diff --git a/Database/scripts/factuges.sql b/Database/scripts/factuges.sql index 5abaa879..5883cc8b 100644 --- a/Database/scripts/factuges.sql +++ b/Database/scripts/factuges.sql @@ -3105,6 +3105,9 @@ ALTER TABLE PAGOS_CLIENTE ADD CONSTRAINT FK_PAGOS_CLIENTE FOREIGN KEY (ID_RECIBO ALTER TABLE PAGOS_PROVEEDOR ADD CONSTRAINT FK_PAGOS_PROVEEDOR FOREIGN KEY (ID_RECIBO) REFERENCES RECIBOS_PROVEEDOR (ID); ALTER TABLE PEDIDOS_CLIENTE ADD CONSTRAINT FK_PEDIDOS_CLIENTE FOREIGN KEY (ID_CLIENTE) REFERENCES CONTACTOS (ID); ALTER TABLE PEDIDOS_CLIENTE ADD CONSTRAINT FK_PEDIDOS_CLIENTE_ID_EMPRESA FOREIGN KEY (ID_EMPRESA) REFERENCES EMPRESAS (ID); +ALTER TABLE PRESUPUESTOS_CLIENTE ADD CONSTRAINT FK_PRESUPUESTOS_CLIENTE_1 FOREIGN KEY (ID_EMPRESA) REFERENCES EMPRESAS (ID); +ALTER TABLE PRESUPUESTOS_CLIENTE ADD CONSTRAINT FK_PRESUPUESTOS_CLIENTE_2 FOREIGN KEY (ID_CLIENTE) REFERENCES CONTACTOS (ID); +ALTER TABLE PRESUPUESTOS_CLIENTE ADD CONSTRAINT FK_PRESUPUESTOS_CLIENTE_3 FOREIGN KEY (ID_FACTURA) REFERENCES FACTURAS_CLIENTE (ID) ON DELETE SET NULL ON UPDATE SET NULL; ALTER TABLE PEDIDOS_PROVEEDOR ADD CONSTRAINT FK_PEDIDOS_PROVEEDOR FOREIGN KEY (ID_EMPRESA) REFERENCES EMPRESAS (ID); ALTER TABLE PEDIDOS_PROVEEDOR ADD CONSTRAINT FK_PEDIDOS_PROVEEDOR2 FOREIGN KEY (ID_PROVEEDOR) REFERENCES CONTACTOS (ID); ALTER TABLE RECIBOS_CLIENTE ADD CONSTRAINT FK_RECIBOS_CLIENTE FOREIGN KEY (ID_FACTURA) REFERENCES FACTURAS_CLIENTE (ID) ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/Source/Cliente/FactuGES.rc b/Source/Cliente/FactuGES.rc index aa8cfae5..855f2de1 100644 --- a/Source/Cliente/FactuGES.rc +++ b/Source/Cliente/FactuGES.rc @@ -1,7 +1,7 @@ MAINICON ICON "C:\Codigo Tecsitel\Resources\Iconos\Factuges.ico" 1 VERSIONINFO -FILEVERSION 1,2,1,0 -PRODUCTVERSION 1,2,1,0 +FILEVERSION 1,2,2,0 +PRODUCTVERSION 1,2,2,0 FILEFLAGSMASK 0x3FL FILEFLAGS 0x00L FILEOS 0x40004L @@ -13,10 +13,10 @@ BEGIN BLOCK "0C0A04E4" BEGIN VALUE "CompanyName", "Rodax Software S.L.\0" - VALUE "FileVersion", "1.2.1.0\0" + VALUE "FileVersion", "1.2.2.0\0" VALUE "InternalName", "FactuGES\0" VALUE "ProductName", "FactuGES\0" - VALUE "ProductVersion", "1.2.1.0\0" + VALUE "ProductVersion", "1.2.2.0\0" END END BLOCK "VarFileInfo" diff --git a/Source/Cliente/FactuGES.res b/Source/Cliente/FactuGES.res index aae74914..7918e903 100644 Binary files a/Source/Cliente/FactuGES.res and b/Source/Cliente/FactuGES.res differ diff --git a/Source/Modulos/Albaranes de cliente/Controller/uAlbaranesClienteController.pas b/Source/Modulos/Albaranes de cliente/Controller/uAlbaranesClienteController.pas index 2ac004ea..ab01640c 100644 --- a/Source/Modulos/Albaranes de cliente/Controller/uAlbaranesClienteController.pas +++ b/Source/Modulos/Albaranes de cliente/Controller/uAlbaranesClienteController.pas @@ -444,7 +444,7 @@ begin if (AAlbaran.Detalles.DataTable.State in dsEditModes) then AAlbaran.Detalles.DataTable.Post; - if (AAlbaran.ID_Cliente < 0) or (AAlbaran.ID_Cliente = 0) then + if (AAlbaran.ID_Cliente <= 0) then // Si hay altas automáticas no hay objeto Cliente pero sí hay ID_CLIENTE { (not Assigned(AAlbaran.Cliente)) or (AAlbaran.Cliente.IsEmpty) then} diff --git a/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranesCliente.dfm b/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranesCliente.dfm index 97fe06be..3df900c1 100644 --- a/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranesCliente.dfm +++ b/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranesCliente.dfm @@ -2,6 +2,7 @@ inherited fEditorAlbaranesCliente: TfEditorAlbaranesCliente Caption = 'Lista de albaranes de cliente' ClientWidth = 583 ExplicitWidth = 591 + ExplicitHeight = 240 PixelsPerInch = 96 TextHeight = 13 inherited JvNavPanelHeader: TJvNavPanelHeader diff --git a/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranesCliente.pas b/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranesCliente.pas index 84285e12..2818ff32 100644 --- a/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranesCliente.pas +++ b/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranesCliente.pas @@ -186,7 +186,7 @@ end; procedure TfEditorAlbaranesCliente.actGenerarFacturaExecute(Sender: TObject); begin - GenerarFacturaCli(Albaranes.ID); + GenerarFacturaCliAlb(Albaranes.ID); actRefrescar.Execute; end; diff --git a/Source/Modulos/Articulos/Views/uViewArticulosProveedores.dfm b/Source/Modulos/Articulos/Views/uViewArticulosProveedores.dfm index be2eba93..b608632e 100644 --- a/Source/Modulos/Articulos/Views/uViewArticulosProveedores.dfm +++ b/Source/Modulos/Articulos/Views/uViewArticulosProveedores.dfm @@ -76,6 +76,8 @@ inherited frViewArticulosProveedores: TfrViewArticulosProveedores end object cxGridViewID_ARTICULO: TcxGridDBColumn DataBinding.FieldName = 'ID_ARTICULO' + Visible = False + VisibleForCustomization = False end end end diff --git a/Source/Modulos/Articulos/Views/uViewDetallesArticulosParaVenta.dfm b/Source/Modulos/Articulos/Views/uViewDetallesArticulosParaVenta.dfm index bd426504..893d0208 100644 --- a/Source/Modulos/Articulos/Views/uViewDetallesArticulosParaVenta.dfm +++ b/Source/Modulos/Articulos/Views/uViewDetallesArticulosParaVenta.dfm @@ -1,73 +1,93 @@ inherited frViewDetallesArticulosParaVenta: TfrViewDetallesArticulosParaVenta inherited ToolBar1: TToolBar - inherited FontName: TJvFontComboBox [4] - Left = 114 + Height = 73 + ExplicitHeight = 73 + inherited ToolButton3: TToolButton + Wrap = False + end + inherited ToolButton4: TToolButton + Left = 278 + Top = 0 + ExplicitLeft = 278 + ExplicitTop = 0 + end + inherited ToolButton14: TToolButton + Left = 334 + Top = 0 + ExplicitLeft = 334 + ExplicitTop = 0 + end + inherited FontName: TJvFontComboBox Top = 22 - ExplicitLeft = 114 ExplicitTop = 22 end - inherited FontSize: TEdit [5] - Left = 259 + inherited FontSize: TEdit Top = 22 - ExplicitLeft = 259 ExplicitTop = 22 end - inherited ToolButton6: TToolButton [6] - Left = 301 - ExplicitLeft = 301 - end - inherited UpDown1: TUpDown [7] - Left = 367 + inherited UpDown1: TUpDown Top = 22 - ExplicitLeft = 367 ExplicitTop = 22 end - inherited ToolButton13: TToolButton [8] - Left = 384 - ExplicitLeft = 384 + inherited ToolButton13: TToolButton + Top = 22 + ExplicitTop = 22 end - inherited ToolButton14: TToolButton [9] - Left = 392 - ExplicitLeft = 392 + inherited ToolButton6: TToolButton + Top = 22 + ExplicitTop = 22 end - inherited ToolButton12: TToolButton [10] + inherited ToolButton7: TToolButton + Top = 22 + ExplicitTop = 22 end - inherited ToolButton9: TToolButton [11] + inherited ToolButton8: TToolButton + Top = 22 + ExplicitTop = 22 + end + inherited ToolButton12: TToolButton + Left = 0 + Top = 22 + Wrap = True + ExplicitLeft = 0 + ExplicitTop = 22 + ExplicitHeight = 27 + end + inherited ToolButton9: TToolButton Left = 0 Top = 49 ExplicitLeft = 0 ExplicitTop = 49 end - inherited ToolButton8: TToolButton [12] + inherited ToolButton10: TToolButton Left = 145 Top = 49 - Wrap = True ExplicitLeft = 145 ExplicitTop = 49 end - inherited ToolButton10: TToolButton [13] - Left = 0 - Top = 71 - Wrap = False - ExplicitLeft = 0 - ExplicitTop = 71 - end - inherited ToolButton7: TToolButton [14] - Left = 125 - Top = 71 - ExplicitLeft = 125 - ExplicitTop = 71 - end - inherited ToolButton11: TToolButton [15] - Left = 192 - ExplicitLeft = 192 + inherited ToolButton11: TToolButton + Left = 270 + Top = 49 + ExplicitLeft = 270 + ExplicitTop = 49 end end inherited cxGrid: TcxGrid - ExplicitTop = 99 - ExplicitHeight = 205 + Top = 99 + Height = 205 + inherited cxGridView: TcxGridDBTableView + inherited cxGridViewREFERENCIA_PROVEEDOR: TcxGridDBColumn + Visible = False + VisibleForCustomization = False + end + inherited cxGridViewREFERENCIA_FABRICANTE: TcxGridDBColumn + Visible = False + VisibleForCustomization = False + end + end end inherited TBXDock1: TTBXDock + Top = 73 ExplicitTop = 73 end end diff --git a/Source/Modulos/Facturas de cliente/FacturasCliente_Group.groupproj b/Source/Modulos/Facturas de cliente/FacturasCliente_Group.groupproj index ca82446e..6e974d46 100644 --- a/Source/Modulos/Facturas de cliente/FacturasCliente_Group.groupproj +++ b/Source/Modulos/Facturas de cliente/FacturasCliente_Group.groupproj @@ -9,6 +9,7 @@ + @@ -18,7 +19,9 @@ + + @@ -211,14 +214,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + \ No newline at end of file diff --git a/Source/Modulos/Facturas de cliente/Views/FacturasCliente_view.dpk b/Source/Modulos/Facturas de cliente/Views/FacturasCliente_view.dpk index 087467d3..e93941aa 100644 Binary files a/Source/Modulos/Facturas de cliente/Views/FacturasCliente_view.dpk and b/Source/Modulos/Facturas de cliente/Views/FacturasCliente_view.dpk differ diff --git a/Source/Modulos/Facturas de cliente/Views/FacturasCliente_view.dproj b/Source/Modulos/Facturas de cliente/Views/FacturasCliente_view.dproj index 19da501b..c5c52675 100644 --- a/Source/Modulos/Facturas de cliente/Views/FacturasCliente_view.dproj +++ b/Source/Modulos/Facturas de cliente/Views/FacturasCliente_view.dproj @@ -54,6 +54,7 @@ +
fEditorElegirArticulosFacturaCliente
TForm diff --git a/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.dfm b/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.dfm index a7b36a22..02938df3 100644 --- a/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.dfm +++ b/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.dfm @@ -60,9 +60,6 @@ inherited fEditorFacturasCliente: TfEditorFacturasCliente inherited tbxMenu: TTBXToolbar ExplicitWidth = 640 end - inherited TBXTMain2: TTBXToolbar - Visible = True - end end inherited StatusBar: TJvStatusBar Top = 647 @@ -136,31 +133,25 @@ inherited fEditorFacturasCliente: TfEditorFacturasCliente Width = 640 ExplicitWidth = 640 inherited txtFiltroTodo: TcxTextEdit - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitWidth = 543 - Width = 543 + ExplicitWidth = 600 + Width = 600 end inherited edtFechaIniFiltro: TcxDateEdit - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 263 Width = 263 end inherited edtFechaFinFiltro: TcxDateEdit Left = 367 - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 367 ExplicitWidth = 263 Width = 263 end + inherited eLista: TcxComboBox + Left = 667 + ExplicitLeft = 667 + ExplicitWidth = 20 + Width = 20 + end end inherited TBXAlignmentPanel1: TTBXAlignmentPanel Width = 640 @@ -1858,8 +1849,16 @@ inherited fEditorFacturasCliente: TfEditorFacturasCliente Default = True end item - Caption = 'Utilizar uno o m'#225's albaranes de cliente.' + Caption = 'Utilizar uno o m'#225's presupuestos de cliente.' Value = 200 + Info.Strings = ( + + 'Puede utilizar uno o m'#225's presupuestos existentes para dar de alt' + + 'a una factura nueva.') + end + item + Caption = 'Utilizar uno o m'#225's albaranes de cliente.' + Value = 300 Info.Strings = ( 'Puede utilizar uno o m'#225's albaranes existentes para dar de alta l' + diff --git a/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.pas b/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.pas index a65560b9..2256e7ae 100644 --- a/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.pas +++ b/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.pas @@ -72,8 +72,7 @@ implementation uses uDataModuleFacturasCliente, uDataModuleUsuarios, uAlbaranesClienteController, uFactuGES_App, -// uPedidosClienteController, uBizPedidosCliente, - uGenerarFacturasCliAlbCliUtils, + uGenerarFacturasCliAlbCliUtils, uGenerarFacturasCliPreCliUtils, uBizAlbaranesCliente, uEditorBase, uGridStatusUtils, uDBSelectionListUtils, udialogUtils; @@ -294,24 +293,12 @@ begin if Respuesta <> IDCANCEL then begin case JsNuevaFacturaDialog.CustomButtonResult of - 300 : begin // Utilizar un pedido - ShowMessage('A COMPLETAR'); - {FPedidosClienteController := TPedidosClienteController.Create; - try - APedido := FPedidosClienteController.ElegirPedidos(FPedidosClienteController.BuscarPendientes, - 'Elija el pedido de cliente que desea utilizar para dar de alta la factura.' - + #10#13 + 'Tenga en cuenta que sólo se podrán utilizar pedidos que no tengan ningún albarán ya asociado.', False); - if Assigned(APedido) then - begin - if FController.Anadir(Facturas, APedido) then - FController.Ver(Facturas); - end; - finally - FPedidosClienteController := NIL; - end;} - end; - 200 : begin // Utilizar albaranes - GenerarFacturaCli; + 200 : begin // Utilizar presupuestos + GenerarFacturaCliPre; + actRefrescar.Execute; + end; + 300 : begin // Utilizar albaranes + GenerarFacturaCliAlb; actRefrescar.Execute; end; 100 : begin // Albaran nuevo vacio diff --git a/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas b/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas index 9ee37d87..63b548d4 100644 --- a/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas +++ b/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas @@ -23,7 +23,8 @@ type procedure RecuperarCliente(APresupuesto : IBizPresupuestoCliente); function Buscar(const ID: Integer): IBizPresupuestoCliente; function BuscarTodos: IBizPresupuestoCliente; - function BuscarPendientes : IBizPresupuestoCliente; + function BuscarAceptados : IBizPresupuestoCliente; + function BuscarSinFacturar : IBizPresupuestoCliente; procedure Ver(APresupuesto : IBizPresupuestoCliente); procedure VerTodos(APresupuestos: IBizPresupuestoCliente); procedure VerDireccionEntrega(APresupuesto : IBizPresupuestoCliente); @@ -92,7 +93,8 @@ type function Anadir(APresupuesto : IBizPresupuestoCliente) : Boolean; function Buscar(const ID: Integer): IBizPresupuestoCliente; function BuscarTodos: IBizPresupuestoCliente; - function BuscarPendientes : IBizPresupuestoCliente; + function BuscarAceptados : IBizPresupuestoCliente; + function BuscarSinFacturar : IBizPresupuestoCliente; function Nuevo : IBizPresupuestoCliente; procedure Ver(APresupuesto : IBizPresupuestoCliente); procedure VerTodos(APresupuestos: IBizPresupuestoCliente); @@ -152,7 +154,7 @@ begin FiltrarEmpresa(Result); end; -function TPresupuestosClienteController.BuscarPendientes: IBizPresupuestoCliente; +function TPresupuestosClienteController.BuscarAceptados: IBizPresupuestoCliente; var Condicion: TDAWhereExpression; begin @@ -163,7 +165,7 @@ begin with Result.DataTable.DynamicWhere do begin // (SITUACION <> RECIBIDO) - Condicion := NewBinaryExpression(NewField('', fld_PresupuestosClienteSITUACION), NewConstant(SITUACION_PRESUPUESTO_PENDIENTE, datString), dboNotEqual); + Condicion := NewBinaryExpression(NewField('', fld_PresupuestosClienteSITUACION), NewConstant(SITUACION_PRESUPUESTO_ACEPTADO, datString), dboEqual); if IsEmpty then Expression := Condicion @@ -175,6 +177,30 @@ begin end; end; +function TPresupuestosClienteController.BuscarSinFacturar: IBizPresupuestoCliente; +var + Condicion: TDAWhereExpression; +begin + ShowHourglassCursor; + try + Result := BuscarAceptados; + + with Result.DataTable.DynamicWhere do + begin + // (ID_FACTURA = NULL) + Condicion := NewBinaryExpression(NewField('', fld_PresupuestosClienteID_FACTURA), NewNull(), dboEqual); + + if IsEmpty then + Expression := Condicion + else + Expression := NewBinaryExpression(Expression, Condicion, dboAnd); + end; + + finally + HideHourglassCursor; + end; +end; + procedure TPresupuestosClienteController.CopiarDireccionEnvio( const ADireccionEnvio: IBizDireccionesContacto; APresupuesto: IBizPresupuestoCliente); {var @@ -300,9 +326,10 @@ begin if Assigned(APresupuesto.Cliente) then APresupuesto.Cliente.DataTable.Active := True; - if (APresupuesto.ID_Cliente < 0) or - (not Assigned(APresupuesto.Cliente)) or - (APresupuesto.Cliente.IsEmpty) then + if (APresupuesto.ID_Cliente <= 0) then + // Si hay altas automáticas no hay objeto Cliente pero sí hay ID_CLIENTE +{ (not Assigned(APresupuesto.Cliente)) or + (APresupuesto.Cliente.IsEmpty) then} raise Exception.Create('Debe indicar el cliente de este presupuesto'); if (EsFechaVacia(APresupuesto.FECHA_PRESUPUESTO)) then diff --git a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.dfm b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.dfm index 4b46a351..5019f595 100644 --- a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.dfm +++ b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.dfm @@ -160,7 +160,7 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente Width = 743 Height = 414 TabOrder = 1 - OnChange = pgPaginasChange + OnChanging = pgPaginasChanging ExplicitWidth = 743 ExplicitHeight = 414 inherited pagGeneral: TTabSheet @@ -204,13 +204,14 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente ExplicitLeft = 278 ExplicitTop = 0 end - inherited ToolButton14: TToolButton [4] + inherited ToolButton14: TToolButton Left = 334 Top = 0 + Wrap = False ExplicitLeft = 334 ExplicitTop = 0 end - inherited FontName: TJvFontComboBox [5] + inherited FontName: TJvFontComboBox Left = 399 Top = 0 ExplicitLeft = 399 @@ -238,44 +239,43 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente ExplicitTop = 0 ExplicitHeight = 27 end - inherited ToolButton6: TToolButton [9] + inherited ToolButton6: TToolButton Left = 0 Top = 27 ExplicitLeft = 0 ExplicitTop = 27 end - inherited ToolButton7: TToolButton [10] + inherited ToolButton7: TToolButton Left = 66 Top = 27 ExplicitLeft = 66 ExplicitTop = 27 end - inherited ToolButton8: TToolButton [11] + inherited ToolButton8: TToolButton Left = 133 Top = 27 ExplicitLeft = 133 ExplicitTop = 27 end - inherited ToolButton12: TToolButton [12] + inherited ToolButton12: TToolButton Left = 216 Top = 27 ExplicitLeft = 216 ExplicitTop = 27 - ExplicitHeight = 22 end - inherited ToolButton9: TToolButton [13] + inherited ToolButton9: TToolButton Left = 224 Top = 27 ExplicitLeft = 224 ExplicitTop = 27 end - inherited ToolButton10: TToolButton [14] + inherited ToolButton10: TToolButton Left = 369 Top = 27 ExplicitLeft = 369 ExplicitTop = 27 end - inherited ToolButton11: TToolButton [15] + inherited ToolButton11: TToolButton Left = 494 Top = 27 ExplicitLeft = 494 diff --git a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.pas b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.pas index aabe0046..42de6d04 100644 --- a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.pas +++ b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.pas @@ -46,9 +46,9 @@ type procedure CustomEditorClose(Sender: TObject; var Action: TCloseAction); procedure frViewTotales1ePortePropertiesValidate(Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean); - procedure pgPaginasChange(Sender: TObject); procedure actGenerarCertificadoExecute(Sender: TObject); procedure actGenerarCertificadoUpdate(Sender: TObject); + procedure pgPaginasChanging(Sender: TObject; var AllowChange: Boolean); private procedure RecalcularPortePorUnidad; @@ -287,19 +287,18 @@ begin end; end; -procedure TfEditorPresupuestoCliente.pgPaginasChange(Sender: TObject); +procedure TfEditorPresupuestoCliente.pgPaginasChanging(Sender: TObject; + var AllowChange: Boolean); +var + ACadena : String; begin inherited; if (not Assigned(FPresupuesto)) or (FPresupuesto.ID_CLIENTE = 0) then begin - if (pgPaginas.ActivePageIndex = pagContenido.PageIndex) then - begin - pagContenido.Enabled := False; - ShowWarningMessage('Antes de introducir conceptos debe elegir un cliente para este presupuesto'); - end; + ACadena := 'Antes de introducir conceptos debe elegir un cliente para este presupuesto'; + ShowWarningMessage(ACadena); + AllowChange := False; end - else - pagContenido.Enabled := True; end; procedure TfEditorPresupuestoCliente.PonerTitulos(const ATitulo: string); diff --git a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestosCliente.dfm b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestosCliente.dfm index e65f8620..fca7a550 100644 --- a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestosCliente.dfm +++ b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestosCliente.dfm @@ -144,14 +144,17 @@ inherited fEditorPresupuestosCliente: TfEditorPresupuestosCliente end end inherited TBXTMain2: TTBXToolbar + Left = 343 + DockPos = 343 Visible = True + ExplicitLeft = 343 ExplicitWidth = 236 object TBXItem42: TTBXItem Action = actGenerarCertificado DisplayMode = nbdmImageAndText end object TBXItem40: TTBXItem - Action = actGenerar + Action = actGenerarFactura DisplayMode = nbdmImageAndText end end @@ -178,20 +181,11 @@ inherited fEditorPresupuestosCliente: TfEditorPresupuestosCliente end object actGenerarFactura: TAction Category = 'Acciones' - Caption = 'Generar factura de cliente' - Enabled = False + Caption = 'Generar factura' ImageIndex = 24 - Visible = False OnExecute = actGenerarFacturaExecute OnUpdate = actGenerarFacturaUpdate end - object actGenerar: TAction - Category = 'Acciones' - Caption = 'Generar factura' - ImageIndex = 26 - OnExecute = actGenerarExecute - OnUpdate = actGenerarUpdate - end object actGenerarCertificado: TAction Category = 'Acciones' Caption = 'Generar certificado' @@ -1883,7 +1877,9 @@ inherited fEditorPresupuestosCliente: TfEditorPresupuestosCliente Action = actGenerarCertificado end object Generar2: TMenuItem [7] - Action = actGenerar + Caption = 'Generar factura' + ImageIndex = 26 + OnClick = actGenerarExecute end object N4: TMenuItem [8] Caption = '-' diff --git a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestosCliente.pas b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestosCliente.pas index aff34a71..4d7e071b 100644 --- a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestosCliente.pas +++ b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestosCliente.pas @@ -24,7 +24,6 @@ type TBXItem38: TTBXItem; TBXItem39: TTBXItem; N4: TMenuItem; - actGenerar: TAction; Generar2: TMenuItem; JsGenerarDialog: TJSDialog; JsPrevisualizarDialog: TJSDialog; @@ -42,7 +41,6 @@ type procedure actGenerarFacturaExecute(Sender: TObject); procedure actGenerarPresupuestoProvExecute(Sender: TObject); procedure actGenerarExecute(Sender: TObject); - procedure actGenerarUpdate(Sender: TObject); procedure actGenerarCertificadoUpdate(Sender: TObject); procedure actGenerarCertificadoExecute(Sender: TObject); @@ -148,8 +146,6 @@ procedure TfEditorPresupuestosCliente.actGenerarExecute(Sender: TObject); // Respuesta : Integer; begin inherited; - actGenerarFactura.Execute; - { Respuesta := JsGenerarDialog.Execute; @@ -173,9 +169,9 @@ begin inherited; if (ShowConfirmMessage('Generar factura', Format('¿Desea copiar todos los conceptos del presupuesto %s a la factura?', [Presupuestos.REFERENCIA])) = IDYES) then - GenerarFacturaCli(Presupuestos.ID) + GenerarFacturaCliPre(Presupuestos.ID) else - GenerarFacturaCli(Presupuestos.ID, False); + GenerarFacturaCliPre(Presupuestos.ID, False); actRefrescar.Execute; end; @@ -184,8 +180,10 @@ procedure TfEditorPresupuestosCliente.actGenerarFacturaUpdate(Sender: TObject); begin inherited; (Sender as TAction).Enabled := HayDatos + and not (ViewGrid.NumSeleccionados > 1) + and (FPresupuestos.FACTURA = '') and ViewGrid.esSeleccionCeldaDatos - and (FPresupuestos.SITUACION = SITUACION_PRESUPUESTO_PENDIENTE); + and (FPresupuestos.SITUACION = SITUACION_PRESUPUESTO_ACEPTADO); end; procedure TfEditorPresupuestosCliente.actGenerarPresupuestoProvExecute(Sender: TObject); @@ -194,16 +192,6 @@ begin // GenerarPresupuestosProv(FPresupuestos); end; -procedure TfEditorPresupuestosCliente.actGenerarUpdate(Sender: TObject); -begin - inherited; - - (Sender as TAction).Enabled := HayDatos and - not (ViewGrid.NumSeleccionados > 1) and - ViewGrid.esSeleccionCeldaDatos and - (FPresupuestos.SITUACION <> SITUACION_PRESUPUESTO_ANULADO); -end; - procedure TfEditorPresupuestosCliente.AsignarVista; begin ViewGrid := CreateView(TfrViewPresupuestosCliente) as IViewPresupuestosCliente; diff --git a/Source/Modulos/Relaciones/Albaranes de cliente - Facturas de cliente/AlbCli_FacCli_relation.dpk b/Source/Modulos/Relaciones/Albaranes de cliente - Facturas de cliente/AlbCli_FacCli_relation.dpk index 717b8ac8..d72b01ad 100644 --- a/Source/Modulos/Relaciones/Albaranes de cliente - Facturas de cliente/AlbCli_FacCli_relation.dpk +++ b/Source/Modulos/Relaciones/Albaranes de cliente - Facturas de cliente/AlbCli_FacCli_relation.dpk @@ -31,7 +31,7 @@ requires FacturasCliente_controller; contains - uGenerarFacturasCliAlbCliUtils in 'uGenerarFacturasCliAlbCliUtils.pas' {dmGenerarFacturasCli}, + uGenerarFacturasCliAlbCliUtils in 'uGenerarFacturasCliAlbCliUtils.pas' {dmGenerarFacturasCliAlb}, uGenerarAlbaranesCliFacCliUtils in 'uGenerarAlbaranesCliFacCliUtils.pas' {dmGenerarAlbaranesCli}; end. diff --git a/Source/Modulos/Relaciones/Albaranes de cliente - Facturas de cliente/AlbCli_FacCli_relation.dproj b/Source/Modulos/Relaciones/Albaranes de cliente - Facturas de cliente/AlbCli_FacCli_relation.dproj index cf649bc8..f907d9f6 100644 --- a/Source/Modulos/Relaciones/Albaranes de cliente - Facturas de cliente/AlbCli_FacCli_relation.dproj +++ b/Source/Modulos/Relaciones/Albaranes de cliente - Facturas de cliente/AlbCli_FacCli_relation.dproj @@ -39,188 +39,7 @@ Delphi.Personality Package - - False - True - False - - - False - False - False - - - True - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 3082 - 1252 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +FalseTrueFalseFalseFalseFalseTrueFalse1000FalseFalseFalseFalseFalse308212521.0.0.01.0.0.0 Borland Sample Components Delphi 1.0 Compatibility Components Borland MyBase DataAccess Components @@ -257,30 +76,25 @@ SMExport suite: data export from dataset. Written by Mike Shkolnik/Scalabium, 1998-2004. Intraweb 8.0 Design Package for Borland Development Studio 2006 Internet Explorer Components - - - AlbCli_FacCli_relation.dpk - - + AlbCli_FacCli_relation.dpk MainSource - - - - + + + +
dmGenerarAlbaranesCli
-
dmGenerarFacturasCli
+
dmGenerarFacturasCliAlb
-