diff --git a/Database/scripts/factuges.sql b/Database/scripts/factuges.sql index dfd6bf95..2cd3f5e6 100644 --- a/Database/scripts/factuges.sql +++ b/Database/scripts/factuges.sql @@ -2833,6 +2833,9 @@ GROUP BY ID_ALMACEN, ARTICULOS.REFERENCIA_FABR, ARTICULOS.UNIDAD_MEDIDA /* ARTICULOS.PRECIO_NETO*/ + +/*QUITAMOS AQUELLAS TUPLAS DE LAS QUE NO TENEMOS UNIDADES EN EL ALAMCEN, NO HAY RESERVAS NI PEDIDOS PENDIENTES DE RECIBIR*/ +HAVING ((SUM(STOCK) <> 0 ) OR (SUM(RESERVA) <> 0) OR (SUM(PENDIENTE_RECEPCION) <> 0)) ; diff --git a/Source/Modulos/Articulos/Views/uEditorArticulos.dfm b/Source/Modulos/Articulos/Views/uEditorArticulos.dfm index ceff9b92..dceeeb0d 100644 --- a/Source/Modulos/Articulos/Views/uEditorArticulos.dfm +++ b/Source/Modulos/Articulos/Views/uEditorArticulos.dfm @@ -33,7 +33,7 @@ inherited fEditorArticulos: TfEditorArticulos Width = 657 ExplicitWidth = 657 inherited tbxMain: TTBXToolbar - ExplicitWidth = 632 + ExplicitWidth = 657 end inherited tbxFiltro: TTBXToolbar inherited tbxEditFiltro: TTBXEditItem @@ -56,7 +56,7 @@ inherited fEditorArticulos: TfEditorArticulos Left = 3 Top = 105 Width = 651 - Height = 317 + Height = 377 ActivePage = pagArticulos Align = alClient TabOrder = 3 @@ -67,7 +67,7 @@ inherited fEditorArticulos: TfEditorArticulos Left = 0 Top = 0 Width = 643 - Height = 289 + Height = 349 Align = alClient Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText @@ -78,12 +78,12 @@ inherited fEditorArticulos: TfEditorArticulos TabOrder = 0 ReadOnly = False ExplicitWidth = 643 - ExplicitHeight = 289 + ExplicitHeight = 349 inherited cxGrid: TcxGrid Width = 643 - Height = 161 + Height = 221 ExplicitWidth = 643 - ExplicitHeight = 161 + ExplicitHeight = 221 inherited cxGridView: TcxGridDBTableView DataController.Summary.FooterSummaryItems = < item @@ -102,10 +102,30 @@ inherited fEditorArticulos: TfEditorArticulos Width = 643 ExplicitWidth = 643 inherited txtFiltroTodo: TcxTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 567 Width = 567 end + inherited edtFechaIniFiltro: TcxDateEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + end + inherited edtFechaFinFiltro: TcxDateEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + end inherited eLista: TcxComboBox + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 20 Width = 20 end @@ -121,8 +141,8 @@ inherited fEditorArticulos: TfEditorArticulos end end inherited pnlAgrupaciones: TTBXDockablePanel - Top = 263 - ExplicitTop = 263 + Top = 323 + ExplicitTop = 323 ExplicitWidth = 643 inherited TBXAlignmentPanel1: TTBXAlignmentPanel Width = 643 @@ -156,7 +176,7 @@ inherited fEditorArticulos: TfEditorArticulos Left = 0 Top = 0 Width = 643 - Height = 289 + Height = 349 Align = alClient Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText @@ -167,10 +187,10 @@ inherited fEditorArticulos: TfEditorArticulos TabOrder = 0 ReadOnly = False ExplicitWidth = 643 - ExplicitHeight = 289 + ExplicitHeight = 349 inherited cxGrid: TcxGrid Width = 643 - Height = 161 + Height = 221 ExplicitWidth = 643 ExplicitHeight = 161 inherited cxGridView: TcxGridDBTableView @@ -191,10 +211,30 @@ inherited fEditorArticulos: TfEditorArticulos Width = 643 ExplicitWidth = 643 inherited txtFiltroTodo: TcxTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 567 Width = 567 end + inherited edtFechaIniFiltro: TcxDateEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + end + inherited edtFechaFinFiltro: TcxDateEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + end inherited eLista: TcxComboBox + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 20 Width = 20 end @@ -210,7 +250,7 @@ inherited fEditorArticulos: TfEditorArticulos end end inherited pnlAgrupaciones: TTBXDockablePanel - Top = 263 + Top = 323 ExplicitTop = 263 ExplicitWidth = 643 inherited TBXAlignmentPanel1: TTBXAlignmentPanel diff --git a/Source/Modulos/Articulos/Views/uEditorArticulos.pas b/Source/Modulos/Articulos/Views/uEditorArticulos.pas index 0a19053f..90a60b0b 100644 --- a/Source/Modulos/Articulos/Views/uEditorArticulos.pas +++ b/Source/Modulos/Articulos/Views/uEditorArticulos.pas @@ -208,12 +208,20 @@ begin end; procedure TfEditorArticulos.SetViewGrid(const Value: IViewGridBase); +var + APosicionarAlprincipio: Boolean; + begin inherited; + + APosicionarAlprincipio := False; case pgPaginas.ActivePage.TabIndex of 0: begin if not Assigned(Articulos) then + begin + APosicionarAlprincipio := True; Articulos := FController.BuscarTodos; + end; Articulos.DataTable.Active := True; if actFiltrar.Checked then @@ -237,7 +245,10 @@ begin end; 1: begin if not Assigned(ArticulosPorProveedor) then + begin + APosicionarAlprincipio := True; ArticulosPorProveedor := FController.BuscarTodosPorProveedor; + end; ArticulosPorProveedor.DataTable.Active := True; if actFiltrar.Checked then @@ -258,6 +269,9 @@ begin end; end; end; + + if APosicionarAlprincipio then + ViewGrid._FocusedView.DataController.GotoFirst; end; destructor TfEditorArticulos.Destroy; diff --git a/Source/Modulos/Articulos/Views/uViewArticulos.dfm b/Source/Modulos/Articulos/Views/uViewArticulos.dfm index d1924bd0..43d5ada9 100644 --- a/Source/Modulos/Articulos/Views/uViewArticulos.dfm +++ b/Source/Modulos/Articulos/Views/uViewArticulos.dfm @@ -38,6 +38,8 @@ inherited frViewArticulos: TfrViewArticulos end object cxGridViewREFERENCIA: TcxGridDBColumn DataBinding.FieldName = 'REFERENCIA' + SortIndex = 0 + SortOrder = soAscending end object cxGridViewDESCRIPCION: TcxGridDBColumn DataBinding.FieldName = 'DESCRIPCION' @@ -74,12 +76,32 @@ inherited frViewArticulos: TfrViewArticulos Width = 715 ExplicitWidth = 715 inherited txtFiltroTodo: TcxTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 618 Width = 618 end + inherited edtFechaIniFiltro: TcxDateEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + end + inherited edtFechaFinFiltro: TcxDateEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + end inherited eLista: TcxComboBox Properties.DropDownRows = 20 Properties.OnChange = frViewFiltroBase1eListaPropertiesChange + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 71 Width = 71 end diff --git a/Source/Modulos/Articulos/Views/uViewArticulosPorProveedor.dfm b/Source/Modulos/Articulos/Views/uViewArticulosPorProveedor.dfm index e42a1c3c..7da8c4e1 100644 --- a/Source/Modulos/Articulos/Views/uViewArticulosPorProveedor.dfm +++ b/Source/Modulos/Articulos/Views/uViewArticulosPorProveedor.dfm @@ -81,6 +81,8 @@ inherited frViewArticulosPorProveedor: TfrViewArticulosPorProveedor Caption = 'Referencia' DataBinding.FieldName = 'REFERENCIA' BestFitMaxWidth = 60 + SortIndex = 0 + SortOrder = soAscending Width = 60 end object cxGridViewFABRICANTE: TcxGridDBColumn diff --git a/Source/Modulos/Historico de movimientos/Views/uViewHistoricoMovimientos.dfm b/Source/Modulos/Historico de movimientos/Views/uViewHistoricoMovimientos.dfm index b4abc2fd..4d449d43 100644 --- a/Source/Modulos/Historico de movimientos/Views/uViewHistoricoMovimientos.dfm +++ b/Source/Modulos/Historico de movimientos/Views/uViewHistoricoMovimientos.dfm @@ -1,6 +1,5 @@ inherited frViewHistoricoMovimientos: TfrViewHistoricoMovimientos inherited cxGrid: TcxGrid - RootLevelOptions.DetailTabsPosition = dtpTop OnActiveTabChanged = cxGridActiveTabChanged inherited cxGridView: TcxGridDBTableView DataController.KeyFieldNames = 'RecID' @@ -32,6 +31,8 @@ inherited frViewHistoricoMovimientos: TfrViewHistoricoMovimientos end object cxGridViewFECHA: TcxGridDBColumn DataBinding.FieldName = 'FECHA' + SortIndex = 0 + SortOrder = soDescending Width = 60 end object cxGridViewTIPO_MOVIMIENTO: TcxGridDBColumn @@ -86,6 +87,7 @@ inherited frViewHistoricoMovimientos: TfrViewHistoricoMovimientos Width = 41 end object cxGridViewNOMBRE_ALMACEN: TcxGridDBColumn + Caption = 'Almac'#233'n/Obra' DataBinding.FieldName = 'NOMBRE_ALMACEN' Width = 42 end diff --git a/Source/Modulos/Historico de movimientos/Views/uViewHistoricoMovimientos.pas b/Source/Modulos/Historico de movimientos/Views/uViewHistoricoMovimientos.pas index 96c444f9..b28bf3f5 100644 --- a/Source/Modulos/Historico de movimientos/Views/uViewHistoricoMovimientos.pas +++ b/Source/Modulos/Historico de movimientos/Views/uViewHistoricoMovimientos.pas @@ -149,7 +149,7 @@ var Nivel: TcxGridLevel; begin FAlmacenes := Value; - +{ if Assigned(FAlmacenes) then begin if not FAlmacenes.DataTable.Active then @@ -164,6 +164,7 @@ begin FAlmacenes.Next; end; end; +} end; procedure TfrViewHistoricoMovimientos.SetHistoricoMovimientos(const Value: IBizHistoricoMovimientos); diff --git a/Source/Modulos/Inventario/Views/uViewDetalleReservas.dfm b/Source/Modulos/Inventario/Views/uViewDetalleReservas.dfm index 5fd0638b..7e4ef690 100644 --- a/Source/Modulos/Inventario/Views/uViewDetalleReservas.dfm +++ b/Source/Modulos/Inventario/Views/uViewDetalleReservas.dfm @@ -3,6 +3,8 @@ inherited frViewDetalleReservas: TfrViewDetalleReservas inherited cxGrid: TcxGrid Top = 143 Height = 272 + ExplicitTop = 143 + ExplicitHeight = 272 inherited cxGridView: TcxGridDBTableView DataController.KeyFieldNames = 'RecID' DataController.Summary.DefaultGroupSummaryItems = < @@ -77,6 +79,8 @@ inherited frViewDetalleReservas: TfrViewDetalleReservas object cxGridViewREFERENCIA: TcxGridDBColumn Caption = 'Referencia' DataBinding.FieldName = 'REFERENCIA' + SortIndex = 0 + SortOrder = soAscending end object cxGridViewDESCRIPCION: TcxGridDBColumn Caption = 'Descripci'#243'n' @@ -164,6 +168,8 @@ inherited frViewDetalleReservas: TfrViewDetalleReservas StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 383 + ExplicitWidth = 215 + Width = 215 end end end @@ -175,8 +181,6 @@ inherited frViewDetalleReservas: TfrViewDetalleReservas Height = 41 Align = alTop TabOrder = 3 - ExplicitLeft = -71 - ExplicitWidth = 678 DesignSize = ( 607 41) @@ -204,7 +208,6 @@ inherited frViewDetalleReservas: TfrViewDetalleReservas StyleHot.LookAndFeel.Kind = lfStandard StyleHot.LookAndFeel.NativeStyle = True TabOrder = 0 - ExplicitWidth = 581 Width = 510 end end diff --git a/Source/Modulos/Inventario/Views/uViewInventario.dfm b/Source/Modulos/Inventario/Views/uViewInventario.dfm index f2e9be84..75dd435c 100644 --- a/Source/Modulos/Inventario/Views/uViewInventario.dfm +++ b/Source/Modulos/Inventario/Views/uViewInventario.dfm @@ -54,6 +54,7 @@ inherited frViewInventario: TfrViewInventario Kind = skSum Column = cxGridViewPENDIENTE_RECEPCION end> + DataController.OnCompare = cxGridViewDataControllerCompare object cxGridViewID: TcxGridDBColumn DataBinding.FieldName = 'ID' Visible = False @@ -78,6 +79,8 @@ inherited frViewInventario: TfrViewInventario Caption = 'Referencia' DataBinding.FieldName = 'REFERENCIA' MinWidth = 30 + SortIndex = 0 + SortOrder = soAscending end object cxGridViewREFERENCIA_PROVEEDOR: TcxGridDBColumn Caption = 'Ref. proveedor' @@ -179,6 +182,8 @@ inherited frViewInventario: TfrViewInventario StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' + ExplicitWidth = 510 + Width = 510 end inherited edtFechaIniFiltro: TcxDateEdit Style.LookAndFeel.SkinName = '' @@ -197,6 +202,8 @@ inherited frViewInventario: TfrViewInventario StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' + ExplicitWidth = 215 + Width = 215 end end inherited TBXAlignmentPanel1: TTBXAlignmentPanel diff --git a/Source/Modulos/Inventario/Views/uViewInventario.pas b/Source/Modulos/Inventario/Views/uViewInventario.pas index 7e28923d..62609993 100644 --- a/Source/Modulos/Inventario/Views/uViewInventario.pas +++ b/Source/Modulos/Inventario/Views/uViewInventario.pas @@ -60,6 +60,9 @@ type AStyle: TcxStyle); procedure cxListaObrasPropertiesEditValueChanged(Sender: TObject); procedure CustomViewShow(Sender: TObject); + procedure cxGridViewDataControllerCompare( + ADataController: TcxCustomDataController; ARecordIndex1, ARecordIndex2, + AItemIndex: Integer; const V1, V2: Variant; var Compare: Integer); private //Filtros relativos a la vista @@ -86,7 +89,7 @@ type implementation {$R *.dfm} -uses uDataModuleInventario, schInventarioClient_Intf; +uses uDataModuleInventario, schInventarioClient_Intf, uReferenciasUtils, cxVariants; procedure TfrViewInventario.AnadirFiltroAlmacenesObras; var @@ -129,6 +132,18 @@ begin pnlAlmacenes.Visible:= False; end; +procedure TfrViewInventario.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 TfrViewInventario.cxGridViewStylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle); diff --git a/Source/Modulos/Recibos de cliente/Views/uViewRecibosCliente.dfm b/Source/Modulos/Recibos de cliente/Views/uViewRecibosCliente.dfm index 2fb72dd8..a3b41ae4 100644 --- a/Source/Modulos/Recibos de cliente/Views/uViewRecibosCliente.dfm +++ b/Source/Modulos/Recibos de cliente/Views/uViewRecibosCliente.dfm @@ -47,6 +47,8 @@ inherited frViewRecibosCliente: TfrViewRecibosCliente object cxGridViewREFERENCIA: TcxGridDBColumn Caption = 'Referencia' DataBinding.FieldName = 'REFERENCIA' + SortIndex = 0 + SortOrder = soDescending Width = 64 end object cxGridViewID_RECIBO_COMPENSADO: TcxGridDBColumn @@ -188,10 +190,12 @@ inherited frViewRecibosCliente: TfrViewRecibosCliente Width = 222 end inherited eLista: TcxComboBox + Left = 558 Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' + ExplicitLeft = 558 ExplicitWidth = 215 Width = 215 end diff --git a/Source/Modulos/Recibos de proveedor/Views/uViewRecibosProveedor.dfm b/Source/Modulos/Recibos de proveedor/Views/uViewRecibosProveedor.dfm index 192f0a67..66aa9fd4 100644 --- a/Source/Modulos/Recibos de proveedor/Views/uViewRecibosProveedor.dfm +++ b/Source/Modulos/Recibos de proveedor/Views/uViewRecibosProveedor.dfm @@ -47,6 +47,8 @@ inherited frViewRecibosProveedor: TfrViewRecibosProveedor object cxGridViewREFERENCIA: TcxGridDBColumn Caption = 'Referencia' DataBinding.FieldName = 'REFERENCIA' + SortIndex = 0 + SortOrder = soDescending Width = 71 end object cxGridViewID_RECIBO_COMPENSADO: TcxGridDBColumn