Merge pull request #7172 from nabinhait/hotfix
Issue fixed in Quality Inspection, P&L period and purchase register
This commit is contained in:
commit
00ae31bd1c
@ -42,9 +42,6 @@ def get_period_list(from_fiscal_year, to_fiscal_year, periodicity):
|
|||||||
if to_date == get_first_day(to_date):
|
if to_date == get_first_day(to_date):
|
||||||
# if to_date is the first day, get the last day of previous month
|
# if to_date is the first day, get the last day of previous month
|
||||||
to_date = add_days(to_date, -1)
|
to_date = add_days(to_date, -1)
|
||||||
else:
|
|
||||||
# to_date should be the last day of the new to_date's month
|
|
||||||
to_date = get_last_day(to_date)
|
|
||||||
|
|
||||||
if to_date <= year_end_date:
|
if to_date <= year_end_date:
|
||||||
# the normal case
|
# the normal case
|
||||||
|
|||||||
@ -185,7 +185,7 @@ def get_invoice_po_pr_map(invoice_list):
|
|||||||
pr_list = [d.purchase_receipt]
|
pr_list = [d.purchase_receipt]
|
||||||
elif d.po_detail:
|
elif d.po_detail:
|
||||||
pr_list = frappe.db.sql_list("""select distinct parent from `tabPurchase Receipt Item`
|
pr_list = frappe.db.sql_list("""select distinct parent from `tabPurchase Receipt Item`
|
||||||
where docstatus=1 and prevdoc_detail_docname=%s""", d.po_detail)
|
where docstatus=1 and purchase_order_item=%s""", d.po_detail)
|
||||||
|
|
||||||
if pr_list:
|
if pr_list:
|
||||||
invoice_po_pr_map.setdefault(d.parent, frappe._dict()).setdefault("purchase_receipt", pr_list)
|
invoice_po_pr_map.setdefault(d.parent, frappe._dict()).setdefault("purchase_receipt", pr_list)
|
||||||
|
|||||||
@ -28,15 +28,12 @@ class QualityInspection(Document):
|
|||||||
frappe.db.sql("""update `tabPurchase Receipt Item` t1, `tabPurchase Receipt` t2
|
frappe.db.sql("""update `tabPurchase Receipt Item` t1, `tabPurchase Receipt` t2
|
||||||
set t1.qa_no = %s, t2.modified = %s
|
set t1.qa_no = %s, t2.modified = %s
|
||||||
where t1.parent = %s and t1.item_code = %s and t1.parent = t2.name""",
|
where t1.parent = %s and t1.item_code = %s and t1.parent = t2.name""",
|
||||||
(self.name, self.modified, self.purchase_receipt_no,
|
(self.name, self.modified, self.purchase_receipt_no, self.item_code))
|
||||||
self.item_code))
|
|
||||||
|
|
||||||
def on_cancel(self):
|
def on_cancel(self):
|
||||||
if self.purchase_receipt_no:
|
if self.purchase_receipt_no:
|
||||||
frappe.db.sql("""update `tabPurchase Receipt Item` t1, `tabPurchase Receipt` t2
|
frappe.db.sql("""update `tabPurchase Receipt Item` set qa_no = '', modified=%s
|
||||||
set t1.qa_no = '', t2.modified = %s
|
where qa_no = %s""", (self.modified, self.name))
|
||||||
where t1.parent = %s and t1.item_code = %s and t1.parent = t2.name""",
|
|
||||||
(self.modified, self.purchase_receipt_no, self.item_code))
|
|
||||||
|
|
||||||
def item_query(doctype, txt, searchfield, start, page_len, filters):
|
def item_query(doctype, txt, searchfield, start, page_len, filters):
|
||||||
if filters.get("from"):
|
if filters.get("from"):
|
||||||
|
|||||||
@ -22,7 +22,7 @@ def execute():
|
|||||||
|
|
||||||
# Update billed_amt in DN and PR which are not against any order
|
# Update billed_amt in DN and PR which are not against any order
|
||||||
for d in frappe.db.sql("""select name from `tabPurchase Receipt Item` item
|
for d in frappe.db.sql("""select name from `tabPurchase Receipt Item` item
|
||||||
where (prevdoc_detail_docname is null or prevdoc_detail_docname = '') and docstatus=1""", as_dict=1):
|
where (purchase_order_item is null or purchase_order_item = '') and docstatus=1""", as_dict=1):
|
||||||
|
|
||||||
billed_amt = frappe.db.sql("""select sum(amount) from `tabPurchase Invoice Item`
|
billed_amt = frappe.db.sql("""select sum(amount) from `tabPurchase Invoice Item`
|
||||||
where pr_detail=%s and docstatus=1""", d.name)
|
where pr_detail=%s and docstatus=1""", d.name)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user