Merge branch 'develop'
This commit is contained in:
commit
4451db2db4
@ -1,2 +1,2 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
__version__ = '5.7.5'
|
__version__ = '5.7.6'
|
||||||
|
@ -236,7 +236,7 @@ class JournalEntry(AccountsController):
|
|||||||
if voucher_properties[0] != 1:
|
if voucher_properties[0] != 1:
|
||||||
frappe.throw(_("{0} {1} is not submitted").format(reference_type, reference_name))
|
frappe.throw(_("{0} {1} is not submitted").format(reference_type, reference_name))
|
||||||
|
|
||||||
if flt(voucher_properties[1]) < total:
|
if total and flt(voucher_properties[1]) < total:
|
||||||
frappe.throw(_("Payment against {0} {1} cannot be greater \
|
frappe.throw(_("Payment against {0} {1} cannot be greater \
|
||||||
than Outstanding Amount {2}").format(reference_type, reference_name, voucher_properties[1]))
|
than Outstanding Amount {2}").format(reference_type, reference_name, voucher_properties[1]))
|
||||||
|
|
||||||
|
@ -215,14 +215,15 @@ class AccountsController(TransactionBase):
|
|||||||
"""Returns list of advances against Account, Party, Reference"""
|
"""Returns list of advances against Account, Party, Reference"""
|
||||||
order_list = list(set([d.get(against_order_field) for d in self.get("items") if d.get(against_order_field)]))
|
order_list = list(set([d.get(against_order_field) for d in self.get("items") if d.get(against_order_field)]))
|
||||||
|
|
||||||
if not order_list:
|
|
||||||
return
|
|
||||||
|
|
||||||
in_placeholder = ', '.join(['%s'] * len(order_list))
|
|
||||||
|
|
||||||
# conver sales_order to "Sales Order"
|
# conver sales_order to "Sales Order"
|
||||||
reference_type = against_order_field.replace("_", " ").title()
|
reference_type = against_order_field.replace("_", " ").title()
|
||||||
|
|
||||||
|
condition = ""
|
||||||
|
if order_list:
|
||||||
|
in_placeholder = ', '.join(['%s'] * len(order_list))
|
||||||
|
condition = "or (t2.reference_type = '{0}' and ifnull(t2.reference_name, '') in ({1}))"\
|
||||||
|
.format(reference_type, in_placeholder)
|
||||||
|
|
||||||
res = frappe.db.sql("""
|
res = frappe.db.sql("""
|
||||||
select
|
select
|
||||||
t1.name as jv_no, t1.remark, t2.{0} as amount, t2.name as jv_detail_no,
|
t1.name as jv_no, t1.remark, t2.{0} as amount, t2.name as jv_detail_no,
|
||||||
@ -233,11 +234,9 @@ class AccountsController(TransactionBase):
|
|||||||
t1.name = t2.parent and t2.account = %s
|
t1.name = t2.parent and t2.account = %s
|
||||||
and t2.party_type = %s and t2.party = %s
|
and t2.party_type = %s and t2.party = %s
|
||||||
and t2.is_advance = 'Yes' and t1.docstatus = 1
|
and t2.is_advance = 'Yes' and t1.docstatus = 1
|
||||||
and (
|
and (ifnull(t2.reference_type, '')='' {1})
|
||||||
ifnull(t2.reference_type, '')=''
|
order by t1.posting_date""".format(dr_or_cr, condition),
|
||||||
or (t2.reference_type = %s and ifnull(t2.reference_name, '') in ({1})))
|
[account_head, party_type, party] + order_list, as_dict=1)
|
||||||
order by t1.posting_date""".format(dr_or_cr, in_placeholder),
|
|
||||||
[account_head, party_type, party, reference_type] + order_list, as_dict=1)
|
|
||||||
|
|
||||||
self.set(parentfield, [])
|
self.set(parentfield, [])
|
||||||
for d in res:
|
for d in res:
|
||||||
|
@ -27,7 +27,7 @@ blogs.
|
|||||||
"""
|
"""
|
||||||
app_icon = "icon-th"
|
app_icon = "icon-th"
|
||||||
app_color = "#e74c3c"
|
app_color = "#e74c3c"
|
||||||
app_version = "5.7.5"
|
app_version = "5.7.6"
|
||||||
github_link = "https://github.com/frappe/erpnext"
|
github_link = "https://github.com/frappe/erpnext"
|
||||||
|
|
||||||
error_report_email = "support@erpnext.com"
|
error_report_email = "support@erpnext.com"
|
||||||
|
@ -334,12 +334,11 @@ class PurchaseReceipt(BuyingController):
|
|||||||
}))
|
}))
|
||||||
|
|
||||||
# divisional loss adjustment
|
# divisional loss adjustment
|
||||||
if not self.get("taxes"):
|
|
||||||
sle_valuation_amount = flt(flt(d.valuation_rate, val_rate_db_precision) * flt(d.qty) * flt(d.conversion_factor),
|
sle_valuation_amount = flt(flt(d.valuation_rate, val_rate_db_precision) * flt(d.qty) * flt(d.conversion_factor),
|
||||||
self.precision("base_net_amount", d))
|
self.precision("base_net_amount", d))
|
||||||
|
|
||||||
distributed_amount = flt(flt(d.base_net_amount, self.precision("base_net_amount", d))) + \
|
distributed_amount = flt(flt(d.base_net_amount, self.precision("base_net_amount", d))) + \
|
||||||
flt(d.landed_cost_voucher_amount) + flt(d.rm_supp_cost)
|
flt(d.landed_cost_voucher_amount) + flt(d.rm_supp_cost) + flt(d.item_tax_amount)
|
||||||
|
|
||||||
divisional_loss = flt(distributed_amount - sle_valuation_amount, self.precision("base_net_amount", d))
|
divisional_loss = flt(distributed_amount - sle_valuation_amount, self.precision("base_net_amount", d))
|
||||||
if divisional_loss:
|
if divisional_loss:
|
||||||
|
@ -80,7 +80,8 @@ class StockEntry(StockController):
|
|||||||
for item in self.get("items"):
|
for item in self.get("items"):
|
||||||
if not flt(item.qty):
|
if not flt(item.qty):
|
||||||
frappe.throw(_("Row {0}: Qty is mandatory").format(item.idx))
|
frappe.throw(_("Row {0}: Qty is mandatory").format(item.idx))
|
||||||
|
if not flt(item.conversion_factor):
|
||||||
|
frappe.throw(_("Row {0}: UOM Conversion Factor is mandatory").format(item.idx))
|
||||||
item.transfer_qty = flt(item.qty * item.conversion_factor, self.precision("transfer_qty", item))
|
item.transfer_qty = flt(item.qty * item.conversion_factor, self.precision("transfer_qty", item))
|
||||||
|
|
||||||
def validate_item(self):
|
def validate_item(self):
|
||||||
|
@ -88,9 +88,12 @@ def update_stock_ledger_entry(item_code, new_stock_uom, conversion_factor):
|
|||||||
|
|
||||||
if flt(conversion_factor) != flt(1):
|
if flt(conversion_factor) != flt(1):
|
||||||
frappe.db.sql("""update `tabStock Ledger Entry`
|
frappe.db.sql("""update `tabStock Ledger Entry`
|
||||||
set stock_uom = %s, actual_qty = ifnull(actual_qty,0) * %s
|
set
|
||||||
|
stock_uom = %s,
|
||||||
|
actual_qty = ifnull(actual_qty,0) * %s,
|
||||||
|
qty_after_transaction = ifnull(qty_after_transaction, 0) * %s
|
||||||
where item_code = %s""",
|
where item_code = %s""",
|
||||||
(new_stock_uom, conversion_factor, item_code))
|
(new_stock_uom, conversion_factor, conversion_factor, item_code))
|
||||||
else:
|
else:
|
||||||
frappe.db.sql("""update `tabStock Ledger Entry` set stock_uom=%s
|
frappe.db.sql("""update `tabStock Ledger Entry` set stock_uom=%s
|
||||||
where item_code=%s""", (new_stock_uom, item_code))
|
where item_code=%s""", (new_stock_uom, item_code))
|
||||||
|
2
setup.py
2
setup.py
@ -1,6 +1,6 @@
|
|||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
version = "5.7.5"
|
version = "5.7.6"
|
||||||
|
|
||||||
with open("requirements.txt", "r") as f:
|
with open("requirements.txt", "r") as f:
|
||||||
install_requires = f.readlines()
|
install_requires = f.readlines()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user