Просмотр исходного кода

Fix decimal amount being dropped

Alan Lam 2 лет назад
Родитель
Сommit
bb996e99d7
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      views/document_items_section.php
  2. 1 1
      views/sale_items_section.php

+ 1 - 1
views/document_items_section.php

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

+ 1 - 1
views/sale_items_section.php

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