Se modifica funcionalidad en documentos para que al cambiar de cliente se obtenga forma de pago y tipo de iva asignado en la ficha (Solicitado po Angélica)

git-svn-id: https://192.168.0.254/svn/Proyectos.AbetoDesign_FactuGES/trunk@108 93f398dd-4eb6-7a46-baf6-13f46f578da2
This commit is contained in:
roberto 2015-12-04 12:18:02 +00:00
parent 53b7ea61fd
commit 7b9599f881
10 changed files with 139 additions and 33 deletions

Binary file not shown.

View File

@ -154,7 +154,8 @@ uses
uBizContactos, uDataTableUtils, uDataModuleUsuarios, uFactuGES_App, uBizContactos, uDataTableUtils, uDataModuleUsuarios, uFactuGES_App,
schContratosClienteClient_Intf, uDAInterfaces, uDateUtils, uIEditorContratoCliente, schContratosClienteClient_Intf, uDAInterfaces, uDateUtils, uIEditorContratoCliente,
uIEditorElegirContratosCliente, uIEditorDireccionEntregaContratoCliente, uIEditorElegirContratosCliente, uIEditorDireccionEntregaContratoCliente,
schContactosClient_Intf, uContratosClienteReportController, uFormasPagoController, uBizFormasPago, schContactosClient_Intf, uContratosClienteReportController,
uFormasPagoController, uBizFormasPago, uTiposIVAController, uBizTiposIVA,
uSistemaFunc, uEMailUtils, uDialogElegirEMail, Dialogs, uStringsUtils, uSistemaFunc, uEMailUtils, uDialogElegirEMail, Dialogs, uStringsUtils,
uIEditorContratosClienteBeneficios, uPresupuestosClienteController, uIEditorContratosClienteBeneficios, uPresupuestosClienteController,
uConfiguracionController, uBizDetallesPresupuestoCliente; uConfiguracionController, uBizDetallesPresupuestoCliente;
@ -166,12 +167,21 @@ procedure TContratosClienteController.ActualizarFormaDePago(
var var
AFormasPago : IBizFormaPago; AFormasPago : IBizFormaPago;
AFormasPagoController : IFormasPagoController; AFormasPagoController : IFormasPagoController;
ATiposIVA : IBizTipoIVA;
ATiposIVAController : ITiposIVAController;
bEnEdicion : Boolean; bEnEdicion : Boolean;
begin begin
AFormasPagoController := TFormasPagoController.Create; AFormasPagoController := TFormasPagoController.Create;
AFormasPago := AFormasPagoController.Buscar(ID_FORMA_PAGO); AFormasPago := AFormasPagoController.Buscar(ID_FORMA_PAGO);
AFormasPago.Open; AFormasPago.Open;
//Se cambia tambien el tipo de IVA por el de la ficha a peticion de Angelica
ATiposIVAController := TTiposIVAController.Create;
ATiposIVA := ATiposIVAController.Buscar(AContrato.Cliente.ID_TIPO_IVA);
ATiposIVA.Open;
bEnEdicion := (AContrato.DataTable.State in dsEditModes); bEnEdicion := (AContrato.DataTable.State in dsEditModes);
if not bEnEdicion then if not bEnEdicion then
AContrato.Edit; AContrato.Edit;
@ -179,11 +189,16 @@ begin
AContrato.ID_FORMA_PAGO := AFormasPago.ID; AContrato.ID_FORMA_PAGO := AFormasPago.ID;
AContrato.DataTable.FieldByName(fld_ContratosClienteFORMA_PAGO).AsString := AFormasPago.DESCRIPCION; AContrato.DataTable.FieldByName(fld_ContratosClienteFORMA_PAGO).AsString := AFormasPago.DESCRIPCION;
AContrato.ID_TIPO_IVA := ATiposIva.ID;
if not bEnEdicion then if not bEnEdicion then
AContrato.Post; AContrato.Post;
AFormasPago := NIL; AFormasPago := NIL;
AFormasPagoController := NIL; AFormasPagoController := NIL;
ATiposIVA := NIL;
ATiposIVAController := NIL;
end; end;
function TContratosClienteController.Anadir(AContrato : IBizContratoCliente; function TContratosClienteController.Anadir(AContrato : IBizContratoCliente;

View File

@ -316,7 +316,7 @@ begin
APrimerCliente := (FContrato.Cliente.ID = 0); APrimerCliente := (FContrato.Cliente.ID = 0);
FContrato.Cliente := ViewContrato.ViewClienteContrato.Cliente; FContrato.Cliente := ViewContrato.ViewClienteContrato.Cliente;
if (ShowConfirmMessage('Cambio forma de pago', '¿Desea actualizar la forma de pago a la asignada en la ficha del cliente seleccionado?') = IDYES) then if (ShowConfirmMessage('Cambio forma de pago y tipo de IVA', '¿Desea actualizar la forma de pago y el tipo de IVA a la asignada en la ficha del cliente seleccionado?') = IDYES) then
FController.ActualizarFormaDePago(FContrato, FContrato.Cliente.ID_FORMA_PAGO); FController.ActualizarFormaDePago(FContrato, FContrato.Cliente.ID_FORMA_PAGO);
if (not APrimerCliente) and (FContrato.Detalles.RecordCount > 0) then begin if (not APrimerCliente) and (FContrato.Detalles.RecordCount > 0) then begin

View File

@ -132,7 +132,8 @@ uses
uDataModuleUsuarios, uDAInterfaces, uDataTableUtils, uAlbaranesClienteController, uDataModuleUsuarios, uDAInterfaces, uDataTableUtils, uAlbaranesClienteController,
schAlbaranesClienteClient_Intf, uROTypes, uDetallesAlbaranClienteController, schAlbaranesClienteClient_Intf, uROTypes, uDetallesAlbaranClienteController,
uBizDetallesAlbaranCliente, uFacturasClienteReportController, DateUtils, Forms, uBizDetallesAlbaranCliente, uFacturasClienteReportController, DateUtils, Forms,
Dialogs, uIntegerListUtils, uFormasPagoController, uBizFormasPago, uIEditorElegirFacturasCliente, Dialogs, uIntegerListUtils, uIEditorElegirFacturasCliente,
uFormasPagoController, uBizFormasPago, uTiposIVAController, uBizTiposIVA,
uBizEjercicios, uRecibosClienteController, uBizRecibosCliente; uBizEjercicios, uRecibosClienteController, uBizRecibosCliente;
@ -209,24 +210,37 @@ procedure TFacturasClienteController.ActualizarFormaDePago(
var var
AFormasPago : IBizFormaPago; AFormasPago : IBizFormaPago;
AFormasPagoController : IFormasPagoController; AFormasPagoController : IFormasPagoController;
ATiposIVA : IBizTipoIVA;
ATiposIVAController : ITiposIVAController;
bEnEdicion : Boolean; bEnEdicion : Boolean;
begin begin
AFormasPagoController := TFormasPagoController.Create; AFormasPagoController := TFormasPagoController.Create;
AFormasPago := AFormasPagoController.Buscar(ID_FORMA_PAGO); AFormasPago := AFormasPagoController.Buscar(ID_FORMA_PAGO);
AFormasPago.Open; AFormasPago.Open;
//Se cambia tambien el tipo de IVA por el de la ficha a peticion de Angelica
ATiposIVAController := TTiposIVAController.Create;
ATiposIVA := ATiposIVAController.Buscar(AFactura.Cliente.ID_TIPO_IVA);
ATiposIVA.Open;
bEnEdicion := (AFactura.DataTable.State in dsEditModes); bEnEdicion := (AFactura.DataTable.State in dsEditModes);
if not bEnEdicion then if not bEnEdicion then
AFactura.Edit; AFactura.Edit;
AFactura.ID_FORMA_PAGO := AFormasPago.ID; AFactura.ID_FORMA_PAGO := AFormasPago.ID;
// AFactura.DataTable.FieldByName(fld_FacturasClienteFORMA_PAGO).AsString := AFormasPago.DESCRIPCION; // AFactura.DataTable.FieldByName(fld_FacturasClienteFORMA_PAGO).AsString := AFormasPago.DESCRIPCION;
AFactura.ID_TIPO_IVA := ATiposIva.ID;
if not bEnEdicion then if not bEnEdicion then
AFactura.Post; AFactura.Post;
AFormasPago := NIL; AFormasPago := NIL;
AFormasPagoController := NIL; AFormasPagoController := NIL;
ATiposIVA := NIL;
ATiposIVAController := NIL;
end; end;
function TFacturasClienteController.Anadir(AFacturas: IBizFacturaCliente; function TFacturasClienteController.Anadir(AFacturas: IBizFacturaCliente;

View File

@ -136,12 +136,11 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
ExplicitWidth = 78 ExplicitWidth = 78
Width = 78 Width = 78
end end
inherited bFormasPago: TButton
Left = 279
ExplicitLeft = 279
end
inherited frViewTienda1: TfrViewTienda inherited frViewTienda1: TfrViewTienda
Width = 351
ExplicitWidth = 351
inherited dxLayoutControl1: TdxLayoutControl inherited dxLayoutControl1: TdxLayoutControl
Width = 351
inherited cbTienda: TcxComboBox inherited cbTienda: TcxComboBox
Style.LookAndFeel.SkinName = '' Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.SkinName = ''
@ -153,9 +152,7 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
end end
end end
inherited frViewClienteFactura1: TfrViewClienteFactura inherited frViewClienteFactura1: TfrViewClienteFactura
Left = 439
Width = 398 Width = 398
ExplicitLeft = 439
ExplicitWidth = 398 ExplicitWidth = 398
inherited dxLayoutControl1: TdxLayoutControl inherited dxLayoutControl1: TdxLayoutControl
Width = 398 Width = 398
@ -209,17 +206,17 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
Width = 276 Width = 276
end end
inherited edtCodigoPostal: TcxDBTextEdit inherited edtCodigoPostal: TcxDBTextEdit
Left = 274 Left = 256
DataBinding.DataSource = dsDataTable DataBinding.DataSource = dsDataTable
Style.LookAndFeel.SkinName = '' Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = ''
ExplicitLeft = 274 ExplicitLeft = 256
end end
inherited Button3: TBitBtn inherited Button3: TBitBtn
Left = 164 Left = 146
ExplicitLeft = 164 ExplicitLeft = 146
end end
inherited cxDBTextEdit1: TcxDBTextEdit inherited cxDBTextEdit1: TcxDBTextEdit
Style.LookAndFeel.SkinName = '' Style.LookAndFeel.SkinName = ''

View File

@ -366,7 +366,7 @@ begin
begin begin
APrimerCliente := (FFactura.Cliente.ID = 0); APrimerCliente := (FFactura.Cliente.ID = 0);
if (ShowConfirmMessage('Cambio forma de pago', '¿Desea actualizar la forma de pago a la asignada en la ficha del cliente seleccionado?') = IDYES) then if (ShowConfirmMessage('Cambio forma de pago y tipo de IVA', '¿Desea actualizar la forma de pago y el tipo de IVA a la asignada en la ficha del cliente seleccionado?') = IDYES) then
FController.ActualizarFormaDePago(FFactura, FFactura.Cliente.ID_FORMA_PAGO); FController.ActualizarFormaDePago(FFactura, FFactura.Cliente.ID_FORMA_PAGO);
if (not APrimerCliente) and (FFactura.Detalles.RecordCount > 0) then begin if (not APrimerCliente) and (FFactura.Detalles.RecordCount > 0) then begin

View File

@ -201,7 +201,8 @@ uses
uBizContactos, uDataTableUtils, uDataModuleUsuarios, uFactuGES_App, uConfiguracionController, uBizContactos, uDataTableUtils, uDataModuleUsuarios, uFactuGES_App, uConfiguracionController,
schPresupuestosClienteClient_Intf, uDAInterfaces, uDateUtils, uIEditorPresupuestoCliente, schPresupuestosClienteClient_Intf, uDAInterfaces, uDateUtils, uIEditorPresupuestoCliente,
uIEditorElegirPresupuestosCliente, uIEditorDireccionEntregaPresupuestoCliente, uIEditorElegirPresupuestosCliente, uIEditorDireccionEntregaPresupuestoCliente,
schContactosClient_Intf, uPresupuestosClienteReportController, uFormasPagoController, uBizFormasPago, schContactosClient_Intf, uPresupuestosClienteReportController,
uFormasPagoController, uBizFormasPago, uTiposIVAController, uBizTiposIVA,
uSistemaFunc, uEMailUtils, uDialogElegirEMail, Dialogs, uStringsUtils; uSistemaFunc, uEMailUtils, uDialogElegirEMail, Dialogs, uStringsUtils;
{ TPresupuestosClienteController } { TPresupuestosClienteController }
@ -210,12 +211,21 @@ procedure TPresupuestosClienteController.ActualizarFormaDePago(APresupuesto: IBi
var var
AFormasPago : IBizFormaPago; AFormasPago : IBizFormaPago;
AFormasPagoController : IFormasPagoController; AFormasPagoController : IFormasPagoController;
ATiposIVA : IBizTipoIVA;
ATiposIVAController : ITiposIVAController;
bEnEdicion : Boolean; bEnEdicion : Boolean;
begin begin
AFormasPagoController := TFormasPagoController.Create; AFormasPagoController := TFormasPagoController.Create;
AFormasPago := AFormasPagoController.Buscar(ID_FORMA_PAGO); AFormasPago := AFormasPagoController.Buscar(ID_FORMA_PAGO);
AFormasPago.Open; AFormasPago.Open;
//Se cambia tambien el tipo de IVA por el de la ficha a peticion de Angelica
ATiposIVAController := TTiposIVAController.Create;
ATiposIVA := ATiposIVAController.Buscar(APresupuesto.Cliente.ID_TIPO_IVA);
ATiposIVA.Open;
bEnEdicion := (APresupuesto.DataTable.State in dsEditModes); bEnEdicion := (APresupuesto.DataTable.State in dsEditModes);
if not bEnEdicion then if not bEnEdicion then
APresupuesto.Edit; APresupuesto.Edit;
@ -223,11 +233,16 @@ begin
APresupuesto.ID_FORMA_PAGO := AFormasPago.ID; APresupuesto.ID_FORMA_PAGO := AFormasPago.ID;
APresupuesto.DataTable.FieldByName(fld_PresupuestosClienteFORMA_PAGO).AsString := AFormasPago.DESCRIPCION; APresupuesto.DataTable.FieldByName(fld_PresupuestosClienteFORMA_PAGO).AsString := AFormasPago.DESCRIPCION;
APresupuesto.ID_TIPO_IVA := ATiposIva.ID;
if not bEnEdicion then if not bEnEdicion then
APresupuesto.Post; APresupuesto.Post;
AFormasPago := NIL; AFormasPago := NIL;
AFormasPagoController := NIL; AFormasPagoController := NIL;
ATiposIVA := NIL;
ATiposIVAController := NIL;
end; end;
function TPresupuestosClienteController.Anadir(APresupuesto: IBizPresupuestoCliente; const ATipo: TEnumTiposPresupuesto): Boolean; function TPresupuestosClienteController.Anadir(APresupuesto: IBizPresupuestoCliente; const ATipo: TEnumTiposPresupuesto): Boolean;

View File

@ -202,52 +202,117 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
ParentFont = False ParentFont = False
TabOrder = 0 TabOrder = 0
ReadOnly = False ReadOnly = False
ExplicitLeft = -61 ExplicitWidth = 834
ExplicitTop = -269 ExplicitHeight = 286
inherited dxLayoutControl1: TdxLayoutControl inherited dxLayoutControl1: TdxLayoutControl
Width = 834 Width = 834
Height = 286 Height = 286
ExplicitWidth = 834
ExplicitHeight = 286
inherited edtFechaPresupuesto: TcxDBDateEdit
ExplicitWidth = 187
Width = 187
end
inherited memObservaciones: TcxDBMemo inherited memObservaciones: TcxDBMemo
Left = 398 Left = 399
ExplicitLeft = 398 ExplicitLeft = 399
ExplicitWidth = 793
Width = 793
end
inherited eReferencia: TcxDBTextEdit
ExplicitWidth = 122
Width = 122
end
inherited cbFormaPago: TcxDBLookupComboBox
ExplicitWidth = 122
Width = 122
end end
inherited bFormasPago: TButton inherited bFormasPago: TButton
Left = 236 Left = 237
ExplicitLeft = 236 ExplicitLeft = 237
end end
inherited edtFechaDecision: TcxDBDateEdit inherited edtFechaDecision: TcxDBDateEdit
Left = 281 Left = 281
ExplicitLeft = 281 ExplicitLeft = 281
ExplicitWidth = 260
Width = 260
end
inherited edtFechaVigencia: TcxDBDateEdit
ExplicitWidth = 260
Width = 260
end
inherited cbSituacion: TcxDBImageComboBox
ExplicitWidth = 260
Width = 260
end end
inherited frViewDatosYSeleccionClientePresupuesto1: TfrViewDatosYSeleccionClientePresupuesto inherited frViewDatosYSeleccionClientePresupuesto1: TfrViewDatosYSeleccionClientePresupuesto
Left = 398 Left = 399
ExplicitLeft = 398 Width = 320
ExplicitLeft = 399
ExplicitWidth = 320
inherited dxLayoutControl1: TdxLayoutControl inherited dxLayoutControl1: TdxLayoutControl
Width = 320
inherited edtlNombre: TcxDBTextEdit
ExplicitWidth = 202
Width = 202
end
inherited edtNIFCIF: TcxDBTextEdit inherited edtNIFCIF: TcxDBTextEdit
Left = 282 Left = 281
ExplicitLeft = 282 ExplicitLeft = 281
end end
inherited Button3: TBitBtn inherited Button3: TBitBtn
Left = 193 Left = 192
ExplicitLeft = 193 ExplicitLeft = 192
end
inherited edtPersonaContacto: TcxDBTextEdit
ExplicitWidth = 329
Width = 329
end
inherited edtDireccion: TcxMemo
ExplicitWidth = 121
Width = 121
end end
inherited Button4: TButton inherited Button4: TButton
Left = 362 Left = 361
ExplicitLeft = 362 ExplicitLeft = 361
end end
inherited Button5: TButton inherited Button5: TButton
Left = 362 Left = 361
ExplicitLeft = 362 ExplicitLeft = 361
end
inherited edtTelefonos: TcxTextEdit
ExplicitWidth = 193
Width = 193
end end
end end
end end
inherited memFormaPago: TcxDBMemo
ExplicitWidth = 475
ExplicitHeight = 44
Height = 44
Width = 475
end
inherited memPlazoEntrega: TcxDBMemo inherited memPlazoEntrega: TcxDBMemo
Top = 303 Top = 303
ExplicitTop = 303 ExplicitTop = 303
ExplicitWidth = 396
ExplicitHeight = 100
Height = 100
Width = 396
end
inherited cbVendedor: TcxDBLookupComboBox
ExplicitWidth = 27
Width = 27
end end
inherited cbTipoPresupuesto: TcxDBComboBox inherited cbTipoPresupuesto: TcxDBComboBox
Left = 276 Left = 276
ExplicitLeft = 276 ExplicitLeft = 276
ExplicitWidth = 186
Width = 186
end
inherited edtlReferenciaCliente: TcxDBTextEdit
ExplicitWidth = 204
Width = 204
end end
end end
end end

View File

@ -300,7 +300,7 @@ begin
APrimerCliente := (FPresupuesto.Cliente.ID = 0); APrimerCliente := (FPresupuesto.Cliente.ID = 0);
FPresupuesto.Cliente := ViewPresupuesto.ViewClientePresupuesto.Cliente; FPresupuesto.Cliente := ViewPresupuesto.ViewClientePresupuesto.Cliente;
if (ShowConfirmMessage('Cambio forma de pago', '¿Desea actualizar la forma de pago a la asignada en la ficha del cliente seleccionado?') = IDYES) then if (ShowConfirmMessage('Cambio forma de pago y tipo de IVA', '¿Desea actualizar la forma de pago y el tipo de IVA a la asignada en la ficha del cliente seleccionado?') = IDYES) then
FController.ActualizarFormaDePago(FPresupuesto, FPresupuesto.Cliente.ID_FORMA_PAGO); FController.ActualizarFormaDePago(FPresupuesto, FPresupuesto.Cliente.ID_FORMA_PAGO);
if (not APrimerCliente) and (FPresupuesto.Detalles.RecordCount > 0) then begin if (not APrimerCliente) and (FPresupuesto.Detalles.RecordCount > 0) then begin

Binary file not shown.