updated money
package to 5.0 version
This commit is contained in:
@ -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));
|
||||
|
||||
|
Reference in New Issue
Block a user