This repository has been archived on 2024-11-28. You can view files and clone it, but cannot push or open issues or pull requests.
LuisLeon_FactuGES2/Source/Modulos/ProcesoPresupuestoCliente/Views/uEditorProcesoPresupuestosCliente.pas
2014-02-20 22:43:39 +00:00

237 lines
8.3 KiB
ObjectPascal
Raw Blame History

unit uEditorProcesoPresupuestosCliente;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uEditorGridBase, Menus, JvAppStorage, JvAppRegistryStorage, DB,
uDAInterfaces, uDADataTable, JvComponentBase, JvFormPlacement, ImgList,
PngImageList, StdActns, ActnList, ComCtrls, JvExComCtrls, JvStatusBar, TBX,
TB2ExtItems, TBXExtItems, TB2Item, TB2Dock, TB2Toolbar, pngimage, ExtCtrls,
JvExControls, JvNavigationPane, uIEditorProcesoPresupuestosCLiente,
uCustomView, uViewBase, uViewGridBase, uViewGrid,
uViewProcesoPresupuestosCliente, uBizPedidosCliente, uBizPedidosProveedor,
uBizAlbaranesProveedor, uBizFacturasProveedor, uBizAlbaranesCliente, uBizFacturasCliente,
uBizFacturasProforma, Grids, DBGrids;
type
TfEditorProcesoPresupuestosCliente = class(TfEditorGridBase, IEditorProcesoPresupuestosCliente)
frViewProcesoPresupuestosCliente1: TfrViewProcesoPresupuestosCliente;
procedure FormShow(Sender: TObject);
protected
FPedidosCliente: IBizPedidoCliente;
FPedidosProveedor: IBizPedidoProveedor;
FAlbaranesProveedor: IBizAlbaranProveedor;
FFacturasProveedor: IBizFacturaProveedor;
FAlbaranesCliente: IBizAlbaranCliente;
FFacturasProforma: IBizFacturaProforma;
FFacturasCliente: IBizFacturaCliente;
function GetPedidosCliente: IBizPedidoCliente;
procedure SetPedidosCliente(const Value: IBizPedidoCliente);
function GetPedidosProveedor: IBizPedidoProveedor;
procedure SetPedidosProveedor(const Value: IBizPedidoProveedor);
function GetAlbaranesProveedor: IBizAlbaranProveedor;
procedure SetAlbaranesProveedor(const Value: IBizAlbaranProveedor);
function GetFacturasProveedor: IBizFacturaProveedor;
procedure SetFacturasProveedor(const Value: IBizFacturaProveedor);
function GetAlbaranesCliente: IBizAlbaranCliente;
procedure SetAlbaranesCliente(const Value: IBizAlbaranCliente);
function GetFacturasProforma: IBizFacturaProforma;
procedure SetFacturasProforma(const Value: IBizFacturaProforma);
function GetFacturasCliente: IBizFacturaCliente;
procedure SetFacturasCliente(const Value: IBizFacturaCliente);
public
property PedidosCliente: IBizPedidoCliente read GetPedidosCliente write SetPedidosCliente;
property PedidosProveedor: IBizPedidoProveedor read GetPedidosProveedor write SetPedidosProveedor;
property AlbaranesProveedor: IBizAlbaranProveedor read GetAlbaranesProveedor write SetAlbaranesProveedor;
property FacturasProveedor: IBizFacturaProveedor read GetFacturasProveedor write SetFacturasProveedor;
property AlbaranesCliente: IBizAlbaranCliente read GetAlbaranesCliente write SetAlbaranesCliente;
property FacturasProforma: IBizFacturaProforma read GetFacturasProforma write SetFacturasProforma;
property FacturasCliente: IBizFacturaCliente read GetFacturasCliente write SetFacturasCliente;
procedure PonerTitulos(const ATitulo: string = ''); override;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
end;
implementation
{$R *.dfm}
{ TfEditorListadoProcesoPedidoCliente }
constructor TfEditorProcesoPresupuestosCliente.Create(AOwner: TComponent);
begin
inherited;
ViewGrid := frViewProcesoPresupuestosCliente1;
end;
destructor TfEditorProcesoPresupuestosCliente.Destroy;
begin
FPedidosCliente := Nil;
FPedidosProveedor := Nil;
FAlbaranesProveedor := Nil;
FFacturasProveedor := Nil;
FAlbaranesCliente := Nil;
FFacturasProforma := Nil;
FFacturasCliente := Nil;
inherited;
end;
procedure TfEditorProcesoPresupuestosCliente.FormShow(Sender: TObject);
begin
inherited;
if not Assigned(ViewGrid) then
raise Exception.Create('No hay ninguna vista asignada');
if not Assigned(PedidosCliente) then
raise Exception.Create('No hay ningun pedido de cliente asignado');
PedidosCliente.DataTable.Active := True;
if not Assigned(PedidosProveedor) then
raise Exception.Create('No hay ningun pedido de proveedor asignado');
PedidosProveedor.DataTable.Active := True;
if not Assigned(AlbaranesProveedor) then
raise Exception.Create('No hay ningun albar<61>n de proveedor asignado');
AlbaranesProveedor.DataTable.Active := True;
if not Assigned(FacturasProveedor) then
raise Exception.Create('No hay ninguna factura de proveedor asignado');
FacturasProveedor.DataTable.Active := True;
if not Assigned(AlbaranesCliente) then
raise Exception.Create('No hay ningun albar<61>n de cliente asignado');
AlbaranesCliente.DataTable.Active := True;
if not Assigned(FacturasCliente) then
raise Exception.Create('No hay ninguna factura de cliente asignado');
FacturasCliente.DataTable.Active := True;
if not Assigned(FacturasProforma) then
raise Exception.Create('No hay ninguna factura proforma asignada');
FacturasProforma.DataTable.Active := True;
ViewGrid.GotoFirst;
ViewGrid.ContraerTodo;
end;
function TfEditorProcesoPresupuestosCliente.GetAlbaranesCliente: IBizAlbaranCliente;
begin
Result := FAlbaranesCliente;
end;
function TfEditorProcesoPresupuestosCliente.GetAlbaranesProveedor: IBizAlbaranProveedor;
begin
Result := FAlbaranesProveedor;
end;
function TfEditorProcesoPresupuestosCliente.GetFacturasCliente: IBizFacturaCliente;
begin
Result := FFacturasCliente;
end;
function TfEditorProcesoPresupuestosCliente.GetFacturasProforma: IBizFacturaProforma;
begin
Result := FFacturasProforma;
end;
function TfEditorProcesoPresupuestosCliente.GetFacturasProveedor: IBizFacturaProveedor;
begin
Result := FFacturasProveedor;
end;
function TfEditorProcesoPresupuestosCliente.GetPedidosCliente: IBizPedidoCliente;
begin
Result := FPedidosCliente;
end;
function TfEditorProcesoPresupuestosCliente.GetPedidosProveedor: IBizPedidoProveedor;
begin
Result := FPedidosProveedor;
end;
procedure TfEditorProcesoPresupuestosCliente.PonerTitulos(
const ATitulo: string);
begin
// inherited; Para que no borre el caption
end;
procedure TfEditorProcesoPresupuestosCliente.SetAlbaranesCliente(const Value: IBizAlbaranCliente);
begin
FAlbaranesCliente := Value;
if Assigned(FAlbaranesCliente) then
begin
if Assigned(ViewGrid) then
(ViewGrid as IViewListadoProcesoPedidoCliente).AlbaranesCliente := AlbaranesCliente;
end;
end;
procedure TfEditorProcesoPresupuestosCliente.SetAlbaranesProveedor(const Value: IBizAlbaranProveedor);
begin
FAlbaranesProveedor := Value;
if Assigned(FAlbaranesProveedor) then
begin
if Assigned(ViewGrid) then
(ViewGrid as IViewListadoProcesoPedidoCliente).AlbaranesProveedor := AlbaranesProveedor;
end;
end;
procedure TfEditorProcesoPresupuestosCliente.SetFacturasCliente(const Value: IBizFacturaCliente);
begin
FFacturasCliente := Value;
if Assigned(FFacturasCliente) then
begin
if Assigned(ViewGrid) then
(ViewGrid as IViewListadoProcesoPedidoCliente).FacturasCliente := FacturasCliente;
end;
end;
procedure TfEditorProcesoPresupuestosCliente.SetFacturasProforma(const Value: IBizFacturaProforma);
begin
FFacturasProforma := Value;
if Assigned(FFacturasProforma) then
begin
if Assigned(ViewGrid) then
(ViewGrid as IViewListadoProcesoPedidoCliente).FacturasProforma := FacturasProforma;
end;
end;
procedure TfEditorProcesoPresupuestosCliente.SetFacturasProveedor(const Value: IBizFacturaProveedor);
begin
FFacturasProveedor := Value;
if Assigned(FFacturasProveedor) then
begin
if Assigned(ViewGrid) then
(ViewGrid as IViewListadoProcesoPedidoCliente).FacturasProveedor := FacturasProveedor;
end;
end;
procedure TfEditorProcesoPresupuestosCliente.SetPedidosCliente(const Value: IBizPedidoCliente);
begin
FPedidosCliente := Value;
if Assigned(FPedidosCliente) then
begin
dsDataTable.DataTable := FPedidosCliente.DataTable;
if Assigned(ViewGrid) then
(ViewGrid as IViewListadoProcesoPedidoCliente).PedidosCliente := PedidosCliente;
end;
end;
procedure TfEditorProcesoPresupuestosCliente.SetPedidosProveedor(const Value: IBizPedidoProveedor);
begin
FPedidosProveedor := Value;
if Assigned(FPedidosProveedor) then
begin
if Assigned(ViewGrid) then
(ViewGrid as IViewListadoProcesoPedidoCliente).PedidosProveedor := PedidosProveedor;
end;
end;
end.