Se adaptan pedidos de cliente, albaranes de cliente a poder enviarlos por correo electronico, se arreglan la logica al generar todos y cada uno de los informes de pedido, albaranes, facturas, etc, para que se haga un begintransaction y un rollbacktransaction porque sino llegaba un momento en el que generar informes no se podia porque daba un error de transaccion activa
git-svn-id: https://192.168.0.254/svn/Proyectos.LuisLeon_FactuGES/trunk@297 c93665c3-c93d-084d-9b98-7d5f4a9c3376
This commit is contained in:
parent
073d29872a
commit
5d1ba11799
Binary file not shown.
@ -148,7 +148,7 @@
|
||||
<VersionInfo Name="IncludeVerInfo">True</VersionInfo>
|
||||
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||
<VersionInfo Name="MajorVer">3</VersionInfo>
|
||||
<VersionInfo Name="MinorVer">1</VersionInfo>
|
||||
<VersionInfo Name="MinorVer">2</VersionInfo>
|
||||
<VersionInfo Name="Release">0</VersionInfo>
|
||||
<VersionInfo Name="Build">0</VersionInfo>
|
||||
<VersionInfo Name="Debug">False</VersionInfo>
|
||||
@ -162,7 +162,7 @@
|
||||
<VersionInfoKeys>
|
||||
<VersionInfoKeys Name="CompanyName">Rodax Software S.L.</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileDescription"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileVersion">3.1.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileVersion">3.2.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="InternalName">FactuGES</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
MAINICON ICON "c:\Codigo Luis Leon\Source\Iconos\Factuges.ico"
|
||||
1 VERSIONINFO
|
||||
FILEVERSION 3,0,9,0
|
||||
PRODUCTVERSION 3,0,9,0
|
||||
FILEVERSION 3,2,0,0
|
||||
PRODUCTVERSION 3,2,0,0
|
||||
FILEFLAGSMASK 0x3FL
|
||||
FILEFLAGS 0x00L
|
||||
FILEOS 0x40004L
|
||||
@ -13,9 +13,9 @@ BEGIN
|
||||
BLOCK "0C0A04E4"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Rodax Software S.L.\0"
|
||||
VALUE "FileVersion", "3.0.9.0\0"
|
||||
VALUE "FileVersion", "3.2.0.0\0"
|
||||
VALUE "InternalName", "FactuGES\0"
|
||||
VALUE "ProductVersion", "3.0.9.0\0"
|
||||
VALUE "ProductVersion", "3.1.0.0\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
Binary file not shown.
@ -54,6 +54,7 @@ contains
|
||||
uAlbaranesClienteReportController in 'uAlbaranesClienteReportController.pas',
|
||||
uIEditorAlbaranesClientePreview in 'View\uIEditorAlbaranesClientePreview.pas',
|
||||
uIEditorAlbaranesDevCliente in 'View\uIEditorAlbaranesDevCliente.pas',
|
||||
uIEditorAlbaranDevCliente in 'View\uIEditorAlbaranDevCliente.pas';
|
||||
uIEditorAlbaranDevCliente in 'View\uIEditorAlbaranDevCliente.pas',
|
||||
uIDialogListaAlbaranesCliEnvioEMail in 'View\uIDialogListaAlbaranesCliEnvioEMail.pas';
|
||||
|
||||
end.
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
unit uIDialogListaAlbaranesCliEnvioEMail;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
uBizAlbaranesCliente, uAlbaranesClienteController;
|
||||
|
||||
type
|
||||
IDialogListaAlbaranesCliEnvioEMail = interface
|
||||
['{2C6DBF4E-28D8-49A6-9FF3-13AA5C6F6CF1}']
|
||||
function GetAlbaranes: IBizAlbaranCliente;
|
||||
procedure SetAlbaranes(const Value: IBizAlbaranCliente);
|
||||
property Albaranes: IBizAlbaranCliente read GetAlbaranes write SetAlbaranes;
|
||||
function ShowModal : Integer;
|
||||
procedure Release;
|
||||
end;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
@ -65,6 +65,13 @@ type
|
||||
function ValidarSituacion(ASituacion: String;
|
||||
AFechaEnvio : TDateTime = 0;
|
||||
AFechaRecibido : TDateTime = 0) : Boolean;
|
||||
|
||||
function EnviarEmailAlbaranes(AAlbaranes : IBizAlbaranCliente): Boolean;
|
||||
function GenerarEmailAlbaran(AAlbaran : IBizAlbaranCliente): Boolean;
|
||||
function EnviarAlbaranPorEMail(AAlbaran: IBizAlbaranCliente;
|
||||
const AEnviarDirectamente: Boolean = True;
|
||||
const ADireccionEMail: String = ''; const AAsuntoEMail: String = '';
|
||||
const ATextoEMail: String = ''): Boolean;
|
||||
end;
|
||||
|
||||
TAlbaranesClienteController = class(TObservador, IAlbaranesClienteController)
|
||||
@ -143,6 +150,13 @@ type
|
||||
function Print(AAlbaran : IBizAlbaranCliente; AllItems: Boolean = false): Boolean;
|
||||
procedure EtiquetasPreview(AAlbaran : IBizAlbaranCliente; Const withRefCliente: Boolean);
|
||||
procedure EtiquetasPrint(AAlbaran : IBizAlbaranCliente; Const withRefCliente: Boolean);
|
||||
|
||||
function EnviarEmailAlbaranes(AAlbaranes : IBizAlbaranCliente): Boolean;
|
||||
function GenerarEmailAlbaran(AAlbaran : IBizAlbaranCliente): Boolean;
|
||||
function EnviarAlbaranPorEMail(AAlbaran: IBizAlbaranCliente;
|
||||
const AEnviarDirectamente: Boolean = True;
|
||||
const ADireccionEMail: String = ''; const AAsuntoEMail: String = '';
|
||||
const ATextoEMail: String = ''): Boolean;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -156,7 +170,9 @@ uses
|
||||
uIEditorElegirAlbaranesCliente, uIEditorDireccionEntregaAlbaranCliente,
|
||||
schContactosClient_Intf, uAlbaranesClienteReportController, uControllerDetallesBase,
|
||||
uPedidosClienteController, uBizPedidosCliente, uBizDetallesPedidoCliente,
|
||||
schPedidosClienteClient_Intf, uDialogUtils, Windows, Forms, Dialogs, uGUIBase;
|
||||
schPedidosClienteClient_Intf, uDialogUtils, Windows, Forms, Dialogs, uGUIBase,
|
||||
|
||||
uIDialogListaAlbaranesCliEnvioEMail, uSistemaFunc, uStringsUtils, uDialogElegirEMail, uEMailUtils;
|
||||
|
||||
|
||||
|
||||
@ -742,6 +758,104 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TAlbaranesClienteController.EnviarAlbaranPorEMail(
|
||||
AAlbaran: IBizAlbaranCliente; const AEnviarDirectamente: Boolean;
|
||||
const ADireccionEMail, AAsuntoEMail, ATextoEMail: String): Boolean;
|
||||
var
|
||||
AReportController : IAlbaranesClienteReportController;
|
||||
AFicheroTMP : TFileName;
|
||||
AEMail : String;
|
||||
AAsunto : String;
|
||||
AListaEmail : TStringList;
|
||||
begin
|
||||
|
||||
if not Assigned(AAlbaran) then
|
||||
raise Exception.Create ('Albaran no asignada (EnviarAlbaranPorEMail)');
|
||||
|
||||
if AAlbaran.DataTable.Active then
|
||||
AAlbaran.DataTable.Active := True;
|
||||
|
||||
RecuperarCliente(AAlbaran);
|
||||
AAlbaran.Cliente.DataTable.Active := True;
|
||||
|
||||
AFicheroTMP := DarFicheroPDFTemporal(EscapeIllegalChars(AAlbaran.REFERENCIA));
|
||||
|
||||
if not EsCadenaVacia(ADireccionEMail) then
|
||||
AEMail := ADireccionEMail
|
||||
else begin
|
||||
AListaEmail := TStringList.Create;
|
||||
try
|
||||
if not EsCadenaVacia(AAlbaran.Cliente.EMAIL_ADMINISTRACION) then
|
||||
AListaEmail.Add(AAlbaran.Cliente.EMAIL_ADMINISTRACION);
|
||||
|
||||
if not ElegirEMail(AListaEmail, AEMail) then
|
||||
Exit;
|
||||
finally
|
||||
FreeANDNIL(AListaEmail);
|
||||
end;
|
||||
end;
|
||||
|
||||
if not EsCadenaVacia(AAsuntoEMail) then
|
||||
AAsunto := AAsuntoEMail
|
||||
else
|
||||
begin
|
||||
if (AAlbaran.TIPO = CTE_TIPO_ALBARAN_DEV) then
|
||||
AAsunto := 'Orden devolución ' + AAlbaran.REFERENCIA
|
||||
else
|
||||
AAsunto := 'Albarán ' + AAlbaran.REFERENCIA;
|
||||
end;
|
||||
|
||||
ShowHourglassCursor;
|
||||
Application.ProcessMessages;
|
||||
|
||||
AReportController := TAlbaranesClienteReportController.Create;
|
||||
try
|
||||
AReportController.ExportToPDF(AAlbaran.ID, AFicheroTMP);
|
||||
Result := EnviarEMailMAPI(AAsunto, ATextoEMail, AFicheroTMP, '', '', AAlbaran.Cliente.NOMBRE, AEMail, AEnviarDirectamente);
|
||||
if Result then
|
||||
// _AnadirMarcaEnvioCorreo(AAlbaran);
|
||||
finally
|
||||
SysUtils.DeleteFile(AFicheroTMP);
|
||||
AReportController := NIL;
|
||||
HideHourglassCursor;
|
||||
Application.ProcessMessages;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TAlbaranesClienteController.EnviarEmailAlbaranes(
|
||||
AAlbaranes: IBizAlbaranCliente): Boolean;
|
||||
var
|
||||
ADialog : IDialogListaAlbaranesCliEnvioEMail;
|
||||
ARespuesta : Integer;
|
||||
begin
|
||||
ADialog := NIL;
|
||||
|
||||
if not Assigned(AAlbaranes) then
|
||||
raise Exception.Create ('Albaranes no asignadas (EnviarAlbaranesCliPorEMail)');
|
||||
|
||||
if AAlbaranes.DataTable.Active then
|
||||
AAlbaranes.DataTable.Active := True;
|
||||
|
||||
ShowHourglassCursor;
|
||||
try
|
||||
CreateEditor('DialogListaAlbaranesCliEnvioEMail', IDialogListaAlbaranesCliEnvioEMail, ADialog);
|
||||
|
||||
if Assigned(ADialog) then
|
||||
begin
|
||||
try
|
||||
ADialog.Albaranes := AAlbaranes;
|
||||
ARespuesta := ADialog.ShowModal;
|
||||
Result := (ARespuesta = mrOK)
|
||||
finally
|
||||
ADialog.Release;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
ADialog := NIL;
|
||||
HideHourglassCursor;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TAlbaranesClienteController.EsEliminable(AAlbaran: IBizAlbaranCliente): Boolean;
|
||||
begin
|
||||
if not Assigned(AAlbaran) then
|
||||
@ -1042,6 +1156,24 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TAlbaranesClienteController.GenerarEmailAlbaran(
|
||||
AAlbaran: IBizAlbaranCliente): Boolean;
|
||||
begin
|
||||
if not Assigned(AAlbaran) then
|
||||
raise Exception.Create ('Pedidos no asignadas (GenerarEmailPedido)');
|
||||
|
||||
if AAlbaran.DataTable.Active then
|
||||
AAlbaran.DataTable.Active := True;
|
||||
|
||||
ShowHourglassCursor;
|
||||
try
|
||||
RecuperarCliente(AAlbaran);
|
||||
EnviarAlbaranPorEMail(AAlbaran, False, AAlbaran.Cliente.EMAIL_ADMINISTRACION);
|
||||
finally
|
||||
HideHourglassCursor;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TAlbaranesClienteController.GenerarOrdenDev(AAlbaran: IBizAlbaranCliente): IBizAlbaranCliente;
|
||||
var
|
||||
AOrden : IBizAlbaranCliente;
|
||||
|
||||
@ -14,6 +14,7 @@ type
|
||||
function Print(const AID : String): Boolean;
|
||||
procedure EtiquetasPreview(const AID : integer; Const withRefCliente: Boolean);
|
||||
procedure EtiquetasPrint(const AID : integer; Const withRefCliente: Boolean);
|
||||
function ExportToPDF(const AID: Integer; const AFileName : String = ''): Boolean;
|
||||
end;
|
||||
|
||||
TAlbaranesClienteReportController = class(TInterfacedObject, IAlbaranesClienteReportController)
|
||||
@ -29,6 +30,7 @@ type
|
||||
function Print(const AID : String): Boolean;
|
||||
procedure EtiquetasPreview(const AID : integer; const withRefCliente: Boolean);
|
||||
procedure EtiquetasPrint(const AID : integer; const withRefCliente: Boolean);
|
||||
function ExportToPDF(const AID: Integer; const AFileName : String = ''): Boolean;
|
||||
end;
|
||||
|
||||
|
||||
@ -37,7 +39,7 @@ implementation
|
||||
uses
|
||||
uROTypes, uEditorRegistryUtils, uIEditorAlbaranesClientePreview,
|
||||
uEditorPreview, uDataModuleAlbaranesCliente, uEditorBase, cxControls,
|
||||
schAlbaranesClienteClient_Intf;
|
||||
schAlbaranesClienteClient_Intf, uStringsUtils;
|
||||
|
||||
{ TAlbaranesClienteReportController }
|
||||
|
||||
@ -107,6 +109,28 @@ begin
|
||||
AEditor.Print
|
||||
end;
|
||||
|
||||
function TAlbaranesClienteReportController.ExportToPDF(const AID: Integer; const AFileName: String): Boolean;
|
||||
var
|
||||
AStream: Binary;
|
||||
begin
|
||||
Result := False;
|
||||
if EsCadenaVacia(AFileName) then
|
||||
Exit;
|
||||
|
||||
ShowHourglassCursor;
|
||||
try
|
||||
AStream := FDataModule.GetRptPDF(AID, True);
|
||||
try
|
||||
AStream.SaveToFile(AFileName);
|
||||
Result := True;
|
||||
finally
|
||||
FreeAndNil(AStream);
|
||||
end;
|
||||
finally
|
||||
HideHourglassCursor;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TAlbaranesClienteReportController.Preview(const AID : String);
|
||||
var
|
||||
AStream: Binary;
|
||||
|
||||
@ -40,6 +40,7 @@ type
|
||||
// Report
|
||||
function GetReport(const AID: String; const ShowLogotipo: Boolean = False): Binary;
|
||||
function GetEtiquetas(const AID: Integer; withRefCliente: Boolean): Binary;
|
||||
function GetRptPDF(const AID: Integer; const ShowLogotipo: Boolean = False): Binary;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -81,6 +82,20 @@ begin
|
||||
Result := (RORemoteService as IsrvAlbaranesCliente).GenerateReport(AID, ShowLogotipo)
|
||||
end;
|
||||
|
||||
function TDataModuleAlbaranesCliente.GetRptPDF(const AID: Integer;
|
||||
const ShowLogotipo: Boolean): Binary;
|
||||
var
|
||||
AParam : TIntegerArray;
|
||||
begin
|
||||
AParam := TIntegerArray.Create;
|
||||
try
|
||||
AParam.Add(AID);
|
||||
Result := (RORemoteService as IsrvAlbaranesCliente).GenerarReportPDF(AParam, ShowLogotipo)
|
||||
finally
|
||||
FreeANDNIL(AParam)
|
||||
end;
|
||||
end;
|
||||
|
||||
function TDataModuleAlbaranesCliente.NewItem: IBizAlbaranCliente;
|
||||
begin
|
||||
Result := GetItem(ID_NULO)
|
||||
|
||||
@ -9,7 +9,8 @@ type
|
||||
IDataModuleAlbaranesClienteReport = interface
|
||||
['{42C55204-5AB9-403E-8385-1A62B02D8234}']
|
||||
function GetReport(const AID: String; const ShowLogotipo: Boolean = False): Binary;
|
||||
function GetEtiquetas(const AID: Integer; withRefCliente: Boolean): Binary;
|
||||
function GetEtiquetas(const AID: Integer; withRefCliente: Boolean): Binary;
|
||||
function GetRptPDF(const AID: Integer; const ShowLogotipo: Boolean = False): Binary;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
@ -1404,4 +1404,18 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
|
||||
Left = 344
|
||||
Top = 16
|
||||
end
|
||||
object frxPDFExport1: TfrxPDFExport
|
||||
ShowDialog = False
|
||||
UseFileCache = True
|
||||
ShowProgress = False
|
||||
PrintOptimized = True
|
||||
Outline = True
|
||||
Author = 'FactuGES'
|
||||
Subject = 'FactuGES'
|
||||
Background = False
|
||||
Creator = 'FactuGES'
|
||||
HTMLTags = True
|
||||
Left = 360
|
||||
Top = 344
|
||||
end
|
||||
end
|
||||
|
||||
@ -7,7 +7,7 @@ uses
|
||||
Dialogs, frxClass, frxDBSet, uDAScriptingProvider,
|
||||
uDADataTable, uDACDSDataTable, DB, uDAClasses, frxChart, frxGradient,
|
||||
frxChBox, frxCross, frxOLE, frxBarcode, frxRich, uDABINAdapter, uROTypes,
|
||||
uDAInterfaces;
|
||||
uDAInterfaces, FactuGES_Intf, frxExportPDF;
|
||||
|
||||
type
|
||||
TRptAlbaranesCliente = class(TDataModule)
|
||||
@ -28,16 +28,18 @@ type
|
||||
schReport: TDASchema;
|
||||
DataDictionary: TDADataDictionary;
|
||||
frxReport: TfrxReport;
|
||||
frxPDFExport1: TfrxPDFExport;
|
||||
procedure DataModuleCreate(Sender: TObject);
|
||||
procedure frxReportGetValue(const VarName: string; var Value: Variant);
|
||||
private
|
||||
FConnection: IDAConnection;
|
||||
FShowLogotipo: Boolean;
|
||||
//Genera cada uno de los albaranes a imprimir
|
||||
procedure GenerarAlbaran(const ID: integer); overload;
|
||||
procedure _GenerarAlbaran(const ID: integer); overload;
|
||||
public
|
||||
function GenerarAlbaran(const AID : String; const AConLogotipo: Boolean = False): Binary; overload;
|
||||
function GenerarEtiquetas(const AID : Integer; withRefCliente: Boolean): Binary;
|
||||
function GenerarReportEnPDF(const ListaID : TIntegerArray; const AConLogotipo: Boolean = False): Binary;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -74,21 +76,17 @@ var
|
||||
i: Integer;
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
FConnection.BeginTransaction;
|
||||
|
||||
try
|
||||
FShowLogotipo := AConLogotipo;
|
||||
FShowLogotipo := AConLogotipo;
|
||||
ID_Albaranes := TStringList.Create;
|
||||
ID_Albaranes.CommaText := AID;
|
||||
|
||||
//Vamos generando todos y cada uno de los albaranes recibidos
|
||||
for i := 0 to ID_Albaranes.Count - 1 do
|
||||
GenerarAlbaran(StrToInt(ID_Albaranes.Strings[i]));
|
||||
_GenerarAlbaran(StrToInt(ID_Albaranes.Strings[i]));
|
||||
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
|
||||
finally
|
||||
FConnection.RollbackTransaction;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -98,13 +96,14 @@ begin
|
||||
Value := FShowLogotipo;
|
||||
end;
|
||||
|
||||
procedure TRptAlbaranesCliente.GenerarAlbaran(const ID: integer);
|
||||
procedure TRptAlbaranesCliente._GenerarAlbaran(const ID: integer);
|
||||
var
|
||||
AStream: TMemoryStream;
|
||||
dsMaster: IDADataset;
|
||||
dsDetail: IDADataset;
|
||||
begin
|
||||
AStream := TMemoryStream.Create;
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
|
||||
try
|
||||
dsMaster := schReport.NewDataset(FConnection, ds_InformeCabecera, ['ID'], [ID]);
|
||||
@ -122,6 +121,7 @@ begin
|
||||
frxReport.PrepareReport(False);
|
||||
|
||||
finally
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
AStream.Free;
|
||||
dsMaster := Nil;
|
||||
dsDetail := Nil;
|
||||
@ -162,4 +162,22 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TRptAlbaranesCliente.GenerarReportEnPDF(const ListaID: TIntegerArray;
|
||||
const AConLogotipo: Boolean): Binary;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
FShowLogotipo := AConLogotipo;
|
||||
Result := Binary.Create;
|
||||
try
|
||||
//Vamos generando todos y cada uno de los presupuestos recibidos
|
||||
for i := 0 to ListaID.Count - 1 do
|
||||
_GenerarAlbaran(ListaID.Items[i]);
|
||||
|
||||
frxPDFExport1.Stream := Result;
|
||||
frxReport.Export(frxPDFExport1)
|
||||
finally
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -40,6 +40,7 @@ type
|
||||
function GetNextAutoInc(const GeneratorName: String): Integer;
|
||||
function GenerateReport(const ID: String; const ShowLogotipo: Boolean): Binary;
|
||||
function GenerateEtiquetas(const ID: Integer; const withRefCliente: Boolean): Binary;
|
||||
function GenerarReportPDF(const ListaID: TIntegerArray; const ShowLogotipo: Boolean): Binary;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -82,6 +83,19 @@ begin
|
||||
bpAlbaranesCliente.BusinessRulesID := BIZ_SERVER_ALBARAN_CLIENTE;
|
||||
end;
|
||||
|
||||
function TsrvAlbaranesCliente.GenerarReportPDF(const ListaID: TIntegerArray;
|
||||
const ShowLogotipo: Boolean): Binary;
|
||||
var
|
||||
AReportGenerator : TRptAlbaranesCliente;
|
||||
begin
|
||||
AReportGenerator := TRptAlbaranesCliente.Create(nil);
|
||||
try
|
||||
Result := AReportGenerator.GenerarReportEnPDF(ListaID, ShowLogotipo);
|
||||
finally
|
||||
FreeAndNIL(AReportGenerator);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TsrvAlbaranesCliente.GenerateEtiquetas(const ID: Integer; const withRefCliente: Boolean): Binary;
|
||||
var
|
||||
AReportGenerator : TRptAlbaranesCliente;
|
||||
|
||||
@ -100,7 +100,8 @@ requires
|
||||
Inventario_controller,
|
||||
JSDialog100,
|
||||
PedCli_AlbCli_relation,
|
||||
AlbCli_FacCli_relation;
|
||||
AlbCli_FacCli_relation,
|
||||
dxGDIPlusD10;
|
||||
|
||||
contains
|
||||
uAlbaranesClienteViewRegister in 'uAlbaranesClienteViewRegister.pas',
|
||||
@ -117,6 +118,7 @@ contains
|
||||
uEditorAlbaranesDevCliente in 'uEditorAlbaranesDevCliente.pas' {fEditorAlbaranesDevCliente: TCustomEditor},
|
||||
uViewAlbaranesDevCliente in 'uViewAlbaranesDevCliente.pas' {frViewAlbaranesDevCliente: TCustomView},
|
||||
uEditorAlbaranDevCliente in 'uEditorAlbaranDevCliente.pas' {fEditorAlbaranDevCliente: TCustomEditor},
|
||||
uViewAlbaranDevCliente in 'uViewAlbaranDevCliente.pas' {frViewAlbaranDevCliente: TCustomView};
|
||||
uViewAlbaranDevCliente in 'uViewAlbaranDevCliente.pas' {frViewAlbaranDevCliente: TCustomView},
|
||||
uDialogListaAlbaranesCliEnvioEMail in 'uDialogListaAlbaranesCliEnvioEMail.pas' {fDialogListaAlbaranesCliEnvioEMail: TCustomEditor};
|
||||
|
||||
end.
|
||||
|
||||
@ -10,7 +10,8 @@ implementation
|
||||
uses
|
||||
uEditorRegistryUtils, uEditorAlbaranesCliente, uEditorAlbaranCliente,
|
||||
uEditorElegirArticulosAlbaranCliente, uEditorAlbaranesClienteReport,
|
||||
uEditorElegirAlbaranesCliente, uEditorAlbaranesDevCliente, uEditorAlbaranDevCliente;
|
||||
uEditorElegirAlbaranesCliente, uEditorAlbaranesDevCliente, uEditorAlbaranDevCliente,
|
||||
uDialogListaAlbaranesCliEnvioEMail;
|
||||
|
||||
procedure RegisterViews;
|
||||
begin
|
||||
@ -21,6 +22,7 @@ begin
|
||||
EditorRegistry.RegisterClass(TfEditorElegirArticulosAlbaranCliente, 'EditorElegirArticulosAlbaranesCliente');
|
||||
EditorRegistry.RegisterClass(TfEditorAlbaranesClientePreview, 'EditorAlbaranesClientePreview');
|
||||
EditorRegistry.RegisterClass(TfEditorElegirAlbaranesCliente, 'EditorElegirAlbaranesCliente');
|
||||
EditorRegistry.RegisterClass(TfDialogListaAlbaranesCliEnvioEMail, 'DialogListaAlbaranesCliEnvioEMail');
|
||||
end;
|
||||
|
||||
procedure UnregisterViews;
|
||||
@ -32,6 +34,7 @@ begin
|
||||
EditorRegistry.UnRegisterClass(TfEditorElegirArticulosAlbaranCliente);
|
||||
EditorRegistry.UnRegisterClass(TfEditorAlbaranesClientePreview);
|
||||
EditorRegistry.UnRegisterClass(TfEditorElegirAlbaranesCliente);
|
||||
EditorRegistry.UnRegisterClass(TfDialogListaAlbaranesCliEnvioEMail);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -0,0 +1,89 @@
|
||||
inherited fDialogListaAlbaranesCliEnvioEMail: TfDialogListaAlbaranesCliEnvioEMail
|
||||
Caption = 'Enviar albaranes por correo electr'#243'nico'
|
||||
ClientHeight = 432
|
||||
ClientWidth = 735
|
||||
ExplicitWidth = 741
|
||||
ExplicitHeight = 457
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
inherited pnlBotones: TFlowPanel
|
||||
Top = 376
|
||||
Width = 735
|
||||
ExplicitTop = 382
|
||||
ExplicitWidth = 735
|
||||
inherited Button1: TButton
|
||||
Left = 639
|
||||
Caption = '&Salir'
|
||||
ExplicitLeft = 639
|
||||
end
|
||||
inherited Button2: TButton
|
||||
Left = 528
|
||||
Width = 96
|
||||
ExplicitLeft = 528
|
||||
ExplicitWidth = 96
|
||||
end
|
||||
end
|
||||
inherited FlowPanel1: TFlowPanel
|
||||
Width = 735
|
||||
Height = 376
|
||||
ExplicitWidth = 735
|
||||
ExplicitHeight = 376
|
||||
inherited lblInstruccion: TLabel
|
||||
Width = 320
|
||||
Caption = 'Enviar albaranes por correo electr'#243'nico'
|
||||
Font.Style = [fsBold]
|
||||
ExplicitWidth = 320
|
||||
end
|
||||
inherited Label2: TLabel
|
||||
Height = 51
|
||||
Caption =
|
||||
'Se generar'#225'n correos electr'#243'nicos autom'#225'ticos adjuntando los alb' +
|
||||
'aranes elegidos en formato PDF. S'#243'lo se tendr'#225'n en cuenta los cl' +
|
||||
'ientes que tengan relleno su e-mail administrativo.'
|
||||
WordWrap = True
|
||||
ExplicitHeight = 51
|
||||
end
|
||||
inherited ListView1: TListView
|
||||
Top = 121
|
||||
Width = 658
|
||||
Height = 232
|
||||
Columns = <
|
||||
item
|
||||
Caption = 'Documento'
|
||||
MaxWidth = 75
|
||||
MinWidth = 75
|
||||
Width = 75
|
||||
end
|
||||
item
|
||||
Caption = 'Destinatario'
|
||||
MaxWidth = 300
|
||||
Width = 280
|
||||
end
|
||||
item
|
||||
Caption = 'Direcci'#243'n E-Mail'
|
||||
MaxWidth = 250
|
||||
Width = 150
|
||||
end
|
||||
item
|
||||
Caption = 'Estado'
|
||||
MaxWidth = 250
|
||||
Width = 149
|
||||
end>
|
||||
ExplicitTop = 121
|
||||
ExplicitWidth = 658
|
||||
ExplicitHeight = 232
|
||||
end
|
||||
end
|
||||
inherited ActionList1: TActionList
|
||||
Left = 8
|
||||
Top = 352
|
||||
inherited actAceptar: TAction
|
||||
Caption = '&Generar correos'
|
||||
OnExecute = actAceptarExecute
|
||||
OnUpdate = actAceptarUpdate
|
||||
end
|
||||
inherited actCancelar: TAction
|
||||
OnExecute = actCancelarExecute
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -0,0 +1,166 @@
|
||||
unit uDialogListaAlbaranesCliEnvioEMail;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, uDialogBase, ActnList, StdCtrls, ExtCtrls, ComCtrls,
|
||||
uDialogListaEnvioEMail, uIDialogListaAlbaranesCliEnvioEMail, uAlbaranesClienteController,
|
||||
uBizAlbaranesCliente;
|
||||
|
||||
type
|
||||
TfDialogListaAlbaranesCliEnvioEMail = class(TfDialogListaEnvioEMail, IDialogListaAlbaranesCliEnvioEMail)
|
||||
procedure actCancelarExecute(Sender: TObject);
|
||||
procedure actAceptarUpdate(Sender: TObject);
|
||||
procedure actAceptarExecute(Sender: TObject);
|
||||
private
|
||||
FAlbaranes : IBizAlbaranCliente;
|
||||
FController : IAlbaranesClienteController;
|
||||
protected
|
||||
function GetAlbaranes: IBizAlbaranCliente;
|
||||
procedure SetAlbaranes(const Value: IBizAlbaranCliente);
|
||||
|
||||
procedure RellenarLista;
|
||||
procedure BorrarLista;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
property Albaranes: IBizAlbaranCliente read GetAlbaranes write SetAlbaranes;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
schAlbaranesClienteClient_Intf, uStringsUtils, cxControls;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
|
||||
{ TfDialogListaAlbaranesEnvioEMail }
|
||||
|
||||
procedure TfDialogListaAlbaranesCliEnvioEMail.actAceptarExecute(Sender: TObject);
|
||||
var
|
||||
i : Integer;
|
||||
begin
|
||||
ShowHourglassCursor;
|
||||
Application.ProcessMessages;
|
||||
try
|
||||
FAlbaranes.First;
|
||||
FController.RecuperarCliente(FAlbaranes);
|
||||
FAlbaranes.Cliente.DataTable.Active := True;
|
||||
try
|
||||
for i := 0 to FAlbaranes.DataTable.RecordCount - 1 do
|
||||
begin
|
||||
if not EsCadenaVacia(FAlbaranes.Cliente.EMAIL_ADMINISTRACION) then
|
||||
begin
|
||||
if FController.EnviarAlbaranPorEMail(FAlbaranes, True, FAlbaranes.Cliente.EMAIL_ADMINISTRACION) then
|
||||
begin
|
||||
ListView1.Items[i].SubItems[2] := 'Correo generado';
|
||||
ModalResult := mrOk;
|
||||
end
|
||||
else
|
||||
ListView1.Items[i].SubItems[2] := 'Error al generar correo';
|
||||
Self.Update;
|
||||
Application.ProcessMessages;
|
||||
end;
|
||||
|
||||
FAlbaranes.Next;
|
||||
FController.RecuperarCliente(FAlbaranes);
|
||||
FAlbaranes.Cliente.DataTable.Active := True;
|
||||
end;
|
||||
Button2.Enabled := False;
|
||||
finally
|
||||
ListView1.Items.EndUpdate;
|
||||
end;
|
||||
finally
|
||||
HideHourglassCursor;
|
||||
end;
|
||||
|
||||
Button1.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TfDialogListaAlbaranesCliEnvioEMail.actAceptarUpdate(Sender: TObject);
|
||||
begin
|
||||
inherited;
|
||||
(Sender as TAction).Enabled := (ListView1.Items.Count > 0)
|
||||
end;
|
||||
|
||||
procedure TfDialogListaAlbaranesCliEnvioEMail.actCancelarExecute(Sender: TObject);
|
||||
begin
|
||||
inherited;
|
||||
ModalResult := mrOk;
|
||||
end;
|
||||
|
||||
procedure TfDialogListaAlbaranesCliEnvioEMail.BorrarLista;
|
||||
begin
|
||||
ListView1.Items.Clear;
|
||||
end;
|
||||
|
||||
constructor TfDialogListaAlbaranesCliEnvioEMail.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited;
|
||||
ModalResult := mrCancel;
|
||||
FController := TAlbaranesClienteController.Create;
|
||||
end;
|
||||
|
||||
function TfDialogListaAlbaranesCliEnvioEMail.GetAlbaranes: IBizAlbaranCliente;
|
||||
begin
|
||||
Result := FAlbaranes;
|
||||
end;
|
||||
|
||||
procedure TfDialogListaAlbaranesCliEnvioEMail.RellenarLista;
|
||||
var
|
||||
i : Integer;
|
||||
begin
|
||||
ListView1.Items.BeginUpdate;
|
||||
ListView1.Items.Clear;
|
||||
|
||||
FAlbaranes.First;
|
||||
FAlbaranes.DataTable.DisableControls;
|
||||
try
|
||||
for i := 0 to FAlbaranes.DataTable.RecordCount - 1 do
|
||||
begin
|
||||
FController.RecuperarCliente(FAlbaranes);
|
||||
FAlbaranes.Cliente.DataTable.Active := True;
|
||||
|
||||
with ListView1.Items.Add do
|
||||
begin
|
||||
Caption := FAlbaranes.REFERENCIA;
|
||||
SubItems.Add(FAlbaranes.NOMBRE);
|
||||
SubItems.Add(FAlbaranes.Cliente.EMAIL_ADMINISTRACION);
|
||||
|
||||
if EsCadenaVacia(FAlbaranes.Cliente.EMAIL_ADMINISTRACION) then
|
||||
SubItems.Add('Sin dirección e-mail administrativa')
|
||||
else
|
||||
SubItems.Add('')
|
||||
end;
|
||||
FAlbaranes.Next;
|
||||
end;
|
||||
finally
|
||||
FAlbaranes.DataTable.EnableControls;
|
||||
ListView1.Items.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfDialogListaAlbaranesCliEnvioEMail.SetAlbaranes(
|
||||
const Value: IBizAlbaranCliente);
|
||||
begin
|
||||
FAlbaranes := Value;
|
||||
|
||||
if Assigned(FAlbaranes) then
|
||||
begin
|
||||
FAlbaranes.DataTable.Open;
|
||||
|
||||
if (FAlbaranes.TIPO = CTE_TIPO_ALBARAN_DEV) then
|
||||
begin
|
||||
Self.Caption := 'Enviar órdenes de devolución por correo electrónico';
|
||||
lblInstruccion.Caption := 'Enviar órdenes de devolución por correo electrónico';
|
||||
Label2.Caption := 'Se generarán correos electrónicos automáticos adjuntando las órdenes de devolución elegidas en formato PDF. Sólo se tendrán en cuenta los clientes que tengan relleno su e-mail administrativo.';
|
||||
end;
|
||||
|
||||
RellenarLista;
|
||||
end
|
||||
else
|
||||
BorrarLista;
|
||||
end;
|
||||
|
||||
end.
|
||||
@ -9,7 +9,7 @@ inherited fEditorAlbaranesCliente: TfEditorAlbaranesCliente
|
||||
inherited JvNavPanelHeader: TJvNavPanelHeader
|
||||
Width = 855
|
||||
Caption = 'Lista de albaranes de cliente'
|
||||
ExplicitWidth = 583
|
||||
ExplicitWidth = 855
|
||||
inherited Image1: TImage
|
||||
Left = 828
|
||||
Picture.Data = {
|
||||
@ -124,11 +124,14 @@ inherited fEditorAlbaranesCliente: TfEditorAlbaranesCliente
|
||||
end
|
||||
inherited TBXDock: TTBXDock
|
||||
Width = 855
|
||||
ExplicitWidth = 583
|
||||
ExplicitWidth = 855
|
||||
inherited tbxMain: TTBXToolbar
|
||||
ExplicitWidth = 638
|
||||
ExplicitWidth = 746
|
||||
object TBXSeparatorItem17: TTBXSeparatorItem [10]
|
||||
end
|
||||
object TBXItem40: TTBXItem [14]
|
||||
Action = actEnviarEMail
|
||||
end
|
||||
end
|
||||
inherited tbxMenu: TTBXToolbar
|
||||
ExplicitWidth = 855
|
||||
@ -169,7 +172,8 @@ inherited fEditorAlbaranesCliente: TfEditorAlbaranesCliente
|
||||
inherited StatusBar: TJvStatusBar
|
||||
Top = 430
|
||||
Width = 855
|
||||
ExplicitWidth = 583
|
||||
ExplicitTop = 430
|
||||
ExplicitWidth = 855
|
||||
end
|
||||
inherited EditorActionList: TActionList
|
||||
inherited actNuevo: TAction
|
||||
@ -225,6 +229,12 @@ inherited fEditorAlbaranesCliente: TfEditorAlbaranesCliente
|
||||
ImageIndex = 23
|
||||
OnExecute = actGenerarOrdenExecute
|
||||
end
|
||||
object actEnviarEMail: TAction
|
||||
Category = 'Acciones'
|
||||
Caption = 'Enviar por e-mail...'
|
||||
OnExecute = actEnviarEMailExecute
|
||||
OnUpdate = actEnviarEMailUpdate
|
||||
end
|
||||
end
|
||||
inherited SmallImages: TPngImageList
|
||||
PngImages = <
|
||||
|
||||
@ -38,6 +38,8 @@ type
|
||||
JsListaAlbaranesNoEliminados: TJSDialog;
|
||||
actGenerarOrden: TAction;
|
||||
TBXItem39: TTBXItem;
|
||||
actEnviarEMail: TAction;
|
||||
TBXItem40: TTBXItem;
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure actGenerarFacturaUpdate(Sender: TObject);
|
||||
procedure actGenerarFacturaExecute(Sender: TObject);
|
||||
@ -51,6 +53,8 @@ type
|
||||
procedure actGenerarEtiquetasExecute(Sender: TObject);
|
||||
procedure actGenerarEtiquetasUpdate(Sender: TObject);
|
||||
procedure actGenerarOrdenExecute(Sender: TObject);
|
||||
procedure actEnviarEMailExecute(Sender: TObject);
|
||||
procedure actEnviarEMailUpdate(Sender: TObject);
|
||||
|
||||
protected
|
||||
FAlbaranes: IBizAlbaranCliente;
|
||||
@ -88,7 +92,7 @@ uses
|
||||
uBizPedidosCliente, uDialogUtils, schAlbaranesClienteClient_Intf,
|
||||
uFacturasClienteController, uBizFacturasCliente, uInventarioController,
|
||||
uEditorBase, uGenerarAlbaranesCliUtils, uGenerarFacturasCliAlbCliUtils,
|
||||
cxCustomData, uGridUtils, uDBSelectionListUtils;
|
||||
cxCustomData, uGridUtils, uDBSelectionListUtils, cxControls;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
@ -196,6 +200,40 @@ begin
|
||||
FController.GenerarOrdenDev(Albaranes);
|
||||
end;
|
||||
|
||||
procedure TfEditorAlbaranesCliente.actEnviarEMailExecute(Sender: TObject);
|
||||
var
|
||||
AAlbaranes : IBizAlbaranCliente;
|
||||
begin
|
||||
inherited;
|
||||
|
||||
if ViewGrid.NumSeleccionados = 1 then
|
||||
FController.GenerarEmailAlbaran(Albaranes)
|
||||
else begin
|
||||
ShowHourglassCursor;
|
||||
try
|
||||
SeleccionarFilasDesdeGrid(ViewGrid._FocusedView, (Albaranes as ISeleccionable).SelectedRecords);
|
||||
AAlbaranes := (Controller as IAlbaranesClienteController).ExtraerSeleccionados(Albaranes, ViewGrid) as IBizAlbaranCliente;
|
||||
|
||||
if Assigned(AAlbaranes) then
|
||||
if FController.EnviarEmailAlbaranes(AAlbaranes) then
|
||||
RefrescarInterno;
|
||||
finally
|
||||
AAlbaranes := NIL;
|
||||
HideHourglassCursor;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfEditorAlbaranesCliente.actEnviarEMailUpdate(Sender: TObject);
|
||||
begin
|
||||
inherited;
|
||||
if HayDatos and Assigned(ViewGrid) then
|
||||
(Sender as TAction).Enabled := ViewGrid.esSeleccionCeldaDatos
|
||||
and (ViewGrid.NumSeleccionados > 0)
|
||||
else
|
||||
(Sender as TAction).Enabled := False;
|
||||
end;
|
||||
|
||||
procedure TfEditorAlbaranesCliente.actEnviarExecute(Sender: TObject);
|
||||
var
|
||||
AInventarioController : IInventarioController;
|
||||
|
||||
@ -1043,13 +1043,14 @@ object RptAlbaranesProveedor: TRptAlbaranesProveedor
|
||||
Top = 158
|
||||
end
|
||||
object frxReport: TfrxReport
|
||||
Version = '3.23.7'
|
||||
Version = '4.3'
|
||||
DotMatrixReport = False
|
||||
EngineOptions.DoublePass = True
|
||||
IniFile = '\Software\Fast Reports'
|
||||
PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator, pbExportQuick]
|
||||
PreviewOptions.Zoom = 1.000000000000000000
|
||||
PrintOptions.Printer = 'Por defecto'
|
||||
PrintOptions.PrintOnSheet = 0
|
||||
ReportOptions.CreateDate = 39065.872423495400000000
|
||||
ReportOptions.LastChange = 39290.783958333330000000
|
||||
ScriptLanguage = 'PascalScript'
|
||||
@ -1157,29 +1158,6 @@ object RptAlbaranesProveedor: TRptAlbaranesProveedor
|
||||
OnStartReport = 'frxReportOnStartReport'
|
||||
Left = 169
|
||||
Top = 16
|
||||
Datasets = <
|
||||
item
|
||||
DataSet = frxDBCabecera
|
||||
DataSetName = 'frxDBCabecera'
|
||||
end
|
||||
item
|
||||
DataSet = frxDBDetalles
|
||||
DataSetName = 'frxDBDetalles'
|
||||
end>
|
||||
Variables = <
|
||||
item
|
||||
Name = ' Paginacion'
|
||||
Value = Null
|
||||
end
|
||||
item
|
||||
Name = 'TotalPaginas'
|
||||
Value = Null
|
||||
end
|
||||
item
|
||||
Name = 'Pagina'
|
||||
Value = Null
|
||||
end>
|
||||
Style = <>
|
||||
end
|
||||
object frxDBCabecera: TfrxDBDataset
|
||||
UserName = 'frxDBCabecera'
|
||||
|
||||
@ -32,7 +32,7 @@ type
|
||||
private
|
||||
FConnection: IDAConnection;
|
||||
//Genera cada uno de los albaranes a imprimir
|
||||
procedure GenerarAlbaran(const ID: integer); overload;
|
||||
procedure _GenerarAlbaran(const ID: integer); overload;
|
||||
public
|
||||
function GenerarAlbaran(const AID : String): Binary; overload;
|
||||
end;
|
||||
@ -68,30 +68,27 @@ var
|
||||
i: Integer;
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
FConnection.BeginTransaction;
|
||||
|
||||
try
|
||||
ID_Albaranes := TStringList.Create;
|
||||
ID_Albaranes.CommaText := AID;
|
||||
|
||||
//Vamos generando todos y cada uno de los albaranes recibidos
|
||||
for i := 0 to ID_Albaranes.Count - 1 do
|
||||
GenerarAlbaran(StrToInt(ID_Albaranes.Strings[i]));
|
||||
_GenerarAlbaran(StrToInt(ID_Albaranes.Strings[i]));
|
||||
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
|
||||
finally
|
||||
FConnection.RollbackTransaction;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRptAlbaranesProveedor.GenerarAlbaran(const ID: integer);
|
||||
procedure TRptAlbaranesProveedor._GenerarAlbaran(const ID: integer);
|
||||
var
|
||||
AStream: TMemoryStream;
|
||||
dsMaster: IDADataset;
|
||||
dsDetail: IDADataset;
|
||||
begin
|
||||
AStream := TMemoryStream.Create;
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
|
||||
try
|
||||
dsMaster := schReport.NewDataset(FConnection, ds_InformeCabecera, ['ID'], [ID]);
|
||||
@ -109,6 +106,7 @@ begin
|
||||
frxReport.PrepareReport(False);
|
||||
|
||||
finally
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
AStream.Free;
|
||||
dsMaster := Nil;
|
||||
dsDetail := Nil;
|
||||
|
||||
@ -112,13 +112,11 @@ type
|
||||
|
||||
function EnviarEmailFacturas(AFacturas : IBizFacturaCliente): Boolean;
|
||||
function GenerarEmailFactura(AFactura : IBizFacturaCliente): Boolean;
|
||||
|
||||
function EnviarFacturaPorEMail(AFactura: IBizFacturaCliente;
|
||||
const AEnviarDirectamente: Boolean = True;
|
||||
const ADireccionEMail: String = ''; const AAsuntoEMail: String = '';
|
||||
const ATextoEMail: String = ''): Boolean;
|
||||
|
||||
|
||||
procedure RecalcularImportes(AFactura: IBizFacturaCliente);
|
||||
function EsModificable(AFactura: IBizFacturaCliente): Boolean;
|
||||
function EsEliminable(AFactura: IBizFacturaCliente): Boolean;
|
||||
|
||||
@ -8,7 +8,9 @@
|
||||
<Option Name="GUID">{31F77077-B4B9-443C-9AA9-F13B4EB640B4}</Option>
|
||||
</Option>
|
||||
</PersonalityInfo>
|
||||
<Default.Personality> <Projects>
|
||||
<Default.Personality>
|
||||
|
||||
<Projects>
|
||||
<Projects Name="Base.bpl">..\..\Base\Base.bdsproj</Projects>
|
||||
<Projects Name="ControllerBase.bpl">..\..\Base\ControllerBase\ControllerBase.bdsproj</Projects>
|
||||
<Projects Name="GUIBase.bpl">..\..\Base\GUIBase\GUIBase.bdsproj</Projects>
|
||||
@ -28,14 +30,10 @@
|
||||
<Projects Name="FactuGES.exe">..\..\Cliente\FactuGES.bdsproj</Projects>
|
||||
<Projects Name="FactuGES_Server.exe">..\..\Servidor\FactuGES_Server.bdsproj</Projects>
|
||||
<Projects Name="AlbaranesCliente_controller.bpl">..\Albaranes de cliente\Controller\AlbaranesCliente_controller.bdsproj</Projects>
|
||||
<Projects Name="PedidosCliente_model.bpl">..\Pedidos de cliente\Model\PedidosCliente_model.bdsproj</Projects>
|
||||
<Projects Name="FacturasProveedor_view.bpl">..\Facturas de proveedor\Views\FacturasProveedor_view.bdsproj</Projects>
|
||||
<Projects Name="FormasPago_model.bpl">..\Formas de pago\Model\FormasPago_model.bdsproj</Projects>
|
||||
<Projects Name="FormasPago_data.bpl">..\Formas de pago\Data\FormasPago_data.bdsproj</Projects>
|
||||
<Projects Name="FormasPago_controller.bpl">..\Formas de pago\Controller\FormasPago_controller.bdsproj</Projects>
|
||||
<Projects Name="FormasPago_view.bpl">..\Formas de pago\Views\FormasPago_view.bdsproj</Projects>
|
||||
<Projects Name="FormasPago_plugin.bpl">..\Formas de pago\Plugin\FormasPago_plugin.bdsproj</Projects>
|
||||
<Projects Name="Targets">Base.bpl ControllerBase.bpl GUIBase.bpl Contactos_model.bpl Contactos_data.bpl Contactos_controller.bpl Articulos_model.bpl Articulos_data.bpl Articulos_controller.bpl Contactos_view.bpl Articulos_view.bpl FacturasCliente_model.bpl FacturasCliente_data.bpl FacturasCliente_controller.bpl AlbCli_FacCli_relation.bpl FacturasCliente_view.bpl FactuGES.exe FactuGES_Server.exe AlbaranesCliente_controller.bpl PedidosCliente_model.bpl FacturasProveedor_view.bpl FormasPago_model.bpl FormasPago_data.bpl FormasPago_controller.bpl FormasPago_view.bpl FormasPago_plugin.bpl</Projects>
|
||||
<Projects Name="PedidosCliente_view.bpl">..\Pedidos de cliente\Views\PedidosCliente_view.bdsproj</Projects>
|
||||
<Projects Name="PedidosCliente_controller.bpl">..\Pedidos de cliente\Controller\PedidosCliente_controller.bdsproj</Projects>
|
||||
<Projects Name="Targets">Base.bpl ControllerBase.bpl GUIBase.bpl Contactos_model.bpl Contactos_data.bpl Contactos_controller.bpl Articulos_model.bpl Articulos_data.bpl Articulos_controller.bpl Contactos_view.bpl Articulos_view.bpl FacturasCliente_model.bpl FacturasCliente_data.bpl FacturasCliente_controller.bpl AlbCli_FacCli_relation.bpl FacturasCliente_view.bpl FactuGES.exe FactuGES_Server.exe AlbaranesCliente_controller.bpl FacturasProveedor_view.bpl PedidosCliente_view.bpl PedidosCliente_controller.bpl</Projects>
|
||||
</Projects>
|
||||
<Dependencies/>
|
||||
</Default.Personality>
|
||||
|
||||
@ -41,7 +41,7 @@ type
|
||||
procedure _GenerarFactura(const ID: Integer);
|
||||
public
|
||||
function GenerarFactura(const ListaID : TIntegerArray;
|
||||
const AConLogotipo: Boolean = False): Binary;
|
||||
const AConLogotipo: Boolean = False): Binary;
|
||||
function GenerarFacturaEnPDF(const ListaID : TIntegerArray;
|
||||
const AConLogotipo: Boolean = False): Binary;
|
||||
end;
|
||||
@ -105,6 +105,7 @@ var
|
||||
dsVencimientos : IDADataset;
|
||||
begin
|
||||
AStream := TMemoryStream.Create;
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
|
||||
try
|
||||
dsMaster := schReport.NewDataset(FConnection, ds_InformeFacturasCliente, ['ID'], [ID]);
|
||||
@ -128,6 +129,7 @@ begin
|
||||
frxReport.PrepareReport(False);
|
||||
|
||||
finally
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
AStream.Free;
|
||||
dsMaster := Nil;
|
||||
dsDetail := Nil;
|
||||
@ -148,8 +150,6 @@ var
|
||||
begin
|
||||
FShowLogotipo := AConLogotipo;
|
||||
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
|
||||
@ -157,7 +157,6 @@ begin
|
||||
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
finally
|
||||
//FConnection.RollbackTransaction; <--- Creo que no va a hacer falta.
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -168,8 +167,6 @@ var
|
||||
begin
|
||||
FShowLogotipo := AConLogotipo;
|
||||
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
|
||||
@ -178,7 +175,6 @@ begin
|
||||
frxPDFExport1.Stream := Result;
|
||||
frxReport.Export(frxPDFExport1)
|
||||
finally
|
||||
//FConnection.RollbackTransaction; <--- Creo que no va a hacer falta.
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
@ -1,24 +1,29 @@
|
||||
inherited fDialogListaFacturasEnvioEMail: TfDialogListaFacturasEnvioEMail
|
||||
Caption = 'Enviar facturas por correo electr'#243'nico'
|
||||
ClientHeight = 432
|
||||
ExplicitWidth = 629
|
||||
ClientWidth = 735
|
||||
ExplicitWidth = 741
|
||||
ExplicitHeight = 457
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
inherited pnlBotones: TFlowPanel
|
||||
Top = 376
|
||||
Width = 735
|
||||
ExplicitTop = 376
|
||||
inherited Button1: TButton
|
||||
Left = 639
|
||||
Caption = '&Salir'
|
||||
ExplicitLeft = 639
|
||||
end
|
||||
inherited Button2: TButton
|
||||
Left = 416
|
||||
Left = 528
|
||||
Width = 96
|
||||
ExplicitLeft = 416
|
||||
ExplicitLeft = 528
|
||||
ExplicitWidth = 96
|
||||
end
|
||||
end
|
||||
inherited FlowPanel1: TFlowPanel
|
||||
Width = 735
|
||||
Height = 376
|
||||
ExplicitHeight = 376
|
||||
inherited lblInstruccion: TLabel
|
||||
@ -38,6 +43,7 @@ inherited fDialogListaFacturasEnvioEMail: TfDialogListaFacturasEnvioEMail
|
||||
end
|
||||
inherited ListView1: TListView
|
||||
Top = 121
|
||||
Width = 658
|
||||
Height = 232
|
||||
Columns = <
|
||||
item
|
||||
@ -58,10 +64,11 @@ inherited fDialogListaFacturasEnvioEMail: TfDialogListaFacturasEnvioEMail
|
||||
end
|
||||
item
|
||||
Caption = 'Estado'
|
||||
MaxWidth = 200
|
||||
Width = 100
|
||||
MaxWidth = 250
|
||||
Width = 149
|
||||
end>
|
||||
ExplicitTop = 121
|
||||
ExplicitWidth = 658
|
||||
ExplicitHeight = 232
|
||||
end
|
||||
end
|
||||
|
||||
@ -45,22 +45,27 @@ begin
|
||||
Application.ProcessMessages;
|
||||
try
|
||||
FFacturas.First;
|
||||
FController.RecuperarCliente(FFacturas);
|
||||
FFacturas.Cliente.DataTable.Active := True;
|
||||
try
|
||||
for i := 0 to FFacturas.DataTable.RecordCount - 1 do
|
||||
begin
|
||||
if EsCadenaVacia(FFacturas.Cliente.EMAIL_ADMINISTRACION) then
|
||||
Continue;
|
||||
|
||||
if FController.EnviarFacturaPorEMail(FFacturas, True, FFacturas.Cliente.EMAIL_ADMINISTRACION) then
|
||||
if not EsCadenaVacia(FFacturas.Cliente.EMAIL_ADMINISTRACION) then
|
||||
begin
|
||||
ListView1.Items[i].SubItems[2] := 'Correo generado';
|
||||
ModalResult := mrOk;
|
||||
end
|
||||
else
|
||||
ListView1.Items[i].SubItems[2] := 'Error al generar correo';
|
||||
Self.Update;
|
||||
Application.ProcessMessages;
|
||||
if FController.EnviarFacturaPorEMail(FFacturas, True, FFacturas.Cliente.EMAIL_ADMINISTRACION) then
|
||||
begin
|
||||
ListView1.Items[i].SubItems[2] := 'Correo generado';
|
||||
ModalResult := mrOk;
|
||||
end
|
||||
else
|
||||
ListView1.Items[i].SubItems[2] := 'Error al generar correo';
|
||||
Self.Update;
|
||||
Application.ProcessMessages;
|
||||
end;
|
||||
|
||||
FFacturas.Next;
|
||||
FController.RecuperarCliente(FFacturas);
|
||||
FFacturas.Cliente.DataTable.Active := True;
|
||||
end;
|
||||
Button2.Enabled := False;
|
||||
finally
|
||||
|
||||
@ -100,7 +100,8 @@ begin
|
||||
AFacturas := (Controller as IFacturasClienteController).ExtraerSeleccionados(Facturas, ViewGrid) as IBizFacturaCliente;
|
||||
|
||||
if Assigned(AFacturas) then
|
||||
FController.EnviarEmailFacturas(AFacturas);
|
||||
if FController.EnviarEmailFacturas(AFacturas) then
|
||||
RefrescarInterno;
|
||||
finally
|
||||
AFacturas := NIL;
|
||||
HideHourglassCursor;
|
||||
|
||||
@ -1178,7 +1178,7 @@ object RptFacturasProveedor: TRptFacturasProveedor
|
||||
Top = 158
|
||||
end
|
||||
object frxReport: TfrxReport
|
||||
Version = '3.23.7'
|
||||
Version = '4.3'
|
||||
DotMatrixReport = False
|
||||
EngineOptions.DoublePass = True
|
||||
IniFile = '\Software\Fast Reports'
|
||||
@ -1186,6 +1186,7 @@ object RptFacturasProveedor: TRptFacturasProveedor
|
||||
PreviewOptions.OutlineWidth = 180
|
||||
PreviewOptions.Zoom = 1.000000000000000000
|
||||
PrintOptions.Printer = 'Default'
|
||||
PrintOptions.PrintOnSheet = 0
|
||||
ReportOptions.CreateDate = 37871.995398692100000000
|
||||
ReportOptions.LastChange = 39465.864521631940000000
|
||||
ReportOptions.VersionBuild = '1'
|
||||
@ -1324,70 +1325,6 @@ object RptFacturasProveedor: TRptFacturasProveedor
|
||||
OnStartReport = 'frxReportOnStartReport'
|
||||
Left = 169
|
||||
Top = 16
|
||||
Datasets = <
|
||||
item
|
||||
DataSet = frxDBCabecera
|
||||
DataSetName = 'frxDBCabecera'
|
||||
end
|
||||
item
|
||||
DataSet = frxDBDetalles
|
||||
DataSetName = 'frxDBDetalles'
|
||||
end
|
||||
item
|
||||
DataSet = frxDBDataset1
|
||||
DataSetName = 'frxDBVencimientos'
|
||||
end>
|
||||
Variables = <
|
||||
item
|
||||
Name = ' Paginacion'
|
||||
Value = Null
|
||||
end
|
||||
item
|
||||
Name = 'Pagina'
|
||||
Value = Null
|
||||
end
|
||||
item
|
||||
Name = 'TotalPaginas'
|
||||
Value = Null
|
||||
end>
|
||||
Style = <
|
||||
item
|
||||
Name = 'Concepto normal'
|
||||
Color = clNone
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = 'Tahoma'
|
||||
Font.Style = []
|
||||
end
|
||||
item
|
||||
Name = 'Concepto subtotal'
|
||||
Color = clNone
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = 'Tahoma'
|
||||
Font.Style = [fsBold]
|
||||
end
|
||||
item
|
||||
Name = 'Cabecera de columna'
|
||||
Color = 15790320
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = 'Tahoma'
|
||||
Font.Style = [fsBold]
|
||||
Frame.Typ = [ftLeft, ftRight, ftTop, ftBottom]
|
||||
end
|
||||
item
|
||||
Name = 'Concepto titulo'
|
||||
Color = clNone
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = 'Tahoma'
|
||||
Font.Style = [fsBold]
|
||||
end>
|
||||
end
|
||||
object frxDBCabecera: TfrxDBDataset
|
||||
UserName = 'frxDBCabecera'
|
||||
|
||||
@ -34,7 +34,7 @@ type
|
||||
procedure DataModuleCreate(Sender: TObject);
|
||||
private
|
||||
FConnection: IDAConnection;
|
||||
procedure GenerarFactura(const AFacturaID: integer); overload;
|
||||
procedure _GenerarFactura(const AFacturaID: integer); overload;
|
||||
public
|
||||
function GenerarFactura(const AFacturaID : String): Binary; overload;
|
||||
end;
|
||||
@ -71,24 +71,20 @@ var
|
||||
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
FConnection.BeginTransaction;
|
||||
|
||||
try
|
||||
ID_Facturas := TStringList.Create;
|
||||
ID_Facturas.CommaText := AFacturaID;
|
||||
|
||||
//Vamos generando todos y cada uno de los albaranes recibidos
|
||||
for i := 0 to ID_Facturas.Count - 1 do
|
||||
GenerarFactura(StrToInt(ID_Facturas.Strings[i]));
|
||||
_GenerarFactura(StrToInt(ID_Facturas.Strings[i]));
|
||||
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
|
||||
finally
|
||||
FConnection.RollbackTransaction;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRptFacturasProveedor.GenerarFactura(const AFacturaID: integer);
|
||||
procedure TRptFacturasProveedor._GenerarFactura(const AFacturaID: integer);
|
||||
var
|
||||
AStream: TMemoryStream;
|
||||
dsMaster: IDADataset;
|
||||
@ -96,6 +92,7 @@ var
|
||||
dsVencimientos : IDADataset;
|
||||
begin
|
||||
AStream := TMemoryStream.Create;
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
|
||||
try
|
||||
dsMaster := schReport.NewDataset(FConnection, ds_InformeFacturasProveedor, ['ID'], [AFacturaID]);
|
||||
@ -119,6 +116,7 @@ begin
|
||||
frxReport.PrepareReport(False);
|
||||
|
||||
finally
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
AStream.Free;
|
||||
dsMaster := Nil;
|
||||
dsDetail := Nil;
|
||||
|
||||
@ -713,13 +713,14 @@ object RptPedidosProveedor: TRptPedidosProveedor
|
||||
Top = 158
|
||||
end
|
||||
object frxReport: TfrxReport
|
||||
Version = '3.23.7'
|
||||
Version = '4.3'
|
||||
DotMatrixReport = False
|
||||
EngineOptions.DoublePass = True
|
||||
IniFile = '\Software\Fast Reports'
|
||||
PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator, pbExportQuick]
|
||||
PreviewOptions.Zoom = 1.000000000000000000
|
||||
PrintOptions.Printer = 'Por defecto'
|
||||
PrintOptions.PrintOnSheet = 0
|
||||
ReportOptions.CreateDate = 39065.872423495400000000
|
||||
ReportOptions.LastChange = 39352.784043865700000000
|
||||
ScriptLanguage = 'PascalScript'
|
||||
@ -802,29 +803,6 @@ object RptPedidosProveedor: TRptPedidosProveedor
|
||||
OnStartReport = 'frxReportOnStartReport'
|
||||
Left = 169
|
||||
Top = 16
|
||||
Datasets = <
|
||||
item
|
||||
DataSet = frxDBCabecera
|
||||
DataSetName = 'frxDBCabecera'
|
||||
end
|
||||
item
|
||||
DataSet = frxDBDetalles
|
||||
DataSetName = 'frxDBDetalles'
|
||||
end>
|
||||
Variables = <
|
||||
item
|
||||
Name = ' Paginacion'
|
||||
Value = Null
|
||||
end
|
||||
item
|
||||
Name = 'TotalPaginas'
|
||||
Value = Null
|
||||
end
|
||||
item
|
||||
Name = 'Pagina'
|
||||
Value = Null
|
||||
end>
|
||||
Style = <>
|
||||
end
|
||||
object frxDBCabecera: TfrxDBDataset
|
||||
UserName = 'frxDBCabecera'
|
||||
@ -840,4 +818,18 @@ object RptPedidosProveedor: TRptPedidosProveedor
|
||||
Left = 344
|
||||
Top = 16
|
||||
end
|
||||
object frxPDFExport1: TfrxPDFExport
|
||||
ShowDialog = False
|
||||
UseFileCache = True
|
||||
ShowProgress = False
|
||||
PrintOptimized = True
|
||||
Outline = True
|
||||
Author = 'FactuGES'
|
||||
Subject = 'FactuGES'
|
||||
Background = False
|
||||
Creator = 'FactuGES'
|
||||
HTMLTags = True
|
||||
Left = 360
|
||||
Top = 344
|
||||
end
|
||||
end
|
||||
|
||||
@ -7,7 +7,7 @@ uses
|
||||
Dialogs, frxClass, frxDBSet, uDAScriptingProvider,
|
||||
uDADataTable, uDACDSDataTable, DB, uDAClasses, frxChart, frxGradient,
|
||||
frxChBox, frxCross, frxOLE, frxBarcode, frxRich, uDABINAdapter, uROTypes,
|
||||
uDAInterfaces;
|
||||
uDAInterfaces, FactuGES_Intf, frxExportPDF;
|
||||
|
||||
type
|
||||
TRptPedidosProveedor = class(TDataModule)
|
||||
@ -28,12 +28,14 @@ type
|
||||
frxReport: TfrxReport;
|
||||
schReport: TDASchema;
|
||||
DataDictionary: TDADataDictionary;
|
||||
frxPDFExport1: TfrxPDFExport;
|
||||
procedure DataModuleCreate(Sender: TObject);
|
||||
private
|
||||
FConnection: IDAConnection;
|
||||
procedure GenerarPedido(const AID : Integer); overload;
|
||||
procedure _GenerarPedido(const AID : Integer); overload;
|
||||
public
|
||||
function GenerarPedido(const AID : String): Binary; overload;
|
||||
function GenerarReportEnPDF(const ListaID : TIntegerArray): Binary; //const AConLogotipo: Boolean = False): Binary;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -58,7 +60,7 @@ procedure TRptPedidosProveedor.DataModuleCreate(Sender: TObject);
|
||||
begin
|
||||
schReport.ConnectionManager := dmServer.ConnectionManager;
|
||||
FConnection := dmServer.DarNuevaConexion;
|
||||
frxReport.EngineOptions.NewSilentMode := simReThrow;
|
||||
frxReport.EngineOptions.NewSilentMode := simReThrow;
|
||||
end;
|
||||
|
||||
function TRptPedidosProveedor.GenerarPedido(const AID: String): Binary;
|
||||
@ -68,30 +70,44 @@ var
|
||||
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
FConnection.BeginTransaction;
|
||||
|
||||
try
|
||||
ID_Pedidos := TStringList.Create;
|
||||
ID_Pedidos.CommaText := AID;
|
||||
|
||||
//Vamos generando todos y cada uno de los albaranes recibidos
|
||||
for i := 0 to ID_Pedidos.Count - 1 do
|
||||
GenerarPedido(StrToInt(ID_Pedidos.Strings[i]));
|
||||
_GenerarPedido(StrToInt(ID_Pedidos.Strings[i]));
|
||||
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
|
||||
finally
|
||||
FConnection.RollbackTransaction;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRptPedidosProveedor.GenerarPedido(const AID: Integer);
|
||||
function TRptPedidosProveedor.GenerarReportEnPDF(const ListaID: TIntegerArray): Binary; //; const AConLogotipo: Boolean): Binary;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
// FShowLogotipo := AConLogotipo;
|
||||
Result := Binary.Create;
|
||||
try
|
||||
//Vamos generando todos y cada uno de los presupuestos recibidos
|
||||
for i := 0 to ListaID.Count - 1 do
|
||||
_GenerarPedido(ListaID.Items[i]);
|
||||
|
||||
frxPDFExport1.Stream := Result;
|
||||
frxReport.Export(frxPDFExport1)
|
||||
finally
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRptPedidosProveedor._GenerarPedido(const AID: Integer);
|
||||
var
|
||||
AStream: TMemoryStream;
|
||||
dsMaster: IDADataset;
|
||||
dsDetail: IDADataset;
|
||||
begin
|
||||
AStream := TMemoryStream.Create;
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
|
||||
try
|
||||
dsMaster := schReport.NewDataset(FConnection, ds_InformeCabecera, ['ID'], [AID]);
|
||||
@ -109,6 +125,7 @@ begin
|
||||
frxReport.PrepareReport(False);
|
||||
|
||||
finally
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
AStream.Free;
|
||||
dsMaster := Nil;
|
||||
dsDetail := Nil;
|
||||
|
||||
@ -39,6 +39,7 @@ type
|
||||
{ IsrvPedidosProveedor methods }
|
||||
function GetNextAutoInc(const GeneratorName: String): Integer;
|
||||
function GenerateReport(const ID: String): Binary;
|
||||
function GenerarReportPDF(const ListaID: TIntegerArray; const ShowLogotipo: Boolean): Binary;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -84,6 +85,19 @@ begin
|
||||
bpPedidosProveedor.BusinessRulesID := BIZ_SERVER_PEDIDOS_PROVEEDOR;
|
||||
end;
|
||||
|
||||
function TsrvPedidosProveedor.GenerarReportPDF(const ListaID: TIntegerArray;
|
||||
const ShowLogotipo: Boolean): Binary;
|
||||
var
|
||||
AReportGenerator : TRptPedidosProveedor;
|
||||
begin
|
||||
AReportGenerator := TRptPedidosProveedor.Create(nil);
|
||||
try
|
||||
Result := AReportGenerator.GenerarReportEnPDF(ListaID); //, ShowLogotipo);
|
||||
finally
|
||||
FreeAndNIL(AReportGenerator);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TsrvPedidosProveedor.GenerateReport(const ID: String): Binary;
|
||||
var
|
||||
AReportGenerator : TRptPedidosProveedor;
|
||||
|
||||
@ -50,6 +50,7 @@ contains
|
||||
uIEditorElegirArticulosPedidosCliente in 'View\uIEditorElegirArticulosPedidosCliente.pas',
|
||||
uIEditorDireccionEntregaPedidoCliente in 'View\uIEditorDireccionEntregaPedidoCliente.pas',
|
||||
uPedidosClienteReportController in 'uPedidosClienteReportController.pas',
|
||||
uIEditorPedidosClientePreview in 'View\uIEditorPedidosClientePreview.pas';
|
||||
uIEditorPedidosClientePreview in 'View\uIEditorPedidosClientePreview.pas',
|
||||
uIDialogListaPedidosCliEnvioEMail in 'View\uIDialogListaPedidosCliEnvioEMail.pas';
|
||||
|
||||
end.
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
unit uIDialogListaPedidosCliEnvioEMail;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
uBizPedidosCliente, uPedidosClienteController;
|
||||
|
||||
type
|
||||
IDialogListaPedidosCliEnvioEMail = interface
|
||||
['{D51F7EC0-A75C-4BA9-9373-F1056F095B40}']
|
||||
function GetPedidos: IBizPedidoCliente;
|
||||
procedure SetPedidos(const Value: IBizPedidoCliente);
|
||||
property Pedidos: IBizPedidoCliente read GetPedidos write SetPedidos;
|
||||
function ShowModal : Integer;
|
||||
procedure Release;
|
||||
end;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
@ -52,6 +52,13 @@ type
|
||||
procedure Preview(APedido : IBizPedidoCliente; AllItems: Boolean = false);
|
||||
function Print(APedido : IBizPedidoCliente; AllItems: Boolean = false): Boolean;
|
||||
|
||||
function EnviarEmailPedidos(APedidos : IBizPedidoCliente): Boolean;
|
||||
function GenerarEmailPedido(APedido : IBizPedidoCliente): Boolean;
|
||||
function EnviarPedidoPorEMail(APedido: IBizPedidoCliente;
|
||||
const AEnviarDirectamente: Boolean = True;
|
||||
const ADireccionEMail: String = ''; const AAsuntoEMail: String = '';
|
||||
const ATextoEMail: String = ''): Boolean;
|
||||
|
||||
function ArticulosPendientes(const ID : Integer): IBizPedidoClienteArticulosPend;
|
||||
end;
|
||||
|
||||
@ -116,6 +123,13 @@ type
|
||||
procedure Preview(APedido : IBizPedidoCliente; AllItems: Boolean = false);
|
||||
function Print(APedido : IBizPedidoCliente; AllItems: Boolean = false): Boolean;
|
||||
|
||||
function EnviarEmailPedidos(APedidos : IBizPedidoCliente): Boolean;
|
||||
function GenerarEmailPedido(APedido : IBizPedidoCliente): Boolean;
|
||||
function EnviarPedidoPorEMail(APedido: IBizPedidoCliente;
|
||||
const AEnviarDirectamente: Boolean = True;
|
||||
const ADireccionEMail: String = ''; const AAsuntoEMail: String = '';
|
||||
const ATextoEMail: String = ''): Boolean;
|
||||
|
||||
function ArticulosPendientes(const ID : Integer): IBizPedidoClienteArticulosPend;
|
||||
end;
|
||||
|
||||
@ -127,7 +141,8 @@ uses
|
||||
uBizContactos, uDataTableUtils, uDataModuleUsuarios, Classes,
|
||||
schPedidosClienteClient_Intf, uDAInterfaces, uDateUtils, uIEditorPedidoCliente,
|
||||
uIEditorElegirPedidosCliente, uIEditorDireccionEntregaPedidoCliente,
|
||||
schContactosClient_Intf, uPedidosClienteReportController;
|
||||
schContactosClient_Intf, uPedidosClienteReportController, uIDialogListaPedidosCliEnvioEMail,
|
||||
uSistemaFunc, uStringsUtils, uDialogElegirEMail, Forms, uEMailUtils;
|
||||
|
||||
{ TPedidosClienteController }
|
||||
|
||||
@ -556,6 +571,98 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TPedidosClienteController.EnviarEmailPedidos(APedidos: IBizPedidoCliente): Boolean;
|
||||
var
|
||||
ADialog : IDialogListaPedidosCliEnvioEMail;
|
||||
ARespuesta : Integer;
|
||||
begin
|
||||
ADialog := NIL;
|
||||
|
||||
if not Assigned(APedidos) then
|
||||
raise Exception.Create ('Facturas no asignadas (EnviarPedidosCliPorEMail)');
|
||||
|
||||
if APedidos.DataTable.Active then
|
||||
APedidos.DataTable.Active := True;
|
||||
|
||||
ShowHourglassCursor;
|
||||
try
|
||||
CreateEditor('DialogListaPedidosCliEnvioEMail', IDialogListaPedidosCliEnvioEMail, ADialog);
|
||||
|
||||
if Assigned(ADialog) then
|
||||
begin
|
||||
try
|
||||
ADialog.Pedidos := APedidos;
|
||||
ARespuesta := ADialog.ShowModal;
|
||||
Result := (ARespuesta = mrOK)
|
||||
finally
|
||||
ADialog.Release;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
ADialog := NIL;
|
||||
HideHourglassCursor;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TPedidosClienteController.EnviarPedidoPorEMail(
|
||||
APedido: IBizPedidoCliente; const AEnviarDirectamente: Boolean;
|
||||
const ADireccionEMail, AAsuntoEMail, ATextoEMail: String): Boolean;
|
||||
var
|
||||
AReportController : IPedidosClienteReportController;
|
||||
AFicheroTMP : TFileName;
|
||||
AEMail : String;
|
||||
AAsunto : String;
|
||||
AListaEmail : TStringList;
|
||||
begin
|
||||
|
||||
if not Assigned(APedido) then
|
||||
raise Exception.Create ('Pedido no asignada (EnviarFacturaPorEMail)');
|
||||
|
||||
if APedido.DataTable.Active then
|
||||
APedido.DataTable.Active := True;
|
||||
|
||||
RecuperarCliente(APedido);
|
||||
APedido.Cliente.DataTable.Active := True;
|
||||
|
||||
AFicheroTMP := DarFicheroPDFTemporal(EscapeIllegalChars(APedido.REFERENCIA));
|
||||
|
||||
if not EsCadenaVacia(ADireccionEMail) then
|
||||
AEMail := ADireccionEMail
|
||||
else begin
|
||||
AListaEmail := TStringList.Create;
|
||||
try
|
||||
if not EsCadenaVacia(APedido.Cliente.EMAIL_ADMINISTRACION) then
|
||||
AListaEmail.Add(APedido.Cliente.EMAIL_ADMINISTRACION);
|
||||
|
||||
if not ElegirEMail(AListaEmail, AEMail) then
|
||||
Exit;
|
||||
finally
|
||||
FreeANDNIL(AListaEmail);
|
||||
end;
|
||||
end;
|
||||
|
||||
if not EsCadenaVacia(AAsuntoEMail) then
|
||||
AAsunto := AAsuntoEMail
|
||||
else
|
||||
AAsunto := 'Pedido ' + APedido.REFERENCIA;
|
||||
|
||||
ShowHourglassCursor;
|
||||
Application.ProcessMessages;
|
||||
|
||||
AReportController := TPedidosClienteReportController.Create;
|
||||
try
|
||||
AReportController.ExportToPDF(APedido.ID, AFicheroTMP);
|
||||
Result := EnviarEMailMAPI(AAsunto, ATextoEMail, AFicheroTMP, '', '', APedido.Cliente.NOMBRE, AEMail, AEnviarDirectamente);
|
||||
if Result then
|
||||
// _AnadirMarcaEnvioCorreo(APedido);
|
||||
finally
|
||||
SysUtils.DeleteFile(AFicheroTMP);
|
||||
AReportController := NIL;
|
||||
HideHourglassCursor;
|
||||
Application.ProcessMessages;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TPedidosClienteController.EsEliminable(APedido: IBizPedidoCliente): Boolean;
|
||||
begin
|
||||
if not Assigned(APedido) then
|
||||
@ -850,6 +957,23 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TPedidosClienteController.GenerarEmailPedido(APedido: IBizPedidoCliente): Boolean;
|
||||
begin
|
||||
if not Assigned(APedido) then
|
||||
raise Exception.Create ('Pedidos no asignadas (GenerarEmailPedido)');
|
||||
|
||||
if APedido.DataTable.Active then
|
||||
APedido.DataTable.Active := True;
|
||||
|
||||
ShowHourglassCursor;
|
||||
try
|
||||
RecuperarCliente(APedido);
|
||||
EnviarPedidoPorEMail(APedido, False, APedido.Cliente.EMAIL_ADMINISTRACION);
|
||||
finally
|
||||
HideHourglassCursor;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TPedidosClienteController.GetClienteController: IClientesController;
|
||||
begin
|
||||
Result := FClienteController;
|
||||
|
||||
@ -12,6 +12,7 @@ type
|
||||
['{D0686358-251C-43C4-9927-6112F2F4D3B8}']
|
||||
procedure Preview(const AID : String);
|
||||
function Print(const AID : String): Boolean;
|
||||
function ExportToPDF(const AID: Integer; const AFileName : String = ''): Boolean;
|
||||
end;
|
||||
|
||||
TPedidosClienteReportController = class(TInterfacedObject, IPedidosClienteReportController)
|
||||
@ -24,6 +25,7 @@ type
|
||||
|
||||
procedure Preview(const AID : String);
|
||||
function Print(const AID : String): Boolean;
|
||||
function ExportToPDF(const AID: Integer; const AFileName : String = ''): Boolean;
|
||||
end;
|
||||
|
||||
|
||||
@ -32,7 +34,7 @@ implementation
|
||||
uses
|
||||
uROTypes, uEditorRegistryUtils, uIEditorPedidosClientePreview,
|
||||
uEditorPreview, uDataModulePedidosCliente, uEditorBase, cxControls,
|
||||
schPedidosClienteClient_Intf;
|
||||
schPedidosClienteClient_Intf, uStringsUtils;
|
||||
|
||||
{ TPedidosClienteReportController }
|
||||
|
||||
@ -54,6 +56,29 @@ begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function TPedidosClienteReportController.ExportToPDF(const AID: Integer;
|
||||
const AFileName: String): Boolean;
|
||||
var
|
||||
AStream: Binary;
|
||||
begin
|
||||
Result := False;
|
||||
if EsCadenaVacia(AFileName) then
|
||||
Exit;
|
||||
|
||||
ShowHourglassCursor;
|
||||
try
|
||||
AStream := FDataModule.GetRptPDF(AID, True);
|
||||
try
|
||||
AStream.SaveToFile(AFileName);
|
||||
Result := True;
|
||||
finally
|
||||
FreeAndNil(AStream);
|
||||
end;
|
||||
finally
|
||||
HideHourglassCursor;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TPedidosClienteReportController.Preview(const AID : String);
|
||||
var
|
||||
AStream: Binary;
|
||||
|
||||
@ -45,8 +45,8 @@ type
|
||||
function NewItem : IBizPedidoCliente;
|
||||
|
||||
// Report
|
||||
// function GetReport(const AID: String): Binary;
|
||||
function GetReport(const AID: String; const ShowLogotipo: Boolean = False): Binary;
|
||||
function GetRptPDF(const AID: Integer; const ShowLogotipo: Boolean = False): Binary;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -88,6 +88,20 @@ begin
|
||||
Result := (RORemoteService as IsrvPedidosCliente).GenerateReport(AID, ShowLogotipo)
|
||||
end;
|
||||
|
||||
function TDataModulePedidosCliente.GetRptPDF(const AID: Integer;
|
||||
const ShowLogotipo: Boolean): Binary;
|
||||
var
|
||||
AParam : TIntegerArray;
|
||||
begin
|
||||
AParam := TIntegerArray.Create;
|
||||
try
|
||||
AParam.Add(AID);
|
||||
Result := (RORemoteService as IsrvPedidosCliente).GenerarReportPDF(AParam, ShowLogotipo)
|
||||
finally
|
||||
FreeANDNIL(AParam)
|
||||
end;
|
||||
end;
|
||||
|
||||
function TDataModulePedidosCliente.NewItem: IBizPedidoCliente;
|
||||
begin
|
||||
Result := GetItem(ID_NULO)
|
||||
|
||||
@ -9,6 +9,7 @@ type
|
||||
IDataModulePedidosClienteReport = interface
|
||||
['{70CEBB06-376F-4363-B80F-DDA4324E0F85}']
|
||||
function GetReport(const AID: String; const ShowLogotipo: Boolean = False): Binary;
|
||||
function GetRptPDF(const AID: Integer; const ShowLogotipo: Boolean = False): Binary;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
@ -8,7 +8,9 @@
|
||||
<Option Name="GUID">{31F77077-B4B9-443C-9AA9-F13B4EB640B4}</Option>
|
||||
</Option>
|
||||
</PersonalityInfo>
|
||||
<Default.Personality> <Projects>
|
||||
<Default.Personality>
|
||||
|
||||
<Projects>
|
||||
<Projects Name="Base.bpl">..\..\Base\Base.bdsproj</Projects>
|
||||
<Projects Name="ControllerBase.bpl">..\..\Base\ControllerBase\ControllerBase.bdsproj</Projects>
|
||||
<Projects Name="GUIBase.bpl">..\..\Base\GUIBase\GUIBase.bdsproj</Projects>
|
||||
@ -23,7 +25,10 @@
|
||||
<Projects Name="PedidosCliente_plugin.bpl">Plugin\PedidosCliente_plugin.bdsproj</Projects>
|
||||
<Projects Name="FactuGES_Server.exe">..\..\Servidor\FactuGES_Server.bdsproj</Projects>
|
||||
<Projects Name="FactuGES.exe">..\..\Cliente\FactuGES.bdsproj</Projects>
|
||||
<Projects Name="Targets">Base.bpl ControllerBase.bpl GUIBase.bpl Articulos_model.bpl Articulos_data.bpl Articulos_controller.bpl Articulos_view.bpl PedidosCliente_model.bpl PedidosCliente_data.bpl PedidosCliente_controller.bpl PedidosCliente_view.bpl PedidosCliente_plugin.bpl FactuGES_Server.exe FactuGES.exe</Projects>
|
||||
<Projects Name="FacturasCliente_view.bpl">..\Facturas de cliente\Views\FacturasCliente_view.bdsproj</Projects>
|
||||
<Projects Name="FacturasCliente_controller.bpl">..\Facturas de cliente\Controller\FacturasCliente_controller.bdsproj</Projects>
|
||||
<Projects Name="FacturasCliente_data.bpl">..\Facturas de cliente\Data\FacturasCliente_data.bdsproj</Projects>
|
||||
<Projects Name="Targets">Base.bpl ControllerBase.bpl GUIBase.bpl Articulos_model.bpl Articulos_data.bpl Articulos_controller.bpl Articulos_view.bpl PedidosCliente_model.bpl PedidosCliente_data.bpl PedidosCliente_controller.bpl PedidosCliente_view.bpl PedidosCliente_plugin.bpl FactuGES_Server.exe FactuGES.exe FacturasCliente_view.bpl FacturasCliente_controller.bpl FacturasCliente_data.bpl</Projects>
|
||||
</Projects>
|
||||
<Dependencies/>
|
||||
</Default.Personality>
|
||||
|
||||
@ -940,4 +940,18 @@ object RptPedidosCliente: TRptPedidosCliente
|
||||
Left = 344
|
||||
Top = 16
|
||||
end
|
||||
object frxPDFExport1: TfrxPDFExport
|
||||
ShowDialog = False
|
||||
UseFileCache = True
|
||||
ShowProgress = False
|
||||
PrintOptimized = True
|
||||
Outline = True
|
||||
Author = 'FactuGES'
|
||||
Subject = 'FactuGES'
|
||||
Background = False
|
||||
Creator = 'FactuGES'
|
||||
HTMLTags = True
|
||||
Left = 360
|
||||
Top = 344
|
||||
end
|
||||
end
|
||||
|
||||
@ -7,7 +7,7 @@ uses
|
||||
Dialogs, frxClass, frxDBSet, uDAScriptingProvider,
|
||||
uDADataTable, uDACDSDataTable, DB, uDAClasses, frxChart, frxGradient,
|
||||
frxChBox, frxCross, frxOLE, frxBarcode, frxRich, uDABINAdapter, uROTypes,
|
||||
uDAInterfaces;
|
||||
uDAInterfaces, FactuGES_Intf, frxExportPDF;
|
||||
|
||||
type
|
||||
TRptPedidosCliente = class(TDataModule)
|
||||
@ -28,14 +28,16 @@ type
|
||||
schReport: TDASchema;
|
||||
DataDictionary: TDADataDictionary;
|
||||
frxReport: TfrxReport;
|
||||
frxPDFExport1: TfrxPDFExport;
|
||||
procedure DataModuleCreate(Sender: TObject);
|
||||
procedure frxReportGetValue(const VarName: string; var Value: Variant);
|
||||
private
|
||||
FConnection: IDAConnection;
|
||||
FShowLogotipo: Boolean;
|
||||
procedure GenerarPedido(const AID : Integer); overload;
|
||||
FShowLogotipo: Boolean;
|
||||
procedure _GenerarPedido(const AID : Integer); overload;
|
||||
public
|
||||
function GenerarPedido(const AID : String; const AConLogotipo: Boolean = False): Binary; overload;
|
||||
function GenerarReportEnPDF(const ListaID : TIntegerArray; const AConLogotipo: Boolean = False): Binary;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -70,8 +72,6 @@ var
|
||||
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
FConnection.BeginTransaction;
|
||||
|
||||
try
|
||||
FShowLogotipo := AConLogotipo;
|
||||
ID_Pedidos := TStringList.Create;
|
||||
@ -79,12 +79,28 @@ begin
|
||||
|
||||
//Vamos generando todos y cada uno de los albaranes recibidos
|
||||
for i := 0 to ID_Pedidos.Count - 1 do
|
||||
GenerarPedido(StrToInt(ID_Pedidos.Strings[i]));
|
||||
_GenerarPedido(StrToInt(ID_Pedidos.Strings[i]));
|
||||
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
|
||||
finally
|
||||
FConnection.RollbackTransaction;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TRptPedidosCliente.GenerarReportEnPDF(const ListaID: TIntegerArray;
|
||||
const AConLogotipo: Boolean): Binary;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
FShowLogotipo := AConLogotipo;
|
||||
Result := Binary.Create;
|
||||
try
|
||||
//Vamos generando todos y cada uno de los presupuestos recibidos
|
||||
for i := 0 to ListaID.Count - 1 do
|
||||
_GenerarPedido(ListaID.Items[i]);
|
||||
|
||||
frxPDFExport1.Stream := Result;
|
||||
frxReport.Export(frxPDFExport1)
|
||||
finally
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -95,13 +111,14 @@ begin
|
||||
Value := FShowLogotipo;
|
||||
end;
|
||||
|
||||
procedure TRptPedidosCliente.GenerarPedido(const AID: Integer);
|
||||
procedure TRptPedidosCliente._GenerarPedido(const AID: Integer);
|
||||
var
|
||||
AStream: TMemoryStream;
|
||||
dsMaster: IDADataset;
|
||||
dsDetail: IDADataset;
|
||||
begin
|
||||
AStream := TMemoryStream.Create;
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
|
||||
try
|
||||
dsMaster := schReport.NewDataset(FConnection, ds_InformeCabecera, ['ID'], [AID]);
|
||||
@ -119,6 +136,7 @@ begin
|
||||
frxReport.PrepareReport(False);
|
||||
|
||||
finally
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
AStream.Free;
|
||||
dsMaster := Nil;
|
||||
dsDetail := Nil;
|
||||
|
||||
@ -39,6 +39,7 @@ type
|
||||
{ IsrvPedidosCliente methods }
|
||||
function GetNextAutoInc(const GeneratorName: String): Integer;
|
||||
function GenerateReport(const ID: String; const ShowLogotipo: Boolean): Binary;
|
||||
function GenerarReportPDF(const ListaID: TIntegerArray; const ShowLogotipo: Boolean): Binary;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -81,6 +82,19 @@ begin
|
||||
bpPedidosCliente.BusinessRulesID := BIZ_SERVER_PEDIDOS_CLIENTE;
|
||||
end;
|
||||
|
||||
function TsrvPedidosCliente.GenerarReportPDF(const ListaID: TIntegerArray;
|
||||
const ShowLogotipo: Boolean): Binary;
|
||||
var
|
||||
AReportGenerator : TRptPedidosCliente;
|
||||
begin
|
||||
AReportGenerator := TRptPedidosCliente.Create(nil);
|
||||
try
|
||||
Result := AReportGenerator.GenerarReportEnPDF(ListaID, ShowLogotipo);
|
||||
finally
|
||||
FreeAndNIL(AReportGenerator);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TsrvPedidosCliente.GenerateReport(const ID: String; const ShowLogotipo: Boolean): Binary;
|
||||
var
|
||||
AReportGenerator : TRptPedidosCliente;
|
||||
|
||||
@ -174,7 +174,7 @@
|
||||
<Excluded_Packages Name="c:\archivos de programa\borland\delphi10\Bin\dclIntraweb_80_100.bpl">Intraweb 8.0 Design Package for Borland Development Studio 2006</Excluded_Packages>
|
||||
</Excluded_Packages>
|
||||
</Delphi.Personality>
|
||||
<!-- EurekaLog First Line
|
||||
<!-- EurekaLog First Line
|
||||
[Exception Log]
|
||||
EurekaLog Version=519
|
||||
Activate=1
|
||||
|
||||
@ -95,7 +95,8 @@ requires
|
||||
FacturasCliente_model,
|
||||
FacturasCliente_controller,
|
||||
PedCli_PedProv_relation,
|
||||
PedCli_AlbCli_relation;
|
||||
PedCli_AlbCli_relation,
|
||||
dxGDIPlusD10;
|
||||
|
||||
contains
|
||||
uPedidosClienteViewRegister in 'uPedidosClienteViewRegister.pas',
|
||||
@ -108,6 +109,7 @@ contains
|
||||
uViewElegirArticulosPedidosCliente in 'uViewElegirArticulosPedidosCliente.pas' {frViewElegirArticulosPedidosCliente: TFrame},
|
||||
uEditorElegirArticulosPedidoCliente in 'uEditorElegirArticulosPedidoCliente.pas' {fEditorElegirArticulosPedidoCliente: TfEditorElegirArticulosPedidoCliente},
|
||||
uViewDireccionEntregaPedidoCliente in 'uViewDireccionEntregaPedidoCliente.pas' {frViewDireccionEntregaPedidoCliente: TFrame},
|
||||
uEditorPedidosClienteReport in 'uEditorPedidosClienteReport.pas' {fEditorPedidosClientePreview: TfEditorPedidosClientePreview};
|
||||
uEditorPedidosClienteReport in 'uEditorPedidosClienteReport.pas' {fEditorPedidosClientePreview: TfEditorPedidosClientePreview},
|
||||
uDialogListaPedidosCliEnvioEMail in 'uDialogListaPedidosCliEnvioEMail.pas' {fDialogListaPedidosCliEnvioEMail: TfDialogListaPedidosCliEnvioEMail};
|
||||
|
||||
end.
|
||||
|
||||
@ -0,0 +1,89 @@
|
||||
inherited fDialogListaPedidosCliEnvioEMail: TfDialogListaPedidosCliEnvioEMail
|
||||
Caption = 'Enviar pedidos por correo electr'#243'nico'
|
||||
ClientHeight = 432
|
||||
ClientWidth = 735
|
||||
ExplicitWidth = 741
|
||||
ExplicitHeight = 457
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
inherited pnlBotones: TFlowPanel
|
||||
Top = 376
|
||||
Width = 735
|
||||
ExplicitTop = 376
|
||||
ExplicitWidth = 735
|
||||
inherited Button1: TButton
|
||||
Left = 639
|
||||
Caption = '&Salir'
|
||||
ExplicitLeft = 639
|
||||
end
|
||||
inherited Button2: TButton
|
||||
Left = 528
|
||||
Width = 96
|
||||
ExplicitLeft = 528
|
||||
ExplicitWidth = 96
|
||||
end
|
||||
end
|
||||
inherited FlowPanel1: TFlowPanel
|
||||
Width = 735
|
||||
Height = 376
|
||||
ExplicitWidth = 735
|
||||
ExplicitHeight = 376
|
||||
inherited lblInstruccion: TLabel
|
||||
Width = 303
|
||||
Caption = 'Enviar pedidos por correo electr'#243'nico'
|
||||
Font.Style = [fsBold]
|
||||
ExplicitWidth = 303
|
||||
end
|
||||
inherited Label2: TLabel
|
||||
Height = 51
|
||||
Caption =
|
||||
'Se generar'#225'n correos electr'#243'nicos autom'#225'ticos adjuntando los ped' +
|
||||
'idos elegidos en formato PDF. S'#243'lo se tendr'#225'n en cuenta los clie' +
|
||||
'ntes que tengan relleno su e-mail administrativo.'
|
||||
WordWrap = True
|
||||
ExplicitHeight = 51
|
||||
end
|
||||
inherited ListView1: TListView
|
||||
Top = 121
|
||||
Width = 658
|
||||
Height = 232
|
||||
Columns = <
|
||||
item
|
||||
Caption = 'Documento'
|
||||
MaxWidth = 75
|
||||
MinWidth = 75
|
||||
Width = 75
|
||||
end
|
||||
item
|
||||
Caption = 'Destinatario'
|
||||
MaxWidth = 300
|
||||
Width = 280
|
||||
end
|
||||
item
|
||||
Caption = 'Direcci'#243'n E-Mail'
|
||||
MaxWidth = 250
|
||||
Width = 150
|
||||
end
|
||||
item
|
||||
Caption = 'Estado'
|
||||
MaxWidth = 250
|
||||
Width = 149
|
||||
end>
|
||||
ExplicitTop = 121
|
||||
ExplicitWidth = 658
|
||||
ExplicitHeight = 232
|
||||
end
|
||||
end
|
||||
inherited ActionList1: TActionList
|
||||
Left = 8
|
||||
Top = 352
|
||||
inherited actAceptar: TAction
|
||||
Caption = '&Generar correos'
|
||||
OnExecute = actAceptarExecute
|
||||
OnUpdate = actAceptarUpdate
|
||||
end
|
||||
inherited actCancelar: TAction
|
||||
OnExecute = actCancelarExecute
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -0,0 +1,158 @@
|
||||
unit uDialogListaPedidosCliEnvioEMail;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, uDialogBase, ActnList, StdCtrls, ExtCtrls, ComCtrls,
|
||||
uDialogListaEnvioEMail, uIDialogListaPedidosCliEnvioEMail, uPedidosClienteController,
|
||||
uBizPedidosCliente;
|
||||
|
||||
type
|
||||
TfDialogListaPedidosCliEnvioEMail = class(TfDialogListaEnvioEMail, IDialogListaPedidosCliEnvioEMail)
|
||||
procedure actCancelarExecute(Sender: TObject);
|
||||
procedure actAceptarUpdate(Sender: TObject);
|
||||
procedure actAceptarExecute(Sender: TObject);
|
||||
private
|
||||
FPedidos : IBizPedidoCliente;
|
||||
FController : IPedidosClienteController;
|
||||
protected
|
||||
function GetPedidos: IBizPedidoCliente;
|
||||
procedure SetPedidos(const Value: IBizPedidoCliente);
|
||||
|
||||
procedure RellenarLista;
|
||||
procedure BorrarLista;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
property Pedidos: IBizPedidoCliente read GetPedidos write SetPedidos;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
schPedidosClienteClient_Intf, uStringsUtils, cxControls;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
|
||||
{ TfDialogListaPedidosEnvioEMail }
|
||||
|
||||
procedure TfDialogListaPedidosCliEnvioEMail.actAceptarExecute(Sender: TObject);
|
||||
var
|
||||
i : Integer;
|
||||
begin
|
||||
ShowHourglassCursor;
|
||||
Application.ProcessMessages;
|
||||
try
|
||||
FPedidos.First;
|
||||
FController.RecuperarCliente(FPedidos);
|
||||
FPedidos.Cliente.DataTable.Active := True;
|
||||
try
|
||||
for i := 0 to FPedidos.DataTable.RecordCount - 1 do
|
||||
begin
|
||||
if not EsCadenaVacia(FPedidos.Cliente.EMAIL_ADMINISTRACION) then
|
||||
begin
|
||||
if FController.EnviarPedidoPorEMail(FPedidos, True, FPedidos.Cliente.EMAIL_ADMINISTRACION) then
|
||||
begin
|
||||
ListView1.Items[i].SubItems[2] := 'Correo generado';
|
||||
ModalResult := mrOk;
|
||||
end
|
||||
else
|
||||
ListView1.Items[i].SubItems[2] := 'Error al generar correo';
|
||||
Self.Update;
|
||||
Application.ProcessMessages;
|
||||
end;
|
||||
|
||||
FPedidos.Next;
|
||||
FController.RecuperarCliente(FPedidos);
|
||||
FPedidos.Cliente.DataTable.Active := True;
|
||||
end;
|
||||
Button2.Enabled := False;
|
||||
finally
|
||||
ListView1.Items.EndUpdate;
|
||||
end;
|
||||
finally
|
||||
HideHourglassCursor;
|
||||
end;
|
||||
|
||||
Button1.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TfDialogListaPedidosCliEnvioEMail.actAceptarUpdate(Sender: TObject);
|
||||
begin
|
||||
inherited;
|
||||
(Sender as TAction).Enabled := (ListView1.Items.Count > 0)
|
||||
end;
|
||||
|
||||
procedure TfDialogListaPedidosCliEnvioEMail.actCancelarExecute(Sender: TObject);
|
||||
begin
|
||||
inherited;
|
||||
ModalResult := mrOk;
|
||||
end;
|
||||
|
||||
procedure TfDialogListaPedidosCliEnvioEMail.BorrarLista;
|
||||
begin
|
||||
ListView1.Items.Clear;
|
||||
end;
|
||||
|
||||
constructor TfDialogListaPedidosCliEnvioEMail.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited;
|
||||
ModalResult := mrCancel;
|
||||
FController := TPedidosClienteController.Create;
|
||||
end;
|
||||
|
||||
function TfDialogListaPedidosCliEnvioEMail.GetPedidos: IBizPedidoCliente;
|
||||
begin
|
||||
Result := FPedidos;
|
||||
end;
|
||||
|
||||
procedure TfDialogListaPedidosCliEnvioEMail.RellenarLista;
|
||||
var
|
||||
i : Integer;
|
||||
begin
|
||||
ListView1.Items.BeginUpdate;
|
||||
ListView1.Items.Clear;
|
||||
|
||||
FPedidos.First;
|
||||
FPedidos.DataTable.DisableControls;
|
||||
try
|
||||
for i := 0 to FPedidos.DataTable.RecordCount - 1 do
|
||||
begin
|
||||
FController.RecuperarCliente(FPedidos);
|
||||
FPedidos.Cliente.DataTable.Active := True;
|
||||
|
||||
with ListView1.Items.Add do
|
||||
begin
|
||||
Caption := FPedidos.REFERENCIA;
|
||||
SubItems.Add(FPedidos.NOMBRE);
|
||||
SubItems.Add(FPedidos.Cliente.EMAIL_ADMINISTRACION);
|
||||
|
||||
if EsCadenaVacia(FPedidos.Cliente.EMAIL_ADMINISTRACION) then
|
||||
SubItems.Add('Sin dirección e-mail administrativa')
|
||||
else
|
||||
SubItems.Add('')
|
||||
end;
|
||||
FPedidos.Next;
|
||||
end;
|
||||
finally
|
||||
FPedidos.DataTable.EnableControls;
|
||||
ListView1.Items.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfDialogListaPedidosCliEnvioEMail.SetPedidos(
|
||||
const Value: IBizPedidoCliente);
|
||||
begin
|
||||
FPedidos := Value;
|
||||
|
||||
if Assigned(FPedidos) then
|
||||
begin
|
||||
FPedidos.DataTable.Open;
|
||||
RellenarLista;
|
||||
end
|
||||
else
|
||||
BorrarLista;
|
||||
end;
|
||||
|
||||
end.
|
||||
@ -2,7 +2,7 @@ inherited fEditorElegirPedidosCliente: TfEditorElegirPedidosCliente
|
||||
Caption = 'Seleccionar pedido de cliente'
|
||||
ClientWidth = 656
|
||||
ExplicitWidth = 664
|
||||
ExplicitHeight = 478
|
||||
ExplicitHeight = 471
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
object JvgWizardHeader1: TJvgWizardHeader [0]
|
||||
@ -65,6 +65,9 @@ inherited fEditorElegirPedidosCliente: TfEditorElegirPedidosCliente
|
||||
inherited TBXSeparatorItem3: TTBXSeparatorItem
|
||||
Visible = False
|
||||
end
|
||||
inherited TBXItem41: TTBXItem
|
||||
Visible = False
|
||||
end
|
||||
inherited TBXItem6: TTBXItem
|
||||
Visible = False
|
||||
end
|
||||
@ -179,6 +182,8 @@ inherited fEditorElegirPedidosCliente: TfEditorElegirPedidosCliente
|
||||
end
|
||||
inherited JsPrevisualizarDialog: TJSDialog [14]
|
||||
end
|
||||
inherited JsImprimirDialog: TJSDialog [15]
|
||||
end
|
||||
object EditorSeleccionActionList: TActionList
|
||||
Images = SmallImages
|
||||
Left = 152
|
||||
|
||||
@ -2,7 +2,6 @@ inherited fEditorPedidosCliente: TfEditorPedidosCliente
|
||||
Caption = 'Lista de pedidos de cliente'
|
||||
ClientWidth = 674
|
||||
ExplicitWidth = 682
|
||||
ExplicitHeight = 240
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
inherited JvNavPanelHeader: TJvNavPanelHeader
|
||||
@ -125,7 +124,10 @@ inherited fEditorPedidosCliente: TfEditorPedidosCliente
|
||||
Width = 674
|
||||
ExplicitWidth = 674
|
||||
inherited tbxMain: TTBXToolbar
|
||||
ExplicitWidth = 632
|
||||
ExplicitWidth = 674
|
||||
object TBXItem41: TTBXItem [13]
|
||||
Action = actEnviarEmail
|
||||
end
|
||||
end
|
||||
inherited tbxMenu: TTBXToolbar
|
||||
ExplicitWidth = 674
|
||||
@ -192,6 +194,12 @@ inherited fEditorPedidosCliente: TfEditorPedidosCliente
|
||||
OnExecute = actGenerarExecute
|
||||
OnUpdate = actGenerarUpdate
|
||||
end
|
||||
object actEnviarEmail: TAction
|
||||
Category = 'Acciones'
|
||||
Caption = 'Enviar por e-mail...'
|
||||
OnExecute = actEnviarEmailExecute
|
||||
OnUpdate = actEnviarEmailUpdate
|
||||
end
|
||||
end
|
||||
inherited SmallImages: TPngImageList
|
||||
PngImages = <
|
||||
|
||||
@ -31,6 +31,8 @@ type
|
||||
JsImprimirDialog: TJSDialog;
|
||||
TBXItem40: TTBXItem;
|
||||
JsListaPedidosNoEliminados: TJSDialog;
|
||||
actEnviarEmail: TAction;
|
||||
TBXItem41: TTBXItem;
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure actGenerarAlbaranCliExecute(Sender: TObject);
|
||||
procedure actEliminarUpdate(Sender: TObject);
|
||||
@ -39,6 +41,8 @@ type
|
||||
procedure actGenerarPedidoProvExecute(Sender: TObject);
|
||||
procedure actGenerarExecute(Sender: TObject);
|
||||
procedure actGenerarUpdate(Sender: TObject);
|
||||
procedure actEnviarEmailExecute(Sender: TObject);
|
||||
procedure actEnviarEmailUpdate(Sender: TObject);
|
||||
|
||||
protected
|
||||
FPedidos: IBizPedidoCliente;
|
||||
@ -75,7 +79,7 @@ uses
|
||||
uDataModulePedidosCliente, uDataModuleUsuarios, uBizAlbaranesCliente,
|
||||
uAlbaranesClienteController, uEditorBase, uEditorDBBase, uDialogUtils,
|
||||
uFacturasClienteController, uBizFacturasCliente, uGridUtils, uDBSelectionListUtils,
|
||||
uGenerarPedidosProvUtils, uGenerarAlbaranesCliUtils;
|
||||
uGenerarPedidosProvUtils, uGenerarAlbaranesCliUtils, cxControls;
|
||||
|
||||
|
||||
{$R *.dfm}
|
||||
@ -90,6 +94,41 @@ begin
|
||||
(Sender as TAction).Enabled := (FPedidos.SITUACION = SITUACION_PEDIDO_PENDIENTE);
|
||||
end;
|
||||
|
||||
procedure TfEditorPedidosCliente.actEnviarEmailExecute(Sender: TObject);
|
||||
var
|
||||
APedidos : IBizPedidoCliente;
|
||||
begin
|
||||
inherited;
|
||||
|
||||
if ViewGrid.NumSeleccionados = 1 then
|
||||
FController.GenerarEmailPedido(Pedidos)
|
||||
else begin
|
||||
ShowHourglassCursor;
|
||||
try
|
||||
SeleccionarFilasDesdeGrid(ViewGrid._FocusedView, (Pedidos as ISeleccionable).SelectedRecords);
|
||||
APedidos := (Controller as IPedidosClienteController).ExtraerSeleccionados(Pedidos, ViewGrid) as IBizPedidoCliente;
|
||||
|
||||
if Assigned(APedidos) then
|
||||
if FController.EnviarEmailPedidos(APedidos) then
|
||||
RefrescarInterno;
|
||||
finally
|
||||
APedidos := NIL;
|
||||
HideHourglassCursor;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfEditorPedidosCliente.actEnviarEmailUpdate(Sender: TObject);
|
||||
begin
|
||||
inherited;
|
||||
if HayDatos and Assigned(ViewGrid) then
|
||||
(Sender as TAction).Enabled := ViewGrid.esSeleccionCeldaDatos
|
||||
and (ViewGrid.NumSeleccionados > 0)
|
||||
else
|
||||
(Sender as TAction).Enabled := False;
|
||||
end;
|
||||
|
||||
procedure TfEditorPedidosCliente.actGenerarAlbaranCliExecute(Sender: TObject);
|
||||
var
|
||||
IDAlbaranAux : Integer;
|
||||
|
||||
@ -9,7 +9,7 @@ implementation
|
||||
|
||||
uses
|
||||
uEditorRegistryUtils, uEditorPedidosCliente, uEditorPedidoCliente, uEditorElegirPedidosCliente,
|
||||
uEditorElegirArticulosPedidoCliente, uEditorPedidosClienteReport;
|
||||
uEditorElegirArticulosPedidoCliente, uEditorPedidosClienteReport, uDialogListaPedidosCliEnvioEMail;
|
||||
|
||||
procedure RegisterViews;
|
||||
begin
|
||||
@ -18,6 +18,7 @@ begin
|
||||
EditorRegistry.RegisterClass(TfEditorElegirPedidosCliente, 'EditorElegirPedidosCliente');
|
||||
EditorRegistry.RegisterClass(TfEditorElegirArticulosPedidoCliente, 'EditorElegirArticulosPedidosCliente');
|
||||
EditorRegistry.RegisterClass(TfEditorPedidosClientePreview, 'EditorPedidosClientePreview');
|
||||
EditorRegistry.RegisterClass(TfDialogListaPedidosCliEnvioEMail, 'DialogListaPedidosCliEnvioEMail');
|
||||
end;
|
||||
|
||||
procedure UnregisterViews;
|
||||
@ -27,6 +28,7 @@ begin
|
||||
EditorRegistry.UnRegisterClass(TfEditorElegirPedidosCliente);
|
||||
EditorRegistry.UnRegisterClass(TfEditorElegirArticulosPedidoCliente);
|
||||
EditorRegistry.UnRegisterClass(TfEditorPedidosClientePreview);
|
||||
EditorRegistry.UnRegisterClass(TfDialogListaPedidosCliEnvioEMail);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -785,7 +785,7 @@ object RptRecibosCliente: TRptRecibosCliente
|
||||
Top = 158
|
||||
end
|
||||
object frxReport: TfrxReport
|
||||
Version = '3.23.7'
|
||||
Version = '4.3'
|
||||
DotMatrixReport = False
|
||||
EngineOptions.DoublePass = True
|
||||
IniFile = '\Software\Fast Reports'
|
||||
@ -793,6 +793,7 @@ object RptRecibosCliente: TRptRecibosCliente
|
||||
PreviewOptions.OutlineWidth = 180
|
||||
PreviewOptions.Zoom = 1.000000000000000000
|
||||
PrintOptions.Printer = 'Default'
|
||||
PrintOptions.PrintOnSheet = 0
|
||||
ReportOptions.CreateDate = 37871.995398692100000000
|
||||
ReportOptions.Description.Strings = (
|
||||
'Demonstrates how to create simple list report.')
|
||||
@ -851,17 +852,6 @@ object RptRecibosCliente: TRptRecibosCliente
|
||||
StoreInDFM = False
|
||||
Left = 169
|
||||
Top = 16
|
||||
Datasets = <
|
||||
item
|
||||
DataSet = frxDBCabecera
|
||||
DataSetName = 'frxDBCabecera'
|
||||
end
|
||||
item
|
||||
DataSet = frxDBCompensados
|
||||
DataSetName = 'frxDBCompensados'
|
||||
end>
|
||||
Variables = <>
|
||||
Style = <>
|
||||
end
|
||||
object frxDBCabecera: TfrxDBDataset
|
||||
UserName = 'frxDBCabecera'
|
||||
|
||||
@ -31,7 +31,7 @@ type
|
||||
procedure DataModuleCreate(Sender: TObject);
|
||||
private
|
||||
FConnection: IDAConnection;
|
||||
procedure GenerarRecibo(const ID : Integer); overload;
|
||||
procedure _GenerarRecibo(const ID : Integer); overload;
|
||||
public
|
||||
function GenerarRecibo(const ID : String): Binary; overload;
|
||||
end;
|
||||
@ -67,24 +67,20 @@ var
|
||||
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
FConnection.BeginTransaction;
|
||||
|
||||
try
|
||||
ID_Recibos := TStringList.Create;
|
||||
ID_Recibos.CommaText := ID;
|
||||
|
||||
//Vamos generando todos y cada uno de los albaranes recibidos
|
||||
for i := 0 to ID_Recibos.Count - 1 do
|
||||
GenerarRecibo(StrToInt(ID_Recibos.Strings[i]));
|
||||
_GenerarRecibo(StrToInt(ID_Recibos.Strings[i]));
|
||||
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
|
||||
finally
|
||||
FConnection.RollbackTransaction;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRptRecibosCliente.GenerarRecibo(const ID: Integer);
|
||||
procedure TRptRecibosCliente._GenerarRecibo(const ID: Integer);
|
||||
var
|
||||
dsMaster: IDADataset;
|
||||
dsCompensados : IDADataset;
|
||||
@ -92,6 +88,7 @@ var
|
||||
|
||||
begin
|
||||
AStream := TMemoryStream.Create;
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
|
||||
try
|
||||
dsMaster := schReport.NewDataset(FConnection, ds_InformeCabecera, ['ID'], [ID]);
|
||||
@ -109,6 +106,7 @@ begin
|
||||
frxReport.PrepareReport(False);
|
||||
|
||||
finally
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
AStream.Free;
|
||||
dsMaster := Nil;
|
||||
dsCompensados := Nil;
|
||||
|
||||
@ -894,7 +894,7 @@ object RptRemesasCliente: TRptRemesasCliente
|
||||
Top = 158
|
||||
end
|
||||
object frxReport: TfrxReport
|
||||
Version = '3.23.7'
|
||||
Version = '4.3'
|
||||
DotMatrixReport = False
|
||||
EngineOptions.DoublePass = True
|
||||
IniFile = '\Software\Fast Reports'
|
||||
@ -902,6 +902,7 @@ object RptRemesasCliente: TRptRemesasCliente
|
||||
PreviewOptions.OutlineWidth = 180
|
||||
PreviewOptions.Zoom = 1.000000000000000000
|
||||
PrintOptions.Printer = 'Default'
|
||||
PrintOptions.PrintOnSheet = 0
|
||||
ReportOptions.CreateDate = 37871.995398692100000000
|
||||
ReportOptions.LastChange = 39611.772828229160000000
|
||||
ReportOptions.VersionBuild = '1'
|
||||
@ -986,66 +987,6 @@ object RptRemesasCliente: TRptRemesasCliente
|
||||
OnStartReport = 'frxReportOnStartReport'
|
||||
Left = 169
|
||||
Top = 16
|
||||
Datasets = <
|
||||
item
|
||||
DataSet = frxDBCabecera
|
||||
DataSetName = 'frxDBCabecera'
|
||||
end
|
||||
item
|
||||
DataSet = frxDBDetalles
|
||||
DataSetName = 'frxDBDetalles'
|
||||
end>
|
||||
Variables = <
|
||||
item
|
||||
Name = ' Paginacion'
|
||||
Value = Null
|
||||
end
|
||||
item
|
||||
Name = 'Pagina'
|
||||
Value = Null
|
||||
end
|
||||
item
|
||||
Name = 'TotalPaginas'
|
||||
Value = Null
|
||||
end>
|
||||
Style = <
|
||||
item
|
||||
Name = 'Concepto normal'
|
||||
Color = clNone
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = 'Tahoma'
|
||||
Font.Style = []
|
||||
end
|
||||
item
|
||||
Name = 'Concepto subtotal'
|
||||
Color = clNone
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = 'Tahoma'
|
||||
Font.Style = [fsBold]
|
||||
end
|
||||
item
|
||||
Name = 'Cabecera de columna'
|
||||
Color = 15790320
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = 'Tahoma'
|
||||
Font.Style = [fsBold]
|
||||
Frame.Typ = [ftLeft, ftRight, ftTop, ftBottom]
|
||||
end
|
||||
item
|
||||
Name = 'Concepto titulo'
|
||||
Color = clNone
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = 'Tahoma'
|
||||
Font.Style = [fsBold]
|
||||
end>
|
||||
end
|
||||
object frxDBCabecera: TfrxDBDataset
|
||||
UserName = 'frxDBCabecera'
|
||||
|
||||
@ -31,7 +31,7 @@ type
|
||||
procedure DataModuleCreate(Sender: TObject);
|
||||
private
|
||||
FConnection: IDAConnection;
|
||||
procedure GenerarRemesa(const ID : Integer); overload;
|
||||
procedure _GenerarRemesa(const ID : Integer); overload;
|
||||
public
|
||||
function GenerarRemesa(const ID : String): Binary; overload;
|
||||
end;
|
||||
@ -68,7 +68,6 @@ var
|
||||
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
FConnection.BeginTransaction;
|
||||
|
||||
try
|
||||
ID_Remesas := TStringList.Create;
|
||||
@ -76,22 +75,21 @@ begin
|
||||
|
||||
//Vamos generando todos y cada uno de los albaranes recibidos
|
||||
for i := 0 to ID_Remesas.Count - 1 do
|
||||
GenerarRemesa(StrToInt(ID_Remesas.Strings[i]));
|
||||
_GenerarRemesa(StrToInt(ID_Remesas.Strings[i]));
|
||||
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
|
||||
finally
|
||||
FConnection.RollbackTransaction;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRptRemesasCliente.GenerarRemesa(const ID: Integer);
|
||||
procedure TRptRemesasCliente._GenerarRemesa(const ID: Integer);
|
||||
var
|
||||
AStream: TMemoryStream;
|
||||
dsMaster: IDADataset;
|
||||
dsDetail: IDADataset;
|
||||
begin
|
||||
AStream := TMemoryStream.Create;
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
|
||||
try
|
||||
dsMaster := schReport.NewDataset(FConnection, ds_InformeCabecera, ['ID'], [ID]);
|
||||
@ -109,6 +107,7 @@ begin
|
||||
frxReport.PrepareReport(False);
|
||||
|
||||
finally
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
AStream.Free;
|
||||
dsMaster := Nil;
|
||||
dsDetail := Nil;
|
||||
|
||||
@ -31,7 +31,7 @@ type
|
||||
procedure DataModuleCreate(Sender: TObject);
|
||||
private
|
||||
FConnection: IDAConnection;
|
||||
procedure GenerarRemesa(const ID : Integer); overload;
|
||||
procedure _GenerarRemesa(const ID : Integer); overload;
|
||||
public
|
||||
function GenerarRemesa(const ID : String): Binary; overload;
|
||||
end;
|
||||
@ -68,7 +68,6 @@ var
|
||||
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
FConnection.BeginTransaction;
|
||||
|
||||
try
|
||||
ID_Remesas := TStringList.Create;
|
||||
@ -76,22 +75,22 @@ begin
|
||||
|
||||
//Vamos generando todos y cada uno de los albaranes recibidos
|
||||
for i := 0 to ID_Remesas.Count - 1 do
|
||||
GenerarRemesa(StrToInt(ID_Remesas.Strings[i]));
|
||||
_GenerarRemesa(StrToInt(ID_Remesas.Strings[i]));
|
||||
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
|
||||
finally
|
||||
FConnection.RollbackTransaction;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRptRemesasProveedor.GenerarRemesa(const ID: Integer);
|
||||
procedure TRptRemesasProveedor._GenerarRemesa(const ID: Integer);
|
||||
var
|
||||
AStream: TMemoryStream;
|
||||
dsMaster: IDADataset;
|
||||
dsDetail: IDADataset;
|
||||
begin
|
||||
AStream := TMemoryStream.Create;
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
|
||||
try
|
||||
dsMaster := schReport.NewDataset(FConnection, ds_InformeCabecera, ['ID'], [ID]);
|
||||
@ -109,6 +108,7 @@ begin
|
||||
frxReport.PrepareReport(False);
|
||||
|
||||
finally
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
AStream.Free;
|
||||
dsMaster := Nil;
|
||||
dsDetail := Nil;
|
||||
|
||||
@ -170,6 +170,16 @@
|
||||
</Parameter>
|
||||
</Parameters>
|
||||
</Operation>
|
||||
<Operation Name="GenerarReportPDF" UID="{A39BD978-1262-440F-B889-A681EF864AD5}">
|
||||
<Parameters>
|
||||
<Parameter Name="Result" DataType="Binary" Flag="Result">
|
||||
</Parameter>
|
||||
<Parameter Name="ListaID" DataType="TIntegerArray" Flag="In" >
|
||||
</Parameter>
|
||||
<Parameter Name="ShowLogotipo" DataType="Boolean" Flag="In" >
|
||||
</Parameter>
|
||||
</Parameters>
|
||||
</Operation>
|
||||
</Operations>
|
||||
</Interface>
|
||||
</Interfaces>
|
||||
@ -260,6 +270,16 @@
|
||||
</Parameter>
|
||||
</Parameters>
|
||||
</Operation>
|
||||
<Operation Name="GenerarReportPDF" UID="{668DADA0-FB08-449E-88F0-092DE6BCC539}">
|
||||
<Parameters>
|
||||
<Parameter Name="Result" DataType="Binary" Flag="Result">
|
||||
</Parameter>
|
||||
<Parameter Name="ListaID" DataType="TIntegerArray" Flag="In" >
|
||||
</Parameter>
|
||||
<Parameter Name="ShowLogotipo" DataType="Boolean" Flag="In" >
|
||||
</Parameter>
|
||||
</Parameters>
|
||||
</Operation>
|
||||
</Operations>
|
||||
</Interface>
|
||||
</Interfaces>
|
||||
@ -304,6 +324,16 @@
|
||||
</Parameter>
|
||||
</Parameters>
|
||||
</Operation>
|
||||
<Operation Name="GenerarReportPDF" UID="{07B002D3-D4A8-4D0D-8D38-9EDAF97A634D}">
|
||||
<Parameters>
|
||||
<Parameter Name="Result" DataType="Binary" Flag="Result">
|
||||
</Parameter>
|
||||
<Parameter Name="ListaID" DataType="TIntegerArray" Flag="In" >
|
||||
</Parameter>
|
||||
<Parameter Name="ShowLogotipo" DataType="Boolean" Flag="In" >
|
||||
</Parameter>
|
||||
</Parameters>
|
||||
</Operation>
|
||||
</Operations>
|
||||
</Interface>
|
||||
</Interfaces>
|
||||
|
||||
@ -288,6 +288,7 @@ type
|
||||
['{3DCC03E4-E9CE-4798-99D4-7170C9CF815B}']
|
||||
function GetNextAutoInc(const GeneratorName: String): Integer;
|
||||
function GenerateReport(const ID: String): Binary;
|
||||
function GenerarReportPDF(const ListaID: TIntegerArray; const ShowLogotipo: Boolean): Binary;
|
||||
end;
|
||||
|
||||
{ CosrvPedidosProveedor }
|
||||
@ -302,6 +303,7 @@ type
|
||||
|
||||
function GetNextAutoInc(const GeneratorName: String): Integer;
|
||||
function GenerateReport(const ID: String): Binary;
|
||||
function GenerarReportPDF(const ListaID: TIntegerArray; const ShowLogotipo: Boolean): Binary;
|
||||
end;
|
||||
|
||||
{ IsrvConfiguracion }
|
||||
@ -385,6 +387,7 @@ type
|
||||
['{8A06D5A7-8461-4F6E-8A8B-EC49C84C45D1}']
|
||||
function GetNextAutoInc(const GeneratorName: String): Integer;
|
||||
function GenerateReport(const ID: String; const ShowLogotipo: Boolean): Binary;
|
||||
function GenerarReportPDF(const ListaID: TIntegerArray; const ShowLogotipo: Boolean): Binary;
|
||||
end;
|
||||
|
||||
{ CosrvPedidosCliente }
|
||||
@ -399,6 +402,7 @@ type
|
||||
|
||||
function GetNextAutoInc(const GeneratorName: String): Integer;
|
||||
function GenerateReport(const ID: String; const ShowLogotipo: Boolean): Binary;
|
||||
function GenerarReportPDF(const ListaID: TIntegerArray; const ShowLogotipo: Boolean): Binary;
|
||||
end;
|
||||
|
||||
{ IsrvFamilias }
|
||||
@ -424,6 +428,7 @@ type
|
||||
function GetNextAutoInc(const GeneratorName: String): Integer;
|
||||
function GenerateReport(const ID: String; const ShowLogotipo: Boolean): Binary;
|
||||
function GenerateEtiquetas(const ID: Integer; const withRefCliente: Boolean): Binary;
|
||||
function GenerarReportPDF(const ListaID: TIntegerArray; const ShowLogotipo: Boolean): Binary;
|
||||
end;
|
||||
|
||||
{ CosrvAlbaranesCliente }
|
||||
@ -439,6 +444,7 @@ type
|
||||
function GetNextAutoInc(const GeneratorName: String): Integer;
|
||||
function GenerateReport(const ID: String; const ShowLogotipo: Boolean): Binary;
|
||||
function GenerateEtiquetas(const ID: Integer; const withRefCliente: Boolean): Binary;
|
||||
function GenerarReportPDF(const ListaID: TIntegerArray; const ShowLogotipo: Boolean): Binary;
|
||||
end;
|
||||
|
||||
{ IsrvAlbaranesProveedor }
|
||||
@ -1447,6 +1453,31 @@ begin
|
||||
end
|
||||
end;
|
||||
|
||||
function TsrvPedidosProveedor_Proxy.GenerarReportPDF(const ListaID: TIntegerArray; const ShowLogotipo: Boolean): Binary;
|
||||
var
|
||||
__request, __response : TMemoryStream;
|
||||
begin
|
||||
result := nil;
|
||||
__request := TMemoryStream.Create;
|
||||
__response := TMemoryStream.Create;
|
||||
|
||||
try
|
||||
__Message.Initialize(__TransportChannel, 'FactuGES', __InterfaceName, 'GenerarReportPDF');
|
||||
__Message.Write('ListaID', TypeInfo(FactuGES_Intf.TIntegerArray), ListaID, []);
|
||||
__Message.Write('ShowLogotipo', TypeInfo(Boolean), ShowLogotipo, []);
|
||||
__Message.Finalize;
|
||||
|
||||
__Message.WriteToStream(__request);
|
||||
__TransportChannel.Dispatch(__request, __response);
|
||||
__Message.ReadFromStream(__response);
|
||||
|
||||
__Message.Read('Result', TypeInfo(Binary), result, []);
|
||||
finally
|
||||
__request.Free;
|
||||
__response.Free;
|
||||
end
|
||||
end;
|
||||
|
||||
{ CosrvConfiguracion }
|
||||
|
||||
class function CosrvConfiguracion.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvConfiguracion;
|
||||
@ -1657,6 +1688,31 @@ begin
|
||||
end
|
||||
end;
|
||||
|
||||
function TsrvPedidosCliente_Proxy.GenerarReportPDF(const ListaID: TIntegerArray; const ShowLogotipo: Boolean): Binary;
|
||||
var
|
||||
__request, __response : TMemoryStream;
|
||||
begin
|
||||
result := nil;
|
||||
__request := TMemoryStream.Create;
|
||||
__response := TMemoryStream.Create;
|
||||
|
||||
try
|
||||
__Message.Initialize(__TransportChannel, 'FactuGES', __InterfaceName, 'GenerarReportPDF');
|
||||
__Message.Write('ListaID', TypeInfo(FactuGES_Intf.TIntegerArray), ListaID, []);
|
||||
__Message.Write('ShowLogotipo', TypeInfo(Boolean), ShowLogotipo, []);
|
||||
__Message.Finalize;
|
||||
|
||||
__Message.WriteToStream(__request);
|
||||
__TransportChannel.Dispatch(__request, __response);
|
||||
__Message.ReadFromStream(__response);
|
||||
|
||||
__Message.Read('Result', TypeInfo(Binary), result, []);
|
||||
finally
|
||||
__request.Free;
|
||||
__response.Free;
|
||||
end
|
||||
end;
|
||||
|
||||
{ CosrvFamilias }
|
||||
|
||||
class function CosrvFamilias.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvFamilias;
|
||||
@ -1756,6 +1812,31 @@ begin
|
||||
end
|
||||
end;
|
||||
|
||||
function TsrvAlbaranesCliente_Proxy.GenerarReportPDF(const ListaID: TIntegerArray; const ShowLogotipo: Boolean): Binary;
|
||||
var
|
||||
__request, __response : TMemoryStream;
|
||||
begin
|
||||
result := nil;
|
||||
__request := TMemoryStream.Create;
|
||||
__response := TMemoryStream.Create;
|
||||
|
||||
try
|
||||
__Message.Initialize(__TransportChannel, 'FactuGES', __InterfaceName, 'GenerarReportPDF');
|
||||
__Message.Write('ListaID', TypeInfo(FactuGES_Intf.TIntegerArray), ListaID, []);
|
||||
__Message.Write('ShowLogotipo', TypeInfo(Boolean), ShowLogotipo, []);
|
||||
__Message.Finalize;
|
||||
|
||||
__Message.WriteToStream(__request);
|
||||
__TransportChannel.Dispatch(__request, __response);
|
||||
__Message.ReadFromStream(__response);
|
||||
|
||||
__Message.Read('Result', TypeInfo(Binary), result, []);
|
||||
finally
|
||||
__request.Free;
|
||||
__response.Free;
|
||||
end
|
||||
end;
|
||||
|
||||
{ CosrvAlbaranesProveedor }
|
||||
|
||||
class function CosrvAlbaranesProveedor.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvAlbaranesProveedor;
|
||||
|
||||
@ -66,6 +66,7 @@ type
|
||||
published
|
||||
procedure Invoke_GetNextAutoInc(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
procedure Invoke_GenerateReport(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
procedure Invoke_GenerarReportPDF(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
end;
|
||||
|
||||
TsrvConfiguracion_Invoker = class(TDARemoteService_Invoker)
|
||||
@ -102,6 +103,7 @@ type
|
||||
published
|
||||
procedure Invoke_GetNextAutoInc(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
procedure Invoke_GenerateReport(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
procedure Invoke_GenerarReportPDF(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
end;
|
||||
|
||||
TsrvFamilias_Invoker = class(TDARemoteService_Invoker)
|
||||
@ -117,6 +119,7 @@ type
|
||||
procedure Invoke_GetNextAutoInc(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
procedure Invoke_GenerateReport(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
procedure Invoke_GenerateEtiquetas(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
procedure Invoke_GenerarReportPDF(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
end;
|
||||
|
||||
TsrvAlbaranesProveedor_Invoker = class(TDARemoteService_Invoker)
|
||||
@ -587,6 +590,37 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TsrvPedidosProveedor_Invoker.Invoke_GenerarReportPDF(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
{ function GenerarReportPDF(const ListaID: TIntegerArray; const ShowLogotipo: Boolean): Binary; }
|
||||
var
|
||||
ListaID: FactuGES_Intf.TIntegerArray;
|
||||
ShowLogotipo: Boolean;
|
||||
lResult: Binary;
|
||||
__lObjectDisposer: TROObjectDisposer;
|
||||
begin
|
||||
ListaID := nil;
|
||||
lResult := nil;
|
||||
try
|
||||
__Message.Read('ListaID', TypeInfo(FactuGES_Intf.TIntegerArray), ListaID, []);
|
||||
__Message.Read('ShowLogotipo', TypeInfo(Boolean), ShowLogotipo, []);
|
||||
|
||||
lResult := (__Instance as IsrvPedidosProveedor).GenerarReportPDF(ListaID, ShowLogotipo);
|
||||
|
||||
__Message.Initialize(__Transport, 'FactuGES', 'srvPedidosProveedor', 'GenerarReportPDFResponse');
|
||||
__Message.Write('Result', TypeInfo(Binary), lResult, []);
|
||||
__Message.Finalize;
|
||||
|
||||
finally
|
||||
__lObjectDisposer := TROObjectDisposer.Create(__Instance);
|
||||
try
|
||||
__lObjectDisposer.Add(ListaID);
|
||||
__lObjectDisposer.Add(lResult);
|
||||
finally
|
||||
__lObjectDisposer.Free();
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
{ TsrvConfiguracion_Invoker }
|
||||
|
||||
procedure TsrvConfiguracion_Invoker.Invoke_darValor(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
@ -721,6 +755,37 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TsrvPedidosCliente_Invoker.Invoke_GenerarReportPDF(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
{ function GenerarReportPDF(const ListaID: TIntegerArray; const ShowLogotipo: Boolean): Binary; }
|
||||
var
|
||||
ListaID: FactuGES_Intf.TIntegerArray;
|
||||
ShowLogotipo: Boolean;
|
||||
lResult: Binary;
|
||||
__lObjectDisposer: TROObjectDisposer;
|
||||
begin
|
||||
ListaID := nil;
|
||||
lResult := nil;
|
||||
try
|
||||
__Message.Read('ListaID', TypeInfo(FactuGES_Intf.TIntegerArray), ListaID, []);
|
||||
__Message.Read('ShowLogotipo', TypeInfo(Boolean), ShowLogotipo, []);
|
||||
|
||||
lResult := (__Instance as IsrvPedidosCliente).GenerarReportPDF(ListaID, ShowLogotipo);
|
||||
|
||||
__Message.Initialize(__Transport, 'FactuGES', 'srvPedidosCliente', 'GenerarReportPDFResponse');
|
||||
__Message.Write('Result', TypeInfo(Binary), lResult, []);
|
||||
__Message.Finalize;
|
||||
|
||||
finally
|
||||
__lObjectDisposer := TROObjectDisposer.Create(__Instance);
|
||||
try
|
||||
__lObjectDisposer.Add(ListaID);
|
||||
__lObjectDisposer.Add(lResult);
|
||||
finally
|
||||
__lObjectDisposer.Free();
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
{ TsrvAlbaranesCliente_Invoker }
|
||||
|
||||
procedure TsrvAlbaranesCliente_Invoker.Invoke_GetNextAutoInc(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
@ -800,6 +865,37 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TsrvAlbaranesCliente_Invoker.Invoke_GenerarReportPDF(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
{ function GenerarReportPDF(const ListaID: TIntegerArray; const ShowLogotipo: Boolean): Binary; }
|
||||
var
|
||||
ListaID: FactuGES_Intf.TIntegerArray;
|
||||
ShowLogotipo: Boolean;
|
||||
lResult: Binary;
|
||||
__lObjectDisposer: TROObjectDisposer;
|
||||
begin
|
||||
ListaID := nil;
|
||||
lResult := nil;
|
||||
try
|
||||
__Message.Read('ListaID', TypeInfo(FactuGES_Intf.TIntegerArray), ListaID, []);
|
||||
__Message.Read('ShowLogotipo', TypeInfo(Boolean), ShowLogotipo, []);
|
||||
|
||||
lResult := (__Instance as IsrvAlbaranesCliente).GenerarReportPDF(ListaID, ShowLogotipo);
|
||||
|
||||
__Message.Initialize(__Transport, 'FactuGES', 'srvAlbaranesCliente', 'GenerarReportPDFResponse');
|
||||
__Message.Write('Result', TypeInfo(Binary), lResult, []);
|
||||
__Message.Finalize;
|
||||
|
||||
finally
|
||||
__lObjectDisposer := TROObjectDisposer.Create(__Instance);
|
||||
try
|
||||
__lObjectDisposer.Add(ListaID);
|
||||
__lObjectDisposer.Add(lResult);
|
||||
finally
|
||||
__lObjectDisposer.Free();
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
{ TsrvAlbaranesProveedor_Invoker }
|
||||
|
||||
procedure TsrvAlbaranesProveedor_Invoker.Invoke_GetNextAutoInc(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
|
||||
Binary file not shown.
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<BorlandProject>
|
||||
<PersonalityInfo>
|
||||
<Option>
|
||||
@ -175,11 +175,10 @@
|
||||
<VersionInfoKeys Name="ProductName">FactuGES Server</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductVersion">3.0.9.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="Comments"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="CompileDate">martes, 30 de septiembre de 2008 19:31</VersionInfoKeys></VersionInfoKeys>
|
||||
<Excluded_Packages>
|
||||
<Excluded_Packages Name="C:\Archivos de programa\RemObjects Software\Pascal Script\Dcu\D10\PascalScript_RO_D10.bpl">RemObjects Pascal Script - RemObjects SDK 3.0 Integration</Excluded_Packages>
|
||||
</Excluded_Packages>
|
||||
</Delphi.Personality>
|
||||
<VersionInfoKeys Name="CompileDate">martes, 30 de septiembre de 2008 19:31</VersionInfoKeys></VersionInfoKeys> <Excluded_Packages>
|
||||
<Excluded_Packages Name="C:\Archivos de programa\RemObjects Software\Pascal Script\Dcu\D10\PascalScript_RO_D10.bpl">RemObjects Pascal Script - RemObjects SDK 3.0 Integration</Excluded_Packages>
|
||||
</Excluded_Packages>
|
||||
</Delphi.Personality>
|
||||
<ModelSupport>False</ModelSupport>
|
||||
<!-- EurekaLog First Line
|
||||
[Exception Log]
|
||||
|
||||
@ -912,12 +912,12 @@
|
||||
#define IdResourceStrings_RSMIMEMIMETypeEmpty 65181
|
||||
#define IdResourceStrings_RSMIMEMIMEExtAlreadyExists 65182
|
||||
#define IdResourceStrings_RSStatusResolving 65183
|
||||
#define uRODECConst_sFMT_HEXL 65184
|
||||
#define uRODECConst_sFMT_MIME64 65185
|
||||
#define uRODECConst_sFMT_UU 65186
|
||||
#define uRODECConst_sFMT_XX 65187
|
||||
#define uRODECConst_sInvalidKeySize 65188
|
||||
#define uRODECConst_sNotInitialized 65189
|
||||
#define uRORes_err_InvalidVarArrayDimCount 65184
|
||||
#define uRORes_err_MessageNotAssigned 65185
|
||||
#define ComConst_SOleError 65186
|
||||
#define ComConst_SNoMethod 65187
|
||||
#define ComConst_SVarNotObject 65188
|
||||
#define ComConst_STooManyParams 65189
|
||||
#define IdResourceStrings_RSCannotAllocateSocket 65190
|
||||
#define IdResourceStrings_RSConnectionClosedGracefully 65191
|
||||
#define IdResourceStrings_RSCouldNotBindSocket 65192
|
||||
@ -928,70 +928,70 @@
|
||||
#define IdResourceStrings_RSThreadClassNotSpecified 65197
|
||||
#define IdResourceStrings_RSFileNotFound 65198
|
||||
#define IdResourceStrings_RSOnlyOneAntiFreeze 65199
|
||||
#define uRORes_err_NoXMLParsersAvailable 65200
|
||||
#define uRORes_err_IDispatchMarshalingNotSupported 65201
|
||||
#define uRORes_err_UnsupportedVariantType 65202
|
||||
#define uRORes_err_VariantIsNotArray 65203
|
||||
#define uRORes_err_InvalidVarArrayDimCount 65204
|
||||
#define uRORes_err_MessageNotAssigned 65205
|
||||
#define ComConst_SOleError 65206
|
||||
#define ComConst_SNoMethod 65207
|
||||
#define ComConst_SVarNotObject 65208
|
||||
#define ComConst_STooManyParams 65209
|
||||
#define uRODECConst_sProtectionCircular 65210
|
||||
#define uRODECConst_sStringFormatExists 65211
|
||||
#define uRODECConst_sInvalidStringFormat 65212
|
||||
#define uRODECConst_sInvalidFormatString 65213
|
||||
#define uRODECConst_sFMT_COPY 65214
|
||||
#define uRODECConst_sFMT_HEX 65215
|
||||
#define uRORes_err_UnknownProxyInterface 65216
|
||||
#define uRORes_err_DispatcherAlreadyAssigned 65217
|
||||
#define uRORes_err_CannotFindMessageDispatcher 65218
|
||||
#define uRORes_err_ServerOnlySupportsOneDispatcher 65219
|
||||
#define uRORes_err_UnhandledException 65220
|
||||
#define uRORes_err_ChannelBusy 65221
|
||||
#define uRORes_err_ArrayIndexOutOfBounds 65222
|
||||
#define uRORes_err_InvalidHeader 65223
|
||||
#define uRORes_err_UnknownClassInStream 65224
|
||||
#define uRORes_err_UnexpectedClassInStream 65225
|
||||
#define uRORes_err_SessionNotFound 65226
|
||||
#define uRORes_err_ChannelDoesntSupportIROMetadataReader 65227
|
||||
#define uRORes_err_TooManySessions 65228
|
||||
#define uRORes_err_DOMElementIsNIL 65229
|
||||
#define uRORes_err_CannotLoadXMLDocument 65230
|
||||
#define uRORes_err_ErrorCreatingMsXmlDoc 65231
|
||||
#define uRORes_err_RodlInvalidDataType 65232
|
||||
#define uRORes_err_RodlStructCannotBeNested 65233
|
||||
#define uRORes_err_RodlInvalidAncestorType 65234
|
||||
#define uRORes_str_ExceptionOnServer 65235
|
||||
#define uRORes_str_ExceptionReraisedFromServer 65236
|
||||
#define uRORes_err_AssignError 65237
|
||||
#define uRORes_err_InvalidRequestStream 65238
|
||||
#define uRORes_err_NILMessage 65239
|
||||
#define uRORes_err_UnspecifiedInterface 65240
|
||||
#define uRORes_err_UnspecifiedMessage 65241
|
||||
#define uRORes_err_UnknownMethod 65242
|
||||
#define uRORes_err_ClassFactoryDidNotReturnInstance 65243
|
||||
#define uRORes_err_TypeNotSupported 65244
|
||||
#define uRORes_err_ClassFactoryNotFound 65245
|
||||
#define uRORes_err_IROMessageNotSupported 65246
|
||||
#define uRORes_err_ClassAlreadyRegistered 65247
|
||||
#define uRORes_err_UnhandledException 65200
|
||||
#define uRORes_err_ChannelBusy 65201
|
||||
#define uRORes_err_ArrayIndexOutOfBounds 65202
|
||||
#define uRORes_err_InvalidHeader 65203
|
||||
#define uRORes_err_UnknownClassInStream 65204
|
||||
#define uRORes_err_UnexpectedClassInStream 65205
|
||||
#define uRORes_err_SessionNotFound 65206
|
||||
#define uRORes_err_ChannelDoesntSupportIROMetadataReader 65207
|
||||
#define uRORes_err_TooManySessions 65208
|
||||
#define uRORes_err_DOMElementIsNIL 65209
|
||||
#define uRORes_err_CannotLoadXMLDocument 65210
|
||||
#define uRORes_err_ErrorCreatingMsXmlDoc 65211
|
||||
#define uRORes_err_NoXMLParsersAvailable 65212
|
||||
#define uRORes_err_IDispatchMarshalingNotSupported 65213
|
||||
#define uRORes_err_UnsupportedVariantType 65214
|
||||
#define uRORes_err_VariantIsNotArray 65215
|
||||
#define uRORes_str_ExceptionReraisedFromServer 65216
|
||||
#define uRORes_err_AssignError 65217
|
||||
#define uRORes_err_InvalidRequestStream 65218
|
||||
#define uRORes_err_NILMessage 65219
|
||||
#define uRORes_err_UnspecifiedInterface 65220
|
||||
#define uRORes_err_UnspecifiedMessage 65221
|
||||
#define uRORes_err_UnknownMethod 65222
|
||||
#define uRORes_err_ClassFactoryDidNotReturnInstance 65223
|
||||
#define uRORes_err_TypeNotSupported 65224
|
||||
#define uRORes_err_ClassFactoryNotFound 65225
|
||||
#define uRORes_err_IROMessageNotSupported 65226
|
||||
#define uRORes_err_ClassAlreadyRegistered 65227
|
||||
#define uRORes_err_UnknownProxyInterface 65228
|
||||
#define uRORes_err_DispatcherAlreadyAssigned 65229
|
||||
#define uRORes_err_CannotFindMessageDispatcher 65230
|
||||
#define uRORes_err_ServerOnlySupportsOneDispatcher 65231
|
||||
#define uRORes_err_InvalidType 65232
|
||||
#define uRORes_err_InvalidStream 65233
|
||||
#define uRORes_err_InvalidParamFlag 65234
|
||||
#define uRORes_err_InvalidStringLength 65235
|
||||
#define uRORes_str_InvalidClassTypeInStream 65236
|
||||
#define uRORes_err_UnexpectedEndOfStream 65237
|
||||
#define uRORes_err_RodlDuplicateName 65238
|
||||
#define uRORes_err_RodlNoDataTypeSpecified 65239
|
||||
#define uRORes_err_RodlNoEnumValues 65240
|
||||
#define uRORes_err_RodlNoStructElementsDefined 65241
|
||||
#define uRORes_err_RodlNoOperationsDefined 65242
|
||||
#define uRORes_err_RodlUsedFileDoesNotExist 65243
|
||||
#define uRORes_err_RodlInvalidDataType 65244
|
||||
#define uRORes_err_RodlStructCannotBeNested 65245
|
||||
#define uRORes_err_RodlInvalidAncestorType 65246
|
||||
#define uRORes_str_ExceptionOnServer 65247
|
||||
#define Consts_SUTF8Encoding 65248
|
||||
#define Consts_SUTF7Encoding 65249
|
||||
#define Consts_SPageControlNotSet 65250
|
||||
#define uRORes_err_InvalidIndex 65251
|
||||
#define uRORes_err_InvalidType 65252
|
||||
#define uRORes_err_InvalidStream 65253
|
||||
#define uRORes_err_InvalidParamFlag 65254
|
||||
#define uRORes_err_InvalidStringLength 65255
|
||||
#define uRORes_str_InvalidClassTypeInStream 65256
|
||||
#define uRORes_err_UnexpectedEndOfStream 65257
|
||||
#define uRORes_err_RodlDuplicateName 65258
|
||||
#define uRORes_err_RodlNoDataTypeSpecified 65259
|
||||
#define uRORes_err_RodlNoEnumValues 65260
|
||||
#define uRORes_err_RodlNoStructElementsDefined 65261
|
||||
#define uRORes_err_RodlNoOperationsDefined 65262
|
||||
#define uRORes_err_RodlUsedFileDoesNotExist 65263
|
||||
#define uRODECConst_sProtectionCircular 65251
|
||||
#define uRODECConst_sStringFormatExists 65252
|
||||
#define uRODECConst_sInvalidStringFormat 65253
|
||||
#define uRODECConst_sInvalidFormatString 65254
|
||||
#define uRODECConst_sFMT_COPY 65255
|
||||
#define uRODECConst_sFMT_HEX 65256
|
||||
#define uRODECConst_sFMT_HEXL 65257
|
||||
#define uRODECConst_sFMT_MIME64 65258
|
||||
#define uRODECConst_sFMT_UU 65259
|
||||
#define uRODECConst_sFMT_XX 65260
|
||||
#define uRODECConst_sInvalidKeySize 65261
|
||||
#define uRODECConst_sNotInitialized 65262
|
||||
#define uRORes_err_InvalidIndex 65263
|
||||
#define Consts_SPictureLabel 65264
|
||||
#define Consts_SPictureDesc 65265
|
||||
#define Consts_SPreviewLabel 65266
|
||||
@ -2170,12 +2170,12 @@ BEGIN
|
||||
IdResourceStrings_RSMIMEMIMETypeEmpty, "Mimetype is empty"
|
||||
IdResourceStrings_RSMIMEMIMEExtAlreadyExists, "Extension already exits"
|
||||
IdResourceStrings_RSStatusResolving, "Resolving hostname %s."
|
||||
uRODECConst_sFMT_HEXL, "Hexadecimal lowercase"
|
||||
uRODECConst_sFMT_MIME64, "MIME Base 64"
|
||||
uRODECConst_sFMT_UU, "UU Coding"
|
||||
uRODECConst_sFMT_XX, "XX Coding"
|
||||
uRODECConst_sInvalidKeySize, "Length from Encryptionkey is invalid.\r\nKeysize for %s must be to %d-%d bytes"
|
||||
uRODECConst_sNotInitialized, "%s is not initialized call Init() or InitKey() before."
|
||||
uRORes_err_InvalidVarArrayDimCount, "Variant Array DimCount must be 1 but is %d"
|
||||
uRORes_err_MessageNotAssigned, "Message is NIL"
|
||||
ComConst_SOleError, "OLE error %.8x"
|
||||
ComConst_SNoMethod, "Method '%s' not supported by automation object"
|
||||
ComConst_SVarNotObject, "Variant does not reference an automation object"
|
||||
ComConst_STooManyParams, "Dispatch methods do not support more than 64 parameters"
|
||||
IdResourceStrings_RSCannotAllocateSocket, "Cannot allocate socket."
|
||||
IdResourceStrings_RSConnectionClosedGracefully, "Connection Closed Gracefully."
|
||||
IdResourceStrings_RSCouldNotBindSocket, "Could not bind socket. Address and port are already in use."
|
||||
@ -2186,26 +2186,6 @@ BEGIN
|
||||
IdResourceStrings_RSThreadClassNotSpecified, "Thread Class Not Specified."
|
||||
IdResourceStrings_RSFileNotFound, "File \"%s\" not found"
|
||||
IdResourceStrings_RSOnlyOneAntiFreeze, "Only one TIdAntiFreeze can exist per application."
|
||||
uRORes_err_NoXMLParsersAvailable, "MSXML is not installed"
|
||||
uRORes_err_IDispatchMarshalingNotSupported, "Marshaling of IDispatch (%d) type variants is not supported."
|
||||
uRORes_err_UnsupportedVariantType, "Unsupported variant type \"%d\""
|
||||
uRORes_err_VariantIsNotArray, "Variant must be Array, but is %d"
|
||||
uRORes_err_InvalidVarArrayDimCount, "Variant Array DimCount must be 1 but is %d"
|
||||
uRORes_err_MessageNotAssigned, "Message is NIL"
|
||||
ComConst_SOleError, "OLE error %.8x"
|
||||
ComConst_SNoMethod, "Method '%s' not supported by automation object"
|
||||
ComConst_SVarNotObject, "Variant does not reference an automation object"
|
||||
ComConst_STooManyParams, "Dispatch methods do not support more than 64 parameters"
|
||||
uRODECConst_sProtectionCircular, "Circular Protection detected, Protection Object is invalid."
|
||||
uRODECConst_sStringFormatExists, "String Format \"%d\" not exists."
|
||||
uRODECConst_sInvalidStringFormat, "Input is not an valid %s Format."
|
||||
uRODECConst_sInvalidFormatString, "Input can not be convert to %s Format."
|
||||
uRODECConst_sFMT_COPY, "copy Input to Output"
|
||||
uRODECConst_sFMT_HEX, "Hexadecimal"
|
||||
uRORes_err_UnknownProxyInterface, "Unknown proxy interface \"%s\""
|
||||
uRORes_err_DispatcherAlreadyAssigned, "Dispatcher for %s already assigned"
|
||||
uRORes_err_CannotFindMessageDispatcher, "Cannot find message dispatcher. Maybe there is no message component configured for for the requested path?"
|
||||
uRORes_err_ServerOnlySupportsOneDispatcher, "%s servers only support one dispatcher"
|
||||
uRORes_err_UnhandledException, "Unhandled exception"
|
||||
uRORes_err_ChannelBusy, "Channel is busy. Try again later."
|
||||
uRORes_err_ArrayIndexOutOfBounds, "Array index out of bounds (%d)."
|
||||
@ -2218,10 +2198,10 @@ BEGIN
|
||||
uRORes_err_DOMElementIsNIL, "DOMElement is NIL"
|
||||
uRORes_err_CannotLoadXMLDocument, "Cannot load XML document.\rReason: %s\rLine: %d\rPosition: %d"
|
||||
uRORes_err_ErrorCreatingMsXmlDoc, "Error creating MSXML Document class\r\r%s: %s"
|
||||
uRORes_err_RodlInvalidDataType, "Invalid or undefined data type \"%s\"."
|
||||
uRORes_err_RodlStructCannotBeNested, "Structs cannot recursively contain themselves."
|
||||
uRORes_err_RodlInvalidAncestorType, "Invalid or undefined ancestor type \"%s\"."
|
||||
uRORes_str_ExceptionOnServer, "An exception of type %s was raised on the server: %s"
|
||||
uRORes_err_NoXMLParsersAvailable, "MSXML is not installed"
|
||||
uRORes_err_IDispatchMarshalingNotSupported, "Marshaling of IDispatch (%d) type variants is not supported."
|
||||
uRORes_err_UnsupportedVariantType, "Unsupported variant type \"%d\""
|
||||
uRORes_err_VariantIsNotArray, "Variant must be Array, but is %d"
|
||||
uRORes_str_ExceptionReraisedFromServer, "An exception was raised on the server: %s"
|
||||
uRORes_err_AssignError, "Cannot assign a \"%s\" to a \"%s\"."
|
||||
uRORes_err_InvalidRequestStream, "Invalid request stream (%d bytes)"
|
||||
@ -2234,10 +2214,10 @@ BEGIN
|
||||
uRORes_err_ClassFactoryNotFound, "Class factory for interface %s not found"
|
||||
uRORes_err_IROMessageNotSupported, "Class \"%s\" does not support IROMessage"
|
||||
uRORes_err_ClassAlreadyRegistered, "Class \"%s\" is already registered"
|
||||
Consts_SUTF8Encoding, "UTF-8"
|
||||
Consts_SUTF7Encoding, "UTF-7"
|
||||
Consts_SPageControlNotSet, "PageControl must first be assigned"
|
||||
uRORes_err_InvalidIndex, "Invalid index %d"
|
||||
uRORes_err_UnknownProxyInterface, "Unknown proxy interface \"%s\""
|
||||
uRORes_err_DispatcherAlreadyAssigned, "Dispatcher for %s already assigned"
|
||||
uRORes_err_CannotFindMessageDispatcher, "Cannot find message dispatcher. Maybe there is no message component configured for for the requested path?"
|
||||
uRORes_err_ServerOnlySupportsOneDispatcher, "%s servers only support one dispatcher"
|
||||
uRORes_err_InvalidType, "Invalid type \"%s. Expected \"%s\"\""
|
||||
uRORes_err_InvalidStream, "Invalid stream"
|
||||
uRORes_err_InvalidParamFlag, "Invalid Parameter Flag \"%s\""
|
||||
@ -2250,6 +2230,26 @@ BEGIN
|
||||
uRORes_err_RodlNoStructElementsDefined, "Struct does not contain any elements."
|
||||
uRORes_err_RodlNoOperationsDefined, "Service interface does not contain any elements."
|
||||
uRORes_err_RodlUsedFileDoesNotExist, "The referenced RODL file \"%s\" could not be found."
|
||||
uRORes_err_RodlInvalidDataType, "Invalid or undefined data type \"%s\"."
|
||||
uRORes_err_RodlStructCannotBeNested, "Structs cannot recursively contain themselves."
|
||||
uRORes_err_RodlInvalidAncestorType, "Invalid or undefined ancestor type \"%s\"."
|
||||
uRORes_str_ExceptionOnServer, "An exception of type %s was raised on the server: %s"
|
||||
Consts_SUTF8Encoding, "UTF-8"
|
||||
Consts_SUTF7Encoding, "UTF-7"
|
||||
Consts_SPageControlNotSet, "PageControl must first be assigned"
|
||||
uRODECConst_sProtectionCircular, "Circular Protection detected, Protection Object is invalid."
|
||||
uRODECConst_sStringFormatExists, "String Format \"%d\" not exists."
|
||||
uRODECConst_sInvalidStringFormat, "Input is not an valid %s Format."
|
||||
uRODECConst_sInvalidFormatString, "Input can not be convert to %s Format."
|
||||
uRODECConst_sFMT_COPY, "copy Input to Output"
|
||||
uRODECConst_sFMT_HEX, "Hexadecimal"
|
||||
uRODECConst_sFMT_HEXL, "Hexadecimal lowercase"
|
||||
uRODECConst_sFMT_MIME64, "MIME Base 64"
|
||||
uRODECConst_sFMT_UU, "UU Coding"
|
||||
uRODECConst_sFMT_XX, "XX Coding"
|
||||
uRODECConst_sInvalidKeySize, "Length from Encryptionkey is invalid.\r\nKeysize for %s must be to %d-%d bytes"
|
||||
uRODECConst_sNotInitialized, "%s is not initialized call Init() or InitKey() before."
|
||||
uRORes_err_InvalidIndex, "Invalid index %d"
|
||||
Consts_SPictureLabel, "Picture:"
|
||||
Consts_SPictureDesc, " (%dx%d)"
|
||||
Consts_SPreviewLabel, "Preview"
|
||||
|
||||
@ -16,7 +16,7 @@ BEGIN
|
||||
VALUE "FileVersion", "3.0.9.0\0"
|
||||
VALUE "ProductName", "FactuGES Server\0"
|
||||
VALUE "ProductVersion", "3.0.9.0\0"
|
||||
VALUE "CompileDate", "viernes, 17 de octubre de 2008 16:17\0"
|
||||
VALUE "CompileDate", "lunes, 27 de octubre de 2008 17:32\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user