diff --git a/netforce_clinic/models/report_hdcase_expense_summary.py b/netforce_clinic/models/report_hdcase_expense_summary.py index d1a3325..3ca637a 100644 --- a/netforce_clinic/models/report_hdcase_expense_summary.py +++ b/netforce_clinic/models/report_hdcase_expense_summary.py @@ -316,7 +316,8 @@ class ReportHDCaseExpenseSummary(Model): no+=1 types=[] total_qty=0 - for name, vals in ptypes.items(): + for name in sorted(ptypes.keys()): + vals=ptypes[name] qty=vals['qty'] or 0 total_qty+=qty color=vals['color'] or "default" @@ -332,7 +333,7 @@ class ReportHDCaseExpenseSummary(Model): 'date': date, 'date_from': date_from, 'date_to': date_to, - 'lines': slines, + 'lines': sorted(slines, key=lambda a: (a.get('ptype',''), a.get('epo_name',''))), 'total_fee': total_fee and '{:,}'.format(total_fee) or "", 'total_srv': total_srv and '{:,}'.format(total_srv) or "", 'total_epo': total_epo and '{:,}'.format(total_epo) or "", diff --git a/netforce_clinic/reports/report_hdcase_expense_summary_pdf.odt b/netforce_clinic/reports/report_hdcase_expense_summary_pdf.odt index e0df4af..c81571e 100644 Binary files a/netforce_clinic/reports/report_hdcase_expense_summary_pdf.odt and b/netforce_clinic/reports/report_hdcase_expense_summary_pdf.odt differ