------------------------------------------------------------------------ r1851319 | jleroux | 2019-01-15 08:43:36 +0100 (mar. 15 janv. 2019) | 12 lignes Fixed: partyId misses in EditEftAccount.ftl (party) when you create an EFT account from the quick finalize page (OFBIZ-10680) If you split the payment and want to create an EFT account you get an error in EditEftAccount.ftl (party) at line 40 colum 50: the partyId is missing. Adds the patch to add the partyId field that was missing while creating an EFT account or credit card in split payment mode. Added proper checks to avoid the broken screen in case the parameter is missing. Thanks: Ankit Joshi for the fix ------------------------------------------------------------------------ git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1851320 13f79535-47bb-0310-9956-ffa450edef68
250 lines
15 KiB
Plaintext
250 lines
15 KiB
Plaintext
<#--
|
|
Licensed to the Apache Software Foundation (ASF) under one
|
|
or more contributor license agreements. See the NOTICE file
|
|
distributed with this work for additional information
|
|
regarding copyright ownership. The ASF licenses this file
|
|
to you under the Apache License, Version 2.0 (the
|
|
"License"); you may not use this file except in compliance
|
|
with the License. You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing,
|
|
software distributed under the License is distributed on an
|
|
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
KIND, either express or implied. See the License for the
|
|
specific language governing permissions and limitations
|
|
under the License.
|
|
-->
|
|
|
|
|
|
<!-- TODO : Need formatting -->
|
|
<script type="application/javascript">
|
|
//<![CDATA[
|
|
function submitForm(form, mode, value) {
|
|
if ("DN" == mode) {
|
|
// done action; checkout
|
|
form.action="<@ofbizUrl>checkoutoptions</@ofbizUrl>";
|
|
form.submit();
|
|
} else if ("CS" == mode) {
|
|
// continue shopping
|
|
form.action="<@ofbizUrl>updateCheckoutOptions/showcart</@ofbizUrl>";
|
|
form.submit();
|
|
} else if ("NC" == mode) {
|
|
// new credit card
|
|
form.action="<@ofbizUrl>updateCheckoutOptions/editcreditcard?DONE_PAGE=checkoutpayment&partyId=${shoppingCart.getPartyId()}</@ofbizUrl>";
|
|
form.submit();
|
|
} else if ("EC" == mode) {
|
|
// edit credit card
|
|
form.action="<@ofbizUrl>updateCheckoutOptions/editcreditcard?DONE_PAGE=checkoutpayment&paymentMethodId="+value+"</@ofbizUrl>";
|
|
form.submit();
|
|
} else if ("GC" == mode) {
|
|
// edit gift card
|
|
form.action="<@ofbizUrl>updateCheckoutOptions/editgiftcard?partyId=${shoppingCart.getPartyId()}&paymentMethodId="+value+"</@ofbizUrl>";
|
|
form.submit();
|
|
} else if ("NE" == mode) {
|
|
// new eft account
|
|
form.action="<@ofbizUrl>updateCheckoutOptions/editeftaccount?DONE_PAGE=checkoutpayment&partyId=${shoppingCart.getPartyId()}</@ofbizUrl>";
|
|
form.submit();
|
|
} else if ("EE" == mode) {
|
|
// edit eft account
|
|
form.action="<@ofbizUrl>updateCheckoutOptions/editeftaccount?DONE_PAGE=checkoutpayment&partyId=${shoppingCart.getPartyId()}&paymentMethodId="+value+"</@ofbizUrl>";
|
|
form.submit();
|
|
}else if(mode = "EG")
|
|
//edit gift card
|
|
form.action="<@ofbizUrl>updateCheckoutOptions/editgiftcard?DONE_PAGE=checkoutpayment&partyId=${shoppingCart.getPartyId()}&paymentMethodId="+value+"</@ofbizUrl>";
|
|
form.submit();
|
|
}
|
|
//]]>
|
|
</script>
|
|
|
|
|
|
<#assign cart = shoppingCart! />
|
|
|
|
<form method="post" id="checkoutInfoForm" action="">
|
|
<fieldset>
|
|
<input type="hidden" name="checkoutpage" value="payment" />
|
|
<input type="hidden" name="BACK_PAGE" value="checkoutoptions" />
|
|
<input type="hidden" name="issuerId" id="issuerId" value="" />
|
|
|
|
<div class="screenlet">
|
|
<div class="screenlet-title-bar">
|
|
<h3>3)${uiLabelMap.OrderHowShallYouPay}?</h3>
|
|
</div>
|
|
<div class="screenlet-body inline">
|
|
<#-- Payment Method Selection -->
|
|
<div>
|
|
<label>${uiLabelMap.CommonAdd}:</label>
|
|
<#if productStorePaymentMethodTypeIdMap.CREDIT_CARD??>
|
|
<a href="javascript:submitForm(document.getElementById('checkoutInfoForm'), 'NC', '');" class="button">${uiLabelMap.AccountingCreditCard}</a>
|
|
</#if>
|
|
<#if productStorePaymentMethodTypeIdMap.EFT_ACCOUNT??>
|
|
<a href="javascript:submitForm(document.getElementById('checkoutInfoForm'), 'NE', '');" class="button">${uiLabelMap.AccountingEFTAccount}</a>
|
|
</#if>
|
|
<#if productStorePaymentMethodTypeIdMap.EXT_OFFLINE??>
|
|
</div>
|
|
<div>
|
|
<label for="checkOutPaymentId_OFFLINE">
|
|
<input type="radio" id="checkOutPaymentId_OFFLINE" name="checkOutPaymentId" value="EXT_OFFLINE" <#if "EXT_OFFLINE" == checkOutPaymentId>checked="checked"</#if> />
|
|
${uiLabelMap.OrderMoneyOrder}</label>
|
|
</div>
|
|
</#if>
|
|
<#if productStorePaymentMethodTypeIdMap.EXT_COD??>
|
|
<div>
|
|
<label for="checkOutPaymentId_COD">
|
|
<input type="radio" id="checkOutPaymentId_COD" name="checkOutPaymentId" value="EXT_COD" <#if "EXT_COD" == checkOutPaymentId>checked="checked"</#if> />
|
|
${uiLabelMap.OrderCOD}</label>
|
|
</div>
|
|
</#if>
|
|
<#if productStorePaymentMethodTypeIdMap.EXT_WORLDPAY??>
|
|
<div>
|
|
<label for="checkOutPaymentId_WORLDPAY">
|
|
<input type="radio" id="checkOutPaymentId_WORLDPAY" name="checkOutPaymentId" value="EXT_WORLDPAY" <#if "EXT_WORLDPAY" == checkOutPaymentId>checked="checked"</#if> />
|
|
${uiLabelMap.AccountingPayWithWorldPay}</label>
|
|
</div>
|
|
</#if>
|
|
<#if productStorePaymentMethodTypeIdMap.EXT_PAYPAL??>
|
|
<div>
|
|
<label for="checkOutPaymentId_PAYPAL">
|
|
<input type="radio" id="checkOutPaymentId_PAYPAL" name="checkOutPaymentId" value="EXT_PAYPAL" <#if "EXT_PAYPAL" == checkOutPaymentId>checked="checked"</#if> />
|
|
${uiLabelMap.AccountingPayWithPayPal}</label>
|
|
</div>
|
|
</#if>
|
|
<#if productStorePaymentMethodTypeIdMap.EXT_IDEAL??>
|
|
<div>
|
|
<label for="checkOutPaymentId_IDEAL">
|
|
<input type="radio" id="checkOutPaymentId_IDEAL" name="checkOutPaymentId" value="EXT_IDEAL" <#if "EXT_IDEAL" == checkOutPaymentId>checked="checked"</#if> />
|
|
${uiLabelMap.AccountingPayWithiDEAL}</label>
|
|
</div>
|
|
|
|
<div id="issuers">
|
|
<div><label >${uiLabelMap.AccountingBank}</label></div>
|
|
<select name="issuer" id="issuer">
|
|
<#if issuerList?has_content>
|
|
<#list issuerList as issuer>
|
|
<option value="${issuer.getIssuerID()}" >${issuer.getIssuerName()}</option>
|
|
</#list>
|
|
</#if>
|
|
</select>
|
|
</div>
|
|
</#if>
|
|
<#if !paymentMethodList?has_content>
|
|
<div>
|
|
<strong>${uiLabelMap.AccountingNoPaymentMethods}.</strong>
|
|
</div>
|
|
<#else>
|
|
<#list paymentMethodList as paymentMethod>
|
|
<#if "GIFT_CARD" == paymentMethod.paymentMethodTypeId>
|
|
<#if productStorePaymentMethodTypeIdMap.GIFT_CARD??>
|
|
<#assign giftCard = paymentMethod.getRelatedOne("GiftCard", false) />
|
|
|
|
<#if giftCard?has_content && giftCard.cardNumber?has_content>
|
|
<#assign giftCardNumber = "" />
|
|
<#assign pcardNumber = giftCard.cardNumber />
|
|
<#if pcardNumber?has_content>
|
|
<#assign psize = pcardNumber?length - 4 />
|
|
<#if 0 < psize>
|
|
<#list 0 .. psize-1 as foo>
|
|
<#assign giftCardNumber = giftCardNumber + "*" />
|
|
</#list>
|
|
<#assign giftCardNumber = giftCardNumber + pcardNumber[psize .. psize + 3] />
|
|
<#else>
|
|
<#assign giftCardNumber = pcardNumber />
|
|
</#if>
|
|
</#if>
|
|
</#if>
|
|
|
|
<div>
|
|
<input type="checkbox" id="checkOutPayment_${paymentMethod.paymentMethodId}" name="checkOutPaymentId" value="${paymentMethod.paymentMethodId}" <#if cart.isPaymentSelected(paymentMethod.paymentMethodId)>checked="checked"</#if> />
|
|
<label for="checkOutPayment_${paymentMethod.paymentMethodId}">${uiLabelMap.AccountingGift}:${giftCardNumber}</label>
|
|
<#if paymentMethod.description?has_content>(${paymentMethod.description})</#if>
|
|
<a href="javascript:submitForm(document.getElementById('checkoutInfoForm'), 'EG', '${paymentMethod.paymentMethodId}');" class="button">${uiLabelMap.CommonUpdate}</a>
|
|
<strong>${uiLabelMap.OrderBillUpTo}:</strong> <input type="text" size="5" class="inputBox" name="amount_${paymentMethod.paymentMethodId}" value="<#if (cart.getPaymentAmount(paymentMethod.paymentMethodId)?default(0) > 0)><@ofbizAmount amount=cart.getPaymentAmount(paymentMethod.paymentMethodId)!/></#if>"/>
|
|
</div>
|
|
</#if>
|
|
<#elseif "CREDIT_CARD" == paymentMethod.paymentMethodTypeId>
|
|
<#if productStorePaymentMethodTypeIdMap.CREDIT_CARD??>
|
|
<#assign creditCard = paymentMethod.getRelatedOne("CreditCard", false) />
|
|
<div>
|
|
<input type="checkbox" id="checkOutPayment_${paymentMethod.paymentMethodId}" name="checkOutPaymentId" value="${paymentMethod.paymentMethodId}" <#if cart.isPaymentSelected(paymentMethod.paymentMethodId)>checked="checked"</#if> />
|
|
<label for="checkOutPayment_${paymentMethod.paymentMethodId}">CC:${Static["org.apache.ofbiz.party.contact.ContactHelper"].formatCreditCard(creditCard)}</label>
|
|
<#if paymentMethod.description?has_content>(${paymentMethod.description})</#if>
|
|
<a href="javascript:submitForm(document.getElementById('checkoutInfoForm'), 'EC', '${paymentMethod.paymentMethodId}');" class="button">${uiLabelMap.CommonUpdate}</a>
|
|
<label for="amount_${paymentMethod.paymentMethodId}"><strong>${uiLabelMap.OrderBillUpTo}:</strong></label><input type="text" size="5" class="inputBox" id="amount_${paymentMethod.paymentMethodId}" name="amount_${paymentMethod.paymentMethodId}" value="<#if (cart.getPaymentAmount(paymentMethod.paymentMethodId)?default(0) > 0)><@ofbizAmount amount=cart.getPaymentAmount(paymentMethod.paymentMethodId)!/></#if>" />
|
|
</div>
|
|
</#if>
|
|
<#elseif "EFT_ACCOUNT" == paymentMethod.paymentMethodTypeId>
|
|
<#if productStorePaymentMethodTypeIdMap.EFT_ACCOUNT??>
|
|
<#assign eftAccount = paymentMethod.getRelatedOne("EftAccount", false) />
|
|
<div>
|
|
<label for="checkOutPayment_${paymentMethod.paymentMethodId}">
|
|
<input type="radio" id="checkOutPayment_${paymentMethod.paymentMethodId}" name="checkOutPaymentId" value="${paymentMethod.paymentMethodId}" <#if paymentMethod.paymentMethodId == checkOutPaymentId>checked="checked"</#if> />
|
|
${uiLabelMap.AccountingEFTAccount}:${eftAccount.bankName!}: ${eftAccount.accountNumber!}</label>
|
|
<#if paymentMethod.description?has_content><p>(${paymentMethod.description})</p></#if>
|
|
<a href="javascript:submitForm(document.getElementById('checkoutInfoForm'), 'EE', '${paymentMethod.paymentMethodId}');" class="button">${uiLabelMap.CommonUpdate}</a>
|
|
</div>
|
|
</#if>
|
|
</#if>
|
|
</#list>
|
|
</#if>
|
|
|
|
<#-- special billing account functionality to allow use w/ a payment method -->
|
|
<#if productStorePaymentMethodTypeIdMap.EXT_BILLACT??>
|
|
<#if billingAccountList?has_content>
|
|
<div>
|
|
<select name="billingAccountId" id="billingAccountId">
|
|
<option value=""></option>
|
|
<#list billingAccountList as billingAccount>
|
|
<#assign availableAmount = billingAccount.accountBalance>
|
|
<#assign accountLimit = billingAccount.accountLimit>
|
|
<option value="${billingAccount.billingAccountId}" <#if billingAccount.billingAccountId == selectedBillingAccountId?default("")>selected="selected"</#if>>${billingAccount.description?default("")} [${billingAccount.billingAccountId}] ${uiLabelMap.EcommerceAvailable} <@ofbizCurrency amount=availableAmount isoCode=billingAccount.accountCurrencyUomId/> ${uiLabelMap.EcommerceLimit} <@ofbizCurrency amount=accountLimit isoCode=billingAccount.accountCurrencyUomId/></option>
|
|
</#list>
|
|
</select>
|
|
<label for="billingAccountId">${uiLabelMap.FormFieldTitle_billingAccountId}</label>
|
|
</div>
|
|
<div>
|
|
<input type="text" size="5" id="billingAccountAmount" name="billingAccountAmount" value="" />
|
|
<label for="billingAccountAmount">${uiLabelMap.OrderBillUpTo}</label>
|
|
</div>
|
|
</#if>
|
|
</#if>
|
|
<#-- end of special billing account functionality -->
|
|
|
|
<#if productStorePaymentMethodTypeIdMap.GIFT_CARD??>
|
|
<div>
|
|
<input type="checkbox" id="addGiftCard" name="addGiftCard" value="Y" />
|
|
<input type="hidden" name="singleUseGiftCard" value="Y" />
|
|
<label for="addGiftCard">${uiLabelMap.AccountingUseGiftCardNotOnFile}</label>
|
|
</div>
|
|
<div>
|
|
<label for="giftCardNumber">${uiLabelMap.AccountingNumber}</label>
|
|
<input type="text" size="15" class="inputBox" id="giftCardNumber" name="giftCardNumber" value="${(requestParameters.giftCardNumber)!}" onfocus="document.getElementById('addGiftCard').checked=true;" />
|
|
</div>
|
|
<#if cart.isPinRequiredForGC(delegator)>
|
|
<div>
|
|
<label for="giftCardPin">${uiLabelMap.AccountingPIN}</label>
|
|
<input type="text" size="10" class="inputBox" id="giftCardPin" name="giftCardPin" value="${(requestParameters.giftCardPin)!}" onfocus="document.getElementById('addGiftCard').checked=true;" />
|
|
</div>
|
|
</#if>
|
|
<div>
|
|
<label for="giftCardAmount">${uiLabelMap.AccountingAmount}</label>
|
|
<input type="text" size="6" class="inputBox" id="giftCardAmount" name="giftCardAmount" value="${(requestParameters.giftCardAmount)!}" onfocus="document.getElementById('addGiftCard').checked=true;" />
|
|
</div>
|
|
</#if>
|
|
|
|
<div>
|
|
<#if productStorePaymentMethodTypeIdMap.CREDIT_CARD??><a href="<@ofbizUrl>setBilling?paymentMethodType=CC&singleUsePayment=Y</@ofbizUrl>" class="button">${uiLabelMap.AccountingSingleUseCreditCard}</a></#if>
|
|
<#if productStorePaymentMethodTypeIdMap.GIFT_CARD??><a href="<@ofbizUrl>setBilling?paymentMethodType=GC&singleUsePayment=Y</@ofbizUrl>" class="button">${uiLabelMap.AccountingSingleUseGiftCard}</a></#if>
|
|
<#if productStorePaymentMethodTypeIdMap.EFT_ACCOUNT??><a href="<@ofbizUrl>setBilling?paymentMethodType=EFT&singleUsePayment=Y</@ofbizUrl>" class="button">${uiLabelMap.AccountingSingleUseEFTAccount}</a></#if>
|
|
</div>
|
|
<#-- End Payment Method Selection -->
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
</form>
|
|
|
|
<div>
|
|
<a href="javascript:submitForm(document.getElementById('checkoutInfoForm'), 'CS', '');" class="buttontextbig">${uiLabelMap.OrderBacktoShoppingCart}</a>
|
|
<a href="javascript:submitForm(document.getElementById('checkoutInfoForm'), 'DN', '');" class="buttontextbig">${uiLabelMap.OrderContinueToFinalOrderReview}</a>
|
|
</div>
|