@frappe.whitelist()
def apply_pricing_rule(args):
 if isinstance(args, basestring):
  args = json.loads(args)
 args = frappe._dict(args)
 if (not args.transaction_type):
  set_transaction_type(args)
 out = []
 if (args.get(u'doctype') == u'Material Request'):
  return out
 item_list = args.get(u'items')
 args.pop(u'items')
 set_serial_nos_based_on_fifo = frappe.db.get_single_value(u'Stock Settings', u'automatically_set_serial_nos_based_on_fifo')
 for item in item_list:
  args_copy = copy.deepcopy(args)
  args_copy.update(item)
  out.append(get_pricing_rule_for_item(args_copy))
  if set_serial_nos_based_on_fifo:
   out.append(get_serial_no_for_item(args_copy))
 return out

@ frappe . whitelist ( ) def apply_pricing_rule ( args ) : if isinstance ( args , basestring ) : args = json . loads ( args ) args = frappe . _dict ( args ) if ( not args . transaction_type ) : set_transaction_type ( args ) out = [ ] if ( args . get ( u'doctype' ) == u'Material Request' ) : return out item_list = args . get ( u'items' ) args . pop ( u'items' ) set_serial_nos_based_on_fifo = frappe . db . get_single_value ( u'Stock Settings' , u'automatically_set_serial_nos_based_on_fifo' ) for item in item_list : args_copy = copy . deepcopy ( args ) args_copy . update ( item ) out . append ( get_pricing_rule_for_item ( args_copy ) ) if set_serial_nos_based_on_fifo : out . append ( get_serial_no_for_item ( args_copy ) ) return out
args = { "items": [{"doctype": "" .