mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-21 22:19:18 +00:00
Merge branch 'develop'
This commit is contained in:
@@ -1 +1 @@
|
|||||||
__version__ = '4.7.0'
|
__version__ = '4.7.1'
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ app_publisher = "Web Notes Technologies Pvt. Ltd. and Contributors"
|
|||||||
app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations"
|
app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations"
|
||||||
app_icon = "icon-th"
|
app_icon = "icon-th"
|
||||||
app_color = "#e74c3c"
|
app_color = "#e74c3c"
|
||||||
app_version = "4.7.0"
|
app_version = "4.7.1"
|
||||||
|
|
||||||
error_report_email = "support@erpnext.com"
|
error_report_email = "support@erpnext.com"
|
||||||
|
|
||||||
|
|||||||
@@ -11,41 +11,42 @@ def execute():
|
|||||||
|
|
||||||
warehouse_account = frappe.db.sql("""select name, master_name from tabAccount
|
warehouse_account = frappe.db.sql("""select name, master_name from tabAccount
|
||||||
where ifnull(account_type, '') = 'Warehouse'""")
|
where ifnull(account_type, '') = 'Warehouse'""")
|
||||||
warehouses = [d[1] for d in warehouse_account]
|
if warehouse_account:
|
||||||
accounts = [d[0] for d in warehouse_account]
|
warehouses = [d[1] for d in warehouse_account]
|
||||||
|
accounts = [d[0] for d in warehouse_account]
|
||||||
|
|
||||||
stock_vouchers = frappe.db.sql("""select distinct sle.voucher_type, sle.voucher_no
|
stock_vouchers = frappe.db.sql("""select distinct sle.voucher_type, sle.voucher_no
|
||||||
from `tabStock Ledger Entry` sle
|
from `tabStock Ledger Entry` sle
|
||||||
where sle.warehouse in (%s)
|
where sle.warehouse in (%s)
|
||||||
order by sle.posting_date""" %
|
order by sle.posting_date""" %
|
||||||
', '.join(['%s']*len(warehouses)), tuple(warehouses))
|
', '.join(['%s']*len(warehouses)), tuple(warehouses))
|
||||||
|
|
||||||
rejected = []
|
rejected = []
|
||||||
for voucher_type, voucher_no in stock_vouchers:
|
for voucher_type, voucher_no in stock_vouchers:
|
||||||
stock_bal = frappe.db.sql("""select sum(stock_value_difference) from `tabStock Ledger Entry`
|
stock_bal = frappe.db.sql("""select sum(stock_value_difference) from `tabStock Ledger Entry`
|
||||||
where voucher_type=%s and voucher_no =%s and warehouse in (%s)""" %
|
where voucher_type=%s and voucher_no =%s and warehouse in (%s)""" %
|
||||||
('%s', '%s', ', '.join(['%s']*len(warehouses))), tuple([voucher_type, voucher_no] + warehouses))
|
('%s', '%s', ', '.join(['%s']*len(warehouses))), tuple([voucher_type, voucher_no] + warehouses))
|
||||||
|
|
||||||
account_bal = frappe.db.sql("""select ifnull(sum(ifnull(debit, 0) - ifnull(credit, 0)), 0)
|
account_bal = frappe.db.sql("""select ifnull(sum(ifnull(debit, 0) - ifnull(credit, 0)), 0)
|
||||||
from `tabGL Entry`
|
from `tabGL Entry`
|
||||||
where voucher_type=%s and voucher_no =%s and account in (%s)
|
where voucher_type=%s and voucher_no =%s and account in (%s)
|
||||||
group by voucher_type, voucher_no""" %
|
group by voucher_type, voucher_no""" %
|
||||||
('%s', '%s', ', '.join(['%s']*len(accounts))), tuple([voucher_type, voucher_no] + accounts))
|
('%s', '%s', ', '.join(['%s']*len(accounts))), tuple([voucher_type, voucher_no] + accounts))
|
||||||
|
|
||||||
if stock_bal and account_bal and abs(flt(stock_bal[0][0]) - flt(account_bal[0][0])) > 0.1:
|
if stock_bal and account_bal and abs(flt(stock_bal[0][0]) - flt(account_bal[0][0])) > 0.1:
|
||||||
try:
|
try:
|
||||||
print voucher_type, voucher_no, stock_bal[0][0], account_bal[0][0]
|
print voucher_type, voucher_no, stock_bal[0][0], account_bal[0][0]
|
||||||
|
|
||||||
frappe.db.sql("""delete from `tabGL Entry`
|
frappe.db.sql("""delete from `tabGL Entry`
|
||||||
where voucher_type=%s and voucher_no=%s""", (voucher_type, voucher_no))
|
where voucher_type=%s and voucher_no=%s""", (voucher_type, voucher_no))
|
||||||
|
|
||||||
voucher = frappe.get_doc(voucher_type, voucher_no)
|
voucher = frappe.get_doc(voucher_type, voucher_no)
|
||||||
voucher.make_gl_entries(repost_future_gle=False)
|
voucher.make_gl_entries(repost_future_gle=False)
|
||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print frappe.get_traceback()
|
print frappe.get_traceback()
|
||||||
rejected.append([voucher_type, voucher_no])
|
rejected.append([voucher_type, voucher_no])
|
||||||
frappe.db.rollback()
|
frappe.db.rollback()
|
||||||
|
|
||||||
print "Failed to repost: "
|
print "Failed to repost: "
|
||||||
print rejected
|
print rejected
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -1,7 +1,7 @@
|
|||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
import os
|
import os
|
||||||
|
|
||||||
version = "4.7.0"
|
version = "4.7.1"
|
||||||
|
|
||||||
with open("requirements.txt", "r") as f:
|
with open("requirements.txt", "r") as f:
|
||||||
install_requires = f.readlines()
|
install_requires = f.readlines()
|
||||||
|
|||||||
Reference in New Issue
Block a user