diff --git a/Database/scripts/factuges.sql b/Database/scripts/factuges.sql
index 6afa808d..472e51d4 100644
--- a/Database/scripts/factuges.sql
+++ b/Database/scripts/factuges.sql
@@ -61,7 +61,7 @@ CREATE DOMAIN TIPO_ID AS
INTEGER;
CREATE DOMAIN TIPO_IMPORTE AS
-NUMERIC(11,4);
+NUMERIC(11,2);
CREATE DOMAIN TIPO_NOTAS AS
BLOB SUB_TYPE 1 SEGMENT SIZE 80;
@@ -70,13 +70,11 @@ CREATE DOMAIN TIPO_PERFIL AS
VARCHAR(15);
CREATE DOMAIN TIPO_PORCENTAJE AS
-FLOAT;
+NUMERIC(2,2);
CREATE DOMAIN TIPO_USUARIO AS
VARCHAR(30);
-
-
/******************************************************************************/
/**** Generators ****/
/******************************************************************************/
@@ -3527,7 +3525,7 @@ ALTER TABLE ALBARANES_CLIENTE ADD CONSTRAINT FK_ALBARAN_CLIENTE1 FOREIGN KEY (ID
ALTER TABLE ALBARANES_CLIENTE ADD CONSTRAINT FK_ALBARAN_CLIENTE2 FOREIGN KEY (ID_EMPRESA) REFERENCES EMPRESAS (ID) ON DELETE NO ACTION ON UPDATE NO ACTION;
ALTER TABLE ALBARANES_CLIENTE ADD CONSTRAINT FK_ALBARAN_CLIENTE3 FOREIGN KEY (ID_PEDIDO) REFERENCES PEDIDOS_CLIENTE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION;
ALTER TABLE ALBARANES_CLIENTE ADD CONSTRAINT FK_ALBARAN_CLIENTE4 FOREIGN KEY (ID_FACTURA) REFERENCES FACTURAS_CLIENTE (ID) ON DELETE SET NULL ON UPDATE SET NULL;
-ALTER TABLE ALBARANES_PROVEEDOR ADD CONSTRAINT FK_ALBARANES_PROVEEDOR3 FOREIGN KEY (ID_PEDIDO) REFERENCES PEDIDOS_PROVEEDOR (ID) ON DELETE CASCADE ON UPDATE CASCADE;
+ALTER TABLE ALBARANES_PROVEEDOR ADD CONSTRAINT FK_ALBARANES_PROVEEDOR3 FOREIGN KEY (ID_PEDIDO) REFERENCES PEDIDOS_PROVEEDOR (ID) ON DELETE NO ACTION ON UPDATE CASCADE;
ALTER TABLE ALBARANES_PROVEEDOR ADD CONSTRAINT FK_ALBARANES_PROVEEDOR4 FOREIGN KEY (ID_FACTURA) REFERENCES FACTURAS_PROVEEDOR (ID) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE ALBARANES_PROVEEDOR ADD CONSTRAINT FK_ALBARAN_PROVEEDOR1 FOREIGN KEY (ID_PROVEEDOR) REFERENCES CONTACTOS (ID) ON DELETE NO ACTION ON UPDATE NO ACTION;
ALTER TABLE ALBARANES_PROVEEDOR ADD CONSTRAINT FK_ALBARAN_PROVEEDOR2 FOREIGN KEY (ID_EMPRESA) REFERENCES EMPRESAS (ID) ON DELETE NO ACTION ON UPDATE NO ACTION;
@@ -3538,7 +3536,6 @@ ALTER TABLE EMPRESAS_CONTACTOS ADD CONSTRAINT FK_EMPRESAS_CONTACTOS FOREIGN KEY
ALTER TABLE EMPRESAS_DATOS_BANCO ADD CONSTRAINT FK_EMPRESAS_DATOS_BANCO FOREIGN KEY (ID_EMPRESA) REFERENCES EMPRESAS (ID) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE FACTURAS_CLIENTE ADD CONSTRAINT FK_FACTURAS_CLIENTE_EMPRESAS FOREIGN KEY (ID_EMPRESA) REFERENCES EMPRESAS (ID) ON DELETE NO ACTION ON UPDATE NO ACTION;
ALTER TABLE FACTURAS_PROVEEDOR ADD CONSTRAINT FK_FACTURAS_PROVEEDOR_EMPRESAS FOREIGN KEY (ID_EMPRESA) REFERENCES EMPRESAS (ID) ON DELETE NO ACTION ON UPDATE NO ACTION;
-ALTER TABLE MOVIMIENTOS ADD CONSTRAINT FK_MOVIMIENTOS FOREIGN KEY (ID_ARTICULO) REFERENCES ARTICULOS (ID);
ALTER TABLE MOVIMIENTOS ADD CONSTRAINT FK_MOVIMIENTOS2 FOREIGN KEY (ID_ALMACEN) REFERENCES ALMACENES (ID);
ALTER TABLE OBRAS_EJECUCIONES_PRESUPUESTOS ADD CONSTRAINT FK_OBRAS_EJE_PRE_1 FOREIGN KEY (ID_EJECUCION) REFERENCES OBRAS_EJECUCIONES (ID);
ALTER TABLE OBRAS_EJECUCIONES_PRESUPUESTOS ADD CONSTRAINT FK_OBRAS_EJE_PRE_2 FOREIGN KEY (ID_PRESUPUESTO) REFERENCES PRESUPUESTOS_CLIENTE (ID);
@@ -3669,7 +3666,7 @@ SET TERM ^ ;
CREATE PROCEDURE PRO_ART_RECALCULAR_PVP (
ID_EMPRESA INTEGER,
- PARAM_MARGEN FLOAT,
+ PARAM_MARGEN NUMERIC(2,2),
PARAM_TIEMPO NUMERIC(11,2))
AS
declare variable id_articulo integer;
@@ -3706,7 +3703,7 @@ RETURNS (
POSICION INTEGER,
TIPO_DETALLE VARCHAR(25),
CONCEPTO VARCHAR(2000),
- IMPORTE_TOTAL NUMERIC(11,4),
+ IMPORTE_TOTAL NUMERIC(11,2),
VISIBLE SMALLINT)
AS
declare variable num_filas integer;
@@ -3800,10 +3797,10 @@ RETURNS (
CONCEPTO VARCHAR(2000),
CANTIDAD NUMERIC(11,2),
UNIDAD_MEDIDA VARCHAR(255),
- IMPORTE_UNIDAD NUMERIC(11,4),
- DESCUENTO FLOAT,
- IMPORTE_PORTE NUMERIC(11,4),
- IMPORTE_TOTAL NUMERIC(11,4),
+ IMPORTE_UNIDAD NUMERIC(11,2),
+ DESCUENTO NUMERIC(2,2),
+ IMPORTE_PORTE NUMERIC(11,2),
+ IMPORTE_TOTAL NUMERIC(11,2),
VISIBLE SMALLINT)
AS
declare variable capitulo_actual integer;
@@ -3814,7 +3811,11 @@ for select pre.id, pre.id_presupuesto, pre.posicion, pre.tipo_detalle,
pre.id_articulo, articulos.referencia,
F_RTFTOTEXT(F_RTFTOTEXT(pre.CONCEPTO)) as CONCEPTO,
pre.cantidad, pre.unidad_medida,
- pre.importe_unidad, pre.descuento, pre.importe_porte,
+ case
+ when (pre.descuento <> 0) then (pre.importe_total / pre.cantidad)
+ else pre.importe_unidad
+ end as importe_unidad,
+ pre.descuento, pre.importe_porte,
pre.importe_total, coalesce(pre.visible, 1)
from presupuestos_cliente_detalles pre
left join articulos on (pre.id_articulo = articulos.id)
@@ -3845,7 +3846,7 @@ RETURNS (
POSICION INTEGER,
TIPO_DETALLE VARCHAR(25),
CONCEPTO VARCHAR(2000),
- IMPORTE_TOTAL NUMERIC(11,4),
+ IMPORTE_TOTAL NUMERIC(11,2),
VISIBLE SMALLINT)
AS
declare variable num_capitulos integer;
diff --git a/Source/Base/Base.dproj b/Source/Base/Base.dproj
index f4910a29..e06bb089 100644
--- a/Source/Base/Base.dproj
+++ b/Source/Base/Base.dproj
@@ -55,57 +55,57 @@
MainSource
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
TForm
diff --git a/Source/Base/Base.res b/Source/Base/Base.res
index 8b251f31..1641339f 100644
Binary files a/Source/Base/Base.res and b/Source/Base/Base.res differ
diff --git a/Source/Base/Controladores/uControllerDetallesBase.pas b/Source/Base/Controladores/uControllerDetallesBase.pas
index 8d4fff2f..4de0ee30 100644
--- a/Source/Base/Controladores/uControllerDetallesBase.pas
+++ b/Source/Base/Controladores/uControllerDetallesBase.pas
@@ -36,6 +36,7 @@ type
procedure Renumerar(DataTable: TDADataTable; LocalizaPosicion: Integer);
function DarListaTiposDetalle: TStringList;
procedure ValidarDetalles(ADataTable: IDAStronglyTypedDataTable);
+ procedure AsignarDescuento(ADataTable: IDAStronglyTypedDataTable; Posicion: TIntegerArray; ADescuento: Variant);
end;
TControllerDetallesBase = class (TSujeto, IControllerDetallesBase)
@@ -93,6 +94,7 @@ type
// Comprueba que todos los detalles del documento tengan un tipo_detalle asignado,
// además de que los capitulos tengan su subtotal de cierre
procedure ValidarDetalles(ADataTable: IDAStronglyTypedDataTable);
+ procedure AsignarDescuento(ADataTable: IDAStronglyTypedDataTable; Posicion: TIntegerArray; ADescuento: Variant); virtual;
end;
@@ -103,6 +105,7 @@ implementation
uses
cxControls, SysUtils, DB, uDAInterfaces, Dialogs;
+
procedure TControllerDetallesBase.ActualizarTotales(ADataTable: IDAStronglyTypedDataTable);
begin
BeginUpdate(ADataTable);
@@ -134,6 +137,43 @@ begin
end;
end;
+procedure TControllerDetallesBase.AsignarDescuento(ADataTable: IDAStronglyTypedDataTable; Posicion: TIntegerArray; ADescuento: Variant);
+var
+ i: integer;
+ AField: TDAField;
+ AsignarDtoPosicion: Integer;
+
+begin
+ AsignarDtoPosicion := 0;
+ AField := ADataTable.DataTable.FindField(CAMPO_POSICION);
+ if not Assigned(AField) then
+ raise Exception.Create('Campo ' + CAMPO_POSICION + ' no encontrado (AsignarDescuento)');
+
+ BeginUpdate(ADataTable);
+ try
+ with ADataTable do
+ begin
+ for i := 0 to High(POSICION) do
+ begin
+ DataTable.First;
+ AsignarDtoPosicion := POSICION[i];
+ if DataTable.Locate(CAMPO_POSICION, AsignarDtoPosicion, []) then
+ begin
+ if (DataTable.FieldByName(CAMPO_TIPO).AsString = TIPO_DETALLE_CONCEPTO) then
+ begin
+ DataTable.Edit;
+ DataTable.FieldByName(CAMPO_DESCUENTO).AsVariant := ADescuento;
+ DataTable.Post;
+ end;
+ end;
+ end;
+ Renumerar(DataTable, AsignarDtoPosicion);
+ end;
+ finally
+ EndUpdate(ADataTable);
+ end;
+end;
+
procedure TControllerDetallesBase.BeginUpdate(ADataTable: IDAStronglyTypedDataTable);
begin
ShowHourglassCursor;
@@ -144,7 +184,7 @@ end;
function TControllerDetallesBase.CalcularImporteTotalConcepto(DataTable: TDADataTable): Double;
begin
with DataTable do
- Result := FieldByName(CAMPO_CANTIDAD).asFloat * FieldByName(CAMPO_IMPORTE_UNIDAD).AsFloat;
+ Result := FieldByName(CAMPO_CANTIDAD).asFloat * FieldByName(CAMPO_IMPORTE_UNIDAD).AsFloat;
end;
function TControllerDetallesBase.CalcularTotales(Modificar: boolean; DataTable: TDADataTable): Double;
@@ -206,7 +246,7 @@ begin
if Modificar then
TratamientoDetalleSubtotal(DataTable); //Se podrá sobreescribir para que se tengan en cuenta nuevos campos
CalculoDetalleSubtotal(DataTable, AuxImporteAcumulado, AuxImporteTotal); //Se podrá sobreescribir para posibles nuevos calculos de los hijos
- SemaforoOpcional := False;
+ SemaforoOpcional := False;
end
//DESCUENTO DE CAPITULO
else if (DataTable.FieldByName(CAMPO_TIPO).AsString = TIPO_DETALLE_DESCUENTO) then
@@ -258,15 +298,19 @@ procedure TControllerDetallesBase.CalculoDetalleDescuento(
DataTable: TDADataTable; var ImporteAcumulado, ImporteTotal: Double);
var
ImporteDto : Double;
+ Redondeado : Double;
begin
- with DataTable do
+//Este metodo calcula el descuento por capitulo que no se activa para tecsitel
+{ with DataTable do
begin
if not Editing then Edit;
ImporteDto := (-1)*((ImporteTotal * DataTable.FieldByName(CAMPO_DESCUENTO).AsFloat) / 100);
+
ImporteTotal := ImporteTotal + ImporteDto;
FieldByName(CAMPO_IMPORTE_TOTAL).AsFloat := ImporteTotal;
Post;
end;
+}
end;
procedure TControllerDetallesBase.CalculoDetalleSalto(DataTable: TDADataTable; var ImporteAcumulado, ImporteTotal: Double);
diff --git a/Source/Base/Utiles/uCalculosUtils.pas b/Source/Base/Utiles/uCalculosUtils.pas
index 57300e45..66ae2fdb 100644
--- a/Source/Base/Utiles/uCalculosUtils.pas
+++ b/Source/Base/Utiles/uCalculosUtils.pas
@@ -32,13 +32,22 @@ uses
function CalcularLineaConcepto (const ADataTable : TDADataTable): Double;
var
ImporteTotal : Double;
+ ImporteA: Double;
+ ImporteB: Double;
begin
with ADataTable do
begin
if (VarIsNull(FieldByName(CAMPO_DESCUENTO).AsVariant)) then
ImporteTotal := FieldByName(CAMPO_CANTIDAD).asfloat * FieldByName(CAMPO_IMPORTE_UNIDAD).AsFloat
else
- ImporteTotal := FieldByName(CAMPO_CANTIDAD).asfloat * (FieldByName(CAMPO_IMPORTE_UNIDAD).AsFloat - (FieldByName(CAMPO_IMPORTE_UNIDAD).AsFloat * (FieldByName(CAMPO_DESCUENTO).AsFloat/100)));
+ begin
+ //Importe descuento con todos los decimales
+ ImporteA := FieldByName(CAMPO_IMPORTE_UNIDAD).AsFloat * (FieldByName(CAMPO_DESCUENTO).AsFloat/100);
+ //Importe descuento redondeado a solo dos decimales, porque en grandes cantidades hay fluctuación
+ //(importe unidad - 0,6732 no es lo mismo que importe unidad - 0,67 sobre todo cuando trabajamos con grandes cantidades)
+ ImporteB := round(ImporteA*100)/100;
+ ImporteTotal := FieldByName(CAMPO_CANTIDAD).asfloat * (FieldByName(CAMPO_IMPORTE_UNIDAD).AsFloat - ImporteB);
+ end;
if (VarIsNull(FieldByName(CAMPO_IMPORTE_PORTE).AsVariant)) then
ImporteTotal := ImporteTotal
diff --git a/Source/Cliente/FactuGES.dproj b/Source/Cliente/FactuGES.dproj
index 9d78660e..5996e25f 100644
--- a/Source/Cliente/FactuGES.dproj
+++ b/Source/Cliente/FactuGES.dproj
@@ -53,7 +53,7 @@
Delphi.Personality
VCLApplication
-FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse1700FalseFalseFalseFalseFalse30821252Rodax Software S.L.1.7.0.0FactuGESFactuGES1.7.0.0FactuGES.dprFalse
+FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse1720FalseFalseFalseFalseFalse30821252Rodax Software S.L.1.7.2.0FactuGESFactuGES1.7.2.0FactuGES.dprFalse
diff --git a/Source/Cliente/FactuGES.rc b/Source/Cliente/FactuGES.rc
index 61c06091..022aadc1 100644
--- a/Source/Cliente/FactuGES.rc
+++ b/Source/Cliente/FactuGES.rc
@@ -1,7 +1,7 @@
MAINICON ICON "C:\Codigo Tecsitel\Resources\Iconos\Factuges.ico"
1 VERSIONINFO
-FILEVERSION 1,7,0,0
-PRODUCTVERSION 1,7,0,0
+FILEVERSION 1,7,2,0
+PRODUCTVERSION 1,7,2,0
FILEFLAGSMASK 0x3FL
FILEFLAGS 0x00L
FILEOS 0x40004L
@@ -13,10 +13,10 @@ BEGIN
BLOCK "0C0A04E4"
BEGIN
VALUE "CompanyName", "Rodax Software S.L.\0"
- VALUE "FileVersion", "1.7.0.0\0"
+ VALUE "FileVersion", "1.7.2.0\0"
VALUE "InternalName", "FactuGES\0"
VALUE "ProductName", "FactuGES\0"
- VALUE "ProductVersion", "1.7.0.0\0"
+ VALUE "ProductVersion", "1.7.2.0\0"
END
END
BLOCK "VarFileInfo"
diff --git a/Source/Cliente/FactuGES.res b/Source/Cliente/FactuGES.res
index 0782d05e..393c93a5 100644
Binary files a/Source/Cliente/FactuGES.res and b/Source/Cliente/FactuGES.res differ
diff --git a/Source/GUIBase/uEditorDBItem.dfm b/Source/GUIBase/uEditorDBItem.dfm
index c808f569..5608817c 100644
--- a/Source/GUIBase/uEditorDBItem.dfm
+++ b/Source/GUIBase/uEditorDBItem.dfm
@@ -28,8 +28,6 @@ inherited fEditorDBItem: TfEditorDBItem
AutoSize = False
Caption = 'Desbloquear'
ParentFont = False
- Properties.Alignment.Horz = taCenter
- Properties.Alignment.Vert = taVCenter
Style.HotTrack = True
Style.LookAndFeel.NativeStyle = False
Style.TextColor = clWindow
@@ -39,10 +37,14 @@ inherited fEditorDBItem: TfEditorDBItem
StyleHot.BorderStyle = ebsNone
StyleHot.LookAndFeel.NativeStyle = False
StyleHot.TextStyle = [fsUnderline]
+ Properties.Alignment.Horz = taCenter
+ Properties.Alignment.Vert = taVCenter
Transparent = True
OnClick = lblDesbloquearClick
Height = 27
Width = 90
+ AnchorX = 821
+ AnchorY = 14
end
end
inherited TBXDock: TTBXDock
diff --git a/Source/GUIBase/uViewDetallesBase.pas b/Source/GUIBase/uViewDetallesBase.pas
index f5c16686..4a41b4e6 100644
--- a/Source/GUIBase/uViewDetallesBase.pas
+++ b/Source/GUIBase/uViewDetallesBase.pas
@@ -216,12 +216,12 @@ type
procedure SetDetalles(const Value: IDAStronglyTypedDataTable);
function DarPosicionCAMPO(const Nombre:String): Integer;
- function DarListaSeleccionados: TIntegerArray;
procedure DoPasteText(Sender: TObject; AText: string);
procedure TratamientoTeclas(Key: Word; Shift: TShiftState; AItem: TcxCustomGridTableItem = nil);
protected
+ function DarListaSeleccionados: TIntegerArray;
function HayQueRecalcular(AItem: TcxCustomGridTableItem): Boolean; virtual;
function EsTipoEditable(AItem: TcxCustomGridTableItem): Boolean; virtual;
function DarTipoConcepto(ARecord: TcxCustomGridRecord): string; virtual;
diff --git a/Source/GUIBase/uViewDetallesDTO.dfm b/Source/GUIBase/uViewDetallesDTO.dfm
index 3cd9f00e..35e92b29 100644
--- a/Source/GUIBase/uViewDetallesDTO.dfm
+++ b/Source/GUIBase/uViewDetallesDTO.dfm
@@ -3,23 +3,22 @@ inherited frViewDetallesDTO: TfrViewDetallesDTO
inherited ToolButton1: TToolButton
ExplicitWidth = 109
end
- inherited ToolButton2: TToolButton
+ inherited ToolButton14: TToolButton [1]
Left = 109
- ExplicitLeft = 109
+ Wrap = False
+ end
+ inherited ToolButton4: TToolButton [2]
+ Left = 174
+ end
+ inherited ToolButton3: TToolButton [3]
+ Left = 230
+ ExplicitLeft = 230
+ end
+ inherited ToolButton2: TToolButton [4]
+ Left = 285
+ ExplicitLeft = 285
ExplicitWidth = 114
end
- inherited ToolButton3: TToolButton
- Left = 223
- ExplicitLeft = 223
- end
- inherited ToolButton4: TToolButton
- Left = 278
- ExplicitLeft = 278
- end
- inherited ToolButton14: TToolButton
- Left = 334
- ExplicitLeft = 334
- end
inherited FontSize: TEdit
Width = 41
ExplicitWidth = 41
diff --git a/Source/Informes/1/InfPresupuestoCliente.fr3 b/Source/Informes/1/InfPresupuestoCliente.fr3
index f538199c..3c129f71 100644
--- a/Source/Informes/1/InfPresupuestoCliente.fr3
+++ b/Source/Informes/1/InfPresupuestoCliente.fr3
@@ -1,5 +1,5 @@
-
+
diff --git a/Source/Informes/2/InfPresupuestoCliente.fr3 b/Source/Informes/2/InfPresupuestoCliente.fr3
index 89e0592c..8d49ab8c 100644
--- a/Source/Informes/2/InfPresupuestoCliente.fr3
+++ b/Source/Informes/2/InfPresupuestoCliente.fr3
@@ -1,5 +1,5 @@
-
+
diff --git a/Source/Modulos/Presupuestos de cliente/Controller/PresupuestosCliente_controller.dpk b/Source/Modulos/Presupuestos de cliente/Controller/PresupuestosCliente_controller.dpk
index 8d51711b..a8a9c003 100644
Binary files a/Source/Modulos/Presupuestos de cliente/Controller/PresupuestosCliente_controller.dpk and b/Source/Modulos/Presupuestos de cliente/Controller/PresupuestosCliente_controller.dpk differ
diff --git a/Source/Modulos/Presupuestos de cliente/Controller/PresupuestosCliente_controller.dproj b/Source/Modulos/Presupuestos de cliente/Controller/PresupuestosCliente_controller.dproj
index 7308d472..4bc7332f 100644
--- a/Source/Modulos/Presupuestos de cliente/Controller/PresupuestosCliente_controller.dproj
+++ b/Source/Modulos/Presupuestos de cliente/Controller/PresupuestosCliente_controller.dproj
@@ -49,16 +49,17 @@
MainSource
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/Source/Modulos/Presupuestos de cliente/Controller/View/uIEditorAsignarDescuento.pas b/Source/Modulos/Presupuestos de cliente/Controller/View/uIEditorAsignarDescuento.pas
new file mode 100644
index 00000000..d47a5dfd
--- /dev/null
+++ b/Source/Modulos/Presupuestos de cliente/Controller/View/uIEditorAsignarDescuento.pas
@@ -0,0 +1,18 @@
+unit uIEditorAsignarDescuento;
+
+interface
+
+uses
+ uEditorBasico;
+
+type
+ IEditorAsignarDescuento = interface(IEditorBasico)
+ ['{E814B4FE-F9EB-4002-83D9-7383A65F3F0D}']
+ function GetDescuento: Variant;
+ procedure SetDescuento(const Value: Variant);
+ property Descuento: Variant Read GetDescuento write SetDescuento;
+ end;
+
+implementation
+
+end.
diff --git a/Source/Modulos/Presupuestos de cliente/Controller/uDetallesPresupuestoClienteController.pas b/Source/Modulos/Presupuestos de cliente/Controller/uDetallesPresupuestoClienteController.pas
index 7da2f9d9..60a056c2 100644
--- a/Source/Modulos/Presupuestos de cliente/Controller/uDetallesPresupuestoClienteController.pas
+++ b/Source/Modulos/Presupuestos de cliente/Controller/uDetallesPresupuestoClienteController.pas
@@ -3,7 +3,7 @@
interface
uses
- uDADataTable, uControllerDetallesArticulos, uBizDetallesPresupuestoCliente, uIDataModulePresupuestosCliente,
+ uDADataTable, uControllerDetallesBase, uControllerDetallesArticulos, uBizDetallesPresupuestoCliente, uIDataModulePresupuestosCliente,
uBizArticulos, uBizContactos;
type
@@ -13,11 +13,14 @@ type
procedure ActualizarDetalles(ADetalles: IDAStronglyTypedDataTable; ACliente: IBizCliente); overload;
procedure DesglosarPorteDetalles(ImportePorte: Currency; ADetalles: IDAStronglyTypedDataTable);
function DarTotalPorteTotal(ADetalles: IDAStronglyTypedDataTable): Double;
+ function PedirDescuento: Variant;
end;
TDetallesPresupuestoClienteController = class(TControllerDetallesArticulos, IDetallesPresupuestoClienteController)
private
FDataModule : IDataModulePresupuestosCliente;
+ function CreateEditor(const AName : String; const IID: TGUID; out Intf): Boolean;
+
protected
// procedure AsignarDatos(ADetalles: IDAStronglyTypedDataTable; IDCabecera: Integer); override;
procedure RellenarOtros(ADetalles: IDAStronglyTypedDataTable; AArticulos: IBizArticulo); overload; override;
@@ -31,6 +34,7 @@ type
function DarTotalPorteTotal(ADetalles: IDAStronglyTypedDataTable): Double;
public
+ function PedirDescuento: Variant;
procedure AnadirArticulos(ADetalles: IDAStronglyTypedDataTable; ACliente: IBizCliente; const ANuevaFila :Boolean = True); reintroduce; overload;
procedure ActualizarDetalles(ADetalles: IDAStronglyTypedDataTable; ACliente: IBizCliente); overload;
constructor Create; override;
@@ -39,8 +43,8 @@ type
implementation
-uses Dialogs, uDialogUtils, Variants, uControllerDetallesBase, uDataModulePresupuestosCliente, uArticulosPresupuestoClienteController,
- uDataTableUtils, uCalculosUtils;
+uses Controls, SysUtils, Dialogs, uDAInterfaces, uDialogUtils, Variants, uDataModulePresupuestosCliente, uArticulosPresupuestoClienteController,
+ uDataTableUtils, uCalculosUtils, uIEditorAsignarDescuento, uEditorRegistryUtils;
{ TDetallesPresupuestoClienteController }
@@ -92,6 +96,22 @@ begin
FArticulosController := TArticulosPresupuestoClienteController.Create;
end;
+function TDetallesPresupuestoClienteController.PedirDescuento: Variant;
+var
+ AEditor: IEditorAsignarDescuento;
+
+begin
+ CreateEditor('EditorAsignarDescuento', IEditorAsignarDescuento, AEditor);
+ if Assigned(AEditor) then
+ try
+ if (AEditor.ShowModal = mrOk) then
+ Result := AEditor.Descuento;
+ finally
+ AEditor.Release;
+ AEditor := NIL;
+ end;
+end;
+
{
procedure TDetallesPresupuestoClienteController.AsignarDatos(ADetalles: IDAStronglyTypedDataTable; IDCabecera: Integer);
begin
@@ -118,6 +138,11 @@ begin
FDataModule := TDataModulePresupuestosCliente.Create(Nil);
end;
+function TDetallesPresupuestoClienteController.CreateEditor(const AName: String; const IID: TGUID; out Intf): Boolean;
+begin
+ Result := Supports(EditorRegistry.CreateEditor(AName), IID, Intf);
+end;
+
function TDetallesPresupuestoClienteController.DarTotalPorteTotal(ADetalles: IDAStronglyTypedDataTable): Double;
begin
Result := DarTotalPorte(ADetalles);
@@ -126,7 +151,7 @@ end;
procedure TDetallesPresupuestoClienteController.DesglosarPorteDetalles(ImportePorte: Currency; ADetalles: IDAStronglyTypedDataTable);
begin
DesglosarPorte(ImportePorte, ADetalles);
- ActualizarTotales(ADetalles);
+ ActualizarTotales(ADetalles);
end;
destructor TDetallesPresupuestoClienteController.Destroy;
@@ -135,7 +160,6 @@ begin
inherited;
end;
-
procedure TDetallesPresupuestoClienteController.RellenarOtros(ADetalles: IDAStronglyTypedDataTable; AArticulos: IBizArticulo);
begin
//En Tecsitel no se tiene en cuenta el descuento de cliente para el precio PVP
diff --git a/Source/Modulos/Presupuestos de cliente/PresupuestosCliente_Group.groupproj b/Source/Modulos/Presupuestos de cliente/PresupuestosCliente_Group.groupproj
index 35fb6aed..0d5b72d2 100644
--- a/Source/Modulos/Presupuestos de cliente/PresupuestosCliente_Group.groupproj
+++ b/Source/Modulos/Presupuestos de cliente/PresupuestosCliente_Group.groupproj
@@ -11,6 +11,7 @@
+
@@ -20,6 +21,7 @@
+
@@ -241,14 +243,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
\ No newline at end of file
diff --git a/Source/Modulos/Presupuestos de cliente/Reports/uRptWordPresupuestoCliente.dfm b/Source/Modulos/Presupuestos de cliente/Reports/uRptWordPresupuestoCliente.dfm
index 95c6f50a..8e6e512f 100644
--- a/Source/Modulos/Presupuestos de cliente/Reports/uRptWordPresupuestoCliente.dfm
+++ b/Source/Modulos/Presupuestos de cliente/Reports/uRptWordPresupuestoCliente.dfm
@@ -293,11 +293,12 @@ object RptWordPresupuestoCliente: TRptWordPresupuestoCliente
SQL =
'SELECT '#10' ID, ID_PRESUPUESTO, POSICION, TIPO_DETALLE, ID_ARTIC' +
'ULO, '#10' F_RTFTOTEXT(F_RTFTOTEXT(CONCEPTO)) as CONCEPTO, CONCEP' +
- 'TO as CONCEPTO_RTF, CANTIDAD,'#10' UNIDAD_MEDIDA, IMPORTE_UNIDAD,' +
- ' DESCUENTO, IMPORTE_PORTE,'#10' IMPORTE_TOTAL, VISIBLE, FECHA_ALT' +
- 'A, FECHA_MODIFICACION'#10' FROM'#10' PRESUPUESTOS_CLIENTE_DETALLES'#10' ' +
- ' WHERE {Where}'#10' AND (VISIBLE <> 0)'#10' AND (ID_PRESUPUESTO = ' +
- ':ID_PRESUPUESTO)'#10' ORDER BY ID_PRESUPUESTO, POSICION'#10
+ 'TO as CONCEPTO_RTF, CANTIDAD,'#10' UNIDAD_MEDIDA,'#10' (IMPORTE_TO' +
+ 'TAL / CANTIDAD) AS IMPORTE_UNIDAD,'#10' DESCUENTO, IMPORTE_PORTE,' +
+ #10' IMPORTE_TOTAL, VISIBLE, FECHA_ALTA, FECHA_MODIFICACION'#10' FR' +
+ 'OM'#10' PRESUPUESTOS_CLIENTE_DETALLES'#10' WHERE {Where}'#10' AND (VI' +
+ 'SIBLE <> 0)'#10' AND (ID_PRESUPUESTO = :ID_PRESUPUESTO)'#10' ORDER B' +
+ 'Y ID_PRESUPUESTO, POSICION'#10
StatementType = stSQL
ColumnMappings = <
item
@@ -401,7 +402,7 @@ object RptWordPresupuestoCliente: TRptWordPresupuestoCliente
end
item
Name = 'CANTIDAD'
- DataType = datFloat
+ DataType = datCurrency
end
item
Name = 'UNIDAD_MEDIDA'
@@ -582,8 +583,6 @@ object RptWordPresupuestoCliente: TRptWordPresupuestoCliente
RemoteFetchEnabled = False
LocalSchema = schReport
LocalDataStreamer = DABin2DataStreamer
- DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
- MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
LogicalName = 'Informe_Cabecera'
IndexDefs = <>
Left = 168
@@ -674,8 +673,6 @@ object RptWordPresupuestoCliente: TRptWordPresupuestoCliente
RemoteFetchEnabled = False
LocalSchema = schReport
LocalDataStreamer = DABin2DataStreamer
- DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
- MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
LogicalName = 'Informe_Detalles'
IndexDefs = <>
Left = 264
@@ -693,8 +690,6 @@ object RptWordPresupuestoCliente: TRptWordPresupuestoCliente
LogChanges = False
StreamingOptions = [soDisableEventsWhileStreaming]
RemoteFetchEnabled = False
- DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
- MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
LogicalName = 'Empresa'
IndexDefs = <>
Left = 168
diff --git a/Source/Modulos/Presupuestos de cliente/Views/PresupuestosCliente_view.dpk b/Source/Modulos/Presupuestos de cliente/Views/PresupuestosCliente_view.dpk
index 8f5deda0..da37d359 100644
--- a/Source/Modulos/Presupuestos de cliente/Views/PresupuestosCliente_view.dpk
+++ b/Source/Modulos/Presupuestos de cliente/Views/PresupuestosCliente_view.dpk
@@ -65,6 +65,7 @@ contains
uEditorFechaDecision in 'uEditorFechaDecision.pas' {fEditorFechaDecision: T},
uViewDocumentosPresupuestoCliente in 'uViewDocumentosPresupuestoCliente.pas' {frViewDocumentosPresupuestoCliente: TFrame},
uViewDatosYSeleccionClientePresupuesto in 'uViewDatosYSeleccionClientePresupuesto.pas' {frViewDatosYSeleccionClientePresupuesto: TFrame},
- uViewTotalesPresupuesto in 'uViewTotalesPresupuesto.pas' {frViewTotalesPresupuesto: TFrame};
+ uViewTotalesPresupuesto in 'uViewTotalesPresupuesto.pas' {frViewTotalesPresupuesto: TFrame},
+ uEditorAsignarDescuento in 'uEditorAsignarDescuento.pas' {fEditorAsignarDescuento};
end.
diff --git a/Source/Modulos/Presupuestos de cliente/Views/PresupuestosCliente_view.dproj b/Source/Modulos/Presupuestos de cliente/Views/PresupuestosCliente_view.dproj
index fee0f8c1..e93c8f8b 100644
--- a/Source/Modulos/Presupuestos de cliente/Views/PresupuestosCliente_view.dproj
+++ b/Source/Modulos/Presupuestos de cliente/Views/PresupuestosCliente_view.dproj
@@ -49,30 +49,30 @@
MainSource
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
TfEditorElegirArticulosPedidoCliente
@@ -130,6 +130,9 @@
TFrame
+
+
+