mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 16:04:46 +00:00
chore: conflicts
This commit is contained in:
@@ -6,12 +6,8 @@ import frappe
|
|||||||
from frappe import _
|
from frappe import _
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from frappe.model.naming import make_autoname, revert_series_if_last
|
from frappe.model.naming import make_autoname, revert_series_if_last
|
||||||
<<<<<<< HEAD
|
|
||||||
from frappe.utils import cint, flt, get_link_to_form, nowtime
|
|
||||||
=======
|
|
||||||
from frappe.query_builder.functions import CurDate, Sum, Timestamp
|
from frappe.query_builder.functions import CurDate, Sum, Timestamp
|
||||||
from frappe.utils import cint, flt, get_link_to_form
|
from frappe.utils import cint, flt, get_link_to_form, nowtime
|
||||||
>>>>>>> 517b5f8567 (refactor: rewrite `batch.py` queries in `QB`)
|
|
||||||
from frappe.utils.data import add_days
|
from frappe.utils.data import add_days
|
||||||
from frappe.utils.jinja import render_template
|
from frappe.utils.jinja import render_template
|
||||||
|
|
||||||
@@ -185,26 +181,18 @@ def get_batch_qty(
|
|||||||
|
|
||||||
out = 0
|
out = 0
|
||||||
if batch_no and warehouse:
|
if batch_no and warehouse:
|
||||||
<<<<<<< HEAD
|
|
||||||
cond = ""
|
|
||||||
|
|
||||||
if posting_date:
|
|
||||||
if posting_time is None:
|
|
||||||
posting_time = nowtime()
|
|
||||||
|
|
||||||
cond = " and timestamp(posting_date, posting_time) <= timestamp('{0}', '{1}')".format(
|
|
||||||
posting_date, posting_time
|
|
||||||
=======
|
|
||||||
query = (
|
query = (
|
||||||
frappe.qb.from_(sle)
|
frappe.qb.from_(sle)
|
||||||
.select(Sum(sle.actual_qty))
|
.select(Sum(sle.actual_qty))
|
||||||
.where((sle.is_cancelled == 0) & (sle.warehouse == warehouse) & (sle.batch_no == batch_no))
|
.where((sle.is_cancelled == 0) & (sle.warehouse == warehouse) & (sle.batch_no == batch_no))
|
||||||
)
|
)
|
||||||
|
|
||||||
if posting_date and posting_time:
|
if posting_date:
|
||||||
|
if posting_time is None:
|
||||||
|
posting_time = nowtime()
|
||||||
|
|
||||||
query = query.where(
|
query = query.where(
|
||||||
Timestamp(sle.posting_date, sle.posting_time) <= Timestamp(posting_date, posting_time)
|
Timestamp(sle.posting_date, sle.posting_time) <= Timestamp(posting_date, posting_time)
|
||||||
>>>>>>> 517b5f8567 (refactor: rewrite `batch.py` queries in `QB`)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
out = query.run(as_list=True)[0][0] or 0
|
out = query.run(as_list=True)[0][0] or 0
|
||||||
|
|||||||
Reference in New Issue
Block a user