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