function fnCheckOut(nResId) {
let xmlhttp = new XMLHttpRequest();
let objParam = {
"ResStatus": 3,
"Reservations": [nResId]
};
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
alert('退房成功');
console.log(xmlhttp.responseText);
let objParam = {
"strName": "fnCallBackCheckOut",
"objValue": null,
"bIfContinue": true,
"strErrorDescription": "多余一个账单号,请手动操作"
}
window.postMessage(objParam);
}
else if (xmlhttp.status == 500) {
let objParam = {
"strName": "fnCallBackCheckOut",
"objValue": null,
"bIfContinue": false,
"strErrorDescription": xmlhttp.responseText
}
window.postMessage(objParam);
}
}
xmlhttp.open("POST", "https://app9.rmscloud.cn/api/Reservation/ResStatus/ChangeStatus");
xmlhttp.setRequestHeader('content-Type', 'application/json; charset=utf-8');
xmlhttp.send(JSON.stringify(objParam));
}
function fnCreateInvoice(objReservationDetails) {
let objLocal = JSON.parse(window.sessionStorage.getItem('RMS-INOUTMOVEMENTS'));
let xmlhttp = new XMLHttpRequest();
xmlhttp.open("POST", "https://app9.rmscloud.cn/api/TaxInvoice/ProcessTaxInvoice", true);
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
console.log(xmlhttp.responseText);
let objLocal = JSON.parse(window.sessionStorage.getItem('RMS-INOUTMOVEMENTS'));
let xmlhttpInner = new XMLHttpRequest();
xmlhttpInner.open("POST", "https://app9.rmscloud.cn/api/Report/Token/Accounting/TaxInvoice", true);
xmlhttpInner.onreadystatechange = function () {
if (xmlhttpInner.readyState == 4 && xmlhttpInner.status == 200) {
console.log(xmlhttpInner.responseText);
let xmlhttp1 = new XMLHttpRequest();
xmlhttp1.open("POST", "https://app9.rmscloud.cn/api/ReportService/ReportPathPost?ReportId=40231&ReportName=Tax+Invoice&ReportType=1&ScheduleId=0", true);
xmlhttp1.onreadystatechange = function () {
if (xmlhttp1.readyState == 4 && xmlhttp1.status == 200) {
let objParam={
"strName": "fnCallBackCreateInvoice",
"bIfContinue":true
}
window.postMessage(objParam);
window.open(JSON.parse(xmlhttp1.responseText).PostPath + "?Token=" + JSON.parse(xmlhttp1.responseText).PostToken + "¶meters=" + JSON.parse(xmlhttp1.responseText).PostData);
}
}
let aryParam = [
JSON.parse(xmlhttp.response).TaxInvoices[0].TaxInvoiceNo,
true,
"TI10305CHINA",
JSON.parse(window.localStorage.getItem('RM_Property')).data.split('_')[0],
0,
false,
window.objGlobalParam.objReservationDetails.ResScreenData.AccountId,
"1,2,4,5,6,12",
"¥",
"/shareddata/14910/RMSWIN/",
null,
"false",
window.objGlobalParam.objReservationDetails.ResScreenData.ResId,
"",
false,
new Date().getFullYear() + '-' + (parseInt(new Date().getMonth()) + 1) + '-' + new Date().getDate() + "T00:00:00",
new Date().getFullYear() + '-' + (parseInt(new Date().getMonth()) + 1) + '-' + new Date().getDate() + "T00:00:00",
false,
1,
"",
false,
false,
new Date().getFullYear() + '-' + (parseInt(new Date().getMonth()) + 1) + '-' + new Date().getDate() + "T00:00:00",
false,
new Date().getFullYear() + '-' + (parseInt(new Date().getMonth()) + 1) + '-' + new Date().getDate() + "T00:00:00",
false,
"",
JSON.parse(window.sessionStorage.getItem('InitData')).data.VersionNo,
44,
JSON.parse(window.localStorage.getItem('RM_Property')).data.split('_')[0],
false,
"",
"",
"0001-01-01T00:00:00"
]
xmlhttp1.setRequestHeader('content-Type', 'application/json; charset=utf-8');
xmlhttp1.send(JSON.stringify(aryParam));
}
}
let dateYYYYMMDD = new Date().getFullYear() + '-' + (parseInt(new Date().getMonth()) + 1) + '-' + new Date().getDate();
let objParam = {
"ReportId": 40231,
"ScheduleId": 0,
"TaxInvoiceNos": JSON.parse(xmlhttp.response).TaxInvoices[0].TaxInvoiceNo,
"IsReprint": false,
"AltTaxInvoice": "TI10305CHINA",
"PropertyId": JSON.parse(window.localStorage.getItem('RM_Property')).data.split('_')[0],
"SortById": 0,
"IsTaxInvoiceProforma": false,
"AccountId": JSON.parse(xmlhttp.response).TaxInvoices[0].AccountNo,
"AccountTypeIDs": "1,2,4,5,6,12",
"CurrencySymbol": "¥",
"SharedDataPath": "/shareddata/14910/RMSWIN/",
"EmailTo": "",
"IsThermalPrint": false,
"ResId": window.objGlobalParam.objReservationDetails.ResScreenData.ResId,
"FromEmail": "",
"ProformaUseDateRange": false,
"ProformaStartDate": dateYYYYMMDD,
"ProformaEndDate": dateYYYYMMDD,
"IsEmailOverride": false,
"ReportType": 1,
"LetterHistoryIds": "",
"IsRestrictedUser": false,
"InvoiceDueDateEnabled": false,
"InvoiceDueDate": dateYYYYMMDD,
"DirectDebitDateEnabled": false,
"DirectDebitDate": dateYYYYMMDD,
"RePrint_Nos": "",
"UseGovInvoiceAudit": false,
"NinePlusVersionNo": "",
"CountryRunningFrom": 44,
"CurrencyView": 0
}
xmlhttpInner.setRequestHeader('content-Type', 'application/json; charset=utf-8');
xmlhttpInner.send(JSON.stringify(objParam));
}
}
let objParam = {
"GroupedInvoice": false,
"PropertyId": JSON.parse(window.localStorage.getItem('RM_Property')).data.split('_')[0],
"lstOfAccountsToProcess": [
{
"AccNo": window.objGlobalParam.objReservationDetails.ResScreenData.AccountId,
"AccType": window.objGlobalParam.nAccountType,
"TransIds": []
}
],
"DueDateOverride": "1990-01-01T00:00:00"
}
xmlhttp.setRequestHeader('content-Type', 'application/json; charset=utf-8');
xmlhttp.send(JSON.stringify(objParam));
}
function fnAutoReceipt(objReservationDetails, fAryAccountBalance) {
let bIfContinue = true;
let dateDeparture = new Date(objReservationDetails.ResScreenData.ResRows[5].ValueText);
let dateToday = new Date();
let nCreditCardId = 0;
dateToday.setHours(0, 0, 0, 0);
dateDeparture.setHours(0, 0, 0, 0);
if (dateDeparture.getTime() !== dateToday.getTime()) {
console.log('continue');
bIfContinue = false;
}
if (bIfContinue) {
let strDate = new Date(objReservationDetails.ResScreenData.ResRows[5].ValueText);
let strAryMonth = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
if (strDate != 'undefined') {
let strCreditCard = prompt('Please enter the credit card type \n AC: Alicredit \n WC: Wechatcredit \n GC: Great Wall Card \n UC: UnionPay ', 'WC');
strCreditCard = strCreditCard.toUpperCase();
if (strCreditCard.match('AC'))
strCreditCard = 'Alicredit';
else if (strCreditCard.match('WC'))
strCreditCard = 'Wechatcredit';
else if (strCreditCard.match('GC'))
strCreditCard = 'Great Wall Card';
else if (strCreditCard.match('UC'))
strCreditCard = 'UnionPay';
else {
strCreditCard = 'undefined'
alert('无法识别信用卡类别,仅支持AC(ali),WC(Wechatcredit),GC(Great Wall Card),UC(UnionPay)');
bIfContinue = false;
}
let objAryCCList = JSON.parse(window.localStorage.getItem('CreditCardList'));
for (let nCounter = 0; nCounter < objAryCCList.length; nCounter++) {
if (objAryCCList[nCounter].CreditCard == strCreditCard) {
nCreditCardId = objAryCCList[nCounter].CardId;
}
}
if (nCreditCardId == 0) {
alert('无法识别信用卡类别,请重试');
bIfContinue = false;
}
}
if (bIfContinue) {
let nAmount = fAryAccountBalance[5];
nAmount = prompt('Please Check the amount of receipt', nAmount);
let jobj = {
"ReceiptType": 4,
"Source": 3000,
"DateOfReceiptOverride": strDate.getDate() + ' ' + strAryMonth[strDate.getMonth()] + ' ' + strDate.getFullYear(),
"CreditCardNumber": "",
"CreditCardExpiry": "",
"NameOnCreditCard": " ",
"CreditCardId": nCreditCardId,
"CreditCardCCVNo": "",
"lstOfAccountsToPay":
[{
"AccountType": 1,
"ReceiptAmount": nAmount,
"SecondCurrency": 0,
"AccountNo": objReservationDetails.ResScreenData.AccountId,
"ManualChargeAllocationTransIds": [],
"InvoiceNo": 0,
"ExchangeRateOverridden": 0
}],
"Tip": 0,
"Comment": '',
"JournalId": "",
"DateBanked": strDate.getDate() + ' ' + strAryMonth[strDate.getMonth()] + ' ' + strDate.getFullYear(),
"Drawer": "",
"Tendered": 0,
"ChequeNo": "",
"Bank": "",
"CreditCardTransactionFeeType": 0,
"Branch": "",
"PostCode": "",
"State": "",
"StreetNo": null,
"Authorization": "",
"PropertyId": JSON.parse(window.localStorage.getItem('RM_Property')).data.split('_')[0],
"EFTPOSStationNo": "",
"EftposTerminalId": 0,
"TokenId": 0,
"DemoOrInternal": false,
"ExcludeOnlinePayment": false,
"IgnoreARAllocationCheck": false,
"SecurityDeposit": false,
"CurrencyCode": "¥",
"Addr1": "",
"Addr2": "",
"ClientResidence": 0,
"ExchangeRateId": 0,
"GatewayProvider": 13,
"ClientId": objReservationDetails.ResScreenData.ClientId,
"CreditCardFee": 0,
"UsingEFTPOSTerminal": false,
"Token": "",
"ResId": objReservationDetails.ResScreenData.ResId,
"CompId": 0,
"AgentId": 0,
"PayByLinkOption": 0,
"PayByLinkFrom": "",
"PayByLinkTo": "",
"PayByLinkEntityId": "",
"PayByLinkEntityType": "",
"PayByLinkLetterId": 0
}
console.log(jobj);
if (1) {
let xmlhttp = new XMLHttpRequest();
xmlhttp.open("POST", "https://app9.rmscloud.cn/api/Receipt/ProcessReceiptOnAccountScreen", true);
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
let objParam = {
"strName": "fnCallBackAutoReceipt",
"objValue": null,
"bIfContinue": true,
"strErrorDescription": ""
}
window.postMessage(objParam);
}
}
xmlhttp.setRequestHeader('content-Type', 'application/json; charset=utf-8');
xmlhttp.send(JSON.stringify(jobj));
}
}
}
}
function fnCancelInvoiceNumber(nInvoiceNumber) {
let xmlhttp = new XMLHttpRequest();
xmlhttp.open("POST", "https://app9.rmscloud.cn/api/TaxInvoice/CancelTaxInvoice", true);
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
console.log('账单号已清理');
console.log(xmlhttp.responseText);
let objParam = {
"strName": "fnCallBackCancelInvoiceNumber",
"objValue": null,
"bIfContinue": true,
"strErrorDescription": null
}
window.postMessage(objParam);
}
}
let objParam = {
"InvoiceNo": nInvoiceNumber,
"PropertyId": JSON.parse(window.localStorage.getItem('RM_Property')).data.split('_')[0],
"ReasonId": 47
}
xmlhttp.setRequestHeader('content-Type', 'application/json; charset=utf-8');
xmlhttp.send(JSON.stringify(objParam));
console.log('fnCancelInvoice is going');
}
function fnGetInvoiceNumber( objReservationDetails)
{
let xmlhttp = new XMLHttpRequest();
xmlhttp.open("POST","https://app9.rmscloud.cn/api/TaxInvoice/TaxInvoiceScreenData",true);
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4)
{
if(xmlhttp.status==200){
console.log(xmlhttp.responseText);
if(JSON.parse(xmlhttp.responseText).TaxInvoiceScreenData.TaxInvoices.length ==1)
{
let objParam = {
"strName": "fnCallBackGetInvoiceNumber",
"objValue": '',
"bIfContinue":true
}
window.objGlobalParam.nInvoiceNumber= JSON.parse(xmlhttp.responseText).TaxInvoiceScreenData.TaxInvoices[0].InvoiceNo;
window.postMessage(objParam);
}
else if(JSON.parse(xmlhttp.responseText).TaxInvoiceScreenData.TaxInvoices.length >1 )
{
let objParam = {
"strName": "fnCallBackGetInvoiceNumber",
"objValue": null,
"bIfContinue":true,
"strErrorDescription":"多余一个账单号,请手动操作"
}
window.postMessage(objParam);
}
else if(JSON.parse(xmlhttp.responseText).TaxInvoiceScreenData.TaxInvoices.length ==0 )
{
let objParam = {
"strName": "fnCallBackGetInvoiceNumber",
"objValue": null,
"bIfContinue":true,
"strErrorDescription":"无账单号"
}
window.postMessage(objParam);
}
}
}
}
let objParam = {
"AccNo": objReservationDetails.ResScreenData.AccountId,
"AccType":1,
"PropertyId":JSON.parse(window.localStorage.getItem('RM_Property')).data.split('_')[0],
"ResId":objReservationDetails.ResScreenData.ResId
};
xmlhttp.setRequestHeader('content-Type','application/json; charset=utf-8');
xmlhttp.send(JSON.stringify(objParam));
}
function fnGetAccountBalance( objReservationDetails)
{
let objAryAccountRows= objReservationDetails.ResScreenData.AccountRows;
let ACCOMM= 0;
let INCIDENTALS= 1;
let FOLIO3= 2;
let BONDS= 3;
let FOLIO5= 4;
let SUM= 5;
let fAryAccountBalance= new Array(6);
fAryAccountBalance[SUM]= 0.00;
for(let nCounter= 0; nCounter< objAryAccountRows.length; nCounter++)
{
if( objAryAccountRows[nCounter].Identifier== "Acc_General")
{
if(objAryAccountRows[nCounter].ValueText.match(','))
objAryAccountRows[nCounter].ValueText= objAryAccountRows[nCounter].ValueText.replace(',','')
fAryAccountBalance[ACCOMM]= parseFloat(objAryAccountRows[nCounter].ValueText);
fAryAccountBalance[SUM] += parseFloat(objAryAccountRows[nCounter].ValueText)
}
else if( objAryAccountRows[nCounter].Identifier== "Acc_Extras")
{
if(objAryAccountRows[nCounter].ValueText.match(','))
objAryAccountRows[nCounter].ValueText= objAryAccountRows[nCounter].ValueText.replace(',','')
fAryAccountBalance[INCIDENTALS]= parseFloat(objAryAccountRows[nCounter].ValueText);
fAryAccountBalance[SUM] += parseFloat(objAryAccountRows[nCounter].ValueText)
}
else if( objAryAccountRows[nCounter].Identifier== "Acc_Gas")
{
if(objAryAccountRows[nCounter].ValueText.match(','))
objAryAccountRows[nCounter].ValueText= objAryAccountRows[nCounter].ValueText.replace(',','')
fAryAccountBalance[FOLIO3]= parseFloat(objAryAccountRows[nCounter].ValueText);
fAryAccountBalance[SUM] += parseFloat(objAryAccountRows[nCounter].ValueText)
}
else if( objAryAccountRows[nCounter].Identifier== "Acc_Electricity")
{
if(objAryAccountRows[nCounter].ValueText.match(','))
objAryAccountRows[nCounter].ValueText= objAryAccountRows[nCounter].ValueText.replace(',','')
fAryAccountBalance[BONDS]= parseFloat(objAryAccountRows[nCounter].ValueText);
fAryAccountBalance[SUM] += parseFloat(objAryAccountRows[nCounter].ValueText)
}
else if( objAryAccountRows[nCounter].Identifier== "Acc_Water")
{
if(objAryAccountRows[nCounter].ValueText.match(','))
objAryAccountRows[nCounter].ValueText= objAryAccountRows[nCounter].ValueText.replace(',','')
fAryAccountBalance[FOLIO5]= parseFloat(objAryAccountRows[nCounter].ValueText);
fAryAccountBalance[SUM] += parseFloat(objAryAccountRows[nCounter].ValueText)
}
}
console.log("get account balance");
window.objGlobalParam.fAryAccountBalance = fAryAccountBalance;
return fAryAccountBalance;
}
function fnParseFromRmNum2ResNum(nRmNum, AryObjInhouseReservationList) {
let objCurrentRes = new Object();
while (AryObjInhouseReservationList.length) {
objCurrentRes = AryObjInhouseReservationList.pop();
if (parseInt(objCurrentRes.Area.split(" ")[0]) == parseInt(nRmNum)) {
window.objGlobalParam.nReservationId = objCurrentRes.ResId;
return objCurrentRes.ResId;
}
};
return -1;
}
function fnGetInhouseReservationList() {
let date = new Date();
let strSymble1;
let strSymble2;
if (parseInt(date.getMonth()) < 9) {
strSymble1 = '-0';
}
else
strSymble1 = '-';
if (parseInt(date.getDate()) < 10) {
strSymble2 = '-0';
}
else
strSymble2 = '-';
let objParam = {
"FromDate": date.getFullYear() + strSymble1
+ parseInt(date.getMonth() + 1) + strSymble2
+ date.getDate(),
"ToDate": date.getFullYear() + strSymble1
+ parseInt(date.getMonth() + 1) + strSymble2
+ date.getDate(),
"OnlyShowPrimaryClient": true,
"ShowGroupMasterOnly": false,
"Properties": [254],
"BookingTypeId": 0,
"ReportView": 3,
"ResView": 0,
"CatGrpIds": [],
"CatIds": []
}
let xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
console.log("fnGetInhouseReservationList: ");
console.log(xmlhttp.responseText);
window.objParam = null;
window.objParam = (xmlhttp.responseText);
let objParam = {
"strName": "fnCallBackGetInhouseReservationList",
"objValue": JSON.parse(xmlhttp.responseText).InOutData,
"bIfContinue": true
}
window.objGlobalParam.objAryInOutData = JSON.parse(xmlhttp.responseText).InOutData;
window.postMessage(objParam);
}
}
xmlhttp.open("POST", "https://app9.rmscloud.cn/api/Reservation/InOutScreen/RetrieveScreenData");
xmlhttp.setRequestHeader('content-Type', 'application/json; charset=utf-8');
xmlhttp.send(JSON.stringify(objParam));
}
console.log("get reservation list");
function fnGetReservationDetails(nResNumber) {
let xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
console.log("fnGetReservationDetails: ");
console.log(xmlhttp.responseText);
let objParam = {
"strName": "fnCallBackGetReservationDetails",
"objValue": JSON.parse(xmlhttp.responseText),
"bIfContinue": 1
}
window.objGlobalParam.objReservationDetails = JSON.parse(xmlhttp.responseText);
window.postMessage(objParam);
}
}
xmlhttp.open("POST", "https://app9.rmscloud.cn/api/ReservationService/ReservationScreenData" +
"?bEventBooking=false&bShowCancelled=true&bUsePreviousTypeOfBooking=false&nGrpResId=0&nResId=" + nResNumber);
xmlhttp.setRequestHeader('content-Type', 'application/json; charset=utf-8');
xmlhttp.send();
}
function fnOnMsg(msg) {
if (!msg.data.bIfContinue) {
alert(msg.strErrorDescription);
window.onmessage = window.fnOldOnmessage;
window.sessionStorage.removeItem('aryStrTaskName');
window.fnOldOnmessage = null;
window.objGlobalParam = null;
}
else if (msg.data.strName.match('fnCallBackGetInhouseReservationList') ||
msg.data.strName.match('fnCallBackGetAccountBalance') ||
msg.data.strName.match('fnCallBackParseFromRmNum2ResNum') ||
msg.data.strName.match('fnCallBackGetInvoiceNumber') ||
msg.data.strName.match('fnCallBackCancelInvoiceNumber') ||
msg.data.strName.match('fnCallBackAutoReceipt') ||
msg.data.strName.match('fnCallBackCreateInvoice') ||
msg.data.strName.match('start') ||
msg.data.strName.match('fnCallBackCheckOut') ||
msg.data.strName.match('fnCallBackGetReservationDetails')
) {
let aryStrTaskName = window.sessionStorage.getItem('aryStrTaskName').split(',');
switch (aryStrTaskName.pop())
{
case "End":
window.onmessage = window.fnOldMainOnmessage;
window.sessionStorage.removeItem('aryStrTaskName');
window.fnOldMainOnmessage = null;
objParam = null;
objMsg = null;
window.objGlobalParam= null;
break;
case "fnGetInhouseReservationList":
fnGetInhouseReservationList(msg.data);
window.sessionStorage.setItem('aryStrTaskName', aryStrTaskName);
break;
case "fnParseFromRmNum2ResNum":
msg.data.name = "fnCallBackParseFromRmNum2ResNum"
fnParseFromRmNum2ResNum(parseInt(prompt("请输入房间号", "")), window.objGlobalParam.objAryInOutData);
window.sessionStorage.setItem('aryStrTaskName', aryStrTaskName);
window.postMessage(msg.data);
break;
case "fnGetReservationDetails":
fnGetReservationDetails(window.objGlobalParam.nReservationId);
window.sessionStorage.setItem('aryStrTaskName', aryStrTaskName);
break;
case "fnGetAccountBalance":
msg.data.strName = "fnCallBackGetAccountBalance";
msg.data.bIfContinue = true;
fnGetAccountBalance(window.objGlobalParam.objReservationDetails);
window.sessionStorage.setItem('aryStrTaskName', aryStrTaskName);
window.postMessage(msg.data);
break;
case "fnGetInvoiceNumber":
if(window.objGlobalParam.fAryAccountBalance[5]!= 0)
fnGetInvoiceNumber(window.objGlobalParam.objReservationDetails);
else
{
msg.data.name= "fnCallBackGetInvoiceNumber";
msg.data.bIfContinue= true;
postMessage(msg.data);
}
window.sessionStorage.setItem('aryStrTaskName', aryStrTaskName);
break;
case "fnCancelInvoiceNumber":
if (window.objGlobalParam.nInvoiceNumber)
fnCancelInvoiceNumber(window.objGlobalParam.nInvoiceNumber);
else
{
msg.data.name= "fnCallBackCancelInvoiceNumber";
msg.data.bIfContinue= true;
postMessage(msg.data);
}
window.sessionStorage.setItem('aryStrTaskName', aryStrTaskName);
break;
case "fnAutoReceipt":
if(window.objGlobalParam.fAryAccountBalance[5]!= 0)
fnAutoReceipt(window.objGlobalParam.objReservationDetails,window.objGlobalParam.fAryAccountBalance);
else
{
msg.data.name= "fnCallBackAutoReceipt";
msg.data.bIfContinue= true;
postMessage(msg.data);
}
window.sessionStorage.setItem('aryStrTaskName', aryStrTaskName);
break;
case "fnCreateInvoice":
if(window.objGlobalParam.fAryAccountBalance[5]!= 0)
fnCreateInvoice(window.objGlobalParam.objReservationDetails);
else
{
msg.data.name= "fnCallBackCreateInvoice";
msg.data.bIfContinue= true;
postMessage(msg.data);
}
window.sessionStorage.setItem('aryStrTaskName', aryStrTaskName);
break;
case "fnCheckOut":
if (msg.data.nValue != -1)
fnCheckOut(window.objGlobalParam.nReservationId);
else {
let objParam = {
"strName": "fnCallBackCheckOut",
"objValue": null,
"bIfContinue": false,
"strErrorDescription": "未找到房间"
}
window.sessionStorage.setItem('aryStrTaskName', aryStrTaskName);
window.postMessage(objParam);
}
window.sessionStorage.setItem('aryStrTaskName', aryStrTaskName);
break;
}
}
else if (window.fnOldMainOnmessage != null)
window.fnOldMainOnmessage(msg);
}
function fnMain() {
window.fnOldMainOnmessage = window.onmessage;
window.onmessage = fnOnMsg;
window.sessionStorage.setItem('aryStrTaskName',
"End," +
"fnCheckOut," +
"fnCreateInvoice," +
"fnAutoReceipt," +
"fnCancelInvoiceNumber," +
"fnGetInvoiceNumber," +
"fnGetAccountBalance," +
"fnGetReservationDetails," +
"fnParseFromRmNum2ResNum," +
"fnGetInhouseReservationList");
let objMainMsg = {
"objParam": '',
"bIfContinue": 1,
"strErrorDescription": '',
"strName": 'start'
}
objMainMsg.objParam.nParam = 0;
window.objGlobalParam = new Object();
window.objGlobalParam.nAccountType = 1;
window.postMessage(objMainMsg);
}
fnMain();