2649 lines
153 KiB
C#
2649 lines
153 KiB
C#
//#20171227 인천공항 포스연동 start, phj
|
|
//#20171227 인천공항 포스연동 end, phj
|
|
|
|
using System;
|
|
using System.Collections;
|
|
using Cosmos.UserFrame;
|
|
using Cosmos.ServiceProvider;
|
|
using Cosmos.Common;
|
|
using Cosmos.CommonManager;
|
|
using System.Text;
|
|
|
|
using System.Runtime.InteropServices;
|
|
using System.IO;
|
|
using System.Data.OleDb;
|
|
using System.Data;
|
|
using System.Xml;
|
|
using ADODB;
|
|
using System.Reflection;
|
|
using PosDBApi;
|
|
using Cosmos.BaseFrame;
|
|
|
|
|
|
/*-----------------------------------------------------------------------------------------------*/
|
|
// 설 명 : 인천공항 데이터 연동 함수모음
|
|
/*-----------------------------------------------------------------------------------------------*/
|
|
namespace Cosmos.Service
|
|
{
|
|
class AirPortTran : PaymentBase, IAirPortTran
|
|
//class AirPortTran : IAirPortTran
|
|
{
|
|
#region 생산자
|
|
public static PosDBApiImp posapi = null;
|
|
|
|
//private SManager sManager = new SManager(); // 이 객체를 통해 업무 Service 호출
|
|
//private StateServer StateObject = (StateServer)StateServer.GetInstance(); // StateObject : StateServer Object (객체)
|
|
//private PosStatus m_cPosStatus = new PosStatus(); // 기본정보 참조
|
|
//private TranStatus m_cTrnStatus = new TranStatus(); // 거래정보 참조
|
|
//private DeviceStatus m_cDevStatus = new DeviceStatus(); // 디바이스 관리
|
|
//private IDataCommonUs m_cDataCommon = null; // POS 공통함수 인터페이스
|
|
//private IDataProcessUs m_cDataService = null; // 거래데이터 합계금액 계산 및 관리
|
|
//private ISaleCompleteUs m_cSaleComplete = null;
|
|
//private ISalePluItemUs m_cPluService = null; // 판매 등록 관리
|
|
|
|
//#20180117 돈통오픈 start,phj
|
|
private ICashdrawerUs m_cCashDrawer = null;
|
|
//#20180117 돈통오픈 start,phj
|
|
|
|
//#20180119 로직변경 start,phj
|
|
private IPaymentUs m_cPaymentUs = null; // 현금 결제 클레스
|
|
//#20180119 로직변경 end,phj
|
|
|
|
/// <summary>
|
|
/// 현재 등록중인 결제 정보
|
|
/// </summary>
|
|
public AirPortTran()
|
|
{
|
|
posapi = new PosDBApiImp();
|
|
|
|
m_cPosStatus = (PosStatus)StateObject.POS; // POS 기본정보
|
|
m_cTrnStatus = (TranStatus)StateObject.TRAN; // POS 거래정보
|
|
//m_cDevStatus = (DeviceStatus)StateObject.TRAN; // 디바이스 관리
|
|
//m_cDataService = (IDataProcessUs)sManager.InitServiceInstance(ServiceLists.ASV_DATA_PROCESS.DLL, ServiceLists.ASV_DATA_PROCESS.DATA_SERVICE);
|
|
//m_cDataCommon = (IDataCommonUs)sManager.InitServiceInstance(ServiceLists.ASV_DATA_PROCESS.DLL, ServiceLists.ASV_DATA_PROCESS.DATA_COMMON);
|
|
//m_cSaleComplete = (ISaleCompleteUs)sManager.InitServiceInstance(ServiceLists.ASV_DATA_PROCESS.DLL, ServiceLists.ASV_DATA_PROCESS.SALE_COMPLETE);
|
|
//m_cPluService = (ISalePluItemUs)sManager.InitServiceInstance(ServiceLists.BSV_SALE.DLL, ServiceLists.BSV_SALE.SALE_PLU_ITEM);
|
|
|
|
//#20180117 돈통오픈 start,phj
|
|
m_cCashDrawer = (ICashdrawerUs)sManager.InitServiceInstance(ServiceLists.AGENT_OLEDEVICE.DLL, ServiceLists.AGENT_OLEDEVICE.DEVICE_CASHDRAWER);
|
|
//#20180117 돈통오픈 start,phj
|
|
|
|
//#20180119 로직변경 start,phj
|
|
m_cPaymentUs = (IPaymentUs)sManager.InitServiceInstance(ServiceLists.BSV_PAYMENT.DLL, ServiceLists.BSV_PAYMENT.CASH);
|
|
//#20180119 로직변경 end,phj
|
|
|
|
}
|
|
#endregion
|
|
|
|
#region 인천공항 DLL 로딩
|
|
private int i_AirPort_Pos_Create()
|
|
{
|
|
int iRet = -1;
|
|
|
|
try
|
|
{
|
|
if (posapi != null)
|
|
{
|
|
iRet = 1;
|
|
}
|
|
else
|
|
{
|
|
posapi = new PosDBApiImp();
|
|
}
|
|
|
|
return iRet;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** IncheonAirport DLL Loading Error : (" + iRet + ") " + ex.Message);
|
|
|
|
return iRet;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 인천공항 POS DB Connect
|
|
private int i_Airport_Start()
|
|
{
|
|
int iRet = -1;
|
|
|
|
string AirportIP = string.Empty;
|
|
string AirPortUser = string.Empty;
|
|
string AirportPass = string.Empty;
|
|
|
|
AirportIP = m_cPosStatus.IncheonAirport.AirportIP;
|
|
AirPortUser = m_cPosStatus.IncheonAirport.AirportUser;
|
|
AirportPass = m_cPosStatus.IncheonAirport.AirportPass;
|
|
|
|
if (AirportIP == "" || AirPortUser == "" || AirportPass == "")
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** IncheonAirport DB Connect - No Information ");
|
|
|
|
WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0746);
|
|
|
|
return iRet;
|
|
}
|
|
else
|
|
{
|
|
try
|
|
{
|
|
// 인천공항 PosDBApi.dll 파일 존재 여부 검사
|
|
if (b_AirPort_Pos_FileExist() == false) return iRet;
|
|
|
|
|
|
// PosDBConnect( int 리턴 )
|
|
// *************************************************
|
|
// 0. 통합POS DB접속 함수
|
|
// 1. 파라미터 - sPosIP : 통합 포스의 IP 정보
|
|
// - sUser : 통합 포스의 접속 계정
|
|
// - sPass : 통합 포스의 접속 계정 암호
|
|
// 2. 리턴 - 1 : 성공
|
|
// - 0 : 실패
|
|
// *************************************************
|
|
|
|
if (posapi != null)
|
|
{
|
|
iRet = posapi.PosDBConnect(AirportIP, AirPortUser, AirportPass);
|
|
}
|
|
else
|
|
{
|
|
// dll 로딩이 안된 경우를 대비해서 한번 더 체크
|
|
if (i_AirPort_Pos_Create() != 1)
|
|
{
|
|
if (posapi != null)
|
|
{
|
|
iRet = posapi.PosDBConnect(AirportIP, AirPortUser, AirportPass);
|
|
}
|
|
}
|
|
}
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** IncheonAirport DB Connect - " + iRet.ToString() + " (0 : FAIL, 1 : SUCCESS)");
|
|
|
|
if (iRet != 1) WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0747);
|
|
|
|
return iRet;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** IncheonAirport DB Connect Error - " + iRet.ToString() + " (0 : FAIL, 1 : SUCCESS) " + ex.Message);
|
|
|
|
return iRet;
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 인천공항 POS DB DisConnect
|
|
private int i_AirPort_End()
|
|
{
|
|
int iRet = -1;
|
|
|
|
try
|
|
{
|
|
// 인천공항 PosDBApi.dll / PosDBApi.tlb 파일 존재 여부 검사
|
|
if (b_AirPort_Pos_FileExist() == false) return iRet;
|
|
|
|
// PosDBDisConnect( int 리턴 )
|
|
// *************************************************
|
|
// 0. 통합POS DB접속 해제 함수
|
|
// 1. 파라미터없음
|
|
// 2. 리턴 - 1 : 성공
|
|
// - 0 : 실패
|
|
// *************************************************
|
|
if (posapi != null)
|
|
{
|
|
iRet = posapi.PosDBDisConnect();
|
|
}
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** IncheonAirpot DB Disconnect Result : " + iRet + " (0 : FAIL, 1 : SUCCESS)");
|
|
|
|
return iRet;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** IncheonAirpot DB Disconnect Error : (" + iRet + ") " + ex.Message);
|
|
|
|
return iRet;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 인천공항 통합POS에서 판매일자, 빌번호의 거래상태 조회
|
|
private int i_AirPort_PosGetSalesTrStatus(string pSaleDt, string pBillNo)
|
|
{
|
|
int iRet = -1;
|
|
|
|
try
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** Bill state Search Start ! SaleData : " + pSaleDt + " , BillNo : " + pBillNo);
|
|
|
|
// 인천공항 PosDBApi.dll / PosDBApi.tlb 파일 존재 여부 검사
|
|
if (b_AirPort_Pos_FileExist() == false) return iRet;
|
|
|
|
// 통합POS에서 판매일자, 빌번호의 거래상태 조회
|
|
// PosGetSalesTrStatus( int 리턴 )
|
|
// *************************************************
|
|
// 0. 통합POS에서 해당빌 거래 상태 조회 함수
|
|
// 1. 파라미터 - SALE_DT : 판매일자(8)
|
|
// - BILL_NO : 입주사영수증번호(30)
|
|
// 2. 리턴 - 300 : 결제 가능
|
|
// - 301 : 결제 취소 된 항목으로 결제 할 수 있음
|
|
// - 302 : 통합 포스에서 결제하기 위해 준비 중
|
|
// - 303 : 통합 포스에서 이미 결제 된 항목
|
|
// - 304 : 해당 값이 없는 경우
|
|
// - 1000 : 기타 에러
|
|
// *************************************************
|
|
iRet = posapi.PosGetSalesTrStatus(pSaleDt, pBillNo);
|
|
|
|
#region PosGetSalesTrStatus MSG
|
|
string sRet = string.Empty;
|
|
switch (iRet)
|
|
{
|
|
case 300:
|
|
{
|
|
sRet = "결제가능";
|
|
break;
|
|
}
|
|
case 301:
|
|
{
|
|
sRet = "결제취소 된 항목으로 결제 할 수 없음";
|
|
break;
|
|
}
|
|
case 302:
|
|
{
|
|
sRet = "통합포스에서 결제하기 위해 준비 중";
|
|
break;
|
|
}
|
|
case 303:
|
|
{
|
|
sRet = "통합포스에서 이미 결제 된 항목";
|
|
break;
|
|
}
|
|
case 304:
|
|
{
|
|
sRet = "해당 값이 없는 경우";
|
|
break;
|
|
}
|
|
case 1000:
|
|
{
|
|
sRet = "기타에러";
|
|
break;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** Bill state Search End ! result : " + iRet + " , result Msg : " + sRet);
|
|
return iRet;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** Bill state Search Error ! " + ex.Message);
|
|
|
|
return iRet;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 인천공항 통합POS로 결제 리스트 전송
|
|
private int i_AirPort_Pos_Sale_TRAN()
|
|
{
|
|
int iRet = 1;
|
|
int iSeq = 0;
|
|
string sPayCode = string.Empty;
|
|
string sCashbill = string.Empty;
|
|
|
|
try
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** Send Pay-List to IncheonAirport POS Start!");
|
|
|
|
#region 결제 건 수 없을 때
|
|
// 결제 리스트
|
|
ArrayList alPayItem = (ArrayList)StateObject.GetItemObject(Column.TR_PAYMENT.ITEM);
|
|
// 결제 건 수 없을 때
|
|
if (alPayItem.Count == 0 || alPayItem == null)
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** Send Pay-List to IncheonAirport POS - no Pay-List");
|
|
return 1;
|
|
}
|
|
#endregion
|
|
|
|
#region 인천공항 통합POS로 결제 리스트 전송
|
|
for (int iRow = 0; iRow < alPayItem.Count; iRow++)
|
|
{
|
|
Column.TR_PAYMENT.DATA cPayItem = (Column.TR_PAYMENT.DATA)alPayItem[iRow];
|
|
|
|
if ((cPayItem.PAY_WAY_CD == ItemConst.TR_ITEM_ID.CREDITCARD_ITEM && cPayItem.PAY_DTL_CD_01 == ItemConst.TR_ITEM_ID.CREDITCARD.CREDIT_CARD) || //카드
|
|
((cPayItem.PAY_WAY_CD == ItemConst.TR_ITEM_ID.CASH_ITEM && cPayItem.PAY_DTL_CD_01 == ItemConst.TR_ITEM_ID.CASH.CASH_PAY) || //현금
|
|
(cPayItem.PAY_WAY_CD == ItemConst.TR_ITEM_ID.FOREIGNEX_ITEM) ||//외화
|
|
(cPayItem.PAY_WAY_CD == ItemConst.TR_ITEM_ID.CHECK_ITEM))) //수표
|
|
continue;
|
|
if (cPayItem.CANCEL_DIV == PosConst.CANCEL_DIV.CANCEL) continue; // 취소 건너뛰기
|
|
|
|
//#20180130 BRK 경우, 이베이쿠폰이면 PAY_DTL_CD_03 체크안하도록 수정 start,PHJ
|
|
//기존
|
|
//if (cPayItem.PAY_DTL_CD_03 == "1") continue; // 1: 할인상품에적용 0: 할인상품에적용안함 <-- 할인이지만 결제처리 되는 건만 전송하기 위해서
|
|
|
|
//변경
|
|
if ((m_cTrnStatus.Head.CmpCd == "BRKR" && cPayItem.PAY_WAY_CD == ItemConst.TR_ITEM_ID.MOBILECON_ITEM && cPayItem.PAY_DTL_CD_01 == ItemConst.TR_ITEM_ID.MOBILECON.E_BAYCON) == false)
|
|
{
|
|
if (cPayItem.PAY_DTL_CD_03 == "1") continue; // 1: 할인상품에적용 0: 할인상품에적용안함 <-- 할인이지만 결제처리 되는 건만 전송하기 위해서
|
|
}
|
|
//#20180130 BRK 경우, 이베이쿠폰이면 PAY_DTL_CD_03 체크안하도록 수정 end,PHJ
|
|
|
|
//if (cPayItem.PAY_DTL_CD_05 != "1") continue; //결제만 (1: 결제, 2:할인)
|
|
|
|
iSeq = iSeq + 1; // 시퀀스
|
|
sPayCode = cPayItem.PAY_WAY_CD + cPayItem.PAY_DTL_CD_01; // 결제코드는 결제코드 + 상세코드로 보낸다.
|
|
if (cPayItem.OCCUR_ENTRY_21 == "1") // 현금영수증 1: Y, 0: N
|
|
{
|
|
sCashbill = "Y";
|
|
}
|
|
else
|
|
{
|
|
sCashbill = "N";
|
|
}
|
|
|
|
//#20180119 로직변경 start,phj
|
|
//기존
|
|
/*
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** Send Pay-List to IncheonAirport POS - PosSetEtcPayD : (BillNo :" + m_cPosStatus.Base.TradeNo + ", Seq :" + cPayItem.SEQ.ToString() + ", PayCd :" + sPayCode + ", CashYN :" + sCashbill + " , PayAmt : " + cPayItem.AMT_ENTRY_01.ToString() + ")");
|
|
|
|
*/
|
|
//변경
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** Send Pay-List to IncheonAirport POS - PosSetEtcPayD : (BillNo :" + m_cPosStatus.Base.TradeNo + ", Seq :" + iSeq.ToString() + ", PayCd :" + sPayCode + ", CashYN :" + sCashbill + " , PayAmt : " + cPayItem.AMT_ENTRY_01.ToString() + ")");
|
|
|
|
//#20180119 로직변경 end,phj
|
|
|
|
|
|
//*****************************************************************************************
|
|
//PosSetEtcPayD
|
|
//설명 : 본 함수는 입주사포스에서 기타결제 정보를 통합포스에 전달하기 위한 함수 이다
|
|
// 리턴 값이 0 or 1000 일 경우 PosGetLastErrorMsg 를 호출하여 메시지를 확인 한다
|
|
//리턴 : 1 - 성공
|
|
// 1000 - 기타 예외 에러 (PosGetLastErrorMsg 호출해서 메세지를 확인한다.)
|
|
//파라미터 : 판매일자 / 입주사거래번호 / 순번 / 기타결제코드 / 현금승인구분(Y/N) / 결제금액
|
|
//*****************************************************************************************
|
|
iRet = -1;
|
|
|
|
//#20180119 로직변경 start,phj
|
|
//기존
|
|
/*
|
|
iRet = posapi.PosSetEtcPayD(m_cTrnStatus.Head.SaleDate, //판매일자
|
|
m_cPosStatus.Base.TradeNo, //영수증 번호
|
|
//int.Parse(cPayItem.SEQ.ToString()), //결제 시퀀스
|
|
iSeq, //결제 시퀀스
|
|
sPayCode, //결제코드+상세코드
|
|
sCashbill, //현금영수증대상유무(발생번호21)
|
|
int.Parse(cPayItem.AMT_ENTRY_01.ToString())); //결제금액(금액항목1)
|
|
|
|
*/
|
|
//변경
|
|
iRet = posapi.PosSetEtcPayD(m_cTrnStatus.Head.SaleDate, //판매일자
|
|
m_cPosStatus.Base.TradeNo, //영수증 번호
|
|
//int.Parse(cPayItem.SEQ.ToString()), //결제 시퀀스
|
|
iSeq, //결제 시퀀스
|
|
sPayCode, //결제코드+상세코드
|
|
sCashbill, //현금영수증대상유무(발생번호21)
|
|
int.Parse(cPayItem.PAY_AMT.ToString())); //결제금액(금액항목1)
|
|
//#20180119 로직변경 end,phj
|
|
|
|
if (iRet == 1)
|
|
{
|
|
// 결제 리스트 전송 성공
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** Send Pay-List to IncheonAirport POS - PosSetEtcPayD Success! " + iRet.ToString());
|
|
}
|
|
else
|
|
{
|
|
// 결제 리스트 전송 실패
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** Send Pay-List to IncheonAirport POS - PosSetEtcPayD Failure! " + iRet.ToString());
|
|
}
|
|
|
|
if (iRet != 1) { break; }
|
|
}
|
|
#endregion
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** Send Pay-List to IncheonAirport POS End!");
|
|
|
|
return iRet;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** Send Pay-List to IncheonAirport POS - PosSetEtcPayD Error! [" + iRet.ToString() + "] " + ex.Message);
|
|
|
|
|
|
return iRet;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 인천공항 POS로 상품전송 후 컴플릿
|
|
private int i_PosSalesItemComplete()
|
|
{
|
|
int iRet = -1;
|
|
|
|
try
|
|
{
|
|
// 인천공항 pos에 판매 품목 등록 확정
|
|
// PosSalesItemComplete( int 리턴 )
|
|
// *************************************************
|
|
// 0. 통합POS에 판매 품목 등록 완료 함수
|
|
// 1. 파라미터 - SALE_DT : 판매일자(8)
|
|
// - BILL_NO : 입주사영수증번호(30)
|
|
// 2. 리턴 - 1 : 판매 정보 등록 성공
|
|
// - 500 : 입력한 파라메터 중 길이제한 오류
|
|
// - 700 : 등록하려는 품목 정보가 없는 경우
|
|
// - 100 : 이미 결제가 진행 중이거나, 결제 완료 된 품목정보가 있는 경우
|
|
// - 0 : 품목 정보 등록 실패
|
|
// *************************************************
|
|
iRet = i_AirPort_Pos_SaleItemComp(m_cTrnStatus.Head.SaleDate, m_cPosStatus.Base.TradeNo);
|
|
|
|
if (iRet == 1)
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** IncheonAirport Tran ItemComplete. Success! [" + iRet.ToString() + "]");
|
|
}
|
|
else
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** IncheonAirport Tran ItemComplete. Failure! [" + iRet.ToString() + "]");
|
|
}
|
|
|
|
return iRet;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** IncheonAirport Tran ItemComplete. Error! [" + iRet.ToString() + "] " + ex.Message);
|
|
|
|
return iRet;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
|
|
#region 인천공항 POS로 상품전송, 컴플릿
|
|
//private int i_AirPort_Pos_TRAN(string pAirPosCompCd, string pAirPosStorCd, string pAirPosPosNo)
|
|
private int i_AirPort_Pos_TRAN()
|
|
{
|
|
int iRet = -1;
|
|
|
|
|
|
int iSaleItemAddRslt = -1; // 인천공항포스에 상품등록한 결과 값.
|
|
int iSaleItemCnt = 0; // SPC포스에서 상품등록한 갯 수.
|
|
int iSaleItemAddCnt = 0; // 인천공항포스에 상품등록 성공한 갯 수.
|
|
|
|
int iCompleteRslt = -1; // 제품 등록 후 컴플리트 RESULT
|
|
int iPaylistTran = -1; // 결제 등록 후 컴플리트 RESULT
|
|
string sDcAmt = string.Empty; // 상품 할인 금액
|
|
|
|
#region 변수 초기화
|
|
string pSALE_DT = string.Empty;
|
|
string pBILL_NO = string.Empty;
|
|
string pSEQ = string.Empty;
|
|
string pITEM_CD = string.Empty;
|
|
string pITEM_NM = string.Empty;
|
|
string pQTY = string.Empty;
|
|
string pSALE_PRICE = string.Empty;
|
|
string pTOT_AMT = string.Empty;
|
|
string pSALE_AMT = string.Empty;
|
|
string pDC_AMT = string.Empty;
|
|
string pCOMP_CD = string.Empty;
|
|
string pSTOR_CD = string.Empty;
|
|
string pPOS_NO = string.Empty;
|
|
string pSTAY_DC_AMT = string.Empty;
|
|
string pDC_TYPE = string.Empty;
|
|
string pPROM_CD = string.Empty;
|
|
string pPROM_NM = string.Empty;
|
|
string pPROM_FR = string.Empty;
|
|
string pPROM_TO = string.Empty;
|
|
string pPROM_RATE_1 = string.Empty;
|
|
string pPROM_RATE_2 = string.Empty;
|
|
string pCounpNo = string.Empty;
|
|
#endregion
|
|
|
|
try
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** Send ItemList, PayList To IncheonAirport POS. Start (trade_no : " + m_cPosStatus.Base.TradeNo + ")");
|
|
|
|
|
|
#region SPCPOS 상품을 통합POS로 전송한다.
|
|
Column.TR_PLU.DATA cPluItem = null;
|
|
ArrayList alPluItem = (ArrayList)StateObject.GetItemObject(Column.TR_PLU.ITEM);
|
|
|
|
//#20180119 로직변경 start,phj
|
|
//기존
|
|
/*
|
|
#region SPC포스에서 등록된 상품이 있는지 체크한다.
|
|
if (alPluItem == null || alPluItem.Count <= 0)
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** No products to send! trade_no : " + m_cPosStatus.Base.TradeNo);
|
|
return iRet;
|
|
}
|
|
#endregion
|
|
*/
|
|
//#20180119 로직변경 end,phj
|
|
|
|
|
|
//#20180129 상품, 결제 전송 완료 후 컴플릿 하도록 수정 start,phj
|
|
bool bDcType = false;
|
|
//#20180129 상품, 결제 전송 완료 후 컴플릿 하도록 수정 end,phj
|
|
|
|
for (int i = 0; i < alPluItem.Count; i++)
|
|
{
|
|
cPluItem = (Column.TR_PLU.DATA)alPluItem[i];
|
|
|
|
if (cPluItem.CANCEL_DIV == PosConst.CANCEL_DIV.CANCEL || cPluItem.CANCEL_DIV_MAIN == PosConst.CANCEL_DIV.CANCEL) continue; // 지정취소
|
|
//if (cPluItem.ITEM_DIV != ItemConst.PLU_ITEM_DIV.NORMAL && cPluItem.ITEM_DIV != ItemConst.PLU_ITEM_DIV.SET_MAIN) continue; //
|
|
//if (cPluItem.BILLSPR_NO != m_cTrnStatus.Sale.BillSplitNo) continue; // 빌분리번호
|
|
//if (cPluItem.DC_PRMT_YN == "1") continue;
|
|
|
|
if (cPluItem.NONSALES_RSN_CD != "0") // 비매출구분
|
|
{
|
|
//SALE_QTY * SALE_PRC
|
|
double TempDcAmt = 0;
|
|
TempDcAmt = cPluItem.SALE_QTY * cPluItem.SALE_PRC;
|
|
sDcAmt = TempDcAmt.ToString();
|
|
}
|
|
else
|
|
{
|
|
// 할인금액 DC_RATE + DC_AMT
|
|
double TempDcAmt = 0;
|
|
/*
|
|
TempDcAmt = cPluItem.ITEM_DC_AMT // POS 단품 할인 금액
|
|
+ cPluItem.SUM_DC_AMT // POS 소계 할인 금액
|
|
+ cPluItem.CPI_DC_AMT // 캠페인 할인 금액
|
|
+ cPluItem.COOP_CARD_DC_AMT // 제휴카드 할인 금액(SKT,LGT,KT 할인 금액)
|
|
+ cPluItem.POINT_DC_AMT // 포인트 할인 금액
|
|
+ cPluItem.CPN_DC_AMT // 쿠폰 할인 금액
|
|
+ cPluItem.ETC_DC_AMT // 직원 할인 금액
|
|
+ cPluItem.SET_DC_AMT // 세트 할인 금액
|
|
+ cPluItem.EXCEP_DC_AMT; // 예외할인금액
|
|
*/
|
|
|
|
TempDcAmt = CmUtil.DoubleAdd(TempDcAmt, cPluItem.ITEM_DC_AMT); // 단품 할인 금액
|
|
TempDcAmt = CmUtil.DoubleAdd(TempDcAmt, cPluItem.SUM_DC_AMT); // 소계 할인 금액
|
|
TempDcAmt = CmUtil.DoubleAdd(TempDcAmt, cPluItem.CPI_DC_AMT); // 행사 할인 금액
|
|
TempDcAmt = CmUtil.DoubleAdd(TempDcAmt, cPluItem.COOP_CARD_DC_AMT); // 제휴카드 할인 금액
|
|
TempDcAmt = CmUtil.DoubleAdd(TempDcAmt, cPluItem.POINT_DC_AMT); // 포인트 할인 금액
|
|
TempDcAmt = CmUtil.DoubleAdd(TempDcAmt, cPluItem.CPN_DC_AMT); // 쿠폰 할인 금액
|
|
TempDcAmt = CmUtil.DoubleAdd(TempDcAmt, cPluItem.EMP_DC_AMT); // 직원 할인 금액
|
|
TempDcAmt = CmUtil.DoubleAdd(TempDcAmt, cPluItem.SET_DC_AMT); // 세트 할인 금액
|
|
TempDcAmt = CmUtil.DoubleAdd(TempDcAmt, cPluItem.ETC_DC_AMT); // 기타 할인 금액
|
|
TempDcAmt = CmUtil.DoubleAdd(TempDcAmt, cPluItem.EXCEP_DC_AMT); // 예외 할인 금액
|
|
|
|
sDcAmt = TempDcAmt.ToString();
|
|
|
|
//#20180129 상품, 결제 전송 완료 후 컴플릿 하도록 수정 start,phj
|
|
|
|
//#20180130 임의할인이고, 입점할인 경우만 할인유형 변경 start,phj
|
|
//기존
|
|
//if (cPluItem.DC_DIV.Substring(0,2) == "17")
|
|
//변경
|
|
if (cPluItem.DC_DIV.Substring(0, 4) == ItemConst.TR_ITEM_ID.USER_DC_ITEM + ItemConst.TR_ITEM_ID.USER_DC.IN_EMP_DC ||
|
|
cPluItem.DC_DIV.Substring(0, 4) == ItemConst.TR_ITEM_ID.USER_DC_ITEM + ItemConst.TR_ITEM_ID.USER_DC.IN_EMP_DC_5)
|
|
//#20180130 임의할인이고, 입점할인 경우만 할인유형 변경 end,phj
|
|
{
|
|
bDcType = true;
|
|
}
|
|
else
|
|
{
|
|
bDcType = false;
|
|
}
|
|
//#20180129 상품, 결제 전송 완료 후 컴플릿 하도록 수정 end,phj
|
|
|
|
}
|
|
|
|
iSaleItemCnt = iSaleItemCnt + 1;
|
|
|
|
#region 전송할 제품 정보 셋팅
|
|
pSALE_DT = m_cTrnStatus.Head.SaleDate; //판매일자(8)
|
|
pBILL_NO = m_cPosStatus.Base.TradeNo; //입주사거래번호(30)
|
|
pSEQ = iSaleItemCnt.ToString(); //순번(5)
|
|
pITEM_CD = cPluItem.ITEM_PLU_CD; //품목코드(30)
|
|
pITEM_NM = cPluItem.ITEM_NAME; //품목명(100)
|
|
pQTY = cPluItem.SALE_QTY.ToString(); //수량(5)
|
|
pSALE_PRICE = cPluItem.SALE_PRC.ToString(); //판매단가(9)
|
|
pTOT_AMT = cPluItem.SALE_AMT.ToString(); //총합계(9)
|
|
pSALE_AMT = cPluItem.BILL_AMT.ToString(); //실판매(9)
|
|
|
|
//#20180119 할인유형 원복 start
|
|
//기존
|
|
/*
|
|
//#20180117 할인유형 변경 start,phj
|
|
//pDC_AMT = sDcAmt; //할인(9) // 할인유형1 - SPC쪽 할인..
|
|
pDC_AMT = "0"; //할인(9) // 할인유형1 - SPC쪽 할인..
|
|
//#20180117 할인유형 변경 end,phj
|
|
*/
|
|
//변경
|
|
//pDC_AMT = sDcAmt; //할인(9) // 할인유형1 - SPC쪽 할인..
|
|
//#20180119 할인유형 원복 end
|
|
|
|
pCOMP_CD = m_cPosStatus.IncheonAirport.AirportComp; //입주사코드(10)
|
|
pSTOR_CD = m_cPosStatus.IncheonAirport.AirportStore; //매장코드(10)
|
|
pPOS_NO = m_cPosStatus.IncheonAirport.AirportPosNo; //POS번호(10)
|
|
|
|
//#20180119 할인유형 원복 start
|
|
//기존
|
|
/*
|
|
//#20180117 할인유형 변경 start,phj
|
|
//pSTAY_DC_AMT = "0"; // 할인유형2
|
|
pSTAY_DC_AMT = sDcAmt; // 할인유형2
|
|
//#20180117 할인유형 변경 start,phj
|
|
*/
|
|
//변경
|
|
//pSTAY_DC_AMT = "0"; // 할인유형2
|
|
//#20180119 할인유형 원복 end
|
|
|
|
//#20180119 할인유형 원복 start
|
|
//기존
|
|
/*
|
|
//#20180117 할인유형 변경 start,phj
|
|
//pDC_TYPE = "1"; // 1: 할인유형1, 2:할인유형2
|
|
pDC_TYPE = "2"; // 1: 할인유형1, 2:할인유형2
|
|
//#20180117 할인유형 변경 end,phj
|
|
*/
|
|
//변경
|
|
//pDC_TYPE = "1"; // 1: 할인유형1, 2:할인유형2
|
|
//#20180119 할인유형 원복 end
|
|
|
|
//#20180129 상품, 결제 전송 완료 후 컴플릿 하도록 수정 start,phj
|
|
if (bDcType == true)
|
|
{
|
|
pDC_TYPE = "2";
|
|
pSTAY_DC_AMT = sDcAmt;
|
|
pDC_AMT = "0";
|
|
}
|
|
else
|
|
{
|
|
pDC_TYPE = "1";
|
|
pSTAY_DC_AMT = "0";
|
|
pDC_AMT = sDcAmt;
|
|
}
|
|
//#20180129 상품, 결제 전송 완료 후 컴플릿 하도록 수정 end,phj
|
|
|
|
pPROM_CD = "";
|
|
pPROM_NM = "";
|
|
pPROM_FR = "";
|
|
pPROM_TO = "";
|
|
pPROM_RATE_1 = "0";
|
|
pPROM_RATE_2 = "0";
|
|
pCounpNo = "";
|
|
#endregion
|
|
|
|
#region 상품전송 (i_AirPort_Pos_SaleItemAdd)
|
|
|
|
iSaleItemAddRslt = i_AirPort_Pos_SaleItemAdd(pSALE_DT, pBILL_NO, pSEQ, pITEM_CD, pITEM_NM, pQTY,
|
|
pSALE_PRICE, pTOT_AMT, pSALE_AMT, pDC_AMT, pCOMP_CD, pSTOR_CD,
|
|
pPOS_NO, pSTAY_DC_AMT, pDC_TYPE, pPROM_CD, pPROM_NM, pPROM_FR,
|
|
pPROM_TO, pPROM_RATE_1, pPROM_RATE_2, pCounpNo);
|
|
|
|
if (iSaleItemAddRslt == 1)
|
|
{
|
|
iSaleItemAddCnt = iSaleItemAddCnt + 1;// 상품 등록 성공한 횟수
|
|
}
|
|
// 제품등록 실패하면
|
|
else
|
|
{
|
|
if (iSaleItemAddRslt == 600)
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** Send products-List of SPCPOS to Incheon Airport POS. failure! no products! Item : " + pITEM_NM + ", Result : " + iSaleItemAddRslt.ToString());
|
|
}
|
|
else
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** Send products-List of SPCPOS to Incheon Airport POS. failure! Item : " + pITEM_NM + ", Result : " + iSaleItemAddRslt.ToString());
|
|
}
|
|
|
|
break;
|
|
}
|
|
#endregion
|
|
}
|
|
#endregion
|
|
|
|
#region 1. SPC포스에서 찍은 상품 갯수와 통합포스로 전송 성공한 갯수가 같은지 체크한다.
|
|
if (iSaleItemCnt == iSaleItemAddCnt)
|
|
{
|
|
|
|
//#20180129 상품, 결제 전송 완료 후 컴플릿 하도록 수정 start,phj
|
|
//기존
|
|
#region 주석처리
|
|
/*
|
|
#region 2. 통합포스로 상품 전송 완료 후 컴플릿 함수를 시도한다.
|
|
iCompleteRslt = i_PosSalesItemComplete();
|
|
|
|
if (iCompleteRslt == 1)
|
|
{
|
|
//WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0748);
|
|
|
|
#region 2. SPC포스에서 통합POS로 결제 리스트를 전송한다.
|
|
iPaylistTran = i_AirPort_Pos_Sale_TRAN();
|
|
|
|
if (iPaylistTran == 1)
|
|
{
|
|
//WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0750);
|
|
iRet = iPaylistTran;
|
|
}
|
|
else
|
|
{
|
|
WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0751);
|
|
}
|
|
#endregion
|
|
}
|
|
else
|
|
{
|
|
WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0749);
|
|
}
|
|
#endregion
|
|
*/
|
|
#endregion
|
|
|
|
//변경
|
|
//상품 전송 후 결제 리스트 전송.
|
|
//이후에 컴플릿!!!
|
|
iPaylistTran = i_AirPort_Pos_Sale_TRAN();
|
|
if (iPaylistTran == 1)
|
|
{
|
|
//컴플릿!!!
|
|
iCompleteRslt = i_PosSalesItemComplete();
|
|
}
|
|
iRet = iCompleteRslt;
|
|
if (iRet != 1)
|
|
{
|
|
//WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0749);
|
|
WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0751);
|
|
}
|
|
//#20180129 상품, 결제 전송 완료 후 컴플릿 하도록 수정 end,phj
|
|
}
|
|
else
|
|
{
|
|
//#20180129 상품, 결제 전송 완료 후 컴플릿 하도록 수정 start,phj
|
|
//iCompleteRslt = i_PosSalesItemComplete();
|
|
//#20180129 상품, 결제 전송 완료 후 컴플릿 하도록 수정 end,phj
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** Send products-List of SPCPOS to Incheon Airport POS. Failure! Number of items is different! [" + iCompleteRslt.ToString() + "]");
|
|
|
|
WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0752);
|
|
}
|
|
#endregion
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** Send ItemList of SPCPOS to Incheon Airport POS. End! (Local Item Count : " + iSaleItemCnt.ToString() + ", Item Tran Count :" + iSaleItemAddCnt.ToString());
|
|
|
|
return iRet;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** Send ItemList of SPCPOS to Incheon Airport POS. Error! (" + iRet.ToString() + ") " + ex.Message);
|
|
|
|
return iRet;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 인천공항 POS로 상품전송
|
|
private int i_AirPort_Pos_SaleItemAdd(string pSaleDt, string pBillNo, string pSeq, string pItemCd, string pItemNm,
|
|
string pQty, string pSalePrice, string pTotAmt, string pSaleAmt, string pDcAmt,
|
|
string pCompCd, string pStorCd, string pPosNo,
|
|
string pSTAY_DC_AMT, string pDC_TYPE, string pPROM_CD, string pPROM_NM, string pPROM_FR, string pPROM_TO, string pPROM_RATE_1, string pPROM_RATE_2, string pPROM_COUPON_NO)
|
|
{
|
|
int iRet = -1;
|
|
try
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** Incheon Airport PosSalesItemAdd. start! ");
|
|
|
|
// 인천공항 PosDBApi.dll / PosDBApi.tlb 파일 존재 여부 검사
|
|
if (b_AirPort_Pos_FileExist() == false) return iRet;
|
|
|
|
|
|
// 인천공항 pos에 판매 품목 등록
|
|
// PosSalesItemAdd( int 리턴 )
|
|
// *************************************************
|
|
// 0. 통합POS에 판매 품목 등록 함수
|
|
// 1. 파라미터 - SALE_DT : 판매일자(8)
|
|
// - BILL_NO : 입주사영수증번호(30)
|
|
// - SEQ : 순번(5)
|
|
// - ITEM_CD : 품목코드(30)
|
|
// - ITEM_NM : 품목명(100)
|
|
// - QTY : 수량(5)
|
|
// - SALE_PRICE : 판매가(9)
|
|
// - TOT_AMT : 총합계(9)
|
|
// - SALE_AMT : 실판매(9)
|
|
// - DC_AMT : 할인(9)
|
|
// - COMP_CD : 입주사코드(10)
|
|
// - STOR_CD : 매장코드(10)
|
|
// - POS_NO : POS번호(10)
|
|
// - pSTAY_DC_AMT : 할인유형2 할인 - 공항직원할인(통행증) 공항POS에서도 할수 있음.
|
|
// - pDC_TYPE : 할인유형 구분 - 할인유형1(1), 할인유형2(2) -> 1: SPCPOS할인, 2: 공항POS할인 으로생각하고, 우리쪽에서 날리는거니 '1'으로 픽스.
|
|
// - pPROM_CD : 프로모션 코드
|
|
// - pPROM_NM : 프로모션명
|
|
// - pPROM_FR : 프로모션 시작일
|
|
// - pPROM_TO : 프로모션 종료일
|
|
// - pPROM_RATE_1 : 할인유형1 비율
|
|
// - pPROM_RATE_2 : 할인유형2 비율
|
|
// - pPROM_COUPON_NO : 쿠폰번호
|
|
// 2. 리턴 - 1 : 해당 품목의 판매 정보 등록 성공
|
|
// - 500 : 입력한 파라메터 중 길이제한 오류
|
|
// - 600 : 품목 마스터에 해당 품목 코드가 없는 경우
|
|
// - 0 : 해당 품목의 판매 정보 등록 실패
|
|
// *************************************************
|
|
iRet = posapi.PosSalesItemAdd(pSaleDt, pBillNo, int.Parse(pSeq,0) , pItemCd, pItemNm,
|
|
int.Parse(pQty, 0), int.Parse(pSalePrice, 0), int.Parse(pTotAmt, 0), int.Parse(pSaleAmt, 0), int.Parse(pDcAmt, 0),
|
|
pCompCd, pStorCd, pPosNo,
|
|
int.Parse(pSTAY_DC_AMT), //할인유형2 할인 - 공항직원할인(통행증) 공항POS에서도 할수 있음.
|
|
pDC_TYPE, //할인유형 구분 - 할인유형1(1), 할인유형2(2) -> 1: SPCPOS할인, 2: 공항POS할인 으로생각하고, 우리쪽에서 날리는거니 '1'으로 픽스.
|
|
pPROM_CD, //프로모션 코드
|
|
pPROM_NM, //프로모션명
|
|
pPROM_FR, //프로모션 시작일
|
|
pPROM_TO, //프로모션 종료일
|
|
int.Parse(pPROM_RATE_1, 0), //할인유형1 비율
|
|
int.Parse(pPROM_RATE_2, 0), //할인유형2 비율
|
|
pPROM_COUPON_NO); //쿠폰번호
|
|
|
|
if (iRet != 1) { string str = posapi.PosGetLastErrorMsg(); WinManager.ConfirmMessage(str); }
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** Incheon Airport PosSalesItemAdd. End! Result : " + iRet.ToString() + " (1: SUCCESS), ItemCd :" + pItemCd);
|
|
|
|
return iRet;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** Incheon Airport PosSalesItemAdd. Error! Result : " + iRet.ToString() + " (1: SUCCESS), pBillNo : " + pBillNo + ", ItemCd :" + pItemCd + ex.Message);
|
|
|
|
return iRet;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 인천공항 pos에 상품전송 컴플릿
|
|
private int i_AirPort_Pos_SaleItemComp(string pSaleDt, string pBillNo)
|
|
{
|
|
int iRet = -1;
|
|
try
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** Item Registry Complete. start! ");
|
|
|
|
// 인천공항 PosDBApi.dll / PosDBApi.tlb 파일 존재 여부 검사
|
|
if (b_AirPort_Pos_FileExist() == false) return iRet;
|
|
|
|
// 인천공항 pos에 판매 품목 등록 확정
|
|
// PosSalesItemComplete( int 리턴 )
|
|
// *************************************************
|
|
// 0. 통합POS에 판매 품목 등록 완료 함수
|
|
// 1. 파라미터 - SALE_DT : 판매일자(8)
|
|
// - BILL_NO : 입주사영수증번호(30)
|
|
// 2. 리턴 - 1 : 판매 정보 등록 성공
|
|
// - 500 : 입력한 파라메터 중 길이제한 오류
|
|
// - 700 : 등록하려는 품목 정보가 없는 경우
|
|
// - 100 : 이미 결제가 진행 중이거나, 결제 완료 된 품목정보가 있는 경우
|
|
// - 0 : 품목 정보 등록 실패
|
|
// *************************************************
|
|
iRet = posapi.PosSalesItemComplete(pSaleDt, pBillNo);
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** Item Registry Complete. end! result :" + iRet.ToString() + " , pBillNo :" + pBillNo);
|
|
|
|
return iRet;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** Item Registry Complete. Error! (" + iRet + ")" + ex.Message);
|
|
|
|
return iRet;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 인천공항 POS에서 결제내역 조회
|
|
|
|
// 통합POS에서 결제내역 조회
|
|
// PosGetSalesTr (String 리턴)
|
|
// *************************************************
|
|
// 0. 통합POS에서 결제된 내역 조회 함수
|
|
// 1. 파라미터 - SALE_DT : 판매일자(8)
|
|
// - BILL_NO : 입주사영수증번호(30)
|
|
// - SALE_TY : 거래구분(0:정상, 1:반품)
|
|
// 2. 리턴 - String : XML
|
|
// *************************************************
|
|
private int i_AirPort_PosGetSaleTr(string pSaleDt, string pBillNo, string pNBillNo, string pSaleTY, string pResultTY)
|
|
{
|
|
int iRet = -1;
|
|
double iGrdTotAmt = 0; // 판매POS의 총 실판매금액
|
|
double iAirPosPayTot = 0; // 통합POS의 총 실판매금액
|
|
string sRet = string.Empty;
|
|
|
|
try
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"Get IncheonAirport POS TR Data - Start! (SaleDt :" + pSaleDt + ", BillNo :" + pBillNo + ", NBillNo :" + pNBillNo + ", SaleTY :" + pSaleTY + ", ResultTY :" + pResultTY);
|
|
|
|
#region 인천공항 DB 상태 체크
|
|
int iDBStatus = posapi.PosDBConnectDBStatus();
|
|
if (iDBStatus != 1)
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"Get IncheonAirport POS TR Data - DB Connect Error ! (" + iDBStatus + ")");
|
|
return iRet;
|
|
}
|
|
#endregion
|
|
|
|
#region 인천공항 PosDBApi.dll / PosDBApi.tlb 파일 존재 여부 검사
|
|
if (b_AirPort_Pos_FileExist() == false) return iRet;
|
|
#endregion
|
|
|
|
// #20180119, 인천공항 포스연동 결제 마감 시 금액 비교 수정 Start
|
|
// 기존
|
|
#region 판매POS의 총실판매 금액
|
|
//iGrdTotAmt = m_cTrnStatus.Head.NetSaleAmt;
|
|
//iGrdTotAmt = m_cTrnStatus.Head.NetSaleAmt + m_cPosStatus.Sale.ChangeCashAmt;
|
|
#endregion
|
|
|
|
// 변경
|
|
#region 판매POS의 받을 금액
|
|
iGrdTotAmt = m_cTrnStatus.Sale.RemainPayAmt; // 순 매출금액에서 받은금액(pay_amt) 뺀 금액
|
|
#endregion
|
|
// #20180119, 인천공항 포스연동 결제 마감 시 금액 비교 수정 End
|
|
|
|
#region 통합POS 결제 데이터 로컬에 저장하기
|
|
if (pSaleTY == "0")
|
|
{
|
|
/*
|
|
#region 로컬에 현금, 카드 결제 건 있는지 체크하기.
|
|
bool bPaycheck = false;
|
|
ArrayList alPays = (ArrayList)StateObject.GetItemObject(Column.TR_PAYMENT.ITEM);
|
|
for (int iRow = 0; iRow < alPays.Count; iRow++)
|
|
{
|
|
Column.TR_PAYMENT.DATA cPayItem = (Column.TR_PAYMENT.DATA)alPays[iRow];
|
|
if (cPayItem.CANCEL_DIV == "1") continue;
|
|
|
|
if ((cPayItem.PAY_WAY_CD == ItemConst.TR_ITEM_ID.CREDITCARD_ITEM && cPayItem.PAY_DTL_CD_01 == ItemConst.TR_ITEM_ID.CREDITCARD.CREDIT_CARD) || //카드
|
|
((cPayItem.PAY_WAY_CD == ItemConst.TR_ITEM_ID.CASH_ITEM && cPayItem.PAY_DTL_CD_01 == ItemConst.TR_ITEM_ID.CASH.CASH_PAY) || //현금
|
|
(cPayItem.PAY_WAY_CD == ItemConst.TR_ITEM_ID.FOREIGNEX_ITEM) ||//외화
|
|
(cPayItem.PAY_WAY_CD == ItemConst.TR_ITEM_ID.CHECK_ITEM)))//수표
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"Get Incheon Airport POS TR Data - Cash or Card Pay exist! exit! ");
|
|
bPaycheck = true;
|
|
break;
|
|
}
|
|
}
|
|
if (bPaycheck == true)
|
|
{
|
|
WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0753);
|
|
return iRet;
|
|
}
|
|
#endregion
|
|
*/
|
|
|
|
// 인천공항 pos에서 결제내역 조회
|
|
// PosGetSalesTr (String 리턴)
|
|
// *************************************************
|
|
// 0. 통합POS에서 결제된 내역 조회 함수
|
|
// 1. 파라미터 - SALE_DT : 판매일자(8)
|
|
// - BILL_NO : 입주사영수증번호(30)
|
|
// - SALE_TY : 거래구분(0:정상, 1:반품)
|
|
// 2. 리턴 - String : XML
|
|
// *************************************************
|
|
|
|
Recordset RS = posapi.PosGetSalesTrEx(pSaleDt, pBillNo, pSaleTY);
|
|
|
|
//#20180119 start,phj
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"PosGetSalesTrEx --> SaleDt : " + pSaleDt + " , BillNo : " + pBillNo + " , SaleTY : " + pSaleTY);
|
|
//#20180119 end,phj
|
|
|
|
if (RS != null && RS.RecordCount > 0)
|
|
{
|
|
ArrayList m_cAirPosPay = null;
|
|
m_cAirPosPay = (ArrayList)StateObject.GetItemObject(Column.AIRPOS_PAYMENT.ITEM);
|
|
m_cAirPosPay.Clear();
|
|
|
|
RS.MoveFirst();
|
|
|
|
#region 인천공항 POS의 결제내역 파싱
|
|
string TempData = RS.GetString(StringFormatEnum.adClipString, -1, "|", "#~", "");
|
|
string[] aRowData = null;
|
|
string[] aColData = null;
|
|
aRowData = TempData.Split(new string[] { "#~" }, StringSplitOptions.None);
|
|
|
|
for (int i = 0; i < aRowData.Length - 1; i++)
|
|
{
|
|
aColData = aRowData[i].Split(new string[] { "|" }, StringSplitOptions.None);
|
|
|
|
Column.AIRPOS_PAYMENT.DATA m_cAirPosPayItem = new Column.AIRPOS_PAYMENT.DATA();
|
|
|
|
m_cAirPosPayItem.SALE_DT = aColData[0];
|
|
m_cAirPosPayItem.BILL_NO = aColData[1];
|
|
m_cAirPosPayItem.IF_BILL_NO = aColData[2];
|
|
m_cAirPosPayItem.SALE_TY = aColData[3];
|
|
m_cAirPosPayItem.PAY_TY = aColData[4];
|
|
m_cAirPosPayItem.PAY_NM = aColData[5];
|
|
m_cAirPosPayItem.PAY_AMT = int.Parse(aColData[6]); //0;
|
|
m_cAirPosPayItem.EXC_CD = aColData[7]; //"";
|
|
m_cAirPosPayItem.EXC_NM = aColData[8]; // "";
|
|
|
|
//#20180116 인천공항 포스연동 외화 결제데이터 관련 수정 Start
|
|
//m_cAirPosPayItem.EXC_BASE = int.Parse(aColData[9]); //0;
|
|
//m_cAirPosPayItem.EXC_COST = int.Parse(aColData[10]); //0;
|
|
//m_cAirPosPayItem.EXC_EAMT = int.Parse(aColData[11]); //0;
|
|
//m_cAirPosPayItem.EXC_IN_EAMT = int.Parse(aColData[12]); //0;
|
|
m_cAirPosPayItem.EXC_BASE = double.Parse(aColData[9]); //0;
|
|
m_cAirPosPayItem.EXC_COST = double.Parse(aColData[10]); //0;
|
|
m_cAirPosPayItem.EXC_EAMT = double.Parse(aColData[11]); //0;
|
|
m_cAirPosPayItem.EXC_IN_EAMT = double.Parse(aColData[12]); //0;
|
|
//#20180116 인천공항 포스연동 외화 결제데이터 관련 수정 End
|
|
|
|
m_cAirPosPayItem.EXC_IN_WAMT = int.Parse(aColData[13]); //0;
|
|
m_cAirPosPayItem.EXC_CHANGE = int.Parse(aColData[14]); //0;
|
|
m_cAirPosPayItem.CARD_ID = aColData[15]; // "";
|
|
m_cAirPosPayItem.CARD_INST = aColData[16]; //"";
|
|
m_cAirPosPayItem.CARD_CARD_CD = aColData[17]; //"";
|
|
m_cAirPosPayItem.CARD_CARD_NM = aColData[18]; //"";
|
|
m_cAirPosPayItem.CARD_PURC_CD = aColData[19]; //"";
|
|
m_cAirPosPayItem.CARD_PURC_NM = aColData[20]; //"";
|
|
m_cAirPosPayItem.CARD_AP_TY = aColData[21]; //"";
|
|
m_cAirPosPayItem.CARD_AP_NO = aColData[22]; //"";
|
|
m_cAirPosPayItem.CARD_MEM_NO = aColData[23]; //"";
|
|
m_cAirPosPayItem.CARD_AP_DT = aColData[24]; //"";
|
|
m_cAirPosPayItem.CARD_AP_TM = aColData[25]; //"";
|
|
m_cAirPosPayItem.CARD_AP_ORG_DT = aColData[26]; //"";
|
|
m_cAirPosPayItem.CARD_AP_ORG_NO = aColData[27]; //"";
|
|
m_cAirPosPayItem.CARD_AP_TERMID = aColData[28]; //"";
|
|
m_cAirPosPayItem.ETC_NAME = aColData[29]; //"";
|
|
m_cAirPosPayItem.CASH_AP_AMT = int.Parse(aColData[30]);
|
|
m_cAirPosPayItem.CASH_AP_TY = aColData[31]; //"";
|
|
m_cAirPosPayItem.CASH_AP_ID = aColData[32]; //"";
|
|
m_cAirPosPayItem.CASH_AP_NO = aColData[33]; //"";
|
|
m_cAirPosPayItem.CASH_AP_DT = aColData[34]; //"";
|
|
m_cAirPosPayItem.CASH_AP_TM = aColData[35]; //"";
|
|
m_cAirPosPayItem.CASH_AP_ORG_DT = aColData[36]; //"";
|
|
m_cAirPosPayItem.CASH_AP_ORG_NO = aColData[37]; //"";
|
|
m_cAirPosPayItem.CASH_AP_CAN_FG = aColData[38]; // "";
|
|
|
|
m_cAirPosPay.Add(m_cAirPosPayItem);
|
|
}
|
|
|
|
//#20180119 start,phj
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"PosGetSalesTrEx --> Count : " + m_cAirPosPay.Count.ToString());
|
|
//#20180119 end,phj
|
|
|
|
#endregion
|
|
|
|
// #20180119, 인천공항 포스연동 결제 마감 시 금액 비교 수정 Start
|
|
#region 인천공항 POS의 총 실판매금액 구하기
|
|
|
|
/*
|
|
double sIncheonPayTot = 0;
|
|
foreach (Column.AIRPOS_PAYMENT.DATA m_cAirPosPayItem in m_cAirPosPay)
|
|
{
|
|
if (m_cAirPosPayItem.PAY_TY == "03") continue;
|
|
double sPayAmt = m_cAirPosPayItem.PAY_AMT;
|
|
sIncheonPayTot = sIncheonPayTot + Convert.ToDouble(sPayAmt); //결제금액
|
|
}
|
|
|
|
double sPayTot = 0;
|
|
ArrayList alPaylist = (ArrayList)StateObject.GetItemObject(Column.TR_PAYMENT.ITEM);
|
|
for (int iRow = 0; iRow < alPays.Count; iRow++)
|
|
{
|
|
Column.TR_PAYMENT.DATA cPayItem = (Column.TR_PAYMENT.DATA)alPays[iRow];
|
|
if (cPayItem.CANCEL_DIV == PosConst.CANCEL_DIV.CANCEL) continue;
|
|
//if (cPayItem.CANCEL_DIV == PosConst.CANCEL_DIV.CANCEL || cPayItem.canCANCEL_DIV_MAIN == PosConst.CANCEL_DIV.CANCEL) continue; // 지정취소
|
|
double sPayAmt = cPayItem.PAY_AMT;
|
|
sPayTot = sPayTot + sPayAmt; //결제금액
|
|
}
|
|
|
|
iAirPosPayTot = sIncheonPayTot + sPayTot;
|
|
*/
|
|
|
|
// 기존
|
|
//foreach (Column.AIRPOS_PAYMENT.DATA m_cAirPosPayItem in m_cAirPosPay)
|
|
//{
|
|
// string sPayAmt = CmUtil.IsNull(m_cAirPosPayItem.PAY_AMT.ToString(), "0");
|
|
// iAirPosPayTot = iAirPosPayTot + Convert.ToDouble(sPayAmt); //결제금액
|
|
//}
|
|
|
|
// 변경
|
|
// SPC포스 받을금액과 통합포스에서 결제한 금액(현금, 외화, 신용카드) 비교하는 것으로 수정
|
|
foreach (Column.AIRPOS_PAYMENT.DATA m_cAirPosPayItem in m_cAirPosPay)
|
|
{
|
|
if (m_cAirPosPayItem.PAY_TY == "01" || m_cAirPosPayItem.PAY_TY == "02")
|
|
{
|
|
string sPayAmt = CmUtil.IsNull(m_cAirPosPayItem.PAY_AMT.ToString(), "0");
|
|
iAirPosPayTot = iAirPosPayTot + Convert.ToDouble(sPayAmt); //결제금액
|
|
}
|
|
}
|
|
#endregion
|
|
// #20180119, 인천공항 포스연동 결제 마감 시 금액 비교 수정 End
|
|
|
|
// #20180119, 인천공항 포스연동 결제 마감 시 금액 비교 수정 Start
|
|
// 기존
|
|
//#region 판매POS의 실판매금액과 인천공항 POS의 실판매금액 비교하기
|
|
|
|
// 변경
|
|
// 판매POS의 실판매금액과 통합POS의 실판매금액 비교하기 -> 판매POS의 받을금액과 통합POS에서 결제된 실판매금액 비교하기
|
|
#region 판매POS의 받을금액과 인천공항 POS의 실판매금액 비교하기
|
|
|
|
|
|
// #20180119, 인천공항 포스연동 결제 마감 시 금액 비교 수정 Start
|
|
// 기존
|
|
// 금액이 다를 경우 팝업 띄워주기
|
|
//if (iGrdTotAmt != iAirPosPayTot)
|
|
|
|
// 변경
|
|
if (iGrdTotAmt > iAirPosPayTot)
|
|
// #20180119, 인천공항 포스연동 결제 마감 시 금액 비교 수정 End
|
|
{
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"Get Incheon Airport POS TR Data - Amount difference! (Airport Amt : " + iAirPosPayTot.ToString() + ", SPCPOS Amt : " + iGrdTotAmt.ToString() + ")");
|
|
|
|
//WinManager.ConfirmMessage("판매포스의 판매금액과 통합포스의 결제금액이 같지 않습니다.");
|
|
WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0754);
|
|
return iRet;
|
|
}
|
|
#endregion
|
|
// #20180119, 인천공항 포스연동 결제 마감 시 금액 비교 수정 End
|
|
|
|
#region 인천공항 POS의 결제 데이터를 SPCPOS 로컬에 저장하기
|
|
|
|
ArrayList alPayItem = (ArrayList)StateObject.GetItemObject(Column.TR_PAYMENT.ITEM);
|
|
ArrayList alEtcItem = (ArrayList)StateObject.GetItemObject(Column.TR_ETC.ITEM);
|
|
|
|
foreach (Column.AIRPOS_PAYMENT.DATA m_cAirPosPayItem in m_cAirPosPay)
|
|
{
|
|
//#20180119 start,phj
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"PosGetSalesTrEx --> " +
|
|
" Sale_Dt :" + m_cAirPosPayItem.SALE_DT +
|
|
", SALE_TY :" + m_cAirPosPayItem.SALE_TY +
|
|
", BILL_NO :" + m_cAirPosPayItem.BILL_NO +
|
|
", IF_BILL_NO :" + m_cAirPosPayItem.IF_BILL_NO +
|
|
", PAY_TY :" + m_cAirPosPayItem.PAY_TY +
|
|
", PAY_NM : " + m_cAirPosPayItem.PAY_NM);
|
|
//#20180119 end,phj
|
|
|
|
|
|
if (m_cAirPosPayItem.PAY_TY == "01")
|
|
{
|
|
#region 01:현금
|
|
// 결과 저장 변수 생성
|
|
Column.TR_PAYMENT.DATA m_cPayItem = new Column.TR_PAYMENT.DATA();
|
|
if (m_cAirPosPayItem.EXC_CD == "")
|
|
{
|
|
// 현금결제
|
|
m_cPayItem.PAY_WAY_CD = ItemConst.TR_ITEM_ID.CASH_ITEM; //현금 결제 그룹 코드
|
|
m_cPayItem.PAY_DTL_CD_01 = ItemConst.TR_ITEM_ID.CASH.CASH_PAY; //현금 결제 코드
|
|
m_cPayItem.OCCUR_ENTRY_20 = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0059); //결제 수단명
|
|
}
|
|
else if (m_cAirPosPayItem.EXC_CD == "01")
|
|
{
|
|
// 외화(USD) : EXC_CD(USD, EUR, JPY, CNY)로 구분
|
|
m_cPayItem.PAY_WAY_CD = ItemConst.TR_ITEM_ID.FOREIGNEX_ITEM; //외화 결제 그룹 코드
|
|
m_cPayItem.PAY_DTL_CD_01 = ItemConst.TR_ITEM_ID.FOREIGNEX.USD; //USD 결제 코드
|
|
m_cPayItem.OCCUR_ENTRY_20 = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0059); //결제 수단명
|
|
}
|
|
else if (m_cAirPosPayItem.EXC_CD == "02")
|
|
{
|
|
// 외화(EUR) : EXC_CD(USD, EUR, JPY, CNY)로 구분
|
|
m_cPayItem.PAY_WAY_CD = ItemConst.TR_ITEM_ID.FOREIGNEX_ITEM; //외화 결제 그룹 코드
|
|
m_cPayItem.PAY_DTL_CD_01 = ItemConst.TR_ITEM_ID.FOREIGNEX.EUR; //EUR 결제 코드
|
|
m_cPayItem.OCCUR_ENTRY_20 = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0059); //결제 수단명
|
|
}
|
|
else if (m_cAirPosPayItem.EXC_CD == "03")
|
|
{
|
|
// 외화(JPY) : EXC_CD(USD, EUR, JPY, CNY)로 구분
|
|
m_cPayItem.PAY_WAY_CD = ItemConst.TR_ITEM_ID.FOREIGNEX_ITEM; //외화 결제 그룹 코드
|
|
m_cPayItem.PAY_DTL_CD_01 = ItemConst.TR_ITEM_ID.FOREIGNEX.JPY; //JPY 결제 코드
|
|
m_cPayItem.OCCUR_ENTRY_20 = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0059); //결제 수단명
|
|
}
|
|
else if (m_cAirPosPayItem.EXC_CD == "04")
|
|
{
|
|
// 외화(CNY) : EXC_CD(USD, EUR, JPY, CNY)로 구분
|
|
m_cPayItem.PAY_WAY_CD = ItemConst.TR_ITEM_ID.FOREIGNEX_ITEM; //외화 결제 그룹 코드
|
|
m_cPayItem.PAY_DTL_CD_01 = ItemConst.TR_ITEM_ID.FOREIGNEX.CNY; //CNY 결제 코드
|
|
m_cPayItem.OCCUR_ENTRY_20 = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0059); //결제 수단명
|
|
}
|
|
|
|
m_cPayItem.PAY_AMT = m_cAirPosPayItem.PAY_AMT; //결제 금액
|
|
m_cPayItem.PAY_DTL_CD_05 = PosConst.PAY_DC_TYPE.PAY; //결제/할인 구분(1:결제, 2:할인)
|
|
m_cPayItem.BILLSPR_NO = m_cTrnStatus.Sale.BillSplitNo; //빌분리 번호
|
|
m_cPayItem.OCCUR_ENTRY_21 = ItemConst.PAY_CASHBILL_DIV.YES; //현금영수증 발행 여부
|
|
//m_cPayItem.AMT_ENTRY_01 = m_cAirPosPayItem.EXC_IN_WAMT; //받은돈
|
|
m_cPayItem.AMT_ENTRY_01 = m_cAirPosPayItem.PAY_AMT; //받은돈
|
|
m_cPayItem.AMT_ENTRY_02 = m_cAirPosPayItem.EXC_CHANGE; //거스름
|
|
m_cPayItem.AMT_ENTRY_03 = m_cAirPosPayItem.EXC_IN_EAMT; //외화 받은돈
|
|
m_cPayItem.AMT_ENTRY_04 = m_cAirPosPayItem.EXC_COST; //환율
|
|
|
|
m_cPayItem.SEQ = alPayItem.Count + 1; //순번
|
|
m_cPayItem.CANCEL_DIV = PosConst.CANCEL_DIV.NORMAL; //취소여부(0:정상, 1:취소)
|
|
m_cPosStatus.Sale.ChangeCashAmt = m_cAirPosPayItem.EXC_CHANGE; //현금거스름
|
|
|
|
alPayItem.Add(m_cPayItem);
|
|
#endregion
|
|
|
|
|
|
//#20180117 돈통오픈 start,phj
|
|
m_cCashDrawer.OpenCashDrawer(); // 돈통 OPEN 처리
|
|
//#20180117 돈통오픈 end,phj
|
|
}
|
|
else if (m_cAirPosPayItem.PAY_TY == "02")
|
|
{
|
|
#region 02:카드
|
|
|
|
// 결과 저장 변수 생성
|
|
Column.TR_PAYMENT.DATA m_cPayItem = new Column.TR_PAYMENT.DATA();
|
|
// 카드결제
|
|
m_cPayItem.PAY_WAY_CD = ItemConst.TR_ITEM_ID.CREDITCARD_ITEM; //현금 결제 그룹 코드
|
|
m_cPayItem.PAY_DTL_CD_01 = ItemConst.TR_ITEM_ID.CREDITCARD.CREDIT_CARD; //현금 결제 코드
|
|
m_cPayItem.PAY_AMT = m_cAirPosPayItem.PAY_AMT; //결제 금액
|
|
m_cPayItem.PAY_DTL_CD_05 = PosConst.PAY_DC_TYPE.PAY; //결제/할인 구분(1:결제, 2:할인)
|
|
m_cPayItem.BILLSPR_NO = m_cTrnStatus.Sale.BillSplitNo; //빌분리 번호
|
|
|
|
m_cPayItem.AMT_ENTRY_01 = m_cAirPosPayItem.PAY_AMT; //결제금액
|
|
m_cPayItem.AMT_ENTRY_02 = m_cAirPosPayItem.PAY_AMT; //공급가
|
|
|
|
m_cPayItem.OCCUR_ENTRY_01 = m_cAirPosPayItem.CARD_ID; //카드번호
|
|
m_cPayItem.OCCUR_ENTRY_02 = m_cAirPosPayItem.CARD_AP_NO; //승인번호
|
|
//m_cPayItem.OCCUR_ENTRY_03 = m_cAirPosPayItem.CARD_AP_DT; //승인일자
|
|
//m_cPayItem.OCCUR_ENTRY_04 = m_cAirPosPayItem.CARD_AP_TM; //승인시간
|
|
m_cPayItem.OCCUR_ENTRY_03 = CmUtil.MidH(m_cAirPosPayItem.CARD_AP_DT, 2, m_cAirPosPayItem.CARD_AP_DT.Length - 2);//승인일자
|
|
m_cPayItem.OCCUR_ENTRY_04 = CmUtil.MidH(m_cAirPosPayItem.CARD_AP_TM, 0, 4); //승인시간
|
|
m_cPayItem.OCCUR_ENTRY_05 = PosConst.POS_VAN_MASTER.INPUT_TYPE.VAN_SWIP; //입력구분(S:Swip,K:Keyin,C:IC,R:RF,B:barcode)
|
|
m_cPayItem.OCCUR_ENTRY_06 = m_cAirPosPayItem.CARD_AP_ORG_NO; //원승인번호
|
|
m_cPayItem.OCCUR_ENTRY_07 = m_cAirPosPayItem.CARD_AP_ORG_DT; //원승인일자
|
|
|
|
//m_cPayItem.OCCUR_ENTRY_08 = m_cAirPosPayItem.CARD_AP_TY; //승인구분(1:POS승인, 2:임의등록)
|
|
if (m_cAirPosPayItem.CARD_AP_TY == "1") //승인구분(1:POS승인, 2:임의등록)
|
|
{
|
|
m_cPayItem.OCCUR_ENTRY_08 = "0";
|
|
}
|
|
else if (m_cAirPosPayItem.CARD_AP_TY == "2") //승인구분(1:POS승인, 2:임의등록)
|
|
{
|
|
m_cPayItem.OCCUR_ENTRY_08 = "1";
|
|
}
|
|
|
|
// 발급사코드, 매입사코드는 SPC 발급사코드, 매입사코드로 변환되야 함.
|
|
m_cPayItem.OCCUR_ENTRY_09 = m_cAirPosPayItem.CARD_CARD_CD; //발급사코드
|
|
m_cPayItem.OCCUR_ENTRY_10 = m_cAirPosPayItem.CARD_CARD_NM; //발급사명
|
|
m_cPayItem.OCCUR_ENTRY_11 = m_cAirPosPayItem.CARD_PURC_CD; //매입사코드
|
|
m_cPayItem.OCCUR_ENTRY_12 = m_cAirPosPayItem.CARD_PURC_NM; //매입사명
|
|
m_cPayItem.OCCUR_ENTRY_14 = m_cAirPosPayItem.CARD_INST; //할부개월
|
|
m_cPayItem.OCCUR_ENTRY_15 = "0";//(0:일반,1:은련카드)
|
|
|
|
// 승인업체 코드는 새로 생성할지 결정해야 함. 기존 값(01)으로 넣으면 안될것 같음.
|
|
m_cPayItem.OCCUR_ENTRY_16 = GetPayDtlCdToVanCode(m_cPayItem.PAY_WAY_CD, m_cPayItem.PAY_DTL_CD_01); //승인업체 코드 조회
|
|
//m_cPayItem.OCCUR_ENTRY_17 = GetSignFlag(m_cAirPosPayItem.CARD_PURC_CD.Trim().Length > 0 ? "1" : "0", m_cPayItem.PAY_AMT); //(0:미서명,1:서명)
|
|
//m_cPayItem.OCCUR_ENTRY_17 = "1"; //(0:미서명,1:서명)
|
|
m_cPayItem.OCCUR_ENTRY_17 = ""; //(0:미서명,1:서명)
|
|
|
|
m_cPayItem.OCCUR_ENTRY_18 = m_cAirPosPayItem.CARD_MEM_NO;//가맹점코드
|
|
m_cPayItem.OCCUR_ENTRY_20 = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0058); //결제수단명
|
|
m_cPayItem.OCCUR_ENTRY_21 = ItemConst.PAY_CASHBILL_DIV.NO; //현금영수증발행여부 0:미발행,1:발행
|
|
|
|
m_cPayItem.CANCEL_DIV = ItemConst.PAY_CANCEL_DIV.NORMAL;
|
|
|
|
m_cPayItem.SEQ = alPayItem.Count + 1;
|
|
alPayItem.Add(m_cPayItem);
|
|
|
|
#endregion
|
|
}
|
|
else if (m_cAirPosPayItem.PAY_TY == "03")
|
|
{
|
|
// 기타결제
|
|
}
|
|
else if (m_cAirPosPayItem.PAY_TY == "04")
|
|
{
|
|
#region 04:현금영수증
|
|
|
|
// 결과 저장 변수 생성
|
|
Column.TR_ETC.DATA m_cEtcItem = new Column.TR_ETC.DATA();
|
|
|
|
m_cEtcItem.ETC_WAY_CD = ItemConst.TR_ITEM_ID.ETC_INFO_ITEM;
|
|
m_cEtcItem.ETC_DTL_CD_01 = ItemConst.TR_ITEM_ID.ETC_INFO.CASHBILL;
|
|
|
|
m_cEtcItem.ETC_AMT = m_cAirPosPayItem.CASH_AP_AMT;//결제 금액
|
|
m_cEtcItem.QTY_ENTRY_01 = 0;
|
|
m_cEtcItem.QTY_ENTRY_02 = 0;
|
|
m_cEtcItem.QTY_ENTRY_03 = 0;
|
|
m_cEtcItem.QTY_ENTRY_04 = 0;
|
|
m_cEtcItem.QTY_ENTRY_05 = 0;
|
|
|
|
m_cEtcItem.AMT_ENTRY_01 = m_cAirPosPayItem.CASH_AP_AMT; //총금액
|
|
m_cEtcItem.AMT_ENTRY_02 = m_cAirPosPayItem.CASH_AP_AMT; //공급가액
|
|
m_cEtcItem.AMT_ENTRY_03 = 0; //세금
|
|
m_cEtcItem.AMT_ENTRY_04 = 0; //봉사료
|
|
m_cEtcItem.AMT_ENTRY_05 = 0;
|
|
m_cEtcItem.AMT_ENTRY_06 = 0;
|
|
m_cEtcItem.AMT_ENTRY_07 = 0;
|
|
m_cEtcItem.AMT_ENTRY_08 = 0;
|
|
m_cEtcItem.AMT_ENTRY_09 = 0;
|
|
m_cEtcItem.AMT_ENTRY_10 = 0;
|
|
|
|
m_cEtcItem.OCCUR_ENTRY_01 = m_cAirPosPayItem.CASH_AP_ID;//인증번호
|
|
m_cEtcItem.OCCUR_ENTRY_02 = m_cAirPosPayItem.CASH_AP_NO;//승인번호
|
|
m_cEtcItem.OCCUR_ENTRY_03 = CmUtil.MidH(m_cAirPosPayItem.CASH_AP_DT, 2, m_cAirPosPayItem.CASH_AP_DT.Length -2); // m_cAirPosPayItem.CASH_AP_DT; //승인일자
|
|
m_cEtcItem.OCCUR_ENTRY_04 = CmUtil.MidH(m_cAirPosPayItem.CASH_AP_TM, 0, 4); //m_cAirPosPayItem.CASH_AP_TM; //승인시간
|
|
m_cEtcItem.OCCUR_ENTRY_05 = PosConst.POS_VAN_MASTER.INPUT_TYPE.VAN_SWIP; //입력구분(S:Swip,K:Keyin,C:IC,R:RF,B:barcode)
|
|
m_cEtcItem.OCCUR_ENTRY_06 = m_cAirPosPayItem.CASH_AP_ORG_NO; //원승인번호 //CmUtil.MidH(m_cAirPosPayItem.CASH_AP_ORG_NO, 2, m_cAirPosPayItem.CASH_AP_ORG_NO.Length - 2);
|
|
m_cEtcItem.OCCUR_ENTRY_07 = m_cAirPosPayItem.CASH_AP_ORG_DT; //원승인일자 //CmUtil.MidH(m_cAirPosPayItem.CASH_AP_ORG_DT, 0, 4);
|
|
m_cEtcItem.OCCUR_ENTRY_08 = ItemConst.PAY_APP_DIV.NORMAL; //승인구분(0:정상,1:임의등록)
|
|
m_cEtcItem.OCCUR_ENTRY_09 = "0"; //거래후 승인구분(0:일반,1:추후)
|
|
m_cEtcItem.OCCUR_ENTRY_10 = "0"; //자진발급구분(0:일반, 1:자진발급)
|
|
m_cEtcItem.OCCUR_ENTRY_11 = m_cAirPosPayItem.CASH_AP_TY; //승인구분(0:소득공제, 1:지출증빙)
|
|
m_cEtcItem.OCCUR_ENTRY_12 = "";
|
|
m_cEtcItem.OCCUR_ENTRY_13 = "";
|
|
m_cEtcItem.OCCUR_ENTRY_14 = "";
|
|
m_cEtcItem.OCCUR_ENTRY_15 = "";
|
|
|
|
m_cEtcItem.OCCUR_ENTRY_16 = GetPayDtlCdToVanCode(m_cEtcItem.ETC_WAY_CD, m_cEtcItem.ETC_DTL_CD_01); //승인업체 코드 조회
|
|
|
|
m_cEtcItem.OCCUR_ENTRY_17 = "";
|
|
m_cEtcItem.OCCUR_ENTRY_18 = "";
|
|
m_cEtcItem.OCCUR_ENTRY_19 = "";
|
|
m_cEtcItem.OCCUR_ENTRY_20 = GetPayDtlCdToPayDtlName(m_cEtcItem.ETC_WAY_CD, m_cEtcItem.ETC_DTL_CD_01); //결제 수단명
|
|
m_cEtcItem.OCCUR_ENTRY_21 = "";
|
|
m_cEtcItem.OCCUR_ENTRY_22 = "";
|
|
m_cEtcItem.OCCUR_ENTRY_23 = "";
|
|
m_cEtcItem.OCCUR_ENTRY_24 = "";
|
|
m_cEtcItem.OCCUR_ENTRY_25 = "";
|
|
m_cEtcItem.BILLSPR_NO = m_cTrnStatus.Sale.BillSplitNo; //빌분리 번호
|
|
m_cEtcItem.CANCEL_DIV = ItemConst.PAY_CANCEL_DIV.NORMAL;
|
|
|
|
m_cEtcItem.SEQ = alEtcItem.Count + 1;
|
|
alEtcItem.Add(m_cEtcItem);
|
|
|
|
#endregion
|
|
}
|
|
else
|
|
{
|
|
//
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
iRet = 1;
|
|
}
|
|
else
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"Get IncheonAirport POS TR Data - not exist! (" + pSaleTY + ")");
|
|
|
|
WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0755);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Recordset RS = posapi.PosGetSalesTrEx(pSaleDt, pBillNo, pSaleTY);
|
|
|
|
//#20180119 start,phj
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"PosGetSalesTrEx[Return] --> SaleDt : " + pSaleDt + " , BillNo : " + pBillNo + " , SaleTY : " + pSaleTY);
|
|
//#20180119 end,phj
|
|
|
|
if (RS != null && RS.RecordCount > 0)
|
|
{
|
|
ArrayList m_cAirPosPay = null;
|
|
m_cAirPosPay = (ArrayList)StateObject.GetItemObject(Column.AIRPOS_PAYMENT.ITEM);
|
|
m_cAirPosPay.Clear();
|
|
|
|
RS.MoveFirst();
|
|
|
|
#region 인천공항 통합POS의 반품내역 파싱
|
|
string TempData = RS.GetString(StringFormatEnum.adClipString, -1, "|", "#~", "");
|
|
string[] aRowData = null;
|
|
string[] aColData = null;
|
|
aRowData = TempData.Split(new string[] { "#~" }, StringSplitOptions.None);
|
|
|
|
for (int i = 0; i < aRowData.Length - 1; i++)
|
|
{
|
|
aColData = aRowData[i].Split(new string[] { "|" }, StringSplitOptions.None);
|
|
|
|
Column.AIRPOS_PAYMENT.DATA m_cAirPosPayItem = new Column.AIRPOS_PAYMENT.DATA();
|
|
|
|
m_cAirPosPayItem.SALE_DT = aColData[0];
|
|
m_cAirPosPayItem.BILL_NO = aColData[1];
|
|
m_cAirPosPayItem.IF_BILL_NO = aColData[2];
|
|
m_cAirPosPayItem.SALE_TY = aColData[3];
|
|
m_cAirPosPayItem.PAY_TY = aColData[4];
|
|
m_cAirPosPayItem.PAY_NM = aColData[5];
|
|
m_cAirPosPayItem.PAY_AMT = int.Parse(aColData[6]); //0;
|
|
m_cAirPosPayItem.EXC_CD = aColData[7]; //"";
|
|
m_cAirPosPayItem.EXC_NM = aColData[8]; // "";
|
|
|
|
//#20180116 인천공항 포스연동 외화 결제데이터 관련 수정 Start
|
|
//m_cAirPosPayItem.EXC_BASE = int.Parse(aColData[9]); //0;
|
|
//m_cAirPosPayItem.EXC_COST = int.Parse(aColData[10]); //0;
|
|
//m_cAirPosPayItem.EXC_EAMT = int.Parse(aColData[11]); //0;
|
|
//m_cAirPosPayItem.EXC_IN_EAMT = int.Parse(aColData[12]); //0;
|
|
|
|
m_cAirPosPayItem.EXC_BASE = double.Parse(aColData[9]); //0;
|
|
m_cAirPosPayItem.EXC_COST = double.Parse(aColData[10]); //0;
|
|
m_cAirPosPayItem.EXC_EAMT = double.Parse(aColData[11]); //0;
|
|
m_cAirPosPayItem.EXC_IN_EAMT = double.Parse(aColData[12]); //0;
|
|
//#20180116 인천공항 포스연동 외화 결제데이터 관련 수정 End
|
|
|
|
m_cAirPosPayItem.EXC_IN_WAMT = int.Parse(aColData[13]); //0;
|
|
m_cAirPosPayItem.EXC_CHANGE = int.Parse(aColData[14]); //0;
|
|
m_cAirPosPayItem.CARD_ID = aColData[15]; // "";
|
|
m_cAirPosPayItem.CARD_INST = aColData[16]; //"";
|
|
m_cAirPosPayItem.CARD_CARD_CD = aColData[17]; //"";
|
|
m_cAirPosPayItem.CARD_CARD_NM = aColData[18]; //"";
|
|
m_cAirPosPayItem.CARD_PURC_CD = aColData[19]; //"";
|
|
m_cAirPosPayItem.CARD_PURC_NM = aColData[20]; //"";
|
|
m_cAirPosPayItem.CARD_AP_TY = aColData[21]; //"";
|
|
m_cAirPosPayItem.CARD_AP_NO = aColData[22]; //"";
|
|
m_cAirPosPayItem.CARD_MEM_NO = aColData[23]; //"";
|
|
m_cAirPosPayItem.CARD_AP_DT = aColData[24]; //"";
|
|
m_cAirPosPayItem.CARD_AP_TM = aColData[25]; //"";
|
|
m_cAirPosPayItem.CARD_AP_ORG_DT = aColData[26]; //"";
|
|
m_cAirPosPayItem.CARD_AP_ORG_NO = aColData[27]; //"";
|
|
m_cAirPosPayItem.CARD_AP_TERMID = aColData[28]; //"";
|
|
m_cAirPosPayItem.ETC_NAME = aColData[29]; //"";
|
|
m_cAirPosPayItem.CASH_AP_AMT = int.Parse(aColData[30]);
|
|
m_cAirPosPayItem.CASH_AP_TY = aColData[31]; //"";
|
|
m_cAirPosPayItem.CASH_AP_ID = aColData[32]; //"";
|
|
m_cAirPosPayItem.CASH_AP_NO = aColData[33]; //"";
|
|
m_cAirPosPayItem.CASH_AP_DT = aColData[34]; //"";
|
|
m_cAirPosPayItem.CASH_AP_TM = aColData[35]; //"";
|
|
m_cAirPosPayItem.CASH_AP_ORG_DT = aColData[36]; //"";
|
|
m_cAirPosPayItem.CASH_AP_ORG_NO = aColData[37]; //"";
|
|
m_cAirPosPayItem.CASH_AP_CAN_FG = aColData[38]; // "";
|
|
|
|
m_cAirPosPay.Add(m_cAirPosPayItem);
|
|
|
|
}
|
|
|
|
//#20180119 start,phj
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"PosGetSalesTrEx[Return] --> Count : " + m_cAirPosPay.Count.ToString());
|
|
//#20180119 end,phj
|
|
#endregion
|
|
|
|
#region 인천공항 통합POS의 총 실판매금액 구하기
|
|
foreach (Column.AIRPOS_PAYMENT.DATA m_cAirPosPayItem in m_cAirPosPay)
|
|
{
|
|
string sPayAmt = CmUtil.IsNull(m_cAirPosPayItem.PAY_AMT.ToString(), "0");
|
|
iAirPosPayTot = iAirPosPayTot + Convert.ToDouble(sPayAmt); //결제금액
|
|
}
|
|
|
|
/*
|
|
double sIncheonPayTot = 0;
|
|
foreach (Column.AIRPOS_PAYMENT.DATA m_cAirPosPayItem in m_cAirPosPay)
|
|
{
|
|
if (m_cAirPosPayItem.PAY_TY == "03") continue;//기타금액
|
|
double sPayAmt = m_cAirPosPayItem.PAY_AMT;
|
|
sIncheonPayTot = sIncheonPayTot + Convert.ToDouble(sPayAmt); //결제금액
|
|
}
|
|
|
|
double sPayTot = 0;
|
|
ArrayList alPaylist = (ArrayList)StateObject.GetItemObject(Column.TR_PAYMENT.ITEM);
|
|
for (int iRow = 0; iRow < alPaylist.Count; iRow++)
|
|
{
|
|
Column.TR_PAYMENT.DATA cPayItem = (Column.TR_PAYMENT.DATA)alPaylist[iRow];
|
|
if (cPayItem.CANCEL_DIV == PosConst.CANCEL_DIV.CANCEL) continue;
|
|
double sPayAmt = cPayItem.PAY_AMT;
|
|
sPayTot = sPayTot + sPayAmt; //결제금액
|
|
}
|
|
|
|
iAirPosPayTot = sIncheonPayTot + sPayTot;
|
|
*/
|
|
#endregion
|
|
|
|
#region SPCPOS의 실판매금액과 인천공항 통합POS의 실판매금액 비교하기
|
|
//반품 시 금액비교 안하는걸로.
|
|
/*
|
|
if ((iGrdTotAmt * -1) != iAirPosPayTot)
|
|
{
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"Get Incheon Airport POS TR Data - Amount difference! (Airport Amt : " + iAirPosPayTot.ToString() + ", SPCPOS Amt : " + (iGrdTotAmt * -1).ToString() + ")");
|
|
|
|
|
|
WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0756);
|
|
return iRet;
|
|
}
|
|
*/
|
|
#endregion
|
|
|
|
#region 카드, 현금, 현금영수증 반품처리
|
|
if (pResultTY == "Y")
|
|
{
|
|
ArrayList alPayItem = (ArrayList)StateObject.GetItemObject(Column.TR_PAYMENT.ITEM);
|
|
ArrayList alEtcItem = (ArrayList)StateObject.GetItemObject(Column.TR_ETC.ITEM);
|
|
|
|
foreach (Column.AIRPOS_PAYMENT.DATA m_cAirPosPayItem in m_cAirPosPay)
|
|
{
|
|
//#20180119 start,phj
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS,System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"PosGetSalesTrEx[Return] --> " +
|
|
" Sale_Dt :" + m_cAirPosPayItem.SALE_DT +
|
|
", SALE_TY :" + m_cAirPosPayItem.SALE_TY +
|
|
", BILL_NO :" + m_cAirPosPayItem.BILL_NO +
|
|
", IF_BILL_NO :" + m_cAirPosPayItem.IF_BILL_NO +
|
|
", PAY_TY :" + m_cAirPosPayItem.PAY_TY +
|
|
", PAY_NM : " + m_cAirPosPayItem.PAY_NM);
|
|
//#20180119 end,phj
|
|
|
|
if (m_cAirPosPayItem.PAY_TY == "02")
|
|
//&& m_cAirPosPayItem.PAY_TY == "1" //1: pos승인, 2: 임의등록
|
|
{
|
|
// 결과 저장 변수 생성
|
|
Column.TR_PAYMENT.DATA m_cTempPayItem = new Column.TR_PAYMENT.DATA();
|
|
|
|
#region 카드 반품
|
|
int rPayCancel = 0;
|
|
for (int iRow = 0; iRow < alPayItem.Count; iRow++)
|
|
{
|
|
Column.TR_PAYMENT.DATA cPayItem = (Column.TR_PAYMENT.DATA)alPayItem[iRow];
|
|
if (cPayItem.PAY_WAY_CD == "02" && cPayItem.PAY_DTL_CD_01 == "00")
|
|
{
|
|
double dPayAmt = 0;
|
|
dPayAmt = m_cAirPosPayItem.PAY_AMT * -1;
|
|
if (cPayItem.PAY_AMT != dPayAmt) continue; // 결제금액이 틀리면 다음
|
|
if (pBillNo != m_cAirPosPayItem.BILL_NO) continue; // 영수증번호가 틀리면 다음
|
|
//if (cPayItem.OCCUR_ENTRY_06 != m_cAirPosPayItem.CARD_AP_NO) continue; // 승인번호가 틀리면 다음
|
|
|
|
cPayItem.OCCUR_ENTRY_06 = cPayItem.OCCUR_ENTRY_02; //원승인번호
|
|
cPayItem.OCCUR_ENTRY_07 = cPayItem.OCCUR_ENTRY_03; //원승인일자
|
|
cPayItem.OCCUR_ENTRY_02 = m_cAirPosPayItem.CARD_AP_NO;//승인번호
|
|
//cPayItem.OCCUR_ENTRY_03 = m_cAirPosPayItem.CASH_AP_DT;//승인일자
|
|
//cPayItem.OCCUR_ENTRY_04 = m_cAirPosPayItem.CASH_AP_TM;//승인시간
|
|
cPayItem.OCCUR_ENTRY_03 = CmUtil.MidH(m_cAirPosPayItem.CARD_AP_DT, 2, m_cAirPosPayItem.CARD_AP_DT.Length - 2);//승인일자
|
|
cPayItem.OCCUR_ENTRY_04 = CmUtil.MidH(m_cAirPosPayItem.CARD_AP_TM, 0, 4);//승인시간
|
|
//cPayItem.OCCUR_ENTRY_17 = GetSignFlag(m_sSign.Length > 0 ? "1" : "0", cPayItem.PAY_AMT); //사인유무
|
|
rPayCancel = 1;
|
|
break;
|
|
}
|
|
}
|
|
// 카드 결제 매칭 데이터 유무 (0: 매칭 데이터 없음. 1: 매칭 데이터 있음.)
|
|
if (rPayCancel != 1)
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"Incheon Airport - No Card Maching Data (" + m_cAirPosPayItem.CARD_AP_NO + ")");
|
|
}
|
|
#endregion
|
|
}
|
|
|
|
//#20180117 돈통오픈 start,phj
|
|
else if (m_cAirPosPayItem.PAY_TY == "01")
|
|
{
|
|
//반품 시 돈통 오픈 안되었을 것 같음!! 일단주석처리.
|
|
//m_cCashDrawer.OpenCashDrawer(); // 돈통 OPEN 처리
|
|
}
|
|
//#20180117 돈통오픈 end,phj
|
|
|
|
else if (m_cAirPosPayItem.PAY_TY == "04")
|
|
{
|
|
// 결과 저장 변수 생성
|
|
Column.TR_ETC.DATA m_cTempEtcItem = new Column.TR_ETC.DATA();
|
|
|
|
#region 현금영수증 반품
|
|
int rPayCancel = 0;
|
|
for (int iRow = 0; iRow < alEtcItem.Count; iRow++)
|
|
{
|
|
Column.TR_ETC.DATA cEtcItem = (Column.TR_ETC.DATA)alEtcItem[iRow];
|
|
if (cEtcItem.ETC_WAY_CD == "80" && cEtcItem.ETC_DTL_CD_01 == "00")
|
|
{
|
|
double dPayAmt = 0;
|
|
dPayAmt = m_cAirPosPayItem.CASH_AP_AMT * -1;
|
|
if (cEtcItem.ETC_AMT != dPayAmt) continue; // 결제금액이 틀리면 다음
|
|
if (pBillNo != m_cAirPosPayItem.BILL_NO) continue; // 영수증번호가 틀리면 다음
|
|
|
|
cEtcItem.OCCUR_ENTRY_06 = cEtcItem.OCCUR_ENTRY_02; //원승인번호
|
|
cEtcItem.OCCUR_ENTRY_07 = cEtcItem.OCCUR_ENTRY_03; //원승인일자
|
|
cEtcItem.OCCUR_ENTRY_02 = m_cAirPosPayItem.CASH_AP_NO;//승인번호
|
|
|
|
//cEtcItem.OCCUR_ENTRY_03 = m_cAirPosPayItem.CASH_AP_DT;//승인일자
|
|
//cEtcItem.OCCUR_ENTRY_04 = m_cAirPosPayItem.CASH_AP_TM;//승인시간
|
|
cEtcItem.OCCUR_ENTRY_03 = CmUtil.MidH(m_cAirPosPayItem.CASH_AP_DT, 2, m_cAirPosPayItem.CASH_AP_DT.Length - 2);//승인일자
|
|
cEtcItem.OCCUR_ENTRY_04 = CmUtil.MidH(m_cAirPosPayItem.CASH_AP_TM, 0, 4);//승인시간
|
|
rPayCancel = 1;
|
|
}
|
|
}
|
|
// 현금영수증 결제 매칭 데이터 유무 (0: 매칭 데이터 없음. 1: 매칭 데이터 있음.)
|
|
if (rPayCancel != 1)
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"Incheon Airport - No CashBill Maching Data (" + m_cAirPosPayItem.CARD_AP_NO + ")");
|
|
}
|
|
#endregion
|
|
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
iRet = 1;
|
|
}
|
|
else
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"Get Incheon Airport POS TR Data - not exist! (" + pSaleTY + ")");
|
|
|
|
WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0757);
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"Get IncheonAirport POS TR Data - End! (" + iRet + ")");
|
|
|
|
return iRet;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"Get Incheon Airport POS TR Data - Error! (" + iRet + ") " + ex.Message);
|
|
|
|
return iRet;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 인천공항 POS로 TRAN 전송
|
|
//private bool b_AirPort_Pos(string pAirPosCompCd, string pAirPosStorCd, string pAirPosPosNo, string pTypeDiv)
|
|
private bool b_AirPort_Pos(string pTypeDiv)
|
|
{
|
|
bool bRet = false;
|
|
|
|
try
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** IncheonAirport Tran Start! TypeDiv : " + pTypeDiv);
|
|
|
|
#region 인천공항 DB 상태 체크
|
|
int iRtn = posapi.PosDBConnectDBStatus();
|
|
if (iRtn != 1)
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** IncheonAirport Tran - DB Status Error : " + iRtn.ToString());
|
|
return bRet;
|
|
}
|
|
#endregion
|
|
|
|
#region 결제, 상품 리스트 전송 시도
|
|
if (pTypeDiv == "TRAN")
|
|
{
|
|
// 상품 리스트 전송
|
|
//if (i_AirPort_Pos_TRAN(pAirPosCompCd, pAirPosStorCd, pAirPosPosNo) == 1)
|
|
if (i_AirPort_Pos_TRAN() == 1)
|
|
{
|
|
bRet = true;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** IncheonAirport Tran End! result : " + bRet.ToString());
|
|
|
|
return bRet;
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** AirPort_Pos Result Error : " + bRet.ToString() + " " + ex.Message);
|
|
|
|
return bRet;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 인천공항 통합POS에서 개점일자 조회
|
|
private int i_AirPort_Pos_GetOpenVWEx()
|
|
{
|
|
int iRet = -1;
|
|
try
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** IncheonAirport PosGetOpenVW. start! ");
|
|
|
|
// 인천공항 PosDBApi.dll / PosDBApi.tlb 파일 존재 여부 검사
|
|
if (b_AirPort_Pos_FileExist() == false) return iRet;
|
|
|
|
// 인천공항 pos에서 통합POS에서 개점일자 조회
|
|
// PosGetOpenVW ( String 리턴 )
|
|
// *************************************************
|
|
// 0. 통합POS에서 개점일자 조회
|
|
// 1. 파라미터 없음
|
|
// 2. 리턴 - 개점구분(Y:개점, N:마감)
|
|
// - 개점일자(YYYYMMDD)
|
|
// *************************************************
|
|
#region 통합POS에서 개점일자 조회 (PosGetOpenVWEx)
|
|
ADODB.Recordset rs = new ADODB.Recordset();
|
|
rs = posapi.PosGetOpenVWEx();
|
|
|
|
if (rs != null || rs.RecordCount > 0)
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** IncheonAirport PosGetOpenVW. count : " + rs.RecordCount.ToString());
|
|
|
|
string TempData = rs.GetString(StringFormatEnum.adClipString, -1, "|", "#~", "");
|
|
|
|
string[] aRowData = null;
|
|
aRowData = TempData.Split(new string[] { "#~" }, StringSplitOptions.None);
|
|
string[] aColData = null;
|
|
aColData = aRowData[0].Split(new string[] { "|" }, StringSplitOptions.None);
|
|
|
|
string sOpenTy = string.Empty;
|
|
sOpenTy = aColData[0];
|
|
string sOpenDt = string.Empty;
|
|
sOpenDt = aColData[1];
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** IncheonAirport PosGetOpenVW. Open Date : " + sOpenDt + ", Open Type : " + sOpenTy + "(Y:OPEN/N:CLOSE)");
|
|
// 마감
|
|
if (sOpenTy == "N")
|
|
{
|
|
WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0758);
|
|
return iRet;
|
|
}
|
|
|
|
// SPCPOS - INCHEON AIRPORT POS 오픈일자 비교
|
|
if (m_cTrnStatus.Head.SaleDate != sOpenDt)
|
|
{
|
|
WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0759);
|
|
return iRet;
|
|
}
|
|
|
|
iRet = 1;
|
|
}
|
|
else
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** IncheonAirport PosGetOpenVW. Not bring IncheonAirport POS Open-Date! ");
|
|
}
|
|
#endregion
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** IncheonAirport PosGetOpenVW. end! ");
|
|
|
|
return iRet;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** IncheonAirport PosGetOpenVW. Error! " + ex.Message);
|
|
|
|
return iRet;
|
|
}
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
#region 인천공항 PosDBApi.dll / PosDBApi.tlb 파일 존재 여부 검사
|
|
private bool b_AirPort_Pos_FileExist()
|
|
{
|
|
bool bRet = false;
|
|
string sDirectory = BaseCom.NxBinPath;
|
|
string sFileName1 = "PosDBApi.dll";
|
|
//string sFileName2 = "PosDBApi.tlb";
|
|
try
|
|
{
|
|
//if (CmUtil.Exists(sDirectory + sFileName1) == true && CmUtil.Exists(sDirectory + sFileName2) == true)
|
|
if (CmUtil.Exists(sDirectory + sFileName1) == true)
|
|
{
|
|
bRet = true;
|
|
}
|
|
else
|
|
{
|
|
bRet = false;
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** " + sDirectory + " -> PosDBApi.dll file not Exist ");
|
|
}
|
|
return bRet;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
" ** " + sDirectory + " -> PosDBApi.dll Exists Check Error " + ex.Message);
|
|
|
|
return bRet;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
//**************************************************************************************************************
|
|
|
|
#region 결제마감하기
|
|
//sMenuKey 메뉴기능키, sCloseGb 인천공항 통합포스 버튼 선택한 경우 Y
|
|
public string IncheonAireportClose(string sMenuKey, string sCloseGb)
|
|
{
|
|
string sRet = UserCom.RST_ERR;
|
|
|
|
try
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"IncheonAirport Data transmission - Start! MenuKey : " + sMenuKey + " , BtnClickYN : " + sCloseGb);
|
|
|
|
//#20171227 인천공항 포스연동 start, phj - #20180313
|
|
|
|
bool bCashPayCheck = false;
|
|
//#20171227 인천공항 포스연동 start, phj - #20180313
|
|
bool bEtcPayCheck = false;
|
|
//#20171227 인천공항 포스연동 end, phj - #20180313
|
|
|
|
ArrayList alPayItem = (ArrayList)StateObject.GetItemObject(Column.TR_PAYMENT.ITEM);
|
|
for (int iRow = 0; iRow < alPayItem.Count; iRow++)
|
|
{
|
|
Column.TR_PAYMENT.DATA cPayItem = (Column.TR_PAYMENT.DATA)alPayItem[iRow];
|
|
|
|
if (cPayItem.PAY_WAY_CD == ItemConst.TR_ITEM_ID.CASH_ITEM && cPayItem.PAY_DTL_CD_01 == ItemConst.TR_ITEM_ID.CASH.CASH_PAY)
|
|
{
|
|
//#20171227 인천공항 포스연동 start, phj - #20180313
|
|
if (cPayItem.CANCEL_DIV == PosConst.CANCEL_DIV.CANCEL) continue;
|
|
//#20171227 인천공항 포스연동 end, phj - #20180313
|
|
bCashPayCheck = true;
|
|
|
|
//#20171227 인천공항 포스연동 start, phj - #20180313
|
|
//break;
|
|
//#20171227 인천공항 포스연동 end, phj - #20180313
|
|
|
|
}
|
|
|
|
//#20171227 인천공항 포스연동 start, phj - #20180313
|
|
else
|
|
{
|
|
// 현금결제 이 외의 다른 결제 수단 있는지 체크
|
|
if (cPayItem.CANCEL_DIV == PosConst.CANCEL_DIV.CANCEL) continue;
|
|
bEtcPayCheck = true;
|
|
}
|
|
//#20171227 인천공항 포스연동 end, phj - #20180313
|
|
}
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"IncheonAirport Data transmission - Cash Pay Check! " + bCashPayCheck.ToString());
|
|
|
|
//#20171227 인천공항 포스연동 start, phj - #20180313
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"IncheonAirport Data transmission - Etc Pay Check! " + bEtcPayCheck.ToString());
|
|
|
|
if (bCashPayCheck == true)
|
|
{
|
|
sRet = UserCom.RST_OK;
|
|
return sRet;
|
|
}
|
|
//#20171227 인천공항 포스연동 end, phj - #20180313
|
|
|
|
// DB Connect
|
|
if (i_Airport_Start() != 1)
|
|
{
|
|
return sRet;
|
|
}
|
|
|
|
// 통합POS에서 개점일자 체크 (마감되었거나, 개점일이 틀리면 -1)
|
|
if (i_AirPort_Pos_GetOpenVWEx() != 1)
|
|
{
|
|
return sRet;
|
|
}
|
|
|
|
|
|
//#20180213 인천공항 빌 번호 체크 start,phj
|
|
if (IncheonAirportBillCheck() == false)
|
|
{
|
|
WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0770);
|
|
return sRet;
|
|
}
|
|
//#20180213 인천공항 빌 번호 체크 end,phj
|
|
|
|
// 해당 빌 상태 체크
|
|
int iAirPosTrStatus = 0;
|
|
iAirPosTrStatus = i_AirPort_PosGetSalesTrStatus(m_cPosStatus.Base.SaleDate, m_cPosStatus.Base.TradeNo);
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"IncheonAirport Data transmission - Bill Check : " + iAirPosTrStatus.ToString());
|
|
|
|
//#20180119 로직변경 start,phj
|
|
//if (sCloseGb == "Y")
|
|
//{
|
|
//#20180119 로직변경 end,phj
|
|
|
|
#region 인천공항 결제완료 버튼눌렀을때
|
|
|
|
bool bTran_Result = false;
|
|
|
|
if (iAirPosTrStatus == 302)
|
|
{
|
|
WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0760);
|
|
i_AirPort_End();// DB DisConnect
|
|
return sRet;
|
|
}
|
|
else if (iAirPosTrStatus == 303)
|
|
{
|
|
WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0761);
|
|
i_AirPort_End();// DB DisConnect
|
|
return sRet;
|
|
}
|
|
|
|
// SPCPOS의 상품 리스트, 결제 리스트를 인천공항 통합POS로 보내기.
|
|
//bTran_Result = b_AirPort_Pos(m_cPosStatus.IncheonAirport.AirportComp, m_cPosStatus.IncheonAirport.AirportStore, m_cPosStatus.IncheonAirport.AirportPosNo, "TRAN");
|
|
bTran_Result = b_AirPort_Pos("TRAN");
|
|
|
|
// DB DisConnect
|
|
i_AirPort_End();
|
|
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"IncheonAirport Data transmission - ItemList , PayList Tran " + bTran_Result.ToString());
|
|
|
|
|
|
if (bTran_Result == true)
|
|
{
|
|
//#20171227 인천공항 포스연동 start, phj - #20180313
|
|
|
|
//기존
|
|
#region 주석처리
|
|
|
|
////#20180119 로직변경 start,phj
|
|
////기존
|
|
////sRet = UserCom.RST_OK;
|
|
////변경
|
|
////if (m_cTrnStatus.Sale.RemainPayAmt > 0)
|
|
//if ((m_cTrnStatus.Sale.RemainPayAmt == 0) ||
|
|
// ((m_cTrnStatus.Sale.RemainPayAmt > 0) && (m_cPosStatus.Base.CmpCd.Equals("PCUS") && m_cTrnStatus.Head.TradeKind == ItemConst.TRAN_KIND.UNDECIDED.RESERVATION_REG)))
|
|
//{
|
|
// //#20180130 start,phj
|
|
// //인천공항 결제화면 밖에서 전체할인 경우 결제완료 진행 안됨.
|
|
// //그래서 결제화면에서 기능키 누르고 진행할 수 있도록 수정.
|
|
// //기존
|
|
// /*
|
|
// if (sCloseGb == "N")
|
|
// {
|
|
// sRet = UserCom.RST_OK;
|
|
// }
|
|
// */
|
|
|
|
// //변경
|
|
// sRet = UserCom.RST_OK;
|
|
// //#20180130 end,phj
|
|
//}
|
|
//else
|
|
//{
|
|
// string sFirstValue = string.Empty;
|
|
// sFirstValue = m_cPosStatus.Global.NumericTOCurrency(m_cTrnStatus.Sale.RemainPayAmt);
|
|
|
|
// sRet = m_cPaymentUs.SetPayment(new string[] { m_cDataService.DoubleParse(sFirstValue).ToString(), PosKey.MENU_KEY.CASH, "", "", "", "", "", "" });
|
|
// if (sRet != UserCom.RST_OK) //return false;
|
|
// {
|
|
// UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
// System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
// System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
// "IncheonAirport Data transmission - Cash bill fail!!! ");
|
|
// }
|
|
|
|
// //#20180129 현금결제 존재 시 돈통오픈 start,phj
|
|
// // 돈통오픈처리!!!
|
|
// m_cCashDrawer.OpenCashDrawer();
|
|
// //#20180129 현금결제 존재 시 돈통오픈 end,phj
|
|
//}
|
|
////#20180119 로직변경 end,phj
|
|
#endregion
|
|
|
|
//변경
|
|
//받을금액0원이고, 주문번호화면 닫았고 인천공항으로 데이터 재전송 할 경우 두번 현금 데이터 생성하지 않도록 리턴!
|
|
//주문화면 결과가 false 경우 PosConst.SALE_FLOW.PAY_DOING으로 모드변경됨!
|
|
//if (m_cTrnStatus.Sale.RemainPayAmt == 0 && m_cPosStatus.Sale.SaleFlow == PosConst.SALE_FLOW.PAY_DOING)
|
|
//{
|
|
// sRet = UserCom.RST_OK;
|
|
// return sRet;
|
|
//}
|
|
|
|
//if ((m_cTrnStatus.Sale.RemainPayAmt == 0 && m_cPosStatus.Sale.SaleFlow == PosConst.SALE_FLOW.PAY_DOING) || //받을금액0원이고결제중모드이거나
|
|
// m_cTrnStatus.Sale.RemainPayAmt != 0) //받을금액이0원이 아닐 때
|
|
//{
|
|
|
|
|
|
if (m_cTrnStatus.Sale.RemainPayAmt == 0 && bEtcPayCheck == true)
|
|
{
|
|
sRet = UserCom.RST_OK;
|
|
return sRet;
|
|
}
|
|
|
|
string sRemainPayAmt = string.Empty;
|
|
sRemainPayAmt = m_cPosStatus.Global.NumericTOCurrency(m_cTrnStatus.Sale.RemainPayAmt);
|
|
|
|
// 0원 또는 받을금액 존재 시 현금 데이터 생성.
|
|
sRet = m_cPaymentUs.SetPayment(new string[] { m_cDataService.DoubleParse(sRemainPayAmt).ToString(), PosKey.MENU_KEY.CASH, "", "", "", "", "", "" });
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"IncheonAirport Data transmission - cash Bill " + sRet.ToString() + "! " + sRemainPayAmt);
|
|
|
|
if (sRet != UserCom.RST_OK)
|
|
{
|
|
sRet = UserCom.RST_ERR;
|
|
return sRet;
|
|
}
|
|
|
|
// 받을금액이 0원이 아닐 때 돈통오픈.
|
|
if (m_cTrnStatus.Sale.RemainPayAmt != 0)
|
|
{
|
|
m_cCashDrawer.OpenCashDrawer(); // 돈통오픈처리!!!
|
|
}
|
|
//}
|
|
//#20171227 인천공항 포스연동 end, phj - #20180313
|
|
|
|
sRet = UserCom.RST_OK;
|
|
}
|
|
else
|
|
{
|
|
sRet = UserCom.RST_ERR;
|
|
}
|
|
#endregion
|
|
|
|
//#20180119 로직변경 start,phj
|
|
/*
|
|
}
|
|
else if (sCloseGb == "N")
|
|
{
|
|
#region 잔액0원으로바로마감루틴탈때
|
|
|
|
bool bTran_Result = false;
|
|
|
|
if (iAirPosTrStatus == 302)
|
|
{
|
|
WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0760);
|
|
i_AirPort_End();
|
|
return sRet;
|
|
}
|
|
|
|
// 301 : 공항POS쪽에 해당빌에 대한 데이터가 없으면 공항POS 팝업
|
|
// 304 : 공항POS쪽에 해당빌에 대한 취소된 상태면 공항POS 팝업
|
|
if (iAirPosTrStatus == 301 || iAirPosTrStatus == 304)
|
|
{
|
|
// SPCPOS의 상품 리스트, 결제 리스트를 인천공항 통합POS로 보내기.
|
|
//bTran_Result = b_AirPort_Pos(m_cPosStatus.IncheonAirport.AirportComp, m_cPosStatus.IncheonAirport.AirportStore, m_cPosStatus.IncheonAirport.AirportPosNo, "TRAN");
|
|
bTran_Result = b_AirPort_Pos("TRAN");
|
|
|
|
// DB DisConnect
|
|
i_AirPort_End();
|
|
}
|
|
|
|
if (bTran_Result == true)
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"IncheonAirport Data transmission - ItemList , PayList Tran Success!!! ");
|
|
|
|
sRet = UserCom.RST_OK;
|
|
}
|
|
else
|
|
{
|
|
if (m_cTrnStatus.Sale.RemainPayAmt == 0 && iAirPosTrStatus == 303)
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"IncheonAirport Data transmission - ItemList , PayList Tran Auto Success!!! ");
|
|
//결제완료처리
|
|
sRet = UserCom.RST_IGNORE;
|
|
}
|
|
else
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"IncheonAirport Data transmission - ItemList , PayList Tran Failure!!! ");
|
|
//
|
|
sRet = UserCom.RST_ERR;
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
*/
|
|
//#20180119 로직변경 end,phj
|
|
|
|
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"IncheonAirport Data transmission - End! MenuKey : " + sMenuKey + " , ClosegGB : " + sCloseGb);
|
|
|
|
return sRet;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." + System.Reflection.MethodBase.GetCurrentMethod().Name + "()", ex.Message);
|
|
|
|
i_AirPort_End(); // DB DisConnect
|
|
|
|
return sRet;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 인천공항 POS 반품 시
|
|
public int i_return_Data(string pSaleDate, string pOld_bill, string pNew_BillNo, string pSaleTY, string pResultTY)
|
|
{
|
|
int iRet = -1;
|
|
|
|
try
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"IncheonAirpot Return Start ! (SaleDate :" + pSaleDate + ", Old_bill :" + pOld_bill + ", New_BillNo :" + pNew_BillNo + ", SaleTY :" + pSaleTY + ", ResultTY :" + pResultTY + ")");
|
|
|
|
// DB Connect
|
|
if (i_Airport_Start() != 1)
|
|
{
|
|
return iRet;
|
|
}
|
|
|
|
int iTran_Result = 0;
|
|
iTran_Result = i_AirPort_PosGetSaleTr(pSaleDate, pOld_bill, pNew_BillNo, pSaleTY, pResultTY);
|
|
|
|
i_AirPort_End();
|
|
|
|
if (iTran_Result == 1)
|
|
{
|
|
iRet = 1;
|
|
}
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"IncheonAirpot Return end !");
|
|
|
|
return iRet;
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"IncheonAirport Return Error : " + iRet + ex.Message);
|
|
|
|
i_AirPort_End();
|
|
|
|
return iRet;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
//#20180123 인천공항 포스 경우 대기번호 입력창 닫을 때 인천공항 상태 체크하도록 수정 start,phj
|
|
#region 대기번호 입력화면에서 인천공항 상태체크
|
|
public string IncheonAirportCheck()
|
|
{
|
|
string sRet = UserCom.RST_ERR;
|
|
try
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"IncheonAirport State Check - Start! ");
|
|
|
|
// DB Connect
|
|
if (i_Airport_Start() != 1)
|
|
{
|
|
return sRet;
|
|
}
|
|
|
|
// 해당 빌 상태 체크
|
|
int iAirPosTrStatus = 0;
|
|
iAirPosTrStatus = i_AirPort_PosGetSalesTrStatus(m_cTrnStatus.Head.SaleDate, m_cPosStatus.Base.TradeNo);
|
|
if (iAirPosTrStatus != 303)
|
|
{
|
|
WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0762);
|
|
i_AirPort_End(); // 통합POS로 DB 연결 해제
|
|
return sRet;
|
|
}
|
|
|
|
sRet = UserCom.RST_OK;
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"IncheonAirport State Check - End! (" + sRet + ")");
|
|
|
|
return sRet;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"IncheonAirport State Check - Error! " + ex.Message);
|
|
|
|
i_AirPort_End(); // 통합POS로 DB 연결 해제
|
|
return sRet;
|
|
}
|
|
}
|
|
#endregion
|
|
//#20180123 인천공항 포스 경우 대기번호 입력창 닫을 때 인천공항 상태 체크하도록 수정 end,phj
|
|
|
|
|
|
#region 인천공항 통합POS 조회
|
|
public string PaySearchClick()
|
|
{
|
|
string sRet = UserCom.RST_ERR;
|
|
try
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"IncheonAirport Data Search - Start! ");
|
|
|
|
// DB Connect
|
|
if (i_Airport_Start() != 1)
|
|
{
|
|
return sRet;
|
|
}
|
|
|
|
// 해당 빌 상태 체크
|
|
int iAirPosTrStatus = 0;
|
|
iAirPosTrStatus = i_AirPort_PosGetSalesTrStatus(m_cTrnStatus.Head.SaleDate, m_cPosStatus.Base.TradeNo);
|
|
if (iAirPosTrStatus != 303)
|
|
{
|
|
WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0762);
|
|
i_AirPort_End(); // 통합POS로 DB 연결 해제
|
|
return sRet;
|
|
}
|
|
|
|
// 인천공항 통합POS의 결제 데이터 가져오기
|
|
int iTran_Result = 0;
|
|
iTran_Result = i_AirPort_PosGetSaleTr(m_cTrnStatus.Head.SaleDate, m_cPosStatus.Base.TradeNo, "", "0", "Y");
|
|
i_AirPort_End(); // 통합POS로 DB 연결 해제
|
|
|
|
if (iTran_Result == 1) { sRet = UserCom.RST_OK; }
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"IncheonAirport Data Search - End! (" + sRet + ")");
|
|
|
|
return sRet;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"IncheonAirport Data Search - Error! " + ex.Message);
|
|
|
|
i_AirPort_End(); // 통합POS로 DB 연결 해제
|
|
return sRet;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 인천공항 통합POS 요청
|
|
public string PayRequestClick()
|
|
{
|
|
string sRet = UserCom.RST_ERR;
|
|
bool bAirPosTrGB = false;
|
|
int iAirPosTrStatus = 0;
|
|
|
|
try
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"Incheon Airport Pay Request - Start! ");
|
|
// DB Connect
|
|
if (i_Airport_Start() != 1)
|
|
{
|
|
return sRet;
|
|
}
|
|
|
|
// 해당 빌 상태 체크
|
|
iAirPosTrStatus = i_AirPort_PosGetSalesTrStatus(m_cTrnStatus.Head.SaleDate, m_cPosStatus.Base.TradeNo);
|
|
if (iAirPosTrStatus == 302)
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"Incheon Airport Pay Request - PosGetSalesTrStatus : " + iAirPosTrStatus);
|
|
|
|
//WinManager.ConfirmMessage("통합POS에서 결제 대기 중 입니다.");
|
|
WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0760);
|
|
i_AirPort_End();// DB DisConnect
|
|
return sRet;
|
|
}
|
|
else if (iAirPosTrStatus == 303)
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"Incheon Airport Pay Request - PosGetSalesTrStatus : " + iAirPosTrStatus);
|
|
|
|
WinManager.ConfirmMessage("통합POS에서 이미 결제 되었습니다.");
|
|
i_AirPort_End();// DB DisConnect
|
|
return sRet;
|
|
}
|
|
|
|
// 통합POS로 TRAN 전송
|
|
//bAirPosTrGB = b_AirPort_Pos(m_cPosStatus.IncheonAirport.AirportComp, m_cPosStatus.IncheonAirport.AirportStore, m_cPosStatus.IncheonAirport.AirportPosNo, "TRAN");
|
|
bAirPosTrGB = b_AirPort_Pos("TRAN");
|
|
|
|
// 통합POS로 DB 연결 해제
|
|
i_AirPort_End();
|
|
|
|
sRet = UserCom.RST_OK;
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"Incheon Airport Pay Request - End! (" + sRet + ")");
|
|
|
|
return sRet;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"Incheon Airport Pay Request - Error! " + ex.Message);
|
|
|
|
i_AirPort_End();
|
|
return sRet;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 인천공항 통합POS 닫기
|
|
public string CloseClick()
|
|
{
|
|
string sRet = UserCom.RST_ERR;
|
|
try
|
|
{
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"Incheon Airpot Form Close Start! ");
|
|
|
|
// DB Connect
|
|
if (i_Airport_Start() != 1)
|
|
{
|
|
return sRet;
|
|
}
|
|
|
|
// 해당 빌 상태 체크
|
|
int iAirPosTrStatus = 0;
|
|
iAirPosTrStatus = i_AirPort_PosGetSalesTrStatus(m_cTrnStatus.Head.SaleDate, m_cPosStatus.Base.TradeNo);
|
|
|
|
// DB DisConnect
|
|
i_AirPort_End();
|
|
|
|
if (iAirPosTrStatus == 302)
|
|
{
|
|
//WinManager.ConfirmMessage("통합POS에서 일괄취소가 되지 않았습니다.");
|
|
WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0763);
|
|
return sRet;
|
|
}
|
|
|
|
if (iAirPosTrStatus == 303)
|
|
{
|
|
//WinManager.ConfirmMessage("통합POS에서 이미 결제완료 되었습니다.");
|
|
WinManager.ConfirmMessage(POS_MESSAGE.ERROR.MSG_0761);
|
|
return sRet;
|
|
}
|
|
|
|
sRet = UserCom.RST_OK;
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"Incheon Airpot Form End! ");
|
|
|
|
return sRet;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"Incheon Airpot Form Error! " + ex.Message);
|
|
// DB DisConnect
|
|
i_AirPort_End();
|
|
return sRet;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
//#20180213 인천공항 빌 번호 체크 start,phj
|
|
#region 인천공항 빌번호 가져오기
|
|
public bool IncheonAirportBillCheck()
|
|
{
|
|
try
|
|
{
|
|
// 인천공항 빌 번호 가져오기
|
|
string IncheonAirport_BillNo = string.Empty;
|
|
string TempData = string.Empty;
|
|
string[] aRowData = null;
|
|
string[] aColData = null;
|
|
|
|
// DB Connect
|
|
if (i_Airport_Start() != 1) { return false; }
|
|
|
|
// 인천공항 PosDBApi.dll / PosDBApi.tlb 파일 존재 여부 검사
|
|
if (b_AirPort_Pos_FileExist() == false) return false;
|
|
|
|
ADODB.Recordset rs_bill = new ADODB.Recordset();
|
|
rs_bill = posapi.PosGetMaxBillVWEx(m_cPosStatus.Base.SaleDate);
|
|
|
|
if (rs_bill == null || rs_bill.RecordCount <= 0)
|
|
{
|
|
IncheonAirport_BillNo = "0";
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"IncheonAirportBillCheck --> IncheonAirport BillNo : null or Count <= 0 " + ", (Previous) SPC Pos BillNo :" + m_cPosStatus.Base.TradeNo);
|
|
|
|
|
|
}
|
|
else
|
|
{
|
|
TempData = rs_bill.GetString(StringFormatEnum.adClipString, -1, "|", "#~", "");
|
|
|
|
aRowData = TempData.Split(new string[] { "#~" }, StringSplitOptions.None);
|
|
aColData = aRowData[0].Split(new string[] { "|" }, StringSplitOptions.None);
|
|
|
|
IncheonAirport_BillNo = aColData[0];
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"IncheonAirportBillCheck --> IncheonAirport BillNo :" + IncheonAirport_BillNo + ", (Previous) SPC Pos BillNo :" + m_cPosStatus.Base.TradeNo);
|
|
}
|
|
|
|
// 자사포스 빌번호보다 인천공항 빌번호가 크거나 같으면 자사포스 빌번호 1 증가
|
|
if (CmUtil.IntParse(IncheonAirport_BillNo) >= CmUtil.IntParse(m_cPosStatus.Base.TradeNo))
|
|
{
|
|
m_cPosStatus.Base.TradeNo = string.Format("{0:D05}", CmUtil.IntParse(IncheonAirport_BillNo) + 1);
|
|
|
|
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"IncheonAirportBillCheck --> IncheonAirport BillNo :" + IncheonAirport_BillNo + ", (After) SPC Pos BillNo :" + m_cPosStatus.Base.TradeNo);
|
|
}
|
|
|
|
return true;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
|
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." +
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name + "()",
|
|
"IncheonAirportBillCheck --> IncheonAirport BIll No Check - Error! " + ex.Message);
|
|
|
|
return false;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
//#20180213 인천공항 빌 번호 체크 end,phj
|
|
}
|
|
}
|
|
|