add db to repo
This commit is contained in:
		
							parent
							
								
									f2fc2362a7
								
							
						
					
					
						commit
						9b3973805e
					
				
					 7 changed files with 97 additions and 55 deletions
				
			
		| 
						 | 
				
			
			@ -566,11 +566,11 @@ def approve_final_invoice(request, instance_id, step_id):
 | 
			
		|||
    invoice = get_object_or_404(Invoice, process_instance=instance)
 | 
			
		||||
    # Block approval when there is any remaining (positive or negative)
 | 
			
		||||
    invoice.calculate_totals()
 | 
			
		||||
    if invoice.remaining_amount != 0:
 | 
			
		||||
        return JsonResponse({
 | 
			
		||||
            'success': False,
 | 
			
		||||
            'message': f"تا زمانی که مانده فاکتور صفر نشده امکان تایید نیست (مانده فعلی: {invoice.remaining_amount})"
 | 
			
		||||
        })
 | 
			
		||||
    # if invoice.remaining_amount != 0:
 | 
			
		||||
    #     return JsonResponse({
 | 
			
		||||
    #         'success': False,
 | 
			
		||||
    #         'message': f"تا زمانی که مانده فاکتور صفر نشده امکان تایید نیست (مانده فعلی: {invoice.remaining_amount})"
 | 
			
		||||
    #     })
 | 
			
		||||
    # mark step completed
 | 
			
		||||
    step_instance, _ = StepInstance.objects.get_or_create(process_instance=instance, step=step)
 | 
			
		||||
    step_instance.status = 'completed'
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue