Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolvendo dependencias do modulo servidor #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added Retaguarda/Comum/Atributos.dcu
Binary file not shown.
Binary file added Retaguarda/Comum/Biblioteca.dcu
Binary file not shown.
322 changes: 181 additions & 141 deletions Retaguarda/Comum/Biblioteca.pas

Large diffs are not rendered by default.

Binary file added Retaguarda/Comum/Constantes.dcu
Binary file not shown.
Binary file not shown.
Binary file added Retaguarda/Comum/Controller/BancoController.dcu
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
97 changes: 48 additions & 49 deletions Retaguarda/Comum/Controller/ControleEstoqueController.pas
Original file line number Diff line number Diff line change
@@ -1,86 +1,85 @@
{ *******************************************************************************
Title: T2Ti ERP
Description: Unit que controla o estoque (incremento e decremento)
Title: T2Ti ERP
Description: Unit que controla o estoque (incremento e decremento)

The MIT License
The MIT License

Copyright: Copyright (C) 2014 T2Ti.COM
Copyright: Copyright (C) 2014 T2Ti.COM

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

The author may be contacted at:
t2ti.com@gmail.com</p>
The author may be contacted at:
t2ti.com@gmail.com</p>

@author Albert Eije (T2Ti.COM)
@version 2.0
******************************************************************************* }
@author Albert Eije (T2Ti.COM)
@version 2.0
******************************************************************************* }
unit ControleEstoqueController;

interface

uses
Classes, SQLExpr, SysUtils, Generics.Collections, Controller, DBXJSON, DBXCommon,
IWSystem;
Classes, SQLExpr, SysUtils, Generics.Collections, Controller, DBXJSON,
DBXCommon;
// IWSystem;

type
TControleEstoqueController = class(TController)
protected
public
class function AtualizarEstoque(pQuantidade: Extended; pIdProduto: Integer; pIdEmpresa: Integer = 0; pTipoAtualizacaoEstoque: String = ''): Boolean;
class function AtualizarEstoque(pQuantidade: Extended; pIdProduto: Integer;
pIdEmpresa: Integer = 0; pTipoAtualizacaoEstoque: String = ''): Boolean;
end;

implementation

uses
T2TiORM;

class function TControleEstoqueController.AtualizarEstoque(pQuantidade: Extended; pIdProduto: Integer; pIdEmpresa: Integer; pTipoAtualizacaoEstoque: String): Boolean;
class function TControleEstoqueController.AtualizarEstoque
(pQuantidade: Extended; pIdProduto: Integer; pIdEmpresa: Integer;
pTipoAtualizacaoEstoque: String): Boolean;
var
ComandoSQL: String;
begin
try
if (pTipoAtualizacaoEstoque <> '') and (pTipoAtualizacaoEstoque <> 'D') then
begin
//atualiza tabela PRODUTO
ComandoSQL :=
'update PRODUTO ' +
'set QUANTIDADE_ESTOQUE = ' +
'case ' +
'when QUANTIDADE_ESTOQUE is null then ' + FloatToStr(pQuantidade) + ' ' +
'when QUANTIDADE_ESTOQUE is not null then QUANTIDADE_ESTOQUE + ' + FloatToStr(pQuantidade) + ' ' +
'end ' +
'where ID= ' + IntToStr(pIdProduto);
// atualiza tabela PRODUTO
ComandoSQL := 'update PRODUTO ' + 'set QUANTIDADE_ESTOQUE = ' + 'case ' +
'when QUANTIDADE_ESTOQUE is null then ' + FloatToStr(pQuantidade) + ' '
+ 'when QUANTIDADE_ESTOQUE is not null then QUANTIDADE_ESTOQUE + ' +
FloatToStr(pQuantidade) + ' ' + 'end ' + 'where ID= ' +
IntToStr(pIdProduto);
end
else if pTipoAtualizacaoEstoque = 'D' then
begin
//atualiza tabela EMPRESA_PRODUTO
ComandoSQL :=
'update EMPRESA_PRODUTO ' +
'set QUANTIDADE_ESTOQUE = ' +
'case ' +
'when QUANTIDADE_ESTOQUE is null then ' + FloatToStr(pQuantidade) + ' ' +
'when QUANTIDADE_ESTOQUE is not null then QUANTIDADE_ESTOQUE + ' + FloatToStr(pQuantidade) + ' ' +
'end ' +
'where ID_PRODUTO= ' + IntToStr(pIdProduto) + ' and ID_EMPRESA= ' + IntToStr(pIdEmpresa);
// atualiza tabela EMPRESA_PRODUTO
ComandoSQL := 'update EMPRESA_PRODUTO ' + 'set QUANTIDADE_ESTOQUE = ' +
'case ' + 'when QUANTIDADE_ESTOQUE is null then ' +
FloatToStr(pQuantidade) + ' ' +
'when QUANTIDADE_ESTOQUE is not null then QUANTIDADE_ESTOQUE + ' +
FloatToStr(pQuantidade) + ' ' + 'end ' + 'where ID_PRODUTO= ' +
IntToStr(pIdProduto) + ' and ID_EMPRESA= ' + IntToStr(pIdEmpresa);
end;

Result := TT2TiORM.ComandoSQL(ComandoSQL);
Expand Down
Binary file not shown.
Binary file added Retaguarda/Comum/Controller/CstIpiController.dcu
Binary file not shown.
Binary file added Retaguarda/Comum/Controller/CstPisController.dcu
Binary file not shown.
Binary file added Retaguarda/Comum/Controller/DAVController.dcu
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Retaguarda/Comum/Controller/NcmController.dcu
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Retaguarda/Comum/Controller/PessoaController.dcu
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{ *******************************************************************************
Title: T2Ti ERP
Description: Unit que controla o estoque (incremento e decremento)

The MIT License

Copyright: Copyright (C) 2014 T2Ti.COM

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

The author may be contacted at:
t2ti.com@gmail.com</p>

@author Albert Eije (T2Ti.COM)
@version 2.0
******************************************************************************* }
unit ControleEstoqueController;

interface

uses
Classes, SQLExpr, SysUtils, Generics.Collections, Controller, DBXJSON, DBXCommon,
IWSystem;

type
TControleEstoqueController = class(TController)
protected
public
class function AtualizarEstoque(pQuantidade: Extended; pIdProduto: Integer; pIdEmpresa: Integer = 0; pTipoAtualizacaoEstoque: String = ''): Boolean;
end;

implementation

uses
T2TiORM;

class function TControleEstoqueController.AtualizarEstoque(pQuantidade: Extended; pIdProduto: Integer; pIdEmpresa: Integer; pTipoAtualizacaoEstoque: String): Boolean;
var
ComandoSQL: String;
begin
try
if (pTipoAtualizacaoEstoque <> '') and (pTipoAtualizacaoEstoque <> 'D') then
begin
//atualiza tabela PRODUTO
ComandoSQL :=
'update PRODUTO ' +
'set QUANTIDADE_ESTOQUE = ' +
'case ' +
'when QUANTIDADE_ESTOQUE is null then ' + FloatToStr(pQuantidade) + ' ' +
'when QUANTIDADE_ESTOQUE is not null then QUANTIDADE_ESTOQUE + ' + FloatToStr(pQuantidade) + ' ' +
'end ' +
'where ID= ' + IntToStr(pIdProduto);
end
else if pTipoAtualizacaoEstoque = 'D' then
begin
//atualiza tabela EMPRESA_PRODUTO
ComandoSQL :=
'update EMPRESA_PRODUTO ' +
'set QUANTIDADE_ESTOQUE = ' +
'case ' +
'when QUANTIDADE_ESTOQUE is null then ' + FloatToStr(pQuantidade) + ' ' +
'when QUANTIDADE_ESTOQUE is not null then QUANTIDADE_ESTOQUE + ' + FloatToStr(pQuantidade) + ' ' +
'end ' +
'where ID_PRODUTO= ' + IntToStr(pIdProduto) + ' and ID_EMPRESA= ' + IntToStr(pIdEmpresa);
end;

Result := TT2TiORM.ComandoSQL(ComandoSQL);
finally
end;
end;

end.
Binary file added Retaguarda/Comum/Conversor.dcu
Binary file not shown.
2 changes: 1 addition & 1 deletion Retaguarda/Comum/Conversor.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

interface

uses Classes, DBXJSON, SysUtils;
uses Classes, DBXJSON, SysUtils, System.JSON;

type
TConversor = class
Expand Down
Binary file not shown.
1 change: 0 additions & 1 deletion Retaguarda/Comum/DataModule/UDataModuleConexao.dfm
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
object FDataModuleConexao: TFDataModuleConexao
OldCreateOrder = False
OnCreate = DataModuleCreate
Height = 150
Width = 215
Expand Down
Loading