remove issue credit note
This commit is contained in:
parent
7779bb3839
commit
a86f3a7d80
File diff suppressed because it is too large
Load Diff
@ -177,7 +177,7 @@ class DeliveryNote(SellingController):
|
|||||||
frappe.msgprint(_("Note: Item {0} entered multiple times").format(d.item_code))
|
frappe.msgprint(_("Note: Item {0} entered multiple times").format(d.item_code))
|
||||||
else:
|
else:
|
||||||
chk_dupl_itm.append(f)
|
chk_dupl_itm.append(f)
|
||||||
#Customer Provided parts will have zero valuation rate
|
#Customer Provided parts will have zero valuation rate
|
||||||
if frappe.db.get_value('Item', d.item_code, 'is_customer_provided_item'):
|
if frappe.db.get_value('Item', d.item_code, 'is_customer_provided_item'):
|
||||||
d.allow_zero_valuation_rate = 1
|
d.allow_zero_valuation_rate = 1
|
||||||
|
|
||||||
@ -215,8 +215,6 @@ class DeliveryNote(SellingController):
|
|||||||
|
|
||||||
if not self.is_return:
|
if not self.is_return:
|
||||||
self.check_credit_limit()
|
self.check_credit_limit()
|
||||||
elif self.issue_credit_note:
|
|
||||||
self.make_return_invoice()
|
|
||||||
# Updating stock ledger should always be called after updating prevdoc status,
|
# Updating stock ledger should always be called after updating prevdoc status,
|
||||||
# because updating reserved qty in bin depends upon updated delivered qty in SO
|
# because updating reserved qty in bin depends upon updated delivered qty in SO
|
||||||
self.update_stock_ledger()
|
self.update_stock_ledger()
|
||||||
@ -318,16 +316,6 @@ class DeliveryNote(SellingController):
|
|||||||
|
|
||||||
self.load_from_db()
|
self.load_from_db()
|
||||||
|
|
||||||
def make_return_invoice(self):
|
|
||||||
try:
|
|
||||||
return_invoice = make_sales_invoice(self.name)
|
|
||||||
return_invoice.is_return = True
|
|
||||||
return_invoice.save()
|
|
||||||
return_invoice.submit()
|
|
||||||
frappe.msgprint(_("Credit Note {0} has been created automatically").format(return_invoice.name))
|
|
||||||
except:
|
|
||||||
frappe.throw(_("Could not create Credit Note automatically, please uncheck 'Issue Credit Note' and submit again"))
|
|
||||||
|
|
||||||
def update_billed_amount_based_on_so(so_detail, update_modified=True):
|
def update_billed_amount_based_on_so(so_detail, update_modified=True):
|
||||||
# Billed against Sales Order directly
|
# Billed against Sales Order directly
|
||||||
billed_against_so = frappe.db.sql("""select sum(amount) from `tabSales Invoice Item`
|
billed_against_so = frappe.db.sql("""select sum(amount) from `tabSales Invoice Item`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user