<%page args="workorder, optical_data" />

% if report.sale:
${ _("Sales Person") }: | ${ report.sale.salesperson.person.name }
% else:
${ _("Responsible") }: % if workorder.quote_responsible: | ${ workorder.quote_responsible.get_description() } % else: | % endif
% endif
${ _("Client") }: | ${ workorder.client.person.name } ${ _("Address") }: ${ workorder.client.person.get_address_string() } % if workorder.client.person.phone_number: ${ _("Phone") }: ${ workorder.client.person.get_formatted_phone_number() } % endif % if workorder.client.person.mobile_number: ${ _("Mobile") }: ${ workorder.client.person.get_formatted_mobile_number() } % endif
% if optical_data.medic:
${ _("Medic") }: | ${ optical_data.medic.person.name } (${ optical_data.medic.crm_number })
% endif

% if not report.sale:

% if workorder.sellable: ${ workorder.sellable.description }
% endif ${ workorder.description }

% else:

${ _("Code") } | ${ _("Item") } | ${ _("Qty") }
% for item in workorder.get_items():
${ item.sellable.code } | ${ item.sellable.get_description() } | ${ format_quantity(item.sale_item.quantity) }
% endfor

% endif % if workorder.defect_reported:

${ _("Observations") }:
% for line in workorder.defect_reported.split("\n"): ${ line | h }
% endfor

% endif % if report.sale:

% endif