Added: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/catalog/SideDeepCategory.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/webapp/webpos/catalog/SideDeepCategory.ftl?rev=1125951&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/webpos/webapp/webpos/catalog/SideDeepCategory.ftl (added) +++ ofbiz/trunk/specialpurpose/webpos/webapp/webpos/catalog/SideDeepCategory.ftl Sun May 22 13:11:17 2011 @@ -0,0 +1,82 @@ +<#-- +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. +--> +<#-- variable setup and worker calls --> +<#if (requestAttributes.topLevelList)?exists><#assign topLevelList = requestAttributes.topLevelList></#if> +<#if (requestAttributes.curCategoryId)?exists><#assign curCategoryId = requestAttributes.curCategoryId></#if> + +<#-- looping macro --> +<#macro categoryList parentCategory category wrapInBox> + <#if catContentWrappers?exists && catContentWrappers[category.productCategoryId]?exists && catContentWrappers[category.productCategoryId].get("CATEGORY_NAME")?exists> + <#assign categoryName = catContentWrappers[category.productCategoryId].get("CATEGORY_NAME")> + <#else> + <#assign categoryName = category.categoryName?if_exists> + </#if> + <#if catContentWrappers?exists && catContentWrappers[category.productCategoryId]?exists && catContentWrappers[category.productCategoryId].get("DESCRIPTION")?exists> + <#assign categoryDescription = catContentWrappers[category.productCategoryId].get("DESCRIPTION")> + <#else> + <#assign categoryDescription = category.description?if_exists> + </#if> + <#if curCategoryId?exists && curCategoryId == category.productCategoryId> + <#assign browseCategoryButtonClass = "browsecategorybuttondisabled"> + <#else> + <#assign browseCategoryButtonClass = "browsecategorybutton"> + </#if> + <#if wrapInBox == "Y"> + <div id="sidedeepcategory"> + <h3><#if categoryDescription?has_content>${categoryDescription}<#else>${categoryName?default("")}</#if></h3> + <div> + <div class="browsecategorylist"> + </#if> + <li class="browsecategorytext"> + <#if parentCategory?has_content> + <#assign parentCategoryId = parentCategory.productCategoryId/> + <#else> + <#assign parentCategoryId = ""/> + </#if> + <#assign categoryUrl = "javascript:selectCategory('" + category.productCategoryId + "');"/> + <a href="${categoryUrl}" class="${browseCategoryButtonClass}"><#if categoryName?has_content>${categoryName}<#else>${categoryDescription?default("")}</#if></a> + <#if (Static["org.ofbiz.product.category.CategoryWorker"].checkTrailItem(request, category.getString("productCategoryId"))) || (curCategoryId?exists && curCategoryId == category.productCategoryId)> + <#local subCatList = Static["org.ofbiz.product.category.CategoryWorker"].getRelatedCategoriesRet(request, "subCatList", category.getString("productCategoryId"), true)> + <#if subCatList?exists> + <#list subCatList as subCat> + <ol class="browsecategorylist"> + <@categoryList parentCategory=category category=subCat wrapInBox="N"/> + </ol> + </#list> + </#if> + </#if> + </li> + <#if wrapInBox == "Y"> + </div> + </div> + </div> + </#if> +</#macro> + +<#if topLevelList?has_content> +<div id="sidedeepcategory"> + <div> + <ol class="browsecategorylist"> + <#list topLevelList as category> + <@categoryList parentCategory=category category=category wrapInBox="N"/> + </#list> + </ol> + </div> +</div> +</#if> \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/catalog/SideDeepCategory.ftl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/catalog/SideDeepCategory.ftl ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/catalog/SideDeepCategory.ftl ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/customer/EditAddress.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/webapp/webpos/customer/EditAddress.ftl?rev=1125951&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/webpos/webapp/webpos/customer/EditAddress.ftl (added) +++ ofbiz/trunk/specialpurpose/webpos/webapp/webpos/customer/EditAddress.ftl Sun May 22 13:11:17 2011 @@ -0,0 +1,98 @@ +<#-- +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. +--> +<div id="editAddress" style="display:none"> + <table border="0" width="100%"> + <tr> + <td width="100%" colspan="4"> + <br /> + </td> + </tr> + <tr> + <td width="15%"> + <b>${uiLabelMap.PartyLastName}</b> + </td> + <td width="35%"> + <input type="hidden" id="partyId" name="partyId" value="" /> + <input type="hidden" id="contactMechId" name="contactMechId" value="" /> + <input type="hidden" id="contactMechPurposeTypeId" name="contactMechPurposeTypeId" value="" /> + <input type="text" id="personLastName" name="personLastName" value="" size="40" /> + </td> + <td width="15%"> + <b>${uiLabelMap.PartyFirstName}</b> + </td> + <td width="35%"> + <input type="text" id="personFirstName" name="personFirstName" value="" size="40" /> + </td> + </tr> + <tr> + <td width="15%"> + <b>${uiLabelMap.PartyAddressLine1}</b> + </td> + <td width="35%"> + <input type="text" id="personAddress1" name="personAddress1" value="" size="40" /> + </td> + <td width="15%"> + <b>${uiLabelMap.PartyAddressLine2}</b> + </td> + <td width="35%"> + <input type="text" id="personAddress2" name="personAddress2" value="" size="40" /> + </td> + </tr> + <tr> + <td width="15%"> + <b>${uiLabelMap.PartyCountry}</b> + </td> + <td width="35%"> + <input type="text" id="countryProvinceGeo" name="countryProvinceGeo" value="" /> + </td> + <td width="15%"> + <b>${uiLabelMap.PartyState}</b> + </td> + <td width="35%"> + <input type="text" id="stateProvinceGeo" name="stateProvinceGeo" value="" /> + </td> + </tr> + <tr> + <td width="15%"> + <b>${uiLabelMap.PartyCity}</b> + </td> + <td width="35%"> + <input type="text" id="personCity" name="personCity" value="" size="40" /> + </td> + <td width="15%"> + <b>${uiLabelMap.PartyPostalCode}</b> + </td> + <td width="35%"> + <input type="text" id="personPostalCode" name="personPostalCode" value="" size="7" /> + </td> + </tr> + <tr> + <td width="100%" colspan="4"> + <br /> + </td> + </tr> + <tr> + <td width="100%" colspan="4" align="center"> + <input type="submit" id="editAddressCreateUpdate" name="editAddressCreateUpdate" value="${uiLabelMap.CommonCreate}"/> + + <input type="submit" id="editAddressCancel" name="editAddressCancel" value="${uiLabelMap.CommonCancel}"/> + </td> + </tr> + </table> +</div> \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/customer/EditAddress.ftl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/customer/EditAddress.ftl ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/customer/EditAddress.ftl ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/error/error.jsp URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/webapp/webpos/error/error.jsp?rev=1125951&r1=1125950&r2=1125951&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/webpos/webapp/webpos/error/error.jsp (original) +++ ofbiz/trunk/specialpurpose/webpos/webapp/webpos/error/error.jsp Sun May 22 13:11:17 2011 @@ -16,37 +16,4 @@ KIND, either express or implied. See th specific language governing permissions and limitations under the License. --%> -<%@ page import="org.ofbiz.base.util.*" %> -<html> -<head> -<title>Open For Business Message</title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -</head> - -<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %> - -<body bgcolor="#FFFFFF"> -<div align="center"> - <br/> - <table width="100%" border="1" height="200"> - <tr> - <td> - <table width="100%" border="0" height="200"> - <tr bgcolor="#CC6666"> - <td height="45"> - <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF"><b>:ERROR MESSAGE:</b></font></div> - </td> - </tr> - <tr> - <td> - <div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><%=UtilFormatOut.replaceString(errorMsg, "\n", "<br/>")%></font></div> - </td> - </tr> - </table> - </td> - </tr> - </table> -</div> -<div align="center"></div> -</body> -</html> +<%response.sendRedirect("control/error");%> \ No newline at end of file Added: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/CategoryDetail.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/CategoryDetail.js?rev=1125951&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/CategoryDetail.js (added) +++ ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/CategoryDetail.js Sun May 22 13:11:17 2011 @@ -0,0 +1,34 @@ +/* +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. +*/ +function showSelectedButton() { + jQuery('li.notSelectedButton').each(function(idx) { + var id = jQuery(this).attr('id'); + if (id != '') { + id = '#' + id; + jQuery(id).bind('mouseover', function(event) { + jQuery(id).addClass("selectedButton"); + jQuery(id).removeClass("notSelectedButton"); + }); + jQuery(id).bind('mouseout', function(event) { + jQuery(id).addClass("notSelectedButton"); + jQuery(id).removeClass("selectedButton"); + }); + } + }); +} \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/CategoryDetail.js ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/CategoryDetail.js ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/CategoryDetail.js ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/ChooseVariant.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/ChooseVariant.js?rev=1125951&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/ChooseVariant.js (added) +++ ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/ChooseVariant.js Sun May 22 13:11:17 2011 @@ -0,0 +1,295 @@ +/* +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. +*/ +var variantData = null; + +jQuery(document).ready(function() { + jQuery('#variantQuantity').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + variantConfirmed(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#chooseVariantConfirm').bind('click', function(event) { + variantConfirmed(); + return false; + }); + + jQuery('#chooseVariantCancel').bind('click', function(event) { + productToSearchFocus(); + return false; + }); +}); + +function variantConfirmed() { + pleaseWait('Y'); + if (jQuery('#variant').val() == 'Y') { + var param = 'add_product_id=' + jQuery('#variantProductId').val() + '&quantity=' + jQuery('#variantQuantity').val() + + '&add_amount=' + jQuery('#amount').val(); + jQuery.ajax({url: 'AddToCart', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfVariantAddItem(data); + }, + error: function(data) { + getResultOfVariantAddItem(data); + } + }); + } else { + jQuery.ajax({url: 'AddToCart', + data: jQuery('#ChooseVariantForm').serialize(), + type: 'post', + async: false, + success: function(data) { + getResultOfVariantAddItem(data); + }, + error: function(data) { + getResultOfVariantAddItem(data); + } + }); + } + pleaseWait('N'); +} + +function getResultOfVariantAddItem(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + } else { + clearErrorMessages(); + updateCart(); + productToSearchFocus(); + } +} + +function chooseVariant(cleanErrors, data) { + if (cleanErrors == undefined) { + cleanErrors = "Y"; + } + if (cleanErrors == "Y") { + hideOverlayDiv(); + jQuery('#chooseVariantFormServerError').html(""); + jQuery('#variantQuantity').val("1"); + } + variantData = data; + + var requireAmount = data.product.requireAmount; + if (requireAmount == null) { + requireAmount = "N"; + } + if (requireAmount == "Y") { + jQuery('#addAmount').show(); + } else { + jQuery('#addAmount').hide(); + } + + var virtualVariantMethodEnum = data.product.virtualVariantMethodEnum; + if (virtualVariantMethodEnum == null) { + virtualVariantMethodEnum = "VV_VARIANTTREE"; + } + if (virtualVariantMethodEnum == "VV_VARIANTTREE") { + selectVariant(variantData, 'Y'); + } + if (virtualVariantMethodEnum == "VV_FEATURETREE") { + selectFeature(variantData, 'Y', data.product.productId); + } +} + +function selectVariant(data, firstTime) { + var variantTree = data.variantTree; + var variantTreeSize = data.variantTreeSize; + var featureOrder = data.featureOrder; + var featureTypes = data.featureTypes; + var variantSampleList = data.variantSampleList; + var selectList = ""; + var featureValue = ""; + if (variantTree != undefined && variantTreeSize > 0) { + if (featureOrder != undefined && featureOrder.length > 0) { + if (variantSampleList != undefined && variantSampleList.length > 0) { + if (featureTypes != undefined) { + var idx = 0; + var previousFeatureValue = ""; + jQuery.each(featureOrder, function(i, actualFeature) { + var feature = featureTypes[actualFeature]; + if (idx == 0) { + selectList = selectList + feature + " "; + selectList = selectList + "<select id=\"FT" + feature + "\" name=\"FT" + feature + "\">"; + for (i = 0; i < variantSampleList.length; i++) { + selectList = selectList + "<option" + if (firstTime == 'N') { + var selectedFeatureValue = "#FT" + feature; + featureValue = jQuery(selectedFeatureValue).val(); + if (featureValue == variantSampleList[i]) { + selectList = selectList + " selected"; + } + } else { + featureValue = variantSampleList[0]; + } + selectList = selectList + ">" + variantSampleList[i] + "</option>"; + } + selectList = selectList + "</select><br/>"; + } else { + var features = variantTree[previousFeatureValue]; + selectList = selectList + feature + " "; + selectList = selectList + "<select id=\"FT" + feature + "\" name=\"FT" + feature + "\">"; + for (var key in features) { + selectList = selectList + "<option" + if (firstTime == 'N') { + var selectedFeatureValue = "#FT" + feature; + var featureValue = jQuery(selectedFeatureValue).val(); + if (featureValue == key) { + selectList = selectList + " selected"; + } + } + selectList = selectList + ">" + key + "</option>"; + } + selectList = selectList + "</select><br/>"; + } + idx++; + previousFeatureValue = featureValue; + }); + jQuery('#features').html(selectList); + var idx = 0; + var features = variantTree; + jQuery.each(featureOrder, function(i, actualFeature) { + var feature = featureTypes[actualFeature]; + featureValue = "FT" + feature; + jQuery('#' + featureValue).bind('change', function(event) { + selectVariant(variantData, 'N'); + return false; + }); + var featValue = jQuery('#' + featureValue).val(); + idx++; + for (var key in features) { + if (key == featValue) { + if (idx == featureOrder.length) { + jQuery('#variantProductId').val(features[key]); + var param = 'productId=' + jQuery('#variantProductId').val(); + jQuery.ajax({url: 'GetProductAndPrice', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfGetProductAndPrice(data); + }, + error: function(data) { + getResultOfGetProductAndPrice(data); + } + }); + } else { + features = features[key]; + } + } + } + }); + } + } + } + } + jQuery('#variant').val('Y'); + jQuery('#features').show(); + jQuery('#chooseVariant').show(); + jQuery('#variantQuantity').focus(); +} + +function selectFeature(data, firstTime, productId) { + var featureLists = data.featureLists; + if (featureLists != undefined && featureLists.length > 0) { + var selectList = ""; + for (i = 0; i < featureLists.length; i++) { + featureList = featureLists[i]; + for (j = 0; j < featureList.length; j++) { + var feature = featureList[j]; + if (j == 0) { + selectList = selectList + feature.description + " "; + selectList = selectList + "<select id=\"FT" + feature.productFeatureTypeId + "\" name=\"FT" + feature.productFeatureTypeId + "\">"; + } else { + selectList = selectList + "<option value='"; + selectList = selectList + feature.productFeatureId; + selectList = selectList + "'>"; + selectList = selectList + feature.description; + if (feature.price != null) { + var amount = getFormattedProductFeaturePrice(feature.productFeatureId, "DEFAULT_PRICE", feature.currencyUomId); + selectList = selectList + " (+ " + amount + ") "; + } + selectList = selectList + "</option>"; + } + } + selectList = selectList + "</select><br/>"; + } + jQuery('#variantProductId').val(productId); + jQuery('#features').html(selectList); + } + jQuery('#variant').val('N'); + jQuery('#features').show(); + jQuery('#chooseVariant').show(); + jQuery('#variantQuantity').focus(); +} + +function getResultOfGetProductAndPrice(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#chooseVariantFormServerError').update(serverError); + chooseVariant('N', data); + } else { + clearErrorMessages(); + var product = data.product; + var price = data.price; + var currencyUomId = data.currencyUomId; + if (product.productName != null) { + jQuery('#variantProductDescription').update(product.productName); + } else if (product.productDescription != null) { + jQuery('#variantProductDescription').update(product.productDescription); + } else if (product.longDescription != null) { + jQuery('#variantProductDescription').update(product.longDescription); + } + var formattedPrice = getFormattedAmount(price, currencyUomId); + jQuery('#variantProductPrice').update(formattedPrice); + } +} + +function getFormattedProductFeaturePrice(productFeatureIdIn, productPriceTypeIdIn, currencyUomIdIn) { + var formattedAmount = ""; + var param = 'productFeatureId=' + productFeatureIdIn + '&productPriceTypeId=' + productPriceTypeIdIn + '¤cyUomId=' + currencyUomIdIn; + jQuery.ajax({url: 'GetFormattedProductFeaturePrice', + data: param, + type: 'post', + async: false, + success: function(data) { + formattedAmount = getResultOfGetFormattedProductFeaturePrice(data); + }, + error: function(data) { + formattedAmount = getResultOfGetFormattedProductFeaturePrice(data); + } + }); + return formattedAmount; +} + +function getResultOfGetFormattedProductFeaturePrice(data) { + return data.formattedFeaturePrice; +} \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/ChooseVariant.js ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/ChooseVariant.js ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/ChooseVariant.js ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/CloseTerminal.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/CloseTerminal.js?rev=1125951&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/CloseTerminal.js (added) +++ ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/CloseTerminal.js Sun May 22 13:11:17 2011 @@ -0,0 +1,137 @@ +/* +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. +*/ +jQuery(document).ready(function() { + jQuery('#endingDrawerCashAmount').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + closeTerminalConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#endingDrawerCheckAmount').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + closeTerminalConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#endingDrawerCcAmount').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + closeTerminalConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#endingDrawerGcAmount').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + closeTerminalConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#endingDrawerOtherAmount').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + closeTerminalConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#closeTerminalConfirm').bind('click', function(event) { + closeTerminalConfirm(); + return false; + }); + + jQuery('#closeTerminalCancel').bind('click', function(event) { + productToSearchFocus(); + return false; + }); +}); + +function closeTerminalConfirm() { + pleaseWait('Y'); + var param = 'endingDrawerCashAmount=' + jQuery('#endingDrawerCashAmount').val() + '&endingDrawerCheckAmount=' + jQuery('#endingDrawerCheckAmount').val() + + '&endingDrawerCcAmount=' + jQuery('#endingDrawerCcAmount').val() + '&endingDrawerGcAmount=' + jQuery('#endingDrawerGcAmount').val() + + '&endingDrawerOtherAmount=' + jQuery('#endingDrawerOtherAmount').val(); + jQuery.ajax({url: 'CloseTerminal', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfCloseTerminal(data); + }, + error: function(data) { + getResultOfCloseTerminal(data); + } + }); + pleaseWait('N'); +} + +function closeTerminal(cleanErrors) { + if (cleanErrors == undefined) { + cleanErrors = "Y"; + } + if (cleanErrors == "Y") { + hideOverlayDiv(); + jQuery('#closeTerminalFormServerError').html(""); + jQuery('#endingDrawerCashAmount').val(""); + jQuery('#endingDrawerCheckAmount').val(""); + jQuery('#endingDrawerCcAmount').val(""); + jQuery('#endingDrawerGcAmount').val(""); + jQuery('#endingDrawerOtherAmount').val(""); + } + jQuery('#closeTerminal').show(); + jQuery('#endingDrawerCashAmount').focus(); +} + +function getResultOfCloseTerminal(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#closeTerminalFormServerError').html(serverError); + closeTerminal('N'); + } else { + clearErrorMessages(); + updateCart(); + productToSearchFocus(); + } +} \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/CloseTerminal.js ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/CloseTerminal.js ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/CloseTerminal.js ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/Common.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/Common.js?rev=1125951&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/Common.js (added) +++ ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/Common.js Sun May 22 13:11:17 2011 @@ -0,0 +1,215 @@ +/* +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. +*/ +jQuery(document).ready(function() { + activateHotKeys(); +}); + +function updateCart() { + jQuery('#CartList').load('ShowCart'); +} + +function updateCustomerAddress() { + jQuery('#CustomerAddressList').load('CustomerAddress'); +} + +function updateCartItemSelected(lineIndex, focusOnQnt) { + if (lineIndex == null) { + lineIndex = 0; + } + jQuery('#CartItemSelected').load('ShowCartItemSelected', {cartLineIndex:lineIndex, focusOnQuantity:focusOnQnt}); +} + +function addItem(product_Id, qnt, updCart) { + pleaseWait('Y'); + var param = 'productId=' + product_Id; + jQuery.ajax({url: 'GetProductType', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfCheckProductType(data, product_Id, qnt, updCart); + }, + error: function(data) { + getResultOfCheckProductType(data, product_Id, qnt, updCart); + } + }); + pleaseWait('N'); +} + +function getResultOfCheckProductType(data, productId, qnt, updCart) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + } else { + var isVirtual = data.product.isVirtual; + if (isVirtual == null) { + isVirtual = "N"; + } + if (isVirtual == "N") { + var param = 'add_product_id=' + productId + "&quantity=" + qnt; + jQuery.ajax({url: 'AddToCart', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfAddItem(data, updCart); + }, + error: function(data) { + getResultOfAddItem(data, updCart); + } + }); + } else { + chooseVariant('Y', data); + } + } +} + +function getResultOfAddItem(data, updCart) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + } else { + if (updCart == "Y") { + jQuery('#errors').fadeOut('slow'); + updateCart(); + if (data.itemId != undefined) { + updateCartItemSelected(data.itemId, 'N'); + } + jQuery('#productToSearch').val(''); + jQuery('#productToSearch').focus(); + } + } +} + +// Check server side error +function getServerError(data) { + var serverErrorHash = []; + var serverError = ""; + if (data._ERROR_MESSAGE_LIST_ != undefined) { + serverErrorHash = data._ERROR_MESSAGE_LIST_; + jQuery.each(serverErrorHash, function(i, error) { + serverError += error; + }); + } + if (data._ERROR_MESSAGE_ != undefined) { + serverError = data._ERROR_MESSAGE_; + } + return serverError; +} + +function hideOverlayDiv() { + jQuery('#payCash').hide(); + jQuery('#payCheck').hide(); + jQuery('#payGiftCard').hide(); + jQuery('#payCreditCard').hide(); + jQuery('#openTerminal').hide(); + jQuery('#closeTerminal').hide(); + jQuery('#paidOutAndIn').hide(); + jQuery('#promo').hide(); + jQuery('#voidOrder').hide(); + jQuery('#chooseVariant').hide(); + jQuery('#searchProductsResults').hide(); + jQuery('#searchPartiesResults').hide(); + jQuery('#editAddress').hide(); + pleaseWait('N'); +} + +function pleaseWait(wait) { + if (wait == "Y") { + jQuery('#pleaseWait').show(); + } + else { + jQuery('#pleaseWait').hide(); + } +} + +function getFormattedAmount(amountStr, currencyStr) { + var formattedAmount = ""; + var param = 'amount=' + amountStr + "¤cyId=" + currencyStr; + jQuery.ajax({url: 'GetFormattedAmount', + data: param, + type: 'post', + async: false, + success: function(data) { + formattedAmount = getResultOfGetFormattedAmount(data); + }, + error: function(data) { + formattedAmount = getResultOfGetFormattedAmount(data); + } + }); + return formattedAmount; +} + +function getResultOfGetFormattedAmount(data) { + return data.formattedAmount; +} + +function emptyCart() { + pleaseWait('Y'); + jQuery.ajax({url: 'EmptyCart', + type: 'post', + async: false, + success: function(data) { + getResultOfEmptyCart(data); + }, + error: function(data) { + getResultOfEmptyCart(data); + } + }); + pleaseWait('N'); + return false; +} + +function getResultOfEmptyCart(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + } else { + jQuery('#errors').fadeOut('slow'); + updateCart(); + updateCartItemSelected(null, 'N'); + updateCustomerAddress(); + hideOverlayDiv(); + clearSearchResults(); + } + productToSearchFocus(); +} + +function clearSearchResults() { + jQuery('#productToSearch').val( ''); + jQuery('#partyToSearch').val(''); +} + +function checkNull(fieldToCheck) { + if (fieldToCheck == null) { + return ""; + } else { + return fieldToCheck; + } +} + +function clearErrorMessages() { + jQuery('#errors').fadeOut('slow'); +} \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/Common.js ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/Common.js ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/Common.js ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/EditAddress.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/EditAddress.js?rev=1125951&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/EditAddress.js (added) +++ ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/EditAddress.js Sun May 22 13:11:17 2011 @@ -0,0 +1,100 @@ +/* +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. +*/ +var uiLabelJsonObjects = null; +jQuery(document).ready(function() { + jQuery('#editAddressCreateUpdate').bind('click', function(event) { + pleaseWait('Y'); + var param = 'partyId=' + jQuery('#partyId').val() + '&firstName=' + jQuery('#personFirstName').val() + '&lastName=' + jQuery('#personLastName').val() + + '&contactMechId=' + jQuery('#contactMechId').val() + '&contactMechPurposeTypeId=' + jQuery('#contactMechPurposeTypeId').val() + + '&address1=' + jQuery('#personAddress1').val() + '&address2=' + jQuery('#personAddress2').val() + + '&countryProvinceGeo=' + jQuery('#countryProvinceGeo').val() + '&stateProvinceGeo=' + jQuery('#stateProvinceGeo').val() + + '&city=' + jQuery('#personCity').val() + '&postalCode=' + jQuery('#personPostalCode').val(); + jQuery.ajax({url: 'CreateUpdateAddress', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfCreateUpdateAddress(data); + }, + error: function(data) { + getResultOfCreateUpdateAddress(data); + } + }); + productToSearchFocus(); + pleaseWait('N'); + partySearchAgain(); + return false; + }); + + jQuery('#editAddressCancel').bind('click', function(event) { + pleaseWait('Y'); + productToSearchFocus(); + pleaseWait('N'); + jQuery('#searchPartiesResults').show(); + return false; + }); + + var labelObject = { + "CommonUiLabels" : ["CommonCreate", "CommonUpdate"], + }; + + uiLabelJsonObjects = getJSONuiLabels(labelObject); +}); + +function getResultOfCreateUpdateAddress(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#editAddressFormServerError').html(serverError); + } else { + productToSearchFocus(); + } +} + +function editAddress(partyIdIn, contactMechIdIn, contactMechPurposeTypeIdIn) { + var param = 'partyId=' + partyIdIn + '&contactMechId=' + contactMechIdIn + '&contactMechPurposeTypeId=' + contactMechPurposeTypeIdIn; + jQuery.ajax({url: 'EditAddress', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfEditAddress(data); + } + }); + jQuery('#editAddress').show(); + jQuery('#personLastName').focus(); +} + +function getResultOfEditAddress(data) { + jQuery('#partyId').val(data.partyId); + jQuery('#contactMechId').val(data.contactMechId); + jQuery('#contactMechPurposeTypeId').val(data.contactMechPurposeTypeId); + jQuery('#personLastName').val(data.lastName); + jQuery('#personFirstName').val(data.firstName); + jQuery('#personAddress1').val(data.address1); + jQuery('#personAddress2').val(data.address2); + jQuery('#countryProvinceGeo').val(data.countryGeoId); + jQuery('#stateProvinceGeo').val(data.stateProvinceGeoId); + jQuery('#personCity').val(data.city); + jQuery('#personPostalCode').val(data.postalCode); + if (data.partyId != "") { + jQuery('#editAddressCreateUpdate').val(uiLabelJsonObjects.CommonUiLabels[1]); + } else { + jQuery('#editAddressCreateUpdate').val(uiLabelJsonObjects.CommonUiLabels[0]); + } +} \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/EditAddress.js ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/EditAddress.js ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/EditAddress.js ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/OpenTerminal.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/OpenTerminal.js?rev=1125951&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/OpenTerminal.js (added) +++ ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/OpenTerminal.js Sun May 22 13:11:17 2011 @@ -0,0 +1,83 @@ +/* +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. +*/ +jQuery(document).ready(function() { + jQuery('#startingDrawerAmount').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + openTerminalConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#openTerminalConfirm').bind('click', function(event) { + openTerminalConfirm(); + return false; + }); + + jQuery('#openTerminalCancel').bind('click', function(event) { + productToSearchFocus(); + return false; + }); +}); + +function openTerminalConfirm() { + pleaseWait('Y'); + var param = 'startingDrawerAmount=' + jQuery('#startingDrawerAmount').val(); + jQuery.ajax({url: 'OpenTerminal', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfOpenTerminal(data); + }, + error: function(data) { + getResultOfOpenTerminal(data); + } + }); + pleaseWait('N'); +} + +function openTerminal(cleanErrors) { + if (cleanErrors == undefined) { + cleanErrors = "Y"; + } + if (cleanErrors == "Y") { + hideOverlayDiv(); + jQuery('#openTerminalFormServerError').html(""); + jQuery('#startingDrawerAmount').val(""); + } + jQuery('#startingDrawerAmount').focus(); + jQuery('#openTerminal').show(); +} + +function getResultOfOpenTerminal(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#openTerminalFormServerError').html(serverError); + openTerminal('N'); + } else { + clearErrorMessages(); + updateCart(); + productToSearchFocus(); + } +} \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/OpenTerminal.js ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/OpenTerminal.js ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/OpenTerminal.js ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PaidOutAndIn.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PaidOutAndIn.js?rev=1125951&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PaidOutAndIn.js (added) +++ ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PaidOutAndIn.js Sun May 22 13:11:17 2011 @@ -0,0 +1,110 @@ +/* +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. +*/ +jQuery(document).ready(function() { + jQuery('#amountInOut').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + paidOutAndInConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#reasonCommentInOut').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + paidOutAndInConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#paidOutAndInConfirm').bind('click', function(event) { + paidOutAndInConfirm(); + return false; + }); + + jQuery('#paidOutAndInCancel').bind('click', function(event) { + productToSearchFocus(); + return false; + }); +}); + +function paidOutAndInConfirm() { + pleaseWait('Y'); + var param = 'type=' + jQuery('#paidType').val() + '&amountInOut=' + jQuery('#amountInOut').val() + + '&reasonIn=' + jQuery('#reasIn').val() + '&reasonOut=' + jQuery('#reasOut').val() + + '&reasonCommentInOut=' + jQuery('#reasonCommentInOut').val(); + jQuery.ajax({url: 'PaidOutAndIn', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfPaidOutAndIn(data); + }, + error: function(data) { + getResultOfPaidOutAndIn(data); + } + }); + pleaseWait('N'); +} + +function paidOutAndIn(cleanErrors, paidInOut) { + if (cleanErrors == undefined) { + cleanErrors = "Y"; + } + if (cleanErrors == "Y") { + hideOverlayDiv(); + jQuery('#paidOutAndInFormServerError').html(""); + jQuery('#amountInOut').val(""); + jQuery('#reasonCommentInOut').val(""); + } + jQuery('#paidType').val(paidInOut); + jQuery('#paidOutAndIn').show(); + if (paidInOut == 'IN') { + jQuery('#reasonIn').show(); + jQuery('#amountPaidIn').show(); + jQuery('#reasonOut').hide(); + jQuery('#amountPaidOut').hide(); + } else { + jQuery('#reasonIn').hide(); + jQuery('#amountPaidIn').hide(); + jQuery('#reasonOut').show(); + jQuery('#amountPaidOut').show(); + } + jQuery('#amountInOut').focus(); +} + +function getResultOfPaidOutAndIn(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#paidOutAndInFormServerError').html(serverError); + paidOutAndIn('N', jQuery('#paidType').val()); + } else { + clearErrorMessages(); + updateCart(); + productToSearchFocus(); + } +} \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PaidOutAndIn.js ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PaidOutAndIn.js ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PaidOutAndIn.js ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayCash.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayCash.js?rev=1125951&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayCash.js (added) +++ ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayCash.js Sun May 22 13:11:17 2011 @@ -0,0 +1,117 @@ +/* +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. +*/ +jQuery(document).ready(function() { + jQuery('#removeCashTotalPaid').click(function(event) { + pleaseWait('Y'); + var param = 'clearCash=Y&clearCheck=N&clearGift=N&clearCredit=N'; + jQuery.ajax({url: 'ClearPayment', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfCashClearPayment(data); + }, + error: function(data) { + getResultOfCashClearPayment(data); + } + }); + pleaseWait('N'); + productToSearchFocus(); + return false; + }); + + jQuery('#amountCash').keypress(function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payCashConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#payCashConfirm').click(function(event) { + payCashConfirm(); + return false; + }); + + jQuery('#payCashCancel').click(function(event) { + productToSearchFocus(); + return false; + }); +}); + +function payCashConfirm() { + pleaseWait('Y'); + var param = 'amountCash=' + jQuery('#amountCash').val(); + jQuery.ajax({url: 'PayCash', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfPayCash(data); + }, + error: function(data) { + getResultOfPayCash(data); + } + }); + pleaseWait('N'); +} + +function payCash(cleanErrors) { + if (cleanErrors == undefined) { + cleanErrors = "Y"; + } + if (cleanErrors == "Y") { + hideOverlayDiv(); + jQuery('#payCashFormServerError').html(""); + jQuery('#amountCash').val(""); + } + jQuery('#cashTotalDue').html(jQuery('#totalDueFormatted').val()); + jQuery('#cashTotalPaid').html(jQuery('#totalCashFormatted').val()); + jQuery('#payCash').show(); + jQuery('#amountCash').focus(); + return false; +} + +function getResultOfPayCash(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#payCashFormServerError').html(serverError); + payCash('N'); + } else { + clearErrorMessages(); + updateCart(); + productToSearchFocus(); + } +} + +function getResultOfCashClearPayment(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + } else { + clearErrorMessages(); + updateCart(); + } +} \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayCash.js ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayCash.js ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayCash.js ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayCheck.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayCheck.js?rev=1125951&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayCheck.js (added) +++ ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayCheck.js Sun May 22 13:11:17 2011 @@ -0,0 +1,130 @@ +/* +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. +*/ +jQuery(document).ready(function() { + jQuery('#removeCheckTotalPaid').bind('click', function(event) { + pleaseWait('Y'); + var param = 'clearCash=N&clearCheck=Y&clearGift=Y&clearCredit=N'; + jQuery.ajax({url: 'ClearPayment', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfCashClearPayment(data); + }, + error: function(data) { + getResultOfCashClearPayment(data); + } + }); + pleaseWait('N'); + productToSearchFocus(); + return false; + }); + + jQuery('#amountCheck').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payCheckConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#refNumCheck').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payCheckConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#payCheckConfirm').bind('click', function(event) { + payCheckConfirm(); + return false; + }); + + jQuery('#payCheckCancel').bind('click', function(event) { + productToSearchFocus(); + return false; + }); +}); + +function payCheckConfirm() { + pleaseWait('Y'); + var param = 'amountCheck=' + jQuery('#amountCheck').val() + '&refNum=' + jQuery('#refNumCheck').val(); + jQuery.ajax({url: 'PayCheck', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfPayCheck(data); + }, + error: function(data) { + getResultOfPayCheck(data); + } + }); + pleaseWait('N'); +} + +function payCheck(cleanErrors) { + if (cleanErrors == undefined) { + cleanErrors = "Y"; + } + if (cleanErrors == "Y") { + hideOverlayDiv(); + jQuery('#payCheckFormServerError').html(""); + jQuery('#amountCheck').val(""); + jQuery('#refNumCheck').val(""); + } + jQuery('#checkTotalDue').html(jQuery('#totalDueFormatted').val()); + jQuery('#checkTotalPaid').html(jQuery('#totalCheckFormatted').val()); + jQuery('#payCheck').show(); + jQuery('#amountCheck').focus(); + return false; +} + +function getResultOfPayCheck(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#payCheckFormServerError').html(serverError); + payCheck('N'); + } else { + clearErrorMessages(); + updateCart(); + productToSearchFocus(); + } +} + +function getResultOfCheckClearPayment(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + } else { + clearErrorMessages(); + updateCart(); + } +} \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayCheck.js ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayCheck.js ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayCheck.js ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayCreditCard.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayCreditCard.js?rev=1125951&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayCreditCard.js (added) +++ ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayCreditCard.js Sun May 22 13:11:17 2011 @@ -0,0 +1,241 @@ +/* +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. +*/ +jQuery(document).ready(function() { + jQuery('#removeCreditCardTotalPaid').bind('click', function(event) { + pleaseWait('Y'); + var param = 'clearCash=N&clearCheck=N&clearGift=N&clearCredit=Y'; + jQuery.ajax({url: 'ClearPayment', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfCreditCardClearPayment(data); + }, + error: function(data) { + getResultOfCreditCardClearPayment(data); + } + }); + pleaseWait('N'); + productToSearchFocus(); + return false; + }); + + jQuery('#swipeCard').bind('click', function(event) { + jQuery('#payCreditCard').show(); + if (jQuery('#swipeCard').val() == 'Y') { + jQuery('#swipeCard').val('N'); + jQuery('#swipeCard').checked = false; + jQuery('#showSwipeData').hide(); + jQuery('#showCreditCardData1').show(); + jQuery('#showCreditCardData2').show(); + jQuery('#firstName').focus(); + } else { + jQuery('#swipeCard').val('Y'); + jQuery('#swipeCard').checked = true; + jQuery('#showSwipeData').show(); + jQuery('#showCreditCardData1').hide(); + jQuery('#showCreditCardData2').hide(); + jQuery('#swipeData').focus(); + } + return false; + }); + + jQuery('#swipeData').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payCreditCardConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#firstName').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payCreditCardConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#lastName').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payCreditCardConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#cardNum').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payCreditCardConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#securityCode').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payCreditCardConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#amountCreditCard').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payCreditCardConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#postalCode').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payCreditCardConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#refNumCreditCard').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payCreditCardConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#payCreditCardConfirm').bind('click', function(event) { + payCreditCardConfirm(); + return false; + }); + + jQuery('#payCreditCardCancel').bind('click', function(event) { + productToSearchFocus(); + return false; + }); +}); + +function payCreditCardConfirm() { + pleaseWait('Y'); + var param = 'swipeCard=' + jQuery('#swipeCard').val() + '&swipeData=' + jQuery('#swipeData').val() + '&cardType=' + jQuery('#cardType').val() + + '&amountCreditCard=' + jQuery('#amountCreditCard').val() + '&refNum=' + jQuery('#refNumCreditCard').val() + '&cardNum=' + jQuery('#cardNum').val() + + '&expMonth=' + jQuery('#expMonth').val() + '&expYear=' + jQuery('#expYear').val() + '&securityCode=' + jQuery('#securityCode').val() + + '&postalCode=' + jQuery('#postalCode').val() + '&firstName=' + jQuery('#firstName').val() + '&lastName=' + jQuery('#lastName').val() + + '&track2=' + jQuery('#track2').val(); + jQuery.ajax({url: 'PayCreditCard', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfPayCreditCard(data); + }, + error: function(data) { + getResultOfPayCreditCard(data); + } + }); + pleaseWait('N'); +} + +function payCreditCard(cleanErrors) { + if (cleanErrors == undefined) { + cleanErrors = "Y"; + } + if (cleanErrors == "Y") { + hideOverlayDiv(); + jQuery('#payCreditCardFormServerError').html(""); + jQuery('#swipeCard').val('Y'); + jQuery('#swipeCard').checked = true; + jQuery('#swipeData').val(''); + jQuery('#firstName').val(''); + jQuery('#lastName').val(''); + jQuery('#cardNum').val(''); + jQuery('#securityCode').val(''); + jQuery('#postalCode').value = ''; + jQuery('#refNumCreditCard').val(''); + jQuery('#amountCreditCard').val(''); + jQuery('#showSwipeData').show(); + jQuery('#showCreditCardData1').hide(); + jQuery('#showCreditCardData2').hide(); + } + jQuery('#creditCardTotalDue').html(jQuery('#totalDueFormatted').val()); + jQuery('#creditCardTotalPaid').html(jQuery('#totalCreditFormatted').val()); + jQuery('#payCreditCard').show(); + if (jQuery('#swipeCard').val() == 'Y') { + jQuery('#swipeData').focus(); + } else { + jQuery('#firstName').focus(); + } + return false; +} + +function getResultOfPayCreditCard(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#payCreditCardFormServerError').html(serverError); + payCreditCard('N'); + } else { + clearErrorMessages(); + updateCart(); + productToSearchFocus(); + } +} + +function getResultOfCreditCardClearPayment(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + } else { + clearErrorMessages(); + updateCart(); + } +} \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayCreditCard.js ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayCreditCard.js ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayCreditCard.js ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayFinish.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayFinish.js?rev=1125951&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayFinish.js (added) +++ ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayFinish.js Sun May 22 13:11:17 2011 @@ -0,0 +1,50 @@ +/* +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. +*/ +function payFinish() { + pleaseWait('Y'); + jQuery.ajax({url: 'PayFinish', + type: 'post', + async: false, + success: function(data) { + getResultOfPayFinish(data); + }, + error: function(data) { + getResultOfPayFinish(data); + } + }); + pleaseWait('N'); + return false; +} + +function getResultOfPayFinish(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + } else { + clearErrorMessages(); + updateCart(); + updateCartItemSelected(null, 'N'); + updateCustomerAddress(); + hideOverlayDiv(); + clearSearchResults(); + } + productToSearchFocus(); +} \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayFinish.js ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayFinish.js ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayFinish.js ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayGiftCard.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayGiftCard.js?rev=1125951&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayGiftCard.js (added) +++ ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayGiftCard.js Sun May 22 13:11:17 2011 @@ -0,0 +1,130 @@ +/* +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. +*/ +jQuery(document).ready(function() { + jQuery('#removeGiftCardTotalPaid').bind('click', function(event) { + pleaseWait('Y'); + var param = 'clearCash=N&clearCheck=N&clearGift=Y&clearCredit=N'; + jQuery.ajax({url: 'ClearPayment', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfCashClearPayment(data); + }, + error: function(data) { + getResultOfCashClearPayment(data); + } + }); + pleaseWait('N'); + productToSearchFocus(); + return false; + }); + + jQuery('#amountGiftCard').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payGiftCardConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#refNumGiftCard').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payGiftCardConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#payGiftCardConfirm').bind('click', function(event) { + payGiftCardConfirm(); + return false; + }); + + jQuery('#payGiftCardCancel').bind('click', function(event) { + productToSearchFocus(); + return false; + }); +}); + +function payGiftCardConfirm() { + pleaseWait('Y'); + var param = 'amountGiftCard=' + jQuery('#amountGiftCard').val() + '&refNum=' + jQuery('#refNumGiftCard').val(); + jQuery.ajax({url: 'PayGiftCard', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfPayGiftCard(data); + }, + error: function(data) { + getResultOfPayGiftCard(data); + } + }); + pleaseWait('N'); +} + +function payGiftCard(cleanErrors) { + if (cleanErrors == undefined) { + cleanErrors = "Y"; + } + if (cleanErrors == "Y") { + hideOverlayDiv(); + jQuery('#payGiftCardFormServerError').html(""); + jQuery('#amountGiftCard').val(""); + jQuery('#refNumGiftCard').val(""); + } + jQuery('#giftCardTotalDue').html(jQuery('#totalDueFormatted').val()); + jQuery('#giftCardTotalPaid').html(jQuery('#totalGiftFormatted').val()); + jQuery('#payGiftCard').show(); + jQuery('#amountGiftCard').focus(); + return false; +} + +function getResultOfPayGiftCard(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#payGiftCardFormServerError').html(serverError); + payGiftCard('N'); + } else { + clearErrorMessages(); + updateCart(); + productToSearchFocus(); + } +} + +function getResultOfGiftCardClearPayment(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + } else { + clearErrorMessages(); + updateCart(); + } +} \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayGiftCard.js ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayGiftCard.js ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PayGiftCard.js ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PromoCode.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PromoCode.js?rev=1125951&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PromoCode.js (added) +++ ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PromoCode.js Sun May 22 13:11:17 2011 @@ -0,0 +1,83 @@ +/* +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. +*/ +jQuery(document).ready(function() { + jQuery('#promoCode').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + promoCodeConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#promoCodeConfirm').bind('click', function(event) { + promoCodeConfirm(); + return false; + }); + + jQuery('#promoCodeCancel').bind('click', function(event) { + productToSearchFocus(); + return false; + }); +}); + +function promoCodeConfirm() { + pleaseWait('Y'); + var param = 'promoCode=' + jQuery('#promoCode').val(); + jQuery.ajax({url: 'PromoCode', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfPromoCode(data); + }, + error: function(data) { + getResultOfPromoCode(data); + } + }); + pleaseWait('N'); +} + +function promoCode(cleanErrors) { + if (cleanErrors == undefined) { + cleanErrors = "Y"; + } + if (cleanErrors == "Y") { + hideOverlayDiv(); + jQuery('#promoCodeFormServerError').html(""); + jQuery('#promoCode').val(""); + } + jQuery('#promo').show(); + jQuery('#promoCode').focus(); +} + +function getResultOfPromoCode(date) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#promoCodeFormServerError').html(serverError); + promoCode('N'); + } else { + clearErrorMessages(); + updateCart(); + productToSearchFocus(); + } +} \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PromoCode.js ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PromoCode.js ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/PromoCode.js ------------------------------------------------------------------------------ svn:mime-type = text/plain |
Free forum by Nabble | Edit this page |