[{assign var="dynvalue" value=$oView->getDynValue()}]
[{assign var="iPayError" value=$oView->getPaymentError()}]
[{assign var="sImageUrl" value=$oViewConf->getModuleUrl('d3heidelpay','out/img/')}]
[{assign var='oHeidelPaySettings' value=$oHeidelpayViewConfig->getSettings()}]
[{assign var='oHeidelPayment' value=$oHeidelPaySettings->getPayment($paymentmethod)}]
[{assign var="aBrands" value=$oHeidelpayViewConfig->getHeidelpayNgwBrands($paymentmethod, $oHeidelPayment, $oxcmp_user)}]
[{assign var="sBrandIdentELV" value='ELV'}]
[{assign var="sFullImageUrl" value=$sImageUrl|cat:'logo_elv.jpg'}]

[{oxscript add="$('#sCountrySelected_$sPaymentID').on('change', function (e) {
    var valueSelected = this.value;
    var hideableLi    = $('#sBIC_$sPaymentID').first();

    if (valueSelected == 'DE') {
        hideableLi.hide()
        hideableLi.find('input').attr('disabled', 'disabled');
    } else {
        hideableLi.show()
        hideableLi.find('input').removeAttr('disabled');
    }
});"}]

[{block name="heidelpay_debitnote"}]
    <dl>
        <dt>
            <input id="payment_[{$sPaymentID}]" type="radio" name="paymentid" value="[{$sPaymentID}]"
                   [{if $oView->getCheckedPaymentId() == $paymentmethod->oxpayments__oxid->value}]checked[{/if}]>
            <label for="payment_[{$sPaymentID}]">
                <b>[{$paymentmethod->oxpayments__oxdesc->value}]</b>
                [{include file="d3_d3heidelpay_views_tpl_payment_img.tpl" sImageUrl=$sFullImageUrl sBrandIdent=$sBrandIdentELV}]
            </label>
        </dt>
        <dd class="[{if $oView->getCheckedPaymentId() == $paymentmethod->oxpayments__oxid->value}]activePayment[{/if}]">
            [{if $paymentmethod->getPrice()}]
                [{assign var="oPaymentPrice" value=$paymentmethod->getPrice()}]
                [{if $oViewConf->isFunctionalityEnabled('blShowVATForPayCharge')}]
                    ([{oxprice price=$oPaymentPrice->getNettoPrice() currency=$currency}]
                    [{if $oPaymentPrice->getVatValue() > 0}]
                        [{oxmultilang ident="PLUS_VAT"}] [{oxprice price=$oPaymentPrice->getVatValue() currency=$currency}]
                    [{/if}])
                [{else}]
                    ([{oxprice price=$oPaymentPrice->getBruttoPrice() currency=$currency}])
                [{/if}]
            [{/if}]
            <div class="form-group">
                <label class="req control-label col-lg-3"
                       for="sCountrySelected_[{$sPaymentID}]">[{oxmultilang ident="D3HEIDELPAY_CC_INPUT_COUNTRY"}]</label>
                <div class="col-lg-9">
                    <select class="form-control" id="sCountrySelected_[{$sPaymentID}]" name="dynvalue[lsland]">
                        <option value="">[{oxmultilang ident="D3PAYMENT_EXT_SELECTPLEASE"}]</option>
                        [{foreach from=$aBrands item='sBrandName' key='sBrandIdent'}]
                            <option value="[{$sBrandIdent}]">[{$sBrandName}]</option>
                        [{/foreach}]
                    </select>
                    [{if !empty($dynvalue.lsland)}]
                        [{oxscript add="$('#sCountrySelected_$sPaymentID').val('`$dynvalue.lsland`').trigger('change');"}]
                    [{/if}]
                </div>
            </div>
            <div class="form-group" id="sBIC_[{$sPaymentID}]">
                <label class="req control-label col-lg-3"
                       for="sCountrySelected_[{$sPaymentID}]lsblz">[{oxmultilang ident="D3HEIDELPAY_PAYMENT_INPUT_BANK_BIC"}]</label>
                <div class="col-lg-9">
                    <input id="sCountrySelected_[{$sPaymentID}]lsblz" type="text" class="form-control js-oxValidate"
                           size="20"
                           maxlength="64" name="dynvalue[lsblz]" autocomplete="off" value="[{$dynvalue.lsblz}]">
                </div>
            </div>
            <div class="form-group">
                <label class="req control-label col-lg-3"
                       for="sCountrySelected_[{$sPaymentID}]lsktonr">[{oxmultilang ident="D3HEIDELPAY_PAYMENT_INPUT_BANK_IBAN"}]</label>
                <div class="col-lg-9">
                    <input id="sCountrySelected_[{$sPaymentID}]lsktonr" type="text"
                           class="form-control js-oxValidate js-oxValidate_notEmpty" size="20" maxlength="64"
                           name="dynvalue[lsktonr]" autocomplete="off" value="[{$dynvalue.lsktonr}]"
                           required="required">
                </div>
            </div>
            <div class="form-group">
                <label class="req control-label col-lg-3"
                       for="sCountrySelected_[{$sPaymentID}]lsktoinhaber">[{oxmultilang ident="D3HEIDELPAY_PAYMENT_INPUT_BANK_ACCOUNTHOLDER"}]</label>
                <div class="col-lg-9">
                    <input id="sCountrySelected_[{$sPaymentID}]lsktoinhaber" type="text"
                           class="form-control js-oxValidate js-oxValidate_notEmpty" size="20" maxlength="64"
                           name="dynvalue[lsktoinhaber]"
                           required="required"
                           value="[{if $dynvalue.lsktoinhaber}][{$dynvalue.lsktoinhaber}][{else}][{$oxcmp_user->oxuser__oxfname->value}] [{$oxcmp_user->oxuser__oxlname->value}][{/if}]">
                </div>
            </div>
            <div class="clearfix"></div>

            [{block name="checkout_payment_longdesc"}]
                [{if $paymentmethod->oxpayments__oxlongdesc->value}]
                    <div class="alert alert-info desc">
                        [{$paymentmethod->oxpayments__oxlongdesc->getRawValue()}]
                    </div>
                [{/if}]
            [{/block}]
        </dd>
    </dl>
[{/block}]
