mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-07 13:41:23 +00:00
Fix partially paid status appearing after invoice update
This commit is contained in:
@@ -407,13 +407,13 @@ class Invoice extends Model implements HasMedia
|
||||
$data['base_due_amount'] = $data['due_amount'] * $data['exchange_rate'];
|
||||
$data['customer_sequence_number'] = $serial->nextCustomerSequenceNumber;
|
||||
|
||||
$this->update($data);
|
||||
|
||||
$statusData = $this->getInvoiceStatusByAmount($data['due_amount']);
|
||||
if (! empty($statusData)) {
|
||||
$data = array_merge($data, $statusData);
|
||||
$this->update($statusData);
|
||||
}
|
||||
|
||||
$this->update($data);
|
||||
|
||||
$company_currency = CompanySetting::getSetting('currency', $request->header('company'));
|
||||
|
||||
if ((string) $data['currency_id'] !== $company_currency) {
|
||||
@@ -711,6 +711,10 @@ class Invoice extends Model implements HasMedia
|
||||
return [];
|
||||
}
|
||||
|
||||
\Log::error(print_r($amount, true));
|
||||
\Log::error(print_r($this->due_amount, true));
|
||||
\Log::error($this->total);
|
||||
|
||||
if ($amount == 0) {
|
||||
$data = [
|
||||
'status' => Invoice::STATUS_COMPLETED,
|
||||
|
||||
Reference in New Issue
Block a user