git-svn-id: https://192.168.0.254/svn/Proyectos.AbetoDesign_FactuGES/trunk@191 93f398dd-4eb6-7a46-baf6-13f46f578da2
527 lines
17 KiB
ObjectPascal
527 lines
17 KiB
ObjectPascal
unit uViewPresupuestosCliente;
|
|
|
|
interface
|
|
|
|
uses
|
|
uViewGrid, cxStyles, cxCustomData, cxGraphics, cxFilter,
|
|
cxData, cxDataStorage, cxEdit, DB, cxDBData, dxPSGlbl, dxPSUtl, dxPSEngn,
|
|
dxPrnPg, dxBkgnd, dxWrap, dxPrnDev, dxPSCompsProvider, dxPSFillPatterns,
|
|
dxPSEdgePatterns, cxImageComboBox, ImgList, Controls, PngImageList,
|
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
|
|
cxGridCustomPopupMenu, cxGridPopupMenu, dxPSCore, dxPScxCommon, dxPScxGrid6Lnk,
|
|
uDADataTable, cxGridLevel, cxClasses, cxControls, cxGridCustomView, Classes,
|
|
cxGrid, uBizPresupuestosCliente, cxCurrencyEdit, Forms, uViewFiltroBase, ActnList, TB2Item,
|
|
TBX, TB2Toolbar, TBXDkPanels, TB2Dock, dxPgsDlg, uDAInterfaces, Windows,
|
|
uCustomView, uViewBase, cxTextEdit, cxCalendar;
|
|
|
|
type
|
|
IViewPresupuestosCliente = interface(IViewGrid)
|
|
['{96821714-55CF-4BC1-A0C1-16E027B2EF16}']
|
|
function GetPresupuestos: IBizPresupuestoCliente;
|
|
procedure SetPresupuestos(const Value: IBizPresupuestoCliente);
|
|
property Presupuestos: IBizPresupuestoCliente read GetPresupuestos write SetPresupuestos;
|
|
end;
|
|
|
|
TfrViewPresupuestosCliente = class(TfrViewGrid, IViewPresupuestosCliente)
|
|
cxGridViewREFERENCIA: TcxGridDBColumn;
|
|
cxGridViewINCIDENCIASACTIVAS: TcxGridDBColumn;
|
|
cxGridViewNOMBRE: TcxGridDBColumn;
|
|
cxGridViewSITUACION: TcxGridDBColumn;
|
|
cxGridViewFECHA_PRESUPUESTO: TcxGridDBColumn;
|
|
cxGridViewCONTRATO: TcxGridDBColumn;
|
|
cxGridViewIMPORTE_TOTAL: TcxGridDBColumn;
|
|
cxGridLevelPendientes: TcxGridLevel;
|
|
cxGridLevelEnProceso: TcxGridLevel;
|
|
cxGridLevelServidor: TcxGridLevel;
|
|
cxStylePENDIENTES: TcxStyle;
|
|
cxStyleACEPTADO: TcxStyle;
|
|
actCliente: TAction;
|
|
actProvincia: TAction;
|
|
TBXItem2: TTBXItem;
|
|
TBXSeparatorItem1: TTBXSeparatorItem;
|
|
TBXSeparatorItem2: TTBXSeparatorItem;
|
|
TBXItem3: TTBXItem;
|
|
cxGridViewFECHA_DECISION: TcxGridDBColumn;
|
|
cxGridViewNIF_CIF: TcxGridDBColumn;
|
|
cxGridViewINCIDENCIAS: TcxGridDBColumn;
|
|
cxStyleRECHAZADO: TcxStyle;
|
|
cxGridViewTIPO: TcxGridDBColumn;
|
|
cxGridViewREFERENCIA_CLIENTE: TcxGridDBColumn;
|
|
cxGridViewBASE_IMPONIBLE: TcxGridDBColumn;
|
|
cxGridViewIMPORTE_IVA: TcxGridDBColumn;
|
|
cxGridViewIVA: TcxGridDBColumn;
|
|
cxGridViewNOMBRE_COMERCIAL_CLIENTE: TcxGridDBColumn;
|
|
cxGridViewPROCEDENCIA_CLIENTE: TcxGridDBColumn;
|
|
TBXSeparatorItem3: TTBXSeparatorItem;
|
|
TBXItem4: TTBXItem;
|
|
actProcedencia: TAction;
|
|
cxGridViewTIENDA: TcxGridDBColumn;
|
|
cxGridViewAGENTE: TcxGridDBColumn;
|
|
cxGridViewDELEGACION: TcxGridDBColumn;
|
|
actDelegacion: TAction;
|
|
actComercial: TAction;
|
|
TBXSeparatorItem4: TTBXSeparatorItem;
|
|
TBXItem5: TTBXItem;
|
|
TBXSeparatorItem5: TTBXSeparatorItem;
|
|
TBXItem6: TTBXItem;
|
|
actTienda: TAction;
|
|
TBXSeparatorItem6: TTBXSeparatorItem;
|
|
TBXItem7: TTBXItem;
|
|
cxGridViewPAIS: TcxGridDBColumn;
|
|
cxGridViewIDIOMA: TcxGridDBColumn;
|
|
actPais: TAction;
|
|
TBXSeparatorItem7: TTBXSeparatorItem;
|
|
TBXItem8: TTBXItem;
|
|
procedure cxGridActiveTabChanged(Sender: TcxCustomGrid; ALevel:
|
|
TcxGridLevel);
|
|
procedure cxGridViewStylesGetContentStyle(Sender: TcxCustomGridTableView;
|
|
ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out
|
|
AStyle: TcxStyle);
|
|
procedure actClienteExecute(Sender: TObject);
|
|
procedure actClienteUpdate(Sender: TObject);
|
|
procedure actProvinciaExecute(Sender: TObject);
|
|
procedure actProvinciaUpdate(Sender: TObject);
|
|
procedure cxGridViewICONOCustomDrawCell(Sender: TcxCustomGridTableView;
|
|
ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
|
|
var ADone: Boolean);
|
|
procedure cxGridViewINCIDENCIASACTIVASGetCellHint(
|
|
Sender: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord;
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; const AMousePos: TPoint;
|
|
var AHintText: TCaption; var AIsHintMultiLine: Boolean;
|
|
var AHintTextRect: TRect);
|
|
procedure cxGridViewDataControllerCompare(
|
|
ADataController: TcxCustomDataController; ARecordIndex1, ARecordIndex2,
|
|
AItemIndex: Integer; const V1, V2: Variant; var Compare: Integer);
|
|
procedure OnFiltroListaPropertiesChange(Sender: TObject);
|
|
procedure OnFiltroListaPropertiesInitPopup(Sender: TObject);
|
|
procedure CustomViewDestroy(Sender: TObject);
|
|
procedure CustomViewShow(Sender: TObject);
|
|
procedure frViewFiltroBase1actQuitarFiltroExecute(Sender: TObject);
|
|
procedure actProcedenciaExecute(Sender: TObject);
|
|
procedure actProcedenciaUpdate(Sender: TObject);
|
|
procedure actDelegacionExecute(Sender: TObject);
|
|
procedure actDelegacionUpdate(Sender: TObject);
|
|
procedure actComercialExecute(Sender: TObject);
|
|
procedure actComercialUpdate(Sender: TObject);
|
|
procedure actTiendaExecute(Sender: TObject);
|
|
procedure actTiendaUpdate(Sender: TObject);
|
|
procedure actPaisExecute(Sender: TObject);
|
|
procedure actPaisUpdate(Sender: TObject);
|
|
|
|
private
|
|
//Filtros relativos a la vista
|
|
procedure AnadirFiltroSituaciones;
|
|
procedure AnadirFiltroFechas;
|
|
// procedure AnadirFiltroFacturado;
|
|
|
|
protected
|
|
FPresupuestos: IBizPresupuestoCliente;
|
|
function GetPresupuestos: IBizPresupuestoCliente;
|
|
procedure SetPresupuestos(const Value: IBizPresupuestoCliente);
|
|
public
|
|
procedure AnadirOtrosFiltros; override;
|
|
procedure ConfigView; override;
|
|
property Presupuestos: IBizPresupuestoCliente read GetPresupuestos write SetPresupuestos;
|
|
|
|
|
|
end;
|
|
|
|
implementation
|
|
|
|
uses
|
|
SysUtils, variants, uDataModulePresupuestosCliente, schPresupuestosClienteClient_Intf,
|
|
uViewGridBase, uFactuGES_App,
|
|
//uReferenciasUtils,
|
|
cxVariants;
|
|
|
|
{$R *.dfm}
|
|
|
|
procedure TfrViewPresupuestosCliente.actClienteExecute(Sender: TObject);
|
|
begin
|
|
if (cxGridViewNOMBRE.GroupIndex < 0) then
|
|
begin
|
|
cxGridViewNOMBRE.GroupIndex := cxGridView.GroupedColumnCount;
|
|
cxGridViewNOMBRE.Visible := False;
|
|
end
|
|
else
|
|
begin
|
|
cxGridViewNOMBRE.GroupIndex := -1;
|
|
cxGridViewNOMBRE.Visible := True;
|
|
end;
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.actClienteUpdate(Sender: TObject);
|
|
begin
|
|
inherited;
|
|
(Sender as TAction).Checked := not (cxGridViewNOMBRE.GroupIndex < 0);
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.actComercialExecute(Sender: TObject);
|
|
begin
|
|
if (cxGridViewAGENTE.GroupIndex < 0) then
|
|
begin
|
|
cxGridViewAGENTE.GroupIndex := cxGridView.GroupedColumnCount;
|
|
cxGridViewAGENTE.Visible := False;
|
|
end
|
|
else
|
|
begin
|
|
cxGridViewAGENTE.GroupIndex := -1;
|
|
cxGridViewAGENTE.Visible := True;
|
|
end;
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.actComercialUpdate(Sender: TObject);
|
|
begin
|
|
inherited;
|
|
(Sender as TAction).Checked := not (cxGridViewAGENTE.GroupIndex < 0);
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.actDelegacionExecute(Sender: TObject);
|
|
begin
|
|
if (cxGridViewDELEGACION.GroupIndex < 0) then
|
|
begin
|
|
cxGridViewDELEGACION.GroupIndex := cxGridView.GroupedColumnCount;
|
|
cxGridViewDELEGACION.Visible := False;
|
|
end
|
|
else
|
|
begin
|
|
cxGridViewDELEGACION.GroupIndex := -1;
|
|
cxGridViewDELEGACION.Visible := True;
|
|
end;
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.actDelegacionUpdate(Sender: TObject);
|
|
begin
|
|
inherited;
|
|
(Sender as TAction).Checked := not (cxGridViewDELEGACION.GroupIndex < 0);
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.actPaisExecute(Sender: TObject);
|
|
begin
|
|
if (cxGridViewPAIS.GroupIndex < 0) then
|
|
begin
|
|
cxGridViewPAIS.GroupIndex := cxGridView.GroupedColumnCount;
|
|
cxGridViewPAIS.Visible := False;
|
|
end
|
|
else
|
|
begin
|
|
cxGridViewPAIS.GroupIndex := -1;
|
|
cxGridViewPAIS.Visible := True;
|
|
end;
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.actPaisUpdate(Sender: TObject);
|
|
begin
|
|
inherited;
|
|
(Sender as TAction).Checked := not (cxGridViewPAIS.GroupIndex < 0);
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.actProcedenciaExecute(Sender: TObject);
|
|
begin
|
|
if (cxGridViewPROCEDENCIA_CLIENTE.GroupIndex < 0) then
|
|
begin
|
|
cxGridViewPROCEDENCIA_CLIENTE.GroupIndex := cxGridView.GroupedColumnCount;
|
|
cxGridViewPROCEDENCIA_CLIENTE.Visible := False;
|
|
end
|
|
else
|
|
begin
|
|
cxGridViewPROCEDENCIA_CLIENTE.GroupIndex := -1;
|
|
cxGridViewPROCEDENCIA_CLIENTE.Visible := True;
|
|
end;
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.actProcedenciaUpdate(Sender: TObject);
|
|
begin
|
|
inherited;
|
|
(Sender as TAction).Checked := not (cxGridViewPROCEDENCIA_CLIENTE.GroupIndex < 0);
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.actProvinciaExecute(Sender: TObject);
|
|
begin
|
|
{
|
|
if (cxGridViewPROVINCIA.GroupIndex < 0) then
|
|
begin
|
|
cxGridViewPROVINCIA.GroupIndex := cxGridView.GroupedColumnCount;
|
|
cxGridViewPROVINCIA.Visible := False;
|
|
end
|
|
else
|
|
begin
|
|
cxGridViewPROVINCIA.GroupIndex := -1;
|
|
cxGridViewPROVINCIA.Visible := True;
|
|
end;
|
|
}
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.actProvinciaUpdate(Sender: TObject);
|
|
begin
|
|
{
|
|
inherited;
|
|
(Sender as TAction).Checked := not (cxGridViewPROVINCIA.GroupIndex < 0);
|
|
}
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.actTiendaExecute(Sender: TObject);
|
|
begin
|
|
if (cxGridViewTIENDA.GroupIndex < 0) then
|
|
begin
|
|
cxGridViewTIENDA.GroupIndex := cxGridView.GroupedColumnCount;
|
|
cxGridViewTIENDA.Visible := False;
|
|
end
|
|
else
|
|
begin
|
|
cxGridViewTIENDA.GroupIndex := -1;
|
|
cxGridViewTIENDA.Visible := True;
|
|
end;
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.actTiendaUpdate(Sender: TObject);
|
|
begin
|
|
inherited;
|
|
(Sender as TAction).Checked := not (cxGridViewTIENDA.GroupIndex < 0);
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.AnadirFiltroFechas;
|
|
var
|
|
Columna: TcxGridDBColumn;
|
|
Fecha1, Fecha2: Variant;
|
|
FFiltro : TcxFilterCriteriaItemList;
|
|
begin
|
|
Fecha1 := frViewFiltroBase1.edtFechaIniFiltro.EditValue;
|
|
Fecha2 := frViewFiltroBase1.edtFechaFinFiltro.EditValue;
|
|
|
|
if not VarIsNull(Fecha1)
|
|
and not VarIsNull(Fecha2) then
|
|
begin
|
|
cxGridView.DataController.Filter.Options := [fcoCaseInsensitive, fcoSoftCompare];
|
|
FFiltro := AddFilterGrid(fboAnd);
|
|
|
|
Columna := (cxGridView as TcxGridDBTableView).GetColumnByFieldName('FECHA_Presupuesto');
|
|
FFiltro.AddItem(Columna, foBetween, varArrayOf([Fecha1, Fecha2]), VarToStr(Fecha1) + ' and ' + VarToStr(Fecha2));
|
|
end;
|
|
end;
|
|
|
|
{procedure TfrViewPresupuestosCliente.AnadirFiltroFacturado;
|
|
var
|
|
FFiltro : TcxFilterCriteriaItemList;
|
|
begin
|
|
//Solo se aplica este filtro en el caso de tener activo el panel de detalle de filtro
|
|
//y sobre la lista de articulos detallada por proveedor
|
|
if frViewFiltroBase1.Visible then
|
|
begin
|
|
case frViewFiltroBase1.eLista.ItemIndex of
|
|
//Sin facturar
|
|
1 : begin
|
|
FFiltro := AddFilterGrid(fboAnd);
|
|
FFiltro.AddItem(cxGridViewFACTURA, foEqual, NULL, 'NoFacturado');
|
|
end;
|
|
|
|
//Facturados
|
|
2: begin
|
|
FFiltro := AddFilterGrid(fboAnd);
|
|
FFiltro.AddItem(cxGridViewFACTURA, foNotEqual, NULL, 'Facturado');
|
|
end;
|
|
end;
|
|
end;
|
|
end;}
|
|
|
|
procedure TfrViewPresupuestosCliente.AnadirFiltroSituaciones;
|
|
var
|
|
FFiltro : TcxFilterCriteriaItemList;
|
|
begin
|
|
FFiltro := AddFilterGrid(fboAnd);
|
|
|
|
case cxGrid.ActiveLevel.Index of
|
|
1 : FFiltro.AddItem(cxGridViewSITUACION, foEqual, SITUACION_PRESUPUESTO_PENDIENTE, SITUACION_PRESUPUESTO_PENDIENTE);
|
|
2 : FFiltro.AddItem(cxGridViewSITUACION, foEqual, SITUACION_PRESUPUESTO_ACEPTADO, SITUACION_PRESUPUESTO_ACEPTADO);
|
|
3 : FFiltro.AddItem(cxGridViewSITUACION, foEqual, SITUACION_PRESUPUESTO_ANULADO, SITUACION_PRESUPUESTO_ANULADO);
|
|
end;
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.AnadirOtrosFiltros;
|
|
begin
|
|
inherited;
|
|
|
|
AnadirFiltroSituaciones;
|
|
AnadirFiltroFechas;
|
|
// AnadirFiltroFacturado;
|
|
|
|
//Finalmente activamos el filtro si tenemos algo
|
|
if cxGridView.DataController.Filter.IsEmpty then
|
|
cxGridView.DataController.Filter.Active := False
|
|
else
|
|
cxGridView.DataController.Filter.Active := True;
|
|
cxGrid.ActiveLevel.GridView := cxGridView;
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.CustomViewDestroy(Sender: TObject);
|
|
begin
|
|
// frViewFiltroBase1.eLista.Properties.OnChange := Nil;
|
|
// frViewFiltroBase1.eLista.Properties.OnInitPopup := Nil;
|
|
inherited;
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.CustomViewShow(Sender: TObject);
|
|
begin
|
|
inherited;
|
|
// frViewFiltroBase1.eLista.Properties.OnChange := OnFiltroListaPropertiesChange;
|
|
// frViewFiltroBase1.eLista.Properties.OnInitPopup := OnFiltroListaPropertiesInitPopup;
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.cxGridActiveTabChanged(Sender: TcxCustomGrid; ALevel: TcxGridLevel);
|
|
begin
|
|
inherited;
|
|
RefrescarFiltro;
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.cxGridViewDataControllerCompare(
|
|
ADataController: TcxCustomDataController; ARecordIndex1, ARecordIndex2,
|
|
AItemIndex: Integer; const V1, V2: Variant; var Compare: Integer);
|
|
begin
|
|
inherited;
|
|
{
|
|
if (AItemIndex = cxGridViewREFERENCIA.Index) and
|
|
(VarType(V1) = VarType(V2)) and (VarType(V1) = varString) then
|
|
Compare := CompararReferencias(V1, V2)
|
|
else
|
|
Compare := VarCompare(V1, V2);
|
|
}
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.cxGridViewICONOCustomDrawCell(
|
|
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
|
|
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|
{var
|
|
R : TRect;}
|
|
begin
|
|
inherited;
|
|
{ R := AViewInfo.ContentBounds;
|
|
ACanvas.FillRect(R);
|
|
|
|
if (cxGridView.DataController.DisplayTexts[AViewInfo.GridRecord.RecordIndex,
|
|
cxGridViewINCIDENCIASACTIVAS.Index] = 'Sin incidencias') then
|
|
ACanvas.DrawImage(GridPNGImageList, R.Left + 2, R.Top + 2, 1)
|
|
else
|
|
ACanvas.DrawImage(GridPNGImageList, R.Left + 2, R.Top + 2, 2);
|
|
ADone := True;}
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.cxGridViewINCIDENCIASACTIVASGetCellHint(
|
|
Sender: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord;
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; const AMousePos: TPoint;
|
|
var AHintText: TCaption; var AIsHintMultiLine: Boolean;
|
|
var AHintTextRect: TRect);
|
|
begin
|
|
inherited;
|
|
if (ARecord.DisplayTexts[Sender.Index] <> 'Sin incidencias') then
|
|
begin
|
|
AIsHintMultiLine := True;
|
|
if not VarIsNull(ARecord.Values[cxGridViewINCIDENCIAS.Index]) then
|
|
AHintText := ARecord.Values[cxGridViewINCIDENCIAS.Index];
|
|
end;
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.cxGridViewStylesGetContentStyle(Sender:
|
|
TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem:
|
|
TcxCustomGridTableItem; out AStyle: TcxStyle);
|
|
var
|
|
IndiceCol: Integer;
|
|
ASituacion: string;
|
|
begin
|
|
inherited;
|
|
if Assigned(ARecord) then
|
|
begin
|
|
IndiceCol := (Sender as TcxGridDBTableView).GetColumnByFieldName(fld_PresupuestosClienteSITUACION).Index;
|
|
ASituacion := VarToStr(ARecord.DisplayTexts[IndiceCol]);
|
|
if ASituacion = SITUACION_PRESUPUESTO_PENDIENTE then
|
|
AStyle.TextColor := cxStylePENDIENTES.TextColor
|
|
else if ASituacion = SITUACION_PRESUPUESTO_ACEPTADO then
|
|
AStyle.TextColor := cxStyleACEPTADO.TextColor
|
|
else if ASituacion = SITUACION_PRESUPUESTO_ANULADO then
|
|
AStyle.TextColor := cxStyleRECHAZADO.TextColor
|
|
end;
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.frViewFiltroBase1actQuitarFiltroExecute(Sender: TObject);
|
|
begin
|
|
frViewFiltroBase1.txtFiltroTodo.Clear;
|
|
// frViewFiltroBase1.eLista.Clear;
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.OnFiltroListaPropertiesChange(Sender: TObject);
|
|
begin
|
|
inherited;
|
|
RefrescarFiltro;
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.OnFiltroListaPropertiesInitPopup(Sender: TObject);
|
|
begin
|
|
inherited;
|
|
{
|
|
with frViewFiltroBase1.eLista.Properties.Items do
|
|
begin
|
|
BeginUpdate;
|
|
try
|
|
Clear;
|
|
Add('Todos'); //Case 0
|
|
Add('Sin facturar'); //Case 1
|
|
Add('Facturados'); //Case 2
|
|
frViewFiltroBase1.eLista.ItemIndex := 0;
|
|
finally
|
|
EndUpdate;
|
|
end;
|
|
end;
|
|
}
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.ConfigView;
|
|
begin
|
|
inherited;
|
|
|
|
cxGridViewTIENDA.Visible := True;
|
|
cxGridViewTIENDA.VisibleForCustomization := True;
|
|
actTienda.Visible := True;
|
|
|
|
cxGridViewAGENTE.Visible := False;
|
|
cxGridViewAGENTE.VisibleForCustomization := False;
|
|
actComercial.Visible := False;
|
|
|
|
cxGridViewDELEGACION.Visible := False;
|
|
cxGridViewDELEGACION.VisibleForCustomization := False;
|
|
actDelegacion.Visible := False;
|
|
|
|
//FILTRO DE EMPRESAS TIENDA
|
|
if (AppFactuGES.EmpresaActiva.ID = CTE_EMPRESA_ABETO) then
|
|
begin
|
|
cxGridViewTIENDA.Visible := False;
|
|
cxGridViewTIENDA.VisibleForCustomization := False;
|
|
actTienda.Visible := False;
|
|
end;
|
|
|
|
//FILTRO DE EMPRESAS COMERCIALES
|
|
if ((AppFactuGES.EmpresaActiva.ID = CTE_EMPRESA_ABETO)
|
|
or (AppFactuGES.EmpresaActiva.ID = CTE_EMPRESA_GRADEN)) then
|
|
begin
|
|
cxGridViewAGENTE.Visible := True;
|
|
cxGridViewAGENTE.VisibleForCustomization := True;
|
|
actComercial.Visible := True;
|
|
|
|
cxGridViewDELEGACION.Visible := True;
|
|
cxGridViewDELEGACION.VisibleForCustomization := True;
|
|
actDelegacion.Visible := True;
|
|
end;
|
|
end;
|
|
|
|
function TfrViewPresupuestosCliente.GetPresupuestos: IBizPresupuestoCliente;
|
|
begin
|
|
Result := FPresupuestos;
|
|
end;
|
|
|
|
procedure TfrViewPresupuestosCliente.SetPresupuestos(const Value: IBizPresupuestoCliente);
|
|
begin
|
|
FPresupuestos := Value;
|
|
if Assigned(FPresupuestos) then
|
|
dsDataSource.DataTable := FPresupuestos.DataTable;
|
|
end;
|
|
|
|
end.
|