mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-07 13:41:23 +00:00
Setup pint & run code style fix
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
|
||||
namespace InvoiceShelf\Http\Requests;
|
||||
|
||||
use InvoiceShelf\Models\CompanySetting;
|
||||
use InvoiceShelf\Models\Customer;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
use InvoiceShelf\Models\CompanySetting;
|
||||
use InvoiceShelf\Models\Customer;
|
||||
|
||||
class PaymentRequest extends FormRequest
|
||||
{
|
||||
@@ -34,14 +34,14 @@ class PaymentRequest extends FormRequest
|
||||
'required',
|
||||
],
|
||||
'exchange_rate' => [
|
||||
'nullable'
|
||||
'nullable',
|
||||
],
|
||||
'amount' => [
|
||||
'required',
|
||||
],
|
||||
'payment_number' => [
|
||||
'required',
|
||||
Rule::unique('payments')->where('company_id', $this->header('company'))
|
||||
Rule::unique('payments')->where('company_id', $this->header('company')),
|
||||
],
|
||||
'invoice_id' => [
|
||||
'nullable',
|
||||
@@ -68,11 +68,11 @@ class PaymentRequest extends FormRequest
|
||||
$customer = Customer::find($this->customer_id);
|
||||
|
||||
if ($customer && $companyCurrency) {
|
||||
if ((string)$customer->currency_id !== $companyCurrency) {
|
||||
if ((string) $customer->currency_id !== $companyCurrency) {
|
||||
$rules['exchange_rate'] = [
|
||||
'required',
|
||||
];
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return $rules;
|
||||
@@ -91,7 +91,7 @@ class PaymentRequest extends FormRequest
|
||||
'company_id' => $this->header('company'),
|
||||
'exchange_rate' => $exchange_rate,
|
||||
'base_amount' => $this->amount * $exchange_rate,
|
||||
'currency_id' => $currency
|
||||
'currency_id' => $currency,
|
||||
])
|
||||
->toArray();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user