Commit 5401b926 authored by Milan Pumpalovic's avatar Milan Pumpalovic

Dodato u pricer da kroz tabelu mogu da se menjaju/uklone pozicije kolona.…

Dodato u pricer da kroz tabelu mogu da se menjaju/uklone pozicije kolona. Takodje je dodato da moze da se menja delimiter '|' default
parent 1444bccb
...@@ -21,6 +21,22 @@ ...@@ -21,6 +21,22 @@
#pragma link "cxLookupEdit" #pragma link "cxLookupEdit"
#pragma link "cxMaskEdit" #pragma link "cxMaskEdit"
#pragma link "cxTextEdit" #pragma link "cxTextEdit"
#pragma link "cxClasses"
#pragma link "cxCustomData"
#pragma link "cxData"
#pragma link "cxDataStorage"
#pragma link "cxDBData"
#pragma link "cxFilter"
#pragma link "cxGrid"
#pragma link "cxGridCustomTableView"
#pragma link "cxGridCustomView"
#pragma link "cxGridDBTableView"
#pragma link "cxGridLevel"
#pragma link "cxGridTableView"
#pragma link "cxNavigator"
#pragma link "cxStyles"
#pragma link "dxDateRanges"
#pragma link "dxScrollbarAnnotations"
#pragma resource "*.dfm" #pragma resource "*.dfm"
TForm4 *Form4; TForm4 *Form4;
int magacin; int magacin;
...@@ -34,7 +50,9 @@ __fastcall TForm4::TForm4(TComponent* Owner) ...@@ -34,7 +50,9 @@ __fastcall TForm4::TForm4(TComponent* Owner)
void __fastcall TForm4::FormCreate(TObject *Sender) void __fastcall TForm4::FormCreate(TObject *Sender)
{ {
// create // create
Position = poScreenCenter; this->WindowState = wsMaximized;
// Position = poScreenCenter;
cdsPricer2->Close(); cdsPricer2->Close();
cdsPricer2->Open(); cdsPricer2->Open();
...@@ -61,20 +79,7 @@ void __fastcall TForm4::sveClick(TObject *Sender) ...@@ -61,20 +79,7 @@ void __fastcall TForm4::sveClick(TObject *Sender)
void __fastcall TForm4::Export(int mg, int sve){ void __fastcall TForm4::Export(int mg, int sve){
TStringList* fajl = new TStringList(); SIFRA_MAGACINA = mg;
WideString naredba = "001|Barcode | Code | Name | Local name | Sales price | List price | Unit Unit | Cenovnik | Weight | Weight unit | Price unit | Vazi_od | Vazi_do";
fajl->Append( naredba );
SaveDialog1->Title = "Izvoz podataka za Pricer";
SaveDialog1->DefaultExt = "csv";
SaveDialog1->Filter = "Text|*.csv|All files|*.*";
SaveDialog1->InitialDir = "C:\\Price\\upload" ;
SaveDialog1->FileName = "item_";
AnsiString cena, unit_price;
Currency cena_zs_stampu;
int mnozi_cenu = mnozi_odnos_pjm;
char lOldDecimalSeparator = FormatSettings.DecimalSeparator;
FormatSettings.DecimalSeparator = '.';
cdsPricer2->Active = false; cdsPricer2->Active = false;
sdsPricer2->ParamByName("MAG")->AsInteger = mg; sdsPricer2->ParamByName("MAG")->AsInteger = mg;
sdsPricer2->ParamByName("datum")->AsDate = Date(); sdsPricer2->ParamByName("datum")->AsDate = Date();
...@@ -84,97 +89,109 @@ void __fastcall TForm4::Export(int mg, int sve){ ...@@ -84,97 +89,109 @@ void __fastcall TForm4::Export(int mg, int sve){
sdsPricer2->ParamByName("datum_promene")->Clear(); sdsPricer2->ParamByName("datum_promene")->Clear();
} }
cdsPricer2->Active = true; cdsPricer2->Active = true;
if ( SaveDialog1->Execute( ) ) }
{
while (!cdsPricer2->Eof) { void __fastcall TForm4::IzveziClick(TObject *Sender)
try { {
if (cdsPricer2->RecordCount > 0) { //
naredba = "001|"; delimiter = EditDelimiter2->Text.Trim();
naredba = naredba + cdsPricer2->FieldByName("BARKOD")->AsString + "|"; TStringList* fajl = new TStringList();
naredba = naredba + cdsPricer2->FieldByName("KOD")->AsString + "|"; WideString naredba;
naredba = naredba + cdsPricer2->FieldByName("artikal")->AsString+ "|"; // WideString naredba = "001|Barcode | Code | Name | Local name | Sales price | List price | Unit | Cenovnik | Weight | Weight unit | Price unit | Vazi_od | Vazi_do";
naredba = naredba + cdsPricer2->FieldByName("lokalni_naziv")->AsString+ "|"; // fajl->Append(naredba);
// naredba = naredba + cdsPricer2->FieldByName("AKCIJA_OZNAKA")->AsString+ "|";
SaveDialog1->Title = "Izvoz podataka za Pricer";
if (mnozi_cenu == 0 && cdsPricer2->FieldByName("ODNOSJMNALEPNICE")->AsCurrency > 0) { SaveDialog1->DefaultExt = "csv";
cena_zs_stampu = cdsPricer2->FieldByName("cena")->AsCurrency / cdsPricer2->FieldByName("ODNOSJMNALEPNICE")->AsCurrency; SaveDialog1->Filter = "Text|*.csv|All files|*.*";
// cena = Strutils::AnsiReplaceStr(FormatCurr("0.00",cdsPricer2->FieldByName("cena")->AsCurrency), ".", "") + "|"; SaveDialog1->InitialDir = "C:\\Price\\upload";
// cena = Strutils::AnsiReplaceStr(cena, ",", "") ; SaveDialog1->FileName = "item_";
cena = FormatCurr("0.00", cdsPricer2->FieldByName("cena")->AsCurrency) + "|";
// unit_price = Strutils::AnsiReplaceStr(FormatCurr("0.00",cena_zs_stampu), ".", ""); AnsiString cena, unit_price;
// unit_price = Strutils::AnsiReplaceStr(unit_price, ",", "")+ "|"; Currency cena_zs_stampu;
unit_price = FormatCurr("0.00", cena_zs_stampu); int mnozi_cenu = mnozi_odnos_pjm;
unit_price = unit_price + "|"; char lOldDecimalSeparator = FormatSettings.DecimalSeparator;
FormatSettings.DecimalSeparator = '.';
}
else if (mnozi_cenu == 1 && cdsPricer2->FieldByName("ODNOSJMNALEPNICE")->AsCurrency > 0) { if (SaveDialog1->Execute()) {
cena_zs_stampu = cdsPricer2->FieldByName("cena")->AsCurrency * cdsPricer2->FieldByName("ODNOSJMNALEPNICE")->AsCurrency; if (!gridView) {
// cena = Strutils::AnsiReplaceStr(FormatCurr("0.00",cena_zs_stampu), ".", "") + "|"; ShowMessage("Greka: TcxGridDBTableView nije pronaen!");
// cena = Strutils::AnsiReplaceStr(cena, ",", "") ; delete fajl;
cena = FormatCurr("0.00", cena_zs_stampu) + "|"; return;
}
// unit_price = Strutils::AnsiReplaceStr(FormatCurr("0.00",cdsPricer2->FieldByName("cena")->AsCurrency), ".", ""); cdsPricer2->First();
// unit_price = Strutils::AnsiReplaceStr(unit_price, ",", "")+ "|"; while (!cdsPricer2->Eof) {
unit_price = FormatCurr("0.00", cdsPricer2->FieldByName("cena")->AsCurrency); try {
unit_price = unit_price + "|"; if (cdsPricer2->RecordCount > 0) {
naredba = "001" + delimiter;
}
else { for (int i = 0; i < gridView->ColumnCount; i++) {
// cena = Strutils::AnsiReplaceStr(FormatCurr("0.00",cdsPricer2->FieldByName("cena")->AsCurrency), ".", "") + "|"; TcxGridDBColumn* column = gridView->Columns[i];
// cena = Strutils::AnsiReplaceStr(cena, ",", "") ;
cena = FormatCurr("0.00", cdsPricer2->FieldByName("cena")->AsCurrency) + "|"; // Formatira cenu na dve decimale i dodaje separator if (!column->Visible) {
unit_price = cena; continue;
} }
String columnName = column->DataBinding->FieldName;
naredba = naredba + cena; if (columnName == "cena" || columnName == "unit_price") {
naredba = naredba + unit_price; if (mnozi_cenu == 0 && cdsPricer2->FieldByName("ODNOSJMNALEPNICE")->AsCurrency > 0) {
naredba = naredba + " |"; cena_zs_stampu = cdsPricer2->FieldByName("cena")->AsCurrency / cdsPricer2->FieldByName("ODNOSJMNALEPNICE")->AsCurrency;
naredba = naredba + " |"; cena = FormatCurr("0.00", cdsPricer2->FieldByName("cena")->AsCurrency) + delimiter;
naredba = naredba + cdsPricer2->FieldByName("tip_cenovnika")->AsString+ "|"; unit_price = FormatCurr("0.00", cena_zs_stampu) + delimiter;
naredba = naredba + cdsPricer2->FieldByName("IDPJM")->AsString+ "|"; }
naredba = naredba + cdsPricer2->FieldByName("IDJMNALEPNICE")->AsString+ "|"; else if (mnozi_cenu == 1 && cdsPricer2->FieldByName("ODNOSJMNALEPNICE")->AsCurrency > 0) {
naredba = naredba + cdsPricer2->FieldByName("ODNOSJMNALEPNICE")->AsString+ "|"; cena_zs_stampu = cdsPricer2->FieldByName("cena")->AsCurrency * cdsPricer2->FieldByName("ODNOSJMNALEPNICE")->AsCurrency;
// naredba = naredba + cdsPricer2->FieldByName("JED_MERE")->AsString+ "|"; cena = FormatCurr("0.00", cena_zs_stampu) + delimiter;
// naredba = naredba + cdsPricer2->FieldByName("kolicina")->AsString+ "|"; unit_price = FormatCurr("0.00", cdsPricer2->FieldByName("cena")->AsCurrency) + delimiter;
// naredba = naredba + cdsPricer2->FieldByName("kategorija")->AsString+ "|"; }
naredba = naredba + " |"; else {
naredba = naredba + FormatDateTime("DD.MM.YYYY",cdsPricer2->FieldByName("vazi_od")->AsDateTime)+ "|"; cena = FormatCurr("0.00", cdsPricer2->FieldByName("cena")->AsCurrency) + delimiter;
if (!cdsPricer2->FieldByName("vazi_do")->IsNull) { unit_price = cena;
naredba = naredba + FormatDateTime("DD.MM.YYYY",cdsPricer2->FieldByName("vazi_do")->AsDateTime)+ "||"; }
}
else { if (columnName == "cena") {
naredba = naredba + "||"; naredba += cena;
} } else if (columnName == "unit_price") {
naredba += unit_price;
// naredba = naredba + FormatCurr("0.00", cdsPricer2->FieldByName("stara_cena")->AsCurrency) + "|||"; }
// UpisiUFile(SaveDialog1->FileName, naredba,2) ; }
naredba = IzbaciNavodnika(naredba); else if (cdsPricer2->FindField(columnName) != NULL) {
fajl->Append( naredba ); naredba += cdsPricer2->FieldByName(columnName)->AsString + delimiter;
} } else {
else { naredba += delimiter;
// UpisiULogFile(LOG_FAJL, "TdmPricer::ExportPricer nama podataka:" + cdsStavke->FieldByName("artikal")->AsString , 2); }
}
} catch (Exception &e) { }
ShowMessage(e.Message); // ShowMessage(naredba[naredba.Length()]);
} // ShowMessage(delimiter);
cdsPricer2->Next(); // if (!naredba.IsEmpty() && naredba[naredba.Length()] == delimiter) {
naredba = ""; // naredba = naredba.SubString(1, naredba.Length() - 1);
} // }
fajl->Append(naredba);
}
}
catch (Exception &e) {
ShowMessage(e.Message);
}
cdsPricer2->Next();
}
}
}
FormatSettings.DecimalSeparator = lOldDecimalSeparator; FormatSettings.DecimalSeparator = lOldDecimalSeparator;
fajl->SaveToFile(SaveDialog1->FileName, TEncoding::UTF8); fajl->SaveToFile(SaveDialog1->FileName, TEncoding::UTF8);
delete fajl; delete fajl;
if(sve == 0){
UpisiUPricerLog(mg); if (sve == 0) {
} UpisiUPricerLog(SIFRA_MAGACINA);
}
ShowMessage("Izvoz zavrsen!!!"); ShowMessage("Izvoz zavrsen!!!");
} }
String __fastcall TForm4::IzbaciNavodnika(String tekst){ String __fastcall TForm4::IzbaciNavodnike(String tekst){
for (int i = 1; i <= tekst.Length(); i++) { for (int i = 1; i <= tekst.Length(); i++) {
if (tekst[i] == '"') { if (tekst[i] == '"') {
tekst[i] = ' '; tekst[i] = ' ';
} }
} }
return tekst; return tekst;
} }
...@@ -283,3 +300,14 @@ int __fastcall TForm4::PodrazumevaniMagacin(){ ...@@ -283,3 +300,14 @@ int __fastcall TForm4::PodrazumevaniMagacin(){
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TForm4::FormResize(TObject *Sender)
{
double sirina_dugmeta = Panel2->Width / 3;
sve->Width = sirina_dugmeta;
promene->Width = sirina_dugmeta;
Izvezi->Width = sirina_dugmeta;
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
...@@ -2,8 +2,8 @@ object Form4: TForm4 ...@@ -2,8 +2,8 @@ object Form4: TForm4
Left = 0 Left = 0
Top = 0 Top = 0
Caption = 'Izvoz u Excel' Caption = 'Izvoz u Excel'
ClientHeight = 175 ClientHeight = 358
ClientWidth = 561 ClientWidth = 700
Color = clBtnFace Color = clBtnFace
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
...@@ -11,20 +11,20 @@ object Form4: TForm4 ...@@ -11,20 +11,20 @@ object Form4: TForm4
Font.Name = 'Segoe UI' Font.Name = 'Segoe UI'
Font.Style = [] Font.Style = []
OnCreate = FormCreate OnCreate = FormCreate
OnResize = FormResize
TextHeight = 15 TextHeight = 15
object Panel1: TPanel object Panel1: TPanel
Left = 0 Left = 0
Top = 0 Top = 0
Width = 561 Width = 700
Height = 41 Height = 49
Align = alTop Align = alTop
BevelOuter = bvNone BevelOuter = bvNone
TabOrder = 0 TabOrder = 0
ExplicitWidth = 557
object cxLabel1: TcxLabel object cxLabel1: TcxLabel
Left = 0 Left = 0
Top = 0 Top = 0
Align = alClient Align = alLeft
Caption = 'Magacini:' Caption = 'Magacini:'
ParentFont = False ParentFont = False
Style.Font.Charset = DEFAULT_CHARSET Style.Font.Charset = DEFAULT_CHARSET
...@@ -33,30 +33,61 @@ object Form4: TForm4 ...@@ -33,30 +33,61 @@ object Form4: TForm4
Style.Font.Name = 'Segoe UI' Style.Font.Name = 'Segoe UI'
Style.Font.Style = [] Style.Font.Style = []
Style.IsFontAssigned = True Style.IsFontAssigned = True
ExplicitWidth = 557 ExplicitHeight = 41
end
object Panel4: TPanel
Left = 110
Top = 0
Width = 267
Height = 49
Align = alLeft
BevelOuter = bvNone
Caption = 'Panel4'
ShowCaption = False
TabOrder = 1
ExplicitHeight = 41
object cxLabel2: TcxLabel
Left = 0
Top = 0
Align = alTop
Caption = 'DELIMITER:'
ExplicitLeft = 80
ExplicitTop = 8
ExplicitWidth = 49
end
object EditDelimiter2: TcxTextEdit
Left = 0
Top = 26
Align = alBottom
TabOrder = 1
Text = '|'
ExplicitLeft = 144
ExplicitTop = 40
ExplicitWidth = 121
Width = 267
end
end
object Panel5: TPanel
Left = 377
Top = 0
Width = 323
Height = 49
Align = alClient
BevelOuter = bvNone
Caption = 'Panel5'
ShowCaption = False
TabOrder = 2
ExplicitLeft = 488
ExplicitTop = 16
ExplicitWidth = 185
ExplicitHeight = 41
end end
end
object cxLookupComboBox1: TcxLookupComboBox
Left = 0
Top = 41
Align = alClient
Properties.KeyFieldNames = 'SIFRA_MAGACINA'
Properties.ListColumns = <
item
FieldName = 'MAGACIN'
end>
Properties.ListOptions.SyncMode = True
Properties.ListSource = dsMagacin
TabOrder = 1
ExplicitWidth = 557
ExplicitHeight = 52
Width = 561
end end
object Panel2: TPanel object Panel2: TPanel
AlignWithMargins = True AlignWithMargins = True
Left = 0 Left = 0
Top = 104 Top = 287
Width = 561 Width = 700
Height = 68 Height = 68
Margins.Left = 0 Margins.Left = 0
Margins.Top = 10 Margins.Top = 10
...@@ -65,20 +96,20 @@ object Form4: TForm4 ...@@ -65,20 +96,20 @@ object Form4: TForm4
BevelOuter = bvNone BevelOuter = bvNone
Caption = 'Panel2' Caption = 'Panel2'
ShowCaption = False ShowCaption = False
TabOrder = 2 TabOrder = 1
ExplicitTop = 103 ExplicitTop = 103
ExplicitWidth = 557 ExplicitWidth = 557
object sve: TcxButton object sve: TcxButton
Left = 0 Left = 0
Top = 0 Top = 0
Width = 272 Width = 216
Height = 68 Height = 68
Margins.Left = 0 Margins.Left = 0
Margins.Top = 10 Margins.Top = 10
Margins.Right = 0 Margins.Right = 0
Margins.Bottom = 0 Margins.Bottom = 0
Align = alLeft Align = alLeft
Caption = 'Izvezi u Excel' Caption = 'U'#269'itaj sve'
LookAndFeel.Kind = lfFlat LookAndFeel.Kind = lfFlat
LookAndFeel.NativeStyle = True LookAndFeel.NativeStyle = True
OptionsImage.Glyph.SourceDPI = 96 OptionsImage.Glyph.SourceDPI = 96
...@@ -86,20 +117,18 @@ object Form4: TForm4 ...@@ -86,20 +117,18 @@ object Form4: TForm4
OptionsImage.Glyph.SourceWidth = 32 OptionsImage.Glyph.SourceWidth = 32
OptionsImage.Glyph.Data = { OptionsImage.Glyph.Data = {
89504E470D0A1A0A0000000D49484452000000100000001008060000001FF3FF 89504E470D0A1A0A0000000D49484452000000100000001008060000001FF3FF
6100000006624B474400FF00FF00FFA0BDA79300000183494441543811636018 6100000006624B474400FF00FF00FFA0BDA79300000150494441543811636018
68C088EC80D0D050E69BEAF755FE33FDD76364F8AFCFF09F411728AF77A9F99C 68C08CCB01DE769D9ACA72EE1755E4DCFEDC79B4FBA4974DAF9A82828BD0BD87
2290C68A1861A2BAB546A7801C6D209F0B8851909C91DC1E6401A0BA4F9B0337 BBDF21EB6141E678DAF684FC63F8F77FE7E1B2B55071F6FF4C8C8C20F63FC67F
0483C45840040803054D41340EEC822CFE1F89C384C46650125562305534010B C798FF33FE03B2C580188E500CF8C70854FE8FE13F4876EBA1F2EB405A0488C1
E9C9EA32288B2983D99B03D633D8485B31806810060B42091403BEFDFACA3031 08684ACB3F4646B01C5880EA849B4D8FB18343030721833D6CBBF703F15E983A
AA8FC144C198A13FB297E1EBCF2F60659DA7BB196EBCBBC900A241182C082550 26188399F1FF728EFF3CBA303E1E9A05E80F14AFE3514B580A18368415815400
0C78F1F125C38A93AB18FA227B18961E5FC600E283D4D9485B3308730A035D61 BDC7C2F187A79981F1FF7F5E09F9DAD5ABC3FE82C4519CE26ED7DDC2F8EFFFFF
0DC620311846310024F81F18F47FFEFE61E064E50471096214030CE4F419020C 1D47CA6A811A38D8FF70DBFC65F87B6BCF918A476CFF791C819A2B409A3E3D7F
FD18E2662730849B8731A889AB820D38F2F428C3DBEF6F194034088305A1048A B80F48EF0162061403FEFEFB3B8B898915E8450606F67FDCEB8029C0939981F9
019FBE7F62485F98C5F0E4FD5386B405190CDF7F7F072B2B372D65D010526700 83BB6DBFD6FFDF7F2E323033DC056A02C6F5EF8B401A8C707A0118D21F812AF8
D1200C168412C0D883B0F46A8D90630722082581E900CA42505B023780F5B2C0 8098E11F13A3DBAE8325BB416C740C8F0574090606C6060606865F40BC93FFCD
851819CE00BDAF03E47300310A626464588D2CF0FF3FC30F181F6C0A8C03A20D 9783407A902200256D65ED92DBF3C70000000049454E44AE426082}
1B0CA5FEFE633406B28D81061A039D657CB9F99C14903F481100B8526B445898
CF5F0000000049454E44AE426082}
TabOrder = 0 TabOrder = 0
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
...@@ -108,14 +137,51 @@ object Form4: TForm4 ...@@ -108,14 +137,51 @@ object Form4: TForm4
Font.Style = [] Font.Style = []
ParentFont = False ParentFont = False
OnClick = sveClick OnClick = sveClick
ExplicitLeft = -3
ExplicitTop = 2
end end
object promene: TcxButton object promene: TcxButton
Left = 272 Left = 216
Top = 0 Top = 0
Width = 289 Width = 260
Height = 68 Height = 68
Align = alClient Align = alLeft
Caption = 'Izvezi zadnje promene' Caption = 'U'#269'itaj zadnje promene'
OptionsImage.Glyph.SourceDPI = 96
OptionsImage.Glyph.SourceHeight = 32
OptionsImage.Glyph.SourceWidth = 32
OptionsImage.Glyph.Data = {
89504E470D0A1A0A0000000D49484452000000100000001008060000001FF3FF
6100000006624B474400FF00FF00FFA0BDA79300000150494441543811636018
68C08CCB01DE769D9ACA72EE1755E4DCFEDC79B4FBA4974DAF9A82828BD0BD87
BBDF21EB6141E678DAF684FC63F8F77FE7E1B2B55071F6FF4C8C8C20F63FC67F
C798FF33FE03B2C580188E500CF8C70854FE8FE13F4876EBA1F2EB405A0488C1
08684ACB3F4646B01C5880EA849B4D8FB18343030721833D6CBBF703F15E983A
26188399F1FF728EFF3CBA303E1E9A05E80F14AFE3514B580A18368415815400
BDC7C2F187A79981F1FF7F5E09F9DAD5ABC3FE82C4519CE26ED7DDC2F8EFFFFF
1D47CA6A811A38D8FF70DBFC65F87B6BCF918A476CFF791C819A2B409A3E3D7F
B80F48EF0162061403FEFEFB3B8B898915E8450606F67FDCEB8029C0939981F9
83BB6DBFD6FFDF7F2E323033DC056A02C6F5EF8B401A8C707A0118D21F812AF8
8098E11F13A3DBAE8325BB416C740C8F0574090606C6060606865F40BC93FFCD
9783407A902200256D65ED92DBF3C70000000049454E44AE426082}
TabOrder = 1
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = 30
Font.Name = 'Segoe UI'
Font.Style = []
ParentFont = False
OnClick = sveClick
ExplicitLeft = 152
ExplicitTop = 8
end
object Izvezi: TcxButton
Left = 476
Top = 0
Width = 224
Height = 68
Align = alRight
Caption = 'Izvezi'
OptionsImage.Glyph.SourceDPI = 96 OptionsImage.Glyph.SourceDPI = 96
OptionsImage.Glyph.SourceHeight = 32 OptionsImage.Glyph.SourceHeight = 32
OptionsImage.Glyph.SourceWidth = 32 OptionsImage.Glyph.SourceWidth = 32
...@@ -135,15 +201,125 @@ object Form4: TForm4 ...@@ -135,15 +201,125 @@ object Form4: TForm4
851819CE00BDAF03E47300310A626464588D2CF0FF3FC30F181F6C0A8C03A20D 851819CE00BDAF03E47300310A626464588D2CF0FF3FC30F181F6C0A8C03A20D
1B0CA5FEFE633406B28D81061A039D657CB9F99C14903F481100B8526B445898 1B0CA5FEFE633406B28D81061A039D657CB9F99C14903F481100B8526B445898
CF5F0000000049454E44AE426082} CF5F0000000049454E44AE426082}
TabOrder = 1 TabOrder = 2
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = 30 Font.Height = -30
Font.Name = 'Segoe UI' Font.Name = 'Segoe UI'
Font.Style = [] Font.Style = []
ParentFont = False ParentFont = False
OnClick = sveClick OnClick = IzveziClick
ExplicitWidth = 285 ExplicitLeft = 216
ExplicitWidth = 134
end
end
object Panel3: TPanel
Left = 0
Top = 49
Width = 700
Height = 228
Align = alClient
Caption = 'Panel3'
TabOrder = 2
ExplicitLeft = 296
ExplicitTop = 168
ExplicitWidth = 185
ExplicitHeight = 41
object cxLookupComboBox1: TcxLookupComboBox
Left = 1
Top = 1
Align = alTop
Properties.KeyFieldNames = 'SIFRA_MAGACINA'
Properties.ListColumns = <
item
FieldName = 'MAGACIN'
end>
Properties.ListOptions.SyncMode = True
Properties.ListSource = dsMagacin
TabOrder = 0
ExplicitWidth = 708
Width = 698
end
object gridView2: TcxGrid
Left = 1
Top = 24
Width = 698
Height = 203
Align = alClient
TabOrder = 1
ExplicitLeft = 0
ExplicitTop = 40
ExplicitWidth = 710
ExplicitHeight = 178
object gridView: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
DataController.DataSource = dsPricer2
DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <>
DataController.Summary.SummaryGroups = <>
OptionsCustomize.ColumnHiding = True
OptionsCustomize.ColumnsQuickCustomization = True
object gridViewBARKOD: TcxGridDBColumn
DataBinding.FieldName = 'BARKOD'
Width = 67
end
object gridViewKOD: TcxGridDBColumn
DataBinding.FieldName = 'KOD'
Width = 67
end
object gridViewARTIKAL: TcxGridDBColumn
DataBinding.FieldName = 'ARTIKAL'
Width = 225
end
object gridViewIDJMNALEPNICE: TcxGridDBColumn
DataBinding.FieldName = 'IDJMNALEPNICE'
end
object gridViewIDPJM: TcxGridDBColumn
DataBinding.FieldName = 'IDPJM'
end
object gridViewLOKALNI_NAZIV: TcxGridDBColumn
DataBinding.FieldName = 'LOKALNI_NAZIV'
Width = 110
end
object gridViewCENA: TcxGridDBColumn
DataBinding.FieldName = 'CENA'
end
object gridViewODNOSJMNALEPNICE: TcxGridDBColumn
DataBinding.FieldName = 'ODNOSJMNALEPNICE'
end
object gridViewAKCIJA_OZNAKA: TcxGridDBColumn
DataBinding.FieldName = 'AKCIJA_OZNAKA'
Width = 112
end
object gridViewJED_MERE: TcxGridDBColumn
DataBinding.FieldName = 'JED_MERE'
Width = 81
end
object gridViewKOLICINA: TcxGridDBColumn
DataBinding.FieldName = 'KOLICINA'
end
object gridViewKATEGORIJA: TcxGridDBColumn
DataBinding.FieldName = 'KATEGORIJA'
Width = 126
end
object gridViewTIP_CENOVNIKA: TcxGridDBColumn
DataBinding.FieldName = 'TIP_CENOVNIKA'
Width = 105
end
object gridViewVAZI_OD: TcxGridDBColumn
DataBinding.FieldName = 'VAZI_OD'
end
object gridViewVAZI_DO: TcxGridDBColumn
DataBinding.FieldName = 'VAZI_DO'
end
object gridViewSTARA_CENA: TcxGridDBColumn
DataBinding.FieldName = 'STARA_CENA'
end
end
object gridView2Level1: TcxGridLevel
GridView = gridView
end
end end
end end
object dsPricer2: TDataSource object dsPricer2: TDataSource
...@@ -330,7 +506,6 @@ object Form4: TForm4 ...@@ -330,7 +506,6 @@ object Form4: TForm4
'drivername=FIREBIRD' 'drivername=FIREBIRD'
'blobsize=-1' 'blobsize=-1'
'commitretain=False' 'commitretain=False'
'#Database=127.0.0.1/3050:D:\C11\baza\SYSTEMLINE.FDB'
'Database=127.0.0.1/3051:D:\C11\baza\LUKI_KLIJENT.FDB' 'Database=127.0.0.1/3051:D:\C11\baza\LUKI_KLIJENT.FDB'
'localecode=0000' 'localecode=0000'
'Password=masterkey' 'Password=masterkey'
......
...@@ -52,6 +52,22 @@ ...@@ -52,6 +52,22 @@
#include <IdTCPClient.hpp> #include <IdTCPClient.hpp>
#include <IdTCPConnection.hpp> #include <IdTCPConnection.hpp>
#include <Vcl.Dialogs.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 class TForm4 : public TForm
{ {
...@@ -138,16 +154,45 @@ __published: // IDE-managed Components ...@@ -138,16 +154,45 @@ __published: // IDE-managed Components
TDateField *cdsPricer2VAZI_OD; TDateField *cdsPricer2VAZI_OD;
TDateField *cdsPricer2VAZI_DO; TDateField *cdsPricer2VAZI_DO;
TFMTBCDField *cdsPricer2STARA_CENA; 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 sveClick(TObject *Sender);
void __fastcall FormCreate(TObject *Sender); void __fastcall FormCreate(TObject *Sender);
void __fastcall FormResize(TObject *Sender);
void __fastcall IzveziClick(TObject *Sender);
private: // User declarations private: // User declarations
public: // User declarations public: // User declarations
int SIFRA_MAGACINA;
String delimiter;
__fastcall TForm4(TComponent* Owner); __fastcall TForm4(TComponent* Owner);
int __fastcall PodrazumevaniMagacin(); int __fastcall PodrazumevaniMagacin();
void __fastcall Export(int mg, int sve); void __fastcall Export(int mg, int sve);
void __fastcall UpisiUPricerLog(int mg); void __fastcall UpisiUPricerLog(int mg);
TDateTime __fastcall VratiVremeZadnjegUpisa(int magacin); TDateTime __fastcall VratiVremeZadnjegUpisa(int magacin);
String __fastcall IzbaciNavodnika(String tekst); String __fastcall IzbaciNavodnike(String tekst);
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
extern PACKAGE TForm4 *Form4; extern PACKAGE TForm4 *Form4;
......

\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment