Form Cleanup: Dynamic label change, smart hide/unhide and dependencies

This commit is contained in:
Nabin Hait 2012-02-27 12:47:40 +05:30
parent 8771da0a27
commit 0959341130
19 changed files with 4107 additions and 4118 deletions

View File

@ -53,24 +53,19 @@ cur_frm.cscript.onload_post_render = function(doc, dt, dn) {
// Hide Fields
// ------------
cur_frm.cscript.hide_fields = function(doc, cdt, cdn) {
par_flds = ['project_name', 'due_date', 'posting_time', 'sales_order_main', 'delivery_note_main', 'Get Items', 'is_opening', 'conversion_rate', 'source', 'cancel_reason', 'total_advance', 'gross_profit', 'gross_profit_percent', 'Get Advances Received', 'advance_adjustment_details', 'sales_partner', 'commission_rate', 'total_commission', 'Repair Outstanding Amt'];
par_flds = ['project_name', 'due_date', 'sales_order_main', 'delivery_note_main', 'Get Items', 'is_opening', 'conversion_rate', 'source', 'cancel_reason', 'total_advance', 'gross_profit', 'gross_profit_percent', 'Get Advances Received', 'advance_adjustment_details', 'sales_partner', 'commission_rate', 'total_commission', 'Repair Outstanding Amt'];
ch_flds = {'entries': ['sales_order', 'delivery_note']}
item_flds_normal = ['sales_order', 'delivery_note']
item_flds_pos = ['warehouse', 'serial_no', 'batch_no', 'actual_qty', 'delivered_qty']
if(cint(doc.is_pos) == 1) {
hide_field(par_flds);
for(t in ch_flds) {
for(f in ch_flds[t]) {
cur_frm.fields_dict[t].grid.set_column_disp(ch_flds[t][f], false);
}
}
hide_field(par_flds);
for(f in item_flds_normal) cur_frm.fields_dict['entries'].grid.set_column_disp(item_flds_normal[f], false);
for(f in item_flds_pos) cur_frm.fields_dict['entries'].grid.set_column_disp(item_flds_pos[f], (doc.update_stock==1?true:false));
} else {
unhide_field(par_flds);
for (t in ch_flds) {
for (f in ch_flds[t]) {
cur_frm.fields_dict[t].grid.set_column_disp(ch_flds[t][f], true);
}
}
for(f in item_flds_normal) cur_frm.fields_dict['entries'].grid.set_column_disp(item_flds_normal[f], true);
for(f in item_flds_pos) cur_frm.fields_dict['entries'].grid.set_column_disp(item_flds_pos[f], false);
}
// India related fields
@ -84,9 +79,14 @@ cur_frm.cscript.hide_fields = function(doc, cdt, cdn) {
// Refresh
// -------
cur_frm.cscript.refresh = function(doc, dt, dn) {
cur_frm.cscript.is_opening(doc, dt, dn);
cur_frm.cscript.hide_fields(doc, cdt, cdn);
cur_frm.cscript.hide_fields(doc, dt, dn);
var callback = function() {
cur_frm.cscript.dynamic_label(doc, dt, dn);
}
cur_frm.cscript.hide_price_list_currency(doc, dt, dn, callback);
// Show / Hide button
cur_frm.clear_custom_buttons();
@ -109,7 +109,7 @@ cur_frm.cscript.refresh = function(doc, dt, dn) {
//fetch retail transaction related fields
//--------------------------------------------
cur_frm.cscript.is_pos = function(doc,dt,dn,callback){
cur_frm.cscript.hide_fields(doc, cdt, cdn);
cur_frm.cscript.hide_fields(doc, dt, dn);
if(doc.is_pos == 1){
if (!doc.company) {
msgprint("Please select company to proceed");
@ -127,6 +127,11 @@ cur_frm.cscript.is_pos = function(doc,dt,dn,callback){
}
cur_frm.cscript.update_stock = function(doc, dt, dn) {
cur_frm.cscript.hide_fields(doc, dt, dn);
}
cur_frm.cscript.warehouse = function(doc, cdt , cdn) {
var d = locals[cdt][cdn];
if (!d.item_code) {alert("please enter item code first"); return};

View File

@ -74,9 +74,9 @@ class DocType(TransactionBase):
for d in getlist(self.doclist,'entries'):
# overwrite if mentioned in item
item = webnotes.conn.sql("select default_income_account, default_sales_cost_center, default_warehouse from tabItem where name = '%s'" %(d.item_code), as_dict=1)
d.income_account = item and item[0]['default_income_account'] or dtl and dtl[0]['income_account'] or ''
d.cost_center = item and item[0]['default_sales_cost_center'] or dtl and dtl[0]['cost_center'] or ''
d.warehouse = item and item[0]['default_warehouse'] or dtl and dtl[0]['warehouse'] or ''
d.income_account = item and item[0]['default_income_account'] or dtl and dtl[0]['income_account'] or d.income_account
d.cost_center = item and item[0]['default_sales_cost_center'] or dtl and dtl[0]['cost_center'] or d.cost_center
d.warehouse = item and item[0]['default_warehouse'] or dtl and dtl[0]['warehouse'] or d.warehouse
@ -151,31 +151,36 @@ class DocType(TransactionBase):
# Item Details
# -------------
def get_item_details(self, item_code=None):
if item_code:
ret = get_obj('Sales Common').get_item_details(item_code, self)
return self.get_pos_details(item_code, ret)
def get_item_details(self, args=None):
args = eval(args)
if args['item_code']:
ret = get_obj('Sales Common').get_item_details(args, self)
return self.get_pos_details(args, ret)
else:
obj = get_obj('Sales Common')
for doc in self.doclist:
if doc.fields.get('item_code'):
ret = obj.get_item_details(doc.item_code, self)
ret = self.get_pos_details(item_code, ret)
ret = self.get_pos_details(doc.item_code, ret)
for r in ret:
if not doc.fields.get(r):
doc.fields[r] = ret[r]
doc.fields[r] = ret[r]
def get_pos_details(self, item_code, ret):
if item_code and cint(self.doc.is_pos) == 1:
def get_pos_details(self, args, ret):
if args['item_code'] and cint(self.doc.is_pos) == 1:
dtl = webnotes.conn.sql("select income_account, warehouse, cost_center from `tabPOS Setting` where user = '%s' and company = '%s'" % (session['user'], self.doc.company), as_dict=1)
if not dtl:
dtl = webnotes.conn.sql("select income_account, warehouse, cost_center from `tabPOS Setting` where ifnull(user,'') = '' and company = '%s'" % (self.doc.company), as_dict=1)
if dtl and not ret['income_account'] and dtl[0]['income_account']: ret['income_account'] = dtl and dtl[0]['income_account']
if dtl and not ret['cost_center'] and dtl[0]['cost_center']: ret['cost_center'] = dtl and dtl[0]['cost_center']
if dtl and not ret['warehouse'] and dtl[0]['warehouse']: ret['warehouse'] = dtl and dtl[0]['warehouse']
item = webnotes.conn.sql("select default_income_account, default_sales_cost_center, default_warehouse from tabItem where name = '%s'" %(args['item_code']), as_dict=1)
ret['income_account'] = item and item[0]['default_income_account'] or dtl and dtl[0]['income_account'] or args['income_account']
ret['cost_center'] = item and item[0]['default_sales_cost_center'] or dtl and dtl[0]['cost_center'] or args['cost_center']
ret['warehouse'] = item and item[0]['default_warehouse'] or dtl and dtl[0]['warehouse'] or args['warehouse']
if ret['warehouse']:
actual_qty = webnotes.conn.sql("select actual_qty from `tabBin` where item_code = '%s' and warehouse = '%s'" % (item_code, ret['warehouse']))
actual_qty = webnotes.conn.sql("select actual_qty from `tabBin` where item_code = '%s' and warehouse = '%s'" % (args['item_code'], ret['warehouse']))
ret['actual_qty']= actual_qty and flt(actual_qty[0][0]) or 0
return ret
@ -185,6 +190,14 @@ class DocType(TransactionBase):
get_obj('Sales Common').get_adj_percent(self)
def get_comp_base_currency(self):
return get_obj('Sales Common').get_comp_base_currency(self.doc.company)
def get_price_list_currency(self):
return get_obj('Sales Common').get_price_list_currency(self.doc.price_list_name, self.doc.company)
# Get tax rate if account type is tax
# ------------------------------------
def get_rate(self,arg):

View File

@ -5,209 +5,199 @@
{
'creation': '2010-08-08 17:09:20',
'docstatus': 0,
'modified': '2011-06-20 13:02:03',
'modified_by': 'Administrator',
'owner': 'Administrator'
'modified': '2012-02-24 16:14:38',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all DocType
{
'autoname': 'INVD.######',
'colour': 'White:FFF',
'autoname': u'INVD.######',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'istable': 1,
'module': 'Accounts',
'module': u'Accounts',
'name': '__common__',
'section_style': 'Tray',
'server_code_error': ' ',
'section_style': u'Tray',
'server_code_error': u' ',
'show_in_menu': 0,
'version': 22
'version': 25
},
# These values are common for all DocField
{
'doctype': 'DocField',
'doctype': u'DocField',
'name': '__common__',
'parent': 'RV Detail',
'parentfield': 'fields',
'parenttype': 'DocType'
'parent': u'RV Detail',
'parentfield': u'fields',
'parenttype': u'DocType'
},
# DocType, RV Detail
{
'doctype': 'DocType',
'name': 'RV Detail'
'name': u'RV Detail'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'item_code',
'fieldtype': 'Link',
'idx': 1,
'doctype': u'DocField',
'fieldname': u'item_code',
'fieldtype': u'Link',
'in_filter': 1,
'label': 'Item',
'oldfieldname': 'item_code',
'oldfieldtype': 'Link',
'options': 'Item',
'label': u'Item',
'oldfieldname': u'item_code',
'oldfieldtype': u'Link',
'options': u'Item',
'permlevel': 0,
'print_hide': 1,
'print_hide': 0,
'reqd': 0,
'search_index': 1,
'trigger': 'Client'
'trigger': u'Client'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'item_name',
'fieldtype': 'Data',
'idx': 2,
'doctype': u'DocField',
'fieldname': u'item_name',
'fieldtype': u'Data',
'in_filter': 0,
'label': 'Item Name',
'oldfieldname': 'item_name',
'oldfieldtype': 'Data',
'label': u'Item Name',
'oldfieldname': u'item_name',
'oldfieldtype': u'Data',
'permlevel': 0,
'print_hide': 1,
'reqd': 1,
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'description',
'fieldtype': 'Text',
'idx': 3,
'label': 'Description',
'oldfieldname': 'description',
'oldfieldtype': 'Text',
'doctype': u'DocField',
'fieldname': u'description',
'fieldtype': u'Text',
'label': u'Description',
'oldfieldname': u'description',
'oldfieldtype': u'Text',
'permlevel': 0,
'reqd': 1,
'width': '300px'
'width': u'200px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'stock_uom',
'fieldtype': 'Data',
'idx': 4,
'label': 'UOM',
'doctype': u'DocField',
'fieldname': u'stock_uom',
'fieldtype': u'Data',
'label': u'UOM',
'permlevel': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'qty',
'fieldtype': 'Currency',
'idx': 5,
'label': 'Qty',
'oldfieldname': 'qty',
'oldfieldtype': 'Currency',
'doctype': u'DocField',
'fieldname': u'qty',
'fieldtype': u'Currency',
'label': u'Qty',
'oldfieldname': u'qty',
'oldfieldtype': u'Currency',
'permlevel': 0,
'reqd': 0,
'trigger': 'Client'
'trigger': u'Client'
},
# DocField
{
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldname': 'ref_rate',
'fieldtype': 'Currency',
'idx': 6,
'label': 'Ref Rate',
'oldfieldname': 'ref_rate',
'oldfieldtype': 'Currency',
'colour': u'White:FFF',
'doctype': u'DocField',
'fieldname': u'ref_rate',
'fieldtype': u'Currency',
'label': u'Price List Rate',
'oldfieldname': u'ref_rate',
'oldfieldtype': u'Currency',
'permlevel': 0,
'print_hide': 1,
'reqd': 0,
'trigger': 'Client'
'trigger': u'Client'
},
# DocField
{
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldname': 'adj_rate',
'fieldtype': 'Float',
'idx': 7,
'label': 'Discount (%)',
'oldfieldname': 'adj_rate',
'oldfieldtype': 'Float',
'colour': u'White:FFF',
'doctype': u'DocField',
'fieldname': u'adj_rate',
'fieldtype': u'Float',
'label': u'Discount (%)',
'oldfieldname': u'adj_rate',
'oldfieldtype': u'Float',
'permlevel': 0,
'print_hide': 1,
'trigger': 'Client'
'trigger': u'Client'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'export_rate',
'fieldtype': 'Currency',
'idx': 8,
'label': 'Basic Rate',
'oldfieldname': 'export_rate',
'oldfieldtype': 'Currency',
'doctype': u'DocField',
'fieldname': u'export_rate',
'fieldtype': u'Currency',
'label': u'Basic Rate',
'oldfieldname': u'export_rate',
'oldfieldtype': u'Currency',
'permlevel': 0,
'reqd': 1,
'trigger': 'Client'
'trigger': u'Client'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'export_amount',
'fieldtype': 'Currency',
'idx': 9,
'label': 'Amount',
'oldfieldname': 'export_amount',
'oldfieldtype': 'Currency',
'doctype': u'DocField',
'fieldname': u'export_amount',
'fieldtype': u'Currency',
'label': u'Amount',
'oldfieldname': u'export_amount',
'oldfieldtype': u'Currency',
'permlevel': 1,
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'base_ref_rate',
'fieldtype': 'Currency',
'idx': 10,
'label': 'Ref Rate*',
'oldfieldname': 'base_ref_rate',
'oldfieldtype': 'Currency',
'doctype': u'DocField',
'fieldname': u'base_ref_rate',
'fieldtype': u'Currency',
'label': u'Price List Rate*',
'oldfieldname': u'base_ref_rate',
'oldfieldtype': u'Currency',
'permlevel': 1,
'print_hide': 1
},
# DocField
{
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldname': 'basic_rate',
'fieldtype': 'Currency',
'idx': 11,
'colour': u'White:FFF',
'doctype': u'DocField',
'fieldname': u'basic_rate',
'fieldtype': u'Currency',
'in_filter': 0,
'label': 'Basic Rate*',
'oldfieldname': 'basic_rate',
'oldfieldtype': 'Currency',
'label': u'Basic Rate*',
'oldfieldname': u'basic_rate',
'oldfieldtype': u'Currency',
'permlevel': 0,
'print_hide': 1,
'reqd': 1,
'search_index': 0,
'trigger': 'Client'
'trigger': u'Client'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'amount',
'fieldtype': 'Currency',
'idx': 12,
'label': 'Amount*',
'oldfieldname': 'amount',
'oldfieldtype': 'Currency',
'doctype': u'DocField',
'fieldname': u'amount',
'fieldtype': u'Currency',
'label': u'Amount*',
'oldfieldname': u'amount',
'oldfieldtype': u'Currency',
'permlevel': 1,
'print_hide': 1,
'reqd': 1
@ -215,167 +205,158 @@
# DocField
{
'doctype': 'DocField',
'fieldname': 'warehouse',
'fieldtype': 'Link',
'doctype': u'DocField',
'fieldname': u'warehouse',
'fieldtype': u'Link',
'hidden': 0,
'idx': 13,
'label': 'Warehouse',
'oldfieldname': 'warehouse',
'oldfieldtype': 'Link',
'options': 'Warehouse',
'label': u'Warehouse',
'oldfieldname': u'warehouse',
'oldfieldtype': u'Link',
'options': u'Warehouse',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldname': 'income_account',
'fieldtype': 'Link',
'idx': 14,
'colour': u'White:FFF',
'doctype': u'DocField',
'fieldname': u'income_account',
'fieldtype': u'Link',
'in_filter': 1,
'label': 'Income Account',
'oldfieldname': 'income_account',
'oldfieldtype': 'Link',
'options': 'Account',
'label': u'Income Account',
'oldfieldname': u'income_account',
'oldfieldtype': u'Link',
'options': u'Account',
'permlevel': 0,
'print_hide': 1,
'reqd': 1,
'search_index': 1,
'trigger': 'Client',
'width': '120px'
'trigger': u'Client',
'width': u'120px'
},
# DocField
{
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldname': 'cost_center',
'fieldtype': 'Link',
'idx': 15,
'colour': u'White:FFF',
'default': u'Purchase - TC',
'doctype': u'DocField',
'fieldname': u'cost_center',
'fieldtype': u'Link',
'in_filter': 1,
'label': 'Cost Center',
'oldfieldname': 'cost_center',
'oldfieldtype': 'Link',
'options': 'Cost Center',
'label': u'Cost Center',
'oldfieldname': u'cost_center',
'oldfieldtype': u'Link',
'options': u'Cost Center',
'permlevel': 0,
'print_hide': 1,
'reqd': 0,
'search_index': 1,
'trigger': 'Client',
'width': '120px'
'trigger': u'Client',
'width': u'120px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'serial_no',
'fieldtype': 'Small Text',
'idx': 16,
'label': 'Serial No',
'oldfieldname': 'serial_no',
'oldfieldtype': 'Small Text',
'permlevel': 0,
'print_hide': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'batch_no',
'fieldtype': 'Link',
'idx': 17,
'label': 'Batch No',
'options': 'Batch',
'permlevel': 0,
'print_hide': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'item_group',
'fieldtype': 'Link',
'idx': 18,
'doctype': u'DocField',
'fieldname': u'serial_no',
'fieldtype': u'Small Text',
'in_filter': 1,
'label': 'Item Group',
'oldfieldname': 'item_group',
'oldfieldtype': 'Link',
'options': 'Item Group',
'permlevel': 1,
'print_hide': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'brand',
'fieldtype': 'Data',
'idx': 19,
'in_filter': 1,
'label': 'Brand Name',
'oldfieldname': 'brand',
'oldfieldtype': 'Data',
'label': u'Serial No',
'oldfieldname': u'serial_no',
'oldfieldtype': u'Small Text',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'actual_qty',
'fieldtype': 'Currency',
'idx': 20,
'label': 'Available Qty at Warehouse',
'oldfieldname': 'actual_qty',
'oldfieldtype': 'Currency',
'permlevel': 1,
'doctype': u'DocField',
'fieldname': u'batch_no',
'fieldtype': u'Link',
'label': u'Batch No',
'options': u'Batch',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'delivered_qty',
'fieldtype': 'Currency',
'idx': 21,
'label': 'Delivered Qty',
'oldfieldname': 'delivered_qty',
'oldfieldtype': 'Currency',
'permlevel': 1,
'print_hide': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'sales_order',
'fieldtype': 'Link',
'idx': 22,
'doctype': u'DocField',
'fieldname': u'item_group',
'fieldtype': u'Link',
'hidden': 1,
'in_filter': 1,
'label': 'Sales Order',
'oldfieldname': 'sales_order',
'oldfieldtype': 'Link',
'options': 'Sales Order',
'label': u'Item Group',
'oldfieldname': u'item_group',
'oldfieldtype': u'Link',
'options': u'Item Group',
'permlevel': 1,
'print_hide': 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'brand',
'fieldtype': u'Data',
'hidden': 1,
'in_filter': 1,
'label': u'Brand Name',
'oldfieldname': u'brand',
'oldfieldtype': u'Data',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'actual_qty',
'fieldtype': u'Currency',
'label': u'Available Qty at Warehouse',
'oldfieldname': u'actual_qty',
'oldfieldtype': u'Currency',
'permlevel': 1,
'print_hide': 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'delivered_qty',
'fieldtype': u'Currency',
'label': u'Delivered Qty',
'oldfieldname': u'delivered_qty',
'oldfieldtype': u'Currency',
'permlevel': 1,
'print_hide': 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'sales_order',
'fieldtype': u'Link',
'in_filter': 1,
'label': u'Sales Order',
'oldfieldname': u'sales_order',
'oldfieldtype': u'Link',
'options': u'Sales Order',
'permlevel': 1,
'print_hide': 1,
'search_index': 1,
'trigger': 'Client'
'trigger': u'Client'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'so_detail',
'fieldtype': 'Data',
'doctype': u'DocField',
'fieldname': u'so_detail',
'fieldtype': u'Data',
'hidden': 1,
'idx': 23,
'in_filter': 1,
'label': 'SO Detail ',
'oldfieldname': 'so_detail',
'oldfieldtype': 'Data',
'label': u'SO Detail ',
'oldfieldname': u'so_detail',
'oldfieldtype': u'Data',
'permlevel': 1,
'print_hide': 1,
'search_index': 1
@ -383,32 +364,30 @@
# DocField
{
'doctype': 'DocField',
'fieldname': 'delivery_note',
'fieldtype': 'Link',
'idx': 24,
'doctype': u'DocField',
'fieldname': u'delivery_note',
'fieldtype': u'Link',
'in_filter': 1,
'label': 'Delivery Note',
'oldfieldname': 'delivery_note',
'oldfieldtype': 'Link',
'options': 'Delivery Note',
'label': u'Delivery Note',
'oldfieldname': u'delivery_note',
'oldfieldtype': u'Link',
'options': u'Delivery Note',
'permlevel': 1,
'print_hide': 1,
'search_index': 1,
'trigger': 'Client'
'trigger': u'Client'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'dn_detail',
'fieldtype': 'Data',
'doctype': u'DocField',
'fieldname': u'dn_detail',
'fieldtype': u'Data',
'hidden': 1,
'idx': 25,
'in_filter': 1,
'label': 'DN Detail',
'oldfieldname': 'dn_detail',
'oldfieldtype': 'Data',
'label': u'DN Detail',
'oldfieldname': u'dn_detail',
'oldfieldtype': u'Data',
'permlevel': 1,
'print_hide': 1,
'search_index': 1
@ -416,29 +395,27 @@
# DocField
{
'doctype': 'DocField',
'fieldname': 'item_tax_rate',
'fieldtype': 'Small Text',
'doctype': u'DocField',
'fieldname': u'item_tax_rate',
'fieldtype': u'Small Text',
'hidden': 1,
'idx': 26,
'label': 'Item Tax Rate',
'oldfieldname': 'item_tax_rate',
'oldfieldtype': 'Small Text',
'label': u'Item Tax Rate',
'oldfieldname': u'item_tax_rate',
'oldfieldtype': u'Small Text',
'permlevel': 1,
'print_hide': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'clear_pending',
'fieldtype': 'Check',
'doctype': u'DocField',
'fieldname': u'clear_pending',
'fieldtype': u'Check',
'hidden': 1,
'idx': 27,
'label': 'Clear Pending',
'label': u'Clear Pending',
'no_copy': 1,
'oldfieldname': 'clear_pending',
'oldfieldtype': 'Check',
'oldfieldname': u'clear_pending',
'oldfieldtype': u'Check',
'permlevel': 1,
'print_hide': 1
},
@ -446,12 +423,10 @@
# DocField
{
'allow_on_submit': 1,
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldname': 'page_break',
'fieldtype': 'Check',
'idx': 28,
'label': 'Page Break',
'doctype': u'DocField',
'fieldname': u'page_break',
'fieldtype': u'Check',
'label': u'Page Break',
'no_copy': 1,
'permlevel': 0,
'print_hide': 1,

View File

@ -5,166 +5,169 @@
{
'creation': '2010-08-08 17:09:20',
'docstatus': 0,
'modified': '2011-12-28 17:33:30',
'modified_by': 'Administrator',
'owner': 'Administrator'
'modified': '2012-02-23 15:49:43',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all DocType
{
'autoname': 'INVTD.######',
'colour': 'White:FFF',
'default_print_format': 'Standard',
'autoname': u'INVTD.######',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'hide_heading': 1,
'istable': 1,
'module': 'Accounts',
'module': u'Accounts',
'name': '__common__',
'section_style': 'Tray',
'server_code_error': ' ',
'section_style': u'Tray',
'server_code_error': u' ',
'show_in_menu': 0,
'version': 18
'version': 20
},
# These values are common for all DocField
{
'doctype': 'DocField',
'doctype': u'DocField',
'name': '__common__',
'parent': 'RV Tax Detail',
'parentfield': 'fields',
'parenttype': 'DocType'
'parent': u'RV Tax Detail',
'parentfield': u'fields',
'parenttype': u'DocType'
},
# DocType, RV Tax Detail
{
'doctype': 'DocType',
'name': 'RV Tax Detail'
'name': u'RV Tax Detail'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'charge_type',
'fieldtype': 'Select',
'label': 'Type',
'oldfieldname': 'charge_type',
'oldfieldtype': 'Select',
'options': '\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total',
'doctype': u'DocField',
'fieldname': u'charge_type',
'fieldtype': u'Select',
'label': u'Type',
'oldfieldname': u'charge_type',
'oldfieldtype': u'Select',
'options': u'\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total',
'permlevel': 0,
'reqd': 1,
'trigger': 'Client'
'trigger': u'Client'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'account_head',
'fieldtype': 'Link',
'label': 'Account Head',
'oldfieldname': 'account_head',
'oldfieldtype': 'Link',
'options': 'Account',
'doctype': u'DocField',
'fieldname': u'account_head',
'fieldtype': u'Link',
'label': u'Account Head',
'oldfieldname': u'account_head',
'oldfieldtype': u'Link',
'options': u'Account',
'permlevel': 0,
'reqd': 1,
'trigger': 'Client'
'search_index': 1,
'trigger': u'Client'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'cost_center_other_charges',
'fieldtype': 'Link',
'label': 'Cost Center',
'oldfieldname': 'cost_center_other_charges',
'oldfieldtype': 'Link',
'options': 'Cost Center',
'doctype': u'DocField',
'fieldname': u'cost_center_other_charges',
'fieldtype': u'Link',
'label': u'Cost Center',
'oldfieldname': u'cost_center_other_charges',
'oldfieldtype': u'Link',
'options': u'Cost Center',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'description',
'fieldtype': 'Small Text',
'label': 'Description',
'oldfieldname': 'description',
'oldfieldtype': 'Small Text',
'doctype': u'DocField',
'fieldname': u'description',
'fieldtype': u'Small Text',
'label': u'Description',
'oldfieldname': u'description',
'oldfieldtype': u'Small Text',
'permlevel': 0,
'reqd': 1,
'width': '300px'
'width': u'300px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'rate',
'fieldtype': 'Currency',
'label': 'Rate',
'oldfieldname': 'rate',
'oldfieldtype': 'Currency',
'doctype': u'DocField',
'fieldname': u'rate',
'fieldtype': u'Currency',
'label': u'Rate',
'oldfieldname': u'rate',
'oldfieldtype': u'Currency',
'permlevel': 0,
'reqd': 0,
'trigger': 'Client'
'trigger': u'Client'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'tax_amount',
'fieldtype': 'Currency',
'label': 'Amount*',
'oldfieldname': 'tax_amount',
'oldfieldtype': 'Currency',
'doctype': u'DocField',
'fieldname': u'tax_amount',
'fieldtype': u'Currency',
'label': u'Amount*',
'oldfieldname': u'tax_amount',
'oldfieldtype': u'Currency',
'permlevel': 0,
'reqd': 0,
'trigger': 'Client'
'trigger': u'Client'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'total',
'fieldtype': 'Currency',
'label': 'Total*',
'oldfieldname': 'total',
'oldfieldtype': 'Currency',
'doctype': u'DocField',
'fieldname': u'total',
'fieldtype': u'Currency',
'label': u'Total*',
'oldfieldname': u'total',
'oldfieldtype': u'Currency',
'permlevel': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'row_id',
'fieldtype': 'Data',
'doctype': u'DocField',
'fieldname': u'row_id',
'fieldtype': u'Data',
'hidden': 0,
'label': 'Enter Row',
'oldfieldname': 'row_id',
'oldfieldtype': 'Data',
'label': u'Enter Row',
'oldfieldname': u'row_id',
'oldfieldtype': u'Data',
'permlevel': 0,
'trigger': 'Client'
'trigger': u'Client'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'item_wise_tax_detail',
'fieldtype': 'Small Text',
'label': 'Item Wise Tax Detail ',
'oldfieldname': 'item_wise_tax_detail',
'oldfieldtype': 'Small Text',
'colour': u'White:FFF',
'doctype': u'DocField',
'fieldname': u'item_wise_tax_detail',
'fieldtype': u'Small Text',
'hidden': 1,
'label': u'Item Wise Tax Detail ',
'oldfieldname': u'item_wise_tax_detail',
'oldfieldtype': u'Small Text',
'permlevel': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'parenttype',
'fieldtype': 'Data',
'doctype': u'DocField',
'fieldname': u'parenttype',
'fieldtype': u'Data',
'hidden': 1,
'in_filter': 1,
'label': 'Parenttype',
'oldfieldname': 'parenttype',
'oldfieldtype': 'Data',
'label': u'Parenttype',
'oldfieldname': u'parenttype',
'oldfieldtype': u'Data',
'permlevel': 0,
'print_hide': 1,
'search_index': 1
@ -172,16 +175,16 @@
# DocField
{
'colour': 'White:FFF',
'description': 'Cheating Field\nPlease do not delete ',
'doctype': 'DocField',
'fieldname': 'total_tax_amount',
'fieldtype': 'Currency',
'colour': u'White:FFF',
'description': u'Cheating Field\nPlease do not delete ',
'doctype': u'DocField',
'fieldname': u'total_tax_amount',
'fieldtype': u'Currency',
'hidden': 1,
'label': 'Total Tax Amount',
'label': u'Total Tax Amount',
'no_copy': 1,
'oldfieldname': 'total_tax_amount',
'oldfieldtype': 'Currency',
'oldfieldname': u'total_tax_amount',
'oldfieldtype': u'Currency',
'permlevel': 0,
'print_hide': 1,
'report_hide': 1
@ -189,15 +192,15 @@
# DocField
{
'description': 'Cheating Field\nPlease do not delete ',
'doctype': 'DocField',
'fieldname': 'total_amount',
'fieldtype': 'Currency',
'description': u'Cheating Field\nPlease do not delete ',
'doctype': u'DocField',
'fieldname': u'total_amount',
'fieldtype': u'Currency',
'hidden': 1,
'label': 'Total Amount',
'label': u'Total Amount',
'no_copy': 1,
'oldfieldname': 'total_amount',
'oldfieldtype': 'Currency',
'oldfieldname': u'total_amount',
'oldfieldtype': u'Currency',
'permlevel': 0,
'print_hide': 1,
'report_hide': 1
@ -206,11 +209,11 @@
# DocField
{
'allow_on_submit': 0,
'description': 'If checked, the tax amount will be considered as already included in the Print Rate / Print Amount',
'doctype': 'DocField',
'fieldname': 'included_in_print_rate',
'fieldtype': 'Check',
'label': 'Included in Print Rate',
'description': u'If checked, the tax amount will be considered as already included in the Print Rate / Print Amount',
'doctype': u'DocField',
'fieldname': u'included_in_print_rate',
'fieldtype': u'Check',
'label': u'Included in Print Rate',
'no_column': 0,
'no_copy': 1,
'permlevel': 0,

View File

@ -31,7 +31,6 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
hide_field(['customer','customer_address','contact_person', 'customer_name','contact_display', 'customer_group']);
}
}
}
cur_frm.cscript.onload_post_render = function(doc, dt, dn) {
@ -68,6 +67,12 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
cur_frm.clear_custom_buttons();
var callback = function() {
cur_frm.cscript.dynamic_label(doc, cdt, cdn);
}
cur_frm.cscript.hide_price_list_currency(doc, cdt, cdn, callback);
if(doc.docstatus == 1 && doc.status!='Order Lost') {
cur_frm.add_custom_button('Make Sales Order', cur_frm.cscript['Make Sales Order']);
cur_frm.add_custom_button('Set as Lost', cur_frm.cscript['Declare Order Lost']);

View File

@ -60,9 +60,10 @@ class DocType(TransactionBase):
# Get Item Details
# -----------------
def get_item_details(self, item_code=None):
if item_code:
return get_obj('Sales Common').get_item_details(item_code, self)
def get_item_details(self, args=None):
args = eval(args)
if args['item_code']:
return get_obj('Sales Common').get_item_details(args, self)
else:
obj = get_obj('Sales Common')
for doc in self.doclist:
@ -77,6 +78,13 @@ class DocType(TransactionBase):
# --------------------------------------------------------------
def get_adj_percent(self, arg=''):
get_obj('Sales Common').get_adj_percent(self)
def get_comp_base_currency(self):
return get_obj('Sales Common').get_comp_base_currency(self.doc.company)
def get_price_list_currency(self):
return get_obj('Sales Common').get_price_list_currency(self.doc.price_list_name, self.doc.company)
# OTHER CHARGES TRIGGER FUNCTIONS
@ -204,7 +212,6 @@ class DocType(TransactionBase):
def on_update(self):
# Add to calendar
#if self.doc.contact_date and self.doc.last_contact_date != self.doc.contact_date:
if self.doc.contact_date and self.doc.contact_date_ref != self.doc.contact_date:
if self.doc.contact_by:
self.add_calendar_event()

File diff suppressed because it is too large Load Diff

View File

@ -5,343 +5,330 @@
{
'creation': '2010-08-08 17:09:18',
'docstatus': 0,
'modified': '2011-02-23 11:28:36',
'modified_by': 'Administrator',
'owner': 'Administrator'
'modified': '2012-02-24 13:21:21',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all DocType
{
'autoname': 'QUOD/.#####',
'colour': 'White:FFF',
'autoname': u'QUOD/.#####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'is_transaction_doc': 0,
'istable': 1,
'module': 'Selling',
'module': u'Selling',
'name': '__common__',
'section_style': 'Tray',
'server_code_error': ' ',
'section_style': u'Tray',
'server_code_error': u' ',
'show_in_menu': 0,
'version': 26
'version': 30
},
# These values are common for all DocField
{
'doctype': 'DocField',
'doctype': u'DocField',
'name': '__common__',
'parent': 'Quotation Detail',
'parentfield': 'fields',
'parenttype': 'DocType'
'parent': u'Quotation Detail',
'parentfield': u'fields',
'parenttype': u'DocType'
},
# DocType, Quotation Detail
{
'doctype': 'DocType',
'name': 'Quotation Detail'
'name': u'Quotation Detail'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'item_code',
'fieldtype': 'Link',
'doctype': u'DocField',
'fieldname': u'item_code',
'fieldtype': u'Link',
'hidden': 0,
'idx': 1,
'in_filter': 1,
'label': 'Item Code',
'oldfieldname': 'item_code',
'oldfieldtype': 'Link',
'options': 'Item',
'label': u'Item Code',
'oldfieldname': u'item_code',
'oldfieldtype': u'Link',
'options': u'Item',
'permlevel': 0,
'print_hide': 0,
'reqd': 1,
'search_index': 1,
'trigger': 'Client',
'width': '150px'
'trigger': u'Client',
'width': u'150px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'item_name',
'fieldtype': 'Data',
'idx': 2,
'doctype': u'DocField',
'fieldname': u'item_name',
'fieldtype': u'Data',
'in_filter': 1,
'label': 'Item Name',
'oldfieldname': 'item_name',
'oldfieldtype': 'Data',
'label': u'Item Name',
'oldfieldname': u'item_name',
'oldfieldtype': u'Data',
'permlevel': 0,
'print_hide': 1,
'reqd': 1,
'search_index': 0,
'width': '150px'
'search_index': 1,
'width': u'150px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'description',
'fieldtype': 'Small Text',
'idx': 3,
'label': 'Description',
'oldfieldname': 'description',
'oldfieldtype': 'Small Text',
'doctype': u'DocField',
'fieldname': u'description',
'fieldtype': u'Small Text',
'label': u'Description',
'oldfieldname': u'description',
'oldfieldtype': u'Small Text',
'permlevel': 0,
'print_hide': 0,
'reqd': 1,
'width': '300px'
'width': u'300px'
},
# DocField
{
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'qty',
'fieldtype': 'Currency',
'idx': 4,
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'ref_rate',
'fieldtype': u'Currency',
'label': u'Price List Rate',
'oldfieldname': u'ref_rate',
'oldfieldtype': u'Currency',
'permlevel': 0,
'print_hide': 1,
'reqd': 0,
'trigger': u'Client',
'width': u'100px'
},
# DocField
{
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'adj_rate',
'fieldtype': u'Float',
'label': u'Discount (%)',
'oldfieldname': u'adj_rate',
'oldfieldtype': u'Float',
'permlevel': 0,
'print_hide': 0,
'trigger': u'Client',
'width': u'100px'
},
# DocField
{
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'export_rate',
'fieldtype': u'Currency',
'in_filter': 0,
'label': 'Quantity',
'oldfieldname': 'qty',
'oldfieldtype': 'Currency',
'label': u'Rate',
'oldfieldname': u'export_rate',
'oldfieldtype': u'Currency',
'permlevel': 0,
'print_hide': 0,
'reqd': 0,
'search_index': 0,
'trigger': u'Client',
'width': u'100px'
},
# DocField
{
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'qty',
'fieldtype': u'Currency',
'in_filter': 0,
'label': u'Quantity',
'oldfieldname': u'qty',
'oldfieldtype': u'Currency',
'permlevel': 0,
'print_hide': 0,
'reqd': 1,
'search_index': 0,
'trigger': 'Client',
'width': '100px'
'trigger': u'Client',
'width': u'100px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'stock_uom',
'fieldtype': 'Data',
'idx': 5,
'label': 'UOM',
'oldfieldname': 'stock_uom',
'oldfieldtype': 'Data',
'permlevel': 1,
'reqd': 0,
'width': '100px'
},
# DocField
{
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'ref_rate',
'fieldtype': 'Currency',
'idx': 6,
'label': 'Ref Rate',
'oldfieldname': 'ref_rate',
'oldfieldtype': 'Currency',
'permlevel': 0,
'print_hide': 1,
'reqd': 0,
'trigger': 'Client',
'width': '100px'
},
# DocField
{
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'adj_rate',
'fieldtype': 'Float',
'idx': 7,
'label': 'Discount (%)',
'oldfieldname': 'adj_rate',
'oldfieldtype': 'Float',
'permlevel': 0,
'print_hide': 1,
'trigger': 'Client',
'width': '100px'
},
# DocField
{
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'export_rate',
'fieldtype': 'Currency',
'idx': 8,
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'export_amount',
'fieldtype': u'Currency',
'in_filter': 0,
'label': 'Rate',
'oldfieldname': 'export_rate',
'oldfieldtype': 'Currency',
'permlevel': 0,
'print_hide': 0,
'reqd': 0,
'search_index': 0,
'trigger': 'Client',
'width': '100px'
},
# DocField
{
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'export_amount',
'fieldtype': 'Currency',
'idx': 9,
'in_filter': 0,
'label': 'Amount',
'oldfieldname': 'export_amount',
'oldfieldtype': 'Currency',
'label': u'Amount',
'oldfieldname': u'export_amount',
'oldfieldtype': u'Currency',
'permlevel': 1,
'print_hide': 0,
'reqd': 0,
'search_index': 0,
'width': '100px'
'width': u'100px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'base_ref_rate',
'fieldtype': 'Currency',
'idx': 10,
'label': 'Ref Rate*',
'oldfieldname': 'base_ref_rate',
'oldfieldtype': 'Currency',
'doctype': u'DocField',
'fieldname': u'base_ref_rate',
'fieldtype': u'Currency',
'label': u'Price List Rate*',
'oldfieldname': u'base_ref_rate',
'oldfieldtype': u'Currency',
'permlevel': 1,
'print_hide': 1,
'width': '100px'
'width': u'100px'
},
# DocField
{
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'basic_rate',
'fieldtype': 'Currency',
'idx': 11,
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'basic_rate',
'fieldtype': u'Currency',
'in_filter': 0,
'label': 'Basic Rate*',
'oldfieldname': 'basic_rate',
'oldfieldtype': 'Currency',
'label': u'Basic Rate*',
'oldfieldname': u'basic_rate',
'oldfieldtype': u'Currency',
'permlevel': 0,
'print_hide': 1,
'reqd': 0,
'search_index': 0,
'trigger': 'Client',
'width': '100px'
'trigger': u'Client',
'width': u'100px'
},
# DocField
{
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'amount',
'fieldtype': 'Currency',
'idx': 12,
'colour': u'White:FFF',
'doctype': u'DocField',
'fieldname': u'stock_uom',
'fieldtype': u'Data',
'label': u'UOM',
'oldfieldname': u'stock_uom',
'oldfieldtype': u'Data',
'permlevel': 1,
'print_hide': 0,
'reqd': 0,
'width': u'100px'
},
# DocField
{
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'amount',
'fieldtype': u'Currency',
'in_filter': 0,
'label': 'Amount*',
'oldfieldname': 'amount',
'oldfieldtype': 'Currency',
'label': u'Amount*',
'oldfieldname': u'amount',
'oldfieldtype': u'Currency',
'permlevel': 1,
'print_hide': 1,
'reqd': 0,
'search_index': 0,
'trigger': 'Client',
'width': '100px'
'trigger': u'Client',
'width': u'100px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'item_group',
'fieldtype': 'Link',
'idx': 13,
'doctype': u'DocField',
'fieldname': u'item_group',
'fieldtype': u'Link',
'hidden': 1,
'in_filter': 1,
'label': 'Item Group',
'oldfieldname': 'item_group',
'oldfieldtype': 'Link',
'options': 'Item Group',
'label': u'Item Group',
'oldfieldname': u'item_group',
'oldfieldtype': u'Link',
'options': u'Item Group',
'permlevel': 1,
'print_hide': 1,
'search_index': 0
'search_index': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'brand',
'fieldtype': 'Link',
'idx': 14,
'doctype': u'DocField',
'fieldname': u'brand',
'fieldtype': u'Link',
'hidden': 1,
'in_filter': 1,
'label': 'Brand',
'oldfieldname': 'brand',
'oldfieldtype': 'Link',
'options': 'Brand',
'label': u'Brand',
'oldfieldname': u'brand',
'oldfieldtype': u'Link',
'options': u'Brand',
'permlevel': 1,
'print_hide': 1,
'search_index': 0,
'width': '150px'
'search_index': 1,
'width': u'150px'
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'item_tax_rate',
'fieldtype': u'Small Text',
'hidden': 1,
'label': u'Item Tax Rate',
'oldfieldname': u'item_tax_rate',
'oldfieldtype': u'Small Text',
'permlevel': 1,
'print_hide': 1,
'report_hide': 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'prevdoc_docname',
'fieldtype': u'Data',
'label': u'Against Docname',
'no_copy': 1,
'oldfieldname': u'prevdoc_docname',
'oldfieldtype': u'Data',
'permlevel': 1,
'print_hide': 1,
'report_hide': 0,
'width': u'150px'
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'prevdoc_doctype',
'fieldtype': u'Data',
'hidden': 1,
'label': u'Against Doctype',
'no_copy': 1,
'oldfieldname': u'prevdoc_doctype',
'oldfieldtype': u'Data',
'permlevel': 1,
'print_hide': 1,
'report_hide': 0,
'width': u'150px'
},
# DocField
{
'allow_on_submit': 1,
'doctype': 'DocField',
'fieldname': 'page_break',
'fieldtype': 'Check',
'doctype': u'DocField',
'fieldname': u'page_break',
'fieldtype': u'Check',
'hidden': 0,
'idx': 15,
'label': 'Page Break',
'label': u'Page Break',
'no_copy': 1,
'oldfieldname': 'page_break',
'oldfieldtype': 'Check',
'oldfieldname': u'page_break',
'oldfieldtype': u'Check',
'permlevel': 0,
'print_hide': 1,
'report_hide': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'item_tax_rate',
'fieldtype': 'Small Text',
'hidden': 1,
'idx': 16,
'label': 'Item Tax Rate',
'oldfieldname': 'item_tax_rate',
'oldfieldtype': 'Small Text',
'permlevel': 1,
'print_hide': 1,
'report_hide': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'prevdoc_docname',
'fieldtype': 'Data',
'idx': 17,
'label': 'Against Docname',
'no_copy': 1,
'oldfieldname': 'prevdoc_docname',
'oldfieldtype': 'Data',
'permlevel': 1,
'print_hide': 1,
'report_hide': 0,
'width': '150px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'prevdoc_doctype',
'fieldtype': 'Data',
'hidden': 1,
'idx': 18,
'label': 'Against Doctype',
'no_copy': 1,
'oldfieldname': 'prevdoc_doctype',
'oldfieldtype': 'Data',
'permlevel': 1,
'print_hide': 1,
'report_hide': 0,
'width': '150px'
}
]

View File

@ -45,7 +45,7 @@ cur_frm.cscript.update_item_details = function(doc, dt, dn, callback) {
doc = locals[doc.doctype][doc.name];
if(!cur_frm.doc.__islocal) return;
var children = getchildren(cur_frm.cscript.tname, doc.name, cur_frm.cscript.fname);
if(children) {
if(children.length) {
$c_obj(make_doclist(doc.doctype, doc.name), 'get_item_details', '',
function(r, rt) {
if(!r.exc) {
@ -58,13 +58,6 @@ cur_frm.cscript.update_item_details = function(doc, dt, dn, callback) {
}
// -----------------
// Shipping Address
// -----------------
cur_frm.add_fetch('company', 'default_currency', 'currency');
cur_frm.add_fetch('company', 'default_currency', 'price_list_currency');
// ============== Customer and its primary contact Details ============================
@ -83,6 +76,88 @@ cur_frm.cscript.customer = function(doc, cdt, cdn) {
}
}
var set_dynamic_label_par = function(doc, cdt, cdn, base_curr) {
//parent flds
par_cols_base = {'net_total': 'Net Total', 'other_charges_total': 'Other Charges Total',
'grand_total': 'Grand Total', 'rounded_total': 'Rounded Total', 'in_words': 'In Words'}
par_cols_export = {'grand_total_export': 'Grand Total', 'rounded_total_export': 'Rounded Total', 'in_words_export': 'In Words'};
for (d in par_cols_base) cur_frm.fields_dict[d].label_area.innerHTML = par_cols_base[d]+' (' + base_curr + ')';
for (d in par_cols_export) cur_frm.fields_dict[d].label_area.innerHTML = par_cols_export[d]+' (' + doc.currency + ')';
cur_frm.fields_dict['conversion_rate'].label_area.innerHTML = "Conversion Rate (" + doc.currency +' -> '+ base_curr + ')';
cur_frm.fields_dict['plc_conversion_rate'].label_area.innerHTML = 'Price List Currency Conversion Rate (' + doc.price_list_currency +' -> '+ base_curr + ')';
if (doc.doctype == 'Receivable Voucher') {
cur_frm.fields_dict['total_advance'].label_area.innerHTML = 'Total Advance (' + base_curr + ')';
cur_frm.fields_dict['outstanding_amount'].label_area.innerHTML = 'Outstanding Amount (' + base_curr + ')';
}
}
var set_dynamic_label_child = function(doc, cdt, cdn, base_curr) {
// item table flds
item_cols_base = {'basic_rate': 'Basic Rate', 'base_ref_rate': 'Price List Rate', 'amount': 'Amount'};
item_cols_export = {'export_rate': 'Basic Rate', 'ref_rate': 'Price List Rate', 'export_amount': 'Amount'};
for (d in item_cols_base) $('[data-grid-fieldname="'+cur_frm.cscript.tname+'-'+d+'"]').html(item_cols_base[d]+' ('+base_curr+')');
for (d in item_cols_export) $('[data-grid-fieldname="'+cur_frm.cscript.tname+'-'+d+'"]').html(item_cols_export[d]+' ('+doc.currency+')');
var hide = (doc.currency == sys_defaults['currency']) ? false : true;
for (f in item_cols_base) cur_frm.fields_dict[cur_frm.cscript.fname].grid.set_column_disp(f, hide);
//tax table flds
tax_cols = {'tax_amount': 'Amount', 'total': 'Total'};
for (d in tax_cols) $('[data-grid-fieldname="RV Tax Detail-'+d+'"]').html(tax_cols[d]+' ('+base_curr+')');
}
// Change label dynamically based on currency
//------------------------------------------------------------------
cur_frm.cscript.dynamic_label = function(doc, cdt, cdn) {
var callback = function(r, rt) {
if (r.message) base_curr = r.message;
else base_curr = sys_defaults['currency'];
set_dynamic_label_par(doc, cdt, cdn, base_curr);
set_dynamic_label_child(doc, cdt, cdn, base_curr);
}
if (doc.company == sys_defaults['company']) callback('', '');
else $c_obj(make_doclist(doc.doctype, doc.name), 'get_comp_base_currency', '', callback);
}
// hide / unhide price list currency based on availability of price list in customer's currency
//---------------------------------------------------------------------------------------------------
cur_frm.cscript.hide_price_list_currency = function(doc, cdt, cdn, callback1) {
if (doc.price_list_name && doc.currency) {
var callback = function(r, rt) {
pl_currency = r.message[0]?r.message[0]:[];
if (pl_currency.length==1) {
if (pl_currency[0] == doc.currency) set_multiple(cdt, cdn, {price_list_currency:doc.currency, plc_conversion_rate:doc.conversion_rate});
else if (pl_currency[0] = r.message[1]) set_multiple(cdt, cdn, {price_list_currency:pl_currency[0], plc_conversion_rate:1})
hide_field(['price_list_currency', 'plc_conversion_rate']);
} else unhide_field(['price_list_currency', 'plc_conversion_rate']);
if (r.message[1] == doc.currency) {
set_multiple(cdt, cdn, {conversion_rate:1});
hide_field(['conversion_rate', 'grand_total_export', 'in_words_export', 'rounded_total_export']);
} else unhide_field(['conversion_rate', 'grand_total_export', 'in_words_export', 'rounded_total_export']);
if (r.message[1] == doc.price_list_currency) {
set_multiple(cdt, cdn, {plc_conversion_rate:1});
hide_field('plc_conversion_rate');
} else unhide_field('plc_conversion_rate');
callback1()
}
$c_obj(make_doclist(doc.doctype, doc.name), 'get_price_list_currency', '', callback);
}
}
//====================opens territory tree page ==================
cur_frm.cscript.TerritoryHelp = function(doc,dt,dn){
var call_back = function(){
@ -107,29 +182,42 @@ cur_frm.cscript.CGHelp = function(doc,dt,dn){
// =====================================================================================================
// ********************* CURRENCY ******************************
cur_frm.cscript.currency = function(doc, cdt, cdn) {
cur_frm.cscript.price_list_name(doc, cdt, cdn);
cur_frm.cscript.currency = function(doc, cdt, cdn) {
cur_frm.cscript.price_list_name(doc, cdt, cdn);
}
cur_frm.cscript.price_list_currency = cur_frm.cscript.currency;
cur_frm.cscript.conversion_rate = cur_frm.cscript.currency;
cur_frm.cscript.plc_conversion_rate = cur_frm.cscript.currency;
cur_frm.cscript.company = function(doc, dt, dn) {
var callback = function(r, rt) {
var doc = locals[dt][dn];
set_multiple(doc.doctype, doc.name, {currency:r.message,price_list_currency:r.message});
cur_frm.cscript.currency(doc, cdt, cdn);
}
$c_obj(make_doclist(doc.doctype, doc.name), 'get_comp_base_currency', '', callback);
}
// ******************** PRICE LIST ******************************
cur_frm.cscript.price_list_name = function(doc, cdt, cdn) {
var fname = cur_frm.cscript.fname;
var cl = getchildren(cur_frm.cscript.tname, doc.name, cur_frm.cscript.fname);
if(doc.price_list_name && doc.currency && doc.price_list_currency && doc.conversion_rate && doc.plc_conversion_rate && cl.length) {
$c_obj(make_doclist(doc.doctype, doc.name), 'get_adj_percent', '',
function(r, rt) {
refresh_field(fname);
var doc = locals[cdt][cdn];
cur_frm.cscript.recalc(doc,3); //this is to re-calculate BASIC RATE and AMOUNT on basis of changed REF RATE
}
);
var callback = function() {
var fname = cur_frm.cscript.fname;
var cl = getchildren(cur_frm.cscript.tname, doc.name, cur_frm.cscript.fname);
if(doc.price_list_name && doc.currency && doc.price_list_currency && doc.conversion_rate && doc.plc_conversion_rate) {
$c_obj(make_doclist(doc.doctype, doc.name), 'get_adj_percent', '',
function(r, rt) {
refresh_field(fname);
var doc = locals[cdt][cdn];
cur_frm.cscript.recalc(doc,3); //this is to re-calculate BASIC RATE and AMOUNT on basis of changed REF RATE
cur_frm.cscript.dynamic_label(doc, cdt, cdn);
}
);
}
}
cur_frm.cscript.hide_price_list_currency(doc, cdt, cdn, callback);
}
@ -155,7 +243,8 @@ cur_frm.cscript.item_code = function(doc, cdt, cdn) {
var callback = function(r, rt){
cur_frm.cscript.recalc(doc, 1);
}
get_server_fields('get_item_details',d.item_code, fname,doc,cdt,cdn,1,callback);
var args = {'item_code':d.item_code, 'income_account':d.income_account, 'cost_center': d.cost_center, 'warehouse': d.warehouse};
get_server_fields('get_item_details',JSON.stringify(args), fname,doc,cdt,cdn,1,callback);
}
}
if(cur_frm.cscript.custom_item_code){

View File

@ -108,13 +108,13 @@ class DocType(TransactionBase):
# Get Item Details
# ===============================================================
def get_item_details(self, item_code, obj):
def get_item_details(self, args, obj):
import json
if not obj.doc.price_list_name:
msgprint("Please Select Price List before selecting Items")
raise Exception
item = webnotes.conn.sql("select description, item_name, brand, item_group, stock_uom, default_warehouse, default_income_account, default_sales_cost_center, description_html from `tabItem` where name = '%s' and (ifnull(end_of_life,'')='' or end_of_life > now() or end_of_life = '0000-00-00') and (is_sales_item = 'Yes' or is_service_item = 'Yes')" % (item_code), as_dict=1)
tax = webnotes.conn.sql("select tax_type, tax_rate from `tabItem Tax` where parent = %s" , item_code)
item = webnotes.conn.sql("select description, item_name, brand, item_group, stock_uom, default_warehouse, default_income_account, default_sales_cost_center, description_html from `tabItem` where name = '%s' and (ifnull(end_of_life,'')='' or end_of_life > now() or end_of_life = '0000-00-00') and (is_sales_item = 'Yes' or is_service_item = 'Yes')" % (args['item_code']), as_dict=1)
tax = webnotes.conn.sql("select tax_type, tax_rate from `tabItem Tax` where parent = %s" , args['item_code'])
t = {}
for x in tax: t[x[0]] = flt(x[1])
ret = {
@ -124,9 +124,9 @@ class DocType(TransactionBase):
'brand' : item and item[0]['brand'] or '',
'stock_uom' : item and item[0]['stock_uom'] or '',
'reserved_warehouse' : item and item[0]['default_warehouse'] or '',
'warehouse' : item and item[0]['default_warehouse'] or '',
'income_account' : item and item[0]['default_income_account'] or '',
'cost_center' : item and item[0]['default_sales_cost_center'] or '',
'warehouse' : item and item[0]['default_warehouse'] or args.get('warehouse'),
'income_account' : item and item[0]['default_income_account'] or args.get('income_account'),
'cost_center' : item and item[0]['default_sales_cost_center'] or args.get('cost_center'),
'qty' : 1.00, # this is done coz if item once fetched is fetched again thn its qty shld be reset to 1
'adj_rate' : 0,
'amount' : 0,
@ -135,7 +135,7 @@ class DocType(TransactionBase):
'batch_no' : ''
}
if(obj.doc.price_list_name and item): #this is done to fetch the changed BASIC RATE and REF RATE based on PRICE LIST
base_ref_rate = self.get_ref_rate(item_code, obj.doc.price_list_name, obj.doc.price_list_currency, obj.doc.plc_conversion_rate)
base_ref_rate = self.get_ref_rate(args['item_code'], obj.doc.price_list_name, obj.doc.price_list_currency, obj.doc.plc_conversion_rate)
ret['ref_rate'] = flt(base_ref_rate)/flt(obj.doc.conversion_rate)
ret['export_rate'] = flt(base_ref_rate)/flt(obj.doc.conversion_rate)
ret['base_ref_rate'] = flt(base_ref_rate)
@ -158,8 +158,22 @@ class DocType(TransactionBase):
d.basic_rate = flt(base_ref_rate)
d.base_ref_rate = flt(base_ref_rate)
d.export_rate = flt(base_ref_rate)/flt(obj.doc.conversion_rate)
d.amount = flt(d.qty)*flt(base_ref_rate)
d.export_amount = flt(d.qty)*flt(base_ref_rate)/flt(obj.doc.conversion_rate)
def get_comp_base_currency(self, comp):
""" get default currency of company"""
return webnotes.conn.sql("select default_currency from `tabCompany` where name = %s", comp)[0][0]
def get_price_list_currency(self, price_list, comp):
""" Get all currency in which price list is maintained"""
plc = webnotes.conn.sql("select distinct ref_currency from `tabRef Rate Detail` where price_list_name = %s", price_list)
plc = [d[0] for d in plc]
base_currency = self.get_comp_base_currency(comp)
return plc, base_currency
# Load Default Taxes
# ====================
def load_default_taxes(self, obj):

View File

@ -22,21 +22,26 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
if(doc.__islocal){
hide_field(['customer_address','contact_person','customer_name','address_display','contact_display','contact_mobile','contact_email','territory','customer_group','shipping_address']);
}
}
cur_frm.cscript.onload_post_render = function(doc, cdt, cdn) {
if(doc.__islocal) {
// defined in sales_common.js
cur_frm.cscript.update_item_details(doc, cdt, cdn, callback);
cur_frm.cscript.update_item_details(doc, cdt, cdn);
}
}
// Refresh
//==================
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
cur_frm.clear_custom_buttons();
var callback = function() {
cur_frm.cscript.dynamic_label(doc, cdt, cdn);
}
cur_frm.cscript.hide_price_list_currency(doc, cdt, cdn, callback);
if(doc.docstatus==1) {
if(doc.status != 'Stopped') {
cur_frm.add_custom_button('Send SMS', cur_frm.cscript['Send SMS']);
@ -82,7 +87,7 @@ cur_frm.cscript.customer = function(doc,dt,dn) {
}
if(doc.customer) $c_obj(make_doclist(doc.doctype, doc.name), 'get_default_customer_address', '', callback);
if(doc.customer) unhide_field(['customer_address','contact_person','customer_name','address_display','contact_display','contact_mobile','contact_email','territory','customer_group','shipping_address']);
if(doc.customer) unhide_field(['customer_address', 'contact_person', 'customer_name', 'address_display', 'contact_display', 'contact_mobile', 'contact_email', 'territory','customer_group','shipping_address']);
}
cur_frm.cscript.customer_address = cur_frm.cscript.contact_person = function(doc,dt,dn) {
@ -135,13 +140,6 @@ cur_frm.cscript.new_contact = function(){
// DOCTYPE TRIGGERS
// ================================================================================================
/*
// ***************** get shipping address based on customer selected *****************
cur_frm.fields_dict['ship_det_no'].get_query = function(doc, cdt, cdn) {
return 'SELECT `tabShipping Address`.`name`, `tabShipping Address`.`ship_to`, `tabShipping Address`.`shipping_address` FROM `tabShipping Address` WHERE `tabShipping Address`.customer = "'+ doc.customer+'" AND `tabShipping Address`.`docstatus` != 2 AND `tabShipping Address`.`name` LIKE "%s" ORDER BY `tabShipping Address`.name ASC LIMIT 50';
}
*/
// ***************** Get project name *****************
cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) {

View File

@ -85,9 +85,10 @@ class DocType(TransactionBase):
# ================================================================================
# Get Item Details
# ----------------
def get_item_details(self, item_code=None):
if item_code:
return get_obj('Sales Common').get_item_details(item_code, self)
def get_item_details(self, args=None):
args = eval(args)
if args['item_code']:
return get_obj('Sales Common').get_item_details(args, self)
else:
obj = get_obj('Sales Common')
for doc in self.doclist:
@ -103,6 +104,15 @@ class DocType(TransactionBase):
def get_adj_percent(self, arg=''):
get_obj('Sales Common').get_adj_percent(self)
def get_comp_base_currency(self):
return get_obj('Sales Common').get_comp_base_currency(self.doc.company)
def get_price_list_currency(self):
return get_obj('Sales Common').get_price_list_currency(self.doc.price_list_name, self.doc.company)
# Get projected qty of item based on warehouse selected
# -----------------------------------------------------
def get_available_qty(self,args):

File diff suppressed because it is too large Load Diff

View File

@ -5,342 +5,295 @@
{
'creation': '2010-08-08 17:09:22',
'docstatus': 0,
'modified': '2011-04-12 14:08:58',
'modified_by': 'Administrator',
'owner': 'Administrator'
'modified': '2012-02-24 10:38:06',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all DocType
{
'autoname': 'SOD/.#####',
'colour': 'White:FFF',
'autoname': u'SOD/.#####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'istable': 1,
'module': 'Selling',
'module': u'Selling',
'name': '__common__',
'section_style': 'Tray',
'server_code_error': ' ',
'section_style': u'Tray',
'server_code_error': u' ',
'show_in_menu': 0,
'version': 52
'version': 49
},
# These values are common for all DocField
{
'doctype': 'DocField',
'doctype': u'DocField',
'name': '__common__',
'parent': 'Sales Order Detail',
'parentfield': 'fields',
'parenttype': 'DocType'
'parent': u'Sales Order Detail',
'parentfield': u'fields',
'parenttype': u'DocType'
},
# DocType, Sales Order Detail
{
'doctype': 'DocType',
'name': 'Sales Order Detail'
'name': u'Sales Order Detail'
},
# DocField
{
'allow_on_submit': 0,
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldname': 'item_code',
'fieldtype': 'Link',
'idx': 1,
'doctype': u'DocField',
'fieldname': u'item_code',
'fieldtype': u'Link',
'in_filter': 1,
'label': 'Item Code',
'oldfieldname': 'item_code',
'oldfieldtype': 'Link',
'options': 'Item',
'label': u'Item Code',
'oldfieldname': u'item_code',
'oldfieldtype': u'Link',
'options': u'Item',
'permlevel': 0,
'reqd': 1,
'search_index': 1,
'trigger': 'Client',
'width': '150px'
'trigger': u'Client',
'width': u'150px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'item_name',
'fieldtype': 'Data',
'idx': 2,
'label': 'Item Name',
'oldfieldname': 'item_name',
'oldfieldtype': 'Data',
'doctype': u'DocField',
'fieldname': u'item_name',
'fieldtype': u'Data',
'label': u'Item Name',
'oldfieldname': u'item_name',
'oldfieldtype': u'Data',
'permlevel': 0,
'print_hide': 1,
'reqd': 1,
'width': '150'
'width': u'150'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'description',
'fieldtype': 'Small Text',
'idx': 3,
'doctype': u'DocField',
'fieldname': u'description',
'fieldtype': u'Small Text',
'in_filter': 1,
'label': 'Description',
'oldfieldname': 'description',
'oldfieldtype': 'Small Text',
'label': u'Description',
'oldfieldname': u'description',
'oldfieldtype': u'Small Text',
'permlevel': 0,
'reqd': 1,
'search_index': 1,
'width': '300px'
'width': u'300px'
},
# DocField
{
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'qty',
'fieldtype': 'Currency',
'idx': 4,
'label': 'Quantity',
'oldfieldname': 'qty',
'oldfieldtype': 'Currency',
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'qty',
'fieldtype': u'Currency',
'label': u'Quantity',
'oldfieldname': u'qty',
'oldfieldtype': u'Currency',
'permlevel': 0,
'reqd': 1,
'trigger': 'Client',
'width': '100px'
'trigger': u'Client',
'width': u'100px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'stock_uom',
'fieldtype': 'Data',
'doctype': u'DocField',
'fieldname': u'stock_uom',
'fieldtype': u'Data',
'hidden': 0,
'idx': 5,
'label': 'UOM',
'oldfieldname': 'stock_uom',
'oldfieldtype': 'Data',
'label': u'UOM',
'oldfieldname': u'stock_uom',
'oldfieldtype': u'Data',
'permlevel': 1,
'reqd': 0,
'width': '70px'
'width': u'70px'
},
# DocField
{
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'ref_rate',
'fieldtype': 'Currency',
'idx': 6,
'label': 'Ref Rate',
'oldfieldname': 'ref_rate',
'oldfieldtype': 'Currency',
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'ref_rate',
'fieldtype': u'Currency',
'label': u'Price List Rate',
'oldfieldname': u'ref_rate',
'oldfieldtype': u'Currency',
'permlevel': 0,
'print_hide': 1,
'reqd': 0,
'trigger': 'Client',
'width': '70px'
'trigger': u'Client',
'width': u'70px'
},
# DocField
{
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'adj_rate',
'fieldtype': 'Float',
'idx': 7,
'label': 'Discount(%)',
'oldfieldname': 'adj_rate',
'oldfieldtype': 'Float',
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'adj_rate',
'fieldtype': u'Float',
'label': u'Discount(%)',
'oldfieldname': u'adj_rate',
'oldfieldtype': u'Float',
'permlevel': 0,
'print_hide': 1,
'trigger': 'Client',
'width': '70px'
'trigger': u'Client',
'width': u'70px'
},
# DocField
{
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'export_rate',
'fieldtype': 'Currency',
'idx': 8,
'label': 'Rate',
'oldfieldname': 'export_rate',
'oldfieldtype': 'Currency',
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'export_rate',
'fieldtype': u'Currency',
'label': u'Rate',
'oldfieldname': u'export_rate',
'oldfieldtype': u'Currency',
'permlevel': 0,
'reqd': 0,
'trigger': 'Client',
'width': '100px'
'trigger': u'Client',
'width': u'100px'
},
# DocField
{
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'export_amount',
'fieldtype': 'Currency',
'idx': 9,
'label': 'Amount',
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'export_amount',
'fieldtype': u'Currency',
'label': u'Amount',
'no_copy': 0,
'oldfieldname': 'export_amount',
'oldfieldtype': 'Currency',
'oldfieldname': u'export_amount',
'oldfieldtype': u'Currency',
'permlevel': 1,
'reqd': 0,
'width': '100px'
'width': u'100px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'base_ref_rate',
'fieldtype': 'Currency',
'idx': 10,
'label': 'Ref Rate*',
'oldfieldname': 'base_ref_rate',
'oldfieldtype': 'Currency',
'doctype': u'DocField',
'fieldname': u'base_ref_rate',
'fieldtype': u'Currency',
'label': u'Price List Rate*',
'oldfieldname': u'base_ref_rate',
'oldfieldtype': u'Currency',
'permlevel': 1,
'print_hide': 1,
'width': '100px'
'width': u'100px'
},
# DocField
{
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'basic_rate',
'fieldtype': 'Currency',
'idx': 11,
'label': 'Basic Rate*',
'oldfieldname': 'basic_rate',
'oldfieldtype': 'Currency',
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'basic_rate',
'fieldtype': u'Currency',
'label': u'Basic Rate*',
'oldfieldname': u'basic_rate',
'oldfieldtype': u'Currency',
'permlevel': 0,
'print_hide': 1,
'reqd': 0,
'trigger': 'Client',
'width': '100px'
'trigger': u'Client',
'width': u'100px'
},
# DocField
{
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'amount',
'fieldtype': 'Currency',
'idx': 12,
'label': 'Amount*',
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'amount',
'fieldtype': u'Currency',
'label': u'Amount*',
'no_copy': 0,
'oldfieldname': 'amount',
'oldfieldtype': 'Currency',
'oldfieldname': u'amount',
'oldfieldtype': u'Currency',
'permlevel': 1,
'print_hide': 1,
'reqd': 0,
'width': '100px'
'width': u'100px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'reserved_warehouse',
'fieldtype': 'Link',
'idx': 13,
'label': 'Reserved Warehouse',
'doctype': u'DocField',
'fieldname': u'reserved_warehouse',
'fieldtype': u'Link',
'label': u'Reserved Warehouse',
'no_copy': 1,
'oldfieldname': 'reserved_warehouse',
'oldfieldtype': 'Link',
'options': 'Warehouse',
'oldfieldname': u'reserved_warehouse',
'oldfieldtype': u'Link',
'options': u'Warehouse',
'permlevel': 0,
'print_hide': 1,
'reqd': 0,
'trigger': 'Client',
'width': '150px'
'trigger': u'Client',
'width': u'150px'
},
# DocField
{
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'projected_qty',
'fieldtype': 'Currency',
'idx': 14,
'label': 'Projected Qty',
'colour': u'White:FFF',
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'projected_qty',
'fieldtype': u'Currency',
'hidden': 1,
'label': u'Projected Qty',
'no_copy': 1,
'oldfieldname': 'projected_qty',
'oldfieldtype': 'Currency',
'oldfieldname': u'projected_qty',
'oldfieldtype': u'Currency',
'permlevel': 1,
'print_hide': 1,
'width': '70px'
'width': u'70px'
},
# DocField
{
'colour': 'White:FFF',
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'actual_qty',
'fieldtype': 'Currency',
'idx': 15,
'label': 'Actual Qty',
'colour': u'White:FFF',
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'actual_qty',
'fieldtype': u'Currency',
'label': u'Actual Qty',
'no_copy': 1,
'permlevel': 1,
'print_hide': 1,
'width': '70px'
'width': u'70px'
},
# DocField
{
'colour': 'White:FFF',
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'indented_qty',
'fieldtype': 'Currency',
'idx': 16,
'label': 'Indented Qty',
'no_copy': 1,
'permlevel': 1,
'print_hide': 1,
'width': '70px'
},
# DocField
{
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'delivered_qty',
'fieldtype': 'Currency',
'colour': u'White:FFF',
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'delivered_qty',
'fieldtype': u'Currency',
'hidden': 0,
'idx': 17,
'in_filter': 0,
'label': 'Delivered Qty',
'label': u'Delivered Qty',
'no_copy': 1,
'oldfieldname': 'delivered_qty',
'oldfieldtype': 'Currency',
'oldfieldname': u'delivered_qty',
'oldfieldtype': u'Currency',
'permlevel': 1,
'print_hide': 1,
'search_index': 0,
'width': '100px'
'width': u'100px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'billed_qty',
'fieldtype': 'Currency',
'idx': 18,
'in_filter': 0,
'label': 'Billed Qty',
'no_copy': 1,
'oldfieldname': 'billed_qty',
'oldfieldtype': 'Currency',
'permlevel': 1,
'print_hide': 1,
'search_index': 0,
'width': '100px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'billed_amt',
'fieldtype': 'Currency',
'idx': 19,
'label': 'Billed Amt',
'doctype': u'DocField',
'fieldname': u'billed_amt',
'fieldtype': u'Currency',
'label': u'Billed Amt',
'no_copy': 1,
'permlevel': 1,
'print_hide': 1
@ -348,83 +301,84 @@
# DocField
{
'description': 'For Production',
'doctype': 'DocField',
'fieldname': 'planned_qty',
'fieldtype': 'Currency',
'colour': u'White:FFF',
'description': u'For Production',
'doctype': u'DocField',
'fieldname': u'planned_qty',
'fieldtype': u'Currency',
'hidden': 1,
'idx': 20,
'label': 'Planned Quantity',
'label': u'Planned Quantity',
'no_copy': 1,
'oldfieldname': 'planned_qty',
'oldfieldtype': 'Currency',
'oldfieldname': u'planned_qty',
'oldfieldtype': u'Currency',
'permlevel': 1,
'print_hide': 1,
'report_hide': 1,
'width': '50px'
'width': u'50px'
},
# DocField
{
'description': 'For Production',
'doctype': 'DocField',
'fieldname': 'produced_qty',
'fieldtype': 'Currency',
'colour': u'White:FFF',
'description': u'For Production',
'doctype': u'DocField',
'fieldname': u'produced_qty',
'fieldtype': u'Currency',
'hidden': 1,
'idx': 21,
'label': 'Produced Quantity',
'oldfieldname': 'produced_qty',
'oldfieldtype': 'Currency',
'label': u'Produced Quantity',
'oldfieldname': u'produced_qty',
'oldfieldtype': u'Currency',
'permlevel': 1,
'print_hide': 1,
'report_hide': 1,
'width': '50px'
'width': u'50px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'brand',
'fieldtype': 'Link',
'idx': 22,
'colour': u'White:FFF',
'doctype': u'DocField',
'fieldname': u'brand',
'fieldtype': u'Link',
'hidden': 1,
'in_filter': 1,
'label': 'Brand Name',
'oldfieldname': 'brand',
'oldfieldtype': 'Link',
'options': 'Brand',
'label': u'Brand Name',
'oldfieldname': u'brand',
'oldfieldtype': u'Link',
'options': u'Brand',
'permlevel': 1,
'print_hide': 1,
'search_index': 0
'search_index': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'item_group',
'fieldtype': 'Link',
'idx': 23,
'colour': u'White:FFF',
'doctype': u'DocField',
'fieldname': u'item_group',
'fieldtype': u'Link',
'hidden': 1,
'in_filter': 1,
'label': 'Item Group',
'oldfieldname': 'item_group',
'oldfieldtype': 'Link',
'options': 'Item Group',
'label': u'Item Group',
'oldfieldname': u'item_group',
'oldfieldtype': u'Link',
'options': u'Item Group',
'permlevel': 1,
'print_hide': 1,
'search_index': 0
'search_index': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'prevdoc_docname',
'fieldtype': 'Link',
'doctype': u'DocField',
'fieldname': u'prevdoc_docname',
'fieldtype': u'Link',
'hidden': 0,
'idx': 24,
'in_filter': 1,
'label': 'Quotation No.',
'oldfieldname': 'prevdoc_docname',
'oldfieldtype': 'Link',
'options': 'Quotation',
'label': u'Quotation No.',
'oldfieldname': u'prevdoc_docname',
'oldfieldtype': u'Link',
'options': u'Quotation',
'permlevel': 1,
'print_hide': 1,
'search_index': 1
@ -433,13 +387,12 @@
# DocField
{
'allow_on_submit': 1,
'doctype': 'DocField',
'fieldname': 'page_break',
'fieldtype': 'Check',
'idx': 25,
'label': 'Page Break',
'oldfieldname': 'page_break',
'oldfieldtype': 'Check',
'doctype': u'DocField',
'fieldname': u'page_break',
'fieldtype': u'Check',
'label': u'Page Break',
'oldfieldname': u'page_break',
'oldfieldtype': u'Check',
'permlevel': 0,
'print_hide': 1,
'report_hide': 1
@ -447,15 +400,15 @@
# DocField
{
'description': 'required for production. will be used later.',
'doctype': 'DocField',
'fieldname': 'delivery_date',
'fieldtype': 'Date',
'hidden': 0,
'idx': 26,
'label': 'Expected Delivery Date',
'oldfieldname': 'delivery_date',
'oldfieldtype': 'Date',
'colour': u'White:FFF',
'description': u'required for production. will be used later.',
'doctype': u'DocField',
'fieldname': u'delivery_date',
'fieldtype': u'Date',
'hidden': 1,
'label': u'Expected Delivery Date',
'oldfieldname': u'delivery_date',
'oldfieldtype': u'Date',
'permlevel': 1,
'print_hide': 1,
'report_hide': 1
@ -464,16 +417,16 @@
# DocField
{
'allow_on_submit': 1,
'description': 'required for production. will be used later.',
'doctype': 'DocField',
'fieldname': 'confirmation_date',
'fieldtype': 'Date',
'colour': u'White:FFF',
'description': u'required for production. will be used later.',
'doctype': u'DocField',
'fieldname': u'confirmation_date',
'fieldtype': u'Date',
'hidden': 0,
'idx': 27,
'in_filter': 1,
'label': 'Confirmed Delivery Date',
'oldfieldname': 'confirmation_date',
'oldfieldtype': 'Date',
'label': u'Confirmed Delivery Date',
'oldfieldname': u'confirmation_date',
'oldfieldtype': u'Date',
'permlevel': 0,
'print_hide': 1,
'report_hide': 1,
@ -482,14 +435,14 @@
# DocField
{
'doctype': 'DocField',
'fieldname': 'item_tax_rate',
'fieldtype': 'Small Text',
'colour': u'White:FFF',
'doctype': u'DocField',
'fieldname': u'item_tax_rate',
'fieldtype': u'Small Text',
'hidden': 1,
'idx': 28,
'label': 'Item Tax Rate',
'oldfieldname': 'item_tax_rate',
'oldfieldtype': 'Small Text',
'label': u'Item Tax Rate',
'oldfieldname': u'item_tax_rate',
'oldfieldtype': u'Small Text',
'permlevel': 1,
'print_hide': 1,
'report_hide': 1
@ -497,16 +450,16 @@
# DocField
{
'description': 'The date at which current entry is made in system.',
'doctype': 'DocField',
'fieldname': 'transaction_date',
'fieldtype': 'Date',
'colour': u'White:FFF',
'description': u'The date at which current entry is made in system.',
'doctype': u'DocField',
'fieldname': u'transaction_date',
'fieldtype': u'Date',
'hidden': 1,
'idx': 29,
'in_filter': 0,
'label': 'Sales Order Date',
'oldfieldname': 'transaction_date',
'oldfieldtype': 'Date',
'label': u'Sales Order Date',
'oldfieldname': u'transaction_date',
'oldfieldtype': u'Date',
'permlevel': 1,
'print_hide': 1,
'report_hide': 1,

View File

@ -22,24 +22,23 @@ cur_frm.cscript.onload = function(doc, dt, dn) {
if(doc.__islocal){
hide_field(['customer_address','contact_person','customer_name','address_display','contact_display','contact_mobile','contact_email','territory','customer_group']);
}
}
}
cur_frm.cscript.onload_post_render = function(doc, dt, dn) {
// defined in sales_common.js
//cur_frm.cscript.update_item_details(doc, cdt, cdn);
// load default charges
if(doc.__islocal && !getchildren('RV Tax Detail', doc.name, 'other_charges', doc.doctype).length)
cur_frm.cscript.load_taxes(doc, cdt, cdn);
if(doc.__islocal) cur_frm.cscript.update_item_details(doc, dt, dn);
}
// REFRESH
// ================================================================================================
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
cur_frm.clear_custom_buttons();
var callback = function() {
cur_frm.cscript.dynamic_label(doc, cdt, cdn);
}
cur_frm.cscript.hide_price_list_currency(doc, cdt, cdn, callback);
if(doc.per_billed < 100 && doc.docstatus==1) cur_frm.add_custom_button('Make Invoice', cur_frm.cscript['Make Sales Invoice']);
@ -144,61 +143,6 @@ cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) {
return repl('SELECT `tabProject`.name FROM `tabProject` WHERE `tabProject`.status = "Open" AND %(cond)s `tabProject`.name LIKE "%s" ORDER BY `tabProject`.name ASC LIMIT 50', {cond:cond});
}
/*
//---- get customer details ----------------------------
cur_frm.cscript.project_name = function(doc,cdt,cdn){
$c_obj(make_doclist(doc.doctype, doc.name),'pull_project_customer','', function(r,rt){
refresh_many(['customer','customer_name', 'customer_address', 'contact_person', 'territory', 'contact_no', 'email_id', 'customer_group']);
});
}
*/
// UTILITY FUNCTIONS
// ================================================================================================
/*
var cfn_set_fields = function(doc, cdt, cdn) {
var supplier_field_list = ['Supplier','supplier','supplier_address'];
var customer_field_list = ['Customer','customer','customer_name','customer_address','territory','customer_group','Business Associate','sales_partner','commission_rate','total_commission','sales_order_no','Get Items'];
if (doc.delivery_type == 'Rejected' && doc.purchase_receipt_no) {
unhide_field('purchase_receipt_no');
unhide_field(supplier_field_list);
hide_field(customer_field_list);
get_field(doc.doctype, 'delivery_type' , doc.name).permlevel = 1;
}
else if (doc.delivery_type == 'Subcontract' && doc.purchase_order_no) {
unhide_field('purchase_order_no');
unhide_field(supplier_field_list);
hide_field(cutomer_field_list);
get_field(doc.doctype, 'delivery_type' , doc.name).permlevel = 1;
}
else if (doc.delivery_type == 'Sample') unhide_field('to_warehouse');
else get_field(doc.doctype, 'delivery_type' , doc.name).permlevel = 0;
}
*/
// DOCTYPE TRIGGERS
// ================================================================================================
/*
// ***************** Get Contact Person based on customer selected *****************
cur_frm.fields_dict['contact_person'].get_query = function(doc, cdt, cdn) {
return 'SELECT `tabContact`.contact_name FROM `tabContact` WHERE ((`tabContact`.is_customer = 1 AND `tabContact`.customer = "'+ doc.customer+'") or (`tabContact`.is_sales_partner = 1 AND `tabContact`.sales_partner = "'+ doc.sales_partner+'")) AND `tabContact`.docstatus != 2 AND `tabContact`.contact_name LIKE "%s" ORDER BY `tabContact`.contact_name ASC LIMIT 50';
}
*/
/*
// ***************** get shipping address based on customer selected *****************
cur_frm.fields_dict['ship_det_no'].get_query = function(doc, cdt, cdn) {
return 'SELECT `tabShipping Address`.`name`, `tabShipping Address`.`ship_to`, `tabShipping Address`.`shipping_address` FROM `tabShipping Address` WHERE `tabShipping Address`.customer = "'+ doc.customer+'" AND `tabShipping Address`.`docstatus` != 2 AND `tabShipping Address`.`name` LIKE "%s" ORDER BY `tabShipping Address`.name ASC LIMIT 50';
}
*/
// *************** Customized link query for SALES ORDER based on customer and currency*****************************
cur_frm.fields_dict['sales_order_no'].get_query = function(doc) {
@ -232,13 +176,6 @@ cur_frm.cscript.serial_no = function(doc, cdt , cdn) {
}
}
/*
// this won't work in case of Sales Bom item where item.is_stock_item = 'No'
cur_frm.fields_dict['delivery_note_details'].grid.get_field('warehouse').get_query= function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
return "SELECT `tabBin`.`warehouse`, `tabBin`.`actual_qty` FROM `tabBin` WHERE `tabBin`.`item_code` = '"+ d.item_code +"' AND ifnull(`tabBin`.`actual_qty`,0) > 0 AND `tabBin`.`warehouse` like '%s' ORDER BY `tabBin`.`warehouse` DESC LIMIT 50";
}
*/
cur_frm.cscript.warehouse = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];

View File

@ -100,9 +100,10 @@ class DocType(TransactionBase):
# ================================================================================
# ***************** Get Item Details ******************************
def get_item_details(self, item_code=None):
if item_code:
return get_obj('Sales Common').get_item_details(item_code, self)
def get_item_details(self, args=None):
args = eval(args)
if args['item_code']:
return get_obj('Sales Common').get_item_details(args, self)
else:
obj = get_obj('Sales Common')
for doc in self.doclist:
@ -117,6 +118,14 @@ class DocType(TransactionBase):
def get_adj_percent(self, arg=''):
get_obj('Sales Common').get_adj_percent(self)
def get_comp_base_currency(self):
return get_obj('Sales Common').get_comp_base_currency(self.doc.company)
def get_price_list_currency(self):
return get_obj('Sales Common').get_price_list_currency(self.doc.price_list_name, self.doc.company)
# ********** Get Actual Qty of item in warehouse selected *************
def get_actual_qty(self,args):
args = eval(args)

File diff suppressed because it is too large Load Diff

View File

@ -5,403 +5,419 @@
{
'creation': '2010-08-08 17:08:58',
'docstatus': 0,
'modified': '2012-02-01 16:08:06',
'modified_by': 'Administrator',
'owner': 'Administrator'
'modified': '2012-02-24 11:33:58',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all DocType
{
'_last_update': '1311621379',
'autoname': 'DND/.#######',
'colour': 'White:FFF',
'default_print_format': 'Standard',
'_last_update': u'1311621379',
'autoname': u'DND/.#######',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'istable': 1,
'module': 'Stock',
'module': u'Stock',
'name': '__common__',
'section_style': 'Tray',
'server_code_error': ' ',
'section_style': u'Tray',
'server_code_error': u' ',
'show_in_menu': 0,
'version': 51
'version': 53
},
# These values are common for all DocField
{
'doctype': 'DocField',
'doctype': u'DocField',
'name': '__common__',
'parent': 'Delivery Note Detail',
'parentfield': 'fields',
'parenttype': 'DocType'
'parent': u'Delivery Note Detail',
'parentfield': u'fields',
'parenttype': u'DocType'
},
# DocType, Delivery Note Detail
{
'doctype': 'DocType',
'name': 'Delivery Note Detail'
'name': u'Delivery Note Detail'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'item_code',
'fieldtype': 'Link',
'doctype': u'DocField',
'fieldname': u'item_code',
'fieldtype': u'Link',
'in_filter': 1,
'label': 'Item Code',
'oldfieldname': 'item_code',
'oldfieldtype': 'Link',
'options': 'Item',
'label': u'Item Code',
'oldfieldname': u'item_code',
'oldfieldtype': u'Link',
'options': u'Item',
'permlevel': 0,
'reqd': 1,
'search_index': 1,
'trigger': 'Client',
'width': '150px'
'trigger': u'Client',
'width': u'150px'
},
# DocField
{
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldname': 'item_name',
'fieldtype': 'Data',
'label': 'Item Name',
'oldfieldname': 'item_name',
'oldfieldtype': 'Data',
'colour': u'White:FFF',
'doctype': u'DocField',
'fieldname': u'item_name',
'fieldtype': u'Data',
'label': u'Item Name',
'oldfieldname': u'item_name',
'oldfieldtype': u'Data',
'permlevel': 0,
'print_hide': 1,
'reqd': 1,
'width': '150px'
'width': u'150px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'description',
'fieldtype': 'Small Text',
'label': 'Description',
'oldfieldname': 'description',
'oldfieldtype': 'Small Text',
'doctype': u'DocField',
'fieldname': u'description',
'fieldtype': u'Small Text',
'label': u'Description',
'oldfieldname': u'description',
'oldfieldtype': u'Small Text',
'permlevel': 0,
'reqd': 1,
'width': '300px'
'width': u'300px'
},
# DocField
{
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'qty',
'fieldtype': 'Currency',
'label': 'Quantity',
'oldfieldname': 'qty',
'oldfieldtype': 'Currency',
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'qty',
'fieldtype': u'Currency',
'label': u'Quantity',
'oldfieldname': u'qty',
'oldfieldtype': u'Currency',
'permlevel': 0,
'reqd': 1,
'trigger': 'Client',
'width': '100px'
'trigger': u'Client',
'width': u'100px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'stock_uom',
'fieldtype': 'Data',
'label': 'UOM',
'oldfieldname': 'stock_uom',
'oldfieldtype': 'Data',
'doctype': u'DocField',
'fieldname': u'stock_uom',
'fieldtype': u'Data',
'label': u'UOM',
'oldfieldname': u'stock_uom',
'oldfieldtype': u'Data',
'permlevel': 1,
'print_hide': 0,
'reqd': 1,
'width': '50px'
'width': u'50px'
},
# DocField
{
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'ref_rate',
'fieldtype': 'Currency',
'label': 'Ref Rate',
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'ref_rate',
'fieldtype': u'Currency',
'label': u'Price List Rate',
'no_copy': 0,
'oldfieldname': 'ref_rate',
'oldfieldtype': 'Currency',
'oldfieldname': u'ref_rate',
'oldfieldtype': u'Currency',
'permlevel': 0,
'print_hide': 1,
'reqd': 0,
'trigger': 'Client',
'width': '100px'
'trigger': u'Client',
'width': u'100px'
},
# DocField
{
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'adj_rate',
'fieldtype': 'Float',
'label': 'Discount (%)',
'oldfieldname': 'adj_rate',
'oldfieldtype': 'Float',
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'adj_rate',
'fieldtype': u'Float',
'label': u'Discount (%)',
'oldfieldname': u'adj_rate',
'oldfieldtype': u'Float',
'permlevel': 0,
'print_hide': 1,
'trigger': 'Client',
'width': '100px'
'trigger': u'Client',
'width': u'100px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'export_rate',
'fieldtype': 'Currency',
'label': 'Rate',
'oldfieldname': 'export_rate',
'oldfieldtype': 'Currency',
'doctype': u'DocField',
'fieldname': u'export_rate',
'fieldtype': u'Currency',
'label': u'Rate',
'oldfieldname': u'export_rate',
'oldfieldtype': u'Currency',
'permlevel': 0,
'print_hide': 0,
'reqd': 0,
'trigger': 'Client',
'width': '150px'
'trigger': u'Client',
'width': u'150px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'export_amount',
'fieldtype': 'Currency',
'label': 'Amount',
'oldfieldname': 'export_amount',
'oldfieldtype': 'Currency',
'doctype': u'DocField',
'fieldname': u'export_amount',
'fieldtype': u'Currency',
'label': u'Amount',
'oldfieldname': u'export_amount',
'oldfieldtype': u'Currency',
'permlevel': 1,
'print_hide': 0,
'reqd': 0,
'width': '100px'
'width': u'100px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'base_ref_rate',
'fieldtype': 'Currency',
'label': 'Ref Rate*',
'oldfieldname': 'base_ref_rate',
'oldfieldtype': 'Currency',
'doctype': u'DocField',
'fieldname': u'base_ref_rate',
'fieldtype': u'Currency',
'label': u'Price List Rate*',
'oldfieldname': u'base_ref_rate',
'oldfieldtype': u'Currency',
'permlevel': 1,
'print_hide': 1,
'width': '100px'
'width': u'100px'
},
# DocField
{
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'basic_rate',
'fieldtype': 'Currency',
'label': 'Rate*',
'oldfieldname': 'basic_rate',
'oldfieldtype': 'Currency',
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'basic_rate',
'fieldtype': u'Currency',
'label': u'Rate*',
'oldfieldname': u'basic_rate',
'oldfieldtype': u'Currency',
'permlevel': 0,
'print_hide': 1,
'reqd': 0,
'trigger': 'Client',
'width': '150px'
'trigger': u'Client',
'width': u'150px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'amount',
'fieldtype': 'Currency',
'label': 'Amount*',
'oldfieldname': 'amount',
'oldfieldtype': 'Currency',
'doctype': u'DocField',
'fieldname': u'amount',
'fieldtype': u'Currency',
'label': u'Amount*',
'oldfieldname': u'amount',
'oldfieldtype': u'Currency',
'permlevel': 1,
'print_hide': 1,
'reqd': 0,
'width': '100px'
'width': u'100px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'warehouse',
'fieldtype': 'Link',
'label': 'Warehouse',
'oldfieldname': 'warehouse',
'oldfieldtype': 'Link',
'options': 'Warehouse',
'doctype': u'DocField',
'fieldname': u'warehouse',
'fieldtype': u'Link',
'label': u'Warehouse',
'oldfieldname': u'warehouse',
'oldfieldtype': u'Link',
'options': u'Warehouse',
'permlevel': 0,
'print_hide': 1,
'trigger': 'Client',
'width': '100px'
'trigger': u'Client',
'width': u'100px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'serial_no',
'fieldtype': 'Text',
'doctype': u'DocField',
'fieldname': u'serial_no',
'fieldtype': u'Text',
'in_filter': 1,
'label': 'Serial No',
'label': u'Serial No',
'no_copy': 1,
'oldfieldname': 'serial_no',
'oldfieldtype': 'Text',
'oldfieldname': u'serial_no',
'oldfieldtype': u'Text',
'permlevel': 0,
'print_hide': 1,
'trigger': 'Client'
'trigger': u'Client'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'batch_no',
'fieldtype': 'Link',
'label': 'Batch No',
'oldfieldname': 'batch_no',
'oldfieldtype': 'Link',
'options': 'Batch',
'doctype': u'DocField',
'fieldname': u'batch_no',
'fieldtype': u'Link',
'label': u'Batch No',
'oldfieldname': u'batch_no',
'oldfieldtype': u'Link',
'options': u'Batch',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'item_group',
'fieldtype': 'Link',
'label': 'Item Group',
'oldfieldname': 'item_group',
'oldfieldtype': 'Link',
'options': 'Item Group',
'doctype': u'DocField',
'fieldname': u'item_group',
'fieldtype': u'Link',
'hidden': 1,
'label': u'Item Group',
'oldfieldname': u'item_group',
'oldfieldtype': u'Link',
'options': u'Item Group',
'permlevel': 1,
'print_hide': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'brand',
'fieldtype': 'Link',
'label': 'Brand Name',
'oldfieldname': 'brand',
'oldfieldtype': 'Link',
'options': 'Brand',
'doctype': u'DocField',
'fieldname': u'brand',
'fieldtype': u'Link',
'hidden': 1,
'label': u'Brand Name',
'oldfieldname': u'brand',
'oldfieldtype': u'Link',
'options': u'Brand',
'permlevel': 1,
'print_hide': 1,
'width': '150px'
'width': u'150px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'installed_qty',
'fieldtype': 'Currency',
'label': 'Installed Qty',
'doctype': u'DocField',
'fieldname': u'actual_qty',
'fieldtype': u'Currency',
'label': u'Available Qty at Warehouse',
'no_copy': 1,
'oldfieldname': 'installed_qty',
'oldfieldtype': 'Currency',
'oldfieldname': u'actual_qty',
'oldfieldtype': u'Currency',
'permlevel': 1,
'print_hide': 1,
'width': '150px'
'width': u'150px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'actual_qty',
'fieldtype': 'Currency',
'label': 'Available Qty at Warehouse',
'no_copy': 1,
'oldfieldname': 'actual_qty',
'oldfieldtype': 'Currency',
'permlevel': 1,
'print_hide': 1,
'width': '150px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'billed_amt',
'fieldtype': 'Currency',
'label': 'Billed Amt',
'doctype': u'DocField',
'fieldname': u'billed_amt',
'fieldtype': u'Currency',
'label': u'Billed Amt',
'no_copy': 1,
'permlevel': 1,
'print_hide': 1,
'width': '100px'
'width': u'100px'
},
# DocField
{
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldname': 'prevdoc_docname',
'fieldtype': 'Data',
'doctype': u'DocField',
'fieldname': u'installed_qty',
'fieldtype': u'Currency',
'label': u'Installed Qty',
'no_copy': 1,
'oldfieldname': u'installed_qty',
'oldfieldtype': u'Currency',
'permlevel': 1,
'print_hide': 1,
'width': u'150px'
},
# DocField
{
'allow_on_submit': 1,
'colour': u'White:FFF',
'default': u'0',
'doctype': u'DocField',
'fieldname': u'packed_qty',
'fieldtype': u'Currency',
'label': u'Packed Quantity',
'no_copy': 1,
'permlevel': 1,
'print_hide': 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'prevdoc_doctype',
'fieldtype': u'Data',
'hidden': 1,
'in_filter': 1,
'label': u'Document Type',
'oldfieldname': u'prevdoc_doctype',
'oldfieldtype': u'Data',
'permlevel': 1,
'print_hide': 1,
'search_index': 1,
'width': u'150px'
},
# DocField
{
'colour': u'White:FFF',
'doctype': u'DocField',
'fieldname': u'prevdoc_docname',
'fieldtype': u'Data',
'hidden': 0,
'in_filter': 1,
'label': 'Against Document No',
'label': u'Against Document No',
'no_copy': 1,
'oldfieldname': 'prevdoc_docname',
'oldfieldtype': 'Data',
'oldfieldname': u'prevdoc_docname',
'oldfieldtype': u'Data',
'permlevel': 1,
'print_hide': 1,
'search_index': 1,
'width': '150px'
'width': u'150px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'prevdoc_doctype',
'fieldtype': 'Data',
'doctype': u'DocField',
'fieldname': u'prevdoc_date',
'fieldtype': u'Date',
'hidden': 1,
'in_filter': 1,
'label': 'Document Type',
'oldfieldname': 'prevdoc_doctype',
'oldfieldtype': 'Data',
'permlevel': 1,
'print_hide': 1,
'search_index': 1,
'width': '150px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'prevdoc_date',
'fieldtype': 'Date',
'hidden': 1,
'in_filter': 1,
'label': 'Against Document Date',
'oldfieldname': 'prevdoc_date',
'oldfieldtype': 'Date',
'label': u'Against Document Date',
'oldfieldname': u'prevdoc_date',
'oldfieldtype': u'Date',
'permlevel': 1,
'print_hide': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'prevdoc_detail_docname',
'fieldtype': 'Data',
'doctype': u'DocField',
'fieldname': u'prevdoc_detail_docname',
'fieldtype': u'Data',
'hidden': 1,
'in_filter': 1,
'label': 'Against Document Detail No',
'oldfieldname': 'prevdoc_detail_docname',
'oldfieldtype': 'Data',
'label': u'Against Document Detail No',
'oldfieldname': u'prevdoc_detail_docname',
'oldfieldtype': u'Data',
'permlevel': 1,
'print_hide': 1,
'search_index': 0,
'width': '150px'
'width': u'150px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'item_tax_rate',
'fieldtype': 'Small Text',
'doctype': u'DocField',
'fieldname': u'item_tax_rate',
'fieldtype': u'Small Text',
'hidden': 1,
'label': 'Item Tax Rate',
'oldfieldname': 'item_tax_rate',
'oldfieldtype': 'Small Text',
'label': u'Item Tax Rate',
'oldfieldname': u'item_tax_rate',
'oldfieldtype': u'Small Text',
'permlevel': 1,
'print_hide': 1
},
@ -409,26 +425,12 @@
# DocField
{
'allow_on_submit': 1,
'colour': 'White:FFF',
'default': '0',
'doctype': 'DocField',
'fieldname': 'packed_qty',
'fieldtype': 'Currency',
'label': 'Packed Quantity',
'no_copy': 1,
'permlevel': 1,
'print_hide': 1
},
# DocField
{
'allow_on_submit': 1,
'doctype': 'DocField',
'fieldname': 'page_break',
'fieldtype': 'Check',
'label': 'Page Break',
'oldfieldname': 'page_break',
'oldfieldtype': 'Check',
'doctype': u'DocField',
'fieldname': u'page_break',
'fieldtype': u'Check',
'label': u'Page Break',
'oldfieldname': u'page_break',
'oldfieldtype': u'Check',
'permlevel': 0,
'print_hide': 1
}