add report invoice matching
							parent
							
								
									e358bea6c9
								
							
						
					
					
						commit
						b8ef808524
					
				| 
						 | 
				
			
			@ -0,0 +1,6 @@
 | 
			
		|||
<action>
 | 
			
		||||
    <field name="type">report_xls</field>
 | 
			
		||||
    <field name="model">clinic.matching.payment</field>
 | 
			
		||||
    <field name="method">get_data_match</field>
 | 
			
		||||
    <field name="template">matching_payment_invoice</field>
 | 
			
		||||
</action>
 | 
			
		||||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
<action>
 | 
			
		||||
    <field name="type">report_xls</field>
 | 
			
		||||
    <field name="model">clinic.matching.payment</field>
 | 
			
		||||
    <field name="method">get_data</field>
 | 
			
		||||
    <field name="template">matching_payment_invoice_unmatch</field>
 | 
			
		||||
    <field name="method">get_data_unmatch</field>
 | 
			
		||||
    <field name="template">matching_payment_invoice</field>
 | 
			
		||||
</action>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,6 +2,7 @@
 | 
			
		|||
    <head>
 | 
			
		||||
        <field name="state"/>
 | 
			
		||||
        <button string="Print" dropdown="1" icon="print">
 | 
			
		||||
            <item string="Invoice Match" action="clinic_matching_payment_match_invoice"/>
 | 
			
		||||
            <item string="Invoice Unmatch" action="clinic_matching_payment_unmatch_invoice"/>
 | 
			
		||||
        </button>
 | 
			
		||||
        <button string="Options" dropdown="1">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -68,6 +68,7 @@ class Department(Model):
 | 
			
		|||
                'perms': perms,
 | 
			
		||||
                'other_perms': [('set',other_perms)],
 | 
			
		||||
                'login_company_id': get_active_company(),
 | 
			
		||||
                'home_action': 'clinic_board',
 | 
			
		||||
            })
 | 
			
		||||
            print("create profile %s"%(code))
 | 
			
		||||
            return profile_id
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -563,7 +563,44 @@ class MatchingPayment(Model):
 | 
			
		|||
        super().write(ids,vals,**kw)
 | 
			
		||||
        self.function_store(ids)
 | 
			
		||||
 | 
			
		||||
    def get_data(self,context={}):
 | 
			
		||||
    def get_data_match(self,context={}):
 | 
			
		||||
        ref_id=int(context.get("refer_id","0"))
 | 
			
		||||
        obj=self.browse(ref_id)
 | 
			
		||||
        inv_match_ids=[]
 | 
			
		||||
        for line in obj.lines:
 | 
			
		||||
            invoice=line.invoice_id
 | 
			
		||||
            if invoice and line.state=='match':
 | 
			
		||||
                inv_match_ids.append(invoice.id)
 | 
			
		||||
        dom=[
 | 
			
		||||
            ['partner_id','=',obj.partner_id.id],
 | 
			
		||||
            ['date', '>=', obj.date_from],
 | 
			
		||||
            ['date', '<=', obj.date_to],
 | 
			
		||||
            ['state','=','waiting_payment'],
 | 
			
		||||
        ]
 | 
			
		||||
        lines=[]
 | 
			
		||||
        no=1
 | 
			
		||||
        for invoice in get_model('account.invoice').search_browse(dom):
 | 
			
		||||
            if invoice.id not in inv_match_ids:
 | 
			
		||||
                continue
 | 
			
		||||
            vals={
 | 
			
		||||
                'no': no,
 | 
			
		||||
                'date': invoice.date,
 | 
			
		||||
                'number': invoice.number,
 | 
			
		||||
                'ref': invoice.ref,
 | 
			
		||||
                'amount_due': invoice.amount_due or 0,
 | 
			
		||||
            }
 | 
			
		||||
            lines.append(vals)
 | 
			
		||||
            no+=1
 | 
			
		||||
        data={
 | 
			
		||||
            'ptype': obj.patient_type_id.name or "",
 | 
			
		||||
            'title': 'Invoice Match',
 | 
			
		||||
            'lines': lines,
 | 
			
		||||
            'date_from': obj.date_from,
 | 
			
		||||
            'date_to': obj.date_to,
 | 
			
		||||
        }
 | 
			
		||||
        return data
 | 
			
		||||
 | 
			
		||||
    def get_data_unmatch(self,context={}):
 | 
			
		||||
        ref_id=int(context.get("refer_id","0"))
 | 
			
		||||
        obj=self.browse(ref_id)
 | 
			
		||||
        inv_match_ids=[]
 | 
			
		||||
| 
						 | 
				
			
			@ -592,6 +629,8 @@ class MatchingPayment(Model):
 | 
			
		|||
            lines.append(vals)
 | 
			
		||||
            no+=1
 | 
			
		||||
        data={
 | 
			
		||||
            'ptype': obj.patient_type_id.name or "",
 | 
			
		||||
            'title': 'Invoice Unmatch',
 | 
			
		||||
            'lines': lines,
 | 
			
		||||
            'date_from': obj.date_from,
 | 
			
		||||
            'date_to': obj.date_to,
 | 
			
		||||
| 
						 | 
				
			
			@ -606,7 +645,16 @@ class MatchingPayment(Model):
 | 
			
		|||
                'mode': 'form',
 | 
			
		||||
                'active_id': obj.id,
 | 
			
		||||
            },
 | 
			
		||||
            #'flash': 'TODO',
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    def print_invoice_match(self,ids,context={}):
 | 
			
		||||
        obj=self.browse(ids)[0]
 | 
			
		||||
        return {
 | 
			
		||||
            'next':{
 | 
			
		||||
                'name': 'clinic_matching_payment',
 | 
			
		||||
                'mode': 'form',
 | 
			
		||||
                'active_id': obj.id,
 | 
			
		||||
            },
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
MatchingPayment.register()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| 
						 | 
				
			
			@ -1,7 +1,8 @@
 | 
			
		|||
- sickbed -> can not see sickbed because mix patient
 | 
			
		||||
    - fixme:
 | 
			
		||||
        - see deparment from sickbed => hd_case => and update department of patient (manymany)
 | 
			
		||||
hd case => can not click next page
 | 
			
		||||
- permission
 | 
			
		||||
    - sickbed -> can not see sickbed because mix patient
 | 
			
		||||
        - fixme:
 | 
			
		||||
            - see deparment from sickbed => hd_case => and update department of patient (manymany)
 | 
			
		||||
    - hd case => can not click next page
 | 
			
		||||
 | 
			
		||||
report cycle item :
 | 
			
		||||
    - sunanna can not see
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue