|
|
@@ -20,7 +20,7 @@ class DolibarrProducerUtils extends AbstractManager |
|
|
|
$this->producerRepository = $this->loadService(ProducerRepository::class); |
|
|
|
} |
|
|
|
|
|
|
|
public function getDolibarrProducerInvoices(Producer $producer): array |
|
|
|
public function getDolibarrProducerInvoices(Producer $producer) |
|
|
|
{ |
|
|
|
$invoicesArray = []; |
|
|
|
if($producer->dolibarr_socid) { |
|
|
@@ -35,9 +35,11 @@ class DolibarrProducerUtils extends AbstractManager |
|
|
|
$unpaidInvoicesArray = []; |
|
|
|
$invoicesArray = $this->getDolibarrProducerInvoices($producer); |
|
|
|
|
|
|
|
foreach($invoicesArray as $invoice) { |
|
|
|
if(isset($invoice['remaintopay']) && $invoice['remaintopay'] > 0) { |
|
|
|
$unpaidInvoicesArray[] = $invoice; |
|
|
|
if($invoicesArray) { |
|
|
|
foreach ($invoicesArray as $invoice) { |
|
|
|
if (isset($invoice['remaintopay']) && $invoice['remaintopay'] > 0) { |
|
|
|
$unpaidInvoicesArray[] = $invoice; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|