diff --git a/erpnext/accounts/doctype/c_form/c_form.js b/erpnext/accounts/doctype/c_form/c_form.js index 4fb32275e9..d9e5c68d2b 100644 --- a/erpnext/accounts/doctype/c_form/c_form.js +++ b/erpnext/accounts/doctype/c_form/c_form.js @@ -17,10 +17,13 @@ //c-form js file // ----------------------------- cur_frm.fields_dict.invoice_details.grid.get_field("invoice_no").get_query = function(doc) { - return 'SELECT `tabSales Invoice`.`name` FROM `tabSales Invoice` WHERE `tabSales Invoice`.`company` = "' +doc.company+'" AND `tabSales Invoice`.%(key)s LIKE "%s" AND `tabSales Invoice`.`customer` = "' + doc.customer + '" AND `tabSales Invoice`.`docstatus` = 1 and `tabSales Invoice`.`c_form_applicable` = "Yes" and ifnull(`tabSales Invoice`.c_form_no, "") = "" ORDER BY `tabSales Invoice`.`name` ASC LIMIT 50'; + cond = "" + if (doc.customer) cond += ' AND `tabSales Invoice`.`customer` = "' + cstr(doc.customer) + '"'; + if (doc.company) cond += ' AND `tabSales Invoice`.`company` = "' + cstr(doc.company) + '"'; + return 'SELECT `tabSales Invoice`.`name` FROM `tabSales Invoice` WHERE `tabSales Invoice`.`docstatus` = 1 and `tabSales Invoice`.`c_form_applicable` = "Yes" and ifnull(`tabSales Invoice`.c_form_no, "") = ""'+cond+' AND `tabSales Invoice`.%(key)s LIKE "%s" ORDER BY `tabSales Invoice`.`name` ASC LIMIT 50'; } cur_frm.cscript.invoice_no = function(doc, cdt, cdn) { var d = locals[cdt][cdn]; get_server_fields('get_invoice_details', d.invoice_no, 'invoice_details', doc, cdt, cdn, 1); -} +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/cost_center/cost_center.py b/erpnext/accounts/doctype/cost_center/cost_center.py index 7429821897..57d9a295c1 100644 --- a/erpnext/accounts/doctype/cost_center/cost_center.py +++ b/erpnext/accounts/doctype/cost_center/cost_center.py @@ -73,7 +73,7 @@ class DocType(DocTypeNestedSet): def validate_budget_details(self): check_acc_list = [] for d in getlist(self.doclist, 'budget_details'): - if doc.group_or_ledger=="Group": + if self.doc.group_or_ledger=="Group": msgprint("Budget cannot be set for Group Cost Centers", raise_exception=1) if [d.account, d.fiscal_year] in check_acc_list: diff --git a/erpnext/accounts/doctype/gl_control/gl_control.py b/erpnext/accounts/doctype/gl_control/gl_control.py index 2acb5ef1d6..bd10d6cfe5 100644 --- a/erpnext/accounts/doctype/gl_control/gl_control.py +++ b/erpnext/accounts/doctype/gl_control/gl_control.py @@ -622,7 +622,7 @@ def send_notification(new_rv): Invoice Date : %s
Invoice Period : %s to %s
Due Date : %s - ''' % (com, new_rv.doc.name, new_rv.doc.customer, new_rv.doc.address_display, getdate(new_rv.doc.posting_date).strftime("%d-%m-%Y"), \ + ''' % (com, new_rv.doc.name, new_rv.doc.customer_name, new_rv.doc.address_display, getdate(new_rv.doc.posting_date).strftime("%d-%m-%Y"), \ getdate(new_rv.doc.invoice_period_from_date).strftime("%d-%m-%Y"), getdate(new_rv.doc.invoice_period_to_date).strftime("%d-%m-%Y"),\ getdate(new_rv.doc.due_date).strftime("%d-%m-%Y")) diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher_list.js b/erpnext/accounts/doctype/journal_voucher/journal_voucher_list.js index 129f3cdc91..e31cee8130 100644 --- a/erpnext/accounts/doctype/journal_voucher/journal_voucher_list.js +++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher_list.js @@ -6,6 +6,7 @@ wn.doclistviews['Journal Voucher'] = wn.views.ListView.extend({ '`tabJournal Voucher`.remark', '`tabJournal Voucher`.total_debit', '`tabJournal Voucher`.company', + "`tabJournal Voucher`.posting_date", ]); this.stats = this.stats.concat(['voucher_type', 'company']); }, @@ -31,6 +32,8 @@ wn.doclistviews['Journal Voucher'] = wn.views.ListView.extend({ }, css: {'text-align':'right'} }, - {width: '12%', content: 'modified', css: {'text-align': 'right', 'color':'#777'}} + {width: '12%', content:'posting_date', + css: {'text-align': 'right', 'color':'#777'}, + title: "Journal Voucher Date", type: "date"} ], }); \ No newline at end of file diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index fe65e95866..d9c3fb149f 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -174,15 +174,13 @@ class DocType(TransactionBase): self.doclist = get_obj('GL Control').get_advances(self, self.doc.credit_to, 'Purchase Invoice Advance','advance_allocation_details','debit') - # ============= OTHER CHARGES ==================== - - # Get Tax rate if account type is TAX - # ------------------------------------ def get_rate(self,arg): return get_obj('Purchase Common').get_rate(arg,self) - # Get Purchase Taxes and Charges Master - # ----------------------------------------------------------- + def load_default_taxes(self): + self.doclist = get_obj('Purchase Common').load_default_taxes(self) + + def get_purchase_tax_details(self): self.doclist = get_obj('Purchase Common').get_purchase_tax_details(self) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js index c0c6625cf8..f9dd4cde9e 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js @@ -9,6 +9,7 @@ wn.doclistviews['Purchase Invoice'] = wn.views.ListView.extend({ 'IFNULL(`tabPurchase Invoice`.grand_total_import, 0) as grand_total_import', 'IFNULL(`tabPurchase Invoice`.grand_total, 0) as grand_total', 'IFNULL(`tabPurchase Invoice`.outstanding_amount, 0) as outstanding_amount', + "`tabPurchase Invoice`.posting_date" ]); this.stats = this.stats.concat(['company']); }, @@ -40,8 +41,8 @@ wn.doclistviews['Purchase Invoice'] = wn.views.ListView.extend({ css: {'text-align':'right'} }, {width: '10%', content: 'paid', type:'bar-graph', label:'Paid'}, - {width: '12%', content:'modified', css: { - 'text-align': 'right', 'color':'#777' - }}, + {width: '12%', content:'posting_date', + css: {'text-align': 'right', 'color':'#777'}, + title: "Purchase Invoice Date", type: "date"}, ] }); diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt index 8add7afa67..5c72c2c584 100644 --- a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-07-03 13:30:50', + 'creation': '2012-05-15 12:14:32', 'docstatus': 0, - 'modified': '2012-07-12 14:10:35', + 'modified': '2012-08-17 09:57:04', 'modified_by': u'Administrator', 'owner': u'wasim@webnotestech.com' }, @@ -107,6 +107,25 @@ 'search_index': 0 }, + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'is_default', + 'fieldtype': u'Check', + 'label': u'Default' + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'company', + 'fieldtype': u'Link', + 'in_filter': 1, + 'label': u'Company', + 'options': u'Company', + 'reqd': 1 + }, + # DocField { 'doctype': u'DocField', diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 4563532aa5..9e0a4ebf39 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -78,35 +78,32 @@ cur_frm.cscript.hide_fields = function(doc, cdt, cdn) { 'source', 'cancel_reason', 'total_advance', 'gross_profit', 'gross_profit_percent', 'get_advances_received', 'advance_adjustment_details', 'sales_partner', 'commission_rate', - 'total_commission']; + 'total_commission', 'advances']; item_flds_normal = ['sales_order', 'delivery_note'] item_flds_pos = ['warehouse', 'serial_no', 'batch_no', 'actual_qty', 'delivered_qty'] if(cint(doc.is_pos) == 1) { hide_field(par_flds); - $(cur_frm.fields_dict.payments_section.row.wrapper).toggle(true); - $(cur_frm.fields_dict.advances.row.wrapper).toggle(false); + unhide_field('payments_section'); for(f in item_flds_normal) cur_frm.fields_dict['entries'].grid.set_column_disp(item_flds_normal[f], false); for(f in item_flds_pos) cur_frm.fields_dict['entries'].grid.set_column_disp(item_flds_pos[f], (doc.update_stock==1?true:false)); } else { + hide_field('payments_section'); unhide_field(par_flds); - $(cur_frm.fields_dict.payments_section.row.wrapper).toggle(false); - $(cur_frm.fields_dict.advances.row.wrapper).toggle(true); for(f in item_flds_normal) cur_frm.fields_dict['entries'].grid.set_column_disp(item_flds_normal[f], true); for(f in item_flds_pos) cur_frm.fields_dict['entries'].grid.set_column_disp(item_flds_pos[f], false); } - if (doc.docstatus==1) $(cur_frm.fields_dict.recurring_invoice.row.wrapper).toggle(true); - else $(cur_frm.fields_dict.recurring_invoice.row.wrapper).toggle(false); + if (doc.docstatus==1) unhide_field('recurring_invoice'); + else hide_field('recurring_invoice'); - if(doc.customer) $(cur_frm.fields_dict.contact_section.row.wrapper).toggle(true); - else $(cur_frm.fields_dict.contact_section.row.wrapper).toggle(false); + if(doc.customer) unhide_field('contact_section'); + else hide_field('contact_section'); // India related fields var cp = wn.control_panel; if (cp.country == 'India') unhide_field(['c_form_applicable', 'c_form_no']); else hide_field(['c_form_applicable', 'c_form_no']); - } @@ -114,7 +111,6 @@ cur_frm.cscript.hide_fields = function(doc, cdt, cdn) { // ------- cur_frm.cscript.refresh = function(doc, dt, dn) { cur_frm.cscript.is_opening(doc, dt, dn); - cur_frm.cscript.hide_fields(doc, dt, dn); erpnext.hide_naming_series(); // Show / Hide button @@ -131,6 +127,8 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { if(doc.outstanding_amount!=0) cur_frm.add_custom_button('Make Payment Entry', cur_frm.cscript.make_bank_voucher); } + cur_frm.cscript.hide_fields(doc, dt, dn); + } //fetch retail transaction related fields @@ -191,7 +189,7 @@ cur_frm.cscript.customer = function(doc,dt,dn,onload) { var args = onload ? 'onload':'' if(doc.customer) $c_obj(make_doclist(doc.doctype, doc.name), 'get_default_customer_address', args, callback); - if(doc.customer) unhide_field(['customer_address','contact_person', 'territory','customer_group']); + if(doc.customer) unhide_field('contact_section'); } @@ -231,7 +229,7 @@ cur_frm.cscript.debit_to = function(doc,dt,dn) { var callback = function(r,rt) { var doc = locals[cur_frm.doctype][cur_frm.docname]; if(doc.customer) $c_obj(make_doclist(dt,dn), 'get_default_customer_address', '', callback2); - if(doc.customer) unhide_field(['customer_address','contact_person','territory','customer_group']); + if(doc.customer) unhide_field('contact_section'); cur_frm.refresh(); } diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt b/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt index b1368d1bc3..ad92d22e06 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-07-13 11:57:13', + 'creation': '2012-07-18 16:02:44', 'docstatus': 0, - 'modified': '2012-07-16 16:25:11', + 'modified': '2012-09-07 11:56:59', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -55,6 +55,66 @@ 'name': u'Sales Invoice' }, + # DocPerm + { + 'amend': 0, + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 1, + 'role': u'Accounts Manager', + 'submit': 0, + 'write': 0 + }, + + # DocPerm + { + 'amend': 1, + 'cancel': 1, + 'create': 1, + 'doctype': u'DocPerm', + 'permlevel': 0, + 'role': u'Accounts Manager', + 'submit': 1, + 'write': 1 + }, + + # DocPerm + { + 'amend': 1, + 'cancel': 1, + 'create': 1, + 'doctype': u'DocPerm', + 'permlevel': 0, + 'role': u'Accounts User', + 'submit': 1, + 'write': 1 + }, + + # DocPerm + { + 'amend': 0, + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 1, + 'role': u'Accounts User', + 'submit': 0, + 'write': 0 + }, + + # DocPerm + { + 'amend': 0, + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 0, + 'role': u'Customer', + 'submit': 0, + 'write': 0 + }, + # DocField { 'doctype': u'DocField', @@ -812,7 +872,7 @@ 'doctype': u'DocField', 'fieldname': u'write_off_outstanding_amount_automatically', 'fieldtype': u'Check', - 'label': u'Write Off Outstanding Amount Automatically', + 'label': u'Write Off Outstanding Amount', 'permlevel': 0, 'print_hide': 1 }, @@ -1487,6 +1547,7 @@ # DocField { 'allow_on_submit': 1, + 'colour': u'White:FFF', 'depends_on': u'eval:doc.convert_into_recurring_invoice==1', 'description': u'Start date of the invoice period', 'doctype': u'DocField', diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js index ae923f4859..1c3b2d38ce 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js @@ -8,7 +8,8 @@ wn.doclistviews['Sales Invoice'] = wn.views.ListView.extend({ "ifnull(`tabSales Invoice`.outstanding_amount,0) as outstanding_amount", "ifnull(`tabSales Invoice`.grand_total,0) as grand_total", "`tabSales Invoice`.currency", - "ifnull(`tabSales Invoice`.grand_total_export,0) as grand_total_export" + "ifnull(`tabSales Invoice`.grand_total_export,0) as grand_total_export", + "`tabSales Invoice`.posting_date", ]); }, prepare_data: function(data) { @@ -35,6 +36,8 @@ wn.doclistviews['Sales Invoice'] = wn.views.ListView.extend({ css: {'text-align':'right'} }, {width: '10%', content: 'paid', type:'bar-graph', label:'Paid'}, - {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} + {width: '12%', content:'posting_date', + css: {'text-align': 'right', 'color':'#777'}, + title: "Sales Invoice Date", type: "date"} ] }); diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.js b/erpnext/accounts/page/accounts_browser/accounts_browser.js index 5bc2e3588e..55d6be9c1c 100644 --- a/erpnext/accounts/page/accounts_browser/accounts_browser.js +++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js @@ -22,7 +22,12 @@ pscript['onload_Accounts Browser'] = function(wrapper){ wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.appframe-area')); - wrapper.appframe.add_button('New Company', function() { newdoc('Company'); }, 'icon-plus'); + + if (wn.boot.profile.can_create.indexOf("Company") !== -1) { + wrapper.appframe.add_button('New Company', function() { newdoc('Company'); }, + 'icon-plus'); + } + wrapper.appframe.add_button('Refresh', function() { wrapper.$company_select.change(); }, 'icon-refresh'); @@ -35,17 +40,6 @@ pscript['onload_Accounts Browser'] = function(wrapper){ }) .appendTo(wrapper.appframe.$w.find('.appframe-toolbar')); - // default company - if(sys_defaults.company) { - $('