Se depura modulo de pedidos de cliente
git-svn-id: https://192.168.0.254/svn/Proyectos.Noviseda_FactuGES2/trunk@103 f33bb606-9f5c-448d-9c99-757f00063c96
This commit is contained in:
parent
8cb5316a32
commit
9ac9ebceb0
@ -3859,7 +3859,7 @@ SELECT
|
||||
CONTACTOS.NOMBRE,
|
||||
PEDIDOS_CLIENTE.REFERENCIA,
|
||||
PEDIDOS_CLIENTE.REFERENCIA_CLIENTE,
|
||||
V_PED_CLI_SITUACION.SITUACION,
|
||||
TRIM(V_PED_CLI_SITUACION.SITUACION),
|
||||
PEDIDOS_CLIENTE.FECHA_PEDIDO,
|
||||
PEDIDOS_CLIENTE.ID_DIRECCION,
|
||||
PEDIDOS_CLIENTE.CALLE,
|
||||
|
||||
@ -55,58 +55,58 @@
|
||||
<DelphiCompile Include="Base.dpk">
|
||||
<MainSource>MainSource</MainSource>
|
||||
</DelphiCompile>
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\adortl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\cxDataD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\cxEditorsD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\cxExportD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\cxExtEditorsD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\cxGridD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\cxLibraryD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\cxPageControlD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\DataAbstract_Core_D11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\dbrtl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\dclIndyCore.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\designide.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\dsnap.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\dxCoreD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\dxGDIPlusD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\dxLayoutControlD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\dxPSCoreD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\dxThemeD11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\GUISDK_D11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\IndyCore.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\IndyProtocols.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\IndySystem.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\Jcl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\JclVcl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\JSDialog100.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\JvCmpD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\JvCoreD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\JvCtrlsD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\JvDlgsD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\JvMMD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\JvNetD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\JvPageCompsD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\JvStdCtrlsD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\JvSystemD11R.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\pckMD5.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\pckUCDataConnector.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\pckUserControl_RT.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\PngComponentsD10.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\PNG_D10.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\RemObjects_Core_D11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\RemObjects_Indy_D11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\rtl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\SpTBXLib_d11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\tb2k_d11.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\vcl.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\vclactnband.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\vcldb.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\vcljpg.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\VclSmp.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\vclx.dcp" />
|
||||
<DCCReference Include="..\Modulos\Albaranes de cliente\Controller\xmlrtl.dcp" />
|
||||
<DCCReference Include="..\Servicios\FactuGES_Intf.pas" />
|
||||
<DCCReference Include="..\Servidor\adortl.dcp" />
|
||||
<DCCReference Include="..\Servidor\cxDataD11.dcp" />
|
||||
<DCCReference Include="..\Servidor\cxEditorsD11.dcp" />
|
||||
<DCCReference Include="..\Servidor\cxExportD11.dcp" />
|
||||
<DCCReference Include="..\Servidor\cxExtEditorsD11.dcp" />
|
||||
<DCCReference Include="..\Servidor\cxGridD11.dcp" />
|
||||
<DCCReference Include="..\Servidor\cxLibraryD11.dcp" />
|
||||
<DCCReference Include="..\Servidor\cxPageControlD11.dcp" />
|
||||
<DCCReference Include="..\Servidor\DataAbstract_Core_D11.dcp" />
|
||||
<DCCReference Include="..\Servidor\dbrtl.dcp" />
|
||||
<DCCReference Include="..\Servidor\dclIndyCore.dcp" />
|
||||
<DCCReference Include="..\Servidor\designide.dcp" />
|
||||
<DCCReference Include="..\Servidor\dsnap.dcp" />
|
||||
<DCCReference Include="..\Servidor\dxCoreD11.dcp" />
|
||||
<DCCReference Include="..\Servidor\dxGDIPlusD11.dcp" />
|
||||
<DCCReference Include="..\Servidor\dxLayoutControlD11.dcp" />
|
||||
<DCCReference Include="..\Servidor\dxPSCoreD11.dcp" />
|
||||
<DCCReference Include="..\Servidor\dxThemeD11.dcp" />
|
||||
<DCCReference Include="..\Servidor\GUISDK_D11R.dcp" />
|
||||
<DCCReference Include="..\Servidor\IndyCore.dcp" />
|
||||
<DCCReference Include="..\Servidor\IndyProtocols.dcp" />
|
||||
<DCCReference Include="..\Servidor\IndySystem.dcp" />
|
||||
<DCCReference Include="..\Servidor\Jcl.dcp" />
|
||||
<DCCReference Include="..\Servidor\JclVcl.dcp" />
|
||||
<DCCReference Include="..\Servidor\JSDialog100.dcp" />
|
||||
<DCCReference Include="..\Servidor\JvCmpD11R.dcp" />
|
||||
<DCCReference Include="..\Servidor\JvCoreD11R.dcp" />
|
||||
<DCCReference Include="..\Servidor\JvCtrlsD11R.dcp" />
|
||||
<DCCReference Include="..\Servidor\JvDlgsD11R.dcp" />
|
||||
<DCCReference Include="..\Servidor\JvMMD11R.dcp" />
|
||||
<DCCReference Include="..\Servidor\JvNetD11R.dcp" />
|
||||
<DCCReference Include="..\Servidor\JvPageCompsD11R.dcp" />
|
||||
<DCCReference Include="..\Servidor\JvStdCtrlsD11R.dcp" />
|
||||
<DCCReference Include="..\Servidor\JvSystemD11R.dcp" />
|
||||
<DCCReference Include="..\Servidor\pckMD5.dcp" />
|
||||
<DCCReference Include="..\Servidor\pckUCDataConnector.dcp" />
|
||||
<DCCReference Include="..\Servidor\pckUserControl_RT.dcp" />
|
||||
<DCCReference Include="..\Servidor\PngComponentsD10.dcp" />
|
||||
<DCCReference Include="..\Servidor\PNG_D10.dcp" />
|
||||
<DCCReference Include="..\Servidor\RemObjects_Core_D11.dcp" />
|
||||
<DCCReference Include="..\Servidor\RemObjects_Indy_D11.dcp" />
|
||||
<DCCReference Include="..\Servidor\rtl.dcp" />
|
||||
<DCCReference Include="..\Servidor\SpTBXLib_d11.dcp" />
|
||||
<DCCReference Include="..\Servidor\tb2k_d11.dcp" />
|
||||
<DCCReference Include="..\Servidor\vcl.dcp" />
|
||||
<DCCReference Include="..\Servidor\vclactnband.dcp" />
|
||||
<DCCReference Include="..\Servidor\vcldb.dcp" />
|
||||
<DCCReference Include="..\Servidor\vcljpg.dcp" />
|
||||
<DCCReference Include="..\Servidor\VclSmp.dcp" />
|
||||
<DCCReference Include="..\Servidor\vclx.dcp" />
|
||||
<DCCReference Include="..\Servidor\xmlrtl.dcp" />
|
||||
<DCCReference Include="Conexion\uConfigurarConexion.pas">
|
||||
<Form>fConfigurarConexion</Form>
|
||||
<DesignClass>TForm</DesignClass>
|
||||
|
||||
Binary file not shown.
5
Source/Informes/InfPedidoCliente.fr3
Normal file
5
Source/Informes/InfPedidoCliente.fr3
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TfrxReport Version="4.8.11" DotMatrixReport="False" EngineOptions.DoublePass="True" IniFile="\Software\Fast Reports" PreviewOptions.Buttons="4095" PreviewOptions.Zoom="1" PrintOptions.Printer="Por defecto" PrintOptions.PrintOnSheet="0" ReportOptions.CreateDate="39065,8724234954" ReportOptions.Description.Text="" ReportOptions.LastChange="40245,7797545833" ScriptLanguage="PascalScript" ScriptText.Text="begin end." ShowProgress="False" StoreInDFM="False" OnStartReport="frxReportOnStartReport" PropData="044C65667403910003546F7002100844617461736574730100095661726961626C65730100055374796C650100">
|
||||
<TfrxDataPage Name="Data" Height="1000" Left="0" Top="0" Width="1000"/>
|
||||
<TfrxReportPage Name="Page1" PaperWidth="210" PaperHeight="297" PaperSize="9" LeftMargin="10" RightMargin="10" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text=""/>
|
||||
</TfrxReport>
|
||||
@ -49,23 +49,23 @@
|
||||
<DelphiCompile Include="PedidosCliente_controller.dpk">
|
||||
<MainSource>MainSource</MainSource>
|
||||
</DelphiCompile>
|
||||
<DCCReference Include="..\..\..\Servidor\adortl.dcp" />
|
||||
<DCCReference Include="..\..\..\Servidor\Articulos_controller.dcp" />
|
||||
<DCCReference Include="..\..\..\Servidor\Contactos_controller.dcp" />
|
||||
<DCCReference Include="..\..\..\Servidor\Contactos_model.dcp" />
|
||||
<DCCReference Include="..\..\..\Servidor\cxLibraryD11.dcp" />
|
||||
<DCCReference Include="..\..\..\Servidor\DataAbstract_Core_D11.dcp" />
|
||||
<DCCReference Include="..\..\..\Servidor\dbrtl.dcp" />
|
||||
<DCCReference Include="..\..\..\Servidor\dsnap.dcp" />
|
||||
<DCCReference Include="..\..\..\Servidor\dxGDIPlusD11.dcp" />
|
||||
<DCCReference Include="..\..\..\Servidor\dxThemeD11.dcp" />
|
||||
<DCCReference Include="..\..\..\Servidor\GUIBase.dcp" />
|
||||
<DCCReference Include="..\..\..\Servidor\PedidosCliente_data.dcp" />
|
||||
<DCCReference Include="..\..\..\Servidor\PedidosCliente_model.dcp" />
|
||||
<DCCReference Include="..\..\..\Servidor\RemObjects_Core_D11.dcp" />
|
||||
<DCCReference Include="..\..\..\Servidor\rtl.dcp" />
|
||||
<DCCReference Include="..\..\..\Servidor\vcl.dcp" />
|
||||
<DCCReference Include="..\..\..\Servidor\vcldb.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\adortl.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\Articulos_controller.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\Contactos_controller.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\Contactos_model.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\cxLibraryD11.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\DataAbstract_Core_D11.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\dbrtl.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\dsnap.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\dxGDIPlusD11.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\dxThemeD11.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\GUIBase.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\PedidosCliente_data.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\PedidosCliente_model.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\RemObjects_Core_D11.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\rtl.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\vcl.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\vcldb.dcp" />
|
||||
<DCCReference Include="uArticulosPedidoClienteController.pas" />
|
||||
<DCCReference Include="uDetallesPedidoClienteController.pas" />
|
||||
<DCCReference Include="uPedidosClienteController.pas" />
|
||||
|
||||
Binary file not shown.
@ -1,4 +1,4 @@
|
||||
unit uDetallesPedidoClienteController;
|
||||
unit uDetallesPedidoClienteController;
|
||||
|
||||
interface
|
||||
|
||||
|
||||
@ -147,7 +147,7 @@ uses
|
||||
uBizContactos, uDataTableUtils, uDataModuleUsuarios, uFactuGES_App,
|
||||
schPedidosClienteClient_Intf, uDAInterfaces, uDateUtils, uIEditorPedidoCliente,
|
||||
uIEditorElegirPedidosCliente, uIEditorDireccionEntregaPedidoCliente,
|
||||
schContactosClient_Intf, uPedidosClienteReportController,
|
||||
schContactosClient_Intf, uPedidosClienteReportController, uIntegerListUtils,
|
||||
uIDialogListaPedidosCliEnvioEMail, uSistemaFunc, uStringsUtils, uDialogElegirEMail, Forms, uEMailUtils;
|
||||
|
||||
{ TPedidosClienteController }
|
||||
@ -672,10 +672,10 @@ begin
|
||||
Result := (APedido.SITUACION <> SITUACION_PEDIDO_SERVIDO);
|
||||
end;
|
||||
|
||||
procedure TPedidosClienteController.RecalcularImportes(
|
||||
APedido: IBizPedidoCliente);
|
||||
procedure TPedidosClienteController.RecalcularImportes(APedido: IBizPedidoCliente);
|
||||
var
|
||||
bEnEdicion : Boolean;
|
||||
ADetallePosAct : Integer;
|
||||
begin
|
||||
if not Assigned(APedido) then
|
||||
raise Exception.Create ('Pedido no asignado (RecalcularImportes)');
|
||||
@ -683,18 +683,26 @@ begin
|
||||
if APedido.DataTable.Active then
|
||||
APedido.DataTable.Active := True;
|
||||
|
||||
{ Hay que guardar la posición en la que estamos en los detalles por que
|
||||
la asignación de valores a los campos IMPORTE_NETO e IMPORTE_PORTE
|
||||
(ver más adelante) colocan el puntero en la tabla detalle al principio.
|
||||
No he encontrado la razón por la que mueve el puntero. }
|
||||
|
||||
ADetallePosAct := APedido.Detalles.POSICION;
|
||||
|
||||
bEnEdicion := (APedido.DataTable.State in dsEditModes);
|
||||
if not bEnEdicion then
|
||||
APedido.Edit;
|
||||
APedido.Edit;
|
||||
|
||||
ShowHourglassCursor;
|
||||
APedido.Edit;
|
||||
try
|
||||
APedido.IMPORTE_NETO := FDetallesController.DarTotalImporteTotal(APedido.Detalles);
|
||||
if not bEnEdicion then
|
||||
APedido.Post;
|
||||
finally
|
||||
HideHourglassCursor;
|
||||
// Restaurar la posición que teníamos en los detalles.
|
||||
FDetallesController.LocalizarPosicion(APedido.Detalles, ADetallePosAct);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -903,12 +911,13 @@ end;
|
||||
procedure TPedidosClienteController.Preview(APedido: IBizPedidoCliente; AllItems: Boolean = false);
|
||||
var
|
||||
AReportController : IPedidosClienteReportController;
|
||||
ID_Pedidos: TStringList;
|
||||
ID_Pedidos: TIntegerList;
|
||||
|
||||
begin
|
||||
AReportController := TPedidosClienteReportController.Create;
|
||||
ID_Pedidos := TIntegerList.Create;
|
||||
|
||||
try
|
||||
ID_Pedidos := TStringList.Create;
|
||||
|
||||
//Si deseamos previsualizar todos los items del objeto albaran
|
||||
if AllItems then
|
||||
@ -918,33 +927,33 @@ begin
|
||||
First;
|
||||
while not EOF do
|
||||
begin
|
||||
ID_Pedidos.Add(IntToStr(APedido.ID));
|
||||
ID_Pedidos.Add(APedido.ID);
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
end
|
||||
//Solo previsualizamos el item seleccionado
|
||||
else
|
||||
ID_Pedidos.Add(IntToStr(APedido.ID));
|
||||
ID_Pedidos.Add(APedido.ID);
|
||||
|
||||
AReportController.Preview(ID_Pedidos.CommaText);
|
||||
AReportController.Preview(ID_Pedidos);
|
||||
|
||||
finally
|
||||
AReportController := NIL;
|
||||
ID_Pedidos.Free;
|
||||
FreeANDNIL(ID_Pedidos);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TPedidosClienteController.Print(APedido: IBizPedidoCliente; AllItems: Boolean = false): Boolean;
|
||||
var
|
||||
AReportController : IPedidosClienteReportController;
|
||||
ID_Pedidos: TStringList;
|
||||
ID_Pedidos: TIntegerList;
|
||||
|
||||
begin
|
||||
Result := False;
|
||||
AReportController := TPedidosClienteReportController.Create;
|
||||
ID_Pedidos := TIntegerList.Create;
|
||||
|
||||
try
|
||||
ID_Pedidos := TStringList.Create;
|
||||
|
||||
//Si deseamos previsualizar todos los items del objeto albaran
|
||||
if AllItems then
|
||||
@ -954,20 +963,20 @@ begin
|
||||
First;
|
||||
while not EOF do
|
||||
begin
|
||||
ID_Pedidos.Add(IntToStr(APedido.ID));
|
||||
ID_Pedidos.Add(APedido.ID);
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
end
|
||||
//Solo previsualizamos el item seleccionado
|
||||
else
|
||||
ID_Pedidos.Add(IntToStr(APedido.ID));
|
||||
ID_Pedidos.Add(APedido.ID);
|
||||
|
||||
Result := AReportController.Print(ID_Pedidos.CommaText);
|
||||
AReportController.Print(ID_Pedidos);
|
||||
|
||||
finally
|
||||
AReportController := NIL;
|
||||
ID_Pedidos.Free;
|
||||
FreeANDNIL(ID_Pedidos);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
@ -5,41 +5,41 @@ interface
|
||||
uses
|
||||
Classes, SysUtils, uDADataTable, uControllerBase, uIDataModulePedidosClienteReport,
|
||||
uClientesController, uPedidosClienteController, uDetallesPedidoClienteController,
|
||||
uBizPedidosCliente;
|
||||
uBizPedidosCliente, uIntegerListUtils;
|
||||
|
||||
type
|
||||
IPedidosClienteReportController = interface
|
||||
['{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;
|
||||
IPedidosClienteReportController = interface(IControllerBase)
|
||||
['{1F989C7E-9B12-4208-8CB3-C4E1B202D62A}']
|
||||
procedure Preview(const AListaID : TIntegerList);
|
||||
procedure Print(const AListaID : TIntegerList);
|
||||
end;
|
||||
|
||||
TPedidosClienteReportController = class(TInterfacedObject, IPedidosClienteReportController)
|
||||
TPedidosClienteReportController = class(TControllerBase, IPedidosClienteReportController)
|
||||
private
|
||||
FDataModule : IDataModulePedidosClienteReport;
|
||||
function CreateEditor(const AName: String; const IID: TGUID; out Intf): Boolean;
|
||||
|
||||
public
|
||||
constructor Create;
|
||||
constructor Create; override;
|
||||
destructor Destroy; override;
|
||||
|
||||
procedure Preview(const AID : String);
|
||||
function Print(const AID : String): Boolean;
|
||||
function ExportToPDF(const AID: Integer; const AFileName : String = ''): Boolean;
|
||||
procedure Preview(const AListaID : TIntegerList);
|
||||
procedure Print(const AListaID : TIntegerList);
|
||||
end;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
uROTypes, uEditorRegistryUtils, uIEditorPedidosClientePreview,
|
||||
uEditorPreview, uDataModulePedidosCliente, uEditorBase, cxControls,
|
||||
schPedidosClienteClient_Intf, uStringsUtils;
|
||||
uROTypes, Controls, uEditorRegistryUtils, uIEditorPedidosClientePreview,
|
||||
uEditorPreview, uDataModulePedidosCliente,
|
||||
uEditorBase, cxControls, uStringsUtils, uSistemaFunc, uFactuGES_App;
|
||||
|
||||
{ TPedidosClienteReportController }
|
||||
|
||||
constructor TPedidosClienteReportController.Create;
|
||||
begin
|
||||
inherited;
|
||||
FDataModule := TDataModulePedidosCliente.Create(Nil);
|
||||
end;
|
||||
|
||||
@ -56,30 +56,40 @@ begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function TPedidosClienteReportController.ExportToPDF(const AID: Integer;
|
||||
const AFileName: String): Boolean;
|
||||
procedure TPedidosClienteReportController.Preview(const AListaID : TIntegerList);
|
||||
var
|
||||
AStream: Binary;
|
||||
AEditor : IEditorPedidosClientePreview;
|
||||
begin
|
||||
Result := False;
|
||||
if EsCadenaVacia(AFileName) then
|
||||
Exit;
|
||||
AEditor := NIL;
|
||||
|
||||
ShowHourglassCursor;
|
||||
try
|
||||
AStream := FDataModule.GetRptPDF(AID, True);
|
||||
AStream := FDataModule.GetRptPedidos(AListaID);
|
||||
try
|
||||
AStream.SaveToFile(AFileName);
|
||||
Result := True;
|
||||
CreateEditor('EditorPedidosClientePreview', IEditorPedidosClientePreview, AEditor);
|
||||
if Assigned(AEditor) then
|
||||
begin
|
||||
try
|
||||
AEditor.Controller := Self;
|
||||
AEditor.ListaID := AListaID;
|
||||
AEditor.Title := 'Pedido - ' + AppFactuGES.EmpresaActiva.NOMBRE;
|
||||
AEditor.LoadFromStream(AStream);
|
||||
AEditor.Preview;
|
||||
finally
|
||||
AEditor.Release;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
FreeAndNil(AStream);
|
||||
AEditor := Nil;
|
||||
end;
|
||||
finally
|
||||
HideHourglassCursor;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TPedidosClienteReportController.Preview(const AID : String);
|
||||
procedure TPedidosClienteReportController.Print(const AListaID : TIntegerList);
|
||||
var
|
||||
AStream: Binary;
|
||||
AEditor : IEditorPedidosClientePreview;
|
||||
@ -88,49 +98,28 @@ begin
|
||||
|
||||
ShowHourglassCursor;
|
||||
try
|
||||
AStream := FDataModule.GetReport(AID, True);
|
||||
AStream := FDataModule.GetRptPedidos(AListaID);
|
||||
try
|
||||
CreateEditor('EditorPedidosClientePreview', IEditorPedidosClientePreview, AEditor);
|
||||
AEditor.LoadFromStream(AStream);
|
||||
if Assigned(AEditor) then
|
||||
begin
|
||||
try
|
||||
AEditor.Controller := Self;
|
||||
AEditor.ListaID := AListaID;
|
||||
AEditor.Title := 'Albarán - ' + AppFactuGES.EmpresaActiva.NOMBRE;
|
||||
AEditor.LoadFromStream(AStream);
|
||||
AEditor.Print;
|
||||
finally
|
||||
AEditor.Release;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
AStream.Free;
|
||||
FreeAndNil(AStream);
|
||||
AEditor := Nil;
|
||||
end;
|
||||
finally
|
||||
HideHourglassCursor;
|
||||
end;
|
||||
|
||||
if Assigned(AEditor) then
|
||||
AEditor.Preview;
|
||||
end;
|
||||
|
||||
function TPedidosClienteReportController.Print(const AID : String): Boolean;
|
||||
var
|
||||
AStream: Binary;
|
||||
AEditor : IEditorPedidosClientePreview;
|
||||
begin
|
||||
{ Result := False;
|
||||
AEditor := NIL;
|
||||
|
||||
ShowHourglassCursor;
|
||||
try
|
||||
AStream := FDataModule.GetReport(AID);
|
||||
try
|
||||
CreateEditor('EditorPedidosClientePreview', IEditorPedidosClientePreview, AEditor);
|
||||
AEditor.LoadFromStream(AStream);
|
||||
finally
|
||||
AStream.Free;
|
||||
end;
|
||||
finally
|
||||
HideHourglassCursor;
|
||||
end;
|
||||
|
||||
if Assigned(AEditor) then
|
||||
begin
|
||||
AEditor.TablaImpresion := nme_PedidosCliente;
|
||||
AEditor.IdTablaImpresion := AID;
|
||||
Result := AEditor.Print;
|
||||
end;
|
||||
}
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -49,13 +49,12 @@
|
||||
<DelphiCompile Include="PedidosCliente_data.dpk">
|
||||
<MainSource>MainSource</MainSource>
|
||||
</DelphiCompile>
|
||||
<DCCReference Include="..\..\..\Servidor\PedidosCliente_model.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\PedidosCliente_model.dcp" />
|
||||
<DCCReference Include="uDataModulePedidosCliente.pas">
|
||||
<Form>DataModulePedidosCliente</Form>
|
||||
</DCCReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
<!-- EurekaLog First Line
|
||||
[Exception Log]
|
||||
EurekaLog Version=6011
|
||||
|
||||
Binary file not shown.
@ -7,7 +7,7 @@ uses
|
||||
uRORemoteService, uROClient, uROBinMessage, uDAScriptingProvider,
|
||||
uDAMemDataTable, uROWinInetHttpChannel, uDADataTable, uDABINAdapter,
|
||||
|
||||
uDAClientDataModule, uROTypes,
|
||||
uDAClientDataModule, uROTypes, uIntegerListUtils,
|
||||
uIDataModulePedidosCliente, uBizPedidosCliente, uBizDetallesPedidoCliente, uBizDetalleColoresPedidoCliente,
|
||||
uIDataModulePedidosClienteReport, uDADataAdapter, uDARemoteDataAdapter,
|
||||
uDADataStreamer, uDABin2DataStreamer, uDAInterfaces, uDACDSDataTable;
|
||||
@ -47,8 +47,7 @@ type
|
||||
function GetArticulosPendientes(const IDPedido: Integer): IBizPedidoClienteArticulosPend;
|
||||
|
||||
// Report
|
||||
function GetReport(const AID: String; const ShowLogotipo: Boolean = False): Binary;
|
||||
function GetRptPDF(const AID: Integer; const ShowLogotipo: Boolean = False): Binary;
|
||||
function GetRptPedidos(const ListaID: TIntegerList): Binary;
|
||||
|
||||
function GetAnosItems : TStringList;
|
||||
end;
|
||||
@ -74,24 +73,16 @@ begin
|
||||
RORemoteService.Message := dmConexion.Message;
|
||||
end;
|
||||
|
||||
function TDataModulePedidosCliente.GetReport(const AID: String; const ShowLogotipo: Boolean = False): Binary;
|
||||
begin
|
||||
// Result := (RORemoteService as IsrvPedidosCliente).GenerateReport(AID, ShowLogotipo)
|
||||
end;
|
||||
|
||||
function TDataModulePedidosCliente.GetRptPDF(const AID: Integer;
|
||||
const ShowLogotipo: Boolean): Binary;
|
||||
function TDataModulePedidosCliente.GetRptPedidos(const ListaID: TIntegerList): Binary;
|
||||
var
|
||||
AParam : TIntegerArray;
|
||||
begin
|
||||
{ AParam := TIntegerArray.Create;
|
||||
AParam := ListaID.ToIntegerArray;
|
||||
try
|
||||
AParam.Add(AID);
|
||||
Result := (RORemoteService as IsrvPedidosCliente).GenerarReportPDF(AParam, ShowLogotipo)
|
||||
Result := (RORemoteService as IsrvPedidosCliente).GenerarInforme(AParam);
|
||||
finally
|
||||
FreeANDNIL(AParam)
|
||||
FreeAndNil(AParam);
|
||||
end;
|
||||
}
|
||||
end;
|
||||
|
||||
function TDataModulePedidosCliente.NewItem: IBizPedidoCliente;
|
||||
|
||||
@ -3,13 +3,12 @@ unit uIDataModulePedidosClienteReport;
|
||||
interface
|
||||
|
||||
uses
|
||||
uROTypes;
|
||||
uROTypes, uIntegerListUtils;
|
||||
|
||||
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;
|
||||
function GetRptPedidos(const ListaID: TIntegerList): Binary;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
@ -49,6 +49,10 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<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 Name="C:\Archivos de programa\EurekaLog 5\Delphi10\ExceptionExpert10.bpl">EurekaLog 5.1.9</Excluded_Packages>
|
||||
</Excluded_Packages><Source><Source Name="MainSource">PedidosCliente_model.dpk</Source></Source></Delphi.Personality></BorlandProject></BorlandProject>
|
||||
@ -58,23 +62,23 @@
|
||||
<DelphiCompile Include="PedidosCliente_model.dpk">
|
||||
<MainSource>MainSource</MainSource>
|
||||
</DelphiCompile>
|
||||
<DCCReference Include="adortl.dcp" />
|
||||
<DCCReference Include="ApplicationBase.dcp" />
|
||||
<DCCReference Include="Contactos_model.dcp" />
|
||||
<DCCReference Include="DataAbstract_Core_D11.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\adortl.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\ApplicationBase.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\Contactos_model.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\DataAbstract_Core_D11.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\dbrtl.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\dsnap.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\RemObjects_Core_D11.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\rtl.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\vcl.dcp" />
|
||||
<DCCReference Include="..\..\Albaranes de cliente\Controller\vcldb.dcp" />
|
||||
<DCCReference Include="Data\uIDataModulePedidosCliente.pas" />
|
||||
<DCCReference Include="Data\uIDataModulePedidosClienteReport.pas" />
|
||||
<DCCReference Include="dbrtl.dcp" />
|
||||
<DCCReference Include="dsnap.dcp" />
|
||||
<DCCReference Include="RemObjects_Core_D11.dcp" />
|
||||
<DCCReference Include="rtl.dcp" />
|
||||
<DCCReference Include="schPedidosClienteClient_Intf.pas" />
|
||||
<DCCReference Include="schPedidosClienteServer_Intf.pas" />
|
||||
<DCCReference Include="uBizDetalleColoresPedidoCliente.pas" />
|
||||
<DCCReference Include="uBizDetallesPedidoCliente.pas" />
|
||||
<DCCReference Include="uBizPedidosCliente.pas" />
|
||||
<DCCReference Include="vcl.dcp" />
|
||||
<DCCReference Include="vcldb.dcp" />
|
||||
<None Include="ModelSupport_PedidosCliente_model\default.txaPackage" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
Binary file not shown.
@ -235,7 +235,7 @@ end;
|
||||
procedure TBizPedidoCliente.OnNewRecord(Sender: TDADataTable);
|
||||
begin
|
||||
inherited;
|
||||
ID := GetRecNo; // -1, -2, -3...
|
||||
// ID := GetRecNo; // -1, -2, -3...
|
||||
IniciarValoresPedidoNuevo;
|
||||
end;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -7,15 +7,13 @@ uses
|
||||
Dialogs, frxClass, frxDBSet, uDAScriptingProvider,
|
||||
uDADataTable, uDACDSDataTable, DB, uDAClasses, frxChart, frxGradient,
|
||||
frxChBox, frxCross, frxOLE, frxBarcode, frxRich, uDABINAdapter, uROTypes,
|
||||
uDAInterfaces, FactuGES_Intf, frxExportPDF;
|
||||
uDAInterfaces, uDADataStreamer, IBCustomDataSet, IBQuery, IBDatabase,
|
||||
uDAMemDataTable, frxExportPDF, FactuGES_Intf, uDABin2DataStreamer, uROClient;
|
||||
|
||||
type
|
||||
TRptPedidosCliente = class(TDataModule)
|
||||
DADataCabecera: TDADataSource;
|
||||
DADataDetalles: TDADataSource;
|
||||
tbl_Cabecera: TDACDSDataTable;
|
||||
tbl_Detalles: TDACDSDataTable;
|
||||
DABINAdapter: TDABINAdapter;
|
||||
DADSCabecera: TDADataSource;
|
||||
DADSDetalles: TDADataSource;
|
||||
frxRichObject1: TfrxRichObject;
|
||||
frxBarCodeObject1: TfrxBarCodeObject;
|
||||
frxOLEObject1: TfrxOLEObject;
|
||||
@ -25,19 +23,57 @@ type
|
||||
frxChartObject1: TfrxChartObject;
|
||||
frxDBCabecera: TfrxDBDataset;
|
||||
frxDBDetalles: TfrxDBDataset;
|
||||
schReport: TDASchema;
|
||||
DataDictionary: TDADataDictionary;
|
||||
frxReport: TfrxReport;
|
||||
IBDatabase1: TIBDatabase;
|
||||
IBTransaction1: TIBTransaction;
|
||||
DataSource1: TDataSource;
|
||||
DataSource3: TDataSource;
|
||||
detalles: TIBQuery;
|
||||
cabecera: TIBQuery;
|
||||
cabeceraID: TIntegerField;
|
||||
cabeceraID_EMPRESA: TIntegerField;
|
||||
cabeceraID_CLIENTE: TIntegerField;
|
||||
cabeceraFECHA_ALBARAN: TDateField;
|
||||
cabeceraREFERENCIA: TIBStringField;
|
||||
cabeceraREFERENCIA_CLIENTE: TIBStringField;
|
||||
cabeceraID_PEDIDO: TIntegerField;
|
||||
cabeceraREF_PEDIDO: TIBStringField;
|
||||
cabeceraOBSERVACIONES: TMemoField;
|
||||
cabeceraIMPORTE_TOTAL: TIBBCDField;
|
||||
cabeceraNIF_CIF: TIBStringField;
|
||||
cabeceraNOMBRE: TIBStringField;
|
||||
cabeceraPERSONA_CONTACTO: TIBStringField;
|
||||
cabeceraCALLE: TIBStringField;
|
||||
cabeceraPOBLACION: TIBStringField;
|
||||
cabeceraPROVINCIA: TIBStringField;
|
||||
cabeceraCODIGO_POSTAL: TIBStringField;
|
||||
detallesID: TIntegerField;
|
||||
detallesID_ALBARAN: TIntegerField;
|
||||
detallesPOSICION: TIntegerField;
|
||||
detallesTIPO_DETALLE: TIBStringField;
|
||||
detallesCONCEPTO: TIBStringField;
|
||||
detallesCANTIDAD: TIntegerField;
|
||||
detallesIMPORTE_UNIDAD: TIBBCDField;
|
||||
detallesIMPORTE_TOTAL: TIBBCDField;
|
||||
detallesREFERENCIA: TIBStringField;
|
||||
tbl_Cabecera: TDAMemDataTable;
|
||||
tbl_Detalles: TDAMemDataTable;
|
||||
frxPDFExport1: TfrxPDFExport;
|
||||
DABin2DataStreamer1: TDABin2DataStreamer;
|
||||
schReport: TDASchema;
|
||||
frxDBEtiquetas: TfrxDBDataset;
|
||||
DADSEtiquetas: TDADataSource;
|
||||
tbl_Etiquetas: TDAMemDataTable;
|
||||
procedure DataModuleCreate(Sender: TObject);
|
||||
procedure frxReportGetValue(const VarName: string; var Value: Variant);
|
||||
procedure DataModuleDestroy(Sender: TObject);
|
||||
private
|
||||
FConnection: IDAConnection;
|
||||
FShowLogotipo: Boolean;
|
||||
procedure _GenerarPedido(const AID : Integer); overload;
|
||||
//Genera cada uno de los pedidos a imprimir
|
||||
procedure _GenerarPedido(const AID: Integer);
|
||||
public
|
||||
function GenerarPedido(const AID : String; const AConLogotipo: Boolean = False): Binary; overload;
|
||||
function GenerarReportEnPDF(const ListaID : TIntegerArray; const AConLogotipo: Boolean = False): Binary;
|
||||
function GenerarPedido(const AListaID : TIntegerArray): Binary;
|
||||
function GenerarEtiquetas(const AListaID : TIntegerArray; const AMercancia: Variant; const ABultos: Integer): Binary;
|
||||
function GenerarPedidoEnPDF(const ListaID : TIntegerArray): Binary;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -45,17 +81,19 @@ implementation
|
||||
{$R *.dfm}
|
||||
|
||||
uses
|
||||
uDataModuleServer, schPedidosClienteClient_Intf;
|
||||
uSistemaFunc, uDataModuleServer, schPedidosClienteClient_Intf;
|
||||
|
||||
const
|
||||
rptInforme = 'InfPedidoCliente.fr3';
|
||||
rptInfEtiquetas = 'InfEtiquetasPedidoCliente.fr3';
|
||||
|
||||
{ Dataset names for schReport }
|
||||
ds_InformeCabecera = 'Informe_Cabecera';
|
||||
ds_InformeDetalles = 'Informe_Detalles';
|
||||
ds_InformeDetallesEtiquetas = 'Informe_Detalles_Etiquetas';
|
||||
|
||||
|
||||
{ TRptPedidosProveedor }
|
||||
{ TRptPedidosCliente }
|
||||
|
||||
|
||||
procedure TRptPedidosCliente.DataModuleCreate(Sender: TObject);
|
||||
@ -63,35 +101,39 @@ begin
|
||||
schReport.ConnectionManager := dmServer.ConnectionManager;
|
||||
FConnection := dmServer.DarNuevaConexion;
|
||||
frxReport.EngineOptions.NewSilentMode := simReThrow;
|
||||
|
||||
frxDBCabecera.DataSource := DADSCabecera;
|
||||
frxDBCabecera.CloseDataSource := False;
|
||||
|
||||
frxDBDetalles.DataSource := DADSDetalles;
|
||||
frxDBDetalles.CloseDataSource := False;
|
||||
end;
|
||||
|
||||
function TRptPedidosCliente.GenerarPedido(const AID: String; const AConLogotipo: Boolean = False): Binary;
|
||||
var
|
||||
ID_Pedidos: TStringList;
|
||||
i: Integer;
|
||||
procedure TRptPedidosCliente.DataModuleDestroy(Sender: TObject);
|
||||
begin
|
||||
tbl_Cabecera.Active := False;
|
||||
tbl_Detalles.Active := False;
|
||||
end;
|
||||
|
||||
function TRptPedidosCliente.GenerarPedido(const AListaID : TIntegerArray): Binary;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
try
|
||||
FShowLogotipo := AConLogotipo;
|
||||
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]));
|
||||
|
||||
//Vamos generando todos y cada uno de los pedidos recibidos
|
||||
for i := 0 to AListaID.Count - 1 do
|
||||
_GenerarPedido(AListaID.Items[i]);
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
finally
|
||||
end;
|
||||
end;
|
||||
|
||||
function TRptPedidosCliente.GenerarReportEnPDF(const ListaID: TIntegerArray;
|
||||
const AConLogotipo: Boolean): Binary;
|
||||
function TRptPedidosCliente.GenerarPedidoEnPDF(
|
||||
const ListaID: TIntegerArray): Binary;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
FShowLogotipo := AConLogotipo;
|
||||
Result := Binary.Create;
|
||||
try
|
||||
//Vamos generando todos y cada uno de los presupuestos recibidos
|
||||
@ -104,42 +146,65 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRptPedidosCliente.frxReportGetValue(const VarName: string;
|
||||
var Value: Variant);
|
||||
begin
|
||||
if VarName = 'ShowLogotipo' then
|
||||
Value := FShowLogotipo;
|
||||
end;
|
||||
|
||||
procedure TRptPedidosCliente._GenerarPedido(const AID: Integer);
|
||||
var
|
||||
AStream: TMemoryStream;
|
||||
dsMaster: IDADataset;
|
||||
dsDetail: IDADataset;
|
||||
AInforme: Variant;
|
||||
|
||||
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]);
|
||||
dsDetail := schReport.NewDataset(FConnection, ds_InformeDetalles, ['ID_PEDIDO'], [AID], False);
|
||||
tbl_Cabecera.Active := False;
|
||||
tbl_Detalles.Active := False;
|
||||
|
||||
AStream.Clear;
|
||||
DABINAdapter.WriteDataset(AStream, dsMaster, [woRows, woSchema], -1);
|
||||
DABINAdapter.ReadDataset(AStream, tbl_Cabecera, TRUE, '', TRUE, TRUE);
|
||||
// tbl_Cabecera.ParamByName('ID').AsInteger := AID;
|
||||
// tbl_Detalles.ParamByName('ID_PEDIDO').AsInteger := AID;
|
||||
|
||||
AStream.Clear;
|
||||
DABINAdapter.WriteDataset(AStream, dsDetail, [woRows, woSchema], -1);
|
||||
DABINAdapter.ReadDataset(AStream, tbl_Detalles, TRUE, '', TRUE, TRUE);
|
||||
tbl_Cabecera.Active := True;
|
||||
tbl_Detalles.Active := True;
|
||||
|
||||
frxReport.LoadFromFile(DarRutaInformes + rptInforme, True);
|
||||
AInforme := DarRutaFichero(DarRutaInformes, rptInforme); //, tbl_Cabecera.FieldByName('ID_EMPRESA').AsString); pedidos comunes a todas las empresas
|
||||
if VarIsNull(AInforme) then
|
||||
raise Exception.Create (('Error Servidor: _GenerarPedido, no encuentra informe ' + rptInforme));
|
||||
|
||||
frxReport.LoadFromFile(AInforme, True);
|
||||
frxReport.PrepareReport(False);
|
||||
|
||||
finally
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
AStream.Free;
|
||||
dsMaster := Nil;
|
||||
dsDetail := Nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TRptPedidosCliente.GenerarEtiquetas(const AListaID : TIntegerArray; const AMercancia: Variant; const ABultos: Integer): Binary;
|
||||
var
|
||||
i: Integer;
|
||||
AInforme: Variant;
|
||||
Cadena : String;
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
try
|
||||
//Vamos generando todos y cada uno de los pedidos recibidos
|
||||
for i := 0 to AListaID.Count - 1 do
|
||||
begin
|
||||
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
try
|
||||
tbl_Etiquetas.Active := False;
|
||||
tbl_Etiquetas.ParamByName('ID').AsInteger := AListaID.Items[i];
|
||||
tbl_Etiquetas.Active := True;
|
||||
|
||||
AInforme := DarRutaFichero(DarRutaInformes, rptInfEtiquetas);
|
||||
if VarIsNull(AInforme) then
|
||||
raise Exception.Create (('Error Servidor: GenerarEtiquetas, no encuentra informe ' + rptInfEtiquetas));
|
||||
|
||||
frxReport.LoadFromFile(AInforme, True);
|
||||
|
||||
frxReport.Variables.Variables['Mercancia'] := '''' + AMercancia + '''';
|
||||
frxReport.Variables.Variables['Bultos'] := ABultos;
|
||||
frxReport.PrepareReport(False);
|
||||
finally
|
||||
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
|
||||
end;
|
||||
end;
|
||||
frxReport.PreviewPages.SaveToStream(Result);
|
||||
finally
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
@ -43,9 +43,8 @@ implementation
|
||||
uses
|
||||
Dialogs,
|
||||
{Generated:} FactuGES_Invk, uDataModuleServer, uDatabaseUtils,
|
||||
schPedidosClienteClient_Intf, uRestriccionesUsuarioUtils
|
||||
// uRptPedidosCliente_Server
|
||||
, uBizPedidosClienteServer;
|
||||
schPedidosClienteClient_Intf, uRestriccionesUsuarioUtils,
|
||||
uRptPedidosCliente_Server, uBizPedidosClienteServer;
|
||||
|
||||
procedure Create_srvPedidosCliente(out anInstance : IUnknown);
|
||||
begin
|
||||
@ -78,15 +77,15 @@ begin
|
||||
end;
|
||||
|
||||
function TsrvPedidosCliente.GenerarInforme(const ListaID: TIntegerArray): Binary;
|
||||
//var
|
||||
// AReportGenerator : TRptAlbaranesCliente;
|
||||
var
|
||||
AReportGenerator : TRptPedidosCliente;
|
||||
begin
|
||||
// AReportGenerator := TRptAlbaranesCliente.Create(nil);
|
||||
// try
|
||||
// Result := AReportGenerator.GenerarAlbaran(ListaID);
|
||||
// finally
|
||||
// FreeAndNIL(AReportGenerator);
|
||||
// end;
|
||||
AReportGenerator := TRptPedidosCliente.Create(nil);
|
||||
try
|
||||
Result := AReportGenerator.GenerarPedido(ListaID);
|
||||
finally
|
||||
FreeAndNIL(AReportGenerator);
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
||||
@ -177,86 +177,36 @@ inherited fEditorPedidoCliente: TfEditorPedidoCliente
|
||||
ExplicitHeight = 336
|
||||
inherited ToolBar1: TToolBar
|
||||
Width = 618
|
||||
Height = 73
|
||||
ExplicitWidth = 618
|
||||
ExplicitHeight = 73
|
||||
inherited ToolButton4: TToolButton [1]
|
||||
Left = 109
|
||||
ExplicitLeft = 109
|
||||
inherited UpDown1: TUpDown
|
||||
Left = 203
|
||||
ExplicitLeft = 203
|
||||
end
|
||||
inherited ToolButton2: TToolButton
|
||||
Left = 0
|
||||
Top = 22
|
||||
inherited ToolButton13: TToolButton
|
||||
Left = 220
|
||||
ExplicitLeft = 220
|
||||
end
|
||||
inherited ToolButton14: TToolButton [3]
|
||||
Left = 114
|
||||
ExplicitLeft = 114
|
||||
inherited ToolButton6: TToolButton
|
||||
Left = 228
|
||||
ExplicitLeft = 228
|
||||
end
|
||||
inherited ToolButton3: TToolButton [4]
|
||||
Left = 179
|
||||
Top = 22
|
||||
ExplicitLeft = 179
|
||||
ExplicitTop = 22
|
||||
inherited ToolButton7: TToolButton
|
||||
Left = 294
|
||||
ExplicitLeft = 294
|
||||
end
|
||||
inherited ToolButton6: TToolButton [5]
|
||||
Left = 234
|
||||
Top = 22
|
||||
ExplicitLeft = 234
|
||||
ExplicitTop = 22
|
||||
end
|
||||
inherited ToolButton8: TToolButton [6]
|
||||
Left = 300
|
||||
Top = 22
|
||||
ExplicitLeft = 300
|
||||
ExplicitTop = 22
|
||||
end
|
||||
inherited FontName: TJvFontComboBox [7]
|
||||
Left = 383
|
||||
ExplicitLeft = 383
|
||||
end
|
||||
inherited FontSize: TEdit [8]
|
||||
Left = 528
|
||||
ExplicitLeft = 528
|
||||
end
|
||||
inherited UpDown1: TUpDown [9]
|
||||
Left = 570
|
||||
ExplicitLeft = 570
|
||||
end
|
||||
inherited ToolButton13: TToolButton [10]
|
||||
Left = 587
|
||||
ExplicitLeft = 587
|
||||
end
|
||||
inherited ToolButton7: TToolButton [11]
|
||||
Left = 595
|
||||
Top = 22
|
||||
Wrap = False
|
||||
ExplicitLeft = 595
|
||||
ExplicitTop = 22
|
||||
end
|
||||
inherited ToolButton12: TToolButton [12]
|
||||
end
|
||||
inherited ToolButton9: TToolButton [13]
|
||||
end
|
||||
inherited ToolButton10: TToolButton [14]
|
||||
end
|
||||
inherited ToolButton11: TToolButton [15]
|
||||
Left = 270
|
||||
Top = 49
|
||||
ExplicitLeft = 270
|
||||
ExplicitTop = 49
|
||||
inherited ToolButton8: TToolButton
|
||||
Left = 361
|
||||
ExplicitLeft = 361
|
||||
end
|
||||
end
|
||||
inherited cxGrid: TcxGrid
|
||||
Top = 99
|
||||
Width = 618
|
||||
Height = 237
|
||||
ExplicitWidth = 618
|
||||
ExplicitHeight = 237
|
||||
end
|
||||
inherited TBXDock1: TSpTBXDock
|
||||
Top = 73
|
||||
Width = 618
|
||||
ExplicitTop = 73
|
||||
ExplicitWidth = 618
|
||||
end
|
||||
inherited cxGridPopupMenu: TcxGridPopupMenu
|
||||
@ -344,12 +294,16 @@ inherited fEditorPedidoCliente: TfEditorPedidoCliente
|
||||
ExplicitWidth = 632
|
||||
ExplicitHeight = 143
|
||||
inherited Bevel3: TBevel
|
||||
Left = 300
|
||||
Height = 201
|
||||
ExplicitLeft = 300
|
||||
ExplicitHeight = 201
|
||||
end
|
||||
inherited Bevel4: TBevel
|
||||
Left = 433
|
||||
Width = 206
|
||||
Height = 9
|
||||
ExplicitLeft = 433
|
||||
ExplicitWidth = 206
|
||||
ExplicitHeight = 9
|
||||
end
|
||||
@ -361,18 +315,22 @@ inherited fEditorPedidoCliente: TfEditorPedidoCliente
|
||||
StyleHot.LookAndFeel.SkinName = ''
|
||||
end
|
||||
inherited ImporteIVA: TcxDBCurrencyEdit
|
||||
Left = 504
|
||||
Style.LookAndFeel.SkinName = ''
|
||||
Style.IsFontAssigned = True
|
||||
StyleDisabled.LookAndFeel.SkinName = ''
|
||||
StyleFocused.LookAndFeel.SkinName = ''
|
||||
StyleHot.LookAndFeel.SkinName = ''
|
||||
ExplicitLeft = 504
|
||||
end
|
||||
inherited ImporteTotal: TcxDBCurrencyEdit
|
||||
Left = 433
|
||||
Style.LookAndFeel.SkinName = ''
|
||||
Style.IsFontAssigned = True
|
||||
StyleDisabled.LookAndFeel.SkinName = ''
|
||||
StyleFocused.LookAndFeel.SkinName = ''
|
||||
StyleHot.LookAndFeel.SkinName = ''
|
||||
ExplicitLeft = 433
|
||||
ExplicitWidth = 90
|
||||
Width = 90
|
||||
end
|
||||
@ -384,33 +342,41 @@ inherited fEditorPedidoCliente: TfEditorPedidoCliente
|
||||
StyleHot.LookAndFeel.SkinName = ''
|
||||
end
|
||||
inherited edtIVA: TcxDBSpinEdit
|
||||
Left = 433
|
||||
Style.LookAndFeel.SkinName = ''
|
||||
Style.IsFontAssigned = True
|
||||
StyleDisabled.LookAndFeel.SkinName = ''
|
||||
StyleFocused.LookAndFeel.SkinName = ''
|
||||
StyleHot.LookAndFeel.SkinName = ''
|
||||
ExplicitLeft = 433
|
||||
end
|
||||
inherited ImporteBase: TcxDBCurrencyEdit
|
||||
Left = 433
|
||||
DataBinding.DataField = 'IMPORTE_NETO'
|
||||
Style.LookAndFeel.SkinName = ''
|
||||
Style.IsFontAssigned = True
|
||||
StyleDisabled.LookAndFeel.SkinName = ''
|
||||
StyleFocused.LookAndFeel.SkinName = ''
|
||||
StyleHot.LookAndFeel.SkinName = ''
|
||||
ExplicitLeft = 433
|
||||
end
|
||||
inherited edtRE: TcxDBSpinEdit
|
||||
Left = 433
|
||||
Style.LookAndFeel.SkinName = ''
|
||||
Style.IsFontAssigned = True
|
||||
StyleDisabled.LookAndFeel.SkinName = ''
|
||||
StyleFocused.LookAndFeel.SkinName = ''
|
||||
StyleHot.LookAndFeel.SkinName = ''
|
||||
ExplicitLeft = 433
|
||||
end
|
||||
inherited ImporteRE: TcxDBCurrencyEdit
|
||||
Left = 504
|
||||
Style.LookAndFeel.SkinName = ''
|
||||
Style.IsFontAssigned = True
|
||||
StyleDisabled.LookAndFeel.SkinName = ''
|
||||
StyleFocused.LookAndFeel.SkinName = ''
|
||||
StyleHot.LookAndFeel.SkinName = ''
|
||||
ExplicitLeft = 504
|
||||
end
|
||||
inherited eImporteNeto: TcxDBCurrencyEdit
|
||||
Style.LookAndFeel.SkinName = ''
|
||||
@ -432,6 +398,10 @@ inherited fEditorPedidoCliente: TfEditorPedidoCliente
|
||||
StyleFocused.LookAndFeel.SkinName = ''
|
||||
StyleHot.LookAndFeel.SkinName = ''
|
||||
end
|
||||
inherited bTiposIVA: TButton
|
||||
Left = 152
|
||||
ExplicitLeft = 152
|
||||
end
|
||||
inherited cbRecargoEquivalencia: TcxDBCheckBox
|
||||
Style.LookAndFeel.SkinName = ''
|
||||
StyleDisabled.LookAndFeel.SkinName = ''
|
||||
@ -440,6 +410,10 @@ inherited fEditorPedidoCliente: TfEditorPedidoCliente
|
||||
ExplicitWidth = 221
|
||||
Width = 221
|
||||
end
|
||||
inherited Panel1: TPanel
|
||||
Width = 185
|
||||
ExplicitWidth = 185
|
||||
end
|
||||
end
|
||||
end
|
||||
inherited EditorActionList: TActionList [5]
|
||||
|
||||
@ -1,32 +1,83 @@
|
||||
inherited frViewDetallesPedidoCliente: TfrViewDetallesPedidoCliente
|
||||
inherited ToolBar1: TToolBar
|
||||
inherited ToolButton11: TToolButton [11]
|
||||
Height = 73
|
||||
ExplicitHeight = 73
|
||||
inherited ToolButton3: TToolButton
|
||||
Wrap = False
|
||||
end
|
||||
inherited ToolButton4: TToolButton
|
||||
Left = 278
|
||||
Top = 0
|
||||
ExplicitLeft = 278
|
||||
ExplicitTop = 0
|
||||
end
|
||||
inherited ToolButton14: TToolButton
|
||||
Left = 334
|
||||
Top = 0
|
||||
ExplicitLeft = 334
|
||||
ExplicitTop = 0
|
||||
end
|
||||
inherited FontName: TJvFontComboBox
|
||||
Top = 22
|
||||
ExplicitTop = 22
|
||||
end
|
||||
inherited FontSize: TEdit
|
||||
Top = 22
|
||||
ExplicitTop = 22
|
||||
end
|
||||
inherited UpDown1: TUpDown
|
||||
Top = 22
|
||||
ExplicitTop = 22
|
||||
end
|
||||
inherited ToolButton13: TToolButton
|
||||
Top = 22
|
||||
ExplicitTop = 22
|
||||
end
|
||||
inherited ToolButton6: TToolButton
|
||||
Top = 22
|
||||
ExplicitTop = 22
|
||||
end
|
||||
inherited ToolButton7: TToolButton
|
||||
Top = 22
|
||||
ExplicitTop = 22
|
||||
end
|
||||
inherited ToolButton8: TToolButton
|
||||
Top = 22
|
||||
ExplicitTop = 22
|
||||
end
|
||||
inherited ToolButton12: TToolButton
|
||||
Left = 0
|
||||
Top = 22
|
||||
Wrap = True
|
||||
ExplicitLeft = 0
|
||||
ExplicitTop = 22
|
||||
ExplicitHeight = 27
|
||||
end
|
||||
inherited ToolButton6: TToolButton [12]
|
||||
Left = 141
|
||||
ExplicitLeft = 141
|
||||
inherited ToolButton9: TToolButton
|
||||
Left = 0
|
||||
Top = 49
|
||||
ExplicitLeft = 0
|
||||
ExplicitTop = 49
|
||||
end
|
||||
inherited ToolButton8: TToolButton [13]
|
||||
Left = 207
|
||||
ExplicitLeft = 207
|
||||
inherited ToolButton10: TToolButton
|
||||
Left = 145
|
||||
Top = 49
|
||||
ExplicitLeft = 145
|
||||
ExplicitTop = 49
|
||||
end
|
||||
inherited FontSize: TEdit [14]
|
||||
Left = 290
|
||||
ExplicitLeft = 290
|
||||
end
|
||||
inherited UpDown1: TUpDown [15]
|
||||
Left = 332
|
||||
ExplicitLeft = 332
|
||||
inherited ToolButton11: TToolButton
|
||||
Left = 270
|
||||
Top = 49
|
||||
ExplicitLeft = 270
|
||||
ExplicitTop = 49
|
||||
end
|
||||
end
|
||||
inherited cxGrid: TcxGrid
|
||||
ExplicitTop = 121
|
||||
Top = 99
|
||||
Height = 205
|
||||
ExplicitTop = 99
|
||||
ExplicitHeight = 205
|
||||
inherited cxGridView: TcxGridDBTableView
|
||||
inherited cxGridViewPOSICION: TcxGridDBColumn
|
||||
Visible = True
|
||||
end
|
||||
inherited cxGridViewTIPO: TcxGridDBColumn
|
||||
Visible = False
|
||||
VisibleForCustomization = False
|
||||
@ -55,6 +106,8 @@ inherited frViewDetallesPedidoCliente: TfrViewDetallesPedidoCliente
|
||||
end
|
||||
end
|
||||
inherited TBXDock1: TSpTBXDock
|
||||
Top = 73
|
||||
ExplicitTop = 73
|
||||
inherited TBXToolbar1: TSpTBXToolbar
|
||||
ExplicitWidth = 447
|
||||
inherited TBXSubmenuItem1: TSpTBXSubmenuItem
|
||||
|
||||
@ -257,6 +257,9 @@ inherited frViewPedidosCliente: TfrViewPedidosCliente
|
||||
BuiltInReportLink = True
|
||||
end
|
||||
end
|
||||
inherited dxPSEngineController1: TdxPSEngineController
|
||||
Active = True
|
||||
end
|
||||
inherited cxStyleRepository1: TcxStyleRepository
|
||||
Left = 248
|
||||
object cxStylePENDIENTES: TcxStyle
|
||||
|
||||
@ -141,7 +141,8 @@ uses
|
||||
schAlbaranesClienteClient_Intf in '..\Modulos\Albaranes de cliente\Model\schAlbaranesClienteClient_Intf.pas',
|
||||
schAlbaranesClienteServer_Intf in '..\Modulos\Albaranes de cliente\Model\schAlbaranesClienteServer_Intf.pas',
|
||||
schPedidosClienteClient_Intf in '..\Modulos\Pedidos de cliente\Model\schPedidosClienteClient_Intf.pas',
|
||||
schPedidosClienteServer_Intf in '..\Modulos\Pedidos de cliente\Model\schPedidosClienteServer_Intf.pas';
|
||||
schPedidosClienteServer_Intf in '..\Modulos\Pedidos de cliente\Model\schPedidosClienteServer_Intf.pas',
|
||||
uRptPedidosCliente_Server in '..\Modulos\Pedidos de cliente\Reports\uRptPedidosCliente_Server.pas' {RptPedidosCliente};
|
||||
|
||||
{$R *.res}
|
||||
{$R ..\Servicios\RODLFile.res}
|
||||
|
||||
@ -213,6 +213,9 @@
|
||||
<DCCReference Include="..\Modulos\Pedidos de cliente\Model\schPedidosClienteClient_Intf.pas" />
|
||||
<DCCReference Include="..\Modulos\Pedidos de cliente\Model\schPedidosClienteServer_Intf.pas" />
|
||||
<DCCReference Include="..\Modulos\Pedidos de cliente\Model\uBizPedidosClienteServer.pas" />
|
||||
<DCCReference Include="..\Modulos\Pedidos de cliente\Reports\uRptPedidosCliente_Server.pas">
|
||||
<Form>RptPedidosCliente</Form>
|
||||
</DCCReference>
|
||||
<DCCReference Include="..\Modulos\Pedidos de cliente\Servidor\srvPedidosCliente_Impl.pas">
|
||||
<Form>srvPedidosCliente</Form>
|
||||
<DesignClass>TDataAbstractService</DesignClass>
|
||||
|
||||
Reference in New Issue
Block a user