mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-03 08:32:24 +00:00
Added Make Receipt (Update Stock) and IsCash option on Purchase Invoice
This commit is contained in:
@@ -152,6 +152,7 @@ def make_return_doc(doctype, source_name, target_doc=None):
|
||||
target_doc.prevdoc_docname = source_doc.prevdoc_docname
|
||||
target_doc.prevdoc_detail_docname = source_doc.prevdoc_detail_docname
|
||||
elif doctype == "Purchase Invoice":
|
||||
target_doc.received_qty = -1* source_doc.qty
|
||||
target_doc.purchase_order = source_doc.purchase_order
|
||||
target_doc.purchase_receipt = source_doc.purchase_receipt
|
||||
target_doc.po_detail = source_doc.po_detail
|
||||
|
||||
@@ -169,7 +169,7 @@ class StockController(AccountsController):
|
||||
else:
|
||||
is_expense_account = frappe.db.get_value("Account",
|
||||
item.get("expense_account"), "report_type")=="Profit and Loss"
|
||||
if self.doctype not in ("Purchase Receipt", "Stock Reconciliation", "Stock Entry") and not is_expense_account:
|
||||
if self.doctype not in ("Purchase Receipt", "Purchase Invoice", "Stock Reconciliation", "Stock Entry") and not is_expense_account:
|
||||
frappe.throw(_("Expense / Difference account ({0}) must be a 'Profit or Loss' account")
|
||||
.format(item.get("expense_account")))
|
||||
if is_expense_account and not item.get("cost_center"):
|
||||
|
||||
Reference in New Issue
Block a user