Mostrando entradas con la etiqueta ERP. Mostrar todas las entradas
Mostrando entradas con la etiqueta ERP. Mostrar todas las entradas
miércoles, 7 de agosto de 2013
Notas descuadradas en Adempiere
-- Type: notas_descuadradas
-- DROP TYPE notas_descuadradas;
CREATE TYPE notas_descuadradas AS
(id_lote numeric(10),
num_lote character varying,
id_nota numeric(10),
num_nota character varying,
debito numeric(10,2),
credito numeric(10,2),
diferencia numeric(10,2));
-- Function: rep_notas_descuadradas(numeric, numeric)
-- DROP FUNCTION rep_notas_descuadradas(numeric, numeric);
CREATE OR REPLACE FUNCTION rep_notas_descuadradas(id_periodo numeric, id_comprobante numeric)
RETURNS SETOF notas_descuadradas AS
$BODY$
declare
resultado notas_descuadradas%rowtype;
begin
drop table if exists tmp_notas_descuadradas;
create table tmp_notas_descuadradas as
select
k.id_lote,
k.num_lote,
k.id_nota,
k.num_nota,
k.debito,
k.credito,
(k.debito - k.credito) diferencia
from
(
select
gb.gl_journalbatch_id id_lote,
gb.documentno num_lote,
g.gl_journal_id id_nota,
g.documentno num_nota,
sum(gl.amtacctdr) debito,
sum(gl.amtacctcr) credito
from gl_journalbatch gb
join gl_journal g
on gb.gl_journalbatch_id = g.gl_journalbatch_id
join gl_journalline gl
on g.gl_journal_id = gl.gl_journal_id
where gb.ad_client_id = 1000001
--and gb.docstatus = 'CO'
and gb.c_period_id = case when id_periodo = 0 then gb.c_period_id else id_periodo end
and gb.gl_journalbatch_id = case when id_comprobante = 0 then gb.gl_journalbatch_id else id_comprobante end
group by
gb.gl_journalbatch_id,
gb.documentno,
g.gl_journal_id,
g.documentno
) k
where k.debito <> k.credito;
for resultado in execute
'select
t.id_lote,
t.num_lote,
t.id_nota,
t.num_nota,
t.debito,
t.credito,
t.diferencia
from tmp_notas_descuadradas t;'
loop
return next resultado;
end loop;
end;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100
ROWS 1000;
lunes, 29 de julio de 2013
Adempiere Light Backup
1) Abrir una terminal Ctrl + Alt + t
sudo pg_dump -Fc -h [IP Servidor] adempiere -U adempiere -v -W -T 'ad_changelog' > adempierefile.backup
Example:
pg_dump -Fc -h localhost -d idempiere -U adempiere -v -W -T 'ad_changelog' -T 'ad_issue' > "C:\dbname230221_1614.backup"
2) Antes de restaurar la base de datos, se debe crear el lenguage plpgsql con la siguiente instrucción:
create language plpgsql;
3) Cuando se vaya a restaurar la base de datos, es necesario crear la estructura de la tabla 'ad_changelog'
-- Table: ad_changelog
-- DROP TABLE ad_changelog;
CREATE TABLE ad_changelog
(
ad_changelog_id numeric(10,0) NOT NULL,
ad_session_id numeric(10,0) NOT NULL,
ad_table_id numeric(10,0) NOT NULL,
ad_column_id numeric(10,0) NOT NULL,
ad_client_id numeric(10,0) NOT NULL,
ad_org_id numeric(10,0) NOT NULL,
isactive character(1) NOT NULL DEFAULT 'Y'::bpchar,
created timestamp without time zone NOT NULL DEFAULT now(),
createdby numeric(10,0) NOT NULL,
updated timestamp without time zone NOT NULL DEFAULT now(),
updatedby numeric(10,0) NOT NULL,
record_id numeric(10,0) NOT NULL,
oldvalue character varying(2000),
newvalue character varying(2000),
undo character(1),
redo character(1),
iscustomization character(1) NOT NULL DEFAULT 'N'::bpchar,
trxname character varying(60),
description character varying(255),
eventchangelog character(1),
CONSTRAINT ad_changelog_pkey PRIMARY KEY (ad_changelog_id , ad_session_id , ad_table_id , ad_column_id ),
CONSTRAINT adcolumn_adchangelog FOREIGN KEY (ad_column_id)
REFERENCES ad_column (ad_column_id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
CONSTRAINT adsession_adchangelog FOREIGN KEY (ad_session_id)
REFERENCES ad_session (ad_session_id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED,
CONSTRAINT adtable_adchangelog FOREIGN KEY (ad_table_id)
REFERENCES ad_table (ad_table_id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
CONSTRAINT ad_changelog_isactive_check CHECK (isactive = ANY (ARRAY['Y'::bpchar, 'N'::bpchar])),
CONSTRAINT ad_changelog_iscustomization_check CHECK (iscustomization = ANY (ARRAY['Y'::bpchar, 'N'::bpchar]))
)
WITH (
OIDS=FALSE
);
ALTER TABLE ad_changelog
OWNER TO adempiere;
-- Index: ad_changelog_speed
-- DROP INDEX ad_changelog_speed;
CREATE INDEX ad_changelog_speed
ON ad_changelog
USING btree
(ad_table_id , record_id );
-- Function: symmetricds.sym_largeobject(oid)
-- DROP FUNCTION symmetricds.sym_largeobject(oid);
CREATE OR REPLACE FUNCTION symmetricds.sym_largeobject(objectid oid)
RETURNS text AS
$BODY$ DECLARE encodedBlob text; encodedBlobPage text; BEGIN encodedBlob := ''; FOR encodedBlobPage IN SELECT pg_catalog.encode(data, 'escape') FROM pg_largeobject WHERE loid = objectId ORDER BY pageno LOOP encodedBlob := encodedBlob || encodedBlobPage; END LOOP; RETURN pg_catalog.encode(pg_catalog.decode(encodedBlob, 'escape'), 'base64'); EXCEPTION WHEN OTHERS THEN RETURN ''; END $BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
ALTER FUNCTION symmetricds.sym_largeobject(oid)
OWNER TO symmetricds;
-- Function: symmetricds.sym_node_disabled()
-- DROP FUNCTION symmetricds.sym_node_disabled();
CREATE OR REPLACE FUNCTION symmetricds.sym_node_disabled()
RETURNS character varying AS
$BODY$ DECLARE nodeId VARCHAR(50); BEGIN select current_setting('symmetric.node_disabled') into nodeId; return nodeId; EXCEPTION WHEN OTHERS THEN return ''; END; $BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
ALTER FUNCTION symmetricds.sym_node_disabled()
OWNER TO symmetricds;
-- Function: symmetricds.sym_triggers_disabled()
-- DROP FUNCTION symmetricds.sym_triggers_disabled();
CREATE OR REPLACE FUNCTION symmetricds.sym_triggers_disabled()
RETURNS integer AS
$BODY$ DECLARE triggerDisabled INTEGER; BEGIN select current_setting('symmetric.triggers_disabled') into triggerDisabled; return triggerDisabled; EXCEPTION WHEN OTHERS THEN return 0; END; $BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
ALTER FUNCTION symmetricds.sym_triggers_disabled()
OWNER TO symmetricds;
sudo pg_dump -Fc -h [IP Servidor] adempiere -U adempiere -v -W -T 'ad_changelog' > adempierefile.backup
Example:
pg_dump -Fc -h localhost -d idempiere -U adempiere -v -W -T 'ad_changelog' -T 'ad_issue' > "C:\dbname230221_1614.backup"
2) Antes de restaurar la base de datos, se debe crear el lenguage plpgsql con la siguiente instrucción:
create language plpgsql;
3) Cuando se vaya a restaurar la base de datos, es necesario crear la estructura de la tabla 'ad_changelog'
-- Table: ad_changelog
-- DROP TABLE ad_changelog;
CREATE TABLE ad_changelog
(
ad_changelog_id numeric(10,0) NOT NULL,
ad_session_id numeric(10,0) NOT NULL,
ad_table_id numeric(10,0) NOT NULL,
ad_column_id numeric(10,0) NOT NULL,
ad_client_id numeric(10,0) NOT NULL,
ad_org_id numeric(10,0) NOT NULL,
isactive character(1) NOT NULL DEFAULT 'Y'::bpchar,
created timestamp without time zone NOT NULL DEFAULT now(),
createdby numeric(10,0) NOT NULL,
updated timestamp without time zone NOT NULL DEFAULT now(),
updatedby numeric(10,0) NOT NULL,
record_id numeric(10,0) NOT NULL,
oldvalue character varying(2000),
newvalue character varying(2000),
undo character(1),
redo character(1),
iscustomization character(1) NOT NULL DEFAULT 'N'::bpchar,
trxname character varying(60),
description character varying(255),
eventchangelog character(1),
CONSTRAINT ad_changelog_pkey PRIMARY KEY (ad_changelog_id , ad_session_id , ad_table_id , ad_column_id ),
CONSTRAINT adcolumn_adchangelog FOREIGN KEY (ad_column_id)
REFERENCES ad_column (ad_column_id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
CONSTRAINT adsession_adchangelog FOREIGN KEY (ad_session_id)
REFERENCES ad_session (ad_session_id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED,
CONSTRAINT adtable_adchangelog FOREIGN KEY (ad_table_id)
REFERENCES ad_table (ad_table_id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
CONSTRAINT ad_changelog_isactive_check CHECK (isactive = ANY (ARRAY['Y'::bpchar, 'N'::bpchar])),
CONSTRAINT ad_changelog_iscustomization_check CHECK (iscustomization = ANY (ARRAY['Y'::bpchar, 'N'::bpchar]))
)
WITH (
OIDS=FALSE
);
ALTER TABLE ad_changelog
OWNER TO adempiere;
-- Index: ad_changelog_speed
-- DROP INDEX ad_changelog_speed;
CREATE INDEX ad_changelog_speed
ON ad_changelog
USING btree
(ad_table_id , record_id );
-- Function: symmetricds.sym_largeobject(oid)
-- DROP FUNCTION symmetricds.sym_largeobject(oid);
CREATE OR REPLACE FUNCTION symmetricds.sym_largeobject(objectid oid)
RETURNS text AS
$BODY$ DECLARE encodedBlob text; encodedBlobPage text; BEGIN encodedBlob := ''; FOR encodedBlobPage IN SELECT pg_catalog.encode(data, 'escape') FROM pg_largeobject WHERE loid = objectId ORDER BY pageno LOOP encodedBlob := encodedBlob || encodedBlobPage; END LOOP; RETURN pg_catalog.encode(pg_catalog.decode(encodedBlob, 'escape'), 'base64'); EXCEPTION WHEN OTHERS THEN RETURN ''; END $BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
ALTER FUNCTION symmetricds.sym_largeobject(oid)
OWNER TO symmetricds;
-- Function: symmetricds.sym_node_disabled()
-- DROP FUNCTION symmetricds.sym_node_disabled();
CREATE OR REPLACE FUNCTION symmetricds.sym_node_disabled()
RETURNS character varying AS
$BODY$ DECLARE nodeId VARCHAR(50); BEGIN select current_setting('symmetric.node_disabled') into nodeId; return nodeId; EXCEPTION WHEN OTHERS THEN return ''; END; $BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
ALTER FUNCTION symmetricds.sym_node_disabled()
OWNER TO symmetricds;
-- Function: symmetricds.sym_triggers_disabled()
-- DROP FUNCTION symmetricds.sym_triggers_disabled();
CREATE OR REPLACE FUNCTION symmetricds.sym_triggers_disabled()
RETURNS integer AS
$BODY$ DECLARE triggerDisabled INTEGER; BEGIN select current_setting('symmetric.triggers_disabled') into triggerDisabled; return triggerDisabled; EXCEPTION WHEN OTHERS THEN return 0; END; $BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
ALTER FUNCTION symmetricds.sym_triggers_disabled()
OWNER TO symmetricds;
"Dejar un comentario es una forma de agradecimiento"
jueves, 18 de julio de 2013
Vendor Name in Adempiere Login Page
1) Abrir una terminal Ctrl + Alt + t
2) cd /opt/Adempiere
3) sudo nano AdempiereEnv.properties
4) Escribir al final del archivo la siguiente línea
ADEMPIERE_VENDOR=NombreEmpresa
5) Guardar los cambios. Listo
2) cd /opt/Adempiere
3) sudo nano AdempiereEnv.properties
4) Escribir al final del archivo la siguiente línea
ADEMPIERE_VENDOR=NombreEmpresa
5) Guardar los cambios. Listo
"Dejar un comentario es una forma de agradecimiento"
miércoles, 17 de julio de 2013
Opening a Closed Invoice in Adempiere
UPDATE C_Invoice SET DocStatus = 'CO', DocAction = 'CL' WHERE C_Invoice_ID = ###
Opening a Closed Order in Adempiere
UPDATE C_Order SET DocStatus = 'CO', DocAction = 'CL' WHERE C_Order_ID = ###
Opening a Closed Journal in Adempiere
UPDATE GL_JournalBatch SET DocStatus = 'CO', DocAction = 'CL' WHERE GL_JournalBatch_ID = ###
lunes, 8 de julio de 2013
Automatic Control Period in Adempiere
Para llevar un control propio de los períodos contables, es necesario entrar a la pantalla de "Esquema Contable" y desmarcar la opción "Control de Período Automático" (Automatic Period Control), como se muestra en la siguiente imagen:
Esto permitirá completar y reactivar notas contables con períodos abiertos de forma manual por el usuario administrador del sistema.
Esto permitirá completar y reactivar notas contables con períodos abiertos de forma manual por el usuario administrador del sistema.
"Dejar un comentario es una forma de agradecimiento"
jueves, 27 de junio de 2013
Get Parent Ledger Account
/*
"1-1-1-00-0-00"
"1-1-1-01-0-00"
"1-1-1-01-1-00"
"1-1-1-01-2-00"
"1-1-1-02-0-00"
"1-1-1-02-1-00"
"1-1-1-02-1-01"
"1-1-1-02-1-02"
"1-1-1-02-1-03"
select sp_obtener_cta_padre('11102103');
select sp_obtener_cta_padre('11102100');
select sp_obtener_cta_padre('11102000');
*/
create or replace function sp_obtener_cta_padre(p_cuenta varchar)
returns varchar as $$
declare
nivel1 integer;
nivel2 integer;
nivel3 integer;
nivel4 integer;
nivel5 integer;
nivel6 integer;
n1 varchar;
n2 varchar;
n3 varchar;
n4 varchar;
n5 varchar;
n6 varchar;
b boolean;
resultado varchar;
begin
nivel1 = cast(substring(p_cuenta, 1, 1) as integer);
nivel2 = cast(substring(p_cuenta, 2, 1) as integer);
nivel3 = cast(substring(p_cuenta, 3, 1) as integer);
nivel4 = cast(substring(p_cuenta, 4, 2) as integer);
nivel5 = cast(substring(p_cuenta, 6, 1) as integer);
nivel6 = cast(substring(p_cuenta, 7, 2) as integer);
b = true;
if (nivel6 > 0 and b = true) then
nivel6 = 0;
b = false;
end if;
if (nivel5 > 0 and b = true) then
nivel5 = 0;
b = false;
end if;
if (nivel4 > 0 and b = true) then
nivel4 = 0;
b = false;
end if;
if (nivel3 > 0 and b = true) then
nivel3 = 0;
b = false;
end if;
if (nivel2 > 0 and b = true) then
nivel2 = 0;
b = false;
end if;
n1 = cast(nivel1 as varchar);
n2 = cast(nivel2 as varchar);
n3 = cast(nivel3 as varchar);
n4 = cast(nivel4 as varchar);
n5 = cast(nivel5 as varchar);
n6 = cast(nivel6 as varchar);
if(char_length(n4) = 1)then
n4 = '0' || n4;
end if;
if(char_length(n6) = 1)then
n6 = '0' || n6;
end if;
resultado = n1 || n2 || n3 || n4 || n5 || n6;
return resultado;
end;
$$ language plpgsql;
lunes, 3 de junio de 2013
Terminated in Adempiere
Cuando un usuario desea completar una orden de compra u orden de venta, el sistema manda este mensaje cuando el número de orden ya existe, y no permite completar porque no permite la duplicidad de ordenes.
miércoles, 8 de mayo de 2013
Accounting View Post
CREATE VIEW "adempiere"."vw_nota_contabilidad" ( ad_client_id,
ad_org_id,
isactive,
created,
createdby,
updated,
updatedby,
gl_journalbatch_id,
num_lote,
docstatus,
docaction,
processed,
fecha_lote,
fecha_conta_lote,
c_period_id,
lote_cr,
lote_dr,
gl_journal_id,
num_nota,
posted,
nota_cr,
nota_dr,
fecha_nota,
fecha_conta_nota,
linea,
credito,
debito,
id_cuenta,
cod_cuenta,
cuenta) AS
SELECT gb.ad_client_id,
gb.ad_org_id,
gb.isactive,
gb.created,
gb.createdby,
gb.updated,
gb.updatedby,
gb.gl_journalbatch_id,
gb.documentno AS num_lote,
gb.docstatus,
gb.docaction,
gb.processed,
gb.datedoc AS fecha_lote,
gb.dateacct AS fecha_conta_lote,
gb.c_period_id,
gb.totalcr AS lote_cr,
gb.totaldr AS lote_dr,
g.gl_journal_id,
g.documentno AS num_nota,
g.posted,
g.totalcr AS nota_cr,
g.totaldr AS nota_dr,
g.datedoc AS fecha_nota,
g.dateacct AS fecha_conta_nota,
gl.line AS linea,
gl.amtacctcr AS credito,
gl.amtacctdr AS debito,
ev.c_elementvalue_id AS id_cuenta,
ev.value AS cod_cuenta,
ev.name AS cuenta
FROM gl_journalbatch gb
JOIN c_period p ON gb.c_period_id = p.c_period_id
JOIN gl_journal g ON gb.gl_journalbatch_id = g.gl_journalbatch_id
JOIN gl_journalline gl ON g.gl_journal_id = gl.gl_journal_id
JOIN c_validcombination vc ON gl.c_validcombination_id = vc.c_validcombination_id
JOIN c_elementvalue ev ON vc.account_id = ev.c_elementvalue_id
WHERE gb.ad_client_id = 1000001::numeric;
martes, 2 de abril de 2013
ReadOnlyLogic in Adempiere
Los campos que se pueden usar para condicionar si un determinado campo es o no de "Solo Lectura" son los siguientes:
Los campos de la misma tabla o vista:
@campo1@ = [Valor]
@campo2@ = [Valor]
@campo3@ = [Valor]
...
@campoN@ = [Valor]
Campos del Sistema
@#AD_Client_ID@
@#AD_Org_ID@
@#AD_Role_ID@
ERROR:
@#AD_User_ID@
El sistema no permite usar este campo porque todos los accesos son a nivel de roles.
martes, 12 de marzo de 2013
Export to excel in Adempiere
1) Descargar el zkcustomization.jar
2) Descargar el poi-3.7-20101029.jar
3) Entrar a la terminal presionando Ctrl + Alt + t
4) Transferir los archivos a la carpeta temporal del servidor
usuario@host:~$ scp /Documentos/zkcustomization.jar UsuarioServidor@HostServidor:/tmp/zkcustomization.jar
usuario@host:~$ scp /Documentos/poi-3.7-20101029.jar UsuarioServidor@HostServidor:/tmp/poi-3.7-20101029.jar
5) Entrar al servidor
ssh UsuarioServidor@HostServidor
6) cd /opt/Adempiere/utils
7) sudo ./RUN_Server2Stop.sh
8) cp /tmp/zkcustomization.jar /opt/Adempiere/lib/
9) sudo ./RUN_silentsetup.sh
10) cp /tmp/poi-3.7-20101029.jar /opt/Adempiere/jboss/server/adempiere/lib/
11) sudo ./RUN_Server2.sh
12) Correr adempiere y ejecutar un reporte jasper, listo !!! Puedes observar cómo queda en la siguiente imagen:
2) Descargar el poi-3.7-20101029.jar
3) Entrar a la terminal presionando Ctrl + Alt + t
4) Transferir los archivos a la carpeta temporal del servidor
usuario@host:~$ scp /Documentos/zkcustomization.jar UsuarioServidor@HostServidor:/tmp/zkcustomization.jar
usuario@host:~$ scp /Documentos/poi-3.7-20101029.jar UsuarioServidor@HostServidor:/tmp/poi-3.7-20101029.jar
5) Entrar al servidor
ssh UsuarioServidor@HostServidor
6) cd /opt/Adempiere/utils
7) sudo ./RUN_Server2Stop.sh
8) cp /tmp/zkcustomization.jar /opt/Adempiere/lib/
9) sudo ./RUN_silentsetup.sh
10) cp /tmp/poi-3.7-20101029.jar /opt/Adempiere/jboss/server/adempiere/lib/
11) sudo ./RUN_Server2.sh
12) Correr adempiere y ejecutar un reporte jasper, listo !!! Puedes observar cómo queda en la siguiente imagen:
Por favor dejen sus comentarios, es una forma de agradecimiento !!! :D
viernes, 15 de febrero de 2013
Movement Type in Adempiere
-- select * from vw_tipos_mov_materiales tm;
drop view if exists vw_tipos_mov_materiales;
create view vw_tipos_mov_materiales
as
select
'C-'::varchar(2) as codigo,
'Embarque a Clientes'::varchar as nombre
union all
select
'C+'::varchar(2) as codigo,
'Devoluciones de Cliente'::varchar as nombre
union all
select
'I-'::varchar(2) as codigo,
'Salida de Inventario'::varchar as nombre
union all
select
'I+'::varchar(2) as codigo,
'Entrada de Inventario'::varchar as nombre
union all
select
'M-'::varchar(2) as codigo,
'Movimiento Desde'::varchar as nombre
union all
select
'M+'::varchar(2) as codigo,
'Movimiento Hacia'::varchar as nombre
union all
select
'P-'::varchar(2) as codigo,
'Producción -'::varchar as nombre
union all
select
'P+'::varchar(2) as codigo,
'Producción +'::varchar as nombre
union all
select
'V-'::varchar(2) as codigo,
'Devoluciones al Proveedor'::varchar as nombre
union all
select
'V+'::varchar(2) as codigo,
'Recibos del Proveedor'::varchar as nombre
union all
select
'W-'::varchar(2) as codigo,
'Orden de Trabajo -'::varchar as nombre
union all
select
'W+'::varchar(2) as codigo,
'Orden de Trabajo +'::varchar as nombre;
viernes, 25 de enero de 2013
Set Date As ProcessedOn Adempiere
La fórmula para establecer la fecha de un documento completado en Adempiere es la siguiente:
select extract(epoch from [Fecha]) * 1000
Ejemplo:
select extract(epoch from cast('130125' as date)) * 1000
1359093600000
select extract(epoch from [Fecha]) * 1000
Ejemplo:
select extract(epoch from cast('130125' as date)) * 1000
1359093600000
Get Processed Date Adempiere
Cuando completamos un registro de un módulo en Adempiere, por ejemplo una orden de venta, este genera un código automático y se guarda en el campo processedon, este campo contiene la fecha en que fue completado el registro, sin embargo está con un formato númerico. Para decifrar dicho formato utilizaremos la siguiente fórmula:
select cast(to_timestamp([ProcessedOn]/1000) as date)
Por ejemplo:
Una oden de venta que fue completado el 25 de Enero del 2013. El formato númerico para el processedon es el siguiente:
1359093600000
select cast(to_timestamp(1359093600000/1000) as date)
RESULTADO:
25/01/2013
select cast(to_timestamp([ProcessedOn]/1000) as date)
Por ejemplo:
Una oden de venta que fue completado el 25 de Enero del 2013. El formato númerico para el processedon es el siguiente:
1359093600000
select cast(to_timestamp(1359093600000/1000) as date)
RESULTADO:
25/01/2013
lunes, 21 de enero de 2013
Opciones del Java en Adempiere
Solo necesitas editar en el archivo $ADEMPIERE_HOME/utils/
myEnviroment.sh
Casi en las últimas lineas, buscas: ADEMPIERE_JAVA_OPTIONS
ANTES:
ADEMPIERE_JAVA_OPTIONS="-Xms64M -Xmx512M -DADEMPIERE_HOME=$ADEMPIERE_HOME"
DESPUES:
ADEMPIERE_JAVA_OPTIONS="- Xms512m -Xmx512m -XX:PermSize=384m -XX:MaxPermSize=384m -DADEMPIERE_HOME=$ADEMPIERE_ HOME"
Casi en las últimas lineas, buscas: ADEMPIERE_JAVA_OPTIONS
ANTES:
ADEMPIERE_JAVA_OPTIONS="-Xms64M -Xmx512M -DADEMPIERE_HOME=$ADEMPIERE_HOME"
DESPUES:
ADEMPIERE_JAVA_OPTIONS="-
domingo, 20 de enero de 2013
Punto Decimal en Adempiere Web
1) Descargar idioma español de Nicaragua para Adempiere
es_NI
2) Si existe traducciones personalizadas respaldar las tablas de traducciones (ad_element_trl, ad_table_trl, ad_window_trl, ad_tab_trl, ad_field_trl, etc...).
3) Entrar al sistema con el usuario System, con el rol System Administrator
4) Ir a la pantalla de Lenguaje, seleccionar "Spanish Nicaragua" y marcar como lenguaje de sistema
5) Ir a la pantalla "import/export traduccion", seleccionar el paquete descomprimido en /opt/Adempiere/data/es_NI
6) Aplicar el proceso Sincronizar Terminología.
Listo, por favor dejar sus comentarios
es_NI
2) Si existe traducciones personalizadas respaldar las tablas de traducciones (ad_element_trl, ad_table_trl, ad_window_trl, ad_tab_trl, ad_field_trl, etc...).
3) Entrar al sistema con el usuario System, con el rol System Administrator
4) Ir a la pantalla de Lenguaje, seleccionar "Spanish Nicaragua" y marcar como lenguaje de sistema
5) Ir a la pantalla "import/export traduccion", seleccionar el paquete descomprimido en /opt/Adempiere/data/es_NI
6) Aplicar el proceso Sincronizar Terminología.
Listo, por favor dejar sus comentarios
miércoles, 12 de septiembre de 2012
Formato de decimales en adempiere
Para cambiar el formato de los números con decimales cuando estos usan un punto y una coma como separador de miles, se debe realizar lo siguiente:
1) Login con el usuario System, perfil System Administrator
2) Clic en Menú > Administrador del Sistema > Reglas Generales > Reglas del Sistema > Lenguaje
3) Seleccionar el idioma que mantendrá el formato númerico
4) Desmarcar la opción "Punto Decimal"
5) Guardar
6) Listo, al entrar al sistema y seleccionar el idioma modificado, se verá el siguiente formato en todos los números:
#,###.##
Dejar sus comentarios es una forma de agradecimiento. :D
1) Login con el usuario System, perfil System Administrator
2) Clic en Menú > Administrador del Sistema > Reglas Generales > Reglas del Sistema > Lenguaje
3) Seleccionar el idioma que mantendrá el formato númerico
4) Desmarcar la opción "Punto Decimal"
5) Guardar
6) Listo, al entrar al sistema y seleccionar el idioma modificado, se verá el siguiente formato en todos los números:
#,###.##
Dejar sus comentarios es una forma de agradecimiento. :D
jueves, 6 de septiembre de 2012
Ubicar reportes en adempiere
create or replace function sp_ubicar_reporte(hostname varchar, port varchar)
returns boolean as $$
begin
update ad_process
set jasperreport = 'http://' || hostname || ':' || port || '/reports/' ||
substring( jasperreport, position('reports/' in jasperreport) + 8, length( jasperreport))
where isreport = 'Y'
and (jasperreport is not null or jasperreport <> '');
return true;
end;
$$ language plpgsql;
returns boolean as $$
begin
update ad_process
set jasperreport = 'http://' || hostname || ':' || port || '/reports/' ||
substring( jasperreport, position('reports/' in jasperreport) + 8, length( jasperreport))
where isreport = 'Y'
and (jasperreport is not null or jasperreport <> '');
return true;
end;
$$ language plpgsql;
viernes, 24 de agosto de 2012
No Identifier records found in Adempiere
"No Identifier records found"
Aunque nosotros tengamos bien definidos el campo de lista, marcando en la tabla principal como "identificador" el campo que queremos mostrar y seleccionando la opción "Tabla Directa" en el campo que tiene la llave foránea, este no funcionará si el nombre de la tabla principal termina con la sílaba "to".
EJEMPLO:
INCORRECTO:
drop table nic_tipo_producto;
create table nic_tipo_producto
(
nic_tipo_producto_id numeric(10,0) primary key not null,
ad_client_id numeric(10,0) not null,
ad_org_id numeric(10,0) not null,
created date not null,
createdby numeric(10,0) not null,
updated date not null,
updatedby numeric(10,0) not null,
isactive char not null,
codigo character varying(30) not null,
nombre character varying(255) not null
);
alter table m_product add nic_tipo_producto_id numeric(10,0);
Resultado:
-----------> MIssue.set_ValueNoCheck: ReleaseNo - Value too long - truncated to length=4 [11]
===========> MLookupFactory.getLookup_TableDir: No Identifier records found: nic_tipo_producto_ID [11]
-----------> MIssue.set_ValueNoCheck: ReleaseNo - Value too long - truncated to length=4 [11]
===========> MLookupFactory.getLookupInfo: No SQL - nic_tipo_producto_ID [11]
-----------> MIssue.set_ValueNoCheck: ReleaseNo - Value too long - truncated to length=4 [11]
===========> GridFieldVO.initFinish: No LookupInfo for nic_tipo_producto_ID [11]
java.lang.NullPointerException
at org.compiere.model.GridFieldVO.initFinish(GridFieldVO.java:507)
at org.compiere.model.GridFieldVO.create(GridFieldVO.java:201)
at org.compiere.model.GridTabVO.createFields(GridTabVO.java:272)
at org.compiere.model.GridTabVO.getFields(GridTabVO.java:444)
at org.compiere.model.GridTab.loadFields(GridTab.java:353)
at org.compiere.model.GridTab.loadTab(GridTab.java:296)
at org.compiere.model.GridTab.initTab(GridTab.java:287)
at org.compiere.model.GridWindow.initTab(GridWindow.java:195)
at org.compiere.apps.APanel.initPanel(APanel.java:737)
at org.compiere.apps.AWindow.initWindow(AWindow.java:102)
at org.compiere.apps.AMenuStartItem.startWindow(AMenuStartItem.java:249)
at org.compiere.apps.AMenuStartItem.run(AMenuStartItem.java:147)
Este error proviene del método "getZoomColumnName(String columnName)" de la clase MQuery
++MLookupFactory
+++MQuery
public static String getZoomColumnName (String columnName)
{
if (columnName == null)
return null;
if (columnName.equals("SalesRep_ID"))
return "AD_User_ID";
if (columnName.equals("C_DocTypeTarget_ID"))
return "C_DocType_ID";
if (columnName.equals("Bill_BPartner_ID"))
return "C_BPartner_ID";
if (columnName.equals("Bill_Location_ID"))
return "C_BPartner_Location_ID";
if (columnName.equals("Account_ID"))
return "C_ElementValue_ID";
if (columnName.equals("C_LocFrom_ID") || columnName.equals("C_LocTo_ID"))
return "C_Location_ID";
// Fix "*_To" columns
if (columnName.toUpperCase().endsWith("TO_ID")) {
return columnName.substring(0, columnName.length()-5)+"_ID";
}
if (columnName.toUpperCase().endsWith("_TO_ID")) {
return columnName.substring(0, columnName.length()-6)+"_ID";
}
if (columnName.equals("AD_OrgBP_ID") || columnName.equals("AD_OrgTrx_ID"))
return "AD_Org_ID";
// See also GridTab.validateQuery
//
return columnName;
} // getZoomColumnName
drop table nic_producto_tipo;
create table nic_producto_tipo
(
nic_producto_tipo_id numeric(10,0) primary key not null,
ad_client_id numeric(10,0) not null,
ad_org_id numeric(10,0) not null,
created date not null,
createdby numeric(10,0) not null,
updated date not null,
updatedby numeric(10,0) not null,
isactive char not null,
codigo character varying(30) not null,
nombre character varying(255) not null
);
alter table m_product add nic_producto_tipo_id numeric(10,0);
Resultado:
Suscribirse a:
Entradas (Atom)




