diff --git a/resources/assets/js/views/estimates/Create.vue b/resources/assets/js/views/estimates/Create.vue index e6443c8a..8ecbfc14 100644 --- a/resources/assets/js/views/estimates/Create.vue +++ b/resources/assets/js/views/estimates/Create.vue @@ -688,7 +688,7 @@ export default { isValid = false } }) - if (this.$v.newEstimate.$invalid === false && isValid === true) { + if (!this.$v.selectedCustomer.$invalid && this.$v.newEstimate.$invalid === false && isValid === true) { return true } return false diff --git a/resources/assets/js/views/invoices/Create.vue b/resources/assets/js/views/invoices/Create.vue index 3b37ab66..abe44796 100644 --- a/resources/assets/js/views/invoices/Create.vue +++ b/resources/assets/js/views/invoices/Create.vue @@ -519,14 +519,6 @@ export default { ...mapActions('item', [ 'fetchItems' ]), - isEmpty (obj) { - for (let key in obj) { - if (obj.hasOwnProperty(key)) { - return false - } - } - return true - }, selectFixed () { if (this.newInvoice.discount_type === 'fixed') { return diff --git a/resources/views/app/pdf/estimate/estimate1.blade.php b/resources/views/app/pdf/estimate/estimate1.blade.php index 59ddc6c6..b89caf3f 100644 --- a/resources/views/app/pdf/estimate/estimate1.blade.php +++ b/resources/views/app/pdf/estimate/estimate1.blade.php @@ -72,6 +72,7 @@ .wrapper { display: block; padding-top: 60px; + padding-bottom: 60px; } .address { @@ -244,6 +245,8 @@ margin-top: 35px; border-bottom: 1px solid #EAF1FB; padding: 0px 30px 0 30px; + page-break-before: avoid; + page-break-after: auto; } .table2 hr { @@ -257,7 +260,7 @@ padding: 5px; } - tr.main-table-header td { + tr.main-table-header th { border-bottom: 1px solid #EAF1FB; font-style: normal; font-weight: normal; @@ -284,28 +287,33 @@ padding-bottom: 8px; } + .padd2 { + padding-top: 2px; + padding-bottom: 2px; + } .table3 { - border: 1px solid #EAF1FB; border-top: none; - padding-right: 30px; box-sizing: border-box; - width: 230px; - height: 100px; - position: absolute; - right: -25; + width: 630px; + page-break-inside: avoid; + page-break-before: auto; + page-break-after: auto; + } - .text-per-item-table3 { - border: 1px solid #EAF1FB; - border-top: none; - padding-right: 30px; - box-sizing: border-box; - width: 260px; - /* height: 100px; */ - position: absolute; - right: -25; + .total-border-left { + border: 1px solid #E8E8E8!important; + border-right: 0px !important; + padding-top: 0px; + padding:8px !important; } + .total-border-right { + border: 1px solid #E8E8E8!important; + border-left: 0px !important; + padding-top: 0px; + padding:8px !important; + } .inv-item { border-color: #d9d9d9; } @@ -322,8 +330,6 @@ margin-top:7px; color:rgba(0, 0, 0, 0.85); } - - diff --git a/resources/views/app/pdf/estimate/estimate2.blade.php b/resources/views/app/pdf/estimate/estimate2.blade.php index 02662065..905f044d 100644 --- a/resources/views/app/pdf/estimate/estimate2.blade.php +++ b/resources/views/app/pdf/estimate/estimate2.blade.php @@ -74,6 +74,7 @@ .wrapper { display: block; padding-top: 110px; + padding-bottom: 60px; } .address { @@ -245,6 +246,8 @@ margin-top: 200px; border-bottom: 1px solid #EAF1FB; padding: 0px 30px 0 30px; + page-break-before: avoid; + page-break-after: auto; } .table2 hr { @@ -258,7 +261,7 @@ padding: 5px; } - tr.main-table-header td { + tr.main-table-header th { border-bottom: 1px solid #EAF1FB; font-style: normal; font-weight: normal; @@ -295,27 +298,21 @@ padding-bottom: 8px; } + .padd2 { + padding-top: 2px; + padding-bottom: 2px; + } + .table3 { border: 1px solid #EAF1FB; border-top: none; - padding-right: 30px; box-sizing: border-box; - width: 230px; - height: 100px; - position: absolute; - right: -25; + width: 630px; + page-break-inside: avoid; + page-break-before: auto; + page-break-after: auto; } - .text-per-item-table3 { - border: 1px solid #EAF1FB; - border-top: none; - padding-right: 30px; - box-sizing: border-box; - width: 260px; - /* height: 100px; */ - position: absolute; - right: -25; - } .inv-item { border-color: #d9d9d9; diff --git a/resources/views/app/pdf/estimate/estimate3.blade.php b/resources/views/app/pdf/estimate/estimate3.blade.php index 69010f3c..f2f02d93 100644 --- a/resources/views/app/pdf/estimate/estimate3.blade.php +++ b/resources/views/app/pdf/estimate/estimate3.blade.php @@ -80,6 +80,7 @@ .wrapper { display: block; padding-top: 110px; + padding-bottom: 60px; } .address { @@ -233,7 +234,7 @@ .main-table-header { border-bottom: 1px solid red; } - tr.main-table-header td { + tr.main-table-header th { font-style: normal; font-weight: 600; font-size: 12px; @@ -249,6 +250,8 @@ margin-top: 188px; border-bottom: 1px solid #EAF1FB; padding: 0px 30px 0 30px; + page-break-before: avoid; + page-break-after: auto; } .table2 hr { @@ -284,26 +287,19 @@ padding-bottom: 8px; } - .table3 { - border: 1px solid #EAF1FB; - border-top: none; - padding-right: 30px; - box-sizing: border-box; - width: 230px; - height: 100px; - position: absolute; - right: -25; + .padd2 { + padding-top: 2px; + padding-bottom: 2px; } - .text-per-item-table3 { - border: 1px solid #EAF1FB; - border-top: none; - padding-right: 30px; + .table3 { + border: 1px solid #EAF1FB; + border-top: none; box-sizing: border-box; - width: 260px; - /* height: 100px; */ - position: absolute; - right: -25; + width: 630px; + page-break-inside: avoid; + page-break-before: auto; + page-break-after: auto; } td.estimate-total1 { diff --git a/resources/views/app/pdf/estimate/partials/table.blade.php b/resources/views/app/pdf/estimate/partials/table.blade.php index ae0db5df..304d1c38 100644 --- a/resources/views/app/pdf/estimate/partials/table.blade.php +++ b/resources/views/app/pdf/estimate/partials/table.blade.php @@ -1,47 +1,54 @@ - - - - - + @if($estimate->discount_per_item === 'NO') + + @else + + @endif + + + @if($estimate->discount_per_item === 'YES') + + @endif + @foreach ($estimate->items as $item) - - - - {{-- --}} - - + + + @if($estimate->discount_per_item === 'YES') + + @endif + @endforeach
ItemsQuantityPriceDiscountAmountItemsItemsQuantityPriceDiscountAmount
+ {{ $item->name }}
{{ $item->description }}
{{$item->quantity}}{{$item->price/100}}{{$item->discount/100}}% - @if($item->discount_type === 'fixed') - {{$item->discount_val/100}} - @endif - @if($item->discount_type === 'percentage') - {{$item->discount}}% - @endif - {{$item->total/100}}{{$item->quantity}}{{$item->price/100}} + @if($item->discount_type === 'fixed') + {{$item->discount_val/100}} + @endif + @if($item->discount_type === 'percentage') + {{$item->discount}}% + @endif + {{$item->total/100}}
- +
- + + style="padding-right:10px; text-align: right; font-size:12px; color: #040405; font-weight: 500;">{!! format_money_pdf($estimate->sub_total) !!} @if ($estimate->tax_per_item === 'YES') @for ($i = 0; $i < count($labels); $i++) - - @@ -49,10 +56,10 @@ @else @foreach ($estimate->taxes as $tax) - - @@ -62,29 +69,33 @@ @if ($estimate->discount_per_item === 'NO') - @endif - + + + + +
SubtotalSubtotal {!! format_money_pdf($estimate->sub_total) !!}
+ {{$labels[$i]}} + {!! format_money_pdf($taxes[$i]) !!}
+ {{$tax->name.' ('.$tax->percent.'%)'}} + {!! format_money_pdf($tax->amount) !!}
- Discount + Discount ({{$estimate->discount}}%) + @if($estimate->discount_type === 'fixed') {!! format_money_pdf($estimate->discount_val) !!} @endif @if($estimate->discount_type === 'percentage') - {{$estimate->discount}}% ({!! format_money_pdf($estimate->discount_val) !!}) + {!! format_money_pdf($estimate->discount_val) !!} @endif
- {!! format_money_pdf($estimate->total)!!} + {!! format_money_pdf($estimate->total)!!}
diff --git a/resources/views/app/pdf/invoice/invoice1.blade.php b/resources/views/app/pdf/invoice/invoice1.blade.php index 8d79738c..854d5368 100644 --- a/resources/views/app/pdf/invoice/invoice1.blade.php +++ b/resources/views/app/pdf/invoice/invoice1.blade.php @@ -72,6 +72,7 @@ .wrapper { display: block; padding-top: 60px; + padding-bottom: 60px; } .address { @@ -244,6 +245,8 @@ margin-top: 35px; border-bottom: 1px solid #EAF1FB; padding: 0px 30px 0 30px; + page-break-before: avoid; + page-break-after: auto; } .table2 hr { @@ -257,7 +260,7 @@ padding: 5px; } - tr.main-table-header td { + tr.main-table-header th { border-bottom: 1px solid #EAF1FB; font-style: normal; font-weight: normal; @@ -284,26 +287,36 @@ padding-bottom: 8px; } - .table3 { - border: 1px solid #EAF1FB; - border-top: none; - padding-right: 30px; - box-sizing: border-box; - width: 230px; - height: 100px; - position: absolute; - right: -25; + .padd2 { + padding-top: 2px; + padding-bottom: 2px; } - .text-per-item-table3 { - border: 1px solid #EAF1FB; + .table3 { + /* border: 1px solid #EAF1FB; */ border-top: none; - padding-right: 30px; + /* padding-right: 30px; */ box-sizing: border-box; - width: 260px; - /* height: 100px; */ - position: absolute; - right: -25; + width: 630px; + /* position: absolute; + right: -25; */ + page-break-inside: avoid; + page-break-before: auto; + page-break-after: auto; + } + + .total-border-left { + border: 1px solid #E8E8E8!important; + border-right: 0px !important; + padding-top: 0px; + padding:8px !important; + } + .total-border-right { + border: 1px solid #E8E8E8!important; + border-left: 0px !important; + padding-top: 0px; + padding:8px !important; + } .inv-item { diff --git a/resources/views/app/pdf/invoice/invoice2.blade.php b/resources/views/app/pdf/invoice/invoice2.blade.php index c790aba9..7a2f9fba 100644 --- a/resources/views/app/pdf/invoice/invoice2.blade.php +++ b/resources/views/app/pdf/invoice/invoice2.blade.php @@ -74,6 +74,7 @@ .wrapper { display: block; padding-top: 110px; + padding-bottom: 60px; } .address { @@ -245,6 +246,8 @@ margin-top: 200px; border-bottom: 1px solid #EAF1FB; padding: 0px 30px 0 30px; + page-break-before: avoid; + page-break-after: auto; } .table2 hr { @@ -258,7 +261,7 @@ padding: 5px; } - tr.main-table-header td { + tr.main-table-header th { border-bottom: 1px solid #EAF1FB; font-style: normal; font-weight: normal; @@ -295,15 +298,19 @@ padding-bottom: 8px; } + .padd2 { + padding-top: 2px; + padding-bottom: 2px; + } + .table3 { border: 1px solid #EAF1FB; border-top: none; - padding-right: 30px; box-sizing: border-box; - width: 230px; - height: 100px; - position: absolute; - right: -25; + width: 630px; + page-break-inside: avoid; + page-break-before: auto; + page-break-after: auto; } .text-per-item-table3 { diff --git a/resources/views/app/pdf/invoice/invoice3.blade.php b/resources/views/app/pdf/invoice/invoice3.blade.php index 7ac29e48..4c6c6b9b 100644 --- a/resources/views/app/pdf/invoice/invoice3.blade.php +++ b/resources/views/app/pdf/invoice/invoice3.blade.php @@ -80,6 +80,7 @@ .wrapper { display: block; padding-top: 110px; + padding-bottom: 60px; } .address { @@ -233,7 +234,7 @@ .main-table-header { border-bottom: 1px solid red; } - tr.main-table-header td { + tr.main-table-header th { font-style: normal; font-weight: 600; font-size: 12px; @@ -249,6 +250,8 @@ margin-top: 188px; border-bottom: 1px solid #EAF1FB; padding: 0px 30px 0 30px; + page-break-before: avoid; + page-break-after: auto; } .table2 hr { @@ -284,15 +287,19 @@ padding-bottom: 8px; } + .padd2 { + padding-top: 2px; + padding-bottom: 2px; + } + .table3 { border: 1px solid #EAF1FB; border-top: none; - padding-right: 30px; box-sizing: border-box; - width: 230px; - height: 100px; - position: absolute; - right: -25; + width: 630px; + page-break-inside: avoid; + page-break-before: auto; + page-break-after: auto; } .text-per-item-table3 { diff --git a/resources/views/app/pdf/invoice/partials/table.blade.php b/resources/views/app/pdf/invoice/partials/table.blade.php index 57e309a5..9e42552b 100644 --- a/resources/views/app/pdf/invoice/partials/table.blade.php +++ b/resources/views/app/pdf/invoice/partials/table.blade.php @@ -1,46 +1,54 @@ - - - - - + @if($invoice->discount_per_item === 'NO') + + @else + + @endif + + + @if($invoice->discount_per_item === 'YES') + + @endif + @foreach ($invoice->items as $item) - - - - - + + + @if($invoice->discount_per_item === 'YES') + + @endif + @endforeach
ItemsQuantityPriceDiscountAmountItemsItemsQuantityPriceDiscountAmount
+ {{ $item->name }}
{{ $item->description }}
{{$item->quantity}}{{$item->price/100}} - @if($item->discount_type === 'fixed') - {{$item->discount_val/100}} - @endif - @if($item->discount_type === 'percentage') - {{$item->discount}}% - @endif - {{$item->total/100}}{{$item->quantity}}{{$item->price/100}} + @if($item->discount_type === 'fixed') + {{$item->discount_val/100}} + @endif + @if($item->discount_type === 'percentage') + {{$item->discount}}% + @endif + {{$item->total/100}}
- +
- + + style="padding-right:10px; text-align: right; font-size:12px; color: #040405; font-weight: 500;">{!! format_money_pdf($invoice->sub_total) !!} @if ($invoice->tax_per_item === 'YES') @for ($i = 0; $i < count($labels); $i++) - - @@ -48,10 +56,10 @@ @else @foreach ($invoice->taxes as $tax) - - @@ -61,27 +69,31 @@ @if ($invoice->discount_per_item === 'NO') - @endif - + + + + +
SubtotalSubtotal {!! format_money_pdf($invoice->sub_total) !!}
+ {{$labels[$i]}} + {!! format_money_pdf($taxes[$i]) !!}
+ {{$tax->name.' ('.$tax->percent.'%)'}} + {!! format_money_pdf($tax->amount) !!}
- Discount + Discount ({{$invoice->discount}}%) + @if($invoice->discount_type === 'fixed') {!! format_money_pdf($invoice->discount_val) !!} @endif @if($invoice->discount_type === 'percentage') - {{$invoice->discount}}% ({!! format_money_pdf($invoice->discount_val) !!}) + {!! format_money_pdf($invoice->discount_val) !!} @endif
{!! format_money_pdf($invoice->total)!!}