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:
parent
53b7ea61fd
commit
7b9599f881
BIN
Build/Build.fbl6
BIN
Build/Build.fbl6
Binary file not shown.
@ -154,7 +154,8 @@ uses
|
||||
uBizContactos, uDataTableUtils, uDataModuleUsuarios, uFactuGES_App,
|
||||
schContratosClienteClient_Intf, uDAInterfaces, uDateUtils, uIEditorContratoCliente,
|
||||
uIEditorElegirContratosCliente, uIEditorDireccionEntregaContratoCliente,
|
||||
schContactosClient_Intf, uContratosClienteReportController, uFormasPagoController, uBizFormasPago,
|
||||
schContactosClient_Intf, uContratosClienteReportController,
|
||||
uFormasPagoController, uBizFormasPago, uTiposIVAController, uBizTiposIVA,
|
||||
uSistemaFunc, uEMailUtils, uDialogElegirEMail, Dialogs, uStringsUtils,
|
||||
uIEditorContratosClienteBeneficios, uPresupuestosClienteController,
|
||||
uConfiguracionController, uBizDetallesPresupuestoCliente;
|
||||
@ -166,12 +167,21 @@ procedure TContratosClienteController.ActualizarFormaDePago(
|
||||
var
|
||||
AFormasPago : IBizFormaPago;
|
||||
AFormasPagoController : IFormasPagoController;
|
||||
ATiposIVA : IBizTipoIVA;
|
||||
ATiposIVAController : ITiposIVAController;
|
||||
|
||||
bEnEdicion : Boolean;
|
||||
begin
|
||||
AFormasPagoController := TFormasPagoController.Create;
|
||||
AFormasPago := AFormasPagoController.Buscar(ID_FORMA_PAGO);
|
||||
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);
|
||||
if not bEnEdicion then
|
||||
AContrato.Edit;
|
||||
@ -179,11 +189,16 @@ begin
|
||||
AContrato.ID_FORMA_PAGO := AFormasPago.ID;
|
||||
AContrato.DataTable.FieldByName(fld_ContratosClienteFORMA_PAGO).AsString := AFormasPago.DESCRIPCION;
|
||||
|
||||
AContrato.ID_TIPO_IVA := ATiposIva.ID;
|
||||
|
||||
|
||||
if not bEnEdicion then
|
||||
AContrato.Post;
|
||||
|
||||
AFormasPago := NIL;
|
||||
AFormasPagoController := NIL;
|
||||
ATiposIVA := NIL;
|
||||
ATiposIVAController := NIL;
|
||||
end;
|
||||
|
||||
function TContratosClienteController.Anadir(AContrato : IBizContratoCliente;
|
||||
|
||||
@ -316,7 +316,7 @@ begin
|
||||
APrimerCliente := (FContrato.Cliente.ID = 0);
|
||||
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);
|
||||
|
||||
if (not APrimerCliente) and (FContrato.Detalles.RecordCount > 0) then begin
|
||||
|
||||
@ -132,7 +132,8 @@ uses
|
||||
uDataModuleUsuarios, uDAInterfaces, uDataTableUtils, uAlbaranesClienteController,
|
||||
schAlbaranesClienteClient_Intf, uROTypes, uDetallesAlbaranClienteController,
|
||||
uBizDetallesAlbaranCliente, uFacturasClienteReportController, DateUtils, Forms,
|
||||
Dialogs, uIntegerListUtils, uFormasPagoController, uBizFormasPago, uIEditorElegirFacturasCliente,
|
||||
Dialogs, uIntegerListUtils, uIEditorElegirFacturasCliente,
|
||||
uFormasPagoController, uBizFormasPago, uTiposIVAController, uBizTiposIVA,
|
||||
uBizEjercicios, uRecibosClienteController, uBizRecibosCliente;
|
||||
|
||||
|
||||
@ -209,24 +210,37 @@ procedure TFacturasClienteController.ActualizarFormaDePago(
|
||||
var
|
||||
AFormasPago : IBizFormaPago;
|
||||
AFormasPagoController : IFormasPagoController;
|
||||
ATiposIVA : IBizTipoIVA;
|
||||
ATiposIVAController : ITiposIVAController;
|
||||
|
||||
bEnEdicion : Boolean;
|
||||
begin
|
||||
AFormasPagoController := TFormasPagoController.Create;
|
||||
AFormasPago := AFormasPagoController.Buscar(ID_FORMA_PAGO);
|
||||
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);
|
||||
if not bEnEdicion then
|
||||
AFactura.Edit;
|
||||
|
||||
AFactura.ID_FORMA_PAGO := AFormasPago.ID;
|
||||
// AFactura.DataTable.FieldByName(fld_FacturasClienteFORMA_PAGO).AsString := AFormasPago.DESCRIPCION;
|
||||
AFactura.ID_TIPO_IVA := ATiposIva.ID;
|
||||
|
||||
|
||||
if not bEnEdicion then
|
||||
AFactura.Post;
|
||||
|
||||
AFormasPago := NIL;
|
||||
AFormasPagoController := NIL;
|
||||
ATiposIVA := NIL;
|
||||
ATiposIVAController := NIL;
|
||||
end;
|
||||
|
||||
function TFacturasClienteController.Anadir(AFacturas: IBizFacturaCliente;
|
||||
|
||||
@ -136,12 +136,11 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
||||
ExplicitWidth = 78
|
||||
Width = 78
|
||||
end
|
||||
inherited bFormasPago: TButton
|
||||
Left = 279
|
||||
ExplicitLeft = 279
|
||||
end
|
||||
inherited frViewTienda1: TfrViewTienda
|
||||
Width = 351
|
||||
ExplicitWidth = 351
|
||||
inherited dxLayoutControl1: TdxLayoutControl
|
||||
Width = 351
|
||||
inherited cbTienda: TcxComboBox
|
||||
Style.LookAndFeel.SkinName = ''
|
||||
StyleDisabled.LookAndFeel.SkinName = ''
|
||||
@ -153,9 +152,7 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
||||
end
|
||||
end
|
||||
inherited frViewClienteFactura1: TfrViewClienteFactura
|
||||
Left = 439
|
||||
Width = 398
|
||||
ExplicitLeft = 439
|
||||
ExplicitWidth = 398
|
||||
inherited dxLayoutControl1: TdxLayoutControl
|
||||
Width = 398
|
||||
@ -209,17 +206,17 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
||||
Width = 276
|
||||
end
|
||||
inherited edtCodigoPostal: TcxDBTextEdit
|
||||
Left = 274
|
||||
Left = 256
|
||||
DataBinding.DataSource = dsDataTable
|
||||
Style.LookAndFeel.SkinName = ''
|
||||
StyleDisabled.LookAndFeel.SkinName = ''
|
||||
StyleFocused.LookAndFeel.SkinName = ''
|
||||
StyleHot.LookAndFeel.SkinName = ''
|
||||
ExplicitLeft = 274
|
||||
ExplicitLeft = 256
|
||||
end
|
||||
inherited Button3: TBitBtn
|
||||
Left = 164
|
||||
ExplicitLeft = 164
|
||||
Left = 146
|
||||
ExplicitLeft = 146
|
||||
end
|
||||
inherited cxDBTextEdit1: TcxDBTextEdit
|
||||
Style.LookAndFeel.SkinName = ''
|
||||
|
||||
@ -366,7 +366,7 @@ begin
|
||||
begin
|
||||
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);
|
||||
|
||||
if (not APrimerCliente) and (FFactura.Detalles.RecordCount > 0) then begin
|
||||
|
||||
@ -201,7 +201,8 @@ uses
|
||||
uBizContactos, uDataTableUtils, uDataModuleUsuarios, uFactuGES_App, uConfiguracionController,
|
||||
schPresupuestosClienteClient_Intf, uDAInterfaces, uDateUtils, uIEditorPresupuestoCliente,
|
||||
uIEditorElegirPresupuestosCliente, uIEditorDireccionEntregaPresupuestoCliente,
|
||||
schContactosClient_Intf, uPresupuestosClienteReportController, uFormasPagoController, uBizFormasPago,
|
||||
schContactosClient_Intf, uPresupuestosClienteReportController,
|
||||
uFormasPagoController, uBizFormasPago, uTiposIVAController, uBizTiposIVA,
|
||||
uSistemaFunc, uEMailUtils, uDialogElegirEMail, Dialogs, uStringsUtils;
|
||||
|
||||
{ TPresupuestosClienteController }
|
||||
@ -210,12 +211,21 @@ procedure TPresupuestosClienteController.ActualizarFormaDePago(APresupuesto: IBi
|
||||
var
|
||||
AFormasPago : IBizFormaPago;
|
||||
AFormasPagoController : IFormasPagoController;
|
||||
ATiposIVA : IBizTipoIVA;
|
||||
ATiposIVAController : ITiposIVAController;
|
||||
|
||||
bEnEdicion : Boolean;
|
||||
begin
|
||||
AFormasPagoController := TFormasPagoController.Create;
|
||||
AFormasPago := AFormasPagoController.Buscar(ID_FORMA_PAGO);
|
||||
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);
|
||||
if not bEnEdicion then
|
||||
APresupuesto.Edit;
|
||||
@ -223,11 +233,16 @@ begin
|
||||
APresupuesto.ID_FORMA_PAGO := AFormasPago.ID;
|
||||
APresupuesto.DataTable.FieldByName(fld_PresupuestosClienteFORMA_PAGO).AsString := AFormasPago.DESCRIPCION;
|
||||
|
||||
APresupuesto.ID_TIPO_IVA := ATiposIva.ID;
|
||||
|
||||
|
||||
if not bEnEdicion then
|
||||
APresupuesto.Post;
|
||||
|
||||
|
||||
AFormasPago := NIL;
|
||||
AFormasPagoController := NIL;
|
||||
ATiposIVA := NIL;
|
||||
ATiposIVAController := NIL;
|
||||
end;
|
||||
|
||||
function TPresupuestosClienteController.Anadir(APresupuesto: IBizPresupuestoCliente; const ATipo: TEnumTiposPresupuesto): Boolean;
|
||||
|
||||
@ -202,52 +202,117 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
|
||||
ParentFont = False
|
||||
TabOrder = 0
|
||||
ReadOnly = False
|
||||
ExplicitLeft = -61
|
||||
ExplicitTop = -269
|
||||
ExplicitWidth = 834
|
||||
ExplicitHeight = 286
|
||||
inherited dxLayoutControl1: TdxLayoutControl
|
||||
Width = 834
|
||||
Height = 286
|
||||
ExplicitWidth = 834
|
||||
ExplicitHeight = 286
|
||||
inherited edtFechaPresupuesto: TcxDBDateEdit
|
||||
ExplicitWidth = 187
|
||||
Width = 187
|
||||
end
|
||||
inherited memObservaciones: TcxDBMemo
|
||||
Left = 398
|
||||
ExplicitLeft = 398
|
||||
Left = 399
|
||||
ExplicitLeft = 399
|
||||
ExplicitWidth = 793
|
||||
Width = 793
|
||||
end
|
||||
inherited eReferencia: TcxDBTextEdit
|
||||
ExplicitWidth = 122
|
||||
Width = 122
|
||||
end
|
||||
inherited cbFormaPago: TcxDBLookupComboBox
|
||||
ExplicitWidth = 122
|
||||
Width = 122
|
||||
end
|
||||
inherited bFormasPago: TButton
|
||||
Left = 236
|
||||
ExplicitLeft = 236
|
||||
Left = 237
|
||||
ExplicitLeft = 237
|
||||
end
|
||||
inherited edtFechaDecision: TcxDBDateEdit
|
||||
Left = 281
|
||||
ExplicitLeft = 281
|
||||
ExplicitWidth = 260
|
||||
Width = 260
|
||||
end
|
||||
inherited edtFechaVigencia: TcxDBDateEdit
|
||||
ExplicitWidth = 260
|
||||
Width = 260
|
||||
end
|
||||
inherited cbSituacion: TcxDBImageComboBox
|
||||
ExplicitWidth = 260
|
||||
Width = 260
|
||||
end
|
||||
inherited frViewDatosYSeleccionClientePresupuesto1: TfrViewDatosYSeleccionClientePresupuesto
|
||||
Left = 398
|
||||
ExplicitLeft = 398
|
||||
Left = 399
|
||||
Width = 320
|
||||
ExplicitLeft = 399
|
||||
ExplicitWidth = 320
|
||||
inherited dxLayoutControl1: TdxLayoutControl
|
||||
Width = 320
|
||||
inherited edtlNombre: TcxDBTextEdit
|
||||
ExplicitWidth = 202
|
||||
Width = 202
|
||||
end
|
||||
inherited edtNIFCIF: TcxDBTextEdit
|
||||
Left = 282
|
||||
ExplicitLeft = 282
|
||||
Left = 281
|
||||
ExplicitLeft = 281
|
||||
end
|
||||
inherited Button3: TBitBtn
|
||||
Left = 193
|
||||
ExplicitLeft = 193
|
||||
Left = 192
|
||||
ExplicitLeft = 192
|
||||
end
|
||||
inherited edtPersonaContacto: TcxDBTextEdit
|
||||
ExplicitWidth = 329
|
||||
Width = 329
|
||||
end
|
||||
inherited edtDireccion: TcxMemo
|
||||
ExplicitWidth = 121
|
||||
Width = 121
|
||||
end
|
||||
inherited Button4: TButton
|
||||
Left = 362
|
||||
ExplicitLeft = 362
|
||||
Left = 361
|
||||
ExplicitLeft = 361
|
||||
end
|
||||
inherited Button5: TButton
|
||||
Left = 362
|
||||
ExplicitLeft = 362
|
||||
Left = 361
|
||||
ExplicitLeft = 361
|
||||
end
|
||||
inherited edtTelefonos: TcxTextEdit
|
||||
ExplicitWidth = 193
|
||||
Width = 193
|
||||
end
|
||||
end
|
||||
end
|
||||
inherited memFormaPago: TcxDBMemo
|
||||
ExplicitWidth = 475
|
||||
ExplicitHeight = 44
|
||||
Height = 44
|
||||
Width = 475
|
||||
end
|
||||
inherited memPlazoEntrega: TcxDBMemo
|
||||
Top = 303
|
||||
ExplicitTop = 303
|
||||
ExplicitWidth = 396
|
||||
ExplicitHeight = 100
|
||||
Height = 100
|
||||
Width = 396
|
||||
end
|
||||
inherited cbVendedor: TcxDBLookupComboBox
|
||||
ExplicitWidth = 27
|
||||
Width = 27
|
||||
end
|
||||
inherited cbTipoPresupuesto: TcxDBComboBox
|
||||
Left = 276
|
||||
ExplicitLeft = 276
|
||||
ExplicitWidth = 186
|
||||
Width = 186
|
||||
end
|
||||
inherited edtlReferenciaCliente: TcxDBTextEdit
|
||||
ExplicitWidth = 204
|
||||
Width = 204
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -300,7 +300,7 @@ begin
|
||||
APrimerCliente := (FPresupuesto.Cliente.ID = 0);
|
||||
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);
|
||||
|
||||
if (not APrimerCliente) and (FPresupuesto.Detalles.RecordCount > 0) then begin
|
||||
|
||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user