applied new features of money package
				
					
				
			This commit is contained in:
		@@ -112,7 +112,7 @@ class CreateBankingDocumentTransaction extends Job implements ShouldCreate
 | 
			
		||||
                $error_amount = round($converted_amount, $precision);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            $message = trans('messages.error.over_payment', ['amount' => money($error_amount, $code, true)]);
 | 
			
		||||
            $message = trans('messages.error.over_payment', ['amount' => money($error_amount, $code)]);
 | 
			
		||||
 | 
			
		||||
            throw new \Exception($message);
 | 
			
		||||
        } else {
 | 
			
		||||
@@ -124,7 +124,7 @@ class CreateBankingDocumentTransaction extends Job implements ShouldCreate
 | 
			
		||||
 | 
			
		||||
    protected function createHistory(): void
 | 
			
		||||
    {
 | 
			
		||||
        $history_desc = money((double) $this->transaction->amount, (string) $this->transaction->currency_code, true)->format() . ' ' . trans_choice('general.payments', 1);
 | 
			
		||||
        $history_desc = money((double) $this->transaction->amount, (string) $this->transaction->currency_code)->format() . ' ' . trans_choice('general.payments', 1);
 | 
			
		||||
 | 
			
		||||
        $this->dispatch(new CreateDocumentHistory($this->model, 0, $history_desc));
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -71,7 +71,7 @@ class MatchBankingDocumentTransaction extends Job
 | 
			
		||||
                $error_amount = round($converted_amount, $precision);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            $message = trans('messages.error.over_match', ['type' => ucfirst($this->model->type), 'amount' => money($error_amount, $code, true)]);
 | 
			
		||||
            $message = trans('messages.error.over_match', ['type' => ucfirst($this->model->type), 'amount' => money($error_amount, $code)]);
 | 
			
		||||
 | 
			
		||||
            throw new \Exception($message);
 | 
			
		||||
        } else {
 | 
			
		||||
@@ -83,7 +83,7 @@ class MatchBankingDocumentTransaction extends Job
 | 
			
		||||
 | 
			
		||||
    protected function createHistory(): void
 | 
			
		||||
    {
 | 
			
		||||
        $history_desc = money((double) $this->transaction->amount, (string) $this->transaction->currency_code, true)->format() . ' ' . trans_choice('general.payments', 1);
 | 
			
		||||
        $history_desc = money((double) $this->transaction->amount, (string) $this->transaction->currency_code)->format() . ' ' . trans_choice('general.payments', 1);
 | 
			
		||||
 | 
			
		||||
        $this->dispatch(new CreateDocumentHistory($this->model, 0, $history_desc));
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -65,7 +65,7 @@ class SplitTransaction extends Job implements ShouldUpdate
 | 
			
		||||
 | 
			
		||||
            $message = trans('messages.error.same_amount', [
 | 
			
		||||
                'transaction' => ucfirst(trans_choice('general.' . Str::plural($this->model->type), 1)),
 | 
			
		||||
                'amount' => money($error_amount, $this->model->currency_code, true)
 | 
			
		||||
                'amount' => money($error_amount, $this->model->currency_code)
 | 
			
		||||
            ]);
 | 
			
		||||
 | 
			
		||||
            throw new \Exception($message);
 | 
			
		||||
 
 | 
			
		||||
@@ -112,7 +112,7 @@ class UpdateBankingDocumentTransaction extends Job implements ShouldUpdate
 | 
			
		||||
                $error_amount = round($converted_amount, $precision);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            $message = trans('messages.error.over_payment', ['amount' => money($error_amount, $code, true)]);
 | 
			
		||||
            $message = trans('messages.error.over_payment', ['amount' => money($error_amount, $code)]);
 | 
			
		||||
 | 
			
		||||
            throw new \Exception($message);
 | 
			
		||||
        } else {
 | 
			
		||||
@@ -124,7 +124,7 @@ class UpdateBankingDocumentTransaction extends Job implements ShouldUpdate
 | 
			
		||||
 | 
			
		||||
    protected function createHistory(): void
 | 
			
		||||
    {
 | 
			
		||||
        $history_desc = money((double) $this->transaction->amount, (string) $this->transaction->currency_code, true)->format() . ' ' . trans_choice('general.payments', 1);
 | 
			
		||||
        $history_desc = money((double) $this->transaction->amount, (string) $this->transaction->currency_code)->format() . ' ' . trans_choice('general.payments', 1);
 | 
			
		||||
 | 
			
		||||
        $this->dispatch(new CreateDocumentHistory($this->model, 0, $history_desc));
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user