Merge branch 'master' of git://github.com/webnotes/erpnext

This commit is contained in:
Nijil
2011-11-21 10:35:15 +05:30
111 changed files with 6873 additions and 1614 deletions

Binary file not shown.

View File

@@ -5,7 +5,7 @@
{ {
'creation': '2010-08-08 17:09:35', 'creation': '2010-08-08 17:09:35',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-09-15 15:04:43', 'modified': '2011-10-12 12:10:15',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
@@ -107,6 +107,15 @@
'to_field': 'naming_series' 'to_field': 'naming_series'
}, },
# Field Mapper Detail
{
'doctype': 'Field Mapper Detail',
'from_field': 'total_tax',
'map': 'Yes',
'match_id': 0,
'to_field': 'total_tax'
},
# Table Mapper Detail # Table Mapper Detail
{ {
'doctype': 'Table Mapper Detail', 'doctype': 'Table Mapper Detail',
@@ -116,17 +125,6 @@
'validation_logic': 'docstatus =1' 'validation_logic': 'docstatus =1'
}, },
# Table Mapper Detail
{
'doctype': 'Table Mapper Detail',
'from_field': 'po_details',
'from_table': 'PO Detail',
'match_id': 1,
'to_field': 'entries',
'to_table': 'PV Detail',
'validation_logic': 'ifnull(billed_qty,0) < qty'
},
# Table Mapper Detail # Table Mapper Detail
{ {
'doctype': 'Table Mapper Detail', 'doctype': 'Table Mapper Detail',

View File

@@ -5,7 +5,7 @@
{ {
'creation': '2010-08-08 17:09:35', 'creation': '2010-08-08 17:09:35',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-09-15 15:04:44', 'modified': '2011-10-12 10:49:26',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
@@ -125,6 +125,33 @@
'to_field': 'naming_series' 'to_field': 'naming_series'
}, },
# Field Mapper Detail
{
'doctype': 'Field Mapper Detail',
'from_field': 'net_total',
'map': 'Yes',
'match_id': 0,
'to_field': 'net_total'
},
# Field Mapper Detail
{
'doctype': 'Field Mapper Detail',
'from_field': 'grand_total',
'map': 'Yes',
'match_id': 0,
'to_field': 'grand_total'
},
# Field Mapper Detail
{
'doctype': 'Field Mapper Detail',
'from_field': 'total_tax',
'map': 'Yes',
'match_id': 0,
'to_field': 'total_tax'
},
# Table Mapper Detail # Table Mapper Detail
{ {
'doctype': 'Table Mapper Detail', 'doctype': 'Table Mapper Detail',

View File

@@ -3,10 +3,10 @@
# These values are common in all dictionaries # These values are common in all dictionaries
{ {
'creation': '2011-03-25 15:26:02', 'creation': '2011-03-28 15:17:25',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-03-28 12:33:24', 'modified': '2011-03-28 12:33:24',
'modified_by': 'Administrator', 'modified_by': 'umair@iwebnotes.com',
'owner': 'Administrator' 'owner': 'Administrator'
}, },

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,27 @@
# Print Format, POS Invoice
[
# These values are common in all dictionaries
{
'creation': '2011-10-19 14:27:47',
'docstatus': 0,
'modified': '2011-10-19 14:29:45',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all Print Format
{
'doctype': 'Print Format',
'html': '<html>\n<head>\n<!--Other charges function-->\n<script>\n var make_row = function(title,val,bold){\n var bstart = \'<b>\'; var bend = \'</b>\';\n return \'<tr><td style="width:50%">\'+(bold?bstart:\'\')+title+(bold?bend:\'\')+\'</td>\'\n +\'<td style="width:20%">\'+doc.currency+\'</td>\'\n +\'<td style="width:30%;text-align:right">\'+(val?val:\'0.00\')+\'</td>\'\n +\'</tr>\'\n }\n var make_row1 = function(title,val,bold){\n var bstart = \'<b>\'; var bend = \'</b>\';\n \n return \'<tr style="font-family:courier new; line-height:150%"><td style="width:50%">\'+(bold?bstart:\'\')+title+(bold?bend:\'\')+\'</td>\'\n +\'<td style="width:50%;text-align:right">\'+(bold?bstart:\'\')+(val?val:\'0.00\')+(bold?bend:\'\')+\'</td>\'\n +\'</tr>\'\n }\n\nfunction get_letter_head() {\n\t// add letter head\n\tvar cp = locals[\'Control Panel\'][\'Control Panel\'];\n\tif(doc.letter_head)\n\t\tvar lh= cstr(_p.letter_heads[doc.letter_head]);\n\telse if(cp.letter_head)\n\t\tvar lh= cp.letter_head;\n\telse \n\t\tvar lh= \'\';\n\t\t\n\treturn lh;\n}\n\n function get_tax_details(){\n \n var cl = getchildren(\'RV Tax Detail\',doc.name,\'other_charges\');\n var out = \'\';\n\n// if(cl.length){\n out += \'<div><table style="float: right;">\';\n for(var i=0;i<cl.length;i++){\n out += make_row1(cl[i].description,fmt_money(convert_rate(cl[i].tax_amount)),0);\n }\n\n out += make_row1(\'TOTAL\',fmt_money(doc.grand_total),1);\n // }\n out +=\'</table></div>\';\n return out;\n }\n function get_other_charges(){\n var out =\'\';\n out += \'<div><table cssClass="noborder" style="width:100%">\';\n \n out += make_row(\'Net Total\',fmt_money(convert_rate(doc.net_total)),1)\n +make_row(\'Total Taxes\',fmt_money(convert_rate(doc.other_charges_total)),0)\n +make_row(\'Grand Total\',fmt_money(convert_rate(doc.grand_total)),1)\n +make_row(\'Rounded Total\',fmt_money(convert_rate(doc.rounded_total)),1)\n +make_row(\'Outstanding Amount\',fmt_money(convert_rate(doc.outstanding_amount)),1)\n out += \'</table></div>\';\n return out;\n }\n\n \n function convert_rate(val){ \n var new_val = flt(val)/flt(doc.conversion_rate);\n return new_val;\n }\n \n</script>\n</head>\n<body>\n\n<div><script>get_letter_head()</script></div>\n<table width="100%" style="font-family: courier new; line-height:200%">\n<tr>\n<td align="left">NO: <script>doc.name</script></td>\n<td align="right">DATE: <script>date.str_to_user(doc.voucher_date)</script></td>\n</tr>\n<tr>\n<td>M/s <script>doc.contact_display</script></td>\n</tr>\n</table>\n<!--Item Table-->\n<div>\n <script>\n var t = print_table(\'Receivable Voucher\', doc.name, \'entries\', \'RV Detail\', [\'description\',\'qty\',\'basic_rate\',\'amount\'], [\'ITEM\', \'QTY\',\'RATE\',\'AMOUNT\'], [\'35%\',\'20%\',\'20%\',\'25%\'])\n if(t.appendChild) {\n // single\n out = t.innerHTML.replace(/border: 1px/gi,\'border: 0px\').replace(/style="/gi,\'style="font-family:courier new;line-height:150%;\');\n }\n else {//multiple\n out = \'<table class="None" border="0px" width="100%" style="border:0px; font-family:courier-new">\';\n\n for(var i=0;i<t.length;i++) \n {\n\t\tif(i==0)\n\t\t{\n\t\t\tout+=\'<tr>\'+t[i].childNodes[0].childNodes[0].childNodes[0].innerHTML.replace(/style="border: 1px solid rgb\\(0, 0, 0\\);/gi,\'style="font-family:courier new;\')+\'</tr>\'\n\t\t}\n\t\tout+=\'<tr>\'+t[i].childNodes[0].childNodes[0].childNodes[1].innerHTML.replace(/style="border: 1px solid rgb\\(0, 0, 0\\);/gi,\'style="font-family:courier new;\')+\'</tr>\'\n }\n\tout += \'</table>\'\n }\n out;\n </script>\n\n</div>\n\n<!--Tax table-->\n<div><script>get_tax_details();</script>\n </table>\n</div>\n\n<br>\n<table style="font-family:courier new;">\n<tr><td><b><script>doc.terms</script></b></td></tr>\n<tr><td nowrap><b>For <script>doc.company</script></b></td></tr>\n<tr><td>&nbsp;</td></tr>\n<tr><td nowrap><b>Signatory</b></td></tr>\n</table>\n</body>\n</html>',
'module': 'Accounts',
'name': '__common__',
'standard': 'Yes'
},
# Print Format, POS Invoice
{
'doctype': 'Print Format',
'name': 'POS Invoice'
}
]

View File

@@ -3,17 +3,17 @@
# These values are common in all dictionaries # These values are common in all dictionaries
{ {
'creation': '2011-03-25 17:30:45', 'creation': '2011-03-28 15:17:25',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-04-27 11:44:30', 'modified': '2011-03-28 12:31:40',
'modified_by': 'Administrator', 'modified_by': 'umair@iwebnotes.com',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
# These values are common for all Print Format # These values are common for all Print Format
{ {
'doctype': 'Print Format', 'doctype': 'Print Format',
'html': '<div style="position: relative;">\n<h3 align="center"><script>doc.company</script>\n</div>\n\n<font size="4">\n<table class=\'simpletable\'>\n<tr>\n<td><b> Receipt No.: </b></td>\n<td><script>doc.name</script></td>\n</tr>\n<tr>\n<td><b> Date : </b></td>\n<td><script>date.str_to_user(doc.voucher_date)</script></td>\n</tr> \n<tr>\n<td><b> Remark: </b></td>\n<td><script> doc.remark </script></td>\n</tr>\n<tr>\n<td><b> Received From: </b></td>\n<td><b><script> doc.pay_to_rec_from </script></b></td>\n</tr>\n</table>\n<br>\n\n<div><b><script>doc.total_amount</script></b> </td></div><br>\n<div style="text-align:left"><b><script>doc.total_amount_in_words</script></b></div><br>\n<div>This receipt is issued subject to realization of the <script>if(doc.cheque_no){\'Cheque\'}else{\'Cash\'}</script></div>\n</font>\n<br>\n<table class="noborder">\n<tr>\n<td style = "text-align = right;"><h3>For <script>doc.company</script>,</h3><br><div>(Authorised Signatory)</div></td>\n</tr>\n</table>', 'html': '<div style="position: relative;">\n<h3 align="center"><script>doc.company</script>\n</div>\n\n<font size="4">\n<table class=\'simpletable\'>\n<tr>\n<td><b> Receipt No.: </b></td>\n<td><script>doc.name</script></td>\n</tr>\n<tr>\n<td><b> Date : </b></td>\n<td><script>date.str_to_user(doc.voucher_date)</script></td>\n</tr> \n<tr>\n<td><b> Remark: </b></td>\n<td><script> doc.remark </script></td>\n</tr>\n<tr>\n<td><b> Received From: </b></td>\n<td><b><script> doc.pay_to_rec_from </script></b></td>\n</tr>\n</table>\n<br>\n\n<div><b><script>doc.total_amount</script></b> </td></div><br>\n<div style="text-align:left"><b><script>doc.total_amount_in_words</script></b></div><br>\n<div>This receipt is issued subject to realization of the Cheque</div>\n</font>\n<br>\n<table class="noborder">\n<tr>\n<td style = "text-align = right;"><h3>For <script>doc.company</script>,</h3><br><div>(Authorised Signatory)</div></td>\n</tr>\n</table>',
'module': 'Accounts', 'module': 'Accounts',
'name': '__common__', 'name': '__common__',
'standard': 'Yes' 'standard': 'Yes'

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -52,7 +52,6 @@ cur_frm.cscript.refresh = function(doc, dt, dn) {
//Supplier //Supplier
cur_frm.cscript.supplier = function(doc,dt,dn) { cur_frm.cscript.supplier = function(doc,dt,dn) {
var callback = function(r,rt) { var callback = function(r,rt) {
var doc = locals[cur_frm.doctype][cur_frm.docname]; var doc = locals[cur_frm.doctype][cur_frm.docname];
get_server_fields('get_credit_to','','',doc, dt, dn, 0, callback2); get_server_fields('get_credit_to','','',doc, dt, dn, 0, callback2);
@@ -144,13 +143,6 @@ cur_frm.cscript.is_opening = function(doc, dt, dn) {
} }
/* ******************************** TRIGGERS **************************************** */ /* ******************************** TRIGGERS **************************************** */
/*
// Supplier
// ---------
cur_frm.cscript.supplier = function(doc,cdt,cdn){
get_server_fields('get_credit_to','','',doc,cdt,cdn);
}
*/
// Conversion Rate // Conversion Rate
// ---------------- // ----------------
@@ -420,7 +412,7 @@ cur_frm.cscript.make_jv = function(doc, dt, dn, det) {
} }
// ***************** Get project name ***************** // ***************** Get project name *****************
cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) { cur_frm.fields_dict['pv_details'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) {
return 'SELECT `tabProject`.name FROM `tabProject` WHERE `tabProject`.status = "Open" AND `tabProject`.name LIKE "%s" ORDER BY `tabProject`.name ASC LIMIT 50'; return 'SELECT `tabProject`.name FROM `tabProject` WHERE `tabProject`.status = "Open" AND `tabProject`.name LIKE "%s" ORDER BY `tabProject`.name ASC LIMIT 50';
} }

View File

@@ -232,15 +232,11 @@ class DocType(TransactionBase):
# Validate Acc Head of Supplier and Credit To Account entered # Validate Acc Head of Supplier and Credit To Account entered
# ------------------------------------------------------------ # ------------------------------------------------------------
def check_for_acc_head_of_supplier(self): def check_for_acc_head_of_supplier(self):
acc_head = sql("select name from `tabAccount` where name = %s", (cstr(self.doc.supplier) + " - " + self.get_company_abbr())) if self.doc.supplier and self.doc.credit_to:
if self.doc.supplier: acc_head = sql("select master_name from `tabAccount` where name = %s", self.doc.credit_to)
if acc_head and acc_head[0][0]:
if not cstr(acc_head[0][0]) == cstr(self.doc.credit_to): if (acc_head and cstr(acc_head[0][0]) != cstr(self.doc.supplier)) or (not acc_head and (self.doc.credit_to != cstr(self.doc.supplier) + " - " + self.get_company_abbr())):
msgprint("Credit To: %s do not match with Supplier: %s for Company: %s i.e. %s" %(self.doc.credit_to,self.doc.supplier,self.doc.company,cstr(acc_head[0][0]))) msgprint("Credit To: %s do not match with Supplier: %s for Company: %s.\n If both correctly entered, please select Master Type and Master Name in account master." %(self.doc.credit_to,self.doc.supplier,self.doc.company), raise_exception=1)
raise Exception, "Validation Error "
if not acc_head:
msgprint("Supplier %s does not have an Account Head in %s. You must first create it from the Supplier Master" % (self.doc.supplier, self.doc.company))
raise Exception, "Validation Error "
# Check for Stopped PO # Check for Stopped PO
# --------------------- # ---------------------

View File

@@ -1,109 +1,38 @@
cur_frm.cscript.onload = function(doc,cdt,cdn){
$c_obj(make_doclist(cdt,cdn),'get_series','',function(r,rt){
if(r.message) set_field_options('naming_series', r.message);
});
//--------- ONLOAD -------------
cur_frm.cscript.onload = function(doc, cdt, cdn) {
} }
// Settings Module //cash bank account
//------------------------------------
cur_frm.cscript.refresh = function(doc,cdt,cdn){ cur_frm.fields_dict['cash_bank_account'].get_query = function(doc,cdt,cdn) {
return 'SELECT tabAccount.name FROM tabAccount WHERE tabAccount.debit_or_credit="Debit" AND tabAccount.is_pl_account = "No" AND tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus!=2 AND tabAccount.company="'+doc.company+'" AND tabAccount.%(key)s LIKE "%s"'
if(doc.based_on == 'Grand Total' || doc.based_on == 'Average Discount' || doc.based_on == 'Total Claimed Amount' || doc.based_on == 'Not Applicable') hide_field('master_name');
else unhide_field('master_name');
if(doc.based_on == 'Not Applicable') hide_field('value');
else unhide_field('value');
if(doc.transaction == 'Expense Voucher' || doc.transaction == 'Appraisal'){
hide_field(['master_name','system_role', 'system_user']);
unhide_field(['to_emp','to_designation']);
if(doc.transaction == 'Appraisal') hide_field('value');
else unhide_field('value');
}
else {
unhide_field(['master_name','system_role', 'system_user','value']);
hide_field(['to_emp','to_designation']);
}
} }
cur_frm.cscript.based_on = function(doc){ // Income Account
if(doc.based_on == 'Grand Total' || doc.based_on == 'Average Discount' || doc.based_on == 'Total Claimed Amount' || doc.based_on == 'Not Applicable'){ // --------------------------------
doc.master_name = ''; cur_frm.fields_dict['income_account'].get_query = function(doc,cdt,cdn) {
refresh_field('master_name'); return 'SELECT tabAccount.name FROM tabAccount WHERE tabAccount.debit_or_credit="Credit" AND tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus!=2 AND tabAccount.company="'+doc.company+'" AND tabAccount.account_type ="Income Account" AND tabAccount.%(key)s LIKE "%s"'
hide_field('master_name');
}
else{
unhide_field('master_name');
}
if(doc.based_on == 'Not Applicable') {
doc.value =0;
refresh_field('value');
hide_field('value');
}
else unhide_field('value');
}
cur_frm.cscript.transaction = function(doc,cdt,cdn){
if(doc.transaction == 'Expense Voucher' || doc.transaction == 'Appraisal'){
doc.master_name = doc.system_role = doc.system_user = '';
refresh_many(['master_name','system_role', 'system_user']);
hide_field(['master_name','system_role', 'system_user']);
unhide_field(['to_emp','to_designation']);
if(doc.transaction == 'Appraisal') {
doc.value =0;
refresh_many('value');
hide_field('value');
}
else unhide_field('value');
}
else {
unhide_field(['master_name','system_role', 'system_user','value']);
hide_field(['to_emp','to_designation']);
}
if(doc.transaction == 'Expense Voucher') doc.based_on = 'Total Claimed Amount';
if(doc.transaction == 'Appraisal') doc.based_on == 'Not Applicable';
} }
// System User Trigger // Cost Center
// ------------------- // -----------------------------
cur_frm.fields_dict['system_user'].get_query = function(doc) { cur_frm.fields_dict['cost_center'].get_query = function(doc,cdt,cdn) {
return 'SELECT tabProfile.name, tabProfile.first_name FROM tabProfile WHERE tabProfile.name not in ("Administrator","Guest") AND tabProfile.docstatus != 2 AND tabProfile.%(key)s LIKE "%s" LIMIT 50' return 'SELECT `tabCost Center`.`name` FROM `tabCost Center` WHERE `tabCost Center`.`company_name` = "' +doc.company+'" AND `tabCost Center`.%(key)s LIKE "%s" AND `tabCost Center`.`group_or_ledger` = "Ledger" AND `tabCost Center`.`docstatus`!= 2 ORDER BY `tabCost Center`.`name` ASC LIMIT 50';
}
//get query select Territory
//=================================================================
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';
} }
// System Role Trigger // ------------------ Get Print Heading ------------------------------------
// ----------------------- cur_frm.fields_dict['select_print_heading'].get_query = function(doc, cdt, cdn) {
cur_frm.fields_dict['system_role'].get_query = function(doc) { return 'SELECT `tabPrint Heading`.name FROM `tabPrint Heading` WHERE `tabPrint Heading`.docstatus !=2 AND `tabPrint Heading`.name LIKE "%s" ORDER BY `tabPrint Heading`.name ASC LIMIT 50';
return 'SELECT tabRole.name FROM tabRole WHERE tabRole.name not in ("Administrator","Guest","All") AND tabRole.docstatus != 2 AND tabRole.%(key)s LIKE "%s" LIMIT 50'
}
// Approving User Trigger
// -----------------------
cur_frm.fields_dict['approving_user'].get_query = function(doc) {
return 'SELECT tabProfile.name, tabProfile.first_name FROM tabProfile WHERE tabProfile.name not in ("Administrator","Guest") AND tabProfile.docstatus != 2 AND tabProfile.%(key)s LIKE "%s" LIMIT 50'
}
// Approving Role Trigger
// -----------------------
cur_frm.fields_dict['approving_role'].get_query = function(doc) {
return 'SELECT tabRole.name FROM tabRole WHERE tabRole.name not in ("Administrator","Guest","All") AND tabRole.docstatus != 2 AND tabRole.%(key)s LIKE "%s" LIMIT 50'
}
// Master Name Trigger
// --------------------
cur_frm.fields_dict['master_name'].get_query = function(doc){
if(doc.based_on == 'Customerwise Discount')
return 'SELECT `tabCustomer`.`name` FROM `tabCustomer` WHERE `tabCustomer`.docstatus !=2 and `tabCustomer`.`name` LIKE "%s" ORDER BY `tabCustomer`.`name` DESC LIMIT 50';
else if(doc.based_on == 'Itemwise Discount')
return 'SELECT `tabItem`.`name` FROM `tabItem` WHERE (IFNULL(`tabItem`.`end_of_life`,"") = "" OR `tabItem`.`end_of_life` = "0000-00-00" OR `tabItem`.`end_of_life` > NOW()) and `tabItem`.is_sales_item = "Yes" and tabItem.%(key)s LIKE "%s" ORDER BY `tabItem`.`name` DESC LIMIT 50';
else
return 'SELECT `tabItem`.`name` FROM `tabItem` WHERE `tabItem`.`name` = "cheating done to avoid null" ORDER BY `tabItem`.`name` DESC LIMIT 50';
} }

View File

@@ -5,8 +5,8 @@
{ {
'creation': '2010-08-08 17:09:16', 'creation': '2010-08-08 17:09:16',
'docstatus': 0, 'docstatus': 0,
'modified': '2010-09-20 14:06:57', 'modified': '2011-11-16 15:41:42',
'modified_by': 'umair@iwebnotes.com', 'modified_by': 'Administrator',
'owner': 'wasim@webnotestech.com' 'owner': 'wasim@webnotestech.com'
}, },
@@ -14,6 +14,7 @@
{ {
'autoname': 'PVTD.######', 'autoname': 'PVTD.######',
'colour': 'White:FFF', 'colour': 'White:FFF',
'default_print_format': 'Standard',
'doctype': 'DocType', 'doctype': 'DocType',
'hide_heading': 1, 'hide_heading': 1,
'istable': 1, 'istable': 1,
@@ -22,7 +23,7 @@
'section_style': 'Tray', 'section_style': 'Tray',
'server_code_error': ' ', 'server_code_error': ' ',
'show_in_menu': 0, 'show_in_menu': 0,
'version': 10 'version': 12
}, },
# These values are common for all DocField # These values are common for all DocField
@@ -45,7 +46,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'category', 'fieldname': 'category',
'fieldtype': 'Select', 'fieldtype': 'Select',
'idx': 1,
'label': 'Category', 'label': 'Category',
'oldfieldname': 'category', 'oldfieldname': 'category',
'oldfieldtype': 'Select', 'oldfieldtype': 'Select',
@@ -60,7 +60,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'add_deduct_tax', 'fieldname': 'add_deduct_tax',
'fieldtype': 'Select', 'fieldtype': 'Select',
'idx': 2,
'label': 'Add or Deduct', 'label': 'Add or Deduct',
'oldfieldname': 'add_deduct_tax', 'oldfieldname': 'add_deduct_tax',
'oldfieldtype': 'Select', 'oldfieldtype': 'Select',
@@ -75,7 +74,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'charge_type', 'fieldname': 'charge_type',
'fieldtype': 'Select', 'fieldtype': 'Select',
'idx': 3,
'label': 'Type', 'label': 'Type',
'oldfieldname': 'charge_type', 'oldfieldname': 'charge_type',
'oldfieldtype': 'Select', 'oldfieldtype': 'Select',
@@ -91,7 +89,6 @@
'fieldname': 'row_id', 'fieldname': 'row_id',
'fieldtype': 'Data', 'fieldtype': 'Data',
'hidden': 0, 'hidden': 0,
'idx': 4,
'label': 'Enter Row', 'label': 'Enter Row',
'oldfieldname': 'row_id', 'oldfieldname': 'row_id',
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
@@ -104,7 +101,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'item_wise_tax_detail', 'fieldname': 'item_wise_tax_detail',
'fieldtype': 'Small Text', 'fieldtype': 'Small Text',
'idx': 5,
'label': 'Item Wise Tax Detail ', 'label': 'Item Wise Tax Detail ',
'oldfieldname': 'item_wise_tax_detail', 'oldfieldname': 'item_wise_tax_detail',
'oldfieldtype': 'Small Text', 'oldfieldtype': 'Small Text',
@@ -116,7 +112,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'description', 'fieldname': 'description',
'fieldtype': 'Small Text', 'fieldtype': 'Small Text',
'idx': 6,
'label': 'Description', 'label': 'Description',
'oldfieldname': 'description', 'oldfieldname': 'description',
'oldfieldtype': 'Small Text', 'oldfieldtype': 'Small Text',
@@ -130,7 +125,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'account_head', 'fieldname': 'account_head',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 7,
'label': 'Account Head', 'label': 'Account Head',
'oldfieldname': 'account_head', 'oldfieldname': 'account_head',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
@@ -145,13 +139,11 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'cost_center', 'fieldname': 'cost_center',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 8,
'label': 'Cost Center', 'label': 'Cost Center',
'oldfieldname': 'cost_center', 'oldfieldname': 'cost_center',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Cost Center', 'options': 'Cost Center',
'permlevel': 0, 'permlevel': 0,
'search_index': 0,
'trigger': 'Client' 'trigger': 'Client'
}, },
@@ -160,7 +152,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'rate', 'fieldname': 'rate',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 9,
'label': 'Rate', 'label': 'Rate',
'oldfieldname': 'rate', 'oldfieldname': 'rate',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@@ -174,7 +165,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'tax_amount', 'fieldname': 'tax_amount',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 10,
'label': 'Amount', 'label': 'Amount',
'oldfieldname': 'tax_amount', 'oldfieldname': 'tax_amount',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@@ -188,7 +178,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'total', 'fieldname': 'total',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 11,
'label': 'Aggregate Total', 'label': 'Aggregate Total',
'oldfieldname': 'total', 'oldfieldname': 'total',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@@ -201,7 +190,6 @@
'fieldname': 'parenttype', 'fieldname': 'parenttype',
'fieldtype': 'Data', 'fieldtype': 'Data',
'hidden': 1, 'hidden': 1,
'idx': 12,
'in_filter': 1, 'in_filter': 1,
'label': 'Parenttype', 'label': 'Parenttype',
'oldfieldname': 'parenttype', 'oldfieldname': 'parenttype',
@@ -218,7 +206,6 @@
'fieldname': 'total_tax_amount', 'fieldname': 'total_tax_amount',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'hidden': 1, 'hidden': 1,
'idx': 13,
'label': 'Total +Tax', 'label': 'Total +Tax',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'total_tax_amount', 'oldfieldname': 'total_tax_amount',
@@ -235,7 +222,6 @@
'fieldname': 'total_amount', 'fieldname': 'total_amount',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'hidden': 1, 'hidden': 1,
'idx': 14,
'label': 'Tax Amount', 'label': 'Tax Amount',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'total_amount', 'oldfieldname': 'total_amount',

View File

@@ -5,7 +5,7 @@
{ {
'creation': '2010-08-08 17:09:17', 'creation': '2010-08-08 17:09:17',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-03-30 11:23:38', 'modified': '2011-10-20 18:41:17',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
@@ -14,6 +14,7 @@
{ {
'autoname': 'EVD.######', 'autoname': 'EVD.######',
'colour': 'White:FFF', 'colour': 'White:FFF',
'default_print_format': 'Standard',
'doctype': 'DocType', 'doctype': 'DocType',
'istable': 1, 'istable': 1,
'module': 'Accounts', 'module': 'Accounts',
@@ -21,7 +22,7 @@
'section_style': 'Tray', 'section_style': 'Tray',
'server_code_error': ' ', 'server_code_error': ' ',
'show_in_menu': 0, 'show_in_menu': 0,
'version': 26 'version': 27
}, },
# These values are common for all DocField # These values are common for all DocField
@@ -44,7 +45,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'item_code', 'fieldname': 'item_code',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 1,
'in_filter': 1, 'in_filter': 1,
'label': 'Item', 'label': 'Item',
'oldfieldname': 'item_code', 'oldfieldname': 'item_code',
@@ -62,7 +62,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'item_name', 'fieldname': 'item_name',
'fieldtype': 'Data', 'fieldtype': 'Data',
'idx': 2,
'in_filter': 0, 'in_filter': 0,
'label': 'Item Name', 'label': 'Item Name',
'oldfieldname': 'item_name', 'oldfieldname': 'item_name',
@@ -77,7 +76,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'brand', 'fieldname': 'brand',
'fieldtype': 'Data', 'fieldtype': 'Data',
'idx': 3,
'label': 'Brand', 'label': 'Brand',
'oldfieldname': 'brand', 'oldfieldname': 'brand',
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
@@ -90,7 +88,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'description', 'fieldname': 'description',
'fieldtype': 'Text', 'fieldtype': 'Text',
'idx': 4,
'label': 'Description', 'label': 'Description',
'oldfieldname': 'description', 'oldfieldname': 'description',
'oldfieldtype': 'Text', 'oldfieldtype': 'Text',
@@ -103,7 +100,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'item_group', 'fieldname': 'item_group',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 5,
'in_filter': 1, 'in_filter': 1,
'label': 'Item Group', 'label': 'Item Group',
'oldfieldname': 'item_group', 'oldfieldname': 'item_group',
@@ -111,7 +107,7 @@
'options': 'Item Group', 'options': 'Item Group',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 1,
'search_index': 0 'search_index': 1
}, },
# DocField # DocField
@@ -119,7 +115,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'rate', 'fieldname': 'rate',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 6,
'label': 'Rate (Default Curr.)', 'label': 'Rate (Default Curr.)',
'oldfieldname': 'rate', 'oldfieldname': 'rate',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@@ -134,7 +129,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'import_rate', 'fieldname': 'import_rate',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 7,
'label': 'Rate', 'label': 'Rate',
'oldfieldname': 'import_rate', 'oldfieldname': 'import_rate',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@@ -149,7 +143,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'qty', 'fieldname': 'qty',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 8,
'label': 'Qty', 'label': 'Qty',
'oldfieldname': 'qty', 'oldfieldname': 'qty',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@@ -164,7 +157,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'amount', 'fieldname': 'amount',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 9,
'label': 'Amount (Default Curr.)', 'label': 'Amount (Default Curr.)',
'oldfieldname': 'amount', 'oldfieldname': 'amount',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@@ -178,7 +170,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'import_amount', 'fieldname': 'import_amount',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 10,
'label': 'Amount', 'label': 'Amount',
'oldfieldname': 'import_amount', 'oldfieldname': 'import_amount',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@@ -192,7 +183,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'expense_head', 'fieldname': 'expense_head',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 11,
'label': 'Expense Head', 'label': 'Expense Head',
'oldfieldname': 'expense_head', 'oldfieldname': 'expense_head',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
@@ -210,7 +200,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'cost_center', 'fieldname': 'cost_center',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 12,
'label': 'Cost Center', 'label': 'Cost Center',
'oldfieldname': 'cost_center', 'oldfieldname': 'cost_center',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
@@ -221,12 +210,24 @@
'width': '120px' 'width': '120px'
}, },
# DocField
{
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldname': 'project_name',
'fieldtype': 'Link',
'in_filter': 1,
'label': 'Project Name',
'options': 'Project',
'permlevel': 0,
'print_hide': 1
},
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'purchase_order', 'fieldname': 'purchase_order',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 13,
'in_filter': 1, 'in_filter': 1,
'label': 'Pur Order', 'label': 'Pur Order',
'oldfieldname': 'purchase_order', 'oldfieldname': 'purchase_order',
@@ -243,7 +244,6 @@
'fieldname': 'po_detail', 'fieldname': 'po_detail',
'fieldtype': 'Data', 'fieldtype': 'Data',
'hidden': 1, 'hidden': 1,
'idx': 14,
'in_filter': 1, 'in_filter': 1,
'label': 'PO Detail', 'label': 'PO Detail',
'oldfieldname': 'po_detail', 'oldfieldname': 'po_detail',
@@ -258,7 +258,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'purchase_receipt', 'fieldname': 'purchase_receipt',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 15,
'in_filter': 1, 'in_filter': 1,
'label': 'Pur Receipt', 'label': 'Pur Receipt',
'oldfieldname': 'purchase_receipt', 'oldfieldname': 'purchase_receipt',
@@ -275,7 +274,6 @@
'fieldname': 'pr_detail', 'fieldname': 'pr_detail',
'fieldtype': 'Data', 'fieldtype': 'Data',
'hidden': 1, 'hidden': 1,
'idx': 16,
'in_filter': 1, 'in_filter': 1,
'label': 'PR Detail', 'label': 'PR Detail',
'oldfieldname': 'pr_detail', 'oldfieldname': 'pr_detail',
@@ -291,7 +289,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'item_tax_rate', 'fieldname': 'item_tax_rate',
'fieldtype': 'Small Text', 'fieldtype': 'Small Text',
'idx': 17,
'label': 'Item Tax Rate', 'label': 'Item Tax Rate',
'oldfieldname': 'item_tax_rate', 'oldfieldname': 'item_tax_rate',
'oldfieldtype': 'Small Text', 'oldfieldtype': 'Small Text',
@@ -306,7 +303,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'page_break', 'fieldname': 'page_break',
'fieldtype': 'Check', 'fieldtype': 'Check',
'idx': 18,
'label': 'Page Break', 'label': 'Page Break',
'no_copy': 1, 'no_copy': 1,
'permlevel': 0, 'permlevel': 0,

View File

@@ -48,9 +48,9 @@ cur_frm.cscript.onload_post_render = function(doc, dt, dn) {
// Hide Fields // Hide Fields
// ------------ // ------------
cur_frm.cscript.hide_fields = function(doc, cdt, cdn) { 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', 'company', 'is_opening', 'currency', 'conversion_rate', 'price_list_name', 'cash_bank_account', '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', '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'];
ch_flds = {'entries': ['income_account', 'warehouse', 'cost_center', 'sales_order', 'delivery_note']} ch_flds = {'entries': ['sales_order', 'delivery_note']}
if(cint(doc.is_pos) == 1) { if(cint(doc.is_pos) == 1) {
hide_field(par_flds); hide_field(par_flds);
@@ -74,6 +74,9 @@ cur_frm.cscript.hide_fields = function(doc, cdt, cdn) {
// ------- // -------
cur_frm.cscript.refresh = function(doc, dt, dn) { cur_frm.cscript.refresh = function(doc, dt, dn) {
cur_frm.cscript.is_opening(doc, dt, dn);
cur_frm.cscript.hide_fields(doc, cdt, cdn);
// Show / Hide button // Show / Hide button
cur_frm.clear_custom_buttons(); cur_frm.clear_custom_buttons();
@@ -90,8 +93,6 @@ cur_frm.cscript.refresh = function(doc, dt, dn) {
} }
else else
hide_field('Repair Outstanding Amt'); hide_field('Repair Outstanding Amt');
cur_frm.cscript.is_opening(doc, dt, dn);
cur_frm.cscript.hide_fields(doc, cdt, cdn);
} }
//fetch retail transaction related fields //fetch retail transaction related fields

View File

@@ -5,14 +5,23 @@
{ {
'creation': '2010-08-08 17:09:18', 'creation': '2010-08-08 17:09:18',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-10-10 12:29:26', 'modified': '2011-10-19 16:31:54',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
# These values are common for all DocField
{
'doctype': 'DocField',
'name': '__common__',
'parent': 'Receivable Voucher',
'parentfield': 'fields',
'parenttype': 'DocType'
},
# These values are common for all DocType # These values are common for all DocType
{ {
'_last_update': '1317986484', '_last_update': '1319014846',
'change_log': '1. Change in pull_details method dt.-26-06-2009', 'change_log': '1. Change in pull_details method dt.-26-06-2009',
'colour': 'White:FFF', 'colour': 'White:FFF',
'default_print_format': 'Standard', 'default_print_format': 'Standard',
@@ -25,15 +34,16 @@
'server_code_error': ' ', 'server_code_error': ' ',
'show_in_menu': 0, 'show_in_menu': 0,
'subject': 'To %(customer_name)s worth %(currency)s %(grand_total_export)s due on %(due_date)s | %(outstanding_amount)s outstanding', 'subject': 'To %(customer_name)s worth %(currency)s %(grand_total_export)s due on %(due_date)s | %(outstanding_amount)s outstanding',
'version': 359 'version': 363
}, },
# These values are common for all DocField # These values are common for all DocFormat
{ {
'doctype': 'DocField', 'doctype': 'DocFormat',
'format': 'POS Invoice',
'name': '__common__', 'name': '__common__',
'parent': 'Receivable Voucher', 'parent': 'Receivable Voucher',
'parentfield': 'fields', 'parentfield': 'formats',
'parenttype': 'DocType' 'parenttype': 'DocType'
}, },
@@ -114,6 +124,11 @@
'write': 0 'write': 0
}, },
# DocFormat
{
'doctype': 'DocFormat'
},
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': 'DocField',

View File

@@ -5,7 +5,7 @@ report.customize_filters = function() {
this.add_filter({fieldname:'period', label:'Period', fieldtype:'Select', options:'Monthly'+NEWLINE+'Quarterly'+NEWLINE+'Half Yearly'+NEWLINE+'Annual',report_default:'Quarterly',ignore : 1, parent:'Profile',in_first_page:1,single_select:1}); this.add_filter({fieldname:'period', label:'Period', fieldtype:'Select', options:'Monthly'+NEWLINE+'Quarterly'+NEWLINE+'Half Yearly'+NEWLINE+'Annual',report_default:'Quarterly',ignore : 1, parent:'Profile',in_first_page:1,single_select:1});
this.add_filter({fieldname:'based_on', label:'Based On', fieldtype:'Select', options:'Item'+NEWLINE+'Item Group'+NEWLINE+'Customer'+NEWLINE+'Customer Group'+NEWLINE+'Territory'+NEWLINE+'Supplier'+NEWLINE+'Supplier Type', ignore : 1, parent:'Profile', report_default:'Item', in_first_page : 1,single_select:1}); this.add_filter({fieldname:'based_on', label:'Based On', fieldtype:'Select', options:'Item'+NEWLINE+'Item Group'+NEWLINE+'Customer'+NEWLINE+'Customer Group'+NEWLINE+'Territory'+NEWLINE+'Supplier'+NEWLINE+'Supplier Type'+NEWLINE+'Project', ignore : 1, parent:'Profile', report_default:'Item', in_first_page : 1,single_select:1});
this.add_filter({fieldname:'group_by', label:'Group By', fieldtype:'Select', options:NEWLINE+'Item'+NEWLINE+'Customer'+NEWLINE+'Supplier', ignore : 1, parent:'Profile',single_select:1}); this.add_filter({fieldname:'group_by', label:'Group By', fieldtype:'Select', options:NEWLINE+'Item'+NEWLINE+'Customer'+NEWLINE+'Supplier', ignore : 1, parent:'Profile',single_select:1});
@@ -24,6 +24,7 @@ report.customize_filters = function() {
this.add_filter({fieldname:'territory', label:'Territory', fieldtype:'Link', options:'Territory', ignore : 1, parent:'Profile'}); this.add_filter({fieldname:'territory', label:'Territory', fieldtype:'Link', options:'Territory', ignore : 1, parent:'Profile'});
this.add_filter({fieldname:'supplier', label:'Supplier', fieldtype:'Link', options:'Supplier', ignore : 1, parent:'Profile'}); this.add_filter({fieldname:'supplier', label:'Supplier', fieldtype:'Link', options:'Supplier', ignore : 1, parent:'Profile'});
this.add_filter({fieldname:'supplier_type', label:'Supplier Type', fieldtype:'Link', options:'Supplier Type', ignore : 1, parent:'Profile'}); this.add_filter({fieldname:'supplier_type', label:'Supplier Type', fieldtype:'Link', options:'Supplier Type', ignore : 1, parent:'Profile'});
this.add_filter({fieldname:'project', label:'Project', fieldtype:'Link', options:'Project', ignore : 1, parent:'Profile'});
} }
@@ -99,6 +100,15 @@ report.get_query = function() {
add_cond += ' AND t1.supplier = t3.name'; add_cond += ' AND t1.supplier = t3.name';
if(supp_type) add_cond += ' AND t1.supplier_type = "'+supp_type+'"'; if(supp_type) add_cond += ' AND t1.supplier_type = "'+supp_type+'"';
break; break;
case 'Project' : pro = this.get_filter('Profile', 'Project').get_value();
if (inList(['Purchase Order', 'Purchase Receipt', 'Payable Voucher'], trans)) {
col = 'DISTINCT t2.project_name';
if(pro) add_cond += ' AND t2.project_name = "'+pro+'"';
} else {
col = 'DISTINCT t1.project_name';
if(pro) add_cond += ' AND t1.project_name = "'+pro+'"';
}
break;
case 'Item Group' : ig = this.get_filter('Profile', 'Item Group').get_value(); case 'Item Group' : ig = this.get_filter('Profile', 'Item Group').get_value();
if(ig) sp_cond += ' AND parent.name = "'+ig+'"'; if(ig) sp_cond += ' AND parent.name = "'+ig+'"';
break; break;
@@ -108,10 +118,11 @@ report.get_query = function() {
case 'Territory' : ter = this.get_filter('Profile', 'Territory').get_value(); case 'Territory' : ter = this.get_filter('Profile', 'Territory').get_value();
if(ter) sp_cond += ' AND parent.name = "'+ter+'"'; if(ter) sp_cond += ' AND parent.name = "'+ter+'"';
break; break;
} }
if(based_on == 'Item' || based_on == 'Customer' || based_on == 'Supplier' || based_on == 'Supplier Type') if(based_on == 'Item' || based_on == 'Customer' || based_on == 'Supplier' || based_on == 'Supplier Type' || based_on == 'Project')
var q ='SELECT '+col+' FROM `tab'+trans+'` t1, `tab'+trans_det+'` t2 '+add_tables+' WHERE t1.fiscal_year = "'+fiscal_year+'" and t1.company = "'+company+'" and t2.parent = t1.name '+add_cond; var q ='SELECT '+col+' FROM `tab'+trans+'` t1, `tab'+trans_det+'` t2 '+add_tables+' WHERE t1.fiscal_year = "'+fiscal_year+'" and t1.company = "'+company+'" and t2.parent = t1.name '+add_cond;
else else
var q = 'SELECT CONCAT(REPEAT(" ", COUNT(parent.name) - 1), node.name) AS "Name" FROM `tab'+based_on+'` node,`tab'+based_on+'` parent WHERE node.lft BETWEEN parent.lft and parent.rgt and node.docstatus !=2 '+sp_cond+' GROUP BY node.name ORDER BY node.lft'; var q = 'SELECT CONCAT(REPEAT(" ", COUNT(parent.name) - 1), node.name) AS "Name" FROM `tab'+based_on+'` node,`tab'+based_on+'` parent WHERE node.lft BETWEEN parent.lft and parent.rgt and node.docstatus !=2 '+sp_cond+' GROUP BY node.name ORDER BY node.lft';

View File

@@ -17,7 +17,7 @@ customer_group = filter_values.get('customer_group')
territory = filter_values.get('territory') territory = filter_values.get('territory')
supplier = filter_values.get('supplier') supplier = filter_values.get('supplier')
supplier_type = filter_values.get('supplier_type') supplier_type = filter_values.get('supplier_type')
project = filter_values.get('project')
# ********************************************* SET DEFAULTS ************************************************** # ********************************************* SET DEFAULTS **************************************************
@@ -41,41 +41,41 @@ col_names.append('Total (Amt)')
# ********************************************* VALIDATIONS *************************************************** # ********************************************* VALIDATIONS ***************************************************
if (based_on in ['Customer','Customer Group','Territory'] and group_by == 'Supplier') or (based_on in ['Supplier','Supplier Type'] and group_by == 'Customer'): if (based_on in ['Customer','Customer Group','Territory'] and group_by == 'Supplier') or (based_on in ['Supplier','Supplier Type'] and group_by == 'Customer'):
msgprint("Sorry! You cannot group Trend Analyzer based on %s by %s" % (based_on,group_by)) msgprint("Sorry! You cannot group Trend Analyzer based on %s by %s" % (based_on,group_by))
raise Exception raise Exception
if based_on == group_by: if based_on == group_by:
msgprint("Based On and Group By value cannot be same for Trend Analyzer") msgprint("Based On and Group By value cannot be same for Trend Analyzer")
raise Exception raise Exception
# ********************************************** ADD COLUMNS ********************************************** # ********************************************** ADD COLUMNS **********************************************
cols = [[based_on, 'Data', '300px', '']] cols = [[based_on, 'Data', '300px', '']]
cr = 1 cr = 1
if based_on == 'Item': if based_on == 'Item':
cols.append(['Item Name','Data','200px','']) cols.append(['Item Name','Data','200px',''])
cr = 2 cr = 2
elif based_on == 'Customer': elif based_on == 'Customer':
cols.append(['Territory','Link','150px','Territory']) cols.append(['Territory','Link','150px','Territory'])
cr = 2 cr = 2
elif based_on == 'Supplier': elif based_on == 'Supplier':
cols.append(['Supplier Type','Link','150px','Supplier Type']) cols.append(['Supplier Type','Link','150px','Supplier Type'])
cr = 2 cr = 2
if group_by: if group_by:
cr += 1 cr += 1
if group_by: if group_by:
cols.append([group_by,'Data','150px','']) cols.append([group_by,'Data','150px',''])
for c in col_names: for c in col_names:
cols.append([c,'Currency','150px','']) cols.append([c,'Currency','150px',''])
for c in cols: for c in cols:
colnames.append(c[0]) colnames.append(c[0])
coltypes.append(c[1]) coltypes.append(c[1])
colwidths.append(c[2]) colwidths.append(c[2])
coloptions.append(c[3]) coloptions.append(c[3])
col_idx[c[0]] = len(colnames)-1 col_idx[c[0]] = len(colnames)-1
# ******************************************* ADDITIONAL CONDITION ************************************************ # ******************************************* ADDITIONAL CONDITION ************************************************
@@ -86,75 +86,81 @@ if order_type: add_cond += ' AND t1.order_type = "%s"' % order_type
# Item # Item
if item or based_on == 'Item': if item or based_on == 'Item':
add_cond += ' AND t2.item_code = "%s"' % (based_on != 'Item' and item or '%(value)s') add_cond += ' AND t2.item_code = "%s"' % (based_on != 'Item' and item or '%(value)s')
# Item Group # Item Group
if item_group or based_on == 'Item Group': if item_group or based_on == 'Item Group':
add_tab += ' ,`tabItem` t3, `tabItem Group` t4 ' add_tab += ' ,`tabItem` t3, `tabItem Group` t4 '
add_cond += ' AND t3.name = t2.item_code AND t3.item_group = t4.name and (t4.name = "%s" or t4.name IN (SELECT t5.name FROM `tabItem Group` t5,`tabItem Group` t6 WHERE t5.lft BETWEEN t6.lft and t6.rgt and t5.docstatus !=2 and ifnull(t5.is_group,"No") = "No" and t6.name = "%s"))' % (based_on != 'Item Group' and item_group or '%(value)s', based_on != 'Item Group' and item_group or '%(value)s') add_cond += ' AND t3.name = t2.item_code AND t3.item_group = t4.name and (t4.name = "%s" or t4.name IN (SELECT t5.name FROM `tabItem Group` t5,`tabItem Group` t6 WHERE t5.lft BETWEEN t6.lft and t6.rgt and t5.docstatus !=2 and ifnull(t5.is_group,"No") = "No" and t6.name = "%s"))' % (based_on != 'Item Group' and item_group or '%(value)s', based_on != 'Item Group' and item_group or '%(value)s')
# Customer # Customer
if customer or based_on == 'Customer': if customer or based_on == 'Customer':
add_cond += ' AND t1.customer = "%s"' % (based_on != 'Customer' and customer or '%(value)s') add_cond += ' AND t1.customer = "%s"' % (based_on != 'Customer' and customer or '%(value)s')
# Customer Group # Customer Group
if customer_group or based_on == 'Customer Group': if customer_group or based_on == 'Customer Group':
add_tab += ' ,`tabCustomer` t7, `tabCustomer Group` t8 ' add_tab += ' ,`tabCustomer` t7, `tabCustomer Group` t8 '
add_cond += ' AND t7.name = t1.customer AND t7.customer_group = t8.name and (t8.name = "%s" or t8.name IN (SELECT t9.name FROM `tabCustomer Group` t9,`tabCustomer Group` t10 WHERE t9.lft BETWEEN t10.lft and t10.rgt and t9.docstatus !=2 and ifnull(t9.is_group,"No") = "No" and t10.name = "%s"))' % (based_on != 'Customer Group' and customer_group or '%(value)s', based_on != 'Customer Group' and customer_group or '%(value)s') add_cond += ' AND t7.name = t1.customer AND t7.customer_group = t8.name and (t8.name = "%s" or t8.name IN (SELECT t9.name FROM `tabCustomer Group` t9,`tabCustomer Group` t10 WHERE t9.lft BETWEEN t10.lft and t10.rgt and t9.docstatus !=2 and ifnull(t9.is_group,"No") = "No" and t10.name = "%s"))' % (based_on != 'Customer Group' and customer_group or '%(value)s', based_on != 'Customer Group' and customer_group or '%(value)s')
# Territory # Territory
if territory or based_on == 'Territory': if territory or based_on == 'Territory':
add_tab += ' ,`tabTerritory` t11 ' add_tab += ' ,`tabTerritory` t11 '
add_cond += ' AND t1.territory = t11.name AND t1.territory = t11.name and (t11.name = "%s" or t11.name IN (SELECT t12.name FROM `tabTerritory` t12,`tabTerritory` t13 WHERE t12.lft BETWEEN t13.lft and t13.rgt and t12.docstatus !=2 and ifnull(t12.is_group,"No") = "No" and t13.name = "%s"))' % (based_on != 'Territory' and territory or '%(value)s', based_on != 'Territory' and territory or '%(value)s') add_cond += ' AND t1.territory = t11.name AND t1.territory = t11.name and (t11.name = "%s" or t11.name IN (SELECT t12.name FROM `tabTerritory` t12,`tabTerritory` t13 WHERE t12.lft BETWEEN t13.lft and t13.rgt and t12.docstatus !=2 and ifnull(t12.is_group,"No") = "No" and t13.name = "%s"))' % (based_on != 'Territory' and territory or '%(value)s', based_on != 'Territory' and territory or '%(value)s')
# Supplier # Supplier
if supplier or based_on == 'Supplier': if supplier or based_on == 'Supplier':
add_cond += ' AND t1.supplier = "%s"' % (based_on != 'Supplier' and supplier or '%(value)s') add_cond += ' AND t1.supplier = "%s"' % (based_on != 'Supplier' and supplier or '%(value)s')
# Supplier Type # Supplier Type
if supplier_type or based_on == 'Supplier Type': if supplier_type or based_on == 'Supplier Type':
add_tab += ' ,`tabSupplier` t14, `tabSupplier Type` t15 ' add_tab += ' ,`tabSupplier` t14, `tabSupplier Type` t15 '
add_cond += ' AND t14.name = t1.supplier AND t14.supplier_type = t15.name and t15.name = "%s"' % (based_on != 'Supplier Type' and supplier_type or '%(value)s') add_cond += ' AND t14.name = t1.supplier AND t14.supplier_type = t15.name and t15.name = "%s"' % (based_on != 'Supplier Type' and supplier_type or '%(value)s')
# Project
if project or based_on == 'Project':
if trans in ['Purchase Order', 'Purchase Receipt', 'Payable Voucher']:
add_cond += ' AND t2.project_name = "%s"' % (based_on != 'Project' and project or '%(value)s')
else:
add_cond += ' AND t1.project_name = "%s"' % (based_on != 'Project' and project or '%(value)s')
# Column to be seleted for group by condition # Column to be seleted for group by condition
# ============================================== # ==============================================
sel_col = '' sel_col = ''
if group_by == 'Item': if group_by == 'Item':
sel_col = 't2.item_code' sel_col = 't2.item_code'
elif group_by == 'Customer': elif group_by == 'Customer':
sel_col = 't1.customer' sel_col = 't1.customer'
elif group_by == 'Supplier': elif group_by == 'Supplier':
sel_col = 't1.supplier' sel_col = 't1.supplier'
# ********************************************** Result Set ************************************************ # ********************************************** Result Set ************************************************
for r in res: for r in res:
main_det = sql("SELECT %s FROM %s WHERE %s" % (query_val, add_tab, add_cond % {'value':cstr(r[col_idx[based_on]]).strip()})) main_det = sql("SELECT %s FROM %s WHERE %s" % (query_val, add_tab, add_cond % {'value':cstr(r[col_idx[based_on]]).strip()}))
if group_by: if group_by:
for col in range(cr,cr+1): # this would make all first row blank. just for look for col in range(cr,cr+1): # this would make all first row blank. just for look
r.append('') r.append('')
if main_det[0][len(colnames) - cr - 1]: if main_det[0][len(colnames) - cr - 1]:
for d in range(len(colnames) - cr): for d in range(len(colnames) - cr):
r.append(flt(main_det[0][d])) r.append(flt(main_det[0][d]))
out.append(r) out.append(r)
if group_by: if group_by:
flag = 1 flag = 1
# check for root nodes # check for root nodes
if based_on in ['Item Group','Customer Group','Territory']: if based_on in ['Item Group','Customer Group','Territory']:
is_grp = sql("select is_group from `tab%s` where name = '%s'" % (based_on, cstr(r[col_idx[based_on]]).strip())) is_grp = sql("select is_group from `tab%s` where name = '%s'" % (based_on, cstr(r[col_idx[based_on]]).strip()))
is_grp = is_grp and cstr(is_grp[0][0]) or '' is_grp = is_grp and cstr(is_grp[0][0]) or ''
if is_grp != 'No': if is_grp != 'No':
flag = 0 flag = 0
if flag == 1: if flag == 1:
det = [x[0] for x in sql("SELECT DISTINCT %s FROM %s where %s" % (sel_col, add_tab, add_cond % {'value':cstr(r[col_idx[based_on]]).strip()}))] det = [x[0] for x in sql("SELECT DISTINCT %s FROM %s where %s" % (sel_col, add_tab, add_cond % {'value':cstr(r[col_idx[based_on]]).strip()}))]
for des in range(len(det)): for des in range(len(det)):
t_row = ['' for i in range(len(colnames))] t_row = ['' for i in range(len(colnames))]
t_row[col_idx[group_by]] = cstr(det[des]) t_row[col_idx[group_by]] = cstr(det[des])
gr_det = sql("SELECT %s FROM %s WHERE %s = '%s' and %s" % (query_val, add_tab, sel_col, cstr(det[des]), add_cond % {'value':cstr(r[col_idx[based_on]]).strip()})) gr_det = sql("SELECT %s FROM %s WHERE %s = '%s' and %s" % (query_val, add_tab, sel_col, cstr(det[des]), add_cond % {'value':cstr(r[col_idx[based_on]]).strip()}))
for d in range(len(col_names)): for d in range(len(col_names)):
t_row[col_idx[col_names[d]]] = flt(gr_det[0][d]) t_row[col_idx[col_names[d]]] = flt(gr_det[0][d])
out.append(t_row) out.append(t_row)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -5,16 +5,17 @@
{ {
'creation': '2010-08-08 17:09:04', 'creation': '2010-08-08 17:09:04',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-05-04 14:53:17', 'modified': '2011-10-12 13:09:38',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
# These values are common for all DocType # These values are common for all DocType
{ {
'_last_update': '1304500997', '_last_update': '1318404775',
'allow_print': 0, 'allow_print': 0,
'colour': 'White:FFF', 'colour': 'White:FFF',
'default_print_format': 'Standard',
'doctype': 'DocType', 'doctype': 'DocType',
'module': 'Buying', 'module': 'Buying',
'name': '__common__', 'name': '__common__',
@@ -24,7 +25,7 @@
'server_code_error': ' ', 'server_code_error': ' ',
'show_in_menu': 0, 'show_in_menu': 0,
'subject': '%(per_ordered)s% ordered', 'subject': '%(per_ordered)s% ordered',
'version': 186 'version': 188
}, },
# These values are common for all DocField # These values are common for all DocField
@@ -52,13 +53,24 @@
'name': 'Indent' 'name': 'Indent'
}, },
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': 'DocPerm',
'permlevel': 0,
'role': 'Production Manager',
'submit': 1,
'write': 1
},
# DocPerm # DocPerm
{ {
'amend': 0, 'amend': 0,
'cancel': 0, 'cancel': 0,
'create': 0, 'create': 0,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 1,
'permlevel': 1, 'permlevel': 1,
'role': 'Purchase Manager', 'role': 'Purchase Manager',
'submit': 0, 'submit': 0,
@@ -71,7 +83,6 @@
'cancel': 1, 'cancel': 1,
'create': 1, 'create': 1,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 2,
'permlevel': 0, 'permlevel': 0,
'role': 'Purchase Manager', 'role': 'Purchase Manager',
'submit': 1, 'submit': 1,
@@ -84,7 +95,6 @@
'cancel': 0, 'cancel': 0,
'create': 0, 'create': 0,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 3,
'permlevel': 1, 'permlevel': 1,
'role': 'Material Manager', 'role': 'Material Manager',
'submit': 0, 'submit': 0,
@@ -97,7 +107,6 @@
'cancel': 1, 'cancel': 1,
'create': 1, 'create': 1,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 4,
'permlevel': 0, 'permlevel': 0,
'role': 'Material Manager', 'role': 'Material Manager',
'submit': 1, 'submit': 1,
@@ -110,7 +119,6 @@
'cancel': 0, 'cancel': 0,
'create': 0, 'create': 0,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 5,
'permlevel': 1, 'permlevel': 1,
'role': 'Material User', 'role': 'Material User',
'submit': 0, 'submit': 0,
@@ -123,7 +131,6 @@
'cancel': 1, 'cancel': 1,
'create': 1, 'create': 1,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 6,
'permlevel': 0, 'permlevel': 0,
'role': 'Material User', 'role': 'Material User',
'submit': 1, 'submit': 1,
@@ -136,7 +143,6 @@
'cancel': 1, 'cancel': 1,
'create': 1, 'create': 1,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 7,
'permlevel': 0, 'permlevel': 0,
'role': 'Purchase User', 'role': 'Purchase User',
'submit': 1, 'submit': 1,
@@ -145,10 +151,14 @@
# DocPerm # DocPerm
{ {
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 8,
'permlevel': 1, 'permlevel': 1,
'role': 'Purchase User' 'role': 'Purchase User',
'submit': 0,
'write': 0
}, },
# DocField # DocField
@@ -158,7 +168,6 @@
'description': 'Enter items and their details for which you want your purchase department to raise a purchase order.', 'description': 'Enter items and their details for which you want your purchase department to raise a purchase order.',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'idx': 1,
'label': 'Basic Info', 'label': 'Basic Info',
'oldfieldtype': 'Section Break', 'oldfieldtype': 'Section Break',
'permlevel': 0, 'permlevel': 0,
@@ -169,7 +178,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Column Break', 'fieldtype': 'Column Break',
'idx': 2,
'oldfieldtype': 'Column Break', 'oldfieldtype': 'Column Break',
'permlevel': 0, 'permlevel': 0,
'print_hide': 0, 'print_hide': 0,
@@ -183,7 +191,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'naming_series', 'fieldname': 'naming_series',
'fieldtype': 'Select', 'fieldtype': 'Select',
'idx': 3,
'label': 'Series', 'label': 'Series',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'naming_series', 'oldfieldname': 'naming_series',
@@ -199,7 +206,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'status', 'fieldname': 'status',
'fieldtype': 'Select', 'fieldtype': 'Select',
'idx': 4,
'in_filter': 1, 'in_filter': 1,
'label': 'Status', 'label': 'Status',
'no_copy': 1, 'no_copy': 1,
@@ -216,7 +222,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Column Break', 'fieldtype': 'Column Break',
'idx': 5,
'oldfieldtype': 'Column Break', 'oldfieldtype': 'Column Break',
'permlevel': 0, 'permlevel': 0,
'width': '50%' 'width': '50%'
@@ -229,7 +234,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'transaction_date', 'fieldname': 'transaction_date',
'fieldtype': 'Date', 'fieldtype': 'Date',
'idx': 6,
'in_filter': 1, 'in_filter': 1,
'label': 'Indent Date', 'label': 'Indent Date',
'no_copy': 1, 'no_copy': 1,
@@ -249,7 +253,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'per_ordered', 'fieldname': 'per_ordered',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 7,
'label': '% Ordered', 'label': '% Ordered',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'per_ordered', 'oldfieldname': 'per_ordered',
@@ -262,7 +265,6 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'idx': 8,
'label': 'Items', 'label': 'Items',
'oldfieldtype': 'Section Break', 'oldfieldtype': 'Section Break',
'permlevel': 0 'permlevel': 0
@@ -275,14 +277,12 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'sales_order_no', 'fieldname': 'sales_order_no',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 9,
'label': 'Sales Order No', 'label': 'Sales Order No',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'sales_order_no', 'oldfieldname': 'sales_order_no',
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
'options': 'Sales Order', 'options': 'Sales Order',
'permlevel': 0, 'permlevel': 0,
'search_index': 0,
'width': '100px' 'width': '100px'
}, },
@@ -290,7 +290,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Button', 'fieldtype': 'Button',
'idx': 10,
'label': 'Pull Sales Order Details', 'label': 'Pull Sales Order Details',
'options': 'pull_so_details', 'options': 'pull_so_details',
'permlevel': 0 'permlevel': 0
@@ -298,10 +297,11 @@
# DocField # DocField
{ {
'allow_on_submit': 1,
'colour': 'White:FFF',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'indent_details', 'fieldname': 'indent_details',
'fieldtype': 'Table', 'fieldtype': 'Table',
'idx': 11,
'label': 'Indent Details', 'label': 'Indent Details',
'no_copy': 0, 'no_copy': 0,
'oldfieldname': 'indent_details', 'oldfieldname': 'indent_details',
@@ -317,7 +317,6 @@
'description': 'Filing in Additional Information about the Indent will help you analyze your data better.', 'description': 'Filing in Additional Information about the Indent will help you analyze your data better.',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'idx': 12,
'label': 'More Info', 'label': 'More Info',
'oldfieldtype': 'Section Break', 'oldfieldtype': 'Section Break',
'permlevel': 0 'permlevel': 0
@@ -330,7 +329,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'company', 'fieldname': 'company',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 13,
'in_filter': 1, 'in_filter': 1,
'label': 'Company', 'label': 'Company',
'oldfieldname': 'company', 'oldfieldname': 'company',
@@ -339,7 +337,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 0, 'search_index': 1,
'width': '150px' 'width': '150px'
}, },
@@ -349,7 +347,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'fiscal_year', 'fieldname': 'fiscal_year',
'fieldtype': 'Select', 'fieldtype': 'Select',
'idx': 14,
'in_filter': 1, 'in_filter': 1,
'label': 'Fiscal Year', 'label': 'Fiscal Year',
'oldfieldname': 'fiscal_year', 'oldfieldname': 'fiscal_year',
@@ -358,7 +355,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 0, 'search_index': 1,
'width': '150px' 'width': '150px'
}, },
@@ -369,7 +366,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'requested_by', 'fieldname': 'requested_by',
'fieldtype': 'Data', 'fieldtype': 'Data',
'idx': 15,
'label': 'Requested By', 'label': 'Requested By',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'requested_by', 'oldfieldname': 'requested_by',
@@ -382,7 +378,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Column Break', 'fieldtype': 'Column Break',
'idx': 16,
'oldfieldtype': 'Column Break', 'oldfieldtype': 'Column Break',
'permlevel': 0, 'permlevel': 0,
'width': '50%' 'width': '50%'
@@ -393,7 +388,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'remark', 'fieldname': 'remark',
'fieldtype': 'Small Text', 'fieldtype': 'Small Text',
'idx': 17,
'label': 'Remarks', 'label': 'Remarks',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'remark', 'oldfieldname': 'remark',
@@ -410,7 +404,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'cancel_reason', 'fieldname': 'cancel_reason',
'fieldtype': 'Data', 'fieldtype': 'Data',
'idx': 18,
'label': 'Cancel Reason', 'label': 'Cancel Reason',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'cancel_reason', 'oldfieldname': 'cancel_reason',
@@ -424,7 +417,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'amended_from', 'fieldname': 'amended_from',
'fieldtype': 'Data', 'fieldtype': 'Data',
'idx': 19,
'label': 'Amended From', 'label': 'Amended From',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'amended_from', 'oldfieldname': 'amended_from',
@@ -440,7 +432,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'amendment_date', 'fieldname': 'amendment_date',
'fieldtype': 'Date', 'fieldtype': 'Date',
'idx': 20,
'label': 'Amendment Date', 'label': 'Amendment Date',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'amendment_date', 'oldfieldname': 'amendment_date',
@@ -455,7 +446,6 @@
'description': 'Add Terms and Conditions for the Indent. You can also prepare a master Term Sheet and use the Template', 'description': 'Add Terms and Conditions for the Indent. You can also prepare a master Term Sheet and use the Template',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'idx': 21,
'label': 'Terms', 'label': 'Terms',
'oldfieldtype': 'Section Break', 'oldfieldtype': 'Section Break',
'permlevel': 0 'permlevel': 0
@@ -467,7 +457,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'letter_head', 'fieldname': 'letter_head',
'fieldtype': 'Select', 'fieldtype': 'Select',
'idx': 22,
'label': 'Letter Head', 'label': 'Letter Head',
'oldfieldname': 'letter_head', 'oldfieldname': 'letter_head',
'oldfieldtype': 'Select', 'oldfieldtype': 'Select',
@@ -481,22 +470,19 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'tc_name', 'fieldname': 'tc_name',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 23,
'label': 'Select Terms', 'label': 'Select Terms',
'oldfieldname': 'tc_name', 'oldfieldname': 'tc_name',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Term', 'options': 'Term',
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'report_hide': 1, 'report_hide': 1
'search_index': 0
}, },
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Button', 'fieldtype': 'Button',
'idx': 24,
'label': 'Get Terms', 'label': 'Get Terms',
'oldfieldtype': 'Button', 'oldfieldtype': 'Button',
'options': 'get_tc_details', 'options': 'get_tc_details',
@@ -507,7 +493,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'HTML', 'fieldtype': 'HTML',
'idx': 25,
'label': 'Terms HTML', 'label': 'Terms HTML',
'oldfieldtype': 'HTML', 'oldfieldtype': 'HTML',
'options': 'You can add Terms and Notes that will be printed in the Transaction', 'options': 'You can add Terms and Notes that will be printed in the Transaction',
@@ -520,7 +505,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'terms', 'fieldname': 'terms',
'fieldtype': 'Text Editor', 'fieldtype': 'Text Editor',
'idx': 26,
'label': 'Terms1', 'label': 'Terms1',
'oldfieldname': 'terms', 'oldfieldname': 'terms',
'oldfieldtype': 'Text Editor', 'oldfieldtype': 'Text Editor',
@@ -531,7 +515,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Column Break', 'fieldtype': 'Column Break',
'idx': 27,
'oldfieldtype': 'Column Break', 'oldfieldtype': 'Column Break',
'permlevel': 0, 'permlevel': 0,
'print_hide': 1 'print_hide': 1
@@ -543,7 +526,6 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Button', 'fieldtype': 'Button',
'idx': 28,
'label': 'Repair Indent', 'label': 'Repair Indent',
'oldfieldtype': 'Button', 'oldfieldtype': 'Button',
'options': 'repair_indent', 'options': 'repair_indent',

View File

@@ -5,7 +5,7 @@
{ {
'creation': '2010-08-08 17:09:04', 'creation': '2010-08-08 17:09:04',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-05-04 14:41:43', 'modified': '2011-10-12 13:02:13',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
@@ -14,6 +14,7 @@
{ {
'autoname': 'IDTD/.#####', 'autoname': 'IDTD/.#####',
'colour': 'White:FFF', 'colour': 'White:FFF',
'default_print_format': 'Standard',
'doctype': 'DocType', 'doctype': 'DocType',
'istable': 1, 'istable': 1,
'module': 'Buying', 'module': 'Buying',
@@ -21,7 +22,7 @@
'section_style': 'Tray', 'section_style': 'Tray',
'server_code_error': ' ', 'server_code_error': ' ',
'show_in_menu': 0, 'show_in_menu': 0,
'version': 29 'version': 34
}, },
# These values are common for all DocField # These values are common for all DocField
@@ -44,7 +45,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'schedule_date', 'fieldname': 'schedule_date',
'fieldtype': 'Date', 'fieldtype': 'Date',
'idx': 1,
'label': 'Required Date', 'label': 'Required Date',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'schedule_date', 'oldfieldname': 'schedule_date',
@@ -60,7 +60,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'item_code', 'fieldname': 'item_code',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 2,
'in_filter': 1, 'in_filter': 1,
'label': 'Item Code', 'label': 'Item Code',
'oldfieldname': 'item_code', 'oldfieldname': 'item_code',
@@ -78,14 +77,13 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'item_name', 'fieldname': 'item_name',
'fieldtype': 'Data', 'fieldtype': 'Data',
'idx': 3,
'in_filter': 1, 'in_filter': 1,
'label': 'Item Name', 'label': 'Item Name',
'oldfieldname': 'item_name', 'oldfieldname': 'item_name',
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
'permlevel': 0, 'permlevel': 0,
'reqd': 1, 'reqd': 1,
'search_index': 0, 'search_index': 1,
'width': '100px' 'width': '100px'
}, },
@@ -94,7 +92,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'description', 'fieldname': 'description',
'fieldtype': 'Text', 'fieldtype': 'Text',
'idx': 4,
'label': 'Description', 'label': 'Description',
'oldfieldname': 'description', 'oldfieldname': 'description',
'oldfieldtype': 'Text', 'oldfieldtype': 'Text',
@@ -108,7 +105,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'warehouse', 'fieldname': 'warehouse',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 5,
'label': 'Warehouse', 'label': 'Warehouse',
'oldfieldname': 'warehouse', 'oldfieldname': 'warehouse',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
@@ -125,14 +121,12 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'brand', 'fieldname': 'brand',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 6,
'label': 'Brand', 'label': 'Brand',
'oldfieldname': 'brand', 'oldfieldname': 'brand',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Brand', 'options': 'Brand',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 1,
'search_index': 0,
'width': '100px' 'width': '100px'
}, },
@@ -142,7 +136,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'item_group', 'fieldname': 'item_group',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 7,
'in_filter': 1, 'in_filter': 1,
'label': 'Item Group', 'label': 'Item Group',
'no_copy': 0, 'no_copy': 0,
@@ -152,7 +145,7 @@
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 1,
'reqd': 0, 'reqd': 0,
'search_index': 0 'search_index': 1
}, },
# DocField # DocField
@@ -162,7 +155,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'qty', 'fieldname': 'qty',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 8,
'label': 'Quantity', 'label': 'Quantity',
'no_copy': 0, 'no_copy': 0,
'oldfieldname': 'qty', 'oldfieldname': 'qty',
@@ -178,7 +170,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'lead_time_date', 'fieldname': 'lead_time_date',
'fieldtype': 'Date', 'fieldtype': 'Date',
'idx': 9,
'label': 'Lead Time Date', 'label': 'Lead Time Date',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'lead_time_date', 'oldfieldname': 'lead_time_date',
@@ -192,7 +183,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'uom', 'fieldname': 'uom',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 10,
'label': 'Stock UOM', 'label': 'Stock UOM',
'no_copy': 0, 'no_copy': 0,
'oldfieldname': 'uom', 'oldfieldname': 'uom',
@@ -200,7 +190,6 @@
'options': 'UOM', 'options': 'UOM',
'permlevel': 1, 'permlevel': 1,
'reqd': 1, 'reqd': 1,
'search_index': 0,
'width': '50px' 'width': '50px'
}, },
@@ -209,7 +198,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'min_order_qty', 'fieldname': 'min_order_qty',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 11,
'label': 'Min Order Qty', 'label': 'Min Order Qty',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'min_order_qty', 'oldfieldname': 'min_order_qty',
@@ -225,7 +213,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'projected_qty', 'fieldname': 'projected_qty',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 12,
'label': 'Projected Qty', 'label': 'Projected Qty',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'projected_qty', 'oldfieldname': 'projected_qty',
@@ -240,7 +227,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'ordered_qty', 'fieldname': 'ordered_qty',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 13,
'label': 'Ordered Qty', 'label': 'Ordered Qty',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'ordered_qty', 'oldfieldname': 'ordered_qty',
@@ -253,9 +239,9 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'sales_order_no', 'fieldname': 'sales_order_no',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 14,
'label': 'Sales Order No', 'label': 'Sales Order No',
'no_copy': 1, 'no_copy': 1,
'options': 'Sales Order',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1 'print_hide': 1
}, },
@@ -266,7 +252,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'page_break', 'fieldname': 'page_break',
'fieldtype': 'Check', 'fieldtype': 'Check',
'idx': 15,
'label': 'Page Break', 'label': 'Page Break',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'page_break', 'oldfieldname': 'page_break',

View File

@@ -5,8 +5,8 @@
{ {
'creation': '2010-08-08 17:09:12', 'creation': '2010-08-08 17:09:12',
'docstatus': 0, 'docstatus': 0,
'modified': '2010-11-12 16:53:30', 'modified': '2011-10-20 18:39:20',
'modified_by': 'sneha@webnotestech.com', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
@@ -14,6 +14,7 @@
{ {
'autoname': 'POD/.#####', 'autoname': 'POD/.#####',
'colour': 'White:FFF', 'colour': 'White:FFF',
'default_print_format': 'Standard',
'doctype': 'DocType', 'doctype': 'DocType',
'istable': 1, 'istable': 1,
'module': 'Buying', 'module': 'Buying',
@@ -21,7 +22,7 @@
'section_style': 'Tray', 'section_style': 'Tray',
'server_code_error': ' ', 'server_code_error': ' ',
'show_in_menu': 0, 'show_in_menu': 0,
'version': 46 'version': 54
}, },
# These values are common for all DocField # These values are common for all DocField
@@ -45,7 +46,6 @@
'fieldname': 'schedule_date', 'fieldname': 'schedule_date',
'fieldtype': 'Date', 'fieldtype': 'Date',
'hidden': 0, 'hidden': 0,
'idx': 1,
'in_filter': 1, 'in_filter': 1,
'label': 'Reqd By Date', 'label': 'Reqd By Date',
'no_copy': 1, 'no_copy': 1,
@@ -54,7 +54,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 0 'search_index': 1
}, },
# DocField # DocField
@@ -62,7 +62,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'item_code', 'fieldname': 'item_code',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 2,
'in_filter': 1, 'in_filter': 1,
'label': 'Item Code', 'label': 'Item Code',
'oldfieldname': 'item_code', 'oldfieldname': 'item_code',
@@ -81,7 +80,6 @@
'fieldname': 'item_name', 'fieldname': 'item_name',
'fieldtype': 'Data', 'fieldtype': 'Data',
'hidden': 0, 'hidden': 0,
'idx': 3,
'in_filter': 1, 'in_filter': 1,
'label': 'Item Name', 'label': 'Item Name',
'oldfieldname': 'item_name', 'oldfieldname': 'item_name',
@@ -89,7 +87,7 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 0 'search_index': 1
}, },
# DocField # DocField
@@ -97,7 +95,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'description', 'fieldname': 'description',
'fieldtype': 'Small Text', 'fieldtype': 'Small Text',
'idx': 4,
'label': 'Description', 'label': 'Description',
'oldfieldname': 'description', 'oldfieldname': 'description',
'oldfieldtype': 'Small Text', 'oldfieldtype': 'Small Text',
@@ -106,13 +103,43 @@
'width': '300px' 'width': '300px'
}, },
# DocField
{
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'qty',
'fieldtype': 'Currency',
'label': 'Quantity',
'oldfieldname': 'qty',
'oldfieldtype': 'Currency',
'permlevel': 0,
'reqd': 1,
'trigger': 'Client',
'width': '60px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'uom',
'fieldtype': 'Link',
'label': 'UOM',
'oldfieldname': 'uom',
'oldfieldtype': 'Link',
'options': 'UOM',
'permlevel': 0,
'print_hide': 0,
'reqd': 1,
'trigger': 'Client',
'width': '100px'
},
# DocField # DocField
{ {
'default': '0.00', 'default': '0.00',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'purchase_rate', 'fieldname': 'purchase_rate',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 7,
'label': 'Rate (Default Curr.)', 'label': 'Rate (Default Curr.)',
'oldfieldname': 'purchase_rate', 'oldfieldname': 'purchase_rate',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@@ -129,7 +156,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'amount', 'fieldname': 'amount',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 8,
'label': 'Amount (Default Curr.)', 'label': 'Amount (Default Curr.)',
'oldfieldname': 'amount', 'oldfieldname': 'amount',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@@ -138,29 +164,12 @@
'reqd': 1 'reqd': 1
}, },
# DocField
{
'default': '0.00',
'doctype': 'DocField',
'fieldname': 'qty',
'fieldtype': 'Currency',
'idx': 9,
'label': 'Quantity',
'oldfieldname': 'qty',
'oldfieldtype': 'Currency',
'permlevel': 0,
'reqd': 1,
'trigger': 'Client',
'width': '60px'
},
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'import_rate', 'fieldname': 'import_rate',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'hidden': 0, 'hidden': 0,
'idx': 9,
'label': 'Rate', 'label': 'Rate',
'oldfieldname': 'import_rate', 'oldfieldname': 'import_rate',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@@ -169,30 +178,11 @@
'trigger': 'Client' 'trigger': 'Client'
}, },
# DocField
{
'doctype': 'DocField',
'fieldname': 'uom',
'fieldtype': 'Link',
'idx': 10,
'label': 'UOM',
'oldfieldname': 'uom',
'oldfieldtype': 'Link',
'options': 'UOM',
'permlevel': 0,
'print_hide': 0,
'reqd': 1,
'search_index': 0,
'trigger': 'Client',
'width': '100px'
},
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'import_amount', 'fieldname': 'import_amount',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 10,
'label': 'Amount', 'label': 'Amount',
'oldfieldname': 'import_amount', 'oldfieldname': 'import_amount',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@@ -205,7 +195,6 @@
'fieldname': 'warehouse', 'fieldname': 'warehouse',
'fieldtype': 'Link', 'fieldtype': 'Link',
'hidden': 0, 'hidden': 0,
'idx': 11,
'label': 'Warehouse', 'label': 'Warehouse',
'oldfieldname': 'warehouse', 'oldfieldname': 'warehouse',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
@@ -223,7 +212,6 @@
'fieldname': 'conversion_factor', 'fieldname': 'conversion_factor',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'hidden': 0, 'hidden': 0,
'idx': 11,
'label': 'Conversion Factor', 'label': 'Conversion Factor',
'oldfieldname': 'conversion_factor', 'oldfieldname': 'conversion_factor',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@@ -238,16 +226,17 @@
{ {
'colour': 'White:FFF', 'colour': 'White:FFF',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'prevdoc_doctype', 'fieldname': 'stock_qty',
'fieldtype': 'Data', 'fieldtype': 'Currency',
'hidden': 1, 'hidden': 0,
'idx': 12, 'label': 'Stock Qty',
'label': 'Prevdoc DocType', 'no_copy': 1,
'no_copy': 0, 'oldfieldname': 'stock_qty',
'oldfieldname': 'prevdoc_doctype', 'oldfieldtype': 'Currency',
'oldfieldtype': 'Data', 'permlevel': 0,
'permlevel': 1, 'print_hide': 1,
'print_hide': 1 'trigger': 'Client',
'width': '100px'
}, },
# DocField # DocField
@@ -256,7 +245,6 @@
'fieldname': 'stock_uom', 'fieldname': 'stock_uom',
'fieldtype': 'Data', 'fieldtype': 'Data',
'hidden': 0, 'hidden': 0,
'idx': 12,
'label': 'Stock UOM', 'label': 'Stock UOM',
'oldfieldname': 'stock_uom', 'oldfieldname': 'stock_uom',
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
@@ -266,6 +254,34 @@
'width': '100px' 'width': '100px'
}, },
# DocField
{
'doctype': 'DocField',
'fieldname': 'project_name',
'fieldtype': 'Link',
'in_filter': 1,
'label': 'Project Name',
'options': 'Project',
'permlevel': 0,
'print_hide': 1,
'report_hide': 0
},
# DocField
{
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldname': 'prevdoc_doctype',
'fieldtype': 'Data',
'hidden': 1,
'label': 'Prevdoc DocType',
'no_copy': 0,
'oldfieldname': 'prevdoc_doctype',
'oldfieldtype': 'Data',
'permlevel': 1,
'print_hide': 1
},
# DocField # DocField
{ {
'colour': 'White:FFF', 'colour': 'White:FFF',
@@ -273,7 +289,6 @@
'fieldname': 'prevdoc_docname', 'fieldname': 'prevdoc_docname',
'fieldtype': 'Link', 'fieldtype': 'Link',
'hidden': 0, 'hidden': 0,
'idx': 13,
'in_filter': 1, 'in_filter': 1,
'label': 'Indent No', 'label': 'Indent No',
'no_copy': 0, 'no_copy': 0,
@@ -292,7 +307,6 @@
'fieldname': 'prevdoc_date', 'fieldname': 'prevdoc_date',
'fieldtype': 'Date', 'fieldtype': 'Date',
'hidden': 0, 'hidden': 0,
'idx': 14,
'in_filter': 1, 'in_filter': 1,
'label': 'Indent Date', 'label': 'Indent Date',
'oldfieldname': 'prevdoc_date', 'oldfieldname': 'prevdoc_date',
@@ -309,7 +323,6 @@
'fieldname': 'prevdoc_detail_docname', 'fieldname': 'prevdoc_detail_docname',
'fieldtype': 'Data', 'fieldtype': 'Data',
'hidden': 1, 'hidden': 1,
'idx': 15,
'in_filter': 1, 'in_filter': 1,
'label': 'Indent Detail No', 'label': 'Indent Detail No',
'no_copy': 0, 'no_copy': 0,
@@ -326,14 +339,12 @@
'fieldname': 'brand', 'fieldname': 'brand',
'fieldtype': 'Link', 'fieldtype': 'Link',
'hidden': 0, 'hidden': 0,
'idx': 16,
'label': 'Brand', 'label': 'Brand',
'oldfieldname': 'brand', 'oldfieldname': 'brand',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Brand', 'options': 'Brand',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 1
'search_index': 0
}, },
# DocField # DocField
@@ -342,7 +353,6 @@
'fieldname': 'item_group', 'fieldname': 'item_group',
'fieldtype': 'Link', 'fieldtype': 'Link',
'hidden': 0, 'hidden': 0,
'idx': 17,
'in_filter': 1, 'in_filter': 1,
'label': 'Item Group', 'label': 'Item Group',
'oldfieldname': 'item_group', 'oldfieldname': 'item_group',
@@ -350,24 +360,7 @@
'options': 'Item Group', 'options': 'Item Group',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 1,
'search_index': 0 'search_index': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'stock_qty',
'fieldtype': 'Currency',
'hidden': 0,
'idx': 20,
'label': 'Stock Qty',
'no_copy': 1,
'oldfieldname': 'stock_qty',
'oldfieldtype': 'Currency',
'permlevel': 0,
'print_hide': 1,
'trigger': 'Client',
'width': '100px'
}, },
# DocField # DocField
@@ -376,7 +369,6 @@
'fieldname': 'received_qty', 'fieldname': 'received_qty',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'hidden': 0, 'hidden': 0,
'idx': 21,
'label': 'Received Qty', 'label': 'Received Qty',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'received_qty', 'oldfieldname': 'received_qty',
@@ -392,7 +384,6 @@
'fieldname': 'billed_qty', 'fieldname': 'billed_qty',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'hidden': 0, 'hidden': 0,
'idx': 22,
'label': 'Billed Quantity', 'label': 'Billed Quantity',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'billed_qty', 'oldfieldname': 'billed_qty',
@@ -409,7 +400,6 @@
'fieldname': 'item_tax_rate', 'fieldname': 'item_tax_rate',
'fieldtype': 'Small Text', 'fieldtype': 'Small Text',
'hidden': 1, 'hidden': 1,
'idx': 23,
'label': 'Item Tax Rate', 'label': 'Item Tax Rate',
'oldfieldname': 'item_tax_rate', 'oldfieldname': 'item_tax_rate',
'oldfieldtype': 'Small Text', 'oldfieldtype': 'Small Text',
@@ -420,12 +410,11 @@
# DocField # DocField
{ {
'allow_on_submit': 1, 'allow_on_submit': 0,
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'page_break', 'fieldname': 'page_break',
'fieldtype': 'Check', 'fieldtype': 'Check',
'hidden': 0, 'hidden': 0,
'idx': 24,
'label': 'Page Break', 'label': 'Page Break',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'page_break', 'oldfieldname': 'page_break',

View File

@@ -111,11 +111,10 @@ cur_frm.cscript.transaction_date = function(doc,cdt,cdn){
// ---------------------- Get project name -------------------------- // ---------------------- Get project name --------------------------
cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) { cur_frm.fields_dict['po_details'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) {
return 'SELECT `tabProject`.name FROM `tabProject` WHERE `tabProject`.status = "Open" AND `tabProject`.name LIKE "%s" ORDER BY `tabProject`.name ASC LIMIT 50'; return 'SELECT `tabProject`.name FROM `tabProject` WHERE `tabProject`.status = "Open" AND `tabProject`.name LIKE "%s" ORDER BY `tabProject`.name ASC LIMIT 50';
} }
//==================== Indent No Get Query ======================================================= //==================== Indent No Get Query =======================================================
//===== Only those Indents status != 'Completed' and docstatus = 1 i.e. submitted================= //===== Only those Indents status != 'Completed' and docstatus = 1 i.e. submitted=================
cur_frm.fields_dict['indent_no'].get_query = function(doc) { cur_frm.fields_dict['indent_no'].get_query = function(doc) {

View File

@@ -31,6 +31,8 @@ class DocType:
def get_modules(self): def get_modules(self):
rl = webnotes.user.get_roles() rl = webnotes.user.get_roles()
ml = sql("select distinct t1.name, t1.module_icon, t1.module_label, t1.module_desc, t1.module_page from `tabModule Def` t1, `tabModule Def Role` t2 where t2.role in ('%s') and t1.disabled !='Yes' and ifnull(t1.is_hidden, 'No') != 'Yes' and t1.name = t2.parent order by t1.module_seq asc" % "','".join(rl), as_dict=1) ml = sql("select distinct t1.name, t1.module_icon, t1.module_label, t1.module_desc, t1.module_page from `tabModule Def` t1, `tabModule Def Role` t2 where t2.role in ('%s') and t1.disabled !='Yes' and ifnull(t1.is_hidden, 'No') != 'Yes' and t1.name = t2.parent order by t1.module_seq asc" % "','".join(rl), as_dict=1)
webnotes.response['login_url'] = session['data'].get('login_from', '')
return ml return ml
def get_module_details(self,m): def get_module_details(self,m):
@@ -48,8 +50,6 @@ class DocType:
AND t2.role IN ("%s") AND t2.role IN ("%s")
AND ifnull(standard,"No")="No"''' % (m, '", "'.join(webnotes.user.get_roles())), as_dict=1) AND ifnull(standard,"No")="No"''' % (m, '", "'.join(webnotes.user.get_roles())), as_dict=1)
ret['login_url'] = session['data'].get('login_from', '')
return ret return ret
# ---------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------

View File

@@ -242,7 +242,7 @@ MemberItem = function(parent, det, mlist) {
// working img // working img
var div = $a($td(this.tab, 0, 1), 'div'); var div = $a($td(this.tab, 0, 1), 'div');
this.working_img = $a(div,'img','',{display:'none'}); this.working_img = $a(div,'img','',{display:'none'});
this.working_img.src = 'images/ui/button-load.gif'; this.working_img.src = 'lib/images/ui/button-load.gif';
this.refresh_name_link(); this.refresh_name_link();
@@ -731,7 +731,7 @@ RoleObj = function(profile_id){
this.make_role_body(profile_id); this.make_role_body(profile_id);
this.make_help_body(); this.make_help_body();
this.body.innerHTML = '<span style="color:#888">Loading...</span> <img src="images/ui/button-load.gif">' this.body.innerHTML = '<span style="color:#888">Loading...</span> <img src="lib/images/ui/button-load.gif">'
var me=this; var me=this;
d.onshow = function() { d.onshow = function() {
@@ -829,7 +829,7 @@ RoleObj.prototype.make_label = function(tbl, ridx, cidx, role){
var t = make_table($td(tbl, ridx, cidx),1,2,null,['16px', null],{marginRight:'5px'}); var t = make_table($td(tbl, ridx, cidx),1,2,null,['16px', null],{marginRight:'5px'});
var ic = $a($td(t,0,0), 'img','',{cursor:'pointer', marginRight:'5px'}); var ic = $a($td(t,0,0), 'img','',{cursor:'pointer', marginRight:'5px'});
ic.src= 'images/icons/help.gif'; ic.src= 'lib/images/icons/help.gif';
ic.role = role; ic.role = role;
ic.onclick = function(){ ic.onclick = function(){
@@ -942,8 +942,8 @@ RoleObj.prototype.set_permissions = function(perm, role){
for(var i=0; i<(head_lst.length-1);i++){ for(var i=0; i<(head_lst.length-1);i++){
$td(perm_tbl,0,i).innerHTML= "<b>"+head_lst[i]+"</b>"; $td(perm_tbl,0,i).innerHTML= "<b>"+head_lst[i]+"</b>";
} }
var accept_img1 = 'images/icons/accept.gif'; var accept_img1 = 'lib/images/icons/accept.gif';
var cancel_img1 = 'images/icons/cancel.gif'; var cancel_img1 = 'lib/images/icons/cancel.gif';
for(i=1; i<perm.length+1; i++){ for(i=1; i<perm.length+1; i++){
$td(perm_tbl,i,0).innerHTML= get_doctype_label(perm[i-1][0]); $td(perm_tbl,i,0).innerHTML= get_doctype_label(perm[i-1][0]);

View File

@@ -1,13 +1,20 @@
cur_frm.add_fetch('employee', 'company', 'company'); cur_frm.add_fetch('employee', 'company', 'company');
cur_frm.cscript.onload = function(doc,cdt,cdn){ cur_frm.cscript.onload = function(doc,cdt,cdn){
if(!doc.status) set_multiple(dt,dn,{status:'Draft'}); if(!doc.status)
if(doc.employee) cur_frm.cscript.employee(doc,cdt,cdn); set_multiple(cdt,cdn,{status:'Draft'});
if(doc.amended_from && doc.__islocal) cur_frm.cscript.refresh_appraisal_details(doc, cdt, cdn); if(doc.amended_from && doc.__islocal)
cur_frm.cscript.refresh_appraisal_details(doc, cdt, cdn);
}
cur_frm.cscript.onload_post_render = function(doc,cdt,cdn){
if(doc.employee)
cur_frm.cscript.employee(doc,cdt,cdn);
} }
cur_frm.cscript.refresh = function(doc,cdt,cdn){ cur_frm.cscript.refresh = function(doc,cdt,cdn){
if(user == doc.kra_approver && doc.status == 'Submitted') unhide_field(['Update', 'Declare Completed', 'Calculate Total Score']); if(user == doc.kra_approver && doc.status == 'Submitted')
unhide_field(['Update', 'Declare Completed', 'Calculate Total Score']);
else hide_field(['Update', 'Declare Completed', 'Calculate Total Score']); else hide_field(['Update', 'Declare Completed', 'Calculate Total Score']);
if(!doc.docstatus) unhide_field('Fetch Template'); if(!doc.docstatus) unhide_field('Fetch Template');

View File

@@ -17,108 +17,116 @@ import datetime
# ----------------------------------------------------------------------------------------- # -----------------------------------------------------------------------------------------
class DocType: class DocType:
def __init__(self, doc, doclist): def __init__(self, doc, doclist):
self.doc = doc self.doc = doc
self.doclist = doclist self.doclist = doclist
# ******************************************** client triggers *********************************************** # ******************************************** client triggers ***********************************************
# ------------------ # ------------------
# get leave balance # get leave balance
# ------------------ # ------------------
def get_leave_balance(self): def get_leave_balance(self):
leave_all = sql("select total_leaves_allocated from `tabLeave Allocation` where employee = '%s' and leave_type = '%s' and fiscal_year = '%s' and docstatus = 1" % (self.doc.employee, self.doc.leave_type, self.doc.fiscal_year)) leave_all = sql("select total_leaves_allocated from `tabLeave Allocation` where employee = '%s' and leave_type = '%s' and fiscal_year = '%s' and docstatus = 1" % (self.doc.employee, self.doc.leave_type, self.doc.fiscal_year))
leave_all = leave_all and flt(leave_all[0][0]) or 0 leave_all = leave_all and flt(leave_all[0][0]) or 0
leave_app = sql("select total_leave_days from `tabLeave Application` where employee = '%s' and leave_type = '%s' and fiscal_year = '%s' and docstatus = 1" % (self.doc.employee, self.doc.leave_type, self.doc.fiscal_year)) leave_app = sql("select total_leave_days from `tabLeave Application` where employee = '%s' and leave_type = '%s' and fiscal_year = '%s' and docstatus = 1" % (self.doc.employee, self.doc.leave_type, self.doc.fiscal_year))
leave_app = leave_app and flt(leave_app[0][0]) or 0 leave_app = leave_app and flt(leave_app[0][0]) or 0
ret = {'leave_balance':leave_all - leave_app} ret = {'leave_balance':leave_all - leave_app}
return ret return ret
# ************************************************ utilities ************************************************* # ************************************************ utilities *************************************************
# ------------------- # -------------------
# get total holidays def get_holidays(self):
# ------------------- """
def get_holidays(self): get total holidays
tot_hol = sql("select count(*) from `tabHoliday List Detail` h1, `tabHoliday List` h2, `tabEmployee` e1 where e1.name = '%s' and h1.parent = h2.name and e1.holiday_list = h2.name and h1.holiday_date between '%s' and '%s'"% (self.doc.employee, self.doc.from_date, self.doc.to_date)) """
if not tot_hol: tot_hol = sql("select count(*) from `tabHoliday List Detail` h1, `tabHoliday List` h2, `tabEmployee` e1 where e1.name = '%s' and h1.parent = h2.name and e1.holiday_list = h2.name and h1.holiday_date between '%s' and '%s'"% (self.doc.employee, self.doc.from_date, self.doc.to_date))
tot_hol = sql("select count(*) from `tabHoliday List Detail` h1, `tabHoliday List` h2 where h1.parent = h2.name and h1.holiday_date between '%s' and '%s' and ifnull(h2.is_default,0) = 1 and h2.fiscal_year = %s"% (self.doc.from_date, self.doc.to_date, self.doc.fiscal_year)) if not tot_hol:
return tot_hol and flt(tot_hol[0][0]) or 0 tot_hol = sql("select count(*) from `tabHoliday List Detail` h1, `tabHoliday List` h2 where h1.parent = h2.name and h1.holiday_date between '%s' and '%s' and ifnull(h2.is_default,0) = 1 and h2.fiscal_year = %s"% (self.doc.from_date, self.doc.to_date, self.doc.fiscal_year))
return tot_hol and flt(tot_hol[0][0]) or 0
# --------------------- # ---------------------
# get total leave days # get total leave days
# --------------------- # ---------------------
def get_total_leave_days(self): def get_total_leave_days(self):
tot_days = date_diff(self.doc.to_date, self.doc.from_date) + 1 """
holidays = self.get_holidays() Calculates total leave days based on input and holidays
ret = {'total_leave_days':flt(tot_days)-flt(holidays)} """
return ret ret = {'total_leave_days' : 0.5}
if not self.doc.half_day:
tot_days = date_diff(self.doc.to_date, self.doc.from_date) + 1
holidays = self.get_holidays()
ret = {
'total_leave_days' : flt(tot_days)-flt(holidays)
}
return ret
# ************************************************ validate ************************************************* # ************************************************ validate *************************************************
# ----------------- # -----------------
# validate to date # validate to date
# ----------------- # -----------------
def validate_to_date(self): def validate_to_date(self):
if (getdate(self.doc.to_date) < getdate(self.doc.from_date)): if self.doc.from_date and self.doc.to_date and (getdate(self.doc.to_date) < getdate(self.doc.from_date)):
msgprint("To date cannot be before from date") msgprint("To date cannot be before from date")
raise Exception raise Exception
# -------------------------------- # --------------------------------
# check whether leave type is lwp # check whether leave type is lwp
# -------------------------------- # --------------------------------
def is_lwp(self): def is_lwp(self):
lwp = sql("select is_lwp from `tabLeave Type` where name = %s", self.doc.leave_type) lwp = sql("select is_lwp from `tabLeave Type` where name = %s", self.doc.leave_type)
return lwp and cint(lwp[0][0]) or 0 return lwp and cint(lwp[0][0]) or 0
# ------------------------ # ------------------------
# validate balance leaves # validate balance leaves
# ------------------------ # ------------------------
def validate_balance_leaves(self): def validate_balance_leaves(self):
if not self.is_lwp(): if self.doc.from_date and self.doc.to_date and not self.is_lwp():
bal = self.get_leave_balance() bal = self.get_leave_balance()
tot_leaves = self.get_total_leave_days() tot_leaves = self.get_total_leave_days()
bal, tot_leaves = bal, tot_leaves bal, tot_leaves = bal, tot_leaves
set(self.doc,'leave_balance',flt(bal['leave_balance'])) set(self.doc,'leave_balance',flt(bal['leave_balance']))
set(self.doc,'total_leave_days',flt(tot_leaves['total_leave_days'])) set(self.doc,'total_leave_days',flt(tot_leaves['total_leave_days']))
if flt(bal['leave_balance']) < flt(tot_leaves['total_leave_days']): if flt(bal['leave_balance']) < flt(tot_leaves['total_leave_days']):
msgprint("Employee : %s cannot apply for %s of more than %s days" % (self.doc.employee, self.doc.leave_type, flt(bal['leave_balance']))) msgprint("Employee : %s cannot apply for %s of more than %s days" % (self.doc.employee, self.doc.leave_type, flt(bal['leave_balance'])))
raise Exception raise Exception
# #
# validate overlapping leaves # validate overlapping leaves
# #
def validate_leave_overlap(self): def validate_leave_overlap(self):
for d in sql("""select name, leave_type, posting_date, from_date, to_date for d in sql("""select name, leave_type, posting_date, from_date, to_date
from `tabLeave Application` from `tabLeave Application`
where where
(from_date <= %(to_date)s and to_date >= %(from_date)s) (from_date <= %(to_date)s and to_date >= %(from_date)s)
and employee = %(employee)s and employee = %(employee)s
and docstatus = 1 and docstatus = 1
and name != %(name)s""", self.doc.fields, as_dict = 1): and name != %(name)s""", self.doc.fields, as_dict = 1):
msgprint("Employee : %s has already applied for %s between %s and %s on %s. Please refer Leave Application : %s" % (self.doc.employee, cstr(d['leave_type']), formatdate(d['from_date']), formatdate(d['to_date']), formatdate(d['posting_date']), d['name']), raise_exception = 1) msgprint("Employee : %s has already applied for %s between %s and %s on %s. Please refer Leave Application : %s" % (self.doc.employee, cstr(d['leave_type']), formatdate(d['from_date']), formatdate(d['to_date']), formatdate(d['posting_date']), d['name']), raise_exception = 1)
# --------------------------------------------------------------------- # ---------------------------------------------------------------------
# validate max days for which leave can be applied for particular type # validate max days for which leave can be applied for particular type
# --------------------------------------------------------------------- # ---------------------------------------------------------------------
def validate_max_days(self): def validate_max_days(self):
max_days = sql("select max_days_allowed from `tabLeave Type` where name = '%s'" %(self.doc.leave_type)) max_days = sql("select max_days_allowed from `tabLeave Type` where name = '%s'" %(self.doc.leave_type))
max_days = max_days and flt(max_days[0][0]) or 0 max_days = max_days and flt(max_days[0][0]) or 0
if max_days and self.doc.total_leave_days > max_days: if max_days and self.doc.total_leave_days > max_days:
msgprint("Sorry ! You cannot apply for %s for more than %s days" % (self.doc.leave_type, max_days)) msgprint("Sorry ! You cannot apply for %s for more than %s days" % (self.doc.leave_type, max_days))
raise Exception raise Exception
# --------- # ---------
# validate # validate
# --------- # ---------
def validate(self): def validate(self):
self.validate_to_date() self.validate_to_date()
self.validate_balance_leaves() self.validate_balance_leaves()
self.validate_leave_overlap() self.validate_leave_overlap()
self.validate_max_days() self.validate_max_days()

View File

@@ -46,7 +46,7 @@ class DocType:
self.check_mandatory() self.check_mandatory()
cond = '' cond = ''
for f in ['company', 'branch', 'department', 'designation', 'grade', 'employment_type']: for f in ['company', 'branch', 'department', 'designation', 'grade']:
if self.doc.fields.get(f): if self.doc.fields.get(f):
cond += " and t1." + f + " = '" + self.doc.fields.get(f) + "'" cond += " and t1." + f + " = '" + self.doc.fields.get(f) + "'"

View File

@@ -5,18 +5,19 @@
{ {
'creation': '2011-08-11 16:40:04', 'creation': '2011-08-11 16:40:04',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-08-25 12:02:57', 'modified': '2011-11-07 10:47:32',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
# These values are common for all DocType # These values are common for all DocType
{ {
'_last_update': '1314179318', '_last_update': '1314253977',
'allow_copy': 1, 'allow_copy': 1,
'allow_email': 1, 'allow_email': 1,
'allow_print': 1, 'allow_print': 1,
'colour': 'White:FFF', 'colour': 'White:FFF',
'default_print_format': 'Standard',
'doctype': 'DocType', 'doctype': 'DocType',
'document_type': 'Other', 'document_type': 'Other',
'issingle': 1, 'issingle': 1,
@@ -24,7 +25,7 @@
'name': '__common__', 'name': '__common__',
'section_style': 'Simple', 'section_style': 'Simple',
'show_in_menu': 1, 'show_in_menu': 1,
'version': 29 'version': 30
}, },
# These values are common for all DocField # These values are common for all DocField
@@ -59,21 +60,18 @@
# DocPerm # DocPerm
{ {
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 1,
'role': 'System Manager' 'role': 'System Manager'
}, },
# DocPerm # DocPerm
{ {
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 2,
'role': 'HR User' 'role': 'HR User'
}, },
# DocPerm # DocPerm
{ {
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 3,
'role': 'HR Manager' 'role': 'HR Manager'
}, },
@@ -82,7 +80,6 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'HTML', 'fieldtype': 'HTML',
'idx': 1,
'label': 'Document Description', 'label': 'Document Description',
'options': '<div class="field_description">You can generate multiple salary slips based on the selected criteria, submit and mail those to the employee directly from here</div>' 'options': '<div class="field_description">You can generate multiple salary slips based on the selected criteria, submit and mail those to the employee directly from here</div>'
}, },
@@ -90,15 +87,13 @@
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break'
'idx': 2
}, },
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Column Break', 'fieldtype': 'Column Break',
'idx': 3,
'width': '50%' 'width': '50%'
}, },
@@ -107,7 +102,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'company', 'fieldname': 'company',
'fieldtype': 'Select', 'fieldtype': 'Select',
'idx': 4,
'label': 'Company', 'label': 'Company',
'options': 'link:Company', 'options': 'link:Company',
'reqd': 1 'reqd': 1
@@ -118,7 +112,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'branch', 'fieldname': 'branch',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 5,
'label': 'Branch', 'label': 'Branch',
'options': 'Branch' 'options': 'Branch'
}, },
@@ -128,7 +121,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'department', 'fieldname': 'department',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 6,
'label': 'Department', 'label': 'Department',
'options': 'Department' 'options': 'Department'
}, },
@@ -138,7 +130,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'designation', 'fieldname': 'designation',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 7,
'label': 'Designation', 'label': 'Designation',
'options': 'Designation' 'options': 'Designation'
}, },
@@ -147,7 +138,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Column Break', 'fieldtype': 'Column Break',
'idx': 8,
'width': '50%' 'width': '50%'
}, },
@@ -156,28 +146,16 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'grade', 'fieldname': 'grade',
'fieldtype': 'Select', 'fieldtype': 'Select',
'idx': 9,
'label': 'Grade', 'label': 'Grade',
'options': 'link:Grade' 'options': 'link:Grade'
}, },
# DocField
{
'doctype': 'DocField',
'fieldname': 'employment_type',
'fieldtype': 'Select',
'idx': 10,
'label': 'Employment Type',
'options': 'link:Employment Type'
},
# DocField # DocField
{ {
'colour': 'White:FFF', 'colour': 'White:FFF',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'fiscal_year', 'fieldname': 'fiscal_year',
'fieldtype': 'Select', 'fieldtype': 'Select',
'idx': 11,
'label': 'Fiscal Year', 'label': 'Fiscal Year',
'options': 'link:Fiscal Year', 'options': 'link:Fiscal Year',
'reqd': 1 'reqd': 1
@@ -189,7 +167,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'month', 'fieldname': 'month',
'fieldtype': 'Select', 'fieldtype': 'Select',
'idx': 12,
'label': 'Month', 'label': 'Month',
'options': '\n01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n11\n12', 'options': '\n01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n11\n12',
'reqd': 1 'reqd': 1
@@ -202,22 +179,19 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'send_email', 'fieldname': 'send_email',
'fieldtype': 'Check', 'fieldtype': 'Check',
'idx': 13,
'label': 'Send Email' 'label': 'Send Email'
}, },
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break'
'idx': 14
}, },
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Column Break', 'fieldtype': 'Column Break',
'idx': 15,
'width': '50%' 'width': '50%'
}, },
@@ -227,7 +201,6 @@
'description': 'Creates salary slip for above mentioned criteria.', 'description': 'Creates salary slip for above mentioned criteria.',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Button', 'fieldtype': 'Button',
'idx': 16,
'label': 'Create Salary Slip', 'label': 'Create Salary Slip',
'trigger': 'Client' 'trigger': 'Client'
}, },
@@ -236,7 +209,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Column Break', 'fieldtype': 'Column Break',
'idx': 17,
'width': '25%' 'width': '25%'
}, },
@@ -246,7 +218,6 @@
'description': 'Submit all salary slips for the above selected criteria', 'description': 'Submit all salary slips for the above selected criteria',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Button', 'fieldtype': 'Button',
'idx': 18,
'label': 'Submit Salary Slip', 'label': 'Submit Salary Slip',
'trigger': 'Client' 'trigger': 'Client'
}, },
@@ -255,7 +226,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Column Break', 'fieldtype': 'Column Break',
'idx': 19,
'width': '25%' 'width': '25%'
}, },
@@ -265,7 +235,6 @@
'description': 'Create Bank Voucher for the total salary paid for the above selected criteria', 'description': 'Create Bank Voucher for the total salary paid for the above selected criteria',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Button', 'fieldtype': 'Button',
'idx': 20,
'label': 'Make Bank Voucher', 'label': 'Make Bank Voucher',
'trigger': 'Client' 'trigger': 'Client'
}, },
@@ -273,15 +242,13 @@
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break'
'idx': 21
}, },
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'HTML', 'fieldtype': 'HTML',
'idx': 22,
'label': 'Activity Log' 'label': 'Activity Log'
} }
] ]

View File

@@ -1,3 +1,24 @@
this.mytabs.items['Select Columns'].hide(); this.mytabs.items['Select Columns'].hide();
this.mytabs.tabs['More Filters'].hide(); this.mytabs.tabs['More Filters'].hide();
report.customize_filters = function() {
this.add_filter({
fieldname:'fiscal_year',
label:'Fiscal Year',
fieldtype:'Link',
ignore : 1,
options: 'Fiscal Year',
parent:'Leave Allocation',
in_first_page:1
});
this.add_filter({
fieldname:'employee_name',
label:'Employee Name',
fieldtype:'Data',
ignore : 1,
options: '',
parent:'Leave Allocation',
in_first_page:1
});
}

View File

@@ -1,20 +1,55 @@
leave_types = sql("select name from `tabLeave Type` where docstatus != 2 and name not in ('Compensatory Off','Leave Without Pay')") leave_types = sql("""
msgprint(leave_types) SELECT name FROM `tabLeave Type`
WHERE
docstatus!=2 AND
name NOT IN ('Compensatory Off', 'Leave Without Pay')""")
col=[] col=[]
col.append(['Employee ID', 'Data', '150px', ''])
col.append(['Employee Name', 'Data', '150px', ''])
col.append(['Fiscal Year', 'Data', '150px', ''])
for e in leave_types: for e in leave_types:
l = (len(e)*9) l = (len(e[0])*9)
if l < 150 : col_width = '150px' if l < 150 : col_width = '150px'
else: col_width = '%spx'%(l) else: col_width = '%spx'%(l)
col.append([e[0],'Currency',col_width,''])
col.append([e,'Currency',col_width,''])
col.append(['Total Balance','Currency','150px','']) col.append(['Total Balance','Currency','150px',''])
for c in col: for c in col:
colnames.append(c[0]) colnames.append(c[0])
coltypes.append(c[1]) coltypes.append(c[1])
colwidths.append(c[2]) colwidths.append(c[2])
coloptions.append(c[3]) coloptions.append(c[3])
col_idx[c[0]] = len(colnames) col_idx[c[0]] = len(colnames)
data = res
res = []
try:
for d in data:
exists = 0
ind = None
# Check if the employee record exists in list 'res'
for r in res:
if r[0] == d[0] and r[1] == d[1]:
exists = 1
ind = res.index(r)
break
if d[3] in colnames:
# If exists, then append the leave type data
if exists:
res[ind][colnames.index(d[3])] = d[4] - d[5]
res[ind][len(colnames)-1] = sum(res[ind][3:-1])
# Else create a new row in res
else:
new_row = [0.0 for c in colnames]
new_row[0] = d[0]
new_row[1] = d[1]
new_row[2] = d[2]
new_row[colnames.index(d[3])] = d[4] - d[5]
new_row[len(colnames)-1] = sum(new_row[3:-1])
res.append(new_row)
except Exception, e:
msgprint(e)

View File

@@ -0,0 +1,26 @@
SELECT
leave_alloc.employee AS 'employee',
leave_alloc.employee_name AS 'employee_name',
leave_alloc.fiscal_year AS 'fiscal_year',
leave_alloc.leave_type AS 'leave_type',
leave_alloc.total_leaves_allocated AS 'total_leaves_allocated',
SUM(leave_app.total_leave_days) AS 'total_leaves_applied'
FROM
`tabLeave Allocation` AS leave_alloc,
`tabLeave Application` AS leave_app
WHERE
leave_alloc.employee=leave_app.employee AND
leave_alloc.leave_type=leave_app.leave_type AND
leave_alloc.fiscal_year=leave_app.fiscal_year AND
leave_alloc.docstatus=1 AND
leave_app.docstatus=1 AND
leave_alloc.fiscal_year LIKE '%(fiscal_year)s%%' AND
leave_alloc.employee_name LIKE '%(employee_name)s%%'
GROUP BY
employee,
fiscal_year,
leave_type
ORDER BY
employee,
fiscal_year,
leave_type

View File

@@ -3,9 +3,9 @@
# These values are common in all dictionaries # These values are common in all dictionaries
{ {
'creation': '2010-12-14 10:23:25', 'creation': '2010-12-14 10:33:09',
'docstatus': 0, 'docstatus': 0,
'modified': '2010-12-01 10:39:56', 'modified': '2011-10-31 15:42:36',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'harshada@webnotestech.com' 'owner': 'harshada@webnotestech.com'
}, },
@@ -13,7 +13,8 @@
# These values are common for all Search Criteria # These values are common for all Search Criteria
{ {
'columns': 'Employee\x01ID', 'columns': 'Employee\x01ID',
'criteria_name': 'Employeewise Balance Leave Report', 'criteria_name': 'Employee Leave Balance Report',
'description': 'Employeewise Balance Leave Report',
'doc_type': 'Employee', 'doc_type': 'Employee',
'doctype': 'Search Criteria', 'doctype': 'Search Criteria',
'filters': "{'Employee\x01Saved':1,'Employee\x01Submitted':1,'Employee\x01Gender':'','Employee\x01Month of Birth':'','Employee\x01Status':'Active'}", 'filters': "{'Employee\x01Saved':1,'Employee\x01Submitted':1,'Employee\x01Gender':'','Employee\x01Month of Birth':'','Employee\x01Status':'Active'}",

View File

@@ -71,8 +71,8 @@ KBPoints = function(parent, points, voted, dt, dn, owner) {
// if user has not already voted // if user has not already voted
if(user!='Guest' && !in_list(voted, user) && user!=owner) { if(user!='Guest' && !in_list(voted, user) && user!=owner) {
this.vote_up = $a(this.wrapper, 'img', 'images/ui/vote_up.gif', {margin:'0px 0px -2px 7px', cursor: 'pointer'}); this.vote_up = $a(this.wrapper, 'img', 'lib/images/ui/vote_up.gif', {margin:'0px 0px -2px 7px', cursor: 'pointer'});
this.vote_down = $a(this.wrapper, 'img', 'images/ui/vote_down.gif', {margin:'0px 0px -3px 0px', cursor: 'pointer'}); this.vote_down = $a(this.wrapper, 'img', 'lib/images/ui/vote_down.gif', {margin:'0px 0px -3px 0px', cursor: 'pointer'});
this.vote_up.title = 'Vote Up'; this.vote_down.title = 'Vote Down'; this.vote_up.title = 'Vote Up'; this.vote_down.title = 'Vote Down';

View File

@@ -36,8 +36,6 @@ function KnowledgeBase(w) {
this.make_search_bar = function() { this.make_search_bar = function() {
this.search = $a($a(w,'div','kb-search-wrapper'), 'textarea'); this.search = $a($a(w,'div','kb-search-wrapper'), 'textarea');
$(this.search).add_default_text('Enter keywords or a new Question');
var div = $a(w,'div','kb-btn-wrapper'); var div = $a(w,'div','kb-btn-wrapper');
$btn(div, 'Search', function() { me.run() }, {fontSize:'14px'}); $btn(div, 'Search', function() { me.run() }, {fontSize:'14px'});
$btn(div, 'Ask', function() { me.ask() }, {fontSize:'14px'}); $btn(div, 'Ask', function() { me.ask() }, {fontSize:'14px'});

View File

@@ -0,0 +1,12 @@
"""
This patch changes criteria name
of search criteria "employeewise_balance_leave_report"
from "Employeewise Balance Leave Report"
to "Employee Leave Balance Report"
"""
def execute():
from webnotes.model.doc import Document
d = Document('Search Criteria', 'employeewise_balance_leave_report')
d.criteria_name = 'Employee Leave Balance Report'
d.description = 'Employeewise Balance Leave Report'
d.save()

View File

@@ -0,0 +1,108 @@
import os, sys
import webnotes
path_to_file = os.sep.join(os.path.abspath(__file__).split(os.sep)[:-1] + ['print_formats'])
def prepare_pf_dict(args_list):
"""
"""
pf_list = []
for a in args_list:
for pf_type in ['Classic', 'Modern', 'Spartan']:
pf = {}
pf['name'] = " ".join([a['name'], pf_type])
pf['file'] = os.sep.join([path_to_file, "".join(pf['name'].split(" ")) + ".html"])
pf['module'] = a['module']
pf['doc_type'] = a['doc_type']
pf['standard'] = 'Yes'
pf_list += [pf]
return pf_list
pf_to_install = prepare_pf_dict([
{
'name' : 'Sales Invoice',
'doc_type' : 'Receivable Voucher',
'module' : 'Accounts'
},
{
'name' : 'Sales Order',
'doc_type' : 'Sales Order',
'module' : 'Selling'
},
{
'name' : 'Quotation',
'doc_type' : 'Quotation',
'module' : 'Selling'
},
{
'name' : 'Delivery Note',
'doc_type' : 'Delivery Note',
'module' : 'Stock'
},
{
'name' : 'Purchase Order',
'doc_type' : 'Purchase Order',
'module' : 'Buying'
}
])
def execute():
"""
Install print formats
"""
from webnotes.modules.module_manager import reload_doc
#reload_doc('core', 'doctype', 'print_format')
#copy_doctype_to_pfs()
global pf_to_install
for pf in pf_to_install:
# install_print_format(pf)
# print "Installed PF: " + pf['name']
reload_doc(pf['module'], 'Print Format', pf['name'])
def copy_doctype_to_pfs():
"""
Copy doctype to existing print formats
"""
pf_dt_list = webnotes.conn.sql("""
SELECT format, parent
FROM `tabDocFormat`""", as_list=1)
from webnotes.model.doc import Document
for pf, dt in pf_dt_list:
try:
d = Document('Print Format', pf)
d.doc_type = dt
d.save()
except Exception, e:
print e.args
pass
def install_print_format(args):
"""
Installs print format
args is a dict consisting of following keys:
* name
* module
* doctype
* standard = "Yes"/"No"
* file
"""
from webnotes.model.doc import Document
d = Document('Print Format')
d.name = args['name']
f = open(args['file'])
d.html = f.read()
f.close()
d.module = args['module']
d.doc_type = args['doc_type']
d.standard = args['standard']
d.save(1)
from webnotes.model.code import get_obj
obj = get_obj('Print Format', args['name'])
obj.on_update()

View File

@@ -0,0 +1,9 @@
def execute():
import webnotes
from webnotes.modules.module_manager import reload_doc
reload_doc('stock', 'doctype', 'landed_cost_wizard')
reload_doc('stock', 'doctype', 'lc_pr_detail')
webnotes.conn.sql("delete from `tabDocField` where parent ='LC PR Detail' and fieldname in ('purchase_receipt_no', 'include_in_landed_cost')")

4
erpnext/patches/p1.py Normal file
View File

@@ -0,0 +1,4 @@
def execute():
import webnotes
if not webnotes.conn.sql("select name from tabDocFormat where parent = 'Receivable Voucher' and format != 'POS Invoice'"):
webnotes.conn.sql("update tabDocType set default_print_format = 'Standard' where name = 'Receivable Voucher'")

View File

@@ -0,0 +1,8 @@
def execute():
import webnotes
from webnotes.modules.module_manager import reload_doc
reload_doc('stock', 'doctype', 'delivery_note_detail')
reload_doc('stock', 'Print Format', 'Delivery Note Packing List Wise')
webnotes.conn.sql("delete from `tabDocField` where fieldname in ('packed_by', 'packing_checked_by', 'pack_size') and parent = 'Delivery Note'")

View File

@@ -1,7 +1,7 @@
# REMEMBER to update this # REMEMBER to update this
# ======================== # ========================
last_patch = 384 last_patch = 388
#------------------------------------------- #-------------------------------------------
@@ -344,8 +344,7 @@ def execute(patch_no):
bin = sql("select name from tabBin") bin = sql("select name from tabBin")
for b in bin: for b in bin:
bobj = get_obj('Bin',b[0]) bobj = get_obj('Bin',b[0])
prev_sle = bobj.get_prev_sle(posting_date = '2011-09-01', posting_time = '01:00') bobj.update_entries_after(posting_date = '2011-09-01', posting_time = '01:00')
bobj.update_item_valuation(posting_date = '2011-09-01', posting_time = '01:00', prev_sle = prev_sle)
elif patch_no == 368: elif patch_no == 368:
from webnotes.utils import nestedset from webnotes.utils import nestedset
t = [ t = [
@@ -454,3 +453,12 @@ def execute(patch_no):
reload_doc('stock', 'Module Def', 'Stock') reload_doc('stock', 'Module Def', 'Stock')
sql("delete from `tabModule Def Item` where display_name = 'Serial No' and parent = 'Support'") sql("delete from `tabModule Def Item` where display_name = 'Serial No' and parent = 'Support'")
sql("update `tabDocType` set subject = 'Item Code: %(item_code)s, Warehouse: %(warehouse)s' where name = 'Serial No'") sql("update `tabDocType` set subject = 'Item Code: %(item_code)s, Warehouse: %(warehouse)s' where name = 'Serial No'")
elif patch_no == 385:
# Patch for adding packing related columns (packed by, checked by, shipping mark etc)
reload_doc('stock','doctype','delivery_note')
elif patch_no == 386:
sql("update `tabDocField` set allow_on_submit = 1 where fieldname = 'page_break'")
elif patch_no == 387:
sql("update `tabDocField` set allow_on_submit = 1 where fieldname in ('indent_details', 'po_details', 'purchase_receipt_details', 'entries', 'sales_order_details', 'delivery_note_details', 'quotation_details') and fieldtype = 'Table'")
elif patch_no == 388:
pass

View File

@@ -0,0 +1,279 @@
<!--
Sample Print Format for ERPNext
Please use at your own discretion
For suggestions and contributions:
https://github.com/webnotes/erpnext-print-templates
Freely usable under MIT license
-->
<!-- Style Settings -->
<style>
/*
common style for whole page
This should include:
+ page size related settings
+ font family settings
+ line spacing settings
*/
@media screen {
body {
width: 8.3in;
}
}
html, body, div, span, td {
font-family: "Georgia", serif;
font-size: 12px;
}
body {
padding: 10px;
margin: auto;
font-size: 12px;
line-height: 150%;
}
.common {
font-family: "Georgia", serif !important;
font-size: 12px;
padding: 10px 0px;
}
table {
border-collapse: collapse;
width: 100%;
vertical-align: top;
}
table td {
padding: 2px 0px;
}
table h1, h2, h3, h4, h5, h6 {
padding: 0px;
margin: 0px;
}
table.header-table td {
vertical-align: top;
}
table.header-table thead {
border-bottom: 1px solid black;
}
table.header-table h3 {
color: gray;
}
table.header-table thead td {
padding: 5px 0px;
}
div.page-body table td:nth-child(6),
div.page-body table td:nth-child(7) {
text-align: right;
}
table.footer-table td {
vertical-align: top;
}
table.footer-table td table td:nth-child(2),
table.footer-table td table td:nth-child(3) {
text-align: right;
}
</style>
<!-- Javascript -->
<script>
si_std = {
print_item_table: function() {
var table = print_table(
'Delivery Note',
doc.name,
'delivery_note_details',
'Delivery Note Detail',
[// Here specify the table columns to be displayed
'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',
'basic_rate', 'amount'
],
[// Here specify the labels of column headings
'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',
'UoM', 'Basic Rate', 'Amount'
],
[// Here specify the column widths
'3%', '10%', '15%', '32%', '5%',
'5%', '15%', '15%'
],
null,
null,
{
'description' : function(data_row) {
if(data_row.serial_no) {
return (
data_row.description +
'<div style="padding-left: 15px;"><i>Serial No.:' +
((data_row.serial_no.indexOf('\n')>-1)?'<br />':'&nbsp;') +
data_row.serial_no + '</i></div>'
);
} else {
return data_row.description;
}
}
}
);
// This code takes care of page breaks
if(table.appendChild) {
out = table.innerHTML;
} else {
out = '';
for(var i=0; i < (table.length-1); i++) {
out += table[i].innerHTML +
'<div style = "page-break-after: always;" \
class = "page_break"></div>\
<div class="page-settings"></div>';
}
out += table[table.length-1].innerHTML;
}
return out;
},
print_other_charges: function(parent) {
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) {
rows +=
'<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' +
'\t<td></td>\n' +
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n';
}
return rows + '</table>\n';
}
};
</script>
<!-- Page Layout Settings -->
<div class='common page-header'>
<!--
Page Header will contain
+ table 1
+ table 1a
- Name
- Address
- Contact
- Mobile No
+ table 1b
- Voucher Date
- Due Date
-->
<table class='header-table' cellspacing=0>
<thead>
<tr><td><h1>Delivery Note</h1></td></tr>
<tr><td><h3><script>cur_frm.docname</script></h3></td></tr>
</thead>
<tbody>
<tr>
<td width=60%><table width=100% cellspacing=0><tbody>
<tr>
<td width=22%><b>Name</b></td>
<td><script>doc.customer_name</script></td>
</tr>
<tr>
<td><b>Address</b></td>
<td><script>replace_newlines(doc.address_display)</script></td>
</tr>
<tr>
<td><b>Contact</b></td>
<td><script>doc.contact_display</script></td>
</tr>
</tbody></table></td>
<td><table width=100% cellspacing=0><tbody>
<tr>
<td width=63%><b>Delivery Note Date</b></td>
<td><script>date.str_to_user(doc.transaction_date)</script></td>
<tr>
<tr>
<td><b>Sales Order No.</b></td>
<td>
<script>doc.sales_order_no</script><br />
<i>(<script>date.str_to_user(doc.posting_date)</script>)</i>
</td>
<tr>
</tbody></table></td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
<div class='common page-body'>
<!--
Page Body will contain
+ table 2
- Sales Invoice Data
-->
<script>si_std.print_item_table()</script>
</div>
<div class='common page-footer'>
<!--
Page Footer will contain
+ table 3
- Terms and Conditions
- Total Rounded Amount Calculation
- Total Rounded Amount in Words
-->
<table class='footer-table' width=100% cellspacing=0>
<thead>
</thead>
<tbody>
<tr>
<td width=60% style='padding-right: 10px;'>
<b>Terms, Conditions &amp; Other Information:</b><br />
<script>doc.terms</script>
</td>
<td>
<table cellspacing=0 width=100%><tbody>
<tr>
<td>Net Total</td>
<td></td>
<td width=38%><script>
fmt_money(doc.net_total)
</script></td>
</tr>
<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>
<tr>
<td>Grand Total</td>
<td></td>
<td><script>
fmt_money(doc.grand_total_export)
</script></td>
</tr>
<tr style='font-weight: bold'>
<td>Rounded Total</td>
<td><script>doc.currency</script></td>
<td><script>
fmt_money(doc.rounded_total_export)
</script></td>
</tr>
</tbody></table>
<br /><b>In Words</b><br />
<i><script>doc.in_words_export</script></i>
</td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>

View File

@@ -0,0 +1,306 @@
<!--
Sample Print Format for ERPNext
Please use at your own discretion
For suggestions and contributions:
https://github.com/webnotes/erpnext-print-templates
Freely usable under MIT license
-->
<!-- Style Settings -->
<style>
/*
common style for whole page
This should include:
+ page size related settings
+ font family settings
+ line spacing settings
*/
@media screen {
body {
width: 8.3in;
}
}
html, body, div, span, td {
font-family: "Helvetica", "Arial", sans-serif;
font-size: 12px;
}
body {
padding: 10px;
margin: auto;
font-size: 12px;
line-height: 150%;
}
.common {
font-family: "Helvetica", "Arial", sans-serif !important;
font-size: 12px;
padding: 10px 0px;
}
table {
border-collapse: collapse;
width: 100%;
vertical-align: top;
border-style: none !important;
}
table td {
padding: 2px 0px;
border-style: none !important;
}
table h1, h2, h3, h4, h5, h6 {
padding: 0px;
margin: 0px;
}
table.header-table td {
vertical-align: top;
}
table.header-table h1 {
text-transform: uppercase;
color: white;
font-size: 55px;
font-style: italic;
}
table.header-table thead tr:nth-child(1) div {
height: 24px;
background-color: #696969;
vertical-align: middle;
padding: 12px 0px 0px 0px;
width: 100%;
}
div.page-body table td:nth-child(6),
div.page-body table td:nth-child(7) {
text-align: right;
}
div.page-body table tr td {
background-color: #DCDCDC !important;
}
div.page-body table tr:nth-child(1) td {
background-color: #696969 !important;
color: white !important;
}
table.footer-table td {
vertical-align: top;
}
table.footer-table td table td:nth-child(2),
table.footer-table td table td:nth-child(3) {
text-align: right;
}
table.footer-table tfoot td {
background-color: #696969;
height: 10px;
}
.imp-details {
background-color: #DCDCDC;
}
</style>
<!-- Javascript -->
<script>
si_std = {
print_item_table: function() {
var table = print_table(
'Delivery Note',
doc.name,
'delivery_note_details',
'Delivery Note Detail',
[// Here specify the table columns to be displayed
'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',
'basic_rate', 'amount'
],
[// Here specify the labels of column headings
'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',
'UoM', 'Basic Rate', 'Amount'
],
[// Here specify the column widths
'3%', '10%', '15%', '32%', '5%',
'5%', '15%', '15%'
],
null,
null,
{
'description' : function(data_row) {
if(data_row.serial_no) {
return (
data_row.description +
'<div style="padding-left: 15px;"><i>Serial No.:' +
((data_row.serial_no.indexOf('\n')>-1)?'<br />':'&nbsp;') +
data_row.serial_no + '</i></div>'
);
} else {
return data_row.description;
}
}
}
);
// This code takes care of page breaks
if(table.appendChild) {
out = table.innerHTML;
} else {
out = '';
for(var i=0; i < (table.length-1); i++) {
out += table[i].innerHTML +
'<div style = "page-break-after: always;" \
class = "page_break"></div>\
<div class="page-settings"></div>';
}
out += table[table.length-1].innerHTML;
}
return out;
},
print_other_charges: function(parent) {
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) {
rows +=
'<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' +
'\t<td></td>\n' +
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n';
}
return rows + '</table>\n';
}
};
</script>
<!-- Page Layout Settings -->
<div class='common page-header'>
<!--
Page Header will contain
+ table 1
+ table 1a
- Name
- Address
- Contact
- Mobile No
+ table 1b
- Voucher Date
- Due Date
-->
<table class='header-table' cellspacing=0>
<thead>
<tr><td colspan=2><div><h1>Delivery Note</h1></div></td></tr>
<tr><td colspan=2><div style="height:15px"></div></td></tr>
</thead>
<tbody>
<tr>
<td width=60%><table width=100% cellspacing=0><tbody>
<tr>
<td width=22%><b>Name</b></td>
<td><script>doc.customer_name</script></td>
</tr>
<tr>
<td><b>Address</b></td>
<td><script>replace_newlines(doc.address_display)</script></td>
</tr>
<tr>
<td><b>Contact</b></td>
<td><script>doc.contact_display</script></td>
</tr>
</tbody></table></td>
<td><table width=100% cellspacing=0><tbody>
<tr class='imp-details'>
<td><b>Delivery Note No.</b></td>
<td><script>cur_frm.docname</script></td>
</tr>
<tr>
<td width=63%><b>Delivery Note Date</b></td>
<td><script>date.str_to_user(doc.transaction_date)</script></td>
<tr>
<tr>
<td><b>Sales Order No.</b></td>
<td>
<script>doc.sales_order_no</script><br />
<i>(<script>date.str_to_user(doc.posting_date)</script>)</i>
</td>
<tr>
</tbody></table></td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
<div class='common page-body'>
<!--
Page Body will contain
+ table 2
- Sales Invoice Data
-->
<script>si_std.print_item_table()</script>
</div>
<div class='common page-footer'>
<!--
Page Footer will contain
+ table 3
- Terms and Conditions
- Total Rounded Amount Calculation
- Total Rounded Amount in Words
-->
<table class='footer-table' width=100% cellspacing=0>
<thead>
</thead>
<tbody>
<tr>
<td width=60% style='padding-right: 10px;'>
<b>Terms, Conditions &amp; Other Information:</b><br />
<script>doc.terms</script>
</td>
<td>
<table cellspacing=0 width=100%><tbody>
<tr>
<td>Net Total</td>
<td></td>
<td width=38%><script>
fmt_money(doc.net_total)
</script></td>
</tr>
<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>
<tr>
<td>Grand Total</td>
<td></td>
<td><script>
fmt_money(doc.grand_total_export)
</script></td>
</tr>
<tr style='font-weight: bold' class='imp-details'>
<td>Rounded Total</td>
<td><script>doc.currency</script></td>
<td><script>
fmt_money(doc.rounded_total_export)
</script></td>
</tr>
</tbody></table>
<br /><b>In Words</b><br />
<i><script>doc.in_words_export</script></i>
</td>
</tr>
</tbody>
<tfoot>
<tr><td colspan=2><div></div></td><tr>
</tfoot>
</table>
</div>

View File

@@ -0,0 +1,302 @@
<!--
Sample Print Format for ERPNext
Please use at your own discretion
For suggestions and contributions:
https://github.com/webnotes/erpnext-print-templates
Freely usable under MIT license
-->
<!-- Style Settings -->
<style>
/*
common style for whole page
This should include:
+ page size related settings
+ font family settings
+ line spacing settings
*/
@media screen {
body {
width: 8.3in;
}
}
html, body, div, span, td {
font-family: "Arial", sans-serif;
font-size: 12px;
}
body {
padding: 10px;
margin: auto;
font-size: 12px;
line-height: 150%;
}
.common {
font-family: "Arial", sans-serif !important;
font-size: 12px;
padding: 0px;
}
table {
width: 100% !important;
vertical-align: top;
}
table td {
padding: 2px 0px;
}
table, td {
border-collapse: collapse !important;
padding: 0px;
margin: 0px !important;
}
table h1, h2, h3, h4, h5, h6 {
padding: 0px;
margin: 0px;
}
table.header-table td {
vertical-align: top;
}
table.header-table h3 {
color: gray;
}
table.header-table thead td {
padding: 5px;
}
table.header-table > thead,
table.header-table > tbody > tr > td,
table.footer-table > tbody > tr > td {
border: 1px solid black;
padding: 5px;
}
table.footer-table > tbody,
table.header-table > thead {
border-bottom: 3px solid black;
}
table.header-table > thead {
border-top: 3px solid black;
}
div.page-body table td:nth-child(6),
div.page-body table td:nth-child(7) {
text-align: right;
}
div.page-body td {
background-color: white !important;
border: 1px solid black !important;
}
table.footer-table td {
vertical-align: top;
}
table.footer-table td table td:nth-child(2),
table.footer-table td table td:nth-child(3) {
text-align: right;
}
</style>
<!-- Javascript -->
<script>
si_std = {
print_item_table: function() {
var table = print_table(
'Delivery Note',
doc.name,
'delivery_note_details',
'Delivery Note Detail',
[// Here specify the table columns to be displayed
'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',
'basic_rate', 'amount'
],
[// Here specify the labels of column headings
'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',
'UoM', 'Basic Rate', 'Amount'
],
[// Here specify the column widths
'3%', '10%', '15%', '32%', '5%',
'5%', '15%', '15%'
],
null,
null,
{
'description' : function(data_row) {
if(data_row.serial_no) {
return (
data_row.description +
'<div style="padding-left: 15px;"><i>Serial No.:' +
((data_row.serial_no.indexOf('\n')>-1)?'<br />':'&nbsp;') +
data_row.serial_no + '</i></div>'
);
} else {
return data_row.description;
}
}
}
);
// This code takes care of page breaks
if(table.appendChild) {
out = table.innerHTML;
} else {
out = '';
for(var i=0; i < (table.length-1); i++) {
out += table[i].innerHTML +
'<div style = "page-break-after: always;" \
class = "page_break"></div>\
<div class="page-settings"></div>';
}
out += table[table.length-1].innerHTML;
}
return out;
},
print_other_charges: function(parent) {
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) {
rows +=
'<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' +
'\t<td></td>\n' +
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n';
}
return rows + '</table>\n';
}
};
</script>
<!-- Page Layout Settings -->
<div class='common page-header'>
<!--
Page Header will contain
+ table 1
+ table 1a
- Name
- Address
- Contact
- Mobile No
+ table 1b
- Voucher Date
- Due Date
-->
<table class='header-table' cellspacing=0>
<thead>
<tr><td colspan=2><h1>Delivery Note</h1></td></tr>
<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></td></tr>
</thead>
<tbody>
<tr>
<td width=60%><table width=100% cellspacing=0><tbody>
<tr>
<td width=22%><b>Name</b></td>
<td><script>doc.customer_name</script></td>
</tr>
<tr>
<td><b>Address</b></td>
<td><script>replace_newlines(doc.address_display)</script></td>
</tr>
<tr>
<td><b>Contact</b></td>
<td><script>doc.contact_display</script></td>
</tr>
</tbody></table></td>
<td><table width=100% cellspacing=0><tbody>
<tr>
<td width=63%><b>Delivery Note Date</b></td>
<td><script>date.str_to_user(doc.transaction_date)</script></td>
<tr>
<tr>
<td><b>Sales Order No.</b></td>
<td>
<script>doc.sales_order_no</script><br />
<i>(<script>date.str_to_user(doc.posting_date)</script>)</i>
</td>
<tr>
</tbody></table></td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
<div class='common page-body'>
<!--
Page Body will contain
+ table 2
- Sales Invoice Data
-->
<script>si_std.print_item_table()</script>
</div>
<div class='common page-footer'>
<!--
Page Footer will contain
+ table 3
- Terms and Conditions
- Total Rounded Amount Calculation
- Total Rounded Amount in Words
-->
<table class='footer-table' width=100% cellspacing=0>
<thead>
</thead>
<tbody>
<tr>
<td width=60% style='padding-right: 10px;'>
<b>Terms, Conditions &amp; Other Information:</b><br />
<script>doc.terms</script>
</td>
<td>
<table cellspacing=0 width=100%><tbody>
<tr>
<td>Net Total</td>
<td></td>
<td width=38%><script>
fmt_money(doc.net_total)
</script></td>
</tr>
<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>
<tr>
<td>Grand Total</td>
<td></td>
<td><script>
fmt_money(doc.grand_total_export)
</script></td>
</tr>
<tr style='font-weight: bold'>
<td>Rounded Total</td>
<td><script>doc.currency</script></td>
<td><script>
fmt_money(doc.rounded_total_export)
</script></td>
</tr>
</tbody></table>
<br /><b>In Words</b><br />
<i><script>doc.in_words_export</script></i>
</td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>

View File

@@ -0,0 +1,249 @@
<!--
Sample Print Format for ERPNext
Please use at your own discretion
For suggestions and contributions:
https://github.com/webnotes/erpnext-print-templates
Freely usable under MIT license
-->
<!-- Style Settings -->
<style>
/*
common style for whole page
This should include:
+ page size related settings
+ font family settings
+ line spacing settings
*/
@media screen {
body {
width: 8.3in;
}
}
html, body, div, span, td {
font-family: "Georgia", serif;
font-size: 12px;
}
body {
padding: 10px;
margin: auto;
font-size: 12px;
line-height: 150%;
}
.common {
font-family: "Georgia", serif !important;
font-size: 12px;
padding: 10px 0px;
}
table {
border-collapse: collapse;
width: 100%;
vertical-align: top;
}
table td {
padding: 2px 0px;
}
table h1, h2, h3, h4, h5, h6 {
padding: 0px;
margin: 0px;
}
table.header-table td {
vertical-align: top;
}
table.header-table thead {
border-bottom: 1px solid black;
}
table.header-table h3 {
color: gray;
}
table.header-table thead td {
padding: 5px 0px;
}
div.page-body table td:nth-child(6),
div.page-body table td:nth-child(7) {
text-align: right;
}
table.footer-table td {
vertical-align: top;
}
table.footer-table td table td:nth-child(2),
table.footer-table td table td:nth-child(3) {
text-align: right;
}
</style>
<!-- Javascript -->
<script>
si_std = {
print_item_table: function() {
var table = print_table(
'Purchase Order',
doc.name,
'po_details',
'PO Detail',
[// Here specify the table columns to be displayed
'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',
'import_rate', 'import_amount'
],
[// Here specify the labels of column headings
'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',
'UoM', 'Basic Rate', 'Amount'
],
[// Here specify the column widths
'3%', '10%', '15%', '32%', '5%',
'5%', '15%', '15%'
]
);
// This code takes care of page breaks
if(table.appendChild) {
out = table.innerHTML;
} else {
out = '';
for(var i=0; i < (table.length-1); i++) {
out += table[i].innerHTML +
'<div style = "page-break-after: always;" \
class = "page_break"></div>\
<div class="page-settings"></div>';
}
out += table[table.length-1].innerHTML;
}
return out;
},
print_other_charges: function(parent) {
var oc = getchildren('Purchase Tax Detail', doc.name, 'purchase_tax_details');
var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) {
rows +=
'<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' +
'\t<td></td>\n' +
'\t<td width=38%>' + fmt_money(oc[i].tax_amount / (doc.conversion_rate || 1)) + '</td>\n' +
'</tr>\n';
}
return rows + '</table>\n';
}
};
</script>
<!-- Page Layout Settings -->
<div class='common page-header'>
<!--
Page Header will contain
+ table 1
+ table 1a
- Name
- Address
- Contact
- Mobile No
+ table 1b
- Voucher Date
- Due Date
-->
<table class='header-table' cellspacing=0>
<thead>
<tr><td><h1>Purchase Order</h1></td></tr>
<tr><td><h3><script>cur_frm.docname</script></h3></td></tr>
</thead>
<tbody>
<tr>
<td width=60%><table width=100% cellspacing=0><tbody>
<tr>
<td width=22%><b>Name</b></td>
<td><script>doc.supplier_name</script></td>
</tr>
<tr>
<td><b>Address</b></td>
<td><script>replace_newlines(doc.address_display)</script></td>
</tr>
<tr>
<td><b>Contact</b></td>
<td><script>doc.contact_display</script></td>
</tr>
</tbody></table></td>
<td><table width=100% cellspacing=0><tbody>
<tr>
<td width=63%><b>Purchase Order Date</b></td>
<td><script>date.str_to_user(doc.transaction_date)</script></td>
<tr>
</tbody></table></td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
<div class='common page-body'>
<!--
Page Body will contain
+ table 2
- Sales Invoice Data
-->
<script>si_std.print_item_table()</script>
</div>
<div class='common page-footer'>
<!--
Page Footer will contain
+ table 3
- Terms and Conditions
- Total Rounded Amount Calculation
- Total Rounded Amount in Words
-->
<table class='footer-table' width=100% cellspacing=0>
<thead>
</thead>
<tbody>
<tr>
<td width=60% style='padding-right: 10px;'>
<b>Terms, Conditions &amp; Other Information:</b><br />
<script>doc.terms</script>
</td>
<td>
<table cellspacing=0 width=100%><tbody>
<tr>
<td>Net Total</td>
<td></td>
<td width=38%><script>
fmt_money(doc.net_total_import)
</script></td>
</tr>
<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>
<tr style='font-weight: bold'>
<td>Grand Total</td>
<td><script>doc.currency</script></td>
<td><script>
fmt_money(doc.grand_total_import)
</script></td>
</tr>
</tbody></table>
<br /><b>In Words</b><br />
<i><script>doc.in_words_import</script></i>
</td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>

View File

@@ -0,0 +1,276 @@
<!--
Sample Print Format for ERPNext
Please use at your own discretion
For suggestions and contributions:
https://github.com/webnotes/erpnext-print-templates
Freely usable under MIT license
-->
<!-- Style Settings -->
<style>
/*
common style for whole page
This should include:
+ page size related settings
+ font family settings
+ line spacing settings
*/
@media screen {
body {
width: 8.3in;
}
}
html, body, div, span, td {
font-family: "Helvetica", "Arial", sans-serif;
font-size: 12px;
}
body {
padding: 10px;
margin: auto;
font-size: 12px;
line-height: 150%;
}
.common {
font-family: "Helvetica", "Arial", sans-serif !important;
font-size: 12px;
padding: 10px 0px;
}
table {
border-collapse: collapse;
width: 100%;
vertical-align: top;
border-style: none !important;
}
table td {
padding: 2px 0px;
border-style: none !important;
}
table h1, h2, h3, h4, h5, h6 {
padding: 0px;
margin: 0px;
}
table.header-table td {
vertical-align: top;
}
table.header-table h1 {
text-transform: uppercase;
color: white;
font-size: 55px;
font-style: italic;
}
table.header-table thead tr:nth-child(1) div {
height: 24px;
background-color: #696969;
vertical-align: middle;
padding: 12px 0px 0px 0px;
width: 100%;
}
div.page-body table td:nth-child(6),
div.page-body table td:nth-child(7) {
text-align: right;
}
div.page-body table tr td {
background-color: #DCDCDC !important;
}
div.page-body table tr:nth-child(1) td {
background-color: #696969 !important;
color: white !important;
}
table.footer-table td {
vertical-align: top;
}
table.footer-table td table td:nth-child(2),
table.footer-table td table td:nth-child(3) {
text-align: right;
}
table.footer-table tfoot td {
background-color: #696969;
height: 10px;
}
.imp-details {
background-color: #DCDCDC;
}
</style>
<!-- Javascript -->
<script>
si_std = {
print_item_table: function() {
var table = print_table(
'Purchase Order',
doc.name,
'po_details',
'PO Detail',
[// Here specify the table columns to be displayed
'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',
'import_rate', 'import_amount'
],
[// Here specify the labels of column headings
'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',
'UoM', 'Basic Rate', 'Amount'
],
[// Here specify the column widths
'3%', '10%', '15%', '32%', '5%',
'5%', '15%', '15%'
]
);
// This code takes care of page breaks
if(table.appendChild) {
out = table.innerHTML;
} else {
out = '';
for(var i=0; i < (table.length-1); i++) {
out += table[i].innerHTML +
'<div style = "page-break-after: always;" \
class = "page_break"></div>\
<div class="page-settings"></div>';
}
out += table[table.length-1].innerHTML;
}
return out;
},
print_other_charges: function(parent) {
var oc = getchildren('Purchase Tax Detail', doc.name, 'purchase_tax_details');
var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) {
rows +=
'<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' +
'\t<td></td>\n' +
'\t<td width=38%>' + fmt_money(oc[i].tax_amount / (doc.conversion_rate || 1)) + '</td>\n' +
'</tr>\n';
}
return rows + '</table>\n';
}
};
</script>
<!-- Page Layout Settings -->
<div class='common page-header'>
<!--
Page Header will contain
+ table 1
+ table 1a
- Name
- Address
- Contact
- Mobile No
+ table 1b
- Voucher Date
- Due Date
-->
<table class='header-table' cellspacing=0>
<thead>
<tr><td colspan=2><div><h1>Purchase Order</h1></div></td></tr>
<tr><td colspan=2><div style="height:15px"></div></td></tr>
</thead>
<tbody>
<tr>
<td width=60%><table width=100% cellspacing=0><tbody>
<tr>
<td width=22%><b>Name</b></td>
<td><script>doc.supplier_name</script></td>
</tr>
<tr>
<td><b>Address</b></td>
<td><script>replace_newlines(doc.address_display)</script></td>
</tr>
<tr>
<td><b>Contact</b></td>
<td><script>doc.contact_display</script></td>
</tr>
</tbody></table></td>
<td><table width=100% cellspacing=0><tbody>
<tr class='imp-details'>
<td><b>Purchase Order No.</b></td>
<td><script>cur_frm.docname</script></td>
</tr>
<tr>
<td width=63%><b>Purchase Order Date</b></td>
<td><script>date.str_to_user(doc.transaction_date)</script></td>
<tr>
</tbody></table></td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
<div class='common page-body'>
<!--
Page Body will contain
+ table 2
- Sales Invoice Data
-->
<script>si_std.print_item_table()</script>
</div>
<div class='common page-footer'>
<!--
Page Footer will contain
+ table 3
- Terms and Conditions
- Total Rounded Amount Calculation
- Total Rounded Amount in Words
-->
<table class='footer-table' width=100% cellspacing=0>
<thead>
</thead>
<tbody>
<tr>
<td width=60% style='padding-right: 10px;'>
<b>Terms, Conditions &amp; Other Information:</b><br />
<script>doc.terms</script>
</td>
<td>
<table cellspacing=0 width=100%><tbody>
<tr>
<td>Net Total</td>
<td></td>
<td width=38%><script>
fmt_money(doc.net_total_import)
</script></td>
</tr>
<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>
<tr style='font-weight: bold' class='imp-details'>
<td>Grand Total</td>
<td><script>doc.currency</script></td>
<td><script>
fmt_money(doc.grand_total_import)
</script></td>
</tr>
</tbody></table>
<br /><b>In Words</b><br />
<i><script>doc.in_words_import</script></i>
</td>
</tr>
</tbody>
<tfoot>
<tr><td colspan=2><div></div></td><tr>
</tfoot>
</table>
</div>

View File

@@ -0,0 +1,272 @@
<!--
Sample Print Format for ERPNext
Please use at your own discretion
For suggestions and contributions:
https://github.com/webnotes/erpnext-print-templates
Freely usable under MIT license
-->
<!-- Style Settings -->
<style>
/*
common style for whole page
This should include:
+ page size related settings
+ font family settings
+ line spacing settings
*/
@media screen {
body {
width: 8.3in;
}
}
html, body, div, span, td {
font-family: "Arial", sans-serif;
font-size: 12px;
}
body {
padding: 10px;
margin: auto;
font-size: 12px;
line-height: 150%;
}
.common {
font-family: "Arial", sans-serif !important;
font-size: 12px;
padding: 0px;
}
table {
width: 100% !important;
vertical-align: top;
}
table td {
padding: 2px 0px;
}
table, td {
border-collapse: collapse !important;
padding: 0px;
margin: 0px !important;
}
table h1, h2, h3, h4, h5, h6 {
padding: 0px;
margin: 0px;
}
table.header-table td {
vertical-align: top;
}
table.header-table h3 {
color: gray;
}
table.header-table thead td {
padding: 5px;
}
table.header-table > thead,
table.header-table > tbody > tr > td,
table.footer-table > tbody > tr > td {
border: 1px solid black;
padding: 5px;
}
table.footer-table > tbody,
table.header-table > thead {
border-bottom: 3px solid black;
}
table.header-table > thead {
border-top: 3px solid black;
}
div.page-body table td:nth-child(6),
div.page-body table td:nth-child(7) {
text-align: right;
}
div.page-body td {
background-color: white !important;
border: 1px solid black !important;
}
table.footer-table td {
vertical-align: top;
}
table.footer-table td table td:nth-child(2),
table.footer-table td table td:nth-child(3) {
text-align: right;
}
</style>
<!-- Javascript -->
<script>
si_std = {
print_item_table: function() {
var table = print_table(
'Purchase Order',
doc.name,
'po_details',
'PO Detail',
[// Here specify the table columns to be displayed
'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',
'import_rate', 'import_amount'
],
[// Here specify the labels of column headings
'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',
'UoM', 'Basic Rate', 'Amount'
],
[// Here specify the column widths
'3%', '10%', '15%', '32%', '5%',
'5%', '15%', '15%'
]
);
// This code takes care of page breaks
if(table.appendChild) {
out = table.innerHTML;
} else {
out = '';
for(var i=0; i < (table.length-1); i++) {
out += table[i].innerHTML +
'<div style = "page-break-after: always;" \
class = "page_break"></div>\
<div class="page-settings"></div>';
}
out += table[table.length-1].innerHTML;
}
return out;
},
print_other_charges: function(parent) {
var oc = getchildren('Purchase Tax Detail', doc.name, 'purchase_tax_details');
var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) {
rows +=
'<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' +
'\t<td></td>\n' +
'\t<td width=38%>' + fmt_money(oc[i].tax_amount / (doc.conversion_rate || 1)) + '</td>\n' +
'</tr>\n';
}
return rows + '</table>\n';
}
};
</script>
<!-- Page Layout Settings -->
<div class='common page-header'>
<!--
Page Header will contain
+ table 1
+ table 1a
- Name
- Address
- Contact
- Mobile No
+ table 1b
- Voucher Date
- Due Date
-->
<table class='header-table' cellspacing=0>
<thead>
<tr><td colspan=2><h1>Purchase Order</h1></td></tr>
<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></td></tr>
</thead>
<tbody>
<tr>
<td width=60%><table width=100% cellspacing=0><tbody>
<tr>
<td width=22%><b>Name</b></td>
<td><script>doc.supplier_name</script></td>
</tr>
<tr>
<td><b>Address</b></td>
<td><script>replace_newlines(doc.address_display)</script></td>
</tr>
<tr>
<td><b>Contact</b></td>
<td><script>doc.contact_display</script></td>
</tr>
</tbody></table></td>
<td><table width=100% cellspacing=0><tbody>
<tr>
<td width=63%><b>Purchase Order Date</b></td>
<td><script>date.str_to_user(doc.transaction_date)</script></td>
<tr>
</tbody></table></td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
<div class='common page-body'>
<!--
Page Body will contain
+ table 2
- Sales Invoice Data
-->
<script>si_std.print_item_table()</script>
</div>
<div class='common page-footer'>
<!--
Page Footer will contain
+ table 3
- Terms and Conditions
- Total Rounded Amount Calculation
- Total Rounded Amount in Words
-->
<table class='footer-table' width=100% cellspacing=0>
<thead>
</thead>
<tbody>
<tr>
<td width=60% style='padding-right: 10px;'>
<b>Terms, Conditions &amp; Other Information:</b><br />
<script>doc.terms</script>
</td>
<td>
<table cellspacing=0 width=100%><tbody>
<tr>
<td>Net Total</td>
<td></td>
<td width=38%><script>
fmt_money(doc.net_total_import)
</script></td>
</tr>
<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>
<tr style='font-weight: bold'>
<td>Grand Total</td>
<td><script>doc.currency</script></td>
<td><script>
fmt_money(doc.grand_total_import)
</script></td>
</tr>
</tbody></table>
<br /><b>In Words</b><br />
<i><script>doc.in_words_import</script></i>
</td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>

View File

@@ -0,0 +1,256 @@
<!--
Sample Print Format for ERPNext
Please use at your own discretion
For suggestions and contributions:
https://github.com/webnotes/erpnext-print-templates
Freely usable under MIT license
-->
<!-- Style Settings -->
<style>
/*
common style for whole page
This should include:
+ page size related settings
+ font family settings
+ line spacing settings
*/
@media screen {
body {
width: 8.3in;
}
}
html, body, div, span, td {
font-family: "Georgia", serif;
font-size: 12px;
}
body {
padding: 10px;
margin: auto;
font-size: 12px;
line-height: 150%;
}
.common {
font-family: "Georgia", serif !important;
font-size: 12px;
padding: 10px 0px;
}
table {
border-collapse: collapse;
width: 100%;
vertical-align: top;
}
table td {
padding: 2px 0px;
}
table h1, h2, h3, h4, h5, h6 {
padding: 0px;
margin: 0px;
}
table.header-table td {
vertical-align: top;
}
table.header-table thead {
border-bottom: 1px solid black;
}
table.header-table h3 {
color: gray;
}
table.header-table thead td {
padding: 5px 0px;
}
div.page-body table td:nth-child(6),
div.page-body table td:nth-child(7) {
text-align: right;
}
table.footer-table td {
vertical-align: top;
}
table.footer-table td table td:nth-child(2),
table.footer-table td table td:nth-child(3) {
text-align: right;
}
</style>
<!-- Javascript -->
<script>
si_std = {
print_item_table: function() {
var table = print_table(
'Quotation',
doc.name,
'quotation_details',
'Quotation Detail',
[// Here specify the table columns to be displayed
'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',
'export_rate', 'export_amount'
],
[// Here specify the labels of column headings
'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',
'UoM', 'Basic Rate', 'Amount'
],
[// Here specify the column widths
'3%', '10%', '15%', '32%', '5%',
'5%', '15%', '15%'
]
);
// This code takes care of page breaks
if(table.appendChild) {
out = table.innerHTML;
} else {
out = '';
for(var i=0; i < (table.length-1); i++) {
out += table[i].innerHTML +
'<div style = "page-break-after: always;" \
class = "page_break"></div>\
<div class="page-settings"></div>';
}
out += table[table.length-1].innerHTML;
}
return out;
},
print_other_charges: function(parent) {
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) {
rows +=
'<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' +
'\t<td></td>\n' +
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n';
}
return rows + '</table>\n';
}
};
</script>
<!-- Page Layout Settings -->
<div class='common page-header'>
<!--
Page Header will contain
+ table 1
+ table 1a
- Name
- Address
- Contact
- Mobile No
+ table 1b
- Voucher Date
- Due Date
-->
<table class='header-table' cellspacing=0>
<thead>
<tr><td><h1>Quotation</h1></td></tr>
<tr><td><h3><script>cur_frm.docname</script></h3></td></tr>
</thead>
<tbody>
<tr>
<td width=60%><table width=100% cellspacing=0><tbody>
<tr>
<td width=39%><b>Name</b></td>
<td><script>doc.customer?doc.customer:doc.lead_name</script></td>
</tr>
<tr>
<td><b>Address</b></td>
<td><script>replace_newlines(doc.address_display)</script></td>
</tr>
<tr>
<td><b>Contact</b></td>
<td><script>doc.contact_display</script></td>
</tr>
</tbody></table></td>
<td><table width=100% cellspacing=0><tbody>
<tr>
<td width=63%><b>Quotation Date</b></td>
<td><script>date.str_to_user(doc.transaction_date)</script></td>
<tr>
</tbody></table></td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
<div class='common page-body'>
<!--
Page Body will contain
+ table 2
- Sales Invoice Data
-->
<script>si_std.print_item_table()</script>
</div>
<div class='common page-footer'>
<!--
Page Footer will contain
+ table 3
- Terms and Conditions
- Total Rounded Amount Calculation
- Total Rounded Amount in Words
-->
<table class='footer-table' width=100% cellspacing=0>
<thead>
</thead>
<tbody>
<tr>
<td width=60% style='padding-right: 10px;'>
<b>Terms, Conditions &amp; Other Information:</b><br />
<script>doc.terms</script>
</td>
<td>
<table cellspacing=0 width=100%><tbody>
<tr>
<td>Net Total</td>
<td></td>
<td width=38%><script>
fmt_money(doc.net_total/doc.conversion_rate)
</script></td>
</tr>
<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>
<tr>
<td>Grand Total</td>
<td></td>
<td><script>
fmt_money(doc.grand_total_export)
</script></td>
</tr>
<tr style='font-weight: bold'>
<td>Rounded Total</td>
<td><script>doc.currency</script></td>
<td><script>
fmt_money(doc.rounded_total_export)
</script></td>
</tr>
</tbody></table>
<br /><b>In Words</b><br />
<i><script>doc.in_words_export</script></i>
</td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>

View File

@@ -0,0 +1,283 @@
<!--
Sample Print Format for ERPNext
Please use at your own discretion
For suggestions and contributions:
https://github.com/webnotes/erpnext-print-templates
Freely usable under MIT license
-->
<!-- Style Settings -->
<style>
/*
common style for whole page
This should include:
+ page size related settings
+ font family settings
+ line spacing settings
*/
@media screen {
body {
width: 8.3in;
}
}
html, body, div, span, td {
font-family: "Helvetica", "Arial", sans-serif;
font-size: 12px;
}
body {
padding: 10px;
margin: auto;
font-size: 12px;
line-height: 150%;
}
.common {
font-family: "Helvetica", "Arial", sans-serif !important;
font-size: 12px;
padding: 10px 0px;
}
table {
border-collapse: collapse;
width: 100%;
vertical-align: top;
border-style: none !important;
}
table td {
padding: 2px 0px;
border-style: none !important;
}
table h1, h2, h3, h4, h5, h6 {
padding: 0px;
margin: 0px;
}
table.header-table td {
vertical-align: top;
}
table.header-table h1 {
text-transform: uppercase;
color: white;
font-size: 55px;
font-style: italic;
}
table.header-table thead tr:nth-child(1) div {
height: 24px;
background-color: #696969;
vertical-align: middle;
padding: 12px 0px 0px 0px;
width: 100%;
}
div.page-body table td:nth-child(6),
div.page-body table td:nth-child(7) {
text-align: right;
}
div.page-body table tr td {
background-color: #DCDCDC !important;
}
div.page-body table tr:nth-child(1) td {
background-color: #696969 !important;
color: white !important;
}
table.footer-table td {
vertical-align: top;
}
table.footer-table td table td:nth-child(2),
table.footer-table td table td:nth-child(3) {
text-align: right;
}
table.footer-table tfoot td {
background-color: #696969;
height: 10px;
}
.imp-details {
background-color: #DCDCDC;
}
</style>
<!-- Javascript -->
<script>
si_std = {
print_item_table: function() {
var table = print_table(
'Quotation',
doc.name,
'quotation_details',
'Quotation Detail',
[// Here specify the table columns to be displayed
'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',
'export_rate', 'export_amount'
],
[// Here specify the labels of column headings
'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',
'UoM', 'Basic Rate', 'Amount'
],
[// Here specify the column widths
'3%', '10%', '15%', '32%', '5%',
'5%', '15%', '15%'
]
);
// This code takes care of page breaks
if(table.appendChild) {
out = table.innerHTML;
} else {
out = '';
for(var i=0; i < (table.length-1); i++) {
out += table[i].innerHTML +
'<div style = "page-break-after: always;" \
class = "page_break"></div>\
<div class="page-settings"></div>';
}
out += table[table.length-1].innerHTML;
}
return out;
},
print_other_charges: function(parent) {
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) {
rows +=
'<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' +
'\t<td></td>\n' +
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n';
}
return rows + '</table>\n';
}
};
</script>
<!-- Page Layout Settings -->
<div class='common page-header'>
<!--
Page Header will contain
+ table 1
+ table 1a
- Name
- Address
- Contact
- Mobile No
+ table 1b
- Voucher Date
- Due Date
-->
<table class='header-table' cellspacing=0>
<thead>
<tr><td colspan=2><div><h1>Quotation</h1></div></td></tr>
<tr><td colspan=2><div style="height:15px"></div></td></tr>
</thead>
<tbody>
<tr>
<td width=60%><table width=100% cellspacing=0><tbody>
<tr>
<td width=39%><b>Name</b></td>
<td><script>doc.customer?doc.customer:doc.lead_name</script></td>
</tr>
<tr>
<td><b>Address</b></td>
<td><script>replace_newlines(doc.address_display)</script></td>
</tr>
<tr>
<td><b>Contact</b></td>
<td><script>doc.contact_display</script></td>
</tr>
</tbody></table></td>
<td><table width=100% cellspacing=0><tbody>
<tr class='imp-details'>
<td><b>Quotation No.</b></td>
<td><script>cur_frm.docname</script></td>
</tr>
<tr>
<td width=63%><b>Quotation Date</b></td>
<td><script>date.str_to_user(doc.transaction_date)</script></td>
<tr>
</tbody></table></td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
<div class='common page-body'>
<!--
Page Body will contain
+ table 2
- Sales Invoice Data
-->
<script>si_std.print_item_table()</script>
</div>
<div class='common page-footer'>
<!--
Page Footer will contain
+ table 3
- Terms and Conditions
- Total Rounded Amount Calculation
- Total Rounded Amount in Words
-->
<table class='footer-table' width=100% cellspacing=0>
<thead>
</thead>
<tbody>
<tr>
<td width=60% style='padding-right: 10px;'>
<b>Terms, Conditions &amp; Other Information:</b><br />
<script>doc.terms</script>
</td>
<td>
<table cellspacing=0 width=100%><tbody>
<tr>
<td>Net Total</td>
<td></td>
<td width=38%><script>
fmt_money(doc.net_total/doc.conversion_rate)
</script></td>
</tr>
<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>
<tr>
<td>Grand Total</td>
<td></td>
<td><script>
fmt_money(doc.grand_total_export)
</script></td>
</tr>
<tr style='font-weight: bold' class='imp-details'>
<td>Rounded Total</td>
<td><script>doc.currency</script></td>
<td><script>
fmt_money(doc.rounded_total_export)
</script></td>
</tr>
</tbody></table>
<br /><b>In Words</b><br />
<i><script>doc.in_words_export</script></i>
</td>
</tr>
</tbody>
<tfoot>
<tr><td colspan=2><div></div></td><tr>
</tfoot>
</table>
</div>

View File

@@ -0,0 +1,279 @@
<!--
Sample Print Format for ERPNext
Please use at your own discretion
For suggestions and contributions:
https://github.com/webnotes/erpnext-print-templates
Freely usable under MIT license
-->
<!-- Style Settings -->
<style>
/*
common style for whole page
This should include:
+ page size related settings
+ font family settings
+ line spacing settings
*/
@media screen {
body {
width: 8.3in;
}
}
html, body, div, span, td {
font-family: "Arial", sans-serif;
font-size: 12px;
}
body {
padding: 10px;
margin: auto;
font-size: 12px;
line-height: 150%;
}
.common {
font-family: "Arial", sans-serif !important;
font-size: 12px;
padding: 0px;
}
table {
width: 100% !important;
vertical-align: top;
}
table td {
padding: 2px 0px;
}
table, td {
border-collapse: collapse !important;
padding: 0px;
margin: 0px !important;
}
table h1, h2, h3, h4, h5, h6 {
padding: 0px;
margin: 0px;
}
table.header-table td {
vertical-align: top;
}
table.header-table h3 {
color: gray;
}
table.header-table thead td {
padding: 5px;
}
table.header-table > thead,
table.header-table > tbody > tr > td,
table.footer-table > tbody > tr > td {
border: 1px solid black;
padding: 5px;
}
table.footer-table > tbody,
table.header-table > thead {
border-bottom: 3px solid black;
}
table.header-table > thead {
border-top: 3px solid black;
}
div.page-body table td:nth-child(6),
div.page-body table td:nth-child(7) {
text-align: right;
}
div.page-body td {
background-color: white !important;
border: 1px solid black !important;
}
table.footer-table td {
vertical-align: top;
}
table.footer-table td table td:nth-child(2),
table.footer-table td table td:nth-child(3) {
text-align: right;
}
</style>
<!-- Javascript -->
<script>
si_std = {
print_item_table: function() {
var table = print_table(
'Quotation',
doc.name,
'quotation_details',
'Quotation Detail',
[// Here specify the table columns to be displayed
'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',
'export_rate', 'export_amount'
],
[// Here specify the labels of column headings
'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',
'UoM', 'Basic Rate', 'Amount'
],
[// Here specify the column widths
'3%', '10%', '15%', '32%', '5%',
'5%', '15%', '15%'
]
);
// This code takes care of page breaks
if(table.appendChild) {
out = table.innerHTML;
} else {
out = '';
for(var i=0; i < (table.length-1); i++) {
out += table[i].innerHTML +
'<div style = "page-break-after: always;" \
class = "page_break"></div>\
<div class="page-settings"></div>';
}
out += table[table.length-1].innerHTML;
}
return out;
},
print_other_charges: function(parent) {
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) {
rows +=
'<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' +
'\t<td></td>\n' +
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n';
}
return rows + '</table>\n';
}
};
</script>
<!-- Page Layout Settings -->
<div class='common page-header'>
<!--
Page Header will contain
+ table 1
+ table 1a
- Name
- Address
- Contact
- Mobile No
+ table 1b
- Voucher Date
- Due Date
-->
<table class='header-table' cellspacing=0>
<thead>
<tr><td colspan=2><h1>Quotation</h1></td></tr>
<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></td></tr>
</thead>
<tbody>
<tr>
<td width=60%><table width=100% cellspacing=0><tbody>
<tr>
<td width=39%><b>Name</b></td>
<td><script>doc.customer?doc.customer:doc.lead_name</script></td>
</tr>
<tr>
<td><b>Address</b></td>
<td><script>replace_newlines(doc.address_display)</script></td>
</tr>
<tr>
<td><b>Contact</b></td>
<td><script>doc.contact_display</script></td>
</tr>
</tbody></table></td>
<td><table width=100% cellspacing=0><tbody>
<tr>
<td width=63%><b>Quotation Date</b></td>
<td><script>date.str_to_user(doc.transaction_date)</script></td>
<tr>
</tbody></table></td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
<div class='common page-body'>
<!--
Page Body will contain
+ table 2
- Sales Invoice Data
-->
<script>si_std.print_item_table()</script>
</div>
<div class='common page-footer'>
<!--
Page Footer will contain
+ table 3
- Terms and Conditions
- Total Rounded Amount Calculation
- Total Rounded Amount in Words
-->
<table class='footer-table' width=100% cellspacing=0>
<thead>
</thead>
<tbody>
<tr>
<td width=60% style='padding-right: 10px;'>
<b>Terms, Conditions &amp; Other Information:</b><br />
<script>doc.terms</script>
</td>
<td>
<table cellspacing=0 width=100%><tbody>
<tr>
<td>Net Total</td>
<td></td>
<td width=38%><script>
fmt_money(doc.net_total/doc.conversion_rate)
</script></td>
</tr>
<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>
<tr>
<td>Grand Total</td>
<td></td>
<td><script>
fmt_money(doc.grand_total_export)
</script></td>
</tr>
<tr style='font-weight: bold'>
<td>Rounded Total</td>
<td><script>doc.currency</script></td>
<td><script>
fmt_money(doc.rounded_total_export)
</script></td>
</tr>
</tbody></table>
<br /><b>In Words</b><br />
<i><script>doc.in_words_export</script></i>
</td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>

View File

@@ -0,0 +1,261 @@
<!--
Sample Print Format for ERPNext
Please use at your own discretion
For suggestions and contributions:
https://github.com/webnotes/erpnext-print-templates
Freely usable under MIT license
-->
<!-- Style Settings -->
<style>
/*
common style for whole page
This should include:
+ page size related settings
+ font family settings
+ line spacing settings
*/
@media screen {
body {
width: 8.3in;
}
}
html, body, div, span, td {
font-family: "Georgia", serif;
font-size: 12px;
}
body {
padding: 10px;
margin: auto;
font-size: 12px;
line-height: 150%;
}
.common {
font-family: "Georgia", serif !important;
font-size: 12px;
padding: 10px 0px;
}
table {
border-collapse: collapse;
width: 100%;
vertical-align: top;
}
table td {
padding: 2px 0px;
}
table h1, h2, h3, h4, h5, h6 {
padding: 0px;
margin: 0px;
}
table.header-table td {
vertical-align: top;
}
table.header-table thead {
border-bottom: 1px solid black;
}
table.header-table h3 {
color: gray;
}
table.header-table thead td {
padding: 5px 0px;
}
div.page-body table td:nth-child(6),
div.page-body table td:nth-child(7) {
text-align: right;
}
table.footer-table td {
vertical-align: top;
}
table.footer-table td table td:nth-child(2),
table.footer-table td table td:nth-child(3) {
text-align: right;
}
</style>
<!-- Javascript -->
<script>
si_std = {
print_item_table: function() {
var table = print_table(
'Receivable Voucher',
doc.name,
'entries',
'RV Detail',
[// Here specify the table columns to be displayed
'SR', 'item_name', 'description', 'qty', 'stock_uom',
'export_rate', 'export_amount'
],
[// Here specify the labels of column headings
'Sr', 'Item Name', 'Description', 'Qty',
'UoM', 'Basic Rate', 'Amount'
],
[// Here specify the column widths
'3%', '20%', '37%', '5%',
'5%', '15%', '15%'
]
);
// This code takes care of page breaks
if(table.appendChild) {
out = table.innerHTML;
} else {
out = '';
for(var i=0; i < (table.length-1); i++) {
out += table[i].innerHTML +
'<div style = "page-break-after: always;" \
class = "page_break"></div>\
<div class="page-settings"></div>';
}
out += table[table.length-1].innerHTML;
}
return out;
},
print_other_charges: function(parent) {
console.log(parent);
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) {
rows +=
'<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' +
'\t<td></td>\n' +
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n';
}
return rows + '</table>\n';
}
};
</script>
<!-- Page Layout Settings -->
<div class='common page-header'>
<!--
Page Header will contain
+ table 1
+ table 1a
- Name
- Address
- Contact
- Mobile No
+ table 1b
- Voucher Date
- Due Date
-->
<table class='header-table' cellspacing=0>
<thead>
<tr><td><h1>Invoice</h1></td></tr>
<tr><td><h3><script>cur_frm.docname</script></h3></td></tr>
</thead>
<tbody>
<tr>
<td width=60%><table width=100% cellspacing=0><tbody>
<tr>
<td width=39%><b>Name</b></td>
<td><script>doc.customer_name</script></td>
</tr>
<tr>
<td><b>Address</b></td>
<td><script>replace_newlines(doc.address_display)</script></td>
</tr>
<tr>
<td><b>Contact</b></td>
<td><script>doc.contact_display</script></td>
</tr>
</tbody></table></td>
<td><table width=100% cellspacing=0><tbody>
<tr>
<td width=40%><b>Invoice Date</b></td>
<td><script>date.str_to_user(doc.voucher_date)</script></td>
<tr>
<tr>
<td><b>Due Date</b></td>
<td><script>date.str_to_user(doc.due_date)</script></td>
<tr>
</tbody></table></td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
<div class='common page-body'>
<!--
Page Body will contain
+ table 2
- Sales Invoice Data
-->
<script>si_std.print_item_table()</script>
</div>
<div class='common page-footer'>
<!--
Page Footer will contain
+ table 3
- Terms and Conditions
- Total Rounded Amount Calculation
- Total Rounded Amount in Words
-->
<table class='footer-table' width=100% cellspacing=0>
<thead>
</thead>
<tbody>
<tr>
<td width=60% style='padding-right: 10px;'>
<b>Terms, Conditions &amp; Other Information:</b><br />
<script>doc.terms</script>
</td>
<td>
<table cellspacing=0 width=100%><tbody>
<tr>
<td>Net Total</td>
<td></td>
<td width=38%><script>
fmt_money(doc.net_total/doc.conversion_rate)
</script></td>
</tr>
<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>
<tr>
<td>Grand Total</td>
<td></td>
<td><script>
fmt_money(doc.grand_total_export)
</script></td>
</tr>
<tr style='font-weight: bold'>
<td>Rounded Total</td>
<td><script>doc.currency</script></td>
<td><script>
fmt_money(doc.rounded_total_export)
</script></td>
</tr>
</tbody></table>
<br /><b>In Words</b><br />
<i><script>doc.in_words_export</script></i>
</td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>

View File

@@ -0,0 +1,288 @@
<!--
Sample Print Format for ERPNext
Please use at your own discretion
For suggestions and contributions:
https://github.com/webnotes/erpnext-print-templates
Freely usable under MIT license
-->
<!-- Style Settings -->
<style>
/*
common style for whole page
This should include:
+ page size related settings
+ font family settings
+ line spacing settings
*/
@media screen {
body {
width: 8.3in;
}
}
html, body, div, span, td {
font-family: "Helvetica", "Arial", sans-serif;
font-size: 12px;
}
body {
padding: 10px;
margin: auto;
font-size: 12px;
line-height: 150%;
}
.common {
font-family: "Helvetica", "Arial", sans-serif !important;
font-size: 12px;
padding: 10px 0px;
}
table {
border-collapse: collapse;
width: 100%;
vertical-align: top;
border-style: none !important;
}
table td {
padding: 2px 0px;
border-style: none !important;
}
table h1, h2, h3, h4, h5, h6 {
padding: 0px;
margin: 0px;
}
table.header-table td {
vertical-align: top;
}
table.header-table h1 {
text-transform: uppercase;
color: white;
font-size: 55px;
font-style: italic;
}
table.header-table thead tr:nth-child(1) div {
height: 24px;
background-color: #696969;
vertical-align: middle;
padding: 12px 0px 0px 0px;
width: 100%;
}
div.page-body table td:nth-child(6),
div.page-body table td:nth-child(7) {
text-align: right;
}
div.page-body table tr td {
background-color: #DCDCDC !important;
}
div.page-body table tr:nth-child(1) td {
background-color: #696969 !important;
color: white !important;
}
table.footer-table td {
vertical-align: top;
}
table.footer-table td table td:nth-child(2),
table.footer-table td table td:nth-child(3) {
text-align: right;
}
table.footer-table tfoot td {
background-color: #696969;
height: 10px;
}
.imp-details {
background-color: #DCDCDC;
}
</style>
<!-- Javascript -->
<script>
si_std = {
print_item_table: function() {
var table = print_table(
'Receivable Voucher',
doc.name,
'entries',
'RV Detail',
[// Here specify the table columns to be displayed
'SR', 'item_name', 'description', 'qty', 'stock_uom',
'export_rate', 'export_amount'
],
[// Here specify the labels of column headings
'Sr', 'Item Name', 'Description', 'Qty',
'UoM', 'Basic Rate', 'Amount'
],
[// Here specify the column widths
'3%', '20%', '37%', '5%',
'5%', '15%', '15%'
]
);
// This code takes care of page breaks
if(table.appendChild) {
out = table.innerHTML;
} else {
out = '';
for(var i=0; i < (table.length-1); i++) {
out += table[i].innerHTML +
'<div style = "page-break-after: always;" \
class = "page_break"></div>\
<div class="page-settings"></div>';
}
out += table[table.length-1].innerHTML;
}
return out;
},
print_other_charges: function(parent) {
console.log(parent);
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) {
rows +=
'<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' +
'\t<td></td>\n' +
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n';
}
return rows + '</table>\n';
}
};
</script>
<!-- Page Layout Settings -->
<div class='common page-header'>
<!--
Page Header will contain
+ table 1
+ table 1a
- Name
- Address
- Contact
- Mobile No
+ table 1b
- Voucher Date
- Due Date
-->
<table class='header-table' cellspacing=0>
<thead>
<tr><td colspan=2><div><h1>Invoice</h1></div></td></tr>
<tr><td colspan=2><div style="height:15px"></div></td></tr>
</thead>
<tbody>
<tr>
<td width=60%><table width=100% cellspacing=0><tbody>
<tr>
<td width=39%><b>Name</b></td>
<td><script>doc.customer_name</script></td>
</tr>
<tr>
<td><b>Address</b></td>
<td><script>replace_newlines(doc.address_display)</script></td>
</tr>
<tr>
<td><b>Contact</b></td>
<td><script>doc.contact_display</script></td>
</tr>
</tbody></table></td>
<td><table width=100% cellspacing=0><tbody>
<tr class='imp-details'>
<td><b>Invoice No.</b></td>
<td><script>cur_frm.docname</script></td>
</tr>
<tr>
<td width=40%><b>Invoice Date</b></td>
<td><script>date.str_to_user(doc.voucher_date)</script></td>
<tr>
<tr>
<td><b>Due Date</b></td>
<td><script>date.str_to_user(doc.due_date)</script></td>
<tr>
</tbody></table></td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
<div class='common page-body'>
<!--
Page Body will contain
+ table 2
- Sales Invoice Data
-->
<script>si_std.print_item_table()</script>
</div>
<div class='common page-footer'>
<!--
Page Footer will contain
+ table 3
- Terms and Conditions
- Total Rounded Amount Calculation
- Total Rounded Amount in Words
-->
<table class='footer-table' width=100% cellspacing=0>
<thead>
</thead>
<tbody>
<tr>
<td width=60% style='padding-right: 10px;'>
<b>Terms, Conditions &amp; Other Information:</b><br />
<script>doc.terms</script>
</td>
<td>
<table cellspacing=0 width=100%><tbody>
<tr>
<td>Net Total</td>
<td></td>
<td width=38%><script>
fmt_money(doc.net_total/doc.conversion_rate)
</script></td>
</tr>
<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>
<tr>
<td>Grand Total</td>
<td></td>
<td><script>
fmt_money(doc.grand_total_export)
</script></td>
</tr>
<tr style='font-weight: bold' class='imp-details'>
<td>Rounded Total</td>
<td><script>doc.currency</script></td>
<td><script>
fmt_money(doc.rounded_total_export)
</script></td>
</tr>
</tbody></table>
<br /><b>In Words</b><br />
<i><script>doc.in_words_export</script></i>
</td>
</tr>
</tbody>
<tfoot>
<tr><td colspan=2><div></div></td><tr>
</tfoot>
</table>
</div>

View File

@@ -0,0 +1,284 @@
<!--
Sample Print Format for ERPNext
Please use at your own discretion
For suggestions and contributions:
https://github.com/webnotes/erpnext-print-templates
Freely usable under MIT license
-->
<!-- Style Settings -->
<style>
/*
common style for whole page
This should include:
+ page size related settings
+ font family settings
+ line spacing settings
*/
@media screen {
body {
width: 8.3in;
}
}
html, body, div, span, td {
font-family: "Arial", sans-serif;
font-size: 12px;
}
body {
padding: 10px;
margin: auto;
font-size: 12px;
line-height: 150%;
}
.common {
font-family: "Arial", sans-serif !important;
font-size: 12px;
padding: 0px;
}
table {
width: 100% !important;
vertical-align: top;
}
table td {
padding: 2px 0px;
}
table, td {
border-collapse: collapse !important;
padding: 0px;
margin: 0px !important;
}
table h1, h2, h3, h4, h5, h6 {
padding: 0px;
margin: 0px;
}
table.header-table td {
vertical-align: top;
}
table.header-table h3 {
color: gray;
}
table.header-table thead td {
padding: 5px;
}
table.header-table > thead,
table.header-table > tbody > tr > td,
table.footer-table > tbody > tr > td {
border: 1px solid black;
padding: 5px;
}
table.footer-table > tbody,
table.header-table > thead {
border-bottom: 3px solid black;
}
table.header-table > thead {
border-top: 3px solid black;
}
div.page-body table td:nth-child(6),
div.page-body table td:nth-child(7) {
text-align: right;
}
div.page-body td {
background-color: white !important;
border: 1px solid black !important;
}
table.footer-table td {
vertical-align: top;
}
table.footer-table td table td:nth-child(2),
table.footer-table td table td:nth-child(3) {
text-align: right;
}
</style>
<!-- Javascript -->
<script>
si_std = {
print_item_table: function() {
var table = print_table(
'Receivable Voucher',
doc.name,
'entries',
'RV Detail',
[// Here specify the table columns to be displayed
'SR', 'item_name', 'description', 'qty', 'stock_uom',
'export_rate', 'export_amount'
],
[// Here specify the labels of column headings
'Sr', 'Item Name', 'Description', 'Qty',
'UoM', 'Basic Rate', 'Amount'
],
[// Here specify the column widths
'3%', '20%', '37%', '5%',
'5%', '15%', '15%'
]
);
// This code takes care of page breaks
if(table.appendChild) {
out = table.innerHTML;
} else {
out = '';
for(var i=0; i < (table.length-1); i++) {
out += table[i].innerHTML +
'<div style = "page-break-after: always;" \
class = "page_break"></div>\
<div class="page-settings"></div>';
}
out += table[table.length-1].innerHTML;
}
return out;
},
print_other_charges: function(parent) {
console.log(parent);
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) {
rows +=
'<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' +
'\t<td></td>\n' +
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n';
}
return rows + '</table>\n';
}
};
</script>
<!-- Page Layout Settings -->
<div class='common page-header'>
<!--
Page Header will contain
+ table 1
+ table 1a
- Name
- Address
- Contact
- Mobile No
+ table 1b
- Voucher Date
- Due Date
-->
<table class='header-table' cellspacing=0>
<thead>
<tr><td colspan=2><h1>Invoice</h1></td></tr>
<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></td></tr>
</thead>
<tbody>
<tr>
<td width=60%><table width=100% cellspacing=0><tbody>
<tr>
<td width=39%><b>Name</b></td>
<td><script>doc.customer_name</script></td>
</tr>
<tr>
<td><b>Address</b></td>
<td><script>replace_newlines(doc.address_display)</script></td>
</tr>
<tr>
<td><b>Contact</b></td>
<td><script>doc.contact_display</script></td>
</tr>
</tbody></table></td>
<td><table width=100% cellspacing=0><tbody>
<tr>
<td width=40%><b>Invoice Date</b></td>
<td><script>date.str_to_user(doc.voucher_date)</script></td>
<tr>
<tr>
<td><b>Due Date</b></td>
<td><script>date.str_to_user(doc.due_date)</script></td>
<tr>
</tbody></table></td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
<div class='common page-body'>
<!--
Page Body will contain
+ table 2
- Sales Invoice Data
-->
<script>si_std.print_item_table()</script>
</div>
<div class='common page-footer'>
<!--
Page Footer will contain
+ table 3
- Terms and Conditions
- Total Rounded Amount Calculation
- Total Rounded Amount in Words
-->
<table class='footer-table' width=100% cellspacing=0>
<thead>
</thead>
<tbody>
<tr>
<td width=60% style='padding-right: 10px;'>
<b>Terms, Conditions &amp; Other Information:</b><br />
<script>doc.terms</script>
</td>
<td>
<table cellspacing=0 width=100%><tbody>
<tr>
<td>Net Total</td>
<td></td>
<td width=38%><script>
fmt_money(doc.net_total/doc.conversion_rate)
</script></td>
</tr>
<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>
<tr>
<td>Grand Total</td>
<td></td>
<td><script>
fmt_money(doc.grand_total_export)
</script></td>
</tr>
<tr style='font-weight: bold'>
<td>Rounded Total</td>
<td><script>doc.currency</script></td>
<td><script>
fmt_money(doc.rounded_total_export)
</script></td>
</tr>
</tbody></table>
<br /><b>In Words</b><br />
<i><script>doc.in_words_export</script></i>
</td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>

View File

@@ -0,0 +1,260 @@
<!--
Sample Print Format for ERPNext
Please use at your own discretion
For suggestions and contributions:
https://github.com/webnotes/erpnext-print-templates
Freely usable under MIT license
-->
<!-- Style Settings -->
<style>
/*
common style for whole page
This should include:
+ page size related settings
+ font family settings
+ line spacing settings
*/
@media screen {
body {
width: 8.3in;
}
}
html, body, div, span, td {
font-family: "Georgia", serif;
font-size: 12px;
}
body {
padding: 10px;
margin: auto;
font-size: 12px;
line-height: 150%;
}
.common {
font-family: "Georgia", serif !important;
font-size: 12px;
padding: 10px 0px;
}
table {
border-collapse: collapse;
width: 100%;
vertical-align: top;
}
table td {
padding: 2px 0px;
}
table h1, h2, h3, h4, h5, h6 {
padding: 0px;
margin: 0px;
}
table.header-table td {
vertical-align: top;
}
table.header-table thead {
border-bottom: 1px solid black;
}
table.header-table h3 {
color: gray;
}
table.header-table thead td {
padding: 5px 0px;
}
div.page-body table td:nth-child(6),
div.page-body table td:nth-child(7) {
text-align: right;
}
table.footer-table td {
vertical-align: top;
}
table.footer-table td table td:nth-child(2),
table.footer-table td table td:nth-child(3) {
text-align: right;
}
</style>
<!-- Javascript -->
<script>
si_std = {
print_item_table: function() {
var table = print_table(
'Sales Order',
doc.name,
'sales_order_details',
'Sales Order Detail',
[// Here specify the table columns to be displayed
'SR', 'item_code', 'description', 'qty', 'stock_uom',
'basic_rate', 'amount'
],
[// Here specify the labels of column headings
'Sr', 'Item Code', 'Description', 'Qty',
'UoM', 'Basic Rate', 'Amount'
],
[// Here specify the column widths
'3%', '20%', '37%', '5%',
'5%', '15%', '15%'
]
);
// This code takes care of page breaks
if(table.appendChild) {
out = table.innerHTML;
} else {
out = '';
for(var i=0; i < (table.length-1); i++) {
out += table[i].innerHTML +
'<div style = "page-break-after: always;" \
class = "page_break"></div>\
<div class="page-settings"></div>';
}
out += table[table.length-1].innerHTML;
}
return out;
},
print_other_charges: function(parent) {
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) {
rows +=
'<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' +
'\t<td></td>\n' +
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n';
}
return rows + '</table>\n';
}
};
</script>
<!-- Page Layout Settings -->
<div class='common page-header'>
<!--
Page Header will contain
+ table 1
+ table 1a
- Name
- Address
- Contact
- Mobile No
+ table 1b
- Voucher Date
- Due Date
-->
<table class='header-table' cellspacing=0>
<thead>
<tr><td><h1>Sales Order</h1></td></tr>
<tr><td><h3><script>cur_frm.docname</script></h3></td></tr>
</thead>
<tbody>
<tr>
<td width=60%><table width=100% cellspacing=0><tbody>
<tr>
<td width=39%><b>Name</b></td>
<td><script>doc.customer_name</script></td>
</tr>
<tr>
<td><b>Address</b></td>
<td><script>replace_newlines(doc.address_display)</script></td>
</tr>
<tr>
<td><b>Contact</b></td>
<td><script>doc.contact_display</script></td>
</tr>
</tbody></table></td>
<td><table width=100% cellspacing=0><tbody>
<tr>
<td width=63%><b>Sales Order Date</b></td>
<td><script>date.str_to_user(doc.transaction_date)</script></td>
<tr>
<tr>
<td><b>Delivery Date</b></td>
<td><script>date.str_to_user(doc.delivery_date)</script></td>
<tr>
</tbody></table></td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
<div class='common page-body'>
<!--
Page Body will contain
+ table 2
- Sales Invoice Data
-->
<script>si_std.print_item_table()</script>
</div>
<div class='common page-footer'>
<!--
Page Footer will contain
+ table 3
- Terms and Conditions
- Total Rounded Amount Calculation
- Total Rounded Amount in Words
-->
<table class='footer-table' width=100% cellspacing=0>
<thead>
</thead>
<tbody>
<tr>
<td width=60% style='padding-right: 10px;'>
<b>Terms, Conditions &amp; Other Information:</b><br />
<script>doc.terms</script>
</td>
<td>
<table cellspacing=0 width=100%><tbody>
<tr>
<td>Net Total</td>
<td></td>
<td width=38%><script>
fmt_money(doc.net_total)
</script></td>
</tr>
<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>
<tr>
<td>Grand Total</td>
<td></td>
<td><script>
fmt_money(doc.grand_total_export)
</script></td>
</tr>
<tr style='font-weight: bold'>
<td>Rounded Total</td>
<td><script>doc.currency</script></td>
<td><script>
fmt_money(doc.rounded_total_export)
</script></td>
</tr>
</tbody></table>
<br /><b>In Words</b><br />
<i><script>doc.in_words_export</script></i>
</td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>

View File

@@ -0,0 +1,287 @@
<!--
Sample Print Format for ERPNext
Please use at your own discretion
For suggestions and contributions:
https://github.com/webnotes/erpnext-print-templates
Freely usable under MIT license
-->
<!-- Style Settings -->
<style>
/*
common style for whole page
This should include:
+ page size related settings
+ font family settings
+ line spacing settings
*/
@media screen {
body {
width: 8.3in;
}
}
html, body, div, span, td {
font-family: "Helvetica", "Arial", sans-serif;
font-size: 12px;
}
body {
padding: 10px;
margin: auto;
font-size: 12px;
line-height: 150%;
}
.common {
font-family: "Helvetica", "Arial", sans-serif !important;
font-size: 12px;
padding: 10px 0px;
}
table {
border-collapse: collapse;
width: 100%;
vertical-align: top;
border-style: none !important;
}
table td {
padding: 2px 0px;
border-style: none !important;
}
table h1, h2, h3, h4, h5, h6 {
padding: 0px;
margin: 0px;
}
table.header-table td {
vertical-align: top;
}
table.header-table h1 {
text-transform: uppercase;
color: white;
font-size: 55px;
font-style: italic;
}
table.header-table thead tr:nth-child(1) div {
height: 24px;
background-color: #696969;
vertical-align: middle;
padding: 12px 0px 0px 0px;
width: 100%;
}
div.page-body table td:nth-child(6),
div.page-body table td:nth-child(7) {
text-align: right;
}
div.page-body table tr td {
background-color: #DCDCDC !important;
}
div.page-body table tr:nth-child(1) td {
background-color: #696969 !important;
color: white !important;
}
table.footer-table td {
vertical-align: top;
}
table.footer-table td table td:nth-child(2),
table.footer-table td table td:nth-child(3) {
text-align: right;
}
table.footer-table tfoot td {
background-color: #696969;
height: 10px;
}
.imp-details {
background-color: #DCDCDC;
}
</style>
<!-- Javascript -->
<script>
si_std = {
print_item_table: function() {
var table = print_table(
'Sales Order',
doc.name,
'sales_order_details',
'Sales Order Detail',
[// Here specify the table columns to be displayed
'SR', 'item_code', 'description', 'qty', 'stock_uom',
'basic_rate', 'amount'
],
[// Here specify the labels of column headings
'Sr', 'Item Code', 'Description', 'Qty',
'UoM', 'Basic Rate', 'Amount'
],
[// Here specify the column widths
'3%', '20%', '37%', '5%',
'5%', '15%', '15%'
]
);
// This code takes care of page breaks
if(table.appendChild) {
out = table.innerHTML;
} else {
out = '';
for(var i=0; i < (table.length-1); i++) {
out += table[i].innerHTML +
'<div style = "page-break-after: always;" \
class = "page_break"></div>\
<div class="page-settings"></div>';
}
out += table[table.length-1].innerHTML;
}
return out;
},
print_other_charges: function(parent) {
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) {
rows +=
'<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' +
'\t<td></td>\n' +
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n';
}
return rows + '</table>\n';
}
};
</script>
<!-- Page Layout Settings -->
<div class='common page-header'>
<!--
Page Header will contain
+ table 1
+ table 1a
- Name
- Address
- Contact
- Mobile No
+ table 1b
- Voucher Date
- Due Date
-->
<table class='header-table' cellspacing=0>
<thead>
<tr><td colspan=2><div><h1>Sales Order</h1></div></td></tr>
<tr><td colspan=2><div style="height:15px"></div></td></tr>
</thead>
<tbody>
<tr>
<td width=60%><table width=100% cellspacing=0><tbody>
<tr>
<td width=39%><b>Name</b></td>
<td><script>doc.customer_name</script></td>
</tr>
<tr>
<td><b>Address</b></td>
<td><script>replace_newlines(doc.address_display)</script></td>
</tr>
<tr>
<td><b>Contact</b></td>
<td><script>doc.contact_display</script></td>
</tr>
</tbody></table></td>
<td><table width=100% cellspacing=0><tbody>
<tr class='imp-details'>
<td><b>Sales Order No.</b></td>
<td><script>cur_frm.docname</script></td>
</tr>
<tr>
<td width=63%><b>Sales Order Date</b></td>
<td><script>date.str_to_user(doc.transaction_date)</script></td>
<tr>
<tr>
<td><b>Delivery Date</b></td>
<td><script>date.str_to_user(doc.delivery_date)</script></td>
<tr>
</tbody></table></td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
<div class='common page-body'>
<!--
Page Body will contain
+ table 2
- Sales Invoice Data
-->
<script>si_std.print_item_table()</script>
</div>
<div class='common page-footer'>
<!--
Page Footer will contain
+ table 3
- Terms and Conditions
- Total Rounded Amount Calculation
- Total Rounded Amount in Words
-->
<table class='footer-table' width=100% cellspacing=0>
<thead>
</thead>
<tbody>
<tr>
<td width=60% style='padding-right: 10px;'>
<b>Terms, Conditions &amp; Other Information:</b><br />
<script>doc.terms</script>
</td>
<td>
<table cellspacing=0 width=100%><tbody>
<tr>
<td>Net Total</td>
<td></td>
<td width=38%><script>
fmt_money(doc.net_total)
</script></td>
</tr>
<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>
<tr>
<td>Grand Total</td>
<td></td>
<td><script>
fmt_money(doc.grand_total_export)
</script></td>
</tr>
<tr style='font-weight: bold' class='imp-details'>
<td>Rounded Total</td>
<td><script>doc.currency</script></td>
<td><script>
fmt_money(doc.rounded_total_export)
</script></td>
</tr>
</tbody></table>
<br /><b>In Words</b><br />
<i><script>doc.in_words_export</script></i>
</td>
</tr>
</tbody>
<tfoot>
<tr><td colspan=2><div></div></td><tr>
</tfoot>
</table>
</div>

View File

@@ -0,0 +1,283 @@
<!--
Sample Print Format for ERPNext
Please use at your own discretion
For suggestions and contributions:
https://github.com/webnotes/erpnext-print-templates
Freely usable under MIT license
-->
<!-- Style Settings -->
<style>
/*
common style for whole page
This should include:
+ page size related settings
+ font family settings
+ line spacing settings
*/
@media screen {
body {
width: 8.3in;
}
}
html, body, div, span, td {
font-family: "Arial", sans-serif;
font-size: 12px;
}
body {
padding: 10px;
margin: auto;
font-size: 12px;
line-height: 150%;
}
.common {
font-family: "Arial", sans-serif !important;
font-size: 12px;
padding: 0px;
}
table {
width: 100% !important;
vertical-align: top;
}
table td {
padding: 2px 0px;
}
table, td {
border-collapse: collapse !important;
padding: 0px;
margin: 0px !important;
}
table h1, h2, h3, h4, h5, h6 {
padding: 0px;
margin: 0px;
}
table.header-table td {
vertical-align: top;
}
table.header-table h3 {
color: gray;
}
table.header-table thead td {
padding: 5px;
}
table.header-table > thead,
table.header-table > tbody > tr > td,
table.footer-table > tbody > tr > td {
border: 1px solid black;
padding: 5px;
}
table.footer-table > tbody,
table.header-table > thead {
border-bottom: 3px solid black;
}
table.header-table > thead {
border-top: 3px solid black;
}
div.page-body table td:nth-child(6),
div.page-body table td:nth-child(7) {
text-align: right;
}
div.page-body td {
background-color: white !important;
border: 1px solid black !important;
}
table.footer-table td {
vertical-align: top;
}
table.footer-table td table td:nth-child(2),
table.footer-table td table td:nth-child(3) {
text-align: right;
}
</style>
<!-- Javascript -->
<script>
si_std = {
print_item_table: function() {
var table = print_table(
'Sales Order',
doc.name,
'sales_order_details',
'Sales Order Detail',
[// Here specify the table columns to be displayed
'SR', 'item_code', 'description', 'qty', 'stock_uom',
'basic_rate', 'amount'
],
[// Here specify the labels of column headings
'Sr', 'Item Code', 'Description', 'Qty',
'UoM', 'Basic Rate', 'Amount'
],
[// Here specify the column widths
'3%', '20%', '37%', '5%',
'5%', '15%', '15%'
]
);
// This code takes care of page breaks
if(table.appendChild) {
out = table.innerHTML;
} else {
out = '';
for(var i=0; i < (table.length-1); i++) {
out += table[i].innerHTML +
'<div style = "page-break-after: always;" \
class = "page_break"></div>\
<div class="page-settings"></div>';
}
out += table[table.length-1].innerHTML;
}
return out;
},
print_other_charges: function(parent) {
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) {
rows +=
'<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' +
'\t<td></td>\n' +
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n';
}
return rows + '</table>\n';
}
};
</script>
<!-- Page Layout Settings -->
<div class='common page-header'>
<!--
Page Header will contain
+ table 1
+ table 1a
- Name
- Address
- Contact
- Mobile No
+ table 1b
- Voucher Date
- Due Date
-->
<table class='header-table' cellspacing=0>
<thead>
<tr><td colspan=2><h1>Sales Order</h1></td></tr>
<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></td></tr>
</thead>
<tbody>
<tr>
<td width=60%><table width=100% cellspacing=0><tbody>
<tr>
<td width=39%><b>Name</b></td>
<td><script>doc.customer_name</script></td>
</tr>
<tr>
<td><b>Address</b></td>
<td><script>replace_newlines(doc.address_display)</script></td>
</tr>
<tr>
<td><b>Contact</b></td>
<td><script>doc.contact_display</script></td>
</tr>
</tbody></table></td>
<td><table width=100% cellspacing=0><tbody>
<tr>
<td width=63%><b>Sales Order Date</b></td>
<td><script>date.str_to_user(doc.transaction_date)</script></td>
<tr>
<tr>
<td><b>Delivery Date</b></td>
<td><script>date.str_to_user(doc.delivery_date)</script></td>
<tr>
</tbody></table></td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
<div class='common page-body'>
<!--
Page Body will contain
+ table 2
- Sales Invoice Data
-->
<script>si_std.print_item_table()</script>
</div>
<div class='common page-footer'>
<!--
Page Footer will contain
+ table 3
- Terms and Conditions
- Total Rounded Amount Calculation
- Total Rounded Amount in Words
-->
<table class='footer-table' width=100% cellspacing=0>
<thead>
</thead>
<tbody>
<tr>
<td width=60% style='padding-right: 10px;'>
<b>Terms, Conditions &amp; Other Information:</b><br />
<script>doc.terms</script>
</td>
<td>
<table cellspacing=0 width=100%><tbody>
<tr>
<td>Net Total</td>
<td></td>
<td width=38%><script>
fmt_money(doc.net_total)
</script></td>
</tr>
<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>
<tr>
<td>Grand Total</td>
<td></td>
<td><script>
fmt_money(doc.grand_total_export)
</script></td>
</tr>
<tr style='font-weight: bold'>
<td>Rounded Total</td>
<td><script>doc.currency</script></td>
<td><script>
fmt_money(doc.rounded_total_export)
</script></td>
</tr>
</tbody></table>
<br /><b>In Words</b><br />
<i><script>doc.in_words_export</script></i>
</td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>

View File

@@ -0,0 +1,18 @@
def execute():
import webnotes
from webnotes.modules.module_manager import reload_doc
sql = webnotes.conn.sql
# Reload item table
reload_doc('accounts', 'doctype', 'pv_detail')
reload_doc('buying', 'doctype', 'po_detail')
reload_doc('stock', 'doctype', 'purchase_receipt_detail')
# copy project value from parent to child
sql("update `tabPO Detail` t1, `tabPurchase Order` t2 set t1.project_name = t2.project_name where t1.parent = t2.name and ifnull(t1.project_name, '') = ''")
sql("update `tabPV Detail` t1, `tabPayable Voucher` t2 set t1.project_name = t2.project_name where t1.parent = t2.name and ifnull(t1.project_name, '') = ''")
sql("update `tabPurchase Receipt Detail` t1, `tabPurchase Receipt` t2 set t1.project_name = t2.project_name where t1.parent = t2.name and ifnull(t1.project_name, '') = ''")
# delete project from parent
sql("delete from `tabDocField` where fieldname = 'project_name' and parent in ('Purchase Order', 'Purchase Receipt', 'Payable Voucher')")

View File

@@ -0,0 +1,5 @@
def execute():
import webnotes
from webnotes.modules.module_manager import reload_doc
reload_doc('production', 'doctype', 'bill_of_materials')

View File

@@ -0,0 +1,6 @@
def execute():
from webnotes.modules import webnotes
from webnotes.modules.module_manager import reload_doc
reload_doc('production', 'doctype', 'flat_bom_detail')
reload_doc('production', 'doctype', 'bom_material')

View File

@@ -0,0 +1,9 @@
def execute():
import webnotes
from webnotes.modules.module_manager import reload_doc
from webnotes.model import delete_doc
delete_doc('DocType', 'Landed Cost Wizard')
delete_doc('DocType', 'LC PR Detail')
reload_doc('stock', 'doctype', 'landed_cost_wizard')
reload_doc('stock', 'doctype', 'lc_pr_detail')

View File

@@ -0,0 +1,17 @@
def execute():
import webnotes
from webnotes.modules.module_manager import reload_doc
from webnotes.model.doc import addchild
from webnotes.model.code import get_obj
reload_doc('stock', 'Print Format', 'Delivery Note Packing List Wise')
reload_doc('stock', 'Print Format', 'Purchase Receipt Format')
reload_doc('accounts', 'Print Format', 'Payment Receipt Voucher')
reload_doc('accounts', 'Print Format', 'POS Invoice')
reload_doc('accounts', 'Print Format', 'Form 16A Print Format')
reload_doc('accounts', 'Print Format', 'Cheque Printing Format')
if not webnotes.conn.sql("select format from `tabDocFormat` where name = 'POS Invoice' and parent = 'Receivable Voucher'"):
dt_obj = get_obj('DocType', 'Receivable Voucher', with_children = 1)
ch = addchild(dt_obj.doc, 'formats', 'DocFormat', 1)
ch.format = 'POS Invoice'
ch.save(1)

View File

@@ -0,0 +1,31 @@
def execute():
import webnotes
sql = webnotes.conn.sql
from webnotes.model.code import get_obj
# stop session
webnotes.conn.set_global('__session_status', 'stop')
webnotes.conn.set_global('__session_status_message', 'Patch is running in background. \nPlease wait until it completed...\n')
webnotes.conn.commit()
webnotes.conn.begin()
# repost
comp = sql("select name from tabCompany where docstatus!=2")
fy = sql("select name from `tabFiscal Year` order by year_start_date asc")
for c in comp:
prev_fy = ''
for f in fy:
fy_obj = get_obj('Fiscal Year', f[0])
fy_obj.doc.past_year = prev_fy
fy_obj.doc.company = c[0]
fy_obj.doc.save()
fy_obj.repost()
prev_fy = f[0]
sql("commit")
sql("start transaction")
# free session
webnotes.conn.set_global('__session_status', '')
webnotes.conn.set_global('__session_status_message', '')

View File

@@ -0,0 +1,8 @@
def execute():
import webnotes
from webnotes.modules.module_manager import reload_doc
sql = webnotes.conn.sql
reload_doc('hr', 'doctype', 'salary_manager')
sql("delete from `tabDocField` where parent = 'Salary Manager' and fieldname = 'employment_type'")

View File

@@ -32,9 +32,10 @@ class DocType:
#----------- Client Trigger function ---------- #----------- Client Trigger function ----------
def get_item_detail(self, item_code): def get_item_detail(self, item_code):
item = sql("select description from `tabItem` where (ifnull(end_of_life,'')='' or end_of_life = '0000-00-00' or end_of_life > now()) and name = %s",item_code , as_dict =1) item = sql("select description, stock_uom from `tabItem` where (ifnull(end_of_life,'')='' or end_of_life = '0000-00-00' or end_of_life > now()) and name = %s",item_code , as_dict =1)
ret={ ret={
'description' : item and item[0]['description'] or '' 'description' : item and item[0]['description'] or '',
'uom' : item and item[0]['stock_uom'] or ''
} }
return ret return ret
@@ -411,8 +412,8 @@ class DocType:
if val_method == 'FIFO': if val_method == 'FIFO':
if warehouse: if warehouse:
bin_obj = get_obj('Warehouse',warehouse).get_bin(item_code) bin_obj = get_obj('Warehouse',warehouse).get_bin(item_code)
prev_sle = bin_obj.get_prev_sle('',nowdate(), (now().split(' ')[1])[:-3]) prev_sle = bin_obj.get_prev_sle(nowdate(), (now().split(' ')[1])[:-3])
fcfs_stack = prev_sle and (prev_sle[0][3] and eval(prev_sle[0][3]) or []) or [] fcfs_stack = prev_sle and prev_sle['fcfs_stack'] and eval(prev_sle['fcfs_stack']) or []
else: else:
prev_sle = sql("select fcfs_stack from `tabStock Ledger Entry` where item_code = '%s' and posting_date <= '%s' order by posting_date DESC, posting_time DESC, name DESC limit 1" % (item_code, nowdate())) prev_sle = sql("select fcfs_stack from `tabStock Ledger Entry` where item_code = '%s' and posting_date <= '%s' order by posting_date DESC, posting_time DESC, name DESC limit 1" % (item_code, nowdate()))
fcfs_stack = prev_sle and (prev_sle[0][0] and eval(prev_sle[0][0]) or []) or [] fcfs_stack = prev_sle and (prev_sle[0][0] and eval(prev_sle[0][0]) or []) or []
@@ -499,20 +500,11 @@ class DocType:
def get_child_flat_bom_items(self, item, d): def get_child_flat_bom_items(self, item, d):
child_flat_bom_items=[] child_flat_bom_items=[]
# if item and (item[0]['is_sub_contracted_item'] == 'Yes' or item[0]['is_pro_applicable'] == 'Yes'):
child_flat_bom_items = sql("select item_code, description, qty_consumed_per_unit, stock_uom, moving_avg_rate, last_purchase_rate, standard_rate, '%s' as parent_bom, bom_mat_no, 'No' as is_pro_applicable from `tabFlat BOM Detail` where parent = '%s' and is_pro_applicable = 'No' and docstatus = 1" % ( d.bom_no, cstr(d.bom_no))) child_flat_bom_items = sql("select fbom.item_code, fbom.description, fbom.qty_consumed_per_unit, fbom.stock_uom, fbom.moving_avg_rate, fbom.last_purchase_rate, fbom.standard_rate, '%s' as parent_bom, fbom.bom_mat_no, 'No' as is_pro_applicable from `tabFlat BOM Detail` fbom,`tabBill Of Materials` bom where fbom.parent=bom.name and fbom.parent = '%s' and fbom.is_pro_applicable = 'No' and bom.docstatus = 1" % ( d.bom_no, cstr(d.bom_no)))
self.cur_flat_bom_items.append([d.item_code, d.description, flt(d.qty), d.stock_uom, flt(d.moving_avg_rate), flt(d.amount_as_per_mar), flt(d.last_purchase_rate), flt(d.amount_as_per_lpr), flt(d.standard_rate), flt(d.amount_as_per_sr), flt(d.qty_consumed_per_unit), (item[0]['is_sub_contracted_item'] == 'Yes') and d.parent or d.bom_no, d.name, (item[0]['is_sub_contracted_item'] == 'Yes') and 'No' or 'Yes']) self.cur_flat_bom_items.append([d.item_code, d.description, flt(d.qty), d.stock_uom, flt(d.moving_avg_rate), flt(d.amount_as_per_mar), flt(d.last_purchase_rate), flt(d.amount_as_per_lpr), flt(d.standard_rate), flt(d.amount_as_per_sr), flt(d.qty_consumed_per_unit), (item[0]['is_sub_contracted_item'] == 'Yes') and d.parent or d.bom_no, d.name, (item[0]['is_sub_contracted_item'] == 'Yes') and 'No' or 'Yes'])
return child_flat_bom_items return child_flat_bom_items
# else:
# child_flat_bom_items = sql("select item_code, description, qty_consumed_per_unit, stock_uom, moving_avg_rate, last_purchase_rate, standard_rate, if(parent_bom = '%s', '%s', parent_bom) as parent_bom, bom_mat_no, is_pro_applicable from `tabFlat BOM Detail` where parent = '%s' and docstatus = 1" % ( d.bom_no, d.parent, cstr(d.bom_no)))
# if not child_flat_bom_items:
# msgprint("Please Submit Child BOM := %s first." % cstr(d.bom_no))
# raise Exception
# else:"""
# Get Current Flat BOM Items # Get Current Flat BOM Items
# ----------------------------- # -----------------------------

View File

@@ -5,14 +5,14 @@
{ {
'creation': '2010-08-08 17:08:52', 'creation': '2010-08-08 17:08:52',
'docstatus': 0, 'docstatus': 0,
'modified': '2010-12-20 17:27:58', 'modified': '2011-11-09 12:47:50',
'modified_by': 'umair@iwebnotes.com', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
# These values are common for all DocType # These values are common for all DocType
{ {
'_last_update': '1309508837', '_last_update': '1319016431',
'allow_attach': 0, 'allow_attach': 0,
'allow_copy': 0, 'allow_copy': 0,
'allow_email': 0, 'allow_email': 0,
@@ -20,6 +20,7 @@
'allow_rename': 0, 'allow_rename': 0,
'allow_trash': 1, 'allow_trash': 1,
'colour': 'White:FFF', 'colour': 'White:FFF',
'default_print_format': 'Standard',
'doctype': 'DocType', 'doctype': 'DocType',
'document_type': 'Master', 'document_type': 'Master',
'hide_heading': 0, 'hide_heading': 0,
@@ -35,7 +36,7 @@
'server_code_error': ' ', 'server_code_error': ' ',
'show_in_menu': 0, 'show_in_menu': 0,
'subject': '%(item)s', 'subject': '%(item)s',
'version': 170 'version': 171
}, },
# These values are common for all DocField # These values are common for all DocField
@@ -49,6 +50,7 @@
# These values are common for all DocPerm # These values are common for all DocPerm
{ {
'amend': 0,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'name': '__common__', 'name': '__common__',
'parent': 'Bill Of Materials', 'parent': 'Bill Of Materials',
@@ -68,7 +70,6 @@
'cancel': 1, 'cancel': 1,
'create': 1, 'create': 1,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 1,
'permlevel': 0, 'permlevel': 0,
'role': 'System Manager', 'role': 'System Manager',
'submit': 1, 'submit': 1,
@@ -77,10 +78,13 @@
# DocPerm # DocPerm
{ {
'cancel': 0,
'create': 0,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 2,
'permlevel': 1, 'permlevel': 1,
'role': 'System Manager' 'role': 'System Manager',
'submit': 0,
'write': 0
}, },
# DocPerm # DocPerm
@@ -88,7 +92,6 @@
'cancel': 1, 'cancel': 1,
'create': 1, 'create': 1,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 3,
'permlevel': 0, 'permlevel': 0,
'role': 'Production Manager', 'role': 'Production Manager',
'submit': 1, 'submit': 1,
@@ -97,10 +100,13 @@
# DocPerm # DocPerm
{ {
'cancel': 0,
'create': 0,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 4,
'permlevel': 1, 'permlevel': 1,
'role': 'Production Manager' 'role': 'Production Manager',
'submit': 0,
'write': 0
}, },
# DocPerm # DocPerm
@@ -108,7 +114,6 @@
'cancel': 1, 'cancel': 1,
'create': 1, 'create': 1,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 5,
'permlevel': 0, 'permlevel': 0,
'role': 'Production User', 'role': 'Production User',
'submit': 1, 'submit': 1,
@@ -117,10 +122,13 @@
# DocPerm # DocPerm
{ {
'cancel': 0,
'create': 0,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 6,
'permlevel': 1, 'permlevel': 1,
'role': 'Production User' 'role': 'Production User',
'submit': 0,
'write': 0
}, },
# DocField # DocField
@@ -128,7 +136,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'trash_reason', 'fieldname': 'trash_reason',
'fieldtype': 'Small Text', 'fieldtype': 'Small Text',
'idx': 1,
'label': 'Trash Reason', 'label': 'Trash Reason',
'oldfieldname': 'trash_reason', 'oldfieldname': 'trash_reason',
'oldfieldtype': 'Small Text', 'oldfieldtype': 'Small Text',
@@ -139,7 +146,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'HTML', 'fieldtype': 'HTML',
'idx': 2,
'label': 'TreeView1', 'label': 'TreeView1',
'oldfieldtype': 'HTML', 'oldfieldtype': 'HTML',
'options': '<div style=\'border: 1px solid #CCF; padding: 8px;margin-bottom: 8px;\'><div class=\'link_type\' onclick=\'loadpage("Bill of Materials"); \'>Go To BOM Tree View</div></div>', 'options': '<div style=\'border: 1px solid #CCF; padding: 8px;margin-bottom: 8px;\'><div class=\'link_type\' onclick=\'loadpage("Bill of Materials"); \'>Go To BOM Tree View</div></div>',
@@ -150,7 +156,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'idx': 3,
'oldfieldtype': 'Section Break', 'oldfieldtype': 'Section Break',
'options': 'Simple', 'options': 'Simple',
'permlevel': 0 'permlevel': 0
@@ -162,7 +167,6 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Button', 'fieldtype': 'Button',
'idx': 4,
'label': 'Set as Default BOM', 'label': 'Set as Default BOM',
'oldfieldtype': 'Button', 'oldfieldtype': 'Button',
'permlevel': 0, 'permlevel': 0,
@@ -173,7 +177,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Column Break', 'fieldtype': 'Column Break',
'idx': 5,
'oldfieldtype': 'Column Break', 'oldfieldtype': 'Column Break',
'permlevel': 0 'permlevel': 0
}, },
@@ -185,7 +188,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Button', 'fieldtype': 'Button',
'hidden': 1, 'hidden': 1,
'idx': 6,
'label': 'Activate BOM', 'label': 'Activate BOM',
'oldfieldtype': 'Button', 'oldfieldtype': 'Button',
'permlevel': 0, 'permlevel': 0,
@@ -199,7 +201,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Button', 'fieldtype': 'Button',
'hidden': 1, 'hidden': 1,
'idx': 7,
'label': 'Inactivate BOM', 'label': 'Inactivate BOM',
'oldfieldtype': 'Button', 'oldfieldtype': 'Button',
'permlevel': 0, 'permlevel': 0,
@@ -210,7 +211,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'idx': 8,
'label': 'Details', 'label': 'Details',
'oldfieldtype': 'Section Break', 'oldfieldtype': 'Section Break',
'permlevel': 0 'permlevel': 0
@@ -223,7 +223,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'item', 'fieldname': 'item',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 9,
'in_filter': 1, 'in_filter': 1,
'label': 'Item', 'label': 'Item',
'oldfieldname': 'item', 'oldfieldname': 'item',
@@ -240,7 +239,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'description', 'fieldname': 'description',
'fieldtype': 'Text', 'fieldtype': 'Text',
'idx': 10,
'label': 'Description', 'label': 'Description',
'oldfieldname': 'description', 'oldfieldname': 'description',
'oldfieldtype': 'Text', 'oldfieldtype': 'Text',
@@ -255,7 +253,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'quantity', 'fieldname': 'quantity',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 11,
'label': 'Quantity', 'label': 'Quantity',
'oldfieldname': 'quantity', 'oldfieldname': 'quantity',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@@ -263,13 +260,22 @@
'reqd': 1 'reqd': 1
}, },
# DocField
{
'doctype': 'DocField',
'fieldname': 'uom',
'fieldtype': 'Select',
'label': 'UOM',
'options': 'link:UOM',
'permlevel': 1
},
# DocField # DocField
{ {
'colour': 'White:FFF', 'colour': 'White:FFF',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'is_active', 'fieldname': 'is_active',
'fieldtype': 'Select', 'fieldtype': 'Select',
'idx': 12,
'label': 'Is Active', 'label': 'Is Active',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'is_active', 'oldfieldname': 'is_active',
@@ -285,7 +291,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'is_default', 'fieldname': 'is_default',
'fieldtype': 'Check', 'fieldtype': 'Check',
'idx': 13,
'label': 'Is Default', 'label': 'Is Default',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'is_default', 'oldfieldname': 'is_default',
@@ -299,7 +304,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'project_name', 'fieldname': 'project_name',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 14,
'in_filter': 1, 'in_filter': 1,
'label': 'Project Name', 'label': 'Project Name',
'oldfieldname': 'project_name', 'oldfieldname': 'project_name',
@@ -313,7 +317,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'idx': 15,
'label': 'Operations', 'label': 'Operations',
'oldfieldtype': 'Section Break', 'oldfieldtype': 'Section Break',
'permlevel': 0 'permlevel': 0
@@ -326,7 +329,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'bom_operations', 'fieldname': 'bom_operations',
'fieldtype': 'Table', 'fieldtype': 'Table',
'idx': 16,
'label': 'BOM Operations', 'label': 'BOM Operations',
'oldfieldname': 'bom_operations', 'oldfieldname': 'bom_operations',
'oldfieldtype': 'Table', 'oldfieldtype': 'Table',
@@ -338,7 +340,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'idx': 17,
'label': 'Materials', 'label': 'Materials',
'oldfieldtype': 'Section Break', 'oldfieldtype': 'Section Break',
'permlevel': 0 'permlevel': 0
@@ -351,7 +352,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'bom_materials', 'fieldname': 'bom_materials',
'fieldtype': 'Table', 'fieldtype': 'Table',
'idx': 18,
'label': 'BOM Material', 'label': 'BOM Material',
'oldfieldname': 'bom_materials', 'oldfieldname': 'bom_materials',
'oldfieldtype': 'Table', 'oldfieldtype': 'Table',
@@ -363,7 +363,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'idx': 19,
'label': 'Costing', 'label': 'Costing',
'oldfieldtype': 'Section Break', 'oldfieldtype': 'Section Break',
'permlevel': 0 'permlevel': 0
@@ -375,7 +374,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'remarks', 'fieldname': 'remarks',
'fieldtype': 'Text', 'fieldtype': 'Text',
'idx': 20,
'label': 'Remarks', 'label': 'Remarks',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'remarks', 'oldfieldname': 'remarks',
@@ -388,7 +386,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'cost_as_per_mar', 'fieldname': 'cost_as_per_mar',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 21,
'label': 'Cost As Per Valuation Rate', 'label': 'Cost As Per Valuation Rate',
'oldfieldname': 'cost_as_per_mar', 'oldfieldname': 'cost_as_per_mar',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@@ -400,7 +397,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'cost_as_per_lpr', 'fieldname': 'cost_as_per_lpr',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 22,
'label': 'Cost As Per LPR', 'label': 'Cost As Per LPR',
'oldfieldname': 'cost_as_per_lpr', 'oldfieldname': 'cost_as_per_lpr',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@@ -412,7 +408,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'cost_as_per_sr', 'fieldname': 'cost_as_per_sr',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 23,
'label': 'Cost As Per SR', 'label': 'Cost As Per SR',
'oldfieldname': 'cost_as_per_sr', 'oldfieldname': 'cost_as_per_sr',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@@ -425,7 +420,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'cost_as_on', 'fieldname': 'cost_as_on',
'fieldtype': 'Data', 'fieldtype': 'Data',
'idx': 24,
'label': 'Cost as on', 'label': 'Cost as on',
'oldfieldname': 'cost_as_on', 'oldfieldname': 'cost_as_on',
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
@@ -437,7 +431,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'dir_mat_as_per_mar', 'fieldname': 'dir_mat_as_per_mar',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 25,
'label': 'Direct Material As Per Valuation', 'label': 'Direct Material As Per Valuation',
'oldfieldname': 'dir_mat_as_per_mar', 'oldfieldname': 'dir_mat_as_per_mar',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@@ -449,7 +442,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'dir_mat_as_per_lpr', 'fieldname': 'dir_mat_as_per_lpr',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 26,
'label': 'Direct Material As Per LPR', 'label': 'Direct Material As Per LPR',
'oldfieldname': 'dir_mat_as_per_lpr', 'oldfieldname': 'dir_mat_as_per_lpr',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@@ -461,7 +453,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'dir_mat_as_per_sr', 'fieldname': 'dir_mat_as_per_sr',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 27,
'label': 'Direct Material As Per SR', 'label': 'Direct Material As Per SR',
'oldfieldname': 'dir_mat_as_per_sr', 'oldfieldname': 'dir_mat_as_per_sr',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@@ -473,7 +464,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'operating_cost', 'fieldname': 'operating_cost',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 28,
'label': 'Operating Cost', 'label': 'Operating Cost',
'oldfieldname': 'operating_cost', 'oldfieldname': 'operating_cost',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@@ -485,7 +475,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'maintained_by', 'fieldname': 'maintained_by',
'fieldtype': 'Data', 'fieldtype': 'Data',
'idx': 29,
'label': 'Maintained By', 'label': 'Maintained By',
'oldfieldname': 'maintained_by', 'oldfieldname': 'maintained_by',
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
@@ -497,7 +486,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'hidden': 1, 'hidden': 1,
'idx': 30,
'label': 'BOM Report', 'label': 'BOM Report',
'oldfieldtype': 'Section Break', 'oldfieldtype': 'Section Break',
'permlevel': 0 'permlevel': 0
@@ -508,7 +496,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'hidden': 0, 'hidden': 0,
'idx': 31,
'label': 'Flat BOM', 'label': 'Flat BOM',
'oldfieldtype': 'Section Break', 'oldfieldtype': 'Section Break',
'permlevel': 0 'permlevel': 0
@@ -522,7 +509,6 @@
'fieldname': 'flat_bom_details', 'fieldname': 'flat_bom_details',
'fieldtype': 'Table', 'fieldtype': 'Table',
'hidden': 0, 'hidden': 0,
'idx': 32,
'label': 'Flat BOM Detail', 'label': 'Flat BOM Detail',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'flat_bom_details', 'oldfieldname': 'flat_bom_details',

View File

@@ -329,11 +329,11 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'qty_consumed_per_unit', 'fieldname': 'qty_consumed_per_unit',
'fieldtype': 'Currency', 'fieldtype': 'Float',
'idx': 21, 'idx': 21,
'label': 'Qty Consumed Per Unit', 'label': 'Qty Consumed Per Unit',
'oldfieldname': 'qty_consumed_per_unit', 'oldfieldname': 'qty_consumed_per_unit',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Float',
'permlevel': 1 'permlevel': 1
} }
] ]

View File

@@ -5,8 +5,8 @@
{ {
'creation': '2010-08-08 17:09:02', 'creation': '2010-08-08 17:09:02',
'docstatus': 0, 'docstatus': 0,
'modified': '2010-09-20 14:06:57', 'modified': '2011-11-10 14:21:40',
'modified_by': 'umair@iwebnotes.com', 'modified_by': 'Administrator',
'owner': 'jai@webnotestech.com' 'owner': 'jai@webnotestech.com'
}, },
@@ -14,6 +14,7 @@
{ {
'autoname': 'FBD/.######', 'autoname': 'FBD/.######',
'colour': 'White:FFF', 'colour': 'White:FFF',
'default_print_format': 'Standard',
'doctype': 'DocType', 'doctype': 'DocType',
'istable': 1, 'istable': 1,
'module': 'Production', 'module': 'Production',
@@ -22,7 +23,7 @@
'section_style': 'Simple', 'section_style': 'Simple',
'server_code_error': ' ', 'server_code_error': ' ',
'show_in_menu': 0, 'show_in_menu': 0,
'version': 15 'version': 18
}, },
# These values are common for all DocField # These values are common for all DocField
@@ -46,7 +47,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'item_code', 'fieldname': 'item_code',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 1,
'label': 'Item Code', 'label': 'Item Code',
'oldfieldname': 'item_code', 'oldfieldname': 'item_code',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
@@ -58,7 +58,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'description', 'fieldname': 'description',
'fieldtype': 'Text', 'fieldtype': 'Text',
'idx': 2,
'label': 'Description', 'label': 'Description',
'oldfieldname': 'description', 'oldfieldname': 'description',
'oldfieldtype': 'Text', 'oldfieldtype': 'Text',
@@ -70,7 +69,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'moving_avg_rate', 'fieldname': 'moving_avg_rate',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 5,
'label': 'Valuation Rate', 'label': 'Valuation Rate',
'oldfieldname': 'moving_avg_rate', 'oldfieldname': 'moving_avg_rate',
'oldfieldtype': 'Currency' 'oldfieldtype': 'Currency'
@@ -81,7 +79,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'amount_as_per_mar', 'fieldname': 'amount_as_per_mar',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 6,
'label': 'Amount As Per Valuation Rate', 'label': 'Amount As Per Valuation Rate',
'oldfieldname': 'amount_as_per_mar', 'oldfieldname': 'amount_as_per_mar',
'oldfieldtype': 'Currency' 'oldfieldtype': 'Currency'
@@ -92,7 +89,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'last_purchase_rate', 'fieldname': 'last_purchase_rate',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 7,
'label': 'Last Purchase Rate', 'label': 'Last Purchase Rate',
'oldfieldname': 'last_purchase_rate', 'oldfieldname': 'last_purchase_rate',
'oldfieldtype': 'Currency' 'oldfieldtype': 'Currency'
@@ -103,7 +99,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'amount_as_per_lpr', 'fieldname': 'amount_as_per_lpr',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 8,
'label': 'Amount As Per LPR', 'label': 'Amount As Per LPR',
'oldfieldname': 'amount_as_per_lpr', 'oldfieldname': 'amount_as_per_lpr',
'oldfieldtype': 'Currency' 'oldfieldtype': 'Currency'
@@ -114,7 +109,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'qty', 'fieldname': 'qty',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 9,
'label': 'Qty', 'label': 'Qty',
'oldfieldname': 'qty', 'oldfieldname': 'qty',
'oldfieldtype': 'Currency' 'oldfieldtype': 'Currency'
@@ -125,7 +119,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'standard_rate', 'fieldname': 'standard_rate',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 9,
'label': 'Standard Rate', 'label': 'Standard Rate',
'oldfieldname': 'standard_rate', 'oldfieldname': 'standard_rate',
'oldfieldtype': 'Currency' 'oldfieldtype': 'Currency'
@@ -136,7 +129,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'amount_as_per_sr', 'fieldname': 'amount_as_per_sr',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 10,
'label': 'Amount As Per SR', 'label': 'Amount As Per SR',
'oldfieldname': 'amount_as_per_sr', 'oldfieldname': 'amount_as_per_sr',
'oldfieldtype': 'Currency' 'oldfieldtype': 'Currency'
@@ -146,11 +138,10 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'qty_consumed_per_unit', 'fieldname': 'qty_consumed_per_unit',
'fieldtype': 'Currency', 'fieldtype': 'Float',
'idx': 11,
'label': 'Qty Consumed Per Unit', 'label': 'Qty Consumed Per Unit',
'oldfieldname': 'qty_consumed_per_unit', 'oldfieldname': 'qty_consumed_per_unit',
'oldfieldtype': 'Currency' 'oldfieldtype': 'Float'
}, },
# DocField # DocField
@@ -158,12 +149,10 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'stock_uom', 'fieldname': 'stock_uom',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 12,
'label': 'Stock UOM', 'label': 'Stock UOM',
'oldfieldname': 'stock_uom', 'oldfieldname': 'stock_uom',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'UOM', 'options': 'UOM'
'search_index': 0
}, },
# DocField # DocField
@@ -172,7 +161,6 @@
'fieldname': 'flat_bom_no', 'fieldname': 'flat_bom_no',
'fieldtype': 'Data', 'fieldtype': 'Data',
'hidden': 1, 'hidden': 1,
'idx': 12,
'label': 'Flat BOM No', 'label': 'Flat BOM No',
'oldfieldname': 'flat_bom_no', 'oldfieldname': 'flat_bom_no',
'oldfieldtype': 'Data' 'oldfieldtype': 'Data'
@@ -184,7 +172,6 @@
'fieldname': 'bom_mat_no', 'fieldname': 'bom_mat_no',
'fieldtype': 'Data', 'fieldtype': 'Data',
'hidden': 0, 'hidden': 0,
'idx': 13,
'label': 'BOM Mat No', 'label': 'BOM Mat No',
'oldfieldname': 'bom_mat_no', 'oldfieldname': 'bom_mat_no',
'oldfieldtype': 'Data' 'oldfieldtype': 'Data'
@@ -196,7 +183,6 @@
'fieldname': 'parent_bom', 'fieldname': 'parent_bom',
'fieldtype': 'Link', 'fieldtype': 'Link',
'hidden': 0, 'hidden': 0,
'idx': 14,
'label': 'Parent BOM', 'label': 'Parent BOM',
'oldfieldname': 'parent_bom', 'oldfieldname': 'parent_bom',
'oldfieldtype': 'Link' 'oldfieldtype': 'Link'
@@ -207,7 +193,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'is_pro_applicable', 'fieldname': 'is_pro_applicable',
'fieldtype': 'Select', 'fieldtype': 'Select',
'idx': 15,
'label': 'Is PRO Applicable', 'label': 'Is PRO Applicable',
'oldfieldname': 'is_pro_applicable', 'oldfieldname': 'is_pro_applicable',
'oldfieldtype': 'Select', 'oldfieldtype': 'Select',

View File

@@ -0,0 +1,55 @@
import unittest
import webnotes
import webnotes.profile
webnotes.user = webnotes.profile.Profile()
from webnotes.model.doc import Document
from webnotes.model.code import get_obj
from webnotes.utils import cstr, flt
from webnotes.model.doclist import getlist
sql = webnotes.conn.sql
from sandbox.testdata import leaves
#----------------------------------------------------------
class TestStockEntry(unittest.TestCase):
#===========================================================================
def setUp(self):
webnotes.conn.begin()
leaves.emp.save(new = 1, make_autoname = 0)
def test_leave_bal(self):
leaves.l_all.save(1)
leaves.l_app1.save(1)
leaves.l_app2.save(1)
la1 = get_obj('Leave Application', leaves.l_app1.name, with_children=1)
la1.validate()
la1.doc.docstatus = 1
la1.doc.save()
self.assertTrue(la1.doc.total_leave_days == 2)
la1.doc.half_day = 1
la1.validate()
la1.doc.save()
self.assertTrue(la1.doc.total_leave_days == .5)
print "Test case for leave applied no of days"
la2 = get_obj('Leave Application', leaves.l_app2.name, with_children=1)
la2.validate()
bal = la2.get_leave_balance()
self.assertTrue(bal, 18)
print "Test case for leave balance"
def tearDown(self):
webnotes.conn.rollback()

View File

@@ -101,7 +101,7 @@ class TestStockEntry(unittest.TestCase):
self.save_stock_entry('Material Transfer') self.save_stock_entry('Material Transfer')
mtn = get_obj('Stock Entry', stock_entry.mtn[0].name, with_children=1) mtn = get_obj('Stock Entry', stock_entry.mtn[0].name, with_children=1)
tn = self.submit_stock_entry(mtn) mtn = self.submit_stock_entry(mtn)
# stock ledger entry # stock ledger entry
print "Checking stock ledger entry........." print "Checking stock ledger entry........."
@@ -202,7 +202,53 @@ class TestStockEntry(unittest.TestCase):
[{'doctype': 'Serial No', 'item_code': 'it', 'warehouse': 'wh1', 'status': 'In Store', 'docstatus': 0}, 10] [{'doctype': 'Serial No', 'item_code': 'it', 'warehouse': 'wh1', 'status': 'In Store', 'docstatus': 0}, 10]
]) ])
#===========================================================================
def test_entries_on_same_datetime(self):
print "Test Case: Multiple entries on same datetime, cancel first one"
# submitted 1st MR
self.save_stock_entry('Material Receipt')
mr = get_obj('Stock Entry', stock_entry.mr[0].name, with_children=1)
mr = self.submit_stock_entry(mr)
# submitted 2nd MR
for each in stock_entry.mr1:
each.save(1)
for t in stock_entry.mr1[1:]:
sql("update `tabStock Entry Detail` set parent = '%s' where name = '%s'" % (stock_entry.mr1[0].name, t.name))
mr1 = get_obj('Stock Entry', stock_entry.mr1[0].name, with_children=1)
mr1 = self.submit_stock_entry(mr1)
# submitted MTN
self.save_stock_entry('Material Transfer')
mtn = get_obj('Stock Entry', stock_entry.mtn[0].name, with_children=1)
mtn = self.submit_stock_entry(mtn)
# cancel prev MR
mr.on_cancel()
mr.doc.cancel_reason = "testing"
mr.doc.docstatus = 2
mr.doc.save()
# stock ledger entry
print "Checking stock ledger entry........."
self.assertDoc(self.get_expected_sle('entries_on_same_datetime'))
# bin qty
print "Checking Bin qty........."
self.assertDoc([
{'doctype':'Bin', 'actual_qty':0, 'item_code':'it', 'warehouse':'wh1'},
{'doctype':'Bin', 'actual_qty':5, 'item_code':'it', 'warehouse':'wh2'}
])
# serial no
self.assertCount([
[{'doctype': 'Serial No', 'item_code': 'it', 'warehouse': 'wh1', 'status': 'In Store', 'docstatus': 0}, 0],
[{'doctype': 'Serial No', 'item_code': 'it', 'warehouse': 'wh2', 'status': 'In Store', 'docstatus': 0}, 5]
])
#=========================================================================== #===========================================================================
def save_stock_entry(self, t): def save_stock_entry(self, t):
@@ -373,8 +419,58 @@ class TestStockEntry(unittest.TestCase):
'ifnull(bin_aqat, 0)': 0, 'ifnull(bin_aqat, 0)': 0,
'ifnull(valuation_rate, 0)': 0, 'ifnull(valuation_rate, 0)': 0,
"ifnull(is_cancelled, 'No')": 'Yes' "ifnull(is_cancelled, 'No')": 'Yes'
}],
'entries_on_same_datetime': [{
'doctype': 'Stock Ledger Entry',
'item_code':'it',
'warehouse':'wh1',
'voucher_type': 'Stock Entry',
'voucher_no': stock_entry.mr[0].name,
'actual_qty': 10,
'bin_aqat': 10,
'valuation_rate': 100,
'is_cancelled': 'Yes'
}, {
'doctype': 'Stock Ledger Entry',
'item_code':'it',
'warehouse':'wh1',
'voucher_type': 'Stock Entry',
'voucher_no': stock_entry.mr[0].name,
'actual_qty': -10,
'ifnull(bin_aqat, 0)': 0,
'ifnull(valuation_rate, 0)': 0,
"ifnull(is_cancelled, 'No')": 'Yes'
}, {
'doctype': 'Stock Ledger Entry',
'item_code':'it',
'warehouse':'wh1',
'voucher_type': 'Stock Entry',
'voucher_no': stock_entry.mr1[0].name,
'actual_qty': 5,
'bin_aqat': 5,
'valuation_rate': 400,
'is_cancelled': 'No'
}, {
'doctype': 'Stock Ledger Entry',
'item_code':'it',
'warehouse':'wh1',
'voucher_type': 'Stock Entry',
'voucher_no': stock_entry.mtn[0].name,
'actual_qty': -5,
'bin_aqat': 0,
'valuation_rate': 400,
'is_cancelled': 'No'
}, {
'doctype': 'Stock Ledger Entry',
'item_code':'it',
'warehouse':'wh2',
'voucher_type': 'Stock Entry',
'voucher_no': stock_entry.mtn[0].name,
'actual_qty': 5,
'bin_aqat': 5,
'valuation_rate': 100,
'is_cancelled': 'No'
}] }]
} }
return expected_sle[action] return expected_sle[action]

54
erpnext/sandbox/testdata/leaves.py vendored Normal file
View File

@@ -0,0 +1,54 @@
from webnotes.model.doc import Document
emp = Document(
fielddata = {
'doctype': 'Employee',
'name': 'emp1',
'employee_name': 'Nijil',
'status': 'Active',
'date_of_joining': '2011-01-01'
}
)
l_all = Document(
fielddata = {
'doctype' : 'Leave Allocation',
'name': 'l_all',
'employee' : 'emp1',
'leave_type' : 'Casual Leave',
'posting_date': '2011-03-01',
'fiscal_year': '2011-2012',
'total_leaves_allocated': 20,
'docstatus': 1
}
)
l_app1 = Document(
fielddata = {
'doctype' : 'Leave Application',
'name': 'l_app1',
'employee' : 'emp1',
'leave_type' : 'Casual Leave',
'posting_date': '2011-03-01',
'fiscal_year': '2011-2012',
'from_date': '2011-08-01',
'to_date': '2011-08-02',
'total_leave_days': 2
}
)
l_app2 = Document(
fielddata = {
'doctype' : 'Leave Application',
'name': 'l_app2',
'employee' : 'emp1',
'leave_type' : 'Casual Leave',
'posting_date': '2011-03-01',
'fiscal_year': '2011-2012',
'from_date': '2011-08-15',
'to_date': '2011-08-17',
'total_leave_days': 3
}
)

View File

@@ -34,6 +34,38 @@ mr = [
) )
] ]
mr1 = [
Document(
fielddata = {
'doctype': 'Stock Entry',
'posting_date': '2011-09-01',
'transfer_date': '2011-09-01',
'posting_time': '12:00',
'company': 'comp',
'fiscal_year' : '2011-2012',
'purpose': 'Material Receipt',
'name': 'mr1'
}
),
Document(
fielddata ={
'doctype': 'Stock Entry Detail',
'parenttype': 'Stock Entry',
'parentfield' : 'mtn_details',
'parent' : 'mr1',
'item_code' : 'it',
't_warehouse' : 'wh1',
'qty' : 5,
'transfer_qty' : 5,
'incoming_rate': 400,
'stock_uom': 'Nos',
'conversion_factor': 1,
'serial_no': 'srno11, srno12, srno13, srno14, srno15'
}
)
]
# Material Transfer # Material Transfer
#-------------------- #--------------------
@@ -43,7 +75,7 @@ mtn = [
'doctype': 'Stock Entry', 'doctype': 'Stock Entry',
'posting_date': '2011-09-01', 'posting_date': '2011-09-01',
'transfer_date': '2011-09-01', 'transfer_date': '2011-09-01',
'posting_time': '13:00', 'posting_time': '12:00',
'company': 'comp', 'company': 'comp',
'fiscal_year' : '2011-2012', 'fiscal_year' : '2011-2012',
'purpose': 'Material Transfer', 'purpose': 'Material Transfer',

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -133,24 +133,13 @@ class DocType(TransactionBase):
# Does not allow same item code to be entered twice # Does not allow same item code to be entered twice
# ------------------------------------------------- # -------------------------------------------------
def validate_for_items(self): def validate_for_items(self):
check_list=[]
chk_dupl_itm = [] chk_dupl_itm = []
for d in getlist(self.doclist,'quotation_details'): for d in getlist(self.doclist,'quotation_details'):
ch = sql("select is_stock_item from `tabItem` where name = '%s'"%d.item_code) if [cstr(d.item_code),cstr(d.description)] in chk_dupl_itm:
if ch and ch[0][0]=='Yes': msgprint("Item %s has been entered twice. Please change description atleast to continue" % d.item_code)
if cstr(d.item_code) in check_list: raise Exception
msgprint("Item %s has been entered twice." % d.item_code) else:
raise Exception chk_dupl_itm.append([cstr(d.item_code),cstr(d.description)])
else:
check_list.append(cstr(d.item_code))
if ch and ch[0][0]=='No':
f = [cstr(d.item_code),cstr(d.description)]
if f in chk_dupl_itm:
msgprint("Item %s has been entered twice." % d.item_code)
raise Exception
else:
chk_dupl_itm.append(f)
#do not allow sales item in maintenance quotation and service item in sales quotation #do not allow sales item in maintenance quotation and service item in sales quotation

View File

@@ -4,7 +4,7 @@ h1, h2, h3, h4 {
} }
body, span, div, td, input, textarea, button, select { body, span, div, td, input, textarea, button, select {
font-family: Verdana, Arial, Sans Serif; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif;
font-size: 12px; font-size: 12px;
} }

View File

@@ -43,18 +43,8 @@ function startup_setup() {
// ------------------ // ------------------
$dh(page_body.footer); $dh(page_body.footer);
// for logout and payment // setup toolbar
var callback = function(r,rt) { pscript.startup_setup_toolbar();
if(r.message){
login_file = 'http://' + r.message;
}
else if(pscript.is_erpnext_saas) {
login_file = 'https://www.erpnext.com';
}
// setup toolbar
pscript.startup_setup_toolbar();
}
$c_obj('Home Control', 'get_login_url', '', callback);
} }
// ==================================================================== // ====================================================================
@@ -66,6 +56,14 @@ pscript.startup_make_sidebar = function() {
// menu // menu
var ml = r.message; var ml = r.message;
// login-file
if(r.login_url){
login_file = 'http://' + r.login_url;
}
else if(pscript.is_erpnext_saas) {
login_file = 'https://www.erpnext.com';
}
// clear // clear
page_body.left_sidebar.innerHTML = ''; page_body.left_sidebar.innerHTML = '';
@@ -299,10 +297,10 @@ SidebarItem.prototype.show_items = function() {
// add to menu-item mapper // add to menu-item mapper
menu_item_map['Page'][me.det.module_label + ' Custom Reports'] = smi.pointer; menu_item_map['Page'][me.det.module_label + ' Custom Reports'] = smi.pointer;
} }
} }
$(me.items_area).slideDown(); $(me.items_area).slideDown();
// high light // high light
@@ -565,7 +563,7 @@ pscript.feature_dict = {
'Timesheet': {'timesheet_details':['project_name']} 'Timesheet': {'timesheet_details':['project_name']}
}, },
'fs_packing_details': { 'fs_packing_details': {
'Delivery Note': {'fields':['packing_details','print_packing_slip'],'delivery_note_details':['no_of_packs','pack_gross_wt','pack_nett_wt','pack_no','pack_unit']}, 'Delivery Note': {'fields':['packing_details','print_packing_slip','packing_checked_by','packed_by','pack_size','shipping_mark'],'delivery_note_details':['no_of_packs','pack_gross_wt','pack_nett_wt','pack_no','pack_unit']},
'Sales Order': {'fields':['packing_details']} 'Sales Order': {'fields':['packing_details']}
}, },
'fs_discounts': { 'fs_discounts': {

View File

@@ -5,7 +5,7 @@
{ {
'creation': '2010-08-08 17:09:35', 'creation': '2010-08-08 17:09:35',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-10-07 12:10:26', 'modified': '2011-10-12 10:49:40',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
@@ -153,6 +153,30 @@
'to_field': 'schedule_date' 'to_field': 'schedule_date'
}, },
# Field Mapper Detail
{
'doctype': 'Field Mapper Detail',
'from_field': 'net_total',
'match_id': 0,
'to_field': 'net_total'
},
# Field Mapper Detail
{
'doctype': 'Field Mapper Detail',
'from_field': 'grand_total',
'match_id': 0,
'to_field': 'grand_total'
},
# Field Mapper Detail
{
'doctype': 'Field Mapper Detail',
'from_field': 'total_tax',
'match_id': 0,
'to_field': 'total_tax'
},
# Table Mapper Detail # Table Mapper Detail
{ {
'doctype': 'Table Mapper Detail', 'doctype': 'Table Mapper Detail',

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -3,9 +3,9 @@
# These values are common in all dictionaries # These values are common in all dictionaries
{ {
'creation': '2011-08-18 16:29:14', 'creation': '2011-08-23 16:49:40',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-08-23 13:24:12', 'modified': '2011-10-19 14:12:11',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
@@ -13,7 +13,7 @@
# These values are common for all Print Format # These values are common for all Print Format
{ {
'doctype': 'Print Format', 'doctype': 'Print Format',
'html': "<html>\n<head>\n\n<script>\nfunction replaceAll(s,s1,s2){ return s.split(s1).join(s2);}\n\nfunction get_letter_head(){\n var cp = locals['Control Panel']['Control Panel'];\n if(cp.letter_head != 'None') {return cp.letter_head; }\n else{ return ''};\n }\n</script>\n<style>\n.cust_tbl { border-collapse:collapse; }\n.cust_tbl td { border:1px solid #848484; }\n</style>\n</head>\n\n<body>\n<script>\nreplaceAll(doc.print_packing_slip,'[HEADER GOES HERE]',get_letter_head());\n</script>\n</body>\n</html>", 'html': "<html>\n<head>\n\n<script>\nfunction replaceAll(s,s1,s2){ return s.split(s1).join(s2);}\n\nfunction get_letter_head() {\n\t// add letter head\n\tvar cp = locals['Control Panel']['Control Panel'];\n\tif(doc.letter_head)\n\t\tvar lh= cstr(_p.letter_heads[doc.letter_head]);\n\telse if(cp.letter_head)\n\t\tvar lh= cp.letter_head;\n\telse \n\t\tvar lh= '';\n\t\t\n\treturn lh;\n}\n\n</script>\n<style>\n.cust_tbl { border-collapse:collapse; }\n.cust_tbl td { border:1px solid #848484; font-size: 13px}\n.large_font td {font-size: 13px}\n</style>\n</head>\n\n<body>\n<script>\nreplaceAll(doc.print_packing_slip,'[HEADER GOES HERE]',get_letter_head());\n</script>\n</body>\n</html>",
'module': 'Stock', 'module': 'Stock',
'name': '__common__', 'name': '__common__',
'standard': 'Yes' 'standard': 'Yes'

File diff suppressed because one or more lines are too long

View File

@@ -5,7 +5,7 @@
{ {
'creation': '2010-08-08 17:09:34', 'creation': '2010-08-08 17:09:34',
'docstatus': 0, 'docstatus': 0,
'modified': '2009-09-07 11:03:11', 'modified': '2011-10-19 14:18:26',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
@@ -13,7 +13,7 @@
# These values are common for all Print Format # These values are common for all Print Format
{ {
'doctype': 'Print Format', 'doctype': 'Print Format',
'html': '<html>\n<head>\n<!--Other charges function-->\n<script>\n var make_row = function(title,val,bold){\n var bstart = \'<b>\'; var bend = \'</b>\';\n return \'<tr><td style="width:50%">\'+(bold?bstart:\'\')+title+(bold?bend:\'\')+\'</td>\'\n +\'<td style="width:20%;text-align:right">\'+doc.currency+\'</td>\'\n +\'<td style="width:30%;text-align:right">\'+(val?val:\'0.00\')+\'</td>\'\n +\'</tr>\'\n }\n\n function get_other_charges(){\n var out =\'\';\n out += \'<div><table class="noborder" style="width:100%">\';\n out += make_row(\'Total Amount\',fmt_money(convert_rate(doc.total_amount)),1)\n +make_row(\'Grand Total\',fmt_money(convert_rate(doc.grand_total)),1);\n out += \'</table></div>\';\n return out;\n }\n\n function get_buying_costs(){\n var out =\'\';\n if(doc.buying_cost_transport || doc.buying_cost_taxes || doc.buying_cost_other){\n out += \'<div><table class="noborder" style="width:100%">\'\n + \'<tr><td style="width:100%"><b>\'+\'Buying Cost Details\'+\'</b></td></tr>\';\n if(doc.buying_cost_transport){ out += make_row(\'Transport Cost\',fmt_money(convert_rate(doc.buying_cost_transport)),0)}\n if(doc.buying_cost_taxes){ out += make_row(\'Taxes\',fmt_money(convert_rate(doc.buying_cost_taxes)),0)}\n if(doc.buying_cost_other){ out += make_row(\'Other Cost\',fmt_money(convert_rate(doc.buying_cost_other)),0)}\n out += \'</table></div>\';\n }\n return out;\n }\n\n function get_letter_head(){\n var cp = locals[\'Control Panel\'][\'Control Panel\'];\n \tif(cp.letter_head) {return cp.letter_head; }\n }\n \n function convert_rate(val){\n var new_val = flt(val)/flt(doc.conversion_rate);\n return new_val;\n }\n \n function get_transport_details(){\n var out = \'\';\n if(doc.transporter_name || doc.lr_no || doc.lr_date){\n out += \'<div><table class="noborder" style="width:40%">\'\n +\'<tr><td style="width:80%"><b>\' + \'Transporter Details\'+\'</b></td><td style="width:20%"></td></tr>\'\n\n if(doc.transporter_name){ out += \'<tr><td style="width:40%">\' + \'Transporter Name\'+\'</td><td style="width:60%">\'+doc.transporter_name+\'</td></tr>\'}\n if(doc.lr_no){ out += \'<tr><td style="width:40%">\' + \'LR No\'+\'</td><td style="width:60%">\'+doc.lr_no+\'</td></tr>\'}\n if(doc.lr_date){ out += \'<tr><td style="width:40%">\' + \'LR Date\'+\'</td><td style="width:60%">\'+doc.lr_date+\'</td></tr>\'}\n out += \'</table></div>\'\n }\n return out;\n }\n\n</script>\n</head>\n<body>\n<div style="border:1px solid black;padding:15px">\n<!--header-->\n<div><script>get_letter_head()</script></div>\n<div style="border-bottom: 1px solid; padding-bottom: 5px;">\n <div><br><b>Purchase Receipt: <script>doc.name</script></b></div>\n <div>Date: <script>date.str_to_user(doc.transaction_date)</script></div>\n</div>\n\n<div style="padding-top:15px">\n<div><script>doc.supplier</script></div>\n<div><br><script>replace_newlines(doc.address_display)</script></div>\n</div>\n\n<div>\n<br>\n <script>\n var t = print_table(\'Purchase Receipt\', doc.name, \'purchase_receipt_details\', \'Purchase Receipt Detail\', [\'SR\', \'item_code\',\'description\',\'received_qty\',\'qty\',\'rejected_qty\',\'po_rate\',\'amount\',\'billed_qty\'], [\'Sr\', \'Item Code\', \'Description\',\'Received Quantity\',\'Accepted Qty\',\'Rejected Qty\',\'Rate\',\'Amount\',\'Billed Qty\'], [\'4%\',\'12%\', \'24%\', \'10%\',\'10%\',\'10%\',\'10%\',\'10%\',\'10%\'])\n if(t.appendChild) {\n // single\n out = t.innerHTML;\n } \n else {//multiple\n out = \'\'\n for(var i=0;i<t.length;i++) {\n if(i!=t.length-1){\n out += \'<div style:"padding-top:5px;"></div>\' + t[i].innerHTML +\'<div style="page-break-after:always"></div>\';\n }\n else out += \'<div style:"padding-top:5px;"></div>\' + t[i].innerHTML;\n }\n }\n out;\n </script>\n\n</div>\n\n<!--Other charges table-->\n<div>\n<table style="width:100%">\n <tr><td style="width:40%"><script>get_buying_costs()</script></td>\n <td style="width:20%"></td><td style="width:40%"><script>get_other_charges()</script></td></tr>\n</table>\n</div>\n<div><script>get_transport_details()</script></div>\n<div><br>Payment Terms</div>\n<div><br><script>replace_newlines(doc.payment_terms)</script></div>\n<div><br>For NCSCI</div>\n<div><br><br>(Authorised Signatory)</div>\n</div></body>\n</html>', 'html': '<html>\n<head>\n<!--Other charges function-->\n<script>\n var make_row = function(title,val,bold){\n var bstart = \'<b>\'; var bend = \'</b>\';\n return \'<tr><td style="width:50%">\'+(bold?bstart:\'\')+title+(bold?bend:\'\')+\'</td>\'\n +\'<td style="width:20%;text-align:right">\'+doc.currency+\'</td>\'\n +\'<td style="width:30%;text-align:right">\'+(val?val:\'0.00\')+\'</td>\'\n +\'</tr>\'\n }\n\n function get_other_charges(){\n var out =\'\';\n out += \'<div><table class="noborder" style="width:100%">\';\n out += make_row(\'Total Amount\',fmt_money(convert_rate(doc.total_amount)),1)\n +make_row(\'Grand Total\',fmt_money(convert_rate(doc.grand_total)),1);\n out += \'</table></div>\';\n return out;\n }\n\n function get_buying_costs(){\n var out =\'\';\n if(doc.buying_cost_transport || doc.buying_cost_taxes || doc.buying_cost_other){\n out += \'<div><table class="noborder" style="width:100%">\'\n + \'<tr><td style="width:100%"><b>\'+\'Buying Cost Details\'+\'</b></td></tr>\';\n if(doc.buying_cost_transport){ out += make_row(\'Transport Cost\',fmt_money(convert_rate(doc.buying_cost_transport)),0)}\n if(doc.buying_cost_taxes){ out += make_row(\'Taxes\',fmt_money(convert_rate(doc.buying_cost_taxes)),0)}\n if(doc.buying_cost_other){ out += make_row(\'Other Cost\',fmt_money(convert_rate(doc.buying_cost_other)),0)}\n out += \'</table></div>\';\n }\n return out;\n }\n\nfunction get_letter_head() {\n\t// add letter head\n\tvar cp = locals[\'Control Panel\'][\'Control Panel\'];\n\tif(doc.letter_head)\n\t\tvar lh= cstr(_p.letter_heads[doc.letter_head]);\n\telse if(cp.letter_head)\n\t\tvar lh= cp.letter_head;\n\telse \n\t\tvar lh= \'\';\n\t\t\n\treturn lh;\n}\n\n \n function convert_rate(val){\n var new_val = flt(val)/flt(doc.conversion_rate);\n return new_val;\n }\n \n function get_transport_details(){\n var out = \'\';\n if(doc.transporter_name || doc.lr_no || doc.lr_date){\n out += \'<div><table class="noborder" style="width:40%">\'\n +\'<tr><td style="width:80%"><b>\' + \'Transporter Details\'+\'</b></td><td style="width:20%"></td></tr>\'\n\n if(doc.transporter_name){ out += \'<tr><td style="width:40%">\' + \'Transporter Name\'+\'</td><td style="width:60%">\'+doc.transporter_name+\'</td></tr>\'}\n if(doc.lr_no){ out += \'<tr><td style="width:40%">\' + \'LR No\'+\'</td><td style="width:60%">\'+doc.lr_no+\'</td></tr>\'}\n if(doc.lr_date){ out += \'<tr><td style="width:40%">\' + \'LR Date\'+\'</td><td style="width:60%">\'+doc.lr_date+\'</td></tr>\'}\n out += \'</table></div>\'\n }\n return out;\n }\n\n</script>\n</head>\n<body>\n<div style="border:1px solid black;padding:15px">\n<!--header-->\n<div><script>get_letter_head()</script></div>\n<div style="border-bottom: 1px solid; padding-bottom: 5px;">\n <div><br><b>Purchase Receipt: <script>doc.name</script></b></div>\n <div>Date: <script>date.str_to_user(doc.transaction_date)</script></div>\n</div>\n\n<div style="padding-top:15px">\n<div><script>doc.supplier</script></div>\n<div><br><script>replace_newlines(doc.address_display)</script></div>\n</div>\n\n<div>\n<br>\n <script>\n var t = print_table(\'Purchase Receipt\', doc.name, \'purchase_receipt_details\', \'Purchase Receipt Detail\', [\'SR\', \'item_code\',\'description\',\'received_qty\',\'qty\',\'rejected_qty\',\'po_rate\',\'amount\',\'billed_qty\'], [\'Sr\', \'Item Code\', \'Description\',\'Received Quantity\',\'Accepted Qty\',\'Rejected Qty\',\'Rate\',\'Amount\',\'Billed Qty\'], [\'4%\',\'12%\', \'24%\', \'10%\',\'10%\',\'10%\',\'10%\',\'10%\',\'10%\'])\n if(t.appendChild) {\n // single\n out = t.innerHTML;\n } \n else {//multiple\n out = \'\'\n for(var i=0;i<t.length;i++) {\n if(i!=t.length-1){\n out += \'<div style:"padding-top:5px;"></div>\' + t[i].innerHTML +\'<div style="page-break-after:always"></div>\';\n }\n else out += \'<div style:"padding-top:5px;"></div>\' + t[i].innerHTML;\n }\n }\n out;\n </script>\n\n</div>\n\n<!--Other charges table-->\n<div>\n<table style="width:100%">\n <tr><td style="width:40%"><script>get_buying_costs()</script></td>\n <td style="width:20%"></td><td style="width:40%"><script>get_other_charges()</script></td></tr>\n</table>\n</div>\n<div><script>get_transport_details()</script></div>\n<div><br>Payment Terms</div>\n<div><br><script>replace_newlines(doc.payment_terms)</script></div>\n<div><br>For NCSCI</div>\n<div><br><br>(Authorised Signatory)</div>\n</div></body>\n</html>',
'module': 'Stock', 'module': 'Stock',
'name': '__common__', 'name': '__common__',
'standard': 'Yes' 'standard': 'Yes'

View File

@@ -1,18 +1,11 @@
# Please edit this list and import only required elements # Please edit this list and import only required elements
import webnotes import webnotes
from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, generate_hash, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add from webnotes.utils import cint, cstr, flt, nowdate
from webnotes.model import db_exists from webnotes.model.code import get_obj
from webnotes.model.doc import Document, addchild, removechild, getchildren, make_autoname, SuperDocType from webnotes import msgprint
from webnotes.model.doclist import getlist, copy_doclist
from webnotes.model.code import get_obj, get_server_obj, run_server_obj, updatedb, check_syntax
from webnotes import session, form, is_testing, msgprint, errprint
set = webnotes.conn.set
sql = webnotes.conn.sql sql = webnotes.conn.sql
get_value = webnotes.conn.get_value
in_transaction = webnotes.conn.in_transaction
convert_to_lists = webnotes.conn.convert_to_lists
# ----------------------------------------------------------------------------------------- # -----------------------------------------------------------------------------------------
@@ -39,19 +32,13 @@ class DocType:
self.doc.save() self.doc.save()
# update valuation for post dated entry
if actual_qty: if actual_qty:
# check actual qty with total number of serial no # check actual qty with total number of serial no
if serial_no: if serial_no:
self.check_qty_with_serial_no() self.check_qty_with_serial_no()
prev_sle = self.get_prev_sle(dt, posting_time, sle_id) # update valuation and qty after transaction for post dated entry
cqty = flt(prev_sle.get('bin_aqat', 0)) self.update_entries_after(dt, posting_time)
# Block if actual qty becomes negative
if (flt(cqty) + flt(actual_qty)) < 0 and flt(actual_qty) < 0 and is_cancelled == 'No':
msgprint('Not enough quantity (requested: %s, current: %s) for Item <b>%s</b> in Warehouse <b>%s</b> as on %s %s' % (flt(actual_qty), flt(cqty), self.doc.item_code, self.doc.warehouse, dt, posting_time), raise_exception = 1)
self.update_item_valuation(sle_id, dt, posting_time, serial_no, prev_sle)
def check_qty_with_serial_no(self): def check_qty_with_serial_no(self):
""" """
@@ -59,11 +46,19 @@ class DocType:
Temporary validation added on: 18-07-2011 Temporary validation added on: 18-07-2011
""" """
if sql("select name from `tabItem` where ifnull(has_serial_no, 'No') = 'Yes' and name = '%s'" % self.doc.item_code): if sql("select name from `tabItem` where ifnull(has_serial_no, 'No') = 'Yes' and name = '%s'" % self.doc.item_code):
sr_count = sql("select count(name) from `tabSerial No` where item_code = '%s' and warehouse = '%s' and status ='In Store' and docstatus != 2" % (self.doc.item_code, self.doc.warehouse))[0][0] sr_count = sql("""select count(name) from `tabSerial No`
where item_code = '%s' and warehouse = '%s'
and status ='In Store' and docstatus != 2
""" % (self.doc.item_code, self.doc.warehouse))[0][0]
if sr_count != self.doc.actual_qty: if sr_count != self.doc.actual_qty:
msg = "Actual Qty(%s) in Bin is mismatched with total number(%s) of serial no in store for item: '%s' and warehouse: '%s'" % (self.doc.actual_qty, sr_count, self.doc.item_code, self.doc.warehouse) msg = """Actual Qty(%s) in Bin is mismatched with total number(%s) of serial no in store
for item: '%s' and warehouse: '%s'""" % \
(self.doc.actual_qty, sr_count, self.doc.item_code, self.doc.warehouse)
if getattr(webnotes.defs,'admin_email_notification',1): if getattr(webnotes.defs,'admin_email_notification',1):
sendmail(['developers@iwebnotes.com'], sender='automail@webnotestech.com', subject='Serial No Count vs Bin Actual Qty', parts=[['text/plain', msg]]) sendmail(['developers@iwebnotes.com'], sender='automail@webnotestech.com', \
subject='Serial No Count vs Bin Actual Qty', parts=[['text/plain', msg]])
msgprint(msg, raise_exception=1) msgprint(msg, raise_exception=1)
# -------------------------------- # --------------------------------
@@ -81,29 +76,19 @@ class DocType:
""", (self.doc.item_code, self.doc.warehouse), as_dict=1) """, (self.doc.item_code, self.doc.warehouse), as_dict=1)
return sle and sle[0] or None return sle and sle[0] or None
# -------------------------------- def get_prev_sle(self, posting_date = '1900-01-01', posting_time = '12:00', sle_id = ''):
# get previous stock ledger entry """
# -------------------------------- get the last sle on or before the current time-bucket,
to get actual qty before transaction, this function
def get_prev_sle(self, posting_date, posting_time, sle_id = ''): is called from various transaction like stock entry, reco etc
# this function will only be called for a live entry """
# for which the "name" will be the latest (even for the same timestamp)
# and even for a back-dated entry
# hence there cannot be any "backdated entries" with a name greater than the
# current one
# if there are multiple entries on this timestamp, then the last one will be with
# the last "name"
# else, the last entry will be the highest name at the previous timestamp
# hence, the double sort on timestamp and name should be sufficient condition
# to get the last sle
sle = sql(""" sle = sql("""
select * from `tabStock Ledger Entry` select * from `tabStock Ledger Entry`
where item_code = %s where item_code = %s
and warehouse = %s and warehouse = %s
and name != %s
and ifnull(is_cancelled, 'No') = 'No' and ifnull(is_cancelled, 'No') = 'No'
and name != %s
and timestamp(posting_date, posting_time) <= timestamp(%s, %s) and timestamp(posting_date, posting_time) <= timestamp(%s, %s)
order by timestamp(posting_date, posting_time) desc, name desc order by timestamp(posting_date, posting_time) desc, name desc
limit 1 limit 1
@@ -112,23 +97,49 @@ class DocType:
return sle and sle[0] or {} return sle and sle[0] or {}
def get_sle_prev_timebucket(self, posting_date = '1900-01-01', posting_time = '12:00'):
"""get previous stock ledger entry before current time-bucket"""
# get the last sle before the current time-bucket, so that all values
# are reposted from the current time-bucket onwards.
# this is necessary because at the time of cancellation, there may be
# entries between the cancelled entries in the same time-bucket
sle = sql("""
select * from `tabStock Ledger Entry`
where item_code = %s
and warehouse = %s
and ifnull(is_cancelled, 'No') = 'No'
and timestamp(posting_date, posting_time) < timestamp(%s, %s)
order by timestamp(posting_date, posting_time) desc, name desc
limit 1
""", (self.doc.item_code, self.doc.warehouse, posting_date, posting_time), as_dict=1)
return sle and sle[0] or {}
# -------------------------------------------------------------------------------------------------------------------------------------- #-------------------------------------------------------------
# validate negative stock (validate if stock is going -ve in between for back dated entries will consider only is_cancel = 'No' entries)
# --------------------------------------------------------------------------------------------------------------------------------------
def validate_negative_stock(self, cqty, s): def validate_negative_stock(self, cqty, s):
if cqty + s['actual_qty'] < 0 and s['is_cancelled'] != 'Yes': """
msgprint(cqty) validate negative stock for entries current datetime onwards
msgprint(s['actual_qty']) will not consider cancelled entries
msgprint('Cannot complete this transaction because stock will become negative in future transaction for Item <b>%s</b> in Warehouse <b>%s</b> on <b>%s %s</b>' % \ """
(self.doc.item_code, self.doc.warehouse, s['posting_date'], s['posting_time'])) diff = cqty + s['actual_qty']
raise Exception if diff < 0 and (abs(diff) > 0.0001) and s['is_cancelled'] == 'No':
msgprint("""
Negative stock error:
Cannot complete this transaction because stock will
become negative (%s) for Item <b>%s</b> in Warehouse
<b>%s</b> on <b>%s %s</b> in Transaction %s %s""" % \
(str(diff), self.doc.item_code, self.doc.warehouse, \
s['posting_date'], s['posting_time'], s['voucher_type'], s['voucher_no']), \
raise_exception=1)
# ------------------------------------
# get serialized inventory values
# ------------------------------------ # ------------------------------------
def get_serialized_inventory_values(self, val_rate, in_rate, opening_qty, actual_qty, is_cancelled, serial_nos): def get_serialized_inventory_values(self, val_rate, in_rate, opening_qty, actual_qty, is_cancelled, serial_nos):
"""
get serialized inventory values
"""
if flt(in_rate) < 0: # wrong incoming rate if flt(in_rate) < 0: # wrong incoming rate
in_rate = val_rate in_rate = val_rate
elif flt(in_rate) == 0: # In case of delivery/stock issue, get average purchase rate of serial nos of current entry elif flt(in_rate) == 0: # In case of delivery/stock issue, get average purchase rate of serial nos of current entry
@@ -220,11 +231,16 @@ class DocType:
stock_val = sum([flt(d[0])*flt(d[1]) for d in self.fcfs_bal]) stock_val = sum([flt(d[0])*flt(d[1]) for d in self.fcfs_bal])
return stock_val return stock_val
# ---------------------- def update_entries_after(self, posting_date, posting_time):
# update item valuation """
# ---------------------- update valution rate and qty after transaction
def update_item_valuation(self, sle_id=None, posting_date=None, posting_time=None, serial_no=None, prev_sle=None): from the current time-bucket onwards
# no sle given, start from the first one (for repost) """
# Get prev sle
prev_sle = self.get_sle_prev_timebucket(posting_date, posting_time)
# if no prev sle, start from the first one (for repost)
if not prev_sle: if not prev_sle:
cqty, cval, val_rate, self.fcfs_bal = 0, 0, 0, [] cqty, cval, val_rate, self.fcfs_bal = 0, 0, 0, []
@@ -235,11 +251,11 @@ class DocType:
val_rate = flt(prev_sle.get('valuation_rate', 0)) val_rate = flt(prev_sle.get('valuation_rate', 0))
self.fcfs_bal = eval(prev_sle.get('fcfs_stack', '[]') or '[]') self.fcfs_bal = eval(prev_sle.get('fcfs_stack', '[]') or '[]')
val_method = get_obj('Valuation Control').get_valuation_method(self.doc.item_code) # get valuation method # get valuation method
val_method = get_obj('Valuation Control').get_valuation_method(self.doc.item_code)
# recalculate the balances for all stock ledger entries # recalculate the balances for all stock ledger entries
# after this one (so that the corrected balance will reflect # after the prev sle
# correctly in all entries after this one)
sll = sql(""" sll = sql("""
select * select *
from `tabStock Ledger Entry` from `tabStock Ledger Entry`
@@ -248,30 +264,32 @@ class DocType:
and ifnull(is_cancelled, 'No') = 'No' and ifnull(is_cancelled, 'No') = 'No'
and timestamp(posting_date, posting_time) > timestamp(%s, %s) and timestamp(posting_date, posting_time) > timestamp(%s, %s)
order by timestamp(posting_date, posting_time) asc, name asc""", \ order by timestamp(posting_date, posting_time) asc, name asc""", \
(self.doc.item_code, self.doc.warehouse, posting_date, posting_time), as_dict = 1) (self.doc.item_code, self.doc.warehouse, \
prev_sle.get('posting_date','1900-01-01'), prev_sle.get('posting_time', '12:00')), as_dict = 1)
# if in live entry - update the values of the current sle for sle in sll:
if sle_id:
sll = sql("select * from `tabStock Ledger Entry` where name=%s and ifnull(is_cancelled, 'No') = 'No'", sle_id, as_dict=1) + sll
for s in sll:
# block if stock level goes negative on any date # block if stock level goes negative on any date
self.validate_negative_stock(cqty, s) self.validate_negative_stock(cqty, sle)
stock_val, in_rate = 0, s['incoming_rate'] # IN stock_val, in_rate = 0, sle['incoming_rate'] # IN
serial_nos = s["serial_no"] and ("'"+"', '".join(cstr(s["serial_no"]).split('\n')) + "'") or '' serial_nos = sle["serial_no"] and ("'"+"', '".join(cstr(sle["serial_no"]).split('\n')) \
+ "'") or ''
# Get valuation rate # Get valuation rate
val_rate, stock_val = self.get_valuation_rate(val_method, serial_nos, val_rate, in_rate, stock_val, cqty, s) val_rate, stock_val = self.get_valuation_rate(val_method, serial_nos, \
val_rate, in_rate, stock_val, cqty, sle)
# Qty upto the sle # Qty upto the sle
cqty += s['actual_qty'] cqty += sle['actual_qty']
# Stock Value upto the sle # Stock Value upto the sle
stock_val = self.get_stock_value(val_method, cqty, stock_val, serial_nos) stock_val = self.get_stock_value(val_method, cqty, stock_val, serial_nos)
# update current sle --> will it be good to update incoming rate in sle for outgoing stock entry?????
# update current sle --> will it be good to update incoming rate in sle
# for outgoing stock entry?????
sql("""update `tabStock Ledger Entry` sql("""update `tabStock Ledger Entry`
set bin_aqat=%s, valuation_rate=%s, fcfs_stack=%s, stock_value=%s set bin_aqat=%s, valuation_rate=%s, fcfs_stack=%s, stock_value=%s
where name=%s""", (cqty, flt(val_rate), cstr(self.fcfs_bal), stock_val, s['name'])) where name=%s""", (cqty, flt(val_rate), cstr(self.fcfs_bal), stock_val, sle['name']))
# update the bin # update the bin
if sll: if sll:

View File

@@ -19,463 +19,504 @@ convert_to_lists = webnotes.conn.convert_to_lists
from utilities.transaction_base import TransactionBase from utilities.transaction_base import TransactionBase
class DocType(TransactionBase): class DocType(TransactionBase):
def __init__(self, doc, doclist=[]): def __init__(self, doc, doclist=[]):
self.doc = doc self.doc = doc
self.doclist = doclist self.doclist = doclist
self.tname = 'Delivery Note Detail' self.tname = 'Delivery Note Detail'
self.fname = 'delivery_note_details' self.fname = 'delivery_note_details'
# Notification objects # Notification objects
self.notify_obj = get_obj('Notification Control') self.notify_obj = get_obj('Notification Control')
# Autoname # Autoname
# --------- # ---------
def autoname(self): def autoname(self):
self.doc.name = make_autoname(self.doc.naming_series+'.#####') self.doc.name = make_autoname(self.doc.naming_series+'.#####')
# DOCTYPE TRIGGERS FUNCTIONS # DOCTYPE TRIGGERS FUNCTIONS
# ============================================================================== # ==============================================================================
#************Fiscal Year Validation***************************** #************Fiscal Year Validation*****************************
def validate_fiscal_year(self): def validate_fiscal_year(self):
get_obj('Sales Common').validate_fiscal_year(self.doc.fiscal_year,self.doc.posting_date,'Posting Date') get_obj('Sales Common').validate_fiscal_year(self.doc.fiscal_year,self.doc.posting_date,'Posting Date')
# ****** Get contact person details based on customer selected **** # ****** Get contact person details based on customer selected ****
def get_contact_details(self): def get_contact_details(self):
return get_obj('Sales Common').get_contact_details(self,0) return get_obj('Sales Common').get_contact_details(self,0)
# *********** Get Commission rate of Sales Partner **************** # *********** Get Commission rate of Sales Partner ****************
def get_comm_rate(self, sales_partner): def get_comm_rate(self, sales_partner):
return get_obj('Sales Common').get_comm_rate(sales_partner, self) return get_obj('Sales Common').get_comm_rate(sales_partner, self)
# *************** Pull Sales Order Details ************************ # *************** Pull Sales Order Details ************************
def pull_sales_order_details(self): def pull_sales_order_details(self):
self.validate_prev_docname() self.validate_prev_docname()
self.doc.clear_table(self.doclist,'other_charges') self.doc.clear_table(self.doclist,'other_charges')
if self.doc.sales_order_no: if self.doc.sales_order_no:
get_obj('DocType Mapper', 'Sales Order-Delivery Note').dt_map('Sales Order', 'Delivery Note', self.doc.sales_order_no, self.doc, self.doclist, "[['Sales Order', 'Delivery Note'],['Sales Order Detail', 'Delivery Note Detail'],['RV Tax Detail','RV Tax Detail'],['Sales Team','Sales Team']]") get_obj('DocType Mapper', 'Sales Order-Delivery Note').dt_map('Sales Order', 'Delivery Note', self.doc.sales_order_no, self.doc, self.doclist, "[['Sales Order', 'Delivery Note'],['Sales Order Detail', 'Delivery Note Detail'],['RV Tax Detail','RV Tax Detail'],['Sales Team','Sales Team']]")
else: else:
msgprint("Please select Sales Order No. whose details need to be pulled") msgprint("Please select Sales Order No. whose details need to be pulled")
return cstr(self.doc.sales_order_no) return cstr(self.doc.sales_order_no)
#-------------------set item details -uom and item group---------------- #-------------------set item details -uom and item group----------------
def set_item_details(self): def set_item_details(self):
for d in getlist(self.doclist,'delivery_note_details'): for d in getlist(self.doclist,'delivery_note_details'):
res = sql("select stock_uom, item_group from `tabItem` where name ='%s'"%d.item_code) res = sql("select stock_uom, item_group from `tabItem` where name ='%s'"%d.item_code)
if not d.stock_uom: d.stock_uom = res and cstr(res[0][0]) or '' if not d.stock_uom: d.stock_uom = res and cstr(res[0][0]) or ''
if not d.item_group: d.item_group = res and cstr(res[0][1]) or '' if not d.item_group: d.item_group = res and cstr(res[0][1]) or ''
d.save() d.save()
# ::::: Validates that Sales Order is not pulled twice ::::::: # ::::: Validates that Sales Order is not pulled twice :::::::
def validate_prev_docname(self): def validate_prev_docname(self):
for d in getlist(self.doclist, 'delivery_note_details'): for d in getlist(self.doclist, 'delivery_note_details'):
if self.doc.sales_order_no == d.prevdoc_docname: if self.doc.sales_order_no == d.prevdoc_docname:
msgprint(cstr(self.doc.sales_order_no) + " sales order details have already been pulled. ") msgprint(cstr(self.doc.sales_order_no) + " sales order details have already been pulled. ")
raise Exception, "Validation Error. " raise Exception, "Validation Error. "
#Set Actual Qty based on item code and warehouse #Set Actual Qty based on item code and warehouse
#------------------------------------------------------ #------------------------------------------------------
def set_actual_qty(self): def set_actual_qty(self):
for d in getlist(self.doclist, 'delivery_note_details'): for d in getlist(self.doclist, 'delivery_note_details'):
if d.item_code and d.warehouse: if d.item_code and d.warehouse:
actual_qty = sql("select actual_qty from `tabBin` where item_code = '%s' and warehouse = '%s'" % (d.item_code, d.warehouse)) actual_qty = sql("select actual_qty from `tabBin` where item_code = '%s' and warehouse = '%s'" % (d.item_code, d.warehouse))
d.actual_qty = actual_qty and flt(actual_qty[0][0]) or 0 d.actual_qty = actual_qty and flt(actual_qty[0][0]) or 0
# GET TERMS & CONDITIONS # GET TERMS & CONDITIONS
# ------------------------------------- # -------------------------------------
def get_tc_details(self): def get_tc_details(self):
return get_obj('Sales Common').get_tc_details(self) return get_obj('Sales Common').get_tc_details(self)
#pull project customer #pull project customer
#------------------------- #-------------------------
def pull_project_customer(self): def pull_project_customer(self):
res = sql("select customer from `tabProject` where name = '%s'"%self.doc.project_name) res = sql("select customer from `tabProject` where name = '%s'"%self.doc.project_name)
if res: if res:
get_obj('DocType Mapper', 'Project-Delivery Note').dt_map('Project', 'Delivery Note', self.doc.project_name, self.doc, self.doclist, "[['Project', 'Delivery Note']]") get_obj('DocType Mapper', 'Project-Delivery Note').dt_map('Project', 'Delivery Note', self.doc.project_name, self.doc, self.doclist, "[['Project', 'Delivery Note']]")
# DELIVERY NOTE DETAILS TRIGGER FUNCTIONS # DELIVERY NOTE DETAILS TRIGGER FUNCTIONS
# ================================================================================ # ================================================================================
# ***************** Get Item Details ****************************** # ***************** Get Item Details ******************************
def get_item_details(self, item_code): def get_item_details(self, item_code):
return get_obj('Sales Common').get_item_details(item_code, self) return get_obj('Sales Common').get_item_details(item_code, self)
# *** Re-calculates Basic Rate & amount based on Price List Selected *** # *** Re-calculates Basic Rate & amount based on Price List Selected ***
def get_adj_percent(self, arg=''): def get_adj_percent(self, arg=''):
get_obj('Sales Common').get_adj_percent(self) get_obj('Sales Common').get_adj_percent(self)
# ********** Get Actual Qty of item in warehouse selected ************* # ********** Get Actual Qty of item in warehouse selected *************
def get_actual_qty(self,args): def get_actual_qty(self,args):
args = eval(args) args = eval(args)
actual_qty = sql("select actual_qty from `tabBin` where item_code = '%s' and warehouse = '%s'" % (args['item_code'], args['warehouse']), as_dict=1) actual_qty = sql("select actual_qty from `tabBin` where item_code = '%s' and warehouse = '%s'" % (args['item_code'], args['warehouse']), as_dict=1)
ret = { ret = {
'actual_qty' : actual_qty and flt(actual_qty[0]['actual_qty']) or 0 'actual_qty' : actual_qty and flt(actual_qty[0]['actual_qty']) or 0
} }
return ret return ret
# OTHER CHARGES TRIGGER FUNCTIONS # OTHER CHARGES TRIGGER FUNCTIONS
# ==================================================================================== # ====================================================================================
# *********** Get Tax rate if account type is TAX ******************** # *********** Get Tax rate if account type is TAX ********************
def get_rate(self,arg): def get_rate(self,arg):
return get_obj('Sales Common').get_rate(arg) return get_obj('Sales Common').get_rate(arg)
# Load Default Charges # Load Default Charges
# ---------------------------------------------------------- # ----------------------------------------------------------
def load_default_taxes(self): def load_default_taxes(self):
return get_obj('Sales Common').load_default_taxes(self) return get_obj('Sales Common').load_default_taxes(self)
# **** Pull details from other charges master (Get Other Charges) **** # **** Pull details from other charges master (Get Other Charges) ****
def get_other_charges(self): def get_other_charges(self):
return get_obj('Sales Common').get_other_charges(self) return get_obj('Sales Common').get_other_charges(self)
#check in manage account if sales order required or not. #check in manage account if sales order required or not.
# ==================================================================================== # ====================================================================================
def so_required(self): def so_required(self):
res = sql("select value from `tabSingles` where doctype = 'Manage Account' and field = 'so_required'") res = sql("select value from `tabSingles` where doctype = 'Manage Account' and field = 'so_required'")
if res and res[0][0] == 'Yes': if res and res[0][0] == 'Yes':
for d in getlist(self.doclist,'delivery_note_details'): for d in getlist(self.doclist,'delivery_note_details'):
if not d.prevdoc_docname: if not d.prevdoc_docname:
msgprint("Sales Order No. required against item %s"%d.item_code) msgprint("Sales Order No. required against item %s"%d.item_code)
raise Exception raise Exception
# VALIDATE # VALIDATE
# ==================================================================================== # ====================================================================================
def validate(self): def validate(self):
self.so_required() self.so_required()
self.validate_fiscal_year() self.validate_fiscal_year()
self.validate_proj_cust() self.validate_proj_cust()
sales_com_obj = get_obj(dt = 'Sales Common') sales_com_obj = get_obj(dt = 'Sales Common')
sales_com_obj.check_stop_sales_order(self) sales_com_obj.check_stop_sales_order(self)
sales_com_obj.check_active_sales_items(self) sales_com_obj.check_active_sales_items(self)
sales_com_obj.get_prevdoc_date(self) sales_com_obj.get_prevdoc_date(self)
self.validate_mandatory() self.validate_mandatory()
#self.validate_prevdoc_details() #self.validate_prevdoc_details()
self.validate_reference_value() self.validate_reference_value()
self.validate_for_items() self.validate_for_items()
sales_com_obj.make_packing_list(self,'delivery_note_details') sales_com_obj.make_packing_list(self,'delivery_note_details')
get_obj('Stock Ledger').validate_serial_no(self, 'packing_details') get_obj('Stock Ledger').validate_serial_no(self, 'packing_details')
sales_com_obj.validate_max_discount(self, 'delivery_note_details') #verify whether rate is not greater than max discount sales_com_obj.validate_max_discount(self, 'delivery_note_details') #verify whether rate is not greater than max discount
sales_com_obj.get_allocated_sum(self) # this is to verify that the allocated % of sales persons is 100% sales_com_obj.get_allocated_sum(self) # this is to verify that the allocated % of sales persons is 100%
sales_com_obj.check_conversion_rate(self) sales_com_obj.check_conversion_rate(self)
# ::::::: Get total in Words :::::::: # ::::::: Get total in Words ::::::::
dcc = TransactionBase().get_company_currency(self.doc.company) dcc = TransactionBase().get_company_currency(self.doc.company)
self.doc.in_words = sales_com_obj.get_total_in_words(dcc, self.doc.rounded_total) self.doc.in_words = sales_com_obj.get_total_in_words(dcc, self.doc.rounded_total)
self.doc.in_words_export = sales_com_obj.get_total_in_words(self.doc.currency, self.doc.rounded_total_export) self.doc.in_words_export = sales_com_obj.get_total_in_words(self.doc.currency, self.doc.rounded_total_export)
# ::::::: Set Net Weight of each Packing # ::::::: Set Net Weight of each Packing
self.update_pack_nett_weight() self.update_pack_nett_weight()
self.print_packing_slip() self.print_packing_slip()
# ::::::: Set actual qty for each item in selected warehouse ::::::: # ::::::: Set actual qty for each item in selected warehouse :::::::
self.update_current_stock() self.update_current_stock()
# :::::: set DN status ::::::: # :::::: set DN status :::::::
self.doc.status = 'Draft' self.doc.status = 'Draft'
if not self.doc.billing_status: self.doc.billing_status = 'Not Billed' if not self.doc.billing_status: self.doc.billing_status = 'Not Billed'
if not self.doc.installation_status: self.doc.installation_status = 'Not Installed' if not self.doc.installation_status: self.doc.installation_status = 'Not Installed'
# ************** Validate Mandatory ************************* # ************** Validate Mandatory *************************
def validate_mandatory(self): def validate_mandatory(self):
# :::::::::: Amendment Date :::::::::::::: # :::::::::: Amendment Date ::::::::::::::
if self.doc.amended_from and not self.doc.amendment_date: if self.doc.amended_from and not self.doc.amendment_date:
msgprint("Please Enter Amendment Date") msgprint("Please Enter Amendment Date")
raise Exception, "Validation Error. " raise Exception, "Validation Error. "
#check for does customer belong to same project as entered.. #check for does customer belong to same project as entered..
#------------------------------------------------------------------------------------------------- #-------------------------------------------------------------------------------------------------
def validate_proj_cust(self): def validate_proj_cust(self):
if self.doc.project_name and self.doc.customer: if self.doc.project_name and self.doc.customer:
res = sql("select name from `tabProject` where name = '%s' and (customer = '%s' or ifnull(customer,'')='')"%(self.doc.project_name, self.doc.customer)) res = sql("select name from `tabProject` where name = '%s' and (customer = '%s' or ifnull(customer,'')='')"%(self.doc.project_name, self.doc.customer))
if not res: if not res:
msgprint("Customer - %s does not belong to project - %s. \n\nIf you want to use project for multiple customers then please make customer details blank in project - %s."%(self.doc.customer,self.doc.project_name,self.doc.project_name)) msgprint("Customer - %s does not belong to project - %s. \n\nIf you want to use project for multiple customers then please make customer details blank in project - %s."%(self.doc.customer,self.doc.project_name,self.doc.project_name))
raise Exception raise Exception
# Validate values with reference document # Validate values with reference document
#---------------------------------------- #----------------------------------------
def validate_reference_value(self): def validate_reference_value(self):
get_obj('DocType Mapper', 'Sales Order-Delivery Note', with_children = 1).validate_reference_value(self, self.doc.name) get_obj('DocType Mapper', 'Sales Order-Delivery Note', with_children = 1).validate_reference_value(self, self.doc.name)
# ******* Validate Previous Document Details ************ # ******* Validate Previous Document Details ************
def validate_prevdoc_details(self): def validate_prevdoc_details(self):
for d in getlist(self.doclist,'delivery_note_details'): for d in getlist(self.doclist,'delivery_note_details'):
prevdoc = d.prevdoc_doctype prevdoc = d.prevdoc_doctype
prevdoc_docname = d.prevdoc_docname prevdoc_docname = d.prevdoc_docname
if prevdoc_docname and prevdoc: if prevdoc_docname and prevdoc:
# ::::::::::: Validates Transaction Date of DN and previous doc (i.e. SO , PO, PR) ********* # ::::::::::: Validates Transaction Date of DN and previous doc (i.e. SO , PO, PR) *********
trans_date = sql("select transaction_date from `tab%s` where name = '%s'" %(prevdoc,prevdoc_docname))[0][0] trans_date = sql("select transaction_date from `tab%s` where name = '%s'" %(prevdoc,prevdoc_docname))[0][0]
if trans_date and getdate(self.doc.transaction_date) < (trans_date): if trans_date and getdate(self.doc.transaction_date) < (trans_date):
msgprint("Your Voucher Date cannot be before "+cstr(prevdoc)+" Date.") msgprint("Your Voucher Date cannot be before "+cstr(prevdoc)+" Date.")
raise Exception raise Exception
# ::::::::: Validates DN and previous doc details :::::::::::::::::: # ::::::::: Validates DN and previous doc details ::::::::::::::::::
get_name = sql("select name from `tab%s` where name = '%s'" % (prevdoc, prevdoc_docname)) get_name = sql("select name from `tab%s` where name = '%s'" % (prevdoc, prevdoc_docname))
name = get_name and get_name[0][0] or '' name = get_name and get_name[0][0] or ''
if name: #check for incorrect docname if name: #check for incorrect docname
if prevdoc == 'Sales Order': if prevdoc == 'Sales Order':
dt = sql("select company, docstatus, customer, currency, sales_partner from `tab%s` where name = '%s'" % (prevdoc, name)) dt = sql("select company, docstatus, customer, currency, sales_partner from `tab%s` where name = '%s'" % (prevdoc, name))
cust_name = dt and dt[0][2] or '' cust_name = dt and dt[0][2] or ''
if cust_name != self.doc.customer: if cust_name != self.doc.customer:
msgprint(cstr(prevdoc) + ": " + cstr(prevdoc_docname) + " customer :" + cstr(cust_name) + " does not match with customer : " + cstr(self.doc.customer) + " of current document.") msgprint(cstr(prevdoc) + ": " + cstr(prevdoc_docname) + " customer :" + cstr(cust_name) + " does not match with customer : " + cstr(self.doc.customer) + " of current document.")
raise Exception, "Validation Error. " raise Exception, "Validation Error. "
sal_partner = dt and dt[0][4] or '' sal_partner = dt and dt[0][4] or ''
if sal_partner != self.doc.sales_partner: if sal_partner != self.doc.sales_partner:
msgprint(cstr(prevdoc) + ": " + cstr(prevdoc_docname) + " sales partner name :" + cstr(sal_partner) + " does not match with sales partner name : " + cstr(self.doc.sales_partner_name) + " of current document.") msgprint(cstr(prevdoc) + ": " + cstr(prevdoc_docname) + " sales partner name :" + cstr(sal_partner) + " does not match with sales partner name : " + cstr(self.doc.sales_partner_name) + " of current document.")
raise Exception, "Validation Error. " raise Exception, "Validation Error. "
else: else:
dt = sql("select company, docstatus, supplier, currency from `tab%s` where name = '%s'" % (prevdoc, name)) dt = sql("select company, docstatus, supplier, currency from `tab%s` where name = '%s'" % (prevdoc, name))
supp_name = dt and dt[0][2] or '' supp_name = dt and dt[0][2] or ''
company_name = dt and dt[0][0] or '' company_name = dt and dt[0][0] or ''
docstatus = dt and dt[0][1] or 0 docstatus = dt and dt[0][1] or 0
currency = dt and dt[0][3] or '' currency = dt and dt[0][3] or ''
if (currency != self.doc.currency): if (currency != self.doc.currency):
msgprint(cstr(prevdoc) + ": " + cstr(prevdoc_docname) + " currency : "+ cstr(currency) + "does not match with Currency: " + cstr(self.doc.currency) + "of current document") msgprint(cstr(prevdoc) + ": " + cstr(prevdoc_docname) + " currency : "+ cstr(currency) + "does not match with Currency: " + cstr(self.doc.currency) + "of current document")
raise Exception, "Validation Error." raise Exception, "Validation Error."
if (company_name != self.doc.company): if (company_name != self.doc.company):
msgprint(cstr(prevdoc) + ": " + cstr(prevdoc_docname) + " does not belong to the Company: " + cstr(self.doc.company_name)) msgprint(cstr(prevdoc) + ": " + cstr(prevdoc_docname) + " does not belong to the Company: " + cstr(self.doc.company_name))
raise Exception, "Validation Error." raise Exception, "Validation Error."
if (docstatus != 1): if (docstatus != 1):
msgprint(cstr(prevdoc) + ": " + cstr(prevdoc_docname) + " is not Submitted Document.") msgprint(cstr(prevdoc) + ": " + cstr(prevdoc_docname) + " is not Submitted Document.")
raise Exception, "Validation Error." raise Exception, "Validation Error."
else: else:
msgprint(cstr(prevdoc) + ": " + cstr(prevdoc_docname) + " is not a valid " + cstr(prevdoc)) msgprint(cstr(prevdoc) + ": " + cstr(prevdoc_docname) + " is not a valid " + cstr(prevdoc))
raise Exception, "Validation Error." raise Exception, "Validation Error."
# ******************** Validate Items ************************** # ******************** Validate Items **************************
def validate_for_items(self): def validate_for_items(self):
check_list, chk_dupl_itm = [], [] check_list, chk_dupl_itm = [], []
for d in getlist(self.doclist,'delivery_note_details'): for d in getlist(self.doclist,'delivery_note_details'):
ch = sql("select is_stock_item from `tabItem` where name = '%s'"%d.item_code) ch = sql("select is_stock_item from `tabItem` where name = '%s'"%d.item_code)
if d.prevdoc_doctype and d.prevdoc_detail_docname and ch and ch[0][0]=='Yes': if d.prevdoc_doctype and d.prevdoc_detail_docname and ch and ch[0][0]=='Yes':
self.validate_items_with_prevdoc(d) self.validate_items_with_prevdoc(d)
# validates whether item is not entered twice # validates whether item is not entered twice
e = [d.item_code, d.description, d.warehouse, d.prevdoc_docname or '', d.batch_no or ''] e = [d.item_code, d.description, d.warehouse, d.prevdoc_docname or '', d.batch_no or '']
f = [d.item_code, d.description, d.prevdoc_docname or ''] f = [d.item_code, d.description, d.prevdoc_docname or '']
if ch and ch[0][0] == 'Yes': if ch and ch[0][0] == 'Yes':
if e in check_list: if e in check_list:
msgprint("Please check whether item %s has been entered twice wrongly." % d.item_code) msgprint("Please check whether item %s has been entered twice wrongly." % d.item_code)
else: else:
check_list.append(e) check_list.append(e)
elif ch and ch[0][0] == 'No': elif ch and ch[0][0] == 'No':
if f in chk_dupl_itm: if f in chk_dupl_itm:
msgprint("Please check whether item %s has been entered twice wrongly." % d.item_code) msgprint("Please check whether item %s has been entered twice wrongly." % d.item_code)
else: else:
chk_dupl_itm.append(f) chk_dupl_itm.append(f)
# check if same item, warehouse present in prevdoc # check if same item, warehouse present in prevdoc
# ------------------------------------------------------------------ # ------------------------------------------------------------------
def validate_items_with_prevdoc(self, d): def validate_items_with_prevdoc(self, d):
if d.prevdoc_doctype == 'Sales Order': if d.prevdoc_doctype == 'Sales Order':
data = sql("select item_code, reserved_warehouse from `tabSales Order Detail` where parent = '%s' and name = '%s'" % (d.prevdoc_docname, d.prevdoc_detail_docname)) data = sql("select item_code, reserved_warehouse from `tabSales Order Detail` where parent = '%s' and name = '%s'" % (d.prevdoc_docname, d.prevdoc_detail_docname))
if d.prevdoc_doctype == 'Purchase Receipt': if d.prevdoc_doctype == 'Purchase Receipt':
data = sql("select item_code, rejected_warehouse from `tabPurchase Receipt Detail` where parent = '%s' and name = '%s'" % (d.prevdoc_docname, d.prevdoc_detail_docname)) data = sql("select item_code, rejected_warehouse from `tabPurchase Receipt Detail` where parent = '%s' and name = '%s'" % (d.prevdoc_docname, d.prevdoc_detail_docname))
if not data or data[0][0] != d.item_code or data[0][1] != d.warehouse: if not data or data[0][0] != d.item_code or data[0][1] != d.warehouse:
msgprint("Item: %s / Warehouse: %s is not matching with Sales Order: %s. Sales Order might be modified after fetching data from it. Please delete items and fetch again." % (d.item_code, d.warehouse, d.prevdoc_docname)) msgprint("Item: %s / Warehouse: %s is not matching with Sales Order: %s. Sales Order might be modified after fetching data from it. Please delete items and fetch again." % (d.item_code, d.warehouse, d.prevdoc_docname))
raise Exception raise Exception
# ********* UPDATE CURRENT STOCK ***************************** # ********* UPDATE CURRENT STOCK *****************************
def update_current_stock(self): def update_current_stock(self):
for d in getlist(self.doclist, 'delivery_note_details'): for d in getlist(self.doclist, 'delivery_note_details'):
bin = sql("select actual_qty from `tabBin` where item_code = %s and warehouse = %s", (d.item_code, d.warehouse), as_dict = 1) bin = sql("select actual_qty from `tabBin` where item_code = %s and warehouse = %s", (d.item_code, d.warehouse), as_dict = 1)
d.actual_qty = bin and flt(bin[0]['actual_qty']) or 0 d.actual_qty = bin and flt(bin[0]['actual_qty']) or 0
for d in getlist(self.doclist, 'packing_details'): for d in getlist(self.doclist, 'packing_details'):
bin = sql("select actual_qty, projected_qty from `tabBin` where item_code = %s and warehouse = %s", (d.item_code, d.warehouse), as_dict = 1) bin = sql("select actual_qty, projected_qty from `tabBin` where item_code = %s and warehouse = %s", (d.item_code, d.warehouse), as_dict = 1)
d.actual_qty = bin and flt(bin[0]['actual_qty']) or 0 d.actual_qty = bin and flt(bin[0]['actual_qty']) or 0
d.projected_qty = bin and flt(bin[0]['projected_qty']) or 0 d.projected_qty = bin and flt(bin[0]['projected_qty']) or 0
# ON SUBMIT # ON SUBMIT
# ================================================================================================= # =================================================================================================
def on_submit(self): def on_submit(self):
set(self.doc, 'message', 'Items against your Order #%s have been delivered. Delivery #%s: ' % (self.doc.po_no, self.doc.name)) set(self.doc, 'message', 'Items against your Order #%s have been delivered. Delivery #%s: ' % (self.doc.po_no, self.doc.name))
self.check_qty_in_stock() self.check_qty_in_stock()
# Check for Approving Authority # Check for Approving Authority
get_obj('Authorization Control').validate_approving_authority(self.doc.doctype, self.doc.company, self.doc.grand_total, self) get_obj('Authorization Control').validate_approving_authority(self.doc.doctype, self.doc.company, self.doc.grand_total, self)
sl_obj = get_obj("Stock Ledger") sl_obj = get_obj("Stock Ledger")
sl_obj.validate_serial_no_warehouse(self, 'packing_details') sl_obj.validate_serial_no_warehouse(self, 'packing_details')
sl_obj.update_serial_record(self, 'packing_details', is_submit = 1, is_incoming = 0) sl_obj.update_serial_record(self, 'packing_details', is_submit = 1, is_incoming = 0)
get_obj("Sales Common").update_prevdoc_detail(1,self) get_obj("Sales Common").update_prevdoc_detail(1,self)
self.update_stock_ledger(update_stock = 1) self.update_stock_ledger(update_stock = 1)
#------------Check Credit Limit--------------------- #------------Check Credit Limit---------------------
self.credit_limit() self.credit_limit()
# set DN status # set DN status
set(self.doc, 'status', 'Submitted') set(self.doc, 'status', 'Submitted')
# on submit notification # on submit notification
self.notify_obj.notify_contact('Delivery Note',self.doc.doctype,self.doc.name, self.doc.email_id, self.doc.contact_person) self.notify_obj.notify_contact('Delivery Note',self.doc.doctype,self.doc.name, self.doc.email_id, self.doc.contact_person)
# *********** Checks whether actual quantity is present in warehouse ************* # *********** Checks whether actual quantity is present in warehouse *************
def check_qty_in_stock(self): def check_qty_in_stock(self):
for d in getlist(self.doclist, 'packing_details'): for d in getlist(self.doclist, 'packing_details'):
is_stock_item = sql("select is_stock_item from `tabItem` where name = '%s'" % d.item_code)[0][0] is_stock_item = sql("select is_stock_item from `tabItem` where name = '%s'" % d.item_code)[0][0]
if is_stock_item == 'Yes' and d.warehouse and flt(d.qty) > flt(d.actual_qty): if is_stock_item == 'Yes' and d.warehouse and flt(d.qty) > flt(d.actual_qty):
msgprint("For Item: " + cstr(d.item_code) + " at Warehouse: " + cstr(d.warehouse) + " Quantity: " + cstr(d.qty) +" is not Available. (Must be less than or equal to " + cstr(d.actual_qty) + " )") msgprint("For Item: " + cstr(d.item_code) + " at Warehouse: " + cstr(d.warehouse) + " Quantity: " + cstr(d.qty) +" is not Available. (Must be less than or equal to " + cstr(d.actual_qty) + " )")
raise Exception, "Validation Error" raise Exception, "Validation Error"
# ON CANCEL # ON CANCEL
# ================================================================================================= # =================================================================================================
def on_cancel(self): def on_cancel(self):
sales_com_obj = get_obj(dt = 'Sales Common') sales_com_obj = get_obj(dt = 'Sales Common')
sales_com_obj.check_stop_sales_order(self) sales_com_obj.check_stop_sales_order(self)
self.check_next_docstatus() self.check_next_docstatus()
get_obj('Stock Ledger').update_serial_record(self, 'packing_details', is_submit = 0, is_incoming = 0) get_obj('Stock Ledger').update_serial_record(self, 'packing_details', is_submit = 0, is_incoming = 0)
sales_com_obj.update_prevdoc_detail(0,self) sales_com_obj.update_prevdoc_detail(0,self)
self.update_stock_ledger(update_stock = -1) self.update_stock_ledger(update_stock = -1)
# :::::: set DN status ::::::: # :::::: set DN status :::::::
set(self.doc, 'status', 'Cancelled') set(self.doc, 'status', 'Cancelled')
# ******************** Check Next DocStatus ************************** # ******************** Check Next DocStatus **************************
def check_next_docstatus(self): def check_next_docstatus(self):
submit_rv = sql("select t1.name from `tabReceivable Voucher` t1,`tabRV Detail` t2 where t1.name = t2.parent and t2.delivery_note = '%s' and t1.docstatus = 1" % (self.doc.name)) submit_rv = sql("select t1.name from `tabReceivable Voucher` t1,`tabRV Detail` t2 where t1.name = t2.parent and t2.delivery_note = '%s' and t1.docstatus = 1" % (self.doc.name))
if submit_rv: if submit_rv:
msgprint("Sales Invoice : " + cstr(submit_rv[0][0]) + " has already been submitted !") msgprint("Sales Invoice : " + cstr(submit_rv[0][0]) + " has already been submitted !")
raise Exception , "Validation Error." raise Exception , "Validation Error."
submit_in = sql("select t1.name from `tabInstallation Note` t1, `tabInstalled Item Details` t2 where t1.name = t2.parent and t2.prevdoc_docname = '%s' and t1.docstatus = 1" % (self.doc.name)) submit_in = sql("select t1.name from `tabInstallation Note` t1, `tabInstalled Item Details` t2 where t1.name = t2.parent and t2.prevdoc_docname = '%s' and t1.docstatus = 1" % (self.doc.name))
if submit_in: if submit_in:
msgprint("Installation Note : "+cstr(submit_in[0][0]) +" has already been submitted !") msgprint("Installation Note : "+cstr(submit_in[0][0]) +" has already been submitted !")
raise Exception , "Validation Error." raise Exception , "Validation Error."
# UPDATE STOCK LEDGER # UPDATE STOCK LEDGER
# ================================================================================================= # =================================================================================================
def update_stock_ledger(self, update_stock, is_stopped = 0): def update_stock_ledger(self, update_stock, is_stopped = 0):
self.values = [] self.values = []
for d in self.get_item_list(is_stopped): for d in self.get_item_list(is_stopped):
stock_item = sql("SELECT is_stock_item, is_sample_item FROM tabItem where name = '%s'"%(d[1]), as_dict = 1) # stock ledger will be updated only if it is a stock item stock_item = sql("SELECT is_stock_item, is_sample_item FROM tabItem where name = '%s'"%(d[1]), as_dict = 1) # stock ledger will be updated only if it is a stock item
if stock_item[0]['is_stock_item'] == "Yes": if stock_item[0]['is_stock_item'] == "Yes":
if not d[0]: if not d[0]:
msgprint("Message: Please enter Warehouse for item %s as it is stock item."% d[1]) msgprint("Message: Please enter Warehouse for item %s as it is stock item."% d[1])
raise Exception raise Exception
# if prevdoc_doctype = "Sales Order" # if prevdoc_doctype = "Sales Order"
if d[3] < 0 : if d[3] < 0 :
# Reduce Reserved Qty from warehouse # Reduce Reserved Qty from warehouse
bin = get_obj('Warehouse', d[0]).update_bin(0, flt(update_stock) * flt(d[3]), 0, 0, 0, d[1], self.doc.transaction_date) bin = get_obj('Warehouse', d[0]).update_bin(0, flt(update_stock) * flt(d[3]), 0, 0, 0, d[1], self.doc.transaction_date)
# Reduce actual qty from warehouse # Reduce actual qty from warehouse
self.make_sl_entry(d, d[0], - flt(d[2]) , 0, update_stock) self.make_sl_entry(d, d[0], - flt(d[2]) , 0, update_stock)
get_obj('Stock Ledger', 'Stock Ledger').update_stock(self.values) get_obj('Stock Ledger', 'Stock Ledger').update_stock(self.values)
# ***************** Gets Items from packing list ***************** # ***************** Gets Items from packing list *****************
def get_item_list(self, is_stopped): def get_item_list(self, is_stopped):
return get_obj('Sales Common').get_item_list(self, is_stopped) return get_obj('Sales Common').get_item_list(self, is_stopped)
# ********************** Make Stock Entry ************************************ # ********************** Make Stock Entry ************************************
def make_sl_entry(self, d, wh, qty, in_value, update_stock): def make_sl_entry(self, d, wh, qty, in_value, update_stock):
self.values.append({ self.values.append({
'item_code' : d[1], 'item_code' : d[1],
'warehouse' : wh, 'warehouse' : wh,
'transaction_date' : self.doc.transaction_date, 'transaction_date' : self.doc.transaction_date,
'posting_date' : self.doc.posting_date, 'posting_date' : self.doc.posting_date,
'posting_time' : self.doc.posting_time, 'posting_time' : self.doc.posting_time,
'voucher_type' : 'Delivery Note', 'voucher_type' : 'Delivery Note',
'voucher_no' : self.doc.name, 'voucher_no' : self.doc.name,
'voucher_detail_no' : '', 'voucher_detail_no' : '',
'actual_qty' : qty, 'actual_qty' : qty,
'stock_uom' : d[4], 'stock_uom' : d[4],
'incoming_rate' : in_value, 'incoming_rate' : in_value,
'company' : self.doc.company, 'company' : self.doc.company,
'fiscal_year' : self.doc.fiscal_year, 'fiscal_year' : self.doc.fiscal_year,
'is_cancelled' : (update_stock==1) and 'No' or 'Yes', 'is_cancelled' : (update_stock==1) and 'No' or 'Yes',
'batch_no' : d[5], 'batch_no' : d[5],
'serial_no' : d[6] 'serial_no' : d[6]
}) })
# SEND SMS # SEND SMS
# ============================================================================================ # ============================================================================================
def send_sms(self): def send_sms(self):
if not self.doc.customer_mobile_no: if not self.doc.customer_mobile_no:
msgprint("Please enter customer mobile no") msgprint("Please enter customer mobile no")
elif not self.doc.message: elif not self.doc.message:
msgprint("Please enter the message you want to send") msgprint("Please enter the message you want to send")
else: else:
msgprint(get_obj("SMS Control", "SMS Control").send_sms([self.doc.customer_mobile_no,], self.doc.message)) msgprint(get_obj("SMS Control", "SMS Control").send_sms([self.doc.customer_mobile_no,], self.doc.message))
#------------ check credit limit of items in DN Detail which are not fetched from sales order---------- #------------ check credit limit of items in DN Detail which are not fetched from sales order----------
def credit_limit(self): def credit_limit(self):
amount, total = 0, 0 amount, total = 0, 0
for d in getlist(self.doclist, 'delivery_note_details'): for d in getlist(self.doclist, 'delivery_note_details'):
if not d.prevdoc_docname: if not d.prevdoc_docname:
amount += d.amount amount += d.amount
if amount != 0: if amount != 0:
total = (amount/self.doc.net_total)*self.doc.grand_total total = (amount/self.doc.net_total)*self.doc.grand_total
get_obj('Sales Common').check_credit(self, total) get_obj('Sales Common').check_credit(self, total)
# on update # on update
def on_update(self): def on_update(self):
self.set_actual_qty() self.set_actual_qty()
get_obj('Stock Ledger').scrub_serial_nos(self) get_obj('Stock Ledger').scrub_serial_nos(self)
# Repair Delivery Note # Repair Delivery Note
# =========================================== # ===========================================
def repair_delivery_note(self): def repair_delivery_note(self):
get_obj('Sales Common', 'Sales Common').repair_curr_doctype_details(self) get_obj('Sales Common', 'Sales Common').repair_curr_doctype_details(self)
# Packing Slip Related # Packing Slip Related
# ========================================== # ==========================================
def update_pack_nett_weight(self): def update_pack_nett_weight(self):
for d in getlist(self.doclist, 'delivery_note_details'): for d in getlist(self.doclist, 'delivery_note_details'):
if d.item_code: if d.item_code and not d.pack_nett_wt:
item_wt = sql("select nett_weight from `tabItem` where name = %s", (d.item_code)) item_wt = sql("select nett_weight from `tabItem` where name = %s", (d.item_code))
d.pack_nett_wt = item_wt and flt(item_wt[0][0])*flt(d.qty) or 0 d.pack_nett_wt = item_wt and flt(item_wt[0][0]) or 0
# ==========================================
def print_packing_slip(self):
prev_pack='0'
sno=0
html=''
tot_nett_wt,tot_gross_wt=0,0
for d in getlist(self.doclist, 'delivery_note_details'):
sno=sno+1
if sno!=1:#Footer goes here
html+='</table><table width="100%"><tr><td>CASE NO</td><td>'+cstr(d.pack_no)+'</td><td>NETT WT</td><td>'+cstr(tot_nett_wt)+'</td><td>CHECKED BY</td><td></td></tr><tr><td>SIZE</td><td></td><td>GROSS WT</td><td>'+cstr(tot_gross_wt)+'</td><td>PACKED BY</td><td></td></tr></table>'
if prev_pack!=d.pack_no: #Prepare Header Here
#Header code goes here
html+='<div align="center">[HEADER GOES HERE]</div><div><center><h2>Packing Slip</h2></center></div> <table width="100%"><tr><td>Order No.</td><td>'+cstr(self.doc.sales_order_no)+'</td><td>Shipping Marks</td><td>'+cstr(d.pack_no)+'</td></tr></table>'
html+='<table class="cust_tbl" style="page-break-after:always" width="100%"><tr><td>S.NO.</td><td>QUANTITY</td><td>CS.NO.</td><td>DESCRIPTION</td><td>WEIGHT</td><tr>'
sno=0
tot_nett_wt,to_gross_wt=flt(d.pack_nett_wt),flt(d.pack_gross_wt)
#Body code goes here
html+='<tr><td>'+cstr(sno+1)+'</td><td>'+cstr(d.qty)+'</td><td></td><td>'+d.item_code+'</td><td>'+cstr(d.pack_nett_wt)+'</td></tr>'
prev_pack=d.pack_no
tot_nett_wt+=flt(d.pack_nett_wt)
tot_gross_wt+=flt(d.pack_gross_wt)
html+='</html>'
self.doc.print_packing_slip=html
# ==========================================
def get_header(self, so_no, shipping_mark):
header = '''
<div align="center">[HEADER GOES HERE]</div>
<div><center><h2>Packing Slip</h2></center></div>
<table width="100%" class="large_font">
<tr>
<td width="20%">ORDER NO.</td>
<td width="30%">'''+cstr(so_no)+'''</td>
<td width="20%">SHIPPING MARKS</td>
<td width="30%">'''+cstr(shipping_mark)+'''</td>
</tr>
</table>''';
return header
def get_footer(self, row, tot_nett, tot_gross):
footer = '''
<table style="page-break-after:always" width="100%" class="large_font">
<tr>
<td>CASE NO</td><td>'''+cstr(row.pack_no)+'''</td>
<td>NETT WT</td><td>'''+cstr(tot_nett)+'''</td>
<td>CHECKED BY</td><td>'''+cstr(row.packing_checked_by)+'''</td>
</tr>
<tr>
<td>SIZE</td><td>'''+cstr(row.pack_size)+'''</td>
<td>GROSS WT</td><td>'''+cstr(tot_gross)+'''</td>
<td>PACKED BY</td><td>'''+cstr(row.packed_by)+'''</td>
</tr>
</table>'''
return footer
def print_packing_slip(self):
plist = {}
for d in getlist(self.doclist, 'delivery_note_details'):
if not plist.has_key(cstr(d.pack_no)):
plist[cstr(d.pack_no)] = [d]
else:
plist.get(cstr(d.pack_no)).append(d)
html=''
for d in sorted(plist.keys()):
tot_nett_wt,tot_gross_wt=0,0
# header
html += self.get_header(self.doc.sales_order_no, self.doc.shipping_mark)
# item table header
html += '''
<table class="cust_tbl" width="100%">
<tr>
<td><b>SR.NO.</b></td><td><b>CS.NO.</b></td><td><b>DESCRIPTION</b></td>
<td><b>QUANTITY</b></td><td><b>WEIGHT</b></td>
</tr>'''
# item table data
sr_no = 1
for r in plist.get(d):
html += '<tr><td>'+cstr(sr_no)+'</td><td>'+r.item_code+'</td><td>'+r.description+'</td><td>'+cstr(r.qty)+'</td><td>'+cstr(r.pack_nett_wt)+'</td></tr>'
tot_nett_wt += flt(r.pack_nett_wt)
tot_gross_wt += flt(r.pack_gross_wt)
sr_no += 1
html += '</table>'
# footer
html += self.get_footer(r, tot_nett_wt, tot_gross_wt)
self.doc.print_packing_slip=html

View File

@@ -5,7 +5,7 @@
{ {
'creation': '2011-04-18 15:58:20', 'creation': '2011-04-18 15:58:20',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-09-07 17:36:34', 'modified': '2011-10-18 13:57:23',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
@@ -21,7 +21,7 @@
# These values are common for all DocType # These values are common for all DocType
{ {
'_last_update': '1314093417', '_last_update': '1318321312',
'colour': 'White:FFF', 'colour': 'White:FFF',
'default_print_format': 'Standard', 'default_print_format': 'Standard',
'doctype': 'DocType', 'doctype': 'DocType',
@@ -37,7 +37,7 @@
'show_in_menu': 0, 'show_in_menu': 0,
'subject': 'To %(customer_name)s on %(transaction_date)s | %(per_billed)s% billed', 'subject': 'To %(customer_name)s on %(transaction_date)s | %(per_billed)s% billed',
'tag_fields': 'billing_status', 'tag_fields': 'billing_status',
'version': 450 'version': 454
}, },
# These values are common for all DocFormat # These values are common for all DocFormat
@@ -114,6 +114,18 @@
'write': 1 'write': 1
}, },
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': 'DocPerm',
'permlevel': 0,
'role': 'Sales Manager',
'submit': 1,
'write': 1
},
# DocPerm # DocPerm
{ {
'doctype': 'DocPerm', 'doctype': 'DocPerm',
@@ -133,11 +145,6 @@
'doctype': 'DocFormat' 'doctype': 'DocFormat'
}, },
# DocFormat
{
'doctype': 'DocFormat'
},
# DocField # DocField
{ {
'colour': 'White:FFF', 'colour': 'White:FFF',
@@ -627,6 +634,7 @@
# DocField # DocField
{ {
'allow_on_submit': 1,
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'delivery_note_details', 'fieldname': 'delivery_note_details',
'fieldtype': 'Table', 'fieldtype': 'Table',
@@ -1390,6 +1398,42 @@
'in_filter': 0, 'in_filter': 0,
'label': 'Print Packing Slip', 'label': 'Print Packing Slip',
'permlevel': 0, 'permlevel': 0,
'print_hide': 0 'print_hide': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'shipping_mark',
'fieldtype': 'Text',
'label': 'Shipping Mark',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'packed_by',
'fieldtype': 'Text',
'label': 'Packed By',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'packing_checked_by',
'fieldtype': 'Text',
'label': 'Packing Checked By',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'pack_size',
'fieldtype': 'Text',
'label': 'Pack Size',
'permlevel': 0
} }
] ]

View File

@@ -5,15 +5,17 @@
{ {
'creation': '2010-08-08 17:08:58', 'creation': '2010-08-08 17:08:58',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-09-07 17:34:13', 'modified': '2011-10-18 16:32:44',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
# These values are common for all DocType # These values are common for all DocType
{ {
'_last_update': '1311621379',
'autoname': 'DND/.#######', 'autoname': 'DND/.#######',
'colour': 'White:FFF', 'colour': 'White:FFF',
'default_print_format': 'Standard',
'doctype': 'DocType', 'doctype': 'DocType',
'istable': 1, 'istable': 1,
'module': 'Stock', 'module': 'Stock',
@@ -21,7 +23,7 @@
'section_style': 'Tray', 'section_style': 'Tray',
'server_code_error': ' ', 'server_code_error': ' ',
'show_in_menu': 0, 'show_in_menu': 0,
'version': 40 'version': 43
}, },
# These values are common for all DocField # These values are common for all DocField
@@ -354,6 +356,37 @@
'width': '100px' 'width': '100px'
}, },
# DocField
{
'doctype': 'DocField',
'fieldname': 'pack_size',
'fieldtype': 'Data',
'label': 'Pack Size',
'no_copy': 0,
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'packed_by',
'fieldtype': 'Data',
'label': 'Packed By',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'packing_checked_by',
'fieldtype': 'Data',
'label': 'Packing Checked By',
'permlevel': 0,
'print_hide': 1
},
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': 'DocField',

View File

@@ -63,6 +63,9 @@ class DocType:
child.conversion_factor = 1 child.conversion_factor = 1
child.save() child.save()
# On delete 1. Delete BIN (if none of the corrosponding transactions present, it gets deleted. if present, rolled back due to exception)
def on_trash(self):
sql("delete from tabBin where item_code='%s'"%(self.doc.item_code))
# Check whether Ref Rate is not entered twice for same Price List and Currency # Check whether Ref Rate is not entered twice for same Price List and Currency
def check_ref_rate_detail(self): def check_ref_rate_detail(self):
@@ -124,7 +127,7 @@ class DocType:
self.doc.min_order_qty = 0 self.doc.min_order_qty = 0
self.check_non_asset_warehouse() self.check_non_asset_warehouse()
if self.doc.is_pro_applicable == 'Yes' and self.doc.is_manufactured_item != 'Yes': if self.doc.is_pro_applicable and self.doc.is_pro_applicable == 'Yes' and self.doc.is_manufactured_item and self.doc.is_manufactured_item != 'Yes':
msgprint("If making Production Order is allowed then, it should also allow to make Bill of Materials. Refer Manufacturing section.") msgprint("If making Production Order is allowed then, it should also allow to make Bill of Materials. Refer Manufacturing section.")
raise Exception raise Exception

View File

@@ -0,0 +1,62 @@
import unittest
import webnotes
import copy
from webnotes.model.doclist import DocList
from webnotes.model.doc import Document
from webnotes.model.code import get_obj
from webnotes.utils import flt
sql = webnotes.conn.sql
class TestItem(unittest.TestCase):
def setUp(self):
webnotes.conn.begin()
def tearDown(self):
webnotes.conn.rollback()
def testInsert(self):
d = DocList()
count_before = flt(sql("select count(*) from tab"+_doctype)[0][0])
if docok:
for i in docok:
d.doc = i
d.children = None
d.doc.fields['__islocal']=1
d.save(1)
count_after = flt(sql("select count(*) from tab"+_doctype)[0][0])
self.assertTrue(count_before+len(docok)==count_after)
def testFailAssert(self):
if docnotok:
with self.assertRaises(Exception) as context:
d = DocList()
d.doc = docnotok[0]
d.children = None
d.doc.fields['__islocal']=1
d.save(1)
# Test Data
tabOK = [
{'is_purchase_item': None, 'is_pro_applicable': 'No', 'is_manufactured_item': None, 'description': 'Gel Ink', 'default_warehouse': None, 'item_name': 'Gel Ink', 'item_group': 'Ink', 'item_code': 'GELINK', 'is_sub_contracted_item': None, 'is_stock_item': 'Yes', 'stock_uom': 'Nos', 'docstatus': '0'},
{'is_purchase_item': None, 'is_pro_applicable': 'No', 'is_manufactured_item': None, 'description': 'Gel Refill', 'default_warehouse': None, 'item_name': 'Gel Refill', 'item_group': 'Refill', 'item_code': 'GELREF', 'is_sub_contracted_item': None, 'is_stock_item': 'Yes', 'stock_uom': 'Nos', 'docstatus': '0'},
{'is_purchase_item': None, 'is_pro_applicable': 'No', 'is_manufactured_item': None, 'description': 'Gel Pen', 'default_warehouse': None, 'item_name': 'Gel Pen', 'item_group': 'Pen', 'item_code': 'GELPEN', 'is_sub_contracted_item': None, 'is_stock_item': 'Yes', 'stock_uom': 'Nos', 'docstatus': '0'}
]
tabNotOK = [
{'is_purchase_item': None, 'is_pro_applicable': None, 'is_manufactured_item': None, 'description': 'F Ink', 'default_warehouse': None, 'item_name': 'F Ink', 'item_group': 'F Ink', 'item_code': None, 'is_sub_contracted_item': None, 'is_stock_item': 'No', 'stock_uom': 'Nos', 'docstatus': '0'}
]
_doctype = 'Item'
for i in tabOK: i['doctype']=_doctype
for i in tabNotOK: i['doctype']=_doctype
docok = [Document(fielddata=r) for r in tabOK]
docnotok = [Document(fielddata=r) for r in tabNotOK]

View File

@@ -2,10 +2,7 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
if(!doc.currency){doc.currency = sys_defaults.currency;} if(!doc.currency){doc.currency = sys_defaults.currency;}
} }
cur_frm.fields_dict['landed_cost_details'].grid.get_field("account_head").get_query = function(doc,cdt,cdn) {
return 'SELECT tabAccount.name FROM tabAccount WHERE tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus != 2 AND tabAccount.account_type = "Chargeable" AND tabAccount.name LIKE "%s"'
}
cur_frm.fields_dict['landed_cost_details'].grid.get_field("account_head").get_query = function(doc,cdt,cdn) { cur_frm.fields_dict['landed_cost_details'].grid.get_field("account_head").get_query = function(doc,cdt,cdn) {
return 'SELECT tabAccount.name FROM tabAccount WHERE tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus != 2 AND (tabAccount.account_type = "Tax" OR tabAccount.account_type = "Chargeable") AND tabAccount.name LIKE "%s"' return 'SELECT tabAccount.name FROM tabAccount WHERE tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus != 2 AND (tabAccount.account_type = "Tax" OR tabAccount.account_type = "Chargeable" or (tabAccount.is_pl_account = "Yes" and tabAccount.debit_or_credit = "Debit")) AND tabAccount.name LIKE "%s"';
} }

View File

@@ -1,236 +1,47 @@
# Please edit this list and import only required elements
import webnotes import webnotes
from webnotes.utils import cint, cstr, flt
from webnotes.model.doc import addchild, getchildren
from webnotes.model.doclist import getlist
from webnotes.model.code import get_obj
from webnotes import msgprint
from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, generate_hash, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add
from webnotes.model import db_exists
from webnotes.model.doc import Document, addchild, removechild, getchildren, make_autoname, SuperDocType
from webnotes.model.doclist import getlist, copy_doclist
from webnotes.model.code import get_obj, get_server_obj, run_server_obj, updatedb, check_syntax
from webnotes import session, form, is_testing, msgprint, errprint
set = webnotes.conn.set
sql = webnotes.conn.sql sql = webnotes.conn.sql
get_value = webnotes.conn.get_value
in_transaction = webnotes.conn.in_transaction
convert_to_lists = webnotes.conn.convert_to_lists
# ----------------------------------------------------------------------------------------- # -----------------------------------------------------------------------------------------
class DocType: class DocType:
def __init__(self, doc, doclist=[]): def __init__(self, doc, doclist=[]):
self.doc = doc self.doc = doc
self.doclist = doclist self.doclist = doclist
self.prwise_cost = {}
def check_mandatory(self):
""" Check mandatory fields """
if not self.doc.from_pr_date or not self.doc.to_pr_date:
msgprint("Please enter From and To PR Date", raise_exception=1)
if not self.doc.currency:
msgprint("Please enter Currency.", raise_exception=1)
def get_purchase_receipts(self): def get_purchase_receipts(self):
""" Get purchase receipts for given period """
self.doc.clear_table(self.doclist,'lc_pr_details',1) self.doc.clear_table(self.doclist,'lc_pr_details',1)
if not self.doc.from_pr_date or not self.doc.to_pr_date: self.check_mandatory()
msgprint("Please enter From and To PR Date")
raise Exception pr = sql("select name from `tabPurchase Receipt` where docstatus = 1 and posting_date >= '%s' and posting_date <= '%s' and currency = '%s' order by name " % (self.doc.from_pr_date, self.doc.to_pr_date, self.doc.currency), as_dict = 1)
if not self.doc.currency:
msgprint("Please enter Currency.")
raise Exception
pr = sql("select name from `tabPurchase Receipt` where docstatus = 1 and posting_date >= '%s' and posting_date <= '%s' and currency = '%s' order by name "%(self.doc.from_pr_date,self.doc.to_pr_date,self.doc.currency), as_dict = 1)
if len(pr)>200: if len(pr)>200:
msgprint("Please enter date of shorter duration as there are too many purchase receipt, hence it cannot be loaded.") msgprint("Please enter date of shorter duration as there are too many purchase receipt, hence it cannot be loaded.", raise_exception=1)
raise Exception
for i in pr: for i in pr:
if i and i['name']: ch = addchild(self.doc, 'lc_pr_details', 'LC PR Detail', 1, self.doclist)
pr_no = addchild(self.doc, 'lc_pr_details', 'LC PR Detail', 1, self.doclist) ch.purchase_receipt = i and i['name'] or ''
pr_no.purchase_receipt_no = i and i['name'] or '' ch.save()
pr_no.save()
def update_pr_lc_se(self):
lst = []
condition = ' name in('
amt = 0
for d in getlist(self.doclist, 'lc_pr_details'):
if cint(d.include_in_landed_cost) == 1:
condition += '"'+d.purchase_receipt_no+'",'
lst.append(d.purchase_receipt_no)
condition += '"")'
amount = sql("SELECT SUM(net_total) FROM `tabPurchase Receipt` WHERE docstatus = 1 AND %s"%condition)
amt = amount and flt(amount[0][0]) or 0
for lc in getlist(self.doclist, 'landed_cost_details'):
for name in lst:
pr_oc_det = sql("select name from `tabPurchase Tax Detail` where parent = %s and category = 'For Valuation' and add_deduct_tax = 'Add' and charge_type = 'Actual' and account_head = %s ",(name, lc.account_head))
#obj = get_obj('Purchase Receipt', name, with_children = 1)
if not pr_oc_det:
obj = get_obj('Purchase Receipt', name, with_children = 1)
lgth = cint(sql("select count(name) from `tabPurchase Tax Detail` where parent = '%s' "%(name))[0][0])
pr_oc = addchild(obj.doc, 'purchase_tax_details', 'Purchase Tax Detail', 1)
pr_oc.category = 'For Valuation'
pr_oc.add_deduct_tax = 'Add'
pr_oc.charge_type = 'Actual'
pr_oc.description = lc.description
pr_oc.account_head = lc.account_head
pr_oc.rate = flt(flt(lc.amount) * flt(obj.doc.net_total/ amt))
pr_oc.tax_amount = flt(flt(lc.amount) * flt(obj.doc.net_total/ amt))
pr_oc.total = obj.doc.grand_total
pr_oc.docstatus = 1
pr_oc.idx = cint(lgth)
pr_oc.save()
else:
obj = get_obj('Purchase Receipt', name)
sql("update `tabPurchase Tax Detail` set rate = %s, tax_amount = %s where name = %s and parent = %s",(flt(flt(lc.amount) * flt(obj.doc.net_total/ amt)),flt(flt(lc.amount) * flt(obj.doc.net_total/ amt)),pr_oc_det[0][0],name))
self.calc_pr_other_charges(name)
obj = get_obj('Purchase Receipt', name, with_children = 1)
for d in getlist(obj.doclist, 'purchase_receipt_details'):
if flt(d.qty):
d.valuation_rate = (flt(d.purchase_rate) + (flt(d.rm_supp_cost) / flt(d.qty)) + (flt(d.item_tax_amount)/flt(d.qty))) / flt(d.conversion_factor)
d.save()
sql("update `tabStock Ledger Entry` set incoming_rate = '%s' where voucher_detail_no = '%s'"%(flt(d.valuation_rate), d.name))
bin_name = sql("select t1.name, t2.name, t2.posting_date, t2.posting_time from `tabBin` t1, `tabStock Ledger Entry` t2 where t2.voucher_detail_no = '%s' and t2.item_code = t1.item_code and t2.warehouse = t1.warehouse LIMIT 1"%(d.name))
if bin_name and bin_name[0][0]:
obj = get_obj('Bin', bin_name[0][0]).update_item_valuation(bin_name[0][1], bin_name[0][2], bin_name[0][3])
# now distribute the taxes among the PRs
for lc in getlist(self.doclist, 'landed_cost_details'):
for d in lst:
pr_id = d.purchase_receipt_no
# load the purchase receipt object
pr = get_obj('Purchase Receipt', pr_id, with_children = 1)
# get the tax detail (for valuation) in the PR if it exists
pr_oc_det = sql("select name from `tabPurchase Tax Detail` where parent = %s and category = 'For Valuation' and add_deduct_tax = 'Add' and charge_type = 'Actual' and account_head = %s ",(pr_id, lc.account_head))
# update tax rate and tax amount
tax_amount = flt(flt(lc.amount) * flt(pr.doc.net_total/ amt))
# for display
d.net_total = pr.doc.net_total
d.added_cost = tax_amount
d.save()
# if not exist, create the tax detail for valuation
if not pr_oc_det:
lgth = cint(sql("select count(name) from `tabPurchase Tax Detail` where parent = '%s' "%(pr_id))[0][0])
pr_oc = addchild(pr.doc, 'purchase_tax_details', 'Purchase Tax Detail', 1)
pr_oc.category = 'For Valuation'
pr_oc.add_deduct_tax = 'Add'
pr_oc.charge_type = 'Actual'
pr_oc.description = lc.description
pr_oc.account_head = lc.account_head
pr_oc.rate = tax_amount
pr_oc.tax_amount = tax_amount
pr_oc.total = obj.doc.grand_total
pr_oc.docstatus = 1
pr_oc.idx = cint(lgth)
pr_oc.save()
else:
obj = get_obj('Purchase Receipt', name)
sql("update `tabPurchase Tax Detail` set rate = %s, tax_amount = %s where name = %s and parent = %s", \
(tax_amount, tax_amount, pr_oc_det[0][0], pr_id))
self.calc_pr_other_charges(name)
# reload - and update the stock entries with the
# additional valuations
obj = get_obj('Purchase Receipt', name, with_children = 1)
for d in getlist(obj.doclist, 'purchase_receipt_details'):
if flt(d.qty):
d.valuation_rate = (flt(d.purchase_rate) + (flt(d.rm_supp_cost) / flt(d.qty)) + (flt(d.item_tax_amount)/flt(d.qty))) / flt(d.conversion_factor)
d.save()
sql("update `tabStock Ledger Entry` set incoming_rate = '%s' where voucher_detail_no = '%s'"%(flt(d.valuation_rate), d.name))
bin_name = sql("select t1.name, t2.name, t2.posting_date, t2.posting_time from `tabBin` t1, `tabStock Ledger Entry` t2 where t2.voucher_detail_no = '%s' and t2.item_code = t1.item_code and t2.warehouse = t1.warehouse LIMIT 1"%(d.name))
# update valuation of the item
if bin_name and bin_name[0][0]:
obj = get_obj('Bin', bin_name[0][0]).update_item_valuation(bin_name[0][1], bin_name[0][2], bin_name[0][3])
def add_deduct_taxes(self, ocd, oc, tax_amount, total_amount, total, prev_total, f=1):
ocd[oc].total_amount = flt(tax_amount.toFixed(2))
ocd[oc].total_tax_amount = flt(prev_total.toFixed(2))
ocd[oc].tax_amount += flt(tax_amount.toFixed(2))
total_amount = flt(ocd[oc].tax_amount)
total_tax_amount = flt(ocd[oc].total_tax_amount) + (f * flt(total_amount))
if ocd[oc].category != "For Valuation":
prev_total += f * flt(ocd[oc].total_amount)
total += f * flt(ocd[oc].tax_amount)
ocd[oc].total = flt(total) + (f * flt(tax[t].tax_amount))
else:
prev_total = prev_total
ocd[oc].total = flt(total)
if ocd[oc].category != "For Total":
item_tax += f * ocd[oc].total_amount
ocd[oc].save()
return total, prev_total
# calculate the taxes for these PRs
def calc_pr_other_charges(self, name):
# re-calculate other charges
obj = get_obj('Purchase Receipt', name, with_children = 1)
total = 0
net_total = obj.doc.net_total
for prd in getlist(obj.doclist, 'purchase_receipt_details'):
prev_total, item_tax = flt(prd.amount), 0
total += flt(flt(prd.qty) * flt(prd.purchase_rate))
check_tax = prd.item_tax_rate and eval(prd.item_tax_rate) or {}
ocd = getlist(obj.doclist, 'purchase_tax_details')
# calculate tax for other charges
for oc in range(len(ocd)):
if check_tax.get(ocd[oc].account_head) and ocd[oc].charge_type != 'Actual':
rate = check_tax[ocd[oc].account_head]
else:
rate = flt(ocd[oc].rate)
tax_amount = self.cal_tax(ocd, prd, rate, net_total, oc)
if ocd[oc].add_deduct_tax == 'Add':
add_deduct_taxes(self, ocd, oc, tax_amount, total_amount, total, prev_total, f=1)
elif ocd[oc].add_deduct_tax == 'Deduct':
add_deduct_taxes(self, ocd, oc, tax_amount, total_amount, total, prev_total, f=-1)
prd.item_tax_amount = flt(item_tax)
prd.save()
obj.doc.save()
def cal_tax(self, ocd, prd, rate, net_total, oc):
tax_amount = 0
if ocd[oc].charge_type == 'Actual':
value = flt(flt(rate) / flt(net_total))
return flt(flt(value) * flt(prd.amount))
elif ocd[oc].charge_type == 'On Net Total':
return flt(flt(rate) * flt(prd.amount) / 100)
elif ocd[oc].charge_type == 'On Previous Row Amount':
row_no = cstr(ocd[oc].row_id)
row = (row_no).split("+")
for r in range(0, len(row.length)):
id = cint(row[r])
tax_amount += flt((flt(rate) * flt(ocd[id-1].total_amount) / 100))
row_id = row_no.find("/")
if row_id != -1:
rate = ''
row = (row_no).split("/")
id1 = cint(row[0])
id2 = cint(row[1])
tax_amount = flt(flt(ocd[id1-1].total_amount) / flt(ocd[id2-1].total_amount))
return tax_amount
# get details for landed cost table from master
# ---------------------------------------------
def get_landed_cost_master_details(self): def get_landed_cost_master_details(self):
""" pull details from landed cost master"""
self.doc.clear_table(self.doclist, 'landed_cost_details') self.doc.clear_table(self.doclist, 'landed_cost_details')
idx = 0 idx = 0
landed_cost = sql("select account_head, description from `tabLanded Cost Master Detail` where parent=%s", (self.doc.landed_cost), as_dict = 1) landed_cost = sql("select account_head, description from `tabLanded Cost Master Detail` where parent=%s", (self.doc.landed_cost), as_dict = 1)
@@ -238,3 +49,177 @@ class DocType:
lct = addchild(self.doc, 'landed_cost_details', 'Landed Cost Detail', 1, self.doclist) lct = addchild(self.doc, 'landed_cost_details', 'Landed Cost Detail', 1, self.doclist)
lct.account_head = cost['account_head'] lct.account_head = cost['account_head']
lct.description = cost['description'] lct.description = cost['description']
def get_selected_pr(self):
""" Get selected purchase receipt no """
self.selected_pr = [d.purchase_receipt for d in getlist(self.doclist, 'lc_pr_details') if d.select_pr]
if not self.selected_pr:
msgprint("Please select atleast one PR to proceed.", raise_exception=1)
def validate_selected_pr(self):
"""Validate selected PR as submitted"""
invalid_pr = sql("SELECT name FROM `tabPurchase Receipt` WHERE docstatus != 1 and name in (%s)" % ("'" + "', '".join(self.selected_pr) + "'"))
if invalid_pr:
msgprint("Selected purchase receipts must be submitted. Following PR are not submitted: %s" % invalid_pr, raise_exception=1)
def get_total_amt(self):
""" Get sum of net total of all selected PR"""
return sql("SELECT SUM(net_total) FROM `tabPurchase Receipt` WHERE name in (%s)" % ("'" + "', '".join(self.selected_pr) + "'"))[0][0]
def add_charges_in_pr(self):
""" Add additional charges in selected pr proportionately"""
total_amt = self.get_total_amt()
for pr in self.selected_pr:
pr_obj = get_obj('Purchase Receipt', pr, with_children = 1)
cumulative_grand_total = flt(pr_obj.doc.grand_total)
for lc in getlist(self.doclist, 'landed_cost_details'):
amt = flt(lc.amount) * flt(pr_obj.doc.net_total)/ flt(total_amt)
self.prwise_cost[pr] = self.prwise_cost.get(pr, 0) + amt
cumulative_grand_total += amt
pr_oc_row = sql("select name from `tabPurchase Tax Detail` where parent = %s and category = 'For Valuation' and add_deduct_tax = 'Add' and charge_type = 'Actual' and account_head = %s",(pr, lc.account_head))
if not pr_oc_row: # add if not exists
ch = addchild(pr_obj.doc, 'purchase_tax_details', 'Purchase Tax Detail', 1)
ch.category = 'For Valuation'
ch.add_deduct_tax = 'Add'
ch.charge_type = 'Actual'
ch.description = lc.description
ch.account_head = lc.account_head
ch.rate = amt
ch.tax_amount = amt
ch.total = cumulative_grand_total
ch.docstatus = 1
ch.idx = 500 # add at the end
ch.save(1)
else: # overwrite if exists
sql("update `tabPurchase Tax Detail` set rate = %s, tax_amount = %s where name = %s and parent = %s ", (amt, amt, pr_oc_row[0][0], pr))
def reset_other_charges(self, pr_obj):
""" Reset all calculated values to zero"""
for t in getlist(pr_obj.doclist, 'purchase_tax_details'):
t.total_tax_amount = 0;
t.total_amount = 0;
t.tax_amount = 0;
t.total = 0;
t.save()
def cal_charges_and_item_tax_amt(self):
""" Re-calculates other charges values and itemwise tax amount for getting valuation rate"""
for pr in self.selected_pr:
obj = get_obj('Purchase Receipt', pr, with_children = 1)
total = 0
self.reset_other_charges(obj)
for prd in getlist(obj.doclist, 'purchase_receipt_details'):
prev_total, item_tax = flt(prd.amount), 0
total += flt(prd.qty) * flt(prd.purchase_rate)
item_tax_rate = prd.item_tax_rate and eval(prd.item_tax_rate) or {}
ocd = getlist(obj.doclist, 'purchase_tax_details')
# calculate tax for other charges
for oc in range(len(ocd)):
# Get rate : consider if diff for this item
if item_tax_rate.get(ocd[oc].account_head) and ocd[oc].charge_type != 'Actual':
rate = item_tax_rate[ocd[oc].account_head]
else:
rate = flt(ocd[oc].rate)
tax_amount = self.cal_tax(ocd, prd, rate, obj.doc.net_total, oc)
total, prev_total, item_tax = self.add_deduct_taxes(ocd, oc, tax_amount, total, prev_total, item_tax)
prd.item_tax_amount = flt(item_tax)
prd.save()
obj.doc.save()
def cal_tax(self, ocd, prd, rate, net_total, oc):
""" Calculates tax amount for one item"""
tax_amount = 0
if ocd[oc].charge_type == 'Actual':
tax_amount = flt(rate) * flt(prd.amount) / flt(net_total)
elif ocd[oc].charge_type == 'On Net Total':
tax_amount = flt(rate) * flt(prd.amount) / 100
elif ocd[oc].charge_type == 'On Previous Row Amount':
row_no = cstr(ocd[oc].row_id)
row = row_no.split("+")
for r in range(0, len(row)):
id = cint(row[r])
tax_amount += flt((flt(rate) * flt(ocd[id-1].total_amount) / 100))
row_id = row_no.find("/")
if row_id != -1:
rate = ''
row = (row_no).split("/")
id1 = cint(row[0])
id2 = cint(row[1])
tax_amount = flt(flt(ocd[id1-1].total_amount) / flt(ocd[id2-1].total_amount))
elif ocd[oc].charge_type == 'On Previous Row Total':
row = cint(ocd[oc].row_id)
if ocd[row-1].add_deduct_tax == 'Add':
tax_amount = flt(rate) * (flt(ocd[row-1].total_tax_amount)+flt(ocd[row-1].total_amount)) / 100
elif ocd[row-1].add_deduct_tax == 'Deduct':
tax_amount = flt(rate) * (flt(ocd[row-1].total_tax_amount)-flt(ocd[row-1].total_amount)) / 100
return tax_amount
def add_deduct_taxes(self, ocd, oc, tax_amount, total, prev_total, item_tax):
"""Calculates other charges values"""
add_ded = ocd[oc].add_deduct_tax == 'Add' and 1 or ocd[oc].add_or_deduct == 'Deduct' and -1
ocd[oc].total_amount = flt(tax_amount)
ocd[oc].total_tax_amount = flt(prev_total)
ocd[oc].tax_amount += flt(tax_amount)
total_amount = flt(ocd[oc].tax_amount)
total_tax_amount = flt(ocd[oc].total_tax_amount) + (add_ded * flt(total_amount))
if ocd[oc].category != "For Valuation":
prev_total += add_ded * flt(ocd[oc].total_amount)
total += add_ded * flt(ocd[oc].tax_amount)
ocd[oc].total = total
else:
prev_total = prev_total
ocd[oc].total = flt(total)
ocd[oc].save()
if ocd[oc].category != "For Total":
item_tax += add_ded * ocd[oc].total_amount
return total, prev_total, item_tax
def update_sle(self):
""" Recalculate valuation rate in all sle after pr posting date"""
for pr in self.selected_pr:
pr_obj = get_obj('Purchase Receipt', pr, with_children = 1)
for d in getlist(pr_obj.doclist, 'purchase_receipt_details'):
if flt(d.qty):
d.valuation_rate = (flt(d.purchase_rate) + (flt(d.rm_supp_cost)/flt(d.qty)) + (flt(d.item_tax_amount)/flt(d.qty))) / flt(d.conversion_factor)
d.save()
sql("update `tabStock Ledger Entry` set incoming_rate = '%s' where voucher_detail_no = '%s'"%(flt(d.valuation_rate), d.name))
bin = sql("select t1.name, t2.posting_date, t2.posting_time from `tabBin` t1, `tabStock Ledger Entry` t2 where t2.voucher_detail_no = '%s' and t2.item_code = t1.item_code and t2.warehouse = t1.warehouse LIMIT 1" % d.name)
# update valuation rate after pr posting date
if bin and bin[0][0]:
obj = get_obj('Bin', bin[0][0]).update_entries_after(bin[0][1], bin[0][2])
def update_landed_cost(self):
"""
Add extra cost and recalculate all values in pr,
Recalculate valuation rate in all sle after pr posting date
"""
self.get_selected_pr()
self.validate_selected_pr()
self.add_charges_in_pr()
self.cal_charges_and_item_tax_amt()
self.update_sle()
msgprint("Landed Cost updated successfully")

View File

@@ -3,16 +3,18 @@
# These values are common in all dictionaries # These values are common in all dictionaries
{ {
'creation': '2010-08-08 17:09:07', 'creation': '2011-11-16 16:17:22',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-06-30 18:47:46', 'modified': '2011-11-16 16:32:18',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'wasim@webnotestech.com' 'owner': 'wasim@webnotestech.com'
}, },
# These values are common for all DocType # These values are common for all DocType
{ {
'_last_update': '1321441191',
'colour': 'White:FFF', 'colour': 'White:FFF',
'default_print_format': 'Standard',
'doctype': 'DocType', 'doctype': 'DocType',
'issingle': 1, 'issingle': 1,
'module': 'Stock', 'module': 'Stock',
@@ -20,7 +22,7 @@
'section_style': 'Simple', 'section_style': 'Simple',
'server_code_error': ' ', 'server_code_error': ' ',
'show_in_menu': 1, 'show_in_menu': 1,
'version': 31 'version': 35
}, },
# These values are common for all DocField # These values are common for all DocField
@@ -52,7 +54,6 @@
# DocPerm # DocPerm
{ {
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 1,
'permlevel': 0, 'permlevel': 0,
'role': 'All', 'role': 'All',
'write': 0 'write': 0
@@ -64,7 +65,6 @@
'cancel': 0, 'cancel': 0,
'create': 1, 'create': 1,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 2,
'permlevel': 0, 'permlevel': 0,
'role': 'Purchase Manager', 'role': 'Purchase Manager',
'submit': 0, 'submit': 0,
@@ -75,7 +75,6 @@
{ {
'create': 1, 'create': 1,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 3,
'permlevel': 0, 'permlevel': 0,
'role': 'System Manager', 'role': 'System Manager',
'write': 1 'write': 1
@@ -85,7 +84,6 @@
{ {
'create': 1, 'create': 1,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 4,
'permlevel': 0, 'permlevel': 0,
'role': 'Purchase User', 'role': 'Purchase User',
'write': 1 'write': 1
@@ -94,7 +92,6 @@
# DocPerm # DocPerm
{ {
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 5,
'permlevel': 1, 'permlevel': 1,
'role': 'All' 'role': 'All'
}, },
@@ -102,7 +99,6 @@
# DocPerm # DocPerm
{ {
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 6,
'permlevel': 1, 'permlevel': 1,
'role': 'System Manager' 'role': 'System Manager'
}, },
@@ -110,7 +106,6 @@
# DocPerm # DocPerm
{ {
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 7,
'permlevel': 1, 'permlevel': 1,
'role': 'Purchase User' 'role': 'Purchase User'
}, },
@@ -118,17 +113,30 @@
# DocPerm # DocPerm
{ {
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 8,
'permlevel': 1, 'permlevel': 1,
'role': 'Purchase Manager' 'role': 'Purchase Manager'
}, },
# DocField
{
'doctype': 'DocField',
'fieldtype': 'HTML',
'label': 'Process',
'options': '<div class="field_description"><b>Process:</b><br>1. Fetch and select Purchase Receipt<br>2. Enter extra costs<br>3. Click on Update Landed Cost button<br> 4. Cost will be added into other charges table of selected PR proportionately based on net total<br>5. Item Valuation Rate will be recalculated</div>'
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'options': 'Simple'
},
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'from_pr_date', 'fieldname': 'from_pr_date',
'fieldtype': 'Date', 'fieldtype': 'Date',
'idx': 1,
'label': 'From PR Date', 'label': 'From PR Date',
'reqd': 1 'reqd': 1
}, },
@@ -138,7 +146,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'to_pr_date', 'fieldname': 'to_pr_date',
'fieldtype': 'Date', 'fieldtype': 'Date',
'idx': 2,
'label': 'To PR Date', 'label': 'To PR Date',
'reqd': 1 'reqd': 1
}, },
@@ -148,7 +155,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'currency', 'fieldname': 'currency',
'fieldtype': 'Select', 'fieldtype': 'Select',
'idx': 3,
'label': 'Currency', 'label': 'Currency',
'options': 'link:Currency', 'options': 'link:Currency',
'reqd': 1 'reqd': 1
@@ -158,26 +164,15 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Button', 'fieldtype': 'Button',
'idx': 4,
'label': 'Get Purchase Receipt', 'label': 'Get Purchase Receipt',
'options': 'get_purchase_receipts' 'options': 'get_purchase_receipts'
}, },
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'idx': 5,
'label': 'LC PR Detail',
'options': 'Simple'
},
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'lc_pr_details', 'fieldname': 'lc_pr_details',
'fieldtype': 'Table', 'fieldtype': 'Table',
'idx': 6,
'label': 'LC PR Details', 'label': 'LC PR Details',
'options': 'LC PR Detail' 'options': 'LC PR Detail'
}, },
@@ -186,8 +181,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'idx': 7,
'label': 'Landed Cost Detail',
'options': 'Simple' 'options': 'Simple'
}, },
@@ -196,7 +189,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'landed_cost', 'fieldname': 'landed_cost',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 8,
'label': 'Select Landed Cost Details Master', 'label': 'Select Landed Cost Details Master',
'options': 'Landed Cost Master' 'options': 'Landed Cost Master'
}, },
@@ -206,7 +198,6 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Button', 'fieldtype': 'Button',
'idx': 9,
'label': 'Get Details', 'label': 'Get Details',
'options': 'get_landed_cost_master_details' 'options': 'get_landed_cost_master_details'
}, },
@@ -216,7 +207,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'landed_cost_details', 'fieldname': 'landed_cost_details',
'fieldtype': 'Table', 'fieldtype': 'Table',
'idx': 10,
'label': 'Landed Cost Details', 'label': 'Landed Cost Details',
'options': 'Landed Cost Detail' 'options': 'Landed Cost Detail'
}, },
@@ -225,8 +215,7 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Button', 'fieldtype': 'Button',
'idx': 11,
'label': 'Update PR', 'label': 'Update PR',
'options': 'update_pr_lc_se' 'options': 'update_landed_cost'
} }
] ]

View File

@@ -5,7 +5,7 @@
{ {
'creation': '2010-08-08 17:09:07', 'creation': '2010-08-08 17:09:07',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-06-30 18:47:22', 'modified': '2011-11-16 16:10:00',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'wasim@webnotestech.com' 'owner': 'wasim@webnotestech.com'
}, },
@@ -13,6 +13,7 @@
# These values are common for all DocType # These values are common for all DocType
{ {
'colour': 'White:FFF', 'colour': 'White:FFF',
'default_print_format': 'Standard',
'doctype': 'DocType', 'doctype': 'DocType',
'istable': 1, 'istable': 1,
'module': 'Stock', 'module': 'Stock',
@@ -20,7 +21,7 @@
'section_style': 'Simple', 'section_style': 'Simple',
'server_code_error': ' ', 'server_code_error': ' ',
'show_in_menu': 0, 'show_in_menu': 0,
'version': 2 'version': 5
}, },
# These values are common for all DocField # These values are common for all DocField
@@ -42,25 +43,23 @@
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'purchase_receipt_no', 'fieldname': 'purchase_receipt',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 1, 'label': 'Purchase Receipt',
'label': 'Purchase Receipt No',
'oldfieldname': 'purchase_receipt_no', 'oldfieldname': 'purchase_receipt_no',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Purchase Receipt', 'options': 'Purchase Receipt',
'search_index': 1 'width': '220px'
}, },
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'include_in_landed_cost', 'fieldname': 'select_pr',
'fieldtype': 'Check', 'fieldtype': 'Check',
'idx': 2, 'label': 'Select PR',
'label': 'Include In Landed Cost',
'oldfieldname': 'include_in_landed_cost', 'oldfieldname': 'include_in_landed_cost',
'oldfieldtype': 'Check', 'oldfieldtype': 'Check',
'width': '150px' 'width': '120px'
} }
] ]

View File

@@ -105,7 +105,7 @@ cur_frm.cscript.transaction_date = function(doc,cdt,cdn){
} }
// ***************** Get project name ***************** // ***************** Get project name *****************
cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) { cur_frm.fields_dict['purchase_receipt_details'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) {
return 'SELECT `tabProject`.name FROM `tabProject` WHERE `tabProject`.status = "Open" AND `tabProject`.name LIKE "%s" ORDER BY `tabProject`.name ASC LIMIT 50'; return 'SELECT `tabProject`.name FROM `tabProject` WHERE `tabProject`.status = "Open" AND `tabProject`.name LIKE "%s" ORDER BY `tabProject`.name ASC LIMIT 50';
} }

Some files were not shown because too many files have changed in this diff Show More