Arreglo en validacion de facturas de cliente y proveedor, para que cuando se desee incluirlas en contabilidad se compruebe que el cliente o proveedor de la factura tenga un subcuenta asociada, ademas se ha modificado el módulo de facturas de proveedor para que funcione la parte contable correctamente
git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@169 f4e31baf-9722-1c47-927c-6f952f962d4b
This commit is contained in:
parent
b7a11db79b
commit
27bb8897ae
@ -22,7 +22,7 @@ begin
|
||||
with AppFactuGES.ModuleManager do
|
||||
begin
|
||||
LoadModule('Referencias_plugin.bpl');
|
||||
LoadModule('TiposVenta_plugin.bpl');
|
||||
// LoadModule('TiposVenta_plugin.bpl');
|
||||
LoadModule('FormasPago_plugin.bpl');
|
||||
LoadModule('TiposIVA_plugin.bpl');
|
||||
LoadModule('Contactos_plugin.bpl');
|
||||
|
||||
@ -76,6 +76,7 @@ type
|
||||
function BuscarTodos: IBizSubCuenta;
|
||||
function BuscarCajasBancos: IBizSubCuenta;
|
||||
function BuscarVentas: IBizSubCuenta;
|
||||
function BuscarCompras: IBizSubCuenta;
|
||||
function Buscar(ID: Integer): IBizSubCuenta;
|
||||
procedure VerTodos(ASubCuentas: IBizSubCuenta);
|
||||
procedure Ver(ASubCuenta: IBizSubCuenta);
|
||||
@ -191,6 +192,31 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TSubCuentasController.BuscarCompras: IBizSubCuenta;
|
||||
var
|
||||
Condicion: TDAWhereExpression;
|
||||
|
||||
begin
|
||||
ShowHourglassCursor;
|
||||
try
|
||||
Result := BuscarTodos;
|
||||
|
||||
with Result.DataTable.DynamicWhere do
|
||||
begin
|
||||
// (REF_CUENTAS = 600 ventas)
|
||||
Condicion := NewBinaryExpression(NewField('', fld_SubCuentasREF_CUENTA), NewConstant(CTE_CUENTASCOMPRA, datInteger), dboEqual);
|
||||
|
||||
if IsEmpty then
|
||||
Expression := Condicion
|
||||
else
|
||||
Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
|
||||
end;
|
||||
|
||||
finally
|
||||
HideHourglassCursor;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TSubCuentasController.BuscarCuentas(const REF_CUENTA: Integer): IBizSubCuenta;
|
||||
var
|
||||
Condicion: TDAWhereExpression;
|
||||
@ -290,7 +316,8 @@ begin
|
||||
// tClientes, tProveedores, tCompras, tVentas,
|
||||
tTodas : ASubCuentas := BuscarTodos;
|
||||
tCajas : ASubCuentas := BuscarCajasBancos;
|
||||
tVentas : ASubCuentas := BuscarVentas;
|
||||
tVentas : ASubCuentas := BuscarVentas;
|
||||
tCompras : ASubCuentas := BuscarCompras;
|
||||
end;
|
||||
|
||||
ASubCuentas.DataTable.Active := True;
|
||||
|
||||
@ -77,6 +77,17 @@ begin
|
||||
try
|
||||
AClientesController := TClientesController.Create;
|
||||
AClientes := (AClientesController.BuscarTodos as IBizCliente);
|
||||
|
||||
showmessage('hola1');
|
||||
AClientes.DataTable.DisableConstraints;
|
||||
AClientes.DataTable.DisableEventHandlers;
|
||||
AClientes.DataTable.DisableControls;
|
||||
AClientes.DataTable.Active := True;
|
||||
AClientes.DataTable.EnableControls;
|
||||
AClientes.DataTable.EnableEventHandlers;
|
||||
AClientes.DataTable.EnableConstraints;
|
||||
showmessage('hola2');
|
||||
|
||||
AClientesController.VerTodos(AClientes);
|
||||
finally
|
||||
AClientes := Nil;
|
||||
|
||||
@ -5,7 +5,7 @@ inherited fEditorClientes: TfEditorClientes
|
||||
ClientHeight = 519
|
||||
ClientWidth = 786
|
||||
ExplicitWidth = 794
|
||||
ExplicitHeight = 546
|
||||
ExplicitHeight = 553
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
inherited JvNavPanelHeader: TJvNavPanelHeader
|
||||
@ -84,23 +84,13 @@ inherited fEditorClientes: TfEditorClientes
|
||||
inherited cxGrid: TcxGrid
|
||||
Width = 786
|
||||
Height = 270
|
||||
ExplicitWidth = 786
|
||||
ExplicitHeight = 270
|
||||
inherited cxGridView: TcxGridDBTableView
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Format = '0 clientes'
|
||||
Kind = skCount
|
||||
Column = frViewClientes1.cxGridViewTiendaWeb
|
||||
Column = frViewClientes1.cxGridViewTIENDA
|
||||
end>
|
||||
inherited cxGridViewBLOQUEADO: TcxGridDBColumn
|
||||
Visible = False
|
||||
VisibleForCustomization = False
|
||||
end
|
||||
inherited cxGridViewTiendaWeb: TcxGridDBColumn
|
||||
Visible = False
|
||||
VisibleForCustomization = False
|
||||
end
|
||||
end
|
||||
end
|
||||
inherited frViewFiltroBase1: TfrViewFiltroBase
|
||||
|
||||
@ -2,6 +2,8 @@ inherited fEditorContactos: TfEditorContactos
|
||||
Left = 285
|
||||
Top = 448
|
||||
Caption = 'Lista de contactos'
|
||||
ExplicitWidth = 320
|
||||
ExplicitHeight = 240
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
inherited JvNavPanelHeader: TJvNavPanelHeader
|
||||
|
||||
@ -64,7 +64,13 @@ begin
|
||||
if not Assigned(Contactos) then
|
||||
raise Exception.Create('No hay ningún contacto asignado');
|
||||
|
||||
Contactos.DataTable.Active := True;
|
||||
// ViewGrid._Grid.BeginUpdate;
|
||||
// Contactos.DataTable.DisableControls;
|
||||
//Contactos.DataTable.DisableEventHandlers;
|
||||
// Contactos.DataTable.Active := True;
|
||||
//Contactos.DataTable.EnableEventHandlers;
|
||||
// Contactos.DataTable.EnableControls;
|
||||
// ViewGrid._Grid.EndUpdate;
|
||||
ViewGrid.GotoFirst;
|
||||
end;
|
||||
|
||||
|
||||
@ -591,7 +591,10 @@ begin
|
||||
|
||||
if (AFactura.Detalles.DataTable.RecordCount = 0) then
|
||||
raise Exception.Create('La factura debe tener al menos un concepto en su contenido');
|
||||
|
||||
|
||||
if (AFactura.IGNORAR_CONTABILIDAD = 0) and (AFactura.Cliente.SubCuentas.ID < 1) then
|
||||
raise Exception.Create('Para que la factura pueda pasar la parte contable es necesario que el proveedor tenga asignada una subcuenta');
|
||||
|
||||
{ Esta validación puede saltar cuando se generan facturas automáticamente
|
||||
por albaranes o pedidos y el cliente no tiene Tipo de IVA puesto. }
|
||||
{ if (AFactura.ID_TIPO_IVA = 0) then
|
||||
|
||||
@ -70,8 +70,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TBizFacturasClienteServer.BeforeProcessDelta(
|
||||
Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
||||
procedure TBizFacturasClienteServer.BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
||||
begin
|
||||
FReferenciaAutomatica := False;
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
||||
inherited JvNavPanelHeader: TJvNavPanelHeader
|
||||
Width = 771
|
||||
Caption = 'Nueva factura de cliente'
|
||||
ExplicitWidth = 813
|
||||
ExplicitWidth = 771
|
||||
inherited Image1: TImage
|
||||
Left = 744
|
||||
Picture.Data = {
|
||||
@ -40,7 +40,7 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
||||
end
|
||||
inherited TBXDock: TTBXDock
|
||||
Width = 771
|
||||
ExplicitWidth = 813
|
||||
ExplicitWidth = 771
|
||||
inherited tbxMain: TTBXToolbar
|
||||
ExplicitWidth = 488
|
||||
inherited TBXItem2: TTBXItem
|
||||
@ -75,12 +75,12 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
||||
OnChanging = pgPaginasChanging
|
||||
ExplicitLeft = 3
|
||||
ExplicitTop = 79
|
||||
ExplicitWidth = 807
|
||||
ExplicitWidth = 765
|
||||
ExplicitHeight = 378
|
||||
inherited pagGeneral: TTabSheet
|
||||
ExplicitLeft = 4
|
||||
ExplicitTop = 24
|
||||
ExplicitWidth = 799
|
||||
ExplicitWidth = 757
|
||||
ExplicitHeight = 350
|
||||
inline frViewFacturaCliente1: TfrViewFacturaCliente
|
||||
Left = 0
|
||||
@ -96,12 +96,12 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
||||
ParentFont = False
|
||||
TabOrder = 0
|
||||
ReadOnly = False
|
||||
ExplicitWidth = 799
|
||||
ExplicitWidth = 757
|
||||
ExplicitHeight = 350
|
||||
inherited dxLayoutControl1: TdxLayoutControl
|
||||
Width = 757
|
||||
Height = 350
|
||||
ExplicitWidth = 799
|
||||
ExplicitWidth = 757
|
||||
ExplicitHeight = 350
|
||||
inherited eReferencia: TcxDBTextEdit
|
||||
ExplicitWidth = 159
|
||||
@ -122,6 +122,7 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
||||
ExplicitWidth = 314
|
||||
inherited dxLayoutControl1: TdxLayoutControl
|
||||
Width = 314
|
||||
ExplicitWidth = 314
|
||||
inherited edtlNombre: TcxDBTextEdit
|
||||
DataBinding.DataSource = frViewFacturaCliente1.DADataSource
|
||||
ExplicitWidth = 224
|
||||
@ -176,7 +177,6 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
||||
object pagContenido: TTabSheet
|
||||
Caption = 'Contenido'
|
||||
ImageIndex = 1
|
||||
ExplicitWidth = 799
|
||||
inline frViewDetallesFacturaCliente1: TfrViewDetallesFacturaCliente
|
||||
Left = 0
|
||||
Top = 0
|
||||
@ -193,11 +193,11 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
||||
ParentFont = False
|
||||
TabOrder = 0
|
||||
ReadOnly = False
|
||||
ExplicitWidth = 799
|
||||
ExplicitWidth = 757
|
||||
ExplicitHeight = 350
|
||||
inherited ToolBar1: TToolBar
|
||||
Width = 757
|
||||
ExplicitWidth = 799
|
||||
ExplicitWidth = 757
|
||||
inherited ToolButton4: TToolButton
|
||||
Wrap = False
|
||||
end
|
||||
@ -219,51 +219,51 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
||||
ExplicitWidth = 57
|
||||
end
|
||||
inherited UpDown1: TUpDown
|
||||
Left = 202
|
||||
ExplicitLeft = 202
|
||||
Left = 218
|
||||
ExplicitLeft = 218
|
||||
end
|
||||
inherited ToolButton13: TToolButton
|
||||
Left = 219
|
||||
ExplicitLeft = 219
|
||||
Left = 235
|
||||
ExplicitLeft = 235
|
||||
end
|
||||
inherited ToolButton6: TToolButton
|
||||
Left = 227
|
||||
ExplicitLeft = 227
|
||||
Left = 243
|
||||
ExplicitLeft = 243
|
||||
end
|
||||
inherited ToolButton7: TToolButton
|
||||
Left = 261
|
||||
ExplicitLeft = 261
|
||||
Left = 277
|
||||
ExplicitLeft = 277
|
||||
end
|
||||
inherited ToolButton8: TToolButton
|
||||
Left = 295
|
||||
ExplicitLeft = 295
|
||||
Left = 311
|
||||
ExplicitLeft = 311
|
||||
end
|
||||
inherited ToolButton12: TToolButton
|
||||
Left = 329
|
||||
ExplicitLeft = 329
|
||||
Left = 345
|
||||
ExplicitLeft = 345
|
||||
end
|
||||
inherited ToolButton9: TToolButton
|
||||
Left = 337
|
||||
ExplicitLeft = 337
|
||||
Left = 353
|
||||
ExplicitLeft = 353
|
||||
end
|
||||
inherited ToolButton10: TToolButton
|
||||
Left = 371
|
||||
ExplicitLeft = 371
|
||||
Left = 387
|
||||
ExplicitLeft = 387
|
||||
end
|
||||
inherited ToolButton11: TToolButton
|
||||
Left = 405
|
||||
ExplicitLeft = 405
|
||||
Left = 421
|
||||
ExplicitLeft = 421
|
||||
end
|
||||
end
|
||||
inherited cxGrid: TcxGrid
|
||||
Width = 757
|
||||
Height = 278
|
||||
ExplicitWidth = 799
|
||||
ExplicitWidth = 757
|
||||
ExplicitHeight = 278
|
||||
end
|
||||
inherited TBXDock1: TTBXDock
|
||||
Width = 757
|
||||
ExplicitWidth = 799
|
||||
ExplicitWidth = 757
|
||||
inherited TBXToolbar1: TTBXToolbar
|
||||
ExplicitWidth = 548
|
||||
end
|
||||
@ -273,7 +273,6 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
||||
object pagContabilidad: TTabSheet
|
||||
Caption = 'Contabilidad'
|
||||
ImageIndex = 2
|
||||
ExplicitWidth = 799
|
||||
inline frViewListaSubcuentas1: TfrViewListaSubcuentas
|
||||
Left = 0
|
||||
Top = 0
|
||||
@ -288,18 +287,22 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
||||
ParentFont = False
|
||||
TabOrder = 0
|
||||
ReadOnly = False
|
||||
ExplicitLeft = 10
|
||||
ExplicitTop = 20
|
||||
ExplicitWidth = 757
|
||||
ExplicitHeight = 73
|
||||
inherited dxLayoutControl1: TdxLayoutControl
|
||||
Width = 757
|
||||
ExplicitWidth = 757
|
||||
inherited cbSubCuentas: TcxComboBox
|
||||
Left = 85
|
||||
ExplicitLeft = 85
|
||||
ExplicitWidth = 376
|
||||
Width = 376
|
||||
end
|
||||
inherited eContabilizar: TcxCheckBox
|
||||
Left = 520
|
||||
ExplicitLeft = 520
|
||||
ExplicitWidth = 203
|
||||
Width = 203
|
||||
end
|
||||
inherited dxLayoutControl1Group_Root: TdxLayoutGroup
|
||||
inherited dxLayoutControl1Item1: TdxLayoutItem
|
||||
@ -318,7 +321,7 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
||||
Width = 200
|
||||
end>
|
||||
ExplicitTop = 623
|
||||
ExplicitWidth = 813
|
||||
ExplicitWidth = 771
|
||||
end
|
||||
inline frViewTotales1: TfrViewTotales [4]
|
||||
Left = 0
|
||||
@ -335,12 +338,12 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
||||
TabOrder = 4
|
||||
ReadOnly = False
|
||||
ExplicitTop = 460
|
||||
ExplicitWidth = 813
|
||||
ExplicitWidth = 771
|
||||
ExplicitHeight = 163
|
||||
inherited dxLayoutControl1: TdxLayoutControl
|
||||
Width = 771
|
||||
LookAndFeel = frViewFacturaCliente1.dxLayoutOfficeLookAndFeel1
|
||||
ExplicitWidth = 813
|
||||
ExplicitWidth = 771
|
||||
inherited Bevel1: TBevel
|
||||
Top = 111
|
||||
Width = 73
|
||||
@ -497,5 +500,6 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
||||
inherited JvFormStorage: TJvFormStorage [8]
|
||||
end
|
||||
inherited dsDataTable: TDADataSource [10]
|
||||
Top = 144
|
||||
end
|
||||
end
|
||||
|
||||
@ -49,6 +49,8 @@ type
|
||||
function ExtraerSeleccionados(ARecibosProveedor: IBizFacturaProveedor) : IBizFacturaProveedor;
|
||||
|
||||
procedure SetID_Tienda (AFactura: IBizFacturaProveedor; const ID_Tienda: Integer);
|
||||
procedure SetIdSubcuenta (AFactura: IBizFacturaProveedor; const IdSubCuenta: Integer);
|
||||
procedure SetIgnorarContabilidad (AFactura: IBizFacturaProveedor; const Ignorar: Integer);
|
||||
end;
|
||||
|
||||
TFacturasProveedorController = class(TObservador, IFacturasProveedorController)
|
||||
@ -109,6 +111,8 @@ type
|
||||
function ExtraerSeleccionados(AFacturasProveedor: IBizFacturaProveedor) : IBizFacturaProveedor;
|
||||
|
||||
procedure SetID_Tienda (AFactura: IBizFacturaProveedor; const ID_Tienda: Integer);
|
||||
procedure SetIdSubcuenta (AFactura: IBizFacturaProveedor; const IdSubCuenta: Integer);
|
||||
procedure SetIgnorarContabilidad (AFactura: IBizFacturaProveedor; const Ignorar: Integer);
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -578,6 +582,9 @@ begin
|
||||
if (AFactura.Detalles.DataTable.RecordCount = 0) then
|
||||
raise Exception.Create('La factura debe tener al menos un concepto en su contenido');
|
||||
|
||||
if (AFactura.IGNORAR_CONTABILIDAD = 0) and (AFactura.Proveedor.SubCuentas.ID < 1) then
|
||||
raise Exception.Create('Para que la factura pueda pasar la parte contable es necesario que el proveedor tenga asignada una subcuenta');
|
||||
|
||||
{ Esta validación puede saltar cuando se generan facturas automáticamente
|
||||
por albaranes o pedidos y el Proveedor no tiene Tipo de IVA puesto. }
|
||||
{ if (AFactura.ID_TIPO_IVA = 0) then
|
||||
@ -884,6 +891,28 @@ begin
|
||||
FDetallesController := Value;
|
||||
end;
|
||||
|
||||
procedure TFacturasProveedorController.SetIdSubcuenta(AFactura: IBizFacturaProveedor; const IdSubCuenta: Integer);
|
||||
var
|
||||
EnEdicion: Boolean;
|
||||
begin
|
||||
if Assigned(AFactura) then
|
||||
begin
|
||||
EnEdicion := AFactura.DataTable.Editing;
|
||||
if not AFactura.DataTable.Editing then
|
||||
AFactura.DataTable.Edit;
|
||||
|
||||
if IdSubCuenta < 0 then
|
||||
AFactura.DataTable.FieldByName(fld_FacturasProveedorID_SUBCUENTA).AsVariant := Null
|
||||
else
|
||||
AFactura.ID_SUBCUENTA := IdSubCuenta;
|
||||
|
||||
AFactura.DataTable.Post;
|
||||
|
||||
if EnEdicion then
|
||||
AFactura.DataTable.Edit;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFacturasProveedorController.SetID_Tienda(AFactura: IBizFacturaProveedor; const ID_Tienda: Integer);
|
||||
var
|
||||
EnEdicion: Boolean;
|
||||
@ -906,6 +935,24 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFacturasProveedorController.SetIgnorarContabilidad(AFactura: IBizFacturaProveedor; const Ignorar: Integer);
|
||||
var
|
||||
EnEdicion: Boolean;
|
||||
begin
|
||||
if Assigned(AFactura) then
|
||||
begin
|
||||
EnEdicion := AFactura.DataTable.Editing;
|
||||
if not AFactura.DataTable.Editing then
|
||||
AFactura.DataTable.Edit;
|
||||
|
||||
AFactura.IGNORAR_CONTABILIDAD := Ignorar;
|
||||
AFactura.DataTable.Post;
|
||||
|
||||
if EnEdicion then
|
||||
AFactura.DataTable.Edit;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TFacturasProveedorController.Guardar(AFactura: IBizFacturaProveedor): Boolean;
|
||||
var
|
||||
IDNuevo : Integer;
|
||||
|
||||
@ -240,6 +240,15 @@ inherited DataModuleFacturasProveedor: TDataModuleFacturasProveedor
|
||||
Name = 'TIENDA'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'ID_SUBCUENTA'
|
||||
DataType = datInteger
|
||||
end
|
||||
item
|
||||
Name = 'SUBCUENTA'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end>
|
||||
Params = <>
|
||||
StreamingOptions = [soDisableEventsWhileStreaming]
|
||||
|
||||
@ -10,7 +10,11 @@
|
||||
<Projects Include="..\..\GUIBase\GUIBase.dproj" />
|
||||
<Projects Include="..\..\Servidor\FactuGES_Server.dproj" />
|
||||
<Projects Include="..\Articulos\Views\Articulos_view.dproj" />
|
||||
<Projects Include="..\Contabilidad\Controller\Contabilidad_controller.dproj" />
|
||||
<Projects Include="..\Contabilidad\Views\Contabilidad_view.dproj" />
|
||||
<Projects Include="..\Contactos\Model\Contactos_model.dproj" />
|
||||
<Projects Include="..\Contactos\Views\Contactos_view.dproj" />
|
||||
<Projects Include="..\Facturas de cliente\Views\FacturasCliente_view.dproj" />
|
||||
<Projects Include="Controller\FacturasProveedor_controller.dproj" />
|
||||
<Projects Include="Data\FacturasProveedor_data.dproj" />
|
||||
<Projects Include="Model\FacturasProveedor_model.dproj" />
|
||||
@ -131,14 +135,50 @@
|
||||
<Target Name="FactuGES_Server:Make">
|
||||
<MSBuild Projects="..\..\Servidor\FactuGES_Server.dproj" Targets="Make" />
|
||||
</Target>
|
||||
<Target Name="FacturasCliente_view">
|
||||
<MSBuild Projects="..\Facturas de cliente\Views\FacturasCliente_view.dproj" Targets="" />
|
||||
</Target>
|
||||
<Target Name="FacturasCliente_view:Clean">
|
||||
<MSBuild Projects="..\Facturas de cliente\Views\FacturasCliente_view.dproj" Targets="Clean" />
|
||||
</Target>
|
||||
<Target Name="FacturasCliente_view:Make">
|
||||
<MSBuild Projects="..\Facturas de cliente\Views\FacturasCliente_view.dproj" Targets="Make" />
|
||||
</Target>
|
||||
<Target Name="Contabilidad_view">
|
||||
<MSBuild Projects="..\Contabilidad\Views\Contabilidad_view.dproj" Targets="" />
|
||||
</Target>
|
||||
<Target Name="Contabilidad_view:Clean">
|
||||
<MSBuild Projects="..\Contabilidad\Views\Contabilidad_view.dproj" Targets="Clean" />
|
||||
</Target>
|
||||
<Target Name="Contabilidad_view:Make">
|
||||
<MSBuild Projects="..\Contabilidad\Views\Contabilidad_view.dproj" Targets="Make" />
|
||||
</Target>
|
||||
<Target Name="Contabilidad_controller">
|
||||
<MSBuild Projects="..\Contabilidad\Controller\Contabilidad_controller.dproj" Targets="" />
|
||||
</Target>
|
||||
<Target Name="Contabilidad_controller:Clean">
|
||||
<MSBuild Projects="..\Contabilidad\Controller\Contabilidad_controller.dproj" Targets="Clean" />
|
||||
</Target>
|
||||
<Target Name="Contabilidad_controller:Make">
|
||||
<MSBuild Projects="..\Contabilidad\Controller\Contabilidad_controller.dproj" Targets="Make" />
|
||||
</Target>
|
||||
<Target Name="Contactos_model">
|
||||
<MSBuild Projects="..\Contactos\Model\Contactos_model.dproj" Targets="" />
|
||||
</Target>
|
||||
<Target Name="Contactos_model:Clean">
|
||||
<MSBuild Projects="..\Contactos\Model\Contactos_model.dproj" Targets="Clean" />
|
||||
</Target>
|
||||
<Target Name="Contactos_model:Make">
|
||||
<MSBuild Projects="..\Contactos\Model\Contactos_model.dproj" Targets="Make" />
|
||||
</Target>
|
||||
<Target Name="Build">
|
||||
<CallTarget Targets="Base;GUIBase;ApplicationBase;Contactos_view;Articulos_view;FacturasProveedor_model;FacturasProveedor_data;FacturasProveedor_controller;FacturasProveedor_view;FacturasProveedor_plugin;FactuGES;FactuGES_Server" />
|
||||
<CallTarget Targets="Base;GUIBase;ApplicationBase;Contactos_view;Articulos_view;FacturasProveedor_model;FacturasProveedor_data;FacturasProveedor_controller;FacturasProveedor_view;FacturasProveedor_plugin;FactuGES;FactuGES_Server;FacturasCliente_view;Contabilidad_view;Contabilidad_controller;Contactos_model" />
|
||||
</Target>
|
||||
<Target Name="Clean">
|
||||
<CallTarget Targets="Base:Clean;GUIBase:Clean;ApplicationBase:Clean;Contactos_view:Clean;Articulos_view:Clean;FacturasProveedor_model:Clean;FacturasProveedor_data:Clean;FacturasProveedor_controller:Clean;FacturasProveedor_view:Clean;FacturasProveedor_plugin:Clean;FactuGES:Clean;FactuGES_Server:Clean" />
|
||||
<CallTarget Targets="Base:Clean;GUIBase:Clean;ApplicationBase:Clean;Contactos_view:Clean;Articulos_view:Clean;FacturasProveedor_model:Clean;FacturasProveedor_data:Clean;FacturasProveedor_controller:Clean;FacturasProveedor_view:Clean;FacturasProveedor_plugin:Clean;FactuGES:Clean;FactuGES_Server:Clean;FacturasCliente_view:Clean;Contabilidad_view:Clean;Contabilidad_controller:Clean;Contactos_model:Clean" />
|
||||
</Target>
|
||||
<Target Name="Make">
|
||||
<CallTarget Targets="Base:Make;GUIBase:Make;ApplicationBase:Make;Contactos_view:Make;Articulos_view:Make;FacturasProveedor_model:Make;FacturasProveedor_data:Make;FacturasProveedor_controller:Make;FacturasProveedor_view:Make;FacturasProveedor_plugin:Make;FactuGES:Make;FactuGES_Server:Make" />
|
||||
<CallTarget Targets="Base:Make;GUIBase:Make;ApplicationBase:Make;Contactos_view:Make;Articulos_view:Make;FacturasProveedor_model:Make;FacturasProveedor_data:Make;FacturasProveedor_controller:Make;FacturasProveedor_view:Make;FacturasProveedor_plugin:Make;FactuGES:Make;FactuGES_Server:Make;FacturasCliente_view:Make;Contabilidad_view:Make;Contabilidad_controller:Make;Contactos_model:Make" />
|
||||
</Target>
|
||||
<Import Condition="Exists('$(MSBuildBinPath)\Borland.Group.Targets')" Project="$(MSBuildBinPath)\Borland.Group.Targets" />
|
||||
</Project>
|
||||
@ -9,8 +9,8 @@ const
|
||||
{ Data table rules ids
|
||||
Feel free to change them to something more human readable
|
||||
but make sure they are unique in the context of your application }
|
||||
RID_FacturasProveedor = '{14858E96-12A5-404D-B349-21C49A4789EC}';
|
||||
RID_FacturasProveedor_Detalles = '{C0F8AC5C-13FF-4B02-A74E-A8665147E9DD}';
|
||||
RID_FacturasProveedor = '{802DA96D-6573-4CBF-BBA2-38E4E0BF9C20}';
|
||||
RID_FacturasProveedor_Detalles = '{3FF532D1-7C43-424B-B91C-C88BAD4881BE}';
|
||||
|
||||
{ Data table names }
|
||||
nme_FacturasProveedor = 'FacturasProveedor';
|
||||
@ -51,6 +51,8 @@ const
|
||||
fld_FacturasProveedorIGNORAR_CONTABILIDAD = 'IGNORAR_CONTABILIDAD';
|
||||
fld_FacturasProveedorID_TIENDA = 'ID_TIENDA';
|
||||
fld_FacturasProveedorTIENDA = 'TIENDA';
|
||||
fld_FacturasProveedorID_SUBCUENTA = 'ID_SUBCUENTA';
|
||||
fld_FacturasProveedorSUBCUENTA = 'SUBCUENTA';
|
||||
|
||||
{ FacturasProveedor field indexes }
|
||||
idx_FacturasProveedorID = 0;
|
||||
@ -87,6 +89,8 @@ const
|
||||
idx_FacturasProveedorIGNORAR_CONTABILIDAD = 31;
|
||||
idx_FacturasProveedorID_TIENDA = 32;
|
||||
idx_FacturasProveedorTIENDA = 33;
|
||||
idx_FacturasProveedorID_SUBCUENTA = 34;
|
||||
idx_FacturasProveedorSUBCUENTA = 35;
|
||||
|
||||
{ FacturasProveedor_Detalles fields }
|
||||
fld_FacturasProveedor_DetallesID = 'ID';
|
||||
@ -123,7 +127,7 @@ const
|
||||
type
|
||||
{ IFacturasProveedor }
|
||||
IFacturasProveedor = interface(IDAStronglyTypedDataTable)
|
||||
['{9E13A0CC-7128-4897-A079-0E7EB45BF1EC}']
|
||||
['{ADC8C0DC-48B7-4189-AC00-BA9A50CE70C4}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -260,6 +264,14 @@ type
|
||||
procedure SetTIENDAValue(const aValue: String);
|
||||
function GetTIENDAIsNull: Boolean;
|
||||
procedure SetTIENDAIsNull(const aValue: Boolean);
|
||||
function GetID_SUBCUENTAValue: Integer;
|
||||
procedure SetID_SUBCUENTAValue(const aValue: Integer);
|
||||
function GetID_SUBCUENTAIsNull: Boolean;
|
||||
procedure SetID_SUBCUENTAIsNull(const aValue: Boolean);
|
||||
function GetSUBCUENTAValue: String;
|
||||
procedure SetSUBCUENTAValue(const aValue: String);
|
||||
function GetSUBCUENTAIsNull: Boolean;
|
||||
procedure SetSUBCUENTAIsNull(const aValue: Boolean);
|
||||
|
||||
|
||||
{ Properties }
|
||||
@ -331,6 +343,10 @@ type
|
||||
property ID_TIENDAIsNull: Boolean read GetID_TIENDAIsNull write SetID_TIENDAIsNull;
|
||||
property TIENDA: String read GetTIENDAValue write SetTIENDAValue;
|
||||
property TIENDAIsNull: Boolean read GetTIENDAIsNull write SetTIENDAIsNull;
|
||||
property ID_SUBCUENTA: Integer read GetID_SUBCUENTAValue write SetID_SUBCUENTAValue;
|
||||
property ID_SUBCUENTAIsNull: Boolean read GetID_SUBCUENTAIsNull write SetID_SUBCUENTAIsNull;
|
||||
property SUBCUENTA: String read GetSUBCUENTAValue write SetSUBCUENTAValue;
|
||||
property SUBCUENTAIsNull: Boolean read GetSUBCUENTAIsNull write SetSUBCUENTAIsNull;
|
||||
end;
|
||||
|
||||
{ TFacturasProveedorDataTableRules }
|
||||
@ -475,6 +491,14 @@ type
|
||||
procedure SetTIENDAValue(const aValue: String); virtual;
|
||||
function GetTIENDAIsNull: Boolean; virtual;
|
||||
procedure SetTIENDAIsNull(const aValue: Boolean); virtual;
|
||||
function GetID_SUBCUENTAValue: Integer; virtual;
|
||||
procedure SetID_SUBCUENTAValue(const aValue: Integer); virtual;
|
||||
function GetID_SUBCUENTAIsNull: Boolean; virtual;
|
||||
procedure SetID_SUBCUENTAIsNull(const aValue: Boolean); virtual;
|
||||
function GetSUBCUENTAValue: String; virtual;
|
||||
procedure SetSUBCUENTAValue(const aValue: String); virtual;
|
||||
function GetSUBCUENTAIsNull: Boolean; virtual;
|
||||
procedure SetSUBCUENTAIsNull(const aValue: Boolean); virtual;
|
||||
|
||||
{ Properties }
|
||||
property ID: Integer read GetIDValue write SetIDValue;
|
||||
@ -545,6 +569,10 @@ type
|
||||
property ID_TIENDAIsNull: Boolean read GetID_TIENDAIsNull write SetID_TIENDAIsNull;
|
||||
property TIENDA: String read GetTIENDAValue write SetTIENDAValue;
|
||||
property TIENDAIsNull: Boolean read GetTIENDAIsNull write SetTIENDAIsNull;
|
||||
property ID_SUBCUENTA: Integer read GetID_SUBCUENTAValue write SetID_SUBCUENTAValue;
|
||||
property ID_SUBCUENTAIsNull: Boolean read GetID_SUBCUENTAIsNull write SetID_SUBCUENTAIsNull;
|
||||
property SUBCUENTA: String read GetSUBCUENTAValue write SetSUBCUENTAValue;
|
||||
property SUBCUENTAIsNull: Boolean read GetSUBCUENTAIsNull write SetSUBCUENTAIsNull;
|
||||
|
||||
public
|
||||
constructor Create(aDataTable: TDADataTable); override;
|
||||
@ -554,7 +582,7 @@ type
|
||||
|
||||
{ IFacturasProveedor_Detalles }
|
||||
IFacturasProveedor_Detalles = interface(IDAStronglyTypedDataTable)
|
||||
['{85F61EAD-0843-4BD9-B02C-03D97E7D72BD}']
|
||||
['{D16CA232-F0BA-4312-B507-9D67A38B081F}']
|
||||
{ Property getters and setters }
|
||||
function GetIDValue: Integer;
|
||||
procedure SetIDValue(const aValue: Integer);
|
||||
@ -1479,6 +1507,48 @@ begin
|
||||
DataTable.Fields[idx_FacturasProveedorTIENDA].AsVariant := Null;
|
||||
end;
|
||||
|
||||
function TFacturasProveedorDataTableRules.GetID_SUBCUENTAValue: Integer;
|
||||
begin
|
||||
result := DataTable.Fields[idx_FacturasProveedorID_SUBCUENTA].AsInteger;
|
||||
end;
|
||||
|
||||
procedure TFacturasProveedorDataTableRules.SetID_SUBCUENTAValue(const aValue: Integer);
|
||||
begin
|
||||
DataTable.Fields[idx_FacturasProveedorID_SUBCUENTA].AsInteger := aValue;
|
||||
end;
|
||||
|
||||
function TFacturasProveedorDataTableRules.GetID_SUBCUENTAIsNull: boolean;
|
||||
begin
|
||||
result := DataTable.Fields[idx_FacturasProveedorID_SUBCUENTA].IsNull;
|
||||
end;
|
||||
|
||||
procedure TFacturasProveedorDataTableRules.SetID_SUBCUENTAIsNull(const aValue: Boolean);
|
||||
begin
|
||||
if aValue then
|
||||
DataTable.Fields[idx_FacturasProveedorID_SUBCUENTA].AsVariant := Null;
|
||||
end;
|
||||
|
||||
function TFacturasProveedorDataTableRules.GetSUBCUENTAValue: String;
|
||||
begin
|
||||
result := DataTable.Fields[idx_FacturasProveedorSUBCUENTA].AsString;
|
||||
end;
|
||||
|
||||
procedure TFacturasProveedorDataTableRules.SetSUBCUENTAValue(const aValue: String);
|
||||
begin
|
||||
DataTable.Fields[idx_FacturasProveedorSUBCUENTA].AsString := aValue;
|
||||
end;
|
||||
|
||||
function TFacturasProveedorDataTableRules.GetSUBCUENTAIsNull: boolean;
|
||||
begin
|
||||
result := DataTable.Fields[idx_FacturasProveedorSUBCUENTA].IsNull;
|
||||
end;
|
||||
|
||||
procedure TFacturasProveedorDataTableRules.SetSUBCUENTAIsNull(const aValue: Boolean);
|
||||
begin
|
||||
if aValue then
|
||||
DataTable.Fields[idx_FacturasProveedorSUBCUENTA].AsVariant := Null;
|
||||
end;
|
||||
|
||||
|
||||
{ TFacturasProveedor_DetallesDataTableRules }
|
||||
constructor TFacturasProveedor_DetallesDataTableRules.Create(aDataTable: TDADataTable);
|
||||
|
||||
@ -9,13 +9,13 @@ const
|
||||
{ Delta rules ids
|
||||
Feel free to change them to something more human readable
|
||||
but make sure they are unique in the context of your application }
|
||||
RID_FacturasProveedorDelta = '{4B9EEC33-A065-4BE4-A8CF-0CBE3D1559CE}';
|
||||
RID_FacturasProveedor_DetallesDelta = '{EC76D38B-EC95-48A9-BD8C-DDF0B39E541F}';
|
||||
RID_FacturasProveedorDelta = '{91DA6A6D-8DED-41A1-BC58-3F8BA43570B9}';
|
||||
RID_FacturasProveedor_DetallesDelta = '{F264DBEE-8AE8-40B8-B153-A141DA741744}';
|
||||
|
||||
type
|
||||
{ IFacturasProveedorDelta }
|
||||
IFacturasProveedorDelta = interface(IFacturasProveedor)
|
||||
['{4B9EEC33-A065-4BE4-A8CF-0CBE3D1559CE}']
|
||||
['{91DA6A6D-8DED-41A1-BC58-3F8BA43570B9}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_EMPRESAValue : Integer;
|
||||
@ -51,6 +51,8 @@ type
|
||||
function GetOldIGNORAR_CONTABILIDADValue : SmallInt;
|
||||
function GetOldID_TIENDAValue : Integer;
|
||||
function GetOldTIENDAValue : String;
|
||||
function GetOldID_SUBCUENTAValue : Integer;
|
||||
function GetOldSUBCUENTAValue : String;
|
||||
|
||||
{ Properties }
|
||||
property OldID : Integer read GetOldIDValue;
|
||||
@ -87,6 +89,8 @@ type
|
||||
property OldIGNORAR_CONTABILIDAD : SmallInt read GetOldIGNORAR_CONTABILIDADValue;
|
||||
property OldID_TIENDA : Integer read GetOldID_TIENDAValue;
|
||||
property OldTIENDA : String read GetOldTIENDAValue;
|
||||
property OldID_SUBCUENTA : Integer read GetOldID_SUBCUENTAValue;
|
||||
property OldSUBCUENTA : String read GetOldSUBCUENTAValue;
|
||||
end;
|
||||
|
||||
{ TFacturasProveedorBusinessProcessorRules }
|
||||
@ -299,6 +303,18 @@ type
|
||||
function GetOldTIENDAIsNull: Boolean; virtual;
|
||||
procedure SetTIENDAValue(const aValue: String); virtual;
|
||||
procedure SetTIENDAIsNull(const aValue: Boolean); virtual;
|
||||
function GetID_SUBCUENTAValue: Integer; virtual;
|
||||
function GetID_SUBCUENTAIsNull: Boolean; virtual;
|
||||
function GetOldID_SUBCUENTAValue: Integer; virtual;
|
||||
function GetOldID_SUBCUENTAIsNull: Boolean; virtual;
|
||||
procedure SetID_SUBCUENTAValue(const aValue: Integer); virtual;
|
||||
procedure SetID_SUBCUENTAIsNull(const aValue: Boolean); virtual;
|
||||
function GetSUBCUENTAValue: String; virtual;
|
||||
function GetSUBCUENTAIsNull: Boolean; virtual;
|
||||
function GetOldSUBCUENTAValue: String; virtual;
|
||||
function GetOldSUBCUENTAIsNull: Boolean; virtual;
|
||||
procedure SetSUBCUENTAValue(const aValue: String); virtual;
|
||||
procedure SetSUBCUENTAIsNull(const aValue: Boolean); virtual;
|
||||
|
||||
{ Properties }
|
||||
property ID : Integer read GetIDValue write SetIDValue;
|
||||
@ -437,6 +453,14 @@ type
|
||||
property TIENDAIsNull : Boolean read GetTIENDAIsNull write SetTIENDAIsNull;
|
||||
property OldTIENDA : String read GetOldTIENDAValue;
|
||||
property OldTIENDAIsNull : Boolean read GetOldTIENDAIsNull;
|
||||
property ID_SUBCUENTA : Integer read GetID_SUBCUENTAValue write SetID_SUBCUENTAValue;
|
||||
property ID_SUBCUENTAIsNull : Boolean read GetID_SUBCUENTAIsNull write SetID_SUBCUENTAIsNull;
|
||||
property OldID_SUBCUENTA : Integer read GetOldID_SUBCUENTAValue;
|
||||
property OldID_SUBCUENTAIsNull : Boolean read GetOldID_SUBCUENTAIsNull;
|
||||
property SUBCUENTA : String read GetSUBCUENTAValue write SetSUBCUENTAValue;
|
||||
property SUBCUENTAIsNull : Boolean read GetSUBCUENTAIsNull write SetSUBCUENTAIsNull;
|
||||
property OldSUBCUENTA : String read GetOldSUBCUENTAValue;
|
||||
property OldSUBCUENTAIsNull : Boolean read GetOldSUBCUENTAIsNull;
|
||||
|
||||
public
|
||||
constructor Create(aBusinessProcessor: TDABusinessProcessor); override;
|
||||
@ -446,7 +470,7 @@ type
|
||||
|
||||
{ IFacturasProveedor_DetallesDelta }
|
||||
IFacturasProveedor_DetallesDelta = interface(IFacturasProveedor_Detalles)
|
||||
['{EC76D38B-EC95-48A9-BD8C-DDF0B39E541F}']
|
||||
['{F264DBEE-8AE8-40B8-B153-A141DA741744}']
|
||||
{ Property getters and setters }
|
||||
function GetOldIDValue : Integer;
|
||||
function GetOldID_FACTURAValue : Integer;
|
||||
@ -1712,6 +1736,68 @@ begin
|
||||
BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasProveedorTIENDA] := Null;
|
||||
end;
|
||||
|
||||
function TFacturasProveedorBusinessProcessorRules.GetID_SUBCUENTAValue: Integer;
|
||||
begin
|
||||
result := BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasProveedorID_SUBCUENTA];
|
||||
end;
|
||||
|
||||
function TFacturasProveedorBusinessProcessorRules.GetID_SUBCUENTAIsNull: Boolean;
|
||||
begin
|
||||
result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasProveedorID_SUBCUENTA]);
|
||||
end;
|
||||
|
||||
function TFacturasProveedorBusinessProcessorRules.GetOldID_SUBCUENTAValue: Integer;
|
||||
begin
|
||||
result := BusinessProcessor.CurrentChange.OldValueByName[fld_FacturasProveedorID_SUBCUENTA];
|
||||
end;
|
||||
|
||||
function TFacturasProveedorBusinessProcessorRules.GetOldID_SUBCUENTAIsNull: Boolean;
|
||||
begin
|
||||
result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_FacturasProveedorID_SUBCUENTA]);
|
||||
end;
|
||||
|
||||
procedure TFacturasProveedorBusinessProcessorRules.SetID_SUBCUENTAValue(const aValue: Integer);
|
||||
begin
|
||||
BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasProveedorID_SUBCUENTA] := aValue;
|
||||
end;
|
||||
|
||||
procedure TFacturasProveedorBusinessProcessorRules.SetID_SUBCUENTAIsNull(const aValue: Boolean);
|
||||
begin
|
||||
if aValue then
|
||||
BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasProveedorID_SUBCUENTA] := Null;
|
||||
end;
|
||||
|
||||
function TFacturasProveedorBusinessProcessorRules.GetSUBCUENTAValue: String;
|
||||
begin
|
||||
result := BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasProveedorSUBCUENTA];
|
||||
end;
|
||||
|
||||
function TFacturasProveedorBusinessProcessorRules.GetSUBCUENTAIsNull: Boolean;
|
||||
begin
|
||||
result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasProveedorSUBCUENTA]);
|
||||
end;
|
||||
|
||||
function TFacturasProveedorBusinessProcessorRules.GetOldSUBCUENTAValue: String;
|
||||
begin
|
||||
result := BusinessProcessor.CurrentChange.OldValueByName[fld_FacturasProveedorSUBCUENTA];
|
||||
end;
|
||||
|
||||
function TFacturasProveedorBusinessProcessorRules.GetOldSUBCUENTAIsNull: Boolean;
|
||||
begin
|
||||
result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_FacturasProveedorSUBCUENTA]);
|
||||
end;
|
||||
|
||||
procedure TFacturasProveedorBusinessProcessorRules.SetSUBCUENTAValue(const aValue: String);
|
||||
begin
|
||||
BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasProveedorSUBCUENTA] := aValue;
|
||||
end;
|
||||
|
||||
procedure TFacturasProveedorBusinessProcessorRules.SetSUBCUENTAIsNull(const aValue: Boolean);
|
||||
begin
|
||||
if aValue then
|
||||
BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasProveedorSUBCUENTA] := Null;
|
||||
end;
|
||||
|
||||
|
||||
{ TFacturasProveedor_DetallesBusinessProcessorRules }
|
||||
constructor TFacturasProveedor_DetallesBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
|
||||
|
||||
@ -91,10 +91,10 @@ function TBizFacturasProveedorServer.DarReferencia: String;
|
||||
var
|
||||
ATipo : String;
|
||||
begin
|
||||
if TIPO = CTE_TIPO_FACTURA then
|
||||
ATipo := REF_FACTURAS_PROVEEDOR
|
||||
else
|
||||
ATipo := REF_ABONOS_PROVEEDOR;
|
||||
// if TIPO = CTE_TIPO_FACTURA then
|
||||
ATipo := REF_FACTURAS_PROVEEDOR;
|
||||
// else
|
||||
// ATipo := REF_ABONOS_PROVEEDOR;
|
||||
|
||||
with TsrvReferencias.Create(NIL) do
|
||||
try
|
||||
@ -113,6 +113,19 @@ begin
|
||||
ASchema := BusinessProcessor.Schema;
|
||||
ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor);
|
||||
|
||||
//Eliminamos los recibos de la factura
|
||||
ACommand := ASchema.NewCommand(ACurrentConn, 'Delete_RecibosFactura');
|
||||
try
|
||||
with ACommand do
|
||||
begin
|
||||
ParamByName('ID_FACTURA').Value := aChange.OldValueByName[fld_FacturasProveedorID];
|
||||
Execute;
|
||||
end;
|
||||
finally
|
||||
ACommand := NIL;
|
||||
end;
|
||||
|
||||
//Eliminamos los asientos contables de la factura
|
||||
ACommand := ASchema.NewCommand(ACurrentConn, 'Delete_AsientoFactura');
|
||||
try
|
||||
with ACommand do
|
||||
@ -130,15 +143,14 @@ function TBizFacturasProveedorServer.IncrementarReferencia: Boolean;
|
||||
var
|
||||
ATipo : String;
|
||||
begin
|
||||
if TIPO = CTE_TIPO_FACTURA then
|
||||
ATipo := REF_FACTURAS_PROVEEDOR
|
||||
else
|
||||
ATipo := REF_ABONOS_PROVEEDOR;
|
||||
// if TIPO = CTE_TIPO_FACTURA then
|
||||
ATipo := REF_FACTURAS_PROVEEDOR;
|
||||
// else
|
||||
// ATipo := REF_ABONOS_PROVEEDOR;
|
||||
|
||||
with TsrvReferencias.Create(NIL) do
|
||||
try
|
||||
Result := IncrementarValorReferencia(ATipo,
|
||||
Self.REFERENCIA, ID_EMPRESA)
|
||||
Result := IncrementarValorReferencia(ATipo, Self.REFERENCIA, ID_EMPRESA, ID_TIENDA)
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
@ -159,6 +171,7 @@ begin
|
||||
with ACommand do
|
||||
begin
|
||||
ParamByName('IdFactura').Value := aChange.NewValueByName[fld_FacturasProveedorID];
|
||||
ParamByName('IdSubCuentaCompra').Value := aChange.NewValueByName[fld_FacturasProveedorID_SUBCUENTA];
|
||||
Execute;
|
||||
end;
|
||||
finally
|
||||
@ -180,6 +193,7 @@ begin
|
||||
with ACommand do
|
||||
begin
|
||||
ParamByName('IdFactura').Value := aChange.NewValueByName[fld_FacturasProveedorID];
|
||||
ParamByName('IdSubCuentaCompra').Value := aChange.NewValueByName[fld_FacturasProveedorID_SUBCUENTA];
|
||||
Execute;
|
||||
end;
|
||||
finally
|
||||
|
||||
@ -158,6 +158,14 @@ object srvFacturasProveedor: TsrvFacturasProveedor
|
||||
item
|
||||
DatasetField = 'TIENDA'
|
||||
TableField = 'TIENDA'
|
||||
end
|
||||
item
|
||||
DatasetField = 'ID_SUBCUENTA'
|
||||
TableField = 'ID_SUBCUENTA'
|
||||
end
|
||||
item
|
||||
DatasetField = 'SUBCUENTA'
|
||||
TableField = 'SUBCUENTA'
|
||||
end>
|
||||
end>
|
||||
Name = 'FacturasProveedor'
|
||||
@ -343,6 +351,15 @@ object srvFacturasProveedor: TsrvFacturasProveedor
|
||||
Name = 'TIENDA'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'ID_SUBCUENTA'
|
||||
DataType = datInteger
|
||||
end
|
||||
item
|
||||
Name = 'SUBCUENTA'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end>
|
||||
end
|
||||
item
|
||||
@ -508,6 +525,24 @@ object srvFacturasProveedor: TsrvFacturasProveedor
|
||||
JoinDataTables = <>
|
||||
UnionDataTables = <>
|
||||
Commands = <
|
||||
item
|
||||
Params = <
|
||||
item
|
||||
Name = 'ID_FACTURA'
|
||||
Value = ''
|
||||
end>
|
||||
Statements = <
|
||||
item
|
||||
Connection = 'IBX'
|
||||
ConnectionType = 'Interbase'
|
||||
Default = True
|
||||
Name = 'IBX'
|
||||
SQL = 'delete from recibos_proveedor'#10'where id_factura = :ID_FACTURA'#10
|
||||
StatementType = stSQL
|
||||
ColumnMappings = <>
|
||||
end>
|
||||
Name = 'Delete_RecibosFactura'
|
||||
end
|
||||
item
|
||||
Params = <
|
||||
item
|
||||
@ -535,6 +570,10 @@ object srvFacturasProveedor: TsrvFacturasProveedor
|
||||
item
|
||||
Name = 'IdFactura'
|
||||
Value = ''
|
||||
end
|
||||
item
|
||||
Name = 'IdSubCuentaCompra'
|
||||
Value = ''
|
||||
end>
|
||||
Statements = <
|
||||
item
|
||||
@ -542,7 +581,9 @@ object srvFacturasProveedor: TsrvFacturasProveedor
|
||||
ConnectionType = 'Interbase'
|
||||
Default = True
|
||||
Name = 'IBX'
|
||||
SQL = 'execute procedure proc_new_asiento_factura_prov :IdFactura'#10
|
||||
SQL =
|
||||
'execute procedure proc_new_asiento_factura_prov :IdFactura, :IdS' +
|
||||
'ubCuentaCompra'#10
|
||||
StatementType = stSQL
|
||||
ColumnMappings = <>
|
||||
end>
|
||||
|
||||
@ -57,14 +57,13 @@ procedure TsrvFacturasProveedor.DARemoteServiceBeforeGetDatasetData(
|
||||
const Dataset: IDADataset; const IncludeSchema: Boolean;
|
||||
const MaxRecords: Integer);
|
||||
begin
|
||||
{ if DataSet.Name = nme_FacturasProveedor then
|
||||
if DataSet.Name = nme_FacturasProveedor then
|
||||
begin
|
||||
{ Aquí se asegura que el usuario sólo accede a facturas
|
||||
de las empresas a las que tiene permiso para acceder
|
||||
filtrando DataSet por ID_EMPRESA. }
|
||||
{ FiltrarAccesoUsuario(Session, Connection, schFacturasProveedor, DataSet, fld_FacturasProveedorID_EMPRESA);
|
||||
FiltrarAccesoUsuario(Session, Connection, schFacturasProveedor, DataSet, fld_FacturasProveedorID_EMPRESA);
|
||||
end;
|
||||
}
|
||||
end;
|
||||
|
||||
procedure TsrvFacturasProveedor.DARemoteServiceCreate(Sender: TObject);
|
||||
|
||||
@ -28,7 +28,9 @@ requires
|
||||
FacturasProveedor_controller,
|
||||
FacturasProveedor_model,
|
||||
GUIBase,
|
||||
Articulos_view;
|
||||
Articulos_view,
|
||||
Contabilidad_controller,
|
||||
Contabilidad_view;
|
||||
|
||||
contains
|
||||
uFacturasProveedorViewRegister in 'uFacturasProveedorViewRegister.pas',
|
||||
|
||||
@ -41,7 +41,6 @@
|
||||
<BorlandProject>
|
||||
<BorlandProject><Delphi.Personality><Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><Package_Options><Package_Options Name="ImplicitBuild">True</Package_Options><Package_Options Name="DesigntimeOnly">False</Package_Options><Package_Options Name="RuntimeOnly">False</Package_Options></Package_Options><VersionInfo><VersionInfo Name="IncludeVerInfo">True</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">3082</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys></VersionInfoKeys><Excluded_Packages>
|
||||
|
||||
|
||||
<Excluded_Packages Name="C:\Archivos de programa\RemObjects Software\Pascal Script\Dcu\D10\PascalScript_RO_D10.bpl">RemObjects Pascal Script - RemObjects SDK 3.0 Integration</Excluded_Packages>
|
||||
</Excluded_Packages><Source><Source Name="MainSource">FacturasProveedor_view.dpk</Source></Source></Delphi.Personality></BorlandProject></BorlandProject>
|
||||
</ProjectExtensions>
|
||||
@ -50,10 +49,12 @@
|
||||
<DelphiCompile Include="FacturasProveedor_view.dpk">
|
||||
<MainSource>MainSource</MainSource>
|
||||
</DelphiCompile>
|
||||
<DCCReference Include="..\Articulos_view.dcp" />
|
||||
<DCCReference Include="..\FacturasProveedor_controller.dcp" />
|
||||
<DCCReference Include="..\FacturasProveedor_model.dcp" />
|
||||
<DCCReference Include="..\GUIBase.dcp" />
|
||||
<DCCReference Include="..\..\Lib\Articulos_view.dcp" />
|
||||
<DCCReference Include="..\..\Lib\Contabilidad_controller.dcp" />
|
||||
<DCCReference Include="..\..\Lib\Contabilidad_view.dcp" />
|
||||
<DCCReference Include="..\..\Lib\FacturasProveedor_controller.dcp" />
|
||||
<DCCReference Include="..\..\Lib\FacturasProveedor_model.dcp" />
|
||||
<DCCReference Include="..\..\Lib\GUIBase.dcp" />
|
||||
<DCCReference Include="uEditorElegirArticulosFacturaProveedor.pas">
|
||||
<Form>fEditorElegirArticulosFacturaProveedor</Form>
|
||||
<DesignClass>TfEditorElegirArticulosFacturaProveedor</DesignClass>
|
||||
|
||||
@ -71,6 +71,7 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor
|
||||
inherited pgPaginas: TPageControl
|
||||
Width = 740
|
||||
Height = 342
|
||||
ActivePage = pagContabilidad
|
||||
OnChanging = pgPaginasChanging
|
||||
ExplicitLeft = 3
|
||||
ExplicitTop = 79
|
||||
@ -98,6 +99,7 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor
|
||||
ExplicitWidth = 732
|
||||
ExplicitHeight = 314
|
||||
inherited dxLayoutControl1: TdxLayoutControl
|
||||
Width = 732
|
||||
Height = 314
|
||||
ExplicitWidth = 732
|
||||
ExplicitHeight = 314
|
||||
@ -122,11 +124,17 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor
|
||||
ExplicitWidth = 169
|
||||
Width = 169
|
||||
end
|
||||
inherited bFormasPago: TButton
|
||||
Left = 210
|
||||
ExplicitLeft = 210
|
||||
end
|
||||
inherited eReferenciaProveedor: TcxDBTextEdit
|
||||
ExplicitWidth = 316
|
||||
Width = 316
|
||||
end
|
||||
inherited frViewProveedorFactura: TfrViewDatosYSeleccionProveedor
|
||||
Left = 370
|
||||
ExplicitLeft = 370
|
||||
inherited dxLayoutControl1: TdxLayoutControl
|
||||
inherited edtlNombre: TcxDBTextEdit
|
||||
ExplicitWidth = 276
|
||||
@ -151,7 +159,10 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor
|
||||
end
|
||||
end
|
||||
inherited frViewTienda1: TfrViewTienda
|
||||
Width = 320
|
||||
ExplicitWidth = 320
|
||||
inherited dxLayoutControl1: TdxLayoutControl
|
||||
Width = 320
|
||||
inherited cbTienda: TcxComboBox
|
||||
ExplicitWidth = 376
|
||||
Width = 376
|
||||
@ -260,32 +271,42 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor
|
||||
object pagContabilidad: TTabSheet
|
||||
Caption = 'Contabilidad'
|
||||
ImageIndex = 2
|
||||
ExplicitLeft = 0
|
||||
ExplicitTop = 0
|
||||
ExplicitWidth = 0
|
||||
ExplicitHeight = 0
|
||||
object cbIgnorarContabilidad: TcxDBCheckBox
|
||||
Left = 16
|
||||
Top = 12
|
||||
Caption = 'Ignorar en contabilidad'
|
||||
DataBinding.DataField = 'IGNORAR_CONTABILIDAD'
|
||||
DataBinding.DataSource = dsDataTable
|
||||
Properties.NullStyle = nssUnchecked
|
||||
Properties.ValueChecked = 1
|
||||
Properties.ValueUnchecked = 0
|
||||
Style.BorderColor = clWindowFrame
|
||||
Style.BorderStyle = ebs3D
|
||||
Style.HotTrack = False
|
||||
Style.LookAndFeel.Kind = lfStandard
|
||||
Style.LookAndFeel.NativeStyle = True
|
||||
StyleDisabled.LookAndFeel.Kind = lfStandard
|
||||
StyleDisabled.LookAndFeel.NativeStyle = True
|
||||
StyleFocused.LookAndFeel.Kind = lfStandard
|
||||
StyleFocused.LookAndFeel.NativeStyle = True
|
||||
StyleHot.LookAndFeel.Kind = lfStandard
|
||||
StyleHot.LookAndFeel.NativeStyle = True
|
||||
inline frViewListaSubcuentas1: TfrViewListaSubcuentas
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 732
|
||||
Height = 69
|
||||
Align = alTop
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'Tahoma'
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
TabOrder = 0
|
||||
Width = 300
|
||||
ReadOnly = False
|
||||
ExplicitWidth = 732
|
||||
inherited dxLayoutControl1: TdxLayoutControl
|
||||
Width = 732
|
||||
ExplicitWidth = 732
|
||||
inherited cbSubCuentas: TcxComboBox
|
||||
Left = 92
|
||||
ExplicitLeft = 92
|
||||
ExplicitWidth = 376
|
||||
Width = 376
|
||||
end
|
||||
inherited eContabilizar: TcxCheckBox
|
||||
Left = 505
|
||||
ExplicitLeft = 505
|
||||
ExplicitWidth = 203
|
||||
Width = 203
|
||||
end
|
||||
inherited dxLayoutControl1Group_Root: TdxLayoutGroup
|
||||
inherited dxLayoutControl1Item1: TdxLayoutItem
|
||||
Caption = 'Tipo de compra:'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -485,5 +506,7 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor
|
||||
inherited JvFormStorage: TJvFormStorage [8]
|
||||
end
|
||||
inherited dsDataTable: TDADataSource [10]
|
||||
Left = 40
|
||||
Top = 144
|
||||
end
|
||||
end
|
||||
|
||||
@ -7,14 +7,14 @@ uses
|
||||
Dialogs, uEditorDBItem, DB, uDADataTable, JvAppStorage,
|
||||
JvAppRegistryStorage, JvComponent, JvFormPlacement, ImgList,
|
||||
PngImageList, StdActns, ActnList, ComCtrls, TBX, TB2Item, TB2Dock,
|
||||
TB2Toolbar, ExtCtrls, JvExControls, JvNavigationPane,
|
||||
TB2Toolbar, ExtCtrls, JvExControls, JvNavigationPane,
|
||||
uCustomView, uViewBase, uViewTotales,
|
||||
StdCtrls, pngimage, AppEvnts, JvComponentBase,
|
||||
uBizFacturasProveedor, uIEditorFacturaProveedor, uFacturasProveedorController, uViewDetallesBase,
|
||||
dxLayoutLookAndFeels, JvExComCtrls, JvStatusBar, uBizTiposIVA,
|
||||
uViewDetallesDTO, uViewDetallesArticulos, uTiposIVAController,
|
||||
uViewDetallesFacturaProveedor, uViewFacturaProveedor, uDAInterfaces,
|
||||
cxControls, cxContainer, cxEdit, cxCheckBox, cxDBEdit;
|
||||
cxControls, cxContainer, cxEdit, cxCheckBox, cxDBEdit, uViewListaSubCuentas;
|
||||
|
||||
|
||||
type
|
||||
@ -23,7 +23,7 @@ type
|
||||
frViewFacturaProveedor1: TfrViewFacturaProveedor;
|
||||
frViewDetallesFacturaProveedor1: TfrViewDetallesFacturaProveedor;
|
||||
pagContabilidad: TTabSheet;
|
||||
cbIgnorarContabilidad: TcxDBCheckBox;
|
||||
frViewListaSubcuentas1: TfrViewListaSubcuentas;
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure frViewProveedorFactura1edtlNombrePropertiesEditValueChanged(
|
||||
Sender: TObject);
|
||||
@ -76,9 +76,10 @@ type
|
||||
|
||||
implementation
|
||||
{$R *.dfm}
|
||||
{$INCLUDE ..\..\..\FactuGES.inc}
|
||||
|
||||
uses
|
||||
uBizContactos, uDataModuleUsuarios, uFactuGES_App,
|
||||
uBizContactos, uDataModuleUsuarios, uFactuGES_App, uSubCuentasController,
|
||||
uDetallesFacturaProveedorController, uDialogUtils, uDataTableUtils;
|
||||
// uGenerarAlbaranesProvFacProvUtils;
|
||||
|
||||
@ -93,7 +94,10 @@ begin
|
||||
inherited;
|
||||
pgPaginas.ActivePageIndex := 0;
|
||||
ViewFacturaProveedor := frViewFacturaProveedor1;
|
||||
FTiposIVAController := TTiposIVAController.Create;
|
||||
FTiposIVAController := TTiposIVAController.Create;
|
||||
|
||||
//CONTABILIDAD
|
||||
frViewListaSubcuentas1.TipoSubCuenta := tCompras;
|
||||
end;
|
||||
|
||||
procedure TfEditorFacturaProveedor.CustomEditorClose(Sender: TObject;
|
||||
@ -246,7 +250,12 @@ begin
|
||||
frViewDetallesFacturaProveedor1.BeginUpdate; // Para que no se mueva el foco
|
||||
try
|
||||
bEsNuevo := FFactura.EsNuevo;
|
||||
FController.SetID_Tienda(FFactura, frViewFacturaProveedor1.frViewTienda1.getIDTienda);
|
||||
|
||||
{$IFDEF CONTABILIDAD}
|
||||
FController.SetIgnorarContabilidad(FFactura, frViewListaSubCuentas1.eContabilizar.EditValue);
|
||||
FController.SetIdSubcuenta(FFactura, frViewListaSubCuentas1.IdSubCuenta);
|
||||
{$ENDIF}
|
||||
|
||||
FController.Guardar(FFactura);
|
||||
finally
|
||||
frViewDetallesFacturaProveedor1.EndUpdate;
|
||||
@ -400,6 +409,12 @@ begin
|
||||
frViewDetallesFacturaProveedor1.Detalles := FFactura.Detalles;
|
||||
frViewDetallesFacturaProveedor1.Factura := FFactura; //Para poder sacar los descuento del articulos segun el proveedor seleccionado
|
||||
end;
|
||||
|
||||
{$IFDEF CONTABILIDAD}
|
||||
frViewListaSubCuentas1.eContabilizar.EditValue := FFactura.IGNORAR_CONTABILIDAD;
|
||||
// frViewListaSubCuentas1.ElegirSubCuenta(FFactura.ID_SUBCUENTA);
|
||||
{$ENDIF}
|
||||
|
||||
end
|
||||
else begin
|
||||
frViewFacturaProveedor1.frViewProveedorFactura.OnProveedorChanged := NIL;
|
||||
|
||||
Binary file not shown.
@ -97,8 +97,6 @@ uses
|
||||
schAlbaranesClienteServer_Intf in '..\Modulos\Albaranes de cliente\Model\schAlbaranesClienteServer_Intf.pas',
|
||||
schAlbaranesProveedorClient_Intf in '..\Modulos\Albaranes de proveedor\Model\schAlbaranesProveedorClient_Intf.pas',
|
||||
schAlbaranesProveedorServer_Intf in '..\Modulos\Albaranes de proveedor\Model\schAlbaranesProveedorServer_Intf.pas',
|
||||
schFacturasProveedorClient_Intf in '..\Modulos\Facturas de proveedor\Model\schFacturasProveedorClient_Intf.pas',
|
||||
schFacturasProveedorServer_Intf in '..\Modulos\Facturas de proveedor\Model\schFacturasProveedorServer_Intf.pas',
|
||||
schPedidosProveedorClient_Intf in '..\Modulos\Pedidos a proveedor\Model\schPedidosProveedorClient_Intf.pas',
|
||||
schPedidosProveedorServer_Intf in '..\Modulos\Pedidos a proveedor\Model\schPedidosProveedorServer_Intf.pas',
|
||||
schPresupuestosClienteClient_Intf in '..\Modulos\Presupuestos de cliente\Model\schPresupuestosClienteClient_Intf.pas',
|
||||
@ -118,7 +116,9 @@ uses
|
||||
schFacturasClienteClient_Intf in '..\Modulos\Facturas de cliente\Model\schFacturasClienteClient_Intf.pas',
|
||||
schFacturasClienteServer_Intf in '..\Modulos\Facturas de cliente\Model\schFacturasClienteServer_Intf.pas',
|
||||
schContabilidadClient_Intf in '..\Modulos\Contabilidad\Model\schContabilidadClient_Intf.pas',
|
||||
schContabilidadServer_Intf in '..\Modulos\Contabilidad\Model\schContabilidadServer_Intf.pas';
|
||||
schContabilidadServer_Intf in '..\Modulos\Contabilidad\Model\schContabilidadServer_Intf.pas',
|
||||
schFacturasProveedorClient_Intf in '..\Modulos\Facturas de proveedor\Model\schFacturasProveedorClient_Intf.pas',
|
||||
schFacturasProveedorServer_Intf in '..\Modulos\Facturas de proveedor\Model\schFacturasProveedorServer_Intf.pas';
|
||||
|
||||
{$R *.res}
|
||||
{$R ..\Servicios\RODLFile.res}
|
||||
|
||||
@ -14,7 +14,7 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "FileVersion", "1.0.0.0\0"
|
||||
VALUE "ProductVersion", "1.0.0.0\0"
|
||||
VALUE "CompileDate", "jueves, 06 de marzo de 2008 21:29\0"
|
||||
VALUE "CompileDate", "miércoles, 12 de marzo de 2008 18:59\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user