Setup pint & run code style fix

This commit is contained in:
gdarko
2024-01-29 04:46:01 -06:00
parent 8de34efd8c
commit 4ab92473e9
406 changed files with 1616 additions and 2026 deletions

View File

@@ -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();
}