{{=T("Class report")}} {{=class_info['date'] + ' ' + class_info['start'] + ' ' + class_info['classtype']}}

{{=T('Teacher')}} {{=class_info['teachers']['teacher']['display_name']}}
{{=T('Studio')}} {{=class_info['location']}}
{{=T('Attendance total')}} {{=revenue['total']['count_total']}}
{{=T('Guests & staff')}} {{=revenue['total']['count_unpaid']}}
{{=T('No membership')}} {{=revenue['dropin']['no_membership']['count'] + revenue['trial']['no_membership']['count']}}

{{=T("Attendance")}}

{{ header = THEAD(TR( TH(T('Type')), TH(T('Customers')), TH(T('Guests & staff')), TH(T('Attendance ')), TH(T('Amount')), TH(T('Total')), )) trial_without_membership = TR( TD(T('Trial without membership')), TD(revenue['trial']['no_membership']['count']), TD(0), TD(revenue['trial']['no_membership']['count']), TD(represent_decimal_as_amount(revenue['trial']['no_membership']['amount'])), TD(represent_decimal_as_amount( revenue['trial']['no_membership']['amount'] * revenue['trial']['no_membership']['count'] )), ) trial_with_membership = TR( TD(T('Trial with membership')), TD(revenue['trial']['membership']['count']), TD(0), TD(revenue['trial']['membership']['count']), TD(represent_decimal_as_amount(revenue['trial']['membership']['amount'])), TD(represent_decimal_as_amount( revenue['trial']['membership']['amount'] * revenue['trial']['membership']['count'] )), ) dropin_without_membership = TR( TD(T('Drop-in without membership')), TD(revenue['dropin']['no_membership']['count']), TD(0), TD(revenue['dropin']['no_membership']['count']), TD(represent_decimal_as_amount(revenue['dropin']['no_membership']['amount'])), TD(represent_decimal_as_amount( revenue['dropin']['no_membership']['amount'] * revenue['dropin']['no_membership']['count'] )), ) dropin_with_membership = TR( TD(T('Drop-in with membership')), TD(revenue['dropin']['membership']['count']), TD(0), TD(revenue['dropin']['membership']['count']), TD(represent_decimal_as_amount(revenue['dropin']['membership']['amount'])), TD(represent_decimal_as_amount( revenue['dropin']['membership']['amount'] * revenue['dropin']['membership']['count'] )), ) table_revenue = TABLE( header, trial_without_membership, trial_with_membership, dropin_without_membership, dropin_with_membership, _class='table table-striped table-hover' ) # subscriptions for s in sorted(revenue['subscriptions']): amount = revenue['subscriptions'][s]['amount'] count = revenue['subscriptions'][s]['count'] table_revenue.append(TR( TD(max_string_length(s, 42)), TD(count), TD(0), TD(count), TD(represent_decimal_as_amount(amount)), TD(represent_decimal_as_amount(amount * count)) )) pass # staff subscriptions for s in sorted(revenue['staff_subscriptions']): amount = revenue['staff_subscriptions'][s]['amount'] count = revenue['staff_subscriptions'][s]['count'] table_revenue.append(TR( TD(max_string_length(s, 42)), TD(0), TD(count), TD(count), TD(represent_decimal_as_amount(amount)), TD(represent_decimal_as_amount(amount * count)) )) pass # class cards for c in sorted(revenue['classcards']): amount = revenue['classcards'][c]['amount'] count = revenue['classcards'][c]['count'] table_revenue.append(TR( TD(max_string_length(c, 42)), TD(count), TD(0), TD(count), TD(represent_decimal_as_amount(amount)), TD(represent_decimal_as_amount(amount * count)) )) pass # Complementary table_revenue.append(TR( TD(T('Complementary')), TD(0), TD(revenue['complementary']['count']), TD(revenue['complementary']['count']), TD(represent_decimal_as_amount(0)), TD(represent_decimal_as_amount(0)), )) # Total footer = TFOOT(TR( TH(T('Total')), TH(revenue['total']['count_paid']), TH(revenue['total']['count_unpaid']), TH(revenue['total']['count_total']), TH(), TH(represent_decimal_as_amount(revenue['total']['amount'])), )) table_revenue.append(footer)}} {{=table_revenue}}

{{=T("Total")}}

{{ if not teacher_payment['error']: tp_amount = teacher_payment['data']['ClassRate'] tp_display = represent_decimal_as_amount(tp_amount) else: tp_amount = 0 tp_display = teacher_payment['data'] pass header = THEAD(TR( TH(T('Description')), TH(T('Amount')), )) attendance = TR( TD(T('Attendance')), TD(represent_decimal_as_amount(revenue['total']['amount'])) ) teacher_payment = TR( TD(T('Teacher payment')), TD(tp_display) ) total = represent_decimal_as_amount(revenue['total']['amount'] - tp_amount) footer = TFOOT(TR( TH(T('Total')), TH(total) )) table_total = TABLE( header, attendance, teacher_payment, footer, _class='table table-striped table-hover' ) }} {{=table_total}}