Index: cw.mac.rou =================================================================== diff -u -r762 -r922 --- cw.mac.rou (.../cw.mac.rou) (revision 762) +++ cw.mac.rou (.../cw.mac.rou) (revision 922) @@ -5,30 +5,31 @@ #Include %Prod.Product #Include %CHUI.System -A B C D E F G H I J K L M N=O P Q R S U V W X Y,Z +A B C D E F G H I J K L M N=O P Q R S:T U V W X Y,Z H -Type2Proforma(ORDNr) - New R,KLNr,OLNr,OrdType,OrderTotaal,Proforma - Set KLNr=$P($G(^KO1(ORDNr,"F")),D),OrdType="",OrderTotaal=0 - If KLNr { - Set OrdType=$P(^KOD(KLNr,"F",ORDNr,1),D,25) - If OrdType'="M",OrdType'="P" { - Set OLNr=100 - For { - Set OLNr=$O(^KOD(KLNr,"F",ORDNr,OLNr)) - Quit:'OLNr - Set OrderTotaal=OrderTotaal+$P(^KOD(KLNr,"F",ORDNr,OLNr),D,9) - } + ; +OLInkortbaar(MPRNr) + New Inkortbaar,BSKey,BSRec + Set BSKey="" + For Set BSKey=$O(^PRBS("BS",MPRNr,BSKey)) Quit:BSKey="" Do Quit + . Set BSRec=^PRBS("BS",MPRNr,BSKey) + . Quit:$P(BSRec,D,3)'="K" ; Geen kindproduct + . Set Inkortbaar=$P(BSRec,D,23) + Quit Inkortbaar + ; +kvd(KLNr,VerlofDagen) + New KlantVerlofPeriode,VerlofPeriodes,Next,Periode,Dag + Set KlantVerlofPeriode=##class(BL.CRM.impl.KlantVerlofPeriode).%New(KLNr) + Do KlantVerlofPeriode.Fetch(.VerlofPeriodes) + If $D(VerlofPeriodes) { + Set Next="" + For { + Set Next=$O(VerlofPeriodes(Next)) + Quit:'Next + Set Periode=VerlofPeriodes(Next) + For Dag=$P(Periode,D,2):1:$P(Periode,D,3) Set VerlofDagen(Dag)="" } } - If OrdType'="M",OrdType'="P" { - If OrderTotaal,'$$IsVTW^KLANT(KLNr) Quit - Set Buttons="Buttons",Buttons(1)="Annuleer",Buttons(2)="Proforma&P",Buttons(3)="+ factuur&F" - Set:OrderTotaal Buttons(2)=Buttons(2)_"*" - Set:'OrderTotaal Buttons(3)=Buttons(3)_"*" - Set Proforma=$$^vhTXTPOP("FLOWORD","TYPE2PROFORMA","",$$EXTNUM^vhDTyp(ORDNr,0,".",0),$P(^KKL(^KK1(KLNr),0),D,2),$$EXTNUM^vhDTyp(OrderTotaal,0,".T",2)) - If $L(Proforma) Set R=^KOD(KLNr,"F",ORDNr,1),$P(R,D,25)="P",$P(R,D,29)=$S(Proforma="F":"P",1:"F"),^KOD(KLNr,"F",ORDNr,1)=R - } Quit ; blg(Document,DocNum)