## -*- coding: utf-8; -*- <%inherit file="/master/view.mako" /> <%def name="extra_javascript()"> ${parent.extra_javascript()} % if not use_buefy and request.rattail_config.versioning_enabled() and master.has_perm('versions'): % endif <%def name="extra_styles()"> ${parent.extra_styles()} <%def name="render_main_fields(form)"> ${form.render_field_readonly('upc')} ${form.render_field_readonly('brand')} ${form.render_field_readonly('description')} ${form.render_field_readonly('size')} ${form.render_field_readonly('unit_size')} ${form.render_field_readonly('unit_of_measure')} ${form.render_field_readonly('case_size')} % if instance.is_pack_item(): ${form.render_field_readonly('pack_size')} ${form.render_field_readonly('unit')} ${form.render_field_readonly('default_pack')} % elif instance.packs: ${form.render_field_readonly('packs')} % endif ${self.extra_main_fields(form)} <%def name="left_column()"> % if use_buefy: % else:

Pricing

${self.render_price_fields(form)}

Flags

${self.render_flag_fields(form)}
% endif ${self.extra_left_panels()} <%def name="right_column()"> ${self.organization_panel()} ${self.movement_panel()} ${self.sources_panel()} ${self.notes_panel()} ${self.ingredients_panel()} ${self.lookup_codes_panel()} ${self.extra_right_panels()} <%def name="extra_main_fields(form)"> <%def name="organization_panel()"> % if use_buefy: % else:

Organization

${self.render_organization_fields(form)}
% endif <%def name="render_organization_fields(form)"> ${form.render_field_readonly('department')} ${form.render_field_readonly('subdepartment')} ${form.render_field_readonly('category')} ${form.render_field_readonly('family')} ${form.render_field_readonly('report_code')} <%def name="render_price_fields(form)"> ${form.render_field_readonly('price_required')} ${form.render_field_readonly('regular_price')} ${form.render_field_readonly('current_price')} ${form.render_field_readonly('current_price_ends')} ${form.render_field_readonly('suggested_price')} ${form.render_field_readonly('deposit_link')} ${form.render_field_readonly('tax')} <%def name="render_flag_fields(form)"> ${form.render_field_readonly('weighed')} ${form.render_field_readonly('discountable')} ${form.render_field_readonly('special_order')} ${form.render_field_readonly('organic')} ${form.render_field_readonly('not_for_sale')} ${form.render_field_readonly('discontinued')} ${form.render_field_readonly('deleted')} <%def name="movement_panel()"> % if use_buefy: % else:

Movement

${self.render_movement_fields(form)}
% endif <%def name="render_movement_fields(form)"> ${form.render_field_readonly('last_sold')} <%def name="lookup_codes_grid()">
% for code in instance._codes: % endfor
Seq Code
${code.ordinal} ${code.code}
<%def name="lookup_codes_panel()"> % if use_buefy: % else:

Additional Lookup Codes

${self.lookup_codes_grid()}
% endif <%def name="sources_grid()">
% for i, cost in enumerate(instance.costs, 1): % endfor
${costs_label_preferred} ${costs_label_vendor} ${costs_label_code} ${costs_label_case_size} Case Cost Unit Cost Status
${'X' if cost.preference == 1 else ''} % if request.has_perm('vendors.view'): ${h.link_to(cost.vendor, request.route_url('vendors.view', uuid=cost.vendor_uuid))} % else: ${cost.vendor} % endif ${cost.code or ''} ${h.pretty_quantity(cost.case_size)} ${'$ %0.2f' % cost.case_cost if cost.case_cost is not None else ''} ${'$ %0.4f' % cost.unit_cost if cost.unit_cost is not None else ''} ${"discontinued" if cost.discontinued else "available"}
<%def name="sources_panel()"> % if use_buefy: % else:

Vendor Sources

${self.sources_grid()}
% endif <%def name="notes_panel()"> % if use_buefy: % else:

Notes

${form.render_field_readonly('notes')}
% endif <%def name="ingredients_panel()"> % if use_buefy: % else:

Ingredients

${form.render_field_readonly('ingredients')}
% endif <%def name="extra_left_panels()"> <%def name="extra_right_panels()"> <%def name="page_content()"> % if use_buefy:
${self.left_column()}
${self.right_column()}
% else: ## legacy / not buefy

Product

${self.render_main_fields(form)}
% if image_url: ${h.image(image_url, "Product Image", id='product-image', width=150, height=150)} % endif
${self.left_column()}
${self.right_column()}
% if request.rattail_config.versioning_enabled() and master.has_perm('versions'):
${regular_price_history_grid.render_grid()|n}
${suggested_price_history_grid.render_grid()|n}
% endif % endif % if buttons: ${buttons|n} % endif ${parent.body()}