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