Se adaptan los detalles para que puedan ser las cantidades decimales

git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@640 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
roberto 2008-09-30 09:55:56 +00:00
parent 7f1c25b8e8
commit 5f365284b3

View File

@ -15,8 +15,8 @@ type
IControllerDetallesArticulos = interface(IControllerDetallesBase) IControllerDetallesArticulos = interface(IControllerDetallesBase)
['{6E156796-DB1F-4727-BBFB-FBAEF2E5C098}'] ['{6E156796-DB1F-4727-BBFB-FBAEF2E5C098}']
procedure AnadirArticulos(ADetalles: IDAStronglyTypedDataTable; const ANuevaFila :Boolean = True); procedure AnadirArticulos(ADetalles: IDAStronglyTypedDataTable; const ANuevaFila :Boolean = True);
function AnadirArticulo(ADetalles: IDAStronglyTypedDataTable; Referencia: String; TipoReferencia: TEnumReferencia; AClienteID: Integer = -1; const ACantidad: Integer = 1): Boolean; overload; function AnadirArticulo(ADetalles: IDAStronglyTypedDataTable; Referencia: String; TipoReferencia: TEnumReferencia; AClienteID: Integer = -1; const ACantidad: Float = 1): Boolean; overload;
function AnadirArticulo(ADetalles: IDAStronglyTypedDataTable; IDArticulo: Integer; AClienteID: Integer = -1; const ACantidad: Integer = 1): Boolean; overload; function AnadirArticulo(ADetalles: IDAStronglyTypedDataTable; IDArticulo: Integer; AClienteID: Integer = -1; const ACantidad: Float = 1): Boolean; overload;
procedure ActualizarDetalles(ADetalles: IDAStronglyTypedDataTable; AArticulos: IBizArticulo); procedure ActualizarDetalles(ADetalles: IDAStronglyTypedDataTable; AArticulos: IBizArticulo);
procedure CambiarSignoDetalles(ADetalles: IDAStronglyTypedDataTable; const AAll: Boolean = True); procedure CambiarSignoDetalles(ADetalles: IDAStronglyTypedDataTable; const AAll: Boolean = True);
procedure AnadirConceptoInicial(ADetalles: IDAStronglyTypedDataTable; AConcepto: String); procedure AnadirConceptoInicial(ADetalles: IDAStronglyTypedDataTable; AConcepto: String);
@ -32,15 +32,15 @@ type
procedure RellenarOtros(ADetalles: IDAStronglyTypedDataTable; AArticulos: IBizArticulo); virtual; procedure RellenarOtros(ADetalles: IDAStronglyTypedDataTable; AArticulos: IBizArticulo); virtual;
procedure RellenarImportes(ADetalles: IDAStronglyTypedDataTable; AArticulos: IBizArticulo); virtual; procedure RellenarImportes(ADetalles: IDAStronglyTypedDataTable; AArticulos: IBizArticulo); virtual;
procedure RellenarGenerales(ADetalles: IDAStronglyTypedDataTable; AArticulos: IBizArticulo); virtual; procedure RellenarGenerales(ADetalles: IDAStronglyTypedDataTable; AArticulos: IBizArticulo); virtual;
procedure RellenarCantidad(ADetalles: IDAStronglyTypedDataTable; const ACantidad: Integer); virtual; procedure RellenarCantidad(ADetalles: IDAStronglyTypedDataTable; const ACantidad: Float); virtual;
procedure RellenarDetalle(ADetalles: IDAStronglyTypedDataTable; AArticulos: IBizArticulo; const ACantidad: Integer = 1); virtual; procedure RellenarDetalle(ADetalles: IDAStronglyTypedDataTable; AArticulos: IBizArticulo; const ACantidad: Float = 1); virtual;
procedure Add(ADetalles: IDAStronglyTypedDataTable; AArticulos: IBizArticulo; const ACantidad: Integer = 1); overload; procedure Add(ADetalles: IDAStronglyTypedDataTable; AArticulos: IBizArticulo; const ACantidad: Float = 1); overload;
procedure AsignarController; virtual; procedure AsignarController; virtual;
public public
function AnadirArticulo(ADetalles: IDAStronglyTypedDataTable; Referencia: String; TipoReferencia: TEnumReferencia; AClienteID: Integer = -1; const ACantidad: Integer = 1): Boolean; overload; function AnadirArticulo(ADetalles: IDAStronglyTypedDataTable; Referencia: String; TipoReferencia: TEnumReferencia; AClienteID: Integer = -1; const ACantidad: Float = 1): Boolean; overload;
function AnadirArticulo(ADetalles: IDAStronglyTypedDataTable; IDArticulo: Integer; AClienteID: Integer = -1; const ACantidad: Integer = 1): Boolean; overload; function AnadirArticulo(ADetalles: IDAStronglyTypedDataTable; IDArticulo: Integer; AClienteID: Integer = -1; const ACantidad: Float = 1): Boolean; overload;
procedure AnadirArticulos(ADetalles: IDAStronglyTypedDataTable; const ANuevaFila :Boolean = True); virtual; procedure AnadirArticulos(ADetalles: IDAStronglyTypedDataTable; const ANuevaFila :Boolean = True); virtual;
procedure ActualizarDetalles(ADetalles: IDAStronglyTypedDataTable; AArticulos: IBizArticulo); procedure ActualizarDetalles(ADetalles: IDAStronglyTypedDataTable; AArticulos: IBizArticulo);
procedure CambiarSignoDetalles(ADetalles: IDAStronglyTypedDataTable; const AAll: Boolean = True); procedure CambiarSignoDetalles(ADetalles: IDAStronglyTypedDataTable; const AAll: Boolean = True);
@ -67,7 +67,7 @@ const
procedure TControllerDetallesArticulos.ActualizarDetalles(ADetalles: IDAStronglyTypedDataTable; AArticulos: IBizArticulo); procedure TControllerDetallesArticulos.ActualizarDetalles(ADetalles: IDAStronglyTypedDataTable; AArticulos: IBizArticulo);
var var
ACantidad: Integer; ACantidad: Float;
begin begin
if (Assigned(ADetalles) and Assigned(AArticulos)) then if (Assigned(ADetalles) and Assigned(AArticulos)) then
begin begin
@ -87,7 +87,7 @@ begin
if AArticulos.DataTable.Locate(CAMPO_ID, FieldByName(CAMPO_ID_ARTICULOS).AsVariant, []) then if AArticulos.DataTable.Locate(CAMPO_ID, FieldByName(CAMPO_ID_ARTICULOS).AsVariant, []) then
begin begin
//Para mantener la cantidad que ya tuviera el detalle se debe guardar y volver a poner //Para mantener la cantidad que ya tuviera el detalle se debe guardar y volver a poner
ACantidad := ADetalles.DataTable.FieldByName(CAMPO_CANTIDAD).AsInteger; ACantidad := ADetalles.DataTable.FieldByName(CAMPO_CANTIDAD).AsFloat;
RellenarDetalle(ADetalles, AArticulos, ACantidad); RellenarDetalle(ADetalles, AArticulos, ACantidad);
end; end;
except except
@ -105,7 +105,7 @@ begin
end; end;
end; end;
procedure TControllerDetallesArticulos.Add(ADetalles: IDAStronglyTypedDataTable; AArticulos: IBizArticulo; const ACantidad: Integer); procedure TControllerDetallesArticulos.Add(ADetalles: IDAStronglyTypedDataTable; AArticulos: IBizArticulo; const ACantidad: Float);
begin begin
if Assigned(ADetalles) and Assigned(AArticulos) then if Assigned(ADetalles) and Assigned(AArticulos) then
begin begin
@ -137,7 +137,7 @@ begin
end; end;
function TControllerDetallesArticulos.AnadirArticulo(ADetalles: IDAStronglyTypedDataTable; IDArticulo, AClienteID: Integer; function TControllerDetallesArticulos.AnadirArticulo(ADetalles: IDAStronglyTypedDataTable; IDArticulo, AClienteID: Integer;
const ACantidad: Integer): Boolean; const ACantidad: Float): Boolean;
var var
AArticulo: IBizArticulo; AArticulo: IBizArticulo;
begin begin
@ -243,10 +243,10 @@ begin
First; First;
while not EOF do while not EOF do
begin begin
if (FieldByName(CAMPO_CANTIDAD).AsInteger <> 0) then if (FieldByName(CAMPO_CANTIDAD).AsFloat <> 0) then
begin begin
Edit; Edit;
FieldByName(CAMPO_CANTIDAD).AsInteger := (-1) * FieldByName(CAMPO_CANTIDAD).AsInteger; FieldByName(CAMPO_CANTIDAD).AsFloat := (-1) * FieldByName(CAMPO_CANTIDAD).AsFloat;
end; end;
Next; Next;
end; end;
@ -254,10 +254,10 @@ begin
//Solo cambia el signo al seleccionado //Solo cambia el signo al seleccionado
else else
begin begin
if (FieldByName(CAMPO_CANTIDAD).AsInteger <> 0) then if (FieldByName(CAMPO_CANTIDAD).AsFloat <> 0) then
begin begin
Edit; Edit;
FieldByName(CAMPO_CANTIDAD).AsInteger := (-1) * FieldByName(CAMPO_CANTIDAD).AsInteger; FieldByName(CAMPO_CANTIDAD).AsFloat := (-1) * FieldByName(CAMPO_CANTIDAD).AsFloat;
end; end;
end; end;
end; end;
@ -300,7 +300,7 @@ begin
end; end;
end; end;
function TControllerDetallesArticulos.AnadirArticulo(ADetalles: IDAStronglyTypedDataTable; Referencia: String; TipoReferencia: TEnumReferencia; AClienteID: Integer = -1; const ACantidad: Integer = 1): Boolean; function TControllerDetallesArticulos.AnadirArticulo(ADetalles: IDAStronglyTypedDataTable; Referencia: String; TipoReferencia: TEnumReferencia; AClienteID: Integer = -1; const ACantidad: Float = 1): Boolean;
var var
AArticulo: IBizArticulo; AArticulo: IBizArticulo;
begin begin
@ -337,15 +337,15 @@ begin
// Procedimiento que en los hijos se sobreescribirá para rellenar otros campos según necesidades // Procedimiento que en los hijos se sobreescribirá para rellenar otros campos según necesidades
end; end;
procedure TControllerDetallesArticulos.RellenarCantidad(ADetalles: IDAStronglyTypedDataTable; const ACantidad: Integer); procedure TControllerDetallesArticulos.RellenarCantidad(ADetalles: IDAStronglyTypedDataTable; const ACantidad: Float);
begin begin
if Assigned(ADetalles) then if Assigned(ADetalles) then
begin begin
ADetalles.DataTable.FieldByName(CAMPO_CANTIDAD).AsInteger := ACantidad; ADetalles.DataTable.FieldByName(CAMPO_CANTIDAD).AsFloat := ACantidad;
end; end;
end; end;
procedure TControllerDetallesArticulos.RellenarDetalle(ADetalles: IDAStronglyTypedDataTable; AArticulos: IBizArticulo; const ACantidad: Integer); procedure TControllerDetallesArticulos.RellenarDetalle(ADetalles: IDAStronglyTypedDataTable; AArticulos: IBizArticulo; const ACantidad: Float);
begin begin
if Assigned(ADetalles) if Assigned(ADetalles)
and Assigned(AArticulos) then and Assigned(AArticulos) then