- Informes de pedidos a proveedor (fastreport y word)
- Cambio de tipo de servicio windows para el servidor. git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@344 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
parent
08a358912d
commit
7ade989aa9
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TfrxReport Version="4.3" 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="39512,8492042824" ScriptLanguage="PascalScript" ScriptText.Text=" procedure DatosEmpresaOnBeforePrint(Sender: TfrxComponent); var Cadena: String; begin { DatosEmpresa.Lines.Clear; if (<frxDBCabecera."TELEFONO_1_EMPRESA"> <> '') then Cadena := 'TLF: ' + <frxDBCabecera."TELEFONO_1_EMPRESA">; if (<frxDBCabecera."FAX_EMPRESA"> <> '') then Cadena := Cadena + ' FAX: ' + <frxDBCabecera."FAX_EMPRESA">; DatosEmpresa.Lines.Add(Cadena); } end; procedure NombreEmpresaOnBeforePrint(Sender: TfrxComponent); begin { NombreEmpresa.Lines.Clear; NombreEmpresa.Lines.Add(<frxDBCabecera."NOMBRE_EMPRESA">); } end; procedure DireccionEnvioOnBeforePrint(Sender: TfrxComponent); var ACadena : String; begin { ACadena := ''; DireccionEnvio.Lines.Clear; if (<frxDBCabecera."REFERENCIA_CLIENTE"> <> '') then ACadena := <frxDBCabecera."REFERENCIA_CLIENTE">; if (<frxDBCabecera."PERSONA_CONTACTO"> <> '') then ACadena := ACadena + ' ' + <frxDBCabecera."PERSONA_CONTACTO">; DireccionEnvio.Lines.Add(ACadena); ACadena := ''; DireccionEnvio.Lines.Add(<frxDBCabecera."CALLE">); if (<frxDBCabecera."CODIGO_POSTAL"> <> '') then ACadena := <frxDBCabecera."CODIGO_POSTAL"> + ' '; if (<frxDBCabecera."POBLACION"> <> '') then ACadena := ACadena + <frxDBCabecera."CODIGO_POSTAL">; if (ACadena <> '') then DireccionEnvio.Lines.Add(ACadena); if (<frxDBCabecera."PROVINCIA"> <> '') then DireccionEnvio.Lines.Add(<frxDBCabecera."PROVINCIA">); if (<frxDBCabecera."TELEFONO"> <> '') then DireccionEnvio.Lines.Add(<frxDBCabecera."TELEFONO">); } end; procedure PageHeader1OnBeforePrint(Sender: TfrxComponent); begin { if not Engine.FinalPass then Set('TotalPaginas', (<TotalPaginas> + 1)); if Engine.FinalPass then Set('Pagina', (<Pagina> + 1));} end; procedure frxReportOnStartReport(Sender: TfrxComponent); begin Set('Pagina', 0); Set('TotalPaginas', 0); Set('Capitulo', 0); Set('NumCapitulos', 0); end; procedure Memo4OnBeforePrint(Sender: TfrxComponent); begin { if (Length(<frxDBCabecera."OBSERVACIONES">) = 0) then Memo4.Visible := False;} end; begin end." ShowProgress="False" StoreInDFM="False" OnStartReport="frxReportOnStartReport" PropData="044C65667403A90003546F70021008446174617365747301010C3400000020446174615365743D22667278444243616265636572612220446174615365744E616D653D22667278444243616265636572612200010C3400000020446174615365743D226672784442446574616C6C65732220446174615365744E616D653D226672784442446574616C6C6573220000095661726961626C657301010C13000000204E616D653D2220506167696E6163696F6E2200010C0E000000204E616D653D22506167696E612200010C14000000204E616D653D22546F74616C506167696E61732200010C10000000204E616D653D2220496E666F726D652200010C10000000204E616D653D224361706974756C6F2200010C14000000204E616D653D224E756D4361706974756C6F73220000055374796C650100">
|
||||
<TfrxReport Version="4.3" 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="39528,6037192477" ScriptLanguage="PascalScript" ScriptText.Text=" procedure DatosEmpresaOnBeforePrint(Sender: TfrxComponent); var Cadena: String; begin { DatosEmpresa.Lines.Clear; if (<frxDBCabecera."TELEFONO_1_EMPRESA"> <> '') then Cadena := 'TLF: ' + <frxDBCabecera."TELEFONO_1_EMPRESA">; if (<frxDBCabecera."FAX_EMPRESA"> <> '') then Cadena := Cadena + ' FAX: ' + <frxDBCabecera."FAX_EMPRESA">; DatosEmpresa.Lines.Add(Cadena); } end; procedure NombreEmpresaOnBeforePrint(Sender: TfrxComponent); begin { NombreEmpresa.Lines.Clear; NombreEmpresa.Lines.Add(<frxDBCabecera."NOMBRE_EMPRESA">); } end; begin end." ShowProgress="False" StoreInDFM="False" OnStartReport="frxReportOnStartReport" PropData="044C65667403890003546F70021008446174617365747301010C3400000020446174615365743D22667278444243616265636572612220446174615365744E616D653D22667278444243616265636572612200010C3400000020446174615365743D226672784442446574616C6C65732220446174615365744E616D653D226672784442446574616C6C6573220000095661726961626C657301010C13000000204E616D653D2220506167696E6163696F6E2200010C0E000000204E616D653D22506167696E612200010C14000000204E616D653D22546F74616C506167696E61732200010C10000000204E616D653D2220496E666F726D652200010C10000000204E616D653D224361706974756C6F2200010C14000000204E616D653D224E756D4361706974756C6F73220000055374796C650100">
|
||||
<TfrxDataPage Name="Data" Height="1000" Left="0" Top="0" Width="1000"/>
|
||||
<TfrxReportPage Name="Page3" Font.Charset="1" Font.Color="13056" Font.Height="-13" Font.Name="Arial" Font.Style="0" Orientation="poLandscape" PaperWidth="297" PaperHeight="210" PaperSize="9" LeftMargin="20" RightMargin="20" TopMargin="15" BottomMargin="15" ColumnWidth="0" ColumnPositions.Text="" LargeDesignHeight="True" HGuides.Text="" VGuides.Text="">
|
||||
<TfrxPageHeader Name="PageHeader2" Height="200,31509" Left="0" Top="18,89765" Width="971,33921">
|
||||
@ -29,9 +29,9 @@
|
||||
</TfrxFooter>
|
||||
<TfrxMasterData Name="MasterData1" Height="22,67718" Left="0" Top="328,81911" Width="971,33921" ColumnWidth="0" ColumnGap="0" DataSet="frxDBDetalles" DataSetName="frxDBDetalles" RowCount="0" Stretched="True">
|
||||
<TfrxMemoView Name="frxDBDetallesPOSICION" Left="627,53562835" Top="0" Width="116,78739913" Height="22,67718" StretchMode="smMaxHeight" DataSet="frxDBDetalles" DataSetName="frxDBDetalles" DisplayFormat.DecimalSeparator="," Font.Charset="1" Font.Color="0" Font.Height="-15" Font.Name="Tahoma" Font.Style="0" Frame.Typ="14" Frame.RightLine.Style="fsDot" GapX="5" GapY="2" HAlign="haRight" ParentFont="False" Text="[frxDBDetalles."CANTIDAD"] [frxDBDetalles."UNIDAD_MEDIDA"]"/>
|
||||
<TfrxMemoView Name="Memo35" Left="744,70098024" Top="0" Width="100,15748276" Height="22,67718" StretchMode="smMaxHeight" DataField="IMPORTE_UNIDAD" DataSet="frxDBDetalles" DataSetName="frxDBDetalles" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-15" Font.Name="Tahoma" Font.Style="0" Frame.Typ="14" Frame.RightLine.Style="fsDot" GapX="5" GapY="2" HAlign="haRight" ParentFont="False" Text="[frxDBDetalles."IMPORTE_UNIDAD"]"/>
|
||||
<TfrxMemoView Name="Memo36" Left="844,61472" Top="0" Width="126,72449" Height="22,67718" StretchMode="smMaxHeight" DataField="IMPORTE_TOTAL" DataSet="frxDBDetalles" DataSetName="frxDBDetalles" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-15" Font.Name="Tahoma" Font.Style="0" Frame.Typ="14" GapX="5" GapY="2" HAlign="haRight" ParentFont="False" Text="[frxDBDetalles."IMPORTE_TOTAL"]"/>
|
||||
<TfrxMemoView Name="Memo6" Left="0" Top="0" Width="97,88974913" Height="22,67718" StretchMode="smMaxHeight" DataSet="frxDBDetalles" DataSetName="frxDBDetalles" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%g" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-15" Font.Name="Tahoma" Font.Style="0" Frame.Typ="15" Frame.RightLine.Style="fsDot" GapX="5" GapY="2" ParentFont="False" Text="[frxDBDetalles."REFERENCIA_PROVEEDOR"]"/>
|
||||
<TfrxMemoView Name="Memo35" Left="744,70098024" Top="0" Width="100,15748276" Height="22,67718" StretchMode="smMaxHeight" DataSet="frxDBDetalles" DataSetName="frxDBDetalles" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-15" Font.Name="Tahoma" Font.Style="0" Frame.Typ="14" Frame.RightLine.Style="fsDot" GapX="5" GapY="2" HAlign="haRight" ParentFont="False" Text="[frxDBDetalles."IMPORTE_UNIDAD"]"/>
|
||||
<TfrxMemoView Name="Memo36" Left="844,61472" Top="0" Width="126,72449" Height="22,67718" StretchMode="smMaxHeight" DataSet="frxDBDetalles" DataSetName="frxDBDetalles" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-15" Font.Name="Tahoma" Font.Style="0" Frame.Typ="14" GapX="5" GapY="2" HAlign="haRight" ParentFont="False" Text="[frxDBDetalles."IMPORTE_TOTAL"]"/>
|
||||
<TfrxMemoView Name="Memo6" Left="0" Top="0" Width="97,88974913" Height="22,67718" StretchMode="smMaxHeight" DataSet="frxDBDetalles" DataSetName="frxDBDetalles" DisplayFormat.DecimalSeparator="," Font.Charset="1" Font.Color="0" Font.Height="-15" Font.Name="Tahoma" Font.Style="0" Frame.Typ="15" Frame.RightLine.Style="fsDot" GapX="5" GapY="2" ParentFont="False" Text="[frxDBDetalles."REFERENCIA_PROVEEDOR"]"/>
|
||||
<TfrxRichView Name="Rich1" Left="195,53556" Top="0" Width="432" Height="22,67716535" StretchMode="smMaxHeight" Frame.Typ="14" Frame.RightLine.Style="fsDot" GapX="5" GapY="1" PropData="0852696368456469740A8C0000007B5C727466315C616E73695C616E7369637067313235325C64656666305C6465666C616E67333038327B5C666F6E7474626C7B5C66305C666E696C205461686F6D613B7D7D0D0A5C766965776B696E64345C7563315C706172645C66305C66733232205B6672784442446574616C6C65732E22434F4E434550544F225D5C667331365C7061720D0A7D0D0A00"/>
|
||||
<TfrxMemoView Name="Memo10" Left="97,26778" Top="0" Width="97,88974913" Height="22,67718" StretchMode="smMaxHeight" DataField="REFERENCIA_FABRICANTE" DataSet="frxDBDetalles" DataSetName="frxDBDetalles" DisplayFormat.DecimalSeparator="," Font.Charset="1" Font.Color="0" Font.Height="-15" Font.Name="Tahoma" Font.Style="0" Frame.Typ="14" Frame.RightLine.Style="fsDot" GapX="5" GapY="2" HAlign="haRight" ParentFont="False" Text="[frxDBDetalles."REFERENCIA_FABRICANTE"]"/>
|
||||
</TfrxMasterData>
|
||||
|
||||
@ -8,13 +8,14 @@ uses
|
||||
uBizPedidosProveedor;
|
||||
|
||||
type
|
||||
IPedidosProveedorReportController = interface
|
||||
IPedidosProveedorReportController = interface(IControllerBase)
|
||||
['{D0686358-251C-43C4-9927-6112F2F4D3B8}']
|
||||
procedure Preview(const AID : String);
|
||||
procedure Print(const AID : String);
|
||||
procedure Preview(const AListaID : String);
|
||||
procedure Print(const AListaID : String);
|
||||
function ExportToWord(const AID: Integer; const AFileName : String = ''): Boolean;
|
||||
end;
|
||||
|
||||
TPedidosProveedorReportController = class(TInterfacedObject, IPedidosProveedorReportController)
|
||||
TPedidosProveedorReportController = class(TControllerBase, IPedidosProveedorReportController)
|
||||
private
|
||||
FDataModule : IDataModulePedidosProveedorReport;
|
||||
function CreateEditor(const AName: String; const IID: TGUID; out Intf): Boolean;
|
||||
@ -22,8 +23,9 @@ type
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
|
||||
procedure Preview(const AID : String);
|
||||
procedure Print(const AID : String);
|
||||
procedure Preview(const AListaID : String);
|
||||
procedure Print(const AListaID : String);
|
||||
function ExportToWord(const AID: Integer; const AFileName : String = ''): Boolean;
|
||||
end;
|
||||
|
||||
|
||||
@ -31,7 +33,8 @@ implementation
|
||||
|
||||
uses
|
||||
uROTypes, uEditorRegistryUtils, uIEditorPedidosProveedorPreview,
|
||||
uEditorPreview, uDataModulePedidosProveedor, uEditorBase, cxControls;
|
||||
uEditorPreview, uDataModulePedidosProveedor, uEditorBase, cxControls,
|
||||
uFactuGES_App, uStringsUtils, uSistemaFunc;
|
||||
|
||||
{ TPedidosProveedorReportController }
|
||||
|
||||
@ -53,7 +56,31 @@ begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TPedidosProveedorReportController.Preview(const AID : String);
|
||||
function TPedidosProveedorReportController.ExportToWord(const AID: Integer;
|
||||
const AFileName: String): Boolean;
|
||||
var
|
||||
AStream: Binary;
|
||||
AFile : String;
|
||||
begin
|
||||
AFile := AFileName;
|
||||
if EsCadenaVacia(AFile) and (not DarFicheroWordExportar(AFile)) then
|
||||
Exit;
|
||||
|
||||
ShowHourglassCursor;
|
||||
try
|
||||
AStream := FDataModule.GetRptWordPedido(AID);
|
||||
try
|
||||
AStream.SaveToFile(AFile);
|
||||
Result := True;
|
||||
finally
|
||||
FreeAndNil(AStream);
|
||||
end;
|
||||
finally
|
||||
HideHourglassCursor;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TPedidosProveedorReportController.Preview(const AListaID : String);
|
||||
var
|
||||
AStream: Binary;
|
||||
AEditor : IEditorPedidosProveedorPreview;
|
||||
@ -61,12 +88,15 @@ begin
|
||||
AEditor := NIL;
|
||||
ShowHourglassCursor;
|
||||
try
|
||||
AStream := FDataModule.GetReport(AID);
|
||||
AStream := FDataModule.GetReport(AListaID);
|
||||
try
|
||||
CreateEditor('EditorPedidosProveedorPreview', IEditorPedidosProveedorPreview, AEditor);
|
||||
if Assigned(AEditor) then
|
||||
with AEditor do
|
||||
begin
|
||||
AEditor.Controller := Self;
|
||||
AEditor.ListaID := AListaID;
|
||||
Title := 'Pedido a proveedor - ' + AppFactuGES.EmpresaActiva.NOMBRE;
|
||||
LoadFromStream(AStream);
|
||||
Preview;
|
||||
Release;
|
||||
@ -80,7 +110,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TPedidosProveedorReportController.Print(const AID : String);
|
||||
procedure TPedidosProveedorReportController.Print(const AListaID : String);
|
||||
var
|
||||
AStream: Binary;
|
||||
AEditor : IEditorPedidosProveedorPreview;
|
||||
@ -88,7 +118,7 @@ begin
|
||||
AEditor := NIL;
|
||||
ShowHourglassCursor;
|
||||
try
|
||||
AStream := FDataModule.GetReport(AID);
|
||||
AStream := FDataModule.GetReport(AListaID);
|
||||
try
|
||||
CreateEditor('EditorPedidosProveedorPreview', IEditorPedidosProveedorPreview, AEditor);
|
||||
if Assigned(AEditor) then
|
||||
|
||||
@ -40,6 +40,7 @@ type
|
||||
|
||||
// Report
|
||||
function GetReport(const AID: String): Binary;
|
||||
function GetRptWordPedido(const AID: Integer): Binary;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -65,7 +66,13 @@ end;
|
||||
|
||||
function TDataModulePedidosProveedor.GetReport(const AID: String): Binary;
|
||||
begin
|
||||
// Result := (RORemoteService as IsrvPedidosProveedor).GenerateReport(AID)
|
||||
Result := (RORemoteService as IsrvPedidosProveedor).GenerateReport(AID)
|
||||
end;
|
||||
|
||||
function TDataModulePedidosProveedor.GetRptWordPedido(
|
||||
const AID: Integer): Binary;
|
||||
begin
|
||||
Result := (RORemoteService as IsrvPedidosProveedor).GenerateReportEnWord(AID)
|
||||
end;
|
||||
|
||||
function TDataModulePedidosProveedor.NewItem: IBizPedidoProveedor;
|
||||
|
||||
@ -7,8 +7,9 @@ uses
|
||||
|
||||
type
|
||||
IDataModulePedidosProveedorReport = interface
|
||||
['{3B7564E3-8DFD-4976-BBE8-6EF13185B209}']
|
||||
['{F2FFF4EA-B43D-4AAB-8A76-35A322B61A80}']
|
||||
function GetReport(const AID: String): Binary;
|
||||
function GetRptWordPedido(const AID: Integer): Binary;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
@ -16,7 +16,7 @@ object RptPedidosProveedor: TRptPedidosProveedor
|
||||
Params = <
|
||||
item
|
||||
Name = 'ID'
|
||||
Value = ''
|
||||
Value = '3'
|
||||
ParamType = daptInput
|
||||
end>
|
||||
Statements = <
|
||||
@ -178,7 +178,7 @@ object RptPedidosProveedor: TRptPedidosProveedor
|
||||
Params = <
|
||||
item
|
||||
Name = 'ID_PEDIDO'
|
||||
Value = '2'
|
||||
Value = '3'
|
||||
ParamType = daptInput
|
||||
end>
|
||||
Statements = <
|
||||
@ -414,7 +414,7 @@ object RptPedidosProveedor: TRptPedidosProveedor
|
||||
ShowProgress = False
|
||||
StoreInDFM = False
|
||||
OnStartReport = 'frxReportOnStartReport'
|
||||
Left = 169
|
||||
Left = 137
|
||||
Top = 16
|
||||
end
|
||||
object frxDBCabecera: TfrxDBDataset
|
||||
@ -432,7 +432,6 @@ object RptPedidosProveedor: TRptPedidosProveedor
|
||||
Top = 24
|
||||
end
|
||||
object IBDatabase1: TIBDatabase
|
||||
Connected = True
|
||||
DatabaseName = 'C:\Codigo Tecsitel\Output\Debug\Database\FACTUGES.FDB'
|
||||
Params.Strings = (
|
||||
'user_name=sysdba'
|
||||
@ -444,7 +443,6 @@ object RptPedidosProveedor: TRptPedidosProveedor
|
||||
Top = 296
|
||||
end
|
||||
object IBTransaction1: TIBTransaction
|
||||
Active = True
|
||||
Left = 48
|
||||
Top = 352
|
||||
end
|
||||
@ -461,7 +459,6 @@ object RptPedidosProveedor: TRptPedidosProveedor
|
||||
object cabecera: TIBQuery
|
||||
Database = IBDatabase1
|
||||
Transaction = IBTransaction1
|
||||
Active = True
|
||||
SQL.Strings = (
|
||||
'SELECT'
|
||||
' V_PEDIDOS_PROVEEDOR.ID,'
|
||||
@ -510,7 +507,7 @@ object RptPedidosProveedor: TRptPedidosProveedor
|
||||
|
||||
' LEFT OUTER JOIN ALMACENES ON (ALMACENES.ID = V_PEDIDOS_PROVEED' +
|
||||
'OR.ID_ALMACEN)'
|
||||
'WHERE V_PEDIDOS_PROVEEDOR.ID = 2')
|
||||
'WHERE V_PEDIDOS_PROVEEDOR.ID = 3')
|
||||
Left = 136
|
||||
Top = 296
|
||||
object cabeceraID: TIntegerField
|
||||
@ -586,7 +583,6 @@ object RptPedidosProveedor: TRptPedidosProveedor
|
||||
object detalles: TIBQuery
|
||||
Database = IBDatabase1
|
||||
Transaction = IBTransaction1
|
||||
Active = True
|
||||
SQL.Strings = (
|
||||
'SELECT DET.ID, DET.ID_PEDIDO,'
|
||||
' DET.POSICION, DET.TIPO_DETALLE,'
|
||||
@ -596,7 +592,7 @@ object RptPedidosProveedor: TRptPedidosProveedor
|
||||
' ARTICULOS.REFERENCIA_FABR as REFERENCIA_FABRICANTE'
|
||||
'FROM PEDIDOS_PROVEEDOR_DETALLES DET'
|
||||
'LEFT OUTER JOIN ARTICULOS ON (DET.ID_ARTICULO = ARTICULOS.ID)'
|
||||
'WHERE DET.ID_PEDIDO = 2 AND DET.VISIBLE = 1 '
|
||||
'WHERE DET.ID_PEDIDO = 3 AND DET.VISIBLE = 1 '
|
||||
'ORDER BY DET.ID_PEDIDO, DET.POSICION;')
|
||||
Left = 136
|
||||
Top = 352
|
||||
@ -663,32 +659,32 @@ object RptPedidosProveedor: TRptPedidosProveedor
|
||||
end
|
||||
end
|
||||
object frxCheckBoxObject1: TfrxCheckBoxObject
|
||||
Left = 376
|
||||
Top = 296
|
||||
Left = 360
|
||||
Top = 248
|
||||
end
|
||||
object frxChartObject1: TfrxChartObject
|
||||
Left = 376
|
||||
Top = 344
|
||||
Left = 360
|
||||
Top = 296
|
||||
end
|
||||
object frxGradientObject1: TfrxGradientObject
|
||||
Left = 440
|
||||
Top = 296
|
||||
Top = 248
|
||||
end
|
||||
object frxCrossObject1: TfrxCrossObject
|
||||
Left = 440
|
||||
Top = 448
|
||||
Top = 400
|
||||
end
|
||||
object frxOLEObject1: TfrxOLEObject
|
||||
Left = 376
|
||||
Top = 448
|
||||
Left = 360
|
||||
Top = 400
|
||||
end
|
||||
object frxBarCodeObject1: TfrxBarCodeObject
|
||||
Left = 440
|
||||
Top = 400
|
||||
Top = 352
|
||||
end
|
||||
object frxRichObject1: TfrxRichObject
|
||||
Left = 376
|
||||
Top = 400
|
||||
Left = 360
|
||||
Top = 352
|
||||
end
|
||||
object DADSCabecera: TDADataSource
|
||||
DataSet = tbl_Cabecera.Dataset
|
||||
@ -708,24 +704,19 @@ object RptPedidosProveedor: TRptPedidosProveedor
|
||||
item
|
||||
Name = 'ID'
|
||||
DataType = datInteger
|
||||
DictionaryEntry = 'FacturasCliente_Detalles_ID'
|
||||
InPrimaryKey = True
|
||||
end
|
||||
item
|
||||
Name = 'ID_FACTURA'
|
||||
Name = 'ID_PEDIDO'
|
||||
DataType = datInteger
|
||||
DictionaryEntry = 'FacturasCliente_Detalles_ID_FACTURA'
|
||||
end
|
||||
item
|
||||
Name = 'POSICION'
|
||||
DataType = datInteger
|
||||
DictionaryEntry = 'FacturasCliente_Detalles_POSICION'
|
||||
end
|
||||
item
|
||||
Name = 'TIPO_DETALLE'
|
||||
DataType = datString
|
||||
Size = 10
|
||||
DictionaryEntry = 'FacturasCliente_Detalles_TIPO_DETALLE'
|
||||
end
|
||||
item
|
||||
Name = 'REFERENCIA'
|
||||
@ -736,41 +727,42 @@ object RptPedidosProveedor: TRptPedidosProveedor
|
||||
Name = 'CONCEPTO'
|
||||
DataType = datString
|
||||
Size = 2000
|
||||
DictionaryEntry = 'FacturasCliente_Detalles_CONCEPTO'
|
||||
end
|
||||
item
|
||||
Name = 'CANTIDAD'
|
||||
DataType = datInteger
|
||||
DictionaryEntry = 'FacturasCliente_Detalles_CANTIDAD'
|
||||
end
|
||||
item
|
||||
Name = 'UNIDAD_MEDIDA'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'IMPORTE_UNIDAD'
|
||||
DataType = datCurrency
|
||||
DictionaryEntry = 'FacturasCliente_Detalles_IMPORTE_UNIDAD'
|
||||
end
|
||||
item
|
||||
Name = 'DESCUENTO'
|
||||
DataType = datFloat
|
||||
end
|
||||
item
|
||||
Name = 'IMPORTE_TOTAL'
|
||||
DataType = datCurrency
|
||||
DictionaryEntry = 'FacturasCliente_Detalles_IMPORTE_TOTAL'
|
||||
end
|
||||
item
|
||||
Name = 'VISIBLE'
|
||||
DataType = datSmallInt
|
||||
DictionaryEntry = 'FacturasCliente_Detalles_VISIBLE'
|
||||
Name = 'REFERENCIA_PROVEEDOR'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'REFERENCIA_FABRICANTE'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end>
|
||||
Params = <
|
||||
item
|
||||
Name = 'ID_FACTURA'
|
||||
DataType = datInteger
|
||||
Name = 'ID_PEDIDO'
|
||||
Value = '2'
|
||||
ParamType = daptInput
|
||||
end>
|
||||
MasterParamsMappings.Strings = (
|
||||
'ID_FACTURA=ID')
|
||||
'ID_PEDIDO=ID')
|
||||
LogChanges = False
|
||||
StreamingOptions = [soDisableEventsWhileStreaming]
|
||||
RemoteFetchEnabled = False
|
||||
@ -778,10 +770,10 @@ object RptPedidosProveedor: TRptPedidosProveedor
|
||||
LocalDataStreamer = DABINAdapter
|
||||
MasterSource = DADSCabecera
|
||||
MasterFields = 'ID'
|
||||
DetailFields = 'ID_FACTURA'
|
||||
DetailFields = 'ID_PEDIDO'
|
||||
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
|
||||
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
|
||||
LogicalName = 'InformeFacturasCliente_Detalles'
|
||||
LogicalName = 'Informe_Detalles'
|
||||
IndexDefs = <>
|
||||
Left = 440
|
||||
Top = 136
|
||||
@ -792,141 +784,73 @@ object RptPedidosProveedor: TRptPedidosProveedor
|
||||
item
|
||||
Name = 'ID'
|
||||
DataType = datInteger
|
||||
DictionaryEntry = 'FacturasCliente_ID'
|
||||
InPrimaryKey = True
|
||||
end
|
||||
item
|
||||
Name = 'ID_EMPRESA'
|
||||
DataType = datInteger
|
||||
DictionaryEntry = 'FacturasCliente_ID_EMPRESA'
|
||||
end
|
||||
item
|
||||
Name = 'REFERENCIA'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
DictionaryEntry = 'FacturasCliente_REFERENCIA'
|
||||
end
|
||||
item
|
||||
Name = 'TIPO'
|
||||
DataType = datString
|
||||
Size = 1
|
||||
end
|
||||
item
|
||||
Name = 'FECHA_FACTURA'
|
||||
Name = 'FECHA_PEDIDO'
|
||||
DataType = datDateTime
|
||||
DictionaryEntry = 'FacturasCliente_FECHA_FACTURA'
|
||||
end
|
||||
item
|
||||
Name = 'BASE_IMPONIBLE'
|
||||
DataType = datCurrency
|
||||
DictionaryEntry = 'FacturasCliente_BASE_IMPONIBLE'
|
||||
end
|
||||
item
|
||||
Name = 'SITUACION'
|
||||
DataType = datString
|
||||
Size = 19
|
||||
end
|
||||
item
|
||||
Name = 'DESCUENTO'
|
||||
DataType = datFloat
|
||||
DictionaryEntry = 'FacturasCliente_DESCUENTO'
|
||||
end
|
||||
item
|
||||
Name = 'IMPORTE_DESCUENTO'
|
||||
DataType = datCurrency
|
||||
DictionaryEntry = 'FacturasCliente_IMPORTE_DESCUENTO'
|
||||
end
|
||||
item
|
||||
Name = 'IVA'
|
||||
DataType = datFloat
|
||||
DictionaryEntry = 'FacturasCliente_IVA'
|
||||
end
|
||||
item
|
||||
Name = 'IMPORTE_IVA'
|
||||
DataType = datCurrency
|
||||
DictionaryEntry = 'FacturasCliente_IMPORTE_IVA'
|
||||
end
|
||||
item
|
||||
Name = 'RE'
|
||||
DataType = datFloat
|
||||
end
|
||||
item
|
||||
Name = 'IMPORTE_RE'
|
||||
DataType = datCurrency
|
||||
end
|
||||
item
|
||||
Name = 'IMPORTE_TOTAL'
|
||||
DataType = datCurrency
|
||||
DictionaryEntry = 'FacturasCliente_IMPORTE_TOTAL'
|
||||
end
|
||||
item
|
||||
Name = 'OBSERVACIONES'
|
||||
DataType = datMemo
|
||||
DictionaryEntry = 'FacturasCliente_OBSERVACIONES'
|
||||
end
|
||||
item
|
||||
Name = 'NIF_CIF'
|
||||
DataType = datString
|
||||
Size = 15
|
||||
DictionaryEntry = 'FacturasCliente_NIF_CIF'
|
||||
end
|
||||
item
|
||||
Name = 'ID_CLIENTE'
|
||||
DataType = datInteger
|
||||
DictionaryEntry = 'FacturasCliente_ID_CLIENTE'
|
||||
end
|
||||
item
|
||||
Name = 'NOMBRE'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
DictionaryEntry = 'FacturasCliente_NOMBRE'
|
||||
end
|
||||
item
|
||||
Name = 'FAX'
|
||||
DataType = datString
|
||||
Size = 25
|
||||
end
|
||||
item
|
||||
Name = 'NOMBRE_ALMACEN'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'CALLE'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
DictionaryEntry = 'FacturasCliente_CALLE'
|
||||
end
|
||||
item
|
||||
Name = 'PROVINCIA'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
DictionaryEntry = 'FacturasCliente_PROVINCIA'
|
||||
end
|
||||
item
|
||||
Name = 'POBLACION'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
DictionaryEntry = 'FacturasCliente_POBLACION'
|
||||
end
|
||||
item
|
||||
Name = 'PROVINCIA'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'CODIGO_POSTAL'
|
||||
DataType = datString
|
||||
Size = 10
|
||||
DictionaryEntry = 'FacturasCliente_CODIGO_POSTAL'
|
||||
end
|
||||
item
|
||||
Name = 'RECARGO_EQUIVALENCIA'
|
||||
DataType = datSmallInt
|
||||
end
|
||||
item
|
||||
Name = 'IMPORTE_NETO'
|
||||
DataType = datCurrency
|
||||
end
|
||||
item
|
||||
Name = 'IMPORTE_PORTE'
|
||||
DataType = datCurrency
|
||||
end
|
||||
item
|
||||
Name = 'FORMA_PAGO'
|
||||
Name = 'PERSONA_CONTACTO'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'TELEFONO'
|
||||
DataType = datString
|
||||
Size = 25
|
||||
end>
|
||||
Params = <
|
||||
item
|
||||
Name = 'ID'
|
||||
DataType = datInteger
|
||||
Value = '1'
|
||||
Value = ''
|
||||
ParamType = daptInput
|
||||
end>
|
||||
LogChanges = False
|
||||
@ -936,7 +860,7 @@ object RptPedidosProveedor: TRptPedidosProveedor
|
||||
LocalDataStreamer = DABINAdapter
|
||||
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
|
||||
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
|
||||
LogicalName = 'InformeFacturasCliente'
|
||||
LogicalName = 'Informe_Cabecera'
|
||||
IndexDefs = <>
|
||||
Left = 360
|
||||
Top = 136
|
||||
|
||||
@ -47,8 +47,6 @@ type
|
||||
cabeceraCODIGO_POSTAL: TIBStringField;
|
||||
cabeceraPERSONA_CONTACTO: TIBStringField;
|
||||
cabeceraTELEFONO: TIBStringField;
|
||||
schReport: TDASchema;
|
||||
DataDictionary: TDADataDictionary;
|
||||
detallesID: TIntegerField;
|
||||
detallesID_PEDIDO: TIntegerField;
|
||||
detallesPOSICION: TIntegerField;
|
||||
@ -61,6 +59,8 @@ type
|
||||
detallesIMPORTE_TOTAL: TIBBCDField;
|
||||
detallesREFERENCIA_PROVEEDOR: TIBStringField;
|
||||
detallesREFERENCIA_FABRICANTE: TIBStringField;
|
||||
schReport: TDASchema;
|
||||
DataDictionary: TDADataDictionary;
|
||||
procedure DataModuleCreate(Sender: TObject);
|
||||
private
|
||||
FConnection: IDAConnection;
|
||||
@ -131,7 +131,7 @@ begin
|
||||
frxDBDetalles.DataSource := DADSDetalles;
|
||||
|
||||
tbl_Cabecera.ParamByName('ID').AsInteger := ID;
|
||||
tbl_Detalles.ParamByName('ID_FACTURA').AsInteger := ID;
|
||||
tbl_Detalles.ParamByName('ID_PEDIDO').AsInteger := ID;
|
||||
|
||||
tbl_Cabecera.Active := True;
|
||||
tbl_Detalles.Active := True;
|
||||
|
||||
@ -12,7 +12,7 @@ object RptWordPedidoProveedor: TRptWordPedidoProveedor
|
||||
Params = <
|
||||
item
|
||||
Name = 'ID'
|
||||
Value = '2'
|
||||
Value = '3'
|
||||
ParamType = daptInput
|
||||
end>
|
||||
Statements = <
|
||||
@ -24,22 +24,23 @@ object RptWordPedidoProveedor: TRptWordPedidoProveedor
|
||||
'_PEDIDO,'#10' V_PEDIDOS_PROVEEDOR.OBSERVACIONES,'#10' V_PROVEEDORES.NO' +
|
||||
'MBRE,'#10' V_PROVEEDORES.FAX,'#10' ALMACENES.NOMBRE AS NOMBRE_ALMACEN,' +
|
||||
#10#10' CASE WHEN (ALMACENES.ID > 0)'#10' THEN ALMACENES.CALL' +
|
||||
'E'#10' ELSE V_PEDIDOS_PROVEEDOR.CALLE'#10' END as CALLE,'#10#10' ' +
|
||||
'CASE WHEN (ALMACENES.ID > 0)'#10' THEN ALMACENES.POBLACIO' +
|
||||
'N'#10' ELSE V_PEDIDOS_PROVEEDOR.POBLACION'#10' END as POBLAC' +
|
||||
'ION,'#10#10' CASE WHEN (ALMACENES.ID > 0)'#10' THEN ALMACENES.' +
|
||||
'PROVINCIA'#10' ELSE V_PEDIDOS_PROVEEDOR.PROVINCIA'#10' END a' +
|
||||
's PROVINCIA,'#10#10' CASE WHEN (ALMACENES.ID > 0)'#10' THEN AL' +
|
||||
'MACENES.CODIGO_POSTAL'#10' ELSE V_PEDIDOS_PROVEEDOR.CODIG' +
|
||||
'O_POSTAL'#10' END as CODIGO_POSTAL,'#10#10' CASE WHEN (ALMACENES.ID > 0)' +
|
||||
#10' THEN ALMACENES.PERSONA_CONTACTO'#10' ELSE V_' +
|
||||
'PEDIDOS_PROVEEDOR.PERSONA_CONTACTO'#10' END as PERSONA_CONTACTO,'#10#10' ' +
|
||||
' CASE WHEN (ALMACENES.ID > 0)'#10' THEN ALMACENES.TELEFON' +
|
||||
'O'#10' ELSE V_PEDIDOS_PROVEEDOR.TELEFONO'#10' END as TELEFON' +
|
||||
'O'#10'FROM'#10' V_PEDIDOS_PROVEEDOR'#10' LEFT OUTER JOIN V_PROVEEDORES ON ' +
|
||||
'(V_PROVEEDORES.ID = V_PEDIDOS_PROVEEDOR.ID_PROVEEDOR)'#10' LEFT OUT' +
|
||||
'ER JOIN ALMACENES ON (ALMACENES.ID = V_PEDIDOS_PROVEEDOR.ID_ALMA' +
|
||||
'CEN)'#10'WHERE V_PEDIDOS_PROVEEDOR.ID = :ID'#10
|
||||
'E'#10' ELSE V_PEDIDOS_PROVEEDOR.CALLE'#10' END as CALLE_ALMA' +
|
||||
'CEN,'#10#10' CASE WHEN (ALMACENES.ID > 0)'#10' THEN ALMACENES.' +
|
||||
'POBLACION'#10' ELSE V_PEDIDOS_PROVEEDOR.POBLACION'#10' END a' +
|
||||
's POBLACION_ALMACEN,'#10#10' CASE WHEN (ALMACENES.ID > 0)'#10' ' +
|
||||
' THEN ALMACENES.PROVINCIA'#10' ELSE V_PEDIDOS_PROVEEDOR.P' +
|
||||
'ROVINCIA'#10' END as PROVINCIA_ALMACEN,'#10#10' CASE WHEN (ALMACENES.ID ' +
|
||||
'> 0)'#10' THEN ALMACENES.CODIGO_POSTAL'#10' ELSE V' +
|
||||
'_PEDIDOS_PROVEEDOR.CODIGO_POSTAL'#10' END as CODIGO_POSTAL_ALMACEN,' +
|
||||
#10#10' CASE WHEN (ALMACENES.ID > 0)'#10' THEN ALMACENES.PERS' +
|
||||
'ONA_CONTACTO'#10' ELSE V_PEDIDOS_PROVEEDOR.PERSONA_CONTAC' +
|
||||
'TO'#10' END as PERSONA_CONTACTO_ALMACEN,'#10#10' CASE WHEN (ALMACENES.ID' +
|
||||
' > 0)'#10' THEN ALMACENES.TELEFONO'#10' ELSE V_PED' +
|
||||
'IDOS_PROVEEDOR.TELEFONO'#10' END as TELEFONO_ALMACEN'#10'FROM'#10' V_PEDID' +
|
||||
'OS_PROVEEDOR'#10' LEFT OUTER JOIN V_PROVEEDORES ON (V_PROVEEDORES.I' +
|
||||
'D = V_PEDIDOS_PROVEEDOR.ID_PROVEEDOR)'#10' LEFT OUTER JOIN ALMACENE' +
|
||||
'S ON (ALMACENES.ID = V_PEDIDOS_PROVEEDOR.ID_ALMACEN)'#10'WHERE V_PED' +
|
||||
'IDOS_PROVEEDOR.ID = :ID'#10
|
||||
StatementType = stSQL
|
||||
ColumnMappings = <
|
||||
item
|
||||
@ -75,28 +76,28 @@ object RptWordPedidoProveedor: TRptWordPedidoProveedor
|
||||
TableField = 'NOMBRE_ALMACEN'
|
||||
end
|
||||
item
|
||||
DatasetField = 'CALLE'
|
||||
TableField = 'CALLE'
|
||||
DatasetField = 'CALLE_ALMACEN'
|
||||
TableField = 'CALLE_ALMACEN'
|
||||
end
|
||||
item
|
||||
DatasetField = 'POBLACION'
|
||||
TableField = 'POBLACION'
|
||||
DatasetField = 'POBLACION_ALMACEN'
|
||||
TableField = 'POBLACION_ALMACEN'
|
||||
end
|
||||
item
|
||||
DatasetField = 'PROVINCIA'
|
||||
TableField = 'PROVINCIA'
|
||||
DatasetField = 'PROVINCIA_ALMACEN'
|
||||
TableField = 'PROVINCIA_ALMACEN'
|
||||
end
|
||||
item
|
||||
DatasetField = 'CODIGO_POSTAL'
|
||||
TableField = 'CODIGO_POSTAL'
|
||||
DatasetField = 'CODIGO_POSTAL_ALMACEN'
|
||||
TableField = 'CODIGO_POSTAL_ALMACEN'
|
||||
end
|
||||
item
|
||||
DatasetField = 'PERSONA_CONTACTO'
|
||||
TableField = 'PERSONA_CONTACTO'
|
||||
DatasetField = 'PERSONA_CONTACTO_ALMACEN'
|
||||
TableField = 'PERSONA_CONTACTO_ALMACEN'
|
||||
end
|
||||
item
|
||||
DatasetField = 'TELEFONO'
|
||||
TableField = 'TELEFONO'
|
||||
DatasetField = 'TELEFONO_ALMACEN'
|
||||
TableField = 'TELEFONO_ALMACEN'
|
||||
end>
|
||||
end>
|
||||
Name = 'Informe_Cabecera'
|
||||
@ -138,32 +139,32 @@ object RptWordPedidoProveedor: TRptWordPedidoProveedor
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'CALLE'
|
||||
Name = 'CALLE_ALMACEN'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'POBLACION'
|
||||
Name = 'POBLACION_ALMACEN'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'PROVINCIA'
|
||||
Name = 'PROVINCIA_ALMACEN'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'CODIGO_POSTAL'
|
||||
Name = 'CODIGO_POSTAL_ALMACEN'
|
||||
DataType = datString
|
||||
Size = 10
|
||||
end
|
||||
item
|
||||
Name = 'PERSONA_CONTACTO'
|
||||
Name = 'PERSONA_CONTACTO_ALMACEN'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'TELEFONO'
|
||||
Name = 'TELEFONO_ALMACEN'
|
||||
DataType = datString
|
||||
Size = 25
|
||||
end>
|
||||
@ -324,8 +325,6 @@ object RptWordPedidoProveedor: TRptWordPedidoProveedor
|
||||
item
|
||||
Name = 'ID'
|
||||
DataType = datInteger
|
||||
Required = True
|
||||
InPrimaryKey = True
|
||||
end
|
||||
item
|
||||
Name = 'ID_EMPRESA'
|
||||
@ -337,110 +336,62 @@ object RptWordPedidoProveedor: TRptWordPedidoProveedor
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'TIPO'
|
||||
DataType = datString
|
||||
Size = 1
|
||||
end
|
||||
item
|
||||
Name = 'FECHA_FACTURA'
|
||||
Name = 'FECHA_PEDIDO'
|
||||
DataType = datDateTime
|
||||
end
|
||||
item
|
||||
Name = 'BASE_IMPONIBLE'
|
||||
DataType = datCurrency
|
||||
end
|
||||
item
|
||||
Name = 'SITUACION'
|
||||
DataType = datString
|
||||
Size = 19
|
||||
end
|
||||
item
|
||||
Name = 'DESCUENTO'
|
||||
DataType = datFloat
|
||||
end
|
||||
item
|
||||
Name = 'IMPORTE_DESCUENTO'
|
||||
DataType = datCurrency
|
||||
end
|
||||
item
|
||||
Name = 'IVA'
|
||||
DataType = datFloat
|
||||
end
|
||||
item
|
||||
Name = 'IMPORTE_IVA'
|
||||
DataType = datCurrency
|
||||
end
|
||||
item
|
||||
Name = 'RE'
|
||||
DataType = datFloat
|
||||
end
|
||||
item
|
||||
Name = 'IMPORTE_RE'
|
||||
DataType = datCurrency
|
||||
end
|
||||
item
|
||||
Name = 'IMPORTE_TOTAL'
|
||||
DataType = datCurrency
|
||||
end
|
||||
item
|
||||
Name = 'OBSERVACIONES'
|
||||
DataType = datMemo
|
||||
end
|
||||
item
|
||||
Name = 'NIF_CIF'
|
||||
DataType = datString
|
||||
Size = 15
|
||||
end
|
||||
item
|
||||
Name = 'ID_CLIENTE'
|
||||
DataType = datInteger
|
||||
end
|
||||
item
|
||||
Name = 'NOMBRE'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'CALLE'
|
||||
Name = 'FAX'
|
||||
DataType = datString
|
||||
Size = 25
|
||||
end
|
||||
item
|
||||
Name = 'NOMBRE_ALMACEN'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'PROVINCIA'
|
||||
Name = 'CALLE_ALMACEN'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'POBLACION'
|
||||
Name = 'POBLACION_ALMACEN'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'CODIGO_POSTAL'
|
||||
Name = 'PROVINCIA_ALMACEN'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'CODIGO_POSTAL_ALMACEN'
|
||||
DataType = datString
|
||||
Size = 10
|
||||
end
|
||||
item
|
||||
Name = 'RECARGO_EQUIVALENCIA'
|
||||
DataType = datSmallInt
|
||||
end
|
||||
item
|
||||
Name = 'IMPORTE_NETO'
|
||||
DataType = datCurrency
|
||||
end
|
||||
item
|
||||
Name = 'IMPORTE_PORTE'
|
||||
DataType = datCurrency
|
||||
end
|
||||
item
|
||||
Name = 'FORMA_PAGO'
|
||||
Name = 'PERSONA_CONTACTO_ALMACEN'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'TELEFONO_ALMACEN'
|
||||
DataType = datString
|
||||
Size = 25
|
||||
end>
|
||||
Params = <
|
||||
item
|
||||
Name = 'ID'
|
||||
Value = ''
|
||||
Value = '3'
|
||||
ParamType = daptInput
|
||||
end>
|
||||
LogChanges = False
|
||||
@ -461,10 +412,9 @@ object RptWordPedidoProveedor: TRptWordPedidoProveedor
|
||||
item
|
||||
Name = 'ID'
|
||||
DataType = datInteger
|
||||
InPrimaryKey = True
|
||||
end
|
||||
item
|
||||
Name = 'ID_FACTURA'
|
||||
Name = 'ID_PEDIDO'
|
||||
DataType = datInteger
|
||||
end
|
||||
item
|
||||
@ -476,6 +426,11 @@ object RptWordPedidoProveedor: TRptWordPedidoProveedor
|
||||
DataType = datString
|
||||
Size = 10
|
||||
end
|
||||
item
|
||||
Name = 'REFERENCIA'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'CONCEPTO'
|
||||
DataType = datString
|
||||
@ -486,25 +441,32 @@ object RptWordPedidoProveedor: TRptWordPedidoProveedor
|
||||
DataType = datInteger
|
||||
end
|
||||
item
|
||||
Name = 'IMPORTE_UNIDAD'
|
||||
DataType = datCurrency
|
||||
Name = 'UNIDAD_MEDIDA'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'DESCUENTO'
|
||||
DataType = datFloat
|
||||
Name = 'IMPORTE_UNIDAD'
|
||||
DataType = datCurrency
|
||||
end
|
||||
item
|
||||
Name = 'IMPORTE_TOTAL'
|
||||
DataType = datCurrency
|
||||
end
|
||||
item
|
||||
Name = 'VISIBLE'
|
||||
DataType = datSmallInt
|
||||
Name = 'REFERENCIA_PROVEEDOR'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end
|
||||
item
|
||||
Name = 'REFERENCIA_FABRICANTE'
|
||||
DataType = datString
|
||||
Size = 255
|
||||
end>
|
||||
Params = <
|
||||
item
|
||||
Name = 'ID_FACTURA'
|
||||
Value = ''
|
||||
Name = 'ID_PEDIDO'
|
||||
Value = '2'
|
||||
ParamType = daptInput
|
||||
end>
|
||||
MasterParamsMappings.Strings = (
|
||||
|
||||
@ -186,10 +186,10 @@ begin
|
||||
while not tbl_Detalles.EOF do
|
||||
begin
|
||||
Rows.Item (iRowCount).Cells.Split (numRows, numCols, mergesplit);
|
||||
Cell(iRowCount, 1).Range.Text := FieldByName('REFPROVEEDOR').AsString;
|
||||
Cell(iRowCount, 2).Range.Text := FieldByName('REFFABRICANTE').AsString;
|
||||
Cell(iRowCount, 3).Range.Text := FieldByName('DESCRIPCION').AsString;
|
||||
Cell(iRowCount, 4).Range.Text := FieldByName('CANTIDAD').AsString + ' ' + FieldByName('UNIDADESMEDIDA').AsString;
|
||||
Cell(iRowCount, 1).Range.Text := FieldByName('REFERENCIA_PROVEEDOR').AsString;
|
||||
Cell(iRowCount, 2).Range.Text := FieldByName('REFERENCIA_FABRICANTE').AsString;
|
||||
Cell(iRowCount, 3).Range.Text := FieldByName('CONCEPTO').AsString;
|
||||
Cell(iRowCount, 4).Range.Text := FieldByName('CANTIDAD').AsString + ' ' + FieldByName('UNIDAD_MEDIDA').AsString;
|
||||
|
||||
if FImportes then
|
||||
Cell(iRowCount, 5).Range.Text := FormatFloat(DISPLAY_EUROS2, FieldByName('IMPORTE_UNIDAD').AsFloat)
|
||||
@ -245,41 +245,38 @@ begin
|
||||
|
||||
with FDocumento, tbl_Cabecera do
|
||||
begin
|
||||
ReplaceBookmark('CodigoPedido', FieldByName('CODIGO').AsString);
|
||||
ReplaceBookmark('FechaPedido', FieldByName('FECHAEMISION').AsString);
|
||||
ReplaceBookmark('CodigoPedido', FieldByName('REFERENCIA').AsString);
|
||||
ReplaceBookmark('FechaPedido', FieldByName('FECHA_PEDIDO').AsString);
|
||||
|
||||
// En la dirección mostrar aquellos campos que estén rellenos.
|
||||
DireccionEntrega := '';
|
||||
if not EsCadenaVacia(FieldByName('CALLEALMACEN').AsString) then
|
||||
DireccionEntrega := DireccionEntrega + FieldByName('CALLEALMACEN').AsString;
|
||||
if not EsCadenaVacia(FieldByName('NUMEROALMACEN').AsString) then
|
||||
DireccionEntrega := DireccionEntrega + ' ' + FieldByName('NUMEROALMACEN').AsString;
|
||||
if not EsCadenaVacia(FieldByName('PISOALMACEN').AsString) then
|
||||
DireccionEntrega := DireccionEntrega + ', ' + FieldByName('PISOALMACEN').AsString;
|
||||
if not EsCadenaVacia(FieldByName('CODIGOPOSTALALMACEN').AsString) then
|
||||
DireccionEntrega := DireccionEntrega + ', ' + FieldByName('CODIGOPOSTALALMACEN').AsString;
|
||||
if not EsCadenaVacia(FieldByName('POBLACIONALMACEN').AsString) then
|
||||
DireccionEntrega := DireccionEntrega + ', ' + FieldByName('POBLACIONALMACEN').AsString;
|
||||
if not EsCadenaVacia(FieldByName('PROVINCIAALMACEN').AsString) then
|
||||
DireccionEntrega := DireccionEntrega + ', ' + FieldByName('PROVINCIAALMACEN').AsString;
|
||||
if not EsCadenaVacia(FieldByName('CALLE_ALMACEN').AsString) then
|
||||
DireccionEntrega := DireccionEntrega + FieldByName('CALLE_ALMACEN').AsString;
|
||||
if not EsCadenaVacia(FieldByName('CODIGO_POSTAL_ALMACEN').AsString) then
|
||||
DireccionEntrega := DireccionEntrega + ', ' + FieldByName('CODIGO_POSTAL_ALMACEN').AsString;
|
||||
if not EsCadenaVacia(FieldByName('POBLACION_ALMACEN').AsString) then
|
||||
DireccionEntrega := DireccionEntrega + ', ' + FieldByName('POBLACION_ALMACEN').AsString;
|
||||
if not EsCadenaVacia(FieldByName('PROVINCIA_ALMACEN').AsString) then
|
||||
DireccionEntrega := DireccionEntrega + ', ' + FieldByName('PROVINCIA_ALMACEN').AsString;
|
||||
ReplaceBookmark('LugarEntrega', DireccionEntrega);
|
||||
|
||||
{ ReplaceBookmark('LugarEntrega', FieldByName('CALLEALMACEN').AsString + ' ' +
|
||||
FieldByName('NUMEROALMACEN').AsString + ', ' + FieldByName('PISOALMACEN').AsString + ', ' +
|
||||
FieldByName('CODIGOPOSTALALMACEN').AsString + ' ' + FieldByName('POBLACIONALMACEN').AsString + ', ' + FieldByName('PROVINCIAALMACEN').AsString);}
|
||||
|
||||
ReplaceBookmark('PersonaEntrega', FieldByName('PERSONACONTACTOALMACEN').AsString);
|
||||
ReplaceBookmark('PersonaEntrega', FieldByName('PERSONA_CONTACTO_ALMACEN').AsString);
|
||||
ReplaceBookmark('NombreProveedor', FieldByName('NOMBRE').AsString);
|
||||
ReplaceBookmark('FaxProveedor', FieldByName('FAX').AsString);
|
||||
ReplaceBookmark('PersonaContactoProveedor', FieldByName('PERSONACONTACTO').AsString);
|
||||
ReplaceBookmark('CodigoClienteProveedor', FieldByName('CODIGOCLIENTE').AsString);
|
||||
|
||||
{ ReplaceBookmark('PersonaContactoProveedor', FieldByName('PERSONA_CONTACTO').AsString);
|
||||
ReplaceBookmark('CodigoClienteProveedor', FieldByName('CODIGO_CLIENTE').AsString);}
|
||||
|
||||
if FImportes then
|
||||
ReplaceBookmark('ImporteTotal', FormatFloat(DISPLAY_EUROS2, FieldByName('IMPORTE_TOTAL').AsFloat))
|
||||
else
|
||||
ReplaceBookmark('ImporteTotal', '');
|
||||
|
||||
ReplaceBookmark('NotasPedido', FieldByName('NOTAS').AsString);
|
||||
ReplaceBookmark('NotasPedido', FieldByName('OBSERVACIONES').AsString);
|
||||
|
||||
ReplaceBookmark('NombreEmpresa', tbl_Empresa.FieldByName('NOMBRE').AsString);
|
||||
ReplaceBookmark('NombreEmpresa2', tbl_Empresa.FieldByName('NOMBRE').AsString);
|
||||
|
||||
@ -34,16 +34,18 @@ type
|
||||
protected
|
||||
{ IsrvPedidosProveedor methods }
|
||||
function GenerateReport(const ID: String): Binary;
|
||||
function GenerateReportEnWord(const ID: Integer): Binary;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.dfm}
|
||||
uses
|
||||
Dialogs,
|
||||
Dialogs, uSistemaFunc,
|
||||
{Generated:} FactuGES_Invk, uDataModuleServer, uDatabaseUtils,
|
||||
schPedidosProveedorClient_Intf, uRestriccionesUsuarioUtils,
|
||||
uBizPedidosProveedorServer, uRptPedidosProveedor_Server;
|
||||
uBizPedidosProveedorServer, uRptPedidosProveedor_Server,
|
||||
uRptWordPedidoProveedor;
|
||||
|
||||
{ uRORemoteDataModule,
|
||||
fServerForm, Variants, IB, schPedidosProveedorClient_Intf;
|
||||
@ -93,6 +95,25 @@ begin
|
||||
|
||||
end;
|
||||
|
||||
function TsrvPedidosProveedor.GenerateReportEnWord(const ID: Integer): Binary;
|
||||
var
|
||||
AReportGenerator : TRptWordPedidoProveedor;
|
||||
AFicheroTMP : TFileName;
|
||||
begin
|
||||
Result := NIL;
|
||||
AFicheroTMP := DarFicheroTemporal;
|
||||
AReportGenerator := TRptWordPedidoProveedor.Create(nil);
|
||||
try
|
||||
if AReportGenerator.Exportar(IntToStr(ID), AFicheroTMP) then
|
||||
begin
|
||||
Result := Binary.Create;
|
||||
Result.LoadFromFile(AFicheroTMP);
|
||||
end;
|
||||
finally
|
||||
FreeAndNIL(AReportGenerator);
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
TROClassFactory.Create('srvPedidosProveedor', Create_srvPedidosProveedor, TsrvPedidosProveedor_Invoker);
|
||||
|
||||
|
||||
@ -1,12 +1,14 @@
|
||||
inherited fEditorPedidosProveedorPreview: TfEditorPedidosProveedorPreview
|
||||
Caption = 'Previsualizar el pedidos proveedor'
|
||||
ExplicitWidth = 320
|
||||
ExplicitHeight = 240
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
inherited frxReport1: TfrxReport
|
||||
Datasets = <>
|
||||
Variables = <>
|
||||
Style = <>
|
||||
inherited TBXDock: TTBXDock
|
||||
inherited TBXToolbar1: TTBXToolbar
|
||||
ExplicitWidth = 540
|
||||
object TBXItem58: TTBXItem [1]
|
||||
Action = actExportarRTF
|
||||
Images = SmallImages
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -9,10 +9,13 @@ uses
|
||||
TB2ExtItems, TBXExtItems, TBX, TB2Item, TB2Dock, TB2Toolbar, pngimage,
|
||||
ExtCtrls, JvExControls, JvComponent, JvNavigationPane, uIEditorPedidosProveedorPreview,
|
||||
JvExComCtrls, JvStatusBar, frxExportImage, frxExportPDF, frxDCtrl, frxClass,
|
||||
frxDMPExport, frxGradient, frxChBox, frxCross, frxRich, frxOLE, frxBarcode;
|
||||
frxDMPExport, frxGradient, frxChBox, frxCross, frxRich, frxOLE, frxBarcode,
|
||||
frxExportText, frxExportRTF, frxExportMail, frxExportXLS;
|
||||
|
||||
type
|
||||
TfEditorPedidosProveedorPreview = class(TfEditorPreview, IEditorPedidosProveedorPreview)
|
||||
TBXItem58: TTBXItem;
|
||||
procedure actExportarRTFExecute(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
@ -24,4 +27,27 @@ implementation
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
uses
|
||||
uPedidosProveedorReportController;
|
||||
|
||||
procedure TfEditorPedidosProveedorPreview.actExportarRTFExecute(
|
||||
Sender: TObject);
|
||||
var
|
||||
AListaID : TStringList;
|
||||
I: Integer;
|
||||
begin
|
||||
// inherited; <- No llamar al padre
|
||||
if not Assigned(Controller) then
|
||||
raise Exception.Create('No se ha asignado el controlador necesario');
|
||||
|
||||
AListaID := TStringList.Create;
|
||||
try
|
||||
AListaID.CommaText := Self.ListaID;
|
||||
for I := 0 to AListaID.Count - 1 do
|
||||
(Controller as IPedidosProveedorReportController).ExportToWord(StrToInt(AListaID[I]));
|
||||
finally
|
||||
FreeAndNIL(AListaID);
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -306,6 +306,14 @@
|
||||
</Parameter>
|
||||
</Parameters>
|
||||
</Operation>
|
||||
<Operation Name="GenerateReportEnWord" UID="{05C0363D-B517-42CB-831E-E32337E9A20D}">
|
||||
<Parameters>
|
||||
<Parameter Name="Result" DataType="Binary" Flag="Result">
|
||||
</Parameter>
|
||||
<Parameter Name="ID" DataType="Integer" Flag="In" >
|
||||
</Parameter>
|
||||
</Parameters>
|
||||
</Operation>
|
||||
</Operations>
|
||||
</Interface>
|
||||
</Interfaces>
|
||||
|
||||
@ -516,6 +516,7 @@ type
|
||||
IsrvPedidosProveedor = interface(IDataAbstractService)
|
||||
['{3DCC03E4-E9CE-4798-99D4-7170C9CF815B}']
|
||||
function GenerateReport(const ID: String): Binary;
|
||||
function GenerateReportEnWord(const ID: Integer): Binary;
|
||||
end;
|
||||
|
||||
{ CosrvPedidosProveedor }
|
||||
@ -529,6 +530,7 @@ type
|
||||
function __GetInterfaceName:string; override;
|
||||
|
||||
function GenerateReport(const ID: String): Binary;
|
||||
function GenerateReportEnWord(const ID: Integer): Binary;
|
||||
end;
|
||||
|
||||
{ IsrvAlbaranesCliente }
|
||||
@ -1465,6 +1467,23 @@ begin
|
||||
end
|
||||
end;
|
||||
|
||||
function TsrvPedidosProveedor_Proxy.GenerateReportEnWord(const ID: Integer): Binary;
|
||||
begin
|
||||
try
|
||||
result := nil;
|
||||
__Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'GenerateReportEnWord');
|
||||
__Message.Write('ID', TypeInfo(Integer), ID, []);
|
||||
__Message.Finalize;
|
||||
|
||||
__TransportChannel.Dispatch(__Message);
|
||||
|
||||
__Message.Read('Result', TypeInfo(Binary), result, []);
|
||||
finally
|
||||
__Message.UnsetAttributes(__TransportChannel);
|
||||
__Message.FreeStream;
|
||||
end
|
||||
end;
|
||||
|
||||
{ CosrvAlbaranesCliente }
|
||||
|
||||
class function CosrvAlbaranesCliente.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvAlbaranesCliente;
|
||||
|
||||
@ -156,6 +156,7 @@ type
|
||||
protected
|
||||
published
|
||||
procedure Invoke_GenerateReport(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
procedure Invoke_GenerateReportEnWord(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
end;
|
||||
|
||||
TsrvAlbaranesCliente_Invoker = class(TDataAbstractService_Invoker)
|
||||
@ -675,6 +676,34 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TsrvPedidosProveedor_Invoker.Invoke_GenerateReportEnWord(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
{ function GenerateReportEnWord(const ID: Integer): Binary; }
|
||||
var
|
||||
ID: Integer;
|
||||
lResult: Binary;
|
||||
__lObjectDisposer: TROObjectDisposer;
|
||||
begin
|
||||
lResult := nil;
|
||||
try
|
||||
__Message.Read('ID', TypeInfo(Integer), ID, []);
|
||||
|
||||
lResult := (__Instance as IsrvPedidosProveedor).GenerateReportEnWord(ID);
|
||||
|
||||
__Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvPedidosProveedor', 'GenerateReportEnWordResponse');
|
||||
__Message.Write('Result', TypeInfo(Binary), lResult, []);
|
||||
__Message.Finalize;
|
||||
__Message.UnsetAttributes(__Transport);
|
||||
|
||||
finally
|
||||
__lObjectDisposer := TROObjectDisposer.Create(__Instance);
|
||||
try
|
||||
__lObjectDisposer.Add(lResult);
|
||||
finally
|
||||
__lObjectDisposer.Free();
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
{ TsrvAlbaranesCliente_Invoker }
|
||||
|
||||
procedure TsrvAlbaranesCliente_Invoker.Invoke_GenerateReport(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -4,6 +4,7 @@ program FactuGES_Server;
|
||||
|
||||
uses
|
||||
uROComInit,
|
||||
uROComboService,
|
||||
Forms,
|
||||
uServerMainForm in 'uServerMainForm.pas' {fServerForm},
|
||||
uAcercaDe in 'uAcercaDe.pas' {fAcercaDe},
|
||||
@ -100,7 +101,7 @@ uses
|
||||
uStringsUtils in '..\Base\Utiles\uStringsUtils.pas',
|
||||
FactuGES_Intf in '..\Servicios\FactuGES_Intf.pas',
|
||||
FactuGES_Invk in '..\Servicios\FactuGES_Invk.pas',
|
||||
uRptWordPresupuestoCliente in '..\Modulos\Presupuestos de cliente\Reports\uRptWordPresupuestoCliente.pas' {RptWordPresupuestosCliente: TDataModule},
|
||||
uRptWordPresupuestoCliente in '..\Modulos\Presupuestos de cliente\Reports\uRptWordPresupuestoCliente.pas' {RptWordPresupuestoCliente: TDataModule},
|
||||
AHWord97 in 'Utiles\AHWord97.pas',
|
||||
uSistemaFunc in '..\Base\Utiles\uSistemaFunc.pas',
|
||||
uRptWordAlbaranCliente in '..\Modulos\Albaranes de cliente\Reports\uRptWordAlbaranCliente.pas' {RptWordAlbaranCliente: TDataModule},
|
||||
@ -112,12 +113,13 @@ uses
|
||||
uRptFichasEmpleado_Server in '..\Modulos\Contactos\Reports\uRptFichasEmpleado_Server.pas' {RptFichasEmpleado: TDataModule},
|
||||
uRptEtiquetasContacto_Server in '..\Modulos\Contactos\Reports\uRptEtiquetasContacto_Server.pas' {RptEtiquetasContacto: TDataModule},
|
||||
uRptWordFacturaCliente in '..\Modulos\Facturas de cliente\Reports\uRptWordFacturaCliente.pas' {RptWordFacturaCliente: TDataModule},
|
||||
uCiaServiceTools in 'Utiles\uCiaServiceTools.pas',
|
||||
srvFabricantes_Impl in '..\Modulos\Fabricantes\Servidor\srvFabricantes_Impl.pas' {srvFabricantes: TDataAbstractService},
|
||||
schFabricantesClient_Intf in '..\Modulos\Fabricantes\Model\schFabricantesClient_Intf.pas',
|
||||
schFabricantesServer_Intf in '..\Modulos\Fabricantes\Model\schFabricantesServer_Intf.pas',
|
||||
schArticulosClient_Intf in '..\Modulos\Articulos\Model\schArticulosClient_Intf.pas',
|
||||
schArticulosServer_Intf in '..\Modulos\Articulos\Model\schArticulosServer_Intf.pas';
|
||||
schArticulosServer_Intf in '..\Modulos\Articulos\Model\schArticulosServer_Intf.pas',
|
||||
uRptPedidosProveedor_Server in '..\Modulos\Pedidos a proveedor\Reports\uRptPedidosProveedor_Server.pas' {RptPedidosProveedor: TDataModule},
|
||||
uRptWordPedidoProveedor in '..\Modulos\Pedidos a proveedor\Reports\uRptWordPedidoProveedor.pas' {RptWordPedidoProveedor: TDataModule};
|
||||
|
||||
{$R *.res}
|
||||
{$R ..\Servicios\RODLFile.res}
|
||||
@ -126,9 +128,12 @@ const
|
||||
FACTUGES_NAME = 'FactuGES Servidor';
|
||||
|
||||
begin
|
||||
if CiaStartService(FACTUGES_NAME) then begin
|
||||
CiaService.CreateForm(TfServerForm, fServerForm);
|
||||
CiaService.Run;
|
||||
if ROStartService(FACTUGES_NAME, FACTUGES_NAME) then
|
||||
begin
|
||||
// Aqui hay que comprobar antes si el servicio ya está en ejecucion
|
||||
|
||||
ROService.CreateForm(TdmServer, dmServer);
|
||||
ROService.Run;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
@ -136,8 +141,8 @@ begin
|
||||
// ReportMemoryLeaksOnShutdown := True;
|
||||
Application.Title := FACTUGES_NAME;
|
||||
|
||||
Application.ShowMainForm := False;
|
||||
|
||||
// Application.ShowMainForm := False;
|
||||
Application.CreateForm(TdmServer, dmServer);
|
||||
Application.CreateForm(TfServerForm, fServerForm);
|
||||
Application.Run;
|
||||
Application.Terminate;
|
||||
|
||||
@ -35,32 +35,7 @@
|
||||
<Borland.Personality>Delphi.Personality</Borland.Personality>
|
||||
<Borland.ProjectType />
|
||||
<BorlandProject>
|
||||
<BorlandProject><Delphi.Personality><Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><VersionInfo><VersionInfo Name="IncludeVerInfo">True</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">2</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">3082</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.2.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.2.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys><VersionInfoKeys Name="CompileDate">lunes, 03 de marzo de 2008 17:25</VersionInfoKeys></VersionInfoKeys><Excluded_Packages>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<Excluded_Packages Name="C:\Documents and Settings\All Users\Documentos\RAD Studio\5.0\Bpl\dxPSCoreD10.bpl">ExpressPrinting System by Developer Express Inc.</Excluded_Packages>
|
||||
<Excluded_Packages Name="$(BDS)\bin\dcloffice2k100.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
|
||||
<Excluded_Packages Name="$(BDS)\bin\dclofficexp100.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
|
||||
</Excluded_Packages><Source><Source Name="MainSource">FactuGES_Server.dpr</Source></Source></Delphi.Personality></BorlandProject></BorlandProject>
|
||||
<BorlandProject><Delphi.Personality><Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters><Parameters Name="RunParams">/standalone</Parameters></Parameters><VersionInfo><VersionInfo Name="IncludeVerInfo">True</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">2</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">3082</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.2.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.2.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys><VersionInfoKeys Name="CompileDate">martes, 04 de marzo de 2008 19:53</VersionInfoKeys></VersionInfoKeys><Excluded_Packages /><Source><Source Name="MainSource">FactuGES_Server.dpr</Source></Source></Delphi.Personality></BorlandProject></BorlandProject>
|
||||
</ProjectExtensions>
|
||||
<Import Project="$(MSBuildBinPath)\Borland.Delphi.Targets" />
|
||||
<ItemGroup>
|
||||
@ -178,6 +153,14 @@
|
||||
<DCCReference Include="..\Modulos\Pedidos a proveedor\Model\schPedidosProveedorClient_Intf.pas" />
|
||||
<DCCReference Include="..\Modulos\Pedidos a proveedor\Model\schPedidosProveedorServer_Intf.pas" />
|
||||
<DCCReference Include="..\Modulos\Pedidos a proveedor\Model\uBizPedidosProveedorServer.pas" />
|
||||
<DCCReference Include="..\Modulos\Pedidos a proveedor\Reports\uRptPedidosProveedor_Server.pas">
|
||||
<Form>RptPedidosProveedor</Form>
|
||||
<DesignClass>TDataModule</DesignClass>
|
||||
</DCCReference>
|
||||
<DCCReference Include="..\Modulos\Pedidos a proveedor\Reports\uRptWordPedidoProveedor.pas">
|
||||
<Form>RptWordPedidoProveedor</Form>
|
||||
<DesignClass>TDataModule</DesignClass>
|
||||
</DCCReference>
|
||||
<DCCReference Include="..\Modulos\Pedidos a proveedor\Servidor\srvPedidosProveedor_Impl.pas">
|
||||
<Form>srvPedidosProveedor</Form>
|
||||
<DesignClass>TDataAbstractService</DesignClass>
|
||||
@ -189,7 +172,7 @@
|
||||
<Form>RptPresupuestosCliente</Form>
|
||||
</DCCReference>
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\Reports\uRptWordPresupuestoCliente.pas">
|
||||
<Form>RptWordPresupuestosCliente</Form>
|
||||
<Form>RptWordPresupuestoCliente</Form>
|
||||
<DesignClass>TDataModule</DesignClass>
|
||||
</DCCReference>
|
||||
<DCCReference Include="..\Modulos\Presupuestos de cliente\Servidor\srvPresupuestosCliente_Impl.pas">
|
||||
@ -276,7 +259,6 @@
|
||||
<DCCReference Include="Utiles\AHWord97.pas" />
|
||||
<DCCReference Include="Utiles\RegExpr.pas" />
|
||||
<DCCReference Include="Utiles\uBusinessUtils.pas" />
|
||||
<DCCReference Include="Utiles\uCiaServiceTools.pas" />
|
||||
<DCCReference Include="Utiles\uDatabaseUtils.pas" />
|
||||
<DCCReference Include="Utiles\uReferenciasUtils.pas" />
|
||||
<DCCReference Include="Utiles\uRestriccionesUsuarioUtils.pas" />
|
||||
|
||||
@ -14,7 +14,7 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "FileVersion", "1.0.2.0\0"
|
||||
VALUE "ProductVersion", "1.0.2.0\0"
|
||||
VALUE "CompileDate", "lunes, 03 de marzo de 2008 17:25\0"
|
||||
VALUE "CompileDate", "jueves, 20 de marzo de 2008 10:23\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
@ -1,161 +0,0 @@
|
||||
unit uCiaServiceTools;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
SysUtils, Classes, Windows, SvcMgr, WinSvc;
|
||||
|
||||
type
|
||||
TCiaService = class(TService)
|
||||
protected
|
||||
procedure Start(Sender: TService; var Started: boolean);
|
||||
procedure Stop(Sender: TService; var Stopped: boolean);
|
||||
procedure Execute(Sender: TService);
|
||||
public
|
||||
function GetServiceController: TServiceController; override;
|
||||
constructor CreateNew(AOwner: TComponent; Dummy: integer = 0); override;
|
||||
procedure CreateForm(InstanceClass: TComponentClass; var Reference);
|
||||
procedure Run;
|
||||
end;
|
||||
|
||||
function CiaStartService(DisplayName: string): Boolean;
|
||||
function CiaIsService: boolean;
|
||||
|
||||
var
|
||||
CiaService: TCiaService;
|
||||
|
||||
implementation
|
||||
|
||||
var
|
||||
FIsService: boolean;
|
||||
FServiceName: string;
|
||||
FDisplayName: string;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//---- TCiaService -------------------------------------------------------------
|
||||
//------------------------------------------------------------------------------
|
||||
procedure ServiceController(CtrlCode: dword); stdcall;
|
||||
begin
|
||||
CiaService.Controller(CtrlCode);
|
||||
end;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function TCiaService.GetServiceController: TServiceController;
|
||||
begin
|
||||
result := ServiceController;
|
||||
end;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
procedure TCiaService.CreateForm(InstanceClass: TComponentClass; var Reference);
|
||||
begin
|
||||
SvcMgr.Application.CreateForm(InstanceClass, Reference);
|
||||
end;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
procedure TCiaService.Run;
|
||||
begin
|
||||
SvcMgr.Application.Run;
|
||||
end;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
constructor TCiaService.CreateNew(AOwner: TComponent; Dummy: integer);
|
||||
begin
|
||||
inherited;
|
||||
AllowPause := False;
|
||||
Interactive := True;
|
||||
DisplayName := FDisplayName;
|
||||
Name := FServiceName;
|
||||
OnStart := Start;
|
||||
OnStop := Stop;
|
||||
end;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
procedure TCiaService.Start(Sender: TService; var Started: boolean);
|
||||
begin
|
||||
Started := True;
|
||||
end;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
procedure TCiaService.Execute(Sender: TService);
|
||||
begin
|
||||
while not Terminated do
|
||||
ServiceThread.ProcessRequests(True);
|
||||
end;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
procedure TCiaService.Stop(Sender: TService; var Stopped: boolean);
|
||||
begin
|
||||
Stopped := True;
|
||||
end;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//---- Various -----------------------------------------------------------------
|
||||
//------------------------------------------------------------------------------
|
||||
function CiaIsService: boolean;
|
||||
begin
|
||||
Result := FIsService;
|
||||
end;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function CiaStartService(DisplayName: string): Boolean;
|
||||
var
|
||||
Mgr, Svc: Integer;
|
||||
UserName, ServiceStartName: string;
|
||||
Config: Pointer;
|
||||
Size: DWord;
|
||||
n: integer;
|
||||
begin
|
||||
FDisplayName := DisplayName;
|
||||
FServiceName := DisplayName;
|
||||
|
||||
for n := 1 to Length(FServiceName) do
|
||||
if FServiceName[n] = ' ' then
|
||||
FServiceName[n] := '_';
|
||||
|
||||
FIsService := FindCmdLineSwitch('install', ['-','\','/'], True) or
|
||||
FindCmdLineSwitch('uninstall', ['-','\','/'], True);
|
||||
|
||||
if FIsService then begin
|
||||
SvcMgr.Application.Initialize;
|
||||
CiaService := TCiaService.CreateNew(SvcMgr.Application, 0);
|
||||
Result := True;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
Mgr := OpenSCManager(nil, nil, SC_MANAGER_ALL_ACCESS);
|
||||
if Mgr <> 0 then begin
|
||||
Svc := OpenService(Mgr, PChar(FServiceName), SERVICE_ALL_ACCESS);
|
||||
FIsService := Svc <> 0;
|
||||
if FIsService then begin
|
||||
QueryServiceConfig (Svc, nil, 0, Size);
|
||||
Config := AllocMem(Size);
|
||||
try
|
||||
QueryServiceConfig(Svc, Config, Size, Size);
|
||||
ServiceStartName := PQueryServiceConfig(Config)^.lpServiceStartName;
|
||||
if CompareText(ServiceStartName, 'LocalSystem') = 0 then
|
||||
ServiceStartName := 'SYSTEM';
|
||||
finally
|
||||
Dispose(Config);
|
||||
end;
|
||||
CloseServiceHandle(Svc);
|
||||
end;
|
||||
CloseServiceHandle(Mgr);
|
||||
end;
|
||||
|
||||
if FIsService then begin
|
||||
Size := 256;
|
||||
SetLength(UserName, Size);
|
||||
GetUserName(PChar(UserName), Size);
|
||||
SetLength(UserName, StrLen(PChar(UserName)));
|
||||
FIsService := CompareText(UserName, ServiceStartName) = 0;
|
||||
end;
|
||||
|
||||
Result := FIsService;
|
||||
|
||||
if FIsService then begin
|
||||
SvcMgr.Application.Initialize;
|
||||
CiaService := TCiaService.CreateNew(SvcMgr.Application, 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
@ -2,8 +2,8 @@ object dmServer: TdmServer
|
||||
OldCreateOrder = False
|
||||
OnCreate = DataModuleCreate
|
||||
OnDestroy = DataModuleDestroy
|
||||
Height = 307
|
||||
Width = 382
|
||||
Height = 285
|
||||
Width = 292
|
||||
object HTTPServer: TROIndyHTTPServer
|
||||
Dispatchers = <
|
||||
item
|
||||
|
||||
@ -72,7 +72,7 @@ implementation
|
||||
{$R *.dfm}
|
||||
|
||||
uses
|
||||
uROEncryption, DateUtils, JclFileUtils, ActiveX, Forms, Registry, Windows, Dialogs,
|
||||
uROComboService, uROEncryption, DateUtils, JclFileUtils, ActiveX, Forms, Registry, Windows, Dialogs,
|
||||
ExtCtrls, uSesionesUtils, uServerAppUtils;
|
||||
|
||||
function DarRutaInformes : String;
|
||||
@ -283,7 +283,8 @@ begin
|
||||
ConnectionName := ConnectionManager.GetDefaultConnectionName;
|
||||
ConnectionManager.Connections.GetDefaultConnection.ConnectionString := GetConnectionString;
|
||||
|
||||
ShowBalloonHint('Conectado a ' + ConnectionName, bfInfo);
|
||||
if not ROIsService then
|
||||
ShowBalloonHint('Conectado a ' + ConnectionName, bfInfo);
|
||||
|
||||
CoInitialize(nil);
|
||||
HTTPServer.Active := TRUE;
|
||||
|
||||
@ -14,7 +14,6 @@ object fServerForm: TfServerForm
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
OnCloseQuery = FormCloseQuery
|
||||
OnCreate = FormCreate
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
object JvGradient1: TJvGradient
|
||||
|
||||
@ -38,7 +38,6 @@ type
|
||||
procedure JvAppInstances1CmdLineReceived(Sender: TObject;
|
||||
CmdLine: TStrings);
|
||||
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
@ -51,17 +50,13 @@ var
|
||||
implementation
|
||||
|
||||
uses
|
||||
uDataModuleServer, uConfiguracion, uAcercaDe, uServerAppUtils,
|
||||
uCiaServiceTools;
|
||||
uROComboService, uDataModuleServer, uConfiguracion, uAcercaDe, uServerAppUtils;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfServerForm.actCerrarExecute(Sender: TObject);
|
||||
begin
|
||||
if CiaIsService then
|
||||
PostThreadMessage(CiaService.ServiceThread.ThreadID, WM_QUIT, 0, 0)
|
||||
else
|
||||
Application.Terminate;
|
||||
Application.Terminate;
|
||||
end;
|
||||
|
||||
procedure TfServerForm.actRestartExecute(Sender: TObject);
|
||||
@ -71,33 +66,27 @@ end;
|
||||
|
||||
procedure TfServerForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
||||
begin
|
||||
CanClose := False;
|
||||
|
||||
with JvProgressDialog1 do
|
||||
begin
|
||||
InitValues(0, 100, 10, 0, 'Cerrar FactuGES Server', 'Espere mientras FactuGES Server se cierra...');
|
||||
Show;
|
||||
while Assigned(dmServer) do
|
||||
if not ROIsService then
|
||||
with JvProgressDialog1 do
|
||||
begin
|
||||
if (Position + Interval > Max) then
|
||||
Position := Min
|
||||
else
|
||||
Position := Position + Interval;
|
||||
Refresh;
|
||||
FreeAndNIL(dmServer);
|
||||
Sleep(500);
|
||||
TrayIcon1.Visible := False;
|
||||
InitValues(0, 100, 10, 0, 'Cerrar FactuGES Server', 'Espere mientras FactuGES Server se cierra...');
|
||||
Show;
|
||||
while Assigned(dmServer) do
|
||||
begin
|
||||
if (Position + Interval > Max) then
|
||||
Position := Min
|
||||
else
|
||||
Position := Position + Interval;
|
||||
Refresh;
|
||||
FreeAndNIL(dmServer);
|
||||
Sleep(500);
|
||||
TrayIcon1.Visible := False;
|
||||
end;
|
||||
Hide;
|
||||
end;
|
||||
Hide;
|
||||
end;
|
||||
CanClose := True;
|
||||
end;
|
||||
|
||||
procedure TfServerForm.FormCreate(Sender: TObject);
|
||||
begin
|
||||
dmServer := TdmServer.Create(Self);
|
||||
end;
|
||||
|
||||
procedure TfServerForm.actOpcionesExecute(Sender: TObject);
|
||||
var
|
||||
AForm : TForm;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user