Arreglo de formas de pago que al añadir una forma de pago nueva desde facturas fallaba

git-svn-id: https://192.168.0.254/svn/Proyectos.LuisLeon_FactuGES/trunk@237 c93665c3-c93d-084d-9b98-7d5f4a9c3376
This commit is contained in:
roberto 2008-05-30 10:02:28 +00:00
parent 05bc30f293
commit d17d0d2e9b
15 changed files with 80 additions and 51 deletions

Binary file not shown.

View File

@ -46,6 +46,10 @@ inherited fEditorDBItem: TfEditorDBItem
TabOrder = 2
object pagGeneral: TTabSheet
Caption = 'General'
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
end
end
inherited StatusBar: TJvStatusBar

View File

@ -126,7 +126,7 @@
<Directories Name="SearchPath">..\Lib;..\Modulos\Lib</Directories>
<Directories Name="Packages">PluginSDK_D10R;GUISDK_D10;DataAbstract_D10;Base;GUIBase;Usuarios;Contactos_plugin;Empresas_plugin;Empresas_controller;Empresas_model;rtl</Directories>
<Directories Name="Conditionals">_VER6;</Directories>
<Directories Name="DebugSourceDirs">E:\Codigo (Luis Leon)\Source\Modulos\Pedidos de cliente\Controller\;E:\Componentes\jvcl\run</Directories>
<Directories Name="DebugSourceDirs"></Directories>
<Directories Name="UsePackages">True</Directories>
</Directories>
<Parameters>

View File

@ -83,10 +83,12 @@
<Projects Name="PedidosProveedor_plugin.bpl">Modulos\Pedidos a proveedor\Plugin\PedidosProveedor_plugin.bdsproj</Projects>
<Projects Name="AlbaranesProveedor_view.bpl">Modulos\Albaranes de proveedor\Views\AlbaranesProveedor_view.bdsproj</Projects>
<Projects Name="AlbaranesProveedor_plugin.bpl">Modulos\Albaranes de proveedor\Plugin\AlbaranesProveedor_plugin.bdsproj</Projects>
<Projects Name="FormasPago_controller.bpl">Modulos\Formas de pago\Controller\FormasPago_controller.bdsproj</Projects>
<Projects Name="FormasPago_view.bpl">Modulos\Formas de pago\Views\FormasPago_view.bdsproj</Projects>
<Projects Name="FactuGES.exe">Cliente\FactuGES.bdsproj</Projects>
<Projects Name="FactuGES_Server.exe">Servidor\FactuGES_Server.bdsproj</Projects>
<Projects Name="AlbCli_FacCli_relation.bpl">Modulos\Relaciones\Albaranes de cliente - Facturas de cliente\AlbCli_FacCli_relation.bdsproj</Projects>
<Projects Name="Targets">DataAbstract_D10.bpl Base.bpl ControllerBase.bpl GUIBase.bpl Empresas_model.bpl Empresas_data.bpl Empresas_controller.bpl Usuarios.bpl Empresas_view.bpl Empresas_plugin.bpl TiposIVA_model.bpl TiposIVA_data.bpl TiposIVA_controller.bpl TiposIVA_view.bpl TiposIVA_plugin.bpl Contactos_model.bpl Contactos_data.bpl Contactos_controller.bpl Contactos_view.bpl Contactos_plugin.bpl Almacenes_model.bpl Almacenes_data.bpl Almacenes_controller.bpl Almacenes_view.bpl Almacenes_plugin.bpl Articulos_model.bpl Articulos_data.bpl Articulos_controller.bpl Articulos_view.bpl Articulos_plugin.bpl RecibosCliente_model.bpl RecibosCliente_data.bpl RecibosCliente_controller.bpl RecibosCliente_view.bpl RecibosCliente_plugin.bpl RemesasCliente_model.bpl RemesasCliente_data.bpl RemesasCliente_controller.bpl BancaElectronica_controller.bpl BancaElectronica_view.bpl RemesasCliente_view.bpl RemesasCliente_plugin.bpl PedidosCliente_model.bpl PedidosCliente_data.bpl PedidosCliente_controller.bpl AlbaranesCliente_model.bpl AlbaranesCliente_data.bpl AlbaranesCliente_controller.bpl FacturasCliente_model.bpl FacturasCliente_data.bpl FacturasCliente_controller.bpl PedidosProveedor_model.bpl PedidosProveedor_data.bpl PedidosProveedor_controller.bpl Inventario_model.bpl Inventario_data.bpl Inventario_controller.bpl AlbaranesProveedor_model.bpl AlbaranesProveedor_data.bpl AlbaranesProveedor_controller.bpl PedCli_PedProv_relation.bpl PedCli_AlbCli_relation.bpl PedidosCliente_view.bpl PedidosCliente_plugin.bpl AlbaranesCliente_view.bpl AlbaranesCliente_plugin.bpl FacturasCliente_view.bpl FacturasCliente_plugin.bpl Inventario_view.bpl Inventario_plugin.bpl PedidosProveedor_view.bpl PedidosProveedor_plugin.bpl AlbaranesProveedor_view.bpl AlbaranesProveedor_plugin.bpl FactuGES.exe FactuGES_Server.exe AlbCli_FacCli_relation.bpl</Projects>
<Projects Name="FormasPago_model.bpl">Modulos\Formas de pago\Model\FormasPago_model.bdsproj</Projects>
<Projects Name="Targets">DataAbstract_D10.bpl Base.bpl ControllerBase.bpl GUIBase.bpl Empresas_model.bpl Empresas_data.bpl Empresas_controller.bpl Usuarios.bpl Empresas_view.bpl Empresas_plugin.bpl TiposIVA_model.bpl TiposIVA_data.bpl TiposIVA_controller.bpl TiposIVA_view.bpl TiposIVA_plugin.bpl Contactos_model.bpl Contactos_data.bpl Contactos_controller.bpl Contactos_view.bpl Contactos_plugin.bpl Almacenes_model.bpl Almacenes_data.bpl Almacenes_controller.bpl Almacenes_view.bpl Almacenes_plugin.bpl Articulos_model.bpl Articulos_data.bpl Articulos_controller.bpl Articulos_view.bpl Articulos_plugin.bpl RecibosCliente_model.bpl RecibosCliente_data.bpl RecibosCliente_controller.bpl RecibosCliente_view.bpl RecibosCliente_plugin.bpl RemesasCliente_model.bpl RemesasCliente_data.bpl RemesasCliente_controller.bpl BancaElectronica_controller.bpl BancaElectronica_view.bpl RemesasCliente_view.bpl RemesasCliente_plugin.bpl PedidosCliente_model.bpl PedidosCliente_data.bpl PedidosCliente_controller.bpl AlbaranesCliente_model.bpl AlbaranesCliente_data.bpl AlbaranesCliente_controller.bpl FacturasCliente_model.bpl FacturasCliente_data.bpl FacturasCliente_controller.bpl PedidosProveedor_model.bpl PedidosProveedor_data.bpl PedidosProveedor_controller.bpl Inventario_model.bpl Inventario_data.bpl Inventario_controller.bpl AlbaranesProveedor_model.bpl AlbaranesProveedor_data.bpl AlbaranesProveedor_controller.bpl PedCli_PedProv_relation.bpl PedCli_AlbCli_relation.bpl PedidosCliente_view.bpl PedidosCliente_plugin.bpl AlbaranesCliente_view.bpl AlbaranesCliente_plugin.bpl FacturasCliente_view.bpl FacturasCliente_plugin.bpl Inventario_view.bpl Inventario_plugin.bpl PedidosProveedor_view.bpl PedidosProveedor_plugin.bpl AlbaranesProveedor_view.bpl AlbaranesProveedor_plugin.bpl FormasPago_controller.bpl FormasPago_view.bpl FactuGES.exe FactuGES_Server.exe FormasPago_model.bpl</Projects>
</Projects>
<Dependencies/>
</Default.Personality>

View File

@ -8,7 +8,13 @@
<Option Name="GUID">{31F77077-B4B9-443C-9AA9-F13B4EB640B4}</Option>
</Option>
</PersonalityInfo>
<Default.Personality> <Projects>
<Default.Personality>
<Projects>
<Projects Name="Base.bpl">..\..\Base\Base.bdsproj</Projects>
<Projects Name="ControllerBase.bpl">..\..\Base\ControllerBase\ControllerBase.bdsproj</Projects>
<Projects Name="GUIBase.bpl">..\..\Base\GUIBase\GUIBase.bdsproj</Projects>
@ -30,7 +36,12 @@
<Projects Name="AlbaranesCliente_controller.bpl">..\Albaranes de cliente\Controller\AlbaranesCliente_controller.bdsproj</Projects>
<Projects Name="PedidosCliente_model.bpl">..\Pedidos de cliente\Model\PedidosCliente_model.bdsproj</Projects>
<Projects Name="FacturasProveedor_view.bpl">..\Facturas de proveedor\Views\FacturasProveedor_view.bdsproj</Projects>
<Projects Name="Targets">Base.bpl ControllerBase.bpl GUIBase.bpl Contactos_model.bpl Contactos_data.bpl Contactos_controller.bpl Articulos_view.bpl Articulos_model.bpl Articulos_data.bpl Articulos_controller.bpl Contactos_view.bpl FacturasCliente_model.bpl FacturasCliente_data.bpl FacturasCliente_controller.bpl FacturasCliente_view.bpl FactuGES.exe FactuGES_Server.exe AlbCli_FacCli_relation.bpl AlbaranesCliente_controller.bpl PedidosCliente_model.bpl FacturasProveedor_view.bpl</Projects>
<Projects Name="FormasPago_model.bpl">..\Formas de pago\Model\FormasPago_model.bdsproj</Projects>
<Projects Name="FormasPago_data.bpl">..\Formas de pago\Data\FormasPago_data.bdsproj</Projects>
<Projects Name="FormasPago_controller.bpl">..\Formas de pago\Controller\FormasPago_controller.bdsproj</Projects>
<Projects Name="FormasPago_view.bpl">..\Formas de pago\Views\FormasPago_view.bdsproj</Projects>
<Projects Name="FormasPago_plugin.bpl">..\Formas de pago\Plugin\FormasPago_plugin.bdsproj</Projects>
<Projects Name="Targets">Base.bpl ControllerBase.bpl GUIBase.bpl Contactos_model.bpl Contactos_data.bpl Contactos_controller.bpl Articulos_view.bpl Articulos_model.bpl Articulos_data.bpl Articulos_controller.bpl Contactos_view.bpl FacturasCliente_model.bpl FacturasCliente_data.bpl FacturasCliente_controller.bpl FacturasCliente_view.bpl FactuGES.exe FactuGES_Server.exe AlbCli_FacCli_relation.bpl AlbaranesCliente_controller.bpl PedidosCliente_model.bpl FacturasProveedor_view.bpl FormasPago_model.bpl FormasPago_data.bpl FormasPago_controller.bpl FormasPago_view.bpl FormasPago_plugin.bpl</Projects>
</Projects>
<Dependencies/>
</Default.Personality>

View File

@ -1,5 +1,5 @@
inherited frViewFacturaCliente: TfrViewFacturaCliente
Width = 747
Width = 451
Height = 304
Align = alClient
OnCreate = CustomViewCreate
@ -9,16 +9,15 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente
object dxLayoutControl1: TdxLayoutControl
Left = 0
Top = 0
Width = 747
Width = 451
Height = 304
Align = alClient
ParentBackground = True
TabOrder = 0
AutoContentSizes = [acsWidth, acsHeight]
LookAndFeel = dxLayoutOfficeLookAndFeel1
ExplicitWidth = 451
DesignSize = (
747
451
304)
object eReferencia: TcxDBTextEdit
Left = 124
@ -80,7 +79,7 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente
Width = 301
end
inline frViewClienteFactura: TfrViewDatosYSeleccionCliente
Left = 390
Left = 310
Top = 30
Width = 314
Height = 215
@ -92,14 +91,14 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente
ParentFont = False
TabOrder = 5
ReadOnly = False
ExplicitLeft = 390
ExplicitLeft = 310
ExplicitTop = 30
ExplicitWidth = 314
ExplicitHeight = 215
inherited dxLayoutControl1: TdxLayoutControl
Width = 314
Height = 215
ExplicitWidth = 119
ExplicitWidth = 314
ExplicitHeight = 215
inherited edtlNombre: TcxDBTextEdit
DataBinding.DataSource = DADataSource
@ -127,13 +126,13 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente
Width = 327
end
inherited edtCodigoPostal: TcxDBTextEdit
Left = 243
Left = 192
DataBinding.DataSource = DADataSource
ExplicitLeft = 243
ExplicitLeft = 192
end
inherited Button3: TBitBtn
Left = 133
ExplicitLeft = 133
Left = 82
ExplicitLeft = 82
end
end
end
@ -169,7 +168,7 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente
Width = 78
end
object bFormasPago: TButton
Left = 230
Left = 150
Top = 84
Width = 132
Height = 23

View File

@ -9,7 +9,7 @@ uses
cxControls, cxContainer, cxEdit, cxTextEdit, cxDBEdit, dxLayoutControl,
cxMemo, cxMaskEdit, cxDropDownEdit, cxCalendar, cxSpinEdit, StdCtrls, Mask,
DBCtrls, cxGraphics, dxLayoutLookAndFeels, cxLookupEdit, cxDBLookupEdit,
cxDBLookupComboBox, uFormasPagoController;
cxDBLookupComboBox, uFormasPagoController, uBizFormasPago;
type
IViewFacturaCliente = interface(IViewBase)
@ -48,6 +48,7 @@ type
procedure CustomViewCreate(Sender: TObject);
protected
FFactura : IBizFacturaCliente;
FFormasPago : IBizFormaPago;
FFormasPagoController : IFormasPagoController;
function GetFactura: IBizFacturaCliente;
procedure SetFactura(const Value: IBizFacturaCliente);
@ -59,8 +60,7 @@ type
implementation
uses
uDataModuleContactos, schFacturasClienteClient_Intf,
uBizFormasPago;
uDataModuleContactos, schFacturasClienteClient_Intf;
{$R *.dfm}
@ -69,18 +69,23 @@ uses
procedure TfrViewFacturaCliente.bFormasPagoClick(Sender: TObject);
begin
inherited;
FFormasPagoController.VerTodos((dsFormaPago.DataTable) as IBizFormaPago);
if Assigned(FFormasPago) then
FFormasPagoController.VerTodos(FFormasPago);
// FFormasPagoController.VerTodos((dsFormaPago.DataTable) as IBizFormaPago);
end;
procedure TfrViewFacturaCliente.CustomViewCreate(Sender: TObject);
begin
inherited;
FFormasPago := Nil;
FFormasPagoController := TFormasPagoController.Create;
end;
procedure TfrViewFacturaCliente.CustomViewDestroy(Sender: TObject);
begin
inherited;
FFormasPago := Nil;
FFormasPagoController := NIL;
end;
@ -98,9 +103,14 @@ begin
begin
DADataSource.DataTable := FFactura.DataTable;
dsFormaPago.DataTable := FFormasPagoController.BuscarTodos.DataTable;
// dsFormaPago.DataTable := FFormasPagoController.BuscarTodos.DataTable;
// dsFormaPago.DataTable.Active := True;
FFormasPago := FFormasPagoController.BuscarTodos;
dsFormaPago.DataTable := FFormasPago.DataTable;
dsFormaPago.DataTable.Active := True;
//Solo se deshabilita al insertar, luego la referencia será modificable
//eReferencia.Enabled := (FFactura.DataTable.State = dsInsert);

View File

@ -172,7 +172,7 @@
<VersionInfoKeys Name="Comments"></VersionInfoKeys>
</VersionInfoKeys>
</Delphi.Personality>
<!-- EurekaLog First Line
<!-- EurekaLog First Line
[Exception Log]
EurekaLog Version=519
Activate=0

View File

@ -195,19 +195,17 @@ begin
ShowHourglassCursor;
try
CreateEditor('EditorFormaPago', IEditorFormaPago, AEditor);
with AEditor do
FormaPago := AFormaPago;
if Assigned(AEditor) then
with AEditor do
begin
FormaPago := AFormaPago;
ShowModal;
Release;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
if Assigned(AEditor) then
try
AEditor.ShowModal;
AEditor.Release;
finally
AEditor := NIL;
end;
end;
procedure TFormasPagoController.VerTodos(AFormasPago: IBizFormaPago);
@ -218,19 +216,17 @@ begin
ShowHourglassCursor;
try
CreateEditor('EditorFormasPago', IEditorFormasPago, AEditor);
with AEditor do
FormasPago := AFormasPago;
if Assigned(AEditor) then
with AEditor do
begin
FormasPago := AFormasPago;
ShowModal;
Release;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
if Assigned(AEditor) then
try
AEditor.ShowModal;
AEditor.Release;
finally
AEditor := NIL;
end;
end;
function TFormasPagoController.Eliminar(AFormaPago: IBizFormaPago): Boolean;

View File

@ -17,7 +17,8 @@
<Projects Name="FormasPago_controller.bpl">Controller\FormasPago_controller.bdsproj</Projects>
<Projects Name="FormasPago_view.bpl">Views\FormasPago_view.bdsproj</Projects>
<Projects Name="FormasPago_plugin.bpl">Plugin\FormasPago_plugin.bdsproj</Projects>
<Projects Name="Targets">Base.bpl GUIBase.bpl Usuarios.bpl FormasPago_model.bpl FormasPago_data.bpl FormasPago_controller.bpl FormasPago_view.bpl FormasPago_plugin.bpl</Projects>
<Projects Name="FactuGES.exe">..\..\Cliente\FactuGES.bdsproj</Projects>
<Projects Name="Targets">Base.bpl GUIBase.bpl Usuarios.bpl FormasPago_model.bpl FormasPago_data.bpl FormasPago_controller.bpl FormasPago_view.bpl FormasPago_plugin.bpl FactuGES.exe</Projects>
</Projects>
<Dependencies/>
</Default.Personality>

View File

@ -27,6 +27,7 @@ type
procedure OnNewRecord(Sender: TDADataTable); override;
function GetPlazos: IBizFormaPagoPlazos;
procedure SetPlazos(const Value: IBizFormaPagoPlazos);
public
procedure IniciarValoresFormaPagoNueva;
function EsNuevo : Boolean;
@ -41,7 +42,7 @@ implementation
{ TBizFormaPago }
uses
SysUtils, uDataTableUtils;
SysUtils, DB, uDataTableUtils;
constructor TBizFormaPago.Create(aDataTable: TDADataTable);
begin

View File

@ -36,9 +36,10 @@ var
AMasterTable : TDADataTable;
begin
inherited;
AMasterTable := DataTable.GetMasterDataTable;
if Assigned(AMasterTable) and (AMasterTable.State = dsInsert) then
AMasterTable.Post;
//En este caso no se debe hacer porque falla el maestro-detalle al añadir los plazos de una nueva forma de pago desde una factura
// AMasterTable := DataTable.GetMasterDataTable;
// if Assigned(AMasterTable) and (AMasterTable.State = dsInsert) then
// AMasterTable.Post;
end;
function TBizFormasPagoPlazos.EsNuevo: Boolean;

View File

@ -95,7 +95,7 @@ implementation
{ TfEditorFormasPago }
uses
uDialogUtils, uDataModuleFormasPago;
uDialogUtils, uDataModuleFormasPago, Dialogs;
function TfEditorFormaPago.GetFormaPago: IBizFormaPago;
begin
@ -153,7 +153,11 @@ end;
procedure TfEditorFormaPago.actAceptarExecute(Sender: TObject);
begin
if not Assigned(FFormaPago.Plazos) or (FFormaPago.Plazos.RecordCount = 0) then
//Comprobamos que no este en modo edicion
if Assigned(FFormaPago.Plazos) and (FFormaPago.Plazos.DataTable.Editing) then
FFormaPago.Plazos.Post;
if (not Assigned(FFormaPago.Plazos)) or (FFormaPago.Plazos.RecordCount = 0) then
if (ShowConfirmMessage('Forma de pago sin plazos', 'No ha indicado plazos de pago para esta forma de pago por lo tanto no se podrán generarar los recibos correspondientes.' + #10#13 + '¿Desea continuar guardando la forma de pago?') = IDNO) then
Exit;

View File

@ -16,7 +16,7 @@ BEGIN
VALUE "FileVersion", "2.9.0.0\0"
VALUE "ProductName", "FactuGES Server\0"
VALUE "ProductVersion", "2.9.0.0\0"
VALUE "CompileDate", "miércoles, 28 de mayo de 2008 19:25\0"
VALUE "CompileDate", "jueves, 29 de mayo de 2008 19:41\0"
END
END
BLOCK "VarFileInfo"

Binary file not shown.