PRT.LINE: *** Set up line printing.

          LD.GET LDID

          PN = LD(1)
          IF NOT(NUM(PN)) THEN RETURN

          GET.ALL.PRD BR,PN,QSIGN,GROUP

          STAT = PRD(3)

          IF PRD.BR(25)='I' OR PRD.BR(25)='A' OR PRD.BR(25)='D' THEN
             SERIAL = YES
          END

          BEGIN CASE
          CASE STAT = 1;   STAT = 'S'
          CASE STAT = 2;   STAT = 'N'
          CASE STAT = 3;   STAT = 'M'
          CASE STAT = 4;   STAT = 'D'
          CASE STAT = 5;   STAT = 'R'
          CASE STAT = 6;   STAT = 'C'
          END CASE
          BEGIN CASE
          CASE PRT.OPT[1,1]='S' AND STAT # 'S'; GOTO SKIPPRT
          CASE PRT.OPT[1,1]='N' AND STAT = 'S'; GOTO SKIPPRT
          END CASE

          OE.DESC.GET DESC,'','POE Printing'
          IF LD(36)<1,GEN,1> # '' THEN DESC<1,-1> = LD(36)<1,GEN,1>

*----Kits
          IF LD(31)#'' AND PRD(86)<1,2> = '1' THEN
             KCMPS = LD(31)
             KQTYS = LD(30)
             GET.KIT.COMPS KCMPS,KQTYS,35,DESC
          END
          HDESC = DESC

*** Get our qty, location, commitment, and tag printing info.

          PRDD.BR.GET STK.BR,PN
          TQTY     = SUM(LD(5)<1,GEN>) + SUM(LD(6)<1,GEN>)

          IF TQTY  = 0 THEN RETURN
          TQTYS    = ADDS(LD(5)<1,GEN>,LD(6)<1,GEN>)
          TQ.CNT   = DCOUNT(TQTYS,SVM)
          FOR TQ = 1 TO TQ.CNT
             TQNT        = TQTYS<1,1,TQ>
             SHP.TYP.LOC = LD(7)<1,GEN,TQ>
             TAG         = FIELD(SHP.TYP.LOC,'^',2)
*             LOCA        = FIELD(FIELD(SHP.TYP.LOC,'~',2),'^',1)

             FORMS.LOCATIONS.GET GEN,1,LSTATS,LOC.LIST,TQ

             LOCA     = FIELD(LOC.LIST<1,1>,'~',2)
             LOC.STAT = FIELD(LOC.LIST<1,1>,'~',3)
             IF TAG # '' THEN LOCA = FIELD(TAG,".",1)

             GOSUB PRT.PO
             IF DESC # HDESC THEN DESC = HDESC
          NEXT TQ



          *** Print All tag Qtys first
          TYP.LOCS = LD(7)<1,GEN>
          LOC.CT   = DCOUNT(TYP.LOCS,SVM)

          FOR LOC  = 1 TO LOC.CT
             TYPE  = FIELD(TYP.LOCS<1,1,LOC>,'~',1)
             IF TYPE = 'T' THEN
                TAG     = TYP.LOCS<1,1,LOC>
                ORN     = FIELD(TAG,'^',2)
                OID     = FIELD(ORN,'.',1)
                LDID    = FIELD(ORN,'.',2)+0
                GID     = ''
                TYPE    = ''
                TORN    = ''
                CTAG    = '-T'
                SHP.QTY = LD(6)<1,GEN,LOC>
                SBR     = STK.BR

                GOSUB PRT.QTY

                TQTY   -= SHP.QTY
             END
          NEXT LOC

          *** Print Stock committments until P/O Qty is used up
          GOSUB SET.PRIS

          *** If the control record to exclude all sales orders
          *** outside the plenty date is set to yes, then prioritize
          *** our orders by ship date and first in first out.
          GOSUB GET.PRI

          ID.CT = DCOUNT(IDS,AM)
          FOR J = 1 TO ID.CT
             IF TQTY <= 0 AND CMTD THEN EXIT
             SHP.QTY  = -QTYS<J>+0
             ID       = IDS<J>
             SBR      = SBRS<J>

             *** Make sure to setup a correct branch.
             IF SBR   = '' THEN SBR = WHSE

             *** Only show Tagged Orders on the P/O recvr...
             IF SBR # STK.BR AND WRK = 'Xfr' THEN GOTO NEXTJ

             IF SHP.QTY > 0 AND FIELD(ID,'~',6) # 'D' THEN
                OID   = FIELD(ID,'~',3)
                GID   = FIELD(ID,'~',5)
                TYPE  = FIELD(ID,'~',6)
                TORN  = FIELD(ID,'~',7)
                LDID  = ''
                CTAG  = ''

                *** Don't print the tagged qtys if they ask not to.
                IF TYPE = 'T' AND NOT(PRT.TGS) THEN CONTINUE

                GOSUB PRT.QTY
                TQTY -= SHP.QTY
             END
NEXTJ:    NEXT J

          GOSUB PRT.XFER

SKIPPRT:  GOSUB SUBT.ONE
          PRINT

          RETURN