diff --git a/Build/Build.fbpInf b/Build/Build.fbpInf index 36e7b215..088ee318 100644 --- a/Build/Build.fbpInf +++ b/Build/Build.fbpInf @@ -14,8 +14,8 @@ - 00:03:10 - 11/04/2012 12:05:34 + 00:03:53 + 16/05/2013 15:44:27 True diff --git a/Build/Build.fbz6 b/Build/Build.fbz6 index 56f97843..c7d95488 100644 Binary files a/Build/Build.fbz6 and b/Build/Build.fbz6 differ diff --git a/Build/Installer.fbpInf b/Build/Installer.fbpInf index 2a3bdc4a..6c6be524 100644 --- a/Build/Installer.fbpInf +++ b/Build/Installer.fbpInf @@ -14,8 +14,8 @@ - 00:00:00 - 30/12/1899 - True + 00:00:15 + 17/05/2013 15:04:17 + False diff --git a/Build/Installer.fbz6 b/Build/Installer.fbz6 index 9cb9d04f..1dc50874 100644 Binary files a/Build/Installer.fbz6 and b/Build/Installer.fbz6 differ diff --git a/Database/scripts/factuges.sql b/Database/scripts/factuges.sql index cd7528a2..9b350562 100644 --- a/Database/scripts/factuges.sql +++ b/Database/scripts/factuges.sql @@ -433,44 +433,45 @@ CREATE TABLE COMISIONES_LIQ_VENDEDORES( IMPORTE_TOTAL TIPO_IMPORTE); CREATE TABLE ALBARANES_CLIENTE ( - ID TIPO_ID NOT NULL, - ID_EMPRESA TIPO_ID, - ID_CLIENTE TIPO_ID, + ID TIPO_ID NOT NULL /* TIPO_ID = INTEGER */, + ID_EMPRESA TIPO_ID /* TIPO_ID = INTEGER */, + ID_CLIENTE TIPO_ID /* TIPO_ID = INTEGER */, FECHA_ALBARAN DATE, - ID_ALMACEN TIPO_ID, - ID_PEDIDO TIPO_ID, - ID_FACTURA TIPO_ID, + ID_ALMACEN TIPO_ID /* TIPO_ID = INTEGER */, + ID_PEDIDO TIPO_ID /* TIPO_ID = INTEGER */, + ID_FACTURA TIPO_ID /* TIPO_ID = INTEGER */, TIPO VARCHAR(1), REFERENCIA VARCHAR(255), - ID_DIRECCION TIPO_ID, CALLE VARCHAR(255), CODIGO_POSTAL VARCHAR(10), POBLACION VARCHAR(255), PROVINCIA VARCHAR(255), PERSONA_CONTACTO VARCHAR(255), TELEFONO VARCHAR(25), - MOVIL VARCHAR(25), - IMPORTE_NETO TIPO_IMPORTE, - IMPORTE_PORTE TIPO_IMPORTE, - DESCUENTO TIPO_PORCENTAJE, - IMPORTE_DESCUENTO TIPO_IMPORTE, - BASE_IMPONIBLE TIPO_IMPORTE, - ID_TIPO_IVA TIPO_ID, - IVA TIPO_PORCENTAJE, - IMPORTE_IVA TIPO_IMPORTE, - IMPORTE_TOTAL TIPO_IMPORTE, - OBSERVACIONES TIPO_NOTAS, - INCIDENCIAS TIPO_NOTAS, + IMPORTE_NETO TIPO_IMPORTE /* TIPO_IMPORTE = NUMERIC(11,2) */, + IMPORTE_PORTE TIPO_IMPORTE /* TIPO_IMPORTE = NUMERIC(11,2) */, + DESCUENTO TIPO_PORCENTAJE /* TIPO_PORCENTAJE = FLOAT */, + IMPORTE_DESCUENTO TIPO_IMPORTE /* TIPO_IMPORTE = NUMERIC(11,2) */, + BASE_IMPONIBLE TIPO_IMPORTE /* TIPO_IMPORTE = NUMERIC(11,2) */, + IVA TIPO_PORCENTAJE /* TIPO_PORCENTAJE = FLOAT */, + IMPORTE_IVA TIPO_IMPORTE /* TIPO_IMPORTE = NUMERIC(11,2) */, + IMPORTE_TOTAL TIPO_IMPORTE /* TIPO_IMPORTE = NUMERIC(11,2) */, + OBSERVACIONES TIPO_NOTAS /* TIPO_NOTAS = BLOB SUB_TYPE 1 SEGMENT SIZE 80 */, + INCIDENCIAS TIPO_NOTAS /* TIPO_NOTAS = BLOB SUB_TYPE 1 SEGMENT SIZE 80 */, INCIDENCIAS_ACTIVAS SMALLINT DEFAULT 0 NOT NULL, FECHA_ALTA TIMESTAMP, FECHA_MODIFICACION TIMESTAMP, - USUARIO TIPO_USUARIO, - ID_FORMA_PAGO TIPO_ID, + USUARIO TIPO_USUARIO /* TIPO_USUARIO = VARCHAR(30) */, + ID_FORMA_PAGO TIPO_ID /* TIPO_ID = INTEGER */, FECHA_ENVIO DATE, FECHA_RECEPCION DATE, FECHA_PREVISTA_ENVIO DATE, - REFERENCIA_CLIENTE VARCHAR(255), - ID_TIENDA TIPO_ID + REFERENCIA_CLIENTE VARCHAR(255) COLLATE ES_ES, + ID_TIENDA TIPO_ID /* TIPO_ID = INTEGER */, + ID_DIRECCION TIPO_ID /* TIPO_ID = INTEGER */, + ID_TIPO_IVA TIPO_ID /* TIPO_ID = INTEGER */, + MOVIL VARCHAR(25), + ID_CONTRATO TIPO_ID /* TIPO_ID = INTEGER */ ); CREATE TABLE ALBARANES_CLIENTE_DETALLES ( @@ -1632,7 +1633,7 @@ CREATE VIEW V_ALBARANES_CLIENTE( PROVINCIA, PERSONA_CONTACTO, TELEFONO, - MOVIL, + MOVIL, IMPORTE_NETO, IMPORTE_PORTE, DESCUENTO, @@ -4261,6 +4262,7 @@ ALTER TABLE REFERENCIAS ADD CONSTRAINT PK_REFERENCIAS PRIMARY KEY (ID); /******************************************************************************/ ALTER TABLE ALBARANES_CLIENTE ADD CONSTRAINT FK_ALBARANES_CLIENTE_1 FOREIGN KEY (ID_FACTURA) REFERENCES FACTURAS_CLIENTE (ID) ON DELETE SET NULL ON UPDATE SET NULL; +ALTER TABLE ALBARANES_CLIENTE ADD CONSTRAINT FK_ALBARANES_CLIENTE_2 FOREIGN KEY (ID_CONTRATO) REFERENCES CONTRATOS_CLIENTE(ID) ON DELETE SET NULL ON UPDATE SET NULL; ALTER TABLE ALBARANES_CLIENTE ADD CONSTRAINT FK_ALBARAN_CLIENTE_2 FOREIGN KEY (ID_EMPRESA) REFERENCES EMPRESAS (ID) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE ALBARANES_PROVEEDOR ADD CONSTRAINT FK_ALBARAN_PROVEEDOR_2 FOREIGN KEY (ID_EMPRESA) REFERENCES EMPRESAS (ID) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE ALMACENES ADD CONSTRAINT FK_ALMACENES_EMPRESAS FOREIGN KEY (ID_EMPRESA) REFERENCES EMPRESAS (ID) ON DELETE NO ACTION ON UPDATE NO ACTION; diff --git a/Source/ApplicationBase/ApplicationBase.dproj b/Source/ApplicationBase/ApplicationBase.dproj index 7c7c24db..343ce860 100644 --- a/Source/ApplicationBase/ApplicationBase.dproj +++ b/Source/ApplicationBase/ApplicationBase.dproj @@ -56,50 +56,53 @@ MainSource + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
fConfiguracionEditor
- + +
frViewConfiguracionBase
+ TFrame +
frViewConfiguracionGeneral
TFrame
- - - - - - diff --git a/Source/Base/Base.dproj b/Source/Base/Base.dproj index 95ba1f77..426db58c 100644 --- a/Source/Base/Base.dproj +++ b/Source/Base/Base.dproj @@ -58,55 +58,55 @@ MainSource - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
fConfigurarConexion
TForm diff --git a/Source/Cliente/FactuGES.dproj b/Source/Cliente/FactuGES.dproj index 7d32c92e..519bf9e4 100644 --- a/Source/Cliente/FactuGES.dproj +++ b/Source/Cliente/FactuGES.dproj @@ -52,7 +52,8 @@ Delphi.Personality VCLApplication -FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse2520FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.5.2.0FactuGESFactuGES2.5.2.0 +FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse2530FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.5.3.0FactuGESFactuGES2.5.3.0 + File C:\Documents and Settings\All Users\Documentos\RAD Studio\5.0\Bpl\dxPScxScheduler2LnkD11.bpl not found FactuGES.dprFalse diff --git a/Source/Cliente/FactuGES.rc b/Source/Cliente/FactuGES.rc index 6aea2108..85ecd366 100644 --- a/Source/Cliente/FactuGES.rc +++ b/Source/Cliente/FactuGES.rc @@ -1,7 +1,7 @@ MAINICON ICON "C:\Codigo Acana\Resources\Iconos\Factuges.ico" 1 VERSIONINFO -FILEVERSION 2,5,2,0 -PRODUCTVERSION 2,5,2,0 +FILEVERSION 2,5,3,0 +PRODUCTVERSION 2,5,3,0 FILEFLAGSMASK 0x3FL FILEFLAGS 0x00L FILEOS 0x40004L @@ -13,10 +13,10 @@ BEGIN BLOCK "0C0A04E4" BEGIN VALUE "CompanyName", "Rodax Software S.L.\0" - VALUE "FileVersion", "2.5.2.0\0" + VALUE "FileVersion", "2.5.3.0\0" VALUE "InternalName", "FactuGES\0" VALUE "ProductName", "FactuGES\0" - VALUE "ProductVersion", "2.5.2.0\0" + VALUE "ProductVersion", "2.5.3.0\0" END END BLOCK "VarFileInfo" diff --git a/Source/Cliente/FactuGES.res b/Source/Cliente/FactuGES.res index f2abbcb7..f6fb879c 100644 Binary files a/Source/Cliente/FactuGES.res and b/Source/Cliente/FactuGES.res differ diff --git a/Source/FactuGES.inc b/Source/FactuGES.inc index bf434910..72603a0d 100644 --- a/Source/FactuGES.inc +++ b/Source/FactuGES.inc @@ -1,4 +1,4 @@ {$DEFINE MULTIEMPRESA} -{$DEFINE ALMACEN} +{DEFINE ALMACEN} {DEFINE PEDIDOSPROVEEDOR} {$DEFINE CONTABILIDAD} \ No newline at end of file diff --git a/Source/GUIBase/GUIBase.res b/Source/GUIBase/GUIBase.res index 8b251f31..1641339f 100644 Binary files a/Source/GUIBase/GUIBase.res and b/Source/GUIBase/GUIBase.res differ diff --git a/Source/Modulos/Albaranes de cliente/AlbaranesCliente_Group.groupproj b/Source/Modulos/Albaranes de cliente/AlbaranesCliente_Group.groupproj index 6480e68e..faccdbc9 100644 --- a/Source/Modulos/Albaranes de cliente/AlbaranesCliente_Group.groupproj +++ b/Source/Modulos/Albaranes de cliente/AlbaranesCliente_Group.groupproj @@ -13,6 +13,8 @@ + + @@ -97,6 +99,24 @@ + + + + + + + + + + + + + + + + + + @@ -152,13 +172,13 @@ - + - + - + \ No newline at end of file diff --git a/Source/Modulos/Albaranes de cliente/Data/uDataModuleAlbaranesCliente.dfm b/Source/Modulos/Albaranes de cliente/Data/uDataModuleAlbaranesCliente.dfm index c49c7292..e3fb20bc 100644 --- a/Source/Modulos/Albaranes de cliente/Data/uDataModuleAlbaranesCliente.dfm +++ b/Source/Modulos/Albaranes de cliente/Data/uDataModuleAlbaranesCliente.dfm @@ -26,6 +26,11 @@ inherited DataModuleAlbaranesCliente: TDataModuleAlbaranesCliente object tbl_AlbaranesCliente: TDAMemDataTable RemoteUpdatesOptions = [] Fields = < + item + Name = 'ID_CONTRATO' + DataType = datInteger + DictionaryEntry = 'AlbaranesCliente_ID_CONTRATO' + end item Name = 'ID' DataType = datAutoInc @@ -112,6 +117,13 @@ inherited DataModuleAlbaranesCliente: TDataModuleAlbaranesCliente DisplayLabel = 'Ref. pedido cliente' DictionaryEntry = 'AlbaranesCliente_REF_PEDIDO' end + item + Name = 'REF_CONTRATO' + DataType = datString + Size = 255 + DisplayLabel = 'Ref. contrato cliente' + DictionaryEntry = 'AlbaranesCliente_REF_CONTRATO' + end item Name = 'ID_FACTURA' DataType = datInteger @@ -182,6 +194,8 @@ inherited DataModuleAlbaranesCliente: TDataModuleAlbaranesCliente Name = 'MOVIL' DataType = datString Size = 25 + DisplayLabel = 'AlbaranesCliente_MOVIL' + DictionaryEntry = 'AlbaranesCliente_MOVIL' end item Name = 'IMPORTE_NETO' @@ -222,6 +236,8 @@ inherited DataModuleAlbaranesCliente: TDataModuleAlbaranesCliente item Name = 'ID_TIPO_IVA' DataType = datInteger + DisplayLabel = 'AlbaranesCliente_ID_TIPO_IVA' + DictionaryEntry = 'AlbaranesCliente_ID_TIPO_IVA' end item Name = 'IVA' diff --git a/Source/Modulos/Albaranes de cliente/Model/schAlbaranesClienteClient_Intf.pas b/Source/Modulos/Albaranes de cliente/Model/schAlbaranesClienteClient_Intf.pas index 845a062d..1a5a0fdc 100644 --- a/Source/Modulos/Albaranes de cliente/Model/schAlbaranesClienteClient_Intf.pas +++ b/Source/Modulos/Albaranes de cliente/Model/schAlbaranesClienteClient_Intf.pas @@ -9,9 +9,9 @@ const { Data table rules ids Feel free to change them to something more human readable but make sure they are unique in the context of your application } - RID_ListaAnosAlbaranes = '{B52C00C6-FE82-4F51-81FA-B4FF1B82A203}'; - RID_AlbaranesCliente = '{34BC09FF-5B71-4550-8CB0-1DA569B133D7}'; - RID_AlbaranesCliente_Detalles = '{86D6C469-278B-4655-A28C-3359D8812BB1}'; + RID_ListaAnosAlbaranes = '{7EB3AC27-59E8-42B4-ADA3-CE4D9CAEB13C}'; + RID_AlbaranesCliente = '{D2DA1D56-1646-4F90-8DE9-D4B5FFE8B553}'; + RID_AlbaranesCliente_Detalles = '{BBD1F7AA-F56C-43AE-A7C7-0F58965BDF4A}'; { Data table names } nme_ListaAnosAlbaranes = 'ListaAnosAlbaranes'; @@ -25,6 +25,7 @@ const idx_ListaAnosAlbaranesANO = 0; { AlbaranesCliente fields } + fld_AlbaranesClienteID_CONTRATO = 'ID_CONTRATO'; fld_AlbaranesClienteID = 'ID'; fld_AlbaranesClienteID_EMPRESA = 'ID_EMPRESA'; fld_AlbaranesClienteID_CLIENTE = 'ID_CLIENTE'; @@ -38,6 +39,7 @@ const fld_AlbaranesClienteNOMBRE_ALMACEN = 'NOMBRE_ALMACEN'; fld_AlbaranesClienteID_PEDIDO = 'ID_PEDIDO'; fld_AlbaranesClienteREF_PEDIDO = 'REF_PEDIDO'; + fld_AlbaranesClienteREF_CONTRATO = 'REF_CONTRATO'; fld_AlbaranesClienteID_FACTURA = 'ID_FACTURA'; fld_AlbaranesClienteREF_FACTURA = 'REF_FACTURA'; fld_AlbaranesClienteID_DIRECCION = 'ID_DIRECCION'; @@ -71,50 +73,52 @@ const fld_AlbaranesClienteTIENDA = 'TIENDA'; { AlbaranesCliente field indexes } - idx_AlbaranesClienteID = 0; - idx_AlbaranesClienteID_EMPRESA = 1; - idx_AlbaranesClienteID_CLIENTE = 2; - idx_AlbaranesClienteNOMBRE = 3; - idx_AlbaranesClienteFECHA_ALBARAN = 4; - idx_AlbaranesClienteREFERENCIA = 5; - idx_AlbaranesClienteREFERENCIA_CLIENTE = 6; - idx_AlbaranesClienteTIPO = 7; - idx_AlbaranesClienteSITUACION = 8; - idx_AlbaranesClienteID_ALMACEN = 9; - idx_AlbaranesClienteNOMBRE_ALMACEN = 10; - idx_AlbaranesClienteID_PEDIDO = 11; - idx_AlbaranesClienteREF_PEDIDO = 12; - idx_AlbaranesClienteID_FACTURA = 13; - idx_AlbaranesClienteREF_FACTURA = 14; - idx_AlbaranesClienteID_DIRECCION = 15; - idx_AlbaranesClienteCALLE = 16; - idx_AlbaranesClienteCODIGO_POSTAL = 17; - idx_AlbaranesClientePOBLACION = 18; - idx_AlbaranesClientePROVINCIA = 19; - idx_AlbaranesClientePERSONA_CONTACTO = 20; - idx_AlbaranesClienteTELEFONO = 21; - idx_AlbaranesClienteMOVIL = 22; - idx_AlbaranesClienteIMPORTE_NETO = 23; - idx_AlbaranesClienteIMPORTE_PORTE = 24; - idx_AlbaranesClienteDESCUENTO = 25; - idx_AlbaranesClienteIMPORTE_DESCUENTO = 26; - idx_AlbaranesClienteBASE_IMPONIBLE = 27; - idx_AlbaranesClienteID_TIPO_IVA = 28; - idx_AlbaranesClienteIVA = 29; - idx_AlbaranesClienteIMPORTE_IVA = 30; - idx_AlbaranesClienteIMPORTE_TOTAL = 31; - idx_AlbaranesClienteOBSERVACIONES = 32; - idx_AlbaranesClienteINCIDENCIAS = 33; - idx_AlbaranesClienteINCIDENCIAS_ACTIVAS = 34; - idx_AlbaranesClienteFECHA_ALTA = 35; - idx_AlbaranesClienteFECHA_MODIFICACION = 36; - idx_AlbaranesClienteUSUARIO = 37; - idx_AlbaranesClienteID_FORMA_PAGO = 38; - idx_AlbaranesClienteFECHA_PREVISTA_ENVIO = 39; - idx_AlbaranesClienteFECHA_ENVIO = 40; - idx_AlbaranesClienteFECHA_RECEPCION = 41; - idx_AlbaranesClienteID_TIENDA = 42; - idx_AlbaranesClienteTIENDA = 43; + idx_AlbaranesClienteID_CONTRATO = 0; + idx_AlbaranesClienteID = 1; + idx_AlbaranesClienteID_EMPRESA = 2; + idx_AlbaranesClienteID_CLIENTE = 3; + idx_AlbaranesClienteNOMBRE = 4; + idx_AlbaranesClienteFECHA_ALBARAN = 5; + idx_AlbaranesClienteREFERENCIA = 6; + idx_AlbaranesClienteREFERENCIA_CLIENTE = 7; + idx_AlbaranesClienteTIPO = 8; + idx_AlbaranesClienteSITUACION = 9; + idx_AlbaranesClienteID_ALMACEN = 10; + idx_AlbaranesClienteNOMBRE_ALMACEN = 11; + idx_AlbaranesClienteID_PEDIDO = 12; + idx_AlbaranesClienteREF_PEDIDO = 13; + idx_AlbaranesClienteREF_CONTRATO = 14; + idx_AlbaranesClienteID_FACTURA = 15; + idx_AlbaranesClienteREF_FACTURA = 16; + idx_AlbaranesClienteID_DIRECCION = 17; + idx_AlbaranesClienteCALLE = 18; + idx_AlbaranesClienteCODIGO_POSTAL = 19; + idx_AlbaranesClientePOBLACION = 20; + idx_AlbaranesClientePROVINCIA = 21; + idx_AlbaranesClientePERSONA_CONTACTO = 22; + idx_AlbaranesClienteTELEFONO = 23; + idx_AlbaranesClienteMOVIL = 24; + idx_AlbaranesClienteIMPORTE_NETO = 25; + idx_AlbaranesClienteIMPORTE_PORTE = 26; + idx_AlbaranesClienteDESCUENTO = 27; + idx_AlbaranesClienteIMPORTE_DESCUENTO = 28; + idx_AlbaranesClienteBASE_IMPONIBLE = 29; + idx_AlbaranesClienteID_TIPO_IVA = 30; + idx_AlbaranesClienteIVA = 31; + idx_AlbaranesClienteIMPORTE_IVA = 32; + idx_AlbaranesClienteIMPORTE_TOTAL = 33; + idx_AlbaranesClienteOBSERVACIONES = 34; + idx_AlbaranesClienteINCIDENCIAS = 35; + idx_AlbaranesClienteINCIDENCIAS_ACTIVAS = 36; + idx_AlbaranesClienteFECHA_ALTA = 37; + idx_AlbaranesClienteFECHA_MODIFICACION = 38; + idx_AlbaranesClienteUSUARIO = 39; + idx_AlbaranesClienteID_FORMA_PAGO = 40; + idx_AlbaranesClienteFECHA_PREVISTA_ENVIO = 41; + idx_AlbaranesClienteFECHA_ENVIO = 42; + idx_AlbaranesClienteFECHA_RECEPCION = 43; + idx_AlbaranesClienteID_TIENDA = 44; + idx_AlbaranesClienteTIENDA = 45; { AlbaranesCliente_Detalles fields } fld_AlbaranesCliente_DetallesID = 'ID'; @@ -151,7 +155,7 @@ const type { IListaAnosAlbaranes } IListaAnosAlbaranes = interface(IDAStronglyTypedDataTable) - ['{88848224-91B5-41B0-A2FC-54BCF8BF5AE8}'] + ['{203EE597-D0C7-4604-A953-891F0E3D98FF}'] { Property getters and setters } function GetANOValue: String; procedure SetANOValue(const aValue: String); @@ -186,8 +190,12 @@ type { IAlbaranesCliente } IAlbaranesCliente = interface(IDAStronglyTypedDataTable) - ['{DFD09690-9B1D-4BE5-9101-46589DF1E88E}'] + ['{D6D78EF6-CA78-4ED9-B294-D1D466E1726B}'] { Property getters and setters } + function GetID_CONTRATOValue: Integer; + procedure SetID_CONTRATOValue(const aValue: Integer); + function GetID_CONTRATOIsNull: Boolean; + procedure SetID_CONTRATOIsNull(const aValue: Boolean); function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); function GetIDIsNull: Boolean; @@ -240,6 +248,10 @@ type procedure SetREF_PEDIDOValue(const aValue: String); function GetREF_PEDIDOIsNull: Boolean; procedure SetREF_PEDIDOIsNull(const aValue: Boolean); + function GetREF_CONTRATOValue: String; + procedure SetREF_CONTRATOValue(const aValue: String); + function GetREF_CONTRATOIsNull: Boolean; + procedure SetREF_CONTRATOIsNull(const aValue: Boolean); function GetID_FACTURAValue: Integer; procedure SetID_FACTURAValue(const aValue: Integer); function GetID_FACTURAIsNull: Boolean; @@ -365,6 +377,8 @@ type { Properties } + property ID_CONTRATO: Integer read GetID_CONTRATOValue write SetID_CONTRATOValue; + property ID_CONTRATOIsNull: Boolean read GetID_CONTRATOIsNull write SetID_CONTRATOIsNull; property ID: Integer read GetIDValue write SetIDValue; property IDIsNull: Boolean read GetIDIsNull write SetIDIsNull; property ID_EMPRESA: Integer read GetID_EMPRESAValue write SetID_EMPRESAValue; @@ -391,6 +405,8 @@ type property ID_PEDIDOIsNull: Boolean read GetID_PEDIDOIsNull write SetID_PEDIDOIsNull; property REF_PEDIDO: String read GetREF_PEDIDOValue write SetREF_PEDIDOValue; property REF_PEDIDOIsNull: Boolean read GetREF_PEDIDOIsNull write SetREF_PEDIDOIsNull; + property REF_CONTRATO: String read GetREF_CONTRATOValue write SetREF_CONTRATOValue; + property REF_CONTRATOIsNull: Boolean read GetREF_CONTRATOIsNull write SetREF_CONTRATOIsNull; property ID_FACTURA: Integer read GetID_FACTURAValue write SetID_FACTURAValue; property ID_FACTURAIsNull: Boolean read GetID_FACTURAIsNull write SetID_FACTURAIsNull; property REF_FACTURA: String read GetREF_FACTURAValue write SetREF_FACTURAValue; @@ -464,6 +480,10 @@ type procedure INCIDENCIAS_OnChange(Sender: TObject); protected { Property getters and setters } + function GetID_CONTRATOValue: Integer; virtual; + procedure SetID_CONTRATOValue(const aValue: Integer); virtual; + function GetID_CONTRATOIsNull: Boolean; virtual; + procedure SetID_CONTRATOIsNull(const aValue: Boolean); virtual; function GetIDValue: Integer; virtual; procedure SetIDValue(const aValue: Integer); virtual; function GetIDIsNull: Boolean; virtual; @@ -516,6 +536,10 @@ type procedure SetREF_PEDIDOValue(const aValue: String); virtual; function GetREF_PEDIDOIsNull: Boolean; virtual; procedure SetREF_PEDIDOIsNull(const aValue: Boolean); virtual; + function GetREF_CONTRATOValue: String; virtual; + procedure SetREF_CONTRATOValue(const aValue: String); virtual; + function GetREF_CONTRATOIsNull: Boolean; virtual; + procedure SetREF_CONTRATOIsNull(const aValue: Boolean); virtual; function GetID_FACTURAValue: Integer; virtual; procedure SetID_FACTURAValue(const aValue: Integer); virtual; function GetID_FACTURAIsNull: Boolean; virtual; @@ -640,6 +664,8 @@ type procedure SetTIENDAIsNull(const aValue: Boolean); virtual; { Properties } + property ID_CONTRATO: Integer read GetID_CONTRATOValue write SetID_CONTRATOValue; + property ID_CONTRATOIsNull: Boolean read GetID_CONTRATOIsNull write SetID_CONTRATOIsNull; property ID: Integer read GetIDValue write SetIDValue; property IDIsNull: Boolean read GetIDIsNull write SetIDIsNull; property ID_EMPRESA: Integer read GetID_EMPRESAValue write SetID_EMPRESAValue; @@ -666,6 +692,8 @@ type property ID_PEDIDOIsNull: Boolean read GetID_PEDIDOIsNull write SetID_PEDIDOIsNull; property REF_PEDIDO: String read GetREF_PEDIDOValue write SetREF_PEDIDOValue; property REF_PEDIDOIsNull: Boolean read GetREF_PEDIDOIsNull write SetREF_PEDIDOIsNull; + property REF_CONTRATO: String read GetREF_CONTRATOValue write SetREF_CONTRATOValue; + property REF_CONTRATOIsNull: Boolean read GetREF_CONTRATOIsNull write SetREF_CONTRATOIsNull; property ID_FACTURA: Integer read GetID_FACTURAValue write SetID_FACTURAValue; property ID_FACTURAIsNull: Boolean read GetID_FACTURAIsNull write SetID_FACTURAIsNull; property REF_FACTURA: String read GetREF_FACTURAValue write SetREF_FACTURAValue; @@ -737,7 +765,7 @@ type { IAlbaranesCliente_Detalles } IAlbaranesCliente_Detalles = interface(IDAStronglyTypedDataTable) - ['{B45193BD-105D-44E3-AF4D-BB43F4A1D1CA}'] + ['{020AD67D-D6F1-4E13-962A-E7B9FE5F4C5E}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -994,6 +1022,27 @@ begin if DataTable.Editing then DataTable.Fields[idx_AlbaranesClienteINCIDENCIAS].AsVariant := TStringList(Sender).Text; end; +function TAlbaranesClienteDataTableRules.GetID_CONTRATOValue: Integer; +begin + result := DataTable.Fields[idx_AlbaranesClienteID_CONTRATO].AsInteger; +end; + +procedure TAlbaranesClienteDataTableRules.SetID_CONTRATOValue(const aValue: Integer); +begin + DataTable.Fields[idx_AlbaranesClienteID_CONTRATO].AsInteger := aValue; +end; + +function TAlbaranesClienteDataTableRules.GetID_CONTRATOIsNull: boolean; +begin + result := DataTable.Fields[idx_AlbaranesClienteID_CONTRATO].IsNull; +end; + +procedure TAlbaranesClienteDataTableRules.SetID_CONTRATOIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_AlbaranesClienteID_CONTRATO].AsVariant := Null; +end; + function TAlbaranesClienteDataTableRules.GetIDValue: Integer; begin result := DataTable.Fields[idx_AlbaranesClienteID].AsInteger; @@ -1267,6 +1316,27 @@ begin DataTable.Fields[idx_AlbaranesClienteREF_PEDIDO].AsVariant := Null; end; +function TAlbaranesClienteDataTableRules.GetREF_CONTRATOValue: String; +begin + result := DataTable.Fields[idx_AlbaranesClienteREF_CONTRATO].AsString; +end; + +procedure TAlbaranesClienteDataTableRules.SetREF_CONTRATOValue(const aValue: String); +begin + DataTable.Fields[idx_AlbaranesClienteREF_CONTRATO].AsString := aValue; +end; + +function TAlbaranesClienteDataTableRules.GetREF_CONTRATOIsNull: boolean; +begin + result := DataTable.Fields[idx_AlbaranesClienteREF_CONTRATO].IsNull; +end; + +procedure TAlbaranesClienteDataTableRules.SetREF_CONTRATOIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_AlbaranesClienteREF_CONTRATO].AsVariant := Null; +end; + function TAlbaranesClienteDataTableRules.GetID_FACTURAValue: Integer; begin result := DataTable.Fields[idx_AlbaranesClienteID_FACTURA].AsInteger; diff --git a/Source/Modulos/Albaranes de cliente/Model/schAlbaranesClienteServer_Intf.pas b/Source/Modulos/Albaranes de cliente/Model/schAlbaranesClienteServer_Intf.pas index 5be1a8e8..119cd060 100644 --- a/Source/Modulos/Albaranes de cliente/Model/schAlbaranesClienteServer_Intf.pas +++ b/Source/Modulos/Albaranes de cliente/Model/schAlbaranesClienteServer_Intf.pas @@ -9,14 +9,14 @@ const { Delta rules ids Feel free to change them to something more human readable but make sure they are unique in the context of your application } - RID_ListaAnosAlbaranesDelta = '{D19A666D-8DA1-4DA3-9C5E-70934F26B596}'; - RID_AlbaranesClienteDelta = '{EC9EB4AE-4745-4CE3-83EB-C57CAA4CCFCD}'; - RID_AlbaranesCliente_DetallesDelta = '{0B383F46-915A-4744-915D-0986E32003B3}'; + RID_ListaAnosAlbaranesDelta = '{B498D9C0-EE0A-46DA-A371-702D825BDB3A}'; + RID_AlbaranesClienteDelta = '{D704D54E-00E5-4A35-B737-A915BB515300}'; + RID_AlbaranesCliente_DetallesDelta = '{999E4300-FF31-4EA7-B81E-287E2000B1BD}'; type { IListaAnosAlbaranesDelta } IListaAnosAlbaranesDelta = interface(IListaAnosAlbaranes) - ['{D19A666D-8DA1-4DA3-9C5E-70934F26B596}'] + ['{B498D9C0-EE0A-46DA-A371-702D825BDB3A}'] { Property getters and setters } function GetOldANOValue : String; @@ -50,8 +50,9 @@ type { IAlbaranesClienteDelta } IAlbaranesClienteDelta = interface(IAlbaranesCliente) - ['{EC9EB4AE-4745-4CE3-83EB-C57CAA4CCFCD}'] + ['{D704D54E-00E5-4A35-B737-A915BB515300}'] { Property getters and setters } + function GetOldID_CONTRATOValue : Integer; function GetOldIDValue : Integer; function GetOldID_EMPRESAValue : Integer; function GetOldID_CLIENTEValue : Integer; @@ -65,6 +66,7 @@ type function GetOldNOMBRE_ALMACENValue : String; function GetOldID_PEDIDOValue : Integer; function GetOldREF_PEDIDOValue : String; + function GetOldREF_CONTRATOValue : String; function GetOldID_FACTURAValue : Integer; function GetOldREF_FACTURAValue : String; function GetOldID_DIRECCIONValue : Integer; @@ -98,6 +100,7 @@ type function GetOldTIENDAValue : String; { Properties } + property OldID_CONTRATO : Integer read GetOldID_CONTRATOValue; property OldID : Integer read GetOldIDValue; property OldID_EMPRESA : Integer read GetOldID_EMPRESAValue; property OldID_CLIENTE : Integer read GetOldID_CLIENTEValue; @@ -111,6 +114,7 @@ type property OldNOMBRE_ALMACEN : String read GetOldNOMBRE_ALMACENValue; property OldID_PEDIDO : Integer read GetOldID_PEDIDOValue; property OldREF_PEDIDO : String read GetOldREF_PEDIDOValue; + property OldREF_CONTRATO : String read GetOldREF_CONTRATOValue; property OldID_FACTURA : Integer read GetOldID_FACTURAValue; property OldREF_FACTURA : String read GetOldREF_FACTURAValue; property OldID_DIRECCION : Integer read GetOldID_DIRECCIONValue; @@ -153,6 +157,12 @@ type procedure INCIDENCIAS_OnChange(Sender: TObject); protected { Property getters and setters } + function GetID_CONTRATOValue: Integer; virtual; + function GetID_CONTRATOIsNull: Boolean; virtual; + function GetOldID_CONTRATOValue: Integer; virtual; + function GetOldID_CONTRATOIsNull: Boolean; virtual; + procedure SetID_CONTRATOValue(const aValue: Integer); virtual; + procedure SetID_CONTRATOIsNull(const aValue: Boolean); virtual; function GetIDValue: Integer; virtual; function GetIDIsNull: Boolean; virtual; function GetOldIDValue: Integer; virtual; @@ -231,6 +241,12 @@ type function GetOldREF_PEDIDOIsNull: Boolean; virtual; procedure SetREF_PEDIDOValue(const aValue: String); virtual; procedure SetREF_PEDIDOIsNull(const aValue: Boolean); virtual; + function GetREF_CONTRATOValue: String; virtual; + function GetREF_CONTRATOIsNull: Boolean; virtual; + function GetOldREF_CONTRATOValue: String; virtual; + function GetOldREF_CONTRATOIsNull: Boolean; virtual; + procedure SetREF_CONTRATOValue(const aValue: String); virtual; + procedure SetREF_CONTRATOIsNull(const aValue: Boolean); virtual; function GetID_FACTURAValue: Integer; virtual; function GetID_FACTURAIsNull: Boolean; virtual; function GetOldID_FACTURAValue: Integer; virtual; @@ -417,6 +433,10 @@ type procedure SetTIENDAIsNull(const aValue: Boolean); virtual; { Properties } + property ID_CONTRATO : Integer read GetID_CONTRATOValue write SetID_CONTRATOValue; + property ID_CONTRATOIsNull : Boolean read GetID_CONTRATOIsNull write SetID_CONTRATOIsNull; + property OldID_CONTRATO : Integer read GetOldID_CONTRATOValue; + property OldID_CONTRATOIsNull : Boolean read GetOldID_CONTRATOIsNull; property ID : Integer read GetIDValue write SetIDValue; property IDIsNull : Boolean read GetIDIsNull write SetIDIsNull; property OldID : Integer read GetOldIDValue; @@ -469,6 +489,10 @@ type property REF_PEDIDOIsNull : Boolean read GetREF_PEDIDOIsNull write SetREF_PEDIDOIsNull; property OldREF_PEDIDO : String read GetOldREF_PEDIDOValue; property OldREF_PEDIDOIsNull : Boolean read GetOldREF_PEDIDOIsNull; + property REF_CONTRATO : String read GetREF_CONTRATOValue write SetREF_CONTRATOValue; + property REF_CONTRATOIsNull : Boolean read GetREF_CONTRATOIsNull write SetREF_CONTRATOIsNull; + property OldREF_CONTRATO : String read GetOldREF_CONTRATOValue; + property OldREF_CONTRATOIsNull : Boolean read GetOldREF_CONTRATOIsNull; property ID_FACTURA : Integer read GetID_FACTURAValue write SetID_FACTURAValue; property ID_FACTURAIsNull : Boolean read GetID_FACTURAIsNull write SetID_FACTURAIsNull; property OldID_FACTURA : Integer read GetOldID_FACTURAValue; @@ -602,7 +626,7 @@ type { IAlbaranesCliente_DetallesDelta } IAlbaranesCliente_DetallesDelta = interface(IAlbaranesCliente_Detalles) - ['{0B383F46-915A-4744-915D-0986E32003B3}'] + ['{999E4300-FF31-4EA7-B81E-287E2000B1BD}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_ALBARANValue : Integer; @@ -869,6 +893,37 @@ begin BusinessProcessor.CurrentChange.NewValueByName[fld_AlbaranesClienteINCIDENCIAS] := TStringList(Sender).Text; end; +function TAlbaranesClienteBusinessProcessorRules.GetID_CONTRATOValue: Integer; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_AlbaranesClienteID_CONTRATO]; +end; + +function TAlbaranesClienteBusinessProcessorRules.GetID_CONTRATOIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_AlbaranesClienteID_CONTRATO]); +end; + +function TAlbaranesClienteBusinessProcessorRules.GetOldID_CONTRATOValue: Integer; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_AlbaranesClienteID_CONTRATO]; +end; + +function TAlbaranesClienteBusinessProcessorRules.GetOldID_CONTRATOIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_AlbaranesClienteID_CONTRATO]); +end; + +procedure TAlbaranesClienteBusinessProcessorRules.SetID_CONTRATOValue(const aValue: Integer); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_AlbaranesClienteID_CONTRATO] := aValue; +end; + +procedure TAlbaranesClienteBusinessProcessorRules.SetID_CONTRATOIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_AlbaranesClienteID_CONTRATO] := Null; +end; + function TAlbaranesClienteBusinessProcessorRules.GetIDValue: Integer; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_AlbaranesClienteID]; @@ -1272,6 +1327,37 @@ begin BusinessProcessor.CurrentChange.NewValueByName[fld_AlbaranesClienteREF_PEDIDO] := Null; end; +function TAlbaranesClienteBusinessProcessorRules.GetREF_CONTRATOValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_AlbaranesClienteREF_CONTRATO]; +end; + +function TAlbaranesClienteBusinessProcessorRules.GetREF_CONTRATOIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_AlbaranesClienteREF_CONTRATO]); +end; + +function TAlbaranesClienteBusinessProcessorRules.GetOldREF_CONTRATOValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_AlbaranesClienteREF_CONTRATO]; +end; + +function TAlbaranesClienteBusinessProcessorRules.GetOldREF_CONTRATOIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_AlbaranesClienteREF_CONTRATO]); +end; + +procedure TAlbaranesClienteBusinessProcessorRules.SetREF_CONTRATOValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_AlbaranesClienteREF_CONTRATO] := aValue; +end; + +procedure TAlbaranesClienteBusinessProcessorRules.SetREF_CONTRATOIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_AlbaranesClienteREF_CONTRATO] := Null; +end; + function TAlbaranesClienteBusinessProcessorRules.GetID_FACTURAValue: Integer; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_AlbaranesClienteID_FACTURA]; diff --git a/Source/Modulos/Albaranes de cliente/Servidor/srvAlbaranesCliente_Impl.dfm b/Source/Modulos/Albaranes de cliente/Servidor/srvAlbaranesCliente_Impl.dfm index 434c5b4b..b2c226b5 100644 --- a/Source/Modulos/Albaranes de cliente/Servidor/srvAlbaranesCliente_Impl.dfm +++ b/Source/Modulos/Albaranes de cliente/Servidor/srvAlbaranesCliente_Impl.dfm @@ -223,10 +223,23 @@ object srvAlbaranesCliente: TsrvAlbaranesCliente item DatasetField = 'MOVIL' TableField = 'MOVIL' + end + item + DatasetField = 'ID_CONTRATO' + TableField = 'ID_CONTRATO' + end + item + DatasetField = 'REF_CONTRATO' + TableField = 'REF_CONTRATO' end> end> Name = 'AlbaranesCliente' Fields = < + item + Name = 'ID_CONTRATO' + DataType = datInteger + DictionaryEntry = 'AlbaranesCliente_ID_CONTRATO' + end item Name = 'ID' DataType = datAutoInc @@ -304,6 +317,12 @@ object srvAlbaranesCliente: TsrvAlbaranesCliente Size = 255 DictionaryEntry = 'AlbaranesCliente_REF_PEDIDO' end + item + Name = 'REF_CONTRATO' + DataType = datString + Size = 255 + DictionaryEntry = 'AlbaranesCliente_REF_CONTRATO' + end item Name = 'ID_FACTURA' DataType = datInteger @@ -366,6 +385,7 @@ object srvAlbaranesCliente: TsrvAlbaranesCliente Name = 'MOVIL' DataType = datString Size = 25 + DictionaryEntry = 'AlbaranesCliente_MOVIL' end item Name = 'IMPORTE_NETO' @@ -395,6 +415,7 @@ object srvAlbaranesCliente: TsrvAlbaranesCliente item Name = 'ID_TIPO_IVA' DataType = datInteger + DictionaryEntry = 'AlbaranesCliente_ID_TIPO_IVA' end item Name = 'IVA' @@ -686,6 +707,11 @@ object srvAlbaranesCliente: TsrvAlbaranesCliente DataType = datInteger Value = '' end + item + Name = 'ID_CONTRATO' + DataType = datInteger + Value = '' + end item Name = 'ID_FACTURA' DataType = datInteger @@ -837,22 +863,23 @@ object srvAlbaranesCliente: TsrvAlbaranesCliente SQL = 'INSERT'#10' INTO ALBARANES_CLIENTE'#10' (ID, ID_EMPRESA, ID_CLIENTE,' + ' FECHA_ALBARAN, TIPO, REFERENCIA,'#10' REFERENCIA_CLIENTE, ID_AL' + - 'MACEN, ID_PEDIDO, ID_FACTURA, ID_DIRECCION,'#10' CALLE, CODIGO_P' + - 'OSTAL, POBLACION, PROVINCIA, PERSONA_CONTACTO,'#10' TELEFONO, MO' + - 'VIL, IMPORTE_NETO, IMPORTE_PORTE, DESCUENTO, IMPORTE_DESCUENTO,'#10 + - ' BASE_IMPONIBLE, IVA, IMPORTE_IVA, IMPORTE_TOTAL, OBSERVACIO' + - 'NES, '#10' INCIDENCIAS, INCIDENCIAS_ACTIVAS, FECHA_ALTA, FECHA_M' + - 'ODIFICACION, '#10' USUARIO, ID_FORMA_PAGO, FECHA_PREVISTA_ENVIO,' + - ' FECHA_ENVIO, '#10' FECHA_RECEPCION, ID_TIENDA)'#10' VALUES'#10' (:I' + - 'D, :ID_EMPRESA, :ID_CLIENTE, :FECHA_ALBARAN, :TIPO, :REFERENCIA,' + - #10' :REFERENCIA_CLIENTE, :ID_ALMACEN, :ID_PEDIDO, :ID_FACTURA,' + - ' :ID_DIRECCION,'#10' :CALLE, :CODIGO_POSTAL, :POBLACION, :PROVIN' + - 'CIA, :PERSONA_CONTACTO,'#10' :TELEFONO, :MOVIL, :IMPORTE_NETO, :' + - 'IMPORTE_PORTE, :DESCUENTO, :IMPORTE_DESCUENTO,'#10' :BASE_IMPONI' + - 'BLE, :IVA, :IMPORTE_IVA, :IMPORTE_TOTAL, :OBSERVACIONES,'#10' :I' + - 'NCIDENCIAS, :INCIDENCIAS_ACTIVAS, CURRENT_TIMESTAMP, :FECHA_MODI' + - 'FICACION,'#10' :USUARIO, :ID_FORMA_PAGO, :FECHA_PREVISTA_ENVIO, ' + - ':FECHA_ENVIO, :FECHA_RECEPCION,'#10' :ID_TIENDA)'#10' '#10' '#10#10 + 'MACEN, ID_PEDIDO, ID_FACTURA, ID_CONTRATO, ID_DIRECCION,'#10' CA' + + 'LLE, CODIGO_POSTAL, POBLACION, PROVINCIA, PERSONA_CONTACTO,'#10' ' + + ' TELEFONO, MOVIL, IMPORTE_NETO, IMPORTE_PORTE, DESCUENTO, IMPORT' + + 'E_DESCUENTO,'#10' BASE_IMPONIBLE, IVA, IMPORTE_IVA, IMPORTE_TOTA' + + 'L, OBSERVACIONES, '#10' INCIDENCIAS, INCIDENCIAS_ACTIVAS, FECHA_' + + 'ALTA, FECHA_MODIFICACION, '#10' USUARIO, ID_FORMA_PAGO, FECHA_PR' + + 'EVISTA_ENVIO, FECHA_ENVIO, '#10' FECHA_RECEPCION, ID_TIENDA)'#10' V' + + 'ALUES'#10' (:ID, :ID_EMPRESA, :ID_CLIENTE, :FECHA_ALBARAN, :TIPO,' + + ' :REFERENCIA,'#10' :REFERENCIA_CLIENTE, :ID_ALMACEN, :ID_PEDIDO,' + + ' :ID_FACTURA, :ID_CONTRATO, :ID_DIRECCION,'#10' :CALLE, :CODIGO_' + + 'POSTAL, :POBLACION, :PROVINCIA, :PERSONA_CONTACTO,'#10' :TELEFON' + + 'O, :MOVIL, :IMPORTE_NETO, :IMPORTE_PORTE, :DESCUENTO, :IMPORTE_D' + + 'ESCUENTO,'#10' :BASE_IMPONIBLE, :IVA, :IMPORTE_IVA, :IMPORTE_TOT' + + 'AL, :OBSERVACIONES,'#10' :INCIDENCIAS, :INCIDENCIAS_ACTIVAS, CUR' + + 'RENT_TIMESTAMP, :FECHA_MODIFICACION,'#10' :USUARIO, :ID_FORMA_PA' + + 'GO, :FECHA_PREVISTA_ENVIO, :FECHA_ENVIO, :FECHA_RECEPCION,'#10' ' + + ':ID_TIENDA)'#10' '#10' '#10#10 StatementType = stSQL ColumnMappings = <> end> @@ -877,6 +904,11 @@ object srvAlbaranesCliente: TsrvAlbaranesCliente end item Params = < + item + Name = 'ID_CONTRATO' + DataType = datInteger + Value = '' + end item Name = 'ID_EMPRESA' DataType = datInteger @@ -1073,21 +1105,21 @@ object srvAlbaranesCliente: TsrvAlbaranesCliente #10' TIPO = :TIPO,'#10' REFERENCIA = :REFERENCIA, '#10' REFERENCIA' + '_CLIENTE = :REFERENCIA_CLIENTE, '#10' ID_ALMACEN = :ID_ALMACEN,'#10' ' + ' ID_PEDIDO = :ID_PEDIDO,'#10' ID_FACTURA = :ID_FACTURA,'#10' ID_' + - 'DIRECCION = :ID_DIRECCION,'#10' CALLE = :CALLE,'#10' CODIGO_POSTAL' + - ' = :CODIGO_POSTAL, '#10' POBLACION = :POBLACION, '#10' PROVINCIA =' + - ' :PROVINCIA, '#10' PERSONA_CONTACTO = :PERSONA_CONTACTO, '#10' TEL' + - 'EFONO = :TELEFONO, '#10' MOVIL = :MOVIL,'#10' IMPORTE_NETO = :IMPO' + - 'RTE_NETO, '#10' IMPORTE_PORTE = :IMPORTE_PORTE, '#10' DESCUENTO = ' + - ':DESCUENTO, '#10' IMPORTE_DESCUENTO = :IMPORTE_DESCUENTO, '#10' BA' + - 'SE_IMPONIBLE = :BASE_IMPONIBLE, '#10' IVA = :IVA, '#10' IMPORTE_IV' + - 'A = :IMPORTE_IVA, '#10' IMPORTE_TOTAL = :IMPORTE_TOTAL, '#10' OBSE' + - 'RVACIONES = :OBSERVACIONES, '#10' INCIDENCIAS = :INCIDENCIAS, '#10' ' + - ' INCIDENCIAS_ACTIVAS = :INCIDENCIAS_ACTIVAS, '#10' FECHA_MODIFIC' + - 'ACION = CURRENT_TIMESTAMP,'#10' USUARIO = :USUARIO, '#10' ID_FORMA' + - '_PAGO = :ID_FORMA_PAGO, '#10' FECHA_PREVISTA_ENVIO = :FECHA_PREVI' + - 'STA_ENVIO, '#10' FECHA_ENVIO = :FECHA_ENVIO, '#10' FECHA_RECEPCION' + - ' = :FECHA_RECEPCION,'#10' ID_TIENDA = :ID_TIENDA'#10' WHERE'#10' (ID ' + - '= :OLD_ID)'#10 + 'CONTRATO = :ID_CONTRATO,'#10' ID_DIRECCION = :ID_DIRECCION,'#10' C' + + 'ALLE = :CALLE,'#10' CODIGO_POSTAL = :CODIGO_POSTAL, '#10' POBLACIO' + + 'N = :POBLACION, '#10' PROVINCIA = :PROVINCIA, '#10' PERSONA_CONTAC' + + 'TO = :PERSONA_CONTACTO, '#10' TELEFONO = :TELEFONO, '#10' MOVIL = ' + + ':MOVIL,'#10' IMPORTE_NETO = :IMPORTE_NETO, '#10' IMPORTE_PORTE = :' + + 'IMPORTE_PORTE, '#10' DESCUENTO = :DESCUENTO, '#10' IMPORTE_DESCUEN' + + 'TO = :IMPORTE_DESCUENTO, '#10' BASE_IMPONIBLE = :BASE_IMPONIBLE, ' + + #10' IVA = :IVA, '#10' IMPORTE_IVA = :IMPORTE_IVA, '#10' IMPORTE_T' + + 'OTAL = :IMPORTE_TOTAL, '#10' OBSERVACIONES = :OBSERVACIONES, '#10' ' + + ' INCIDENCIAS = :INCIDENCIAS, '#10' INCIDENCIAS_ACTIVAS = :INCIDEN' + + 'CIAS_ACTIVAS, '#10' FECHA_MODIFICACION = CURRENT_TIMESTAMP,'#10' U' + + 'SUARIO = :USUARIO, '#10' ID_FORMA_PAGO = :ID_FORMA_PAGO, '#10' FEC' + + 'HA_PREVISTA_ENVIO = :FECHA_PREVISTA_ENVIO, '#10' FECHA_ENVIO = :F' + + 'ECHA_ENVIO, '#10' FECHA_RECEPCION = :FECHA_RECEPCION,'#10' ID_TIEN' + + 'DA = :ID_TIENDA'#10' WHERE'#10' (ID = :OLD_ID)'#10 StatementType = stSQL ColumnMappings = <> end> @@ -1685,6 +1717,26 @@ object srvAlbaranesCliente: TsrvAlbaranesCliente DataType = datString Size = 255 ServerAutoRefresh = True + end + item + Name = 'AlbaranesCliente_ID_CONTRATO' + DataType = datInteger + DisplayLabel = 'ID_CONTRATO' + end + item + Name = 'AlbaranesCliente_REF_CONTRATO' + DataType = datString + Size = 255 + DisplayLabel = 'Ref. contrato cliente' + end + item + Name = 'AlbaranesCliente_MOVIL' + DataType = datString + Size = 25 + end + item + Name = 'AlbaranesCliente_ID_TIPO_IVA' + DataType = datInteger end> Left = 48 Top = 136 diff --git a/Source/Modulos/Albaranes de cliente/Views/AlbaranesCliente_view.dpk b/Source/Modulos/Albaranes de cliente/Views/AlbaranesCliente_view.dpk index 780c6ac5..f4f071fb 100644 --- a/Source/Modulos/Albaranes de cliente/Views/AlbaranesCliente_view.dpk +++ b/Source/Modulos/Albaranes de cliente/Views/AlbaranesCliente_view.dpk @@ -32,7 +32,9 @@ requires AlbaranesCliente_controller, Articulos_view, Almacenes_controller, - AlbCli_FacCli_relation; + AlbCli_FacCli_relation, + ContratosCliente_controller, + ConCli_AlbCli_relation; contains uAlbaranesClienteViewRegister in 'uAlbaranesClienteViewRegister.pas', diff --git a/Source/Modulos/Albaranes de cliente/Views/AlbaranesCliente_view.dproj b/Source/Modulos/Albaranes de cliente/Views/AlbaranesCliente_view.dproj index 2f756bc7..3f152c59 100644 --- a/Source/Modulos/Albaranes de cliente/Views/AlbaranesCliente_view.dproj +++ b/Source/Modulos/Albaranes de cliente/Views/AlbaranesCliente_view.dproj @@ -43,6 +43,18 @@ Package FalseTrueFalseFalseFalseFalseTrueFalse1000FalseFalseFalseFalseFalse308212521.0.0.01.0.0.0 + + + + + + + + + + + + File c:\archivos de programa\borland\delphi10\Bin\dclIntraweb_80_100.bpl not found File c:\archivos de programa\borland\delphi10\Bin\dclnet100.bpl not found File c:\archivos de programa\borland\delphi10\Bin\dclsoap100.bpl not found @@ -54,14 +66,16 @@ MainSource - - - - - - - - + + + + + + + + + +
fEditorAlbaranCliente
diff --git a/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranCliente.dfm b/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranCliente.dfm index 14d8c4dc..4e4c1438 100644 --- a/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranCliente.dfm +++ b/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranCliente.dfm @@ -201,12 +201,19 @@ inherited fEditorAlbaranCliente: TfEditorAlbaranCliente inherited TBXDock1: TTBXDock Width = 751 ExplicitWidth = 751 + inherited TBXToolbar1: TTBXToolbar + ExplicitWidth = 548 + end end end end object pagInicidencias: TTabSheet Caption = 'Incidencias' ImageIndex = 2 + ExplicitLeft = 0 + ExplicitTop = 0 + ExplicitWidth = 0 + ExplicitHeight = 0 inline frViewIncidenciasCli: TfrViewIncidencias Left = 0 Top = 0 @@ -441,10 +448,6 @@ inherited fEditorAlbaranCliente: TfEditorAlbaranCliente inherited PnlComentario: TPanel [5] Width = 765 ExplicitWidth = 765 - inherited lbComentario: TLabel - Width = 755 - Height = 25 - end end inherited EditorActionList: TActionList [9] Left = 32 diff --git a/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranesCliente.dfm b/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranesCliente.dfm index ebbb83c2..080e53b9 100644 --- a/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranesCliente.dfm +++ b/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranesCliente.dfm @@ -2,7 +2,6 @@ inherited fEditorAlbaranesCliente: TfEditorAlbaranesCliente Caption = 'Lista de albaranes de cliente' ClientWidth = 583 ExplicitWidth = 591 - ExplicitHeight = 240 PixelsPerInch = 96 TextHeight = 13 inherited JvNavPanelHeader: TJvNavPanelHeader @@ -148,7 +147,7 @@ inherited fEditorAlbaranesCliente: TfEditorAlbaranesCliente Left = 431 Visible = True ExplicitLeft = 431 - ExplicitWidth = 152 + ExplicitWidth = 129 object TBXItem42: TTBXItem Action = actEnviar DisplayMode = nbdmImageAndText @@ -202,28 +201,36 @@ inherited fEditorAlbaranesCliente: TfEditorAlbaranesCliente object actEnviar: TAction Category = 'Acciones' Caption = 'Enviar albar'#225'n...' + Enabled = False ImageIndex = 23 + Visible = False OnExecute = actEnviarExecute OnUpdate = actEnviarUpdate end object actCancelarEnvio: TAction Category = 'Acciones' Caption = 'Cancelar envio' + Enabled = False ImageIndex = 23 + Visible = False OnExecute = actCancelarEnvioExecute OnUpdate = actCancelarEnvioUpdate end object actConfirmarRecepcion: TAction Category = 'Acciones' Caption = 'Confirmar recepcion' + Enabled = False ImageIndex = 23 + Visible = False OnExecute = actConfirmarRecepcionExecute OnUpdate = actConfirmarRecepcionUpdate end object actGenerarEtiquetas: TAction Category = 'Acciones' Caption = 'Generar etiquetas' + Enabled = False ImageIndex = 23 + Visible = False OnExecute = actGenerarEtiquetasExecute OnUpdate = actGenerarEtiquetasUpdate end @@ -1672,10 +1679,7 @@ inherited fEditorAlbaranesCliente: TfEditorAlbaranesCliente object N4: TMenuItem [5] Caption = '-' end - object Serviralbarn1: TMenuItem [6] - Action = actEnviar - end - object Generarfactura1: TMenuItem [7] + object Generarfactura1: TMenuItem [6] Action = actGenerarFactura end end @@ -1749,12 +1753,12 @@ inherited fEditorAlbaranesCliente: TfEditorAlbaranesCliente Value = 100 end item - Caption = 'Utilizar un pedido de cliente.' - Value = 200 + Caption = 'Utilizar un contrato de cliente.' + Value = 300 Info.Strings = ( - 'Puede utilizar un pedido de cliente existente para dar de alta e' + - 'l albar'#225'n nuevo.') + 'Puede utilizar un contrato de cliente existente para dar de alta' + + ' el albar'#225'n nuevo.') end> ButtonBar.Buttons = [cbCancel] MainIcon = tdiCustom diff --git a/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranesCliente.pas b/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranesCliente.pas index fea01f7e..e10da2f3 100644 --- a/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranesCliente.pas +++ b/Source/Modulos/Albaranes de cliente/Views/uEditorAlbaranesCliente.pas @@ -22,7 +22,6 @@ type Generarfactura1: TMenuItem; TBXSeparatorItem17: TTBXSeparatorItem; actEnviar: TAction; - Serviralbarn1: TMenuItem; JsImprimirDialog: TJSDialog; JsPrevisualizarDialog: TJSDialog; actCancelarEnvio: TAction; @@ -85,11 +84,8 @@ implementation uses uDataModuleAlbaranesCliente, uDataModuleUsuarios, uFactuGES_App, -//En tecsitel no estaran habilitados los pedidos -// uPedidosClienteController, uBizPedidosCliente, uDialogUtils, schAlbaranesClienteClient_Intf, uGenerarFacturasCliAlbCliUtils, -// uFacturasClienteController, uBizFacturasCliente, uGenerarAlbaranesCliUtils, -// uInventarioController, + uGenerarAlbaranesCliUtils, uEditorBase, cxCustomData, uGridUtils, uDBSelectionListUtils; @@ -251,11 +247,11 @@ end; procedure TfEditorAlbaranesCliente.actEnviarUpdate(Sender: TObject); begin - inherited; +{ inherited; (Sender as TAction).Enabled := HayDatos and not (ViewGrid.NumSeleccionados > 1) and ViewGrid.esSeleccionCeldaDatos - and (FAlbaranes.SITUACION = SITUACION_ALBARAN_PENDIENTE); + and (FAlbaranes.SITUACION = SITUACION_ALBARAN_PENDIENTE);} end; procedure TfEditorAlbaranesCliente.AsignarVista; @@ -431,34 +427,32 @@ begin end; procedure TfEditorAlbaranesCliente.NuevoInterno; -{var +var Respuesta : Integer; AAlbaran : IBizAlbaranCliente; - IDAlbaranAux: Integer;} + IDAlbaranAux: Integer; begin inherited; - if FController.Anadir(Albaranes) then - FController.Ver(Albaranes); - -//Se deshabilita la funcionalidad para poder generar un albarán a partir de un presupuesto - -{ Respuesta := JsNuevoAlbaranDialog.Execute; + Respuesta := JsNuevoAlbaranDialog.Execute; if Respuesta <> IDCANCEL then begin case JsNuevoAlbaranDialog.CustomButtonResult of - 200 : begin // Utilizar un pedido -// if ElegirPedidoYGenerarAlbaranCli(IDAlbaranAux) then + {200 : begin // Utilizar un pedido + if ElegirPedidoYGenerarAlbaranCli(IDAlbaranAux) then actRefrescar.Execute; - end; + end;} 100 : begin // Albaran nuevo vacio if FController.Anadir(Albaranes) then FController.Ver(Albaranes); end; + 300 : begin // Utilizar un contrato + if ElegirContratoYGenerarAlbaranCli(IDAlbaranAux) then + actRefrescar.Execute; + end; end; end; -} end; procedure TfEditorAlbaranesCliente.OnListaAnosChange(Sender: TObject; const Text: string); diff --git a/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranCliente.dfm b/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranCliente.dfm index 4bf64cd4..f839b9ec 100644 --- a/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranCliente.dfm +++ b/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranCliente.dfm @@ -1,25 +1,25 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente - Width = 825 - Height = 512 + Width = 947 + Height = 644 OnCreate = CustomViewCreate OnDestroy = CustomViewDestroy - ExplicitWidth = 825 - ExplicitHeight = 512 + ExplicitWidth = 947 + ExplicitHeight = 644 object dxLayoutControl1: TdxLayoutControl Left = 0 Top = 0 - Width = 825 - Height = 512 + Width = 947 + Height = 644 Align = alClient ParentBackground = True TabOrder = 0 TabStop = False AutoContentSizes = [acsWidth, acsHeight] DesignSize = ( - 825 - 512) + 947 + 644) object Label1: TLabel - Left = 344 + Left = 546 Top = 622 Width = 299 Height = 26 @@ -81,7 +81,7 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente Width = 284 end inline frViewClienteAlbaran: TfrViewDatosYSeleccionClienteAlbaran - Left = 344 + Left = 546 Top = 28 Width = 442 Height = 221 @@ -91,46 +91,32 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente Font.Name = 'Tahoma' Font.Style = [] ParentFont = False - TabOrder = 10 + TabOrder = 12 ReadOnly = False - ExplicitLeft = 344 + ExplicitLeft = 546 ExplicitTop = 28 ExplicitWidth = 442 ExplicitHeight = 221 inherited dxLayoutControl1: TdxLayoutControl Width = 442 Height = 221 - ExplicitWidth = 452 - ExplicitHeight = 226 - inherited edtlNombre: TcxDBTextEdit - ExplicitWidth = 224 - Width = 224 - end - inherited edtNIFCIF: TcxDBTextEdit - ExplicitWidth = 103 - Width = 103 - end + ExplicitWidth = 442 + ExplicitHeight = 221 inherited bVerFichaCliente: TBitBtn - Left = 240 - ExplicitLeft = 240 - end - inherited edtDireccion: TcxMemo - ExplicitWidth = 437 - Width = 437 + Left = 160 + ExplicitLeft = 160 end inherited bElegirDireccion: TButton - Left = 409 - ExplicitLeft = 409 + Left = 329 + ExplicitLeft = 329 end inherited edtTelefonos: TcxTextEdit ExplicitWidth = 193 Width = 193 end inherited edtReferencia: TcxDBTextEdit - Left = 282 - ExplicitLeft = 282 - ExplicitWidth = 103 - Width = 103 + Left = 242 + ExplicitLeft = 242 end end inherited ActionList1: TActionList @@ -141,7 +127,7 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente end end object eCalle: TcxDBTextEdit - Left = 438 + Left = 640 Top = 396 DataBinding.DataField = 'CALLE' DataBinding.DataSource = DADataSource @@ -156,11 +142,11 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente StyleFocused.LookAndFeel.NativeStyle = True StyleHot.LookAndFeel.Kind = lfStandard StyleHot.LookAndFeel.NativeStyle = True - TabOrder = 14 + TabOrder = 16 Width = 284 end object ePoblacion: TcxDBTextEdit - Left = 438 + Left = 640 Top = 423 DataBinding.DataField = 'POBLACION' DataBinding.DataSource = DADataSource @@ -175,11 +161,11 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente StyleFocused.LookAndFeel.NativeStyle = True StyleHot.LookAndFeel.Kind = lfStandard StyleHot.LookAndFeel.NativeStyle = True - TabOrder = 15 + TabOrder = 17 Width = 61 end object eCodigoPostal: TcxDBTextEdit - Left = 721 + Left = 843 Top = 423 DataBinding.DataField = 'CODIGO_POSTAL' DataBinding.DataSource = DADataSource @@ -194,11 +180,11 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente StyleFocused.LookAndFeel.NativeStyle = True StyleHot.LookAndFeel.Kind = lfStandard StyleHot.LookAndFeel.NativeStyle = True - TabOrder = 16 + TabOrder = 18 Width = 65 end object eProvincia: TcxDBTextEdit - Left = 438 + Left = 640 Top = 450 DataBinding.DataField = 'PROVINCIA' DataBinding.DataSource = DADataSource @@ -213,11 +199,11 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente StyleFocused.LookAndFeel.NativeStyle = True StyleHot.LookAndFeel.Kind = lfStandard StyleHot.LookAndFeel.NativeStyle = True - TabOrder = 17 + TabOrder = 19 Width = 406 end object ePersonaContacto: TcxDBTextEdit - Left = 438 + Left = 640 Top = 477 DataBinding.DataField = 'PERSONA_CONTACTO' DataBinding.DataSource = DADataSource @@ -233,11 +219,11 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente StyleFocused.LookAndFeel.NativeStyle = True StyleHot.LookAndFeel.Kind = lfStandard StyleHot.LookAndFeel.NativeStyle = True - TabOrder = 18 + TabOrder = 20 Width = 284 end object eTlfTrabajo: TcxDBTextEdit - Left = 438 + Left = 640 Top = 504 DataBinding.DataField = 'TELEFONO' DataBinding.DataSource = DADataSource @@ -252,20 +238,20 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente StyleFocused.LookAndFeel.NativeStyle = True StyleHot.LookAndFeel.Kind = lfStandard StyleHot.LookAndFeel.NativeStyle = True - TabOrder = 19 + TabOrder = 21 Width = 284 end object bElegirDireccion: TBitBtn - Left = 614 + Left = 736 Top = 531 Width = 172 Height = 23 Action = actElegirDireccion Caption = 'Elegir una direcci'#243'n de env'#237'o...' - TabOrder = 20 + TabOrder = 22 end object Button1: TButton - Left = 182 + Left = 384 Top = 138 Width = 132 Height = 23 @@ -327,7 +313,7 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente Width = 146 end object bFormasPago: TButton - Left = 182 + Left = 384 Top = 109 Width = 132 Height = 23 @@ -336,7 +322,7 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente OnClick = bFormasPagoClick end object eFechaRecepcion: TcxDBDateEdit - Left = 478 + Left = 680 Top = 339 Anchors = [akLeft, akTop, akRight] DataBinding.DataField = 'FECHA_RECEPCION' @@ -357,20 +343,20 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente StyleFocused.LookAndFeel.NativeStyle = True StyleHot.LookAndFeel.Kind = lfStandard StyleHot.LookAndFeel.NativeStyle = True - TabOrder = 13 + TabOrder = 15 Width = 239 end object cbConAlmacen: TCheckBox - Left = 354 + Left = 556 Top = 590 Width = 179 Height = 21 Caption = 'Asociar este albar'#225'n al almac'#233'n:' - TabOrder = 21 + TabOrder = 23 OnClick = cbConAlmacenClick end object cbAlmacen: TcxDBLookupComboBox - Left = 539 + Left = 741 Top = 590 DataBinding.DataField = 'ID_ALMACEN' DataBinding.DataSource = DADataSource @@ -396,12 +382,12 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente StyleFocused.LookAndFeel.NativeStyle = True StyleHot.LookAndFeel.Kind = lfStandard StyleHot.LookAndFeel.NativeStyle = True - TabOrder = 22 + TabOrder = 24 Width = 586 end object eRefFacturaCli: TcxDBTextEdit Left = 116 - Top = 167 + Top = 196 Anchors = [akLeft, akTop, akRight] DataBinding.DataField = 'REF_FACTURA' DataBinding.DataSource = DADataSource @@ -422,11 +408,11 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente StyleFocused.LookAndFeel.NativeStyle = True StyleHot.LookAndFeel.Kind = lfStandard StyleHot.LookAndFeel.NativeStyle = True - TabOrder = 7 + TabOrder = 9 Width = 284 end object eFechaPrevista: TcxDBDateEdit - Left = 478 + Left = 680 Top = 285 Anchors = [akLeft, akTop, akRight] DataBinding.DataField = 'FECHA_PREVISTA_ENVIO' @@ -449,7 +435,7 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente StyleFocused.LookAndFeel.NativeStyle = True StyleHot.LookAndFeel.Kind = lfStandard StyleHot.LookAndFeel.NativeStyle = True - TabOrder = 11 + TabOrder = 13 Width = 202 end object eRefCliente: TcxDBTextEdit @@ -478,7 +464,7 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente Width = 284 end object eFechaEnvio: TcxDBDateEdit - Left = 478 + Left = 680 Top = 312 Anchors = [akLeft, akTop, akRight] DataBinding.DataField = 'FECHA_ENVIO' @@ -499,12 +485,12 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente StyleFocused.LookAndFeel.NativeStyle = True StyleHot.LookAndFeel.Kind = lfStandard StyleHot.LookAndFeel.NativeStyle = True - TabOrder = 12 + TabOrder = 14 Width = 239 end inline frViewTienda1: TfrViewTienda Left = 22 - Top = 224 + Top = 253 Width = 373 Height = 41 Font.Charset = DEFAULT_CHARSET @@ -513,10 +499,10 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente Font.Name = 'Tahoma' Font.Style = [] ParentFont = False - TabOrder = 8 + TabOrder = 10 ReadOnly = False ExplicitLeft = 22 - ExplicitTop = 224 + ExplicitTop = 253 ExplicitWidth = 373 inherited dxLayoutControl1: TdxLayoutControl Width = 373 @@ -529,7 +515,7 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente end inline frViewObservaciones1: TfrViewObservaciones Left = 22 - Top = 301 + Top = 330 Width = 521 Height = 228 Font.Charset = DEFAULT_CHARSET @@ -538,10 +524,10 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente Font.Name = 'Tahoma' Font.Style = [] ParentFont = False - TabOrder = 9 + TabOrder = 11 ReadOnly = False ExplicitLeft = 22 - ExplicitTop = 301 + ExplicitTop = 330 ExplicitHeight = 228 inherited memObservaciones: TcxDBMemo DataBinding.DataField = 'OBSERVACIONES' @@ -550,6 +536,40 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente Height = 228 end end + object eRefContratoCli: TcxDBTextEdit + Left = 116 + Top = 167 + Anchors = [akLeft, akTop, akRight] + DataBinding.DataField = 'REF_CONTRATO' + DataBinding.DataSource = DADataSource + Enabled = False + Properties.ReadOnly = False + Properties.ValidateOnEnter = True + Style.BorderColor = clWindowFrame + Style.BorderStyle = ebs3D + Style.Color = clWindow + Style.HotTrack = False + Style.LookAndFeel.Kind = lfStandard + Style.LookAndFeel.NativeStyle = True + StyleDisabled.Color = clMenuBar + StyleDisabled.LookAndFeel.Kind = lfStandard + StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.TextColor = clWindowText + StyleFocused.LookAndFeel.Kind = lfStandard + StyleFocused.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.Kind = lfStandard + StyleHot.LookAndFeel.NativeStyle = True + TabOrder = 7 + Width = 247 + end + object Button2: TButton + Left = 369 + Top = 167 + Width = 147 + Height = 23 + Action = actVerContratoCli + TabOrder = 8 + end object dxLayoutControl1Group_Root: TdxLayoutGroup ShowCaption = False Hidden = True @@ -631,6 +651,22 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente ControlOptions.ShowBorder = False end end + object dxLayoutControl1Group16: TdxLayoutGroup + ShowCaption = False + Hidden = True + LayoutDirection = ldHorizontal + ShowBorder = False + object dxLayoutControl1Item25: TdxLayoutItem + Caption = 'Ref. contrato:' + Control = eRefContratoCli + ControlOptions.ShowBorder = False + end + object dxLayoutControl1Item26: TdxLayoutItem + ShowCaption = False + Control = Button2 + ControlOptions.ShowBorder = False + end + end object dxLayoutControl1Item22: TdxLayoutItem Caption = 'Ref. factura:' Control = eRefFacturaCli @@ -796,6 +832,14 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente end end end + object cxDBTextEdit1: TcxDBTextEdit + Left = 176 + Top = 236 + DataBinding.DataField = 'REF_CONTRATO' + DataBinding.DataSource = DADataSource + TabOrder = 1 + Width = 297 + end object DADataSource: TDADataSource Left = 48 end @@ -810,6 +854,11 @@ inherited frViewAlbaranCliente: TfrViewAlbaranCliente OnExecute = actVerPedidoCliExecute OnUpdate = actVerPedidoCliUpdate end + object actVerContratoCli: TAction + Caption = 'Ver el contrato de cliente...' + OnExecute = actVerContratoCliExecute + OnUpdate = actVerContratoCliUpdate + end end object dsFormaPago: TDADataSource Left = 16 diff --git a/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranCliente.pas b/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranCliente.pas index 7365c6a6..0c99d645 100644 --- a/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranCliente.pas +++ b/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranCliente.pas @@ -11,6 +11,7 @@ uses cxGraphics, cxDropDownEdit, cxImageComboBox, cxDBEdit, cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxCalendar, dxLayoutControl, cxControls, cxMemo, uViewDireccionEntregaAlbaranCliente, Buttons, ActnList, + uBizContratosCliente, uContratosClienteController, // uBizPedidosCliente, uPedidosClienteController, @@ -102,6 +103,13 @@ type dxLayoutControl1Item17: TdxLayoutItem; frViewObservaciones1: TfrViewObservaciones; dxLayoutControl1Item6: TdxLayoutItem; + dxLayoutControl1Item25: TdxLayoutItem; + eRefContratoCli: TcxDBTextEdit; + dxLayoutControl1Item26: TdxLayoutItem; + Button2: TButton; + dxLayoutControl1Group16: TdxLayoutGroup; + actVerContratoCli: TAction; + cxDBTextEdit1: TcxDBTextEdit; procedure CustomViewCreate(Sender: TObject); procedure CustomViewDestroy(Sender: TObject); procedure actVerPedidoCliExecute(Sender: TObject); @@ -119,6 +127,8 @@ type procedure frViewClienteAlbaranButton1Click(Sender: TObject); procedure frViewClienteAlbaranButton2Click(Sender: TObject); procedure frViewClienteAlbaranactAnadirContactoUpdate(Sender: TObject); + procedure actVerContratoCliUpdate(Sender: TObject); + procedure actVerContratoCliExecute(Sender: TObject); protected FAlbaran : IBizAlbaranCliente; @@ -126,6 +136,8 @@ type FAlmacenesController : IAlmacenesController; // FPedidoAsociado : IBizPedidoCliente; // FPedidoController : IPedidosClienteController; + FContratoAsociado : IBizContratoCliente; + FContratoController : IContratosClienteController; FViewClienteAlbaran : IViewDatosYSeleccionClienteAlbaran; FFormasPago : IBizFormaPago; FFormasPagoController : IFormasPagoController; @@ -152,6 +164,20 @@ uses uDialogUtils, uFactuGES_App; +procedure TfrViewAlbaranCliente.actVerContratoCliExecute(Sender: TObject); +begin + inherited; + FContratoController. + Ver(FContratoAsociado); +end; + +procedure TfrViewAlbaranCliente.actVerContratoCliUpdate(Sender: TObject); +begin + inherited; + if (Sender as TAction).Enabled then + (Sender as TAction).Enabled := (FAlbaran.ID_CONTRATO > 0); +end; + procedure TfrViewAlbaranCliente.actVerPedidoCliExecute(Sender: TObject); begin inherited; @@ -161,8 +187,8 @@ end; procedure TfrViewAlbaranCliente.actVerPedidoCliUpdate(Sender: TObject); begin inherited; - if (Sender as TAction).Enabled then - (Sender as TAction).Enabled := (Albaran.REF_PEDIDO <> '') +{ if (Sender as TAction).Enabled then + (Sender as TAction).Enabled := (Albaran.REF_PEDIDO <> '')} end; procedure TfrViewAlbaranCliente.bFormasPagoClick(Sender: TObject); @@ -196,6 +222,8 @@ begin inherited; FFormasPago := Nil; FFormasPagoController := TFormasPagoController.Create; + FContratoAsociado := NIL; + FContratoController := TContratosClienteController.Create; // FPedidoAsociado := NIL; // FPedidoController := TPedidosClienteController.Create; FViewClienteAlbaran := frViewClienteAlbaran; @@ -208,6 +236,8 @@ begin FFormasPago := Nil; FFormasPagoController := NIL; FViewClienteAlbaran := Nil; + FContratoAsociado := NIL; + FContratoController := NIL; // FPedidoController := NIL; // FPedidoAsociado := NIL; FAlmacenesController := NIL; @@ -356,6 +386,21 @@ begin end; end; + FContratoAsociado := NIL; + if (FAlbaran.ID_CONTRATO > 0) then + begin + FContratoAsociado := FContratoController.Buscar(FAlbaran.ID_CONTRATO); + if Assigned(FContratoAsociado) then + begin + FContratoAsociado.DataTable.Active := True; + eRefContratoCli.Text := FContratoAsociado.REFERENCIA + end + else + eRefContratoCli.Text := ''; + end + else + eRefContratoCli.Text := 'No hay contrato asociado'; + { FPedidoAsociado := NIL; if (FAlbaran.ID_PEDIDO > 0) then @@ -371,7 +416,7 @@ begin end else eReferenciaPedidoCli.Text := 'No hay pedido asociado'; -} +} end else begin DADataSource.DataTable := NIL; diff --git a/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranDevCliente.dfm b/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranDevCliente.dfm index bdee0729..cde39b8d 100644 --- a/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranDevCliente.dfm +++ b/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranDevCliente.dfm @@ -1,235 +1,94 @@ inherited frViewAlbaranDevCliente: TfrViewAlbaranDevCliente inherited dxLayoutControl1: TdxLayoutControl - ExplicitHeight = 650 inherited Label1: TLabel - Left = 352 Width = 299 - ExplicitLeft = 352 ExplicitWidth = 299 end inherited edtFechaAlbaran: TcxDBDateEdit - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 431 Width = 431 end - inherited memObservaciones: TcxDBMemo - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitWidth = 499 - Width = 499 - end inherited eReferencia: TcxDBTextEdit - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 431 Width = 431 end inherited frViewClienteAlbaran: TfrViewDatosYSeleccionClienteAlbaran - Left = 352 Width = 145 - ExplicitLeft = 352 ExplicitWidth = 145 inherited dxLayoutControl1: TdxLayoutControl Width = 145 - ExplicitWidth = 219 + ExplicitWidth = 145 inherited edtlNombre: TcxDBTextEdit - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 210 Width = 210 end inherited edtNIFCIF: TcxDBTextEdit - Left = 231 - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitLeft = 231 ExplicitWidth = 210 Width = 210 end - inherited Button3: TBitBtn - Left = 249 - ExplicitLeft = 249 - end - inherited edtPersonaContacto: TcxDBTextEdit - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitWidth = 283 - Width = 283 - end inherited edtDireccion: TcxMemo - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 403 Width = 403 end - inherited Button4: TButton - Left = 418 - ExplicitLeft = 418 + inherited edtTelefonos: TcxTextEdit + ExplicitWidth = 193 + Width = 193 end - inherited Button5: TButton - Left = 418 - ExplicitLeft = 418 + inherited edtReferencia: TcxDBTextEdit + ExplicitWidth = 103 + Width = 103 end end end inherited eCalle: TcxDBTextEdit - Left = 446 - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitLeft = 446 ExplicitWidth = 125 Width = 125 end inherited ePoblacion: TcxDBTextEdit - Left = 446 - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitLeft = 446 ExplicitWidth = 24 Width = 24 end - inherited eCodigoPostal: TcxDBTextEdit - Left = 738 - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitLeft = 738 - end inherited eProvincia: TcxDBTextEdit - Left = 446 - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitLeft = 446 ExplicitWidth = 125 Width = 125 end inherited ePersonaContacto: TcxDBTextEdit - Left = 446 - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitLeft = 446 ExplicitWidth = 125 Width = 125 end inherited eTlfTrabajo: TcxDBTextEdit - Left = 446 - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitLeft = 446 ExplicitWidth = 125 Width = 125 end - inherited bElegirDireccion: TBitBtn - Left = 631 - ExplicitLeft = 631 - end - inherited Button1: TButton - Left = 190 - ExplicitLeft = 190 - end inherited eReferenciaPedidoCli: TcxTextEdit - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 245 Width = 245 end inherited cbFormaPago: TcxDBLookupComboBox - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 293 Width = 293 end - inherited bFormasPago: TButton - Left = 190 - ExplicitLeft = 190 - end inherited eFechaRecepcion: TcxDBDateEdit - Left = 486 - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitLeft = 486 ExplicitWidth = 85 Width = 85 end - inherited cbConAlmacen: TCheckBox - Left = 362 - ExplicitLeft = 362 - end inherited cbAlmacen: TcxDBLookupComboBox - Left = 547 - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitLeft = 547 ExplicitWidth = 586 Width = 586 end inherited eRefFacturaCli: TcxDBTextEdit - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 381 Width = 381 end inherited eFechaPrevista: TcxDBDateEdit - Left = 486 - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitLeft = 486 ExplicitWidth = 85 Width = 85 end inherited eRefCliente: TcxDBTextEdit - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 431 Width = 431 end inherited eFechaEnvio: TcxDBDateEdit - Left = 486 - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitLeft = 486 ExplicitWidth = 85 Width = 85 end @@ -240,15 +99,24 @@ inherited frViewAlbaranDevCliente: TfrViewAlbaranDevCliente Width = 515 ExplicitWidth = 515 inherited cbTienda: TcxComboBox - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 454 Width = 454 end end end + inherited frViewObservaciones1: TfrViewObservaciones + Width = 521 + Height = 228 + ExplicitWidth = 521 + ExplicitHeight = 228 + inherited memObservaciones: TcxDBMemo + DataBinding.DataSource = DADataSource + ExplicitWidth = 521 + ExplicitHeight = 228 + Height = 228 + Width = 521 + end + end inherited dxLayoutControl1Group_Root: TdxLayoutGroup inherited dxLayoutControl1Group3: TdxLayoutGroup inherited dxLayoutControl1Group11: TdxLayoutGroup diff --git a/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranDevCliente.pas b/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranDevCliente.pas index 33160106..f585cb91 100644 --- a/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranDevCliente.pas +++ b/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranDevCliente.pas @@ -9,7 +9,7 @@ uses cxDBLookupComboBox, cxTextEdit, Buttons, uCustomView, uViewBase, uViewDatosYSeleccionCliente, cxDBEdit, cxMemo, cxContainer, cxEdit, cxMaskEdit, cxCalendar, cxControls, uDAInterfaces, uViewTienda, - uViewDatosYSeleccionClienteAlbaran; + uViewDatosYSeleccionClienteAlbaran, uViewObservaciones; type TfrViewAlbaranDevCliente = class(TfrViewAlbaranCliente) diff --git a/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesCliente.dfm b/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesCliente.dfm index 38774d19..597fbdf4 100644 --- a/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesCliente.dfm +++ b/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesCliente.dfm @@ -115,6 +115,11 @@ inherited frViewAlbaranesCliente: TfrViewAlbaranesCliente VisibleForCustomization = False Width = 45 end + object cxGridViewREF_CONTRATO: TcxGridDBColumn + DataBinding.FieldName = 'REF_CONTRATO' + BestFitMaxWidth = 45 + Width = 61 + end object cxGridViewREF_FACTURA: TcxGridDBColumn DataBinding.FieldName = 'REF_FACTURA' BestFitMaxWidth = 45 @@ -171,17 +176,21 @@ inherited frViewAlbaranesCliente: TfrViewAlbaranesCliente end object cxGridLevelPendientes: TcxGridLevel Caption = 'Pendientes' + Visible = False end object cxGridLevelEnviados: TcxGridLevel Caption = 'Enviados' + Visible = False end object cxGridLevelServidos: TcxGridLevel Caption = 'Servidos' + Visible = False end object cxGridLevelProximosAEnviar: TcxGridLevel Caption = 'Pasados de fecha' Options.DetailFrameColor = clNone Options.DetailFrameWidth = 0 + Visible = False end end inherited frViewFiltroBase1: TfrViewFiltroBase diff --git a/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesCliente.pas b/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesCliente.pas index bb90a0df..7850955f 100644 --- a/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesCliente.pas +++ b/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesCliente.pas @@ -59,6 +59,7 @@ type cxGridViewFECHA_PREVISTA_ENVIO: TcxGridDBColumn; cxStyleRETRASADOS: TcxStyle; cxGridViewTIENDA: TcxGridDBColumn; + cxGridViewREF_CONTRATO: TcxGridDBColumn; procedure cxGridActiveTabChanged(Sender: TcxCustomGrid; ALevel: TcxGridLevel); procedure cxGridViewCODIGOCustomDrawCell(Sender: TcxCustomGridTableView; diff --git a/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesDevCliente.pas b/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesDevCliente.pas index af69998f..f484cded 100644 Binary files a/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesDevCliente.pas and b/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesDevCliente.pas differ diff --git a/Source/Modulos/Articulos/Data/Articulos_data.dproj b/Source/Modulos/Articulos/Data/Articulos_data.dproj index 362ae2fb..126ef528 100644 --- a/Source/Modulos/Articulos/Data/Articulos_data.dproj +++ b/Source/Modulos/Articulos/Data/Articulos_data.dproj @@ -54,7 +54,7 @@ MainSource - +
DataModuleArticulos
diff --git a/Source/Modulos/Articulos/Views/Articulos_view.dproj b/Source/Modulos/Articulos/Views/Articulos_view.dproj index aa976d2f..3a73d011 100644 --- a/Source/Modulos/Articulos/Views/Articulos_view.dproj +++ b/Source/Modulos/Articulos/Views/Articulos_view.dproj @@ -55,11 +55,11 @@ MainSource - - - - - + + + + +
fEditorArticulo
diff --git a/Source/Modulos/Contratos de cliente/ContratosCliente_Group.groupproj b/Source/Modulos/Contratos de cliente/ContratosCliente_Group.groupproj index 022cfd0f..822dbf0c 100644 --- a/Source/Modulos/Contratos de cliente/ContratosCliente_Group.groupproj +++ b/Source/Modulos/Contratos de cliente/ContratosCliente_Group.groupproj @@ -17,6 +17,7 @@ + @@ -148,6 +149,15 @@ + + + + + + + + + @@ -212,13 +222,13 @@ - + - + - + \ No newline at end of file diff --git a/Source/Modulos/Contratos de cliente/Controller/ContratosCliente_controller.dproj b/Source/Modulos/Contratos de cliente/Controller/ContratosCliente_controller.dproj index 0d47611c..29fccc12 100644 --- a/Source/Modulos/Contratos de cliente/Controller/ContratosCliente_controller.dproj +++ b/Source/Modulos/Contratos de cliente/Controller/ContratosCliente_controller.dproj @@ -49,14 +49,14 @@ MainSource - - - - - - - - + + + + + + + + diff --git a/Source/Modulos/Contratos de cliente/Controller/uContratosClienteController.pas b/Source/Modulos/Contratos de cliente/Controller/uContratosClienteController.pas index d47eb4eb..bef0524d 100644 --- a/Source/Modulos/Contratos de cliente/Controller/uContratosClienteController.pas +++ b/Source/Modulos/Contratos de cliente/Controller/uContratosClienteController.pas @@ -33,7 +33,8 @@ type function Buscar(const ListaID: TIntegerList): IBizContratoCliente; overload; function BuscarTodos: IBizContratoCliente; overload; function BuscarTodos(const ID_Cliente: Integer): IBizContratoCliente; overload; - procedure Ver(AContrato : IBizContratoCliente); + procedure Ver(AContrato : IBizContratoCliente); overload; + procedure Ver(const ID: Integer); overload; procedure VerTodos(AContratos: IBizContratoCliente; const AVerModal : Boolean = False; const AWindowCaption: String = ''; const AHeaderText: String = ''); @@ -113,7 +114,8 @@ type function BuscarTodos: IBizContratoCliente; overload; function BuscarTodos(const ID_Cliente: Integer): IBizContratoCliente; overload; function Nuevo : IBizContratoCliente; - procedure Ver(AContrato : IBizContratoCliente); + procedure Ver(AContrato : IBizContratoCliente); overload; + procedure Ver(const ID: Integer); overload; procedure VerTodos(AContratos: IBizContratoCliente; const AVerModal : Boolean = False; const AWindowCaption: String = ''; const AHeaderText: String = ''); @@ -460,6 +462,19 @@ begin end; end; +procedure TContratosClienteController.Ver(const ID: Integer); +var + AContrato : IBizContratoCliente; +begin + AContrato := Self.Buscar(ID); + if Assigned(AContrato) then + try + Self.Ver(AContrato); + finally + FreeAndNil(AContrato); + end; +end; + procedure TContratosClienteController.VerListadoBeneficios; var AContratosClienteBeneficios: IBizContratosClienteBeneficios; diff --git a/Source/Modulos/Contratos de cliente/Data/ContratosCliente_data.dproj b/Source/Modulos/Contratos de cliente/Data/ContratosCliente_data.dproj index 160b9273..aaee7298 100644 --- a/Source/Modulos/Contratos de cliente/Data/ContratosCliente_data.dproj +++ b/Source/Modulos/Contratos de cliente/Data/ContratosCliente_data.dproj @@ -49,18 +49,18 @@ MainSource - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/Source/Modulos/Contratos de cliente/Model/ContratosCliente_model.dproj b/Source/Modulos/Contratos de cliente/Model/ContratosCliente_model.dproj index e8f8b499..4403e025 100644 --- a/Source/Modulos/Contratos de cliente/Model/ContratosCliente_model.dproj +++ b/Source/Modulos/Contratos de cliente/Model/ContratosCliente_model.dproj @@ -52,23 +52,23 @@ MainSource - - - - - + + + + + + + + + + + - - - - - - diff --git a/Source/Modulos/Relaciones/Contratos de cliente - Albaranes de cliente/ConCli_AlbCli_relation.res b/Source/Modulos/Relaciones/Contratos de cliente - Albaranes de cliente/ConCli_AlbCli_relation.res new file mode 100644 index 00000000..8b251f31 Binary files /dev/null and b/Source/Modulos/Relaciones/Contratos de cliente - Albaranes de cliente/ConCli_AlbCli_relation.res differ diff --git a/Source/Modulos/Relaciones/Contratos de cliente - Albaranes de cliente/uGenerarAlbaranesCliUtils.dfm b/Source/Modulos/Relaciones/Contratos de cliente - Albaranes de cliente/uGenerarAlbaranesCliUtils.dfm new file mode 100644 index 00000000..95561c15 --- /dev/null +++ b/Source/Modulos/Relaciones/Contratos de cliente - Albaranes de cliente/uGenerarAlbaranesCliUtils.dfm @@ -0,0 +1,313 @@ +object dmGenerarAlbaranesCli: TdmGenerarAlbaranesCli + OldCreateOrder = False + Height = 176 + Width = 254 + object JsListaAlbaranesGenerados: TJSDialog + DialogOptions = [doCommandLinks, doModal] + Glyph.Data = { + 0A54504E474F626A65637489504E470D0A1A0A0000000D494844520000001C00 + 00001C0806000000720DDF940000000970485973000017120000171201679FD2 + 520000000467414D410000B18E7CFB5193000003104944415478DAAD96FB4B14 + 5114C7CFE463DC1E606444BFF54424D3DC55CA52B1CCD7165A219905054182FD + 1452FD5810FD100406610A669A998FC4F5BDB6266265DAB60F5DD15E58FE03B2 + 3F99D29ABBA7B9779C71C61D9D6177CFCE70CFDCB97B3EF7DCF3BD33C38082FD + B502B2B300CC656020048688A24F036233A0671F40D43160BA87BF62AEEE1010 + 60D7AE293AD8B835815E9B625C80DC8F1E88D4A7C1E8C1FB8F9FD6C3C44035B3 + 21500A65F6D700FE2EA580A5EC551F4A50359316B31D76EFDC0EE5F72A645045 + A067AE0623074B8140891108F1057064CC0D556053DF173812B707E6DCF332A8 + 225080D201DB4AF99BF335B4D502F371415BCC364833C4C29F458F0C2A031281 + 081734AB0B3C88403C1E6E3E2E7960F6A8FFD27A7D3EF07A11DA2C76C84A8D87 + A57FCB32E8B8A54A4C8C21B59365C9015996EF2240B6634DF435B51460A46D1F + 70C093AA46BF09C980C12CA914E6F371ADD707EF1DB3B0B0B8006EB79B8EA96B + EA5106121851245129118FD8BFA2DC5C53C6BAF5EBBBBA97C2D64EC064195B1F + 286C76E956A0EA5C51AEB4764A9929F5750D5A9581D2274B9B651C0BA2F514A8 + 6F28E36B70AD9A4253EF97A9AA55B0CEBA87D03B645B3F43C1DE589C58186D10 + 81150FCAC57B11E161B04517099BB953C78643141B01BA28EEE4DAB0B04DE2B8 + CA460B9C399902E661BB3AB0F5AD038BF30CD4D7E7DD14815A61023027DD00EF + 469C1A80FD1C307F1578FD4A81E665945AD68924181A9D5007B6F4DBF1527E32 + F5C9D3632351F8F549AEE916B14EAA039BCD362C31A6040D23E7887D4A03B0CF + 86C5C6641A24BB7646D3F2D51A77F8C1BCDCFFC79CD3EAC0D7BD56AE86294165 + 4660CB5C6B737DD3062CCA31D00069E76E05241862CF1EDD05E7D40F756063CF + 673C7F5A4F679A59541EF03E4C8C3B0893DF67D481AFBAC7B0F05412CD30EBE2 + ED80F7617CEC0198FEF94B1BF06C6622AD4B4EC99D80F7A1666043D7281A3312 + FD84C20B8417C3AA789405239826E0CBCE4F98979E10344C33B0BE630473D312 + 82866906D6993E62F6F1C3F45D160A5305BE68FF8095CF5B4302134CFE1185EA + 1FB8A1B4FF4FE32FF6FADB8B5E0000000049454E44AE426082} + Instruction.Text = 'Se ha generado el albar'#225'n de cliente' + Instruction.Glyph.Data = { + 0A54504E474F626A65637489504E470D0A1A0A0000000D494844520000001C00 + 00001C0806000000720DDF940000000970485973000017120000171201679FD2 + 520000000467414D410000B18E7CFB5193000003104944415478DAAD96FB4B14 + 5114C7CFE463DC1E606444BFF54424D3DC55CA52B1CCD7165A219905054182FD + 1452FD5810FD100406610A669A998FC4F5BDB6266265DAB60F5DD15E58FE03B2 + 3F99D29ABBA7B9779C71C61D9D6177CFCE70CFDCB97B3EF7DCF3BD33C38082FD + B502B2B300CC656020048688A24F036233A0671F40D43160BA87BF62AEEE1010 + 60D7AE293AD8B835815E9B625C80DC8F1E88D4A7C1E8C1FB8F9FD6C3C44035B3 + 21500A65F6D700FE2EA580A5EC551F4A50359316B31D76EFDC0EE5F72A645045 + A067AE0623074B8140891108F1057064CC0D556053DF173812B707E6DCF332A8 + 225080D201DB4AF99BF335B4D502F371415BCC364833C4C29F458F0C2A031281 + 081734AB0B3C88403C1E6E3E2E7960F6A8FFD27A7D3EF07A11DA2C76C84A8D87 + A57FCB32E8B8A54A4C8C21B59365C9015996EF2240B6634DF435B51460A46D1F + 70C093AA46BF09C980C12CA914E6F371ADD707EF1DB3B0B0B8006EB79B8EA96B + EA5106121851245129118FD8BFA2DC5C53C6BAF5EBBBBA97C2D64EC064195B1F + 286C76E956A0EA5C51AEB4764A9929F5750D5A9581D2274B9B651C0BA2F514A8 + 6F28E36B70AD9A4253EF97A9AA55B0CEBA87D03B645B3F43C1DE589C58186D10 + 81150FCAC57B11E161B04517099BB953C78643141B01BA28EEE4DAB0B04DE2B8 + CA460B9C399902E661BB3AB0F5AD038BF30CD4D7E7DD14815A61023027DD00EF + 469C1A80FD1C307F1578FD4A81E665945AD68924181A9D5007B6F4DBF1527E32 + F5C9D3632351F8F549AEE916B14EAA039BCD362C31A6040D23E7887D4A03B0CF + 86C5C6641A24BB7646D3F2D51A77F8C1BCDCFFC79CD3EAC0D7BD56AE86294165 + 4660CB5C6B737DD3062CCA31D00069E76E05241862CF1EDD05E7D40F756063CF + 673C7F5A4F679A59541EF03E4C8C3B0893DF67D481AFBAC7B0F05412CD30EBE2 + ED80F7617CEC0198FEF94B1BF06C6622AD4B4EC99D80F7A1666043D7281A3312 + FD84C20B8417C3AA789405239826E0CBCE4F98979E10344C33B0BE630473D312 + 82866906D6993E62F6F1C3F45D160A5305BE68FF8095CF5B4302134CFE1185EA + 1FB8A1B4FF4FE32FF6FADB8B5E0000000049454E44AE426082} + Instruction.Icon = tdiCustom + CustomButtons = < + item + Caption = 'Ver el albar'#225'n' + Value = 100 + Info.Strings = ( + 'Mostrar el albar'#225'n que se ha creado') + end> + ButtonBar.Buttons = [cbOK] + ButtonBar.Cancel = cbOK + ButtonBar.UseCancel = False + MainIcon = tdiCustom + Title = 'FactuGES' + Position = dpMainFormCenter + Icon.Data = { + 0000010003002020100001000400E8020000360000002020000001000800A808 + 00001E0300002020000001002000A8100000C60B000028000000200000004000 + 0000010004000000000000020000000000000000000000000000000000000000 + 000000008000008000000080800080000000800080008080000080808000C0C0 + C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000 + 0000000000000000000000000000000008777777777777777777777700000000 + 0877767777677776777767760000000008F88888888888888888888700000000 + 08F8FF8F8F888888888888860000000008FF8F8F88F8F8888888888C00000000 + 08F88888F8888888888888860000000008F8688878E8888E88E8788700000000 + 08F8688888F8F8FFFFFF88760000000008FF4888888F8FFFFFFF788700000000 + 08F8676767677677677658E50000000008FF8888888887878787888700000000 + 08FF8887887E8888888888860000000008FFE8E8E788C8E8FF8F8F8600000000 + 08FFF8F8F8F8FF8F88F8F8870000000008FFFFFF8FF8F8F8F88F888600000000 + 0FF8477878787878788788860000000008FF68888888F8FF8F8F788700000000 + 08B7588888FF8FFFFFFF78860000083008BB47887776777777776F86000000B7 + 8B9B73BB88788787E87878870000008BB8B9BB78888888EFF8F8FF8600000087 + B8BB8B888E8E8E88FFF8F886000000088BBB888FFFFFFFFFF8F877770000B9BB + B8FFBB9B9BFFFFFFF87466460000BBB9BB8FBBBBB8FFFFFFF88F888700000008 + B8BB88888FFFFFFFF88F8F7700000008BBBBBB8FFFFFFFFFFF8887700000007B + B7B98BB8FFFFFFFFF8887700000000B78B9B87B888F88F88F8877000000007B0 + 08BB883B78888788787700000000000000B9000000000000000000000000FFFF + FFFFF800000FF800000FF800000FF800000FF800000FF800000FF800000FF800 + 000FF800000FF800000FF800000FF800000FF800000FF800000FF800000FF800 + 000FF800000FF800000F9800000FC000000FC000000FC000000FE000000F0000 + 000F0000000FE000000FE000001FC000003FC000007F980000FFFCFFFFFF2800 + 0000200000004000000001000800000000000004000000000000000000000001 + 00000001000000000000694731007C5D49007E604C0081635000826451008567 + 540085685500886B5900896D5B008A6E5D008B705F008E715F008B7260008C72 + 61008E74640084766C00957A6900977D6D00887B72009A8171009D8272009C84 + 76009D8778009F897B00A28A7900A08B7D00A18C7E00E1B06E00E1B67D003E7A + 970073A0A5007AA2B70074AFBD007BB2BB003CAACE0028A5DB0020ADDF000D9A + E500209EE3000DA6E2001AA4EF0000A6FF000CABFE0009ACFE0010A4F10015AC + FA0000B5FB0000B0FD000CB6FC0000BFF90000BAFD0004BAFD0009BBFB0013B6 + F40015BFFA001CBDFB0026B7FD00589EC50040A4CD0040ABCC0050A2C7005DAE + C00060A3C20062A4C60060B7CB006AB0CD007BB6C80077BAC80061BADD0044AD + E50000C3F80007C6FB0000CAF80000CFFB0000D4F90026C8FA0026CDF8002BCC + F90039C4FB0039C2FC0039CAFA003FCFFB0024D6F80030D2F80039D5F80000F8 + F8001FF8F8002CF6F8003EF4F8005AC6DC0070CDDF0052C0E40054C9E3004DCE + FA005FC7FF004FD2FB004DD9F8005FD9FB006ED3E70063CDFE0060D1FB0060D8 + F90060DDF80046F8F90056F0F8005FFAFA0073E3F80073E4F90073EEF80060F1 + F800958A84009A918C0081999500A68F8200AD968500A3968C00AE988900AD9A + 8D00B19A8B00AF9C9000B09E9200B59F9200B7A29300B2A19600B5A19400B7A4 + 9700BDA79700B4A39800B1A59D00B4A79F00BAA69800BCA79900B4A89F00BCA8 + 9900BAA89C00BDAA9D00BEAC9E0083ADBD00B5A9A100BDABA000BEADA100BFAF + A500A0BABE00C0AB9E00C1AC9E00C6AE9F00E2B98100E4BA8300E4BB8400E5BC + 8500E1BD8E00E3BF9000C0ADA000C2B0A300C2B1A500C4B2A600C1B2A800C3B5 + AB00C8B4A800CCB9AD00CEBCB100D0BEB200D1BFB400E4C19300E5C29400E6C4 + 9600E8C69900D0C9A300CFC1B800D2C1B600D3C3B800D5C4B900D6C6BC00D8C6 + BC00D6C8BE00DAC9BF00ECD3B000EDD4B200EFD6B500E7D1B800E7D3BD00F0D8 + B6008CB7C40080BEC70097C3C70099C3C900ABD7CF00AFD9DD0086E3F90086E7 + F90086ECF8009EE5FB0090E8F900ACEDFC00BCEAFD00BCF1FB00BFF1FD00D7C9 + C000D9CAC100DCCBC200DACCC200DDCCC300DACCC400DDCEC400DED0C600DED1 + C900DED3CC00DFD4CD00E1D1C900E2D5CD00F0DCC200E3D8D200E5D9D200E2DA + D500E6DBD400E5DCD500E8DDD600E6DDD800E9DFD900E6E0DB00EAE0DA00EAE2 + DD00ECE3DE00EBE4DE00ECE4DE00F3E7D900C6E1EF00C9EFFD00D7F6FD00DFF3 + FF00DFFEFE00EBE7E300EDE6E100EFE7E400EEE8E400F0EAE600F2EDE900F2EE + EC00F4EFEC00F5F0EE00F9F4ED00E7FAFD00EBF8FF00F6F2F000F7F4F100F8F4 + F200F9F7F500FAF8F600FBF9F900FCFBFA00FCFCFB00FEFEFE00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000007D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D + 0D0D0000000000000000009C9C19191919191919191919191919191919191919 + 1903000000000000000000ABDECBCBC7C7AFABABABABAAA3A2A2A0A0A0A0A0A0 + 8607000000000000000000ABECEAE9DEDEDEDED7D5D2D2D2CBCBCBCBB0CBB0CB + 9007000000000000000000ABEDECEAE9DEDEDBD7D7D5D2D2D2CDCDCBB0B0B0B0 + 9007000000000000000000AFEDE9A9CFD2CFD2CDCBCBCBB0B0ABACA3A3A3A3B0 + 9007000000000000000000AFF0D5017783838386868686869099909999907BB0 + 9007000000000000000000B0F4D501A0B0CBD2D5DEECEDF7FAFAFAFAFAF77BAA + 9007000000000000000000CBF4DC01A0B0B0B0D2D5DBEAEDF7FAFAFAFAF47BB0 + 9007000000000000000000CBF8DC010404070604090909090D0D110D110D02A3 + 9007000000000000000000CBFAED9E9E9E9C999E8C8C8C868683837E7D7D7ACB + 9007000000000000000000CBFAF1A7A7A6A6A6A69898989898B5DBDBD5D5D2D2 + 9907000000000000000000CDFAF796969696961D961D931D1DB4DEDBD7D5D5D2 + 9C07000000000000000000CFFAFAFAFAF8F7F0F0EDEDEDECE9E9DEDEDED7D5D5 + 9907000000000000000000CDFAFAEAF0EDEDECEAEAE9DEDEDBDCD5D5D5D5D2D5 + 9C07000000000000000000D2FAEC01737D7D7B7D7D7B7D7B7D7B7B7B7D7B7DD2 + 9907000000000000000000CFFAEC019EABB0CBD2D5DCDEECEDF4F4F4F4EA7BD2 + 9C07000000000000000000B9524601A0B0B0CBB5D5DEEAEDF7FAFAFAFAF47DD5 + 9C070000000000213F0000B83226010C3F5C1F111214141616191B1B1B1807D2 + 9C07000000000000253D8A5B322D711E2860BA7E7E7A7E797A797979767676D5 + 9E0700000000000041375E662F2B65314EBBB6B6B6B6B4B4B1E2F4EDEDEDECEA + 9C070000000000008F5D66663232394EC1A81C1C1C1C1C1C1CD3F7F4EDDED7D5 + 9C0700000000000000B7BE6E5758BEBDE4E6E6F3FAFAFAFAFAFAF7F4D5928675 + 7304000000002A2A2A2A4A6AFAE7562F2A2A2A5FFAFAFAFAFAFAF8D577010101 + 0101000000004747472F4A59C5E7564A32474766FAFAFAFAFAFAFADCA0D2CFB0 + A20C00000000000000436C6958686D6BC2C5C5E7FAFAFAFAFAFAFADEAADEDBCB + 1470000000000000004551534A4A5250C0E7FAFAFAFAFAFAFAFAFADEAAD7B514 + 700000000000000042384C54472B613550C3FAFAFAFAFAFAFAFAFADEA1B0196F + 000000000000000024234463322EBC5A3664E3ECE9E9E9E9E9E9E9CF90731300 + 000000000000003A3C00002232298B8B3E3B207E8B7E8B7E827E817E74100000 + 0000000000000000000000003227000000000000000000000000000000000000 + 000000000000FFFFFFFFF800000FF800000FF800000FF800000FF800000FF800 + 000FF800000FF800000FF800000FF800000FF800000FF800000FF800000FF800 + 000FF800000FF800000FF800000FF800000F9800000FC000000FC000000FC000 + 000FE000000F0000000F0000000FE000000FE000001FC000003FC000007F9800 + 00FFFCFFFFFF2800000020000000400000000100200000000000801000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000007067 + 5F70AA9382E570513CE3735540E3735540E3735540E3735540E3735540E37355 + 40E3735540E3735540E3735540E3735540E3735540E3735540E3735540E37355 + 40E3735540E3735540E3735540E3735540E3735540E3735540E372533EE5BAAB + A070000000000000000000000000000000000000000000000000000000005E54 + 4C7FCAB7ABFFC5B5AAFFA18877FFA28A78FFA28A79FFA28A79FFA28A79FFA28A + 79FFA28A79FFA28A79FFA28A79FFA28A79FFA28A79FFA28A79FFA28A79FFA28A + 79FFA28A79FFA28A79FFA28A79FFA28A79FFA28A79FFA58D7CFF7A5B46FFB2A1 + 967F000000000000000000000000000000000000000000000000000000006055 + 4D7ED7C6BBFFEDE4E0FFD9CCC4FFD9CCC4FFD9CBC3FFD8CAC1FFD7C9BFFFD6C7 + BDFFD5C6BBFFD4C4BAFFD3C3B8FFD2C1B7FFD1C0B5FFD0BEB3FFCFBDB2FFCEBC + B0FFCEBBAFFFCEBBAFFFCEBBAFFFCEBBAFFFCEBCB0FFBEAA9CFF82644FFFB2A1 + 967E000000000000000000000000000000000000000000000000000000006056 + 4D7ED7C8BCFFF2EBE8FFEFE9E5FFEEE7E2FFECE5E0FFEBE2DEFFEAE0DBFFE9DE + D8FFE7DBD4FFE5D9D1FFE3D7CFFFE2D4CCFFE1D2C9FFDFD0C7FFDDCDC4FFDCCB + C2FFDBC9BFFFDBC9BFFFDBC9BFFFDBC9BFFFDCCAC1FFC1AC9FFF81634FFFB2A1 + 967E000000000000000000000000000000000000000000000000000000006155 + 4E7ED8C9BDFFF3EDE9FFF1EAE6FFF0E9E6FFEEE6E1FFECE4DFFFEBE2DDFFEAE0 + DAFFE9DED7FFE7DBD4FFE5D9D1FFE3D7CFFFE2D4CCFFE1D2C9FFDFD0C7FFDDCD + C4FFDCCBC2FFDBC9BFFFDBC9BFFFDBC9BFFFDCCAC0FFC1AC9FFF81634FFFB2A1 + 967E000000000000000000000000000000000000000000000000000000006157 + 4E7ED9C9BFFFF4EFEDFFEFE8E3FFD0C2B9FFDFD5CEFFE0D5CEFFE0D4CCFFDED3 + CBFFDDD1C8FFDCCFC6FFDACCC4FFD9CBC1FFD8C9BFFFD7C7BDFFD6C5BBFFD5C4 + B9FFD3C2B7FFD2C0B5FFD2BFB4FFD2BFB4FFDAC8BEFFC1AC9FFF81634FFFB2A1 + 967E000000000000000000000000000000000000000000000000000000006256 + 4F7EDACCC0FFF5F2EFFFE5DDD9FF5C3821FFB0998AFFB8A394FFB8A394FFB9A3 + 94FFB8A495FFB9A597FFB9A698FFBAA698FFBBA799FFBBA89AFFBBA89BFFBCA8 + 9BFFBCA89BFFBCA89BFFBBA89AFFB49E8FFFD8C6BBFFC1AC9FFF81634FFFB2A1 + 967E000000000000000000000000000000000000000000000000000000006256 + 4F7EDBCBC1FFF8F4F3FFE7E0DBFF5F3C24FFD0BDB2FFDCCBC1FFDDCCC3FFE2D2 + CBFFE7DBD4FFEDE2DEFFF0E8E6FFF5F0EDFFF9F7F4FFFDFDFDFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFAF8F7FFB39D8DFFD8C6BBFFC1AC9FFF81634FFFB2A1 + 967E000000000000000000000000000000000000000000000000000000006256 + 4F7EDCCEC3FFFAF6F5FFE9E2DDFF5F3C24FFD2BFB5FFDFCDC4FFDECCC3FFE0CE + C6FFE4D4CDFFE9DDD6FFEFE4E0FFF1EAE8FFF7F1EFFFFBF8F6FFFFFEFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFCFBFAFFB5A090FFD9C7BEFFC1AD9FFF81634FFFB2A1 + 967E000000000000000000000000000000000000000000000000000000006257 + 4F7EDDCFC4FFFCF9F9FFE9E4E0FF5F3A23FF7C5D49FF7F5F4CFF7E5F4CFF7E60 + 4DFF7F614DFF816350FF826552FF836654FF846856FF856A57FF866B59FF876C + 5BFF876D5BFF876D5BFF866B59FF72523DFFD5C3B9FFC1AFA1FF81634FFFB2A1 + 967E000000000000000000000000000000000000000000000000000000006357 + 507EDECFC6FFFCFCFBFFF4F1F0FFC3B6AEFFC3B5ADFFC1B4ACFFC0B3AAFFBFB1 + A9FFBEB0A6FFBDAEA5FFBDACA3FFBCABA2FFBBAAA0FFBAA99FFFB8A69AFFB8A4 + 98FFB6A396FFB5A194FFB49F93FFB39D90FFDCCDC4FFC2AEA1FF81634FFFB2A1 + 967E000000000000000000000000000000000000000000000000000000006357 + 507EDFD2C7FFFEFEFDFFF9F5EFFFE8C696FFE9C799FFE8C697FFE7C596FFE7C4 + 95FFE6C394FFE5C293FFE4C091FFE4C090FFE3BF8FFFE2BD8CFFE9D5BFFFEBE1 + DCFFEADFD8FFE7DCD5FFE5DAD3FFE4D8D0FFE3D4CCFFC2AFA2FF81634FFFB2A1 + 967E000000000000000000000000000000000000000000000000000000006458 + 517EE0D3C8FFFFFFFFFFFAF5EFFFE3B77CFFE4B97FFFE2B87EFFE3B77DFFE2B7 + 7CFFE2B67BFFE1B57AFFE1B479FFE0B478FFE0B377FFDFB174FFE6D0B7FFEBE1 + DCFFE8DFD9FFE8DDD6FFE6D9D2FFE3D8D1FFE4D7CFFFC3AFA2FF81634FFFB2A1 + 967E000000000000000000000000000000000000000000000000000000006458 + 517EE1D2C9FFFFFFFFFFFEFEFDFFFEFFFFFFFCFDFEFFFBFBFBFFF9F7F8FFF8F5 + F6FFF7F3F2FFF5F1F0FFF4EFEEFFF1EDEBFFF0EBE9FFEEE9E6FFEDE6E2FFECE3 + DEFFEBE1DBFFE9DFD9FFE8DDD6FFE6DAD3FFE5D9D2FFC3B0A3FF81634FFFB2A1 + 967E000000000000000000000000000000000000000000000000000000006459 + 517EE1D4CAFFFFFFFFFFFDFDFCFFEEEBE8FFF5F2F0FFF4F0EFFFF3EFECFFF2ED + EAFFF1EBE8FFEEE9E5FFEFE7E3FFECE5E1FFEAE4DEFFEAE1DCFFE8E0DAFFE7DE + D8FFE6DDD6FFE5DBD4FFE4D8D1FFE2D6CEFFE6DBD4FFC3B1A4FF81634EFFB2A1 + 967E000000000000000000000000000000000000000000000000000000006559 + 527EE2D4CAFFFFFFFFFFF0ECEAFF5B361EFFAB9383FFB39D8EFFB39D8DFFB39D + 8DFFB29D8DFFB29C8DFFB29C8CFFB29C8CFFB29C8CFFB29C8CFFB29C8CFFB29C + 8CFFB29C8CFFB29C8CFFB29C8DFFB39D8EFFE3D8D0FFC4B1A4FF81634EFFB2A1 + 967E000000000000000000000000000000000000000000000000000000006559 + 527EE5D4CAFFFFFFFFFFF7F0EBFF5F3B24FFCCB8ADFFD7C5BAFFD9C7BDFFDCCC + C3FFE1D4CCFFE5DAD4FFE8E0DBFFEDE5E1FFF1EBE9FFF5F2EFFFF7F5F3FFF8F6 + F4FFF8F5F4FFF8F6F4FFF1EEEAFFB29C8DFFE6DAD3FFC4B2A5FF81634EFFB2A1 + 967E00000000000000000000000000000000000000000000000000000000685A + 527E9AC6C9FF35CFFEFF3DAEEBFF663E24FFD2BFB4FFE0CBBFFFE0C9BDFFE1CD + C4FFE4D5CDFFE9DED7FFEEE5E0FFF2EBE8FFF6F2F0FFFCF8F8FFFFFFFEFFFFFF + FFFFFFFFFFFFFFFFFFFFFCFAF9FFB49E8FFFE7DED7FFC5B3A6FF81634EFFB2A1 + 967E00000000000000000000000000000000007792910072A7A3001E33366957 + 4C7C86C1C8FF00BFFBFF079AEBFF6A3E23FF926D57FF5FA3C8FF4AC1E8FF6C9C + A2FF917260FF927767FF947A69FF957C6CFF977E6FFF998171FF9A8374FF9B85 + 76FF9C8678FF9C8678FF998274FF7D5E49FFE3D9D4FFC5B3A7FF81634EFFB2A1 + 967E00000000000000000000000000000000005A6F7000A9E5E40075AEAE5C90 + A5BD75D0E0FF00BFFAFF0CA3F4FF8A9A91FF3C7492FF03A4E4FF4AD5FFFF98C4 + CBFFB3A196FFB1A197FFB0A096FFB09F95FFAF9D92FFAF9C91FFAD9A8EFFAC99 + 8CFFAB988AFFAB9789FFAA9688FFA99386FFE8E0DAFFC5B4A7FF81634EFFB2A1 + 967E00000000000000000000000000000000000000002DA5BFC110C2FFFF4DD0 + FDFF64DBF9FF00B3FAFF09A8FEFF68D7FFFF04B5FFFF24CCFBFFAFD8CEFFF7DA + B8FFF3DBBBFFF3DBBAFFF2D9B9FFF1D8B7FFF0D7B4FFEED5B2FFF6EADDFFF9F6 + F4FFF7F3F1FFF5F1EEFFF5EFECFFF4EDEAFFF1EBE7FFC6B4A8FF81634EFFB2A1 + 967E00000000000000000000000000000000000000005F8A909142C7E4E960DE + F8FF64D7FAFF00B6FDFF00B8FDFF21B2FDFF1ECCF7FF93EBFCFFD2C69BFFE1AB + 63FFDFAC66FFDFAC66FFDFAC66FFDFAC66FFDFAC66FFDEA961FFEFDBC0FFF8F6 + F5FFF6F2F0FFF3EDEBFFECE2DCFFE9DFD9FFE5DBD6FFC2B1A4FF81634FFFB2A1 + 967E000000000000000000000000000E171A000E171A00040B145994A4A990EB + FCFF61F1F7FF13FAF7FF23F9F7FF93EDF7FF8CE5F8FFD5F2FDFFE9F8FFFFE7F8 + FFFFF0FCFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFDFEFFFFFAFAF9FFF9F7 + F5FFF7F2F0FFE8DFD8FFC7AE9FFFBEA998FFAF9888FFB09A8AFF7F604DFFB2A1 + 967E00000000000000000000000000AAFFFF00AAFFFF00AAFFFF00A4FFFF00CD + FAFF5DFCF9FFFFFFFFFFEEFEFEFF00FBF7FF00AAFEFF00A1FFFF00A1FFFF00A0 + FFFF56C3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCFDFBFFFCFBFAFFFBFA + F8FFE6DDD6FFAA9180FF5D3922FF603D26FF613E27FF613E28FF634029FFB4A3 + 987E00000000000000000000000000CAFFFF00CAFFFF00CBFFFF00B0FFFF00CD + FBFF38F5F7FFC3EFFAFFF0FFFEFF00FAF7FF00C8F7FF00C2F7FF00C2F7FF00C1 + F7FF57D7FAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFEFEFFFDFDFCFFFCFC + FBFFE7DED8FFCCB9ACFFE6DBD5FFE2D7D0FFDCCFC5FFD7C5BBFF8E705DFFB4A2 + 9680000000000000000000000000002E383C002E383C00252F364C99B0B57DE8 + FBFF59F1F7FF25F7F7FF41FAF8FF7CEEF7FF77E4F7FFB5EFFCFFC6F2FDFFC3F2 + FDFFD9F6FCFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFEFEFFFEFE + FEFFE9E1DAFFCEBCAFFFF1E9E3FFEADFD8FFE4D5CCFF9D816FFF3A291F868985 + 831C00000000000000000000000000000000000000004E7073774AB0DADC37C9 + FBFF22D5F7FF00D3F9FF02C3FBFF37D5F7FF34BEFCFFA2E6FAFFECFBFDFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFF + FFFFEAE2DCFFCDBBADFFEADFD8FFE3D5CBFF9F8271FF3E2D2386050100200000 + 000000000000000000000000000000000000000000003E9CC4C219C0FFFF23C9 + FCFF30D3F8FF00BEF8FF06A8FEFF4FDCF8FF00B8FCFF32C2FBFFC0EBFCFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFEAE3DEFFCDB9ABFFDDCEC4FFA58979FF3E2C1F8F0905041B000000000000 + 000000000000000000000000000000000000003451510099DDDB0091C0C35DAD + BCCF76D7E9FF00BEF9FF10A9FBFFBDDEDEFF5AC8DDFF0AB5F7FF62CEFFFFCBE4 + F1FFF1E7E0FFEFE7E1FFEEE6E1FFEEE6E1FFEEE6E0FFEDE6E0FFEDE5E0FFEEE6 + E1FFE1D4CCFFC5AE9FFFA68D7FF53E2718A10402000E00000000000000000000 + 0000000000000000000000000000000000000075B7AF0099C7C500323E425442 + 3B5C6BA8B1DA00C1FCFF0EA1F3F8A98E80C0AB9081C12698B1C10088C4C14C85 + A3C1A18D80C19E8D81C19E8B81C19D8C80C19B8C7FC19B8A7FC19C897FC19A89 + 7EC19B8B7EC1897769C2432B1BAC000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000045565A00C5FFFF0094E6E2000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFFFFF0000007F0000007F0000007F000 + 0007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F000 + 0007F0000007F0000007F0000007F0000007F0000007F0000007800000078000 + 0007C0000007C000000700000007000000070000000700000007C000000FC000 + 001F8000003F800000FFF8FFFFFF} + Width = 450 + Left = 72 + Top = 16 + end +end diff --git a/Source/Modulos/Relaciones/Contratos de cliente - Albaranes de cliente/uGenerarAlbaranesCliUtils.pas b/Source/Modulos/Relaciones/Contratos de cliente - Albaranes de cliente/uGenerarAlbaranesCliUtils.pas new file mode 100644 index 00000000..6ec433ac --- /dev/null +++ b/Source/Modulos/Relaciones/Contratos de cliente - Albaranes de cliente/uGenerarAlbaranesCliUtils.pas @@ -0,0 +1,296 @@ +unit uGenerarAlbaranesCliUtils; + +interface + +uses + Windows, SysUtils, Classes, pngimage, JSDialog, + uBizContratosCliente, uBizAlbaranesCliente; + +type + TdmGenerarAlbaranesCli = class(TDataModule) + JsListaAlbaranesGenerados: TJSDialog; + end; + + function GenerarAlbaranCli(const IDContrato : Integer) : Boolean; overload; + function GenerarAlbaranCli(AContrato : IBizContratoCliente; var AAlbaran: IBizAlbaranCliente) : Boolean; overload; +// function ElegirPedidoYGenerarAlbaranCli(var IDAlbaran: Integer) : Boolean; + function ElegirContratoYGenerarAlbaranCli(var IDAlbaran: Integer) : Boolean; + +implementation + +{$R *.dfm} + +uses + uDialogUtils, uBizDetallesContratoCliente, uBizDetallesAlbaranCliente, + uContratosClienteController, uAlbaranesClienteController, uClientesController, + uDetallesAlbaranClienteController, uControllerDetallesBase, + uBizContactos, schAlbaranesClienteClient_Intf, + schContratosClienteClient_Intf, uBizDetallesPresupuestoCliente; + +var + dmGenerarAlbaranesCli: TdmGenerarAlbaranesCli; + AContratosClienteController : IContratosClienteController; + AAlbaranesClienteController : IAlbaranesClienteController; + AClientesController : IClientesController; + +{ Métodos auxiliares } +procedure CopiarContratoAAlbaran(AContrato: IBizContratoCliente; AAlbaran : IBizAlbaranCliente); +begin + if not Assigned(AAlbaran) then + raise Exception.Create ('Albarán no asignado (CopiarContratoAAlbaran)'); + + if not Assigned(AContrato) then + raise Exception.Create ('Contrato no asignado (CopiarContratoAAlbaran)'); + + if not AContrato.DataTable.Active then + AContrato.DataTable.Active := True; + + // El albarán tiene que venir ya abierto y posicionado donde hay que copiar + AAlbaran.ID_CLIENTE := AContrato.ID_CLIENTE; + // Lo dejamos listo para que se localize la subcuenta contable asociada al cliente + AAlbaranesClienteController.RecuperarCliente(AAlbaran); + AAlbaran.Cliente.Open; + +// AAlbaran.NIF_CIF := AContrato.NIF_CIF; + AAlbaran.NOMBRE := AContrato.NOMBRE; + AAlbaran.CALLE := AContrato.CALLE; + AAlbaran.POBLACION := AContrato.POBLACION; + AAlbaran.PROVINCIA := AContrato.PROVINCIA; + AAlbaran.CODIGO_POSTAL := AContrato.CODIGO_POSTAL; + + +// AAlbaran.PERSONA_CONTACTO := AContrato.PERSONA_CONTACTO; +// AAlbaran.DataTable.FieldByName(fld_FacturasClientePLAZO_ENTREGA).AsVariant := AContrato.DataTable.FieldByName(fld_ContratosClientePLAZO_ENTREGA).AsVariant; + + AAlbaran.DataTable.FieldByName(fld_AlbaranesClienteOBSERVACIONES).AsVariant := AContrato.DataTable.FieldByName(fld_ContratosClienteOBSERVACIONES).AsVariant; + AAlbaran.IMPORTE_NETO := AContrato.IMPORTE_NETO; + AAlbaran.IMPORTE_PORTE := AContrato.IMPORTE_PORTE; + AAlbaran.DESCUENTO := AContrato.DESCUENTO; + AAlbaran.IMPORTE_DESCUENTO := AContrato.IMPORTE_DESCUENTO; + AAlbaran.BASE_IMPONIBLE := AContrato.BASE_IMPONIBLE; + AAlbaran.ID_TIPO_IVA := AContrato.ID_TIPO_IVA; + AAlbaran.IVA := AContrato.IVA; + AAlbaran.IMPORTE_IVA := AContrato.IMPORTE_IVA; + AAlbaran.IMPORTE_TOTAL := AContrato.IMPORTE_TOTAL; + AAlbaran.ID_TIENDA := AContrato.ID_TIENDA; + AAlbaran.ID_CONTRATO := AContrato.ID; + +// AAlbaran.ID_VENDEDOR := AContrato.ID_VENDEDOR; +// AAlbaran.RECARGO_EQUIVALENCIA := AContrato.RECARGO_EQUIVALENCIA; +// AAlbaran.RE := AContrato.RE; +// AAlbaran.IMPORTE_RE := AContrato.IMPORTE_RE; +// AAlbaran.TIPO_FACTURA := AContrato.TIPO_CONTRATO; +end; + +procedure CopiarDetallesAAlbaran( + AContrato: IBizContratoCliente; + AAlbaran: IBizAlbaranCliente; + AArticulos: IBizDetallesContratoCliente); +var + i : integer; + ADetalles : IBizDetallesAlbaranCliente; + ADetallesController : IDetallesAlbaranClienteController; +begin + if not Assigned(AAlbaran) then + raise Exception.Create ('Albarán no asignada (CopiarDetallesAAlbaran)'); + + if not Assigned(AContrato) then + raise Exception.Create ('Contrato no asignado (CopiarDetallesAAlbaran)'); + + if not Assigned(AArticulos) then + raise Exception.Create ('Artículos no asignado (CopiarDetallesAAlbaran)'); + + if not AArticulos.DataTable.Active then + AArticulos.DataTable.Active := True; + + // El contrato tiene que venir ya abierto y posicionado donde hay que copiar + + ADetalles := AAlbaran.Detalles; + ADetallesController := TDetallesAlbaranClienteController.Create; + try + //OJO IMPORTANTE + //Siempre que vayamos a trabajar con los detalles debemos hacer un beginupdate de los mismos y un endupdate para + //obligarle siempre a recalcular los detalles una sola vez + ADetallesController.BeginUpdate(ADetalles); + + AArticulos.DataTable.First; + for i := 0 to AArticulos.DataTable.RecordCount - 1 do + begin + ADetallesController.Add(ADetalles, AArticulos.TIPO_DETALLE); + ADetalles.Edit; + ADetalles.REFERENCIA := AArticulos.REFERENCIA; + ADetalles.ID_ARTICULO := AArticulos.ID_ARTICULO; + if (AArticulos.PROPIEDAD <> '') then + ADetalles.CONCEPTO := AArticulos.PROPIEDAD + ': '+ AArticulos.CONCEPTO + else + ADetalles.CONCEPTO := AArticulos.CONCEPTO; + + if not AArticulos.CANTIDADIsNull then + ADetalles.CANTIDAD := AArticulos.CANTIDAD; + if not AArticulos.IMPORTE_UNIDADIsNull then + ADetalles.IMPORTE_UNIDAD := AArticulos.IMPORTE_UNIDAD; + if not AArticulos.IMPORTE_TOTALIsNull then + ADetalles.IMPORTE_TOTAL := AArticulos.IMPORTE_TOTAL; + if not AArticulos.DESCUENTOIsNull then + ADetalles.DESCUENTO := AArticulos.DESCUENTO; + if not AArticulos.IMPORTE_PORTEIsNull then + ADetalles.IMPORTE_PORTE := AArticulos.IMPORTE_PORTE; + ADetalles.VISIBLE := AArticulos.VISIBLE; + ADetalles.REFERENCIA_PROVEEDOR := AArticulos.REFERENCIA_PROVEEDOR; + ADetalles.Post; + AArticulos.Next; + end; + finally + ADetallesController.EndUpdate(ADetalles); + ADetallesController := NIL; + end; +end; + +procedure Inicializar; +begin + dmGenerarAlbaranesCli := TdmGenerarAlbaranesCli.Create(nil); + AContratosClienteController := TContratosClienteController.Create; + AAlbaranesClienteController := TAlbaranesClienteController.Create; + AClientesController := TClientesController.Create; +end; + +procedure Finalizar; +begin + FreeAndNIL(dmGenerarAlbaranesCli); + AContratosClienteController := nil; + AAlbaranesClienteController := nil; + AClientesController := nil; +end; + + +function GenerarAlbaranCli(const IDContrato : Integer) : Boolean; overload; +var + AContrato : IBizContratoCliente; + AAlbaran : IBizAlbaranCliente; +begin + Result := False; + + try + if not Assigned(AContratosClienteController) then + Inicializar; + + AContrato := AContratosClienteController.Buscar(IDContrato); + if Assigned(AContrato) then + Result := GenerarAlbaranCli(AContrato, AAlbaran); + finally + if Assigned(AContratosClienteController) then + Finalizar; + end; +end; + +function GenerarAlbaranCli(AContrato : IBizContratoCliente; var AAlbaran: IBizAlbaranCliente) : Boolean; overload; +var + ARespuesta : Integer; +begin + AAlbaran := NIL; + + if not Assigned(AContrato) then + raise Exception.Create('Contrato de cliente no asignado (GenerarAlbaranCli)'); + + if not AContrato.DataTable.Active then + AContrato.DataTable.Active := True; + + if not Assigned(AContratosClienteController) then + Inicializar; + + try + AAlbaran := AAlbaranesClienteController.Nuevo; + CopiarContratoAAlbaran(AContrato, AAlbaran); + CopiarDetallesAAlbaran(AContrato, AAlbaran, AContrato.Detalles); + + //Sustituir por if de guardar + if AAlbaranesClienteController.Guardar(AAlbaran) then + begin +// Asocio el contrato al presupuesto + with dmGenerarAlbaranesCli.JsListaAlbaranesGenerados do + begin + Instruction.Text := 'Se ha generado el albarán'; + + Content.Clear; + Content.Add(Format('Se ha generado correctamente el albarán %s a partir del contrato de cliente' + #10#13, [AAlbaran.REFERENCIA])); + Execute; + + ARespuesta := CustomButtonResult; + case ARespuesta of + 100 : begin + // Ver el albarán + AAlbaranesClienteController.Ver(AAlbaran); + end; + 200 : // Continuar; + end; + end; + end; + + Result := True; + finally + if Assigned(AContratosClienteController) then + Finalizar; + end; +end; + +function ElegirContratoYGenerarAlbaranCli(var IDAlbaran: Integer) : Boolean; +var + AContrato : IBizContratoCliente; + AAlbaran : IBizAlbaranCliente; +begin + Result := False; + IDAlbaran := -1; + + AAlbaran := NIL; + try + if not Assigned(AContratosClienteController) then + Inicializar; + + AContrato := AContratosClienteController.ElegirContratos(AContratosClienteController.BuscarTodos, + 'Elija el contrato de cliente que desea utilizar para dar de alta el albarán.', False); + + if Assigned(AContrato) then + begin + Result := GenerarAlbaranCli(AContrato, AAlbaran); + if Result then + IDAlbaran := AAlbaran.ID; + end; + finally + if Assigned(AContratosClienteController) then + Finalizar; + end; +end; + + + +{ +function ElegirPedidoYGenerarAlbaranCli(var IDAlbaran: Integer) : Boolean; overload; +var + APedido : IBizPedidoCliente; + AAlbaran : IBizAlbaranCliente; +begin + Result := False; + IDAlbaran := -1; + + AAlbaran := NIL; + try + if not Assigned(APedidosClienteController) then + Inicializar; + + APedido := APedidosClienteController.ElegirPedidos(APedidosClienteController.BuscarPendientes, + 'Elija el pedido de cliente que desea utilizar para dar de alta el albarán de cliente.' + , False); + + if Assigned(APedido) then + begin + Result := GenerarAlbaranCli(APedido, AAlbaran); + if Result then + IDAlbaran := AAlbaran.ID; + end; + finally + if Assigned(APedidosClienteController) then + Finalizar; + end; +end; +} +end. diff --git a/Source/Modulos/Relaciones/Contratos de cliente - Facturas de cliente/ConCli_FacCli_relation.dproj b/Source/Modulos/Relaciones/Contratos de cliente - Facturas de cliente/ConCli_FacCli_relation.dproj index 4eb2e1a5..27164aa9 100644 --- a/Source/Modulos/Relaciones/Contratos de cliente - Facturas de cliente/ConCli_FacCli_relation.dproj +++ b/Source/Modulos/Relaciones/Contratos de cliente - Facturas de cliente/ConCli_FacCli_relation.dproj @@ -40,114 +40,6 @@ Package FalseTrueFalseFalseFalseFalseTrueFalse1000FalseFalseFalseFalseFalse308212521.0.0.01.0.0.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Borland Sample Components Delphi 1.0 Compatibility Components Borland MyBase DataAccess Components @@ -191,14 +83,14 @@ MainSource - - - - - - - - + + + + + + + +
dmGenerarFacturasCli
diff --git a/Source/Servidor/FactuGES_Server.dpr b/Source/Servidor/FactuGES_Server.dpr index d2fca630..eeb8ae75 100644 --- a/Source/Servidor/FactuGES_Server.dpr +++ b/Source/Servidor/FactuGES_Server.dpr @@ -115,8 +115,6 @@ uses srvContratosCliente_Impl in '..\Modulos\Contratos de cliente\Servidor\srvContratosCliente_Impl.pas' {srvContratosCliente: TDataAbstractService}, uBizContratosClienteServer in '..\Modulos\Contratos de cliente\Model\uBizContratosClienteServer.pas', uRptContratosCliente_Server in '..\Modulos\Contratos de cliente\Reports\uRptContratosCliente_Server.pas' {RptContratosCliente}, - schAlbaranesClienteClient_Intf in '..\Modulos\Albaranes de cliente\Model\schAlbaranesClienteClient_Intf.pas', - schAlbaranesClienteServer_Intf in '..\Modulos\Albaranes de cliente\Model\schAlbaranesClienteServer_Intf.pas', schAlbaranesProveedorClient_Intf in '..\Modulos\Albaranes de proveedor\Model\schAlbaranesProveedorClient_Intf.pas', schAlbaranesProveedorServer_Intf in '..\Modulos\Albaranes de proveedor\Model\schAlbaranesProveedorServer_Intf.pas', schInventarioClient_Intf in '..\Modulos\Inventario\Model\schInventarioClient_Intf.pas', @@ -136,7 +134,9 @@ uses schPresupuestosClienteClient_Intf in '..\Modulos\Presupuestos de cliente\Model\schPresupuestosClienteClient_Intf.pas', schPresupuestosClienteServer_Intf in '..\Modulos\Presupuestos de cliente\Model\schPresupuestosClienteServer_Intf.pas', schFacturasClienteClient_Intf in '..\Modulos\Facturas de cliente\Model\schFacturasClienteClient_Intf.pas', - schFacturasClienteServer_Intf in '..\Modulos\Facturas de cliente\Model\schFacturasClienteServer_Intf.pas'; + schFacturasClienteServer_Intf in '..\Modulos\Facturas de cliente\Model\schFacturasClienteServer_Intf.pas', + schAlbaranesClienteClient_Intf in '..\Modulos\Albaranes de cliente\Model\schAlbaranesClienteClient_Intf.pas', + schAlbaranesClienteServer_Intf in '..\Modulos\Albaranes de cliente\Model\schAlbaranesClienteServer_Intf.pas'; {$R *.res} {$R ..\Servicios\RODLFile.res} diff --git a/Source/Servidor/FactuGES_Server.dproj b/Source/Servidor/FactuGES_Server.dproj index 9237fba4..97f4123f 100644 --- a/Source/Servidor/FactuGES_Server.dproj +++ b/Source/Servidor/FactuGES_Server.dproj @@ -28,7 +28,7 @@ Delphi.Personality - FalseTrueFalseTrueFalse2520FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.5.2.0FactuGES (Servidor)2.5.2.0martes, 29 de enero de 2013 19:17 + FalseTrueFalseTrueFalse2530FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.5.3.0FactuGES (Servidor)2.5.3.0viernes, 17 de mayo de 2013 12:12 File C:\Documents and Settings\All Users\Documentos\RAD Studio\5.0\Bpl\dxPScxScheduler2LnkD11.bpl not found FactuGES_Server.dpr diff --git a/Source/Servidor/FactuGES_Server.rc b/Source/Servidor/FactuGES_Server.rc index bab0a7e3..59c19d00 100644 --- a/Source/Servidor/FactuGES_Server.rc +++ b/Source/Servidor/FactuGES_Server.rc @@ -1,7 +1,7 @@ MAINICON ICON "C:\Codigo Acana\Resources\Iconos\Servidor.ico" 1 VERSIONINFO -FILEVERSION 2,5,2,0 -PRODUCTVERSION 2,5,2,0 +FILEVERSION 2,5,3,0 +PRODUCTVERSION 2,5,3,0 FILEFLAGSMASK 0x3FL FILEFLAGS 0x00L FILEOS 0x40004L @@ -13,10 +13,10 @@ BEGIN BLOCK "0C0A04E4" BEGIN VALUE "CompanyName", "Rodax Software S.L.\0" - VALUE "FileVersion", "2.5.2.0\0" + VALUE "FileVersion", "2.5.3.0\0" VALUE "ProductName", "FactuGES (Servidor)\0" - VALUE "ProductVersion", "2.5.2.0\0" - VALUE "CompileDate", "martes, 05 de febrero de 2013 12:54\0" + VALUE "ProductVersion", "2.5.3.0\0" + VALUE "CompileDate", "viernes, 17 de mayo de 2013 14:16\0" END END BLOCK "VarFileInfo" diff --git a/Source/Servidor/FactuGES_Server.res b/Source/Servidor/FactuGES_Server.res index b3876333..624d4397 100644 Binary files a/Source/Servidor/FactuGES_Server.res and b/Source/Servidor/FactuGES_Server.res differ diff --git a/Tools/UPX/BUGS b/Tools/UPX/BUGS new file mode 100644 index 00000000..ee6f284e --- /dev/null +++ b/Tools/UPX/BUGS @@ -0,0 +1,51 @@ + ooooo ooo ooooooooo. ooooooo ooooo + `888' `8' `888 `Y88. `8888 d8' + 888 8 888 .d88' Y888..8P + 888 8 888ooo88P' `8888' + 888 8 888 .8PY888. + `88. .8' 888 d8' `888b + `YbodP' o888o o888o o88888o + + + The Ultimate Packer for eXecutables + Copyright (c) 1996-2013 Markus Oberhumer, Laszlo Molnar & John Reiser + http://upx.sourceforge.net + + +Limitations and other things which are not (yet) supported: +=========================================================== + +djgpp2/coff +----------- + * all overlays (except Allegro pakfiles) are silently stripped + +dos/exe +------- + * normal dos/exes with new exe headers + * max ~24000 relocation records (...should be enough for everyone ;-) + * exe + sys combined images + +watcom/le +--------- + * 16-bit selector alias fixups + * 16-bit offset relocation for objects larger than 4 KiB + * 16:16 fixups + +If you need any of the above (they're very rare), send us an URL of a +test file. + + * 16-bit objects are not loaded into DOS memory + * There is still a problem with the wdosx extender: if you compress a + watcom/le file which does NOT contain the wdosx extender, and after this + you bind the wdosx stub to the compressed file, then it will work. + Otherwise it won't. + * unpacked pmwlite compressed programs might not work when compressed + with UPX (this is a bug in pmwunlite) + +win32/pe +-------- + * writable shared sections (`--force' *may* work) + * certificates in the image + * compressing files which contain a big BSS requires lots of memory + during compression + diff --git a/Tools/UPX/COPYING b/Tools/UPX/COPYING new file mode 100644 index 00000000..d159169d --- /dev/null +++ b/Tools/UPX/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/Tools/UPX/LICENSE b/Tools/UPX/LICENSE new file mode 100644 index 00000000..444ded8d --- /dev/null +++ b/Tools/UPX/LICENSE @@ -0,0 +1,138 @@ +-----BEGIN PGP SIGNED MESSAGE----- + + + ooooo ooo ooooooooo. ooooooo ooooo + `888' `8' `888 `Y88. `8888 d8' + 888 8 888 .d88' Y888..8P + 888 8 888ooo88P' `8888' + 888 8 888 .8PY888. + `88. .8' 888 d8' `888b + `YbodP' o888o o888o o88888o + + + The Ultimate Packer for eXecutables + Copyright (c) 1996-2000 Markus Oberhumer & Laszlo Molnar + http://wildsau.idv.uni-linz.ac.at/mfx/upx.html + http://www.nexus.hu/upx + http://upx.tsx.org + + +PLEASE CAREFULLY READ THIS LICENSE AGREEMENT, ESPECIALLY IF YOU PLAN +TO MODIFY THE UPX SOURCE CODE OR USE A MODIFIED UPX VERSION. + + +ABSTRACT +======== + + UPX and UCL are copyrighted software distributed under the terms + of the GNU General Public License (hereinafter the "GPL"). + + The stub which is imbedded in each UPX compressed program is part + of UPX and UCL, and contains code that is under our copyright. The + terms of the GNU General Public License still apply as compressing + a program is a special form of linking with our stub. + + As a special exception we grant the free usage of UPX for all + executables, including commercial programs. + See below for details and restrictions. + + +COPYRIGHT +========= + + UPX and UCL are copyrighted software. All rights remain with the authors. + + UPX is Copyright (C) 1996-2000 Markus Franz Xaver Johannes Oberhumer + UPX is Copyright (C) 1996-2000 Laszlo Molnar + + UCL is Copyright (C) 1996-2000 Markus Franz Xaver Johannes Oberhumer + + +GNU GENERAL PUBLIC LICENSE +========================== + + UPX and the UCL library are free software; you can redistribute them + and/or modify them under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + UPX and UCL are distributed in the hope that they will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. + + +SPECIAL EXCEPTION FOR COMPRESSED EXECUTABLES +============================================ + + The stub which is imbedded in each UPX compressed program is part + of UPX and UCL, and contains code that is under our copyright. The + terms of the GNU General Public License still apply as compressing + a program is a special form of linking with our stub. + + Hereby Markus F.X.J. Oberhumer and Laszlo Molnar grant you special + permission to freely use and distribute all UPX compressed programs + (including commercial ones), subject to the following restrictions: + + 1. You must compress your program with a completely unmodified UPX + version; either with our precompiled version, or (at your option) + with a self compiled version of the unmodified UPX sources as + distributed by us. + 2. This also implies that the UPX stub must be completely unmodfied, i.e. + the stub imbedded in your compressed program must be byte-identical + to the stub that is produced by the official unmodified UPX version. + 3. The decompressor and any other code from the stub must exclusively get + used by the unmodified UPX stub for decompressing your program at + program startup. No portion of the stub may get read, copied, + called or otherwise get used or accessed by your program. + + +ANNOTATIONS +=========== + + - You can use a modified UPX version or modified UPX stub only for + programs that are compatible with the GNU General Public License. + + - We grant you special permission to freely use and distribute all UPX + compressed programs. But any modification of the UPX stub (such as, + but not limited to, removing our copyright string or making your + program non-decompressible) will immediately revoke your right to + use and distribute a UPX compressed program. + + - UPX is not a software protection tool; by requiring that you use + the unmodified UPX version for your proprietary programs we + make sure that any user can decompress your program. This protects + both you and your users as nobody can hide malicious code - + any program that cannot be decompressed is highly suspicious + by definition. + + - You can integrate all or part of UPX and UCL into projects that + are compatible with the GNU GPL, but obviously you cannot grant + any special exceptions beyond the GPL for our code in your project. + + - We want to actively support manufacturers of virus scanners and + similar security software. Please contact us if you would like to + incorporate parts of UPX or UCL into such a product. + + + +Markus F.X.J. Oberhumer Laszlo Molnar +markus.oberhumer@jk.uni-linz.ac.at ml1050@cdata.tvnet.hu + +Linz, Austria, 25 Feb 2000 + + + +-----BEGIN PGP SIGNATURE----- +Version: 2.6.3ia +Charset: noconv + +iQCVAwUBOLaLS210fyLu8beJAQFYVAP/ShzENWKLTvedLCjZbDcwaBEHfUVcrGMI +wE7frMkbWT2zmkdv9hW90WmjMhOBu7yhUplvN8BKOtLiolEnZmLCYu8AGCwr5wBf +dfLoClxnzfTtgQv5axF1awp4RwCUH3hf4cDrOVqmAsWXKPHtm4hx96jF6L4oHhjx +OO03+ojZdO8= +=CS52 +-----END PGP SIGNATURE----- diff --git a/Tools/UPX/NEWS b/Tools/UPX/NEWS new file mode 100644 index 00000000..a25da715 --- /dev/null +++ b/Tools/UPX/NEWS @@ -0,0 +1,478 @@ +================================================================== +User visible changes for UPX +================================================================== + +Changes in 3.09 (18 Feb 2013): + * New option --preserve-build-id for GNU ELF. + * Allow for code signing and LC_UUID on Mac OS X executables. + * Allow non-contiguous LC_SEGMENTs and 0==.vmsize for Mach-O. + * Allow zero-filled final page in PackUnix::canUnpack(). + * bug fixes + +Changes in 3.08 (12 Dec 2011): + * Fix allocation in runtime stub for darwin.macho-entry (i386 and amd64). + * Compress shared library on ELF i386 only [ld.so threatens even this case]. + * Attempt to support ELF on QNX 6.3.0 for armel (experimental). + * Better diagnostic when ELF -fPIC is needed. + * PT_NOTE improvements for *BSD. + * Preserve more ELF .e_flags on ARM. + * Minor code improvements for ELF stubs. + * Defend against another flavor of corrupt PE header. + * bug fixes + +Changes in 3.07 (08 Sep 2010): + * win32/pe: fixed relocation handling for files with *no* TLS callbacks + [severe bug introduced in 3.06] + +Changes in 3.06 (04 Sep 2010): + * win32/pe: TLS callback support contributed by Stefan Widmann. Thanks! + * bug fixes + +Changes in 3.05 (27 Apr 2010): + * i386-linux and amd64-linux support shared libraries (DT_INIT must + exist, all info needed by runtime loader must be first in .text, etc.) + * Linux /proc/self/exe now is preserved by default, by leaving behind + one page. New compress-time option --unmap-all-pages is available. + * Withdraw support for shared libraries on Darwin (Apple Mac OS X) + because upx does not understand enough about .dylib. + * bug fixes + +Changes in 3.04 (27 Sep 2009): + * new format Mach/AMD64 supports 64-bit programs on Apple Macintosh. + * new formats Dylib/i386 and Dylib/ppc32 support shared libraries + [such as browser plugins] on Darwin (Apple Macintosh). An existing + -init function (LC_ROUTINES command) is required. + * new format vmlinuz/armel for Debian NSLU2 (etc.) linux kernel + * bvmlinuz boot protocol 2.08 for 386 Linux kernel + * Extended ABI version 4 for armel-eabi ARM Linux ELF + * bug fixes + +Changes in 3.03 (27 Apr 2008): + * implement cache flushing for PowerPC (esp. model 440) + * fix cache flushing on MIPS (>3 MiB compressed, or with holes) + * fix MIPS big-endian + * bug fixes + +Changes in 3.02 (16 Dec 2007): + * fix unmapping on arm-linux.elf + * fix error checking in mmap for i386-linux.elf [triggered by -fPIE] + * bug fixes + +Changes in 3.01 (31 Jul 2007): + * new options --no-mode, --no-owner and --no-time to disable preservation + of mode (file permissions), file ownership and timestamps. + * dos/exe: fixed an incorrect error message caused by a bug in + relocation handling + * new format linux/mipsel supports ELF on [32-bit] R3000 + * fix argv[0] on PowerPC with --lzma + * bug fixes + +Changes in 3.00 (27 Apr 2007): + * watcom/le & tmt/adam: fixed a problem when using certain filters + +Changes in 2.93 beta (08 Mar 2007): + * new formats Mach/i386 and Mach/fat support Mac OS X i686 and + Universal binaries [i686 and PowerPC only] + * dos/exe: LZMA is now also supported for 16-bit dos/exe. Please note that + you have to explicitly use '--lzma' even for '--ultra-brute' here + because runtime decompression is about 30 times slower than NRV - + which is really noticeable on old machines. + * dos/exe: fixed a rarely occuring bug in relocation handling + * win32/pe & arm/pe: better icon compression handling + +Changes in 2.92 beta (23 Jan 2007): + * new option '--ultra-brute' which tries even more variants + * slightly improved compression ratio for some files when + using '--brute' or '--ultra-brute' + * bug fixes + +Changes in 2.91 beta (29 Nov 2006): + * assorted bug fixes + * arm/pe: fix "missing" icon & version info resource problem for wince 5 + * win32/pe & arm/pe: added option --compress-icons=3 to compress all icons + +Changes in 2.90 beta (08 Oct 2006): + * LZMA algorithm support for most of the 32-bit and 64-bit file formats; + use new option '--lzma' to enable + * new format: BSD/elf386 supporting FreeBSD, NetBSD and OpenBSD + via auto-detection of PT_NOTE or EI_OSABI + * arm/pe: all the NRV compression methods are now supported + (only NRV2D is missing in thumb mode) + * linux/elf386, linux/ElfAMD: remember /proc/self/exe in environment + * major source code changes: the runtime decompression stubs are now + built from internal ELF objects + +================================================================== + +Changes in 2.03 (07 Nov 2006): + * bvmlinuz/386: fix for kernels not at 0x100000; also allow x86_64 + * linux/elf386: work around Linux kernel bug (0-length .bss needs PF_W) + +Changes in 2.02 (13 Aug 2006): + * linux/386: work around Linux kernel bug (".bss" requires PF_W) + * linux/ppc32, mach/ppc32: compressed programs now work on a 405 CPU + * vmlinuz/386: fixed zlib uncompression problem on DOS + +Changes in 2.01 (06 Jun 2006): + * arm/pe: better DLL support + * dos/exe: device driver support added + * linux/386: Fix --force-execve for PaX, grSecurity, and strict SELinux. + /tmp must support execve(); therefore /tmp cannot be mounted 'noexec'. + * win32/pe & arm/pe: added new option '--keep-resource=' for + excluding selected resources from compression + +Changes in 2.00 (27 Apr 2006): + * linux/386: the stub now prints an error message if some strict + SELinux mode does prevent runtime decompression and execution + (for a fully SELinux-compatible but otherwise inferior compression + format you can use the '--force-execve' option) + * linux/386: worked around a problem where certain Linux kernels + clobber the %ebx register during a syscall + * win32/pe: disable filters for files with broken PE headers + +Changes in 1.96 beta (13 Apr 2006): + * arm/pe: added filter support + * win32/pe: removed an unnecessary check so that Delphi 2006 and + Digital Mars C++ programs finally are supported + +Changes in 1.95 beta (09 Apr 2006): + * arm/pe: added DLL support + * arm/pe: added thumb mode stub support + * arm/pe: added unpacking support + * win32/pe: really worked around R6002 runtime errors + +Changes in 1.94 beta (11 Mar 2006): + * new format: added support for arm/pe (ARM executables running on WinCE) + * new format: added support for linux elf/amd64 + * new format: added support for linux elf/ppc32 + * new format: added support for mach/ppc32 (Apple Mac OS X) + * win32/pe: hopefully working "load config" support + * win32/pe: R6002 runtime errors worked around + * win32/pe: the stub now clears the dirty stack + +Changes in 1.93 beta (07 Feb 2005): + * vmlinuz/386: fixes to support more kernels + +Changes in 1.92 beta (20 Jul 2004): + * win32/pe: added option '--strip-loadconf' to strip the SEH load + config section [NOTE: this option is obsolete since UPX 1.94] + * win32/pe: try to detect .NET (win32/net) files [not yet supported by UPX] + * vmlinux/386: new format that directly supports building Linux kernels + * source code: now compiles cleanly under Win64 + +Changes in 1.91 beta (30 Jun 2004): + * djgpp2/coff: added support for recent binutils versions + * linux/elf386, linux/sh386: lots of improvements + * vmlinuz/386: added support for recent kernels + * watcom/le: don't crash on files without relocations + * win32/pe: stricter checks of some PE values + * option '--brute' now implies '--crp-ms=999999'. + * source code: much improved portability using ACC, the + Automatic Compiler Configuration + * source code: compile fixes for strict ISO C++ compilers + * source code: compile fixes for Win64 + * re-synced with upx 1.25 branch + +Changes in 1.90 beta (11 Nov 2002): + * implemented several new options for finer compression control: + '--all-methods', '--all-filters' and '--brute' + * ps1/exe: new format - UPX now supports PlayStation One programs + * linux/386: added the option '--force-execve' + * vmlinuz/386: better kernel detection and sanity checks + * re-synced with upx 1.24 branch + * documentation updates + +Changes in 1.11 beta (20 Dec 2000): + * vmlinuz/386: new format - UPX now supports bootable linux kernels + * linux/elf386: added the new ELF direct-to-memory executable format - no + more temp files are needed for decompression! + * linux/sh386: added the new shell direct-to-memory executable format - no + more temp files are needed for decompression! + * reduced overall memory requirements during packing + * quite a number of internal source code rearrangements + +================================================================== + +Changes in 1.25 (29 Jun 2004) + * INFO: http://upx.sourceforge.net is the permanent UPX home page + * watcom/le: don't crash on files without relocations + * win32/pe: stricter checks of some PE values + * source code: much improved portability using ACC, the + Automatic Compiler Configuration + * source code: compile fixes for strict ISO C++ compilers + * source code: compile fixes for Win64 + +Changes in 1.24 (07 Nov 2002) + * djgpp2/coff: stricter check of the COFF header to work around a + problem with certain binutils versions + +Changes in 1.23 (05 Sep 2002) + * atari/tos: fixed an unpacking problem where a buffer was too + small (introduced in 1.22) + * linux/386: don't give up too early if a single block turns out + to be incompressible + * documentation: added some quick tips how to achieve the best + compression ratio for the final release of your application + * fixed a rare situation where the exit code was not set correctly + +Changes in 1.22 (27 Jun 2002) + * atari/tos: the stub now flushes the CPU cache to avoid + problems on 68030+ machines + * source code: additional compiler support for Borland C++, + Digital Mars C++ and Watcom C++ + +Changes in 1.21 (01 Jun 2002) + * New option '--crp-ms=' for slightly better compression at the cost + of higher memory requirements during compression. + Try 'upx --best --crp-ms=100000'. See the docs for more info. + * source code: portability fixes + * source code: compile fixes for g++ 3.0 and g++ 3.1 + +Changes in 1.20 (23 May 2001) + * slightly faster compression + * work around a gcc problem in the latest djgpp2 distribution + * watcom/le: fixed detection of already compressed files + * win32/pe: do not compress RT_MANIFEST resource types + * win32/pe: improved the error message for empty resource sections + * [NOTE: the jump from 1.08 to 1.20 is to avoid confusion with + our unstable development releases 1.1x and 1.9x] + +Changes in 1.08 (30 Apr 2001) + * new native port to atari/tos + * win32/pe: shortened the identstring + * source code: portability fixes - UPX now builds cleanly under m68k CPUs + +Changes in 1.07 (20 Feb 2001) + * win32/pe: corrected the TLS callback check + * win32/pe: really fixed that rare bug in relocation handling + * win32/pe: experimental support for SizeOfHeaders > 0x1000 + * win32/pe: check for superfluous data between sections + * win32/pe: compressing screensavers (.scr) should finally work + +Changes in 1.06 (27 Jan 2001) + * win32/pe: the check for TLS callbacks introduced in 1.05 + was too strict - disabled for now + * dos/com: decreased the decompressor stack size a little bit + +Changes in 1.05 (24 Jan 2001) + * win32/pe: refuse to compress programs with TLS callbacks + * win32/pe: stub changes to avoid slowdowns with some virus monitors + * win32/pe: reverted the relocation handling changes in 1.04 + * linux/386: dont try to compress Linux kernel images (have a look + at the unstable UPX 1.1x beta versions for that) + +Changes in 1.04 (19 Dec 2000) + * dos/exe: fixed an internal error when using '--no-reloc' + * win32/pe: fixed a rare bug in the relocation handling code + * some tunings for the default compression level + +Changes in 1.03 (30 Nov 2000) + * linked with a new version of the NRV compression library: + - improved compression ratio a little bit + - overall significantly faster compression + - much faster when using high compression levels like '-9' or '--best' + - much faster with large files + * atari/tos: added support for FreeMiNT + * the 32-bit DOS version now uses the new CWSDSTUB extender + +Changes in 1.02 (13 Sep 2000) + * watcom/le: fixed a problem with the Causeway extender + * win32/pe: don't automatically strip relocs if they seem needed + * support multiple backup generations when using '-k' + * updated the console screen driver + +Changes in 1.01 (09 Apr 2000) + * win32/pe: fixed an uncompression problem in DLLs with empty + fixup sections + * win32/pe: fixed another rare uncompression problem - a field in the + PE header was set incorrectly + +Changes in 1.00 (26 Mar 2000) + * documentation updates + * watcom/le: do not duplicate the non-resident name table + * win32/pe: fixed an import handling problem: sometimes too much data + could be deleted from a file -> the uncompressed file would not work + anymore + +Changes in 0.99.3 (07 Mar 2000) + * win32/pe: fixed a rare problem in the stub string handling part + +Changes in 0.99.2 (02 Mar 2000) + * dos/exe: fixed a typo causing an internal error (introduced in 0.99.1) + +Changes in 0.99.1 (29 Feb 2000) + * win32/pe: fixed some object alignments which were causing + problems when loading compressed DLLs under Windows NT/2000 + +Changes in 0.99 (25 Feb 2000) + * FULL SOURCE CODE RELEASED UNDER THE TERMS OF THE GNU GPL + * win32/pe: changed default to '--strip-relocs=1' + * dos/com and dos/sys: fixed a bad decompressor problem + * linux/386: the counter for the progress indicator was off by one + +Changes in 0.94 (06 Dec 1999) + * win32/pe: the stub now calls ExitProcess in case of import errors + * under DOS and Windows, the environment variable UPX now accepts + a '#' as replacement for '=' because of a COMMAND.COM limitation + +Changes in 0.93 (22 Nov 1999) + * win32/pe: fixed --strip-relocs problem with uncompression + * win32/pe: fixed a bug which could produce a broken decompressor stub + * linux/386: yet another FreeBSD compatibility fix + +Changes in 0.92 (14 Nov 1999) + * win32/pe: really fixed that one line (see below) + +Changes in 0.91 (13 Nov 1999) + * win32/pe: an important one-line fix for the newly introduced problems + * dos/com and dos/sys: fixed an internal error + * dos/exe: correctly restore cs when uncompressing + +Changes in 0.90 (10 Nov 1999) + * all formats: '--overlay=copy' now is the default overlay mode + * improved compression ratio for most files + * win32/pe: uncompression is finally supported + * win32/pe: never compress REGISTRY resources + * win32/pe: headersize was not set in PE header + * win32/pe: resource handling is rewritten + * win32/pe: the last :-) TLS problem is fixed + * win32/pe: somewhat less memory is required during compression + * linux/386: fixed compression of scripts which was broken since 0.71 + * linux/386: more FreeBSD compatibility issues + * changed option: '-i' now prints some more details during compression + (not finished yet) + +Changes in 0.84 (04 Oct 1999) + * dos/exe: fixed a rare problem where the decompressor could crash + * some other minor fixes + +Changes in 0.83 (17 Sep 1999) + * dos/exe: fixed minimal memory requirement problem for some files + * win32/pe: fixed a bug which caused a crash in some compressed files + * linux/386: various improvements in the stub; also, for the sake + of FreeBSD users, the stub is now branded as Linux/ELF + +Changes in 0.82 (16 Aug 1999) + * dos/exe: fixed a decompressor bug which could cause crash on some files + * linux/386: section headers are now stripped from the stub so that + 'strip' won't ruin a compressed file any longer + * wc/le: support for stack not in the last object disabled again + * win32/pe: removed some unneeded data + +Changes in 0.81 (04 Aug 1999) + * win32/pe: fixed an important bug in import handling + * dos/com: fixed an internal error that could happen with very small files + +Changes in 0.80 (03 Aug 1999) + * you can set some default options in the environment var 'UPX' + * dos/com: the decompressor stub now checks for enough free memory + * dos/exe: decompressor rewritten, some bugs are fixed + * dos/exe: new option '--no-reloc': no relocation data is put into + the DOS header + * tmt/adam: added support for more stubs, detect already packed files + * tmt/adam: new option '--copy-overlay' + * wc/le: reduced memory requirement during uncompression + * wc/le: support files which do not contain their stack in the last object + * wc/le: fixed a bug which could cause a crash, improved relocation + handling + * wc/le: new option '--copy-overlay' + * win32/pe: '--compress-icons=2' is now the default + * win32/pe: even better TLS support + * win32/pe: versioninfo works on NT + * win32/pe: import by ordinal from kernel32.dll works + * win32/pe: other import improvements: importing a nonexistent DLL + results in a usual Windows message, importing a nonexistent function + results in program exit (instead of crash ;-) + * win32/pe: new option: '--compress-resources=0' + * win32/pe: reduced memory requirement during uncompression, some + files might even require LESS memory when they're compressed + * win32/pe: TYPELIBs should work now + * win32/pe: improved relocation handling, 16-bit relocations should work + * win32/pe: new option '--strip-relocs' (only if you know what you are doing) + * win32/pe: new option '--copy-overlay' + * important internal changes: now the stubs are built at runtime + +Changes in 0.72 (12 May 1999) + * tmt/adam: fixed a serious problem in the decompressor stub; all + compressed tmt files should be recompressed + * win32/pe: fixed the 'shared sections not supported' warning: + read-only shared sections are fine + * win32/pe: never compress TYPELIB resources + * win32/pe: compressed files are hopefully less suspicious to heuristic + virus scanners now + * linux/386: minor decompressor stub updates, nicer progress bar + +Changes in 0.71 (19 Apr 1999) + * dos/exe: added option '--no-overlay' + * linux/386: various improvements in the stub, most notably the + overhead for an extra cleanup process has been removed + * win32/pe: added support for export forwarders + * win32/pe: added support for DLLs without entry point or imports + * win32/pe: yet another .bss fix + * win32/pe: new option '--compress-icons=2': compress all icons + which are not in the first icon directory + * win32/pe: rearranged stub to avoid false alerts from some virus scanners + +Changes in 0.70 (30 Mar 1999) + * added support for linux/386 executables + * improved compression ratio quite a bit + * added new compression level '--best' to squeeze out even some more bytes + * win32/pe: TLS support is much better now + * win32/pe: --compress-icons=0 should now work as well + * the usual minor fixes for win32/pe + +Changes in 0.62 (16 Mar 1999) + * win32/pe: --compress-icons and --compress-exports are on now by default + * win32/pe: --compress-icons should really work now + * win32/pe: fixed a problem with embedded .bss sections + +Changes in 0.61 (08 Mar 1999) + * atari/tos: fixed a problem where the bss segment could become too small + +Changes in 0.60 (06 Mar 1999) + * win32/pe: fixed file corruption when the size of the export data is invalid + * win32/pe: fixed a problem with empty resource data + * win32/pe: compressed file alignment set to minimum value + * win32/pe: made all compressed sections writable + * fixed some other win32/pe bugs + * fixed an address optimization problem for some not Watcom LE files + * fixed a bug which could make UPX hang when an exe header contained + an illegal value + * added some compression flags for the win32/pe format + * added support for Atari ST/TT executables (atari/tos) + * improved compression ratio + * improved compression speed + +Changes in 0.51 (14 Jan 1999) + * fixed a small bug in the PE header that would prevent some compressed + win32/pe executables from running under Windows NT and WINE + +Changes in 0.50 (03 Jan 1999) + * added support for PE format executables (win32/pe & rtm32/pe) + * added support for TMT executables (tmt/adam) + * fixed a dos/sys bug that affected OpenDOS + +Changes in 0.40 (05 Oct 1998) + * improved compression ratio + * fixed a small but fatal bug in dos/sys introduced in 0.30 + * fixed a rare bug in dos/exe + * worked around a bug in djgpp's strip 2.8 + * djgpp/coff: Allegro packfile support should work now + * added dos/exeh compression method (works on 386+) + +Changes in 0.30 (27 Jul 1998) + * fixed a serious bug in the 32-bit compressors - please don't use + djgpp/coff and watcom/le compressed files from previous versions, + some of them are possibly damaged ! + * the 16-bit uncompressors are a little bit shorter & faster + * fixed progress indicator for VESA and SVGA text modes + +Changes in 0.20 (05 Jul 1998) + * second public beta release + * too many changes to list here + +Changes in 0.05 (26 May 1998) + * first public beta release + + +# vim:set syntax=off tw=0 ts=4 sw=4 et: -*- coding: utf-8 -*- diff --git a/Tools/UPX/README b/Tools/UPX/README new file mode 100644 index 00000000..63ccb5df --- /dev/null +++ b/Tools/UPX/README @@ -0,0 +1,142 @@ + ooooo ooo ooooooooo. ooooooo ooooo + `888' `8' `888 `Y88. `8888 d8' + 888 8 888 .d88' Y888..8P + 888 8 888ooo88P' `8888' + 888 8 888 .8PY888. + `88. .8' 888 d8' `888b + `YbodP' o888o o888o o88888o + + + The Ultimate Packer for eXecutables + Copyright (c) 1996-2013 Markus Oberhumer, Laszlo Molnar & John Reiser + http://upx.sourceforge.net + + + +WELCOME +======= + +Welcome to UPX ! + +Please don't forget to read the file LICENSE - UPX is distributed +under the GNU General Public License (GPL) with special exceptions +allowing the distribution of all compressed executables, including +commercial programs. + + +INTRODUCTION +============ + +UPX is an advanced executable file compressor. UPX will typically +reduce the file size of programs and DLLs by around 50%-70%, thus +reducing disk space, network load times, download times and +other distribution and storage costs. + +Programs and libraries compressed by UPX are completely self-contained +and run exactly as before, with no runtime or memory penalty for most +of the supported formats. + +UPX supports a number of different executable formats, including +Windows 95/98/ME/NT/2000/XP/CE programs and DLLs, DOS programs, +and Linux executables and kernels. + +UPX is free software distributed under the term of the GNU General +Public License. Full source code is available. + +UPX may be distributed and used freely, even with commercial applications. +See the UPX License Agreement for details. + +UPX is rated number one in the well known Archive Comparison Test. Visit +http://compression.ca/ . + +UPX aims to be Commercial Quality Freeware. + + +SHORT DOCUMENTATION +=================== + +'upx program.exe' will compress a program or DLL. For best compression +results try 'upx --brute program.exe'. + +Please see the file UPX.DOC for the full documentation. The files +NEWS and BUGS also contain various tidbits of information. + + +DISCLAIMER +========== + +UPX comes with ABSOLUTELY NO WARRANTY; for details see the file LICENSE. + +Having said that, we think that UPX is quite stable now. Indeed we +have compressed lots of files without any problems. Also, the +current version has undergone several months of beta testing - +actually it's almost 8 years since our first public beta. + +This is the first production quality release, and we plan that future +releases will be backward compatible with this version. + +Please report all problems or suggestions to the authors. Thanks. + + +THE FUTURE +========== + + - We'd really love to support handheld systems like the PalmPilot because + compression makes a lot of sense here. And - because of the atari/tos + format - we already have a working decompressor in 68000 assembly. + Unfortunately we know next to nothing about the operating system + architecture of such handhelds, so we need some information from + an expert. Please contact us if you think you can help. + + - The Linux approach could probably get ported to a lot of other Unix + variants, at least for other i386 architectures it shouldn't be too + much work. If someone sends me a fresh hard disk and an official + FreeBSD/OpenBSD/NetBSD/Solaris/BeOS... CD I might take a look at it ;-) + + - We will *NOT* add any sort of protection and/or encryption. + This only gives people a false feeling of security because + by definition all protectors/compressors can be broken. + And don't trust any advertisement of authors of other executable + compressors about this topic - just do a websearch on "unpackers"... + + - Fix all remaining bugs - keep your reports coming ;-) + + - See the file PROJECTS in the source code distribution if you want + to contribute. + + +COPYRIGHT +========= + +Copyright (C) 1996-2013 Markus Franz Xaver Johannes Oberhumer +Copyright (C) 1996-2013 Laszlo Molnar +Copyright (C) 2000-2013 John F. Reiser + +This program may be used freely, and you are welcome to +redistribute it under certain conditions. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +UPX License Agreement for more details. + +You should have received a copy of the UPX License Agreement along +with this program; see the file LICENSE. If not, visit the UPX home page. + + +Share and enjoy, +Markus & Laszlo + + + Markus F.X.J. Oberhumer Laszlo Molnar + + + + +[ The term UPX is a shorthand for the Ultimate Packer for eXecutables + and holds no connection with potential owners of registered trademarks + or other rights. ] + +[ Feel free to contact us if you have commercial compression requirements + or interesting job offers. ] + diff --git a/Tools/UPX/README.1ST b/Tools/UPX/README.1ST new file mode 100644 index 00000000..51ad0816 --- /dev/null +++ b/Tools/UPX/README.1ST @@ -0,0 +1,23 @@ + ooooo ooo ooooooooo. ooooooo ooooo + `888' `8' `888 `Y88. `8888 d8' + 888 8 888 .d88' Y888..8P + 888 8 888ooo88P' `8888' + 888 8 888 .8PY888. + `88. .8' 888 d8' `888b + `YbodP' o888o o888o o88888o + + + The Ultimate Packer for eXecutables + Copyright (c) 1996-2013 Markus Oberhumer, Laszlo Molnar & John Reiser + http://upx.sourceforge.net + + +MAJOR NEWS IN UPX 3 +=================== + +The main news since UPX 2 are: + + * new format: added support for linux elf/arm + + * better compression using the LZMA algorithm (option '--lzma') + diff --git a/Tools/UPX/THANKS b/Tools/UPX/THANKS new file mode 100644 index 00000000..159429b5 --- /dev/null +++ b/Tools/UPX/THANKS @@ -0,0 +1,61 @@ + ooooo ooo ooooooooo. ooooooo ooooo + `888' `8' `888 `Y88. `8888 d8' + 888 8 888 .d88' Y888..8P + 888 8 888ooo88P' `8888' + 888 8 888 .8PY888. + `88. .8' 888 d8' `888b + `YbodP' o888o o888o o88888o + + + The Ultimate Packer for eXecutables + Copyright (c) 1996-2013 Markus Oberhumer, Laszlo Molnar & John Reiser + http://upx.sourceforge.net + + +.___.. . + | |_ _.._ ;_/ __ + | [ )(_][ )| \_) +-------------------- + +UPX would not be what it is today without the invaluable help of +everybody who was kind enough to spend time testing it, using it +in applications and reporting bugs. + +The following people made especially gracious contributions of their +time and energy in helping to track down bugs, add new features, and +generally assist in the UPX maintainership process: + +Adam Ierymenko + for severals ideas for the Linux version +Andi Kleen and Jamie Lokier + for the /proc/self/fd/X and other Linux suggestions +Andreas Muegge + for the Win32 GUI +Atli Mar Gudmundsson + for several comments on the win32/pe stub +Charles W. Sandmann + for the idea with the stubless decompressor in djgpp2/coff +Ice + for debugging the PE headersize problem down +Joergen Ibsen and d'b + for the relocation & address optimization ideas +John S. Fine + for the new version of the dos/exe decompressor +Lukundoo + for beta testing +Michael Devore + for initial dos/exe device driver support +Oleg V. Volkov + for various FreeBSD specific informations +The Owl & G-RoM + for the --compress-icons fix +Ralph Roth + for reporting several bugs +Salvador Eduardo Tropea + for beta testing +Stefan Widmann + for the win32/pe TLS callback support +The WINE project (http://www.winehq.com/) + for lots of useful information found in their PE loader sources +Natascha + diff --git a/Tools/UPX/TODO b/Tools/UPX/TODO new file mode 100644 index 00000000..210d9a17 --- /dev/null +++ b/Tools/UPX/TODO @@ -0,0 +1,114 @@ +UPX TODO list. Last updated 2006-12-08. + + +IMPORTANT PROBLEMS THAT SHOULD BE FIXED SOON: + +- [None] + + +OTHER: + +- docs: convert docs from upx.pod to use AsciiDoc + +- check all to make sure they are not invalid + +- throwNotCompressible() is not a real error, so make the output nicer + (info: bla bla). Also ui.cpp (total_*). + + +----------------------------------------------------------------------- + + +IMPROVED COMPRESSION RATIO +========================== + +- experiment with new filters + +- implement filters for dos/exe + +- filters: could we exploit a f->firstcall info field ? + +- for small programs (e.g. < 64k), try an additional algorithm + to see if it gives better compression + + +ALL FORMATS +=========== + +- more thoroughly test the exe-header in canPack() + and throw exceptions when encountering bad values. + +- implement `--cpu=486' option to use bswap on the 32-bit formats + (if cpu >= 486) + + +FORMAT DJGPP2/COFF +================== + +- handle overlays + +- fix default file extension handling when the --coff option is set + + +FORMAT DOS/EXE +============== + +- implement filters + +- add a check so that we don't pack djgpp1 binaries + + +FORMAT LINUX/386 +================ + +- don't mmap() the temporary output file - this seems to improve + file io speed + + +FORMAT TMT/ADAM +=============== + +- the decompressors are already aligned, no need for an + extra alignment + + +FORMAT WATCOM/LE +================ + +- handle files without relocations + +- the decompressors are already aligned, no need for an + extra alignment + +- fix default file extension handling when the --le option is set + +- handle holes in the file + + +FORMAT WIN16/NE +=============== + +- implement readFileHeader() to correctly identify a win16/ne + executable, so that the call for contribution will get thrown + + +FORMAT WIN32/PE +=============== + +- fix the section alignment with the Intel compiler + +- decrease runtime memory overhead + +3 - difficult) don't compress the BSS section and other holes. + +4 - medium - ml) fix when objectalign < 0x1000 + +4 - easy - ml) put the original offset of moved resources somewhere into + the res.dir. (if it's safe to do) + +4 - ??? - ml) fix FIXMEs + +5 - medium - ml) try to put the preprocessed imports & relocs back to their + original section if possible. this could save some virtual memory + address space. + diff --git a/Tools/UPX/upx.1 b/Tools/UPX/upx.1 new file mode 100644 index 00000000..1fd249ed --- /dev/null +++ b/Tools/UPX/upx.1 @@ -0,0 +1,1036 @@ +.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.13) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "UPX 1" +.TH UPX 1 "2013-02-18" "upx 3.09" " " +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +upx \- compress or expand executable files +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +\&\fBupx\fR [\ \fIcommand\fR\ ] [\ \fIoptions\fR\ ] \fIfilename\fR... +.SH "ABSTRACT" +.IX Header "ABSTRACT" +.Vb 3 +\& The Ultimate Packer for eXecutables +\& Copyright (c) 1996\-2013 Markus Oberhumer, Laszlo Molnar & John Reiser +\& http://upx.sourceforge.net +.Ve +.PP +\&\fB\s-1UPX\s0\fR is a portable, extendable, high-performance executable packer for +several different executable formats. It achieves an excellent compression +ratio and offers \fI*very*\fR fast decompression. Your executables suffer +no memory overhead or other drawbacks for most of the formats supported, +because of in-place decompression. +.PP +While you may use \fB\s-1UPX\s0\fR freely for both non-commercial and commercial +executables (for details see the file \s-1LICENSE\s0), we would highly +appreciate if you credit \fB\s-1UPX\s0\fR and ourselves in the documentation, +possibly including a reference to the \fB\s-1UPX\s0\fR home page. Thanks. +.PP +[ Using \fB\s-1UPX\s0\fR in non-OpenSource applications without proper credits +is considered not politically correct ;\-) ] +.SH "DISCLAIMER" +.IX Header "DISCLAIMER" +\&\fB\s-1UPX\s0\fR comes with \s-1ABSOLUTELY\s0 \s-1NO\s0 \s-1WARRANTY\s0; for details see the file \s-1LICENSE\s0. +.PP +This is the first production quality release, and we plan that future 1.xx +releases will be backward compatible with this version. +.PP +Please report all problems or suggestions to the authors. Thanks. +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +\&\fB\s-1UPX\s0\fR is a versatile executable packer with the following features: +.PP +.Vb 2 +\& \- excellent compression ratio: compresses better than zip/gzip, +\& use UPX to decrease the size of your distribution ! +\& +\& \- very fast decompression: about 10 MiB/sec on an ancient Pentium 133, +\& about 200 MiB/sec on an Athlon XP 2000+. +\& +\& \- no memory overhead for your compressed executables for most of the +\& supported formats +\& +\& \- safe: you can list, test and unpack your executables +\& Also, a checksum of both the compressed and uncompressed file is +\& maintained internally. +\& +\& \- universal: UPX can pack a number of executable formats: +\& * atari/tos +\& * bvmlinuz/386 [bootable Linux kernel] +\& * djgpp2/coff +\& * dos/com +\& * dos/exe +\& * dos/sys +\& * linux/386 +\& * linux/elf386 +\& * linux/sh386 +\& * ps1/exe +\& * rtm32/pe +\& * tmt/adam +\& * vmlinuz/386 [bootable Linux kernel] +\& * vmlinux/386 +\& * watcom/le (supporting DOS4G, PMODE/W, DOS32a and CauseWay) +\& * win32/pe (exe and dll) +\& * arm/pe (exe and dll) +\& * linux/elfamd64 +\& * linux/elfppc32 +\& * mach/elfppc32 +\& +\& \- portable: UPX is written in portable endian\-neutral C++ +\& +\& \- extendable: because of the class layout it\*(Aqs very easy to support +\& new executable formats or add new compression algorithms +\& +\& \- free: UPX can be distributed and used freely. And from version 0.99 +\& the full source code of UPX is released under the GNU General Public +\& License (GPL) ! +.Ve +.PP +You probably understand now why we call \fB\s-1UPX\s0\fR the "\fIultimate\fR" +executable packer. +.SH "COMMANDS" +.IX Header "COMMANDS" +.SS "Compress" +.IX Subsection "Compress" +This is the default operation, eg. \fBupx yourfile.exe\fR will compress the file +specified on the command line. +.SS "Decompress" +.IX Subsection "Decompress" +All \fB\s-1UPX\s0\fR supported file formats can be unpacked using the \fB\-d\fR switch, eg. +\&\fBupx \-d yourfile.exe\fR will uncompress the file you've just compressed. +.SS "Test" +.IX Subsection "Test" +The \fB\-t\fR command tests the integrity of the compressed and uncompressed +data, eg. \fBupx \-t yourfile.exe\fR check whether your file can be safely +decompressed. Note, that this command doesn't check the whole file, only +the part that will be uncompressed during program execution. This means +that you should not use this command instead of a virus checker. +.SS "List" +.IX Subsection "List" +The \fB\-l\fR command prints out some information about the compressed files +specified on the command line as parameters, eg \fBupx \-l yourfile.exe\fR +shows the compressed / uncompressed size and the compression ratio of +\&\fIyourfile.exe\fR. +.SH "OPTIONS" +.IX Header "OPTIONS" +\&\fB\-q\fR: be quiet, suppress warnings +.PP +\&\fB\-q \-q\fR (or \fB\-qq\fR): be very quiet, suppress errors +.PP +\&\fB\-q \-q \-q\fR (or \fB\-qqq\fR): produce no output at all +.PP +\&\fB\-\-help\fR: prints the help +.PP +\&\fB\-\-version\fR: print the version of \fB\s-1UPX\s0\fR +.PP +\&\fB\-\-exact\fR: when compressing, require to be able to get a byte-identical file +after decompression with option \fB\-d\fR. [\s-1NOTE:\s0 this is work in progress and is +not supported for all formats yet. If you do care, as a workaround you can +compress and then decompress your program a first time \- any further +compress-decompress steps should then yield byte-identical results +as compared to the first decompressed version.] +.PP +[ ...to be written... \- type `\fBupx \-\-help\fR' for now ] +.SH "COMPRESSION LEVELS & TUNING" +.IX Header "COMPRESSION LEVELS & TUNING" +\&\fB\s-1UPX\s0\fR offers ten different compression levels from \fB\-1\fR to \fB\-9\fR, +and \fB\-\-best\fR. The default compression level is \fB\-8\fR for files +smaller than 512 KiB, and \fB\-7\fR otherwise. +.IP "\(bu" 4 +Compression levels 1, 2 and 3 are pretty fast. +.IP "\(bu" 4 +Compression levels 4, 5 and 6 achieve a good time/ratio performance. +.IP "\(bu" 4 +Compression levels 7, 8 and 9 favor compression ratio over speed. +.IP "\(bu" 4 +Compression level \fB\-\-best\fR may take a long time. +.PP +Note that compression level \fB\-\-best\fR can be somewhat slow for large +files, but you definitely should use it when releasing a final version +of your program. +.PP +Quick info for achieving the best compression ratio: +.IP "\(bu" 4 +Try \fBupx \-\-brute myfile.exe\fR or even \fBupx \-\-ultra\-brute myfile.exe\fR. +.IP "\(bu" 4 +Try if \fB\-\-overlay=strip\fR works. +.IP "\(bu" 4 +For win32/pe programs there's \fB\-\-strip\-relocs=0\fR. See notes below. +.SH "OVERLAY HANDLING OPTIONS" +.IX Header "OVERLAY HANDLING OPTIONS" +Info: An \*(L"overlay\*(R" means auxiliary data attached after the logical end of +an executable, and it often contains application specific data +(this is a common practice to avoid an extra data file, though +it would be better to use resource sections). +.PP +\&\fB\s-1UPX\s0\fR handles overlays like many other executable packers do: it simply +copies the overlay after the compressed image. This works with some +files, but doesn't work with others, depending on how an application +actually accesses this overlayed data. +.PP +.Vb 1 +\& \-\-overlay=copy Copy any extra data attached to the file. [DEFAULT] +\& +\& \-\-overlay=strip Strip any overlay from the program instead of +\& copying it. Be warned, this may make the compressed +\& program crash or otherwise unusable. +\& +\& \-\-overlay=skip Refuse to compress any program which has an overlay. +.Ve +.SH "ENVIRONMENT" +.IX Header "ENVIRONMENT" +The environment variable \fB\s-1UPX\s0\fR can hold a set of default +options for \fB\s-1UPX\s0\fR. These options are interpreted first and +can be overwritten by explicit command line parameters. +For example: +.PP +.Vb 3 +\& for DOS/Windows: set UPX=\-9 \-\-compress\-icons#0 +\& for sh/ksh/zsh: UPX="\-9 \-\-compress\-icons=0"; export UPX +\& for csh/tcsh: setenv UPX "\-9 \-\-compress\-icons=0" +.Ve +.PP +Under DOS/Windows you must use '#' instead of '=' when setting the +environment variable because of a \s-1COMMAND\s0.COM limitation. +.PP +Not all of the options are valid in the environment variable \- +\&\fB\s-1UPX\s0\fR will tell you. +.PP +You can explicitly use the \fB\-\-no\-env\fR option to ignore the +environment variable. +.SH "NOTES FOR THE SUPPORTED EXECUTABLE FORMATS" +.IX Header "NOTES FOR THE SUPPORTED EXECUTABLE FORMATS" +.SS "\s-1NOTES\s0 \s-1FOR\s0 \s-1ATARI/TOS\s0" +.IX Subsection "NOTES FOR ATARI/TOS" +This is the executable format used by the Atari \s-1ST/TT\s0, a Motorola 68000 +based personal computer which was popular in the late '80s. Support +of this format is only because of nostalgic feelings of one of +the authors and serves no practical purpose :\-). +See http://www.freemint.de for more info. +.PP +Packed programs will be byte-identical to the original after uncompression. +All debug information will be stripped, though. +.PP +Extra options available for this executable format: +.PP +.Vb 4 +\& \-\-all\-methods Compress the program several times, using all +\& available compression methods. This may improve +\& the compression ratio in some cases, but usually +\& the default method gives the best results anyway. +.Ve +.SS "\s-1NOTES\s0 \s-1FOR\s0 \s-1BVMLINUZ/I386\s0" +.IX Subsection "NOTES FOR BVMLINUZ/I386" +Same as vmlinuz/i386. +.SS "\s-1NOTES\s0 \s-1FOR\s0 \s-1DOS/COM\s0" +.IX Subsection "NOTES FOR DOS/COM" +Obviously \fB\s-1UPX\s0\fR won't work with executables that want to read data from +themselves (like some commandline utilities that ship with Win95/98/ME). +.PP +Compressed programs only work on a 286+. +.PP +Packed programs will be byte-identical to the original after uncompression. +.PP +Maximum uncompressed size: ~65100 bytes. +.PP +Extra options available for this executable format: +.PP +.Vb 1 +\& \-\-8086 Create an executable that works on any 8086 CPU. +\& +\& \-\-all\-methods Compress the program several times, using all +\& available compression methods. This may improve +\& the compression ratio in some cases, but usually +\& the default method gives the best results anyway. +\& +\& \-\-all\-filters Compress the program several times, using all +\& available preprocessing filters. This may improve +\& the compression ratio in some cases, but usually +\& the default filter gives the best results anyway. +.Ve +.SS "\s-1NOTES\s0 \s-1FOR\s0 \s-1DOS/EXE\s0" +.IX Subsection "NOTES FOR DOS/EXE" +dos/exe stands for all \*(L"normal\*(R" 16\-bit \s-1DOS\s0 executables. +.PP +Obviously \fB\s-1UPX\s0\fR won't work with executables that want to read data from +themselves (like some command line utilities that ship with Win95/98/ME). +.PP +Compressed programs only work on a 286+. +.PP +Extra options available for this executable format: +.PP +.Vb 1 +\& \-\-8086 Create an executable that works on any 8086 CPU. +\& +\& \-\-no\-reloc Use no relocation records in the exe header. +\& +\& \-\-all\-methods Compress the program several times, using all +\& available compression methods. This may improve +\& the compression ratio in some cases, but usually +\& the default method gives the best results anyway. +.Ve +.SS "\s-1NOTES\s0 \s-1FOR\s0 \s-1DOS/SYS\s0" +.IX Subsection "NOTES FOR DOS/SYS" +Compressed programs only work on a 286+. +.PP +Packed programs will be byte-identical to the original after uncompression. +.PP +Maximum uncompressed size: ~65350 bytes. +.PP +Extra options available for this executable format: +.PP +.Vb 1 +\& \-\-8086 Create an executable that works on any 8086 CPU. +\& +\& \-\-all\-methods Compress the program several times, using all +\& available compression methods. This may improve +\& the compression ratio in some cases, but usually +\& the default method gives the best results anyway. +\& +\& \-\-all\-filters Compress the program several times, using all +\& available preprocessing filters. This may improve +\& the compression ratio in some cases, but usually +\& the default filter gives the best results anyway. +.Ve +.SS "\s-1NOTES\s0 \s-1FOR\s0 \s-1DJGPP2/COFF\s0" +.IX Subsection "NOTES FOR DJGPP2/COFF" +First of all, it is recommended to use \fB\s-1UPX\s0\fR *instead* of \fBstrip\fR. strip has +the very bad habit of replacing your stub with its own (outdated) version. +Additionally \fB\s-1UPX\s0\fR corrects a bug/feature in strip v2.8.x: it +will fix the 4 KiB alignment of the stub. +.PP +\&\fB\s-1UPX\s0\fR includes the full functionality of stubify. This means it will +automatically stubify your \s-1COFF\s0 files. Use the option \fB\-\-coff\fR to +disable this functionality (see below). +.PP +\&\fB\s-1UPX\s0\fR automatically handles Allegro packfiles. +.PP +The \s-1DLM\s0 format (a rather exotic shared library extension) is not supported. +.PP +Packed programs will be byte-identical to the original after uncompression. +All debug information and trailing garbage will be stripped, though. +.PP +Extra options available for this executable format: +.PP +.Vb 2 +\& \-\-coff Produce COFF output instead of EXE. By default +\& UPX keeps your current stub. +\& +\& \-\-all\-methods Compress the program several times, using all +\& available compression methods. This may improve +\& the compression ratio in some cases, but usually +\& the default method gives the best results anyway. +\& +\& \-\-all\-filters Compress the program several times, using all +\& available preprocessing filters. This may improve +\& the compression ratio in some cases, but usually +\& the default filter gives the best results anyway. +.Ve +.SS "\s-1NOTES\s0 \s-1FOR\s0 \s-1LINUX\s0 [general]" +.IX Subsection "NOTES FOR LINUX [general]" +Introduction +.PP +.Vb 4 +\& Linux/386 support in UPX consists of 3 different executable formats, +\& one optimized for ELF executables ("linux/elf386"), one optimized +\& for shell scripts ("linux/sh386"), and one generic format +\& ("linux/386"). +\& +\& We will start with a general discussion first, but please +\& also read the relevant docs for each of the individual formats. +\& +\& Also, there is special support for bootable kernels \- see the +\& description of the vmlinuz/386 format. +.Ve +.PP +General user's overview +.PP +.Vb 7 +\& Running a compressed executable program trades less space on a +\& \`\`permanent\*(Aq\*(Aq storage medium (such as a hard disk, floppy disk, +\& CD\-ROM, flash memory, EPROM, etc.) for more space in one or more +\& \`\`temporary\*(Aq\*(Aq storage media (such as RAM, swap space, /tmp, etc.). +\& Running a compressed executable also requires some additional CPU +\& cycles to generate the compressed executable in the first place, +\& and to decompress it at each invocation. +\& +\& How much space is traded? It depends on the executable, but many +\& programs save 30% to 50% of permanent disk space. How much CPU +\& overhead is there? Again, it depends on the executable, but +\& decompression speed generally is at least many megabytes per second, +\& and frequently is limited by the speed of the underlying disk +\& or network I/O. +\& +\& Depending on the statistics of usage and access, and the relative +\& speeds of CPU, RAM, swap space, /tmp, and file system storage, then +\& invoking and running a compressed executable can be faster than +\& directly running the corresponding uncompressed program. +\& The operating system might perform fewer expensive I/O operations +\& to invoke the compressed program. Paging to or from swap space +\& or /tmp might be faster than paging from the general file system. +\& \`\`Medium\-sized\*(Aq\*(Aq programs which access about 1/3 to 1/2 of their +\& stored program bytes can do particularly well with compression. +\& Small programs tend not to benefit as much because the absolute +\& savings is less. Big programs tend not to benefit proportionally +\& because each invocation may use only a small fraction of the program, +\& yet UPX decompresses the entire program before invoking it. +\& But in environments where disk or flash memory storage is limited, +\& then compression may win anyway. +\& +\& Currently, executables compressed by UPX do not share RAM at runtime +\& in the way that executables mapped from a file system do. As a +\& result, if the same program is run simultaneously by more than one +\& process, then using the compressed version will require more RAM and/or +\& swap space. So, shell programs (bash, csh, etc.) and \`\`make\*(Aq\*(Aq +\& might not be good candidates for compression. +\& +\& UPX recognizes three executable formats for Linux: Linux/elf386, +\& Linux/sh386, and Linux/386. Linux/386 is the most generic format; +\& it accommodates any file that can be executed. At runtime, the UPX +\& decompression stub re\-creates in /tmp a copy of the original file, +\& and then the copy is (re\-)executed with the same arguments. +\& ELF binary executables prefer the Linux/elf386 format by default, +\& because UPX decompresses them directly into RAM, uses only one +\& exec, does not use space in /tmp, and does not use /proc. +\& Shell scripts where the underlying shell accepts a \`\`\-c\*(Aq\*(Aq argument +\& can use the Linux/sh386 format. UPX decompresses the shell script +\& into low memory, then maps the shell and passes the entire text of the +\& script as an argument with a leading \`\`\-c\*(Aq\*(Aq. +.Ve +.PP +General benefits: +.PP +.Vb 4 +\& \- UPX can compress all executables, be it AOUT, ELF, libc4, libc5, +\& libc6, Shell/Perl/Python/... scripts, standalone Java .class +\& binaries, or whatever... +\& All scripts and programs will work just as before. +\& +\& \- Compressed programs are completely self\-contained. No need for +\& any external program. +\& +\& \- UPX keeps your original program untouched. This means that +\& after decompression you will have a byte\-identical version, +\& and you can use UPX as a file compressor just like gzip. +\& [ Note that UPX maintains a checksum of the file internally, +\& so it is indeed a reliable alternative. ] +\& +\& \- As the stub only uses syscalls and isn\*(Aqt linked against libc it +\& should run under any Linux configuration that can run ELF +\& binaries. +\& +\& \- For the same reason compressed executables should run under +\& FreeBSD and other systems which can run Linux binaries. +\& [ Please send feedback on this topic ] +.Ve +.PP +General drawbacks: +.PP +.Vb 4 +\& \- It is not advisable to compress programs which usually have many +\& instances running (like \`sh\*(Aq or \`make\*(Aq) because the common segments of +\& compressed programs won\*(Aqt be shared any longer between different +\& processes. +\& +\& \- \`ldd\*(Aq and \`size\*(Aq won\*(Aqt show anything useful because all they +\& see is the statically linked stub. Since version 0.82 the section +\& headers are stripped from the UPX stub and \`size\*(Aq doesn\*(Aqt even +\& recognize the file format. The file patches/patch\-elfcode.h has a +\& patch to fix this bug in \`size\*(Aq and other programs which use GNU BFD. +.Ve +.PP +General notes: +.PP +.Vb 2 +\& \- As UPX leaves your original program untouched it is advantageous +\& to strip it before compression. +\& +\& \- If you compress a script you will lose platform independence \- +\& this could be a problem if you are using NFS mounted disks. +\& +\& \- Compression of suid, guid and sticky\-bit programs is rejected +\& because of possible security implications. +\& +\& \- For the same reason there is no sense in making any compressed +\& program suid. +\& +\& \- Obviously UPX won\*(Aqt work with executables that want to read data +\& from themselves. E.g., this might be a problem for Perl scripts +\& which access their _\|_DATA_\|_ lines. +\& +\& \- In case of internal errors the stub will abort with exitcode 127. +\& Typical reasons for this to happen are that the program has somehow +\& been modified after compression. +\& Running \`strace \-o strace.log compressed_file\*(Aq will tell you more. +.Ve +.SS "\s-1NOTES\s0 \s-1FOR\s0 \s-1LINUX/ELF386\s0" +.IX Subsection "NOTES FOR LINUX/ELF386" +Please read the general Linux description first. +.PP +The linux/elf386 format decompresses directly into \s-1RAM\s0, +uses only one exec, does not use space in /tmp, +and does not use /proc. +.PP +Linux/elf386 is automatically selected for Linux \s-1ELF\s0 executables. +.PP +Packed programs will be byte-identical to the original after uncompression. +.PP +How it works: +.PP +.Vb 9 +\& For ELF executables, UPX decompresses directly to memory, simulating +\& the mapping that the operating system kernel uses during exec(), +\& including the PT_INTERP program interpreter (if any). +\& The brk() is set by a special PT_LOAD segment in the compressed +\& executable itself. UPX then wipes the stack clean except for +\& arguments, environment variables, and Elf_auxv entries (this is +\& required by bugs in the startup code of /lib/ld\-linux.so as of +\& May 2000), and transfers control to the program interpreter or +\& the e_entry address of the original executable. +\& +\& The UPX stub is about 1700 bytes long, partly written in assembler +\& and only uses kernel syscalls. It is not linked against any libc. +.Ve +.PP +Specific drawbacks: +.PP +.Vb 9 +\& \- For linux/elf386 and linux/sh386 formats, you will be relying on +\& RAM and swap space to hold all of the decompressed program during +\& the lifetime of the process. If you already use most of your swap +\& space, then you may run out. A system that is "out of memory" +\& can become fragile. Many programs do not react gracefully when +\& malloc() returns 0. With newer Linux kernels, the kernel +\& may decide to kill some processes to regain memory, and you +\& may not like the kernel\*(Aqs choice of which to kill. Running +\& /usr/bin/top is one way to check on the usage of swap space. +.Ve +.PP +Extra options available for this executable format: +.PP +.Vb 1 +\& (none) +.Ve +.SS "\s-1NOTES\s0 \s-1FOR\s0 \s-1LINUX/SH386\s0" +.IX Subsection "NOTES FOR LINUX/SH386" +Please read the general Linux description first. +.PP +Shell scripts where the underling shell accepts a ``\-c'' argument +can use the Linux/sh386 format. \fB\s-1UPX\s0\fR decompresses the shell script +into low memory, then maps the shell and passes the entire text of the +script as an argument with a leading ``\-c''. +It does not use space in /tmp, and does not use /proc. +.PP +Linux/sh386 is automatically selected for shell scripts that +use a known shell. +.PP +Packed programs will be byte-identical to the original after uncompression. +.PP +How it works: +.PP +.Vb 8 +\& For shell script executables (files beginning with "#!/" or "#! /") +\& where the shell is known to accept "\-c ", UPX decompresses +\& the file into low memory, then maps the shell (and its PT_INTERP), +\& and passes control to the shell with the entire decompressed file +\& as the argument after "\-c". Known shells are sh, ash, bash, bsh, csh, +\& ksh, tcsh, pdksh. Restriction: UPX cannot use this method +\& for shell scripts which use the one optional string argument after +\& the shell name in the script (example: "#! /bin/sh option3\en".) +\& +\& The UPX stub is about 1700 bytes long, partly written in assembler +\& and only uses kernel syscalls. It is not linked against any libc. +.Ve +.PP +Specific drawbacks: +.PP +.Vb 9 +\& \- For linux/elf386 and linux/sh386 formats, you will be relying on +\& RAM and swap space to hold all of the decompressed program during +\& the lifetime of the process. If you already use most of your swap +\& space, then you may run out. A system that is "out of memory" +\& can become fragile. Many programs do not react gracefully when +\& malloc() returns 0. With newer Linux kernels, the kernel +\& may decide to kill some processes to regain memory, and you +\& may not like the kernel\*(Aqs choice of which to kill. Running +\& /usr/bin/top is one way to check on the usage of swap space. +.Ve +.PP +Extra options available for this executable format: +.PP +.Vb 1 +\& (none) +.Ve +.SS "\s-1NOTES\s0 \s-1FOR\s0 \s-1LINUX/386\s0" +.IX Subsection "NOTES FOR LINUX/386" +Please read the general Linux description first. +.PP +The generic linux/386 format decompresses to /tmp and needs +/proc file system support. It starts the decompressed program +via the \fIexecve()\fR syscall. +.PP +Linux/386 is only selected if the specialized linux/elf386 +and linux/sh386 won't recognize a file. +.PP +Packed programs will be byte-identical to the original after uncompression. +.PP +How it works: +.PP +.Vb 7 +\& For files which are not ELF and not a script for a known "\-c" shell, +\& UPX uses kernel execve(), which first requires decompressing to a +\& temporary file in the file system. Interestingly \- +\& because of the good memory management of the Linux kernel \- this +\& often does not introduce a noticeable delay, and in fact there +\& will be no disk access at all if you have enough free memory as +\& the entire process takes places within the file system buffers. +\& +\& A compressed executable consists of the UPX stub and an overlay +\& which contains the original program in a compressed form. +\& +\& The UPX stub is a statically linked ELF executable and does +\& the following at program startup: +\& +\& 1) decompress the overlay to a temporary location in /tmp +\& 2) open the temporary file for reading +\& 3) try to delete the temporary file and start (execve) +\& the uncompressed program in /tmp using /proc//fd/X as +\& attained by step 2) +\& 4) if that fails, fork off a subprocess to clean up and +\& start the program in /tmp in the meantime +\& +\& The UPX stub is about 1700 bytes long, partly written in assembler +\& and only uses kernel syscalls. It is not linked against any libc. +.Ve +.PP +Specific drawbacks: +.PP +.Vb 4 +\& \- You need additional free disk space for the uncompressed program +\& in your /tmp directory. This program is deleted immediately after +\& decompression, but you still need it for the full execution time +\& of the program. +\& +\& \- You must have /proc file system support as the stub wants to open +\& /proc//exe and needs /proc//fd/X. This also means that you +\& cannot compress programs that are used during the boot sequence +\& before /proc is mounted. +\& +\& \- Utilities like \`top\*(Aq will display numerical values in the process +\& name field. This is because Linux computes the process name from +\& the first argument of the last execve syscall (which is typically +\& something like /proc//fd/3). +\& +\& \- Because of temporary decompression to disk the decompression speed +\& is not as fast as with the other executable formats. Still, I can see +\& no noticeable delay when starting programs like my ~3 MiB emacs (which +\& is less than 1 MiB when compressed :\-). +.Ve +.PP +Extra options available for this executable format: +.PP +.Vb 3 +\& \-\-force\-execve Force the use of the generic linux/386 "execve" +\& format, i.e. do not try the linux/elf386 and +\& linux/sh386 formats. +.Ve +.SS "\s-1NOTES\s0 \s-1FOR\s0 \s-1PS1/EXE\s0" +.IX Subsection "NOTES FOR PS1/EXE" +This is the executable format used by the Sony PlayStation (PSone), +a Mips R3000 based gaming console which is popular since the late '90s. +Support of this format is very similar to the Atari one, because of +nostalgic feelings of one of the authors. +.PP +Packed programs will be byte-identical to the original after uncompression, +until further notice. +.PP +Maximum uncompressed size: ~1.89 / ~7.60 MiB. +.PP +Notes: +.PP +.Vb 6 +\& \- UPX creates as default a suitable executable for CD\-Mastering +\& and console transfer. For a CD\-Master main executable you could also try +\& the special option "\-\-boot\-only" as described below. +\& It has been reported that upx packed executables are fully compatible with +\& the Sony PlayStation 2 (PS2, PStwo) and Sony PlayStation Portable (PSP) in +\& Sony PlayStation (PSone) emulation mode. +\& +\& \- Normally the packed files use the same memory areas like the uncompressed +\& versions, so they will not override other memory areas while unpacking. +\& If this isn\*(Aqt possible UPX will abort showing a \*(Aqpacked data overlap\*(Aq +\& error. With the "\-\-force" option UPX will relocate the loading address +\& for the packed file, but this isn\*(Aqt a real problem if it is a single or +\& the main executable. +.Ve +.PP +Extra options available for this executable format: +.PP +.Vb 4 +\& \-\-all\-methods Compress the program several times, using all +\& available compression methods. This may improve +\& the compression ratio in some cases, but usually +\& the default method gives the best results anyway. +\& +\& \-\-8\-bit Uses 8 bit size compression [default: 32 bit] +\& +\& \-\-8mib\-ram PSone has 8 MiB ram available [default: 2 MiB] +\& +\& \-\-boot\-only This format is for main exes and CD\-Mastering only ! +\& It may slightly improve the compression ratio, +\& decompression routines are faster than default ones. +\& But it cannot be used for console transfer ! +\& +\& \-\-no\-align This option disables CD mode 2 data sector format +\& alignment. May slightly improves the compression ratio, +\& but the compressed executable will not boot from a CD. +\& Use it for console transfer only ! +.Ve +.SS "\s-1NOTES\s0 \s-1FOR\s0 \s-1RTM32/PE\s0 and \s-1ARM/PE\s0" +.IX Subsection "NOTES FOR RTM32/PE and ARM/PE" +Same as win32/pe. +.SS "\s-1NOTES\s0 \s-1FOR\s0 \s-1TMT/ADAM\s0" +.IX Subsection "NOTES FOR TMT/ADAM" +This format is used by the \s-1TMT\s0 Pascal compiler \- see http://www.tmt.com/ . +.PP +Extra options available for this executable format: +.PP +.Vb 4 +\& \-\-all\-methods Compress the program several times, using all +\& available compression methods. This may improve +\& the compression ratio in some cases, but usually +\& the default method gives the best results anyway. +\& +\& \-\-all\-filters Compress the program several times, using all +\& available preprocessing filters. This may improve +\& the compression ratio in some cases, but usually +\& the default filter gives the best results anyway. +.Ve +.SS "\s-1NOTES\s0 \s-1FOR\s0 \s-1VMLINUZ/386\s0" +.IX Subsection "NOTES FOR VMLINUZ/386" +The vmlinuz/386 and bvmlinuz/386 formats take a gzip-compressed +bootable Linux kernel image (\*(L"vmlinuz\*(R", \*(L"zImage\*(R", \*(L"bzImage\*(R"), +gzip-decompress it and re-compress it with the \fB\s-1UPX\s0\fR compression method. +.PP +vmlinuz/386 is completely unrelated to the other Linux executable +formats, and it does not share any of their drawbacks. +.PP +Notes: +.PP +.Vb 3 +\& \- Be sure that "vmlinuz/386" or "bvmlinuz/386" is displayed +\& during compression \- otherwise a wrong executable format +\& may have been used, and the kernel won\*(Aqt boot. +.Ve +.PP +Benefits: +.PP +.Vb 4 +\& \- Better compression (but note that the kernel was already compressed, +\& so the improvement is not as large as with other formats). +\& Still, the bytes saved may be essential for special needs like +\& boot disks. +\& +\& For example, this is what I get for my 2.2.16 kernel: +\& 1589708 vmlinux +\& 641073 bzImage [original] +\& 560755 bzImage.upx [compressed by "upx \-9"] +\& +\& \- Much faster decompression at kernel boot time (but kernel +\& decompression speed is not really an issue these days). +.Ve +.PP +Drawbacks: +.PP +.Vb 1 +\& (none) +.Ve +.PP +Extra options available for this executable format: +.PP +.Vb 4 +\& \-\-all\-methods Compress the program several times, using all +\& available compression methods. This may improve +\& the compression ratio in some cases, but usually +\& the default method gives the best results anyway. +\& +\& \-\-all\-filters Compress the program several times, using all +\& available preprocessing filters. This may improve +\& the compression ratio in some cases, but usually +\& the default filter gives the best results anyway. +.Ve +.SS "\s-1NOTES\s0 \s-1FOR\s0 \s-1WATCOM/LE\s0" +.IX Subsection "NOTES FOR WATCOM/LE" +\&\fB\s-1UPX\s0\fR has been successfully tested with the following extenders: + \s-1DOS4G\s0, \s-1DOS4GW\s0, \s-1PMODE/W\s0, DOS32a, CauseWay. + The \s-1WDOS/X\s0 extender is partly supported (for details + see the file bugs \s-1BUGS\s0). +.PP +DLLs and the \s-1LX\s0 format are not supported. +.PP +Extra options available for this executable format: +.PP +.Vb 2 +\& \-\-le Produce an unbound LE output instead of +\& keeping the current stub. +.Ve +.SS "\s-1NOTES\s0 \s-1FOR\s0 \s-1WIN32/PE\s0" +.IX Subsection "NOTES FOR WIN32/PE" +The \s-1PE\s0 support in \fB\s-1UPX\s0\fR is quite stable now, but probably there are +still some incompatibilities with some files. +.PP +Because of the way \fB\s-1UPX\s0\fR (and other packers for this format) works, you +can see increased memory usage of your compressed files because the whole +program is loaded into memory at startup. +If you start several instances of huge compressed programs you're +wasting memory because the common segments of the program won't +get shared across the instances. +On the other hand if you're compressing only smaller programs, or +running only one instance of larger programs, then this penalty is +smaller, but it's still there. +.PP +If you're running executables from network, then compressed programs +will load faster, and require less bandwidth during execution. +.PP +DLLs are supported. But \s-1UPX\s0 compressed DLLs can not share common data and +code when they got used by multiple applications. So compressing msvcrt.dll +is a waste of memory, but compressing the dll plugins of a particular +application may be a better idea. +.PP +Screensavers are supported, with the restriction that the filename +must end with \*(L".scr\*(R" (as screensavers are handled slightly different +than normal exe files). +.PP +\&\s-1UPX\s0 compressed \s-1PE\s0 files have some minor memory overhead (usually in the +10 \- 30 KiB range) which can be seen by specifying the \*(L"\-i\*(R" command +line switch during compression. +.PP +Extra options available for this executable format: +.PP +.Vb 9 +\& \-\-compress\-exports=0 Don\*(Aqt compress the export section. +\& Use this if you plan to run the compressed +\& program under Wine. +\& \-\-compress\-exports=1 Compress the export section. [DEFAULT] +\& Compression of the export section can improve the +\& compression ratio quite a bit but may not work +\& with all programs (like winword.exe). +\& UPX never compresses the export section of a DLL +\& regardless of this option. +\& +\& \-\-compress\-icons=0 Don\*(Aqt compress any icons. +\& \-\-compress\-icons=1 Compress all but the first icon. +\& \-\-compress\-icons=2 Compress all icons which are not in the +\& first icon directory. [DEFAULT] +\& \-\-compress\-icons=3 Compress all icons. +\& +\& \-\-compress\-resources=0 Don\*(Aqt compress any resources at all. +\& +\& \-\-keep\-resource=list Don\*(Aqt compress resources specified by the list. +\& The members of the list are separated by commas. +\& A list member has the following format: I. +\& I is the type of the resource. Standard types +\& must be specified as decimal numbers, user types can be +\& specified by decimal IDs or strings. I is the +\& identifier of the resource. It can be a decimal number +\& or a string. For example: +\& +\& \-\-keep\-resource=2/MYBITMAP,5,6/12345 +\& +\& UPX won\*(Aqt compress the named bitmap resource "MYBITMAP", +\& it leaves every dialog (5) resource uncompressed, and +\& it won\*(Aqt touch the string table resource with identifier +\& 12345. +\& +\& \-\-force Force compression even when there is an +\& unexpected value in a header field. +\& Use with care. +\& +\& \-\-strip\-relocs=0 Don\*(Aqt strip relocation records. +\& \-\-strip\-relocs=1 Strip relocation records. [DEFAULT] +\& This option only works on executables with base +\& address greater or equal to 0x400000. Usually the +\& compressed files becomes smaller, but some files +\& may become larger. Note that the resulting file will +\& not work under Windows 3.x (Win32s). +\& UPX never strips relocations from a DLL +\& regardless of this option. +\& +\& \-\-all\-methods Compress the program several times, using all +\& available compression methods. This may improve +\& the compression ratio in some cases, but usually +\& the default method gives the best results anyway. +\& +\& \-\-all\-filters Compress the program several times, using all +\& available preprocessing filters. This may improve +\& the compression ratio in some cases, but usually +\& the default filter gives the best results anyway. +.Ve +.SH "DIAGNOSTICS" +.IX Header "DIAGNOSTICS" +Exit status is normally 0; if an error occurs, exit status +is 1. If a warning occurs, exit status is 2. +.PP +\&\fB\s-1UPX\s0\fR's diagnostics are intended to be self-explanatory. +.SH "BUGS" +.IX Header "BUGS" +Please report all bugs immediately to the authors. +.SH "AUTHORS" +.IX Header "AUTHORS" +.Vb 2 +\& Markus F.X.J. Oberhumer +\& http://www.oberhumer.com +\& +\& Laszlo Molnar +\& +\& John F. Reiser +\& +\& Jens Medoch +.Ve +.SH "COPYRIGHT" +.IX Header "COPYRIGHT" +Copyright (C) 1996\-2013 Markus Franz Xaver Johannes Oberhumer +.PP +Copyright (C) 1996\-2013 Laszlo Molnar +.PP +Copyright (C) 2000\-2013 John F. Reiser +.PP +Copyright (C) 2002\-2013 Jens Medoch +.PP +This program may be used freely, and you are welcome to +redistribute it under certain conditions. +.PP +This program is distributed in the hope that it will be useful, +but \s-1WITHOUT\s0 \s-1ANY\s0 \s-1WARRANTY\s0; without even the implied warranty of +\&\s-1MERCHANTABILITY\s0 or \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0. See the +\&\fB\s-1UPX\s0 License Agreement\fR for more details. +.PP +You should have received a copy of the \s-1UPX\s0 License Agreement along +with this program; see the file \s-1LICENSE\s0. If not, visit the \s-1UPX\s0 home page. diff --git a/Tools/UPX/upx.doc b/Tools/UPX/upx.doc new file mode 100644 index 00000000..cc6f7e27 --- /dev/null +++ b/Tools/UPX/upx.doc @@ -0,0 +1,843 @@ +NAME + upx - compress or expand executable files + +SYNOPSIS + upx [ *command* ] [ *options* ] *filename*... + +ABSTRACT + The Ultimate Packer for eXecutables + Copyright (c) 1996-2013 Markus Oberhumer, Laszlo Molnar & John Reiser + http://upx.sourceforge.net + + UPX is a portable, extendable, high-performance executable packer for + several different executable formats. It achieves an excellent + compression ratio and offers **very** fast decompression. Your + executables suffer no memory overhead or other drawbacks for most of the + formats supported, because of in-place decompression. + + While you may use UPX freely for both non-commercial and commercial + executables (for details see the file LICENSE), we would highly + appreciate if you credit UPX and ourselves in the documentation, + possibly including a reference to the UPX home page. Thanks. + + [ Using UPX in non-OpenSource applications without proper credits is + considered not politically correct ;-) ] + +DISCLAIMER + UPX comes with ABSOLUTELY NO WARRANTY; for details see the file LICENSE. + + This is the first production quality release, and we plan that future + 1.xx releases will be backward compatible with this version. + + Please report all problems or suggestions to the authors. Thanks. + +DESCRIPTION + UPX is a versatile executable packer with the following features: + + - excellent compression ratio: compresses better than zip/gzip, + use UPX to decrease the size of your distribution ! + + - very fast decompression: about 10 MiB/sec on an ancient Pentium 133, + about 200 MiB/sec on an Athlon XP 2000+. + + - no memory overhead for your compressed executables for most of the + supported formats + + - safe: you can list, test and unpack your executables + Also, a checksum of both the compressed and uncompressed file is + maintained internally. + + - universal: UPX can pack a number of executable formats: + * atari/tos + * bvmlinuz/386 [bootable Linux kernel] + * djgpp2/coff + * dos/com + * dos/exe + * dos/sys + * linux/386 + * linux/elf386 + * linux/sh386 + * ps1/exe + * rtm32/pe + * tmt/adam + * vmlinuz/386 [bootable Linux kernel] + * vmlinux/386 + * watcom/le (supporting DOS4G, PMODE/W, DOS32a and CauseWay) + * win32/pe (exe and dll) + * arm/pe (exe and dll) + * linux/elfamd64 + * linux/elfppc32 + * mach/elfppc32 + + - portable: UPX is written in portable endian-neutral C++ + + - extendable: because of the class layout it's very easy to support + new executable formats or add new compression algorithms + + - free: UPX can be distributed and used freely. And from version 0.99 + the full source code of UPX is released under the GNU General Public + License (GPL) ! + + You probably understand now why we call UPX the "*ultimate*" executable + packer. + +COMMANDS + Compress + This is the default operation, eg. upx yourfile.exe will compress the + file specified on the command line. + + Decompress + All UPX supported file formats can be unpacked using the -d switch, eg. + upx -d yourfile.exe will uncompress the file you've just compressed. + + Test + The -t command tests the integrity of the compressed and uncompressed + data, eg. upx -t yourfile.exe check whether your file can be safely + decompressed. Note, that this command doesn't check the whole file, only + the part that will be uncompressed during program execution. This means + that you should not use this command instead of a virus checker. + + List + The -l command prints out some information about the compressed files + specified on the command line as parameters, eg upx -l yourfile.exe + shows the compressed / uncompressed size and the compression ratio of + *yourfile.exe*. + +OPTIONS + -q: be quiet, suppress warnings + + -q -q (or -qq): be very quiet, suppress errors + + -q -q -q (or -qqq): produce no output at all + + --help: prints the help + + --version: print the version of UPX + + --exact: when compressing, require to be able to get a byte-identical + file after decompression with option -d. [NOTE: this is work in progress + and is not supported for all formats yet. If you do care, as a + workaround you can compress and then decompress your program a first + time - any further compress-decompress steps should then yield + byte-identical results as compared to the first decompressed version.] + + [ ...to be written... - type `upx --help' for now ] + +COMPRESSION LEVELS & TUNING + UPX offers ten different compression levels from -1 to -9, and --best. + The default compression level is -8 for files smaller than 512 KiB, and + -7 otherwise. + + * Compression levels 1, 2 and 3 are pretty fast. + + * Compression levels 4, 5 and 6 achieve a good time/ratio performance. + + * Compression levels 7, 8 and 9 favor compression ratio over speed. + + * Compression level --best may take a long time. + + Note that compression level --best can be somewhat slow for large files, + but you definitely should use it when releasing a final version of your + program. + + Quick info for achieving the best compression ratio: + + * Try upx --brute myfile.exe or even upx --ultra-brute myfile.exe. + + * Try if --overlay=strip works. + + * For win32/pe programs there's --strip-relocs=0. See notes below. + +OVERLAY HANDLING OPTIONS + Info: An "overlay" means auxiliary data attached after the logical end + of an executable, and it often contains application specific data (this + is a common practice to avoid an extra data file, though it would be + better to use resource sections). + + UPX handles overlays like many other executable packers do: it simply + copies the overlay after the compressed image. This works with some + files, but doesn't work with others, depending on how an application + actually accesses this overlayed data. + + --overlay=copy Copy any extra data attached to the file. [DEFAULT] + + --overlay=strip Strip any overlay from the program instead of + copying it. Be warned, this may make the compressed + program crash or otherwise unusable. + + --overlay=skip Refuse to compress any program which has an overlay. + +ENVIRONMENT + The environment variable UPX can hold a set of default options for UPX. + These options are interpreted first and can be overwritten by explicit + command line parameters. For example: + + for DOS/Windows: set UPX=-9 --compress-icons#0 + for sh/ksh/zsh: UPX="-9 --compress-icons=0"; export UPX + for csh/tcsh: setenv UPX "-9 --compress-icons=0" + + Under DOS/Windows you must use '#' instead of '=' when setting the + environment variable because of a COMMAND.COM limitation. + + Not all of the options are valid in the environment variable - UPX will + tell you. + + You can explicitly use the --no-env option to ignore the environment + variable. + +NOTES FOR THE SUPPORTED EXECUTABLE FORMATS + NOTES FOR ATARI/TOS + This is the executable format used by the Atari ST/TT, a Motorola 68000 + based personal computer which was popular in the late '80s. Support of + this format is only because of nostalgic feelings of one of the authors + and serves no practical purpose :-). See http://www.freemint.de for more + info. + + Packed programs will be byte-identical to the original after + uncompression. All debug information will be stripped, though. + + Extra options available for this executable format: + + --all-methods Compress the program several times, using all + available compression methods. This may improve + the compression ratio in some cases, but usually + the default method gives the best results anyway. + + NOTES FOR BVMLINUZ/I386 + Same as vmlinuz/i386. + + NOTES FOR DOS/COM + Obviously UPX won't work with executables that want to read data from + themselves (like some commandline utilities that ship with Win95/98/ME). + + Compressed programs only work on a 286+. + + Packed programs will be byte-identical to the original after + uncompression. + + Maximum uncompressed size: ~65100 bytes. + + Extra options available for this executable format: + + --8086 Create an executable that works on any 8086 CPU. + + --all-methods Compress the program several times, using all + available compression methods. This may improve + the compression ratio in some cases, but usually + the default method gives the best results anyway. + + --all-filters Compress the program several times, using all + available preprocessing filters. This may improve + the compression ratio in some cases, but usually + the default filter gives the best results anyway. + + NOTES FOR DOS/EXE + dos/exe stands for all "normal" 16-bit DOS executables. + + Obviously UPX won't work with executables that want to read data from + themselves (like some command line utilities that ship with + Win95/98/ME). + + Compressed programs only work on a 286+. + + Extra options available for this executable format: + + --8086 Create an executable that works on any 8086 CPU. + + --no-reloc Use no relocation records in the exe header. + + --all-methods Compress the program several times, using all + available compression methods. This may improve + the compression ratio in some cases, but usually + the default method gives the best results anyway. + + NOTES FOR DOS/SYS + Compressed programs only work on a 286+. + + Packed programs will be byte-identical to the original after + uncompression. + + Maximum uncompressed size: ~65350 bytes. + + Extra options available for this executable format: + + --8086 Create an executable that works on any 8086 CPU. + + --all-methods Compress the program several times, using all + available compression methods. This may improve + the compression ratio in some cases, but usually + the default method gives the best results anyway. + + --all-filters Compress the program several times, using all + available preprocessing filters. This may improve + the compression ratio in some cases, but usually + the default filter gives the best results anyway. + + NOTES FOR DJGPP2/COFF + First of all, it is recommended to use UPX *instead* of strip. strip has + the very bad habit of replacing your stub with its own (outdated) + version. Additionally UPX corrects a bug/feature in strip v2.8.x: it + will fix the 4 KiB alignment of the stub. + + UPX includes the full functionality of stubify. This means it will + automatically stubify your COFF files. Use the option --coff to disable + this functionality (see below). + + UPX automatically handles Allegro packfiles. + + The DLM format (a rather exotic shared library extension) is not + supported. + + Packed programs will be byte-identical to the original after + uncompression. All debug information and trailing garbage will be + stripped, though. + + Extra options available for this executable format: + + --coff Produce COFF output instead of EXE. By default + UPX keeps your current stub. + + --all-methods Compress the program several times, using all + available compression methods. This may improve + the compression ratio in some cases, but usually + the default method gives the best results anyway. + + --all-filters Compress the program several times, using all + available preprocessing filters. This may improve + the compression ratio in some cases, but usually + the default filter gives the best results anyway. + + NOTES FOR LINUX [general] + Introduction + + Linux/386 support in UPX consists of 3 different executable formats, + one optimized for ELF executables ("linux/elf386"), one optimized + for shell scripts ("linux/sh386"), and one generic format + ("linux/386"). + + We will start with a general discussion first, but please + also read the relevant docs for each of the individual formats. + + Also, there is special support for bootable kernels - see the + description of the vmlinuz/386 format. + + General user's overview + + Running a compressed executable program trades less space on a + ``permanent'' storage medium (such as a hard disk, floppy disk, + CD-ROM, flash memory, EPROM, etc.) for more space in one or more + ``temporary'' storage media (such as RAM, swap space, /tmp, etc.). + Running a compressed executable also requires some additional CPU + cycles to generate the compressed executable in the first place, + and to decompress it at each invocation. + + How much space is traded? It depends on the executable, but many + programs save 30% to 50% of permanent disk space. How much CPU + overhead is there? Again, it depends on the executable, but + decompression speed generally is at least many megabytes per second, + and frequently is limited by the speed of the underlying disk + or network I/O. + + Depending on the statistics of usage and access, and the relative + speeds of CPU, RAM, swap space, /tmp, and file system storage, then + invoking and running a compressed executable can be faster than + directly running the corresponding uncompressed program. + The operating system might perform fewer expensive I/O operations + to invoke the compressed program. Paging to or from swap space + or /tmp might be faster than paging from the general file system. + ``Medium-sized'' programs which access about 1/3 to 1/2 of their + stored program bytes can do particularly well with compression. + Small programs tend not to benefit as much because the absolute + savings is less. Big programs tend not to benefit proportionally + because each invocation may use only a small fraction of the program, + yet UPX decompresses the entire program before invoking it. + But in environments where disk or flash memory storage is limited, + then compression may win anyway. + + Currently, executables compressed by UPX do not share RAM at runtime + in the way that executables mapped from a file system do. As a + result, if the same program is run simultaneously by more than one + process, then using the compressed version will require more RAM and/or + swap space. So, shell programs (bash, csh, etc.) and ``make'' + might not be good candidates for compression. + + UPX recognizes three executable formats for Linux: Linux/elf386, + Linux/sh386, and Linux/386. Linux/386 is the most generic format; + it accommodates any file that can be executed. At runtime, the UPX + decompression stub re-creates in /tmp a copy of the original file, + and then the copy is (re-)executed with the same arguments. + ELF binary executables prefer the Linux/elf386 format by default, + because UPX decompresses them directly into RAM, uses only one + exec, does not use space in /tmp, and does not use /proc. + Shell scripts where the underlying shell accepts a ``-c'' argument + can use the Linux/sh386 format. UPX decompresses the shell script + into low memory, then maps the shell and passes the entire text of the + script as an argument with a leading ``-c''. + + General benefits: + + - UPX can compress all executables, be it AOUT, ELF, libc4, libc5, + libc6, Shell/Perl/Python/... scripts, standalone Java .class + binaries, or whatever... + All scripts and programs will work just as before. + + - Compressed programs are completely self-contained. No need for + any external program. + + - UPX keeps your original program untouched. This means that + after decompression you will have a byte-identical version, + and you can use UPX as a file compressor just like gzip. + [ Note that UPX maintains a checksum of the file internally, + so it is indeed a reliable alternative. ] + + - As the stub only uses syscalls and isn't linked against libc it + should run under any Linux configuration that can run ELF + binaries. + + - For the same reason compressed executables should run under + FreeBSD and other systems which can run Linux binaries. + [ Please send feedback on this topic ] + + General drawbacks: + + - It is not advisable to compress programs which usually have many + instances running (like `sh' or `make') because the common segments of + compressed programs won't be shared any longer between different + processes. + + - `ldd' and `size' won't show anything useful because all they + see is the statically linked stub. Since version 0.82 the section + headers are stripped from the UPX stub and `size' doesn't even + recognize the file format. The file patches/patch-elfcode.h has a + patch to fix this bug in `size' and other programs which use GNU BFD. + + General notes: + + - As UPX leaves your original program untouched it is advantageous + to strip it before compression. + + - If you compress a script you will lose platform independence - + this could be a problem if you are using NFS mounted disks. + + - Compression of suid, guid and sticky-bit programs is rejected + because of possible security implications. + + - For the same reason there is no sense in making any compressed + program suid. + + - Obviously UPX won't work with executables that want to read data + from themselves. E.g., this might be a problem for Perl scripts + which access their __DATA__ lines. + + - In case of internal errors the stub will abort with exitcode 127. + Typical reasons for this to happen are that the program has somehow + been modified after compression. + Running `strace -o strace.log compressed_file' will tell you more. + + NOTES FOR LINUX/ELF386 + Please read the general Linux description first. + + The linux/elf386 format decompresses directly into RAM, uses only one + exec, does not use space in /tmp, and does not use /proc. + + Linux/elf386 is automatically selected for Linux ELF executables. + + Packed programs will be byte-identical to the original after + uncompression. + + How it works: + + For ELF executables, UPX decompresses directly to memory, simulating + the mapping that the operating system kernel uses during exec(), + including the PT_INTERP program interpreter (if any). + The brk() is set by a special PT_LOAD segment in the compressed + executable itself. UPX then wipes the stack clean except for + arguments, environment variables, and Elf_auxv entries (this is + required by bugs in the startup code of /lib/ld-linux.so as of + May 2000), and transfers control to the program interpreter or + the e_entry address of the original executable. + + The UPX stub is about 1700 bytes long, partly written in assembler + and only uses kernel syscalls. It is not linked against any libc. + + Specific drawbacks: + + - For linux/elf386 and linux/sh386 formats, you will be relying on + RAM and swap space to hold all of the decompressed program during + the lifetime of the process. If you already use most of your swap + space, then you may run out. A system that is "out of memory" + can become fragile. Many programs do not react gracefully when + malloc() returns 0. With newer Linux kernels, the kernel + may decide to kill some processes to regain memory, and you + may not like the kernel's choice of which to kill. Running + /usr/bin/top is one way to check on the usage of swap space. + + Extra options available for this executable format: + + (none) + + NOTES FOR LINUX/SH386 + Please read the general Linux description first. + + Shell scripts where the underling shell accepts a ``-c'' argument can + use the Linux/sh386 format. UPX decompresses the shell script into low + memory, then maps the shell and passes the entire text of the script as + an argument with a leading ``-c''. It does not use space in /tmp, and + does not use /proc. + + Linux/sh386 is automatically selected for shell scripts that use a known + shell. + + Packed programs will be byte-identical to the original after + uncompression. + + How it works: + + For shell script executables (files beginning with "#!/" or "#! /") + where the shell is known to accept "-c ", UPX decompresses + the file into low memory, then maps the shell (and its PT_INTERP), + and passes control to the shell with the entire decompressed file + as the argument after "-c". Known shells are sh, ash, bash, bsh, csh, + ksh, tcsh, pdksh. Restriction: UPX cannot use this method + for shell scripts which use the one optional string argument after + the shell name in the script (example: "#! /bin/sh option3\n".) + + The UPX stub is about 1700 bytes long, partly written in assembler + and only uses kernel syscalls. It is not linked against any libc. + + Specific drawbacks: + + - For linux/elf386 and linux/sh386 formats, you will be relying on + RAM and swap space to hold all of the decompressed program during + the lifetime of the process. If you already use most of your swap + space, then you may run out. A system that is "out of memory" + can become fragile. Many programs do not react gracefully when + malloc() returns 0. With newer Linux kernels, the kernel + may decide to kill some processes to regain memory, and you + may not like the kernel's choice of which to kill. Running + /usr/bin/top is one way to check on the usage of swap space. + + Extra options available for this executable format: + + (none) + + NOTES FOR LINUX/386 + Please read the general Linux description first. + + The generic linux/386 format decompresses to /tmp and needs /proc file + system support. It starts the decompressed program via the execve() + syscall. + + Linux/386 is only selected if the specialized linux/elf386 and + linux/sh386 won't recognize a file. + + Packed programs will be byte-identical to the original after + uncompression. + + How it works: + + For files which are not ELF and not a script for a known "-c" shell, + UPX uses kernel execve(), which first requires decompressing to a + temporary file in the file system. Interestingly - + because of the good memory management of the Linux kernel - this + often does not introduce a noticeable delay, and in fact there + will be no disk access at all if you have enough free memory as + the entire process takes places within the file system buffers. + + A compressed executable consists of the UPX stub and an overlay + which contains the original program in a compressed form. + + The UPX stub is a statically linked ELF executable and does + the following at program startup: + + 1) decompress the overlay to a temporary location in /tmp + 2) open the temporary file for reading + 3) try to delete the temporary file and start (execve) + the uncompressed program in /tmp using /proc//fd/X as + attained by step 2) + 4) if that fails, fork off a subprocess to clean up and + start the program in /tmp in the meantime + + The UPX stub is about 1700 bytes long, partly written in assembler + and only uses kernel syscalls. It is not linked against any libc. + + Specific drawbacks: + + - You need additional free disk space for the uncompressed program + in your /tmp directory. This program is deleted immediately after + decompression, but you still need it for the full execution time + of the program. + + - You must have /proc file system support as the stub wants to open + /proc//exe and needs /proc//fd/X. This also means that you + cannot compress programs that are used during the boot sequence + before /proc is mounted. + + - Utilities like `top' will display numerical values in the process + name field. This is because Linux computes the process name from + the first argument of the last execve syscall (which is typically + something like /proc//fd/3). + + - Because of temporary decompression to disk the decompression speed + is not as fast as with the other executable formats. Still, I can see + no noticeable delay when starting programs like my ~3 MiB emacs (which + is less than 1 MiB when compressed :-). + + Extra options available for this executable format: + + --force-execve Force the use of the generic linux/386 "execve" + format, i.e. do not try the linux/elf386 and + linux/sh386 formats. + + NOTES FOR PS1/EXE + This is the executable format used by the Sony PlayStation (PSone), a + Mips R3000 based gaming console which is popular since the late '90s. + Support of this format is very similar to the Atari one, because of + nostalgic feelings of one of the authors. + + Packed programs will be byte-identical to the original after + uncompression, until further notice. + + Maximum uncompressed size: ~1.89 / ~7.60 MiB. + + Notes: + + - UPX creates as default a suitable executable for CD-Mastering + and console transfer. For a CD-Master main executable you could also try + the special option "--boot-only" as described below. + It has been reported that upx packed executables are fully compatible with + the Sony PlayStation 2 (PS2, PStwo) and Sony PlayStation Portable (PSP) in + Sony PlayStation (PSone) emulation mode. + + - Normally the packed files use the same memory areas like the uncompressed + versions, so they will not override other memory areas while unpacking. + If this isn't possible UPX will abort showing a 'packed data overlap' + error. With the "--force" option UPX will relocate the loading address + for the packed file, but this isn't a real problem if it is a single or + the main executable. + + Extra options available for this executable format: + + --all-methods Compress the program several times, using all + available compression methods. This may improve + the compression ratio in some cases, but usually + the default method gives the best results anyway. + + --8-bit Uses 8 bit size compression [default: 32 bit] + + --8mib-ram PSone has 8 MiB ram available [default: 2 MiB] + + --boot-only This format is for main exes and CD-Mastering only ! + It may slightly improve the compression ratio, + decompression routines are faster than default ones. + But it cannot be used for console transfer ! + + --no-align This option disables CD mode 2 data sector format + alignment. May slightly improves the compression ratio, + but the compressed executable will not boot from a CD. + Use it for console transfer only ! + + NOTES FOR RTM32/PE and ARM/PE + Same as win32/pe. + + NOTES FOR TMT/ADAM + This format is used by the TMT Pascal compiler - see http://www.tmt.com/ + . + + Extra options available for this executable format: + + --all-methods Compress the program several times, using all + available compression methods. This may improve + the compression ratio in some cases, but usually + the default method gives the best results anyway. + + --all-filters Compress the program several times, using all + available preprocessing filters. This may improve + the compression ratio in some cases, but usually + the default filter gives the best results anyway. + + NOTES FOR VMLINUZ/386 + The vmlinuz/386 and bvmlinuz/386 formats take a gzip-compressed bootable + Linux kernel image ("vmlinuz", "zImage", "bzImage"), gzip-decompress it + and re-compress it with the UPX compression method. + + vmlinuz/386 is completely unrelated to the other Linux executable + formats, and it does not share any of their drawbacks. + + Notes: + + - Be sure that "vmlinuz/386" or "bvmlinuz/386" is displayed + during compression - otherwise a wrong executable format + may have been used, and the kernel won't boot. + + Benefits: + + - Better compression (but note that the kernel was already compressed, + so the improvement is not as large as with other formats). + Still, the bytes saved may be essential for special needs like + boot disks. + + For example, this is what I get for my 2.2.16 kernel: + 1589708 vmlinux + 641073 bzImage [original] + 560755 bzImage.upx [compressed by "upx -9"] + + - Much faster decompression at kernel boot time (but kernel + decompression speed is not really an issue these days). + + Drawbacks: + + (none) + + Extra options available for this executable format: + + --all-methods Compress the program several times, using all + available compression methods. This may improve + the compression ratio in some cases, but usually + the default method gives the best results anyway. + + --all-filters Compress the program several times, using all + available preprocessing filters. This may improve + the compression ratio in some cases, but usually + the default filter gives the best results anyway. + + NOTES FOR WATCOM/LE + UPX has been successfully tested with the following extenders: DOS4G, + DOS4GW, PMODE/W, DOS32a, CauseWay. The WDOS/X extender is partly + supported (for details see the file bugs BUGS). + + DLLs and the LX format are not supported. + + Extra options available for this executable format: + + --le Produce an unbound LE output instead of + keeping the current stub. + + NOTES FOR WIN32/PE + The PE support in UPX is quite stable now, but probably there are still + some incompatibilities with some files. + + Because of the way UPX (and other packers for this format) works, you + can see increased memory usage of your compressed files because the + whole program is loaded into memory at startup. If you start several + instances of huge compressed programs you're wasting memory because the + common segments of the program won't get shared across the instances. On + the other hand if you're compressing only smaller programs, or running + only one instance of larger programs, then this penalty is smaller, but + it's still there. + + If you're running executables from network, then compressed programs + will load faster, and require less bandwidth during execution. + + DLLs are supported. But UPX compressed DLLs can not share common data + and code when they got used by multiple applications. So compressing + msvcrt.dll is a waste of memory, but compressing the dll plugins of a + particular application may be a better idea. + + Screensavers are supported, with the restriction that the filename must + end with ".scr" (as screensavers are handled slightly different than + normal exe files). + + UPX compressed PE files have some minor memory overhead (usually in the + 10 - 30 KiB range) which can be seen by specifying the "-i" command line + switch during compression. + + Extra options available for this executable format: + + --compress-exports=0 Don't compress the export section. + Use this if you plan to run the compressed + program under Wine. + --compress-exports=1 Compress the export section. [DEFAULT] + Compression of the export section can improve the + compression ratio quite a bit but may not work + with all programs (like winword.exe). + UPX never compresses the export section of a DLL + regardless of this option. + + --compress-icons=0 Don't compress any icons. + --compress-icons=1 Compress all but the first icon. + --compress-icons=2 Compress all icons which are not in the + first icon directory. [DEFAULT] + --compress-icons=3 Compress all icons. + + --compress-resources=0 Don't compress any resources at all. + + --keep-resource=list Don't compress resources specified by the list. + The members of the list are separated by commas. + A list member has the following format: I. + I is the type of the resource. Standard types + must be specified as decimal numbers, user types can be + specified by decimal IDs or strings. I is the + identifier of the resource. It can be a decimal number + or a string. For example: + + --keep-resource=2/MYBITMAP,5,6/12345 + + UPX won't compress the named bitmap resource "MYBITMAP", + it leaves every dialog (5) resource uncompressed, and + it won't touch the string table resource with identifier + 12345. + + --force Force compression even when there is an + unexpected value in a header field. + Use with care. + + --strip-relocs=0 Don't strip relocation records. + --strip-relocs=1 Strip relocation records. [DEFAULT] + This option only works on executables with base + address greater or equal to 0x400000. Usually the + compressed files becomes smaller, but some files + may become larger. Note that the resulting file will + not work under Windows 3.x (Win32s). + UPX never strips relocations from a DLL + regardless of this option. + + --all-methods Compress the program several times, using all + available compression methods. This may improve + the compression ratio in some cases, but usually + the default method gives the best results anyway. + + --all-filters Compress the program several times, using all + available preprocessing filters. This may improve + the compression ratio in some cases, but usually + the default filter gives the best results anyway. + +DIAGNOSTICS + Exit status is normally 0; if an error occurs, exit status is 1. If a + warning occurs, exit status is 2. + + UPX's diagnostics are intended to be self-explanatory. + +BUGS + Please report all bugs immediately to the authors. + +AUTHORS + Markus F.X.J. Oberhumer + http://www.oberhumer.com + + Laszlo Molnar + + John F. Reiser + + Jens Medoch + +COPYRIGHT + Copyright (C) 1996-2013 Markus Franz Xaver Johannes Oberhumer + + Copyright (C) 1996-2013 Laszlo Molnar + + Copyright (C) 2000-2013 John F. Reiser + + Copyright (C) 2002-2013 Jens Medoch + + This program may be used freely, and you are welcome to redistribute it + under certain conditions. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the UPX License + Agreement for more details. + + You should have received a copy of the UPX License Agreement along with + this program; see the file LICENSE. If not, visit the UPX home page. + diff --git a/Tools/UPX/upx.exe b/Tools/UPX/upx.exe new file mode 100644 index 00000000..e48db4fb Binary files /dev/null and b/Tools/UPX/upx.exe differ diff --git a/Tools/UPX/upx.html b/Tools/UPX/upx.html new file mode 100644 index 00000000..c364bb3d --- /dev/null +++ b/Tools/UPX/upx.html @@ -0,0 +1,894 @@ + + + + +upx - compress or expand executable files + + + + + + + + +
+

+ + + +
+ + +

+

+

NAME

+

upx - compress or expand executable files

+

+

+
+

SYNOPSIS

+

upxcommand ] [ options ] filename...

+

+

+
+

ABSTRACT

+
+                    The Ultimate Packer for eXecutables
+   Copyright (c) 1996-2013 Markus Oberhumer, Laszlo Molnar & John Reiser
+                        http://upx.sourceforge.net
+

UPX is a portable, extendable, high-performance executable packer for +several different executable formats. It achieves an excellent compression +ratio and offers *very* fast decompression. Your executables suffer +no memory overhead or other drawbacks for most of the formats supported, +because of in-place decompression.

+

While you may use UPX freely for both non-commercial and commercial +executables (for details see the file LICENSE), we would highly +appreciate if you credit UPX and ourselves in the documentation, +possibly including a reference to the UPX home page. Thanks.

+

[ Using UPX in non-OpenSource applications without proper credits +is considered not politically correct ;-) ]

+

+

+
+

DISCLAIMER

+

UPX comes with ABSOLUTELY NO WARRANTY; for details see the file LICENSE.

+

This is the first production quality release, and we plan that future 1.xx +releases will be backward compatible with this version.

+

Please report all problems or suggestions to the authors. Thanks.

+

+

+
+

DESCRIPTION

+

UPX is a versatile executable packer with the following features:

+
+  - excellent compression ratio: compresses better than zip/gzip,
+      use UPX to decrease the size of your distribution !
+
+  - very fast decompression: about 10 MiB/sec on an ancient Pentium 133,
+      about 200 MiB/sec on an Athlon XP 2000+.
+
+  - no memory overhead for your compressed executables for most of the
+      supported formats
+
+  - safe: you can list, test and unpack your executables
+      Also, a checksum of both the compressed and uncompressed file is
+      maintained internally.
+
+  - universal: UPX can pack a number of executable formats:
+      * atari/tos
+      * bvmlinuz/386    [bootable Linux kernel]
+      * djgpp2/coff
+      * dos/com
+      * dos/exe
+      * dos/sys
+      * linux/386
+      * linux/elf386
+      * linux/sh386
+      * ps1/exe
+      * rtm32/pe
+      * tmt/adam
+      * vmlinuz/386     [bootable Linux kernel]
+      * vmlinux/386
+      * watcom/le (supporting DOS4G, PMODE/W, DOS32a and CauseWay)
+      * win32/pe (exe and dll)
+      * arm/pe (exe and dll)
+      * linux/elfamd64
+      * linux/elfppc32
+      * mach/elfppc32
+
+  - portable: UPX is written in portable endian-neutral C++
+
+  - extendable: because of the class layout it's very easy to support
+      new executable formats or add new compression algorithms
+
+  - free: UPX can be distributed and used freely. And from version 0.99
+      the full source code of UPX is released under the GNU General Public
+      License (GPL) !
+

You probably understand now why we call UPX the "ultimate" +executable packer.

+

+

+
+

COMMANDS

+

+

+

Compress

+

This is the default operation, eg. upx yourfile.exe will compress the file +specified on the command line.

+

+

+

Decompress

+

All UPX supported file formats can be unpacked using the -d switch, eg. +upx -d yourfile.exe will uncompress the file you've just compressed.

+

+

+

Test

+

The -t command tests the integrity of the compressed and uncompressed +data, eg. upx -t yourfile.exe check whether your file can be safely +decompressed. Note, that this command doesn't check the whole file, only +the part that will be uncompressed during program execution. This means +that you should not use this command instead of a virus checker.

+

+

+

List

+

The -l command prints out some information about the compressed files +specified on the command line as parameters, eg upx -l yourfile.exe +shows the compressed / uncompressed size and the compression ratio of +yourfile.exe.

+

+

+
+

OPTIONS

+

-q: be quiet, suppress warnings

+

-q -q (or -qq): be very quiet, suppress errors

+

-q -q -q (or -qqq): produce no output at all

+

--help: prints the help

+

--version: print the version of UPX

+

--exact: when compressing, require to be able to get a byte-identical file +after decompression with option -d. [NOTE: this is work in progress and is +not supported for all formats yet. If you do care, as a workaround you can +compress and then decompress your program a first time - any further +compress-decompress steps should then yield byte-identical results +as compared to the first decompressed version.]

+

[ ...to be written... - type `upx --help' for now ]

+

+

+
+

COMPRESSION LEVELS & TUNING

+

UPX offers ten different compression levels from -1 to -9, +and --best. The default compression level is -8 for files +smaller than 512 KiB, and -7 otherwise.

+
    +
  • +

    Compression levels 1, 2 and 3 are pretty fast.

    +
  • +
  • +

    Compression levels 4, 5 and 6 achieve a good time/ratio performance.

    +
  • +
  • +

    Compression levels 7, 8 and 9 favor compression ratio over speed.

    +
  • +
  • +

    Compression level --best may take a long time.

    +
  • +
+

Note that compression level --best can be somewhat slow for large +files, but you definitely should use it when releasing a final version +of your program.

+

Quick info for achieving the best compression ratio:

+
    +
  • +

    Try upx --brute myfile.exe or even upx --ultra-brute myfile.exe.

    +
  • +
  • +

    Try if --overlay=strip works.

    +
  • +
  • +

    For win32/pe programs there's --strip-relocs=0. See notes below.

    +
  • +
+

+

+
+

OVERLAY HANDLING OPTIONS

+

Info: An "overlay" means auxiliary data attached after the logical end of +an executable, and it often contains application specific data +(this is a common practice to avoid an extra data file, though +it would be better to use resource sections).

+

UPX handles overlays like many other executable packers do: it simply +copies the overlay after the compressed image. This works with some +files, but doesn't work with others, depending on how an application +actually accesses this overlayed data.

+
+  --overlay=copy    Copy any extra data attached to the file. [DEFAULT]
+
+  --overlay=strip   Strip any overlay from the program instead of
+                    copying it. Be warned, this may make the compressed
+                    program crash or otherwise unusable.
+
+  --overlay=skip    Refuse to compress any program which has an overlay.
+

+

+
+

ENVIRONMENT

+

The environment variable UPX can hold a set of default +options for UPX. These options are interpreted first and +can be overwritten by explicit command line parameters. +For example:

+
+    for DOS/Windows:   set UPX=-9 --compress-icons#0
+    for sh/ksh/zsh:    UPX="-9 --compress-icons=0"; export UPX
+    for csh/tcsh:      setenv UPX "-9 --compress-icons=0"
+

Under DOS/Windows you must use '#' instead of '=' when setting the +environment variable because of a COMMAND.COM limitation.

+

Not all of the options are valid in the environment variable - +UPX will tell you.

+

You can explicitly use the --no-env option to ignore the +environment variable.

+

+

+
+

NOTES FOR THE SUPPORTED EXECUTABLE FORMATS

+

+

+

NOTES FOR ATARI/TOS

+

This is the executable format used by the Atari ST/TT, a Motorola 68000 +based personal computer which was popular in the late '80s. Support +of this format is only because of nostalgic feelings of one of +the authors and serves no practical purpose :-). +See http://www.freemint.de for more info.

+

Packed programs will be byte-identical to the original after uncompression. +All debug information will be stripped, though.

+

Extra options available for this executable format:

+
+  --all-methods       Compress the program several times, using all
+                      available compression methods. This may improve
+                      the compression ratio in some cases, but usually
+                      the default method gives the best results anyway.
+

+

+

NOTES FOR BVMLINUZ/I386

+

Same as vmlinuz/i386.

+

+

+

NOTES FOR DOS/COM

+

Obviously UPX won't work with executables that want to read data from +themselves (like some commandline utilities that ship with Win95/98/ME).

+

Compressed programs only work on a 286+.

+

Packed programs will be byte-identical to the original after uncompression.

+

Maximum uncompressed size: ~65100 bytes.

+

Extra options available for this executable format:

+
+  --8086              Create an executable that works on any 8086 CPU.
+
+  --all-methods       Compress the program several times, using all
+                      available compression methods. This may improve
+                      the compression ratio in some cases, but usually
+                      the default method gives the best results anyway.
+
+  --all-filters       Compress the program several times, using all
+                      available preprocessing filters. This may improve
+                      the compression ratio in some cases, but usually
+                      the default filter gives the best results anyway.
+

+

+

NOTES FOR DOS/EXE

+

dos/exe stands for all "normal" 16-bit DOS executables.

+

Obviously UPX won't work with executables that want to read data from +themselves (like some command line utilities that ship with Win95/98/ME).

+

Compressed programs only work on a 286+.

+

Extra options available for this executable format:

+
+  --8086              Create an executable that works on any 8086 CPU.
+
+  --no-reloc          Use no relocation records in the exe header.
+
+  --all-methods       Compress the program several times, using all
+                      available compression methods. This may improve
+                      the compression ratio in some cases, but usually
+                      the default method gives the best results anyway.
+

+

+

NOTES FOR DOS/SYS

+

Compressed programs only work on a 286+.

+

Packed programs will be byte-identical to the original after uncompression.

+

Maximum uncompressed size: ~65350 bytes.

+

Extra options available for this executable format:

+
+  --8086              Create an executable that works on any 8086 CPU.
+
+  --all-methods       Compress the program several times, using all
+                      available compression methods. This may improve
+                      the compression ratio in some cases, but usually
+                      the default method gives the best results anyway.
+
+  --all-filters       Compress the program several times, using all
+                      available preprocessing filters. This may improve
+                      the compression ratio in some cases, but usually
+                      the default filter gives the best results anyway.
+

+

+

NOTES FOR DJGPP2/COFF

+

First of all, it is recommended to use UPX *instead* of strip. strip has +the very bad habit of replacing your stub with its own (outdated) version. +Additionally UPX corrects a bug/feature in strip v2.8.x: it +will fix the 4 KiB alignment of the stub.

+

UPX includes the full functionality of stubify. This means it will +automatically stubify your COFF files. Use the option --coff to +disable this functionality (see below).

+

UPX automatically handles Allegro packfiles.

+

The DLM format (a rather exotic shared library extension) is not supported.

+

Packed programs will be byte-identical to the original after uncompression. +All debug information and trailing garbage will be stripped, though.

+

Extra options available for this executable format:

+
+  --coff              Produce COFF output instead of EXE. By default
+                      UPX keeps your current stub.
+
+  --all-methods       Compress the program several times, using all
+                      available compression methods. This may improve
+                      the compression ratio in some cases, but usually
+                      the default method gives the best results anyway.
+
+  --all-filters       Compress the program several times, using all
+                      available preprocessing filters. This may improve
+                      the compression ratio in some cases, but usually
+                      the default filter gives the best results anyway.
+

+

+

NOTES FOR LINUX [general]

+

Introduction

+
+  Linux/386 support in UPX consists of 3 different executable formats,
+  one optimized for ELF executables ("linux/elf386"), one optimized
+  for shell scripts ("linux/sh386"), and one generic format
+  ("linux/386").
+
+  We will start with a general discussion first, but please
+  also read the relevant docs for each of the individual formats.
+
+  Also, there is special support for bootable kernels - see the
+  description of the vmlinuz/386 format.
+

General user's overview

+
+  Running a compressed executable program trades less space on a
+  ``permanent'' storage medium (such as a hard disk, floppy disk,
+  CD-ROM, flash memory, EPROM, etc.) for more space in one or more
+  ``temporary'' storage media (such as RAM, swap space, /tmp, etc.).
+  Running a compressed executable also requires some additional CPU
+  cycles to generate the compressed executable in the first place,
+  and to decompress it at each invocation.
+
+  How much space is traded?  It depends on the executable, but many
+  programs save 30% to 50% of permanent disk space.  How much CPU
+  overhead is there?  Again, it depends on the executable, but
+  decompression speed generally is at least many megabytes per second,
+  and frequently is limited by the speed of the underlying disk
+  or network I/O.
+
+  Depending on the statistics of usage and access, and the relative
+  speeds of CPU, RAM, swap space, /tmp, and file system storage, then
+  invoking and running a compressed executable can be faster than
+  directly running the corresponding uncompressed program.
+  The operating system might perform fewer expensive I/O operations
+  to invoke the compressed program.  Paging to or from swap space
+  or /tmp might be faster than paging from the general file system.
+  ``Medium-sized'' programs which access about 1/3 to 1/2 of their
+  stored program bytes can do particularly well with compression.
+  Small programs tend not to benefit as much because the absolute
+  savings is less.  Big programs tend not to benefit proportionally
+  because each invocation may use only a small fraction of the program,
+  yet UPX decompresses the entire program before invoking it.
+  But in environments where disk or flash memory storage is limited,
+  then compression may win anyway.
+
+  Currently, executables compressed by UPX do not share RAM at runtime
+  in the way that executables mapped from a file system do.  As a
+  result, if the same program is run simultaneously by more than one
+  process, then using the compressed version will require more RAM and/or
+  swap space.  So, shell programs (bash, csh, etc.)  and ``make''
+  might not be good candidates for compression.
+
+  UPX recognizes three executable formats for Linux: Linux/elf386,
+  Linux/sh386, and Linux/386.  Linux/386 is the most generic format;
+  it accommodates any file that can be executed.  At runtime, the UPX
+  decompression stub re-creates in /tmp a copy of the original file,
+  and then the copy is (re-)executed with the same arguments.
+  ELF binary executables prefer the Linux/elf386 format by default,
+  because UPX decompresses them directly into RAM, uses only one
+  exec, does not use space in /tmp, and does not use /proc.
+  Shell scripts where the underlying shell accepts a ``-c'' argument
+  can use the Linux/sh386 format.  UPX decompresses the shell script
+  into low memory, then maps the shell and passes the entire text of the
+  script as an argument with a leading ``-c''.
+

General benefits:

+
+  - UPX can compress all executables, be it AOUT, ELF, libc4, libc5,
+    libc6, Shell/Perl/Python/... scripts, standalone Java .class
+    binaries, or whatever...
+    All scripts and programs will work just as before.
+
+  - Compressed programs are completely self-contained. No need for
+    any external program.
+
+  - UPX keeps your original program untouched. This means that
+    after decompression you will have a byte-identical version,
+    and you can use UPX as a file compressor just like gzip.
+    [ Note that UPX maintains a checksum of the file internally,
+      so it is indeed a reliable alternative. ]
+
+  - As the stub only uses syscalls and isn't linked against libc it
+    should run under any Linux configuration that can run ELF
+    binaries.
+
+  - For the same reason compressed executables should run under
+    FreeBSD and other systems which can run Linux binaries.
+    [ Please send feedback on this topic ]
+

General drawbacks:

+
+  - It is not advisable to compress programs which usually have many
+    instances running (like `sh' or `make') because the common segments of
+    compressed programs won't be shared any longer between different
+    processes.
+
+  - `ldd' and `size' won't show anything useful because all they
+    see is the statically linked stub.  Since version 0.82 the section
+    headers are stripped from the UPX stub and `size' doesn't even
+    recognize the file format.  The file patches/patch-elfcode.h has a
+    patch to fix this bug in `size' and other programs which use GNU BFD.
+

General notes:

+
+  - As UPX leaves your original program untouched it is advantageous
+    to strip it before compression.
+
+  - If you compress a script you will lose platform independence -
+    this could be a problem if you are using NFS mounted disks.
+
+  - Compression of suid, guid and sticky-bit programs is rejected
+    because of possible security implications.
+
+  - For the same reason there is no sense in making any compressed
+    program suid.
+
+  - Obviously UPX won't work with executables that want to read data
+    from themselves. E.g., this might be a problem for Perl scripts
+    which access their __DATA__ lines.
+
+  - In case of internal errors the stub will abort with exitcode 127.
+    Typical reasons for this to happen are that the program has somehow
+    been modified after compression.
+    Running `strace -o strace.log compressed_file' will tell you more.
+

+

+

NOTES FOR LINUX/ELF386

+

Please read the general Linux description first.

+

The linux/elf386 format decompresses directly into RAM, +uses only one exec, does not use space in /tmp, +and does not use /proc.

+

Linux/elf386 is automatically selected for Linux ELF executables.

+

Packed programs will be byte-identical to the original after uncompression.

+

How it works:

+
+  For ELF executables, UPX decompresses directly to memory, simulating
+  the mapping that the operating system kernel uses during exec(),
+  including the PT_INTERP program interpreter (if any).
+  The brk() is set by a special PT_LOAD segment in the compressed
+  executable itself.  UPX then wipes the stack clean except for
+  arguments, environment variables, and Elf_auxv entries (this is
+  required by bugs in the startup code of /lib/ld-linux.so as of
+  May 2000), and transfers control to the program interpreter or
+  the e_entry address of the original executable.
+
+  The UPX stub is about 1700 bytes long, partly written in assembler
+  and only uses kernel syscalls. It is not linked against any libc.
+

Specific drawbacks:

+
+  - For linux/elf386 and linux/sh386 formats, you will be relying on
+    RAM and swap space to hold all of the decompressed program during
+    the lifetime of the process.  If you already use most of your swap
+    space, then you may run out.  A system that is "out of memory"
+    can become fragile.  Many programs do not react gracefully when
+    malloc() returns 0.  With newer Linux kernels, the kernel
+    may decide to kill some processes to regain memory, and you
+    may not like the kernel's choice of which to kill.  Running
+    /usr/bin/top is one way to check on the usage of swap space.
+

Extra options available for this executable format:

+
+  (none)
+

+

+

NOTES FOR LINUX/SH386

+

Please read the general Linux description first.

+

Shell scripts where the underling shell accepts a ``-c'' argument +can use the Linux/sh386 format. UPX decompresses the shell script +into low memory, then maps the shell and passes the entire text of the +script as an argument with a leading ``-c''. +It does not use space in /tmp, and does not use /proc.

+

Linux/sh386 is automatically selected for shell scripts that +use a known shell.

+

Packed programs will be byte-identical to the original after uncompression.

+

How it works:

+
+  For shell script executables (files beginning with "#!/" or "#! /")
+  where the shell is known to accept "-c <command>", UPX decompresses
+  the file into low memory, then maps the shell (and its PT_INTERP),
+  and passes control to the shell with the entire decompressed file
+  as the argument after "-c".  Known shells are sh, ash, bash, bsh, csh,
+  ksh, tcsh, pdksh.  Restriction: UPX cannot use this method
+  for shell scripts which use the one optional string argument after
+  the shell name in the script (example: "#! /bin/sh option3\n".)
+
+  The UPX stub is about 1700 bytes long, partly written in assembler
+  and only uses kernel syscalls. It is not linked against any libc.
+

Specific drawbacks:

+
+  - For linux/elf386 and linux/sh386 formats, you will be relying on
+    RAM and swap space to hold all of the decompressed program during
+    the lifetime of the process.  If you already use most of your swap
+    space, then you may run out.  A system that is "out of memory"
+    can become fragile.  Many programs do not react gracefully when
+    malloc() returns 0.  With newer Linux kernels, the kernel
+    may decide to kill some processes to regain memory, and you
+    may not like the kernel's choice of which to kill.  Running
+    /usr/bin/top is one way to check on the usage of swap space.
+

Extra options available for this executable format:

+
+  (none)
+

+

+

NOTES FOR LINUX/386

+

Please read the general Linux description first.

+

The generic linux/386 format decompresses to /tmp and needs +/proc file system support. It starts the decompressed program +via the execve() syscall.

+

Linux/386 is only selected if the specialized linux/elf386 +and linux/sh386 won't recognize a file.

+

Packed programs will be byte-identical to the original after uncompression.

+

How it works:

+
+  For files which are not ELF and not a script for a known "-c" shell,
+  UPX uses kernel execve(), which first requires decompressing to a
+  temporary file in the file system.  Interestingly -
+  because of the good memory management of the Linux kernel - this
+  often does not introduce a noticeable delay, and in fact there
+  will be no disk access at all if you have enough free memory as
+  the entire process takes places within the file system buffers.
+
+  A compressed executable consists of the UPX stub and an overlay
+  which contains the original program in a compressed form.
+
+  The UPX stub is a statically linked ELF executable and does
+  the following at program startup:
+
+    1) decompress the overlay to a temporary location in /tmp
+    2) open the temporary file for reading
+    3) try to delete the temporary file and start (execve)
+       the uncompressed program in /tmp using /proc/<pid>/fd/X as
+       attained by step 2)
+    4) if that fails, fork off a subprocess to clean up and
+       start the program in /tmp in the meantime
+
+  The UPX stub is about 1700 bytes long, partly written in assembler
+  and only uses kernel syscalls. It is not linked against any libc.
+

Specific drawbacks:

+
+  - You need additional free disk space for the uncompressed program
+    in your /tmp directory. This program is deleted immediately after
+    decompression, but you still need it for the full execution time
+    of the program.
+
+  - You must have /proc file system support as the stub wants to open
+    /proc/<pid>/exe and needs /proc/<pid>/fd/X. This also means that you
+    cannot compress programs that are used during the boot sequence
+    before /proc is mounted.
+
+  - Utilities like `top' will display numerical values in the process
+    name field. This is because Linux computes the process name from
+    the first argument of the last execve syscall (which is typically
+    something like /proc/<pid>/fd/3).
+
+  - Because of temporary decompression to disk the decompression speed
+    is not as fast as with the other executable formats. Still, I can see
+    no noticeable delay when starting programs like my ~3 MiB emacs (which
+    is less than 1 MiB when compressed :-).
+

Extra options available for this executable format:

+
+  --force-execve      Force the use of the generic linux/386 "execve"
+                      format, i.e. do not try the linux/elf386 and
+                      linux/sh386 formats.
+

+

+

NOTES FOR PS1/EXE

+

This is the executable format used by the Sony PlayStation (PSone), +a Mips R3000 based gaming console which is popular since the late '90s. +Support of this format is very similar to the Atari one, because of +nostalgic feelings of one of the authors.

+

Packed programs will be byte-identical to the original after uncompression, +until further notice.

+

Maximum uncompressed size: ~1.89 / ~7.60 MiB.

+

Notes:

+
+  - UPX creates as default a suitable executable for CD-Mastering
+    and console transfer. For a CD-Master main executable you could also try
+    the special option "--boot-only" as described below.
+    It has been reported that upx packed executables are fully compatible with
+    the Sony PlayStation 2 (PS2, PStwo) and Sony PlayStation Portable (PSP) in
+    Sony PlayStation (PSone) emulation mode.
+
+  - Normally the packed files use the same memory areas like the uncompressed
+    versions, so they will not override other memory areas while unpacking.
+    If this isn't possible UPX will abort showing a 'packed data overlap'
+    error. With the "--force" option UPX will relocate the loading address
+    for the packed file, but this isn't a real problem if it is a single or
+    the main executable.
+

Extra options available for this executable format:

+
+  --all-methods       Compress the program several times, using all
+                      available compression methods. This may improve
+                      the compression ratio in some cases, but usually
+                      the default method gives the best results anyway.
+
+  --8-bit             Uses 8 bit size compression [default: 32 bit]
+
+  --8mib-ram          PSone has 8 MiB ram available [default: 2 MiB]
+
+  --boot-only         This format is for main exes and CD-Mastering only !
+                      It may slightly improve the compression ratio,
+                      decompression routines are faster than default ones.
+                      But it cannot be used for console transfer !
+
+  --no-align          This option disables CD mode 2 data sector format
+                      alignment. May slightly improves the compression ratio,
+                      but the compressed executable will not boot from a CD.
+                      Use it for console transfer only !
+

+

+

NOTES FOR RTM32/PE and ARM/PE

+

Same as win32/pe.

+

+

+

NOTES FOR TMT/ADAM

+

This format is used by the TMT Pascal compiler - see http://www.tmt.com/ .

+

Extra options available for this executable format:

+
+  --all-methods       Compress the program several times, using all
+                      available compression methods. This may improve
+                      the compression ratio in some cases, but usually
+                      the default method gives the best results anyway.
+
+  --all-filters       Compress the program several times, using all
+                      available preprocessing filters. This may improve
+                      the compression ratio in some cases, but usually
+                      the default filter gives the best results anyway.
+

+

+

NOTES FOR VMLINUZ/386

+

The vmlinuz/386 and bvmlinuz/386 formats take a gzip-compressed +bootable Linux kernel image ("vmlinuz", "zImage", "bzImage"), +gzip-decompress it and re-compress it with the UPX compression method.

+

vmlinuz/386 is completely unrelated to the other Linux executable +formats, and it does not share any of their drawbacks.

+

Notes:

+
+  - Be sure that "vmlinuz/386" or "bvmlinuz/386" is displayed
+  during compression - otherwise a wrong executable format
+  may have been used, and the kernel won't boot.
+

Benefits:

+
+  - Better compression (but note that the kernel was already compressed,
+  so the improvement is not as large as with other formats).
+  Still, the bytes saved may be essential for special needs like
+  boot disks.
+
+     For example, this is what I get for my 2.2.16 kernel:
+        1589708  vmlinux
+         641073  bzImage        [original]
+         560755  bzImage.upx    [compressed by "upx -9"]
+
+  - Much faster decompression at kernel boot time (but kernel
+    decompression speed is not really an issue these days).
+

Drawbacks:

+
+  (none)
+

Extra options available for this executable format:

+
+  --all-methods       Compress the program several times, using all
+                      available compression methods. This may improve
+                      the compression ratio in some cases, but usually
+                      the default method gives the best results anyway.
+
+  --all-filters       Compress the program several times, using all
+                      available preprocessing filters. This may improve
+                      the compression ratio in some cases, but usually
+                      the default filter gives the best results anyway.
+

+

+

NOTES FOR WATCOM/LE

+

UPX has been successfully tested with the following extenders: + DOS4G, DOS4GW, PMODE/W, DOS32a, CauseWay. + The WDOS/X extender is partly supported (for details + see the file bugs BUGS).

+

DLLs and the LX format are not supported.

+

Extra options available for this executable format:

+
+  --le                Produce an unbound LE output instead of
+                      keeping the current stub.
+

+

+

NOTES FOR WIN32/PE

+

The PE support in UPX is quite stable now, but probably there are +still some incompatibilities with some files.

+

Because of the way UPX (and other packers for this format) works, you +can see increased memory usage of your compressed files because the whole +program is loaded into memory at startup. +If you start several instances of huge compressed programs you're +wasting memory because the common segments of the program won't +get shared across the instances. +On the other hand if you're compressing only smaller programs, or +running only one instance of larger programs, then this penalty is +smaller, but it's still there.

+

If you're running executables from network, then compressed programs +will load faster, and require less bandwidth during execution.

+

DLLs are supported. But UPX compressed DLLs can not share common data and +code when they got used by multiple applications. So compressing msvcrt.dll +is a waste of memory, but compressing the dll plugins of a particular +application may be a better idea.

+

Screensavers are supported, with the restriction that the filename +must end with ".scr" (as screensavers are handled slightly different +than normal exe files).

+

UPX compressed PE files have some minor memory overhead (usually in the +10 - 30 KiB range) which can be seen by specifying the "-i" command +line switch during compression.

+

Extra options available for this executable format:

+
+ --compress-exports=0 Don't compress the export section.
+                      Use this if you plan to run the compressed
+                      program under Wine.
+ --compress-exports=1 Compress the export section. [DEFAULT]
+                      Compression of the export section can improve the
+                      compression ratio quite a bit but may not work
+                      with all programs (like winword.exe).
+                      UPX never compresses the export section of a DLL
+                      regardless of this option.
+
+  --compress-icons=0  Don't compress any icons.
+  --compress-icons=1  Compress all but the first icon.
+  --compress-icons=2  Compress all icons which are not in the
+                      first icon directory. [DEFAULT]
+  --compress-icons=3  Compress all icons.
+
+  --compress-resources=0  Don't compress any resources at all.
+
+  --keep-resource=list Don't compress resources specified by the list.
+                      The members of the list are separated by commas.
+                      A list member has the following format: I<type[/name]>.
+                      I<Type> is the type of the resource. Standard types
+                      must be specified as decimal numbers, user types can be
+                      specified by decimal IDs or strings. I<Name> is the
+                      identifier of the resource. It can be a decimal number
+                      or a string. For example:
+
+                      --keep-resource=2/MYBITMAP,5,6/12345
+
+                      UPX won't compress the named bitmap resource "MYBITMAP",
+                      it leaves every dialog (5) resource uncompressed, and
+                      it won't touch the string table resource with identifier
+                      12345.
+
+  --force             Force compression even when there is an
+                      unexpected value in a header field.
+                      Use with care.
+
+  --strip-relocs=0    Don't strip relocation records.
+  --strip-relocs=1    Strip relocation records. [DEFAULT]
+                      This option only works on executables with base
+                      address greater or equal to 0x400000. Usually the
+                      compressed files becomes smaller, but some files
+                      may become larger. Note that the resulting file will
+                      not work under Windows 3.x (Win32s).
+                      UPX never strips relocations from a DLL
+                      regardless of this option.
+
+  --all-methods       Compress the program several times, using all
+                      available compression methods. This may improve
+                      the compression ratio in some cases, but usually
+                      the default method gives the best results anyway.
+
+  --all-filters       Compress the program several times, using all
+                      available preprocessing filters. This may improve
+                      the compression ratio in some cases, but usually
+                      the default filter gives the best results anyway.
+

+

+
+

DIAGNOSTICS

+

Exit status is normally 0; if an error occurs, exit status +is 1. If a warning occurs, exit status is 2.

+

UPX's diagnostics are intended to be self-explanatory.

+

+

+
+

BUGS

+

Please report all bugs immediately to the authors.

+

+

+
+

AUTHORS

+
+ Markus F.X.J. Oberhumer <markus@oberhumer.com>
+ http://www.oberhumer.com
+
+ Laszlo Molnar <ml1050@users.sourceforge.net>
+
+ John F. Reiser <jreiser@BitWagon.com>
+
+ Jens Medoch <jssg@users.sourceforge.net>
+

+

+
+

COPYRIGHT

+

Copyright (C) 1996-2013 Markus Franz Xaver Johannes Oberhumer

+

Copyright (C) 1996-2013 Laszlo Molnar

+

Copyright (C) 2000-2013 John F. Reiser

+

Copyright (C) 2002-2013 Jens Medoch

+

This program may be used freely, and you are welcome to +redistribute it under certain conditions.

+

This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +UPX License Agreement for more details.

+

You should have received a copy of the UPX License Agreement along +with this program; see the file LICENSE. If not, visit the UPX home page.

+ + + +