chore: fix patch
This commit is contained in:
		
							parent
							
								
									153675e52a
								
							
						
					
					
						commit
						f6a61b999f
					
				| @ -1,12 +1,13 @@ | ||||
| import frappe | ||||
| from frappe.utils import nowdate | ||||
| 
 | ||||
| from erpnext.accounts.utils import get_fiscal_year | ||||
| from erpnext.accounts.utils import FiscalYearError, get_fiscal_year | ||||
| 
 | ||||
| 
 | ||||
| def execute(): | ||||
| 	# Only do for current fiscal year, no need to repost for all years | ||||
| 	for company in frappe.get_all("Company"): | ||||
| 		try: | ||||
| 			fiscal_year_details = get_fiscal_year(date=nowdate(), company=company.name, as_dict=True) | ||||
| 
 | ||||
| 			purchase_invoice = frappe.qb.DocType("Purchase Invoice") | ||||
| @ -24,3 +25,5 @@ def execute(): | ||||
| 			).where( | ||||
| 				purchase_invoice.docstatus == 1 | ||||
| 			).run() | ||||
| 		except FiscalYearError: | ||||
| 			pass | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user