DEFINE CURSOR oCursor RESOURCE "DRAGTRN2"
DEFINE DIALOG oDlgf RESOURCE cFolGst TITLE TE(0396,'โฟลิโอแขกพักห้อง','Guest In House Folio') ;
COLOR FONTTHEME, MEMVAR->THEME2020 ;
FONT MEMVAR->oFont
oDlgf:lHelpIcon := .F.
REDEFINE FOLDER oFld ID 102 OF oDlgf ;
PROMPTS 'Folio# 1 ',;
'Folio# 2 ',;
'Folio# 3 ',;
'Folio# 4 ',;
'Folio# 5 ',;
'Folio# 6 ',;
'Folio# 7 ',;
'Folio# 8 ',;
'Folio# 9 ' ;
DIALOGS cFolList, ;
cFolList, ;
cFolList, ;
cFolList, ;
cFolList, ;
cFolList, ;
cFolList, ;
cFolList, ;
cFolList ;
COLOR FONTTHEME, MEMVAR->THEME2020
// oFld:lAllWidth := .T.
oFld:bChange := { || oFld_Con() }
oFld:oFont := oFnt[4]
// Drag & Drop
oFld:bDropOver = { |uDropInfo,nRow,nCol,nKeyFlags| MoveTrns(0,nRow,nCol) }
REDEFINE XBROWSE oTbw COLUMNS 'tbl_rmno', ;
'ChkSt(oTBL)', ;
'', ;
'tbl_last', ;
'tbl_com', ;
'tbl_group', ;
'TotalFolio(oTBL)' ;
FIELDSIZES aGstsSize ;
HEADERS TE(0062,'ห้อง','Room'),;
TE(0490,'เช็ค','Chk'),;
TE('ออฟไลน์','Offline'),;
TE(0299,'ชื่อแขก','Guest Name'),;
TE(0171,'บริษัท','Company'), ;
TE(0172,'กลุ่ม','Group'), ;
TE(0398,'ยอด','Balance') ;
PICTURE ,,,,,,'999,999,999.99' ;
STYLE 2010 ;
JUSTIFY 0, 2, 2, 0, 0, 0, 1 ;
DATASOURCE oTBL ;
AUTOSORT ;
UPDATE ;
ID 101 ;
OF oDlgf
xBrStyles( oTbw, .T. )
oTbw:nHeaderHeight:= 31
oTbw:nRowHeight := 29
oTbw:aCols[1]:AddResource("LOCK1")
oTbw:aCols[1]:bBmpData := { || iif(rtrim(oTBL:tbl_lockrm)='Y', 1, 0 ) }
oTbw:aCols[1]:nDataBmpAlign := AL_RIGHT
oTbw:aCols[4]:bStrData := { ||RsGstName2(oTBL) }
oTbw:aCols[5]:bStrImage := { || iif(!empty(oTBL:gsi_image1), oTBL:gsi_image1, '' ) }
oTbw:aCols[5]:bStrData := { || iif(!empty(oTBL:gsi_image1), space(6), '' )+oTBL:tbl_com }
oTbw:bClrStd := { ||{ iif(oTBL:tbl_dep=MEMVAR->comdat , CLR_WHITE,FONTTHEME), iif(oTBL:TBL_DEP=MEMVAR->comdat , CLR_HRED, nXBckGrd( oTbw )) }}
oTbw:bClrSel := oTbw:bClrSelFocus
oTbw:bChange := { || if(!empty(oTBL:tbl_intno),(oTbl_Con(), oDlgf:aEvalWhen(), oDlgf:Update(), ReBtn2(oBtn,oBtnf) ), ) } // , SysRefresh() ) }
oTbw:bKeyDown := { | nKey | (if(upper(chr(nKey))='R' , (ReCalc(), oTBL:ReSync()) , ), oTbw:Refresh(), oTbw:SetFocus()) }
oTbw:bLDblClick := { |nRow,nCol,nKeyFlag| if(oTbw:nAt=3, (ChngOffPos(),oTbw:SetFocus(),oTbw:RefreshCurrent()), (if(!empty(val(oTBL:tbl_intno)),(RsvnScr(.F.,.T.,oTBL), oTbw:SetFocus(), oDlgf:Refresh(), ReGets()), )) ) }
oTbw:aCols[3]:AddResource("LOCK")
oTbw:aCols[3]:bBmpData := { || iif(oTBL:tbl_offpos, 1, 0) }
oTbw:aCols[3]:nDataBmpAlign := AL_CENTER
REDEFINE SAY oSayf[3] PROMPT TE(0399,'ห้อง# : ','Room# : ') ID 300 OF oDlgf UPDATE FONT oFnt[1] COLOR FONTTHEME, MEMVAR->THEME2020
REDEFINE SAY oTbw:oSeek PROMPT oTbw:cSeek ID 299 OF oDlgf UPDATE FONT oFnt[1] COLOR CLR_GREEN, MEMVAR->THEME2020
REDEFINE SAY oSayf[2] PROMPT cAT ID 298 OF oDlgf UPDATE FONT oFnt[1] COLOR CLR_HRED, MEMVAR->THEME2020
REDEFINE SAY oSays PROMPT TE(0225,'เลขห้อง','Room No.') ID 131 OF oDlgf
REDEFINE SAY oSays PROMPT TE(0400,'ค่าห้องพัก','Room Rate') ID 132 OF oDlgf
REDEFINE SAY oSays PROMPT TE(0017,'วันเข้า','Arrival') ID 133 OF oDlgf
REDEFINE SAY oSays PROMPT TE(0233,'วันออก','Departure') ID 134 OF oDlgf
REDEFINE SAY oSays PROMPT TE(1154,'เที่ยวบิน','Flight') ID 135 OF oDlgf
// REDEFINE SAY oSays PROMPT TE(0172,'กลุ่ม','Group') ID 136 OF oDlgf
REDEFINE SAY oSays PROMPT TE(0401,'ชำระโดย','Pay by') ID 137 OF oDlgf
REDEFINE SAY oSays PROMPT TE(0209,'หมายเหตุ','Remarks') ID 138 OF oDlgf
REDEFINE SAY oGets[1] VAR oTBL:tbl_rmno ID 103 OF oDlgf FONT oFnt[2] COLOR CLR_HRED, MEMVAR->THEME2020
REDEFINE SAY oGets[20] VAR Trans( TotalFolio(oTBL),'9,999,999,999.99') ID 104 OF oDlgf FONT oFnt[2] COLOR CLR_RED, RGB( 255, 255, 128 )
oGets[20]:lTransparent := .F.
REDEFINE GET oGets[2] VAR oTBL:tbl_rate ID 105 OF oDlgf WHEN .F. FONT oFnt[4] PICTURE '@Z 99,999.99'
REDEFINE GET oGets[3] VAR oTBL:tbl_arr ID 106 OF oDlgf WHEN .F. FONT oFnt[4]
REDEFINE GET oGets[4] VAR oTBL:tbl_dep ID 107 OF oDlgf WHEN .F. FONT oFnt[4]
REDEFINE GET oGets[5] VAR oTBL:tbl_dpflt ID 108 OF oDlgf WHEN .F. FONT oFnt[4]
REDEFINE GET oGets[6] VAR oTBL:tbl_dptime ID 109 OF oDlgf WHEN .F. FONT oFnt[4]
REDEFINE GET oGets[7] VAR oTBL:tbl_pay ID 110 OF oDlgf WHEN .F. FONT oFnt[4]
REDEFINE GET oGets[8] VAR oTBL:tbl_rmk ID 111 OF oDlgf WHEN .F. FONT oFnt[1] COLOR CLR_RED, RGB(128,255,255)
REDEFINE GET oGets[9] VAR oTBL:tbl_card ID 112 OF oDlgf WHEN .F. FONT oFnt[4]
REDEFINE GET oGets[10] VAR oTBL:tbl_expire ID 113 OF oDlgf WHEN .F. FONT oFnt[4]
DEFINE CURSOR oCur HAND
REDEFINE SAY oBals VAR TRANS( TotalFolio( oTBL, str(oFld:nOption,1) ) ,'999,999,999.99') ID 128 OF oDlgf FONT oFnt[5] COLOR FONTTHEME, RGB( 255, 255, 128 )
oBals:lTransparent := .F.
REDEFINE GET oGet2[1] VAR cPay[1] ID 129 OF oDlgf COLOR CLR_WHITE, CLR_RED WHEN .F. READONLY FONT oFnt[1]
oGet2[1]:lDisColors := .F.
oGet2[1]:lTransparent := .F.
for n := 1 to 9
REDEFINE XBROWSE oTrn[n] FIELDS DTOC(TRN1:trn_date) ,;
iif(MEMVAR->PrnInvNo,iif(TRN1:trn_invno=0,'',ltrim(str(TRN1:trn_invno,10))),left(TRN1:trn_time,5)) , ;
TRN1:trn_trno , ;
TRN1:trn_order, ;
TRN1:trn_desc , ;
TRN1:trn_rmk, ;
iif(TRN1:trn_tbl=TRN1:trn_rmno,'',TRN1:trn_rmno) , ;
iif(TRN1:trn_void='V','Void','') , ;
iif(!empty(TRN1:trn_trno), iif(EMPTY(TRN1:trn_user),'AUTO',TRN1:trn_user) , '' ) , ;
iif(TRN1:trn_trno< '9000' ,ROUND(TRN1:trn_unit * TRN1:trn_qtty,2), 0 ), ; // '@Z 999,999,999.99'), ;
iif(TRN1:trn_trno>='9000' ,ROUND((TRN1:trn_unit * TRN1:trn_qtty)*-1,2),0) ; //,'@Z 999,999,999.99') ;
FIELDSIZES aColsSize ; // 70, 60, 40, 75, 220, 200, 70, 45, 90, 110, 110 ;
HEADERS TE(0203,'วันที่','Date'), ;
TE(iif(MEMVAR->PrnInvNo,'ใบแจ้งหนี้','เวลา'),iif(MEMVAR->PrnInvNo,'Invoice','Time')), ;
TE(0402,'รหัส','Trn#'), ;
TE(0403,'เลขอ้างอิง','Reference'), ;
TE(0582,'รายการ','Description'), ;
TE(0209,'หมายเหตุ','Remarks'), ;
TE(0404,'ห้องเดิม','O.Rm'), ;
TE(0405,'ยกเว้น','Void'), ;
TE(0406,'พนักงาน','UserID'), ;
TE(0354,'จำนวนเงิน','Amount'), ;
TE(0407,'ยอดชำระ','Paid') ;
DATASOURCE TRN1 ;
UPDATE ;
JUSTIFY 2 , 2 , 2 , 0 , 0 , 0 , 2 , 2 , 2 , 1 , 1 ;
PICTURE ,,,,,,,,,'@Z 99,999,999.99', '@Z 99,999,999.99' ;
ID 121 ;
STYLE 2010 ;
OF oFld:aDialogs[ n ] ;
xBrStyles( oTrn[n], .T. )
oTrn[n]:nRowDividerStyle := MARQSTYLE_NOMARQUEE
oTrn[n]:lRecordSelector := .F.
oTrn[n]:bClrStd := { ||{ SelColor(TRN1:trn_void,.F.,.F.), SelColor(TRN1:trn_void,.T.,.F.) }}
oTrn[n]:bClrSel := { ||{ SelColor(TRN1:trn_void,.F.,.T.), SelColor(TRN1:trn_void,.T.,.T.) }}
oTrn[n]:nRowHeight := 29
oTrn[n]:nFooterHeight := 28
oTrn[n]:lFooter := .T.
oTrn[n]:aCols[ 9]:bFooter := {||'Total'}
oTrn[n]:aCols[ 9]:nFootStrAlign := AL_CENTER
oTrn[n]:aCols[10]:nFooterType := AGGR_SUM
oTrn[n]:aCols[10]:bSumCondition := { |v,o| TRN1:trn_void<>'V' }
oTrn[n]:aCols[10]:cEditPicture := '@Z 9,999,999,999.99'
oTrn[n]:aCols[10]:nFootStrAlign := AL_RIGHT
oTrn[n]:aCols[11]:nFooterType := AGGR_SUM
oTrn[n]:aCols[11]:cEditPicture := '@Z 9,999,999,999.99'
oTrn[n]:aCols[11]:nFootStrAlign := AL_RIGHT
oTrn[n]:oDragCursor := oCursor
oTrn[n]:bDragBegin := { || iif(UserRights(57,.F.), ( nFolioNo := oFld:nOption ),) }
oTrn[n]:bLDblClick := { || iif(!empty(TRN1:trn_trno),NewPost( .F. , 'R' ), ) }
oTrn[n]:bChange := { || (lEnables := TRN1:trn_date=MEMVAR->COMDAT.and.!empty(TRN1:trn_trno)) , ;
(lSplit := TRN1:trn_void<>'V'.and.TRN1:trn_trno<'9000'.and.!empty(TRN1:trn_trno)) , ;
ReBtn2(oBtn,oBtnf), ;
oDlgf:aEvalWhen() , ;
oDlgf:Update() }
oTrn[n]:bKeyDown := { | nKey | (IIF(nKey = VK_INSERT.and.empty(aRecNo) , NewPost(.T.,'R') , ;
IIF(nKey = VK_RETURN , iif(!empty(TRN1:trn_trno), NewPost(.F.,'R') , ) , ;
IIF(nKey = VK_ADD , iif(!empty(TRN1:trn_trno), (MarkTrn() , (lTrnsfer := !empty(aRecNo)) , oDlgf:aEvalWhen() , oDlgf:Update() ) , ) , ;
IIF(nKey = VK_MULTIPLY, iif(!empty(TRN1:trn_trno), (MarkAll() , (lTrnsfer := !empty(aRecNo)) , oDlgf:aEvalWhen() , oDlgf:Update() ) , ) , ;
IIF(nKey = VK_DELETE , iif(!empty(TRN1:trn_trno), iif(TRN1:TRN_TRNO<'9000', (VoidTrn(TRN1:RecNo()),oTrn[oFld:nOption]:SetFocus()), NewPost(.T.,'P',,.T.)) , ) , ;
IIF(nKey = VK_INSERT.and.!empty(aRecNo) , MoveTrns( oFld:nOption, 0 , 0 ) , ) ) ) ) ) ), oTbw:Refresh()) }
oTrn[n]:Maketotals()
next
REDEFINE SAY oSayc PROMPT TE(0398,'ยอดสุทธิ','Balance') ID 125 OF oDlgf TRANSPARENT FONT oFnt[1]
REDEFINE SBUTTON oBtnf[1] ID 122 OF oDlgf ;
RESOURCE 'MARK1' ;
PROMPT TE(0264,'เลือก','Mark'); // TE(0265,'ยกเลิก','UnMark') ;
WHEN ((TRN1:trn_chkno=0.or.(TRN1:trn_chkno>0.and.UserRights(118,.F.))) .and. MEMVAR->oTBL:tbl_status='O'.and.UserRights(57,.F.) ) ; // lTrnsfer ;
ACTION ( MarkTrn(), (lTrnsfer := !empty(aRecNo)) , oDlgf:aEvalWhen() , oDlgf:Update(), ReBtn2(oBtn,oBtnf) ) ;
COLOR bSColors W97 ;
TEXT ON_BOTTOM
REDEFINE SBUTTON oBtnf[2] ID 123 OF oDlgf ;
RESOURCE 'MARKALL1' ;
PROMPT TE(0264,'เลือก','Mark')+' '+;
TE(0408,'หมด','All') ;
WHEN ((TRN1:TRN_CHKNO=0.or.(TRN1:TRN_CHKNO>0.and.UserRights(118,.F.))) .and. MEMVAR->oTBL:tbl_status='O'.and.UserRights(57,.F.) ) ; // lTrnsfer ;
ACTION (MarkAll() , (lTrnsfer := !empty(aRecNo)) , oDlgf:aEvalWhen() , oDlgf:Update(), ReBtn2(oBtn,oBtnf) ) ;
COLOR bSColors W97 ;
TEXT ON_BOTTOM
REDEFINE SBUTTON oBtnf[3] ID 130 OF oDlgf ;
RESOURCE 'MOVETRN1' ;
PROMPT TE(0409,'ย้าย','Move')+' '+;
TE(0410,'รายการ','Trns') ;
WHEN ( !empty(aRecNo).and.MEMVAR->oTBL:tbl_status='O'.and.UserRights(57,.F.) ) ; // lTrnsfer ;
ACTION ( MoveToFol(), oBtn[9]:Refresh(), oBtnf[3]:Refresh() ) ;
COLOR bSColors W97 ;
TEXT ON_BOTTOM
REDEFINE SBUTTON oSay2[1] ID 241 OF oDlgf ;
ACTION ( oFld:SetOption(1) ) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oSay2[2] ID 242 OF oDlgf ;
ACTION ( oFld:SetOption(2) ) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oSay2[3] ID 243 OF oDlgf ;
ACTION ( oFld:SetOption(3) ) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oSay2[4] ID 244 OF oDlgf ;
ACTION ( oFld:SetOption(4) ) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oSay2[5] ID 245 OF oDlgf ;
ACTION ( oFld:SetOption(5) ) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oSay2[6] ID 246 OF oDlgf ;
ACTION ( oFld:SetOption(6) ) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oSay2[7] ID 247 OF oDlgf ;
ACTION ( oFld:SetOption(7) ) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oSay2[8] ID 248 OF oDlgf ;
ACTION ( oFld:SetOption(8) ) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oSay2[9] ID 249 OF oDlgf ;
ACTION ( oFld:SetOption(9) ) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SAY oGets[11] VAR oTBL:fol_amt1-oTBL:fol_pad1 PICTURE '@Z 999,999,999.99' ID 141 OF oDlgf COLOR CLR_RED, CLR_WHITE
oGets[11]:bDropOver := {|| MoveTrns(1,0,0) }
REDEFINE SAY oGets[12] VAR oTBL:fol_amt2-oTBL:fol_pad2 PICTURE '@Z 999,999,999.99' ID 142 OF oDlgf COLOR CLR_RED, CLR_WHITE
oGets[12]:bDropOver := {|| MoveTrns(2,0,0) }
REDEFINE SAY oGets[13] VAR oTBL:fol_amt3-oTBL:fol_pad3 PICTURE '@Z 999,999,999.99' ID 143 OF oDlgf COLOR CLR_RED, CLR_WHITE
oGets[13]:bDropOver := {|| MoveTrns(3,0,0) }
REDEFINE SAY oGets[14] VAR oTBL:fol_amt4-oTBL:fol_pad4 PICTURE '@Z 999,999,999.99' ID 144 OF oDlgf COLOR CLR_RED, CLR_WHITE
oGets[14]:bDropOver := {|| MoveTrns(4,0,0) }
REDEFINE SAY oGets[15] VAR oTBL:fol_amt5-oTBL:fol_pad5 PICTURE '@Z 999,999,999.99' ID 145 OF oDlgf COLOR CLR_RED, CLR_WHITE
oGets[15]:bDropOver := {|| MoveTrns(5,0,0) }
REDEFINE SAY oGets[16] VAR oTBL:fol_amt6-oTBL:fol_pad6 PICTURE '@Z 999,999,999.99' ID 146 OF oDlgf COLOR CLR_RED, CLR_WHITE
oGets[16]:bDropOver := {|| MoveTrns(6,0,0) }
REDEFINE SAY oGets[17] VAR oTBL:fol_amt7-oTBL:fol_pad7 PICTURE '@Z 999,999,999.99' ID 147 OF oDlgf COLOR CLR_RED, CLR_WHITE
oGets[17]:bDropOver := {|| MoveTrns(7,0,0) }
REDEFINE SAY oGets[18] VAR oTBL:fol_amt8-oTBL:fol_pad8 PICTURE '@Z 999,999,999.99' ID 148 OF oDlgf COLOR CLR_RED, CLR_WHITE
oGets[18]:bDropOver := {|| MoveTrns(8,0,0) }
REDEFINE SAY oGets[19] VAR oTBL:fol_amt9-oTBL:fol_pad9 PICTURE '@Z 999,999,999.99' ID 149 OF oDlgf COLOR CLR_RED, CLR_WHITE
oGets[19]:bDropOver := {|| MoveTrns(9,0,0) }
for x := 11 to 9
oGets[x]:lTransparent := .F.
next
REDEFINE SBUTTON oBtn[1] ID 201 OF oDlgf ;
RESOURCE 'NEW1' ;
WHEN (oTBL:tbl_status='O' .and.UserRights( 31,.F.)) ;
PROMPT TE(0411,'วอคอิน','Walk In') ;
ACTION ( RsvnScr(.T.,.T.,oTBL), oTbw:SetFocus(), oTbl_Con(), oDlgf:Refresh() ) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oBtn[2] ID 202 OF oDlgf;
RESOURCE 'EDIT1' ;
WHEN (oTBL:tbl_status='O' .and. UserRights( 31,.F.)) ;
PROMPT TE(0192,'แก้ไข','Edit')+' '+TE(0204,'จอง','Book') ;
ACTION (if(!empty(val(oTBL:tbl_intno)),(RsvnScr(.F.,.T.,oTBL), oTbw:SetFocus(), oDlgf:Refresh(), ReGets()), ) ) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oBtn[3] ID 203 OF oDlgf ;
RESOURCE 'OUT1' ;
WHEN (TotalFolio(oTBL)=0) ;
PROMPT iif(oTBL:tbl_status='O', TE(0412,'แขกออก','Check Out'), ;
TE(0413,'เลิกออก','Cxl C/Out'));
ACTION (iif(oTBL:tbl_status='O',CheckOut(oTBL:tbl_rmno,,oTBL),CxlChkOut(oTBL,oTBL:tbl_rmno)), ;
oTBL:Refresh(), ;
oTbw:GoUp(), ;
oTbw:Refresh(), ;
oTbw:SetFocus(), ;
oBtn[3]:Refresh(), oDlgf:Update(), SysRefresh(), ;
iif(oTBL:KeyCount()=0, oDlgf:End(), ) ) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oBtn[4] ID 204 OF oDlgf ;
RESOURCE 'MOVERM' ;
WHEN (oTBL:tbl_status='O'.and.UserRights( 39, .F.)) ;
PROMPT TE(0415,'ย้ายห้อง','Move Room') ;
ACTION (Moveroom(oTBL:Tbl_Intno,oTBL:tbl_shrno,oTBL), oGets[1]:Refresh(), oTBL:ReQuery(), oTbw:Refresh(), oTbw:SetFocus()) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oBtn[5] ID 205 OF oDlgf ;
RESOURCE 'FOLSET1' ;
WHEN (oTBL:tbl_status='O'.and.UserRights( 41, .F.)) ;
PROMPT TE(0417,'รูปแบบโฟลิโอ','Folio SetUp') ;
ACTION ( if(FolSetUp(), oTrn[oFld:nOption]:SetFocus(), ;
oTrn[oFld:nOption]:SetFocus()), Eval(oTbw:bChange) ) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oBtn[6] ID 206 OF oDlgf ;
RESOURCE 'PAY1' ;
WHEN (oTBL:tbl_status='O'.and.UserRights( 58 , .F. )) ;
PROMPT TE(0418,'จ่าย','Pay') ;
ACTION (if(Bal0(oFld:nOption),PrintFol0(str(oFld:nOption,1)),NewPost( .T. , 'P' )), oTrn[oFld:nOption]:SetFocus() ) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oBtn[7] ID 207 OF oDlgf ;
RESOURCE 'POST1' ;
WHEN (oTBL:tbl_status='O'.and.UserRights(53,.F.)) ;
PROMPT TE(0420,'บันทึกใหม่','New Post') ;
ACTION (NewPost( .T. , 'R' ), oTBL:ReQuery(), oTbw:Refresh(), ReBtn2(oBtn,oBtnf), oTrn[oFld:nOption]:SetFocus() ) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oBtn[8] ID 208 OF oDlgf ;
RESOURCE 'DELETE1' ;
WHEN (lEnables.and.oTBL:tbl_status='O'.and.UserRights(55,.F.)) ; // lMainMenu.and. .and.TRN1:TRN_DATE=MEMVAR->comdat
PROMPT TE(0422,'ยกเลิก/เรียกคืน','Void/UnVoid') ;
ACTION (if(TRN1:trn_trno<'9000',(VoidTrn(TRN1:RecNo()), oTbw:Refresh()), ;
(NewPost( .T. , 'P', , .T. )) ), oTrn[oFld:nOption]:SetFocus()) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oBtn[9] ID 209 OF oDlgf ;
RESOURCE 'TRANSFER' ;
WHEN (!empty(aRecNo).and.oTBL:tbl_status='O'.and.UserRights(57,.F.)) ; // lTrnsfer
PROMPT TE(0424,'โอนย้าย','Transfer') ;
ACTION ( PickGst(oFld:nOption), oTBL:ReQuery(), oBtn[9]:Refresh(), oBtnf[3]:Refresh(), oTrn[oFld:nOption]:SetFocus() ) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oBtn[10] ID 210 OF oDlgf ;
RESOURCE 'SPLIT' ;
WHEN (lSplit.and.oTBL:tbl_status='O' .and. ascan( MEMVAR->aMnb , TRN1:trn_trno )=0 .and. !empty(TRN1:trn_trno).and.UserRights(54,.F.)) ;
PROMPT TE(0426,'แบ่งรายการ','Spl&it Trns.') ;
ACTION ( Splitrn( (15*(oTrn[oFld:nOption]:nRowSel-1)), TRN1:Recno() ) , oTrn[oFld:nOption]:SetFocus() ) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oBtn[11] ID 211 OF oDlgf ;
RESOURCE 'PRINT1' ;
WHEN (oTBL:Fields('fol_uprn'+str(oFld:nOption,1)):Value=.F.) ;
PROMPT TE(0348,'พิมพ์','Print') ;
ACTION (PrintFol(str(oFld:nOption,1),0,,MEMVAR->lDemo,iif(empty(oTBL:tbl_lang),iif(MEMVAR->dLang='E',1,2),iif(oTBL:tbl_lang='E',1,2)))) ; // PrnOpt(str(oFld:nOption,1)) ;
MENU ACTION (PrnOpt(str(oFld:nOption,1))) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oBtn[13] ID 223 OF oDlgf ;
RESOURCE 'OUT1' ;
WHEN (oTBL:tbl_status='O' .and. !empty(cGroup)) ;
PROMPT TE(0414,'แขกออกยอด 0','Chk&Out 0 Bal.') ;
ACTION (ChkOutZero( oTBL:tbl_grpno), ;
oTBL:ReQuery(), ;
oTBL:Refresh(), ;
oTbw:SetFocus(), ;
oTbw:Refresh(), ;
oTbw:SetFocus(), ;
oBtn[13]:Refresh(), ;
oBtn[15]:Refresh(), ;
oBtn[16]:Refresh(), ;
oBtn[17]:Refresh(), ;
oBtn[21]:Refresh(), ;
SysRefresh()) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oBtn[14] ID 224 OF oDlgf ;
RESOURCE 'GUEST1' ;
WHEN (oTBL:tbl_status='O' ) ;
PROMPT TE(0416,'ประวัติแขก','Guest Profile') ;
ACTION (EditGst(oDlgf),oTbw:SetFocus(), oTBL:ReSync(), oTBL:Refresh(), oTbw:Refresh()) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oBtn[15] ID 226 OF oDlgf ;
RESOURCE 'ATPOST1' ;
WHEN (oTBL:tbl_status='O'.and.UserRights(53,.F.)) ;
PROMPT TE(0419,'บันทึกค่าห้อง','Room Posted') ;
ACTION (RoomPost(oTBL:tbl_rmno) , oTbw:Refresh() , oTbl_con() ) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oBtn[16] ID 227 OF oDlgf ;
RESOURCE 'CALENDAR3' ;
WHEN (oTBL:tbl_status='O'.and.UserRights(53,.F.) .and. !empty(oTBL:tbl_ratcod)) ;
PROMPT TE(0421,'ค่าเช่ารายเดือน','Monthly Posting');
ACTION (mPostDate(.F.), oTbw:SetFocus(), oTbw:Refresh()) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oBtn[17] ID 228 OF oDlgf ;
RESOURCE 'CALLHK1' ;
WHEN (oTBL:tbl_status='O') ;
PROMPT TE(0423,'แจ้งแม่บ้าน','Call H/K') ;
ACTION (if(MsgYesNo(TE(1628,'ส่งข้อความเช็คเอาท์ให้แม่บ้าน','Send Check Out Message to H/K')+' ?'), SendMsgHK() , ), oTbw:Refresh()) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oBtn[18] ID 229 OF oDlgf ;
RESOURCE 'FOLDER1' ;
WHEN (oTBL:tbl_status='O' ) ;
PROMPT TE(0425,'บันทึกเปลี่ยน','User Log') ;
ACTION ViewLog(oTBL:tbl_intno,'C') ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oBtn[19] ID 231 OF oDlgf ;
RESOURCE 'SHARE1' ;
WHEN (oTBL:tbl_status='O'.and.UserRights(34,.F.)) ;
PROMPT TE(0427,'พักร่วม','Share Guest') ;
ACTION ( ShareRsvn(oTBL:tbl_status), oTbw:Refresh(), oTbw:SetFocus() ) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oBtn[20] ID 233 OF oDlgf ;
RESOURCE 'CHKIN1' ;
PROMPT TE(0428,'พัก/ออก','In/Out') ;
ACTION ((rStatus := iif(rStatus='O',"","O")), ;
oDlgf:SetText( if(rStatus='O',TE(0396,'โฟลิโอแขกพักห้อง','Guest In House Folio'),TE(0429,'โฟลิโอที่จ่ายแล้ว','Checked Out Folio')) ), ;
SysRefresh(), ;
oTBL:ReQuery( {rStatus} ) , ;
oTBL:Refresh(), ;
oTBL:GoTop(), ;
oTbw:GoTop(), ;
ReBtn2(oBtn,oBtnf), ;
oTbw:Refresh(), ;
oTbw:SetFocus() ) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oBtn[21] ID 234 OF oDlgf ;
RESOURCE 'CHNGST1' ;
WHEN (oTBL:tbl_status='O' ) ;
PROMPT TE(0430,'เปลี่ยนแขก','Change Guest') ;
ACTION (ChangeGuest( .F. ), oTbw:Refresh(), oTbw:SetFocus()) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
REDEFINE SBUTTON oBtn[12] ID 236 OF oDlgf ;
PROMPT TE(0431,'ออก','Exit') ;
RESOURCE 'EXIT1' ;
ACTION (oDlgf:End()) ;
COLOR bSColors W97 ;
TEXT ON_RIGHT
oDlgf:bStart := {|| if(empty(cSearch), oTbw:SetFocus(), ) }
ACTIVATE DIALOG oDlgf ON INIT (oDlgf:Move( MEMVAR->TopWin,MEMVAR->LeftWin) , oTbw:GoTop() , Eval( oTbw:bChange )) ;
ON PAINT (Timers()) ;
VALID (oTimer:Deactivate(), .T.) RESIZE16