added gk lib for appenablement

This commit is contained in:
2026-04-02 08:29:44 +02:00
parent 586ac4c5c2
commit e8bec486c5
8 changed files with 1938 additions and 6 deletions
+42
View File
@@ -1,3 +1,7 @@
var oAppEnablementCommonInstance = new comGkSoftwareGkrAppEnablementApi.Common();
var oAppEnablementPosInstance = new comGkSoftwareGkrAppEnablementApi.Pos();
var oAppEnablementPosEXTInstance = new comGkSoftwareGkrAppEnablementApi.Pos_EXT();
async function searchCompany() {
const country = document.getElementById("country").value;
const vatNumber = document.getElementById("vat_number").value.trim();
@@ -56,6 +60,14 @@ function saveData() {
};
alert(JSON.stringify(payload, null, 2));
var customer = {
"customerId":"17600703312990"
}
var oRegisterCustomerRequest = JSON.stringify(customer)
oAppEnablementPosInstance.registerCustomer('registerDataOk', 'registerDataFailed', oRegisterCustomerRequest);
}
function clearForm() {
@@ -81,5 +93,35 @@ function updateVatPlaceholder() {
}
}
function closeBrowser() {
oAppEnablementCommonInstance.closeBrowser();
}
// customer registration - uses standard Pos
function registerLoyaltyCall(customerId) {
var request = JSON.stringify({
"customerId": customerId,
"customerServiceTypeCode": null,
"preferredReceiptPrintoutTypeCode": null
});
oAppEnablementPosInstance.registerCustomer(
'onSuccess',
'onError',
request
);
}
// Callback functions
function onSuccess(result) {
document.getElementById("status").textContent = "Thank you.";
closeBrowser();
}
function onError(error) {
document.getElementById("status").textContent = "Company registration in receipt failed. Please try again.";
}
document.getElementById("country").addEventListener("change", updateVatPlaceholder);
window.addEventListener("DOMContentLoaded", updateVatPlaceholder);