[Fix] Minor issue in landed cost voucher
This commit is contained in:
parent
e2f4b35b11
commit
a3a977d02a
@ -12,22 +12,23 @@ class LandedCostVoucher(Document):
|
|||||||
def get_items_from_purchase_receipts(self):
|
def get_items_from_purchase_receipts(self):
|
||||||
self.set("items", [])
|
self.set("items", [])
|
||||||
for pr in self.get("purchase_receipts"):
|
for pr in self.get("purchase_receipts"):
|
||||||
pr_items = frappe.db.sql("""select pr_item.item_code, pr_item.description,
|
if pr.receipt_document_type and pr.receipt_document:
|
||||||
pr_item.qty, pr_item.base_rate, pr_item.base_amount, pr_item.name
|
pr_items = frappe.db.sql("""select pr_item.item_code, pr_item.description,
|
||||||
from `tab{doctype} Item` pr_item where parent = %s
|
pr_item.qty, pr_item.base_rate, pr_item.base_amount, pr_item.name
|
||||||
and exists(select name from tabItem where name = pr_item.item_code and is_stock_item = 1)
|
from `tab{doctype} Item` pr_item where parent = %s
|
||||||
""".format(doctype=pr.receipt_document_type), pr.receipt_document, as_dict=True)
|
and exists(select name from tabItem where name = pr_item.item_code and is_stock_item = 1)
|
||||||
|
""".format(doctype=pr.receipt_document_type), pr.receipt_document, as_dict=True)
|
||||||
|
|
||||||
for d in pr_items:
|
for d in pr_items:
|
||||||
item = self.append("items")
|
item = self.append("items")
|
||||||
item.item_code = d.item_code
|
item.item_code = d.item_code
|
||||||
item.description = d.description
|
item.description = d.description
|
||||||
item.qty = d.qty
|
item.qty = d.qty
|
||||||
item.rate = d.base_rate
|
item.rate = d.base_rate
|
||||||
item.amount = d.base_amount
|
item.amount = d.base_amount
|
||||||
item.receipt_document_type = pr.receipt_document_type
|
item.receipt_document_type = pr.receipt_document_type
|
||||||
item.receipt_document = pr.receipt_document
|
item.receipt_document = pr.receipt_document
|
||||||
item.purchase_receipt_item = d.name
|
item.purchase_receipt_item = d.name
|
||||||
|
|
||||||
if self.get("taxes"):
|
if self.get("taxes"):
|
||||||
self.set_applicable_charges_for_item()
|
self.set_applicable_charges_for_item()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user