Browse Source

Merge branch 'develop'

master
Guillaume Bourgeois 2 months ago
parent
commit
6b9a5081b2
2 changed files with 8 additions and 6 deletions
  1. +2
    -2
      common/components/Tiller/TillerClientV2.php
  2. +6
    -4
      domain/Producer/Producer/DolibarrProducerUtils.php

+ 2
- 2
common/components/Tiller/TillerClientV2.php View File

'restaurant_token' => $this->restaurantToken, 'restaurant_token' => $this->restaurantToken,
], $params); ], $params);


\Yii::$app->mailerService->sendAdmin('Log post order SumUp', 'contact', [
/*\Yii::$app->mailerService->sendAdmin('Log post order SumUp', 'contact', [
'name' => 'Souke', 'name' => 'Souke',
'email' => 'contact@souke.fr', 'email' => 'contact@souke.fr',
'content' => json_encode($params) 'content' => json_encode($params)
]);
]);*/


return $this->curl->setPostParams($params)->post($this->urlApi . 'orders'); return $this->curl->setPostParams($params)->post($this->urlApi . 'orders');
} }

+ 6
- 4
domain/Producer/Producer/DolibarrProducerUtils.php View File

$this->producerRepository = $this->loadService(ProducerRepository::class); $this->producerRepository = $this->loadService(ProducerRepository::class);
} }


public function getDolibarrProducerInvoices(Producer $producer): array
public function getDolibarrProducerInvoices(Producer $producer)
{ {
$invoicesArray = []; $invoicesArray = [];
if($producer->dolibarr_socid) { if($producer->dolibarr_socid) {
$unpaidInvoicesArray = []; $unpaidInvoicesArray = [];
$invoicesArray = $this->getDolibarrProducerInvoices($producer); $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;
}
} }
} }



Loading…
Cancel
Save