Skip to content

Commit cd75544

Browse files
author
decisao.net
committed
relatorio com estoque positivo
1 parent 148dca6 commit cd75544

23 files changed

+2666
-81
lines changed

REPORTS/e2admrep.identcache

-12 Bytes
Binary file not shown.

SERVIDOR/BASE/BASE.identcache

-16 Bytes
Binary file not shown.
-16 Bytes
Binary file not shown.
-16 Bytes
Binary file not shown.
-16 Bytes
Binary file not shown.
-16 Bytes
Binary file not shown.
-16 Bytes
Binary file not shown.
-16 Bytes
Binary file not shown.
-16 Bytes
Binary file not shown.

SQL/0476.SQL

+184
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
/*
2+
** CST 4 DIGITOS
3+
*/
4+
5+
SET TERM ^ ;
6+
7+
CREATE OR ALTER trigger verifica_barra_ins for produtos
8+
inactive before insert position 0
9+
AS
10+
DECLARE VARIABLE TEMP_EAN VARCHAR(13);
11+
BEGIN
12+
IF (NEW.INDIVIDUAL = 'N') THEN
13+
BEGIN
14+
EXECUTE PROCEDURE CALC_EAN13(NEW.BARRA)
15+
RETURNING_VALUES :TEMP_EAN;
16+
IF (NEW.BARRA <> TEMP_EAN) THEN
17+
EXCEPTION PRODUTO_BARRA;
18+
END
19+
IF ((NEW.PRECOCUSTO < 0) OR (NEW.PRECOVENDA < 0)) THEN
20+
EXCEPTION VALOR_ZERO;
21+
IF (NEW.PRECOCUSTO > NEW.PRECOVENDA) THEN
22+
EXCEPTION PRECOCUSTO_MAIOR;
23+
IF (NEW.PESO IS NULL) THEN
24+
NEW.PESO = 0;
25+
END^
26+
27+
SET TERM ; ^
28+
29+
SET TERM ^ ;
30+
31+
CREATE OR ALTER trigger produtos_margem_ins for produtos
32+
inactive before insert position 200
33+
AS
34+
BEGIN
35+
36+
IF (NEW.CAIXA_ITENS IS NULL) THEN
37+
NEW.CAIXA_ITENS = 1;
38+
39+
/* MARGEM */
40+
IF ((NEW.PRECOCUSTO = 0) AND (NEW.PRECOVENDA = 0)) THEN
41+
BEGIN
42+
43+
NEW.MARGEM = 0;
44+
45+
END ELSE
46+
BEGIN
47+
48+
IF ((NEW.PRECOCUSTO = 0) AND (NEW.PRECOVENDA > 0)) THEN
49+
BEGIN
50+
51+
NEW.MARGEM = NEW.PRECOVENDA * 100;
52+
53+
END ELSE
54+
BEGIN
55+
56+
NEW.MARGEM = (100 - ((NEW.PRECOVENDA * 100) / NEW.PRECOCUSTO)) * -1;
57+
58+
END
59+
END
60+
61+
IF (NEW.CODSERVICO IS NULL) THEN
62+
BEGIN
63+
64+
NEW.PRECOSERVICO = 0;
65+
NEW.PRECOTOTAL = NEW.PRECOVENDA;
66+
67+
END ELSE NEW.PRECOTOTAL = NEW.PRECOSERVICO + NEW.PRECOVENDA;
68+
END^
69+
70+
SET TERM ; ^
71+
72+
SET TERM ^ ;
73+
74+
CREATE OR ALTER trigger verifica_barra_upd for produtos
75+
inactive before update position 0
76+
AS
77+
DECLARE VARIABLE TEMP_EAN VARCHAR(13);
78+
BEGIN
79+
IF (NEW.INDIVIDUAL = 'N') THEN
80+
BEGIN
81+
EXECUTE PROCEDURE CALC_EAN13(NEW.BARRA) RETURNING_VALUES :TEMP_EAN;
82+
IF (NEW.BARRA <> TEMP_EAN) THEN EXCEPTION PRODUTO_BARRA;
83+
END
84+
IF ((NEW.PRECOCUSTO < 0) OR (NEW.PRECOVENDA < 0)) THEN EXCEPTION VALOR_ZERO;
85+
IF (NEW.PESO IS NULL) THEN NEW.PESO = 0;
86+
-- IF (NEW.PRECOCUSTO > NEW.PRECOVENDA) THEN
87+
-- EXCEPTION PRECOCUSTO_MAIOR;
88+
END^
89+
90+
SET TERM ; ^
91+
92+
SET TERM ^ ;
93+
94+
CREATE OR ALTER trigger produtos_margem_upd for produtos
95+
inactive before update position 200
96+
AS
97+
BEGIN
98+
99+
IF (NEW.CAIXA_ITENS IS NULL) THEN
100+
NEW.CAIXA_ITENS = 1;
101+
102+
/* MARGEM */
103+
IF ((NEW.PRECOCUSTO = 0) AND (NEW.PRECOVENDA = 0)) THEN
104+
BEGIN
105+
106+
NEW.MARGEM = 0;
107+
108+
END ELSE
109+
BEGIN
110+
111+
IF ((NEW.PRECOCUSTO = 0) AND (NEW.PRECOVENDA > 0)) THEN
112+
BEGIN
113+
114+
NEW.MARGEM = NEW.PRECOVENDA * 100;
115+
116+
END ELSE
117+
BEGIN
118+
119+
NEW.MARGEM = (100 - ((NEW.PRECOVENDA * 100) / NEW.PRECOCUSTO)) * -1;
120+
121+
END
122+
END
123+
124+
IF (NEW.CODSERVICO IS NULL) THEN
125+
BEGIN
126+
127+
NEW.PRECOSERVICO = 0;
128+
NEW.PRECOTOTAL = NEW.PRECOVENDA;
129+
130+
END ELSE NEW.PRECOTOTAL = NEW.PRECOSERVICO + NEW.PRECOVENDA;
131+
132+
END^
133+
134+
SET TERM ; ^
135+
136+
SET TERM ^ ;
137+
138+
CREATE OR ALTER trigger provar_upd for produtos
139+
inactive after update position 10
140+
AS
141+
DECLARE VARIABLE REAJUSTE NUMERIC(9,4);
142+
BEGIN
143+
144+
/* HOUVE ALGUM REAJUSTE?
145+
IF (NEW.PRECOVENDA <> OLD.PRECOVENDA) THEN
146+
BEGIN
147+
IF (NEW.PRECOVENDA > OLD.PRECOVENDA) THEN
148+
BEGIN
149+
IF (OLD.PRECOVENDA = 0) THEN
150+
REAJUSTE = NEW.PRECOVENDA * 100;
151+
ELSE
152+
REAJUSTE = ((NEW.PRECOVENDA * 100) / OLD.PRECOVENDA) - 100;
153+
END ELSE
154+
BEGIN
155+
IF (NEW.PRECOVENDA = 0) THEN
156+
REAJUSTE = OLD.PRECOVENDA * -100;
157+
ELSE
158+
REAJUSTE = ((OLD.PRECOVENDA - NEW.PRECOVENDA) * -100) / OLD.PRECOVENDA;
159+
END
160+
INSERT INTO
161+
VARIACAO_VALOR (
162+
CODPRODUTO,
163+
DATA,
164+
VALOR_ANTIGO,
165+
VALOR_NOVO,
166+
REAJUSTE )
167+
VALUES (
168+
OLD.CODIGO,
169+
CURRENT_TIMESTAMP,
170+
OLD.PRECOVENDA,
171+
NEW.PRECOVENDA,
172+
:REAJUSTE);
173+
END */
174+
175+
IF (NEW.PS = 'S') THEN
176+
BEGIN
177+
UPDATE PRODUTOS SET PRODUTOS.PRECOSERVICO = NEW.PRECOVENDA
178+
WHERE PRODUTOS.CODSERVICO = NEW.CODIGO;
179+
END
180+
END^
181+
182+
SET TERM ; ^
183+
184+

e2.groupproj.local

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<BorlandProject>
33
<Transactions/>
44
<Default.Personality>
5-
<Projects ActiveProject="C:\Users\elies\Documents\enterprise\enterprise\enterprise.dproj"/>
5+
<Projects ActiveProject="C:\Users\elies\Documents\GitHub\enterprise\enterprise.dproj"/>
66
</Default.Personality>
77
</BorlandProject>

enterprise.dproj.local

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<BorlandProject>
33
<Transactions>
44
<Transaction>2018/02/19 20:48:26.000.526,=C:\Users\Administrador\Documents\enterprise\Unit1.pas</Transaction>
5-
<Transaction>2018/02/19 20:51:02.000.921,C:\Users\Administrador\Documents\enterprise\Unit1.pas=C:\Users\Administrador\Documents\enterprise\relatorios\rel_estoquereposicao.pas</Transaction>
6-
<Transaction>2018/02/19 20:51:02.000.921,C:\Users\Administrador\Documents\enterprise\Unit1.dfm=C:\Users\Administrador\Documents\enterprise\relatorios\rel_estoquereposicao.dfm</Transaction>
5+
<Transaction>2018/02/19 20:51:02.000.921,C:\Users\Administrador\Documents\enterprise\relatorios\rel_estoquereposicao.pas=C:\Users\Administrador\Documents\enterprise\Unit1.pas</Transaction>
6+
<Transaction>2018/02/19 20:51:02.000.921,C:\Users\Administrador\Documents\enterprise\relatorios\rel_estoquereposicao.dfm=C:\Users\Administrador\Documents\enterprise\Unit1.dfm</Transaction>
77
</Transactions>
88
</BorlandProject>

enterprise.identcache

-464 Bytes
Binary file not shown.

principal/__history/principal.pas.~83~ principal/__history/principal.pas.~95~

+39-42
Original file line numberDiff line numberDiff line change
@@ -1207,11 +1207,8 @@ end;
12071207

12081208
procedure TformPrincipal.actSobreExecute(Sender: TObject);
12091209
begin MsgError(
1210-
'Enterprise' + #13#10#13#10 +
1211-
'� 1999-2012 Taligent' + #13#10 +
1212-
'� 2013-2018 decisao.net - Gest�o de Resultado' + #13#10#13#10 +
1213-
'[email protected]' + #13#10#13#10 +
1214-
'vers�o 2018.024 (21/02/2018)',
1210+
'Enterprise' + #13#10#13#10 +
1211+
'vers�o 2019.92 (02/09/2019)',
12151212
'Sobre...');
12161213
end;
12171214

@@ -1439,39 +1436,39 @@ var
14391436
gbak, opcoes: string;
14401437

14411438
function ExecProcess(FileName, Params: string; WindowState: Word; ProcessName: string = ''; Wait: Boolean =
1442-
True): Boolean;
1443-
var
1444-
SI: TStartupInfo;
1445-
PI: TProcessInformation;
1446-
CmdLine: string;
1447-
Status: Cardinal;
1448-
begin
1449-
CmdLine := FileName + ' ' + Params;
1450-
FillChar(SI, SizeOf(SI), #0);
1451-
with SI do
1452-
begin
1453-
cb := SizeOf(SI);
1454-
dwFillAttribute := FOREGROUND_RED;
1455-
if ProcessName <> '' then
1456-
lpTitle := PChar(ProcessName);
1457-
wShowWindow := WindowState;
1458-
dwFlags := STARTF_USESHOWWINDOW + STARTF_USEFILLATTRIBUTE;
1459-
end;
1460-
Result := CreateProcess(nil, PChar(CmdLine), nil, nil, False, CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS,
1461-
nil, PChar(ExtractFilePath(FileName)), SI, PI);
1462-
if Result then
1463-
begin
1464-
if Wait then
1465-
WaitForSingleObject(PI.hProcess, INFINITE);
1466-
{***********************************************}
1467-
{altera��o para capturar o codigo retornado pelo processo}
1468-
{***********************************************}
1469-
GetExitCodeProcess(PI.hProcess, status);
1470-
Result := Status = 0;
1471-
{***********************************************}
1472-
CloseHandle(PI.hProcess);
1473-
CloseHandle(PI.hThread);
1474-
end;
1439+
True): Boolean;
1440+
var
1441+
SI: TStartupInfo;
1442+
PI: TProcessInformation;
1443+
CmdLine: string;
1444+
Status: Cardinal;
1445+
begin
1446+
CmdLine := FileName + ' ' + Params;
1447+
FillChar(SI, SizeOf(SI), #0);
1448+
with SI do
1449+
begin
1450+
cb := SizeOf(SI);
1451+
dwFillAttribute := FOREGROUND_RED;
1452+
if ProcessName <> '' then
1453+
lpTitle := PChar(ProcessName);
1454+
wShowWindow := WindowState;
1455+
dwFlags := STARTF_USESHOWWINDOW + STARTF_USEFILLATTRIBUTE;
1456+
end;
1457+
Result := CreateProcess(nil, PChar(CmdLine), nil, nil, False, CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS,
1458+
nil, PChar(ExtractFilePath(FileName)), SI, PI);
1459+
if Result then
1460+
begin
1461+
if Wait then
1462+
WaitForSingleObject(PI.hProcess, INFINITE);
1463+
{***********************************************}
1464+
{altera��o para capturar o codigo retornado pelo processo}
1465+
{***********************************************}
1466+
GetExitCodeProcess(PI.hProcess, status);
1467+
Result := Status = 0;
1468+
{***********************************************}
1469+
CloseHandle(PI.hProcess);
1470+
CloseHandle(PI.hThread);
1471+
end;
14751472
end;
14761473

14771474
begin
@@ -2217,8 +2214,8 @@ begin
22172214
end;
22182215

22192216
procedure TformPrincipal.actRelEstoqueReposicaoExecute(Sender: TObject);
2220-
begin
2221-
if UserIn(Sender as TAction) then
2217+
begin
2218+
if UserIn(Sender as TAction) then
22222219
try
22232220
formRelEstoqueReposicao := TformRelEstoqueReposicao.Create(Self);
22242221
formRelEstoqueReposicao.Tag := TAction(Sender).Tag;
@@ -2230,8 +2227,8 @@ begin
22302227
except
22312228
end
22322229
end
2233-
end;
2234-
2230+
end;
2231+
22352232
procedure TformPrincipal.actBancosExecute(Sender: TObject);
22362233
begin
22372234
if UserIn(Sender as TAction) then

principal/principal.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ function TformPrincipal.GetTime: TDateTime;
12081208
procedure TformPrincipal.actSobreExecute(Sender: TObject);
12091209
begin MsgError(
12101210
'Enterprise' + #13#10#13#10 +
1211-
'versão 2019.92 (02/09/2019)',
1211+
'versão 2020.31 (09/03/2020)',
12121212
'Sobre...');
12131213
end;
12141214

0 commit comments

Comments
 (0)