Se retocan los informes de facturas para que la base imponible no se falsee al descontar el descuento, ya no se debe hacer version 1.0.8

git-svn-id: https://192.168.0.254/svn/Proyectos.AbetoArmarios_FactuGES/trunk@48 0a814768-cfdd-9c42-8d01-223fcc10da9d
This commit is contained in:
roberto 2010-06-14 18:03:11 +00:00
parent 7f905a73f9
commit 1a77d838f5
12 changed files with 196 additions and 80 deletions

View File

@ -114,7 +114,7 @@ IncludeVerInfo=1
AutoIncBuild=0
MajorVer=3
MinorVer=2
Release=7
Release=8
Build=0
Debug=0
PreRelease=0
@ -126,13 +126,13 @@ CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=
FileVersion=3.2.7.0
FileVersion=3.2.8.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=3.2.7.0
ProductVersion=3.2.8.0
Comments=
[Excluded Packages]
C:\Archivos de programa\Borland\Delphi7\Projects\Bpl\cxLibraryVCLD7.bpl=Express Cross Platform Library (VCL Edition) by Developer Express Inc.

View File

@ -8,37 +8,50 @@ File_5=SourceModule,'C:\Codigo Abeto\BaseDatos\TablaEmpresas.pas',0,1,379,1,390,
File_6=SourceModule,'C:\Codigo Abeto\Informes\InformeAlbaranCliente.pas',0,1,51,38,68,0,0
[Modules]
Module0=C:\Codigo Abeto\Informes\InformeFacturaCliente.pas
Module1=C:\Codigo Abeto\Clientes\ContratoCliente.pas
Module2=C:\Codigo Abeto\Informes\InformeContratoCliente.pas
Module3=C:\Codigo Abeto\Clientes\FacturaProforma.pas
Module4=C:\Codigo Abeto\Clientes\PresupuestoCliente.pas
Module5=C:\Codigo Abeto\Clientes\FacturaCliente.pas
Module6=C:\Codigo Abeto\BaseDatos\TablaPresupuestos.pas
Module7=C:\Codigo Abeto\BaseDatos\TablaFacturasCliente.pas
Module8=C:\Codigo Abeto\Informes\InformeTrimestralVentas.pas
Module9=C:\Codigo Abeto\Clientes\ImprimirFacturasCliente.pas
Module10=C:\Codigo Abeto\BaseDatos\TablaContratos.pas
Module11=C:\Codigo Abeto\Factuges.dpr
Count=12
Module0=C:\Codigo Abeto\Proveedores\FacturaProveedor.pas
Module1=C:\Codigo Abeto\BaseDatos\TablaFacturasCliente.pas
Module2=C:\Codigo Abeto\BaseDatos\TablaFacturasProveedor.pas
Module3=C:\Codigo Abeto\Clientes\FacturaCliente.pas
Module4=C:\Codigo Abeto\Clientes\ContratoCliente.pas
Module5=C:\Codigo Abeto\Clientes\PresupuestoCliente.pas
Module6=C:\Codigo Abeto\Informes\InformeTrimestralVentas.pas
Module7=C:\Codigo Abeto\Informes\InformeTrimestralCompras.pas
Module8=C:\Codigo Abeto\Informes\InformeResumenFacturacionProveedores.pas
Module9=C:\Codigo Abeto\Informes\InformeResumenFacturacionClientes.pas
Module10=C:\Codigo Abeto\Informes\InformeHistorialFacturacionProveedores.pas
Module11=C:\Codigo Abeto\Informes\InformeHistorialFacturacionClientes.pas
Module12=C:\Codigo Abeto\Clientes\AlbaranCliente.pas
Module13=C:\Codigo Abeto\Informes\InformeFacturaCliente.pas
Module14=C:\Codigo Abeto\Clientes\ImprimirFacturasCliente.pas
Module15=C:\Codigo Abeto\BaseDatos\TablaPresupuestos.pas
Module16=C:\Codigo Abeto\Clientes\FacturaProforma.pas
Module17=C:\Codigo Abeto\Informes\InformeContratoCliente.pas
Module18=C:\Codigo Abeto\BaseDatos\TablaContratos.pas
Module19=C:\Codigo Abeto\Factuges.dpr
Count=20
EditWindowCount=1
[C:\Codigo Abeto\Informes\InformeFacturaCliente.pas]
ModuleType=SourceModule
FormState=1
FormOnTop=1
[C:\Codigo Abeto\Clientes\ContratoCliente.pas]
[C:\Codigo Abeto\Proveedores\FacturaProveedor.pas]
ModuleType=SourceModule
FormState=1
FormOnTop=0
[C:\Codigo Abeto\Informes\InformeContratoCliente.pas]
[C:\Codigo Abeto\BaseDatos\TablaFacturasCliente.pas]
ModuleType=SourceModule
FormState=0
FormOnTop=0
[C:\Codigo Abeto\BaseDatos\TablaFacturasProveedor.pas]
ModuleType=SourceModule
FormState=0
FormOnTop=0
[C:\Codigo Abeto\Clientes\FacturaCliente.pas]
ModuleType=SourceModule
FormState=1
FormOnTop=1
FormOnTop=0
[C:\Codigo Abeto\Clientes\FacturaProforma.pas]
[C:\Codigo Abeto\Clientes\ContratoCliente.pas]
ModuleType=SourceModule
FormState=1
FormOnTop=0
@ -48,7 +61,47 @@ ModuleType=SourceModule
FormState=1
FormOnTop=0
[C:\Codigo Abeto\Clientes\FacturaCliente.pas]
[C:\Codigo Abeto\Informes\InformeTrimestralVentas.pas]
ModuleType=SourceModule
FormState=1
FormOnTop=0
[C:\Codigo Abeto\Informes\InformeTrimestralCompras.pas]
ModuleType=SourceModule
FormState=0
FormOnTop=0
[C:\Codigo Abeto\Informes\InformeResumenFacturacionProveedores.pas]
ModuleType=SourceModule
FormState=0
FormOnTop=0
[C:\Codigo Abeto\Informes\InformeResumenFacturacionClientes.pas]
ModuleType=SourceModule
FormState=0
FormOnTop=0
[C:\Codigo Abeto\Informes\InformeHistorialFacturacionProveedores.pas]
ModuleType=SourceModule
FormState=0
FormOnTop=0
[C:\Codigo Abeto\Informes\InformeHistorialFacturacionClientes.pas]
ModuleType=SourceModule
FormState=0
FormOnTop=0
[C:\Codigo Abeto\Clientes\AlbaranCliente.pas]
ModuleType=SourceModule
FormState=0
FormOnTop=0
[C:\Codigo Abeto\Informes\InformeFacturaCliente.pas]
ModuleType=SourceModule
FormState=1
FormOnTop=0
[C:\Codigo Abeto\Clientes\ImprimirFacturasCliente.pas]
ModuleType=SourceModule
FormState=1
FormOnTop=0
@ -58,21 +111,16 @@ ModuleType=SourceModule
FormState=1
FormOnTop=0
[C:\Codigo Abeto\BaseDatos\TablaFacturasCliente.pas]
[C:\Codigo Abeto\Clientes\FacturaProforma.pas]
ModuleType=SourceModule
FormState=1
FormOnTop=0
[C:\Codigo Abeto\Informes\InformeTrimestralVentas.pas]
[C:\Codigo Abeto\Informes\InformeContratoCliente.pas]
ModuleType=SourceModule
FormState=1
FormOnTop=1
[C:\Codigo Abeto\Clientes\ImprimirFacturasCliente.pas]
ModuleType=SourceModule
FormState=1
FormOnTop=0
[C:\Codigo Abeto\BaseDatos\TablaContratos.pas]
ModuleType=SourceModule
FormState=0
@ -87,6 +135,10 @@ FormOnTop=0
FormState=0
FormOnTop=0
[C:\Codigo Abeto\Informes\InformeBase.pas]
FormState=0
FormOnTop=0
[C:\Codigo Abeto\Libreria\Configuracion.pas]
FormState=0
FormOnTop=0
@ -95,13 +147,9 @@ FormOnTop=0
FormState=0
FormOnTop=0
[C:\Codigo Abeto\Informes\InformeBase.pas]
FormState=0
FormOnTop=0
[EditWindow0]
ViewCount=12
CurrentView=7
ViewCount=20
CurrentView=5
View0=0
View1=1
View2=2
@ -114,6 +162,14 @@ View8=8
View9=9
View10=10
View11=11
View12=12
View13=13
View14=14
View15=15
View16=16
View17=17
View18=18
View19=19
CodeExplorer=CodeExplorer@EditWindow0
MessageView=MessageView@EditWindow0
Create=1
@ -131,7 +187,7 @@ LeftPanelSize=140
LeftPanelClients=CodeExplorer@EditWindow0
LeftPanelData=000004000000000000000000000000000000000000000000000100000000000000000C000000436F64654578706C6F726572FFFFFFFF
RightPanelSize=0
BottomPanelSize=249
BottomPanelSize=499
BottomPanelClients=MessageView@EditWindow0
BottomPanelData=000004000000000000000000000000000000000000000000000100000000000000000B0000004D65737361676556696577FFFFFFFF
@ -151,8 +207,8 @@ LeftCol=1
[View2]
Module=C:\Codigo Abeto\Clientes\FacturaCliente.pas
CursorX=67
CursorY=776
CursorX=7
CursorY=768
TopLine=764
LeftCol=1
@ -165,58 +221,114 @@ LeftCol=1
[View4]
Module=C:\Codigo Abeto\Informes\InformeTrimestralVentas.pas
CursorX=70
CursorX=27
CursorY=134
TopLine=119
LeftCol=1
[View5]
Module=C:\Codigo Abeto\Clientes\PresupuestoCliente.pas
CursorX=24
CursorY=1023
TopLine=1009
Module=C:\Codigo Abeto\Proveedores\FacturaProveedor.pas
CursorX=32
CursorY=694
TopLine=684
LeftCol=1
[View6]
Module=C:\Codigo Abeto\BaseDatos\TablaFacturasProveedor.pas
CursorX=1
CursorY=1
TopLine=91
LeftCol=1
[View7]
Module=C:\Codigo Abeto\Clientes\PresupuestoCliente.pas
CursorX=23
CursorY=1013
TopLine=1012
LeftCol=1
[View8]
Module=C:\Codigo Abeto\Clientes\ImprimirFacturasCliente.pas
CursorX=34
CursorY=9
TopLine=22
LeftCol=1
[View7]
[View9]
Module=C:\Codigo Abeto\Informes\InformeFacturaCliente.pas
CursorX=1
CursorY=1
TopLine=1
CursorX=60
CursorY=18
TopLine=85
LeftCol=1
[View8]
[View10]
Module=C:\Codigo Abeto\Informes\InformeContratoCliente.pas
CursorX=87
CursorY=14
TopLine=217
LeftCol=1
[View9]
[View11]
Module=C:\Codigo Abeto\Clientes\ContratoCliente.pas
CursorX=44
CursorY=902
TopLine=888
CursorX=7
CursorY=892
TopLine=876
LeftCol=1
[View10]
[View12]
Module=C:\Codigo Abeto\BaseDatos\TablaContratos.pas
CursorX=1
CursorY=1
TopLine=1
LeftCol=1
[View11]
[View13]
Module=C:\Codigo Abeto\BaseDatos\TablaFacturasCliente.pas
CursorX=14
CursorY=103
TopLine=184
CursorY=154
TopLine=217
LeftCol=1
[View14]
Module=C:\Codigo Abeto\Clientes\AlbaranCliente.pas
CursorX=23
CursorY=648
TopLine=633
LeftCol=1
[View15]
Module=C:\Codigo Abeto\Informes\InformeHistorialFacturacionClientes.pas
CursorX=21
CursorY=98
TopLine=76
LeftCol=1
[View16]
Module=C:\Codigo Abeto\Informes\InformeHistorialFacturacionProveedores.pas
CursorX=37
CursorY=99
TopLine=75
LeftCol=1
[View17]
Module=C:\Codigo Abeto\Informes\InformeResumenFacturacionClientes.pas
CursorX=34
CursorY=93
TopLine=72
LeftCol=1
[View18]
Module=C:\Codigo Abeto\Informes\InformeResumenFacturacionProveedores.pas
CursorX=34
CursorY=91
TopLine=75
LeftCol=1
[View19]
Module=C:\Codigo Abeto\Informes\InformeTrimestralCompras.pas
CursorX=65
CursorY=150
TopLine=140
LeftCol=1
[Watches]
@ -256,8 +368,8 @@ Left=0
Top=0
Width=1676
Height=112
MaxLeft=-4
MaxTop=-4
MaxLeft=-1
MaxTop=-1
MaxWidth=1684
MaxHeight=112
ClientWidth=1676
@ -342,7 +454,7 @@ LRDockWidth=317
Dockable=1
SplitPos=201
ArrangeBy=Name
SelectedItem=Name
SelectedItem=Visible
ExpandedItems=ActiveTranslateStringEngine,Anchors,AppStorage,BevelEdges,Brush,Constraints,DataBinding,DataController,DataController.Filter,DataController.Options,DataController.Summary,DataController.Summary.Options,Filtering,HTTPOptions,LookAndFeel.AssignedValues,NavigatorButtons.Cancel,NavigatorButtons.Delete,NavigatorButtons.Edit,Options,OptionsBehavior,OptionsData,OptionsSelection,OptionsView,Preview,Properties,Properties.Alignment,Properties.SpinButtons,StorageOptions,Style,Styles,VertScrollBar
HiddenCategories=
@ -535,11 +647,11 @@ State=0
Left=0
Top=12
Width=140
Height=574
Height=324
MaxLeft=-1
MaxTop=-1
ClientWidth=140
ClientHeight=574
ClientHeight=324
TBDockHeight=305
LRDockWidth=140
Dockable=1
@ -551,12 +663,12 @@ State=0
Left=12
Top=0
Width=1224
Height=249
Height=499
MaxLeft=-1
MaxTop=-1
ClientWidth=1224
ClientHeight=249
TBDockHeight=249
ClientHeight=499
TBDockHeight=499
LRDockWidth=443
Dockable=1
@ -580,6 +692,6 @@ TBDockHeight=916
LRDockWidth=325
Dockable=1
TabPosition=0
ActiveTab=Object Inspector
ActiveTab=Object TreeView
TabDockClients=PropertyInspector,ObjectTree

Binary file not shown.

View File

@ -88,14 +88,14 @@ begin
SQL.Add('COALESCE(C.CODIGOPOSTAL, FC.CODIGOPOSTAL) as CODIGOPOSTAL, ');
SQL.Add('COALESCE(C.POBLACION, FC.POBLACION) as POBLACION ,');
SQL.Add('COALESCE(C.PROVINCIA, FC.PROVINCIA) as PROVINCIA ,');
SQL.Add('FC.IVA, (FC.BASEIMPONIBLE - FC.IMPORTEDESCUENTO) AS BASEIMPONIBLE, FC.IMPORTEIVA, FC.IMPORTETOTAL');
SQL.Add('FC.IVA, FC.BASEIMPONIBLE AS BASEIMPONIBLE, FC.IMPORTEIVA, FC.IMPORTETOTAL');
SQL.Add('from FACTURASCLIENTE FC left join sucursalescliente C');
SQL.Add('on (FC.CODIGOCLIENTE = C.CODIGOCLIENTE) and (C.TIPO = ''P'')');
SQL.Add('where FC.CODIGOEMPRESA = :CODIGOEMPRESA');
SQL.Add('and upper(FC.NOMBRE) between upper(:NOMBREINI) and upper(:NOMBREFIN) ');
SQL.Add('and FC.FECHAFACTURA between :FECHAFACINI and :FECHAFACFIN ');
if not VarIsNull(FImporteMinimo) then
SQL.Add('and (FC.BASEIMPONIBLE - FC.IMPORTEDESCUENTO) >= :BASEIMPONIBLE ');
SQL.Add('and FC.BASEIMPONIBLE >= :BASEIMPONIBLE ');
SQL.Add('order by FC.NOMBRE, FC.FECHAFACTURA');
ParamByName('CODIGOEMPRESA').AsInteger := EmpresaActiva.Codigo;
ParamByName('NOMBREINI').AsString := FNombreIni;

View File

@ -87,7 +87,7 @@ begin
SQL.Add('COALESCE(P.CODIGOPOSTAL, FP.CODIGOPOSTAL) as CODIGOPOSTAL, ');
SQL.Add('COALESCE(P.POBLACION, FP.POBLACION) as POBLACION ,');
SQL.Add('COALESCE(P.PROVINCIA, FP.PROVINCIA) as PROVINCIA ,');
SQL.Add('FP.IVA, (FP.BASEIMPONIBLE - FP.IMPORTEDESCUENTO) AS BASEIMPONIBLE, FP.IMPORTEIVA, FP.IMPORTETOTAL');
SQL.Add('FP.IVA, FP.BASEIMPONIBLE AS BASEIMPONIBLE, FP.IMPORTEIVA, FP.IMPORTETOTAL');
SQL.Add('from FACTURASPROVEEDOR FP left join PROVEEDORES P');
SQL.Add('on FP.CODIGOPROVEEDOR = P.CODIGO');
SQL.Add('left join TIPOSFACTURAS TF');
@ -96,7 +96,7 @@ begin
SQL.Add('and upper(FP.NOMBRE) between upper(:NOMBREINI) and upper(:NOMBREFIN) ');
SQL.Add('and FP.FECHAFACTURA between :FECHAFACINI and :FECHAFACFIN ');
if not VarIsNull(FImporteMinimo) then
SQL.Add('and (FP.BASEIMPONIBLE - FP.IMPORTEDESCUENTO) >= :BASEIMPONIBLE ');
SQL.Add('and FP.BASEIMPONIBLE >= :BASEIMPONIBLE ');
SQL.Add('order by FP.NOMBRE, FP.FECHAFACTURA');
ParamByName('CODIGOEMPRESA').AsInteger := EmpresaActiva.Codigo;
ParamByName('NOMBREINI').AsString := FNombreIni;

View File

@ -84,13 +84,13 @@ begin
Database := FBaseDatos;
Transaction := FTransaccion;
SQL.Clear;
SQL.Add('select NOMBRE, (BASEIMPONIBLE - IMPORTEDESCUENTO) AS BASEIMPONIBLE, IMPORTEIVA, IMPORTETOTAL ');
SQL.Add('select NOMBRE, BASEIMPONIBLE AS BASEIMPONIBLE, IMPORTEIVA, IMPORTETOTAL ');
SQL.Add('from FACTURASCLIENTE ');
SQL.Add('where CODIGOEMPRESA = :CODIGOEMPRESA');
SQL.Add('and upper(NOMBRE) between upper(:NOMBREINI) and upper(:NOMBREFIN) ');
SQL.Add('and FECHAFACTURA between :FECHAFACINI and :FECHAFACFIN ');
if not VarIsNull(FImporteMinimo) then
SQL.Add('and (BASEIMPONIBLE - IMPORTEDESCUENTO) >= :BASEIMPONIBLE ');
SQL.Add('and BASEIMPONIBLE >= :BASEIMPONIBLE ');
SQL.Add('order by NOMBRE');
ParamByName('CODIGOEMPRESA').AsInteger := EmpresaActiva.Codigo;
ParamByName('NOMBREINI').AsString := FNombreIni;

View File

@ -82,13 +82,13 @@ begin
Database := FBaseDatos;
Transaction := FTransaccion;
SQL.Clear;
SQL.Add('select NOMBRE, (BASEIMPONIBLE - IMPORTEDESCUENTO) AS BASEIMPONIBLE, IMPORTEIVA, IMPORTETOTAL ');
SQL.Add('select NOMBRE, BASEIMPONIBLE AS BASEIMPONIBLE, IMPORTEIVA, IMPORTETOTAL ');
SQL.Add('from FACTURASPROVEEDOR ');
SQL.Add('where CODIGOEMPRESA = :CODIGOEMPRESA');
SQL.Add('and upper(NOMBRE) between upper(:NOMBREINI) and upper(:NOMBREFIN) ');
SQL.Add('and FECHAFACTURA between :FECHAFACINI and :FECHAFACFIN ');
if not VarIsNull(FImporteMinimo) then
SQL.Add('and (BASEIMPONIBLE - IMPORTEDESCUENTO) >= :BASEIMPONIBLE ');
SQL.Add('and BASEIMPONIBLE >= :BASEIMPONIBLE ');
SQL.Add('order by NOMBRE');
ParamByName('CODIGOEMPRESA').AsInteger := EmpresaActiva.Codigo;
ParamByName('NOMBREINI').AsString := FNombreIni;

View File

@ -117,7 +117,7 @@ begin
for i := 0 to ContAux do
begin
if i < FListaCodTiposOp.Count then
SQL.Add('case TIPOFACTURA when ' + FListaCodTiposOp.Strings[i] + ' then (BASEIMPONIBLE - IMPORTEDESCUENTO) else null end as OP' + IntToStr(i) + ', ')
SQL.Add('case TIPOFACTURA when ' + FListaCodTiposOp.Strings[i] + ' then BASEIMPONIBLE else null end as OP' + IntToStr(i) + ', ')
else
SQL.Add('0 as OP' + IntToStr(i) + ', ');
end;
@ -147,7 +147,7 @@ begin
Database := FBaseDatos;
Transaction := FTransaccion;
SQL.Clear;
SQL.Add('select T.CODIGO, T.DESCRIPCION, SUM((F.BASEIMPONIBLE - F.IMPORTEDESCUENTO)) BASEIMPONIBLE, SUM(F.IMPORTEIVA) IMPORTEIVA, SUM(F.IMPORTETOTAL) IMPORTETOTAL');
SQL.Add('select T.CODIGO, T.DESCRIPCION, SUM(F.BASEIMPONIBLE) BASEIMPONIBLE, SUM(F.IMPORTEIVA) IMPORTEIVA, SUM(F.IMPORTETOTAL) IMPORTETOTAL');
SQL.Add('from FACTURASPROVEEDOR F, TIPOSFACTURAS T');
SQL.Add('where F.TIPOFACTURA = T.CODIGO');
SQL.Add('and F.CODIGOEMPRESA = :CODIGOEMPRESA');

View File

@ -131,7 +131,7 @@ begin
end;
//Para que el importe total de cada factura sea de 4 decimales y el total salga con exactitud
SQL.Add('BASEIMPONIBLE - coalesce(importedescuento,0) + coalesce(importere,0) + coalesce(importeiva,0) as IMPORTETOTAL ');
SQL.Add('BASEIMPONIBLE + coalesce(importere,0) + coalesce(importeiva,0) as IMPORTETOTAL ');
SQL.Add('from FACTURASCLIENTE FC, TIPOSFACTURAS TF ');
SQL.Add('where TIPOFACTURA = TF.CODIGO ');
SQL.Add('and CODIGOEMPRESA = :CODIGOEMPRESA');

View File

@ -1508,12 +1508,14 @@ object frFacturaProveedor: TfrFacturaProveedor
Width = 74
Height = 13
Caption = 'Descuento(%):'
Enabled = False
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
Visible = False
end
object Label8: TLabel
Left = 157
@ -1548,9 +1550,11 @@ object frFacturaProveedor: TfrFacturaProveedor
Top = 38
DataBinding.DataField = 'DESCUENTO'
DataBinding.DataSource = dsFactura
Enabled = False
ParentFont = False
Style.StyleController = dmConfiguracion.cxEstiloEditoresFondoOscuro
TabOrder = 1
Visible = False
Width = 57
end
object IVA: TcxDBTextEdit

Binary file not shown.

Binary file not shown.