AbetoDesign_FactuGES2/Source/Modulos/Contactos/Views/uViewClientes.pas
roberto 1f5e6ebcb9 Version 4.5.4
Cambio en los informes de Contratos de cliente de todas las entidades: Cambio fecha de entrega por fecha expedicion - Solicitado por Próspero
Cambio logo uecko y sellos cabecera en todos los informes de todas las entidades- Solicitado por Noelia
Arreglo para que permita introducir DNI y CIFs raros - Solicitado por Mónica
Las facturas proforma no se tendrán en cuenta en las facturas asociadas a los contratos, listado de contratos - Solicitado por Eva
Se añade comprobación de capitulos para que avise si existe un subtotal sin capitulo correspondiente, ayudará a controlar errores en presupuestos y contratos largos. - Solicitado por Miriam
En los detalles de presupuestos y contratos si eligen un articulo de la tarífa el programa no deja modificar las descripciones (Se ha detectado que lo hen hecho en ocasiones en las tiendas) - Solicitado por Miriam

git-svn-id: https://192.168.0.254/svn/Proyectos.AbetoDesign_FactuGES/trunk@186 93f398dd-4eb6-7a46-baf6-13f46f578da2
2024-02-05 10:15:29 +00:00

224 lines
6.9 KiB
ObjectPascal

unit uViewClientes;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uViewContactos, cxStyles, cxCustomData, cxGraphics, cxFilter,
cxData, cxDataStorage, cxEdit, DB, cxDBData, ActnList, uDADataTable,
cxGridLevel, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
cxClasses, cxControls, cxGridCustomView, cxGrid, JvComponent,
JvFormAutoSize, cxImage, PngImageList, ImgList, dxPSGlbl, dxPSUtl,
dxPSEngn, dxPrnPg, dxBkgnd, dxWrap, dxPrnDev, dxPSCompsProvider,
dxPSFillPatterns, dxPSEdgePatterns, dxPSCore,
dxPScxCommon, cxImageComboBox, cxGridCustomPopupMenu, cxGridPopupMenu,
dxPScxGrid6Lnk, ExtCtrls, JvComponentBase, JvBalloonHint, JvHint,
uViewFiltroBase, dxPgsDlg, TB2Item, TBX, TB2Toolbar, TBXDkPanels, TB2Dock,
uDAInterfaces, cxTextEdit, uCustomView, uViewBase, cxCurrencyEdit;
type
IViewClientes = interface(IViewContactos)
['{7964E0AB-3075-43E7-94BC-513D80A1C116}']
end;
TfrViewClientes = class(TfrViewContactos, IViewClientes)
cxGridViewNOMBRE_COMERCIAL: TcxGridDBColumn;
cxGridViewBLOQUEADO: TcxGridDBColumn;
cxGridViewTiendaWeb: TcxGridDBColumn;
cxGridViewPERSONA_CONTACTO: TcxGridDBColumn;
cxGridViewPROCEDENCIA_CLIENTE: TcxGridDBColumn;
actProcedencia: TAction;
TBXSeparatorItem1: TTBXSeparatorItem;
TBXItem2: TTBXItem;
cxGridViewPRECIO_PUNTO: TcxGridDBColumn;
TBXSeparatorItem2: TTBXSeparatorItem;
TBXItem3: TTBXItem;
actPrecioPunto: TAction;
cxGridViewAGENTE: TcxGridDBColumn;
cxGridViewDELEGACION: TcxGridDBColumn;
actDelegacion: TAction;
actComercial: TAction;
TBXSeparatorItem3: TTBXSeparatorItem;
TBXItem4: TTBXItem;
TBXSeparatorItem4: TTBXSeparatorItem;
TBXItem5: TTBXItem;
actPais: TAction;
TBXSeparatorItem5: TTBXSeparatorItem;
TBXItem6: TTBXItem;
procedure cxGridViewCODIGOCustomDrawCell(Sender: TcxCustomGridTableView;
ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
var ADone: Boolean);
procedure actProcedenciaExecute(Sender: TObject);
procedure actProcedenciaUpdate(Sender: TObject);
procedure actPrecioPuntoExecute(Sender: TObject);
procedure actPrecioPuntoUpdate(Sender: TObject);
procedure actComercialExecute(Sender: TObject);
procedure actComercialUpdate(Sender: TObject);
procedure actDelegacionExecute(Sender: TObject);
procedure actDelegacionUpdate(Sender: TObject);
procedure ConfigView; override;
procedure actPaisExecute(Sender: TObject);
procedure actPaisUpdate(Sender: TObject);
end;
implementation
uses uViewGridBase, uFactuGES_App;
{$R *.dfm}
procedure TfrViewClientes.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 TfrViewClientes.actComercialUpdate(Sender: TObject);
begin
inherited;
(Sender as TAction).Checked := not (cxGridViewAGENTE.GroupIndex < 0);
end;
procedure TfrViewClientes.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 TfrViewClientes.actDelegacionUpdate(Sender: TObject);
begin
inherited;
(Sender as TAction).Checked := not (cxGridViewDELEGACION.GroupIndex < 0);
end;
procedure TfrViewClientes.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 TfrViewClientes.actPaisUpdate(Sender: TObject);
begin
inherited;
(Sender as TAction).Checked := not (cxGridViewPAIS.GroupIndex < 0);
end;
procedure TfrViewClientes.actPrecioPuntoExecute(Sender: TObject);
begin
if (cxGridViewPRECIO_PUNTO.GroupIndex < 0) then
begin
cxGridViewPRECIO_PUNTO.GroupIndex := cxGridView.GroupedColumnCount;
cxGridViewPRECIO_PUNTO.Visible := False;
end
else
begin
cxGridViewPRECIO_PUNTO.GroupIndex := -1;
cxGridViewPRECIO_PUNTO.Visible := True;
end;
end;
procedure TfrViewClientes.actPrecioPuntoUpdate(Sender: TObject);
begin
inherited;
(Sender as TAction).Checked := not (cxGridViewPRECIO_PUNTO.GroupIndex < 0);
end;
procedure TfrViewClientes.actProcedenciaExecute(Sender: TObject);
begin
inherited;
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 TfrViewClientes.actProcedenciaUpdate(Sender: TObject);
begin
inherited;
(Sender as TAction).Checked := not (cxGridViewPROCEDENCIA_CLIENTE.GroupIndex < 0);
end;
procedure TfrViewClientes.ConfigView;
begin
inherited;
if ((AppFactuGES.EmpresaActiva.ID = CTE_EMPRESA_ABETO)
or (AppFactuGES.EmpresaActiva.ID = CTE_EMPRESA_GRADEN)) then
begin
cxGridViewTIENDA.VisibleForCustomization := False;
cxGridViewTIENDA.Visible := False;
cxGridViewAGENTE.VisibleForCustomization := True;
cxGridViewAGENTE.Visible := True;
cxGridViewDELEGACION.VisibleForCustomization := True;
cxGridViewDELEGACION.Visible := True;
actComercial.Visible := True;
actDelegacion.Visible := True;
end
else
begin
cxGridViewTIENDA.VisibleForCustomization := True;
cxGridViewTIENDA.Visible := True;
cxGridViewAGENTE.VisibleForCustomization := False;
cxGridViewAGENTE.Visible := False;
cxGridViewDELEGACION.VisibleForCustomization := False;
cxGridViewDELEGACION.Visible := False;
actComercial.Visible := False;
actDelegacion.Visible := False;
end;
end;
procedure TfrViewClientes.cxGridViewCODIGOCustomDrawCell(
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
var
R : TRect;
begin
//inherited; <- No llamamos al padre porque queremos hacer tratamiento especial
R := AViewInfo.ContentBounds;
ACanvas.FillRect(R);
if (cxGridView.DataController.DisplayTexts[AViewInfo.GridRecord.RecordIndex,
cxGridViewBLOQUEADO.Index] = '1') then
ACanvas.DrawImage(PngImageList, R.Left + 2, R.Top + 2, 2)
else
ACanvas.DrawImage(PngImageList, R.Left + 2, R.Top + 2, 1);
ADone := True;
end;
end.