!!! 5 %html %head %title Invoice = wicked_pdf_stylesheet_link_tag 'pdf' %body %div.mt-3.w-50.float-left %strong.d-block.subtitle-2= family.name .d-block.body-2= family.address .d-block.body-2.mb-2= "#{family.city}, #{family.state} #{family.zip}" .d-block.overline.mt-3 Students .d-block.body-2= family.student_names %div.mt-3.w-50.float-left %table.table %tbody %tr.remove-top-border %td.caption Due Date %td.caption.text-right= invoice.due_on %tr %td.caption Amount Invoiced %td.caption.text-right= invoice.total(:to_currency) %tr %td.caption Amount Paid %td.caption.text-right= invoice.allocated(:to_currency) %tr %td.subtitle-2 Amount Due %td.subtitle-2.text-right= invoice.balance(:to_currency) .d-block.overline.mt-3 Invoiced Charges %table.table %thead %tr.remove-top-border %th.caption.text-muted Date %th.caption.text-muted Student %th.caption.text-muted Category %th.caption.text-muted Charged %th.caption.text-muted Paid %th.caption.text-muted Due %tbody - charges.each do |charge| %tr %td.caption= charge.posted_date %td.caption= charge.students.first.full_name(:reverse) %td.caption= charge.category_name %td.caption= charge.currency %td.caption= charge.allocated(:to_currency) %td.caption= charge.balance(:to_currency) %tr.remove-top-border %td.caption.text-muted{ colspan: 6 }= charge.memo - if include_allocations && allocations.present? .d-block.overline.mt-3 Applied Payments & Credits %table.table %thead %tr.remove-top-border %th.caption.text-muted Date %th.caption.text-muted Type %th.caption.text-muted Memo %th.caption.text-muted.text-right Amount Applied %tbody - allocations.each do |allocation| - transaction = allocation.decrease.accounting_transaction.decorate %tr %td.caption= transaction.posted_date %td.caption= transaction.name %td.caption= transaction.memo %td.caption.text-right= allocation.decorate.currency