mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 13:04:30 -04:00
Adjust number applying on Purchase orders when_sent / when_saved
This commit is contained in:
parent
6e5f5da6bb
commit
6faa3a0ccb
@ -923,6 +923,9 @@ class Import implements ShouldQueue
|
|||||||
$modified['company_id'] = $this->company->id;
|
$modified['company_id'] = $this->company->id;
|
||||||
$modified['line_items'] = $this->cleanItems($modified['line_items']);
|
$modified['line_items'] = $this->cleanItems($modified['line_items']);
|
||||||
|
|
||||||
|
if(array_key_exists('next_send_date', $resource))
|
||||||
|
$modified['next_send_date_client'] = $resource['next_send_date'];
|
||||||
|
|
||||||
if(array_key_exists('created_at', $modified))
|
if(array_key_exists('created_at', $modified))
|
||||||
$modified['created_at'] = Carbon::parse($modified['created_at']);
|
$modified['created_at'] = Carbon::parse($modified['created_at']);
|
||||||
|
|
||||||
|
@ -41,7 +41,20 @@ class ApplyNumber extends AbstractService
|
|||||||
return $this->purchase_order;
|
return $this->purchase_order;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->trySaving();
|
switch ($this->vendor->company->getSetting('counter_number_applied')) {
|
||||||
|
case 'when_saved':
|
||||||
|
$this->trySaving();
|
||||||
|
break;
|
||||||
|
case 'when_sent':
|
||||||
|
if ($this->invoice->status_id == PurchaseOrder::STATUS_SENT) {
|
||||||
|
$this->trySaving();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return $this->purchase_order;
|
return $this->purchase_order;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user