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 @@| Items | -Quantity | -Price | -Discount | -Amount | + @if($estimate->discount_per_item === 'NO') +Items | + @else +Items | + @endif +Quantity | +Price | + @if($estimate->discount_per_item === 'YES') +Discount | + @endif +Amount |
|---|---|---|---|---|---|---|---|---|---|---|
| + |
{{ $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($estimate->discount_per_item === 'YES') ++ @if($item->discount_type === 'fixed') + {{$item->discount_val/100}} + @endif + @if($item->discount_type === 'percentage') + {{$item->discount}}% + @endif + | + @endif +{{$item->total/100}} |
| Subtotal | +Subtotal | {!! format_money_pdf($estimate->sub_total) !!} | + style="padding-right:10px; text-align: right; font-size:12px; color: #040405; font-weight: 500;">{!! 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)!!} |
| Items | -Quantity | -Price | -Discount | -Amount | + @if($invoice->discount_per_item === 'NO') +Items | + @else +Items | + @endif +Quantity | +Price | + @if($invoice->discount_per_item === 'YES') +Discount | + @endif +Amount |
|---|---|---|---|---|---|---|---|---|---|---|
| + |
{{ $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($invoice->discount_per_item === 'YES') ++ @if($item->discount_type === 'fixed') + {{$item->discount_val/100}} + @endif + @if($item->discount_type === 'percentage') + {{$item->discount}}% + @endif + | + @endif +{{$item->total/100}} |
| Subtotal | +Subtotal | {!! format_money_pdf($invoice->sub_total) !!} | + style="padding-right:10px; text-align: right; font-size:12px; color: #040405; font-weight: 500;">{!! 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)!!} |