diff --git a/ProcedureNLQREP_ShipTicket.txt b/ProcedureNLQREP_ShipTicket.txt new file mode 100644 index 0000000..d80f5ea --- /dev/null +++ b/ProcedureNLQREP_ShipTicket.txt @@ -0,0 +1,261 @@ +======OBJECT = ProcedureNLQREP_ShipTicket === Shipping ticket report===== +=== RULES === +Parm(in:&pLqTskID); + +output_file("NLQShipReport", "PDF"); + +=== PROCEDURE SOURCE === +/* +2016-03-04 RP Created +*/ + + +&message.Description = '&pLqTskID = ' + &pLqTskID.ToString() +PTraceLog.Call(&Pgmname, &message) + +&LQList.FromXml( &Session.Get('TnfListPrint')) +printfile("xml") +printfile(&LQList.ToXml()) + + +if &pLqTskID = 0 + + for &indexLqTskId in &LQList + + For each + where LqTskId = &indexLqTskId.TnfID + + &LqTskID = LqTskId + + endfor + do 'PrintTicket' + endfor + + +else + &LqTskID = &pLqTskID + do 'PrintTicket' +endif + + + +Sub 'PrintTicket' + +&LineSDT = new() //laz 11-11-04 +&TypeHeading = 'Liquidation' + + +&NEW_BK_ID = PGetPr21.Udp() +&USED_BK_ID = PGetPr22.Udp() + +&reprint0 = '' +&reprint1 = '' +&reprint2 = '' + +//MB 2014-10-21. #2113 +&Code = &LqTskID.ToString() +&Code = &Code.Trim() +&TemporalPath = PGetPr10.Udp() +&Path = &TemporalPath.Trim() + &Code + '.gif' +PgenerateBarcode.Call(&Path,&Code) +&barcode = loadbitmap(&Path) +//END MB-------------- + +print header +&total = 0 + +&lastPage = Boolean.FALSE + + for each + Order LqTskId + where LqTskId = &LqTskID + + &STRNUMBER = LqTskShStr + &UNTNUMBER = LqTskShUnt + + NLqGetLiquidatorName.Call(LQRId,&LQRName) + + &LQTskStrDsc = LqTskStrDsc + print body + + &message.Description = '&Inside first foreach' + PTraceLog.Call(&Pgmname, &message) + for each + where LqTskId = &LqTskID + + + &message.Description = '&Inside second foreach' + PTraceLog.Call(&Pgmname, &message) + &BkISBN = LqTskBEAN + &BkTitle = LqTskBTtl + &BkAuthor = LqTskBAthr + PClsGt01.Call(LqTskBCls,&BkClsName) + &LqTskBShNQ = LqTskBShNQ + &LqTskBShUQ = LqTskBShUQ + &PriceNew = LqTskBPRSN + &PriceUse = LqTskBPRSU + &LqPrice = LqTskBPrc + + Do 'Print' + + endfor + + + endfor + + // Print line from SDT + do 'PrintLineFromSDT' + + &totalStr = '$' + Trim(&total.ToString()) + print bottom + &lastPage = Boolean.TRUE + + print Tracking + do 'getTrackingInfo' + + + footer + if &lastPage = Boolean.TRUE + print footer + endif + end + + eject // added by cdm on 10-24-2011 + +EndSub + + +sub 'getTrackingInfo' + &TrkNumbers = '' + for each Order LqTskId + where LqTskId = &LqTskID + &TrkNumbers = LqTrckNbr.Trim() + &TspPrvName = TspPrvName.Trim() + print TrackingLine + endfor +endsub + + + +sub 'PrintNew' + if &LqTskBShNQ > 0 + &message.Type = MessageTypes.Verbose + &message.Description = 'Print New' + PTraceLog.Call(&Pgmname, &message) + + &division = &NEW_BK_ID + &Price = &LqPrice //Liquidation Price + //&CPriceNew = '$' + trim(&PriceNew.ToString()) + //&CPriceUse = '' + &LQQty = &LqTskBShNQ + &lineTotal = &Price * &LqTskBShNQ + &total += &lineTotal + + &priceStr = '$' + Trim(&Price.ToString()) + &lineTotalStr= '$' + Trim(&lineTotal.ToString()) + + + // print line + &LineItem.Division = &division + //&LineItem.PriceNew = &CPriceNew + //&LineItem.PriceUsed = &CPriceUse + &LineItem.TnfQty = &LQQty + &LineItem.TnfPrice = &priceStr + &LineItem.LineTotal = &lineTotalStr + endif +endsub + +sub 'PrintUsed' + if &LqTskBShUQ > 0 + &message.Type = MessageTypes.Verbose + &message.Description = 'Sub Print Used ' + PTraceLog.Call(&Pgmname, &message) + + &division = &USED_BK_ID + &Price = &LqPrice //Liquidation Price + //&CPriceNew = '' + //&CPriceUse = '$' + trim(&PriceUse.ToString()) + &LQQty = &LqTskBShUQ + &lineTotal = &Price * &LqTskBShUQ + &total += &lineTotal + + &priceStr = '$' + Trim(&Price.ToString()) + &lineTotalStr = '$' + Trim(&lineTotal.ToString()) + + // print line + &LineItem.Division = &division + //&LineItem.PriceNew = &CPriceNew + //&LineItem.PriceUsed = &CPriceUse + &LineItem.TnfQty = &LQQty + &LineItem.TnfPrice = &priceStr + &LineItem.LineTotal = &lineTotalStr + endif +endsub + + +Sub 'Print' + &message.Type = MessageTypes.Verbose + &message.Description = 'Sub Print. NewQty = '+ &LqTskBShNQ.ToString() + 'UsdQty= ' + &LqTskBShUQ.ToString() + PTraceLog.Call(&Pgmname, &message) + + //LAZ 2011-11-23: There must be two new() if there are two lines... each line must have its own new. + // I don't understand how this worked before... + + if &LqTskBShNQ > 0 //LAZ 2011-11-13 + &LineItem = new ShipReceiveTicketLine.ShipReceiveTicketLineItem() //LAZ 2011-11-13 + + // Load SDT book data + &LineItem.BkISBN = &BkISBN + &LineItem.BKTitle = &BkTitle + &LineItem.BKAuthor = &BkAuthor + &LineItem.BkClsName = &BkClsName //RP 2015-1-09 + + do 'PrintNew' + &LineSDT.Add(&LineItem) //LAZ 2011-11-13 + + endif + + if &LqTskBShUQ > 0 //LAZ 2011-11-13 + &LineItem = new ShipReceiveTicketLine.ShipReceiveTicketLineItem() + + // Load SDT book data + &LineItem.BkISBN = &BkISBN + &LineItem.BKTitle = &BkTitle + &LineItem.BKAuthor = &BkAuthor + &LineItem.BkClsName = &BkClsName + + do 'PrintUsed' + &LineSDT.Add(&LineItem) + + endif + +EndSub + + + +Sub 'PrintLineFromSDT' + + &message.Type = MessageTypes.Verbose + &message.Description = 'Sub PrintLineFromSDT. ' + &LineSDT.ToXml() + PTraceLog.Call(&Pgmname, &message) + + + &LineSDT.Sort("BkAuthor, BkTitle, BkISBN, BkClsAbr") + For &LineItem in &LineSDT + &BkISBN = &LineItem.BkISBN + &BkTitle = &LineItem.BKTitle + &BkAuthor = &LineItem.BKAuthor + &BkClsAbr = &LineItem.BkClsAbr + &division = &LineItem.Division + //&CPriceNew = &LineItem.PriceNew + //&CPriceUse = &LineItem.PriceUsed + &LQQty = &LineItem.TnfQty + &priceStr = &LineItem.TnfPrice + &lineTotalStr = &LineItem.LineTotal + &BkClsName = &LineItem.BkClsName + + print line + endfor +EndSub + + diff --git a/ProcedureNLqGetLiquidatorName.txt b/ProcedureNLqGetLiquidatorName.txt new file mode 100644 index 0000000..65b02ad --- /dev/null +++ b/ProcedureNLqGetLiquidatorName.txt @@ -0,0 +1,17 @@ +======OBJECT = ProcedureNLqGetLiquidatorName === Get Liquidator Name By LQRId===== +=== RULES === +parm(in:&LQRId, out:&LQRName); + +=== PROCEDURE SOURCE === +/* +2015-03-01 TA2-709 AMM Created. + Get Liquidator Name by Liquidator Id +*/ +// + +for each + where LQRId = &LQRId + + &LQRName = LQRName +endfor + diff --git a/ProcedureNLqGetQtyFulfilled.txt b/ProcedureNLqGetQtyFulfilled.txt new file mode 100644 index 0000000..210335c --- /dev/null +++ b/ProcedureNLqGetQtyFulfilled.txt @@ -0,0 +1,16 @@ +======OBJECT = ProcedureNLqGetQtyFulfilled === Get Liquidation Quantity Fulfilled===== +=== RULES === +parm(in:&LqLstId, in:&LqLinId, out:&LqExcQtyFF); + +=== PROCEDURE SOURCE === +/* +2016-01-21 AMM Created. Get Quantity Fulfilled. +*/ + +for each + where LqLstId = &LqLstId + where LqLinId = &LqLinId + + &LqExcQtyFF = LqExcQtyFF +endfor + diff --git a/ProcedureNLqILiqInterface.txt b/ProcedureNLqILiqInterface.txt new file mode 100644 index 0000000..16f19b7 --- /dev/null +++ b/ProcedureNLqILiqInterface.txt @@ -0,0 +1,66 @@ +======OBJECT = ProcedureNLqILiqInterface === NLq ILiq Interface===== +=== RULES === +parm(in:&LqTskId); + +=== PROCEDURE SOURCE === +/* + 2016-03-02 DV Created. + Insert into LqInt completed task's information. +*/ + + +for each LqTskB + order LqTskBId + where LqTskId = &LqTskId + + //new books + if (LqTskBShNQ > 0) + PGet001('LQINT', &AuxId) + &LqInt.LqIntID = &AuxId + &LqInt.LqIntTC = "TXT" + &LqInt.LqIntStrN = LqTskShStr + &LqInt.LqIntDept = trim(str(PGetPr23())) + &LqInt.LqIntDate = LqTskInsOn + &LqInt.LqIntLiqN = LqTskId + &LqInt.LqIntLiqr = LQRName.Trim() + &LqInt.LqIntRefN = LqTskRefN.Trim() + &LqInt.LqIntQty = LqTskBShNQ + &LqInt.LqIntBRP = LqTskBPRSN + &LqInt.LqIntBREP = round((LqTskBPRSN * LqTskBShNQ),2) + &LqInt.LqIntBLP = LqTskBPrc + &LqInt.LqIntBLEP = round((LqTskBPrc * LqTskBShNQ),2) + &LqInt.LqIntEAN = LqTskBEAN.Trim() + &LqInt.LqIntAthr = LqTskBAthr.Trim() + &LqInt.LqIntTtle = LqTskBTtl.Trim() + &LqInt.LqIntAPSts = 'PE' + &LqInt.LqIntTStmp = servernow() + &LqInt.Save() + endif + + //used books + if (LqTskBShUQ > 0) + PGet001('LQINT', &AuxId) + &LqInt.LqIntID = &AuxId + &LqInt.LqIntTC = "TXT" + &LqInt.LqIntStrN = LqTskShStr + &LqInt.LqIntDept = trim(str(PGetPr24())) + &LqInt.LqIntDate = LqTskInsOn + &LqInt.LqIntLiqN = LqTskId + &LqInt.LqIntLiqr = LQRName.Trim() + &LqInt.LqIntRefN = LqTskRefN.Trim() + &LqInt.LqIntQty = LqTskBShUQ + &LqInt.LqIntBRP = LqTskBPRSU + &LqInt.LqIntBREP = round((LqTskBPRSU * LqTskBShUQ),2) + &LqInt.LqIntBLP = LqTskBPrc + &LqInt.LqIntBLEP = round((LqTskBPrc * LqTskBShUQ),2) + &LqInt.LqIntEAN = LqTskBEAN.Trim() + &LqInt.LqIntAthr = LqTskBAthr.Trim() + &LqInt.LqIntTtle = LqTskBTtl.Trim() + &LqInt.LqIntAPSts = 'PE' + &LqInt.LqIntTStmp = servernow() + &LqInt.Save() + endif + +endfor + + diff --git a/ProcedureNLqPProcessTask.txt b/ProcedureNLqPProcessTask.txt new file mode 100644 index 0000000..ee2a747 --- /dev/null +++ b/ProcedureNLqPProcessTask.txt @@ -0,0 +1,87 @@ +======OBJECT = ProcedureNLqPProcessTask === NLq PProcess Task===== +=== RULES === +parm(in: &LqTskId); + +=== PROCEDURE SOURCE === +/* + 2016-02-25 DV Created +*/ + +//Get head data +for each //LqTsk + where LqTskId = &LqTskId + &ShippingStore = LqTskShStr + &ShippingUnit = LqTskShUnt + exit +endfor + + +//iterate task lines +for each //LqTskB + where LqTskId = &LqTskId + + &AuxEAN = LqTskBEAN.Trim() + &TrcMessage.Description = '&AuxEAN = ' + &AuxEAN.ToString() + do 'trace' + do 'get_bookId_from_EAN' + + if (&BkID <> 0) + //Markdown + if (LqTskBShNQ > 0 or LqTskBShUQ > 0) + //AdjReasons.LiquidationShipping + PAddAdjustment(&ShippingStore, &ShippingUnit, &BkID, LqTskBCls, LqTskBShNQ, LqTskBShUQ, AdjReasons.LiquidationShipping, '', &LqTskId, &LqTskId, '', Boolean.FALSE, &AdjustmentId) + endif + //Discrepancy + if (LqTskBRNQy <> LqTskBShNQ or LqTskBRUQy <> LqTskBShUQ) + //AdjReasons.LiquidationShippingDiscrepancy + &NewDiscrQty = LqTskBRNQy - LqTskBShNQ + &UsdDiscrQty = LqTskBRUQy - LqTskBShUQ + PAddAdjustment(&ShippingStore, &ShippingUnit, &BkID, LqTskBCls, &NewDiscrQty, &UsdDiscrQty, AdjReasons.LiquidationShippingDiscrepancy, '', &LqTskId, &LqTskId, '', Boolean.FALSE, &AdjustmentId) + endif + else + //Trace BkId Empty Error + &TrcMessage.Description = "Erro looking for BookID - EAN # " + &AuxEAN.Trim() + " - TaskId: " + &LqTskId.ToString().Trim() + do 'trace' + endif + +endfor + +//mark Task as shipped +//Get head data +for each //LqTsk + where LqTskId = &LqTskId + LqTskSts = TnfStatus.Completed + exit +endfor +commit + + + + + +//-------------------------------------------------------- Subs -------------------------------------------------------------// + +Sub 'get_bookId_from_EAN' + + &BkID = 0 + //&AuxEAN = &EAN.Trim() + &EANPre = Substr(&AuxEAN,1,3) + &lenght = Len(&AuxEAN) + &EANPos = Substr(&AuxEAN,4,&lenght) //Remove the first 3 digits + PPIGet29(&EanPre, Division.New, &ISBNPre) //Map the first 3 digits + &ISBN = &ISBNPre.Trim() + &EANPos.Trim() + &ISBN12 = substr(&ISBN, 1, 12) + &BkISBNPre = &ISBN12.ToNumeric() + &TrcMessage.Description = '&BkISBNPre = ' + &BkISBNPre.ToString() + do 'trace' + PBKGet21(&BkISBNPre, &BkID) //Get BookId + +EndSub //get_bookId_from_EAN + +Sub 'trace' + + &TrcMessage.Type = MessageTypes.Error + PTraceLog(&Pgmname, &TrcMessage) + +EndSub //trace + diff --git a/ProcedureNLqULqLstSts.txt b/ProcedureNLqULqLstSts.txt new file mode 100644 index 0000000..edd7760 --- /dev/null +++ b/ProcedureNLqULqLstSts.txt @@ -0,0 +1,17 @@ +======OBJECT = ProcedureNLqULqLstSts === Liquidation List Update Status===== +=== RULES === +parm(in:&LqLstId, in:&LqLstSts); + +=== PROCEDURE SOURCE === +/* + 2016-04-07 DV Created. + Update LqLstSts value. +*/ + +&LqLst.Load(&LqLstId) +if &LqLst.Success() + &LqLst.LqLstSts = &LqLstSts + &LqLst.Save() + commit +endif + diff --git a/ProcedureNLqUTaskBQuantities.txt b/ProcedureNLqUTaskBQuantities.txt new file mode 100644 index 0000000..47abf0e --- /dev/null +++ b/ProcedureNLqUTaskBQuantities.txt @@ -0,0 +1,17 @@ +======OBJECT = ProcedureNLqUTaskBQuantities === NLq UTask BQuantities===== +=== RULES === +parm(in:&LqTskId, in: &LqTskBId, in: &NewShippedQty, in: &UsedShippedQty); + +=== PROCEDURE SOURCE === +/* + 2016-02-23 DV Created - Update shipped new & used quantities for task book. +*/ + +for each + where LqTskId = &LqTskId + where LqTskBId = &LqTskBId + LqTskBShNQ = &NewShippedQty + LqTskBShUQ = &UsedShippedQty + exit +endfor + diff --git a/ProcedureNLqUTaskShip.txt b/ProcedureNLqUTaskShip.txt new file mode 100644 index 0000000..1a0c370 --- /dev/null +++ b/ProcedureNLqUTaskShip.txt @@ -0,0 +1,26 @@ +======OBJECT = ProcedureNLqUTaskShip === NLq UTask Ship===== +=== RULES === +parm(in:&LqTskId, in:&UsrId); + +=== PROCEDURE SOURCE === +/* + 2016-02-23 DV Created - Update Task Shipping Data. +*/ + +&message.Description = 'NLqUTaskShip - &LqTskId = ' + &LqTskId.ToString() +PTraceLog.Call(&Pgmname, &message) +&message.Description = 'NLqUTaskShip - &UsrId = ' + &UsrId.ToString() +PTraceLog.Call(&Pgmname, &message) + + +&ShipDate = servernow() + +for each + where LqTskId = &LqTskId + &message.Description = 'NLqUTaskShip - inside foreach' + PTraceLog.Call(&Pgmname, &message) + LqTskShDte = &ShipDate + LqTskShUsr = &UsrId + exit +endfor + diff --git a/ProcedureNLqUTaskStatus.txt b/ProcedureNLqUTaskStatus.txt new file mode 100644 index 0000000..0af10bc --- /dev/null +++ b/ProcedureNLqUTaskStatus.txt @@ -0,0 +1,16 @@ +======OBJECT = ProcedureNLqUTaskStatus === NLq UTask Status===== +=== RULES === +parm(in:&NewTaskStatus); + +=== PROCEDURE SOURCE === +/* + 2016-02-26 DV Created - Update Task Status. +*/ + +for each + where LqTskId = &LqTskId + LqTskSts = &NewTaskStatus + exit +endfor +commit + diff --git a/ProcedureNLqrGLiquidators.txt b/ProcedureNLqrGLiquidators.txt new file mode 100644 index 0000000..19095df --- /dev/null +++ b/ProcedureNLqrGLiquidators.txt @@ -0,0 +1,34 @@ +======OBJECT = ProcedureNLqrGLiquidators === NLqr GLiquidators===== +=== RULES === +parm(out:&Liquidators); + +=== PROCEDURE SOURCE === +/* + 2016-02-18 - DV - Return a collection of Liquidators. + 2016-03-23 LAZ - Filter to show only active ones + 2016-03-24 LAZ TA2-908 Since we search by name, sort by name to optimize search + Ignore WARNING on ORDER! +*/ + +&Liquidators.Clear() + +for each //LQR + order LQRName + where LQRSts = AIStatus.Active + + &liquidator = new() + &liquidator.LQRId = LQRId + &liquidator.LQRName = LQRName.ToUpper().Trim() + &liquidator.LQRPhone = LQRPhone.Trim() + &liquidator.LQRFax = LQRFax.Trim() + &liquidator.LQRAddrs = LQRAddrs.Trim() + &liquidator.LQREmail = LQREmail.Trim() + &liquidator.LQRWebSte = LQRWebSte.Trim() + &liquidator.LQRSts = LQRSts + &liquidator.LQRAttTo = LQRAttTo.Trim() + &liquidator.LQRNotes = LQRNotes.Trim() + //add to collection + &Liquidators.Add(&liquidator) + +endfor + diff --git a/WebComponentHBNBatchPrintInboxWC2.txt b/WebComponentHBNBatchPrintInboxWC2.txt new file mode 100644 index 0000000..09ceb7d --- /dev/null +++ b/WebComponentHBNBatchPrintInboxWC2.txt @@ -0,0 +1,348 @@ +======OBJECT = WebComponentHBNBatchPrintInboxWC2 === HBNBatch Print Inbox WC2===== +=== RULES === + +=== EVENTS SOURCE === + +Event Start + + /* Generated by DVelop Work With Plus Pattern [Start] - Do not change */ + + &STRNUMBER.Visible = False + InboxGrid.Rows = 10 + + /* Generated by DVelop Work With Plus Pattern [End] - Do not change */ + + PLoadContext.Call(&AuxContext) + &StrNumber = &AuxContext.FilterStore + &UsrId = &AuxContext.UserID + + // Get Batch Size Parameter + PGetParmBatchSize(&BatchSize) + + &FilterTask = Tasks.ALL + &SortBy = SortInbox.Created + &ReceivingStr.SetEmpty() + &ShippingStr.SetEmpty() + &TnfIdFilter.SetEmpty() + &FromDate = nullvalue(&FromDate) + &ToDate = nullvalue(&ToDate) + &totalTasks = 0 + &new = 0 + + do 'doSearch' + +EndEvent + +Event InboxGrid.Load + + /* Generated by DVelop Work With Plus Pattern [Start] - Do not change */ + + //this code should be inside the For Each used to load the grid + + /* Generated by DVelop Work With Plus Pattern [End] - Do not change */ + + &GridSelected.Enabled = true + &new = 0 + + For &InboxSDTItem in &InboxSDT + &GridSelected = &InboxSDTItem.GrdSelected + &TnfFStrNum = &InboxSDTItem.TnffstrNum + &TnfToStrNum = &InboxSDTItem.TnfToStrNum + &TnfFStrDsc = &InboxSDTItem.FromStoreName.Trim() + &TnfToStrDsc = &InboxSDTItem.ToStoreName.Trim() + //&TnfTask = Tasks.EnumerationDescription(&InboxSDTItem.TnfTask) + &TnfTask = &InboxSDTItem.TnfTask + &TnfId2 = &InboxSDTItem.TnfID + &TnfWLstId = &InboxSDTItem.TnfWLstId + &TnfInsOnDT = &InboxSDTItem.TnfDate + &TnfWFId = &InboxSDTItem.TnfWFId + &TnfTknBy = &InboxSDTItem.TakenByUID + + &image2.FromImage(ActionDisabled) + &image2.Tooltiptext= '' + + if &InboxSDTItem.PrintedFlag = Boolean.TRUE + &image2.FromImage(PrinterOk) + &image2.Tooltiptext = 'Printed' + else + &image2.FromImage(NotDone) + &image2.Tooltiptext = 'Not Printed' + endif + + do 'GetSelectedListFromSession' + do 'CheckSelected' + + if &InboxSDTItem.TakenByUID.IsEmpty() + &Taken.FromImage(MailClosed) + &Taken.Tooltiptext = "New" + &new += 1 + else + if &InboxSDTItem.TakenByUID = &AuxContext.UserId + &Taken.FromImage(MailOpen) + &Taken.Tooltiptext = "In Process" + else + &Taken.FromImage(MailAssigned) + endif + endif + + load + + endfor + + &totalTasks = &InboxSDT.Count + &Selcount = &TnfList.Count + &count = &totalTasks + + //Summary + txtsummary.Caption = 'Summary: Inbox ' + &totalTasks.ToString().Trim() + ' - New ' + &new.ToString().Trim() + ' - Selected: ' + &Selcount.ToString().Trim() + + &Session.Set("TN2InboxCount",trim(str(&count))) + + &TnfIdFilter.Setfocus() + +EndEvent + +Event 'DoPrintSelectedBtn' + + /* Generated by DVelop Work With Plus Pattern [Start] - Do not change */ + + + + /* Generated by DVelop Work With Plus Pattern [End] - Do not change */ + + &TnfList.Clear() + + &message.Description = '&FilterTask = ' + &FilterTask.ToString() + PTraceLog.Call(&Pgmname, &message) + + Do case + Case &FilterTask = Tasks.ALL + + msg('You should select a task type') + + Case &FilterTask = Tasks.SHIP or &FilterTask = Tasks.RECEIVE + + for each line in InboxGrid + if (&GridSelected = true) + PTRSetPrintFlag(&TnfID2,TransferCategory.Internal) + //add to tnflist + &tnflistitem.TnfID = &TnfID2 + &TnfList.Add(&tnflistitem) + &tnflistitem = new() + endif + endfor + commit + + //call report in popup + &workitemsxml2 = &TnfList.ToXml() + + &Session.Set("TnfListPrint",&workitemsxml2) + RBNREP_ShipReceiveTicket.Popup(0, '') + + &TnfList.Clear() + + //Refresh + InboxGrid.Refresh() + + + Case &FilterTask = Tasks.LQD + + for each line in InboxGrid + if (&GridSelected = true) + PTRSetPrintFlag(&TnfID2,TransferCategory.Liquidation) + //add to tnflist + &tnflistitem.TnfID = &TnfID2 + &TnfList.Add(&tnflistitem) + &tnflistitem = new() + endif + endfor + commit + + //call report in popup + &workitemsxml2 = &TnfList.ToXml() + + &Session.Set("TnfListPrint",&workitemsxml2) + NLQREP_ShipTicket.Popup(0) + + &TnfList.Clear() + + //Refresh + InboxGrid.Refresh() + endcase + +EndEvent + +Event Enter + + do 'ApplyFilters' + do 'doSearch' + + InboxGrid.Refresh() + + /* Generated by DVelop Work With Plus Pattern [Start] - Do not change */ + + + + /* Generated by DVelop Work With Plus Pattern [End] - Do not change */ + +EndEvent + +Event &TnfID2.Click + + ploadContext.Call(&AuxContext) + if (&TnfTknBy.IsEmpty()) or (&TnfTknBy = &AuxContext.UserId) + if &TnfTask = Tasks.SHIP + HPOShip.Popup(&TnfID2) + else + if &TnfTask = Tasks.LQD + &TransferCategory = TransferCategory.Liquidation + NLQShip.Popup(&TnfID2,&TransferCategory) + else + HPOReceive.Popup(&TnfID2) + endif + + endif + endif + + //Refresh + InboxGrid.Refresh() + +EndEvent + +Event &SortBy.Click + + do 'doSearch' + InboxGrid.Refresh() + +EndEvent + +Event &SelFirst50.Click + + &qtySelected = 0 + if (&SelFirst50=true) + &selectedState = true + else + &selectedState = false + endif + + //Refresh + InboxGrid.Refresh() + +EndEvent + +Event &LQRId.Click + + if not &LQRId.IsEmpty() and &LQRId <> 0 + + &FilterTask = Tasks.LQD + + else + if &LQRId = 0 + &FilterTask = Tasks.ALL + endif + + endif + +EndEvent + +Sub 'doSearch' + + PInboxSDTLoad(&StrNumber, &ReceivingStr, &LQRId, &ShippingStr, &TnfIdFilter, &FromDate, &ToDate, &FilterTask, &SortBy, &InboxSDT) + + For &InboxSDTItem in &InboxSDT + &InboxSDTItem.GrdSelected = &selectedState + &qtySelected +=1 + if (&qtySelected=50) + exit + endif + EndFor + +EndSub + +Sub 'CheckSelected' + + &Selected = Boolean.FALSE + for &IndexTnfID in &TnfList + if &IndexTnfID.TnfID = &TnfId2 + &Selected = Boolean.TRUE + exit + endif + endfor + +EndSub + +Sub 'GetSelectedListFromSession' + + &TnfList.FromXml(&Session.Get('TnfList')) + +EndSub + +Sub 'ApplyFilters' + + &Message.Description ='Sub ApplyFilters &TnfIdFilter=' + &TnfIdFilter.ToString().Trim() + PTraceLog.Call(&Pgmname, &Message) + + if(not &TnfIdFilter.IsEmpty()) + &ExisteTnfId = Boolean.FALSE + for each + where TnfID = &TnfIdFilter + where TnfRdyFlg = 1 + + if &StrNumber = 0 or + ( TnfSts = TnfStatus.Request and TnfFStrNum = &StrNumber ) or + ( TnfSts = TnfStatus.Shipped and TnfToStrNum = &StrNumber ) + + &ExisteTnfId = Boolean.TRUE + if TnfSts = TnfStatus.Request + &AuxTnfTask = Tasks.SHIP + + &AuxTnfTknBy = iif(TnfShpTknBy.IsEmpty(), 0, TnfShpTknBy) + else + &AuxTnfTask = Tasks.RECEIVE + &AuxTnfTknBy = iif(TnfRcvTknBy.IsEmpty(), 0, TnfRcvTknBy) + endif + endif + when none + for each + where LqTskId = &TnfIdFilter + where LqTskRFlg = true + where LqTskSts = TnfStatus.Request + + &ExisteTnfId = Boolean.TRUE + &AuxTnfTask = Tasks.LQD + &AuxTnfTknBy = iif(LqTskTknBy.IsEmpty(), 0, LqTskTknBy) + endfor + endfor + + if(&ExisteTnfId = Boolean.TRUE) + do 'ExecuteSelectedTransfer' + endif + + endif + +EndSub + +Sub 'ExecuteSelectedTransfer' + + ploadContext.Call(&AuxContext) + if (&AuxTnfTknBy.IsEmpty()) or (&AuxTnfTknBy = &AuxContext.UserId) + if &AuxTnfTask = Tasks.SHIP + HPOShip.Popup(&TnfIdFilter) + &TnfIdFilter.SetEmpty() + else + if &AuxTnfTask = Tasks.RECEIVE + HPOReceive.Popup(&TnfIdFilter) + &TnfIdFilter.SetEmpty() + else + &AuxTnfTask = Tasks.LQD + NLQShip.Popup(&TnfIdFilter, TransferCategory.Liquidation) + &TnfIdFilter.SetEmpty() + endif + endif + endif + refresh + +EndSub + + +