gen number invoice
							parent
							
								
									5334815bc4
								
							
						
					
					
						commit
						66e447c664
					
				| 
						 | 
				
			
			@ -294,7 +294,7 @@ class HDCase(Model):
 | 
			
		|||
 | 
			
		||||
    def _get_number_invoice_noclaim(self,context={}):
 | 
			
		||||
        while 1:
 | 
			
		||||
            seq_id=get_model("sequence").find_sequence(type="clinic_invoice_noclaim")
 | 
			
		||||
            seq_id=get_model("sequence").find_sequence(type="clinic_invoice_noclaim",name=None,context=context)
 | 
			
		||||
            num=get_model("sequence").get_next_number(seq_id,context=context)
 | 
			
		||||
            if not num:
 | 
			
		||||
                return None
 | 
			
		||||
| 
						 | 
				
			
			@ -695,6 +695,7 @@ class HDCase(Model):
 | 
			
		|||
            partner=patient.partner_id
 | 
			
		||||
            if not partner:
 | 
			
		||||
                raise Exception("No contact for this patient %s"%obj.partner.name)
 | 
			
		||||
            context['branch_id']=obj.branch_id.id
 | 
			
		||||
            number=self._get_number_invoice_noclaim(context=context)
 | 
			
		||||
            vals={
 | 
			
		||||
                'number': number,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -45,7 +45,6 @@ class HDCasePayment(Model):
 | 
			
		|||
        hd_case.post_invoices()
 | 
			
		||||
        if obj.pay_amount:
 | 
			
		||||
            hd_case.make_payment(context=context)
 | 
			
		||||
        #hd_case.do_expense()
 | 
			
		||||
 | 
			
		||||
        inv_remain_amount=0
 | 
			
		||||
        for inv in hd_case.invoices:
 | 
			
		||||
| 
						 | 
				
			
			@ -82,7 +81,6 @@ class HDCasePayment(Model):
 | 
			
		|||
        hd_case.make_invoices(context=context)
 | 
			
		||||
        hd_case.post_invoices()
 | 
			
		||||
        hd_case.create_cycle_item()
 | 
			
		||||
        #hd_case.do_expense()
 | 
			
		||||
        hd_case.write({
 | 
			
		||||
            'state': 'waiting_payment',
 | 
			
		||||
            'req_fee': 0, # force to hide button pay!
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue