From 7c6a40374d8bd79ca38087e2ede8e5b01c104673 Mon Sep 17 00:00:00 2001 From: raishvaria Date: Sat, 14 Dec 2019 14:42:34 +0530 Subject: [PATCH] fix tax percent & pdf money format issue --- .../js/components/base/modal/TaxTypeModal.vue | 2 +- .../app/pdf/estimate/partials/table.blade.php | 40 +++++++++++++++---- .../app/pdf/invoice/partials/table.blade.php | 35 +++++++++++++--- .../views/app/pdf/reports/expenses.blade.php | 8 +++- .../app/pdf/reports/profit-loss.blade.php | 8 +++- .../app/pdf/reports/sales-customers.blade.php | 16 ++++++-- .../app/pdf/reports/sales-items.blade.php | 16 ++++++-- .../app/pdf/reports/tax-summary.blade.php | 24 ++++++++--- 8 files changed, 116 insertions(+), 33 deletions(-) diff --git a/resources/assets/js/components/base/modal/TaxTypeModal.vue b/resources/assets/js/components/base/modal/TaxTypeModal.vue index 7461cee9..151ba30c 100644 --- a/resources/assets/js/components/base/modal/TaxTypeModal.vue +++ b/resources/assets/js/components/base/modal/TaxTypeModal.vue @@ -124,7 +124,7 @@ export default { }, percent: { required, - between: between(-1, 100) + between: between(0, 100) }, description: { maxLength: maxLength(255) diff --git a/resources/views/app/pdf/estimate/partials/table.blade.php b/resources/views/app/pdf/estimate/partials/table.blade.php index b7ec1471..0278ff56 100644 --- a/resources/views/app/pdf/estimate/partials/table.blade.php +++ b/resources/views/app/pdf/estimate/partials/table.blade.php @@ -18,24 +18,48 @@ @endphp @foreach ($estimate->items as $item) - {{$index}} - - {{ $item->name }}
- {{ $item->description }} + + {{$index}} + + + {{ $item->name }}
+ + {{ $item->description }} + + + + {{$item->quantity}} + + + {!! format_money_pdf($item->price, $estimate->user->currency) !!} - {{$item->quantity}} - {{$item->price/100}} @if($estimate->discount_per_item === 'YES') @if($item->discount_type === 'fixed') - {{$item->discount_val/100}} + {!! format_money_pdf($item->discount_val, $estimate->user->currency) !!} @endif @if($item->discount_type === 'percentage') {{$item->discount}}% @endif @endif - {{$item->total/100}} + + {!! format_money_pdf($item->total, $estimate->user->currency) !!} + @php $index += 1 diff --git a/resources/views/app/pdf/invoice/partials/table.blade.php b/resources/views/app/pdf/invoice/partials/table.blade.php index 0bcc30c2..363bfe29 100644 --- a/resources/views/app/pdf/invoice/partials/table.blade.php +++ b/resources/views/app/pdf/invoice/partials/table.blade.php @@ -18,24 +18,47 @@ @endphp @foreach ($invoice->items as $item) - {{$index}} - + + {{$index}} + + {{ $item->name }}
{{ $item->description }} - {{$item->quantity}} - {{$item->price/100}} + + {{$item->quantity}} + + + {!! format_money_pdf($item->price, $invoice->user->currency) !!} + @if($invoice->discount_per_item === 'YES') @if($item->discount_type === 'fixed') - {{$item->discount_val/100}} + {!! format_money_pdf($item->discount_val, $invoice->user->currency) !!} @endif @if($item->discount_type === 'percentage') {{$item->discount}}% @endif @endif - {{$item->total/100}} + + {!! format_money_pdf($item->total, $invoice->user->currency) !!} + @php $index += 1 diff --git a/resources/views/app/pdf/reports/expenses.blade.php b/resources/views/app/pdf/reports/expenses.blade.php index 6912d765..054bd79f 100644 --- a/resources/views/app/pdf/reports/expenses.blade.php +++ b/resources/views/app/pdf/reports/expenses.blade.php @@ -181,10 +181,14 @@ @foreach ($expenseCategories as $expenseCategory) -

{{ $expenseCategory->category->name }}

+

+ {{ $expenseCategory->category->name }} +

-

{!! format_money_pdf($expenseCategory->total_amount) !!}

+

+ {!! format_money_pdf($expenseCategory->total_amount) !!} +

@endforeach diff --git a/resources/views/app/pdf/reports/profit-loss.blade.php b/resources/views/app/pdf/reports/profit-loss.blade.php index 1c5d89e7..fbcb59c7 100644 --- a/resources/views/app/pdf/reports/profit-loss.blade.php +++ b/resources/views/app/pdf/reports/profit-loss.blade.php @@ -220,10 +220,14 @@ @foreach ($expenseCategories as $expenseCategory) -

{{ $expenseCategory->category->name }}

+

+ {{ $expenseCategory->category->name }} +

-

{!! format_money_pdf($expenseCategory->total_amount) !!}

+

+ {!! format_money_pdf($expenseCategory->total_amount) !!} +

@endforeach diff --git a/resources/views/app/pdf/reports/sales-customers.blade.php b/resources/views/app/pdf/reports/sales-customers.blade.php index dd33385c..d91337e6 100644 --- a/resources/views/app/pdf/reports/sales-customers.blade.php +++ b/resources/views/app/pdf/reports/sales-customers.blade.php @@ -223,10 +223,14 @@ @foreach ($customer->invoices as $invoice) -

{{ $invoice->formattedInvoiceDate }} ({{ $invoice->invoice_number }})

+

+ {{ $invoice->formattedInvoiceDate }} ({{ $invoice->invoice_number }}) +

-

{!! format_money_pdf($invoice->total) !!}

+

+ {!! format_money_pdf($invoice->total) !!} +

@endforeach @@ -235,7 +239,9 @@
-

{!! format_money_pdf($customer->totalAmount) !!}

+

+ {!! format_money_pdf($customer->totalAmount) !!} +

@@ -249,7 +255,9 @@

TOTAL SALES

-

{!! format_money_pdf($totalAmount) !!}

+

+ {!! format_money_pdf($totalAmount) !!} +

diff --git a/resources/views/app/pdf/reports/sales-items.blade.php b/resources/views/app/pdf/reports/sales-items.blade.php index 55619d0a..e939a57c 100644 --- a/resources/views/app/pdf/reports/sales-items.blade.php +++ b/resources/views/app/pdf/reports/sales-items.blade.php @@ -222,10 +222,14 @@
-

{{ $item->name }}

+

+ {{ $item->name }} +

-

{!! format_money_pdf($item->total_amount) !!}

+

+ {!! format_money_pdf($item->total_amount) !!} +

@@ -235,7 +239,9 @@
-

{!! format_money_pdf($totalAmount) !!}

+

+ {!! format_money_pdf($totalAmount) !!} +

@@ -248,7 +254,9 @@

TOTAL SALES

-

{!! format_money_pdf($totalAmount) !!}

+

+ {!! format_money_pdf($totalAmount) !!} +

diff --git a/resources/views/app/pdf/reports/tax-summary.blade.php b/resources/views/app/pdf/reports/tax-summary.blade.php index 8ef69eb6..33931627 100644 --- a/resources/views/app/pdf/reports/tax-summary.blade.php +++ b/resources/views/app/pdf/reports/tax-summary.blade.php @@ -174,10 +174,14 @@ @@ -192,10 +196,14 @@ @foreach ($taxTypes as $tax) @endforeach @@ -207,7 +215,9 @@
-

{{ $company->name }}

+

+ {{ $company->name }} +

-

{{ $from_date }} - {{ $to_date }}

+

+ {{ $from_date }} - {{ $to_date }} +

-

{{ $tax->taxType->name }}

+

+ {{ $tax->taxType->name }} +

-

{!! format_money_pdf($tax->total_tax_amount) !!}

+

+ {!! format_money_pdf($tax->total_tax_amount) !!} +

-

{!! format_money_pdf($totalTaxAmount) !!}

+

+ {!! format_money_pdf($totalTaxAmount) !!} +

@@ -217,7 +227,9 @@

TOTAL TAX

-

{!! format_money_pdf($totalTaxAmount) !!}

+

+ {!! format_money_pdf($totalTaxAmount) !!} +