From b07ff0ac025d4f4510a7de0808cd2da886c1c7c6 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Mon, 28 Oct 2013 09:35:17 +0100 Subject: [PATCH] Allocate Customer Payment or Credit Note, Allocate Supplier Payment or Credit Note: settled amount displayed in header. --- purchasing/allocations/supplier_allocate.php | 9 +++++---- sales/allocations/customer_allocate.php | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/purchasing/allocations/supplier_allocate.php b/purchasing/allocations/supplier_allocate.php index a1249406..2ebbb227 100644 --- a/purchasing/allocations/supplier_allocate.php +++ b/purchasing/allocations/supplier_allocate.php @@ -57,11 +57,12 @@ function edit_allocations_for_transaction($type, $trans_no) display_heading2(_("Total:"). " " . price_format(-$cart->bank_amount).' '.$cart->currency.""); - if ($cart->currency != $cart->person_curr) + if (floatcmp($cart->bank_amount, $cart->amount)) { - $total = _("Total in clearing currency:") . " " . price_format(-$cart->amount)."" - . sprintf(" %s (%s %s/%s)", $cart->person_curr, exrate_format($cart->bank_amount/$cart->amount), $cart->currency, $cart->person_curr); - display_heading2($total); + $total = _("Amount ot be settled:") . " " . price_format(-$cart->amount).' '.$cart->person_curr.""; + if ($cart->currency != $cart->person_curr) + $total .= sprintf(" (%s %s/%s)", exrate_format($cart->bank_amount/$cart->amount), $cart->currency, $cart->person_curr); + display_heading2($total); } echo "
"; diff --git a/sales/allocations/customer_allocate.php b/sales/allocations/customer_allocate.php index cf0005fe..f269ca4b 100644 --- a/sales/allocations/customer_allocate.php +++ b/sales/allocations/customer_allocate.php @@ -54,11 +54,12 @@ function edit_allocations_for_transaction($type, $trans_no) display_heading2(_("Date:") . " " . $cart->date_ . ""); display_heading2(_("Total:"). " " . price_format($cart->bank_amount).' '.$cart->currency.""); - if ($cart->currency != $cart->person_curr) + if (floatcmp($cart->bank_amount, $cart->amount)) { - $total = _("Total in clearing currency:") . " " . price_format($cart->amount)."" - . sprintf(" %s (%s %s/%s)", $cart->person_curr, exrate_format($cart->bank_amount/$cart->amount), $cart->currency, $cart->person_curr); - display_heading2($total); + $total = _("Amount ot be settled:") . " " . price_format($cart->amount).' '.$cart->person_curr.""; + if ($cart->currency != $cart->person_curr) + $total .= sprintf(" (%s %s/%s)", exrate_format($cart->bank_amount/$cart->amount), $cart->currency, $cart->person_curr); + display_heading2($total); } echo "
"; -- 2.30.2