mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-21 22:19:18 +00:00
refactor: further changes to adapt to query builder changes
(cherry picked from commit 8235a551f0)
This commit is contained in:
@@ -360,6 +360,8 @@ class BOMCreator(Document):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_children(doctype=None, parent=None, **kwargs):
|
def get_children(doctype=None, parent=None, **kwargs):
|
||||||
|
from pypika.terms import ValueWrapper
|
||||||
|
|
||||||
if isinstance(kwargs, str):
|
if isinstance(kwargs, str):
|
||||||
kwargs = frappe.parse_json(kwargs)
|
kwargs = frappe.parse_json(kwargs)
|
||||||
|
|
||||||
@@ -373,7 +375,7 @@ def get_children(doctype=None, parent=None, **kwargs):
|
|||||||
"parent as parent_id",
|
"parent as parent_id",
|
||||||
"qty",
|
"qty",
|
||||||
"idx",
|
"idx",
|
||||||
"'BOM Creator Item' as doctype",
|
ValueWrapper("BOM Creator Item").as_("doctype"),
|
||||||
"name",
|
"name",
|
||||||
"uom",
|
"uom",
|
||||||
"rate",
|
"rate",
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import frappe
|
import frappe
|
||||||
|
from pypika.terms import LiteralValue
|
||||||
|
|
||||||
from erpnext.accounts.general_ledger import make_reverse_gl_entries
|
from erpnext.accounts.general_ledger import make_reverse_gl_entries
|
||||||
|
|
||||||
@@ -39,7 +40,7 @@ def execute():
|
|||||||
"payment_amount",
|
"payment_amount",
|
||||||
# at the time of creating this dunning, the full amount was outstanding
|
# at the time of creating this dunning, the full amount was outstanding
|
||||||
"payment_amount as outstanding",
|
"payment_amount as outstanding",
|
||||||
"'0' as paid_amount",
|
LiteralValue(0).as_("paid_amount"),
|
||||||
"discounted_amount",
|
"discounted_amount",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -383,7 +383,7 @@ def get_timesheet_data(name, project):
|
|||||||
data = frappe.get_all(
|
data = frappe.get_all(
|
||||||
"Timesheet",
|
"Timesheet",
|
||||||
fields=[
|
fields=[
|
||||||
"(total_billable_amount - total_billed_amount) as billing_amt",
|
{"SUB": ["total_billable_amount", "total_billed_amount"], "as": "billing_amt"},
|
||||||
"total_billable_hours as billing_hours",
|
"total_billable_hours as billing_hours",
|
||||||
],
|
],
|
||||||
filters={"name": name},
|
filters={"name": name},
|
||||||
|
|||||||
Reference in New Issue
Block a user