blanket order related fixes
This commit is contained in:
parent
0b9b8d6826
commit
2737b08f0f
@ -274,7 +274,7 @@
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
@ -306,7 +306,7 @@
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
@ -452,7 +452,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2018-06-04 06:36:36.933751",
|
||||
"modified": "2018-06-14 18:06:48.009635",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Manufacturing",
|
||||
"name": "Blanket Order",
|
||||
|
@ -749,19 +749,23 @@ def get_blanket_order_details(args):
|
||||
args = frappe._dict(json.loads(args))
|
||||
|
||||
blanket_order_details = None
|
||||
condition1, condition2 = ' ', ' '
|
||||
condition = ''
|
||||
if args.item_code:
|
||||
if args.customer and args.doctype == "Sales Order":
|
||||
condition1 = ' and bo.customer=%(customer)s '
|
||||
condition = ' and bo.customer=%(customer)s'
|
||||
elif args.supplier and args.doctype == "Purchase Order":
|
||||
condition1 = ' and bo.supplier=%(supplier)s '
|
||||
condition = ' and bo.supplier=%(supplier)s'
|
||||
if args.blanket_order:
|
||||
condition2 = ' and bo.name =%(blanket_order)s '
|
||||
condition += ' and bo.name =%(blanket_order)s'
|
||||
if args.transaction_date:
|
||||
condition += ' and bo.to_date>=%(transaction_date)s'
|
||||
|
||||
blanket_order_details = frappe.db.sql('''
|
||||
select boi.rate as blanket_order_rate, bo.name as blanket_order
|
||||
from `tabBlanket Order` bo, `tabBlanket Order Item` boi
|
||||
where bo.to_date>=%(transaction_date)s and bo.company=%(company)s and boi.item_code=%(item_code)s
|
||||
and bo.docstatus=1 and bo.name = boi.parent {0} {1}
|
||||
'''.format(condition1, condition2), args, as_dict=True)
|
||||
where bo.company=%(company)s and boi.item_code=%(item_code)s
|
||||
and bo.docstatus=1 and bo.name = boi.parent {0}
|
||||
'''.format(condition), args, as_dict=True)
|
||||
|
||||
blanket_order_details = blanket_order_details[0] if blanket_order_details else ''
|
||||
return blanket_order_details
|
||||
|
Loading…
x
Reference in New Issue
Block a user