mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-07 13:41:23 +00:00
Adding Flat Tax support with fixed amount (#253)
* Possibility to set a fixed amount on tax types settings * Pint and manage flat taxes on items * Fix display errors and handle global taxes * Tests * Pint with PHP 8.2 cause with PHP 8.3 version it cause workflow error * Merging percent and fixed amount into one column * Now display the currency on SelectTaxPopup on fixed taxes
This commit is contained in:
@@ -28,8 +28,17 @@ class TaxTypeRequest extends FormRequest
|
||||
->where('type', TaxType::TYPE_GENERAL)
|
||||
->where('company_id', $this->header('company')),
|
||||
],
|
||||
'percent' => [
|
||||
'calculation_type' => [
|
||||
'required',
|
||||
Rule::in(['percentage', 'fixed']),
|
||||
],
|
||||
'percent' => [
|
||||
'nullable',
|
||||
'numeric',
|
||||
],
|
||||
'fixed_amount' => [
|
||||
'nullable',
|
||||
'numeric',
|
||||
],
|
||||
'description' => [
|
||||
'nullable',
|
||||
|
||||
@@ -25,6 +25,8 @@ class TaxResource extends JsonResource
|
||||
'name' => $this->name,
|
||||
'amount' => $this->amount,
|
||||
'percent' => $this->percent,
|
||||
'calculation_type' => $this->calculation_type,
|
||||
'fixed_amount' => $this->fixed_amount,
|
||||
'compound_tax' => $this->compound_tax,
|
||||
'base_amount' => $this->base_amount,
|
||||
'currency_id' => $this->currency_id,
|
||||
|
||||
@@ -17,6 +17,8 @@ class TaxTypeResource extends JsonResource
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'percent' => $this->percent,
|
||||
'fixed_amount' => $this->fixed_amount,
|
||||
'calculation_type' => $this->calculation_type,
|
||||
'type' => $this->type,
|
||||
'compound_tax' => $this->compound_tax,
|
||||
'collective_tax' => $this->collective_tax,
|
||||
|
||||
Reference in New Issue
Block a user