1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
| var
FAM,SEC,ET String
Q query
TC,QTC,TCDELIG tcursor
FM Form
endvar
setMouseShape(MouseWait,true)
If FM.attach("PATIENTER") Then
FM.bringToTop()
Else
FM.open(":WORK:PDX V2010\\PATIENTER.fsl")
EndIf
;Tri DELAI
TC.attach(CADRE)
TC.switchIndex()
CADRE.resync(TC)
FAM=iif(FAMIL.isBlank(),"",",")+FAMIL
SEC=SECT1
If SEC="TOUS" then SEC="" EndIf
If ETA1.Value="TOUS" then
ET="NOT LIV,NOT ENR,NOT TRT, NOT ANU"
Else
ET=ETA1+",NOT LIV,NOT ENR,NOT TRT, NOT ANU"
EndIf
TC.attach(CADRE)
TC.empty()
Q = Query
PDX V2010\TABLES\CDELIG.DB | NCOMMANDE | LIGNE | FAMILLE | ETAPE | DELAI |
| Check | Check | Check _jointure1 ~ FAM | CheckPlus ~ ET | Check |
PDX V2010\TABLES\FAMILLES.DB | Famille | Secteur |
| _jointure1 | CheckPlus ~ SEC |
ENDQUERY
;If NOT Q.executeQbe(":WORK:PDX V2010\\TABLES\\SELECTION.DB") then errorshow() EndIf; return
if not Q.executeQbe(QTC) then
errorshow()
endif
QTC.add(TC)
QTC.Close()
TC.Home()
CADRE.resync(TC)
;Tri DELAI
TC.attach(CADRE)
TC.switchIndex("TRIDELAICROI")
TCDELIG.Open(":WORK:PDX V2010\\TABLES\\CDELIG.DB")
Scan TC:
TCDELIG.Qlocate(TC.NCOMMANDE,TC.LIGNE)
If TC.ETAPE="LCT" then
If TCDELIG.DELAI_PREPARATION<Today() Then TC.URGENT="g" EndIf
EndIf
If TC.ETAPE="PRP" then
If TCDELIG.DELAI_ASSEMBLAGE<Today() Then TC.URGENT="g" EndIf
EndIf
If TC.ETAPE="ASS" then
If TCDELIG.DELAI_SOUDURE<Today() Then TC.URGENT="g" EndIf
EndIf
If TC.ETAPE="SOU" then
If TCDELIG.DELAI_USINAGE<Today() Then TC.URGENT="g" EndIf
EndIf
If TC.ETAPE="USI" then
If TCDELIG.DELAI<Today() Then TC.URGENT="g" EndIf
EndIf
EndScan
TC.Home()
CADRE.resync(TC)
TC.Close()
TCDELIG.Close()
FM.Close()
setMouseShape(Mousearrow,true) |
Partager