diff --git a/Source/Base/Controladores/uControllerDetallesBase.pas b/Source/Base/Controladores/uControllerDetallesBase.pas index 2a205325..c608254c 100644 --- a/Source/Base/Controladores/uControllerDetallesBase.pas +++ b/Source/Base/Controladores/uControllerDetallesBase.pas @@ -35,7 +35,7 @@ type function LocalizarPosicion(ADataTable: IDAStronglyTypedDataTable; const APosicion: Integer): Boolean; procedure Renumerar(DataTable: TDADataTable; LocalizaPosicion: Integer); function DarListaTiposDetalle: TStringList; - procedure ValidarCierreCapitulos(ADataTable: IDAStronglyTypedDataTable); + procedure ValidarDetalles(ADataTable: IDAStronglyTypedDataTable); end; TControllerDetallesBase = class (TSujeto, IControllerDetallesBase) @@ -90,8 +90,9 @@ type function DarListaTiposDetalle: TStringList; virtual; function LocalizarPosicion(ADataTable: IDAStronglyTypedDataTable; const APosicion: Integer): Boolean; - // Comprueba que todos los capitulos tengan su subtotal de cierre - procedure ValidarCierreCapitulos(ADataTable: IDAStronglyTypedDataTable); + // 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); end; @@ -691,8 +692,7 @@ begin raise Exception.Create('Campo ' + CAMPO_IMPORTE_TOTAL + ' no encontrado (validarCampos)'); end; -procedure TControllerDetallesBase.ValidarCierreCapitulos( - ADataTable: IDAStronglyTypedDataTable); +procedure TControllerDetallesBase.ValidarDetalles(ADataTable: IDAStronglyTypedDataTable); var ATipoCampo : String; bEnCapitulo : Boolean; @@ -717,6 +717,16 @@ begin begin ATipoCampo := ADataTable.DataTable.FieldByName(CAMPO_TIPO).AsString; + //Si la linea de concepto no tiene asignado el tipo de detalle, le asignamos nosotros como concepto + //para que no falle el calculo del documento + if (Length(ATipoCampo) = 0) then + begin + if not ADataTable.DataTable.Editing then + ADataTable.DataTable.Edit; + ADataTable.DataTable.FieldByName(CAMPO_TIPO).AsString := TIPO_DETALLE_CONCEPTO; + ADataTable.DataTable.Post; + end; + if (ATipoCampo = TIPO_DETALLE_SUBTOTAL) and bEnCapitulo then bEnCapitulo := False; diff --git a/Source/Cliente/FactuGES.res b/Source/Cliente/FactuGES.res index 178c4aa7..5d085937 100644 Binary files a/Source/Cliente/FactuGES.res and b/Source/Cliente/FactuGES.res differ diff --git a/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas b/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas index 4353f9f4..409e17bc 100644 --- a/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas +++ b/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas @@ -409,7 +409,7 @@ begin raise Exception.Create('El presupuesto debe tener en su contenido al menos un concepto'); - FDetallesController.ValidarCierreCapitulos(APresupuesto.Detalles); + FDetallesController.ValidarDetalles(APresupuesto.Detalles); { Asegurarse de valores en campos "automáticos" tanto en MODIFICACIÓN como en INSERCIÓN. } diff --git a/Source/Servidor/FactuGES_Server.RES b/Source/Servidor/FactuGES_Server.RES index fb304d01..b440dfb5 100644 Binary files a/Source/Servidor/FactuGES_Server.RES and b/Source/Servidor/FactuGES_Server.RES differ diff --git a/Source/Servidor/FactuGES_Server.rc b/Source/Servidor/FactuGES_Server.rc index d3059860..4809ffe5 100644 --- a/Source/Servidor/FactuGES_Server.rc +++ b/Source/Servidor/FactuGES_Server.rc @@ -14,7 +14,7 @@ BEGIN BEGIN VALUE "FileVersion", "1.3.7.0\0" VALUE "ProductVersion", "1.3.7.0\0" - VALUE "CompileDate", "miércoles, 01 de octubre de 2008 16:16\0" + VALUE "CompileDate", "viernes, 03 de octubre de 2008 11:31\0" END END BLOCK "VarFileInfo"