From 25143fb973445365bd34e16811c69a5ecd6f4aa7 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 22 Jul 2016 17:05:20 +0000 Subject: [PATCH] =?UTF-8?q?-=20Tarea=20#1436=20->=20Al=20exportar=20a=20PD?= =?UTF-8?q?F=20cambiar=20el=20nombre=20del=20fichero=20-=20Mejorada=20la?= =?UTF-8?q?=20ventana=20de=20elegir=20email=20al=20enviar=20un=20documento?= =?UTF-8?q?=20-=20M=C3=A1s=20espacio=20para=20los=20conceptos=20en=20el=20?= =?UTF-8?q?informe=20de=20pedido=20a=20Proveedor=20-=20La=20persona=20de?= =?UTF-8?q?=20contacto=20y=20el=20tlf=20de=20contacto=20pasa=20a=20ser=20e?= =?UTF-8?q?l=20vendedor=20en=20el=20pedido=20a=20proveedor.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@645 f4e31baf-9722-1c47-927c-6f952f962d4b --- Source/Base/Base.dproj | 96 +++++++------- Source/Cliente/FactuGES.dproj | 3 +- Source/Cliente/FactuGES.rc | 8 +- Source/Cliente/FactuGES.res | Bin 172156 -> 171984 bytes Source/GUIBase/uDialogElegirEMail.dfm | 2 + Source/GUIBase/uDialogElegirEMail.pas | 28 +++-- Source/Informes/InfPedidoProveedor.fr3 | 20 +-- .../uAlbaranesClienteController.pas | 7 +- .../uContratosClienteController.pas | 8 +- .../Model/uBizContratosCliente.pas | 3 +- .../Controller/uFacturasClienteController.pas | 7 +- .../uPedidosProveedorController.pas | 13 +- .../Model/uBizPedidosProveedor.pas | 64 +++++++++- .../Reports/uRptPedidosProveedor_Server.dfm | 25 ++-- .../Views/PedidosProveedor_view.dproj | 42 +++---- .../Views/uEditorPedidosProveedor.dfm | 36 ++---- .../Views/uEditorPedidosProveedor.pas | 13 +- .../Views/uViewDetallesPedidoProveedor.dfm | 93 ++++++++++++++ .../Views/uViewDireccionEntregaPedidoProv.dfm | 12 +- .../Views/uViewDireccionEntregaPedidoProv.pas | 119 ++++++++++++++---- .../Views/uViewPedidoProveedor.dfm | 11 +- .../uPresupuestosClienteController.pas | 8 +- .../Model/uBizPresupuestosCliente.pas | 4 +- Source/Servidor/FactuGES_Server.dproj | 2 +- Source/Servidor/FactuGES_Server.rc | 10 +- Source/Servidor/FactuGES_Server.res | Bin 23348 -> 23348 bytes 26 files changed, 439 insertions(+), 195 deletions(-) diff --git a/Source/Base/Base.dproj b/Source/Base/Base.dproj index 81cc26e9..33b554c0 100644 --- a/Source/Base/Base.dproj +++ b/Source/Base/Base.dproj @@ -58,55 +58,55 @@ MainSource - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
fConfigurarConexion
TForm diff --git a/Source/Cliente/FactuGES.dproj b/Source/Cliente/FactuGES.dproj index fd04568e..abd7460b 100644 --- a/Source/Cliente/FactuGES.dproj +++ b/Source/Cliente/FactuGES.dproj @@ -52,8 +52,7 @@ Delphi.Personality VCLApplication -FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse2730FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.7.3.0FactuGESFactuGES2.7.3.0 - +FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse2740FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.7.4.0FactuGESFactuGES2.7.4.0 File C:\Documents and Settings\All Users\Documentos\RAD Studio\5.0\Bpl\dxPScxScheduler2LnkD11.bpl not found FactuGES.dprFalse diff --git a/Source/Cliente/FactuGES.rc b/Source/Cliente/FactuGES.rc index 9390f219..f7e285a5 100644 --- a/Source/Cliente/FactuGES.rc +++ b/Source/Cliente/FactuGES.rc @@ -1,7 +1,7 @@ MAINICON ICON "C:\Codigo Acana\Resources\Iconos\Factuges.ico" 1 VERSIONINFO -FILEVERSION 2,7,2,0 -PRODUCTVERSION 2,7,2,0 +FILEVERSION 2,7,4,0 +PRODUCTVERSION 2,7,4,0 FILEFLAGSMASK 0x3FL FILEFLAGS 0x00L FILEOS 0x40004L @@ -13,10 +13,10 @@ BEGIN BLOCK "0C0A04E4" BEGIN VALUE "CompanyName", "Rodax Software S.L.\0" - VALUE "FileVersion", "2.7.2.0\0" + VALUE "FileVersion", "2.7.4.0\0" VALUE "InternalName", "FactuGES\0" VALUE "ProductName", "FactuGES\0" - VALUE "ProductVersion", "2.7.3.0\0" + VALUE "ProductVersion", "2.7.4.0\0" END END BLOCK "VarFileInfo" diff --git a/Source/Cliente/FactuGES.res b/Source/Cliente/FactuGES.res index 788e748ccb8bcc75ae5dedfb8ecb2356b220a448..1948d2446fff030f34f0057d9aedf57425e290f5 100644 GIT binary patch delta 318 zcmY+9u}Z{15Qe`U_s%39l14}w5HW>CgzFCRunO2%*k7)@w=ji89zfVCiKP!N5VlD+Z63f@ zw6wIew(}hV@yyP~;DOnhpZ{|H{d{w#?@sSYz3Akq>$*;kzft6HT~K6bq|9xRM&X-LG#V~~X;o@cp922wHdm`GZhVln1cU@1nztx}amrIH~%HVz?6xopv(0uHsB zMU!V(rq_#=8B-L78u7tw=E_m>f+C9_8tUMCq<7a7vQ(r}`5@Amx+dxWOoRPU7t~ka zhq}7CCA{K_q{#c*>0yU{bng9R* diff --git a/Source/GUIBase/uDialogElegirEMail.dfm b/Source/GUIBase/uDialogElegirEMail.dfm index b20fcd30..d1968467 100644 --- a/Source/GUIBase/uDialogElegirEMail.dfm +++ b/Source/GUIBase/uDialogElegirEMail.dfm @@ -27,6 +27,7 @@ inherited fDialogElegirEMail: TfDialogElegirEMail inherited btnAceptar: TButton Left = 369 Top = 6 + Default = True ExplicitLeft = 369 ExplicitTop = 6 end @@ -47,6 +48,7 @@ inherited fDialogElegirEMail: TfDialogElegirEMail end inherited lblComments: TLabel Width = 456 + Height = 27 Visible = False end end diff --git a/Source/GUIBase/uDialogElegirEMail.pas b/Source/GUIBase/uDialogElegirEMail.pas index 1d9e5b35..38153168 100644 --- a/Source/GUIBase/uDialogElegirEMail.pas +++ b/Source/GUIBase/uDialogElegirEMail.pas @@ -26,9 +26,10 @@ type FListaDirecciones: TStringList; function GetEMailElegido: String; procedure ActualizarOpciones; + procedure SetListaDirecciones(ALista : TStringList); public property EMailElegido: String read GetEMailElegido; - property ListaDirecciones : TStringList read FListaDirecciones write FListaDirecciones; + property ListaDirecciones : TStringList read FListaDirecciones write SetListaDirecciones; end; @@ -75,16 +76,19 @@ procedure TfDialogElegirEMail.ActualizarOpciones; begin if rbEdit.Checked then begin - edtEMail.Enabled := True; rbCombo.Checked := False; cbEMail.Enabled := False; + edtEMail.Enabled := True; + edtEMail.SetFocus; end else begin if rbCombo.Enabled then begin - cbEMail.Enabled := True; edtEMail.Enabled := False; rbEdit.Checked := False; + cbEMail.Enabled := True; + cbEMail.ItemIndex := 0; + cbEMail.SetFocus; end else rbEdit.Checked := True; @@ -136,12 +140,10 @@ begin if cbEMail.Items.Count = 0 then begin rbCombo.Enabled := False; - rbEdit.Checked; + rbEdit.Checked := True end - else begin - cbEMail.ItemIndex := 0; + else rbCombo.Checked := True; - end; ActualizarOpciones; end; @@ -168,4 +170,16 @@ begin ActualizarOpciones; end; +procedure TfDialogElegirEMail.SetListaDirecciones(ALista: TStringList); +var + i : integer; +begin + FListaDirecciones := ALista; + for i := FListaDirecciones.count - 1 downto 0 do + begin + if Trim(FListaDirecciones[i]) = '' then + FListaDirecciones.Delete(i); + end; +end; + end. diff --git a/Source/Informes/InfPedidoProveedor.fr3 b/Source/Informes/InfPedidoProveedor.fr3 index e1ede75a..e5758ee6 100644 --- a/Source/Informes/InfPedidoProveedor.fr3 +++ b/Source/Informes/InfPedidoProveedor.fr3 @@ -1,5 +1,5 @@ - + @@ -8,11 +8,11 @@ - + - - - + + + @@ -26,17 +26,17 @@ - + - - + + - - + + diff --git a/Source/Modulos/Albaranes de cliente/Controller/uAlbaranesClienteController.pas b/Source/Modulos/Albaranes de cliente/Controller/uAlbaranesClienteController.pas index 579b97fb..b5152802 100644 --- a/Source/Modulos/Albaranes de cliente/Controller/uAlbaranesClienteController.pas +++ b/Source/Modulos/Albaranes de cliente/Controller/uAlbaranesClienteController.pas @@ -740,6 +740,7 @@ procedure TAlbaranesClienteController.EnviarAlbaranPorEMail( var AReportController : IAlbaranesClienteReportController; AFicheroTMP : TFileName; + ATituloEnvio : String; AEMail : String; AListaEmail : TStringList; begin @@ -749,8 +750,6 @@ begin if AAlbaran.DataTable.Active then AAlbaran.DataTable.Active := True; - AFicheroTMP := DarFicheroPDFTemporal(EscapeIllegalChars(AAlbaran.REFERENCIA)); - AListaEmail := TStringList.Create; try RecuperarCliente(AAlbaran); @@ -768,10 +767,12 @@ begin end; ShowHourglassCursor; + ATituloEnvio := 'Albarán ' + AAlbaran.Cliente.NOMBRE; + AFicheroTMP := DarFicheroPDFTemporal(EscapeIllegalChars(ATituloEnvio)); AReportController := TAlbaranesClienteReportController.Create; try AReportController.ExportToPDF(AAlbaran.ID, AFicheroTMP); - SendMailMAPI('Albarán ' + AAlbaran.REFERENCIA, '', AFicheroTMP, '', '', AAlbaran.Cliente.NOMBRE, AEMail); + SendMailMAPI(ATituloEnvio, '', AFicheroTMP, '', '', AAlbaran.Cliente.NOMBRE, AEMail); finally SysUtils.DeleteFile(AFicheroTMP); AReportController := NIL; diff --git a/Source/Modulos/Contratos de cliente/Controller/uContratosClienteController.pas b/Source/Modulos/Contratos de cliente/Controller/uContratosClienteController.pas index 7091524b..b34ba0b5 100644 --- a/Source/Modulos/Contratos de cliente/Controller/uContratosClienteController.pas +++ b/Source/Modulos/Contratos de cliente/Controller/uContratosClienteController.pas @@ -381,6 +381,7 @@ begin REFERENCIA := ''; SITUACION := SITUACION_CONTRATO_PENDIENTE; end; + Result.AsignarVendedor; Result.Post; finally HideHourglassCursor; @@ -661,6 +662,7 @@ procedure TContratosClienteController.EnviarContratoPorEMail( var AReportController : IContratosClienteReportController; AFicheroTMP : TFileName; + ATituloEnvio : String; AEMail : String; AListaEmail : TStringList; begin @@ -670,8 +672,6 @@ begin if AContrato.DataTable.Active then AContrato.DataTable.Active := True; - AFicheroTMP := DarFicheroPDFTemporal(EscapeIllegalChars(AContrato.REFERENCIA)); - AListaEmail := TStringList.Create; try RecuperarCliente(AContrato); @@ -689,10 +689,12 @@ begin end; ShowHourglassCursor; + ATituloEnvio := 'Contrato ' + AContrato.Cliente.NOMBRE + ' - ' + AContrato.REFERENCIA_CLIENTE; + AFicheroTMP := DarFicheroPDFTemporal(EscapeIllegalChars(ATituloEnvio)); AReportController := TContratosClienteReportController.Create; try AReportController.ExportToPDF(AContrato.ID, AFicheroTMP); - SendMailMAPI('Contrato ' + AContrato.REFERENCIA, '', AFicheroTMP, '', '', AContrato.Cliente.NOMBRE, AEMail); + SendMailMAPI(ATituloEnvio, '', AFicheroTMP, '', '', AContrato.Cliente.NOMBRE, AEMail); finally DeleteFile(AFicheroTMP); AReportController := NIL; diff --git a/Source/Modulos/Contratos de cliente/Model/uBizContratosCliente.pas b/Source/Modulos/Contratos de cliente/Model/uBizContratosCliente.pas index adee4824..333789f1 100644 --- a/Source/Modulos/Contratos de cliente/Model/uBizContratosCliente.pas +++ b/Source/Modulos/Contratos de cliente/Model/uBizContratosCliente.pas @@ -34,6 +34,7 @@ type property Detalles: IBizDetallesContratoCliente read GetDetalles write SetDetalles; procedure CalcularImporteTotal; + procedure AsignarVendedor; function EsNuevo : Boolean; function DarListaSituaciones: TStringList; @@ -49,7 +50,6 @@ type procedure CalcularIVA; procedure CalcularRE; procedure AsignarTipoIVA (IDTipoIVA : Integer); - procedure AsignarVendedor; protected FSeleccionableInterface : ISeleccionable; @@ -87,6 +87,7 @@ type function DarListaSituaciones: TStringList; function EsNuevo : Boolean; procedure CalcularImporteTotal; + procedure AsignarVendedor; property Cliente : IBizCliente read GetCliente write SetCliente; property _Cliente : IBizCliente read _GetCliente write _SetCliente; diff --git a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas index e7832cc7..8a1c186a 100644 --- a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas +++ b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas @@ -857,6 +857,7 @@ procedure TFacturasClienteController.EnviarFacturaPorEMail(AFactura: IBizFactura var AReportController : IFacturasClienteReportController; AFicheroTMP : TFileName; + ATituloEnvio : String; AEMail : String; AListaEmail : TStringList; begin @@ -866,8 +867,6 @@ begin if AFactura.DataTable.Active then AFactura.DataTable.Active := True; - AFicheroTMP := DarFicheroPDFTemporal(EscapeIllegalChars(AFactura.REFERENCIA)); - AListaEmail := TStringList.Create; try RecuperarCliente(AFactura); @@ -885,10 +884,12 @@ begin end; ShowHourglassCursor; + ATituloEnvio := 'Factura ' + AFactura.REFERENCIA + ' - ' + AFactura.Cliente.NOMBRE; + AFicheroTMP := DarFicheroPDFTemporal(EscapeIllegalChars(ATituloEnvio)); AReportController := TFacturasClienteReportController.Create; try AReportController.ExportToPDF(AFactura.ID, AFicheroTMP); - SendMailMAPI('Factura ' + AFactura.REFERENCIA, '', AFicheroTMP, '', '', AFactura.Cliente.NOMBRE, AEMail); + SendMailMAPI(ATituloEnvio, '', AFicheroTMP, '', '', AFactura.Cliente.NOMBRE, AEMail); finally DeleteFile(AFicheroTMP); AReportController := NIL; diff --git a/Source/Modulos/Pedidos a proveedor/Controller/uPedidosProveedorController.pas b/Source/Modulos/Pedidos a proveedor/Controller/uPedidosProveedorController.pas index a6239128..ab70fb88 100644 --- a/Source/Modulos/Pedidos a proveedor/Controller/uPedidosProveedorController.pas +++ b/Source/Modulos/Pedidos a proveedor/Controller/uPedidosProveedorController.pas @@ -343,6 +343,8 @@ begin REF_CON_CLIENTE := ''; ID_CONTRATO_CLIENTE := 0; end; + Result.AsignarVendedor; + Result.Post; finally HideHourglassCursor; @@ -602,6 +604,7 @@ procedure TPedidosProveedorController.EnviarPedidoPorEMail(APedido: IBizPedidoPr var AReportController : IPedidosProveedorReportController; AFicheroTMP : TFileName; + ATituloEnvio : String; AEMail : String; AListaEmail : TStringList; begin @@ -611,8 +614,6 @@ begin if APedido.DataTable.Active then APedido.DataTable.Active := True; - AFicheroTMP := DarFicheroPDFTemporal(EscapeIllegalChars(APedido.REFERENCIA)); - AListaEmail := TStringList.Create; try RecuperarProveedor(APedido); @@ -630,10 +631,16 @@ begin end; ShowHourglassCursor; + if not APedido.DESCRIPCION_GENERALIsNull then + ATituloEnvio := APedido.DESCRIPCION_GENERAL + else + ATituloEnvio := 'Pedido ' + APedido.REFERENCIA; + + AFicheroTMP := DarFicheroPDFTemporal(EscapeIllegalChars(ATituloEnvio)); AReportController := TPedidosProveedorReportController.Create; try AReportController.ExportToPDF(APedido.ID, AFicheroTMP); - SendMailMAPI('Pedido ' + APedido.REFERENCIA, '', AFicheroTMP, '', '', APedido.Proveedor.NOMBRE, AEMail); + SendMailMAPI(ATituloEnvio, '', AFicheroTMP, '', '', APedido.Proveedor.NOMBRE, AEMail); finally DeleteFile(AFicheroTMP); AReportController := NIL; diff --git a/Source/Modulos/Pedidos a proveedor/Model/uBizPedidosProveedor.pas b/Source/Modulos/Pedidos a proveedor/Model/uBizPedidosProveedor.pas index 2fdfee6d..cc5234c1 100644 --- a/Source/Modulos/Pedidos a proveedor/Model/uBizPedidosProveedor.pas +++ b/Source/Modulos/Pedidos a proveedor/Model/uBizPedidosProveedor.pas @@ -34,13 +34,13 @@ type function EsNuevo : Boolean; function DarListaSituaciones: TStringList; + procedure AsignarVendedor; end; TBizPedidoProveedor = class(TPedidosProveedorDataTableRules, IBizPedidoProveedor, ISeleccionable) private procedure CalcularBaseImponible; procedure CalcularIVA; - procedure AsignarVendedor; protected FSeleccionableInterface : ISeleccionable; @@ -64,12 +64,14 @@ type procedure SetID_CONTRATO_CLIENTEValue(const aValue: Integer); override; // procedure SetINCIDENCIASValue(const aValue: IROStrings); override; procedure SetID_FORMA_PAGOValue(const aValue: Integer); override; - procedure SetID_TIENDAValue(const aValue: Integer); + procedure SetID_TIENDAValue(const aValue: Integer); override; + procedure SetID_VENDEDORValue(const aValue: Integer); override; procedure IMPORTE_NETOOnChange(Sender: TDACustomField); procedure IMPORTE_PORTEOnChange(Sender: TDACustomField); procedure DESCUENTOOnChange(Sender: TDACustomField); procedure IVAOnChange(Sender: TDACustomField); + procedure ID_VENDEDOROnChange(Sender: TDACustomField); procedure OnNewRecord(Sender: TDADataTable); override; procedure IniciarValoresPedidoNuevo; @@ -77,6 +79,8 @@ type public procedure CalcularImporteTotal; function DarListaSituaciones: TStringList; + procedure AsignarVendedor; + procedure RellenarContactoVendedor; function EsNuevo : Boolean; property Proveedor : IBizProveedor read GetProveedor write SetProveedor; property _Proveedor : IBizProveedor read _GetProveedor write _SetProveedor; @@ -93,12 +97,51 @@ type implementation uses - SysUtils, Variants, uDataModuleConfiguracion, uDataModuleUsuarios, + SysUtils, Dialogs, Variants, uDataModuleConfiguracion, uDataModuleUsuarios, uDataTableUtils, DateUtils, uDateUtils, DB, uFactuGES_App, uBizEmpresasTiendas, uVendedoresController; { TBizPedidoProveedor } +procedure TBizPedidoProveedor.RellenarContactoVendedor; +var + AVendedoresController: IVendedoresController; + AVendedor : IBizVendedor; + ATelefonos : String; +begin + ATelefonos := ''; + if ID_VENDEDORIsNull then begin + SetFieldNull(DataTable, fld_PedidosProveedorPERSONA_CONTACTO); + SetFieldNull(DataTable, fld_PedidosProveedorTELEFONO); + end + else begin + AVendedoresController := TVendedoresController.Create; + try + AVendedor := (AVendedoresController.Buscar(ID_VENDEDOR) as IBizVendedor); + if not Assigned(AVendedor) then + raise Exception.Create (Format('No se ha encontrado un vendedor con ID %d (AsignarVendedor)', [ID_VENDEDOR])); + + AVendedor.DataTable.Active := True; + PERSONA_CONTACTO := AVendedor.NOMBRE; + + if not AVendedor.TELEFONO_1IsNull then + ATelefonos := ATelefonos + AVendedor.TELEFONO_1; + + if not AVendedor.MOVIL_1IsNull then + begin + if (Length(ATelefonos) > 0) then + ATelefonos := ATelefonos + ' / '; + ATelefonos := ATelefonos + AVendedor.MOVIL_1; + end; + + TELEFONO := ATelefonos; + finally + AVendedor := nil; + AVendedoresController := nil; + end; + end; +end; + procedure TBizPedidoProveedor.AsignarVendedor; var AVendedoresController: IVendedoresController; @@ -106,6 +149,7 @@ begin AVendedoresController := TVendedoresController.Create; try ID_VENDEDOR := AVendedoresController.DarIDVendedorDeUsuario(AppFactuGES.UsuarioActivo.ID); + RellenarContactoVendedor; finally AVendedoresController := nil; end; @@ -154,6 +198,7 @@ begin FieldByName(fld_PedidosProveedorIMPORTE_PORTE).OnChange := IMPORTE_PORTEOnChange; FieldByName(fld_PedidosProveedorDESCUENTO).OnChange := DESCUENTOOnChange; FieldByName(fld_PedidosProveedorIVA).OnChange := IVAOnChange; + FieldByName(fld_PedidosProveedorID_VENDEDOR).OnChange := ID_VENDEDOROnChange; end; FDetallesLink := TDADataSource.Create(NIL); @@ -198,6 +243,11 @@ begin Result := FProveedor; end; +procedure TBizPedidoProveedor.ID_VENDEDOROnChange(Sender: TDACustomField); +begin + RellenarContactoVendedor; +end; + procedure TBizPedidoProveedor.IMPORTE_NETOOnChange(Sender: TDACustomField); begin CalcularImporteTotal; @@ -241,6 +291,14 @@ begin end; +procedure TBizPedidoProveedor.SetID_VENDEDORValue(const aValue: Integer); +begin + if (aValue = 0) then + SetFieldNull(DataTable, fld_PedidosProveedorID_VENDEDOR) + else + inherited; +end; + function TBizPedidoProveedor.GetDetalles: IBizDetallesPedidoProveedor; begin Result := FDetalles; diff --git a/Source/Modulos/Pedidos a proveedor/Reports/uRptPedidosProveedor_Server.dfm b/Source/Modulos/Pedidos a proveedor/Reports/uRptPedidosProveedor_Server.dfm index 55e864bf..fdc4a52d 100644 --- a/Source/Modulos/Pedidos a proveedor/Reports/uRptPedidosProveedor_Server.dfm +++ b/Source/Modulos/Pedidos a proveedor/Reports/uRptPedidosProveedor_Server.dfm @@ -102,19 +102,16 @@ object RptPedidosProveedor: TRptPedidosProveedor ' POBLACION,'#10' IIF ((PEDIDOS_PROVEEDOR.ID_ALMACEN = 0), PEDIDOS_P' + 'ROVEEDOR.PROVINCIA, ALMACENES.PROVINCIA) AS PROVINCIA,'#10' IIF ((P' + 'EDIDOS_PROVEEDOR.ID_ALMACEN = 0), PEDIDOS_PROVEEDOR.CODIGO_POSTA' + - 'L, ALMACENES.CODIGO_POSTAL) AS CODIGO_POSTAL,'#10' IIF ((PEDIDOS_PR' + - 'OVEEDOR.ID_ALMACEN = 0), PEDIDOS_PROVEEDOR.PERSONA_CONTACTO, ALM' + - 'ACENES.PERSONA_CONTACTO) AS PERSONA_CONTACTO,'#10' IIF ((PEDIDOS_PR' + - 'OVEEDOR.ID_ALMACEN = 0), PEDIDOS_PROVEEDOR.TELEFONO, ALMACENES.T' + - 'ELEFONO) AS TELEFONO'#10#10'FROM'#10' PEDIDOS_PROVEEDOR'#10' LEFT OUTER JOIN' + - ' CONTACTOS PROVEEDOR ON (PROVEEDOR .ID = PEDIDOS_PROVEEDOR.ID_PR' + - 'OVEEDOR)'#10' LEFT OUTER JOIN CONTACTOS VENDEDORES ON (VENDEDORES.I' + - 'D = PEDIDOS_PROVEEDOR.ID_VENDEDOR)'#10' LEFT OUTER JOIN CONTRATOS_C' + - 'LIENTE ON (CONTRATOS_CLIENTE.ID = PEDIDOS_PROVEEDOR.ID_CONTRATO_' + - 'CLIENTE)'#10' LEFT OUTER JOIN CONTACTOS CLIENTES ON (CLIENTES.ID = ' + - 'CONTRATOS_CLIENTE.ID_CLIENTE)'#10' LEFT OUTER JOIN ALMACENES ON (AL' + - 'MACENES.ID = PEDIDOS_PROVEEDOR.ID_ALMACEN)'#10'WHERE PEDIDOS_PROVEED' + - 'OR.ID = :ID'#10 + 'L, ALMACENES.CODIGO_POSTAL) AS CODIGO_POSTAL,'#10' PEDIDOS_PROVEEDO' + + 'R.PERSONA_CONTACTO,'#10' PEDIDOS_PROVEEDOR.TELEFONO'#10#10'FROM'#10' PEDIDOS' + + '_PROVEEDOR'#10' LEFT OUTER JOIN CONTACTOS PROVEEDOR ON (PROVEEDOR .' + + 'ID = PEDIDOS_PROVEEDOR.ID_PROVEEDOR)'#10' LEFT OUTER JOIN CONTACTOS' + + ' VENDEDORES ON (VENDEDORES.ID = PEDIDOS_PROVEEDOR.ID_VENDEDOR)'#10' ' + + ' LEFT OUTER JOIN CONTRATOS_CLIENTE ON (CONTRATOS_CLIENTE.ID = PE' + + 'DIDOS_PROVEEDOR.ID_CONTRATO_CLIENTE)'#10' LEFT OUTER JOIN CONTACTOS' + + ' CLIENTES ON (CLIENTES.ID = CONTRATOS_CLIENTE.ID_CLIENTE)'#10' LEFT' + + ' OUTER JOIN ALMACENES ON (ALMACENES.ID = PEDIDOS_PROVEEDOR.ID_AL' + + 'MACEN)'#10'WHERE PEDIDOS_PROVEEDOR.ID = :ID'#10 StatementType = stSQL ColumnMappings = < item @@ -465,7 +462,7 @@ object RptPedidosProveedor: TRptPedidosProveedor PrintOptions.Printer = 'Por defecto' PrintOptions.PrintOnSheet = 0 ReportOptions.CreateDate = 39065.872423495400000000 - ReportOptions.LastChange = 42481.774581759260000000 + ReportOptions.LastChange = 42573.662110995400000000 ScriptLanguage = 'PascalScript' ShowProgress = False StoreInDFM = False diff --git a/Source/Modulos/Pedidos a proveedor/Views/PedidosProveedor_view.dproj b/Source/Modulos/Pedidos a proveedor/Views/PedidosProveedor_view.dproj index f307ed79..f58c19ec 100644 --- a/Source/Modulos/Pedidos a proveedor/Views/PedidosProveedor_view.dproj +++ b/Source/Modulos/Pedidos a proveedor/Views/PedidosProveedor_view.dproj @@ -49,27 +49,27 @@ MainSource - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + +
fEditorDireccionEntregaPedidoProveedor
TfEditorDireccionEntregaPedidoProveedor diff --git a/Source/Modulos/Pedidos a proveedor/Views/uEditorPedidosProveedor.dfm b/Source/Modulos/Pedidos a proveedor/Views/uEditorPedidosProveedor.dfm index 0c4b1d07..3d8f781e 100644 --- a/Source/Modulos/Pedidos a proveedor/Views/uEditorPedidosProveedor.dfm +++ b/Source/Modulos/Pedidos a proveedor/Views/uEditorPedidosProveedor.dfm @@ -56,11 +56,9 @@ inherited fEditorPedidosProveedor: TfEditorPedidosProveedor ExplicitWidth = 700 end inherited TBXTMain2: TTBXToolbar - Left = 343 DockPos = 343 Visible = True - ExplicitLeft = 343 - ExplicitWidth = 119 + ExplicitWidth = 156 object TBXItem39: TTBXItem Action = actRecibirPedido DisplayMode = nbdmImageAndText @@ -75,9 +73,9 @@ inherited fEditorPedidosProveedor: TfEditorPedidosProveedor end inline frViewPedidosProveedor1: TfrViewPedidosProveedor [3] Left = 0 - Top = 102 + Top = 116 Width = 700 - Height = 478 + Height = 464 Align = alClient Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText @@ -87,14 +85,14 @@ inherited fEditorPedidosProveedor: TfEditorPedidosProveedor ParentFont = False TabOrder = 3 ReadOnly = False - ExplicitTop = 102 + ExplicitTop = 116 ExplicitWidth = 700 - ExplicitHeight = 478 + ExplicitHeight = 464 inherited cxGrid: TcxGrid Width = 700 - Height = 350 + Height = 336 ExplicitWidth = 700 - ExplicitHeight = 350 + ExplicitHeight = 336 inherited cxGridView: TcxGridDBTableView DataController.Summary.DefaultGroupSummaryItems = < item @@ -128,27 +126,15 @@ inherited fEditorPedidosProveedor: TfEditorPedidosProveedor Width = 700 ExplicitWidth = 700 inherited txtFiltroTodo: TcxTextEdit - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 457 Width = 457 end inherited edtFechaIniFiltro: TcxDateEdit - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 240 Width = 240 end inherited edtFechaFinFiltro: TcxDateEdit Left = 371 - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 371 ExplicitWidth = 294 Width = 294 @@ -168,8 +154,8 @@ inherited fEditorPedidosProveedor: TfEditorPedidosProveedor end end inherited pnlAgrupaciones: TTBXDockablePanel - Top = 452 - ExplicitTop = 452 + Top = 438 + ExplicitTop = 438 ExplicitWidth = 700 inherited TBXAlignmentPanel1: TTBXAlignmentPanel Width = 700 @@ -206,10 +192,6 @@ inherited fEditorPedidosProveedor: TfEditorPedidosProveedor inherited actImprimir: TAction Visible = True end - inherited actDuplicar: TAction - Enabled = False - Visible = False - end inherited actAnchoAuto: TAction ImageIndex = 22 end diff --git a/Source/Modulos/Pedidos a proveedor/Views/uEditorPedidosProveedor.pas b/Source/Modulos/Pedidos a proveedor/Views/uEditorPedidosProveedor.pas index 756d74db..d8eb1f43 100644 --- a/Source/Modulos/Pedidos a proveedor/Views/uEditorPedidosProveedor.pas +++ b/Source/Modulos/Pedidos a proveedor/Views/uEditorPedidosProveedor.pas @@ -154,10 +154,10 @@ begin end; procedure TfEditorPedidosProveedor.DuplicarInterno; -{var - APedido : IBizPedidoProveedor;} +var + APedido : IBizPedidoProveedor; begin -{ + inherited; APedido := FController.Duplicar(Pedidos); try @@ -165,7 +165,6 @@ begin finally actRefrescar.Execute; end; -} end; procedure TfEditorPedidosProveedor.EliminarInterno; @@ -305,7 +304,11 @@ procedure TfEditorPedidosProveedor.PonerTitulos(const ATitulo: string); var FTitulo : String; begin - FTitulo := FWindowCaption + AppFactuGES.EmpresaActiva.NOMBRE; + if (ATitulo = '') then + FTitulo := 'Lista de pedidos a proveedor - ' + AppFactuGES.EmpresaActiva.NOMBRE + else + FTitulo := ATitulo; + inherited PonerTitulos(FTitulo); end; diff --git a/Source/Modulos/Pedidos a proveedor/Views/uViewDetallesPedidoProveedor.dfm b/Source/Modulos/Pedidos a proveedor/Views/uViewDetallesPedidoProveedor.dfm index 8e5b982b..9cd8dafe 100644 --- a/Source/Modulos/Pedidos a proveedor/Views/uViewDetallesPedidoProveedor.dfm +++ b/Source/Modulos/Pedidos a proveedor/Views/uViewDetallesPedidoProveedor.dfm @@ -1,9 +1,102 @@ inherited frViewDetallesPedidoProveedor: TfrViewDetallesPedidoProveedor + Width = 1039 + Height = 727 + inherited ToolBar1: TToolBar + Width = 1039 + 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 = 53 + Width = 1039 + Height = 674 + ExplicitTop = 75 + ExplicitHeight = 229 inherited cxGridView: TcxGridDBTableView inherited cxGridViewIMPORTENETO: TcxGridDBColumn Properties.ReadOnly = False end end end + inherited TBXDock1: TTBXDock + Top = 24 + Width = 1039 + inherited TBXToolbar1: TTBXToolbar + ExplicitWidth = 731 + end + end end diff --git a/Source/Modulos/Pedidos a proveedor/Views/uViewDireccionEntregaPedidoProv.dfm b/Source/Modulos/Pedidos a proveedor/Views/uViewDireccionEntregaPedidoProv.dfm index 7e720225..924fe524 100644 --- a/Source/Modulos/Pedidos a proveedor/Views/uViewDireccionEntregaPedidoProv.dfm +++ b/Source/Modulos/Pedidos a proveedor/Views/uViewDireccionEntregaPedidoProv.dfm @@ -23,6 +23,7 @@ inherited frViewDireccionEntregaPedidoProv: TfrViewDireccionEntregaPedidoProv Height = 17 Action = actLista TabOrder = 0 + TabStop = True end object rdxDestino2: TRadioButton Left = 10 @@ -87,9 +88,7 @@ inherited frViewDireccionEntregaPedidoProv: TfrViewDireccionEntregaPedidoProv Top = 60 Width = 566 Height = 17 - Action = actLista - Caption = 'Enviar a esta direcci'#243'n del cliente:' - Enabled = False + Action = actListaCliente TabOrder = 2 end object cbListaDireccionesCliente: TcxDBLookupComboBox @@ -110,7 +109,7 @@ inherited frViewDireccionEntregaPedidoProv: TfrViewDireccionEntregaPedidoProv Properties.ListOptions.GridLines = glNone Properties.ListOptions.ShowHeader = False Properties.ListOptions.SyncMode = True - Properties.ListSource = dsAlmacenes + Properties.ListSource = dsDireccionesCliente Properties.PostPopupValueOnTab = True Style.BorderColor = clWindowFrame Style.BorderStyle = ebs3D @@ -195,6 +194,11 @@ inherited frViewDireccionEntregaPedidoProv: TfrViewDireccionEntregaPedidoProv GroupIndex = 1 OnExecute = actOtroExecute end + object actListaCliente: TAction + Caption = 'Enviar a esta direcci'#243'n del cliente:' + GroupIndex = 1 + OnExecute = actListaClienteExecute + end end object dsPedido: TDADataSource Left = 280 diff --git a/Source/Modulos/Pedidos a proveedor/Views/uViewDireccionEntregaPedidoProv.pas b/Source/Modulos/Pedidos a proveedor/Views/uViewDireccionEntregaPedidoProv.pas index b360b76b..6d0da691 100644 --- a/Source/Modulos/Pedidos a proveedor/Views/uViewDireccionEntregaPedidoProv.pas +++ b/Source/Modulos/Pedidos a proveedor/Views/uViewDireccionEntregaPedidoProv.pas @@ -9,7 +9,7 @@ uses cxDBLookupEdit, cxDBLookupComboBox, StdCtrls, cxControls, DB, uDADataTable, ActnList, uBizAlmacenes, uAlmacenesController, uPedidosProveedorController, Buttons, uDAInterfaces, uClientesController, uDireccionesContactoController, - uBizDireccionesContacto; + uBizDireccionesContacto, uBizContratosCliente, uContratosClienteController; type IViewDireccionEntregaPedidoProv = interface(IViewBase) @@ -17,6 +17,7 @@ type function GetPedidoProveedor: IBizPedidoProveedor; procedure SetPedidoProveedor(const Value: IBizPedidoProveedor); property PedidoProveedor: IBizPedidoProveedor read GetPedidoProveedor write SetPedidoProveedor; + procedure RefrescarDireccion; end; TfrViewDireccionEntregaPedidoProv = class(TfrViewBase, IViewDireccionEntregaPedidoProv) @@ -42,31 +43,33 @@ type dxLayoutControl1Item6: TdxLayoutItem; cbListaDireccionesCliente: TcxDBLookupComboBox; dsDireccionesCliente: TDADataSource; + actListaCliente: TAction; procedure actListaExecute(Sender: TObject); procedure actOtroExecute(Sender: TObject); procedure cbListaPropertiesValidate(Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean); procedure cbListaDireccionesClientePropertiesValidate(Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean); procedure bModificarClick(Sender: TObject); procedure txtDireccionDblClick(Sender: TObject); + procedure actListaClienteExecute(Sender: TObject); protected FAlmacenesController : IAlmacenesController; FAlmacenes: IBizAlmacen; FClientesController: IClientesController; - FDireccionesClienteController : IDireccionesContactoController; FDireccionesCliente : IBizDireccionesContacto; FPedido : IBizPedidoProveedor; FController : IPedidosProveedorController; function GetPedidoProveedor: IBizPedidoProveedor; procedure SetPedidoProveedor(const Value: IBizPedidoProveedor); procedure CambioDireccionAlmacen; - procedure CambioDireccionCliente; - procedure RefrescarDireccion; + procedure CambioDireccionCliente; + procedure RecuperarClienteAsociado; procedure SetReadOnly(Value: Boolean); override; public property PedidoProveedor: IBizPedidoProveedor read GetPedidoProveedor write SetPedidoProveedor; constructor Create(AOwner: TComponent); override; destructor Destroy; override; + procedure RefrescarDireccion; end; implementation @@ -74,7 +77,15 @@ implementation {$R *.dfm} uses - uEditorRegistryUtils, uCustomView, uStringsUtils; + uEditorRegistryUtils, uCustomView, uStringsUtils, uFactuGES_App; + +procedure TfrViewDireccionEntregaPedidoProv.actListaClienteExecute( + Sender: TObject); +begin + inherited; + actListaCliente.Checked := True; + RefrescarDireccion; +end; procedure TfrViewDireccionEntregaPedidoProv.actListaExecute(Sender: TObject); begin @@ -108,8 +119,7 @@ end; procedure TfrViewDireccionEntregaPedidoProv.CambioDireccionAlmacen; begin - if Assigned(FPedido) - and Assigned(FAlmacenes) then + if Assigned(FPedido) and Assigned(FAlmacenes) then begin FPedido.Edit; FPedido.CALLE := FAlmacenes.CALLE; @@ -117,15 +127,22 @@ begin FPedido.POBLACION := FAlmacenes.POBLACION; FPedido.PROVINCIA := FAlmacenes.PROVINCIA; FPedido.CODIGO_POSTAL := FAlmacenes.CODIGO_POSTAL; - FPedido.PERSONA_CONTACTO := FAlmacenes.PERSONA_CONTACTO; - FPedido.TELEFONO := FAlmacenes.TELEFONO; RefrescarDireccion; end; end; procedure TfrViewDireccionEntregaPedidoProv.CambioDireccionCliente; begin - // + if Assigned(FPedido) and Assigned(FDireccionesCliente) then + begin + FPedido.Edit; + FPedido.CALLE := FDireccionesCliente.CALLE; + FPedido.POBLACION := FDireccionesCliente.POBLACION; + FPedido.POBLACION := FDireccionesCliente.POBLACION; + FPedido.PROVINCIA := FDireccionesCliente.PROVINCIA; + FPedido.CODIGO_POSTAL := FDireccionesCliente.CODIGO_POSTAL; + RefrescarDireccion; + end; end; procedure TfrViewDireccionEntregaPedidoProv.cbListaDireccionesClientePropertiesValidate( @@ -155,15 +172,18 @@ begin FAlmacenes.DataTable.Active := True; dsAlmacenes.DataTable := FAlmacenes.DataTable; - FDireccionesClienteController := TDireccionesContactoController.Create; FDireccionesCliente := NIL; -// dsDireccionesCliente.DataTable := FDireccionesCliente.DataTable; + dsDireccionesCliente.DataTable := NIL; end; destructor TfrViewDireccionEntregaPedidoProv.Destroy; begin cbListaDireccionesCliente.Properties.OnValidate := Nil; cbLista.Properties.OnValidate := Nil; + + FDireccionesCliente := NIL; + dsDireccionesCliente.DataTable := NIL; + FAlmacenesController := Nil; FAlmacenes := Nil; FController := NIL; @@ -175,6 +195,32 @@ begin Result := FPedido; end; +procedure TfrViewDireccionEntregaPedidoProv.RecuperarClienteAsociado; +var + AContratoController : IContratosClienteController; + AContrato : IBizContratoCliente; +begin + FDireccionesCliente := NIL; + dsDireccionesCliente.DataTable := NIL; + + if (FPedido.ID_CONTRATO_CLIENTE > 0) then + begin + AContratoController := TContratosClienteController.Create; + try + AContrato := AContratoController.Buscar(FPedido.ID_CONTRATO_CLIENTE); + if Assigned(AContrato) then + begin + AContrato.DataTable.Active := True; + AContratoController.RecuperarCliente(AContrato); + FDireccionesCliente := AContrato._Cliente.Direcciones; + end; + finally + AContratoController := NIL; + AContrato := NIL; + end; + end +end; + procedure TfrViewDireccionEntregaPedidoProv.RefrescarDireccion; begin txtDireccion.Caption := ''; @@ -184,22 +230,44 @@ begin txtDireccion.Caption := FPedido.CALLE; txtDireccion.Caption := txtDireccion.Caption + #13#10 + FPedido.CODIGO_POSTAL + ' ' + FPedido.POBLACION; txtDireccion.Caption := txtDireccion.Caption + #13#10 + FPedido.PROVINCIA; - if not esCadenaVacia(FPedido.PERSONA_CONTACTO) then - txtDireccion.Caption := txtDireccion.Caption + #13#10 + 'Persona contacto: ' + FPedido.PERSONA_CONTACTO; - if not esCadenaVacia(FPedido.TELEFONO) then - txtDireccion.Caption := txtDireccion.Caption + #13#10 + 'Teléfono: ' + FPedido.TELEFONO; + txtDireccion.Caption := txtDireccion.Caption + #13#10 + 'Persona contacto: ' + FPedido.PERSONA_CONTACTO; + txtDireccion.Caption := txtDireccion.Caption + #13#10 + 'Teléfono: ' + FPedido.TELEFONO; if (actOtro.Checked) then begin + txtDireccion.Enabled := True; + bModificar.Enabled := True; + cbLista.Enabled := False; cbLista.Text := ''; - bModificar.Enabled := True; + + cbListaDireccionesCliente.Enabled := False; + cbListaDireccionesCliente.Text := ''; + end else begin - txtDireccion.Enabled := False; - cbLista.Enabled := True; - cbLista.DroppedDown := True; - bModificar.Enabled := False; + if (actListaCliente.Checked) then + begin + cbListaDireccionesCliente.Enabled := True; + cbListaDireccionesCliente.DroppedDown := True; + + cbLista.Enabled := False; + cbLista.Text := ''; + + txtDireccion.Enabled := False; + bModificar.Enabled := False; + + end + else begin + cbLista.Enabled := True; + cbLista.DroppedDown := True; + + cbListaDireccionesCliente.Enabled := False; + cbListaDireccionesCliente.Text := ''; + + txtDireccion.Enabled := False; + bModificar.Enabled := False; + end; end; end; end; @@ -215,7 +283,13 @@ begin dsPedido.DataTable := FPedido.DataTable; cbLista.Properties.OnValidate := cbListaPropertiesValidate; - cbListaDireccionesCliente.Properties.OnValidate := cbListaDireccionesClientePropertiesValidate; + + RecuperarClienteAsociado; + if Assigned(FDireccionesCliente) then + begin + dsDireccionesCliente.DataTable := FDireccionesCliente.DataTable; + cbListaDireccionesCliente.Properties.OnValidate := cbListaDireccionesClientePropertiesValidate; + end; if (FPedido.ID_ALMACEN < 1) then actOtro.Checked := True @@ -231,6 +305,7 @@ begin if ReadOnly then begin rdxDestino1.Enabled := False; + rdxDestinoCliente.Enabled := False; rdxDestino2.Enabled := False; end; end; diff --git a/Source/Modulos/Pedidos a proveedor/Views/uViewPedidoProveedor.dfm b/Source/Modulos/Pedidos a proveedor/Views/uViewPedidoProveedor.dfm index 824ee14f..6cfb3ddc 100644 --- a/Source/Modulos/Pedidos a proveedor/Views/uViewPedidoProveedor.dfm +++ b/Source/Modulos/Pedidos a proveedor/Views/uViewPedidoProveedor.dfm @@ -39,7 +39,7 @@ inherited frViewPedidoProveedor: TfrViewPedidoProveedor Width = 357 Height = 215 Align = alClient - ExplicitWidth = 335 + ExplicitWidth = 357 ExplicitHeight = 215 inherited edtlNombre: TcxDBTextEdit ExplicitWidth = 283 @@ -178,8 +178,8 @@ inherited frViewPedidoProveedor: TfrViewPedidoProveedor inherited dxLayoutControl1: TdxLayoutControl Width = 273 Height = 166 - ExplicitWidth = 525 - ExplicitHeight = 116 + ExplicitWidth = 273 + ExplicitHeight = 166 inherited rdxDestino1: TRadioButton Width = 255 ExplicitWidth = 255 @@ -326,7 +326,7 @@ inherited frViewPedidoProveedor: TfrViewPedidoProveedor ExplicitHeight = 46 inherited dxLayoutControl1: TdxLayoutControl Width = 357 - ExplicitWidth = 335 + ExplicitWidth = 357 end end inline frViewObservaciones1: TfrViewObservaciones @@ -351,7 +351,7 @@ inherited frViewPedidoProveedor: TfrViewPedidoProveedor inherited memObservaciones: TcxDBMemo DataBinding.DataField = 'OBSERVACIONES' DataBinding.DataSource = DADataSource - ExplicitWidth = 389 + ExplicitWidth = 422 ExplicitHeight = 90 Height = 90 Width = 422 @@ -406,6 +406,7 @@ inherited frViewPedidoProveedor: TfrViewPedidoProveedor Top = 219 DataBinding.DataField = 'ID_VENDEDOR' DataBinding.DataSource = DADataSource + Properties.ImmediatePost = True Properties.KeyFieldNames = 'ID' Properties.ListColumns = < item diff --git a/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas b/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas index 49daff2d..285d965f 100644 --- a/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas +++ b/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas @@ -479,6 +479,7 @@ begin REFERENCIA := ''; SITUACION := SITUACION_PRESUPUESTO_PENDIENTE; end; + Result.AsignarVendedor; Result.Post; finally HideHourglassCursor; @@ -726,6 +727,7 @@ procedure TPresupuestosClienteController.EnviarPresupuestoPorEMail( var AReportController : IPresupuestosClienteReportController; AFicheroTMP : TFileName; + ATituloEnvio : String; AEMail : String; AListaEmail : TStringList; begin @@ -735,8 +737,6 @@ begin if APresupuesto.DataTable.Active then APresupuesto.DataTable.Active := True; - AFicheroTMP := DarFicheroPDFTemporal(EscapeIllegalChars(APresupuesto.REFERENCIA)); - AListaEmail := TStringList.Create; try RecuperarCliente(APresupuesto); @@ -754,10 +754,12 @@ begin end; ShowHourglassCursor; + ATituloEnvio := 'Presupuesto ' + APresupuesto.Cliente.NOMBRE + ' - ' + APresupuesto.REFERENCIA_CLIENTE; + AFicheroTMP := DarFicheroPDFTemporal(EscapeIllegalChars(ATituloEnvio)); AReportController := TPresupuestosClienteReportController.Create; try AReportController.ExportToPDF(APresupuesto.ID, AFicheroTMP); - SendMailMAPI('Presupuesto ' + APresupuesto.REFERENCIA, '', AFicheroTMP, '', '', APresupuesto.Cliente.NOMBRE, AEMail); + SendMailMAPI(ATituloEnvio, '', AFicheroTMP, '', '', APresupuesto.Cliente.NOMBRE, AEMail); finally DeleteFile(AFicheroTMP); AReportController := NIL; diff --git a/Source/Modulos/Presupuestos de cliente/Model/uBizPresupuestosCliente.pas b/Source/Modulos/Presupuestos de cliente/Model/uBizPresupuestosCliente.pas index 2221752e..d21d4c7e 100644 --- a/Source/Modulos/Presupuestos de cliente/Model/uBizPresupuestosCliente.pas +++ b/Source/Modulos/Presupuestos de cliente/Model/uBizPresupuestosCliente.pas @@ -34,6 +34,7 @@ type property Detalles: IBizDetallesPresupuestoCliente read GetDetalles write SetDetalles; procedure CalcularImporteTotal; + procedure AsignarVendedor; function EsNuevo : Boolean; function DarListaSituaciones: TStringList; @@ -45,7 +46,6 @@ type procedure CalcularIVA; procedure CalcularRE; procedure AsignarTipoIVA (IDTipoIVA : Integer); - procedure AsignarVendedor; protected FSeleccionableInterface : ISeleccionable; @@ -82,6 +82,8 @@ type public function DarListaSituaciones: TStringList; function EsNuevo : Boolean; + + procedure AsignarVendedor; procedure CalcularImporteTotal; property Cliente : IBizCliente read GetCliente write SetCliente; property _Cliente : IBizCliente read _GetCliente write _SetCliente; diff --git a/Source/Servidor/FactuGES_Server.dproj b/Source/Servidor/FactuGES_Server.dproj index b6fa7469..d93eba6d 100644 --- a/Source/Servidor/FactuGES_Server.dproj +++ b/Source/Servidor/FactuGES_Server.dproj @@ -28,7 +28,7 @@ Delphi.Personality - FalseTrueFalseTrueFalse2730FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.7.3.0FactuGES (Servidor)2.7.3.0miércoles, 01 de junio de 2016 9:42 + FalseTrueFalseTrueFalse2740FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.7.4.0FactuGES (Servidor)2.7.4.0viernes, 22 de julio de 2016 15:45 File C:\Documents and Settings\All Users\Documentos\RAD Studio\5.0\Bpl\dxPScxScheduler2LnkD11.bpl not found FactuGES_Server.dpr diff --git a/Source/Servidor/FactuGES_Server.rc b/Source/Servidor/FactuGES_Server.rc index 6c4bcbe3..59a83f0f 100644 --- a/Source/Servidor/FactuGES_Server.rc +++ b/Source/Servidor/FactuGES_Server.rc @@ -1,7 +1,7 @@ MAINICON ICON "C:\Codigo Acana\Resources\Iconos\Servidor.ico" 1 VERSIONINFO -FILEVERSION 2,7,3,0 -PRODUCTVERSION 2,7,3,0 +FILEVERSION 2,7,4,0 +PRODUCTVERSION 2,7,4,0 FILEFLAGSMASK 0x3FL FILEFLAGS 0x00L FILEOS 0x40004L @@ -13,10 +13,10 @@ BEGIN BLOCK "0C0A04E4" BEGIN VALUE "CompanyName", "Rodax Software S.L.\0" - VALUE "FileVersion", "2.7.3.0\0" + VALUE "FileVersion", "2.7.4.0\0" VALUE "ProductName", "FactuGES (Servidor)\0" - VALUE "ProductVersion", "2.7.3.0\0" - VALUE "CompileDate", "miércoles, 01 de junio de 2016 9:47\0" + VALUE "ProductVersion", "2.7.4.0\0" + VALUE "CompileDate", "viernes, 22 de julio de 2016 18:53\0" END END BLOCK "VarFileInfo" diff --git a/Source/Servidor/FactuGES_Server.res b/Source/Servidor/FactuGES_Server.res index b2a718185ec48e1e6c9ff25ec5974f109375dcfd..2e4abeca4ae5b102bea77ba1dd3a9b37097e0932 100644 GIT binary patch delta 113 zcmdn8jd9C1#tlZ1oGc9N3``6R3@nqaBV`$eKLotI6g91>6A&^V~@)a1e7)lxPfU5H0B1T|& SGa%oR!HU6z!F=-DD0cwSTN{c1