Zacatek uprav Ramcovy plan

This commit is contained in:
2025-06-10 19:43:13 +02:00
parent fedc940ac4
commit 5fcde65f6b
30 changed files with 1863 additions and 334 deletions

View File

@ -6,7 +6,7 @@ uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.StdCtrls, Vcl.Mask, Vcl.Buttons,
IdHTTP, IdSSLOpenSSL, REST.Json,
ddPlugin_TLB, JsonDataObjects, ColorButton;
ddPlugin_TLB, JsonDataObjects, ColorButton, uPing;
{$I iConsts.inc}
@ -81,6 +81,7 @@ var
tiskNa: byte;
idKmen, idPalety, idFormKA, idFormPL, idFormPS: integer;
mjEvid: string;
jeFinal, jePolotovar: boolean;
pocKA, pocKS, ksVKA: Extended;
prepKA2ks, prepKA2pal: Extended;
@ -339,6 +340,9 @@ uses DateUtils, Math, StrUtils,
begin
idKmen:= 0;
mjEvid:= '';
jeFinal:= false;
jePolotovar:= false;
if (idVPr>0) then
begin
with Helios.OpenSQL('SELECT k.SkupZbo, k.RegCis, k.Nazev1, vp.IDTabKmen, k.MJEvidence FROM ' + tblVPr + ' vp INNER JOIN ' + tblKZ + ' k ON (k.ID=vp.IDTabKmen) WHERE vp.ID=' + idVPr.ToString) do
@ -348,6 +352,9 @@ uses DateUtils, Math, StrUtils,
edtSZ.Text:= VarToStr(FieldByNameValues('SkupZbo'));
edtRegCis.Text:= VarToStr(FieldByNameValues('RegCis'));
edtNazev1.Text:= VarToStr(FieldByNameValues('Nazev1'));
jeFinal:= helUtils.sqlExistsTestGeneral (Helios, 'SELECT 1 FROM ' + tblParKZ + ' WHERE IDKmenZbozi=' + idKmen.ToString + ' AND TypDilce=0');
jePolotovar:= helUtils.sqlExistsTestGeneral (Helios, 'SELECT 1 FROM ' + tblParKZ + ' WHERE IDKmenZbozi=' + idKmen.ToString + ' AND TypDilce=1');
end;
pocKA:= NactiPocetKAZEvidRozpOperR;
@ -504,7 +511,7 @@ uses DateUtils, Math, StrUtils,
var lSQL, lSQL2, podm, errMsg, a, novyPL, idMzdyS, idMezdS, skSubPrikaz, sTemp, sRnd, sklVyd, radaVyd: string;
nazevOp, mjDilce: string;
pocKA, pocKAOld, pocKS, noveMnoz, NPalPocKA, NPalPocKS, prepKA2ks, mnozProKoef, koefMn : extended;
casPrace, idEvOpR, idMzdy, locIdVPr, d, d2, cnt: integer;
casPrace, idEvOpR, idMzdy, locIdVPr, d, d2, cnt, iPing: integer;
bid, idF, idPalUkonceni, idPrac, idDZ, idDZVyd: integer;
spotrebaTesto, spotreba702, vydejOK: boolean;
fSarzeVydej: TformSarzeVydej;
@ -764,10 +771,11 @@ uses DateUtils, Math, StrUtils,
}
lSQL:= lSQL + 'DECLARE @e NVARCHAR(500)=N''''; IF OBJECT_ID(N''dbo.ep_Vyroba_GenOdvodZeMzdy'', N''P'') IS NOT NULL EXEC dbo.ep_Vyroba_GenOdvodZeMzdy @IDMzdy=' + idMzdy.ToString
+ ', @bezVyrCis=0, @realizujPrijem=1, @errMsg=@e OUT'; // @kopiiNaTechSklad=0,
if (edtNazev1.Text.Contains('polotovar')) then
if (edtNazev1.Text.Contains('polotovar')) or (jePolotovar) then
lSQL:= lSQL + ', @skladOdvod=N''311'''
else
lSQL:= lSQL + ', @skladOdvod=N''312''';
lSQL:= lSQL + CRLF + 'SELECT @e';
errMsg:= helUtils.getHeliosStrVal (Helios, '', lSQL);
@ -800,7 +808,9 @@ uses DateUtils, Math, StrUtils,
resp:= '';
respStream:= TStringStream.Create('');
if (helUtils.PingHost (helUtils.NetGetHostName(datMod.phServer))) then
iPing:= uPing.Ping (datMod.getDomainName (datMod.phServer), resp);
// if (helUtils.PingHost (helUtils.NetGetHostName(datMod.phServer))) then
if (iPing=0) then
begin
lHTTP.Post (datMod.phServer + IfThen(datMod.phServer.EndsWith('/'), '', '/') + 'prikaz', lParamList, respStream);
resp:= respStream.DataString.Replace('\/', '/');