{% set total=0 %}
{% set charge_total=0 %}
{% set shipping_charge=0 %}
{% set grand_total=0 %}
{% set total_product_tax_shipping_wise=0 %}
{% if data|length>0 %}
{% set currency='' %}
{% set total_tax=0 %}
{% for index,product in data %}
{% set sub_total=0 %}
{% set sub_charge_total=0 %}
{% set sub_shipping_charge=0 %}
{% set sub_grand_total=0 %}
{% set sub_shipping_tax = 0 %}
{% set currency=product.currency.symbol|upper %}
{% set price_unit = (product.price_unit is defined and product.price_unit!='') ? product.price_unit : 'each' %}
{{ 'orderadmin.order_id' | trans }}: {{ order.id }}
{{ 'cart.cart_order_type' | trans }}: {{ order.orderItemLine[index].orderType }}
{{ 'cart.cart_shipping' | trans }} : {{ order.orderItemLine[index].orderProduct[0].orderShippingDetail.shippingType }}
{% set price_type_from_api = 'decorative' %}
{% if product.decorative_pricing is defined and product.decorative_pricing and product.decorative_pricing == 1 %}
{% set price_type_from_api = 'decorative' %}
{% elseif product.blank_pricing is defined and product.blank_pricing and product.blank_pricing == 1 %}
{% set price_type_from_api = 'blank' %}
{% endif %}
{% set productCulture = '' %}
{% set productDetailConfiguration = order.orderItemLine[index].productDetailConfiguration|deserialize %}
{% if productDetailConfiguration['culture'] is defined %}
{% set productCulture = productDetailConfiguration['culture'] %}
{% endif %}
{# Extract the product properties as variables started #}
{% set price_type = product.price_type %}
{% if product.variation_pricing_for_other_country is defined %}
{% set variation_pricing_for_other_country = product.variation_pricing_for_other_country %}
{% endif %}
{% if product.pricing_for_other_country is defined %}
{% set pricing_for_other_country = product.pricing_for_other_country %}
{% endif %}
{% if product.variation_pricing_country_available is defined %}
{% set variation_pricing_country_available = product.variation_pricing_country_available %}
{% endif %}
{% if product.country_available is defined %}
{% set country_available = product.country_available %}
{% endif %}
{% if product.product_id is defined %}
{% set product_id = product.product_id %}
{% endif %}
{# Extract the product properties as variables ended #}
{# decide the final pricing started #}
{% if price_type is defined and price_type == 'variations' %}
{% set final_pricing = variation_pricing_for_other_country %}
{% set final_country_available = variation_pricing_country_available %}
{% else %}
{% set final_pricing = pricing_for_other_country %}
{% set final_country_available = country_available %}
{% endif %}
{# decide the final pricing ended #}
{% set finalPricing = (final_pricing['us'] is defined)?final_pricing['us']: [] %}
{% if productCulture =='en_ca' %}
{% set finalPricing = (final_pricing['ca'] is defined)?final_pricing['ca']: final_pricing['us'] %}
{% endif %}
{% include 'OfficeBrainOrderBundle:OrderAdmin:quantityWisePricePanel.html.twig' with {'show_heading':false , 'price_array_type':price_type_from_api, 'price_type' : product.price_type ,'price_array':finalPricing,'currency_code':order.orderItemLine[index].currencySymbol|upper, 'price_unit' :price_unit } %}
{% if order.orderItemLine[index].orderProductImprintArea|length>0 %}
{% for imprintArea in order.orderItemLine[index].orderProductImprintArea %}
{% if product.imprint_position_and_methods|length>0 %}
{% for areaId,imprint_pos in product.imprint_position_and_methods %}
{% if(areaId == imprintArea.imprintAreaId) %}
{{ 'edit_cart.edit_cart_print_position' | trans }}: {{ (product.imprint_position_and_methods[imprintArea.imprintAreaId]["position_area"] is defined) ? product.imprint_position_and_methods[imprintArea.imprintAreaId]["position_area"] : '' }}
{% endif %}
{% endfor %}
{% else %}
{{ 'edit_cart.edit_cart_print_position' | trans }}: N/A
{% endif %}
{{ 'edit_cart.edit_cart_imprint_method' | trans }}: {{ (product.imprint_methods[imprintArea.imprintAreaMethodId] is defined) ? product.imprint_methods[imprintArea.imprintAreaMethodId] : '' }}
{% if imprintArea.orderProductImprintColor|length>0 %}
{% for index,imprintcolor in imprintArea.orderProductImprintColor %}
{% if imprintcolor.isPmsColor==1 %}
{% if imprintcolor.colorName is defined and imprintcolor.colorName !='' %}
{% set color = imprintcolor.colorName %}
{% else %}
{% set color ='PMS '~imprintcolor.colorId %}
{% endif %}
{% else %}
{% set color ='Standard'~imprintcolor.colorId %}
{% endif %}
{{ 'admin.quote_info.quote_color' |trans }}{{ index+1 }} : {{ color }}
{% endfor %}
{% endif %}
{% if imprintArea.orderProductImprintTextArtWork|length>0 %}
{% set imgVal = 1 %}
{% set indVal = 1 %}
{% for ind,imprintartwork in imprintArea.orderProductImprintTextArtWork %}
{% if imprintartwork.logoPath!='' %}
{% set sub_shipping_tax = 0 %}
{% if order.orderItemLine[index].orderProduct|length>0 %}
{% for i, prod in order.orderItemLine[index].orderProduct %}
{% set totQty=0 %}
{% if product.attributes is defined %}
{% set colorValue= '' %}
{% for attr in product.attributes %}
{% if attr.id=="11" %}
{% if attr.values is defined and attr.values!='' %}
{{ attr.label }}
{% for size in attr.values %}
{{ size }}
{% endfor %}
{#
{{ 'admin.quote_info.quote_total'|trans }}
#}
{% endif %}
{% else %}
{% if attr.id=="10" %}
{% set colorValue= attr.values %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% if prod.orderVariationMaster|length>0 %}
{% for varMaster in prod.orderVariationMaster %}
{% if order.orderItemLine[index].extraColor != '' %}
{% set extra_color_ary = order.orderItemLine[index].extraColor|displayOtherColor(product.attributes) %}
{% for eca in extra_color_ary %}
{{ eca }}
{% endfor %}
{% else %}
{{ colorValue[varMaster.attributeValueId] }}
{% endif %}
{% set totVarQty=0 %}
{% if varMaster.orderVariationMapping|length>0 %}
{% if varMaster.orderVariationMapping.orderVariationQuantity|length>0 %}
{% for varQty in varMaster.orderVariationMapping.orderVariationQuantity %}
{% set totQty=totQty+varQty.quantity %}
{{ varQty.quantity }}
{% endfor %}
{#{% if varMaster.orderVariationMapping.orderVariationQuantity|length>0 %}
{% if product.is_size==true %}
{{ totQty }}
{% endif %}
{% endif %}#}
{% endif %}
{% endif %}
{% endfor %}
{% if product.is_size!=true %}
{{ 'admin.quote_info.quote_total'|trans }}
{{ totQty }}
{% endif %}
{% endif %}
{{ prod.orderShippingDetail.name }}
{{ prod.orderShippingDetail.street1 }}
{% if prod.orderShippingDetail.street2 is defined and prod.orderShippingDetail.street2 != '' %}
{{ prod.orderShippingDetail.street2 }}
{% endif %}
{{ prod.orderShippingDetail.cityName }}, {{ prod.orderShippingDetail.stateName }},
{{ prod.orderShippingDetail.zipCode }}, {{ prod.orderShippingDetail.countryName }}
{% if prod.orderShippingDetail.phone !='' %}
T : {{ prod.orderShippingDetail.phone }}
{% endif %}
{% if prod.orderShippingDetail.fax !='' %}
F : {{ prod.orderShippingDetail.fax }}
{% endif %}
{% if prod.orderShippingDetail.website is defined and prod.orderShippingDetail.website !='' %}
Web : {{ prod.orderShippingDetail.website }}
{% endif %}
{% if ob_project_setting.configuration_rule.transaction.shopping_cart.product_detail_popup.option.shipping.option.shipping_carrier.status==1 %}
{{ 'edit_cart.edit_cart_shipping_carrier' |trans }}:
{% if prod.orderShippingDetail.shippingType is defined %}
{{ prod.orderShippingDetail.shippingType|capitalize }}
{% endif %}
{% endif %}
{% if ob_project_setting.configuration_rule.transaction.shopping_cart.product_detail_popup.option.shipping.option.shipping_method.status==1 %}
{{ 'edit_cart.edit_cart_method' |trans }}:
{% if prod.orderShippingDetail.serviceType is defined %}
{{ prod.orderShippingDetail.serviceType }}{% endif %}
{% endif %}
{% if ob_project_setting.configuration_rule.transaction.shopping_cart.product_detail_popup.option.shipping.option.shipper_account.status==1 %}
{{ 'request_quote.shipping_type.account' |trans }}:
{% if prod.orderShippingDetail.shipperAccount is defined %}
{{ prod.orderShippingDetail.shipperAccount }}{% endif %}
{% endif %}
{% if prod.orderShippingDetail.onHandDate != '' %}
{{ 'request_quote.shipping_type.inhand_date' |trans }} : {{ prod.orderShippingDetail.onHandDate|dateFormat }}
{% endif %}