chore: Revert "fix: Received/Delivered Items to Billed Logic" (#23950)

This reverts commit 4f008f59fc.
This commit is contained in:
Marica
2020-11-18 20:54:43 +05:30
committed by GitHub
parent 18471131cc
commit 507c46d9a4
3 changed files with 16 additions and 40 deletions

View File

@@ -14,19 +14,11 @@ def execute(filters=None):
def get_column(): def get_column():
return [ return [
_("Delivery Note") + ":Link/Delivery Note:160", _("Delivery Note") + ":Link/Delivery Note:120", _("Status") + "::120", _("Date") + ":Date:100",
_("Date") + ":Date:100", _("Suplier") + ":Link/Customer:120", _("Customer Name") + "::120",
_("Customer") + ":Link/Customer:120", _("Project") + ":Link/Project:120", _("Item Code") + ":Link/Item:120",
_("Customer Name") + "::120", _("Amount") + ":Currency:100", _("Billed Amount") + ":Currency:100", _("Pending Amount") + ":Currency:100",
_("Item Code") + ":Link/Item:120", _("Item Name") + "::120", _("Description") + "::120", _("Company") + ":Link/Company:120",
_("Amount") + ":Currency:100",
_("Billed Amount") + ":Currency:100",
_("Returned Amount") + ":Currency:120",
_("Pending Amount") + ":Currency:100",
_("Item Name") + "::120",
_("Description") + "::120",
_("Project") + ":Link/Project:120",
_("Company") + ":Link/Company:120",
] ]
def get_args(): def get_args():

View File

@@ -17,26 +17,18 @@ def get_ordered_to_be_billed_data(args):
return frappe.db.sql(""" return frappe.db.sql("""
Select Select
`{parent_tab}`.name, `{parent_tab}`.{date_field}, `{parent_tab}`.name, `{parent_tab}`.status, `{parent_tab}`.{date_field}, `{parent_tab}`.{party}, `{parent_tab}`.{party}_name,
`{parent_tab}`.{party}, `{parent_tab}`.{party}_name, {project_field}, `{child_tab}`.item_code, `{child_tab}`.base_amount,
`{child_tab}`.item_code,
`{child_tab}`.base_amount,
(`{child_tab}`.billed_amt * ifnull(`{parent_tab}`.conversion_rate, 1)), (`{child_tab}`.billed_amt * ifnull(`{parent_tab}`.conversion_rate, 1)),
(`{child_tab}`.base_rate * ifnull(`{child_tab}`.returned_qty, 0)), (`{child_tab}`.base_amount - (`{child_tab}`.billed_amt * ifnull(`{parent_tab}`.conversion_rate, 1))),
(`{child_tab}`.base_amount - `{child_tab}`.item_name, `{child_tab}`.description, `{parent_tab}`.company
(`{child_tab}`.billed_amt * ifnull(`{parent_tab}`.conversion_rate, 1)) -
(`{child_tab}`.base_rate * ifnull(`{child_tab}`.returned_qty, 0))),
`{child_tab}`.item_name, `{child_tab}`.description,
{project_field}, `{parent_tab}`.company
from from
`{parent_tab}`, `{child_tab}` `{parent_tab}`, `{child_tab}`
where where
`{parent_tab}`.name = `{child_tab}`.parent and `{parent_tab}`.docstatus = 1 `{parent_tab}`.name = `{child_tab}`.parent and `{parent_tab}`.docstatus = 1
and `{parent_tab}`.status not in ('Closed', 'Completed') and `{parent_tab}`.status not in ('Closed', 'Completed')
and `{child_tab}`.amount > 0 and `{child_tab}`.amount > 0 and round(`{child_tab}`.billed_amt *
and (`{child_tab}`.base_amount - ifnull(`{parent_tab}`.conversion_rate, 1), {precision}) < `{child_tab}`.base_amount
round(`{child_tab}`.billed_amt * ifnull(`{parent_tab}`.conversion_rate, 1), {precision}) -
(`{child_tab}`.base_rate * ifnull(`{child_tab}`.returned_qty, 0))) > 0
order by order by
`{parent_tab}`.{order} {order_by} `{parent_tab}`.{order} {order_by}
""".format(parent_tab = 'tab' + doctype, child_tab = 'tab' + child_tab, precision= precision, party = party, """.format(parent_tab = 'tab' + doctype, child_tab = 'tab' + child_tab, precision= precision, party = party,

View File

@@ -14,19 +14,11 @@ def execute(filters=None):
def get_column(): def get_column():
return [ return [
_("Purchase Receipt") + ":Link/Purchase Receipt:160", _("Purchase Receipt") + ":Link/Purchase Receipt:120", _("Status") + "::120", _("Date") + ":Date:100",
_("Date") + ":Date:100", _("Supplier") + ":Link/Supplier:120", _("Supplier Name") + "::120",
_("Supplier") + ":Link/Supplier:120", _("Project") + ":Link/Project:120", _("Item Code") + ":Link/Item:120",
_("Supplier Name") + "::120", _("Amount") + ":Currency:100", _("Billed Amount") + ":Currency:100", _("Amount to Bill") + ":Currency:100",
_("Item Code") + ":Link/Item:120", _("Item Name") + "::120", _("Description") + "::120", _("Company") + ":Link/Company:120",
_("Amount") + ":Currency:100",
_("Billed Amount") + ":Currency:100",
_("Returned Amount") + ":Currency:120",
_("Pending Amount") + ":Currency:120",
_("Item Name") + "::120",
_("Description") + "::120",
_("Project") + ":Link/Project:120",
_("Company") + ":Link/Company:120",
] ]
def get_args(): def get_args():