var allocations = {
'.amount': function(e) {
- e.onblur = function() {
- blur_alloc(this);
+ if(e.name == 'allocated_amount')
+ {
+ e.onblur = function() {
+ var dec = this.getAttribute("dec");
+ price_format(this.name, get_amount(this.name), dec);
};
- e.onfocus = function() {
- focus_alloc(this);
- };
+ } else {
+ e.onblur = function() {
+ blur_alloc(this);
+ };
+ e.onfocus = function() {
+ focus_alloc(this);
+ };
+ }
}
}
if ($comp_currency != $bank_currency && $bank_currency != $supp_currency)
$rate = 0;
else
+ {
$rate = input_num('_ex_rate');
+ $supplier_amount = input_num('allocated_amount');
+ if($supplier_amount) $rate = input_num('amount')/$supplier_amount;
+ }
$payment_id = add_supp_payment($_POST['supplier_id'], $_POST['DatePaid'],
$_POST['bank_account'], input_num('amount'), input_num('discount'),
$bank_currency = get_bank_account_currency($_POST['bank_account']);
if ($bank_currency != $supplier_currency)
{
- exchange_rate_display($bank_currency, $supplier_currency, $_POST['DatePaid'], true);
+ amount_row("Supplier Amount:", 'allocated_amount', null, '', $supplier_currency, 2);
}
amount_row(_("Bank Charge:"), 'charge');