CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Language: FoxPro

RFQ Debug Code

201 Views
Copy Code Show/Hide Line Numbers
** cmdSend.Click()
 
nPrevSel= SELECT()
thisform.mupdatesuppliers()
 
IF USED("csRFQSend")
   USE IN csRFQSend
ENDIF
 
SELECT * FROM csRFQList WHERE sel > 0 INTO CURSOR csRFQSend
 
******
******
TRY 
    SELECT csRFQSend
    MESSAGEBOX("Checkpoint1: " + ALIAS(SELECT()) + " reccount: " + ALLTRIM(STR(RECCOUNT())) + CHR(13) + CHR(10) + ;
               "This is a list of all RFQ's that were selected for sending.")
    BROWSE TITLE "Press ESC to continue..."
CATCH
    MESSAGEBOX("Error displaying checkpoint1." + CHR(13) + CHR(10) + MESSAGE())
ENDTRY 
******
****** 
 
SELECT csRFQSend
SCAN
   thisform.msendrfq(csRFQSend.RFQ, csRFQSend.cage)
   SELECT csRFQSend
ENDSCAN
 
SELECT (nPrevSel)
 
 
 
** cFrmRfqMain.mSendRfq()
 
LOCAL _temp_realTally
_temp_realTally = 0
 
******
******
TRY 
    SELECT csRFQ1
    MESSAGEBOX("Checkpoint2: " + ALIAS(SELECT()) + " reccount: " + ALLTRIM(STR(RECCOUNT())) + CHR(13) + CHR(10) + ;
               "This should be a one record table of the RFQ currently being processed.")
    BROWSE TITLE "Press ESC to continue..."
CATCH
    MESSAGEBOX("Error displaying checkpoint2." + CHR(13) + CHR(10) + MESSAGE())
ENDTRY 
******
****** 
 
   IF USED("csRFQ1") AND RECCOUNT("csRFQ1") > 0 then
      
      IF USED('csRFQ2')
         USE IN csRFQ2
      ENDIF
      
      SELECT csRFQ1.*, cssupplier.comp_name, cssupplier.address, cssupplier.city, ;
         cssupplier.state, cssupplier.zip, cssupplier.supaddr1, cssupplier.supaddr2, ;
         cssupplier.supaddr3, cssupplier.supaddr4, cssupplier.supaddr5, ;
         cssupplier.contact, cssupplier.phone, cssupplier.fax, cssupplier.email;
         FROM csRFQ1 inner JOIN cssupplier ;
         ON SUBSTR(UPPER(ALLTRIM(csRFQ1.cage)),1,7) == SUBSTR(UPPER(ALLTRIM(cssupplier.cage)),1,7) ;
         INTO CURSOR csRFQ2
 
        _temp_realTally = _tally
 
******
******
TRY 
    SELECT csRFQ2
    MESSAGEBOX("Checkpoint3: " + ALIAS(SELECT()) + " reccount: " + ALLTRIM(STR(RECCOUNT())) + CHR(13) + CHR(10) + ;
               "This should again be a one record table of the RFQ currently being processed, after another query." + CHR(13) + CHR(10) + ;
               "If this table is empty, a 'Cage is not in supplier table' error will follow.")
    BROWSE TITLE "Press ESC to continue..."
CATCH
    MESSAGEBOX("Error displaying checkpoint3." + CHR(13) + CHR(10) + MESSAGE())
ENDTRY 
******
****** 
      
      IF _temp_realTally = 0
         MESSAGEBOX("Cage " + ALLTRIM(csRFQ1.cage) + " is not in Supplier table; RFQ won't be sent", 48, "FYI")
      ENDIF
 
      USE IN csRFQ1
 
   *!* m.bidno = thisform.pgfSearchGridEdit.page2.txtbidno.Value
   ** Changed :: Vlad 02/02/2010 **
   SELECT bid_no FROM csRFQList WHERE rfq = csRFQ2.rfq INTO CURSOR csResult
   m.bidno = IIF(ISNULL(csResult.bid_no), '0', ALLTRIM(csResult.bid_no))
   IF USED("csResult")
      USE IN csResult
   ENDIF
   ********************************
   
   IF USED("csRFQ2") AND RECCOUNT("csRFQ2") > 0 then
   
      IF USED('csT1')
         USE IN csT1
      ENDIF
      
      SELECT ALLTRIM(initials) FROM csPersonne WHERE UPPER(ALLTRIM(csRFQ2.Buyer)) == UPPER(ALLTRIM(initials)) AND terminated = "N" INTO CURSOR csT1
 
       _temp_realTally = _tally
       
******
******
TRY 
    SELECT csT1
    MESSAGEBOX("Checkpoint4: " + ALIAS(SELECT()) + " reccount: " + ALLTRIM(STR(RECCOUNT())) + CHR(13) + CHR(10) + ;
               "This should be a one record table of Buyers initials." + CHR(13) + CHR(10) + ;
               "If this table is empty, a 'Buyer's initials are not in Personne table' error will follow.")
    BROWSE TITLE "Press ESC to continue..."
CATCH
    MESSAGEBOX("Error displaying checkpoint4." + CHR(13) + CHR(10) + MESSAGE())
ENDTRY 
******
****** 
 
      IF _temp_realTally = 0
         MESSAGEBOX("Buyer's initials " + ALLTRIM(csRFQ2.Buyer) + " are not in Personne table; RFQ won't be sent", 48, "FYI")
      ELSE
by vlad tamas
  April 15, 2010 @ 5:11am
Tags:

Add a comment


Report Abuse
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate