merge
This commit is contained in:
commit
94a2fecf9d
@ -1043,7 +1043,7 @@ div.dialog_head {
|
||||
}
|
||||
|
||||
div.dialog_body {
|
||||
padding: 8px 8px 16px;
|
||||
padding: 8px 4px 16px 4px;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
|
@ -362,7 +362,7 @@ div.dialog_head {
|
||||
}
|
||||
|
||||
div.dialog_body {
|
||||
padding: 8px 8px 16px;
|
||||
padding: 8px 4px 16px 4px;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
|
@ -42,27 +42,31 @@ cur_frm.cscript.onload = function(doc,dt,dn) {
|
||||
}
|
||||
|
||||
cur_frm.cscript.onload_post_render = function(doc, dt, dn) {
|
||||
var callback2 = null;
|
||||
if(doc.customer && doc.__islocal) {
|
||||
var callback = function(doc, dt, dn) {
|
||||
// called from mapper, update the account names for items and customer
|
||||
callback2 = function(doc, dt, dn) {
|
||||
$c_obj(make_doclist(doc.doctype,doc.name),
|
||||
'load_default_accounts','',
|
||||
function(r,rt) {
|
||||
refresh_field('entries');
|
||||
cur_frm.cscript.customer(doc,dt,dn,onload=true);
|
||||
}
|
||||
);
|
||||
var callback2 = function(doc, dt, dn) {
|
||||
if(doc.customer && doc.__islocal) {
|
||||
$c_obj(make_doclist(doc.doctype,doc.name),
|
||||
'load_default_accounts','',
|
||||
function(r,rt) {
|
||||
refresh_field('entries');
|
||||
cur_frm.cscript.customer(doc,dt,dn,onload=true);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
// defined in sales_common.js
|
||||
var callback1 = function(doc, dt, dn) {
|
||||
//for previously created sales invoice, set required field related to pos
|
||||
cur_frm.cscript.update_item_details(doc, dt, dn, callback2);
|
||||
}
|
||||
}
|
||||
// defined in sales_common.js
|
||||
var callback1 = function(doc, dt, dn) {
|
||||
//for previously created sales invoice, set required field related to pos
|
||||
cur_frm.cscript.update_item_details(doc, dt, dn, callback2);
|
||||
}
|
||||
|
||||
if(doc.is_pos ==1) cur_frm.cscript.is_pos(doc, dt, dn,callback1);
|
||||
else cur_frm.cscript.update_item_details(doc, dt, dn, callback2);
|
||||
if(doc.is_pos ==1) cur_frm.cscript.is_pos(doc, dt, dn,callback1);
|
||||
else cur_frm.cscript.update_item_details(doc, dt, dn, callback2);
|
||||
}
|
||||
|
||||
cur_frm.cscript.hide_price_list_currency(doc, dt, dn, callback);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -97,16 +101,11 @@ cur_frm.cscript.hide_fields = function(doc, cdt, cdn) {
|
||||
cur_frm.cscript.refresh = function(doc, dt, dn) {
|
||||
cur_frm.cscript.is_opening(doc, dt, dn);
|
||||
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();
|
||||
|
||||
if (!cur_frm.cscript.is_onload) cur_frm.cscript.hide_price_list_currency(doc, dt, dn);
|
||||
|
||||
if(doc.docstatus==1) {
|
||||
cur_frm.add_custom_button('View Ledger', cur_frm.cscript['View Ledger Entry']);
|
||||
cur_frm.add_custom_button('Send SMS', cur_frm.cscript['Send SMS']);
|
||||
|
@ -167,16 +167,19 @@ class DocType(TransactionBase):
|
||||
# Item Details
|
||||
# -------------
|
||||
def get_item_details(self, args=None):
|
||||
args = eval(args)
|
||||
if args['item_code']:
|
||||
args = args and eval(args) or {}
|
||||
if args.get('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(doc.item_code, ret)
|
||||
arg = {'item_code':doc.fields.get('item_code'), 'income_account':doc.fields.get('income_account'),
|
||||
'cost_center': doc.fields.get('cost_center'), 'warehouse': doc.fields.get('warehouse')};
|
||||
|
||||
ret = obj.get_item_details(arg, self)
|
||||
ret = self.get_pos_details(arg, ret)
|
||||
for r in ret:
|
||||
if not doc.fields.get(r):
|
||||
doc.fields[r] = ret[r]
|
||||
@ -205,14 +208,6 @@ 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):
|
||||
|
@ -5,47 +5,48 @@
|
||||
{
|
||||
'creation': '2010-08-08 17:08:56',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-07-20 10:42:05',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
'modified': '2012-02-29 13:24:31',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all DocType
|
||||
{
|
||||
'_last_update': '1309508837',
|
||||
'_last_update': u'1330501485',
|
||||
'allow_print': 0,
|
||||
'allow_trash': 1,
|
||||
'colour': 'White:FFF',
|
||||
'colour': u'White:FFF',
|
||||
'default_print_format': u'Standard',
|
||||
'doctype': 'DocType',
|
||||
'document_type': 'Master',
|
||||
'module': 'Selling',
|
||||
'document_type': u'Master',
|
||||
'module': u'Selling',
|
||||
'name': '__common__',
|
||||
'search_fields': 'customer_name,customer_group,country,territory',
|
||||
'section_style': 'Tabbed',
|
||||
'server_code_error': ' ',
|
||||
'search_fields': u'customer_name,customer_group,country,territory',
|
||||
'section_style': u'Tabbed',
|
||||
'server_code_error': u' ',
|
||||
'show_in_menu': 0,
|
||||
'subject': "eval:'%(customer_name)s'=='%(name)s' ? ' ' : '%(customer_name)s'",
|
||||
'tag_fields': 'customer_group,customer_type',
|
||||
'version': 433
|
||||
'subject': u'eval:"%(customer_name)s"=="%(name)s" ? "" : "%(customer_name)s"',
|
||||
'tag_fields': u'customer_group,customer_type',
|
||||
'version': 434
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': 'Customer',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType'
|
||||
'parent': u'Customer',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
},
|
||||
|
||||
# These values are common for all DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'doctype': u'DocPerm',
|
||||
'name': '__common__',
|
||||
'parent': 'Customer',
|
||||
'parentfield': 'permissions',
|
||||
'parenttype': 'DocType',
|
||||
'parent': u'Customer',
|
||||
'parentfield': u'permissions',
|
||||
'parenttype': u'DocType',
|
||||
'read': 1,
|
||||
'submit': 0
|
||||
},
|
||||
@ -53,17 +54,16 @@
|
||||
# DocType, Customer
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': 'Customer'
|
||||
'name': u'Customer'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 1,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': 'Sales Manager',
|
||||
'role': u'Sales Manager',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
@ -71,10 +71,9 @@
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 2,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': 'Sales Manager',
|
||||
'role': u'Sales Manager',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
@ -82,10 +81,9 @@
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 3,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': 'Sales User',
|
||||
'role': u'Sales User',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
@ -93,10 +91,9 @@
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 4,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': 'Sales User',
|
||||
'role': u'Sales User',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
@ -104,10 +101,9 @@
|
||||
{
|
||||
'cancel': 1,
|
||||
'create': 1,
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 5,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': 'Sales Master Manager',
|
||||
'role': u'Sales Master Manager',
|
||||
'write': 1
|
||||
},
|
||||
|
||||
@ -115,38 +111,35 @@
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 6,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': 'Sales Master Manager',
|
||||
'role': u'Sales Master Manager',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': 'White:FFF',
|
||||
'description': 'Note: You Can Manage Multiple Address or Contacts via Addresses & Contacts',
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 1,
|
||||
'label': 'Basic Info',
|
||||
'oldfieldtype': 'Section Break',
|
||||
'colour': u'White:FFF',
|
||||
'description': u'Note: You Can Manage Multiple Address or Contacts via Addresses & Contacts',
|
||||
'doctype': u'DocField',
|
||||
'fieldtype': u'Section Break',
|
||||
'label': u'Basic Info',
|
||||
'oldfieldtype': u'Section Break',
|
||||
'permlevel': 0,
|
||||
'reqd': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'customer_name',
|
||||
'fieldtype': 'Data',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'customer_name',
|
||||
'fieldtype': u'Data',
|
||||
'hidden': 0,
|
||||
'idx': 2,
|
||||
'in_filter': 1,
|
||||
'label': 'Customer Name',
|
||||
'label': u'Customer Name',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'customer_name',
|
||||
'oldfieldtype': 'Data',
|
||||
'oldfieldname': u'customer_name',
|
||||
'oldfieldtype': u'Data',
|
||||
'permlevel': 0,
|
||||
'print_hide': 0,
|
||||
'report_hide': 0,
|
||||
@ -156,330 +149,312 @@
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'customer_type',
|
||||
'fieldtype': 'Select',
|
||||
'idx': 3,
|
||||
'label': 'Customer Type',
|
||||
'oldfieldname': 'customer_type',
|
||||
'oldfieldtype': 'Select',
|
||||
'options': '\nCompany\nIndividual',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'customer_type',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'Customer Type',
|
||||
'oldfieldname': u'customer_type',
|
||||
'oldfieldtype': u'Select',
|
||||
'options': u'\nCompany\nIndividual',
|
||||
'permlevel': 0,
|
||||
'reqd': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'naming_series',
|
||||
'fieldtype': 'Select',
|
||||
'idx': 4,
|
||||
'label': 'Series',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'naming_series',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'Series',
|
||||
'no_copy': 1,
|
||||
'options': '\nCUST\nCUSTMUM\nCUSTOM',
|
||||
'options': u'\nCUST\nCUSTMUM',
|
||||
'permlevel': 0,
|
||||
'print_hide': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': 'White:FFF',
|
||||
'description': 'Fetch lead which will be converted into customer.',
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'lead_name',
|
||||
'fieldtype': 'Link',
|
||||
'colour': u'White:FFF',
|
||||
'description': u'Fetch lead which will be converted into customer.',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'lead_name',
|
||||
'fieldtype': u'Link',
|
||||
'hidden': 0,
|
||||
'idx': 5,
|
||||
'in_filter': 1,
|
||||
'label': 'Lead Ref',
|
||||
'label': u'Lead Ref',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'lead_name',
|
||||
'oldfieldtype': 'Link',
|
||||
'options': 'Lead',
|
||||
'oldfieldname': u'lead_name',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Lead',
|
||||
'permlevel': 0,
|
||||
'print_hide': 1,
|
||||
'report_hide': 1,
|
||||
'trigger': 'Client'
|
||||
'trigger': u'Client'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Column Break',
|
||||
'idx': 6,
|
||||
'doctype': u'DocField',
|
||||
'fieldtype': u'Column Break',
|
||||
'permlevel': 0,
|
||||
'width': '50%'
|
||||
'width': u'50%'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': 'White:FFF',
|
||||
'description': '<a href="javascript:cur_frm.cscript.CGHelp();">To manage Customer Groups, click here</a>',
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'customer_group',
|
||||
'fieldtype': 'Link',
|
||||
'colour': u'White:FFF',
|
||||
'description': u'<a href="javascript:cur_frm.cscript.CGHelp();">To manage Customer Groups, click here</a>',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'customer_group',
|
||||
'fieldtype': u'Link',
|
||||
'hidden': 0,
|
||||
'idx': 7,
|
||||
'in_filter': 1,
|
||||
'label': 'Customer Group',
|
||||
'oldfieldname': 'customer_group',
|
||||
'oldfieldtype': 'Link',
|
||||
'options': 'Customer Group',
|
||||
'label': u'Customer Group',
|
||||
'oldfieldname': u'customer_group',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Customer Group',
|
||||
'permlevel': 0,
|
||||
'print_hide': 0,
|
||||
'reqd': 1,
|
||||
'search_index': 1,
|
||||
'trigger': 'Client'
|
||||
'trigger': u'Client'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': 'White:FFF',
|
||||
'description': '<a href="javascript:cur_frm.cscript.TerritoryHelp();">To manage Territory, click here</a>',
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'territory',
|
||||
'fieldtype': 'Link',
|
||||
'idx': 8,
|
||||
'label': 'Territory',
|
||||
'oldfieldname': 'territory',
|
||||
'oldfieldtype': 'Link',
|
||||
'options': 'Territory',
|
||||
'colour': u'White:FFF',
|
||||
'description': u'<a href="javascript:cur_frm.cscript.TerritoryHelp();">To manage Territory, click here</a>',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'territory',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Territory',
|
||||
'oldfieldname': u'territory',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Territory',
|
||||
'permlevel': 0,
|
||||
'print_hide': 1,
|
||||
'reqd': 1,
|
||||
'trigger': 'Client'
|
||||
'trigger': u'Client'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': 'White:FFF',
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 9,
|
||||
'label': 'Address & Contacts',
|
||||
'colour': u'White:FFF',
|
||||
'doctype': u'DocField',
|
||||
'fieldtype': u'Section Break',
|
||||
'label': u'Address & Contacts',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': 'White:FFF',
|
||||
'depends_on': 'eval:doc.__islocal',
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'HTML',
|
||||
'idx': 10,
|
||||
'label': 'Address Desc',
|
||||
'options': '<em>Addresses will appear only when you save the customer</em>',
|
||||
'colour': u'White:FFF',
|
||||
'depends_on': u'eval:doc.__islocal',
|
||||
'doctype': u'DocField',
|
||||
'fieldtype': u'HTML',
|
||||
'label': u'Address Desc',
|
||||
'options': u'<em>Addresses will appear only when you save the customer</em>',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': 'White:FFF',
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'HTML',
|
||||
'idx': 11,
|
||||
'label': 'Address HTML',
|
||||
'colour': u'White:FFF',
|
||||
'doctype': u'DocField',
|
||||
'fieldtype': u'HTML',
|
||||
'label': u'Address HTML',
|
||||
'permlevel': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Column Break',
|
||||
'idx': 12,
|
||||
'doctype': u'DocField',
|
||||
'fieldtype': u'Column Break',
|
||||
'permlevel': 0,
|
||||
'width': '50%'
|
||||
'width': u'50%'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': 'White:FFF',
|
||||
'depends_on': 'eval:doc.__islocal',
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'HTML',
|
||||
'idx': 13,
|
||||
'label': 'Contact Desc',
|
||||
'options': '<em>Contact Details will appear only when you save the customer</em>',
|
||||
'colour': u'White:FFF',
|
||||
'depends_on': u'eval:doc.__islocal',
|
||||
'doctype': u'DocField',
|
||||
'fieldtype': u'HTML',
|
||||
'label': u'Contact Desc',
|
||||
'options': u'<em>Contact Details will appear only when you save the customer</em>',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': 'White:FFF',
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'HTML',
|
||||
'idx': 14,
|
||||
'label': 'Contact HTML',
|
||||
'oldfieldtype': 'HTML',
|
||||
'colour': u'White:FFF',
|
||||
'doctype': u'DocField',
|
||||
'fieldtype': u'HTML',
|
||||
'label': u'Contact HTML',
|
||||
'oldfieldtype': u'HTML',
|
||||
'permlevel': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': 'White:FFF',
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 15,
|
||||
'label': 'More Info',
|
||||
'oldfieldtype': 'Section Break',
|
||||
'colour': u'White:FFF',
|
||||
'doctype': u'DocField',
|
||||
'fieldtype': u'Section Break',
|
||||
'label': u'More Info',
|
||||
'oldfieldtype': u'Section Break',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': 'White:FFF',
|
||||
'description': 'To create an Account Head under a different company, then set the company and click the button below.',
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'company',
|
||||
'fieldtype': 'Link',
|
||||
'idx': 16,
|
||||
'doctype': u'DocField',
|
||||
'fieldtype': u'Column Break',
|
||||
'permlevel': 0,
|
||||
'width': u'50%'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'To create an Account Head under a different company, select the company and save customer.',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'company',
|
||||
'fieldtype': u'Link',
|
||||
'in_filter': 1,
|
||||
'label': 'Company',
|
||||
'oldfieldname': 'company',
|
||||
'oldfieldtype': 'Link',
|
||||
'options': 'Company',
|
||||
'label': u'Company',
|
||||
'oldfieldname': u'company',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Company',
|
||||
'permlevel': 0,
|
||||
'reqd': 1,
|
||||
'search_index': 0
|
||||
'search_index': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': 'White:FFF',
|
||||
'description': "Your Customer's TAX registration numbers (if applicable) or any general information",
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'customer_details',
|
||||
'fieldtype': 'Text',
|
||||
'idx': 17,
|
||||
'label': 'Customer Details',
|
||||
'oldfieldname': 'customer_details',
|
||||
'oldfieldtype': 'Code',
|
||||
'colour': u'White:FFF',
|
||||
'description': u"Your Customer's TAX registration numbers (if applicable) or any general information",
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'customer_details',
|
||||
'fieldtype': u'Text',
|
||||
'label': u'Customer Details',
|
||||
'oldfieldname': u'customer_details',
|
||||
'oldfieldtype': u'Code',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Column Break',
|
||||
'idx': 18,
|
||||
'doctype': u'DocField',
|
||||
'fieldtype': u'Column Break',
|
||||
'permlevel': 0,
|
||||
'width': '50%'
|
||||
'width': u'50%'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'credit_days',
|
||||
'fieldtype': 'Int',
|
||||
'idx': 19,
|
||||
'label': 'Credit Days',
|
||||
'oldfieldname': 'credit_days',
|
||||
'oldfieldtype': 'Int',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'credit_days',
|
||||
'fieldtype': u'Int',
|
||||
'label': u'Credit Days',
|
||||
'oldfieldname': u'credit_days',
|
||||
'oldfieldtype': u'Int',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'credit_limit',
|
||||
'fieldtype': 'Currency',
|
||||
'idx': 20,
|
||||
'label': 'Credit Limit',
|
||||
'oldfieldname': 'credit_limit',
|
||||
'oldfieldtype': 'Currency',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'credit_limit',
|
||||
'fieldtype': u'Currency',
|
||||
'label': u'Credit Limit',
|
||||
'oldfieldname': u'credit_limit',
|
||||
'oldfieldtype': u'Currency',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'website',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 21,
|
||||
'label': 'Website',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'website',
|
||||
'fieldtype': u'Data',
|
||||
'label': u'Website',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 22,
|
||||
'label': 'Sales Team',
|
||||
'oldfieldtype': 'Section Break',
|
||||
'doctype': u'DocField',
|
||||
'fieldtype': u'Section Break',
|
||||
'label': u'Sales Team',
|
||||
'oldfieldtype': u'Section Break',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'default_sales_partner',
|
||||
'fieldtype': 'Link',
|
||||
'idx': 23,
|
||||
'label': 'Default Sales Partner',
|
||||
'oldfieldname': 'default_sales_partner',
|
||||
'oldfieldtype': 'Link',
|
||||
'options': 'Sales Partner',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'default_sales_partner',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Default Sales Partner',
|
||||
'oldfieldname': u'default_sales_partner',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Sales Partner',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'default_commission_rate',
|
||||
'fieldtype': 'Currency',
|
||||
'idx': 24,
|
||||
'label': 'Default Commission Rate',
|
||||
'oldfieldname': 'default_commission_rate',
|
||||
'oldfieldtype': 'Currency',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'default_commission_rate',
|
||||
'fieldtype': u'Currency',
|
||||
'label': u'Default Commission Rate',
|
||||
'oldfieldname': u'default_commission_rate',
|
||||
'oldfieldtype': u'Currency',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'sales_team',
|
||||
'fieldtype': 'Table',
|
||||
'idx': 25,
|
||||
'label': 'Sales Team Details',
|
||||
'oldfieldname': 'sales_team',
|
||||
'oldfieldtype': 'Table',
|
||||
'options': 'Sales Team',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'sales_team',
|
||||
'fieldtype': u'Table',
|
||||
'label': u'Sales Team Details',
|
||||
'oldfieldname': u'sales_team',
|
||||
'oldfieldtype': u'Table',
|
||||
'options': u'Sales Team',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': 'White:FFF',
|
||||
'depends_on': 'eval:!doc.__islocal',
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 26,
|
||||
'label': 'Transaction History',
|
||||
'colour': u'White:FFF',
|
||||
'depends_on': u'eval:!doc.__islocal',
|
||||
'doctype': u'DocField',
|
||||
'fieldtype': u'Section Break',
|
||||
'label': u'Transaction History',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': 'White:FFF',
|
||||
'depends_on': 'eval:!doc.__islocal',
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'HTML',
|
||||
'idx': 27,
|
||||
'label': 'History HTML',
|
||||
'colour': u'White:FFF',
|
||||
'depends_on': u'eval:!doc.__islocal',
|
||||
'doctype': u'DocField',
|
||||
'fieldtype': u'HTML',
|
||||
'label': u'History HTML',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': 'White:FFF',
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'trash_reason',
|
||||
'fieldtype': 'Small Text',
|
||||
'idx': 28,
|
||||
'label': 'Trash Reason',
|
||||
'oldfieldname': 'trash_reason',
|
||||
'oldfieldtype': 'Small Text',
|
||||
'colour': u'White:FFF',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'trash_reason',
|
||||
'fieldtype': u'Small Text',
|
||||
'label': u'Trash Reason',
|
||||
'oldfieldname': u'trash_reason',
|
||||
'oldfieldtype': u'Small Text',
|
||||
'permlevel': 1
|
||||
}
|
||||
]
|
@ -50,8 +50,11 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
}
|
||||
|
||||
cur_frm.cscript.onload_post_render = function(doc, dt, dn) {
|
||||
// defined in sales_common.js
|
||||
cur_frm.cscript.update_item_details(doc, cdt, cdn);
|
||||
var callback = function(doc, dt, dn) {
|
||||
// defined in sales_common.js
|
||||
cur_frm.cscript.update_item_details(doc, dt, dn);
|
||||
}
|
||||
cur_frm.cscript.hide_price_list_currency(doc, dt, dn, callback);
|
||||
}
|
||||
|
||||
// hide - unhide fields based on lead or customer..
|
||||
@ -83,10 +86,7 @@ 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 (!cur_frm.cscript.is_onload) cur_frm.cscript.hide_price_list_currency(doc, cdt, cdn);
|
||||
|
||||
|
||||
if(doc.docstatus == 1 && doc.status!='Order Lost') {
|
||||
|
@ -77,14 +77,16 @@ class DocType(TransactionBase):
|
||||
# Get Item Details
|
||||
# -----------------
|
||||
def get_item_details(self, args=None):
|
||||
args = eval(args)
|
||||
if args['item_code']:
|
||||
args = args and eval(args) or {}
|
||||
if args.get('item_code'):
|
||||
return get_obj('Sales Common').get_item_details(args, self)
|
||||
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)
|
||||
arg = {'item_code':doc.fields.get('item_code'), 'income_account':doc.fields.get('income_account'),
|
||||
'cost_center': doc.fields.get('cost_center'), 'warehouse': doc.fields.get('warehouse')};
|
||||
ret = obj.get_item_details(arg, self)
|
||||
for r in ret:
|
||||
if not doc.fields.get(r):
|
||||
doc.fields[r] = ret[r]
|
||||
@ -96,11 +98,6 @@ 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)
|
||||
|
||||
|
||||
# OTHER CHARGES TRIGGER FUNCTIONS
|
||||
|
@ -75,7 +75,6 @@ cur_frm.cscript.update_item_details = function(doc, dt, dn, callback) {
|
||||
|
||||
|
||||
|
||||
|
||||
// ============== Customer and its primary contact Details ============================
|
||||
cur_frm.cscript.customer = function(doc, cdt, cdn) {
|
||||
if(doc.customer){
|
||||
@ -136,17 +135,11 @@ var set_dynamic_label_child = function(doc, cdt, cdn, 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'];
|
||||
cur_frm.cscript.dynamic_label = function(doc, cdt, cdn, base_curr, callback) {
|
||||
set_dynamic_label_par(doc, cdt, cdn, base_curr);
|
||||
set_dynamic_label_child(doc, cdt, cdn, base_curr);
|
||||
|
||||
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);
|
||||
if (callback) callback(doc, cdt, cdn);
|
||||
}
|
||||
|
||||
|
||||
@ -155,27 +148,30 @@ cur_frm.cscript.dynamic_label = function(doc, cdt, cdn) {
|
||||
|
||||
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']);
|
||||
wn.call({
|
||||
method: 'selling.doctype.sales_common.sales_common.get_price_list_currency',
|
||||
args: {'price_list':doc.price_list_name, 'company': doc.company},
|
||||
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.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);
|
||||
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');
|
||||
|
||||
cur_frm.cscript.dynamic_label(doc, cdt, cdn, r.message[1], callback1);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -213,12 +209,15 @@ 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);
|
||||
wn.call({
|
||||
method: 'selling.doctype.sales_common.sales_common.get_comp_base_currency',
|
||||
args: {company:doc.company},
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -234,7 +233,6 @@ cur_frm.cscript.price_list_name = function(doc, cdt, cdn) {
|
||||
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);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -178,18 +178,6 @@ class DocType(TransactionBase):
|
||||
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):
|
||||
@ -781,3 +769,17 @@ class StatusUpdater:
|
||||
where
|
||||
name="%(name)s"
|
||||
""" % args)
|
||||
|
||||
|
||||
@webnotes.whitelist()
|
||||
def get_comp_base_currency(arg=None):
|
||||
""" get default currency of company"""
|
||||
return webnotes.conn.sql("select default_currency from `tabCompany` where name = %s", webnotes.form_dict['company'])[0][0]
|
||||
|
||||
@webnotes.whitelist()
|
||||
def get_price_list_currency(arg=None):
|
||||
""" 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", webnotes.form_dict['price_list'])
|
||||
plc = [d[0] for d in plc]
|
||||
base_currency = get_comp_base_currency(webnotes.form_dict['company'])
|
||||
return plc, base_currency
|
||||
|
@ -41,10 +41,15 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
}
|
||||
|
||||
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);
|
||||
var callback = function(doc, cdt, cdn) {
|
||||
if(doc.__islocal) {
|
||||
// defined in sales_common.js
|
||||
cur_frm.cscript.update_item_details(doc, cdt, cdn);
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.cscript.hide_price_list_currency(doc, cdt, cdn, callback);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -52,10 +57,8 @@ cur_frm.cscript.onload_post_render = function(doc, cdt, cdn) {
|
||||
//==================
|
||||
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 (!cur_frm.cscript.is_onload) cur_frm.cscript.hide_price_list_currency(doc, cdt, cdn);
|
||||
|
||||
|
||||
if(doc.docstatus==1) {
|
||||
|
@ -102,14 +102,16 @@ class DocType(TransactionBase):
|
||||
# Get Item Details
|
||||
# ----------------
|
||||
def get_item_details(self, args=None):
|
||||
args = eval(args)
|
||||
if args['item_code']:
|
||||
args = args and eval(args) or {}
|
||||
if args.get('item_code'):
|
||||
return get_obj('Sales Common').get_item_details(args, self)
|
||||
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)
|
||||
arg = {'item_code':doc.fields.get('item_code'), 'income_account':doc.fields.get('income_account'),
|
||||
'cost_center': doc.fields.get('cost_center'), 'warehouse': doc.fields.get('warehouse')};
|
||||
ret = obj.get_item_details(arg, self)
|
||||
for r in ret:
|
||||
if not doc.fields.get(r):
|
||||
doc.fields[r] = ret[r]
|
||||
@ -120,13 +122,6 @@ 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
|
||||
|
@ -149,7 +149,6 @@ pscript.feature_dict = {
|
||||
'Sales Order': {'fields':['sales_team','Packing List']}
|
||||
},
|
||||
'fs_more_info': {
|
||||
'Customer': {'fields':['More Info']},
|
||||
'Delivery Note': {'fields':['More Info']},
|
||||
'Enquiry': {'fields':['More Info']},
|
||||
'Indent': {'fields':['More Info']},
|
||||
@ -160,8 +159,6 @@ pscript.feature_dict = {
|
||||
'Quotation': {'fields':['More Info']},
|
||||
'Receivable Voucher': {'fields':['More Info']},
|
||||
'Sales Order': {'fields':['More Info']},
|
||||
'Serial No': {'fields':['More Info']},
|
||||
'Supplier': {'fields':['More Info']}
|
||||
},
|
||||
'fs_quality': {
|
||||
'Item': {'fields':['Item Inspection Criteria','inspection_required']},
|
||||
|
@ -43,17 +43,19 @@ cur_frm.cscript.onload = function(doc, dt, dn) {
|
||||
|
||||
cur_frm.cscript.onload_post_render = function(doc, dt, dn) {
|
||||
// defined in sales_common.js
|
||||
if(doc.__islocal) cur_frm.cscript.update_item_details(doc, dt, dn);
|
||||
var callback = function(doc, dt, dn) {
|
||||
if(doc.__islocal) cur_frm.cscript.update_item_details(doc, dt, dn);
|
||||
}
|
||||
|
||||
cur_frm.cscript.hide_price_list_currency(doc, dt, dn, callback);
|
||||
}
|
||||
|
||||
// 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 (!cur_frm.cscript.is_onload) cur_frm.cscript.hide_price_list_currency(doc, cdt, cdn);
|
||||
|
||||
|
||||
if(doc.per_billed < 100 && doc.docstatus==1) cur_frm.add_custom_button('Make Invoice', cur_frm.cscript['Make Sales Invoice']);
|
||||
|
@ -117,14 +117,16 @@ class DocType(TransactionBase):
|
||||
|
||||
# ***************** Get Item Details ******************************
|
||||
def get_item_details(self, args=None):
|
||||
args = eval(args)
|
||||
if args['item_code']:
|
||||
args = args and eval(args) or {}
|
||||
if args.get('item_code'):
|
||||
return get_obj('Sales Common').get_item_details(args, self)
|
||||
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)
|
||||
arg = {'item_code':doc.fields.get('item_code'), 'income_account':doc.fields.get('income_account'),
|
||||
'cost_center': doc.fields.get('cost_center'), 'warehouse': doc.fields.get('warehouse')};
|
||||
ret = obj.get_item_details(arg, self)
|
||||
for r in ret:
|
||||
if not doc.fields.get(r):
|
||||
doc.fields[r] = ret[r]
|
||||
@ -135,13 +137,6 @@ 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 Actual Qty of item in warehouse selected *************
|
||||
def get_actual_qty(self,args):
|
||||
args = eval(args)
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user