; verze z 8.6.2006 Name('Export stavu skladu Plus(TNTRADE)') Designed('SKL_MAN#1') Author('Winduo Team','EMail: winduo@winduo.cz','http://www.winduo.com','http://www.winduo.cz') Descr('Exportuje stav skladu pro e-shop TN TRADE') WNSType(-1); ;**************************************************************************** ExpName:String ExpName='c:\temp\sklad.dat' Export:TextFile Rewrite(Export,ExpName, True); ;LoadTranslateTab(trans_ISO8859_2); ;SetTranslate(Export,True) DeclareRec('Sklad'); DeclareRec('KeySklad9'); DeclareRec('KeySklad10'); DeclareRec('Vyrobek'); DeclareRec('KeyVyrobek1'); DeclareRec('Ciselnik'); DeclareRec('KeyCiselnik1'); Sklad2:Sklad DeclareRec('KeySklad10') DeclareRec('Pohyb') DeclareRec('KeyPohyb3') ClearKey(KeySklad9); InitStatus(UsedKeys(KeySklad9),'Exportuji stav ...') Veta:LongInt; Pozice:LongInt Polozek:LongInt Zustatek:Double VetaV:LongInt VetaS:LongInt LocBo:Boolean LocD:Double; LocBo2:Boolean LocBo3:Boolean VetaC:LongInt VetaS2:LongInt Rezervace:Real VetaP:LongInt RezTime:LongInt=SwapL((GetDate()*65536+GetTime())!LongInt(-1)); While(NextKey(KeySklad9,Veta)) begin ReadRec(Sklad,Veta); if((Sklad.Sklad=1) and (InFilter(Sklad)) and (Length(Sklad.Kod<>0))) begin Rezervace=0 Write(Export,Sklad.Kod); Write(Export,';'); Write(Export,Sklad.Nazev); Write(Export,';'); Write(Export,Sklad.LongText); Write(Export,';'); KeyCiselnik1.Length=SizeOf(KeyCiselnik1)-1 KeyCiselnik1.Druh=Swap(1) KeyCiselnik1.Kod=SwapL(Sklad.Druh) if(FindKey(KeyCiselnik1,VetaC)) ReadRec(Ciselnik,VetaC) else ClearRec(Ciselnik) Write(Export,Ciselnik.Popis); Write(Export,';'); ClearRec(Sklad2) if(Sklad.NavaznaSluzba<>0) begin KeySklad10.Length=4 KeySklad10.Cislo=SwapL(Sklad.NavaznaSluzba) if(FindKey(KeySklad10,VetaS2)) begin ReadRec(Sklad2,VetaS2) end end Write(Export,StrFinanc(Sklad2.CenaA,2)); Write(Export,';'); if(Sklad.TypKarty=2) begin Zustatek=0 KeyVyrobek1.Length=SizeOf(KeyVyrobek1)-1; KeyVyrobek1.CisloVyrobku=SwapL(Sklad.Cislo); LocBo2=False LocBo=SearchKey(KeyVyrobek1,VetaV); While((LocBo) and (KeyVyrobek1.CisloVyrobku=SwapL(Sklad.Cislo))) begin ReadRec(Vyrobek,VetaV); if(Vyrobek.Mnozstvi<>0) begin KeySklad10.Length=SizeOf(KeySklad10)-1; KeySklad10.Cislo=SwapL(Vyrobek.CisloMat); FindKey(KeySklad10,VetaS); ReadRec(Sklad2,VetaS); ZjistiRezervace(Sklad2.Cislo); LocD=Int(RoundQuantity((Sklad2.PocStav+Sklad2.Prijmy-Sklad2.Vydaje-Rezervace)/Vyrobek.Mnozstvi)); if((LocD