if source qty/amt zero, do not check for over delivery/bill

This commit is contained in:
Nabin Hait 2011-08-31 17:23:23 +05:30
parent 30174d27dc
commit 630f433741

View File

@ -576,7 +576,7 @@ class StatusUpdater:
""" """
Checks if there is overflow condering a relaxation tolerance Checks if there is overflow condering a relaxation tolerance
""" """
# check if overflow is within tolerance # check if overflow is within tolerance
tolerance = self.get_tolerance_for(item['item_code']) tolerance = self.get_tolerance_for(item['item_code'])
overflow_percent = ((item[args['compare_field']] - item[args['compare_ref_field']]) / item[args['compare_ref_field']] * 100) overflow_percent = ((item[args['compare_field']] - item[args['compare_ref_field']]) / item[args['compare_ref_field']] * 100)
@ -606,12 +606,14 @@ class StatusUpdater:
select item_code, `%(compare_ref_field)s`, `%(compare_field)s`, parenttype, parent from `tab%(target_dt)s` select item_code, `%(compare_ref_field)s`, `%(compare_field)s`, parenttype, parent from `tab%(target_dt)s`
where `%(compare_ref_field)s` < `%(compare_field)s` and name="%(name)s" and docstatus=1 where `%(compare_ref_field)s` < `%(compare_field)s` and name="%(name)s" and docstatus=1
""" % args, as_dict=1) """ % args, as_dict=1)
if item: if item:
item = item[0] item = item[0]
item['idx'] = d.idx item['idx'] = d.idx
item['compare_ref_field'] = args['compare_ref_field'] item['compare_ref_field'] = args['compare_ref_field']
if no_tolerance:
if not item[args['compare_ref_field']]:
msgprint("As %(compare_ref_field)s for item: %(item_code)s in %(parenttype)s: %(parent)s is zero, system will not check over-delivery or over-billed" % item)
elif no_tolerance:
item['reduce_by'] = item[args['compare_field']] - item[args['compare_ref_field']] item['reduce_by'] = item[args['compare_field']] - item[args['compare_ref_field']]
msgprint(""" msgprint("""
Row #%(idx)s: Max %(compare_ref_field)s allowed for <b>Item %(item_code)s</b> against Row #%(idx)s: Max %(compare_ref_field)s allowed for <b>Item %(item_code)s</b> against