picking
							parent
							
								
									481d554913
								
							
						
					
					
						commit
						deea486556
					
				| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
<action>                                                                                                         
 | 
					<action>                                                                                                         
 | 
				
			||||||
    <field name="string">Report Claim/No Claim</field>
 | 
					    <field name="string">Report Claim Expense</field>
 | 
				
			||||||
    <field name="view_cls">report</field>                                                                        
 | 
					    <field name="view_cls">report</field>                                                                        
 | 
				
			||||||
    <field name="model">clinic.report.account.hd.case.summary</field>
 | 
					    <field name="model">clinic.report.account.hd.case.summary</field>
 | 
				
			||||||
    <field name="report_template">report_account_hd_case_summary</field>                                                      
 | 
					    <field name="report_template">report_account_hd_case_summary</field>                                                      
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
<action>                                                                                                         
 | 
					<action>                                                                                                         
 | 
				
			||||||
    <field name="string">Report Claim/No Claim</field>
 | 
					    <field name="string">Report Claim Expense</field>
 | 
				
			||||||
    <field name="view_cls">report</field>                                                                        
 | 
					    <field name="view_cls">report</field>                                                                        
 | 
				
			||||||
    <field name="model">clinic.report.account.hd.case.summary</field>
 | 
					    <field name="model">clinic.report.account.hd.case.summary</field>
 | 
				
			||||||
    <field name="report_template">report_account_hd_case_summary</field>                                                      
 | 
					    <field name="report_template">report_account_hd_case_summary</field>                                                      
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,7 +7,7 @@
 | 
				
			||||||
            <item string="HD Cases Matching" action="clinic_matching_hdcase_acc"/>
 | 
					            <item string="HD Cases Matching" action="clinic_matching_hdcase_acc"/>
 | 
				
			||||||
            <divider/>
 | 
					            <divider/>
 | 
				
			||||||
            <header string="REPORTS"/>
 | 
					            <header string="REPORTS"/>
 | 
				
			||||||
            <item string="Report Claim/No Claim" action="clinic_report_account_hd_case_summary"/>
 | 
					            <item string="Report Claim Expense" action="clinic_report_account_hd_case_summary"/>
 | 
				
			||||||
            <item string="Labor Cost Summary" action="clinic_report_labor_cost_summary"/>
 | 
					            <item string="Labor Cost Summary" action="clinic_report_labor_cost_summary"/>
 | 
				
			||||||
            <item string="Labor Cost Detail" action="clinic_report_labor_cost_detail"/>
 | 
					            <item string="Labor Cost Detail" action="clinic_report_labor_cost_detail"/>
 | 
				
			||||||
            <item string="Labor Cost Sub Detail" action="clinic_report_labor_cost_sub_detail"/>
 | 
					            <item string="Labor Cost Sub Detail" action="clinic_report_labor_cost_sub_detail"/>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -46,7 +46,7 @@
 | 
				
			||||||
        <item string="Sickbed" action="clinic_sickbed"/>
 | 
					        <item string="Sickbed" action="clinic_sickbed"/>
 | 
				
			||||||
    </item>
 | 
					    </item>
 | 
				
			||||||
    <item string="Reporting" perm="clinic_report">
 | 
					    <item string="Reporting" perm="clinic_report">
 | 
				
			||||||
        <item string="Report Claim/No Claim" action="clinic_report_claim"/>
 | 
					        <item string="Report Claim Expense" action="clinic_report_claim"/>
 | 
				
			||||||
        <item string="Cycle Item Summary" action="clinic_report_cycle_item"/>
 | 
					        <item string="Cycle Item Summary" action="clinic_report_cycle_item"/>
 | 
				
			||||||
        <item string="HD Case Summary" action="clinic_report_hd_case_summary"/>
 | 
					        <item string="HD Case Summary" action="clinic_report_hd_case_summary"/>
 | 
				
			||||||
        <!--<item string="HD Case Summary(PDF)" action="clinic_hd_case_print"/>-->
 | 
					        <!--<item string="HD Case Summary(PDF)" action="clinic_hd_case_print"/>-->
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
<form model="clinic.setting" title="Clinic Settings">
 | 
					<form model="clinic.setting" title="Clinic Settings">
 | 
				
			||||||
    <head>
 | 
					    <head>
 | 
				
			||||||
        <button string="Options" dropdown="1">
 | 
					        <button string="Options" dropdown="1">
 | 
				
			||||||
            <item string="Manual Generate Visit" method="manual_generate_visit" confirm="This action will remove all pending visit of this month and generate new one. Are you sure?"/>
 | 
					            <item string="Manual Generate Visit" perm="clinic_gen_visit" method="manual_generate_visit" confirm="This action will remove all pending visit of this month and generate new one. Are you sure?"/>
 | 
				
			||||||
        </button>
 | 
					        </button>
 | 
				
			||||||
    </head>
 | 
					    </head>
 | 
				
			||||||
    <separator string="Visit"/>
 | 
					    <separator string="Visit"/>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -105,14 +105,17 @@ class ReportAccountHDCaseSummary(Model):
 | 
				
			||||||
                items[code].append({
 | 
					                items[code].append({
 | 
				
			||||||
                    'amount': amt,
 | 
					                    'amount': amt,
 | 
				
			||||||
                })
 | 
					                })
 | 
				
			||||||
            pm_number=''
 | 
					            pm_number=','.join([pm.number for pm in hdcase.payments if pm.number])
 | 
				
			||||||
            for pm in hdcase.payments:
 | 
					 | 
				
			||||||
                pm_number+=pm.number or ""
 | 
					 | 
				
			||||||
            inv_number=""
 | 
					            inv_number=""
 | 
				
			||||||
            inv_ref=""
 | 
					            inv_ref=""
 | 
				
			||||||
            for inv in hdcase.invoices:
 | 
					            for inv in hdcase.invoices:
 | 
				
			||||||
                inv_number+=inv.number or ""
 | 
					                inv_number+=inv.number or ""
 | 
				
			||||||
                inv_ref+=inv.ref or ""
 | 
					                inv_ref+=inv.ref or ""
 | 
				
			||||||
 | 
					            pick_ref=""
 | 
				
			||||||
 | 
					            pick_id=None
 | 
				
			||||||
 | 
					            for pick in hdcase.pickings:
 | 
				
			||||||
 | 
					                pick_ref=pick.number or ""
 | 
				
			||||||
 | 
					                pick_id=pick.id
 | 
				
			||||||
            patient=hdcase.patient_id
 | 
					            patient=hdcase.patient_id
 | 
				
			||||||
            ptype=hdcase.patient_type_id
 | 
					            ptype=hdcase.patient_type_id
 | 
				
			||||||
            cycle=hdcase.cycle_id
 | 
					            cycle=hdcase.cycle_id
 | 
				
			||||||
| 
						 | 
					@ -146,6 +149,8 @@ class ReportAccountHDCaseSummary(Model):
 | 
				
			||||||
                'lab': hdcase.lab,
 | 
					                'lab': hdcase.lab,
 | 
				
			||||||
                'misc': hdcase.misc,
 | 
					                'misc': hdcase.misc,
 | 
				
			||||||
                'inv_ref': inv_ref and inv_ref or "-",
 | 
					                'inv_ref': inv_ref and inv_ref or "-",
 | 
				
			||||||
 | 
					                'pick_ref': pick_ref and pick_ref or "-",
 | 
				
			||||||
 | 
					                'pick_id': pick_id,
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            for code, item in items.items():
 | 
					            for code, item in items.items():
 | 
				
			||||||
                vals.update({
 | 
					                vals.update({
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -152,65 +152,19 @@ class ClinicSetting(Model):
 | 
				
			||||||
        if user_id !=1:
 | 
					        if user_id !=1:
 | 
				
			||||||
            print("Only admin!!")
 | 
					            print("Only admin!!")
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
 | 
					        for pt in get_model("clinic.patient").browse([1267]):
 | 
				
			||||||
        dom=[
 | 
					            print(pt.name or "")
 | 
				
			||||||
            ['type','=','doctor'],
 | 
					            cycles={}
 | 
				
			||||||
        ]
 | 
					            for vs in pt.visits:
 | 
				
			||||||
        for st in get_model("clinic.staff").search_browse(dom):
 | 
					                date=vs.visit_date
 | 
				
			||||||
            dpt_ids=[]
 | 
					                wd=datetime.strptime(date,"%Y-%m-%d").weekday()
 | 
				
			||||||
            for b in get_model("clinic.branch").browse([]):
 | 
					                key='%s-%s-%s'%(vs.cycle_id.id, wd, vs.department_id.id)
 | 
				
			||||||
                for dpt in b.departments:
 | 
					                cycles[key]=key
 | 
				
			||||||
                    dpt_ids.append(dpt.id)
 | 
					            for k, v in cycles.items():
 | 
				
			||||||
            st.write({
 | 
					                print(k)
 | 
				
			||||||
                'departments': [('set',dpt_ids)],
 | 
					 | 
				
			||||||
            })
 | 
					 | 
				
			||||||
            print('dpt_ids ', dpt_ids)
 | 
					 | 
				
			||||||
        print("Done!")
 | 
					 | 
				
			||||||
        return
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        files=['Patients_Data_LS1.csv','Patients_Data_LS2.csv','Patients_Data_LS3.csv']
 | 
					 | 
				
			||||||
        self.update_patient_file(files)
 | 
					 | 
				
			||||||
        print("Done!")
 | 
					 | 
				
			||||||
        return
 | 
					 | 
				
			||||||
        ###TODO remove douplicate patient
 | 
					        ###TODO remove douplicate patient
 | 
				
			||||||
        ###TODO remove douplicate staff
 | 
					        ###TODO remove douplicate staff
 | 
				
			||||||
        ###TODO remove douplicate visit
 | 
					        ###TODO remove douplicate visit
 | 
				
			||||||
        visits={}
 | 
					 | 
				
			||||||
        for visit in get_model("clinic.visit").search_browse([]):
 | 
					 | 
				
			||||||
            key='%s-%s'%(visit.visit_date, visit.patient_id.id)
 | 
					 | 
				
			||||||
            if not key in visits.keys():
 | 
					 | 
				
			||||||
                visits[key]=[]
 | 
					 | 
				
			||||||
            hd_ids=[]
 | 
					 | 
				
			||||||
            for hdcase in visit.hd_cases:
 | 
					 | 
				
			||||||
                hd_ids.append(hdcase.id)
 | 
					 | 
				
			||||||
            visits[key].append({
 | 
					 | 
				
			||||||
                'id': visit.id,
 | 
					 | 
				
			||||||
                'date': visit.visit_date,
 | 
					 | 
				
			||||||
                'patient_id': visit.patient_id.id,
 | 
					 | 
				
			||||||
                'state': visit.state,
 | 
					 | 
				
			||||||
                'hd_ids': hd_ids,
 | 
					 | 
				
			||||||
            })
 | 
					 | 
				
			||||||
        for k, vs in visits.items():
 | 
					 | 
				
			||||||
            if len(vs) > 1:
 | 
					 | 
				
			||||||
                vids=[]
 | 
					 | 
				
			||||||
                for v in vs:
 | 
					 | 
				
			||||||
                    if v['state']=='pending':
 | 
					 | 
				
			||||||
                        visit=get_model("clinic.visit").browse(v['id'])
 | 
					 | 
				
			||||||
                        for hdcase in visit.hd_cases:
 | 
					 | 
				
			||||||
                            hdcase.delete()
 | 
					 | 
				
			||||||
                        visit.delete()
 | 
					 | 
				
			||||||
                        print('deleted id ', v['id'], v['patient_id'], v['date'])
 | 
					 | 
				
			||||||
                    elif len(v['hd_ids']) < 1:
 | 
					 | 
				
			||||||
                        visit=get_model("clinic.visit").browse(v['id'])
 | 
					 | 
				
			||||||
                        if visit:
 | 
					 | 
				
			||||||
                            for hdcase in visit.hd_cases:
 | 
					 | 
				
			||||||
                                hdcase.delete()
 | 
					 | 
				
			||||||
                            visit.to_draft()
 | 
					 | 
				
			||||||
                            visit.delete()
 | 
					 | 
				
			||||||
                            print('deleted id ', v['id'], v['patient_id'], v['date'])
 | 
					 | 
				
			||||||
                    elif v['state'] in ('confirmed', 'cancelled'):
 | 
					 | 
				
			||||||
                        vids.append(v['id'])
 | 
					 | 
				
			||||||
                print('need to delete id ', vids, vids[0])
 | 
					 | 
				
			||||||
        print("Done!")
 | 
					        print("Done!")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def multi_department(self,ids,context={}):
 | 
					    def multi_department(self,ids,context={}):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											Binary file not shown.
										
									
								
							| 
						 | 
					@ -45,6 +45,7 @@
 | 
				
			||||||
                <th>Misc.</th>
 | 
					                <th>Misc.</th>
 | 
				
			||||||
                <th>Dlz</th>
 | 
					                <th>Dlz</th>
 | 
				
			||||||
                <th>Ref.Inv#</th>
 | 
					                <th>Ref.Inv#</th>
 | 
				
			||||||
 | 
					                <th>Picking#</th>
 | 
				
			||||||
            {{else}}
 | 
					            {{else}}
 | 
				
			||||||
                <th>Date</th>
 | 
					                <th>Date</th>
 | 
				
			||||||
                <th>Cycle#</th>
 | 
					                <th>Cycle#</th>
 | 
				
			||||||
| 
						 | 
					@ -58,6 +59,7 @@
 | 
				
			||||||
                <th>ค่าฟอก</th>
 | 
					                <th>ค่าฟอก</th>
 | 
				
			||||||
                <th>ค่ายา</th>
 | 
					                <th>ค่ายา</th>
 | 
				
			||||||
                <th>ค่าบริการฉีดยา</th>
 | 
					                <th>ค่าบริการฉีดยา</th>
 | 
				
			||||||
 | 
					                <th>Picking#</th>
 | 
				
			||||||
                <th>แพทย์</th>
 | 
					                <th>แพทย์</th>
 | 
				
			||||||
                <th>พยาบาล</th>
 | 
					                <th>พยาบาล</th>
 | 
				
			||||||
            {{/ifeq}}
 | 
					            {{/ifeq}}
 | 
				
			||||||
| 
						 | 
					@ -85,6 +87,13 @@
 | 
				
			||||||
                    <td>{{currency misc zero=""}}</td>
 | 
					                    <td>{{currency misc zero=""}}</td>
 | 
				
			||||||
                    <td>{{dlz_name}}</td>
 | 
					                    <td>{{dlz_name}}</td>
 | 
				
			||||||
                    <td>{{inv_ref}}</td>
 | 
					                    <td>{{inv_ref}}</td>
 | 
				
			||||||
 | 
					                    <td>
 | 
				
			||||||
 | 
					                        {{#if pick_id}}
 | 
				
			||||||
 | 
					                            {{view "link" string=pick_ref action="pick_out" action_options="mode=form" active_id=pick_id}}
 | 
				
			||||||
 | 
					                        {{else}}
 | 
				
			||||||
 | 
					                            - 
 | 
				
			||||||
 | 
					                        {{/if}}
 | 
				
			||||||
 | 
					                    </td>
 | 
				
			||||||
                {{else}}
 | 
					                {{else}}
 | 
				
			||||||
                    <td style="width:10%">{{date}}</td>
 | 
					                    <td style="width:10%">{{date}}</td>
 | 
				
			||||||
                    <td style="width:6%">{{cycle}}</td>
 | 
					                    <td style="width:6%">{{cycle}}</td>
 | 
				
			||||||
| 
						 | 
					@ -100,6 +109,13 @@
 | 
				
			||||||
                    <td>{{currency fee zero=""}}</td>
 | 
					                    <td>{{currency fee zero=""}}</td>
 | 
				
			||||||
                    <td>{{currency epo zero=""}}</td>
 | 
					                    <td>{{currency epo zero=""}}</td>
 | 
				
			||||||
                    <td>{{currency srv zero=""}}</td>
 | 
					                    <td>{{currency srv zero=""}}</td>
 | 
				
			||||||
 | 
					                    <td>
 | 
				
			||||||
 | 
					                        {{#if pick_id}}
 | 
				
			||||||
 | 
					                            {{view "link" string=pick_ref action="pick_out" action_options="mode=form" active_id=pick_id}}
 | 
				
			||||||
 | 
					                        {{else}}
 | 
				
			||||||
 | 
					                            - 
 | 
				
			||||||
 | 
					                        {{/if}}
 | 
				
			||||||
 | 
					                    </td>
 | 
				
			||||||
                    <td>{{dname}}</td>
 | 
					                    <td>{{dname}}</td>
 | 
				
			||||||
                    <td>
 | 
					                    <td>
 | 
				
			||||||
                        {{view "link" string="View" action="clinic_cycle_item" action_options="mode=form" active_id=cycle_item_id}}
 | 
					                        {{view "link" string="View" action="clinic_cycle_item" action_options="mode=form" active_id=cycle_item_id}}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,8 @@
 | 
				
			||||||
 | 
					 report cycle item
 | 
				
			||||||
 | 
					    - remove minus from fee amount
 | 
				
			||||||
 | 
					    - summary amount
 | 
				
			||||||
 | 
					report medical
 | 
				
			||||||
 | 
					    - see detail of amount (department, patient, cycle, hdcase#)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					report claim expense:
 | 
				
			||||||
 | 
					    - add good issue columns
 | 
				
			||||||
		Loading…
	
		Reference in New Issue