CheckForServiceOrders

Check for Service Orders

Minor Business Rule

Object Name: N1700830

Parent DLL: CCRIN

Location: Client/Server

Language: NER

//     Mode = 1 for Customer
//     Mode = 2 for NUMB

//     Mode = 3 for ITM

//     Mode = 4 for PRODM 

//     Mode = 5 for FAILCD 

//



If BF mnCurrentOrder_DOCO is equal to 

Or BF mnCurrentOrder_DOCO is equal to 

   BF mnCurrentOrder_DOCO = "0"

End If

BF cOrdersFound = "0"

If BF cMode is equal to "1-5"

   //

   //     MODE = 1 - Customer

   //

   If BF cMode is equal to "1"

   And BF jdStartFromDate is not equal to 

      F4801.Select

         BF mnCurrentOrder_DOCO != TK Document (Order No, Invoice, etc.)

         BF szStatusCodeWoFrom <= TK Status Code W.O.

         BF mnCustomerNumber =  TK Address Number

         BF jdStartFromDate <= TK Date - Order/Transaction

      F4801.Fetch Next

         VA evt_mnDocNumber_DOCO <- TK Document (Order No, Invoice, etc.)

         VA evt_szTypeWo_TYPS <- TK Type - W.O.

         VA evt_szStatus_SRST <- TK Status Code W.O.

      While SV File_IO_Status is equal to CO SUCCESS

      And BF cOrdersFound is equal to 

         If VA evt_szStatus_SRST is less than or equal to BF szStatusCodeWoThru

            If BF cTypeWo is equal to 

            Or BF cTypeWo is equal to 

               If BF jdRepairDateFrom is equal to 

               And BF jdRepairDateThru is equal to 

                  BF cOrdersFound = "1"

               Else

                  F4801T.Fetch Single

                     VA evt_mnDocNumber_DOCO =  TK Document (Order No, Invoice, etc.)

                     VA evt_jdRepairDate_REPDT <- TK Repair Date

                  If VA evt_jdRepairDate_REPDT is greater than or equal to BF jdRepairDateFrom

                  And VA evt_jdRepairDate_REPDT is less than or equal to BF jdRepairDateThru

                     BF cOrdersFound = "1"

                  End If

               End If

            Else

               If BF cTypeWo is equal to VA evt_szTypeWo_TYPS

                  If BF jdRepairDateFrom is equal to 

                  And BF jdRepairDateThru is equal to 

                     BF cOrdersFound = "1"

                  Else

                     F4801T.Fetch Single

                        VA evt_mnDocNumber_DOCO =  TK Document (Order No, Invoice, etc.)

                        VA evt_jdRepairDate_REPDT <- TK Repair Date

                     If VA evt_jdRepairDate_REPDT is greater than or equal to BF jdRepairDateFrom

                     And VA evt_jdRepairDate_REPDT is less than or equal to BF jdRepairDateThru

                        BF cOrdersFound = "1"

                     End If

                  End If

               End If

            End If

         End If

         If BF cOrdersFound is equal to 

            F4801.Fetch Next

               VA evt_mnDocNumber_DOCO <- TK Document (Order No, Invoice, etc.)

               VA evt_szTypeWo_TYPS <- TK Type - W.O.

               VA evt_szStatus_SRST <- TK Status Code W.O.

         End If

      End While

   Else

      //

      //     MODE = 2 - NUMB

      //

      If BF cMode is equal to "2"

      And BF jdStartFromDate is not equal to 

         F4801.Select

            BF mnCurrentOrder_DOCO != TK Document (Order No, Invoice, etc.)

            BF szStatusCodeWoFrom <= TK Status Code W.O.

            BF jdStartFromDate <= TK Date - Order/Transaction

            BF mnAssetItemNumber =  TK Asset Item Number

         F4801.Fetch Next

            VA evt_mnDocNumber_DOCO <- TK Document (Order No, Invoice, etc.)

            VA evt_szTypeWo_TYPS <- TK Type - W.O.

            VA evt_szStatus_SRST <- TK Status Code W.O.

         While SV File_IO_Status is equal to CO SUCCESS

         And BF cOrdersFound is equal to 

            If VA evt_szStatus_SRST is less than or equal to BF szStatusCodeWoThru

               If BF cTypeWo is equal to 

               Or BF cTypeWo is equal to 

                  If BF jdRepairDateFrom is equal to 

                  And BF jdRepairDateThru is equal to 

                     BF cOrdersFound = "1"

                  Else

                     F4801T.Fetch Single

                        VA evt_mnDocNumber_DOCO =  TK Document (Order No, Invoice, etc.)

                        VA evt_jdRepairDate_REPDT <- TK Repair Date

                     If VA evt_jdRepairDate_REPDT is greater than or equal to BF jdRepairDateFrom

                     And VA evt_jdRepairDate_REPDT is less than or equal to BF jdRepairDateThru

                        BF cOrdersFound = "1"

                     End If

                  End If

               Else

                  If BF cTypeWo is equal to VA evt_szTypeWo_TYPS

                     If BF jdRepairDateFrom is equal to 

                     And BF jdRepairDateThru is equal to 

                        BF cOrdersFound = "1"

                     Else

                        F4801T.Fetch Single

                           VA evt_mnDocNumber_DOCO =  TK Document (Order No, Invoice, etc.)

                           VA evt_jdRepairDate_REPDT <- TK Repair Date

                        If VA evt_jdRepairDate_REPDT is greater than or equal to BF jdRepairDateFrom

                        And VA evt_jdRepairDate_REPDT is less than or equal to BF jdRepairDateThru

                           BF cOrdersFound = "1"

                        End If

                     End If

                  End If

               End If

            End If

            If BF cOrdersFound is equal to 

               F4801.Fetch Next

                  VA evt_mnDocNumber_DOCO <- TK Document (Order No, Invoice, etc.)

                  VA evt_szTypeWo_TYPS <- TK Type - W.O.

                  VA evt_szStatus_SRST <- TK Status Code W.O.

            End If

         End While

      Else

         //

         //     MODE = 3 - ITM

         //

         If BF cMode is equal to "3"

         And BF jdStartFromDate is not equal to 

            F4801.Select

               BF mnCurrentOrder_DOCO != TK Document (Order No, Invoice, etc.)

               BF szStatusCodeWoFrom <= TK Status Code W.O.

               BF jdStartFromDate <= TK Date - Order/Transaction

               BF mnInventoryItemNumber =  TK Item Number - Short

            F4801.Fetch Next

               VA evt_mnDocNumber_DOCO <- TK Document (Order No, Invoice, etc.)

               VA evt_szTypeWo_TYPS <- TK Type - W.O.

               VA evt_szStatus_SRST <- TK Status Code W.O.

            While SV File_IO_Status is equal to CO SUCCESS

            And BF cOrdersFound is equal to 

               If VA evt_szStatus_SRST is less than or equal to BF szStatusCodeWoThru

                  If BF cTypeWo is equal to 

                  Or BF cTypeWo is equal to 

                     If BF jdRepairDateFrom is equal to 

                     And BF jdRepairDateThru is equal to 

                        BF cOrdersFound = "1"

                     Else

                        F4801T.Fetch Single

                           VA evt_mnDocNumber_DOCO =  TK Document (Order No, Invoice, etc.)

                           VA evt_jdRepairDate_REPDT <- TK Repair Date

                        If VA evt_jdRepairDate_REPDT is greater than or equal to BF jdRepairDateFrom

                        And VA evt_jdRepairDate_REPDT is less than or equal to BF jdRepairDateThru

                           BF cOrdersFound = "1"

                        End If

                     End If

                  Else

                     If BF cTypeWo is equal to VA evt_szTypeWo_TYPS

                        If BF jdRepairDateFrom is equal to 

                        And BF jdRepairDateThru is equal to 

                           BF cOrdersFound = "1"

                        Else

                           F4801T.Fetch Single

                              VA evt_mnDocNumber_DOCO =  TK Document (Order No, Invoice, etc.)

                              VA evt_jdRepairDate_REPDT <- TK Repair Date

                           If VA evt_jdRepairDate_REPDT is greater than or equal to BF jdRepairDateFrom

                           And VA evt_jdRepairDate_REPDT is less than or equal to BF jdRepairDateThru

                              BF cOrdersFound = "1"

                           End If

                        End If

                     End If

                  End If

               End If

               If BF cOrdersFound is equal to 

                  F4801.Fetch Next

                     VA evt_mnDocNumber_DOCO <- TK Document (Order No, Invoice, etc.)

                     VA evt_szTypeWo_TYPS <- TK Type - W.O.

                     VA evt_szStatus_SRST <- TK Status Code W.O.

               End If

            End While

         Else

            //

            //     MODE = 4 - PRODM

            //

            If BF cMode is equal to "4"

               F4801T.Select

                  BF mnCurrentOrder_DOCO != TK Document (Order No, Invoice, etc.)

                  BF szProductModel =  TK Product Model

               F4801T.Fetch Next

                  VA evt_mnDocNumber_DOCO <- TK Document (Order No, Invoice, etc.)

                  VA evt_jdRepairDate_REPDT <- TK Repair Date

               While SV File_IO_Status is equal to CO SUCCESS

               And BF cOrdersFound is equal to 

                  F4801.Fetch Single

                     VA evt_mnDocNumber_DOCO =  TK Document (Order No, Invoice, etc.)

                     VA evt_szTypeWo_TYPS <- TK Type - W.O.

                     VA evt_szStatus_SRST <- TK Status Code W.O.

                     VA evt_jdDate_STRX <- TK Date - Completion (Julian)

                  If SV File_IO_Status is equal to CO SUCCESS

                  And VA evt_szStatus_SRST is greater than or equal to BF szStatusCodeWoFrom

                  And VA evt_szStatus_SRST is less than or equal to BF szStatusCodeWoThru

                  And VA evt_jdDate_STRX is greater than or equal to BF jdStartFromDate

                     If BF cTypeWo is equal to 

                     Or BF cTypeWo is equal to 

                        If BF jdRepairDateFrom is equal to 

                        And BF jdRepairDateThru is equal to 

                           BF cOrdersFound = "1"

                        Else

                           If VA evt_jdRepairDate_REPDT is greater than or equal to BF jdRepairDateFrom

                           And VA evt_jdRepairDate_REPDT is less than or equal to BF jdRepairDateThru

                              BF cOrdersFound = "1"

                           End If

                        End If

                     Else

                        If BF cTypeWo is equal to VA evt_szTypeWo_TYPS

                           If BF jdRepairDateFrom is equal to 

                           And BF jdRepairDateThru is equal to 

                              BF cOrdersFound = "1"

                           Else

                              If VA evt_jdRepairDate_REPDT is greater than or equal to BF jdRepairDateFrom

                              And VA evt_jdRepairDate_REPDT is less than or equal to BF jdRepairDateThru

                                 BF cOrdersFound = "1"

                              End If

                           End If

                        End If

                     End If

                  End If

                  If BF cOrdersFound is equal to 

                     F4801T.Fetch Next

                        VA evt_mnDocNumber_DOCO <- TK Document (Order No, Invoice, etc.)

                        VA evt_jdRepairDate_REPDT <- TK Repair Date

                  End If

               End While

            Else

               //

               //     MODE = 5  - FAILCD

               //

               If BF cMode is equal to "5"

                  F4801T.Select

                     BF mnCurrentOrder_DOCO != TK Document (Order No, Invoice, etc.)

                     BF szFailureCode =  TK Defect Code

                  F4801T.Fetch Next

                     VA evt_mnDocNumber_DOCO <- TK Document (Order No, Invoice, etc.)

                     VA evt_jdRepairDate_REPDT <- TK Repair Date

                  While SV File_IO_Status is equal to CO SUCCESS

                  And BF cOrdersFound is equal to 

                     F4801.Fetch Single

                        VA evt_mnDocNumber_DOCO =  TK Document (Order No, Invoice, etc.)

                        VA evt_szTypeWo_TYPS <- TK Type - W.O.

                        VA evt_szStatus_SRST <- TK Status Code W.O.

                        VA evt_jdDate_STRX <- TK Date - Completion (Julian)

                     If SV File_IO_Status is equal to CO SUCCESS

                     And VA evt_szStatus_SRST is greater than or equal to BF szStatusCodeWoFrom

                     And VA evt_szStatus_SRST is less than or equal to BF szStatusCodeWoThru

                     And VA evt_jdDate_STRX is greater than or equal to BF jdStartFromDate

                        If BF cTypeWo is equal to 

                        Or BF cTypeWo is equal to 

                           If BF jdRepairDateFrom is equal to 

                           And BF jdRepairDateThru is equal to 

                              BF cOrdersFound = "1"

     '1a'1a

Data Structure

D1700830 - Check For Service Orders

Parameter NameData ItemData TypeReq/OptI/O/Both
cModeEV01charREQINPUT

An option that specifies the type of processing for an event.

mnCustomerNumberAN8MATH_NUMERICOPTNONE

A number that identifies an entry in the Address Book system, such as employee, applicant, participant, customer, supplier, tenant, or 
location.

mnAssetItemNumberNUMBMATH_NUMERICOPTNONE

An 8-digit number that uniquely identifies an asset.

mnInventoryItemNumberITMMATH_NUMERICOPTNONE

An inventory item number. The system provides three separate item numbers plus an extensive cross-reference capability to other item 
numbers (see data item XRT) to accommodate substitute item numbers, replacements, bar codes, customer numbers, supplier numbers, and 
so forth. The item numbers are as follows:   o Item Number (short) - An eight-digit, computer-assigned item number     o 2nd Item Number - The 
25-digit, free-form, user defined alphanumeric item number     o 3rd Item Number - Another 25-digit, free-form, user defined alphanumeric item 
number

szStatusCodeWoFromSRSTcharREQINPUT

A user defined code (00/SS) that describes the status of a work order, rate schedule, or engineering change order. Any status change from 
90 through 99  triggers the system to automatically update the completion date.

szStatusCodeWoThruSRSTcharREQINPUT

A user defined code (00/SS) that describes the status of a work order, rate schedule, or engineering change order. Any status change from 
90 through 99  triggers the system to automatically update the completion date.

jdStartFromDateUPMJJDEDATEREQINPUT

The date that specifies the last update to the file record.

szProductModelPRODMcharOPTNONE

A code that classifies an inventory item into a model for customer service. Some examples include: Laser Printer, Inkjet or Fax.

cOrdersFoundEV01charREQOUTPUT

An option that specifies the type of processing for an event.

mnCurrentOrder_DOCODOCOMATH_NUMERICOPTNONE

A number that identifies an original document. This document can be a voucher, a sales order, an invoice, unapplied cash, a journal entry, 
and so on.

cTypeWoTYPScharOPTNONE

A user defined code (00/TY) that indicates the classification of a work order or engineering change order. You can use work order type as a 
selection criterion for work order approvals.

szFailureCodeFAILCDcharOPTNONE

A user defined code (17/FC) that indicates the type of defect.

jdRepairDateFromREPDTJDEDATEOPTNONE

The date that the equipment was repaired.

jdRepairDateThruREPDTJDEDATEOPTNONE

The date that the equipment was repaired.

Related Functions

None

Related Tables

None