mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-06 06:58:27 +00:00
aii fixes
This commit is contained in:
@@ -41,9 +41,10 @@ class SellingController(StockController):
|
||||
self.doc.in_words_export = money_in_words(disable_rounded_total and
|
||||
self.doc.grand_total_export or self.doc.rounded_total_export, self.doc.currency)
|
||||
|
||||
def set_buying_amount(self):
|
||||
def set_buying_amount(self, stock_ledger_entries = None):
|
||||
from stock.utils import get_buying_amount
|
||||
stock_ledger_entries = self.get_stock_ledger_entries()
|
||||
if not stock_ledger_entries:
|
||||
stock_ledger_entries = self.get_stock_ledger_entries()
|
||||
|
||||
item_sales_bom = {}
|
||||
for d in self.doclist.get({"parentfield": "packing_details"}):
|
||||
@@ -65,4 +66,8 @@ class SellingController(StockController):
|
||||
def check_expense_account(self, item):
|
||||
if item.buying_amount and not item.expense_account:
|
||||
msgprint(_("""Expense account is mandatory for item: """) + item.item_code,
|
||||
raise_exception=1)
|
||||
|
||||
if item.buying_amount and not item.cost_center:
|
||||
msgprint(_("""Cost Center is mandatory for item: """) + item.item_code,
|
||||
raise_exception=1)
|
||||
@@ -16,7 +16,8 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
from webnotes import msgprint, _
|
||||
from webnotes.utils import cint
|
||||
import webnotes.defaults
|
||||
from controllers.accounts_controller import AccountsController
|
||||
|
||||
class StockController(AccountsController):
|
||||
@@ -72,4 +73,10 @@ class StockController(AccountsController):
|
||||
item_list.append(item.item_code)
|
||||
warehouse_list.append(item.warehouse)
|
||||
|
||||
return list(set(item_list)), list(set(warehouse_list))
|
||||
return list(set(item_list)), list(set(warehouse_list))
|
||||
|
||||
def make_cancel_gl_entries(self):
|
||||
if webnotes.conn.sql("""select name from `tabGL Entry` where voucher_type=%s
|
||||
and voucher_no=%s and ifnull(is_cancelled, 'No')='No'""",
|
||||
(self.doc.doctype, self.doc.name)):
|
||||
self.make_gl_entries()
|
||||
Reference in New Issue
Block a user