diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index 76f51ee4c2..e4ae2a4698 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -38,7 +38,7 @@ class ReceivablePayableReport(object): "width": 120 }) - columns += [_("Age (Days)") + "::80"] + columns += [_("Age (Days)") + ":Int:80"] if not "range1" in self.filters: self.filters["range1"] = "30" diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py index 0fbe22d7af..27ec6181b0 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -355,7 +355,7 @@ class calculate_taxes_and_totals(object): item.net_amount = flt(item.net_amount + discount_amount_loss, item.precision("net_amount")) - item.net_rate = flt(item.net_amount / item.qty, item.precision("net_rate")) + item.net_rate = flt(item.net_amount / item.qty, item.precision("net_rate")) if item.qty else 0 self._set_in_company_currency(item, ["net_rate", "net_amount"]) diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index eda8c7323a..732867ff01 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -396,7 +396,7 @@ def make_sales_invoice(source_name, target_doc=None): "parent": "sales_order", }, "postprocess": update_item, - "condition": lambda doc: doc.base_amount==0 or doc.billed_amt < doc.amount + "condition": lambda doc: doc.qty and (doc.base_amount==0 or doc.billed_amt < doc.amount) }, "Sales Taxes and Charges": { "doctype": "Sales Taxes and Charges", diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 310f4cca22..8a6acd7c77 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -200,8 +200,8 @@ class Item(WebsiteGenerator): self.set("reorder_levels", []) if self.re_order_level or len(self.get("reorder_levels", {"material_request_type": "Purchase"})): - if not self.is_purchase_item: - frappe.throw(_("""To set reorder level, item must be a Purchase Item""")) + if not (self.is_purchase_item or self.is_pro_applicable): + frappe.throw(_("""To set reorder level, item must be a Purchase Item or Prodcution Item""")) def validate_warehouse_for_reorder(self): warehouse = []