aii: patches and fine tuning

This commit is contained in:
Nabin Hait
2013-03-25 11:06:00 +05:30
parent b632ba5f51
commit 0fc2454384
21 changed files with 255 additions and 124 deletions

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-03-07 11:42:59",
"docstatus": 0,
"modified": "2013-03-21 18:36:22",
"modified": "2013-03-22 18:43:10",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -257,10 +257,10 @@
},
{
"doctype": "DocField",
"fieldname": "cost_center",
"fieldname": "purchase_cost_center",
"fieldtype": "Link",
"hidden": 1,
"label": "Cost Center",
"label": "Purchase Cost Center",
"no_copy": 1,
"options": "Cost Center",
"print_hide": 1,

View File

@@ -320,7 +320,7 @@ class DocType(BuyingController):
from accounts.general_ledger import make_gl_entries
against_stock_account = self.get_default_account("stock_received_but_not_billed")
against_stock_account = self.get_company_default("stock_received_but_not_billed")
total_valuation_amount = self.get_total_valuation_amount()
gl_entries = self.get_gl_entries_for_stock(against_stock_account, total_valuation_amount)

View File

@@ -33,9 +33,9 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
else account_for = "stock_adjustment_account";
this.frm.call({
method: "controllers.accounts_controller.get_default_account",
method: "accounts.utils.get_company_default",
args: {
"account_for": account_for,
"fieldname": account_for,
"company": this.frm.doc.company
},
callback: function(r) {

View File

@@ -176,11 +176,10 @@ class DocType(StockController):
from accounts.general_ledger import make_gl_entries
cost_center = "Auto Inventory Accounting - %s" % (self.company_abbr,)
total_valuation_amount = self.get_total_valuation_amount()
gl_entries = self.get_gl_entries_for_stock(self.doc.expense_adjustment_account,
total_valuation_amount, cost_center=cost_center)
total_valuation_amount)
if gl_entries:
make_gl_entries(gl_entries, cancel=self.doc.docstatus == 2)

View File

@@ -27,9 +27,9 @@ erpnext.stock.StockReconciliation = erpnext.stock.StockController.extend({
if (sys_defaults.auto_inventory_accounting && !this.frm.doc.expense_account) {
this.frm.call({
method: "controllers.accounts_controller.get_default_account",
method: "accounts.utils.get_company_default",
args: {
"account_for": "stock_adjustment_account",
"fieldname": "stock_adjustment_account",
"company": this.frm.doc.company
},
callback: function(r) {

View File

@@ -310,11 +310,9 @@ class DocType(StockController):
msgprint(_("Please enter Expense Account"), raise_exception=1)
from accounts.general_ledger import make_gl_entries
cost_center = "Auto Inventory Accounting - %s" % (self.company_abbr,)
gl_entries = self.get_gl_entries_for_stock(self.doc.expense_account,
self.doc.stock_value_difference, cost_center=cost_center)
self.doc.stock_value_difference)
if gl_entries:
make_gl_entries(gl_entries, cancel=self.doc.docstatus == 2)