updated money package to 5.0 version

This commit is contained in:
Denis Duliçi
2023-07-10 12:53:43 +03:00
parent 7a589e5bbd
commit 20e5b57562
26 changed files with 1887 additions and 1877 deletions

View File

@ -68,7 +68,7 @@ class UpdateBankingDocumentTransaction extends Job implements ShouldUpdate
$this->request['company_id'] = $this->model->company_id;
$this->request['currency_code'] = $currency_code;
$this->request['paid_at'] = isset($this->request['paid_at']) ? $this->request['paid_at'] : Date::now()->toDateTimeString();
$this->request['currency_rate'] = config('money.' . $currency_code . '.rate');
$this->request['currency_rate'] = config('money.currencies.' . $currency_code . '.rate');
$this->request['account_id'] = isset($this->request['account_id']) ? $this->request['account_id'] : setting('default.account');
$this->request['document_id'] = isset($this->request['document_id']) ? $this->request['document_id'] : $this->model->id;
$this->request['contact_id'] = isset($this->request['contact_id']) ? $this->request['contact_id'] : $this->model->contact_id;
@ -82,7 +82,7 @@ class UpdateBankingDocumentTransaction extends Job implements ShouldUpdate
$code = $this->request['currency_code'];
$rate = $this->request['currency_rate'];
$precision = config('money.' . $code . '.precision');
$precision = config('money.currencies.' . $code . '.precision');
$amount = $this->request['amount'] = round($this->request['amount'], $precision);
@ -92,7 +92,7 @@ class UpdateBankingDocumentTransaction extends Job implements ShouldUpdate
$amount = round($converted_amount, $precision);
}
// if you edit transaction before remove transaction amount
// if you edit transaction before remove transaction amount
$this->model->paid_amount = ($this->model->paid - $this->transaction->amount);
event(new PaidAmountCalculated($this->model));