[docs] [minor] perpetual accounting

This commit is contained in:
Nabin Hait
2013-09-03 01:07:55 +05:30
parent 3f5e59eeeb
commit b9b3a5377a
3 changed files with 106 additions and 25 deletions

View File

@@ -2,19 +2,47 @@
// License: GNU General Public License v3. See license.txt
cur_frm.fields_dict['lc_pr_details'].grid.get_field("purchase_receipt").get_query = function(doc, cdt, cdn) {
return {
filters:[['Purchase Receipt', 'docstatus', '=', '1']]
}
}
wn.provide("erpnext.stock");
wn.require("public/app/js/controllers/stock_controller.js");
cur_frm.fields_dict['landed_cost_details'].grid.get_field("account_head").get_query = function(doc, cdt, cdn) {
return{
filters:[
['Account', 'group_or_ledger', '=', 'Ledger'],
['Account', 'account_type', 'in', 'Tax, Chargeable'],
['Account', 'is_pl_account', '=', 'Yes'],
['Account', 'debit_or_credit', '=', 'Debit']
]
erpnext.stock.LandedCostWizard = erpnext.stock.StockController.extend({
setup: function() {
var me = this;
this.frm.fields_dict.lc_pr_details.grid.get_field('purchase_receipt').get_query =
function() {
if(!me.frm.doc.company) msgprint(wn._("Please enter company first"));
return {
filters:[
['Purchase Receipt', 'docstatus', '=', '1'],
['Purchase Receipt', 'company', '=', me.frm.doc.company],
]
}
};
this.frm.fields_dict.landed_cost_details.grid.get_field('account_head').get_query = function() {
if(!me.frm.doc.company) msgprint(wn._("Please enter company first"));
return {
filters:[
['Account', 'group_or_ledger', '=', 'Ledger'],
['Account', 'account_type', 'in', 'Tax, Chargeable'],
['Account', 'is_pl_account', '=', 'Yes'],
['Account', 'debit_or_credit', '=', 'Debit'],
['Account', 'company', '=', me.frm.doc.company]
]
}
},
this.frm.fields_dict.landed_cost_details.grid.get_field('cost_center').get_query =
function() {
if(!me.frm.doc.company) msgprint(wn._("Please enter company first"));
return {
filters:[
['Cost Center', 'group_or_ledger', '=', 'Ledger'],
['Cost Center', 'company', '=', me.frm.doc.company]
]
}
}
}
}
});
cur_frm.script_manager.make(erpnext.stock.LandedCostWizard);

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-22 16:50:39",
"docstatus": 0,
"modified": "2013-09-02 13:45:54",
"modified": "2013-09-02 19:13:09",
"modified_by": "Administrator",
"owner": "wasim@webnotestech.com"
},
@@ -38,6 +38,14 @@
"doctype": "DocType",
"name": "Landed Cost Wizard"
},
{
"doctype": "DocField",
"fieldname": "company",
"fieldtype": "Link",
"label": "Company",
"options": "Company",
"reqd": 1
},
{
"doctype": "DocField",
"fieldname": "section_break0",