Delete update_sales_invoice_remarks.py

This commit is contained in:
vorasmit 2021-01-01 10:54:57 +05:30 committed by GitHub
parent 8aeb340dc8
commit 8c39ab68df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,32 +0,0 @@
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import formatdate
def execute():
si_list = frappe.db.get_all('Sales Invoice', filters = {
'docstatus': 1,
'remarks': 'No Remarks',
'po_no' : ['!=', ''],
'po_date' : ['!=', '']
},
fields = ['name', 'po_no', 'po_date']
)
for doc in si_list:
remarks = _("Against Customer Order {0} dated {1}").format(doc.po_no,
formatdate(doc.po_date))
frappe.db.set_value('Sales Invoice', doc.name, 'remarks', remarks)
gl_entry_list = frappe.db.get_all('GL Entry', filters = {
'voucher_type': 'Sales Invoice',
'remarks': 'No Remarks',
'voucher_no' : doc.name
},
fields = ['name']
)
for entry in gl_entry_list:
frappe.db.set_value('GL Entry', entry.name, 'remarks', remarks)