|
@@ -7,9 +7,6 @@
|
7
|
7
|
$type = $getType();
|
8
|
8
|
$viewModel = new DocumentTotalViewModel($data, $type);
|
9
|
9
|
extract($viewModel->buildViewData(), EXTR_SKIP);
|
10
|
|
-
|
11
|
|
- $discountMethod = DocumentDiscountMethod::parse($data['discount_method']);
|
12
|
|
- $isPerDocumentDiscount = $discountMethod->isPerDocument();
|
13
|
10
|
@endphp
|
14
|
11
|
|
15
|
12
|
<div class="totals-summary w-full lg:pl-[4rem] lg:pr-[6rem] py-8 lg:py-0">
|
|
@@ -23,66 +20,78 @@
|
23
|
20
|
<col class="w-[10%]"> {{-- Amount --}}
|
24
|
21
|
</colgroup>
|
25
|
22
|
<tbody>
|
|
23
|
+ @if($subtotal)
|
26
|
24
|
<tr>
|
27
|
25
|
<td colspan="4"></td>
|
28
|
26
|
<td class="text-sm p-2 font-semibold text-gray-950 dark:text-white">Subtotal:</td>
|
29
|
27
|
<td class="text-sm p-2">{{ $subtotal }}</td>
|
30
|
28
|
</tr>
|
|
29
|
+ @endif
|
|
30
|
+ @if($taxTotal)
|
31
|
31
|
<tr>
|
32
|
32
|
<td colspan="4"></td>
|
33
|
33
|
<td class="text-sm p-2">Tax:</td>
|
34
|
34
|
<td class="text-sm p-2">{{ $taxTotal }}</td>
|
35
|
35
|
</tr>
|
36
|
|
- @if($isPerDocumentDiscount)
|
37
|
|
- <tr>
|
38
|
|
- <td colspan="3" class="text-sm p-2">Discount:</td>
|
39
|
|
- <td colspan="2" class="text-sm p-2">
|
40
|
|
- <div class="flex justify-between space-x-2">
|
41
|
|
- @foreach($getChildComponentContainer()->getComponents() as $component)
|
42
|
|
- <div class="flex-1 text-left">{{ $component }}</div>
|
43
|
|
- @endforeach
|
44
|
|
- </div>
|
45
|
|
- </td>
|
46
|
|
- <td class="text-sm p-2">({{ $discountTotal }})</td>
|
47
|
|
- </tr>
|
48
|
|
- @else
|
49
|
|
- <tr>
|
50
|
|
- <td colspan="4"></td>
|
51
|
|
- <td class="text-sm p-2">Discount:</td>
|
52
|
|
- <td class="text-sm p-2">({{ $discountTotal }})</td>
|
53
|
|
- </tr>
|
54
|
|
- @endif
|
|
36
|
+ @endif
|
|
37
|
+ @if($isPerDocumentDiscount)
|
|
38
|
+ <tr>
|
|
39
|
+ <td colspan="3" class="text-sm p-2">Discount:</td>
|
|
40
|
+ <td colspan="2" class="text-sm p-2">
|
|
41
|
+ <div class="flex justify-between space-x-2">
|
|
42
|
+ @foreach($getChildComponentContainer()->getComponents() as $component)
|
|
43
|
+ <div class="flex-1 text-left">{{ $component }}</div>
|
|
44
|
+ @endforeach
|
|
45
|
+ </div>
|
|
46
|
+ </td>
|
|
47
|
+ <td class="text-sm p-2">({{ $discountTotal }})</td>
|
|
48
|
+ </tr>
|
|
49
|
+ @elseif($discountTotal)
|
55
|
50
|
<tr>
|
56
|
51
|
<td colspan="4"></td>
|
57
|
|
- <td class="text-sm p-2 font-semibold text-gray-950 dark:text-white">Total:</td>
|
58
|
|
- <td class="text-sm p-2">{{ $grandTotal }}</td>
|
|
52
|
+ <td class="text-sm p-2">Discount:</td>
|
|
53
|
+ <td class="text-sm p-2">({{ $discountTotal }})</td>
|
59
|
54
|
</tr>
|
|
55
|
+ @endif
|
|
56
|
+ <tr>
|
|
57
|
+ <td colspan="4"></td>
|
|
58
|
+ <td class="text-sm p-2 font-semibold text-gray-950 dark:text-white">{{ $amountDue ? 'Total' : 'Grand Total' }}:</td>
|
|
59
|
+ <td class="text-sm p-2">{{ $grandTotal }}</td>
|
|
60
|
+ </tr>
|
|
61
|
+ @if($amountDue)
|
60
|
62
|
<tr>
|
61
|
63
|
<td colspan="4"></td>
|
62
|
|
- <td class="text-sm p-2 font-semibold text-gray-950 dark:text-white border-t-4 border-double">Amount Due ({{ $currencyCode }}):</td>
|
|
64
|
+ <td class="text-sm p-2 font-semibold text-gray-950 dark:text-white border-t-4 border-double">Amount Due
|
|
65
|
+ ({{ $currencyCode }}):
|
|
66
|
+ </td>
|
63
|
67
|
<td class="text-sm p-2 border-t-4 border-double">{{ $amountDue }}</td>
|
64
|
68
|
</tr>
|
65
|
|
- @if($conversionMessage)
|
66
|
|
- <tr>
|
67
|
|
- <td colspan="6" class="text-sm p-2 text-gray-600">
|
68
|
|
- {{ $conversionMessage }}
|
69
|
|
- </td>
|
70
|
|
- </tr>
|
71
|
|
- @endif
|
|
69
|
+ @endif
|
|
70
|
+ @if($conversionMessage)
|
|
71
|
+ <tr>
|
|
72
|
+ <td colspan="6" class="text-sm p-2 text-gray-600">
|
|
73
|
+ {{ $conversionMessage }}
|
|
74
|
+ </td>
|
|
75
|
+ </tr>
|
|
76
|
+ @endif
|
72
|
77
|
</tbody>
|
73
|
78
|
</table>
|
74
|
79
|
|
75
|
80
|
<!-- Mobile View -->
|
76
|
81
|
<div class="block lg:hidden">
|
77
|
82
|
<div class="flex flex-col space-y-6">
|
78
|
|
- <div class="flex justify-between items-center">
|
79
|
|
- <span class="text-sm font-semibold text-gray-950 dark:text-white">Subtotal:</span>
|
80
|
|
- <span class="text-sm">{{ $subtotal }}</span>
|
81
|
|
- </div>
|
82
|
|
- <div class="flex justify-between items-center">
|
83
|
|
- <span class="text-sm">Tax:</span>
|
84
|
|
- <span class="text-sm">{{ $taxTotal }}</span>
|
85
|
|
- </div>
|
|
83
|
+ @if($subtotal)
|
|
84
|
+ <div class="flex justify-between items-center">
|
|
85
|
+ <span class="text-sm font-semibold text-gray-950 dark:text-white">Subtotal:</span>
|
|
86
|
+ <span class="text-sm">{{ $subtotal }}</span>
|
|
87
|
+ </div>
|
|
88
|
+ @endif
|
|
89
|
+ @if($taxTotal)
|
|
90
|
+ <div class="flex justify-between items-center">
|
|
91
|
+ <span class="text-sm">Tax:</span>
|
|
92
|
+ <span class="text-sm">{{ $taxTotal }}</span>
|
|
93
|
+ </div>
|
|
94
|
+ @endif
|
86
|
95
|
@if($isPerDocumentDiscount)
|
87
|
96
|
<div class="flex flex-col space-y-2">
|
88
|
97
|
<span class="text-sm">Discount:</span>
|
|
@@ -92,20 +101,23 @@
|
92
|
101
|
@endforeach
|
93
|
102
|
</div>
|
94
|
103
|
</div>
|
95
|
|
- @else
|
|
104
|
+ @elseif($discountTotal)
|
96
|
105
|
<div class="flex justify-between items-center">
|
97
|
106
|
<span class="text-sm">Discount:</span>
|
98
|
107
|
<span class="text-sm">({{ $discountTotal }})</span>
|
99
|
108
|
</div>
|
100
|
109
|
@endif
|
101
|
110
|
<div class="flex justify-between items-center">
|
102
|
|
- <span class="text-sm font-semibold text-gray-950 dark:text-white">Total:</span>
|
|
111
|
+ <span class="text-sm font-semibold text-gray-950 dark:text-white">{{ $amountDue ? 'Total' : 'Grand Total' }}:</span>
|
103
|
112
|
<span class="text-sm">{{ $grandTotal }}</span>
|
104
|
113
|
</div>
|
105
|
|
- <div class="flex justify-between items-center">
|
106
|
|
- <span class="text-sm font-semibold text-gray-950 dark:text-white">Amount Due ({{ $currencyCode }}):</span>
|
107
|
|
- <span class="text-sm">{{ $amountDue }}</span>
|
108
|
|
- </div>
|
|
114
|
+ @if($amountDue)
|
|
115
|
+ <div class="flex justify-between items-center">
|
|
116
|
+ <span
|
|
117
|
+ class="text-sm font-semibold text-gray-950 dark:text-white">Amount Due ({{ $currencyCode }}):</span>
|
|
118
|
+ <span class="text-sm">{{ $amountDue }}</span>
|
|
119
|
+ </div>
|
|
120
|
+ @endif
|
109
|
121
|
@if($conversionMessage)
|
110
|
122
|
<div class="text-sm text-gray-600">
|
111
|
123
|
{{ $conversionMessage }}
|