Эх сурвалжийг харах

Fix decimal amount being dropped

Alan Lam 2 жил өмнө
parent
commit
bb996e99d7

+ 1 - 1
views/document_items_section.php

@@ -123,7 +123,7 @@ if($document->isAru()) {
 								<?=htmlspecialchars($formatter->formatCurrency($item->getAmount(), $currency))?>
 								<?=htmlspecialchars($formatter->formatCurrency($item->getAmount(), $currency))?>
 							</td>
 							</td>
 							<?php
 							<?php
-							$subtotal = bcadd($subtotal, $item->getAmount());
+							$subtotal = bcadd($subtotal, $item->getAmount(), 2);
 						}
 						}
 						if($document->isDeliveryNote()) {
 						if($document->isDeliveryNote()) {
 							?>
 							?>

+ 1 - 1
views/sale_items_section.php

@@ -89,7 +89,7 @@ use NumberFormatter;
 						</td>
 						</td>
 					</tr>
 					</tr>
 					<?php
 					<?php
-					$subtotal = bcadd($subtotal, $item->getAmount());
+					$subtotal = bcadd($subtotal, $item->getAmount(), 2);
 				}
 				}
 				$tax = bcmul($subtotal, $sale->tax_rate / 100, 2);
 				$tax = bcmul($subtotal, $sale->tax_rate / 100, 2);
 				$total = bcadd($subtotal, $tax, 2);
 				$total = bcadd($subtotal, $tax, 2);