Merge branch 'develop' into payroll-entry-fixes

This commit is contained in:
Anurag Mishra 2020-12-30 13:22:13 +05:30 committed by GitHub
commit b7631af741
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 22 deletions

View File

@ -47,6 +47,7 @@ def get_data(filters):
for d in gl_entries: for d in gl_entries:
asset_data = assets_details.get(d.against_voucher) asset_data = assets_details.get(d.against_voucher)
if asset_data:
if not asset_data.get("accumulated_depreciation_amount"): if not asset_data.get("accumulated_depreciation_amount"):
asset_data.accumulated_depreciation_amount = d.debit asset_data.accumulated_depreciation_amount = d.debit
else: else:

View File

@ -259,11 +259,16 @@ class StockEntry(StockController):
item_code.append(item.item_code) item_code.append(item.item_code)
def validate_fg_completed_qty(self): def validate_fg_completed_qty(self):
item_wise_qty = {}
if self.purpose == "Manufacture" and self.work_order: if self.purpose == "Manufacture" and self.work_order:
for d in self.items: for d in self.items:
if d.is_finished_item and d.qty != self.fg_completed_qty: if d.is_finished_item:
frappe.throw(_("Finished product quantity <b>{0}</b> and For Quantity <b>{1}</b> cannot be different") item_wise_qty.setdefault(d.item_code, []).append(d.qty)
.format(d.qty, self.fg_completed_qty))
for item_code, qty_list in iteritems(item_wise_qty):
if self.fg_completed_qty != sum(qty_list):
frappe.throw(_("The finished product {0} quantity {1} and For Quantity {2} cannot be different")
.format(frappe.bold(item_code), frappe.bold(sum(qty_list)), frappe.bold(self.fg_completed_qty)))
def validate_difference_account(self): def validate_difference_account(self):
if not cint(erpnext.is_perpetual_inventory_enabled(self.company)): if not cint(erpnext.is_perpetual_inventory_enabled(self.company)):
@ -319,7 +324,7 @@ class StockEntry(StockController):
if self.purpose == "Manufacture": if self.purpose == "Manufacture":
if validate_for_manufacture: if validate_for_manufacture:
if d.bom_no: if d.is_finished_item or d.is_scrap_item:
d.s_warehouse = None d.s_warehouse = None
if not d.t_warehouse: if not d.t_warehouse:
frappe.throw(_("Target warehouse is mandatory for row {0}").format(d.idx)) frappe.throw(_("Target warehouse is mandatory for row {0}").format(d.idx))

View File

@ -217,7 +217,7 @@
"fieldname": "role_allowed_to_create_edit_back_dated_transactions", "fieldname": "role_allowed_to_create_edit_back_dated_transactions",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Role Allowed to Create/Edit Back-dated Transactions", "label": "Role Allowed to Create/Edit Back-dated Transactions",
"options": "User" "options": "Role"
}, },
{ {
"fieldname": "column_break_26", "fieldname": "column_break_26",
@ -234,7 +234,7 @@
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"issingle": 1, "issingle": 1,
"links": [], "links": [],
"modified": "2020-11-23 22:26:54.225608", "modified": "2020-12-29 12:53:31.162247",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Stock Settings", "name": "Stock Settings",