Allocate entire advance amount if advance against SO/PO
This commit is contained in:
		
							parent
							
								
									daf344e5fd
								
							
						
					
					
						commit
						bc8b20ae3c
					
				| @ -387,7 +387,7 @@ class AccountsController(TransactionBase): | ||||
| 
 | ||||
| 		res = frappe.db.sql(""" | ||||
| 			select | ||||
| 				t1.name as jv_no, t1.remark, t2.%s as amount, t2.name as jv_detail_no | ||||
| 				t1.name as jv_no, t1.remark, t2.%s as amount, t2.name as jv_detail_no, `against_%s` as against_order | ||||
| 			from | ||||
| 				`tabJournal Voucher` t1, `tabJournal Voucher Detail` t2 | ||||
| 			where | ||||
| @ -400,7 +400,7 @@ class AccountsController(TransactionBase): | ||||
| 						and ifnull(t2.against_purchase_order, '')  = '' | ||||
| 					) %s) | ||||
| 			order by t1.posting_date""" % | ||||
| 			(dr_or_cr, '%s', cond), | ||||
| 			(dr_or_cr, against_order_field, '%s', cond), | ||||
| 			tuple([account_head] + so_list), as_dict= True) | ||||
| 
 | ||||
| 		self.set(parentfield, []) | ||||
| @ -411,7 +411,7 @@ class AccountsController(TransactionBase): | ||||
| 				"jv_detail_no": d.jv_detail_no, | ||||
| 				"remarks": d.remark, | ||||
| 				"advance_amount": flt(d.amount), | ||||
| 				"allocate_amount": 0 | ||||
| 				"allocated_amount": flt(d.amount) if d.against_order else 0 | ||||
| 			}) | ||||
| 
 | ||||
| 	def validate_advance_jv(self, advance_table_fieldname, against_order_field): | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user