2020 <th width =" 12%" class =" fw6 bb b--black-20 tl pb3 pr3 bg-white" ><?php esc_html_e ( ' Total amount' , ' altapay' ); ? > </th >
2121 </tr >
2222 </thead >
23- <tbody class =" lh-copy" >
24-
25- @php
26- $productsWithCoupon = array ();
27- @endphp
23+ <tbody >
2824
2925 @foreach ($order -> get_items () as $item )
3026
4541 $productUnitPriceWithTax = round (($total / $qty ) + ($item -> get_total_tax () / $qty ), 2 );
4642 $totalIncTax = round ($total + $item -> get_total_tax (), 2 );
4743 @endphp
48-
49- <tr class =" ap-orderlines-capture" >
50- <td style =" display :none " >
51- <input class =" form-control ap-order-product-sku pv3 pr3 bb b--black-20" name =" productID" type =" text" value =" {{ $productID } }" />
52- </td >
53- <td class =" pv3 pr3 bb b--black-20" > {{ $item -> get_name ()} } </td >
54- <td class =" ap-orderline-unit-price pv3 pr3 bb b--black-20" >{{ $productUnitPriceWithTax } } </td >
55- <td class =" pv3 pr3 bb b--black-20" >{{ $productUnitPriceWithoutTax } } </td >
56- <td class =" ap-orderline-capture-max-quantity pv3 pr3 bb b--black-20" >{{ $qty } } </td >
57- <td class =" ap-orderline-discount-percent pv3 pr3 bb b--black-20" >{{ $discountPercent } } </td >
58- <td class =" pv3 pr3 bb b--black-20" >
59- <input style =" width : 100px ;" class =" form-control ap-order-capture-modify"
60- name =" qty" value =" {{ $capturableQty } }"
61- type =" number"
62- {{ ! $capturableQty ? ' disabled' : ' ' } } />
63- </td >
64- <td class =" ap-orderline-totalprice-capture pv3 pr3 bb b--black-20" >
65- <span class =" totalprice-capture" >{{ $order -> get_currency ()} } {{ $totalIncTax } } </span >
66- </td >
67- </tr >
44+ @include (' tables.order-line' , [
45+ ' itemId' => $productID ,
46+ ' itemName' => $item -> get_name (),
47+ ' priceWithTax' => $productUnitPriceWithTax ,
48+ ' priceWithoutTax' => $productUnitPriceWithoutTax ,
49+ ' qty' => $qty ,
50+ ' discountPercent' => $discountPercent ,
51+ ' availableQty' => $capturableQty ,
52+ ' currency' => $order -> get_currency (),
53+ ' totalIncTax' => $totalIncTax ,
54+ ' type' => ' capture' ,
55+ ] )
6856 @endforeach
6957
7058 @if ($order -> get_shipping_total () <> 0 || $order -> get_shipping_tax () <> 0 )
7866 @foreach ($order_shipping_methods as $ordershipping_key => $ordershippingmethods )
7967 @php ($shipping_id = $ordershippingmethods [' method_id' ] )
8068 @endforeach
81-
82- <tr class =" ap-orderlines-capture" >
83- @php
84- $capturableQty = ( isset ( $items_captured [$shipping_id ] ) && $items_captured [$shipping_id ] == 1 ) ? 0 : 1 ;
85- @endphp
86- <td style =" display :none " >
87- <input class =" form-control ap-order-product-sku pv3 pr3 bb b--black-20" name =" productID"
88- type =" text" value =" {{ $shipping_id } }" />
89- </td >
90- <td class =" pv3 pr3 bb b--black-20" >{{ $order -> get_shipping_method ()} } </td >
91- <td class =" ap-orderline-unit-price pv3 pr3 bb b--black-20" >{{ $totalIncTax } } </td >
92- <td class =" pv3 pr3 bb b--black-20" >{{ $excTax } } </td >
93- <td class =" ap-orderline-capture-max-quantity pv3 pr3 bb b--black-20" >1</td >
94- <td class =" ap-orderline-discount-percent pv3 pr3 bb b--black-20" >{{ $discountPercentage } } </td >
95- <td class =" pv3 pr3 bb b--black-20" >
96- <input class =" form-control ap-order-capture-modify" name =" qty"
97- value =" {{ $capturableQty } }" type =" number" style =" width : 100px ;" {{ $capturableQty === 0 ? ' disabled' : ' ' } } />
98- </td >
99- <td class =" ap-orderline-totalprice-capture pv3 pr3 bb b--black-20" >
100- <span class =" totalprice-capture" >{{ $order -> get_currency ()} } {{ $totalIncTax } } </span >
101- </td >
102- </tr >
69+ @php
70+ $capturableQty = ( isset ( $items_captured [$shipping_id ] ) && $items_captured [$shipping_id ] == 1 ) ? 0 : 1 ;
71+ @endphp
72+ @include (' tables.order-line' , [
73+ ' itemId' => $shipping_id ,
74+ ' itemName' => $order -> get_shipping_method (),
75+ ' priceWithTax' => $totalIncTax ,
76+ ' priceWithoutTax' => $excTax ,
77+ ' qty' => 1 ,
78+ ' discountPercent' => $discountPercentage ,
79+ ' availableQty' => $capturableQty ,
80+ ' currency' => $order -> get_currency (),
81+ ' totalIncTax' => $totalIncTax ,
82+ ' type' => ' capture' ,
83+ ] )
10384 @endif
85+
86+ @php
87+ $fees = $order -> get_fees ();
88+ @endphp
89+ @foreach ( $fees as $fee )
90+ @php
91+ $surchargeAmount = (float ) $fee -> get_total ();
92+ @endphp
93+ @if ( $fee -> get_name () === ' Surcharge' )
94+ @include (' tables.order-line' , [
95+ ' itemId' => $fee -> get_id (),
96+ ' itemName' => $fee -> get_name (),
97+ ' priceWithTax' => $surchargeAmount ,
98+ ' priceWithoutTax' => $surchargeAmount ,
99+ ' qty' => 1 ,
100+ ' discountPercent' => 0 ,
101+ ' availableQty' => 1 ,
102+ ' currency' => $order -> get_currency (),
103+ ' totalIncTax' => $surchargeAmount ,
104+ ' type' => ' capture'
105+ ] )
106+ @endif
107+ @endforeach
104108 </tbody >
105109</table >
0 commit comments