20 |
IdExplicitTLSClientServerBase, IdFTP, IdException, |
IdExplicitTLSClientServerBase, IdFTP, IdException, |
21 |
ShellApi, ClipBrd, Buttons, wininet, |
ShellApi, ClipBrd, Buttons, wininet, |
22 |
UITypes, |
UITypes, |
23 |
PakkeshopLabels, |
LabelData, |
24 |
Utils, |
Utils, |
25 |
ParentForm, |
ParentForm, |
26 |
LabelPrint, |
LabelPrint, |
202 |
procedure LogMessage( msg : string); |
procedure LogMessage( msg : string); |
203 |
procedure SetPrinterstatusText( txt: string; alert: boolean); |
procedure SetPrinterstatusText( txt: string; alert: boolean); |
204 |
function GetFormObject() : TForm; |
function GetFormObject() : TForm; |
205 |
|
function GetXMLDocument() : TXMLDocument; |
206 |
|
|
207 |
|
|
208 |
|
|
539 |
|
|
540 |
// Sætter lige en default panel størrelse |
// Sætter lige en default panel størrelse |
541 |
MainForm.ClientWidth := 1000; |
MainForm.ClientWidth := 1000; |
542 |
MainForm.ClientHeight := 820; |
MainForm.ClientHeight := 920; |
543 |
|
|
544 |
Config := TConfiguration.Create(); |
Config := TConfiguration.Create(); |
545 |
Config.ReadFromInifile( TIniFile.Create(ChangeFileExt(Application.ExeName,'.ini')) ); //ToDo: clean up duplicate ini ref |
Config.ReadFromInifile( TIniFile.Create(ChangeFileExt(Application.ExeName,'.ini')) ); //ToDo: clean up duplicate ini ref |
554 |
Sted := ReadString('Settings','Sted',''); |
Sted := ReadString('Settings','Sted',''); |
555 |
StedNavn := ReadString('Settings','Stednavn',''); |
StedNavn := ReadString('Settings','Stednavn',''); |
556 |
|
|
557 |
|
Scanningtype := 'A'; //hardcoded |
558 |
|
Pakketype := '0'; |
559 |
|
|
560 |
|
|
561 |
|
|
562 |
|
|
1430 |
end; |
end; |
1431 |
end; |
end; |
1432 |
|
|
1433 |
|
// EmballageRepareret skal bare sætte reklamationkoden, |
1434 |
|
// og så ellers fortsætte med scanning som normalt |
1435 |
|
if (chkEmballageRepareret.Checked = True) then |
1436 |
|
begin |
1437 |
|
URLStr := Format(Config.UrlEmballageRepareret,[Sted,Stregkode]); |
1438 |
|
WebSvar := IdHTTP1.Get(URLStr); |
1439 |
|
ShowMessage( WebSvar ); |
1440 |
|
|
1441 |
|
chkEmballageRepareret.Checked := False; |
1442 |
|
end; |
1443 |
|
|
1444 |
|
|
1445 |
|
|
1446 |
if (PakkeshopText1.Visible = true) and (PakkeshopText1.Caption = 'Stregkode') and menuAutomatiskTjekkodeStyring.Checked then |
if (PakkeshopText1.Visible = true) and (PakkeshopText1.Caption = 'Stregkode') and menuAutomatiskTjekkodeStyring.Checked then |
1944 |
pakkestorrelse : String; |
pakkestorrelse : String; |
1945 |
PrintNyLabelInteger : Integer; |
PrintNyLabelInteger : Integer; |
1946 |
|
|
1947 |
PakkeshopLabel: TPakkeshopLabel; |
PakkeshopLabel: TLabelData; |
1948 |
begin |
begin |
1949 |
if radioStorPakke.Checked then |
if radioStorPakke.Checked then |
1950 |
begin |
begin |
2053 |
if (Kommentar = 'Ok') then |
if (Kommentar = 'Ok') then |
2054 |
begin |
begin |
2055 |
PrintNyLabel := True; //Indleveringskode vil ALTID udskrive label |
PrintNyLabel := True; //Indleveringskode vil ALTID udskrive label |
2056 |
PakkeshopLabel := TPakkeshopLabel.Create( XMLDocument1 ); //Opret struct og parse xml doc |
PakkeshopLabel := TLabelData.Create( XMLDocument1 ); //Opret struct og parse xml doc |
2057 |
RuteNummer := PakkeshopLabel.Koreliste + ' -> ' + PakkeshopLabel.PakkeshopTurid; |
RuteNummer := PakkeshopLabel.Koreliste + ' -> ' + PakkeshopLabel.PakkeshopTurid; |
2058 |
Stregkode := PakkeshopLabel.Stregkode; |
Stregkode := PakkeshopLabel.Stregkode; |
2059 |
|
|
2102 |
begin |
begin |
2103 |
if (Leveringssted <> BladhusStedKode[BladhusSted]) and (BladhusStedKode[BladhusSted] <> 'DBK') then |
if (Leveringssted <> BladhusStedKode[BladhusSted]) and (BladhusStedKode[BladhusSted] <> 'DBK') then |
2104 |
begin |
begin |
2105 |
Kommentar := Kommentar + 'Pakke burde være hos ' + Leveringssted; |
Kommentar := Kommentar + ' Pakke burde være hos ' + Leveringssted; |
2106 |
PrintNyLabel := False; |
//PrintNyLabel := False; //ved fuld-daekning / X-ruter skal vi altid skrive label alligevel |
2107 |
end; |
end; |
2108 |
end |
end |
2109 |
else if (menuDaoDirekte1.Checked) and (Leveringssted <> Sted) And (Leveringssted <> '') then |
else if (menuDaoDirekte1.Checked) and (Leveringssted <> Sted) And (Leveringssted <> '') then |
2110 |
begin |
begin |
2111 |
if (Leveringssted = 'E') and (Sted = 'DBK') then |
Kommentar := Kommentar + ' Pakke burde være hos ' + Leveringssted; |
2112 |
begin |
//PrintNyLabel := False; //ved fuld-daekning / X-ruter skal vi altid skrive label alligevel |
|
// Det er ok at DBK scanner pakker til E (Schenker) |
|
|
end |
|
|
else |
|
|
begin |
|
|
Kommentar := Kommentar + 'Pakke burde være hos ' + Leveringssted; |
|
|
PrintNyLabel := False; |
|
|
end; |
|
2113 |
end; |
end; |
2114 |
except on e:exception do |
except on e:exception do |
2115 |
raise exception.CreateFmt('Fejl i XML-format: %s',[e.Message]); |
raise exception.CreateFmt('Fejl i XML-format: %s',[e.Message]); |
4869 |
Result := self; |
Result := self; |
4870 |
end; |
end; |
4871 |
|
|
4872 |
|
//Nedarvet fra IParentForm |
4873 |
|
function TMainForm.GetXMLDocument() : TXMLDocument; |
4874 |
|
begin |
4875 |
|
Result := XMLDocument1 |
4876 |
|
end; |
4877 |
|
|
4878 |
|
|
4879 |
end. |
end. |
4880 |
|
|