Merge pull request #3750 from nabinhait/payreco

Minor fixes
This commit is contained in:
Nabin Hait 2015-07-30 11:50:19 +05:30
commit befa8d613f
2 changed files with 4 additions and 3 deletions

View File

@ -190,8 +190,9 @@ class PaymentReconciliation(Document):
if flt(p.allocated_amount) > flt(p.amount):
frappe.throw(_("Row {0}: Allocated amount {1} must be less than or equals to JV amount {2}")
.format(p.idx, p.allocated_amount, p.amount))
if flt(p.allocated_amount) > unreconciled_invoices.get(p.invoice_type, {}).get(p.invoice_number):
invoice_outstanding = unreconciled_invoices.get(p.invoice_type, {}).get(p.invoice_number)
if abs(flt(p.allocated_amount) - invoice_outstanding) > 0.009:
frappe.throw(_("Row {0}: Allocated amount {1} must be less than or equals to invoice outstanding amount {2}")
.format(p.idx, p.allocated_amount, unreconciled_invoices.get(p.invoice_type, {}).get(p.invoice_number)))

View File

@ -300,7 +300,7 @@ def get_serial_nos_by_fifo(args, item_doc):
order by timestamp(purchase_date, purchase_time) asc limit %(qty)s""", {
"item_code": args.item_code,
"warehouse": args.warehouse,
"qty": cint(args.qty)
"qty": abs(cint(args.qty))
}))
def get_actual_batch_qty(batch_no,warehouse,item_code):