2011-11-14 17:40:41 +00:00
|
|
|
|
unit uViewDetallesContratoCliente;
|
|
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
|
|
|
Dialogs, uViewDetallesArticulos, cxStyles, cxCustomData, cxGraphics, cxFilter,
|
|
|
|
|
|
cxData, cxDataStorage, cxEdit, DB, cxDBData, ImgList, PngImageList,
|
|
|
|
|
|
uDADataTable, ActnList, ComCtrls, ToolWin, cxGridLevel, cxClasses, cxControls,
|
|
|
|
|
|
cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
|
|
|
|
|
|
cxGrid, cxImageComboBox, cxTextEdit, cxMaskEdit, cxCheckBox, cxCurrencyEdit,
|
|
|
|
|
|
Grids, DBGrids, StdCtrls, ExtCtrls, cxRichEdit, ExtActns, StdActns,
|
|
|
|
|
|
JvExStdCtrls, JvCombobox, JvColorCombo, TB2Item, TBX, TB2Dock, TB2Toolbar,
|
|
|
|
|
|
uControllerDetallesArticulos, uBizContratosCliente, uDAInterfaces, Buttons,
|
|
|
|
|
|
Mask, DBCtrls, cxButtonEdit, cxDropDownEdit, Menus, cxGridCustomPopupMenu,
|
|
|
|
|
|
cxGridPopupMenu, cxDBLookupComboBox, cxCalc, cxEditRepositoryItems,
|
|
|
|
|
|
cxContainer, cxLookupEdit, cxDBLookupEdit, uBizDetallesContratoCliente,
|
|
|
|
|
|
cxMemo, uBizDetallesPresupuestoCliente;
|
|
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
IViewDetallesContratoCliente = interface(IViewDetallesArticulos)
|
|
|
|
|
|
['{61D7EB63-B37B-40D1-A36A-15F7F09525A4}']
|
|
|
|
|
|
function GetContrato: IBizContratoCliente;
|
|
|
|
|
|
procedure SetContrato(const Value: IBizContratoCliente);
|
|
|
|
|
|
property Contrato: IBizContratoCliente read GetContrato write SetContrato;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
TfrViewDetallesContratoCliente = class(TfrViewDetallesArticulos, IViewDetallesContratoCliente)
|
|
|
|
|
|
actAsignarDescuento: TAction;
|
|
|
|
|
|
TBXItem18: TTBXItem;
|
|
|
|
|
|
TBXSeparatorItem9: TTBXSeparatorItem;
|
|
|
|
|
|
DAPropiedades: TDADataSource;
|
2012-07-11 15:39:13 +00:00
|
|
|
|
cxGridViewPROPIEDAD: TcxGridDBColumn;
|
2011-11-14 17:40:41 +00:00
|
|
|
|
cxLookupComboBox1: TcxLookupComboBox;
|
|
|
|
|
|
DAValores: TDADataSource;
|
|
|
|
|
|
cxRichEdit1: TcxRichEdit;
|
|
|
|
|
|
cxGridViewTIPO_ARTICULO: TcxGridDBColumn;
|
|
|
|
|
|
TBXSubmenuItem1: TTBXSubmenuItem;
|
|
|
|
|
|
TBXSeparatorItem6: TTBXSeparatorItem;
|
|
|
|
|
|
TBXItem14: TTBXItem;
|
|
|
|
|
|
actCapituloCocina: TAction;
|
|
|
|
|
|
actCapituloArmarioF: TAction;
|
|
|
|
|
|
actCapituloBano: TAction;
|
|
|
|
|
|
TBXItem15: TTBXItem;
|
|
|
|
|
|
TBXItem16: TTBXItem;
|
|
|
|
|
|
actCapituloArmarioI: TAction;
|
|
|
|
|
|
TBXItem17: TTBXItem;
|
|
|
|
|
|
actCapituloElectrodomesticos: TAction;
|
|
|
|
|
|
actCapituloVarios: TAction;
|
|
|
|
|
|
TBXItem19: TTBXItem;
|
|
|
|
|
|
TBXItem20: TTBXItem;
|
|
|
|
|
|
TBXSeparatorItem7: TTBXSeparatorItem;
|
|
|
|
|
|
TBXSeparatorItem8: TTBXSeparatorItem;
|
|
|
|
|
|
TBXSeparatorItem10: TTBXSeparatorItem;
|
|
|
|
|
|
actCapituloImportes: TAction;
|
|
|
|
|
|
TBXSeparatorItem11: TTBXSeparatorItem;
|
|
|
|
|
|
TBXItem21: TTBXItem;
|
2012-07-11 15:39:13 +00:00
|
|
|
|
cxLookupComboBox2: TcxLookupComboBox;
|
2011-11-14 17:40:41 +00:00
|
|
|
|
procedure actAsignarDescuentoExecute(Sender: TObject);
|
|
|
|
|
|
procedure actAsignarDescuentoUpdate(Sender: TObject);
|
|
|
|
|
|
procedure CustomViewShow(Sender: TObject);
|
|
|
|
|
|
procedure cxGridViewDESCRIPCIONGetPropertiesForEdit(Sender: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord;
|
|
|
|
|
|
var AProperties: TcxCustomEditProperties);
|
|
|
|
|
|
procedure actCapituloBanoExecute(Sender: TObject);
|
|
|
|
|
|
procedure actCapituloArmarioFExecute(Sender: TObject);
|
|
|
|
|
|
procedure actCapituloArmarioIExecute(Sender: TObject);
|
|
|
|
|
|
procedure actCapituloCocinaExecute(Sender: TObject);
|
|
|
|
|
|
procedure actCapituloElectrodomesticosExecute(Sender: TObject);
|
|
|
|
|
|
procedure actCapituloVariosExecute(Sender: TObject);
|
|
|
|
|
|
procedure actAnadirExecute(Sender: TObject);
|
|
|
|
|
|
procedure actCapituloImportesExecute(Sender: TObject);
|
|
|
|
|
|
procedure OnVISIBLEPropertiesEditValueChanged(Sender: TObject);
|
|
|
|
|
|
procedure CustomViewDestroy(Sender: TObject);
|
2012-07-11 15:39:13 +00:00
|
|
|
|
procedure cxGridViewPROPIEDADGetPropertiesForEdit(
|
|
|
|
|
|
Sender: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord;
|
|
|
|
|
|
var AProperties: TcxCustomEditProperties);
|
2011-11-14 17:40:41 +00:00
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
procedure AnadirCapitulo(const Tipo: String;const Descripcion: String; const Descuento:Boolean = false);
|
|
|
|
|
|
|
|
|
|
|
|
protected
|
|
|
|
|
|
FContrato: IBizContratoCliente;
|
|
|
|
|
|
FPropiedades: IBizPropiedades;
|
|
|
|
|
|
function GetContrato: IBizContratoCliente;
|
|
|
|
|
|
procedure SetContrato(const Value: IBizContratoCliente);
|
|
|
|
|
|
|
|
|
|
|
|
procedure AnadirArticulosInterno; override;
|
|
|
|
|
|
procedure RellenarArticulosInterno; override;
|
|
|
|
|
|
function AnadirArticulo(pReferencia: String; TipoReferencia: TEnumReferencia): Boolean; override;
|
|
|
|
|
|
|
|
|
|
|
|
function EsTipoEditable(AItem: TcxCustomGridTableItem): Boolean; override;
|
|
|
|
|
|
|
|
|
|
|
|
public
|
|
|
|
|
|
property Contrato: IBizContratoCliente read GetContrato write SetContrato;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
|
|
uses uControllerDetallesBase, uDetallesContratoClienteController, schContratosClienteClient_Intf,
|
|
|
|
|
|
uDetallesPresupuestoClienteController,
|
|
|
|
|
|
uCalculosUtils;
|
|
|
|
|
|
|
|
|
|
|
|
{ TfrViewDetallesContratoProveedor }
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewDetallesContratoCliente.actAnadirExecute(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
AuxTipo: String;
|
|
|
|
|
|
begin
|
|
|
|
|
|
AuxTipo := '';
|
|
|
|
|
|
//En el caso de estar dentro de un capitulo almacenamos el tipo de articulo del capitulo
|
|
|
|
|
|
if FContrato.Detalles.TIPO_DETALLE = TIPO_DETALLE_CONCEPTO then
|
|
|
|
|
|
AuxTipo := FContrato.Detalles.TIPO_ARTICULO;
|
|
|
|
|
|
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
|
|
|
|
|
|
//Asignamos el tipo de articulo del capitulo
|
|
|
|
|
|
(Controller as IDetallesContratoClienteController).SetTipoArticulo(Detalles, AuxTipo);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewDetallesContratoCliente.actAsignarDescuentoExecute(Sender: TObject);
|
|
|
|
|
|
{var
|
|
|
|
|
|
AuxTop, AuxRow:Integer;
|
|
|
|
|
|
ADescuento: Variant;}
|
|
|
|
|
|
|
|
|
|
|
|
begin
|
|
|
|
|
|
{
|
|
|
|
|
|
ADescuento := (Controller as IDetallesContratoClienteController).PedirDescuento;
|
|
|
|
|
|
|
|
|
|
|
|
ShowHourglassCursor;
|
|
|
|
|
|
_FocusedView.BeginUpdate;
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
|
|
|
|
if Assigned(Controller) and Assigned(FContrato.Detalles) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
AuxTop := cxGridView.Controller.TopRowIndex;
|
|
|
|
|
|
AuxRow := cxGridView.DataController.FocusedRowIndex;
|
|
|
|
|
|
|
|
|
|
|
|
(Controller as IDetallesContratoClienteController).AsignarDescuento(FContrato.Detalles, darListaSeleccionados, ADescuento);
|
|
|
|
|
|
|
|
|
|
|
|
_FocusedView.DataController.SelectRows(AuxRow,AuxRow);
|
|
|
|
|
|
_FocusedView.Controller.TopRowIndex := AuxTop;
|
|
|
|
|
|
end
|
|
|
|
|
|
finally
|
|
|
|
|
|
_FocusedView.EndUpdate;
|
|
|
|
|
|
HideHourglassCursor;
|
|
|
|
|
|
end;
|
|
|
|
|
|
}
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewDetallesContratoCliente.actAsignarDescuentoUpdate(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
|
|
|
|
|
|
if not DADataSource.DataTable.IsEmpty then
|
|
|
|
|
|
(Sender as TAction).Enabled := not (DADataSource.DataTable.State in dsEditModes)
|
|
|
|
|
|
and (_FocusedView.DataController.GetSelectedCount > 0)
|
|
|
|
|
|
and (FContrato.Detalles.TIPO_DETALLE = TIPO_DETALLE_CONCEPTO)
|
|
|
|
|
|
else
|
|
|
|
|
|
(Sender as TAction).Enabled := False;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewDetallesContratoCliente.actCapituloArmarioFExecute(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
AnadirCapitulo(TIPO_CAPITULO_AF, 'FRENTE DE ARMARIO N<> ');
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewDetallesContratoCliente.actCapituloArmarioIExecute(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
AnadirCapitulo(TIPO_CAPITULO_AI, 'INTERIOR DE ARMARIO N<> ');
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewDetallesContratoCliente.actCapituloBanoExecute(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
AnadirCapitulo(TIPO_CAPITULO_B, 'MUEBLE DE BA<42>O N<> ');
|
|
|
|
|
|
AnadirCapitulo(TIPO_CAPITULO_V, 'IMPORTES ', True);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewDetallesContratoCliente.actCapituloCocinaExecute(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
AnadirCapitulo(TIPO_CAPITULO_C, 'MUEBLES DE COCINA ');
|
|
|
|
|
|
AnadirCapitulo(TIPO_CAPITULO_V, 'IMPORTES ', True);
|
|
|
|
|
|
AnadirCapitulo(TIPO_CAPITULO_V, 'AUMENTO POR ');
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewDetallesContratoCliente.actCapituloElectrodomesticosExecute(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
AnadirCapitulo(TIPO_CAPITULO_E, 'ELECTRODOM<4F>STICOS ');
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewDetallesContratoCliente.actCapituloImportesExecute(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
AnadirCapitulo(TIPO_CAPITULO_V, 'IMPORTES ');
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewDetallesContratoCliente.actCapituloVariosExecute(Sender: TObject);
|
|
|
|
|
|
begin
|
2016-09-05 09:30:43 +00:00
|
|
|
|
AnadirCapitulo(TIPO_CAPITULO_V, 'VARIOS ', true);
|
2011-11-14 17:40:41 +00:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TfrViewDetallesContratoCliente.AnadirArticulo(pReferencia: String; TipoReferencia: TEnumReferencia): Boolean;
|
|
|
|
|
|
begin
|
|
|
|
|
|
Result := (Controller as IDetallesContratoClienteController).AnadirArticulo(Detalles, pReferencia, TipoReferencia, Contrato.Cliente.ID);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewDetallesContratoCliente.AnadirArticulosInterno;
|
|
|
|
|
|
begin
|
|
|
|
|
|
(Controller as IDetallesContratoClienteController).AnadirArticulos(Detalles, Contrato.Cliente);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewDetallesContratoCliente.AnadirCapitulo(const Tipo: String;const Descripcion: String; const Descuento:Boolean = false);
|
|
|
|
|
|
var
|
|
|
|
|
|
bEsMultiSelect : Boolean;
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
// Debo quitar el multiselect porque provoca que se quede seleccionado
|
|
|
|
|
|
// el registro actual y no el nuevo registro que voy a a<>adir
|
|
|
|
|
|
bEsMultiSelect := _FocusedView.OptionsSelection.MultiSelect;
|
|
|
|
|
|
if bEsMultiSelect then
|
|
|
|
|
|
_FocusedView.OptionsSelection.MultiSelect := False;
|
|
|
|
|
|
|
|
|
|
|
|
ShowHourglassCursor;
|
|
|
|
|
|
_FocusedView.BeginUpdate;
|
|
|
|
|
|
try
|
|
|
|
|
|
if _FocusedView.Controller.EditingController.IsEditing then
|
|
|
|
|
|
_FocusedView.Controller.EditingController.Edit.PostEditValue;
|
|
|
|
|
|
|
|
|
|
|
|
if Assigned(Controller) and Assigned(Detalles) then
|
|
|
|
|
|
(Controller as IDetallesContratoClienteController).AnadirCapitulo(Tipo, Descripcion, Descuento, Detalles)
|
|
|
|
|
|
finally
|
|
|
|
|
|
_FocusedView.EndUpdate;
|
|
|
|
|
|
HideHourglassCursor;
|
|
|
|
|
|
|
|
|
|
|
|
// Dejo la propiedad MultiSelect como estaba
|
|
|
|
|
|
if bEsMultiSelect then
|
|
|
|
|
|
_FocusedView.OptionsSelection.MultiSelect := bEsMultiSelect;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewDetallesContratoCliente.CustomViewDestroy(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
cxGridViewVISIBLE.Properties.OnEditValueChanged := Nil;
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewDetallesContratoCliente.CustomViewShow(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
if not Assigned(FPropiedades) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
FPropiedades := (Controller as IDetallesContratoClienteController).DarPropiedades;
|
|
|
|
|
|
FPropiedades.DataTable.Active := True;
|
|
|
|
|
|
DAPropiedades.DataTable := FPropiedades.DataTable;
|
|
|
|
|
|
DAValores.DataTable := FPropiedades.Valores.DataTable;
|
|
|
|
|
|
cxGridViewVISIBLE.Properties.OnEditValueChanged := OnVISIBLEPropertiesEditValueChanged;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewDetallesContratoCliente.cxGridViewDESCRIPCIONGetPropertiesForEdit(
|
|
|
|
|
|
Sender: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord;
|
|
|
|
|
|
var AProperties: TcxCustomEditProperties);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
|
2013-04-25 17:15:39 +00:00
|
|
|
|
//Se desactiva la asociaci<63>n que habia de propiedades = familias, no saldr<64> combo directamente se escribe o rellena al elegir un articulo
|
2011-11-14 17:40:41 +00:00
|
|
|
|
//OJO sin esto no se refresca el filtro en tabla detalle "VALORES".
|
2013-04-25 17:15:39 +00:00
|
|
|
|
// DAPropiedades.DataTable.Locate(fld_PropiedadesDESCRIPCION, cxGridViewPROPIEDAD.DataBinding.Field.AsVariant,[]);
|
2011-11-14 17:40:41 +00:00
|
|
|
|
|
2013-04-25 17:15:39 +00:00
|
|
|
|
// if (ARecord.DisplayTexts[cxGridViewTIPO.Index] = TIPO_DETALLE_CONCEPTO)
|
|
|
|
|
|
// and (ARecord.DisplayTexts[cxGridViewPROPIEDAD.Index] <> '') then
|
|
|
|
|
|
// AProperties := cxLookupComboBox1.Properties
|
|
|
|
|
|
// else
|
2011-11-14 17:40:41 +00:00
|
|
|
|
AProperties := cxRichEdit1.Properties;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2012-07-11 15:39:13 +00:00
|
|
|
|
procedure TfrViewDetallesContratoCliente.cxGridViewPROPIEDADGetPropertiesForEdit(
|
|
|
|
|
|
Sender: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord;
|
|
|
|
|
|
var AProperties: TcxCustomEditProperties);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
|
2013-04-25 17:15:39 +00:00
|
|
|
|
//Se desactiva la asociaci<63>n que habia de propiedades = familias, no saldr<64> combo directamente se escribe o rellena al elegir un articulo
|
|
|
|
|
|
// if (ARecord.DisplayTexts[cxGridViewTIPO.Index] = TIPO_DETALLE_CONCEPTO)
|
|
|
|
|
|
// then
|
|
|
|
|
|
// AProperties := cxLookupComboBox2.Properties
|
|
|
|
|
|
// else
|
2012-07-11 15:39:13 +00:00
|
|
|
|
AProperties := cxRichEdit1.Properties;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2011-11-14 17:40:41 +00:00
|
|
|
|
function TfrViewDetallesContratoCliente.EsTipoEditable(AItem: TcxCustomGridTableItem): Boolean;
|
|
|
|
|
|
var
|
|
|
|
|
|
IndiceCol : Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
Result := True;
|
|
|
|
|
|
|
|
|
|
|
|
if (AItem.Index in [cxGridViewDESCUENTO.Index]) then
|
|
|
|
|
|
begin
|
2013-04-25 17:15:39 +00:00
|
|
|
|
//Esto es para que solo sea editable la columna dto en las lineas de tipo descuento (para hacer descuento por capitulo),
|
2013-09-25 17:13:02 +00:00
|
|
|
|
//adem<65>s descuentos a nivel de lineas de detalle
|
|
|
|
|
|
IndiceCol := cxGridView.GetColumnByFieldName(CAMPO_TIPO).Index;
|
|
|
|
|
|
if (AItem.GridView.Items[IndiceCol].EditValue <> TIPO_DETALLE_DESCUENTO)
|
|
|
|
|
|
and (AItem.GridView.Items[IndiceCol].EditValue <> TIPO_DETALLE_CONCEPTO) then
|
|
|
|
|
|
Result := False
|
2011-11-14 17:40:41 +00:00
|
|
|
|
end
|
2012-07-11 15:39:13 +00:00
|
|
|
|
else if (AItem.Index in [cxGridViewPROPIEDAD.Index, cxGridViewTIPO_ARTICULO.Index]) then
|
2011-11-14 17:40:41 +00:00
|
|
|
|
begin
|
|
|
|
|
|
IndiceCol := cxGridView.GetColumnByFieldName(CAMPO_TIPO).Index;
|
|
|
|
|
|
if ((AItem.GridView.Items[IndiceCol].EditValue = TIPO_DETALLE_SALTO) or
|
|
|
|
|
|
(AItem.GridView.Items[IndiceCol].EditValue = TIPO_DETALLE_SUBTOTAL) or
|
|
|
|
|
|
(AItem.GridView.Items[IndiceCol].EditValue = TIPO_DETALLE_DESCUENTO) or
|
|
|
|
|
|
(AItem.GridView.Items[IndiceCol].EditValue = TIPO_DETALLE_TITULO)) then
|
|
|
|
|
|
Result := False
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
IndiceCol := cxGridView.GetColumnByFieldName(fld_ContratosCliente_DetallesTIPO_ARTICULO).Index;
|
|
|
|
|
|
if ((AItem.GridView.Items[IndiceCol].EditValue <> TIPO_CAPITULO_AF) and
|
|
|
|
|
|
(AItem.GridView.Items[IndiceCol].EditValue <> TIPO_CAPITULO_AI) and
|
2012-07-11 15:39:13 +00:00
|
|
|
|
(AItem.GridView.Items[IndiceCol].EditValue <> TIPO_CAPITULO_C) and
|
|
|
|
|
|
(AItem.GridView.Items[IndiceCol].EditValue <> TIPO_CAPITULO_O) and
|
|
|
|
|
|
(AItem.GridView.Items[IndiceCol].EditValue <> TIPO_CAPITULO_V) and
|
|
|
|
|
|
(AItem.GridView.Items[IndiceCol].EditValue <> TIPO_CAPITULO_E) and
|
|
|
|
|
|
(AItem.GridView.Items[IndiceCol].EditValue <> TIPO_CAPITULO_B)) then
|
2011-11-14 17:40:41 +00:00
|
|
|
|
Result := False
|
|
|
|
|
|
end;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
Result := inherited EsTipoEditable(AItem);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TfrViewDetallesContratoCliente.GetContrato: IBizContratoCliente;
|
|
|
|
|
|
begin
|
|
|
|
|
|
Result := FContrato;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewDetallesContratoCliente.OnVISIBLEPropertiesEditValueChanged(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
Orden: Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
Orden := 1;
|
|
|
|
|
|
if (cxGridView.DataController.GetItemByFieldName(CAMPO_TIPO).EditValue = TIPO_DETALLE_TITULO)
|
|
|
|
|
|
or (cxGridView.DataController.GetItemByFieldName(CAMPO_TIPO).EditValue = TIPO_DETALLE_TITULO_OPCIONAL)
|
|
|
|
|
|
or (cxGridView.DataController.GetItemByFieldName(CAMPO_TIPO).EditValue = TIPO_DETALLE_SUBTOTAL) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
cxGridView.BeginUpdate;
|
|
|
|
|
|
|
|
|
|
|
|
if (cxGridView.DataController.GetItemByFieldName(CAMPO_TIPO).EditValue = TIPO_DETALLE_SUBTOTAL) then
|
|
|
|
|
|
Orden := 0;
|
|
|
|
|
|
|
|
|
|
|
|
if Assigned(Controller) and Assigned(Detalles) then
|
|
|
|
|
|
(Controller as IDetallesContratoClienteController).SetVisible(Detalles, cxGridView.DataController.GetItemByFieldName(CAMPO_VISIBLE).EditValue, Orden);
|
|
|
|
|
|
|
|
|
|
|
|
cxGridView.EndUpdate;
|
|
|
|
|
|
end;
|
|
|
|
|
|
(Controller as IDetallesContratoClienteController).ActualizarTotales(Detalles);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewDetallesContratoCliente.RellenarArticulosInterno;
|
|
|
|
|
|
begin
|
|
|
|
|
|
(Controller as IDetallesContratoClienteController).AnadirArticulos(Detalles, Contrato.Cliente, False);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrViewDetallesContratoCliente.SetContrato(const Value: IBizContratoCliente);
|
|
|
|
|
|
begin
|
|
|
|
|
|
FContrato := Value;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end.
|