fix(Sales Invoice): Reset Asset status on issuing Credit Note
This commit is contained in:
parent
721ff9438a
commit
8127208774
@ -936,7 +936,8 @@ class SalesInvoice(SellingController):
|
|||||||
gl_entries.append(self.get_gl_dict(gle, item=item))
|
gl_entries.append(self.get_gl_dict(gle, item=item))
|
||||||
|
|
||||||
asset.db_set("disposal_date", self.posting_date)
|
asset.db_set("disposal_date", self.posting_date)
|
||||||
asset.set_status("Sold" if self.docstatus==1 else None)
|
self.set_asset_status(asset)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Do not book income for transfer within same company
|
# Do not book income for transfer within same company
|
||||||
if not self.is_internal_transfer():
|
if not self.is_internal_transfer():
|
||||||
@ -962,6 +963,12 @@ class SalesInvoice(SellingController):
|
|||||||
erpnext.is_perpetual_inventory_enabled(self.company):
|
erpnext.is_perpetual_inventory_enabled(self.company):
|
||||||
gl_entries += super(SalesInvoice, self).get_gl_entries()
|
gl_entries += super(SalesInvoice, self).get_gl_entries()
|
||||||
|
|
||||||
|
def set_asset_status(self, asset):
|
||||||
|
if self.is_return:
|
||||||
|
asset.set_status()
|
||||||
|
else:
|
||||||
|
asset.set_status("Sold" if self.docstatus==1 else None)
|
||||||
|
|
||||||
def make_loyalty_point_redemption_gle(self, gl_entries):
|
def make_loyalty_point_redemption_gle(self, gl_entries):
|
||||||
if cint(self.redeem_loyalty_points):
|
if cint(self.redeem_loyalty_points):
|
||||||
gl_entries.append(
|
gl_entries.append(
|
||||||
|
Loading…
Reference in New Issue
Block a user