mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 11:49:10 +00:00
Merge pull request #23286 from rohitwaghchaure/fixed-payment-entry-status-issue
fix: incorrect payment entry status
This commit is contained in:
@@ -84,7 +84,7 @@ class PaymentEntry(AccountsController):
|
|||||||
self.delink_advance_entry_references()
|
self.delink_advance_entry_references()
|
||||||
self.update_payment_schedule(cancel=1)
|
self.update_payment_schedule(cancel=1)
|
||||||
self.set_payment_req_status()
|
self.set_payment_req_status()
|
||||||
self.set_status()
|
self.set_status(update=True)
|
||||||
|
|
||||||
def set_payment_req_status(self):
|
def set_payment_req_status(self):
|
||||||
from erpnext.accounts.doctype.payment_request.payment_request import update_payment_req_status
|
from erpnext.accounts.doctype.payment_request.payment_request import update_payment_req_status
|
||||||
@@ -340,7 +340,7 @@ class PaymentEntry(AccountsController):
|
|||||||
frappe.db.sql(""" UPDATE `tabPayment Schedule` SET paid_amount = `paid_amount` + %s
|
frappe.db.sql(""" UPDATE `tabPayment Schedule` SET paid_amount = `paid_amount` + %s
|
||||||
WHERE parent = %s and payment_term = %s""", (amount, key[1], key[0]))
|
WHERE parent = %s and payment_term = %s""", (amount, key[1], key[0]))
|
||||||
|
|
||||||
def set_status(self):
|
def set_status(self, update=False):
|
||||||
if self.docstatus == 2:
|
if self.docstatus == 2:
|
||||||
self.status = 'Cancelled'
|
self.status = 'Cancelled'
|
||||||
elif self.docstatus == 1:
|
elif self.docstatus == 1:
|
||||||
@@ -348,6 +348,9 @@ class PaymentEntry(AccountsController):
|
|||||||
else:
|
else:
|
||||||
self.status = 'Draft'
|
self.status = 'Draft'
|
||||||
|
|
||||||
|
if update:
|
||||||
|
self.db_set('status', self.status)
|
||||||
|
|
||||||
def set_amounts(self):
|
def set_amounts(self):
|
||||||
self.set_amounts_in_company_currency()
|
self.set_amounts_in_company_currency()
|
||||||
self.set_total_allocated_amount()
|
self.set_total_allocated_amount()
|
||||||
|
|||||||
@@ -677,3 +677,4 @@ erpnext.patches.v12_0.set_multi_uom_in_rfq
|
|||||||
erpnext.patches.v12_0.update_state_code_for_daman_and_diu
|
erpnext.patches.v12_0.update_state_code_for_daman_and_diu
|
||||||
erpnext.patches.v12_0.rename_lost_reason_detail
|
erpnext.patches.v12_0.rename_lost_reason_detail
|
||||||
erpnext.patches.v12_0.update_leave_application_status
|
erpnext.patches.v12_0.update_leave_application_status
|
||||||
|
erpnext.patches.v12_0.update_payment_entry_status
|
||||||
7
erpnext/patches/v12_0/update_payment_entry_status.py
Normal file
7
erpnext/patches/v12_0/update_payment_entry_status.py
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
frappe.reload_doc("accounts", "doctype", "payment_entry")
|
||||||
|
|
||||||
|
frappe.db.sql(""" UPDATE `tabPayment Entry` set status = 'Cancelled' WHERE docstatus = 2 """)
|
||||||
Reference in New Issue
Block a user