diff --git a/Source/Base/Utiles/uGridUtils.pas b/Source/Base/Utiles/uGridUtils.pas
index 3b0362f8..e3b654a2 100644
--- a/Source/Base/Utiles/uGridUtils.pas
+++ b/Source/Base/Utiles/uGridUtils.pas
@@ -54,6 +54,8 @@ type
procedure SeleccionarFilasDesdeGrid(const AView : TcxGridDBTableView;
ASelectedRowList : TSelectedRecords);
+procedure AsignarAnchosPrefijadosAColumnas(const AView : TcxGridDBTableView);
+
implementation
@@ -263,7 +265,7 @@ begin
RedrawWindow(AGridView.Site.Handle, Nil, 0, RDW_FRAME Or RDW_NOFRAME Or
RDW_ALLCHILDREN Or RDW_INVALIDATE);
end;
-end;
+end;
procedure SeleccionarFilasDesdeGrid(const AView : TcxGridDBTableView;
@@ -272,6 +274,7 @@ var
ARecord: TcxCustomGridRecord;
i : Integer;
AGridStatus : TcxGridStatus;
+
begin
if not Assigned(AView) then
raise Exception.Create('No hay vista asignada (SeleccionarFilasDesdeGrid)');
@@ -298,4 +301,71 @@ begin
end;
+procedure AsignarAnchosPrefijadosAColumnas(const AView : TcxGridDBTableView);
+var
+ DefAnchos : TStringList;
+ AColumn: TcxGridDBColumn;
+ AIndex, i : Integer;
+begin
+ if not Assigned(AView) then
+ raise Exception.Create('No hay vista asignada (AsignarAnchosPrefijadosAColumnas)');
+
+ DefAnchos := TStringList.Create;
+ with DefAnchos do begin
+ CaseSensitive := False;
+ Sorted := False;
+ CommaText := 'CONCEPTO=600,' +
+ 'NOMBRE=600,' +
+ 'CANTIDAD=40,' +
+ 'VISIBLE=20,' +
+ 'VISIBLE2=20,' +
+ 'DESCUENTO=60,' +
+ 'IVA=60,' +
+ 'RE=60,' +
+ 'IMPORTE_UNIDAD=80' +
+ 'REFERENCIA=100,' +
+ 'REF_PEDIDO=100,' +
+ 'REF_CONTRATO=100,' +
+ 'REF_FACTURA=100,' +
+ 'REFERENCIA_CLIENTE=100,' +
+ 'REFERENCIA_PROVEEDOR=100,' +
+ 'SITUACION=100,' +
+ 'IMPORTE_NETO=80,' +
+ 'IMPORTE_PORTE=80,' +
+ 'IMPORTE_IVA=80,' +
+ 'IMPORTE_RE=80,' +
+ 'IMPORTE_TOTAL=150,' +
+ 'TIPO=80,' +
+ 'TIPO_CONTRATO=80,' +
+ 'TIPO_PRESUPUESTO=80,' +
+ 'VENDEDOR=60,' +
+ 'TIENDA=60,' +
+ 'NIF_CIF=60,' +
+ 'FECHA_FACTURA=80,' +
+ 'FECHA_VENCIMIENTO=80,' +
+ 'FECHA_CONTRATO=80,' +
+ 'FECHA_ALBARAN=80,' +
+ 'FECHA_RECEPCION=80,' +
+ 'FECHA_ENVIO=80,' +
+ 'FECHA_VIGENCIA=80';
+ end;
+
+ ShowHourglassCursor;
+ AView.BeginUpdate;
+ try
+ for i := 0 to (AView.ColumnCount - 1) do
+ begin
+ AColumn := AView.Columns[i];
+ AColumn.BestFitMaxWidth := StrToIntDef(DefAnchos.Values[AColumn.DataBinding.FieldName], 60);
+ Acolumn.MinWidth := 10;
+ if AColumn.Width > AColumn.BestFitMaxWidth then
+ AColumn.Width := AColumn.BestFitMaxWidth;
+ end;
+ finally
+ AView.EndUpdate;
+ HideHourglassCursor;
+ FreeAndNil(DefAnchos);
+ end;
+end;
+
end.
diff --git a/Source/Cliente/FactuGES.dpr b/Source/Cliente/FactuGES.dpr
index 953a0006..26dad992 100644
--- a/Source/Cliente/FactuGES.dpr
+++ b/Source/Cliente/FactuGES.dpr
@@ -1,7 +1,6 @@
program FactuGES;
uses
- ExceptionLog,
Forms,
Windows,
SysUtils,
diff --git a/Source/Cliente/FactuGES.dproj b/Source/Cliente/FactuGES.dproj
index e70a0105..07f2c461 100644
--- a/Source/Cliente/FactuGES.dproj
+++ b/Source/Cliente/FactuGES.dproj
@@ -43,7 +43,7 @@
$(BDS)\lib\Debug;$(BDS)\Lib\Debug\Indy10;T:\COMPON~1\jcl\lib\d11\debug;$(BDSCOMMONDIR)\Dcp;..\Lib;..\Modulos\Lib
$(BDS)\lib\Debug;$(BDS)\Lib\Debug\Indy10;T:\COMPON~1\jcl\lib\d11\debug;$(BDSCOMMONDIR)\Dcp;..\Lib;..\Modulos\Lib
$(BDS)\lib\Debug;$(BDS)\Lib\Debug\Indy10;T:\COMPON~1\jcl\lib\d11\debug;$(BDSCOMMONDIR)\Dcp;..\Lib;..\Modulos\Lib
- DEBUG;EUREKALOG;EUREKALOG_VER6
+ DEBUG;
True
True
3
@@ -81,7 +81,7 @@
diff --git a/Source/GUIBase/GUIBase.res b/Source/GUIBase/GUIBase.res
index 8b251f31..1641339f 100644
Binary files a/Source/GUIBase/GUIBase.res and b/Source/GUIBase/GUIBase.res differ
diff --git a/Source/GUIBase/uViewDetallesBase.dfm b/Source/GUIBase/uViewDetallesBase.dfm
index 9e883e85..85f558a3 100644
--- a/Source/GUIBase/uViewDetallesBase.dfm
+++ b/Source/GUIBase/uViewDetallesBase.dfm
@@ -64,7 +64,7 @@ inherited frViewDetallesBase: TfrViewDetallesBase
DroppedDownWidth = 145
MaxMRUCount = 0
FontName = 'Tahoma'
- ItemIndex = 35
+ ItemIndex = 40
Options = [foTrueTypeOnly, foNoOEMFonts, foScalableOnly, foWysiWyg]
Sorted = True
TabOrder = 2
diff --git a/Source/GUIBase/uViewDetallesBase.pas b/Source/GUIBase/uViewDetallesBase.pas
index 60b786f6..76546378 100644
--- a/Source/GUIBase/uViewDetallesBase.pas
+++ b/Source/GUIBase/uViewDetallesBase.pas
@@ -165,6 +165,7 @@ type
function darListaSeleccionados: TIntegerArray;
procedure TratamientoTeclas(Key: Word; Shift: TShiftState; AItem: TcxCustomGridTableItem = nil);
+ procedure BestFitAllColumns;
protected
function HayQueRecalcular(AItem: TcxCustomGridTableItem): Boolean; virtual;
function EsTipoEditable(AItem: TcxCustomGridTableItem): Boolean; virtual;
@@ -288,10 +289,38 @@ begin
and (not cxGridView.Controller.FocusedRow.IsFirst)
end;
+
+procedure TfrViewDetallesBase.BestFitAllColumns;
+var
+ i : Integer ;
+
+begin
+ ShowHourglassCursor;
+ _FocusedView.BeginUpdate;
+
+ try
+ AsignarAnchosPrefijadosAColumnas(_FocusedView);
+ for i := 0 to _FocusedView.VisibleColumnCount-1 do
+ begin
+ _FocusedView.VisibleColumns[i].ApplyBestFit;
+ if (_FocusedView.VisibleColumns[i].BestFitMaxWidth > 0) and
+ (_FocusedView.VisibleColumns[i].Width > _FocusedView.VisibleColumns[i].BestFitMaxWidth) then
+ _FocusedView.VisibleColumns[i].Width := _FocusedView.VisibleColumns[i].BestFitMaxWidth;
+ end;
+ finally
+ _FocusedView.EndUpdate;
+ HideHourglassCursor;
+ end;
+end;
+
+
+
procedure TfrViewDetallesBase.AjustarAncho;
begin
- if Assigned(_FocusedView) then
+ if Assigned(_FocusedView) then begin
+ BestFitAllColumns;
_FocusedView.ApplyBestFit;
+ end;
end;
procedure TfrViewDetallesBase.BeginUpdate;
@@ -725,7 +754,8 @@ begin
if Assigned(FDetalles) then
begin
DADataSource.DataTable := FDetalles.DataTable;
- RestoreFromIniFile; // la restauración de las columnas sólo funciona cuando hay datos.
+ //RestoreFromIniFile; // la restauración de las columnas sólo funciona cuando hay datos.
+ AjustarAncho;
end
else
DADataSource.DataTable := NIL;
diff --git a/Source/GUIBase/uViewGridBase.pas b/Source/GUIBase/uViewGridBase.pas
index fb51587a..1d53ffb4 100644
--- a/Source/GUIBase/uViewGridBase.pas
+++ b/Source/GUIBase/uViewGridBase.pas
@@ -187,6 +187,7 @@ begin
_FocusedView.BeginUpdate;
try
+ AsignarAnchosPrefijadosAColumnas(_FocusedView);
for i := 0 to _FocusedView.VisibleColumnCount-1 do
begin
_FocusedView.VisibleColumns[i].ApplyBestFit;
@@ -340,7 +341,7 @@ var
AIniFile : String;
begin
inherited;
- if Assigned(_FocusedView) then
+ {if Assigned(_FocusedView) then
begin
AIniFile := GetSpecialFolderPath(CSIDL_APPDATA); //[Current Users]\Application Data
@@ -350,7 +351,8 @@ begin
ForceDirectories(AIniFile);
_FocusedView.RestoreFromIniFile(AIniFile + 'grid.xml', True, False, []);
- end;
+ end;}
+ AjustarAncho;
end;
procedure TfrViewGridBase.RestoreFromRegistry(const Path: String);
diff --git a/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesCliente.dfm b/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesCliente.dfm
index 92d1adf0..123345bc 100644
--- a/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesCliente.dfm
+++ b/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesCliente.dfm
@@ -1,11 +1,11 @@
inherited frViewAlbaranesCliente: TfrViewAlbaranesCliente
- Width = 596
- Height = 479
- ExplicitWidth = 596
- ExplicitHeight = 479
+ Width = 1121
+ Height = 620
+ ExplicitWidth = 1121
+ ExplicitHeight = 620
inherited cxGrid: TcxGrid
- Width = 596
- Height = 351
+ Width = 1121
+ Height = 492
RootLevelOptions.DetailTabsPosition = dtpTop
OnActiveTabChanged = cxGridActiveTabChanged
ExplicitWidth = 596
@@ -69,25 +69,25 @@ inherited frViewAlbaranesCliente: TfrViewAlbaranesCliente
object cxGridViewREFERENCIA: TcxGridDBColumn
DataBinding.FieldName = 'REFERENCIA'
BestFitMaxWidth = 45
- Width = 57
+ Width = 20
end
object cxGridViewSITUACION: TcxGridDBColumn
DataBinding.FieldName = 'SITUACION'
BestFitMaxWidth = 45
- Width = 65
+ Width = 70
end
object cxGridViewFECHA_ALBARAN: TcxGridDBColumn
DataBinding.FieldName = 'FECHA_ALBARAN'
BestFitMaxWidth = 45
SortIndex = 0
SortOrder = soDescending
- Width = 68
+ Width = 94
end
object cxGridViewNOMBRE: TcxGridDBColumn
Caption = 'Cliente'
DataBinding.FieldName = 'NOMBRE'
BestFitMaxWidth = 120
- Width = 119
+ Width = 601
end
object cxGridViewREF_PEDIDO: TcxGridDBColumn
DataBinding.FieldName = 'REF_PEDIDO'
@@ -120,12 +120,12 @@ inherited frViewAlbaranesCliente: TfrViewAlbaranesCliente
object cxGridViewREF_CONTRATO: TcxGridDBColumn
DataBinding.FieldName = 'REF_CONTRATO'
BestFitMaxWidth = 45
- Width = 61
+ Width = 75
end
object cxGridViewREF_FACTURA: TcxGridDBColumn
DataBinding.FieldName = 'REF_FACTURA'
BestFitMaxWidth = 45
- Width = 61
+ Width = 73
end
object cxGridViewNOMBRE_ALMACEN: TcxGridDBColumn
DataBinding.FieldName = 'NOMBRE_ALMACEN'
@@ -171,6 +171,7 @@ inherited frViewAlbaranesCliente: TfrViewAlbaranesCliente
Properties.Alignment.Horz = taRightJustify
FooterAlignmentHorz = taRightJustify
HeaderAlignmentHorz = taRightJustify
+ Width = 78
end
end
inherited cxGridLevel: TcxGridLevel
@@ -196,45 +197,33 @@ inherited frViewAlbaranesCliente: TfrViewAlbaranesCliente
end
end
inherited frViewFiltroBase1: TfrViewFiltroBase
- Width = 596
+ Width = 1121
ExplicitWidth = 596
inherited TBXDockablePanel1: TTBXDockablePanel
ExplicitWidth = 596
inherited dxLayoutControl1: TdxLayoutControl
- Width = 596
+ Width = 1121
ExplicitWidth = 596
inherited txtFiltroTodo: TcxTextEdit
- Style.LookAndFeel.SkinName = ''
- StyleDisabled.LookAndFeel.SkinName = ''
- StyleFocused.LookAndFeel.SkinName = ''
- StyleHot.LookAndFeel.SkinName = ''
ExplicitWidth = 499
Width = 499
end
inherited edtFechaIniFiltro: TcxDateEdit
- Style.LookAndFeel.SkinName = ''
- StyleDisabled.LookAndFeel.SkinName = ''
- StyleFocused.LookAndFeel.SkinName = ''
- StyleHot.LookAndFeel.SkinName = ''
ExplicitWidth = 147
Width = 147
end
inherited edtFechaFinFiltro: TcxDateEdit
- Left = 251
- Style.LookAndFeel.SkinName = ''
- StyleDisabled.LookAndFeel.SkinName = ''
- StyleFocused.LookAndFeel.SkinName = ''
- StyleHot.LookAndFeel.SkinName = ''
- ExplicitLeft = 251
+ Left = 457
+ ExplicitLeft = 457
ExplicitWidth = 335
Width = 335
end
end
inherited TBXAlignmentPanel1: TTBXAlignmentPanel
- Width = 596
+ Width = 1121
ExplicitWidth = 596
inherited tbxBotones: TTBXToolbar
- Width = 586
+ Width = 1111
ExplicitWidth = 586
end
end
@@ -245,15 +234,15 @@ inherited frViewAlbaranesCliente: TfrViewAlbaranesCliente
end
end
inherited pnlAgrupaciones: TTBXDockablePanel
- Top = 453
+ Top = 594
Visible = True
ExplicitTop = 453
ExplicitWidth = 596
inherited TBXAlignmentPanel1: TTBXAlignmentPanel
- Width = 596
+ Width = 1121
ExplicitWidth = 596
inherited TBXToolbar1: TTBXToolbar
- Width = 586
+ Width = 1111
ExplicitWidth = 586
object TBXSeparatorItem1: TTBXSeparatorItem
end
@@ -272,13 +261,20 @@ inherited frViewAlbaranesCliente: TfrViewAlbaranesCliente
Top = 72
end
inherited dxComponentPrinter: TdxComponentPrinter
+ Left = 400
+ Top = 328
inherited dxComponentPrinterLink: TdxGridReportLink
ReportDocument.CreationDate = 39217.578907326390000000
BuiltInReportLink = True
end
end
+ inherited dxPSEngineController1: TdxPSEngineController
+ Left = 304
+ Top = 232
+ end
inherited cxViewGridPopupMenu: TcxGridPopupMenu
- Left = 280
+ Left = 272
+ Top = 192
end
inherited ActionList1: TActionList
object actClientes: TAction
@@ -294,6 +290,10 @@ inherited frViewAlbaranesCliente: TfrViewAlbaranesCliente
OnUpdate = actAlmacenesUpdate
end
end
+ inherited cxStyleRepositoryInforme: TcxStyleRepository
+ Left = 360
+ Top = 256
+ end
inherited GridPNGImageList: TPngImageList
PngImages = <
item
@@ -413,6 +413,7 @@ inherited frViewAlbaranesCliente: TfrViewAlbaranesCliente
end
inherited cxStyleRepository1: TcxStyleRepository
Left = 248
+ Top = 160
object cxStyleProximosAEnviar: TcxStyle
AssignedValues = [svColor, svTextColor]
Color = clFuchsia
diff --git a/Source/Modulos/Albaranes de cliente/Views/uViewDetallesAlbaranCliente.dfm b/Source/Modulos/Albaranes de cliente/Views/uViewDetallesAlbaranCliente.dfm
index 3f02dd73..6fc94528 100644
--- a/Source/Modulos/Albaranes de cliente/Views/uViewDetallesAlbaranCliente.dfm
+++ b/Source/Modulos/Albaranes de cliente/Views/uViewDetallesAlbaranCliente.dfm
@@ -1,6 +1,99 @@
inherited frViewDetallesAlbaranCliente: TfrViewDetallesAlbaranCliente
+ Width = 1016
+ Height = 639
+ inherited ToolBar1: TToolBar
+ Width = 1016
+ Height = 24
+ inherited ToolButton4: TToolButton
+ Wrap = False
+ end
+ inherited ToolButton14: TToolButton
+ Left = 334
+ Top = 0
+ ExplicitLeft = 334
+ ExplicitTop = 0
+ end
+ inherited FontName: TJvFontComboBox
+ Left = 368
+ Top = 0
+ ExplicitLeft = 368
+ ExplicitTop = 0
+ end
+ inherited FontSize: TEdit
+ Left = 513
+ Top = 0
+ ExplicitLeft = 513
+ ExplicitTop = 0
+ end
+ inherited UpDown1: TUpDown
+ Left = 555
+ Top = 0
+ ExplicitLeft = 555
+ ExplicitTop = 0
+ end
+ inherited ToolButton13: TToolButton
+ Left = 572
+ Top = 0
+ ExplicitLeft = 572
+ ExplicitTop = 0
+ end
+ inherited ToolButton6: TToolButton
+ Left = 580
+ Top = 0
+ ExplicitLeft = 580
+ ExplicitTop = 0
+ end
+ inherited ToolButton7: TToolButton
+ Left = 614
+ Top = 0
+ ExplicitLeft = 614
+ ExplicitTop = 0
+ end
+ inherited ToolButton8: TToolButton
+ Left = 648
+ Top = 0
+ ExplicitLeft = 648
+ ExplicitTop = 0
+ end
+ inherited ToolButton12: TToolButton
+ Left = 682
+ Top = 0
+ ExplicitLeft = 682
+ ExplicitTop = 0
+ end
+ inherited ToolButton9: TToolButton
+ Left = 690
+ Top = 0
+ ExplicitLeft = 690
+ ExplicitTop = 0
+ end
+ inherited ToolButton10: TToolButton
+ Left = 724
+ Top = 0
+ ExplicitLeft = 724
+ ExplicitTop = 0
+ end
+ inherited ToolButton11: TToolButton
+ Left = 758
+ Top = 0
+ ExplicitLeft = 758
+ ExplicitTop = 0
+ end
+ end
inherited cxGrid: TcxGrid
+ Top = 50
+ Width = 1016
+ Height = 589
inherited cxGridView: TcxGridDBTableView
+ inherited cxGridViewDESCRIPCION: TcxGridDBColumn
+ Width = 752
+ end
+ inherited cxGridViewCANTIDAD: TcxGridDBColumn
+ Width = 68
+ end
+ inherited cxGridViewIMPORTEUNIDAD: TcxGridDBColumn
+ Width = 97
+ end
inherited cxGridViewDESCUENTO: TcxGridDBColumn
Visible = False
VisibleForCustomization = False
@@ -9,6 +102,16 @@ inherited frViewDetallesAlbaranCliente: TfrViewDetallesAlbaranCliente
Visible = False
VisibleForCustomization = False
end
+ inherited cxGridViewIMPORTETOTAL: TcxGridDBColumn
+ Width = 83
+ end
+ end
+ end
+ inherited TBXDock1: TTBXDock
+ Top = 24
+ Width = 1016
+ inherited TBXToolbar1: TTBXToolbar
+ ExplicitWidth = 548
end
end
end
diff --git a/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.dfm b/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.dfm
index 05424f4e..dee451bc 100644
--- a/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.dfm
+++ b/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.dfm
@@ -1,5 +1,89 @@
inherited frViewDetallesContratoCliente: TfrViewDetallesContratoCliente
+ Width = 975
+ Height = 494
+ inherited ToolBar1: TToolBar
+ Width = 975
+ Height = 24
+ inherited ToolButton4: TToolButton
+ Wrap = False
+ end
+ inherited ToolButton14: TToolButton
+ Left = 334
+ Top = 0
+ ExplicitLeft = 334
+ ExplicitTop = 0
+ end
+ inherited FontName: TJvFontComboBox
+ Left = 368
+ Top = 0
+ ExplicitLeft = 368
+ ExplicitTop = 0
+ end
+ inherited FontSize: TEdit
+ Left = 513
+ Top = 0
+ ExplicitLeft = 513
+ ExplicitTop = 0
+ end
+ inherited UpDown1: TUpDown
+ Left = 555
+ Top = 0
+ ExplicitLeft = 555
+ ExplicitTop = 0
+ end
+ inherited ToolButton13: TToolButton
+ Left = 572
+ Top = 0
+ ExplicitLeft = 572
+ ExplicitTop = 0
+ end
+ inherited ToolButton6: TToolButton
+ Left = 580
+ Top = 0
+ ExplicitLeft = 580
+ ExplicitTop = 0
+ end
+ inherited ToolButton7: TToolButton
+ Left = 614
+ Top = 0
+ ExplicitLeft = 614
+ ExplicitTop = 0
+ end
+ inherited ToolButton8: TToolButton
+ Left = 648
+ Top = 0
+ ExplicitLeft = 648
+ ExplicitTop = 0
+ end
+ inherited ToolButton12: TToolButton
+ Left = 682
+ Top = 0
+ ExplicitLeft = 682
+ ExplicitTop = 0
+ end
+ inherited ToolButton9: TToolButton
+ Left = 690
+ Top = 0
+ ExplicitLeft = 690
+ ExplicitTop = 0
+ end
+ inherited ToolButton10: TToolButton
+ Left = 724
+ Top = 0
+ ExplicitLeft = 724
+ ExplicitTop = 0
+ end
+ inherited ToolButton11: TToolButton
+ Left = 758
+ Top = 0
+ ExplicitLeft = 758
+ ExplicitTop = 0
+ end
+ end
inherited cxGrid: TcxGrid
+ Top = 50
+ Width = 975
+ Height = 444
inherited cxGridView: TcxGridDBTableView
inherited cxGridViewID_ARTICULO: TcxGridDBColumn
Width = 57
@@ -11,10 +95,12 @@ inherited frViewDetallesContratoCliente: TfrViewDetallesContratoCliente
end
inherited cxGridViewVISIBLE2: TcxGridDBColumn [5]
Visible = True
+ BestFitMaxWidth = 20
end
inherited cxGridViewVISIBLE: TcxGridDBColumn [6]
Caption = #191'Valorado?'
Visible = True
+ BestFitMaxWidth = 20
end
object cxGridViewPROPIEDAD: TcxGridDBColumn [7]
Caption = 'Propiedad'
@@ -58,7 +144,10 @@ inherited frViewDetallesContratoCliente: TfrViewDetallesContratoCliente
end
end
inherited TBXDock1: TTBXDock
+ Top = 24
+ Width = 975
inherited TBXToolbar1: TTBXToolbar
+ ExplicitWidth = 663
object TBXSubmenuItem1: TTBXSubmenuItem [0]
Caption = 'A'#241'adir cap'#237'tulo'
DisplayMode = nbdmImageAndText