diff --git a/app/Factory/InvoiceItemFactory.php b/app/Factory/InvoiceItemFactory.php index ed7a9c681dfb..6fee332a41ba 100644 --- a/app/Factory/InvoiceItemFactory.php +++ b/app/Factory/InvoiceItemFactory.php @@ -59,7 +59,7 @@ class InvoiceItemFactory $item->quantity = $faker->numberBetween(1,10); $item->cost = $faker->randomFloat(2, 1, 1000); $item->line_total = $item->quantity * $item->cost; - $item->is_amount_discount = $faker->boolean(); + $item->is_amount_discount = false; $item->discount = $faker->numberBetween(1,10); $item->notes = $faker->realText(20); $item->product_key = $faker->word(); diff --git a/app/Helpers/Invoice/Discounter.php b/app/Helpers/Invoice/Discounter.php new file mode 100644 index 000000000000..8110b3bdc12b --- /dev/null +++ b/app/Helpers/Invoice/Discounter.php @@ -0,0 +1,31 @@ +invoice = $invoice; + $this->settings = $settings; - + $this->tax_map = new Collection; } @@ -104,19 +111,12 @@ class InvoiceCalc */ private function calcDiscount() { - if ($this->invoice->discount != 0) { - if ($this->invoice->is_amount_discount) { + $this->setTotalDiscount($this->discount($this->getSubTotal(), $this->invoice->discount, $this->invoice->is_amount_discount)); - $this->total -= $this->invoice->discount; + $this->setTotal( $this->getTotal() - $this->getTotalDiscount() ); - } else { - - $this->total -= round($this->total * ($this->invoice->discount / 100), 2); - - } - - } + /* Reduce all taxes */ return $this; } @@ -132,9 +132,9 @@ class InvoiceCalc if(isset($this->invoice->id) && $this->invoice->id >= 1) { - $this->balance = round($this->total - ($this->invoice->amount - $this->invoice->balance), 2); + $this->balance = round($this->getTotal() - ($this->invoice->amount - $this->invoice->balance), 2); } else { - $this->balance = $this->total; + $this->balance = $this->getTotal(); } return $this; @@ -151,23 +151,26 @@ class InvoiceCalc { // custom fields charged taxes - if (isset($this->invoice->custom_value1) && isset($this->settings->custom_invoice_taxes1)) { - $this->total += $this->invoice->custom_value1; + if (isset($this->invoice->custom_value1) && property_exists($this->settings, 'custom_invoice_taxes1') && $this->settings->custom_invoice_taxes1 === true ) { + $this->setTotal($this->getTotal() + $this->invoice->custom_value1); } - if (isset($this->invoice->custom_value2) && isset($this->settings->custom_invoice_taxes2)) { - $this->total += $this->invoice->custom_value2; + if (isset($this->invoice->custom_value2) && property_exists($this->settings, 'custom_invoice_taxes1') && $this->settings->custom_invoice_taxes2 === true) { + $this->setTotal($this->getTotal() + $this->invoice->custom_value2); } + // \Log::error("pre calc taxes = ".$this->getTotal()); $this->calcTaxes(); // custom fields not charged taxes - if (isset($this->invoice->custom_value1) && ! $this->settings->custom_invoice_taxes1) { - $this->total += $this->invoice->custom_value1; + if (isset($this->invoice->custom_value1) && property_exists($this->settings, 'custom_invoice_taxes1') && $this->settings->custom_invoice_taxes1 !== true) { + $this->setTotal($this->getTotal() + $this->invoice->custom_value1); } - if (isset($this->invoice->custom_value2) && ! $this->settings->custom_invoice_taxes2) { - $this->total += $this->invoice->custom_value2; + + if (isset($this->invoice->custom_value2) && property_exists($this->settings, 'custom_invoice_taxes1') && $this->settings->custom_invoice_taxes2 !== true) { + $this->setTotal($this->getTotal() + $this->invoice->custom_value2); } + return $this; } @@ -178,10 +181,33 @@ class InvoiceCalc { if (property_exists($this->settings, 'inclusive_taxes') && ! $this->settings->inclusive_taxes) { - $taxAmount1 = round($this->total * ($this->invoice->tax_rate1 ? $this->invoice->tax_rate1 : 0) / 100, 2); - $taxAmount2 = round($this->total * ($this->invoice->tax_rate2 ? $this->invoice->tax_rate2 : 0) / 100, 2); - $this->total_taxes = round($taxAmount1 + $taxAmount2, 2) + $this->total_item_taxes; - $this->total += $this->total_taxes; + + $taxAmount1 = round($this->getSubTotal() * (($this->invoice->tax_rate1 ? $this->invoice->tax_rate1 : 0) / 100), 2); + $taxAmount1 -= $this->discount($taxAmount1, $this->invoice->discount, $this->invoice->is_amount_discount); + + $tmp_array = []; + + if($taxAmount1 > 0) + $tmp_array[] = ['name' => $this->invoice->tax_name1 . ' ' . $this->invoice->tax_rate1.'%', 'total' => $taxAmount1]; + + $taxAmount2 = round($this->getSubTotal() * (($this->invoice->tax_rate2 ? $this->invoice->tax_rate2 : 0) / 100), 2); + $taxAmount2 -= $this->discount($taxAmount2, $this->invoice->discount, $this->invoice->is_amount_discount); + + if($taxAmount2 > 0) + $tmp_array[] = ['name' => $this->invoice->tax_name2 . ' ' . $this->invoice->tax_rate2.'%', 'total' => $taxAmount2]; + + $taxAmount3 = round($this->getSubTotal() * (($this->invoice->tax_rate3 ? $this->invoice->tax_rate3 : 0) / 100), 2); + $taxAmount3 -= $this->discount($taxAmount3, $this->invoice->discount, $this->invoice->is_amount_discount); + + if($taxAmount3 > 0) + $tmp_array[] = ['name' => $this->invoice->tax_name3 . ' ' . $this->invoice->tax_rate3.'%', 'total' => $taxAmount3]; + + + $this->setTotalTaxMap($tmp_array); + + $this->setItemTotalTaxes($this->getItemTotalTaxes() + $taxAmount1 + $taxAmount2 + $taxAmount3); + + $this->setTotal($this->getTotal() + $this->getItemTotalTaxes()); } return $this; @@ -205,7 +231,6 @@ class InvoiceCalc $item_calc = new InvoiceItemCalc($item, $this->settings, $this->invoice); $item_calc->process(); - $new_line_items[] = $item_calc->getLineItem(); //set collection of itemised taxes @@ -214,13 +239,15 @@ class InvoiceCalc //set running total of taxes $this->total_item_taxes += $item_calc->getTotalTaxes(); - //set running total of discounts - $this->total_discount += $item_calc->getTotalDiscounts(); + $this->setItemTotalTaxes($this->getItemTotalTaxes() + ($item_calc->getTotalTaxes() - $this->discount($item_calc->getTotalTaxes(), $this->invoice->discount, $this->invoice->is_amount_discount))); + + //set running total of item discounts + $this->item_discount += $item_calc->getTotalDiscounts(); //set running subtotal - $this->sub_total += $item_calc->getLineTotal(); + $this->setSubTotal($this->getSubTotal() + $item_calc->getLineTotal()); - $this->total += $item_calc->getLineTotal(); + $this->setTotal($this->getTotal() + $item_calc->getLineTotal()); } @@ -246,6 +273,18 @@ class InvoiceCalc return $this; } + public function getTotalTaxMap() + { + return $this->total_tax_map; + } + + public function setTotalTaxMap($value) + { + $this->total_tax_map = $value; + + return $this; + } + /** * Sums and reduces the line item taxes * @@ -270,7 +309,7 @@ class InvoiceCalc $total_line_tax = $values->filter(function ($value, $k) use($key){ return $value['key'] == $key; })->sum('total'); - + $tax_array[] = ['name' => $tax_name, 'total' => $total_line_tax]; } @@ -280,6 +319,14 @@ class InvoiceCalc } + private function adjustTaxesWithDiscount($line_taxes) + {\Log::error($line_taxes); + return $line_taxes->transform(function($line_tax){ + \Log::error($line_tax['tax_name'] . " " . $line_tax['total']. " ". $this->discount($line_tax['total'], $this->invoice->discount, $this->invoice->is_amount_discount)); + return $line_tax['total'] -= $this->discount($line_tax['total'], $this->invoice->discount, $this->invoice->is_amount_discount); + }); + } + public function setTaxMap($value) { $htis->tax_map = $value; @@ -299,12 +346,12 @@ class InvoiceCalc return $this; } - public function getTotalTaxes() + public function getItemTotalTaxes() { return $this->total_taxes; } - public function setTotalTaxes($value) + public function setItemTotalTaxes($value) { $this->total_taxes = $value; @@ -323,7 +370,11 @@ class InvoiceCalc public function setTotal($value) { + \Log::error($this->total . " sets to " . $value); + $this->total = $value; + + return $this; } public function getBalance() @@ -334,6 +385,8 @@ class InvoiceCalc public function setBalance($value) { $this->balance = $value; + + return $this; } public function getInvoice() diff --git a/app/Helpers/Invoice/InvoiceItemCalc.php b/app/Helpers/Invoice/InvoiceItemCalc.php index 02fe7c0afa15..3a6757273bb6 100644 --- a/app/Helpers/Invoice/InvoiceItemCalc.php +++ b/app/Helpers/Invoice/InvoiceItemCalc.php @@ -45,15 +45,17 @@ class InvoiceItemCalc $this->tax_collection = collect([]); $this->invoice = $invoice; + + $this->currency = $invoice->client->currency(); } public function process() { - $this->line_total = $this->formatValue($this->item->cost, $this->invoice->client->currency()->precision) * $this->formatValue($this->item->quantity, $this->invoice->client->currency()->precision); + $this->setLineTotal($this->formatValue($this->item->cost, $this->currency->precision) * $this->formatValue($this->item->quantity, $this->currency->precision)); $this->setDiscount() - ->calcTaxes(); + ->calcTaxes(); } @@ -65,22 +67,19 @@ class InvoiceItemCalc if($this->item->is_amount_discount) { - $discount = $this->formatValue($this->item->discount, $this->invoice->client->currency()->precision); - - $this->line_total -= $discount; - - $this->total_discounts += $discount; + $discountedTotal = $this->getLineTotal() - $this->formatValue($this->item->discount, $this->currency->precision); } else - { - $discount = $this->formatValue(($this->line_total * $this->item->discount / 100), $this->invoice->client->currency()->precision); - - $this->line_total -= $discount; - - $this->total_discounts += $discount; - + { + $discountedTotal = $this->getLineTotal() - $this->formatValue(round($this->getLineTotal() * ($this->item->discount / 100),2), $this->currency->precision); } + $this->setLineTotal($discountedTotal); + + $totalDiscount = $this->getTotalDiscounts() + $discountedTotal; + + $this->setTotalDiscounts($totalDiscount); + return $this; } @@ -91,12 +90,12 @@ class InvoiceItemCalc if(isset($this->item->tax_rate1) && $this->item->tax_rate1 > 0) { - $tax_rate1 = $this->formatValue($this->item->tax_rate1, $this->invoice->client->currency()->precision); + $tax_rate1 = $this->formatValue($this->item->tax_rate1, $this->currency->precision); if($this->settings->inclusive_taxes) - $item_tax_rate1_total = $this->formatValue(($this->line_total - ($this->line_total / (1+$tax_rate1/100))) , $this->invoice->client->currency()->precision); + $item_tax_rate1_total = $this->formatValue(($this->getLineTotal() - ($this->getLineTotal() / (1+$tax_rate1/100))) , $this->currency->precision); else - $item_tax_rate1_total = $this->formatValue(($this->line_total * $tax_rate1/100), $this->invoice->client->currency()->precision); + $item_tax_rate1_total = $this->formatValue(($this->getLineTotal() * $tax_rate1/100), $this->currency->precision); $item_tax += $item_tax_rate1_total; @@ -105,12 +104,12 @@ class InvoiceItemCalc if(isset($this->item->tax_rate2) && $this->item->tax_rate2 > 0) { - $tax_rate2 = $this->formatValue($this->item->tax_rate2, $this->invoice->client->currency()->precision); + $tax_rate2 = $this->formatValue($this->item->tax_rate2, $this->currency->precision); if($this->settings->inclusive_taxes) - $item_tax_rate2_total = $this->formatValue(($this->line_total - ($this->line_total / (1+$tax_rate2/100))) , $this->invoice->client->currency()->precision); + $item_tax_rate2_total = $this->formatValue(($this->getLineTotal() - ($this->getLineTotal() / (1+$tax_rate2/100))) , $this->currency->precision); else - $item_tax_rate2_total = $this->formatValue(($this->line_total * $tax_rate2/100), $this->invoice->client->currency()->precision); + $item_tax_rate2_total = $this->formatValue(($this->getLineTotal() * $tax_rate2/100), $this->currency->precision); $item_tax += $item_tax_rate2_total; @@ -120,6 +119,8 @@ class InvoiceItemCalc } $this->setTotalTaxes($item_tax); + + return $this; } private function groupTax($tax_name, $tax_rate, $tax_total) @@ -149,12 +150,12 @@ class InvoiceItemCalc public function getLineTotal() { - return $this->line_total; + return $this->item->line_total; } public function setLineTotal($total) { - $this->line_total = $total; + $this->item->line_total = $total; return $this; } diff --git a/app/Http/Controllers/OpenAPI/ClientSchema.php b/app/Http/Controllers/OpenAPI/ClientSchema.php index da4f5fa051ad..ff3fb6d1862e 100644 --- a/app/Http/Controllers/OpenAPI/ClientSchema.php +++ b/app/Http/Controllers/OpenAPI/ClientSchema.php @@ -39,12 +39,12 @@ * @OA\Property(property="shipping_state", type="string", example="", description="________"), * @OA\Property(property="shipping_postal_code", type="string", example="", description="________"), * @OA\Property(property="shipping_country_id", type="string", example="", description="________"), - * @OA\Property(property="settings", type="object", example="", description="________"), * @OA\Property(property="is_deleted", type="boolean", example=true, description="________"), * @OA\Property(property="balance", type="number", format="float", example="10.00", description="________"), * @OA\Property(property="paid_to_date", type="number", format="float", example="10.00", description="________"), * @OA\Property(property="last_login", type="number", format="integer", example="134341234234", description="Timestamp"), * @OA\Property(property="created_at", type="number", format="integer", example="134341234234", description="Timestamp"), * @OA\Property(property="updated_at", type="number", format="integer", example="134341234234", description="Timestamp"), + * @OA\Property(property="settings",ref="#/components/schemas/CompanySettings"), * ) */ \ No newline at end of file diff --git a/app/Http/Controllers/OpenAPI/CompanySchema.php b/app/Http/Controllers/OpenAPI/CompanySchema.php index 6012e90d2cc4..1fd03a7b4bfb 100644 --- a/app/Http/Controllers/OpenAPI/CompanySchema.php +++ b/app/Http/Controllers/OpenAPI/CompanySchema.php @@ -6,5 +6,6 @@ * @OA\Property(property="id", type="string", example="WJxbojagwO", description="The company hash id"), * @OA\Property(property="name", type="string", example="The local shop", description="The company name"), * @OA\Property(property="logo", type="object", example="logo.png", description="The company logo - binary"), + * @OA\Property(property="settings",ref="#/components/schemas/CompanySettings"), * ) */ \ No newline at end of file diff --git a/app/Http/Controllers/OpenAPI/CompanySettingsSchema.php b/app/Http/Controllers/OpenAPI/CompanySettingsSchema.php index a8093284ce7d..24b2d93e1d4f 100644 --- a/app/Http/Controllers/OpenAPI/CompanySettingsSchema.php +++ b/app/Http/Controllers/OpenAPI/CompanySettingsSchema.php @@ -30,7 +30,7 @@ * @OA\Property(property="show_tasks_in_portal", type="boolean", example=true, description="____________"), * @OA\Property(property="show_currency_code", type="boolean", example=true, description="____________"), * @OA\Property(property="shared_invoice_quote_counter", type="boolean", example=true, description="Flags whether to share the counter for invoices and quotes"), - * @OA\Property(property="start_of_week", type="integer", example="1", description="____________"), + * @OA\Property(property="first_day_of_week", type="integer", example="1", description="____________"), * @OA\Property(property="invoice_number_prefix", type="string", example="R", description="This string is prepended to the invoice number"), * @OA\Property(property="invoice_number_pattern", type="string", example="{$year}-{$counter}", description="Allows customisation of the invoice number pattern"), * @OA\Property(property="invoice_number_counter", type="integer", example="1", description="____________"), diff --git a/app/Http/Controllers/OpenAPI/InvoiceSchema.php b/app/Http/Controllers/OpenAPI/InvoiceSchema.php index 698aa5ceb23e..9f5da93e85f7 100644 --- a/app/Http/Controllers/OpenAPI/InvoiceSchema.php +++ b/app/Http/Controllers/OpenAPI/InvoiceSchema.php @@ -26,7 +26,6 @@ * @OA\Property(property="tax_name3", type="string", example="", description="________"), * @OA\Property(property="tax_rate3", type="number", format="float", example="10.00", description="_________"), * @OA\Property(property="line_items", type="object", example="", description="_________"), - * @OA\Property(property="settings", type="object", example="", description="_________"), * @OA\Property(property="amount", type="number", format="float", example="10.00", description="_________"), * @OA\Property(property="balance", type="number", format="float", example="10.00", description="_________"), * @OA\Property(property="discount", type="number", format="float", example="10.00", description="_________"), @@ -36,6 +35,7 @@ * @OA\Property(property="invoice_date", type="string", format="date", example="1994-07-30", description="_________"), * @OA\Property(property="partial_due_date", type="string", format="date", example="1994-07-30", description="_________"), * @OA\Property(property="due_date", type="string", format="date", example="1994-07-30", description="_________"), + * @OA\Property(property="settings",ref="#/components/schemas/CompanySettings"), * @OA\Property(property="last_viewed", type="number", format="integer", example="1434342123", description="Timestamp"), * @OA\Property(property="updated_at", type="number", format="integer", example="1434342123", description="Timestamp"), * @OA\Property(property="archived_at", type="number", format="integer", example="1434342123", description="Timestamp"), diff --git a/app/Http/Controllers/OpenAPI/swagger-v3.php b/app/Http/Controllers/OpenAPI/swagger-v3.php index 4f43c44e6a13..37be0741a977 100644 --- a/app/Http/Controllers/OpenAPI/swagger-v3.php +++ b/app/Http/Controllers/OpenAPI/swagger-v3.php @@ -2,7 +2,7 @@ /** * @OA\OpenApi( * @OA\Info( - * version="1.0.27", + * version="1.0.30", * title="Invoice Ninja", * description="Invoice Ninja. Open Source Invoicing lives here. ", * termsOfService="http://swagger.io/terms/", @@ -16,7 +16,7 @@ * ), * @OA\Server( * description="InvoiceNinja host", - * url="https://virtserver.swaggerhub.com/InvoiceNinja/invoices/1.0.27" + * url="https://virtserver.swaggerhub.com/InvoiceNinja/invoices/1.0.30" * ), * @OA\ExternalDocumentation( * description="http://docs.invoiceninja.com", diff --git a/app/Transformers/CompanyGatewayTransformer.php b/app/Transformers/CompanyGatewayTransformer.php index 80227b7b4898..104a61530e66 100644 --- a/app/Transformers/CompanyGatewayTransformer.php +++ b/app/Transformers/CompanyGatewayTransformer.php @@ -57,8 +57,10 @@ class CompanyGatewayTransformer extends EntityTransformer 'fee_percent' => (float)$company_gateway->fee_percent ?: '', 'fee_tax_name1' => (string)$company_gateway->fee_tax_name1 ?: '', 'fee_tax_name2' => (string) $company_gateway->fee_tax_name2 ?: '', + 'fee_tax_name3' => (string) $company_gateway->fee_tax_name3 ?: '', 'fee_tax_rate1' => (float) $company_gateway->fee_tax_rate1, 'fee_tax_rate2' => (float)$company_gateway->fee_tax_rate2, + 'fee_tax_rate3' => (float)$company_gateway->fee_tax_rate3, 'fee_cap' => (float)$company_gateway->fee_cap, 'adjust_fee_percent' => (bool)$company_gateway->adjust_fee_percent, 'updated_at' => $company_gateway->updated_at, diff --git a/app/Transformers/InvoiceTransformer.php b/app/Transformers/InvoiceTransformer.php index 7b4c1c8df9cc..8b84be7ca060 100644 --- a/app/Transformers/InvoiceTransformer.php +++ b/app/Transformers/InvoiceTransformer.php @@ -115,8 +115,10 @@ class InvoiceTransformer extends EntityTransformer 'custom_value4' => (string) $invoice->custom_value4 ?: '', 'has_tasks' => (bool) $invoice->has_tasks, 'has_expenses' => (bool) $invoice->has_expenses, - 'custom_text_value1' => $invoice->custom_text_value1 ?: '', - 'custom_text_value2' => $invoice->custom_text_value2 ?: '', + 'custom_surcharge1' => $invoice->custom_surcharge1 ?: '', + 'custom_surcharge2' => $invoice->custom_surcharge2 ?: '', + 'custom_surcharge3' => $invoice->custom_surcharge3 ?: '', + 'custom_surcharge4' => $invoice->custom_surcharge4 ?: '', 'line_items' => $invoice->line_items ?: '', 'backup' => $invoice->backup ?: '', 'settings' => $invoice->settings ?: '', diff --git a/app/Utils/Traits/MakesInvoiceValues.php b/app/Utils/Traits/MakesInvoiceValues.php index f068f4c6f65e..24055a6038c0 100644 --- a/app/Utils/Traits/MakesInvoiceValues.php +++ b/app/Utils/Traits/MakesInvoiceValues.php @@ -166,6 +166,7 @@ trait MakesInvoiceValues $data['$invoice_number'] = $this->invoice_number; $data['$po_number'] = $this->po_number; $data['$line_taxes'] = $this->makeLineTaxes(); + $data['$total_taxes'] = $this->makeTotalTaxes(); // $data['$tax'] = ; // $data['$item'] = ; // $data['$description'] = ; @@ -179,7 +180,7 @@ trait MakesInvoiceValues $data['$partial_due'] = Number::formatMoney($this->partial, $this->client); $data['$total'] = Number::formatMoney($this->calc()->getTotal(), $this->client); $data['$balance'] = Number::formatMoney($this->calc()->getBalance(), $this->client); - $data['$taxes'] = Number::formatMoney($this->calc()->getTotalTaxes(), $this->client); + $data['$taxes'] = Number::formatMoney($this->calc()->getItemTotalTaxes(), $this->client); $data['$terms'] = $this->terms; // $data['$your_invoice'] = ; // $data['$quote'] = ; @@ -414,4 +415,27 @@ trait MakesInvoiceValues return $data; } + + /** + * @return string a collectino of with + * itemised total tax data + */ + + private function makeTotalTaxes() :string + { + + $total_tax_map = $this->calc()->getTotalTaxMap(); + + $data = ''; + + foreach($total_tax_map as $tax) + { + $data .= ''; + $data .= ''. $tax['name'] .''; + $data .= ''. Number::formatMoney($tax['total'], $this->client) .''; + } + + return $data; + + } } \ No newline at end of file diff --git a/config/ninja.php b/config/ninja.php index 5e7d98894ca5..811bbf174cee 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -48,7 +48,7 @@ return [ 'map_zoom' => env('DEFAULT_MAP_ZOOM', 10), 'payment_terms' => env('DEFAULT_PAYMENT_TERMS', 1), 'military_time' => env('MILITARY_TIME', 0), - 'start_of_week' => env('START_OF_WEEK',1), + 'first_day_of_week' => env('FIRST_DATE_OF_WEEK',0), 'financial_year_start' => env('FINANCIAL_YEAR_START', '2000-01-01') ], diff --git a/database/factories/InvoiceFactory.php b/database/factories/InvoiceFactory.php index 25506e619349..5dc66d2d1367 100644 --- a/database/factories/InvoiceFactory.php +++ b/database/factories/InvoiceFactory.php @@ -10,17 +10,17 @@ $factory->define(App\Models\Invoice::class, function (Faker $faker) { 'status_id' => App\Models\Invoice::STATUS_SENT, 'invoice_number' => $faker->ean13(), 'discount' => $faker->numberBetween(1,10), - 'is_amount_discount' => $faker->boolean(), + 'is_amount_discount' => false, 'tax_name1' => 'GST', 'tax_rate1' => 10, 'tax_name2' => 'VAT', 'tax_rate2' => 17.5, - 'tax_name3' => 'THIRDTAX', - 'tax_rate3' => 5, - 'custom_value1' => $faker->numberBetween(1,4), - 'custom_value2' => $faker->numberBetween(1,4), - 'custom_value3' => $faker->numberBetween(1,4), - 'custom_value4' => $faker->numberBetween(1,4), + //'tax_name3' => 'THIRDTAX', + //'tax_rate3' => 5, + // 'custom_value1' => $faker->numberBetween(1,4), + // 'custom_value2' => $faker->numberBetween(1,4), + // 'custom_value3' => $faker->numberBetween(1,4), + // 'custom_value4' => $faker->numberBetween(1,4), 'is_deleted' => false, 'po_number' => $faker->text(10), 'invoice_date' => $faker->date(), diff --git a/database/migrations/2014_10_13_000000_create_users_table.php b/database/migrations/2014_10_13_000000_create_users_table.php index c9ec9ca87ed6..9902cede08d9 100644 --- a/database/migrations/2014_10_13_000000_create_users_table.php +++ b/database/migrations/2014_10_13_000000_create_users_table.php @@ -147,7 +147,7 @@ class CreateUsersTable extends Migration // $table->string('vat_number')->nullable(); // $table->string('id_number')->nullable(); $table->unsignedInteger('size_id')->nullable(); - $table->string('start_of_week')->nullable(); + $table->string('first_day_of_week')->nullable(); $table->string('financial_year_start')->nullable(); $table->smallInteger('enable_modules')->default(0); $table->text('custom_fields'); @@ -415,7 +415,6 @@ class CreateUsersTable extends Migration $t->text('private_notes')->nullable(); $t->text('terms')->nullable(); - $t->string('tax_name1')->nullable(); $t->decimal('tax_rate1', 13, 3)->default(0); @@ -425,12 +424,16 @@ class CreateUsersTable extends Migration $t->string('tax_name3')->nullable(); $t->decimal('tax_rate3', 13, 3)->default(0); - $t->string('custom_value1')->nullable(); $t->string('custom_value2')->nullable(); $t->string('custom_value3')->nullable(); $t->string('custom_value4')->nullable(); + $t->string('custom_surcharge1')->nullable(); + $t->string('custom_surcharge2')->nullable(); + $t->string('custom_surcharge3')->nullable(); + $t->string('custom_surcharge4')->nullable(); + $t->decimal('amount', 13, 2); $t->decimal('balance', 13, 2); $t->decimal('partial', 13, 2)->nullable(); diff --git a/resources/assets/js/vue-i18n-locales.generated.js b/resources/assets/js/vue-i18n-locales.generated.js index 435d89a1a3d3..79b926a2a5ea 100644 --- a/resources/assets/js/vue-i18n-locales.generated.js +++ b/resources/assets/js/vue-i18n-locales.generated.js @@ -1417,7 +1417,7 @@ export default { "failed_remove_payment_method": "Failed to remove the payment method", "gateway_exists": "This gateway already exists", "manual_entry": "Manual entry", - "start_of_week": "First Day of the Week", + "first_day_of_week": "First Day of the Week", "freq_inactive": "Inactive", "freq_daily": "Daily", "freq_weekly": "Weekly", @@ -2084,7 +2084,7 @@ export default { "recipients": "Recipients", "save_as_default": "Save as default", "template": "Template", - "start_of_week_help": "Used by date<\/b> selectors", + "first_day_of_week_help": "Used by date<\/b> selectors", "financial_year_start_help": "Used by date range<\/b> selectors", "reports_help": "Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.", "this_year": "This Year", @@ -4223,7 +4223,7 @@ export default { "failed_remove_payment_method": "Failed to remove the payment method", "gateway_exists": "This gateway already exists", "manual_entry": "Manual entry", - "start_of_week": "First Day of the Week", + "first_day_of_week": "First Day of the Week", "freq_inactive": "Inactive", "freq_daily": "Daily", "freq_weekly": "týdně", @@ -4890,7 +4890,7 @@ export default { "recipients": "Recipients", "save_as_default": "Save as default", "template": "Template", - "start_of_week_help": "Used by date<\/b> selectors", + "first_day_of_week_help": "Used by date<\/b> selectors", "financial_year_start_help": "Used by date range<\/b> selectors", "reports_help": "Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.", "this_year": "This Year", @@ -7025,7 +7025,7 @@ export default { "failed_remove_payment_method": "Det lykkedes ikke at fjerne betalingsmetoden", "gateway_exists": "Denne gateway eksisterer allerede", "manual_entry": "Manuel indtastning", - "start_of_week": "Første dag i ugen", + "first_day_of_week": "Første dag i ugen", "freq_inactive": "Inaktiv", "freq_daily": "Daglig", "freq_weekly": "Ugentlig", @@ -7692,7 +7692,7 @@ export default { "recipients": "Recipients", "save_as_default": "Save as default", "template": "Skabelon", - "start_of_week_help": "Used by date<\/b> selectors", + "first_day_of_week_help": "Used by date<\/b> selectors", "financial_year_start_help": "Used by date range<\/b> selectors", "reports_help": "Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.", "this_year": "This Year", @@ -9831,7 +9831,7 @@ export default { "failed_remove_payment_method": "Zahlungsart entfernen fehlgeschlagen", "gateway_exists": "Dieser Zahlungsanbieter wurde bereits angelegt", "manual_entry": "Manuell hinzufügen", - "start_of_week": "Erster Tag der Woche", + "first_day_of_week": "Erster Tag der Woche", "freq_inactive": "Inaktiv", "freq_daily": "Täglich", "freq_weekly": "Wöchentlich", @@ -10498,7 +10498,7 @@ export default { "recipients": "Empfänger", "save_as_default": "Als Standard speichern", "template": "Vorlage", - "start_of_week_help": "Verwendet von Datums<\/b>selektoren", + "first_day_of_week_help": "Verwendet von Datums<\/b>selektoren", "financial_year_start_help": "Verwendet von Datum-Bereichs<\/b>selektoren", "reports_help": "Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.", "this_year": "Dieses Jahr", @@ -12643,7 +12643,7 @@ export default { "failed_remove_payment_method": "Αποτυχία διαγραφής του τρόπου πληρωμής", "gateway_exists": "Αυτή η πύλη πληρωμών (Gateway) υπάρχει ήδη", "manual_entry": "Χειροκίνητη εισαγωγή", - "start_of_week": "Πρώτη Μέρα της Εβδομάδας", + "first_day_of_week": "Πρώτη Μέρα της Εβδομάδας", "freq_inactive": "Ανενεργό", "freq_daily": "Ημερήσιο", "freq_weekly": "Εβδομάδα", @@ -13310,7 +13310,7 @@ export default { "recipients": "Παραλήπτες", "save_as_default": "Αποθήκευση ως προεπιλογή", "template": "Πρότυπο", - "start_of_week_help": "Χρησιμοποιήθηκε από date<\/b> επιλογείς", + "first_day_of_week_help": "Χρησιμοποιήθηκε από date<\/b> επιλογείς", "financial_year_start_help": "Χρησιμοποιήθηκε από date range<\/b> επιλογείς", "reports_help": "Shift + Click για να γίνει ταξινόμηση με βάση πολλές στήλες, Ctrl + Click για εκκαθάριση της ομαδοποίησης.", "this_year": "Τρέχον Χρόνος", @@ -15494,7 +15494,7 @@ export default { "failed_remove_payment_method": "Failed to remove the payment method", "gateway_exists": "This gateway already exists", "manual_entry": "Manual entry", - "start_of_week": "First Day of the Week", + "first_day_of_week": "First Day of the Week", "freq_inactive": "Inactive", "freq_daily": "Daily", "freq_weekly": "Weekly", @@ -16161,7 +16161,7 @@ export default { "recipients": "Recipients", "save_as_default": "Save as default", "template": "Template", - "start_of_week_help": "Used by date<\/b> selectors", + "first_day_of_week_help": "Used by date<\/b> selectors", "financial_year_start_help": "Used by date range<\/b> selectors", "reports_help": "Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.", "this_year": "This Year", @@ -18521,7 +18521,7 @@ export default { "failed_remove_payment_method": "Failed to remove the payment method", "gateway_exists": "This gateway already exists", "manual_entry": "Manual entry", - "start_of_week": "First Day of the Week", + "first_day_of_week": "First Day of the Week", "freq_inactive": "Inactive", "freq_daily": "Daily", "freq_weekly": "Weekly", @@ -19188,7 +19188,7 @@ export default { "recipients": "Recipients", "save_as_default": "Save as default", "template": "Template", - "start_of_week_help": "Used by date<\/b> selectors", + "first_day_of_week_help": "Used by date<\/b> selectors", "financial_year_start_help": "Used by date range<\/b> selectors", "reports_help": "Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.", "this_year": "This Year", @@ -21320,7 +21320,7 @@ export default { "failed_remove_payment_method": "Failed to remove the payment method", "gateway_exists": "This gateway already exists", "manual_entry": "Manual entry", - "start_of_week": "Primer Día de la Semana", + "first_day_of_week": "Primer Día de la Semana", "freq_inactive": "Inactivo", "freq_daily": "Diario", "freq_weekly": "Weekly", @@ -21987,7 +21987,7 @@ export default { "recipients": "Remitentes", "save_as_default": "Guardar como predeterminado", "template": "Plantilla", - "start_of_week_help": "Usado por los selectores de fecha<\/b>", + "first_day_of_week_help": "Usado por los selectores de fecha<\/b>", "financial_year_start_help": "Usado por los selectores de rango de fecha<\/b>", "reports_help": "Shift + Click para ordenar por múltiples columnas, Ctrl + Click para desactivar la agrupación.", "this_year": "Este Año", @@ -24119,7 +24119,7 @@ export default { "failed_remove_payment_method": "Falló la eliminación del Método de pago", "gateway_exists": "Esta pasarela ya existe", "manual_entry": "Entrada manual", - "start_of_week": "Primer día de la semana", + "first_day_of_week": "Primer día de la semana", "freq_inactive": "Inactivo", "freq_daily": "Diariamente", "freq_weekly": "Semanal", @@ -24786,7 +24786,7 @@ export default { "recipients": "Destinatarios", "save_as_default": "Guardar como Por Defecto", "template": "Plantilla", - "start_of_week_help": "Utilizado por selectores de fecha<\/b>", + "first_day_of_week_help": "Utilizado por selectores de fecha<\/b>", "financial_year_start_help": "Utilizado por selectores de rango de fecha<\/b>", "reports_help": "May + Click para ordenar por múltiples columnas, Ctrl + click para quitar agrupamiento.", "this_year": "Este Año", @@ -26933,7 +26933,7 @@ export default { "failed_remove_payment_method": "Failed to remove the payment method", "gateway_exists": "This gateway already exists", "manual_entry": "Manual entry", - "start_of_week": "First Day of the Week", + "first_day_of_week": "First Day of the Week", "freq_inactive": "Inactive", "freq_daily": "Daily", "freq_weekly": "Weekly", @@ -27600,7 +27600,7 @@ export default { "recipients": "Recipients", "save_as_default": "Save as default", "template": "Template", - "start_of_week_help": "Used by date<\/b> selectors", + "first_day_of_week_help": "Used by date<\/b> selectors", "financial_year_start_help": "Used by date range<\/b> selectors", "reports_help": "Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.", "this_year": "This Year", @@ -29762,7 +29762,7 @@ export default { "failed_remove_payment_method": "La suppression de la méthode de paiement a échoué", "gateway_exists": "La passerelle existe déjà", "manual_entry": "Saisie manuelle", - "start_of_week": "Premier jour de la semaine", + "first_day_of_week": "Premier jour de la semaine", "freq_inactive": "Inactif", "freq_daily": "Quotidien", "freq_weekly": "Hebdomadaire", @@ -30429,7 +30429,7 @@ export default { "recipients": "Destinataires", "save_as_default": "Sauvegarder par défaut", "template": "Modèle", - "start_of_week_help": "Utilisés par des sélecteurs de date<\/b>", + "first_day_of_week_help": "Utilisés par des sélecteurs de date<\/b>", "financial_year_start_help": "Utilisés par des sélecteurs de plages de date<\/b>", "reports_help": "Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.", "this_year": "Cette année", @@ -32591,7 +32591,7 @@ export default { "failed_remove_payment_method": "La suppression de la méthode de paiement a échoué", "gateway_exists": "La passerelle existe déjà", "manual_entry": "Saisie manuelle", - "start_of_week": "Premier jour de la semaine", + "first_day_of_week": "Premier jour de la semaine", "freq_inactive": "Inactif", "freq_daily": "Quotidienne", "freq_weekly": "Hebdomadaire", @@ -33258,7 +33258,7 @@ export default { "recipients": "destinataires", "save_as_default": "Sauvegarder comme défaut", "template": "Modèle", - "start_of_week_help": "Utilisé par les sélecteurs de date<\/b>", + "first_day_of_week_help": "Utilisé par les sélecteurs de date<\/b>", "financial_year_start_help": "Utilisé par les sélecteurs d'écart de date<\/b>", "reports_help": "MAJ + Clic pour filtrer plusieurs colonnes. CRTL + Clic pour annuler le groupement.", "this_year": "Cette année", @@ -35398,7 +35398,7 @@ export default { "failed_remove_payment_method": "Failed to remove the payment method", "gateway_exists": "This gateway already exists", "manual_entry": "Manual entry", - "start_of_week": "First Day of the Week", + "first_day_of_week": "First Day of the Week", "freq_inactive": "Inactive", "freq_daily": "Daily", "freq_weekly": "Weekly", @@ -36065,7 +36065,7 @@ export default { "recipients": "Recipients", "save_as_default": "Save as default", "template": "Template", - "start_of_week_help": "Used by date<\/b> selectors", + "first_day_of_week_help": "Used by date<\/b> selectors", "financial_year_start_help": "Used by date range<\/b> selectors", "reports_help": "Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.", "this_year": "Ova godina", @@ -38197,7 +38197,7 @@ export default { "failed_remove_payment_method": "Failed to remove the payment method", "gateway_exists": "Questo Gateway esiste già", "manual_entry": "Inserimento manuale", - "start_of_week": "Primo giorno della settimana", + "first_day_of_week": "Primo giorno della settimana", "freq_inactive": "Inattivo", "freq_daily": "Daily", "freq_weekly": "Settimanale", @@ -38864,7 +38864,7 @@ export default { "recipients": "Destinatari", "save_as_default": "Salva come predefinito", "template": "Modelli", - "start_of_week_help": "Used by date<\/b> selectors", + "first_day_of_week_help": "Used by date<\/b> selectors", "financial_year_start_help": "Used by date range<\/b> selectors", "reports_help": "Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.", "this_year": "Quest'anno", @@ -40997,7 +40997,7 @@ export default { "failed_remove_payment_method": "Failed to remove the payment method", "gateway_exists": "This gateway already exists", "manual_entry": "Manual entry", - "start_of_week": "First Day of the Week", + "first_day_of_week": "First Day of the Week", "freq_inactive": "Inactive", "freq_daily": "Daily", "freq_weekly": "Weekly", @@ -41664,7 +41664,7 @@ export default { "recipients": "Recipients", "save_as_default": "Save as default", "template": "Template", - "start_of_week_help": "Used by date<\/b> selectors", + "first_day_of_week_help": "Used by date<\/b> selectors", "financial_year_start_help": "Used by date range<\/b> selectors", "reports_help": "Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.", "this_year": "This Year", @@ -43794,7 +43794,7 @@ export default { "failed_remove_payment_method": "Failed to remove the payment method", "gateway_exists": "Ši mokėjimo sąsaja jau yra", "manual_entry": "Įrašyti rankiniu būdu", - "start_of_week": "First Day of the Week", + "first_day_of_week": "First Day of the Week", "freq_inactive": "Inactive", "freq_daily": "Daily", "freq_weekly": "Weekly", @@ -44461,7 +44461,7 @@ export default { "recipients": "Recipients", "save_as_default": "Save as default", "template": "Template", - "start_of_week_help": "Used by date<\/b> selectors", + "first_day_of_week_help": "Used by date<\/b> selectors", "financial_year_start_help": "Used by date range<\/b> selectors", "reports_help": "Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.", "this_year": "This Year", @@ -46633,7 +46633,7 @@ export default { "failed_remove_payment_method": "Неуспешно отстранување на начинот на плаќање", "gateway_exists": "Овој платен портал веќе постои", "manual_entry": "Рачен влез", - "start_of_week": "Прв ден од неделата", + "first_day_of_week": "Прв ден од неделата", "freq_inactive": "Неактивно", "freq_daily": "Дневно", "freq_weekly": "Неделно", @@ -47300,7 +47300,7 @@ export default { "recipients": "Приматели", "save_as_default": "Зачувај како стандард", "template": "Шаблон", - "start_of_week_help": "Користено по датуми <\/b> селектори", + "first_day_of_week_help": "Користено по датуми <\/b> селектори", "financial_year_start_help": "Користено по опсег на датуми <\/b> селектори", "reports_help": "Shift + клик за распределување по повеќе колони, Ctrl + клик за чистење на групирањето.", "this_year": "Оваа година", @@ -49424,7 +49424,7 @@ export default { "failed_remove_payment_method": "Klarte ikke å fjerne betalingsmåte", "gateway_exists": "This gateway already exists", "manual_entry": "Manual entry", - "start_of_week": "Første dag i uken", + "first_day_of_week": "Første dag i uken", "freq_inactive": "Inactive", "freq_daily": "Daily", "freq_weekly": "Ukentlig", @@ -50091,7 +50091,7 @@ export default { "recipients": "Mottakere", "save_as_default": "Sett som standard", "template": "Mal", - "start_of_week_help": "Used by date<\/b> selectors", + "first_day_of_week_help": "Used by date<\/b> selectors", "financial_year_start_help": "Used by date range<\/b> selectors", "reports_help": "Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.", "this_year": "Dette Året", @@ -52235,7 +52235,7 @@ export default { "failed_remove_payment_method": "Verwijderen van betalingsmethode mislukt", "gateway_exists": "Deze gateway bestaat reeds", "manual_entry": "Manuele invoer", - "start_of_week": "Eerste dag van de week", + "first_day_of_week": "Eerste dag van de week", "freq_inactive": "Inactief", "freq_daily": "Dagelijks", "freq_weekly": "Wekelijks", @@ -52902,7 +52902,7 @@ export default { "recipients": "Ontvangers", "save_as_default": "Opslaan als standaard", "template": "Sjabloon", - "start_of_week_help": "Gebruikt door datum<\/b> selecties", + "first_day_of_week_help": "Gebruikt door datum<\/b> selecties", "financial_year_start_help": "Gebruikt door datumbereik<\/b> selecties", "reports_help": "Shift + klik om op meerdere kolommen te sorteren, Ctrl + klik om de groepering te wissen.", "this_year": "Dit jaar", @@ -55035,7 +55035,7 @@ export default { "failed_remove_payment_method": "Nie udało się usunąć metody płatności", "gateway_exists": "Ten dostawca płatności już istnieje", "manual_entry": "Ręczny wpis", - "start_of_week": "Pierwszy dzień tygodnia", + "first_day_of_week": "Pierwszy dzień tygodnia", "freq_inactive": "Nieaktywne", "freq_daily": "Codziennie", "freq_weekly": "Co tydzień", @@ -55702,7 +55702,7 @@ export default { "recipients": "Odbiorcy", "save_as_default": "Zapisz jako domyślne", "template": "Szablon", - "start_of_week_help": "Używany przez selektory dat<\/b>", + "first_day_of_week_help": "Używany przez selektory dat<\/b>", "financial_year_start_help": "Używany przez selektory zakresów czasu<\/b>", "reports_help": "Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.", "this_year": "Ten rok", @@ -57835,7 +57835,7 @@ export default { "failed_remove_payment_method": "Falha ao remover o método de pagamento", "gateway_exists": "Esse gateway já existe", "manual_entry": "Entrada manual", - "start_of_week": "Primeiro dia da Semana", + "first_day_of_week": "Primeiro dia da Semana", "freq_inactive": "Inativo", "freq_daily": "Diariamente", "freq_weekly": "Semanalmente", @@ -58502,7 +58502,7 @@ export default { "recipients": "Recipients", "save_as_default": "Save as default", "template": "Template", - "start_of_week_help": "Used by date<\/b> selectors", + "first_day_of_week_help": "Used by date<\/b> selectors", "financial_year_start_help": "Used by date range<\/b> selectors", "reports_help": "Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.", "this_year": "This Year", @@ -60635,7 +60635,7 @@ export default { "failed_remove_payment_method": "Erro ao remover o método de pagamento", "gateway_exists": "Este gateway já existe", "manual_entry": "Introdução manual", - "start_of_week": "Primeiro Dia da Semana", + "first_day_of_week": "Primeiro Dia da Semana", "freq_inactive": "Inactive", "freq_daily": "Daily", "freq_weekly": "Semanal", @@ -61302,7 +61302,7 @@ export default { "recipients": "Destinatários", "save_as_default": "Guardar como padrão", "template": "Template", - "start_of_week_help": "Utilizado pelos selectores date<\/b>", + "first_day_of_week_help": "Utilizado pelos selectores date<\/b>", "financial_year_start_help": "Utilizado pelos selectores interevalo de data>", "reports_help": "Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.", "this_year": "Este ano", @@ -63449,7 +63449,7 @@ export default { "failed_remove_payment_method": "Failed to remove the payment method", "gateway_exists": "This gateway already exists", "manual_entry": "Manual", - "start_of_week": "Prima Zi a Săptamânii", + "first_day_of_week": "Prima Zi a Săptamânii", "freq_inactive": "Inactive", "freq_daily": "Daily", "freq_weekly": "Săptămânal", @@ -64116,7 +64116,7 @@ export default { "recipients": "Recipients", "save_as_default": "Save as default", "template": "Template", - "start_of_week_help": "Used by date<\/b> selectors", + "first_day_of_week_help": "Used by date<\/b> selectors", "financial_year_start_help": "Used by date range<\/b> selectors", "reports_help": "Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.", "this_year": "This Year", @@ -66261,7 +66261,7 @@ export default { "failed_remove_payment_method": "Načina plačila ni bilo mogoče odstraniti.", "gateway_exists": "Prehod že obstaja", "manual_entry": "Ročni vnos", - "start_of_week": "Prvi dan v tednu", + "first_day_of_week": "Prvi dan v tednu", "freq_inactive": "Nedejaven", "freq_daily": "Dnevno", "freq_weekly": "Tedensko", @@ -66928,7 +66928,7 @@ export default { "recipients": "Prejemniki", "save_as_default": "Shrani kot privzeto", "template": "Predloga", - "start_of_week_help": "Uporaba pri izbiri datuma", + "first_day_of_week_help": "Uporaba pri izbiri datuma", "financial_year_start_help": "Uporaba pri izbiri časovnega odbodja", "reports_help": "Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.", "this_year": "To leto", @@ -69071,7 +69071,7 @@ export default { "failed_remove_payment_method": "Ka dështuar largimi i metodës së pagesës", "gateway_exists": "Ky kanal pagese tashmë ekziston", "manual_entry": "Vendos manualisht", - "start_of_week": "First Day of the Week", + "first_day_of_week": "First Day of the Week", "freq_inactive": "Inactive", "freq_daily": "Daily", "freq_weekly": "Javore", @@ -69738,7 +69738,7 @@ export default { "recipients": "Recipients", "save_as_default": "Save as default", "template": "Template", - "start_of_week_help": "Used by date<\/b> selectors", + "first_day_of_week_help": "Used by date<\/b> selectors", "financial_year_start_help": "Used by date range<\/b> selectors", "reports_help": "Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.", "this_year": "This Year", @@ -71880,7 +71880,7 @@ export default { "failed_remove_payment_method": "Misslyckades att ta bort betalningsmetod", "gateway_exists": "Denna gateway finns redan.", "manual_entry": "Manuell", - "start_of_week": "Första veckodagen", + "first_day_of_week": "Första veckodagen", "freq_inactive": "Inaktiv", "freq_daily": "Dagligen", "freq_weekly": "Veckovis", @@ -72547,7 +72547,7 @@ export default { "recipients": "Mottagare", "save_as_default": "Spara som standard", "template": "Mall", - "start_of_week_help": "Använd av datum<\/b> väljare", + "first_day_of_week_help": "Använd av datum<\/b> väljare", "financial_year_start_help": "Används av datum urvals<\/b> valen.", "reports_help": "Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.", "this_year": "Detta året", @@ -74687,7 +74687,7 @@ export default { "failed_remove_payment_method": "ไม่สามารถลบวิธีการชำระเงินได้", "gateway_exists": "เกตเวย์นี้มีอยู่แล้ว", "manual_entry": "ป้อนค่าด้วยตนเอง", - "start_of_week": "วันแรกของสัปดาห์", + "first_day_of_week": "วันแรกของสัปดาห์", "freq_inactive": "ไม่ทำงาน", "freq_daily": "Daily", "freq_weekly": "รายสัปดาห์", @@ -75354,7 +75354,7 @@ export default { "recipients": "ผู้รับ", "save_as_default": "บันทึกเป็นค่าเริ่มต้น", "template": "แบบ", - "start_of_week_help": "ใช้โดย วันที่<\/b>ถูกเลือก", + "first_day_of_week_help": "ใช้โดย วันที่<\/b>ถูกเลือก", "financial_year_start_help": "ใช้โดย ช่วงวันที่<\/b>ถูกเลือก", "reports_help": "Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.", "this_year": "ปีนี้", @@ -77501,7 +77501,7 @@ export default { "failed_remove_payment_method": "Failed to remove the payment method", "gateway_exists": "This gateway already exists", "manual_entry": "Manual entry", - "start_of_week": "First Day of the Week", + "first_day_of_week": "First Day of the Week", "freq_inactive": "Inactive", "freq_daily": "Daily", "freq_weekly": "Weekly", @@ -78168,7 +78168,7 @@ export default { "recipients": "Recipients", "save_as_default": "Save as default", "template": "Template", - "start_of_week_help": "Used by date<\/b> selectors", + "first_day_of_week_help": "Used by date<\/b> selectors", "financial_year_start_help": "Used by date range<\/b> selectors", "reports_help": "Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.", "this_year": "This Year", @@ -80370,7 +80370,7 @@ export default { "failed_remove_payment_method": "未能移除付款方式", "gateway_exists": "閘道已存在", "manual_entry": "手動輸入", - "start_of_week": "每星期的第一天", + "first_day_of_week": "每星期的第一天", "freq_inactive": "停用的", "freq_daily": "每天", "freq_weekly": "每星期", @@ -81037,7 +81037,7 @@ export default { "recipients": "收件匣", "save_as_default": "儲存為預設值", "template": "範本", - "start_of_week_help": "由 日期<\/b>選擇器使用", + "first_day_of_week_help": "由 日期<\/b>選擇器使用", "financial_year_start_help": "由日期範圍<\/b> 選擇器所使用", "reports_help": "Shift + Click 可多欄排序,Ctrl + Click 以取消組合。", "this_year": "今年", diff --git a/resources/views/pdf/design1.blade.php b/resources/views/pdf/design1.blade.php index ad44df5f18a6..efbe791a12b6 100644 --- a/resources/views/pdf/design1.blade.php +++ b/resources/views/pdf/design1.blade.php @@ -114,10 +114,10 @@ $subtotal_label: $subtotal - - $taxes_label: - $taxes - + + {{-- total_taxes html is populated server side, with a class of total_taxes, you can customise your CSS here to override the defaults--}} + + $total_taxes {{-- line_taxes html is populated server side, with a class of line_items, you can customise your CSS here to override the defaults--}} diff --git a/swagger.json b/swagger.json index 2b91922d76bb..55f067de2a89 100644 --- a/swagger.json +++ b/swagger.json @@ -5205,7 +5205,7 @@ "type" : "boolean", "description" : "Toggles 24 hour time" }, - "start_of_week" : { + "first_day_of_week" : { "type" : "integer", "description" : "References the start day of the week", "example" : 1 diff --git a/tests/Browser/ClientPortalTest.php b/tests/Browser/ClientPortalTest.php index c672a7c51386..1ff44867dfbc 100644 --- a/tests/Browser/ClientPortalTest.php +++ b/tests/Browser/ClientPortalTest.php @@ -319,4 +319,4 @@ class ClientPortalTest extends DuskTestCase }); } -} +} \ No newline at end of file diff --git a/tests/Unit/InvoiceTest.php b/tests/Unit/InvoiceTest.php index 83360e25fe0b..1e4a81b4b4b5 100644 --- a/tests/Unit/InvoiceTest.php +++ b/tests/Unit/InvoiceTest.php @@ -126,9 +126,9 @@ class InvoiceTest extends TestCase $this->invoice_calc->build(); $this->assertEquals($this->invoice_calc->getSubTotal(), 20); - $this->assertEquals($this->invoice_calc->getTotal(), 22); - $this->assertEquals($this->invoice_calc->getBalance(), 22); - $this->assertEquals($this->invoice_calc->getTotalTaxes(), 2); + $this->assertEquals($this->invoice_calc->getTotal(), 21.5); + $this->assertEquals($this->invoice_calc->getBalance(), 21.5); + $this->assertEquals($this->invoice_calc->getTotalTaxes(), 1.5); } public function testInvoiceTotalsWithDiscountWithSurchargeWithDoubleExclusiveTax() @@ -147,9 +147,9 @@ class InvoiceTest extends TestCase $this->invoice_calc->build(); $this->assertEquals($this->invoice_calc->getSubTotal(), 20); - $this->assertEquals($this->invoice_calc->getTotal(), 24); - $this->assertEquals($this->invoice_calc->getBalance(), 24); - $this->assertEquals($this->invoice_calc->getTotalTaxes(), 4); + $this->assertEquals($this->invoice_calc->getTotal(), 23); + $this->assertEquals($this->invoice_calc->getBalance(), 23); + $this->assertEquals($this->invoice_calc->getTotalTaxes(), 3); } @@ -185,7 +185,7 @@ class InvoiceTest extends TestCase $this->assertEquals($this->invoice_calc->getSubTotal(), 20); $this->assertEquals($this->invoice_calc->getTotal(), 20); $this->assertEquals($this->invoice_calc->getBalance(), 20); - $this->assertEquals($this->invoice_calc->getTotalTaxes(), 0); + $this->assertEquals($this->invoice_calc->getTotalTaxes(), 1.82); $this->assertEquals(count($this->invoice_calc->getTaxMap()), 1); }