mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 19:51:09 -04:00
fix base_due_amount calculation
This commit is contained in:
@ -389,6 +389,7 @@ class Invoice extends Model implements HasMedia
|
||||
}
|
||||
|
||||
$data['due_amount'] = ($this->due_amount + $oldTotal);
|
||||
$data['base_due_amount'] = $data['due_amount'] * $data['exchange_rate'];
|
||||
$data['customer_sequence_number'] = $serial->nextCustomerSequenceNumber;
|
||||
|
||||
$this->changeInvoiceStatus($data['due_amount']);
|
||||
@ -660,6 +661,7 @@ class Invoice extends Model implements HasMedia
|
||||
public function addInvoicePayment($amount)
|
||||
{
|
||||
$this->due_amount += $amount;
|
||||
$this->base_due_amount = $this->due_amount * $this->exchange_rate;
|
||||
|
||||
$this->changeInvoiceStatus($this->due_amount);
|
||||
}
|
||||
@ -667,6 +669,7 @@ class Invoice extends Model implements HasMedia
|
||||
public function subtractInvoicePayment($amount)
|
||||
{
|
||||
$this->due_amount -= $amount;
|
||||
$this->base_due_amount = $this->due_amount * $this->exchange_rate;
|
||||
|
||||
$this->changeInvoiceStatus($this->due_amount);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user