mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-06 21:59:13 +00:00
Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
@@ -172,16 +172,13 @@ return{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.fields_dict['entries'].grid.get_field("expense_head").get_query = function(doc) {
|
cur_frm.set_query("expense_head", "entries", function(doc) {
|
||||||
return{
|
return{
|
||||||
filters:{
|
query: "accounts.doctype.purchase_invoice.purchase_invoice.get_expense_account",
|
||||||
'debit_or_credit':'Debit',
|
filters: {'company': doc.company}
|
||||||
'account_type': 'Expense Account',
|
|
||||||
'group_or_ledger': 'Ledger',
|
|
||||||
'company': doc.company
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
|
||||||
cur_frm.cscript.expense_head = function(doc, cdt, cdn){
|
cur_frm.cscript.expense_head = function(doc, cdt, cdn){
|
||||||
var d = locals[cdt][cdn];
|
var d = locals[cdt][cdn];
|
||||||
if(d.idx == 1 && d.expense_head){
|
if(d.idx == 1 && d.expense_head){
|
||||||
|
|||||||
@@ -252,14 +252,14 @@ class DocType(BuyingController):
|
|||||||
self.doc.against_expense_account = ",".join(against_accounts)
|
self.doc.against_expense_account = ",".join(against_accounts)
|
||||||
|
|
||||||
def po_required(self):
|
def po_required(self):
|
||||||
if webnotes.conn.get_single_value("Buying Settings", "po_required") == 'Yes':
|
if webnotes.conn.get_value("Buying Settings", None, "po_required") == 'Yes':
|
||||||
for d in getlist(self.doclist,'entries'):
|
for d in getlist(self.doclist,'entries'):
|
||||||
if not d.purchase_order:
|
if not d.purchase_order:
|
||||||
msgprint("Purchse Order No. required against item %s"%d.item_code)
|
msgprint("Purchse Order No. required against item %s"%d.item_code)
|
||||||
raise Exception
|
raise Exception
|
||||||
|
|
||||||
def pr_required(self):
|
def pr_required(self):
|
||||||
if webnotes.conn.get_single_value("Buying Settings", "pr_required") == 'Yes':
|
if webnotes.conn.get_value("Buying Settings", None, "pr_required") == 'Yes':
|
||||||
for d in getlist(self.doclist,'entries'):
|
for d in getlist(self.doclist,'entries'):
|
||||||
if not d.purchase_receipt:
|
if not d.purchase_receipt:
|
||||||
msgprint("Purchase Receipt No. required against item %s"%d.item_code)
|
msgprint("Purchase Receipt No. required against item %s"%d.item_code)
|
||||||
@@ -458,3 +458,17 @@ class DocType(BuyingController):
|
|||||||
"conversion_factor")) or 1
|
"conversion_factor")) or 1
|
||||||
|
|
||||||
d.rm_supp_cost = rm_cost * flt(d.qty) * flt(d.conversion_factor)
|
d.rm_supp_cost = rm_cost * flt(d.qty) * flt(d.conversion_factor)
|
||||||
|
|
||||||
|
@webnotes.whitelist()
|
||||||
|
def get_expense_account(doctype, txt, searchfield, start, page_len, filters):
|
||||||
|
from controllers.queries import get_match_cond
|
||||||
|
|
||||||
|
return webnotes.conn.sql("""select tabAccount.name from `tabAccount`
|
||||||
|
where (tabAccount.debit_or_credit="Debit"
|
||||||
|
or tabAccount.account_type = "Expense Account")
|
||||||
|
and tabAccount.group_or_ledger="Ledger"
|
||||||
|
and tabAccount.docstatus!=2
|
||||||
|
and tabAccount.company = '%(company)s'
|
||||||
|
and tabAccount.%(key)s LIKE '%(txt)s'
|
||||||
|
%(mcond)s""" % {'company': filters['company'], 'key': searchfield,
|
||||||
|
'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype, searchfield)})
|
||||||
@@ -431,7 +431,7 @@ class DocType(SellingController):
|
|||||||
"""check in manage account if sales order / delivery note required or not."""
|
"""check in manage account if sales order / delivery note required or not."""
|
||||||
dic = {'Sales Order':'so_required','Delivery Note':'dn_required'}
|
dic = {'Sales Order':'so_required','Delivery Note':'dn_required'}
|
||||||
for i in dic:
|
for i in dic:
|
||||||
if webnotes.conn.get_single_value('Selling Settings', dic[i]) == 'Yes':
|
if webnotes.conn.get_value('Selling Settings', None, dic[i]) == 'Yes':
|
||||||
for d in getlist(self.doclist,'entries'):
|
for d in getlist(self.doclist,'entries'):
|
||||||
if webnotes.conn.get_value('Item', d.item_code, 'is_stock_item') == 'Yes' \
|
if webnotes.conn.get_value('Item', d.item_code, 'is_stock_item') == 'Yes' \
|
||||||
and not d.fields[i.lower().replace(' ','_')]:
|
and not d.fields[i.lower().replace(' ','_')]:
|
||||||
@@ -979,6 +979,7 @@ def get_bank_cash_account(mode_of_payment):
|
|||||||
"cash_bank_account": val
|
"cash_bank_account": val
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@webnotes.whitelist()
|
||||||
def get_income_account(doctype, txt, searchfield, start, page_len, filters):
|
def get_income_account(doctype, txt, searchfield, start, page_len, filters):
|
||||||
from controllers.queries import get_match_cond
|
from controllers.queries import get_match_cond
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ class DocType(SellingController):
|
|||||||
|
|
||||||
def so_required(self):
|
def so_required(self):
|
||||||
"""check in manage account if sales order required or not"""
|
"""check in manage account if sales order required or not"""
|
||||||
if webnotes.conn.get_single_value("Selling Settings", 'so_required') == 'Yes':
|
if webnotes.conn.get_value("Selling Settings", None, 'so_required') == '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)
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ class DocType(BuyingController):
|
|||||||
|
|
||||||
|
|
||||||
def po_required(self):
|
def po_required(self):
|
||||||
if webnotes.conn.get_single_value("Buying Settings", "po_required") == 'Yes':
|
if webnotes.conn.get_value("Buying Settings", None, "po_required") == 'Yes':
|
||||||
for d in getlist(self.doclist,'purchase_receipt_details'):
|
for d in getlist(self.doclist,'purchase_receipt_details'):
|
||||||
if not d.prevdoc_docname:
|
if not d.prevdoc_docname:
|
||||||
msgprint("Purchse Order No. required against item %s"%d.item_code)
|
msgprint("Purchse Order No. required against item %s"%d.item_code)
|
||||||
|
|||||||
Reference in New Issue
Block a user