fix: qty calculation in SABB traceability

This commit is contained in:
Rohit Waghchaure
2025-08-07 16:22:52 +05:30
parent c15d7fe86e
commit 505814c07a

View File

@@ -268,7 +268,9 @@ class ReportData:
( (
( (
stock_entry_detail.qty stock_entry_detail.qty
/ Case().when(stock_entry.fg_completed_qty > 0, stock_entry.fg_completed_qty).else_(1) / Case()
.when(stock_entry.fg_completed_qty > 0, stock_entry.fg_completed_qty)
.else_(sabb_data.qty)
) )
* sabb_data.qty * sabb_data.qty
).as_("qty"), ).as_("qty"),
@@ -329,7 +331,7 @@ class ReportData:
& (SABB.type_of_transaction == type_of_transaction) & (SABB.type_of_transaction == type_of_transaction)
) )
.orderby(SABB.posting_date) .orderby(SABB.posting_date)
.orderby(SABE.posting_time) .orderby(SABB.posting_time)
) )
query = query.where((SABE.serial_no == value) | (SABE.batch_no == value)) query = query.where((SABE.serial_no == value) | (SABE.batch_no == value))