Arreglo generar de reports, begintracsaction y rollbacktransaccion, ademas de arreglos de orden de columnas
git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@719 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
parent
7d2c015221
commit
d4278f3e50
Binary file not shown.
@ -17,16 +17,21 @@ uses
|
||||
function CompararReferencias(const ARef1, ARef2 : String) : Integer;
|
||||
var
|
||||
Aux1, Aux2 : String;
|
||||
AuxInt1, AuxInt2: Double;
|
||||
Rpl : Char;
|
||||
begin
|
||||
Rpl := ' ';
|
||||
Aux1 := StrReplaceButChars(ARef1, AnsiDecDigits, Rpl);
|
||||
Aux1 := StrRemoveChars(Aux1, AnsiWhiteSpace);
|
||||
Aux2 := StrReplaceButChars(ARef2, AnsiDecDigits, Rpl);
|
||||
Aux2 := StrRemoveChars(Aux2, AnsiWhiteSpace);
|
||||
Aux2 := StrRemoveChars(Aux2, AnsiWhiteSpace);
|
||||
|
||||
if StrIsDigit(Aux1) and StrIsDigit(Aux2) then
|
||||
Result := VarCompare(StrToIntSafe(Aux1), StrToIntSafe(Aux2))
|
||||
begin
|
||||
AuxInt1 := StrToFloatSafe(Aux1);
|
||||
AuxInt2 := StrToFloatSafe(Aux2);
|
||||
Result := VarCompare(AuxInt1, AuxInt2)
|
||||
end
|
||||
else
|
||||
Result := VarCompare(Aux1, Aux2)
|
||||
end;
|
||||
|
||||
Binary file not shown.
@ -107,15 +107,12 @@ var
|
||||
i: Integer;
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
//FConnection.BeginTransaction; <--- Creo que no va a hacer falta.
|
||||
|
||||
try
|
||||
//Vamos generando todos y cada uno de los albaranes recibidos
|
||||
for i := 0 to AListaID.Count - 1 do
|
||||
_GenerarAlbaran(AListaID.Items[i]);
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
finally
|
||||
//FConnection.RollbackTransaction; <--- Creo que no va a hacer falta.
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -125,8 +122,6 @@ var
|
||||
i: Integer;
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
//FConnection.BeginTransaction; <--- Creo que no va a hacer falta.
|
||||
|
||||
try
|
||||
//Vamos generando todos y cada uno de los presupuestos recibidos
|
||||
for i := 0 to ListaID.Count - 1 do
|
||||
@ -135,23 +130,27 @@ begin
|
||||
frxPDFExport1.Stream := Result;
|
||||
frxReport.Export(frxPDFExport1)
|
||||
finally
|
||||
//FConnection.RollbackTransaction; <--- Creo que no va a hacer falta.
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRptAlbaranesCliente._GenerarAlbaran(const AID: Integer);
|
||||
begin
|
||||
tbl_Cabecera.Active := False;
|
||||
tbl_Detalles.Active := False;
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
try
|
||||
tbl_Cabecera.Active := False;
|
||||
tbl_Detalles.Active := False;
|
||||
|
||||
tbl_Cabecera.ParamByName('ID').AsInteger := AID;
|
||||
tbl_Detalles.ParamByName('ID_ALBARAN').AsInteger := AID;
|
||||
tbl_Cabecera.ParamByName('ID').AsInteger := AID;
|
||||
tbl_Detalles.ParamByName('ID_ALBARAN').AsInteger := AID;
|
||||
|
||||
tbl_Cabecera.Active := True;
|
||||
tbl_Detalles.Active := True;
|
||||
tbl_Cabecera.Active := True;
|
||||
tbl_Detalles.Active := True;
|
||||
|
||||
frxReport.LoadFromFile(DarRutaInformes + rptInforme, True);
|
||||
frxReport.PrepareReport(False);
|
||||
frxReport.LoadFromFile(DarRutaInformes + rptInforme, True);
|
||||
frxReport.PrepareReport(False);
|
||||
finally
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
end;
|
||||
end;
|
||||
|
||||
function TRptAlbaranesCliente.GenerarEtiquetas(const AID: Integer; withRefCliente: Boolean): Binary;
|
||||
|
||||
@ -229,22 +229,27 @@ procedure TRptWordAlbaranCliente._GenerarAlbaran(const AID: String);
|
||||
var
|
||||
ACopiaPlantilla : String;
|
||||
begin
|
||||
tbl_Cabecera.ParamByName('ID').AsString := AID;
|
||||
tbl_Detalles.ParamByName('ID_ALBARAN').AsString := AID;
|
||||
|
||||
tbl_Cabecera.Active := True;
|
||||
tbl_Detalles.Active := True;
|
||||
|
||||
FCodigoAlbaran := AID;
|
||||
|
||||
ACopiaPlantilla := DarFicheroTemporal;
|
||||
CopiarFichero(FPlantilla, ACopiaPlantilla);
|
||||
FPlantilla := ACopiaPlantilla;
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
try
|
||||
if RecuperarEmpresa(tbl_Cabecera.FieldByName('ID_EMPRESA').AsInteger, tbl_Empresa) then
|
||||
Generar;
|
||||
tbl_Cabecera.ParamByName('ID').AsString := AID;
|
||||
tbl_Detalles.ParamByName('ID_ALBARAN').AsString := AID;
|
||||
|
||||
tbl_Cabecera.Active := True;
|
||||
tbl_Detalles.Active := True;
|
||||
|
||||
FCodigoAlbaran := AID;
|
||||
|
||||
ACopiaPlantilla := DarFicheroTemporal;
|
||||
CopiarFichero(FPlantilla, ACopiaPlantilla);
|
||||
FPlantilla := ACopiaPlantilla;
|
||||
try
|
||||
if RecuperarEmpresa(tbl_Cabecera.FieldByName('ID_EMPRESA').AsInteger, tbl_Empresa) then
|
||||
Generar;
|
||||
finally
|
||||
SysUtils.DeleteFile(ACopiaPlantilla);
|
||||
end;
|
||||
finally
|
||||
SysUtils.DeleteFile(ACopiaPlantilla);
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
@ -66,7 +66,6 @@ var
|
||||
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
|
||||
FConnection.BeginTransaction;
|
||||
|
||||
AStream := TMemoryStream.Create;
|
||||
|
||||
@ -64,8 +64,6 @@ var
|
||||
i: Integer;
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
|
||||
//FConnection.BeginTransaction; <--- Creo que no va a hacer falta.
|
||||
try
|
||||
//Vamos generando todos y cada uno de las fichas de empleado
|
||||
for i := 0 to ListaID.Count - 1 do
|
||||
@ -73,7 +71,6 @@ begin
|
||||
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
finally
|
||||
//FConnection.RollbackTransaction; <--- Creo que no va a hacer falta.
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -83,7 +80,7 @@ var
|
||||
dsMaster: IDADataset;
|
||||
begin
|
||||
AStream := TMemoryStream.Create;
|
||||
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
try
|
||||
dsMaster := schReport.NewDataset(FConnection, ds_InformeFichaEmpleado, ['ID'], [ID]);
|
||||
|
||||
@ -95,6 +92,7 @@ begin
|
||||
frxReport.PrepareReport(False);
|
||||
|
||||
finally
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
AStream.Free;
|
||||
dsMaster := Nil;
|
||||
end;
|
||||
|
||||
@ -139,8 +139,6 @@ var
|
||||
i: Integer;
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
//FConnection.BeginTransaction; <--- Creo que no va a hacer falta.
|
||||
|
||||
try
|
||||
//Vamos generando todos y cada una de las facturas recibidas
|
||||
for i := 0 to ListaID.Count - 1 do
|
||||
@ -148,7 +146,6 @@ begin
|
||||
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
finally
|
||||
//FConnection.RollbackTransaction; <--- Creo que no va a hacer falta.
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -158,8 +155,6 @@ var
|
||||
i: Integer;
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
//FConnection.BeginTransaction; <--- Creo que no va a hacer falta.
|
||||
|
||||
try
|
||||
//Vamos generando todos y cada una de las facturas recibidas
|
||||
for i := 0 to ListaID.Count - 1 do
|
||||
@ -168,7 +163,6 @@ begin
|
||||
frxPDFExport1.Stream := Result;
|
||||
frxReport.Export(frxPDFExport1)
|
||||
finally
|
||||
//FConnection.RollbackTransaction; <--- Creo que no va a hacer falta.
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -177,7 +171,6 @@ var
|
||||
ATipoInforme: String;
|
||||
|
||||
begin
|
||||
|
||||
//DESGLOSADO POR CLIENTE EN ESTE INFORME NO SE DESGLOSARÁ POR CLIENTE
|
||||
if Desglosado then
|
||||
ATipoInforme := rptInformeIVADesglosado
|
||||
@ -240,20 +233,25 @@ end;
|
||||
|
||||
procedure TRptFacturasCliente._GenerarFactura(const ID: Integer);
|
||||
begin
|
||||
tbl_Cabecera.Active := False;
|
||||
tbl_Detalles.Active := False;
|
||||
tbl_Vencimientos.Active := False;
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
try
|
||||
tbl_Cabecera.Active := False;
|
||||
tbl_Detalles.Active := False;
|
||||
tbl_Vencimientos.Active := False;
|
||||
|
||||
tbl_Cabecera.ParamByName('ID').AsInteger := ID;
|
||||
tbl_Detalles.ParamByName('ID_FACTURA').AsInteger := ID;
|
||||
tbl_Vencimientos.ParamByName('ID_FACTURA').AsInteger := ID;
|
||||
tbl_Cabecera.ParamByName('ID').AsInteger := ID;
|
||||
tbl_Detalles.ParamByName('ID_FACTURA').AsInteger := ID;
|
||||
tbl_Vencimientos.ParamByName('ID_FACTURA').AsInteger := ID;
|
||||
|
||||
tbl_Cabecera.Active := True;
|
||||
tbl_Detalles.Active := True;
|
||||
tbl_Vencimientos.Active := True;
|
||||
tbl_Cabecera.Active := True;
|
||||
tbl_Detalles.Active := True;
|
||||
tbl_Vencimientos.Active := True;
|
||||
|
||||
frxReport.LoadFromFile(DarRutaInformes + rptFacturaCliente, True);
|
||||
frxReport.PrepareReport(False);
|
||||
frxReport.LoadFromFile(DarRutaInformes + rptFacturaCliente, True);
|
||||
frxReport.PrepareReport(False);
|
||||
finally
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
end;
|
||||
end;
|
||||
|
||||
function TRptFacturasCliente._GenerarInforme(const TipoInforme: String;
|
||||
@ -265,7 +263,7 @@ var
|
||||
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
//FConnection.BeginTransaction; <--- Creo que no va a hacer falta.
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
|
||||
try
|
||||
|
||||
@ -342,7 +340,7 @@ begin
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
|
||||
finally
|
||||
//FConnection.RollbackTransaction; <--- Creo que no va a hacer falta.
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
@ -352,26 +352,31 @@ procedure TRptWordFacturaCliente._GenerarFactura(const AID: String);
|
||||
var
|
||||
ACopiaPlantilla : String;
|
||||
begin
|
||||
tbl_Cabecera.ParamByName('ID').AsString := AID;
|
||||
tbl_Detalles.ParamByName('ID_FACTURA').AsString := AID;
|
||||
tbl_Vencimientos.ParamByName('ID_FACTURA').AsString := AID;
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
try
|
||||
tbl_Cabecera.ParamByName('ID').AsString := AID;
|
||||
tbl_Detalles.ParamByName('ID_FACTURA').AsString := AID;
|
||||
tbl_Vencimientos.ParamByName('ID_FACTURA').AsString := AID;
|
||||
|
||||
tbl_Cabecera.Active := True;
|
||||
tbl_Detalles.Active := True;
|
||||
tbl_Vencimientos.Active := True;
|
||||
tbl_Cabecera.Active := True;
|
||||
tbl_Detalles.Active := True;
|
||||
tbl_Vencimientos.Active := True;
|
||||
|
||||
FCodigoFactura := AID;
|
||||
FCodigoFactura := AID;
|
||||
|
||||
if RecuperarEmpresa(tbl_Cabecera.FieldByName('ID_EMPRESA').AsInteger, tbl_Empresa) then
|
||||
begin
|
||||
ACopiaPlantilla := DarFicheroTemporal;
|
||||
CopiarFichero(FPlantilla, ACopiaPlantilla);
|
||||
FPlantilla := ACopiaPlantilla;
|
||||
try
|
||||
Generar;
|
||||
finally
|
||||
SysUtils.DeleteFile(ACopiaPlantilla);
|
||||
if RecuperarEmpresa(tbl_Cabecera.FieldByName('ID_EMPRESA').AsInteger, tbl_Empresa) then
|
||||
begin
|
||||
ACopiaPlantilla := DarFicheroTemporal;
|
||||
CopiarFichero(FPlantilla, ACopiaPlantilla);
|
||||
FPlantilla := ACopiaPlantilla;
|
||||
try
|
||||
Generar;
|
||||
finally
|
||||
SysUtils.DeleteFile(ACopiaPlantilla);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
@ -195,7 +195,7 @@ var
|
||||
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
//FConnection.BeginTransaction; <--- Creo que no va a hacer falta.
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
|
||||
try
|
||||
|
||||
@ -272,7 +272,7 @@ begin
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
|
||||
finally
|
||||
//FConnection.RollbackTransaction; <--- Creo que no va a hacer falta.
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
@ -154,8 +154,6 @@ begin
|
||||
Result := Binary.Create;
|
||||
FImprimirPrecio := ImprimirPrecio;
|
||||
FImprimirRefProveedor := ImprimirRefProveedor;
|
||||
|
||||
//FConnection.BeginTransaction; <--- Creo que no va a hacer falta.
|
||||
try
|
||||
//Vamos generando todos y cada uno de los pedidos recibidos
|
||||
for i := 0 to ListaID.Count - 1 do
|
||||
@ -163,7 +161,6 @@ begin
|
||||
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
finally
|
||||
//FConnection.RollbackTransaction; <--- Creo que no va a hacer falta.
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -176,7 +173,7 @@ var
|
||||
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
//FConnection.BeginTransaction; <--- Creo que no va a hacer falta.
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
|
||||
try
|
||||
|
||||
@ -253,23 +250,28 @@ begin
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
|
||||
finally
|
||||
//FConnection.RollbackTransaction; <--- Creo que no va a hacer falta.
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRptPedidosProveedor._GenerarPedido(const ID: Integer);
|
||||
begin
|
||||
tbl_Cabecera.Active := False;
|
||||
tbl_Detalles.Active := False;
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
try
|
||||
tbl_Cabecera.Active := False;
|
||||
tbl_Detalles.Active := False;
|
||||
|
||||
tbl_Cabecera.ParamByName('ID').AsInteger := ID;
|
||||
tbl_Detalles.ParamByName('ID_PEDIDO').AsInteger := ID;
|
||||
tbl_Cabecera.ParamByName('ID').AsInteger := ID;
|
||||
tbl_Detalles.ParamByName('ID_PEDIDO').AsInteger := ID;
|
||||
|
||||
tbl_Cabecera.Active := True;
|
||||
tbl_Detalles.Active := True;
|
||||
tbl_Cabecera.Active := True;
|
||||
tbl_Detalles.Active := True;
|
||||
|
||||
frxReport.LoadFromFile(DarRutaInformes + rptInforme, True);
|
||||
frxReport.PrepareReport(False);
|
||||
frxReport.LoadFromFile(DarRutaInformes + rptInforme, True);
|
||||
frxReport.PrepareReport(False);
|
||||
finally
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
end;
|
||||
end;
|
||||
|
||||
function TRptPedidosProveedor.GenerarPedidoEnPDF(
|
||||
@ -281,8 +283,6 @@ begin
|
||||
Result := Binary.Create;
|
||||
FImprimirPrecio := ImprimirPrecio;
|
||||
FImprimirRefProveedor := ImprimirRefProveedor;
|
||||
|
||||
//FConnection.BeginTransaction; <--- Creo que no va a hacer falta.
|
||||
try
|
||||
//Vamos generando todos y cada uno de los albaranes recibidos
|
||||
for i := 0 to ListaID.Count - 1 do
|
||||
@ -291,7 +291,6 @@ begin
|
||||
frxPDFExport1.Stream := Result;
|
||||
frxReport.Export(frxPDFExport1)
|
||||
finally
|
||||
//FConnection.RollbackTransaction; <--- Creo que no va a hacer falta.
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
@ -247,24 +247,29 @@ procedure TRptWordPedidoProveedor._GenerarPedido(const AID: String);
|
||||
var
|
||||
ACopiaPlantilla : String;
|
||||
begin
|
||||
tbl_Cabecera.ParamByName('ID').AsString := AID;
|
||||
tbl_Detalles.ParamByName('ID_PEDIDO').AsString := AID;
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
try
|
||||
tbl_Cabecera.ParamByName('ID').AsString := AID;
|
||||
tbl_Detalles.ParamByName('ID_PEDIDO').AsString := AID;
|
||||
|
||||
tbl_Cabecera.Active := True;
|
||||
tbl_Detalles.Active := True;
|
||||
tbl_Cabecera.Active := True;
|
||||
tbl_Detalles.Active := True;
|
||||
|
||||
FCodigoPedido := AID;
|
||||
FCodigoPedido := AID;
|
||||
|
||||
if RecuperarEmpresa(tbl_Cabecera.FieldByName('ID_EMPRESA').AsInteger, tbl_Empresa) then
|
||||
begin
|
||||
ACopiaPlantilla := DarFicheroTemporal;
|
||||
CopiarFichero(FPlantilla, ACopiaPlantilla);
|
||||
FPlantilla := ACopiaPlantilla;
|
||||
try
|
||||
Generar;
|
||||
finally
|
||||
SysUtils.DeleteFile(ACopiaPlantilla);
|
||||
if RecuperarEmpresa(tbl_Cabecera.FieldByName('ID_EMPRESA').AsInteger, tbl_Empresa) then
|
||||
begin
|
||||
ACopiaPlantilla := DarFicheroTemporal;
|
||||
CopiarFichero(FPlantilla, ACopiaPlantilla);
|
||||
FPlantilla := ACopiaPlantilla;
|
||||
try
|
||||
Generar;
|
||||
finally
|
||||
SysUtils.DeleteFile(ACopiaPlantilla);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
@ -125,8 +125,6 @@ var
|
||||
i: Integer;
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
//FConnection.BeginTransaction; <--- Creo que no va a hacer falta.
|
||||
|
||||
try
|
||||
//Vamos generando todos y cada uno de los presupuestos recibidos
|
||||
for i := 0 to ListaID.Count - 1 do
|
||||
@ -135,7 +133,6 @@ begin
|
||||
frxPDFExport1.Stream := Result;
|
||||
frxReport.Export(frxPDFExport1)
|
||||
finally
|
||||
//FConnection.RollbackTransaction; <--- Creo que no va a hacer falta.
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -162,8 +159,6 @@ var
|
||||
i: Integer;
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
//FConnection.BeginTransaction; <--- Creo que no va a hacer falta.
|
||||
|
||||
try
|
||||
//Vamos generando todos y cada uno de los presupuestos recibidos
|
||||
for i := 0 to ListaID.Count - 1 do
|
||||
@ -171,7 +166,6 @@ begin
|
||||
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
finally
|
||||
//FConnection.RollbackTransaction; <--- Creo que no va a hacer falta.
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -184,7 +178,7 @@ var
|
||||
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
//FConnection.BeginTransaction; <--- Creo que no va a hacer falta.
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
|
||||
try
|
||||
|
||||
@ -261,29 +255,34 @@ begin
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
|
||||
finally
|
||||
//FConnection.RollbackTransaction; <--- Creo que no va a hacer falta.
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRptPresupuestosCliente._GenerarPresupuesto(const AID: Integer);
|
||||
begin
|
||||
tbl_Cabecera.Active := False;
|
||||
tbl_Capitulos.Active := False;
|
||||
tbl_Detalles.Active := False;
|
||||
tbl_Resumen.Active := False;
|
||||
|
||||
tbl_Cabecera.ParamByName('ID').AsInteger := AID;
|
||||
tbl_Capitulos.ParamByName('ID_PRESUPUESTO').AsInteger := AID;
|
||||
tbl_Detalles.ParamByName('ID_PRESUPUESTO').AsInteger := AID;
|
||||
tbl_Resumen.ParamByName('ID_PRESUPUESTO').AsInteger := AID;
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
try
|
||||
tbl_Cabecera.Active := False;
|
||||
tbl_Capitulos.Active := False;
|
||||
tbl_Detalles.Active := False;
|
||||
tbl_Resumen.Active := False;
|
||||
|
||||
tbl_Cabecera.Active := True;
|
||||
tbl_Capitulos.Active := True;
|
||||
tbl_Detalles.Active := True;
|
||||
tbl_Resumen.Active := True;
|
||||
tbl_Cabecera.ParamByName('ID').AsInteger := AID;
|
||||
tbl_Capitulos.ParamByName('ID_PRESUPUESTO').AsInteger := AID;
|
||||
tbl_Detalles.ParamByName('ID_PRESUPUESTO').AsInteger := AID;
|
||||
tbl_Resumen.ParamByName('ID_PRESUPUESTO').AsInteger := AID;
|
||||
|
||||
frxReport.LoadFromFile(DarRutaInformes + rptInforme, True);
|
||||
frxReport.PrepareReport(False);
|
||||
tbl_Cabecera.Active := True;
|
||||
tbl_Capitulos.Active := True;
|
||||
tbl_Detalles.Active := True;
|
||||
tbl_Resumen.Active := True;
|
||||
|
||||
frxReport.LoadFromFile(DarRutaInformes + rptInforme, True);
|
||||
frxReport.PrepareReport(False);
|
||||
finally
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -187,24 +187,29 @@ procedure TRptWordCertificadoTrabajo._GenerarCertificado(const AID: Integer);
|
||||
var
|
||||
ACopiaPlantilla: string;
|
||||
begin
|
||||
tbl_Cabecera.ParamByName('ID').AsInteger := AID;
|
||||
tbl_Capitulos.ParamByName('ID_PRESUPUESTO').AsInteger := AID;
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
try
|
||||
tbl_Cabecera.ParamByName('ID').AsInteger := AID;
|
||||
tbl_Capitulos.ParamByName('ID_PRESUPUESTO').AsInteger := AID;
|
||||
|
||||
tbl_Cabecera.Active := True;
|
||||
tbl_Capitulos.Active := True;
|
||||
tbl_Cabecera.Active := True;
|
||||
tbl_Capitulos.Active := True;
|
||||
|
||||
FCodigoPresupuesto := AID;
|
||||
FCodigoPresupuesto := AID;
|
||||
|
||||
if RecuperarEmpresa(tbl_Cabecera.FieldByName('ID_EMPRESA').AsInteger, tbl_Empresa) then
|
||||
begin
|
||||
ACopiaPlantilla := DarFicheroTemporal;
|
||||
CopiarFichero(FPlantilla, ACopiaPlantilla);
|
||||
FPlantilla := ACopiaPlantilla;
|
||||
try
|
||||
Generar;
|
||||
finally
|
||||
SysUtils.DeleteFile(ACopiaPlantilla);
|
||||
if RecuperarEmpresa(tbl_Cabecera.FieldByName('ID_EMPRESA').AsInteger, tbl_Empresa) then
|
||||
begin
|
||||
ACopiaPlantilla := DarFicheroTemporal;
|
||||
CopiarFichero(FPlantilla, ACopiaPlantilla);
|
||||
FPlantilla := ACopiaPlantilla;
|
||||
try
|
||||
Generar;
|
||||
finally
|
||||
SysUtils.DeleteFile(ACopiaPlantilla);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
@ -498,24 +498,29 @@ procedure TRptWordPresupuestoCliente._GenerarPresupuesto(const AID: String);
|
||||
var
|
||||
ACopiaPlantilla: string;
|
||||
begin
|
||||
tbl_Cabecera.ParamByName('ID').AsString := AID;
|
||||
tbl_Detalles.ParamByName('ID_PRESUPUESTO').AsString := AID;
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
try
|
||||
tbl_Cabecera.ParamByName('ID').AsString := AID;
|
||||
tbl_Detalles.ParamByName('ID_PRESUPUESTO').AsString := AID;
|
||||
|
||||
tbl_Cabecera.Active := True;
|
||||
tbl_Detalles.Active := True;
|
||||
tbl_Cabecera.Active := True;
|
||||
tbl_Detalles.Active := True;
|
||||
|
||||
FCodigoPresupuesto := AID;
|
||||
FCodigoPresupuesto := AID;
|
||||
|
||||
if RecuperarEmpresa(tbl_Cabecera.FieldByName('ID_EMPRESA').AsInteger, tbl_Empresa) then
|
||||
begin
|
||||
ACopiaPlantilla := DarFicheroTemporal;
|
||||
CopiarFichero(FPlantilla, ACopiaPlantilla);
|
||||
FPlantilla := ACopiaPlantilla;
|
||||
try
|
||||
Generar;
|
||||
finally
|
||||
SysUtils.DeleteFile(ACopiaPlantilla);
|
||||
if RecuperarEmpresa(tbl_Cabecera.FieldByName('ID_EMPRESA').AsInteger, tbl_Empresa) then
|
||||
begin
|
||||
ACopiaPlantilla := DarFicheroTemporal;
|
||||
CopiarFichero(FPlantilla, ACopiaPlantilla);
|
||||
FPlantilla := ACopiaPlantilla;
|
||||
try
|
||||
Generar;
|
||||
finally
|
||||
SysUtils.DeleteFile(ACopiaPlantilla);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
@ -78,15 +78,12 @@ var
|
||||
i: Integer;
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
|
||||
//FConnection.BeginTransaction; <--- Creo que no va a hacer falta.
|
||||
try
|
||||
//Vamos generando todos y cada uno de los albaranes recibidos
|
||||
for i := 0 to ListaID.Count - 1 do
|
||||
_GenerarRecibo(ListaID.Items[i]);
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
finally
|
||||
//FConnection.RollbackTransaction; <--- Creo que no va a hacer falta.
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -150,7 +147,7 @@ var
|
||||
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
//FConnection.BeginTransaction; <--- Creo que no va a hacer falta.
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
|
||||
try
|
||||
|
||||
@ -226,24 +223,29 @@ begin
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
|
||||
finally
|
||||
//FConnection.RollbackTransaction; <--- Creo que no va a hacer falta.
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TRptRecibosCliente._GenerarRecibo(const ID: Integer);
|
||||
begin
|
||||
tbl_Cabecera.Active := False;
|
||||
tbl_Compensados.Active := False;
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
try
|
||||
tbl_Cabecera.Active := False;
|
||||
tbl_Compensados.Active := False;
|
||||
|
||||
tbl_Cabecera.ParamByName('ID').AsInteger := ID;
|
||||
tbl_Compensados.ParamByName('ID_RECIBO').AsInteger := ID;
|
||||
tbl_Cabecera.ParamByName('ID').AsInteger := ID;
|
||||
tbl_Compensados.ParamByName('ID_RECIBO').AsInteger := ID;
|
||||
|
||||
tbl_Cabecera.Active := True;
|
||||
tbl_Compensados.Active := True;
|
||||
tbl_Cabecera.Active := True;
|
||||
tbl_Compensados.Active := True;
|
||||
|
||||
frxReport.LoadFromFile(DarRutaInformes + rptInforme, True);
|
||||
frxReport.PrepareReport(False);
|
||||
frxReport.LoadFromFile(DarRutaInformes + rptInforme, True);
|
||||
frxReport.PrepareReport(False);
|
||||
finally
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -130,7 +130,7 @@ var
|
||||
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
//FConnection.BeginTransaction; <--- Creo que no va a hacer falta.
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
|
||||
try
|
||||
|
||||
@ -206,7 +206,7 @@ begin
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
|
||||
finally
|
||||
//FConnection.RollbackTransaction; <--- Creo que no va a hacer falta.
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user