mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 14:39:19 +00:00
Merge branch 'v12-pre-release' into version-12
This commit is contained in:
@@ -5,7 +5,7 @@ import frappe
|
|||||||
from erpnext.hooks import regional_overrides
|
from erpnext.hooks import regional_overrides
|
||||||
from frappe.utils import getdate
|
from frappe.utils import getdate
|
||||||
|
|
||||||
__version__ = '12.5.1'
|
__version__ = '12.5.2'
|
||||||
|
|
||||||
def get_default_company(user=None):
|
def get_default_company(user=None):
|
||||||
'''Get default company for user'''
|
'''Get default company for user'''
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class BankReconciliation(Document):
|
|||||||
|
|
||||||
condition = ""
|
condition = ""
|
||||||
if not self.include_reconciled_entries:
|
if not self.include_reconciled_entries:
|
||||||
condition = " and (clearance_date is null or clearance_date='0000-00-00')"
|
condition = "and (clearance_date IS NULL or clearance_date='0000-00-00')"
|
||||||
|
|
||||||
journal_entries = frappe.db.sql("""
|
journal_entries = frappe.db.sql("""
|
||||||
select
|
select
|
||||||
@@ -34,11 +34,10 @@ class BankReconciliation(Document):
|
|||||||
where
|
where
|
||||||
t2.parent = t1.name and t2.account = %(account)s and t1.docstatus=1
|
t2.parent = t1.name and t2.account = %(account)s and t1.docstatus=1
|
||||||
and t1.posting_date >= %(from)s and t1.posting_date <= %(to)s
|
and t1.posting_date >= %(from)s and t1.posting_date <= %(to)s
|
||||||
and ifnull(t1.is_opening, 'No') = 'No' %(condition)s
|
and ifnull(t1.is_opening, 'No') = 'No' {condition}
|
||||||
group by t2.account, t1.name
|
group by t2.account, t1.name
|
||||||
order by t1.posting_date ASC, t1.name DESC
|
order by t1.posting_date ASC, t1.name DESC
|
||||||
""", {"condition":condition, "account": self.account, "from": self.from_date, "to": self.to_date}, as_dict=1)
|
""".format(condition=condition), {"account": self.account, "from": self.from_date, "to": self.to_date}, as_dict=1)
|
||||||
|
|
||||||
condition = ''
|
condition = ''
|
||||||
|
|
||||||
if self.bank_account:
|
if self.bank_account:
|
||||||
|
|||||||
@@ -306,10 +306,6 @@ def get_conditions(filters):
|
|||||||
|
|
||||||
def get_items(filters, additional_query_columns):
|
def get_items(filters, additional_query_columns):
|
||||||
conditions = get_conditions(filters)
|
conditions = get_conditions(filters)
|
||||||
match_conditions = frappe.build_match_conditions("Purchase Invoice")
|
|
||||||
|
|
||||||
if match_conditions:
|
|
||||||
match_conditions = " and {0} ".format(match_conditions)
|
|
||||||
|
|
||||||
if additional_query_columns:
|
if additional_query_columns:
|
||||||
additional_query_columns = ', ' + ', '.join(additional_query_columns)
|
additional_query_columns = ', ' + ', '.join(additional_query_columns)
|
||||||
@@ -327,8 +323,8 @@ def get_items(filters, additional_query_columns):
|
|||||||
`tabPurchase Invoice`.supplier_name, `tabPurchase Invoice`.mode_of_payment {0}
|
`tabPurchase Invoice`.supplier_name, `tabPurchase Invoice`.mode_of_payment {0}
|
||||||
from `tabPurchase Invoice`, `tabPurchase Invoice Item`
|
from `tabPurchase Invoice`, `tabPurchase Invoice Item`
|
||||||
where `tabPurchase Invoice`.name = `tabPurchase Invoice Item`.`parent` and
|
where `tabPurchase Invoice`.name = `tabPurchase Invoice Item`.`parent` and
|
||||||
`tabPurchase Invoice`.docstatus = 1 %s %s
|
`tabPurchase Invoice`.docstatus = 1 %s
|
||||||
""".format(additional_query_columns) % (conditions, match_conditions), filters, as_dict=1)
|
""".format(additional_query_columns) % (conditions), filters, as_dict=1)
|
||||||
|
|
||||||
def get_aii_accounts():
|
def get_aii_accounts():
|
||||||
return dict(frappe.db.sql("select name, stock_received_but_not_billed from tabCompany"))
|
return dict(frappe.db.sql("select name, stock_received_but_not_billed from tabCompany"))
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
|
|||||||
add_sub_total_row(total_row, total_row_map, 'total_row', tax_columns)
|
add_sub_total_row(total_row, total_row_map, 'total_row', tax_columns)
|
||||||
data.append(total_row_map.get('total_row'))
|
data.append(total_row_map.get('total_row'))
|
||||||
skip_total_row = 1
|
skip_total_row = 1
|
||||||
|
|
||||||
return columns, data, None, None, None, skip_total_row
|
return columns, data, None, None, None, skip_total_row
|
||||||
|
|
||||||
def get_columns(additional_table_columns, filters):
|
def get_columns(additional_table_columns, filters):
|
||||||
@@ -370,10 +370,6 @@ def get_group_by_conditions(filters, doctype):
|
|||||||
|
|
||||||
def get_items(filters, additional_query_columns):
|
def get_items(filters, additional_query_columns):
|
||||||
conditions = get_conditions(filters)
|
conditions = get_conditions(filters)
|
||||||
match_conditions = frappe.build_match_conditions("Sales Invoice")
|
|
||||||
|
|
||||||
if match_conditions:
|
|
||||||
match_conditions = " and {0} ".format(match_conditions)
|
|
||||||
|
|
||||||
if additional_query_columns:
|
if additional_query_columns:
|
||||||
additional_query_columns = ', ' + ', '.join(additional_query_columns)
|
additional_query_columns = ', ' + ', '.join(additional_query_columns)
|
||||||
@@ -394,8 +390,8 @@ def get_items(filters, additional_query_columns):
|
|||||||
`tabSales Invoice`.update_stock, `tabSales Invoice Item`.uom, `tabSales Invoice Item`.qty {0}
|
`tabSales Invoice`.update_stock, `tabSales Invoice Item`.uom, `tabSales Invoice Item`.qty {0}
|
||||||
from `tabSales Invoice`, `tabSales Invoice Item`
|
from `tabSales Invoice`, `tabSales Invoice Item`
|
||||||
where `tabSales Invoice`.name = `tabSales Invoice Item`.parent
|
where `tabSales Invoice`.name = `tabSales Invoice Item`.parent
|
||||||
and `tabSales Invoice`.docstatus = 1 {1} {2}
|
and `tabSales Invoice`.docstatus = 1 {1}
|
||||||
""".format(additional_query_columns or '', conditions, match_conditions), filters, as_dict=1) #nosec
|
""".format(additional_query_columns or '', conditions), filters, as_dict=1) #nosec
|
||||||
|
|
||||||
def get_delivery_notes_against_sales_order(item_list):
|
def get_delivery_notes_against_sales_order(item_list):
|
||||||
so_dn_map = frappe._dict()
|
so_dn_map = frappe._dict()
|
||||||
|
|||||||
Reference in New Issue
Block a user