From ee6ba1a7c86736e48c144dcb98df3cc11a58b20c Mon Sep 17 00:00:00 2001 From: david Date: Tue, 2 Sep 2008 16:49:55 +0000 Subject: [PATCH] =?UTF-8?q?Ticket=20#91=20->=20En=20las=20obras,=20poner?= =?UTF-8?q?=20la=20direcci=C3=B3n=20del=20cliente=20como=20direcci=C3=B3n?= =?UTF-8?q?=20de=20la=20obra.?= 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.Tecsitel_FactuGES2/trunk@550 0c75b7a4-871f-7646-8a2f-f78d34cc349f --- .../Contactos/Views/Contactos_view.dpk | 2 +- .../Contactos/Views/Contactos_view.dproj | 78 ++++---- .../Contactos/Views/Contactos_view.res | Bin 384 -> 4748 bytes .../Obras/Controller/uObrasController.pas | 49 ++++- Source/Modulos/Obras/Obras_Group.groupproj | 16 +- Source/Modulos/Obras/Views/uViewObra.dfm | 177 ++++++++++++++---- Source/Modulos/Obras/Views/uViewObra.pas | 13 +- 7 files changed, 239 insertions(+), 96 deletions(-) diff --git a/Source/Modulos/Contactos/Views/Contactos_view.dpk b/Source/Modulos/Contactos/Views/Contactos_view.dpk index 7594ff77..fd43ae93 100644 --- a/Source/Modulos/Contactos/Views/Contactos_view.dpk +++ b/Source/Modulos/Contactos/Views/Contactos_view.dpk @@ -35,7 +35,7 @@ requires TiposIVA_model, TiposIVA_controller, Contactos_model, - Contactos_controller, + Contactos_controller, JvGlobusD11R, dbrtl, DataAbstract_Core_D11, diff --git a/Source/Modulos/Contactos/Views/Contactos_view.dproj b/Source/Modulos/Contactos/Views/Contactos_view.dproj index 13840958..34ad6710 100644 --- a/Source/Modulos/Contactos/Views/Contactos_view.dproj +++ b/Source/Modulos/Contactos/Views/Contactos_view.dproj @@ -49,52 +49,38 @@ MainSource - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
fEditorCliente
diff --git a/Source/Modulos/Contactos/Views/Contactos_view.res b/Source/Modulos/Contactos/Views/Contactos_view.res index 8b251f312bcccec5485024f6fe8d80e1cdf25746..1641339fcc482e7e3492d1b45813a86619622c33 100644 GIT binary patch literal 4748 zcmbW5&ub)A5XUPdpe&2#;C*uNAUVhgd+&(4um@dnom`vXF9g}ZuHJ;se=<3UNdFJg zbCw+UD9j$byGIXV`~6hC>h4S?F|k9X-j90q{Z_qtZ<;nUJCO8!h?p${kR>3GhM`oH*q zk=UsjOCIgA_4!`B+Gb&`I84R)bT4dy-BQV<-SyFz?R8ILEQ(+JB$u{sEXE@j@B*7W zT;iZH#|OJ<&DO$RCkM6VbK3(B(k{nbdv1lpc;E$xz9as|v3uE1V{hw2w~g3eD0an7 z{BT%G%irdMe*|oDJmgvJaA2`9B<6Xi*?M~Q;)@Sbfwf3uf zVaWkbUjU=;sL{BlYemIZXv%qZ{SZw{-TCU+;!nH6KDDIJumU+9{E0zXW4>7T)y|>$DQlv zRJe?TjSp{c!DqeayAnSMTtZZT;>LN7J0Rls+5m@q)MbyB*eL%Eu@(+$Cw}Pd@q7N| z%Q0*AHpCP^b9v`@jx-l_FD>khpW2W8(OU2&V5TrnoAY-m_hlcV?zq3;7{2gF{J#Hc z6R+o~mVenX?>@W0@_DVzyOFs(5464CY{!q9ChoF#_*eXi@4gFuV8?vhl=_w5$iKL0 zEV0nMBcN08xtRmsgJrqjh@s#|{?*ssnsG)mH*wa6{efF0JFWHok@kA5%b661{B38= zCcgJ|*ZFTpV$8<-&+AWpa)Q8*`wL&hMeNQ^v6I7$HSdLZhZ^&+6<@Uw_Zsml9^v3W zVvPDBKHh;i=RU4J_ta3E;)Mn>Y+L zKLZ0UQ+*km9FO-b?U4gmn-62iwzH6&*duKGo~aUV)bYDla8wWZ9+^7p-F<8lP@i!m z@vhbD_${F}h>^T;C(?(b*OJDk?{dEXB?nuehoON3HAb!7Mr7-ls!84-5V-jJugbu<_$}mU=Yd9!?TOX;|B-#B)+0x#9q*yqJiqS!`49d=7ztk$O+9=1i;?K_|J<8T z?0b7=-`Z3A#vV$4XJ5(lQ~TOZHUFdA%oWvK5zg&_IKXIbughQBA8XAsd#=@|TFLXC zy(^m((;DnQmDQKatmw!@c`| G?EMQ&4NnpP delta 11 ScmeBCZD5|Duvteife`=|>;pCc diff --git a/Source/Modulos/Obras/Controller/uObrasController.pas b/Source/Modulos/Obras/Controller/uObrasController.pas index fa8fd9ce..f818b713 100644 --- a/Source/Modulos/Obras/Controller/uObrasController.pas +++ b/Source/Modulos/Obras/Controller/uObrasController.pas @@ -5,7 +5,7 @@ interface uses Classes, SysUtils, uDADataTable, uControllerBase, uEditorDBItem, - uIDataModuleObras, uBizObras, uBizDireccionesContacto; + uIDataModuleObras, uBizObras, uBizDireccionesContacto, uBizContactos; type IObrasController = interface(IControllerBase) @@ -27,7 +27,8 @@ type procedure Print(AObra : IBizObra); procedure QuitarDireccion(AObra: IBizObra); - procedure CopiarDireccion (const ADireccionEnvio: IBizDireccionesContacto; AObra: IBizObra); + procedure CopiarDireccion (const ADireccionEnvio: IBizDireccionesContacto; AObra: IBizObra); overload; + procedure CopiarDireccion (const ACliente: IBizCliente; AObra: IBizObra); overload; end; TObrasController = class(TControllerBase, IObrasController) @@ -71,7 +72,8 @@ type procedure Print(AObra : IBizObra); procedure QuitarDireccion(AObra: IBizObra); - procedure CopiarDireccion (const ADireccionEnvio: IBizDireccionesContacto; AObra: IBizObra); + procedure CopiarDireccion (const ADireccionEnvio: IBizDireccionesContacto; AObra: IBizObra); overload; + procedure CopiarDireccion (const ACliente: IBizCliente; AObra: IBizObra); overload; end; implementation @@ -164,6 +166,45 @@ begin end; end; +procedure TObrasController.CopiarDireccion(const ACliente: IBizCliente; + AObra: IBizObra); +var + bEnEdicion : Boolean; +begin + if not Assigned(AObra) then + raise Exception.Create ('Obra no asignada (CopiarDireccion)'); + + if not Assigned(ACliente) then + raise Exception.Create ('No se ha indicado el cliente (CopiarDireccionEnvio)'); + + if AObra.DataTable.Active then + AObra.DataTable.Active := True; + + if ACliente.DataTable.Active then + ACliente.DataTable.Active := True; + + + bEnEdicion := (AObra.DataTable.State in dsEditModes); + if not bEnEdicion then + AObra.Edit; + + ShowHourglassCursor; + AObra.Edit; + try + AObra.CALLE := ACliente.CALLE; + AObra.POBLACION := ACliente.POBLACION; + AObra.CODIGO_POSTAL := ACliente.CODIGO_POSTAL; + AObra.PROVINCIA := ACliente.PROVINCIA; + AObra.TELEFONO := ACliente.TELEFONO_1; + AObra.PERSONA_CONTACTO := ACliente.PERSONA_CONTACTO; + + if not bEnEdicion then + AObra.Post; + finally + HideHourglassCursor; + end; +end; + constructor TObrasController.Create; begin inherited; @@ -221,8 +262,6 @@ end; function TObrasController.ValidarObra(AObra: IBizObra): Boolean; begin - Result := False; - if not Assigned(AObra) then raise Exception.Create ('Obra no asignada'); diff --git a/Source/Modulos/Obras/Obras_Group.groupproj b/Source/Modulos/Obras/Obras_Group.groupproj index a9b568d1..470febc4 100644 --- a/Source/Modulos/Obras/Obras_Group.groupproj +++ b/Source/Modulos/Obras/Obras_Group.groupproj @@ -6,6 +6,7 @@ + @@ -103,6 +104,15 @@ + + + + + + + + + @@ -122,13 +132,13 @@ - + - + - + \ No newline at end of file diff --git a/Source/Modulos/Obras/Views/uViewObra.dfm b/Source/Modulos/Obras/Views/uViewObra.dfm index 9e446aec..aaf0d610 100644 --- a/Source/Modulos/Obras/Views/uViewObra.dfm +++ b/Source/Modulos/Obras/Views/uViewObra.dfm @@ -1,23 +1,24 @@ inherited frViewObra: TfrViewObra - Width = 924 - Height = 548 + Width = 841 + Height = 487 Align = alClient ExplicitWidth = 451 ExplicitHeight = 304 object dxLayoutControlObra: TdxLayoutControl Left = 0 Top = 0 - Width = 924 - Height = 548 + Width = 841 + Height = 487 Align = alClient ParentBackground = True TabOrder = 0 TabStop = False AutoContentSizes = [acsWidth, acsHeight] - ExplicitHeight = 497 + ExplicitWidth = 451 + ExplicitHeight = 304 DesignSize = ( - 924 - 548) + 841 + 487) object eNombre: TcxDBTextEdit Left = 130 Top = 34 @@ -30,9 +31,13 @@ inherited frViewObra: TfrViewObra Style.Color = 14745599 Style.HotTrack = False Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.SkinName = '' TabOrder = 0 Width = 116 end @@ -46,9 +51,13 @@ inherited frViewObra: TfrViewObra Style.BorderStyle = ebs3D Style.HotTrack = False Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.SkinName = '' TabOrder = 1 Width = 116 end @@ -61,9 +70,13 @@ inherited frViewObra: TfrViewObra Style.BorderStyle = ebs3D Style.HotTrack = False Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.SkinName = '' TabOrder = 6 Width = 116 end @@ -76,9 +89,13 @@ inherited frViewObra: TfrViewObra Style.BorderStyle = ebs3D Style.HotTrack = False Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.SkinName = '' TabOrder = 7 Width = 116 end @@ -91,9 +108,13 @@ inherited frViewObra: TfrViewObra Style.BorderStyle = ebs3D Style.HotTrack = False Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.SkinName = '' TabOrder = 8 Width = 116 end @@ -107,12 +128,16 @@ inherited frViewObra: TfrViewObra Style.HotTrack = False Style.LookAndFeel.Kind = lfStandard Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.Kind = lfStandard StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.Kind = lfStandard StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.Kind = lfStandard StyleHot.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.SkinName = '' TabOrder = 2 Width = 116 end @@ -130,19 +155,23 @@ inherited frViewObra: TfrViewObra Style.HotTrack = False Style.LookAndFeel.Kind = lfStandard Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' Style.ButtonStyle = bts3D Style.PopupBorderStyle = epbsFrame3D StyleDisabled.LookAndFeel.Kind = lfStandard StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.Kind = lfStandard StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.Kind = lfStandard StyleHot.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.SkinName = '' TabOrder = 5 Width = 203 end object eCodigoPostal: TcxDBTextEdit - Left = 351 + Left = 310 Top = 145 DataBinding.DataField = 'CODIGO_POSTAL' DataBinding.DataSource = DADataSource @@ -151,12 +180,16 @@ inherited frViewObra: TfrViewObra Style.HotTrack = False Style.LookAndFeel.Kind = lfStandard Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.Kind = lfStandard StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.Kind = lfStandard StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.Kind = lfStandard StyleHot.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.SkinName = '' TabOrder = 4 Width = 91 end @@ -174,14 +207,18 @@ inherited frViewObra: TfrViewObra Style.HotTrack = False Style.LookAndFeel.Kind = lfStandard Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' Style.ButtonStyle = bts3D Style.PopupBorderStyle = epbsFrame3D StyleDisabled.LookAndFeel.Kind = lfStandard StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.Kind = lfStandard StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.Kind = lfStandard StyleHot.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.SkinName = '' TabOrder = 3 Width = 253 end @@ -195,19 +232,23 @@ inherited frViewObra: TfrViewObra Style.BorderStyle = ebs3D Style.LookAndFeel.Kind = lfStandard Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.Kind = lfStandard StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.Kind = lfStandard StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.Kind = lfStandard StyleHot.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.SkinName = '' TabOrder = 9 Height = 246 Width = 224 end inline frViewSubcontrataObra1: TfrViewSubcontrataObra - Left = 472 - Top = 34 + Left = 431 + Top = 283 Width = 503 Height = 159 Font.Charset = DEFAULT_CHARSET @@ -216,10 +257,10 @@ inherited frViewObra: TfrViewObra Font.Name = 'Tahoma' Font.Style = [] ParentFont = False - TabOrder = 10 + TabOrder = 11 ReadOnly = False - ExplicitLeft = 472 - ExplicitTop = 34 + ExplicitLeft = 431 + ExplicitTop = 283 ExplicitWidth = 503 ExplicitHeight = 159 inherited dxLayoutControl1: TdxLayoutControl @@ -231,42 +272,78 @@ inherited frViewObra: TfrViewObra 503 265) inherited edtlNombre: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 375 Width = 375 end inherited edtNIFCIF: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 375 Width = 375 end inherited edtCalle: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 375 Width = 375 end inherited edtPoblacion: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 257 Width = 257 end inherited edtProvincia: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 375 Width = 375 end inherited edtCodigoPostal: TcxDBTextEdit - Left = 338 - ExplicitLeft = 338 + Left = 296 + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + ExplicitLeft = 296 end inherited Button3: TBitBtn - Left = 197 - ExplicitLeft = 197 + Left = 155 + ExplicitLeft = 155 end inherited edtPersonaContacto: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 375 Width = 375 end inherited edtReferenciaAsignada: TcxDBTextEdit - Left = 299 - ExplicitLeft = 299 + Left = 257 + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + ExplicitLeft = 257 end inherited edtTlf: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 182 Width = 182 end @@ -285,8 +362,8 @@ inherited frViewObra: TfrViewObra end end inline frViewClienteAsociadoObra1: TfrViewClienteAsociadoObra - Left = 472 - Top = 229 + Left = 431 + Top = 34 Width = 503 Height = 213 Font.Charset = DEFAULT_CHARSET @@ -295,10 +372,10 @@ inherited frViewObra: TfrViewObra Font.Name = 'Tahoma' Font.Style = [] ParentFont = False - TabOrder = 11 + TabOrder = 10 ReadOnly = False - ExplicitLeft = 472 - ExplicitTop = 229 + ExplicitLeft = 431 + ExplicitTop = 34 ExplicitWidth = 503 ExplicitHeight = 213 inherited dxLayoutControl1: TdxLayoutControl @@ -307,32 +384,56 @@ inherited frViewObra: TfrViewObra ExplicitWidth = 503 ExplicitHeight = 213 inherited edtlNombre: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 429 Width = 429 end inherited edtNIFCIF: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 429 Width = 429 end inherited edtCalle: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 429 Width = 429 end inherited edtPoblacion: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 311 Width = 311 end inherited edtProvincia: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 429 Width = 429 end inherited edtCodigoPostal: TcxDBTextEdit - Left = 338 - ExplicitLeft = 338 + Left = 296 + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + ExplicitLeft = 296 end inherited Button3: TBitBtn - Left = 228 - ExplicitLeft = 228 + Left = 186 + ExplicitLeft = 186 end end end @@ -448,16 +549,6 @@ inherited frViewObra: TfrViewObra ShowCaption = False Hidden = True ShowBorder = False - object dxLayoutControlObraGroup9: TdxLayoutGroup - AutoAligns = [aaVertical] - AlignHorz = ahClient - Caption = 'Subcontrata' - object dxLayoutControlObraItem8: TdxLayoutItem - Control = frViewSubcontrataObra1 - ControlOptions.AutoColor = True - ControlOptions.ShowBorder = False - end - end object dxLayoutControlObraGroup7: TdxLayoutGroup AutoAligns = [] AlignHorz = ahClient @@ -470,6 +561,16 @@ inherited frViewObra: TfrViewObra ControlOptions.ShowBorder = False end end + object dxLayoutControlObraGroup9: TdxLayoutGroup + AutoAligns = [aaVertical] + AlignHorz = ahClient + Caption = 'Subcontrata' + object dxLayoutControlObraItem8: TdxLayoutItem + Control = frViewSubcontrataObra1 + ControlOptions.AutoColor = True + ControlOptions.ShowBorder = False + end + end end end end diff --git a/Source/Modulos/Obras/Views/uViewObra.pas b/Source/Modulos/Obras/Views/uViewObra.pas index 148a5b94..48814942 100644 --- a/Source/Modulos/Obras/Views/uViewObra.pas +++ b/Source/Modulos/Obras/Views/uViewObra.pas @@ -88,7 +88,7 @@ implementation uses uDataModuleObras, uProvinciasPoblacionesController, uStringsUtils, - uClientesController, uBizDireccionesContacto; + uClientesController, uBizDireccionesContacto, uDialogUtils; {$R *.dfm} @@ -207,13 +207,14 @@ procedure TfrViewObra.OnClienteChanged(Sender: TObject); var AClientesController : IClientesController; ADireccion : IBizDireccionesContacto; - + AVerMensaje : Boolean; begin if Assigned(FObra) then begin FObra.Edit; FObra.ID_CLIENTE := frViewClienteAsociadoObra1.ID_Cliente; + AVerMensaje := False; AClientesController := TClientesController.Create; try { // Esto podría ser configurable en el programa @@ -222,10 +223,12 @@ begin case frViewClienteAsociadoObra1.Cliente.Direcciones.RecordCount of 0 : begin - FController.QuitarDireccion(FObra); + FController.CopiarDireccion(frViewClienteAsociadoObra1.Cliente, FObra); + AVerMensaje := True; end; 1 : begin FController.CopiarDireccion(frViewClienteAsociadoObra1.Cliente.Direcciones, FObra); + AVerMensaje := True; end else begin ADireccion := AClientesController.ElegirDireccionEntrega(frViewClienteAsociadoObra1.Cliente.Direcciones, ''); @@ -242,6 +245,10 @@ begin finally AClientesController := NIL; end; + + if AVerMensaje then + ShowInfoMessage('Dirección de la obra actualizada.', 'Se ha actualizado los datos de la dirección de la obra con los datos del cliente.'); + end; end;