//---------------------------------------------------------------------------

#ifndef Unit4H
#define Unit4H
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Data.DB.hpp>
#include <Data.FMTBcd.hpp>
#include <Data.SqlExpr.hpp>
#include <Datasnap.DBClient.hpp>
#include <Datasnap.Provider.hpp>
#include "cxContainer.hpp"
#include "cxControls.hpp"
#include "cxEdit.hpp"
#include "cxGraphics.hpp"
#include "cxLabel.hpp"
#include "cxLookAndFeelPainters.hpp"
#include "cxLookAndFeels.hpp"
#include <Vcl.ExtCtrls.hpp>
#include "cxButtons.hpp"
#include "cxDBLookupComboBox.hpp"
#include "cxDBLookupEdit.hpp"
#include "cxDropDownEdit.hpp"
#include "cxLookupEdit.hpp"
#include "cxMaskEdit.hpp"
#include "cxTextEdit.hpp"
#include <Vcl.Menus.hpp>
#include <Data.DBXFirebird.hpp>
#include <FireDAC.Comp.Client.hpp>
#include <FireDAC.Comp.UI.hpp>
#include <FireDAC.Phys.FB.hpp>
#include <FireDAC.Phys.FBDef.hpp>
#include <FireDAC.Phys.hpp>
#include <FireDAC.Phys.IBBase.hpp>
#include <FireDAC.Phys.Intf.hpp>
#include <FireDAC.Phys.ODBC.hpp>
#include <FireDAC.Phys.ODBCBase.hpp>
#include <FireDAC.Phys.ODBCDef.hpp>
#include <FireDAC.Stan.Async.hpp>
#include <FireDAC.Stan.Def.hpp>
#include <FireDAC.Stan.Error.hpp>
#include <FireDAC.Stan.Intf.hpp>
#include <FireDAC.Stan.Option.hpp>
#include <FireDAC.Stan.Pool.hpp>
#include <FireDAC.UI.Intf.hpp>
#include <FireDAC.VCLUI.Wait.hpp>
#include <IdBaseComponent.hpp>
#include <IdComponent.hpp>
#include <IdTCPClient.hpp>
#include <IdTCPConnection.hpp>
#include <Vcl.Dialogs.hpp>
#include "cxClasses.hpp"
#include "cxCustomData.hpp"
#include "cxData.hpp"
#include "cxDataStorage.hpp"
#include "cxDBData.hpp"
#include "cxFilter.hpp"
#include "cxGrid.hpp"
#include "cxGridCustomTableView.hpp"
#include "cxGridCustomView.hpp"
#include "cxGridDBTableView.hpp"
#include "cxGridLevel.hpp"
#include "cxGridTableView.hpp"
#include "cxNavigator.hpp"
#include "cxStyles.hpp"
#include "dxDateRanges.hpp"
#include "dxScrollbarAnnotations.hpp"
//---------------------------------------------------------------------------
class TForm4 : public TForm
{
__published:	// IDE-managed Components
	TDataSource *dsPricer2;
	TClientDataSet *cdsPricer2;
	TDataSetProvider *dspPricer2;
	TSQLDataSet *sdsPricer2;
	TcxLabel *cxLabel1;
	TPanel *Panel1;
	TcxButton *sve;
	TSQLConnection *Konekcija;
	TSaveDialog *SaveDialog1;
	TSQLDataSet *sqlMagacin;
	TDataSetProvider *dspMagacin;
	TClientDataSet *cdsMagacin;
	TIntegerField *cdsMagacinSIFRA_MAGACINA;
	TStringField *cdsMagacinMAGACIN;
	TIntegerField *cdsMagacinSEDISTE;
	TStringField *cdsMagacinSKRACENICA;
	TStringField *cdsMagacinMESTO;
	TStringField *cdsMagacinADRESA;
	TSmallintField *cdsMagacinCENA_MAGACIN;
	TIntegerField *cdsMagacinDEF_DOKUMENT;
	TIntegerField *cdsMagacinROBNO_DALJINSKI;
	TFMTBCDField *cdsMagacinMAX_KOL;
	TIntegerField *cdsMagacinKES;
	TIntegerField *cdsMagacinCEK;
	TIntegerField *cdsMagacinKARTICA;
	TIntegerField *cdsMagacinVIRMAN;
	TFMTBCDField *cdsMagacinAKCIJSKI_RABAT;
	TIntegerField *cdsMagacinKARTICA_TERMINAL;
	TStringField *cdsMagacinUSER_RFZO_KNJIZICA;
	TStringField *cdsMagacinPASS_RFZO_KNJIZICA;
	TSmallintField *cdsMagacinSALJI_KESIRICE;
	TIntegerField *cdsMagacinKESIRICI;
	TStringField *cdsMagacinVAGA_PREFIX;
	TFMTBCDField *cdsMagacinVAGA_KOEF_TEZINA;
	TIntegerField *cdsMagacinIMA_VAGU;
	TStringField *cdsMagacinHOST_REST;
	TIntegerField *cdsMagacinPORT_REST;
	TSmallintField *cdsMagacinOBRISI_PREFIKS_VAGE;
	TIntegerField *cdsMagacinDEF_DOKUMENT_CC;
	TSmallintField *cdsMagacinBENEFIT;
	TSmallintField *cdsMagacinBROJ_DECIMALA_IZLAZ;
	TSmallintField *cdsMagacinAPI_ID_KESIRICI;
	TStringField *cdsMagacinKESIRICI_API;
	TSmallintField *cdsMagacinVAUCER;
	TIntegerField *cdsMagacinRACUN_IZ_VISE_MAGACINA;
	TSmallintField *cdsMagacinBEZGOTOVINSKO;
	TDataSource *dsMagacin;
	TcxLookupComboBox *cxLookupComboBox1;
	TPanel *Panel2;
	TcxButton *promene;
	TStringField *sdsPricer2KOD;
	TStringField *sdsPricer2BARKOD;
	TStringField *sdsPricer2ARTIKAL;
	TStringField *sdsPricer2IDJMNALEPNICE;
	TStringField *sdsPricer2IDPJM;
	TStringField *sdsPricer2LOKALNI_NAZIV;
	TFMTBCDField *sdsPricer2CENA;
	TFloatField *sdsPricer2ODNOSJMNALEPNICE;
	TIntegerField *sdsPricer2AKCIJA_OZNAKA;
	TStringField *sdsPricer2JED_MERE;
	TFMTBCDField *sdsPricer2KOLICINA;
	TStringField *sdsPricer2KATEGORIJA;
	TStringField *sdsPricer2TIP_CENOVNIKA;
	TDateField *sdsPricer2VAZI_OD;
	TDateField *sdsPricer2VAZI_DO;
	TFMTBCDField *sdsPricer2STARA_CENA;
	TStringField *cdsPricer2KOD;
	TStringField *cdsPricer2BARKOD;
	TStringField *cdsPricer2ARTIKAL;
	TStringField *cdsPricer2IDJMNALEPNICE;
	TStringField *cdsPricer2IDPJM;
	TStringField *cdsPricer2LOKALNI_NAZIV;
	TFMTBCDField *cdsPricer2CENA;
	TFloatField *cdsPricer2ODNOSJMNALEPNICE;
	TIntegerField *cdsPricer2AKCIJA_OZNAKA;
	TStringField *cdsPricer2JED_MERE;
	TFMTBCDField *cdsPricer2KOLICINA;
	TStringField *cdsPricer2KATEGORIJA;
	TStringField *cdsPricer2TIP_CENOVNIKA;
	TDateField *cdsPricer2VAZI_OD;
	TDateField *cdsPricer2VAZI_DO;
	TFMTBCDField *cdsPricer2STARA_CENA;
	TcxGridDBTableView *gridView;
	TcxGridLevel *gridView2Level1;
	TcxGrid *gridView2;
	TPanel *Panel3;
	TcxGridDBColumn *gridViewKOD;
	TcxGridDBColumn *gridViewBARKOD;
	TcxGridDBColumn *gridViewARTIKAL;
	TcxGridDBColumn *gridViewIDJMNALEPNICE;
	TcxGridDBColumn *gridViewIDPJM;
	TcxGridDBColumn *gridViewLOKALNI_NAZIV;
	TcxGridDBColumn *gridViewCENA;
	TcxGridDBColumn *gridViewODNOSJMNALEPNICE;
	TcxGridDBColumn *gridViewAKCIJA_OZNAKA;
	TcxGridDBColumn *gridViewJED_MERE;
	TcxGridDBColumn *gridViewKOLICINA;
	TcxGridDBColumn *gridViewKATEGORIJA;
	TcxGridDBColumn *gridViewTIP_CENOVNIKA;
	TcxGridDBColumn *gridViewVAZI_OD;
	TcxGridDBColumn *gridViewVAZI_DO;
	TcxGridDBColumn *gridViewSTARA_CENA;
	TcxButton *Izvezi;
	TPanel *Panel4;
	TcxLabel *cxLabel2;
	TcxTextEdit *EditDelimiter2;
	TPanel *Panel5;
	void __fastcall sveClick(TObject *Sender);
	void __fastcall FormCreate(TObject *Sender);
	void __fastcall FormResize(TObject *Sender);
	void __fastcall IzveziClick(TObject *Sender);
private:	// User declarations
public:		// User declarations
	int SIFRA_MAGACINA;
	String delimiter;
	__fastcall TForm4(TComponent* Owner);
	int __fastcall PodrazumevaniMagacin();
	void __fastcall Export(int mg, int sve);
	void __fastcall UpisiUPricerLog(int mg);
	TDateTime __fastcall VratiVremeZadnjegUpisa(int magacin);
	String __fastcall IzbaciNavodnike(String tekst);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm4 *Form4;
//---------------------------------------------------------------------------
#endif
