Merge pull request #25541 from rohitwaghchaure/fixed-incorrect-serial-no-set

fix: serial no changed after saving stock reconciliation
This commit is contained in:
rohitwaghchaure 2021-05-06 17:44:36 +05:30 committed by GitHub
commit dc6233b703
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt
def execute(filters=None):
columns, data = [], []
@ -52,8 +53,8 @@ def get_rows(filters):
def calculate_cost_and_profit(data):
for row in data:
row.fractional_cost = row.base_gross_pay * row.utilization
row.profit = row.base_grand_total - row.base_gross_pay * row.utilization
row.fractional_cost = flt(row.base_gross_pay) * flt(row.utilization)
row.profit = flt(row.base_grand_total) - flt(row.base_gross_pay) * flt(row.utilization)
return data
def get_conditions(filters):

View File

@ -72,7 +72,7 @@ class StockReconciliation(StockController):
if item_dict.get("serial_nos"):
item.current_serial_no = item_dict.get("serial_nos")
if self.purpose == "Stock Reconciliation":
if self.purpose == "Stock Reconciliation" and not item.serial_no:
item.serial_no = item.current_serial_no
item.current_qty = item_dict.get("qty")