{% set oShop = oEmailView.getShop() %}
{% set oViewConf = oEmailView.getViewConfig() %}
{% set oCurrency = oEmailView.getCurrency() %}
{% set oUser = oEmailView.getUser() %}
{% set oB2bAccount = oUser.getB2bAccount() %}
{% set sOfferStartDate = oBasket.getOfferStartDate() %}
{% set sOfferEndDate = oBasket.getOfferEndDate() %}
{% set sOfferNumber = oBasket.getOfferNumber() %}
{% set sShopId = oViewConf.getActiveShopId() %}
{% set sBaseContentSidePadding = oViewConf.getViewThemeParam("sBaseContentSidePadding") %}
{% set sBaseFontSize = oViewConf.getViewThemeParam("sBaseFontSize") %}
{% set sBaseFontFamily = oViewConf.getViewThemeParam("sBaseFontFamily") %}
{% block email_plain_offer_user_orderemail %}
{% set sUserSal = oUser.oxuser__oxsal.value %}
{{ translate({ ident: "C4S_OFFER_EMAIL_GREETING" }) }}
{% if sShopId != "2" %}
{{ translate({ ident: sUserSal }) }}
{% endif %}
{{ oUser.oxuser__oxfname.value }}
{{ oUser.oxuser__oxlname.value }}
{% if sShopId == "2" %}
,
{% else %}
!
{% endif %}
{% ifcontent ident "c4s_offer_mail_desc" set oContent %}
{{ include(template_from_string(oContent.oxcontents__oxcontent.value)) }}
{% endifcontent %}
{% endblock %}
{# order details #}
{{ translate({ ident: "FIRST_LAST_NAME", suffix: "COLON" }) }} {{ oUser.oxuser__oxfname.value }} {{ oUser.oxuser__oxlname.value }}
{% if iShopId == 2 %}
{% set sSageNr = oB2bAccount.smxb2b_account__c4ssagedebnr.value %}
{% if sSageNr %}
{{ translate({ ident: "C4S_OFFER_EMAIL_CUSTOMER_NO_US", suffix: "COLON" }) }} {{ oB2bAccount.smxb2b_account__c4ssagedebnr.value }}
{% else %}
{{ translate({ ident: "C4S_OFFER_EMAIL_CUSTOMER_NO", suffix: "COLON" }) }} {{ oUser.oxuser__oxcustnr.value }}
{% endif %}
{% else %}
{{ translate({ ident: "C4S_OFFER_EMAIL_CUSTOMER_NO", suffix: "COLON" }) }} {{ oUser.oxuser__oxcustnr.value }}
{% endif %}
{{ translate({ ident: "EMAIL_ADDRESS", suffix: "COLON" }) }} {{ oUser.oxuser__oxusername.value }}
{{ translate({ ident: "C4S_OFFER_EMAIL_OFFER_NUMBER", suffix: "COLON" }) }} {{ sOfferNumber }}
{{ translate({ ident: "C4S_OFFER_VALIDITY", suffix: "COLON" }) }} {{ sOfferStartDate }} {{ translate({ ident: "C4S_OFFER_VALIDITY_UPTO" }) }} {{ sOfferEndDate }}
{# Basket Contents #}
{{ translate({ ident: "PRODUCT" }) }}, {{ translate({ ident: "QUANTITY" }) }}, {{ translate({ ident: "UNIT_PRICE" }) }}, {{ translate({ ident: "TOTAL" }) }}
{% set basketitemlist = oBasket.getBasketArticles() %}
{% for basketindex, basketitem in oBasket.getContents() %}
{% set oArticle = basketitem.getArticle() %}
{% set oAttributes = oArticle.getAttributesDisplayableInBasket() %}
{% set oAttributesinBasket = oArticle.getAttributesDisplayableInBasket() %}
{% block email_plain_order_user_basketitem %}
{% set basketproduct = basketitemlist[basketindex] %}
{% set oParentArticle = basketproduct.getParentArticle() %}
{% if oParentArticle %}
{% set oParentHomeCategory = oParentArticle.getCategory() %}
{% else %}
{% set oHomeCategory = basketproduct.getCategory() %}
{% endif %}
{{ basketproduct.oxarticles__oxtitle.value }}
{% block email_plain_order_user_basketproduct_artnum %}
{% if basketproduct.oxarticles__oxartnum.value %}
{{ translate({ ident: "C4S_ARTNUM_SHORT", suffix: "COLON" }) }}
{{ basketproduct.oxarticles__oxartnum.value }}
{% endif %}
{% endblock %}
{% block email_plain_order_user_basketproduct_attributes %}
{% if oAttributesinBasket %}
{% set sep = ", " %}
{% set result = "" %}
{% for oArtAttributes, oAttr in oAttributes.getArray() %}
{% set sTempTitle = oAttr.oxattribute__oxtitle.value %}
{% set sTempValue = oAttr.oxattribute__oxvalue.value %}
{% set result = result ~ sTempValue ~ sep %}
{% endfor %}
{% if result %}
{{ result|trim("sep") }}
{% endif %}
{% endif %}
{% endblock %}
{% block email_plain_order_user_basketproduct_shortdesc %}
{% if basketproduct.oxarticles__oxshortdesc %}
{{ basketproduct.oxarticles__oxshortdesc }}
{% endif %}
{% endblock %}
{{ basketitem.getAmount() }}
{% if basketitem.getFUnitPrice() %}{{ basketitem.getFUnitPrice() }} {{ oCurrency.sign }}{% endif %}
{% if not basketitem.isBundle() %}
{% set oRegUnitPrice = basketitem.getRegularUnitPrice() %}
{% set oUnitPrice = basketitem.getUnitPrice() %}
{% if oRegUnitPrice.getPrice() > oUnitPrice.getPrice() %}
{{ basketitem.getFRegularUnitPrice() }} {{ oCurrency.sign }}
{% endif %}
{% endif %}
{% block email_plain_order_user_basketproduct_totalprice %}
{{ basketitem.getFTotalPrice() }} {{ oCurrency.sign }}
{% endblock %}
{% block email_plain_order_user_basketproduct_extras %}{% endblock %}
{% endblock %}
{% if oViewConf.isModuleActive("c4s_order_simulation") %}
{% block email_plain_order_cust_basketproduct_extras %}
{% if oViewConf.showSimulationConditions() %}
{{ translate({ ident: "C4S_ORDER_SIMULATION_RESULT_SURCHARGES" }) }}
{% if not oBasketItem.hasConditions() %}0,00{{ oCurrency.sign }}{% endif %}
{% if oBasketItem.hasConditions() %}
{% for basketindex, oCondition in oBasketItem.getConditions() %}
{% if oCondition.getKind() == " + " %}
{{ oCondition.getDescription() }}
{{ oCondition.getValue()|number_format(2, ",", ".") }} {{ oCurrency.sign }}
{% elseif oCondition.getKind() == " - " %}
{{ oCondition.getDescription() }} ({{ oCondition.getRate() }}%)
{{ oCondition.getValue()|number_format(2, ",", ".") }} {{ oCurrency.sign }}
{% endif %}
{% endfor %}
{% endif %}
{{ translate({ ident: "C4S_ORDER_SIMULATION_RESULT_TOTALPRICE" }) }}
{% set oSimulationArticle = oBasketItem.getSimulationArticle() %}
{% if oSimulationArticle and oSimulationArticle.getNetPositionSum() %}
{{ oSimulationArticle.getNetPositionSum()|number_format(2, ",", ".") }}
{% else %}
{{ oBasketItem.getFTotalPrice() }}
{% endif %}
{{ oCurrency.sign }}
{% endif %}
{% endblock %}
{% endif %}
{% endfor %}
{# Basket Summary #}
{% if not oBasket.getDiscounts() %}
{% block email_plain_order_user_nodiscounttotalnet %}
{{ translate({ ident: "TOTAL_NET", suffix: "COLON" }) }}
{{ oBasket.getProductsNetPrice() }} {{ oCurrency.sign }}
{% endblock %}
{% block email_plain_order_user_nodiscountproductvats %}
{% for key, VATitem in oBasket.getProductVats(false) %}
{{ translate({ ident: "VAT_PLUS_PERCENT_AMOUNT", suffix: "COLON", args: key }) }}
{{ format_price(VATitem, { currency: oCurrency }) }}
{% endfor %}
{% endblock %}
{% endif %}
{% block email_plain_order_user_grandtotal %}
{{ translate({ ident: "GRAND_TOTAL", suffix: "COLON" }) }}
{{ oBasket.getFPrice() }} {{ oCurrency.sign }}
{% endblock %}
{# c4s :: delivery and debtor/customer address #}
{{ translate({ ident: "BILLING_ADDRESS" }) }}
{% set aAgAddresses = oB2bAccount.getAddresses("AG") %}
{% if aAgAddresses|length == 1 %}
{% for oAgAddress in aAgAddresses %}
{% if loop.first %}
{% if oAgAddress.oxaddress__oxcompany.value %}{{ oAgAddress.oxaddress__oxcompany.value }}{% endif %}
{% if oAgAddress.oxaddress__oxfname.value %}{{ oAgAddress.oxaddress__oxfname.value }}{% endif %} {% if oAgAddress.oxaddress__oxlname.value %}{{ oAgAddress.oxaddress__oxlname.value }}{% endif %}
{% if oAgAddress.oxaddress__oxstreet.value %}{{ oAgAddress.oxaddress__oxstreet.value }}{% endif %} {% if oAgAddress.oxaddress__oxstreetnr.value %}{{ oAgAddress.oxaddress__oxstreetnr.value }}{% endif %}
{% if oAgAddress.oxaddress__oxzip.value %}{{ oAgAddress.oxaddress__oxzip.value }}{% endif %} {% if oAgAddress.oxaddress__oxcity.value %}{{ oAgAddress.oxaddress__oxcity.value }}{% endif %}
{% for country_id, country in oViewConf.getCountryList() %}
{% if (isset(oAgAddress.oxaddress__oxcountryid) and oAgAddress.oxaddress__oxcountryid == country.oxcountry__oxid.value) %}
{{ country.oxcountry__oxtitle.value }}
{% endif %}
{% endfor %}
{% if oAgAddress.oxaddress__oxfon.value %}{{ translate({ ident: "DASHBOARD_FON", suffix: "COLON" }) }} {{ oAgAddress.oxaddress__oxfon.value }} {% endif %}
{% if oAgAddress.oxaddress__oxfax.value %}{{ translate({ ident: "DASHBOARD_FAX", suffix: "COLON" }) }} {{ oAgAddress.oxaddress__oxfax.value }} {% endif %}
{% endif %}
{% endfor %}
{% endif %}
{{ translate({ ident: "C4S_OFFER_MODAL_COMMENTS" }) }}
{{ sOfferComment }}
{% block email_plain_offer_user_orderemailend %}
{% endblock %}