Merge with development

This commit is contained in:
hieplq 2016-03-23 14:03:19 +07:00
commit 7d6eb45e85
63 changed files with 2227 additions and 142 deletions

View File

@ -353,7 +353,7 @@ AS
ubp.numberemployees AS salesrep_bp_numberemployees,
ubp.paymentrule AS salesrep_bp_paymentrule,
ubp.paymentrulepo AS salesrep_bp_paymentrulepo,
ubp.po_discountschema_id AS salesrep_bp_po_discountsch_id,
ubp.po_discountschema_id AS salesrep_bp_po_discountschm_id,
ubp.po_paymentterm_id AS salesrep_bp_po_paymentterm_id,
ubp.po_pricelist_id AS salesrep_bp_po_pricelist_id,
ubp.poreference AS salesrep_bp_poreference,

View File

@ -351,7 +351,7 @@ SELECT o.ad_client_id,
ubp.numberemployees AS salesrep_bp_numberemployees,
ubp.paymentrule AS salesrep_bp_paymentrule,
ubp.paymentrulepo AS salesrep_bp_paymentrulepo,
ubp.po_discountschema_id AS salesrep_bp_po_discountsch_id,
ubp.po_discountschema_id AS salesrep_bp_po_discountschm_id,
ubp.po_paymentterm_id AS salesrep_bp_po_paymentterm_id,
ubp.po_pricelist_id AS salesrep_bp_po_pricelist_id,
ubp.poreference AS salesrep_bp_poreference,

View File

@ -0,0 +1,10 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-2985 : Recurring : implement Payment
-- Dec 23, 2015 2:43:32 PM CET
INSERT INTO AD_Ref_List (AD_Ref_List_ID,Name,AD_Reference_ID,Value,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Ref_List_UU) VALUES (200345,'Payment',282,'P',0,0,'Y',TO_DATE('2015-12-23 14:43:31','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2015-12-23 14:43:31','YYYY-MM-DD HH24:MI:SS'),100,'D','b3e77f8d-0d0d-4bf5-bb42-d998fb0c728c')
;
SELECT register_migration_script('201512231444_IDEMPIERE-2985.sql') FROM dual
;

View File

@ -0,0 +1,15 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-3004: View Column - View Component require SeqNo
-- Jan 25, 2016 4:42:40 PM CET
UPDATE AD_Column SET DefaultValue='@SQL=SELECT COALESCE(MAX(SeqNo),0)+10 AS DefaultValue FROM AD_ViewComponent WHERE AD_Table_ID=@AD_Table_ID@', IsUpdateable='N',Updated=TO_DATE('2016-01-25 16:42:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=210567
;
-- Jan 25, 2016 4:49:47 PM CET
UPDATE AD_Field SET SortNo=1.0,Updated=TO_DATE('2016-01-25 16:49:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202233
;
SELECT register_migration_script('201601161701_IDEMPIERE-3004.sql') FROM dual
;

View File

@ -0,0 +1,43 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-3004: View Column - View Component require SeqNo
-- Jan 25, 2016 5:22:40 PM CET
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure) VALUES (212635,0,'Sequence','Method of ordering records; lowest number comes first','The Sequence indicates the order of records',200088,'SeqNo','@SQL=SELECT COALESCE(MAX(SeqNo),0)+10 AS DefaultValue FROM AD_ViewColumn WHERE AD_Table_ID=@AD_Table_ID@',22,'N','N','N','N','N',0,'N',11,0,0,'Y',TO_DATE('2016-01-25 17:22:39','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-01-25 17:22:39','YYYY-MM-DD HH24:MI:SS'),100,566,'Y','N','D','N','N','N','Y','cc51c32b-7c4a-49c8-a9d4-94989260e242','Y',0,'N','N')
;
-- Jan 25, 2016 5:24:53 PM CET
UPDATE AD_Column SET DefaultValue='@SQL=SELECT COALESCE(MAX(SeqNo),0)+10 AS DefaultValue FROM AD_ViewColumn WHERE AD_ViewComponent_ID=@AD_ViewComponent_ID@',Updated=TO_DATE('2016-01-25 17:24:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=212635
;
-- Jan 25, 2016 5:25:19 PM CET
ALTER TABLE AD_ViewColumn ADD SeqNo NUMBER(10) DEFAULT NULL
;
-- Jan 25, 2016 5:27:04 PM CET
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (204135,'Sequence','Method of ordering records; lowest number comes first','The Sequence indicates the order of records',200099,212635,'Y',22,110,'N','N','N','N',0,0,'Y',TO_DATE('2016-01-25 17:27:04','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-01-25 17:27:04','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','6f955e38-0d37-4410-b8d2-3034ab5edd4a','Y',90,2)
;
-- Jan 25, 2016 5:27:47 PM CET
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=90, XPosition=4,Updated=TO_DATE('2016-01-25 17:27:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204135
;
-- Jan 25, 2016 5:27:48 PM CET
UPDATE AD_Field SET SeqNo=100,Updated=TO_DATE('2016-01-25 17:27:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202244
;
-- Jan 25, 2016 5:27:48 PM CET
UPDATE AD_Field SET SeqNo=110,Updated=TO_DATE('2016-01-25 17:27:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202248
;
-- Jan 25, 2016 5:28:00 PM CET
UPDATE AD_Field SET SortNo=1.0,Updated=TO_DATE('2016-01-25 17:28:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204135
;
-- Jan 25, 2016 5:28:00 PM CET
UPDATE AD_ViewColumn SET SeqNo = 0,Updated=TO_DATE('2016-01-25 17:28:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100
;
SELECT register_migration_script('201601161728_IDEMPIERE-3004.sql') FROM dual
;

View File

@ -0,0 +1,53 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Jan 20, 2016 2:26:58 PM CET
-- IDEMPIERE-2954
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200393,'0e4f4eec-17f8-478e-a598-ed833bf5493c',0,TO_DATE('2016-01-20 14:26:57','YYYY-MM-DD HH24:MI:SS'),0,'D','Y','Could not convert currency {0} to base currency {1}','I',TO_DATE('2016-01-20 14:26:57','YYYY-MM-DD HH24:MI:SS'),0,'ErrorConvertingCurrencyToProjectCurrency')
;
UPDATE AD_Message SET MsgText='Could not convert currency {0} to base currency {1} - converstion type : {2} / Date : {3}',Updated=TO_DATE('2016-01-20 15:34:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Message_ID=200393
;
-- Jan 20, 2016 3:34:28 PM CET
UPDATE AD_Message SET MsgText='Could not convert currency {0} to project currency {1} - converstion type : {2} / Date : {3}',Updated=TO_DATE('2016-01-20 15:34:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Message_ID=200393
;
-- Jan 20, 2016 3:34:38 PM CET
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200394,'64dd01ce-7afb-4db6-8641-bd80f7248ecd',0,TO_DATE('2016-01-20 15:34:37','YYYY-MM-DD HH24:MI:SS'),0,'D','Y','Could not convert currency {0} to base currency {1} - converstion type : {2} / Date : {3}','I',TO_DATE('2016-01-20 15:34:37','YYYY-MM-DD HH24:MI:SS'),0,'ErrorConvertingCurrencyToBaseCurrency')
;
-- Jan 20, 2016 3:35:50 PM CET
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200395,'66d383a0-ad94-435c-ac96-f03903fcda59',0,TO_DATE('2016-01-20 15:35:50','YYYY-MM-DD HH24:MI:SS'),0,'D','Y','Could not convert allocation currency {0} to base currency {1} - conversion type : {2} / conversion date : {3}','I',TO_DATE('2016-01-20 15:35:50','YYYY-MM-DD HH24:MI:SS'),0,'ErrorConvertingAllocationCurrencyToBaseCurrency')
;
-- Jan 20, 2016 3:36:05 PM CET
UPDATE AD_Message SET EntityType='D', MsgText='Could not convert currency {0} to base currency {1} - conversion type : {2} / conversion date : {3}',Updated=TO_DATE('2016-01-20 15:36:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Message_ID=200394
;
-- Jan 20, 2016 3:36:15 PM CET
UPDATE AD_Message SET MsgText='Could not convert currency {0} to project currency {1} - conversion type : {2} / conversion date : {3}',Updated=TO_DATE('2016-01-20 15:36:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Message_ID=200393
;
-- Jan 20, 2016 3:36:20 PM CET
UPDATE AD_Message SET EntityType='D',Updated=TO_DATE('2016-01-20 15:36:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Message_ID=200395
;
-- Jan 20, 2016 3:36:59 PM CET
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200396,'449bfa95-a175-4862-98c2-525c6a564c60',0,TO_DATE('2016-01-20 15:36:59','YYYY-MM-DD HH24:MI:SS'),0,'D','Y','Could not convert invoice currency {0} to base currency {1} - conversion type : {2} / conversion date : {3}','I',TO_DATE('2016-01-20 15:36:59','YYYY-MM-DD HH24:MI:SS'),0,'ErrorConvertingInvoiceCurrencyToBaseCurrency')
;
-- Jan 20, 2016 4:47:30 PM CET
UPDATE AD_Message SET MsgText='Could not convert currency {0} to base currency {1} - conversion type : {2} / conversion date : {3,date,short}',Updated=TO_DATE('2016-01-20 16:47:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200394
;
-- Jan 20, 2016 4:47:33 PM CET
UPDATE AD_Message SET MsgText='Could not convert currency {0} to project currency {1} - conversion type : {2} / conversion date : {3,date,short}',Updated=TO_DATE('2016-01-20 16:47:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200393
;
-- Jan 20, 2016 4:47:37 PM CET
UPDATE AD_Message SET MsgText='Could not convert invoice currency {0} to base currency {1} - conversion type : {2} / conversion date : {3,date,short}',Updated=TO_DATE('2016-01-20 16:47:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200396
;
SELECT register_migration_script('201601201427_IDEMPIERE-2954.sql') FROM dual
;

View File

@ -0,0 +1,11 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-3015
-- Jan 27, 2016 5:03:50 PM CET
UPDATE AD_Column SET IsParent='Y', IsUpdateable='N',Updated=TO_DATE('2016-01-27 17:03:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=749
;
SELECT register_migration_script('201601271704_IDEMPIERE-3015.sql') FROM dual
;

View File

@ -0,0 +1,528 @@
DROP VIEW c_order_header_vt;
CREATE OR REPLACE VIEW c_order_header_vt
AS
SELECT o.ad_client_id,
o.ad_org_id,
o.isactive,
o.created,
o.createdby,
o.updated,
o.updatedby,
dt.ad_language,
o.c_order_id,
o.issotrx,
o.documentno,
o.docstatus,
o.c_doctype_id,
o.c_bpartner_id,
bp.value AS bpvalue,
bp.taxid AS bptaxid,
bp.naics,
bp.duns,
oi.c_location_id AS org_location_id,
oi.taxid,
o.m_warehouse_id,
wh.c_location_id AS warehouse_location_id,
dt.printname AS documenttype,
dt.documentnote AS documenttypenote,
o.salesrep_id,
COALESCE(ubp.name, u.name) AS salesrep_name,
o.dateordered,
o.datepromised,
bpgt.greeting AS bpgreeting,
bp.name,
bp.name2,
bpcgt.greeting AS bpcontactgreeting,
bpc.title,
bpc.phone,
NULLIF(bpc.name, bp.name) AS contactname,
bpl.c_location_id,
l.postal
|| l.postal_add AS postal,
bp.referenceno,
o.bill_bpartner_id,
o.bill_location_id,
o.bill_user_id,
bbp.value AS bill_bpvalue,
bbp.taxid AS bill_bptaxid,
bbp.name AS bill_name,
bbp.name2 AS bill_name2,
bbpc.title AS bill_title,
bbpc.phone AS bill_phone,
NULLIF(bbpc.name, bbp.name) AS bill_contactname,
bbpl.c_location_id AS bill_c_location_id,
o.description,
o.poreference,
o.c_currency_id,
ptt.name AS paymentterm,
ptt.documentnote AS paymenttermnote,
o.c_charge_id,
o.chargeamt,
o.totallines,
o.grandtotal,
o.grandtotal AS amtinwords,
o.m_pricelist_id,
o.istaxincluded,
o.volume,
o.weight,
o.c_campaign_id,
o.c_project_id,
o.c_activity_id,
o.m_shipper_id,
o.deliveryrule,
o.deliveryviarule,
o.priorityrule,
o.invoicerule,
COALESCE(oi.logo_id, ci.logo_id) AS logo_id,
o.ad_orgtrx_id,
o.ad_user_id,
o.amountrefunded,
o.amounttendered,
o.c_bpartner_location_id,
o.c_cashline_id,
o.c_cashplanline_id,
o.c_conversiontype_id,
o.c_doctypetarget_id,
o.copyfrom,
o.c_payment_id,
o.c_paymentterm_id,
o.c_pos_id,
o.dateacct,
o.dateprinted,
o.docaction,
o.dropship_bpartner_id,
o.dropship_location_id,
o.dropship_user_id,
o.freightamt,
o.freightcostrule,
o.isapproved,
o.iscreditapproved,
o.isdelivered,
o.isdiscountprinted,
o.isdropship,
o.isinvoiced,
o.ispayschedulevalid,
o.isprinted,
o.isselected,
o.isselfservice,
o.istransferred,
o.link_order_id,
o.m_freightcategory_id,
o.ordertype,
o.pay_bpartner_id,
o.pay_location_id,
o.paymentrule,
o.posted,
o.processed,
o.processedon,
o.promotioncode,
o.ref_order_id,
o.sendemail,
o.user1_id,
o.user2_id,
wh.ad_org_id AS m_warehouse_ad_org_id,
wh.description AS m_warehouse_description,
wh.isactive AS m_warehouse_isactive,
wh.isdisallownegativeinv,
wh.isintransit,
wh.m_warehousesource_id,
wh.name AS m_warehouse_name,
wh.replenishmentclass,
wh.separator,
wh.value AS m_warehouse_value,
ptt.ad_org_id AS c_paymentterm_ad_org_id,
pt.afterdelivery,
ptt.description AS c_paymentterm_description,
pt.discount,
pt.discount2,
pt.discountdays,
pt.discountdays2,
pt.fixmonthcutoff,
pt.fixmonthday,
pt.fixmonthoffset,
pt.gracedays,
ptt.isactive AS c_paymentterm_isactive,
pt.isdefault,
pt.isduefixed,
pt.isnextbusinessday,
pt.isvalid,
pt.netday,
pt.netdays,
pt.paymenttermusage,
pt.value AS m_paymentterm_value,
bp.acqusitioncost AS bp_acqusitioncost,
bp.actuallifetimevalue AS bp_actuallifetimevalue,
bp.ad_language AS bp_ad_language,
bp.ad_orgbp_id AS bp_ad_orgbp_id,
bp.ad_org_id AS bp_ad_org_id,
bp.bpartner_parent_id AS bp_bpartner_parent_id,
bp.c_bp_group_id AS bp_c_bp_group_id,
bp.c_dunning_id AS bp_c_dunning_id,
bp.c_greeting_id AS bp_c_greeting_id,
bp.c_invoiceschedule_id AS bp_c_invoiceschedule_id,
bp.c_paymentterm_id AS bp_c_paymentterm_id,
bp.created AS bp_created,
bp.createdby AS bp_createdby,
bp.c_taxgroup_id AS bp_c_taxgroup_id,
bp.deliveryrule AS bp_deliveryrule,
bp.deliveryviarule AS bp_deliveryviarule,
bp.description AS bp_description,
bp.dunninggrace AS bp_dunninggrace,
bp.firstsale AS bp_firstsale,
bp.flatdiscount AS bp_flatdiscount,
bp.freightcostrule AS bp_freightcostrule,
bp.invoicerule AS bp_invoicerule,
bp.isactive AS bp_isactive,
bp.iscustomer AS bp_iscustomer,
bp.isdiscountprinted AS bp_isdiscountprinted,
bp.isemployee AS bp_isemployee,
bp.ismanufacturer AS bp_ismanufacturer,
bp.isonetime AS bp_isonetime,
bp.ispotaxexempt AS bp_ispotaxexempt,
bp.isprospect AS bp_isprospect,
bp.issalesrep AS bp_issalesrep,
bp.issummary AS bp_issummary,
bp.istaxexempt AS bp_istaxexempt,
bp.isvendor AS bp_isvendor,
bp.logo_id AS bp_logo_id,
bp.m_discountschema_id AS bp_m_discountschema_id,
bp.m_pricelist_id AS bp_m_pricelist_id,
bp.numberemployees AS bp_numberemployees,
bp.paymentrule AS bp_paymentrule,
bp.paymentrulepo AS bp_paymentrulepo,
bp.po_discountschema_id AS bp_po_discountschema_id,
bp.po_paymentterm_id AS bp_po_paymentterm_id,
bp.po_pricelist_id AS bp_po_pricelist_id,
bp.poreference AS bp_poreference,
bp.potentiallifetimevalue AS bp_potentiallifetimevalue,
bp.rating AS bp_rating,
bp.salesrep_id AS bp_salesrep_id,
bp.salesvolume AS bp_salesvolume,
bp.sendemail AS bp_sendemail,
bp.shareofcustomer AS bp_shareofcustomer,
bp.shelflifeminpct AS bp_shelflifeminpct,
bp.so_creditlimit AS bp_so_creditlimit,
bp.socreditstatus AS bp_socreditstatus,
bp.so_creditused AS bp_so_creditused,
bp.so_description AS bp_so_description,
bp.totalopenbalance AS bp_totalopenbalance,
bp.updated AS bp_updated,
bp.updatedby AS bp_updatedby,
bp.url AS bp_url,
bpgt.ad_org_id AS c_greeting_ad_org_id,
bpgt.isactive AS c_greeting_isactive,
bpg.isfirstnameonly,
bpgt.name AS c_greeting_name,
bpl.ad_org_id AS bp_location_ad_org_id,
bpl.c_bpartner_id AS bp_location_c_bpartner_id,
bpl.created AS bp_location_created,
bpl.createdby AS bp_location_createdby,
bpl.c_salesregion_id AS bp_location_c_salesregion_id,
bpl.fax AS bp_location_fax,
bpl.isactive AS bp_location_isactive,
bpl.isbillto AS bp_location_isbillto,
bpl.isdn AS bp_location_isdn,
bpl.ispayfrom AS bp_location_ispayfrom,
bpl.isremitto AS bp_location_isremitto,
bpl.isshipto AS bp_location_isshipto,
bpl.name AS bp_location_name,
bpl.phone AS bp_location_phone,
bpl.phone2 AS bp_location_phone2,
bpl.updated AS bp_location_updated,
bpl.updatedby AS bp_location_updatedby,
l.address1,
l.address2,
l.address3,
l.address4,
l.ad_org_id AS c_location_ad_org_id,
l.c_city_id,
l.c_country_id,
l.city,
l.created AS c_location_created,
l.createdby AS c_location_createdby,
l.c_region_id,
l.isactive AS c_location_isactive,
l.regionname,
l.updated AS c_location_updated,
l.updatedby AS c_location_updatedby,
bpc.ad_org_id AS ad_user_ad_org_id,
bpc.ad_orgtrx_id AS ad_user_ad_orgtrx_id,
bpc.birthday AS ad_user_ad_birthday,
bpc.c_bpartner_id AS ad_user_c_bpartner_id,
bpc.c_bpartner_location_id AS ad_user_c_bpartner_location_id,
bpc.c_greeting_id AS ad_user_c_greeting_id,
bpc.comments AS ad_user_comments,
bpc.created AS ad_user_created,
bpc.createdby AS ad_user_createdby,
bpc.description AS ad_user_description,
bpc.email AS ad_user_email,
bpc.fax AS ad_user_fax,
bpc.isactive AS ad_user_isactive,
bpc.lastcontact AS ad_user_lastcontact,
bpc.lastresult AS ad_user_lastresult,
bpc.phone2 AS ad_user_phone2,
bpc.supervisor_id AS ad_user_supervisor_id,
bpc.updated AS ad_user_updated,
bpc.updatedby AS ad_user_updatedby,
bpc.value AS ad_user_value,
bpcgt.ad_org_id AS c_user_greeting_ad_org_id,
bpcgt.isactive AS c_user_greeting_isactive,
bpcg.isfirstnameonly AS c_user_greeting_isfnameonly,
bpcgt.name AS c_user_greeting_name,
oi.ad_org_id AS ad_orginfo_ad_org_id,
oi.ad_orgtype_id,
oi.c_calendar_id,
oi.created AS ad_orginfo_created,
oi.createdby AS ad_orginfo_createdby,
oi.dropship_warehouse_id,
oi.duns AS ad_orginfo_duns,
oi.email AS ad_orginfo_email,
oi.fax AS ad_orginfo_fax,
oi.isactive AS ad_orginfo_isactive,
oi.m_warehouse_id AS ad_orginfo_m_warehouse_id,
oi.parent_org_id,
oi.phone AS ad_orginfo_phone,
oi.phone2 AS ad_orginfo_phone2,
oi.receiptfootermsg,
oi.supervisor_id,
oi.updated AS ad_orginfo_updated,
oi.updatedby AS ad_orginfo_updatedby,
u.ad_org_id AS salesrep_ad_org_id,
u.ad_orgtrx_id AS salesrep_ad_orgtrx_id,
u.birthday AS salesrep_ad_birthday,
u.c_bpartner_id AS salesrep_c_bpartner_id,
u.c_bpartner_location_id AS salesrep_c_bp_location_id,
u.c_greeting_id AS salesrep_c_greeting_id,
u.comments AS salesrep_comments,
u.created AS salesrep_created,
u.createdby AS salesrep_createdby,
u.description AS salesrep_description,
u.email AS salesrep_email,
u.fax AS salesrep_fax,
u.isactive AS salesrep_isactive,
u.lastcontact AS salesrep_lastcontact,
u.lastresult AS salesrep_lastresult,
u.phone AS salesrep_phone,
u.phone2 AS salesrep_phone2,
u.supervisor_id AS salesrep_supervisor_id,
u.title AS salesrep_title,
u.updated AS salesrep_updated,
u.updatedby AS salesrep_updatedby,
u.value AS salesrep_value,
ubp.acqusitioncost AS salesrep_bp_acqusitioncost,
ubp.actuallifetimevalue AS salesrep_bp_actuallifetimeval,
ubp.ad_language AS salesrep_bp_ad_language,
ubp.ad_orgbp_id AS salesrep_bp_ad_orgbp_id,
ubp.ad_org_id AS salesrep_bp_ad_org_id,
ubp.bpartner_parent_id AS salesrep_bp_bpartner_parent_id,
ubp.c_bp_group_id AS salesrep_bp_c_bp_group_id,
ubp.c_dunning_id AS salesrep_bp_c_dunning_id,
ubp.c_greeting_id AS salesrep_bp_c_greeting_id,
ubp.c_invoiceschedule_id AS salesrep_bp_c_invoicesched_id,
ubp.c_paymentterm_id AS salesrep_bp_c_paymentterm_id,
ubp.created AS salesrep_bp_created,
ubp.createdby AS salesrep_bp_createdby,
ubp.c_taxgroup_id AS salesrep_bp_c_taxgroup_id,
ubp.deliveryrule AS salesrep_bp_deliveryrule,
ubp.deliveryviarule AS salesrep_bp_deliveryviarule,
ubp.description AS salesrep_bp_description,
ubp.dunninggrace AS salesrep_bp_dunninggrace,
ubp.duns AS salesrep_bp_duns,
ubp.firstsale AS salesrep_bp_firstsale,
ubp.flatdiscount AS salesrep_bp_flatdiscount,
ubp.freightcostrule AS salesrep_bp_freightcostrule,
ubp.invoicerule AS salesrep_bp_invoicerule,
ubp.isactive AS salesrep_bp_isactive,
ubp.iscustomer AS salesrep_bp_iscustomer,
ubp.isdiscountprinted AS salesrep_bp_isdiscountprinted,
ubp.isemployee AS salesrep_bp_isemployee,
ubp.ismanufacturer AS salesrep_bp_ismanufacturer,
ubp.isonetime AS salesrep_bp_isonetime,
ubp.ispotaxexempt AS salesrep_bp_ispotaxexempt,
ubp.isprospect AS salesrep_bp_isprospect,
ubp.issalesrep AS salesrep_bp_issalesrep,
ubp.issummary AS salesrep_bp_issummary,
ubp.istaxexempt AS salesrep_bp_istaxexempt,
ubp.isvendor AS salesrep_bp_isvendor,
ubp.logo_id AS salesrep_bp_logo_id,
ubp.m_discountschema_id AS salesrep_bp_m_discountschm_id,
ubp.m_pricelist_id AS salesrep_bp_m_pricelist_id,
ubp.naics AS salesrep_bp_naics,
ubp.name2 AS salesrep_bp_name2,
ubp.numberemployees AS salesrep_bp_numberemployees,
ubp.paymentrule AS salesrep_bp_paymentrule,
ubp.paymentrulepo AS salesrep_bp_paymentrulepo,
ubp.po_discountschema_id AS salesrep_bp_po_discountschm_id,
ubp.po_paymentterm_id AS salesrep_bp_po_paymentterm_id,
ubp.po_pricelist_id AS salesrep_bp_po_pricelist_id,
ubp.poreference AS salesrep_bp_poreference,
ubp.potentiallifetimevalue AS salesrep_bp_potentiallifetime,
ubp.rating AS salesrep_bp_rating,
ubp.referenceno AS salesrep_bp_referenceno,
ubp.salesrep_id AS salesrep_bp_salesrep_id,
ubp.salesvolume AS salesrep_bp_salesvolume,
ubp.sendemail AS salesrep_bp_sendemail,
ubp.shareofcustomer AS salesrep_bp_shareofcustomer,
ubp.shelflifeminpct AS salesrep_bp_shelflifeminpct,
ubp.so_creditlimit AS salesrep_bp_so_creditlimit,
ubp.socreditstatus AS salesrep_bp_socreditstatus,
ubp.so_creditused AS salesrep_bp_so_creditused,
ubp.so_description AS salesrep_bp_so_description,
ubp.taxid AS salesrep_bp_taxid,
ubp.totalopenbalance AS salesrep_bp_totalopenbalance,
ubp.updated AS salesrep_bp_updated,
ubp.updatedby AS salesrep_bp_updatedby,
ubp.url AS salesrep_bp_url,
ubp.value AS salesrep_bp_value,
bbp.acqusitioncost AS bill_bp_acqusitioncost,
bbp.actuallifetimevalue AS bill_bp_actuallifetimevalue,
bbp.ad_language AS bill_bp_ad_language,
bbp.ad_orgbp_id AS bill_bp_ad_orgbp_id,
bbp.ad_org_id AS bill_bp_ad_org_id,
bbp.bpartner_parent_id AS bill_bp_bpartner_parent_id,
bbp.c_bp_group_id AS bill_bp_c_bp_group_id,
bbp.c_dunning_id AS bill_bp_c_dunning_id,
bbp.c_greeting_id AS bill_bp_c_greeting_id,
bbp.c_invoiceschedule_id AS bill_bp_c_invoiceschedule_id,
bbp.c_paymentterm_id AS bill_bp_c_paymentterm_id,
bbp.created AS bill_bp_created,
bbp.createdby AS bill_bp_createdby,
bbp.c_taxgroup_id AS bill_bp_c_taxgroup_id,
bbp.deliveryrule AS bill_bp_deliveryrule,
bbp.deliveryviarule AS bill_bp_deliveryviarule,
bbp.description AS bill_bp_description,
bbp.dunninggrace AS bill_bp_dunninggrace,
bbp.duns AS bill_bp_duns,
bbp.firstsale AS bill_bp_firstsale,
bbp.flatdiscount AS bill_bp_flatdiscount,
bbp.freightcostrule AS bill_bp_freightcostrule,
bbp.invoicerule AS bill_bp_invoicerule,
bbp.isactive AS bill_bp_isactive,
bbp.iscustomer AS bill_bp_iscustomer,
bbp.isdiscountprinted AS bill_bp_isdiscountprinted,
bbp.isemployee AS bill_bp_isemployee,
bbp.ismanufacturer AS bill_bp_ismanufacturer,
bbp.isonetime AS bill_bp_isonetime,
bbp.ispotaxexempt AS bill_bp_ispotaxexempt,
bbp.isprospect AS bill_bp_isprospect,
bbp.issalesrep AS bill_bp_issalesrep,
bbp.issummary AS bill_bp_issummary,
bbp.istaxexempt AS bill_bp_istaxexempt,
bbp.isvendor AS bill_bp_isvendor,
bbp.logo_id AS bill_bp_logo_id,
bbp.m_discountschema_id AS bill_bp_m_discountschema_id,
bbp.m_pricelist_id AS bill_bp_m_pricelist_id,
bbp.naics AS bill_bp_naics,
bbp.numberemployees AS bill_bp_numberemployees,
bbp.paymentrule AS bill_bp_paymentrule,
bbp.paymentrulepo AS bill_bp_paymentrulepo,
bbp.po_discountschema_id AS bill_bp_po_discountschema_id,
bbp.po_paymentterm_id AS bill_bp_po_paymentterm_id,
bbp.po_pricelist_id AS bill_bp_po_pricelist_id,
bbp.poreference AS bill_bp_poreference,
bbp.potentiallifetimevalue AS bill_bp_potentiallifetimevalue,
bbp.rating AS bill_bp_rating,
bbp.referenceno AS bill_bp_referenceno,
bbp.salesrep_id AS bill_bp_salesrep_id,
bbp.salesvolume AS bill_bp_salesvolume,
bbp.sendemail AS bill_bp_sendemail,
bbp.shareofcustomer AS bill_bp_shareofcustomer,
bbp.shelflifeminpct AS bill_bp_shelflifeminpct,
bbp.so_creditlimit AS bill_bp_so_creditlimit,
bbp.socreditstatus AS bill_bp_socreditstatus,
bbp.so_creditused AS bill_bp_so_creditused,
bbp.so_description AS bill_bp_so_description,
bbp.totalopenbalance AS bill_bp_totalopenbalance,
bbp.updated AS bill_bp_updated,
bbp.updatedby AS bill_bp_updatedby,
bbp.url AS bill_bp_url,
bbpl.ad_org_id AS bill_bp_location_ad_org_id,
bbpl.c_bpartner_id AS bill_bp_location_c_bpartner_id,
bbpl.created AS bill_bp_location_created,
bbpl.createdby AS bill_bp_location_createdby,
bbpl.c_salesregion_id AS bill_bp_location_c_salesreg_id,
bbpl.fax AS bill_bp_location_fax,
bbpl.isactive AS bill_bp_location_isactive,
bbpl.isbillto AS bill_bp_location_isbillto,
bbpl.isdn AS bill_bp_location_isdn,
bbpl.ispayfrom AS bill_bp_location_ispayfrom,
bbpl.isremitto AS bill_bp_location_isremitto,
bbpl.isshipto AS bill_bp_location_isshipto,
bbpl.name AS bill_bp_location_name,
bbpl.phone AS bill_bp_location_phone,
bbpl.phone2 AS bill_bp_location_phone2,
bbpl.updated AS bill_bp_location_updated,
bbpl.updatedby AS bill_bp_location_updatedby,
bbpc.ad_org_id AS bill_user_ad_org_id,
bbpc.ad_orgtrx_id AS bill_user_ad_orgtrx_id,
bbpc.birthday AS bill_user_ad_birthday,
bbpc.c_bpartner_id AS bill_user_c_bpartner_id,
bbpc.c_bpartner_location_id AS bill_user_c_bp_location_id,
bbpc.c_greeting_id AS bill_user_c_greeting_id,
bbpc.comments AS bill_user_comments,
bbpc.created AS bill_user_created,
bbpc.createdby AS bill_user_createdby,
bbpc.description AS bill_user_description,
bbpc.email AS bill_user_email,
bbpc.fax AS bill_user_fax,
bbpc.isactive AS bill_user_isactive,
bbpc.lastcontact AS bill_user_lastcontact,
bbpc.lastresult AS bill_user_lastresult,
bbpc.phone2 AS bill_user_phone2,
bbpc.supervisor_id AS bill_user_supervisor_id,
bbpc.updated AS bill_user_updated,
bbpc.updatedby AS bill_user_updatedby,
bbpc.value AS bill_user_value,
cur.cursymbol,
cur.description AS cur_description
FROM c_order o
JOIN c_doctype_trl dt
ON o.c_doctype_id = dt.c_doctype_id
JOIN m_warehouse wh
ON o.m_warehouse_id = wh.m_warehouse_id
JOIN c_paymentterm pt
ON o.c_paymentterm_id = pt.c_paymentterm_id
JOIN c_paymentterm_trl ptt
ON o.c_paymentterm_id = ptt.c_paymentterm_id
AND dt.ad_language = ptt.ad_language
JOIN c_bpartner bp
ON o.c_bpartner_id = bp.c_bpartner_id
LEFT JOIN c_greeting bpg
ON bp.c_greeting_id = bpg.c_greeting_id
LEFT JOIN c_greeting_trl bpgt
ON bp.c_greeting_id = bpgt.c_greeting_id
AND dt.ad_language = bpgt.ad_language
JOIN c_bpartner_location bpl
ON o.c_bpartner_location_id = bpl.c_bpartner_location_id
JOIN c_location l
ON bpl.c_location_id = l.c_location_id
LEFT JOIN ad_user bpc
ON o.ad_user_id = bpc.ad_user_id
LEFT JOIN c_greeting bpcg
ON bpc.c_greeting_id = bpcg.c_greeting_id
LEFT JOIN c_greeting_trl bpcgt
ON bpc.c_greeting_id = bpcgt.c_greeting_id
AND dt.ad_language = bpcgt.ad_language
JOIN ad_orginfo oi
ON o.ad_org_id = oi.ad_org_id
JOIN ad_clientinfo ci
ON o.ad_client_id = ci.ad_client_id
LEFT JOIN ad_user u
ON o.salesrep_id = u.ad_user_id
LEFT JOIN c_bpartner ubp
ON u.c_bpartner_id = ubp.c_bpartner_id
JOIN c_bpartner bbp
ON o.bill_bpartner_id = bbp.c_bpartner_id
JOIN c_bpartner_location bbpl
ON o.bill_location_id = bbpl.c_bpartner_location_id
LEFT JOIN ad_user bbpc
ON o.bill_user_id = bbpc.ad_user_id
LEFT JOIN c_currency_trl cur
ON o.c_currency_id = cur.c_currency_id
AND dt.ad_language = cur.ad_language
;
SELECT register_migration_script('201601271716_IDEMPIERE-3013.sql') FROM dual
;

View File

@ -0,0 +1,11 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-3022 Copy Columns from table error message
-- Feb 1, 2016 5:11:42 PM CET
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','Target table must not have columns',0,0,'Y',TO_DATE('2016-02-01 17:11:42','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2016-02-01 17:11:42','YYYY-MM-DD HH24:MI:SS'),0,200398,'ErrorCopyColumns','D','e74d8970-44f1-4cd0-9b5e-ee21af6c286e')
;
SELECT register_migration_script('201602011711_IDEMPIERE-3022.sql') FROM dual
;

View File

@ -0,0 +1,55 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-3005 Copy view and view components
-- Feb 1, 2016 4:04:17 PM CET
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','Target table must not have view components',0,0,'Y',TO_DATE('2016-02-01 16:04:16','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-02-01 16:04:16','YYYY-MM-DD HH24:MI:SS'),100,200397,'ErrorCopyView','D','9e9efdf9-cafd-4857-b4d5-37055b0d0786')
;
-- Feb 1, 2016 4:28:54 PM CET
INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,PrintName,EntityType,AD_Element_UU) VALUES (202975,0,0,'Y',TO_DATE('2016-02-01 16:28:53','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-02-01 16:28:53','YYYY-MM-DD HH24:MI:SS'),100,'CopyComponentsFromView','Copy Components From View','Copy Components From View','D','667adbfe-8e70-450b-9c45-e042c12f518a')
;
-- Feb 1, 2016 4:30:59 PM CET
INSERT INTO AD_Process (AD_Process_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,IsReport,Value,IsDirectPrint,Classname,AccessLevel,EntityType,Statistic_Count,Statistic_Seconds,IsBetaFunctionality,IsServerProcess,ShowHelp,CopyFromProcess,AD_Process_UU) VALUES (200086,0,0,'Y',TO_DATE('2016-02-01 16:30:59','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-02-01 16:30:59','YYYY-MM-DD HH24:MI:SS'),100,'Copy Components From View','Create dictionary view components for a table taking another as base','N','AD_Table_CopyComponentsFromView','N','org.compiere.process.CopyComponentsFromView','4','D',0,0,'N','N','Y','N','ebc55ee4-a02a-4505-9063-ae687e37ed6c')
;
-- Feb 1, 2016 4:32:56 PM CET
INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,IsRange,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200155,0,0,'Y',TO_DATE('2016-02-01 16:32:56','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-02-01 16:32:56','YYYY-MM-DD HH24:MI:SS'),100,'Table','Database Table information','The Database Table provides the information of the table definition',200086,10,19,'N',0,'Y','AD_Table_ID','Y','D',126,'ce32a1c1-2820-4610-ac00-109ed3ac5b03','N')
;
-- Feb 1, 2016 4:33:43 PM CET
INSERT INTO AD_Column (AD_Column_ID,Version,Name,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,AD_Process_ID,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure) VALUES (212637,0,'Copy Components From View',100,'CopyComponentsFromView',1,'N','N','N','N','N',0,'N',28,0,0,'Y',TO_DATE('2016-02-01 16:33:42','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-02-01 16:33:42','YYYY-MM-DD HH24:MI:SS'),100,202975,'Y',200086,'N','D','N','N','N','Y','c9a6c992-0cac-4559-b3e3-b9981cb5db4f','Y',0,'Y','N')
;
-- Feb 1, 2016 4:33:49 PM CET
INSERT INTO AD_TreeNode (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo, AD_TreeNode_UU) SELECT t.AD_Client_ID, 0, 'Y', SysDate, 100, SysDate, 100,t.AD_Tree_ID, 200004, 0, 999, Generate_UUID() FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='TL' AND t.AD_Table_ID=282 AND NOT EXISTS (SELECT * FROM AD_TreeNode e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=200004)
;
-- Feb 1, 2016 4:33:49 PM CET
ALTER TABLE AD_Table ADD CopyComponentsFromView CHAR(1) DEFAULT NULL
;
-- Feb 1, 2016 4:34:53 PM CET
INSERT INTO AD_TreeNode (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo, AD_TreeNode_UU) SELECT t.AD_Client_ID, 0, 'Y', SysDate, 100, SysDate, 100,t.AD_Tree_ID, 200005, 0, 999, Generate_UUID() FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='TL' AND t.AD_Table_ID=282 AND NOT EXISTS (SELECT * FROM AD_TreeNode e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=200005)
;
-- Feb 1, 2016 4:34:53 PM CET
INSERT INTO AD_Field (AD_Field_ID,Name,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan) VALUES (204137,'Copy Components From View',100,212637,'Y',1,220,'N','N','N','N',0,0,'Y',TO_DATE('2016-02-01 16:34:53','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-02-01 16:34:53','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','063d15a1-b7df-4f27-8d37-23360fae8f83','Y',190,2,2)
;
-- Feb 1, 2016 4:35:53 PM CET
UPDATE AD_Field SET DisplayLogic='@IsView@=''Y''',Updated=TO_DATE('2016-02-01 16:35:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204137
;
-- Feb 3, 2016 5:06:14 PM CET
INSERT INTO AD_Val_Rule (AD_Val_Rule_ID,Name,Type,Code,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Val_Rule_UU) VALUES (200088,'AD_Table is View','S','AD_Table.IsView=''Y''',0,0,'Y',TO_DATE('2016-02-03 17:06:14','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-02-03 17:06:14','YYYY-MM-DD HH24:MI:SS'),100,'D','84fba66f-4489-4993-8ea9-84fec646dd42')
;
-- Feb 3, 2016 5:06:28 PM CET
UPDATE AD_Process_Para SET AD_Val_Rule_ID=200088,Updated=TO_DATE('2016-02-03 17:06:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=200155
;
SELECT register_migration_script('201602031708_IDEMPIERE-3005.sql') FROM dual
;

View File

@ -0,0 +1,11 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-3004 View Column - View Component require SeqNo
-- Feb 3, 2016 8:35:41 PM CET
UPDATE AD_Column SET IsUpdateable='Y',Updated=TO_DATE('2016-02-03 20:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=210567
;
SELECT register_migration_script('201602032036_IDEMPIERE-3004.sql') FROM dual
;

View File

@ -0,0 +1,11 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-3027 'Closed' projects are still selectable in drop downs
-- Feb 4, 2016 2:27:17 PM UTC
UPDATE AD_Val_Rule SET Code='C_Project.Processed=''N'' AND C_Project.IsSummary=''N'' AND (C_Project.C_BPartner_ID IS NULL OR C_Project.C_BPartner_ID=@C_BPartner_ID@ OR C_Project.C_BPartnerSR_ID=@C_BPartner_ID@)',Updated=TO_DATE('2016-02-04 14:27:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=227
;
SELECT register_migration_script('201602171450_IDEMPIERE-3027.sql') FROM dual
;

View File

@ -0,0 +1,26 @@
-- IDEMPIERE-2064 Show all DocAction button in trx windows in toolbar and window
update ad_column set istoolbarbutton='B' where ad_column_id in (
1789,
2171,
3495,
4324,
5497,
10797,
11480,
12076,
12120,
12282,
12319,
12330,
12412,
12449,
12461,
59447,
59452,
59480,
210983)
;
SELECT register_migration_script('201602191721_IDEMPIERE-2064.sql') FROM dual
;

View File

@ -0,0 +1,11 @@
-- IDEMPIERE-3052 Advanced Search on doctype on invoices or orders shows all the doctypes
update ad_column set AD_Val_Rule_ID=124 where AD_Column_ID=3493 and AD_Val_Rule_ID IS NULL
;
update ad_column set AD_Val_Rule_ID=133 where AD_Column_ID=2172 and AD_Val_Rule_ID IS NULL
;
SELECT register_migration_script('201603110209_IDEMPIERE-3052.sql') FROM dual
;

View File

@ -0,0 +1,7 @@
-- IDEMPIERE-2985 : Recurring : implement Payment
-- Dec 23, 2015 2:43:32 PM CET
INSERT INTO AD_Ref_List (AD_Ref_List_ID,Name,AD_Reference_ID,Value,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Ref_List_UU) VALUES (200345,'Payment',282,'P',0,0,'Y',TO_TIMESTAMP('2015-12-23 14:43:31','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2015-12-23 14:43:31','YYYY-MM-DD HH24:MI:SS'),100,'D','b3e77f8d-0d0d-4bf5-bb42-d998fb0c728c')
;
SELECT register_migration_script('201512231444_IDEMPIERE-2985.sql') FROM dual
;

View File

@ -0,0 +1,12 @@
-- IDEMPIERE-3004: View Column - View Component require SeqNo
-- Jan 25, 2016 4:42:40 PM CET
UPDATE AD_Column SET DefaultValue='@SQL=SELECT COALESCE(MAX(SeqNo),0)+10 AS DefaultValue FROM AD_ViewComponent WHERE AD_Table_ID=@AD_Table_ID@', IsUpdateable='N',Updated=TO_TIMESTAMP('2016-01-25 16:42:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=210567
;
-- Jan 25, 2016 4:49:47 PM CET
UPDATE AD_Field SET SortNo=1.0,Updated=TO_TIMESTAMP('2016-01-25 16:49:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202233
;
SELECT register_migration_script('201601161701_IDEMPIERE-3004.sql') FROM dual
;

View File

@ -0,0 +1,39 @@
-- IDEMPIERE-3004: View Column - View Component require SeqNo
-- Jan 25, 2016 5:22:40 PM CET
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure) VALUES (212635,0,'Sequence','Method of ordering records; lowest number comes first','The Sequence indicates the order of records',200088,'SeqNo','@SQL=SELECT COALESCE(MAX(SeqNo),0)+10 AS DefaultValue FROM AD_ViewColumn WHERE AD_Table_ID=@AD_Table_ID@',22,'N','N','N','N','N',0,'N',11,0,0,'Y',TO_TIMESTAMP('2016-01-25 17:22:39','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-01-25 17:22:39','YYYY-MM-DD HH24:MI:SS'),100,566,'Y','N','D','N','N','N','Y','cc51c32b-7c4a-49c8-a9d4-94989260e242','Y',0,'N','N')
;
-- Jan 25, 2016 5:24:53 PM CET
UPDATE AD_Column SET DefaultValue='@SQL=SELECT COALESCE(MAX(SeqNo),0)+10 AS DefaultValue FROM AD_ViewColumn WHERE AD_ViewComponent_ID=@AD_ViewComponent_ID@',Updated=TO_TIMESTAMP('2016-01-25 17:24:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=212635
;
-- Jan 25, 2016 5:25:19 PM CET
ALTER TABLE AD_ViewColumn ADD COLUMN SeqNo NUMERIC(10) DEFAULT NULL
;
-- Jan 25, 2016 5:27:04 PM CET
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (204135,'Sequence','Method of ordering records; lowest number comes first','The Sequence indicates the order of records',200099,212635,'Y',22,110,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2016-01-25 17:27:04','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-01-25 17:27:04','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','6f955e38-0d37-4410-b8d2-3034ab5edd4a','Y',90,2)
;
-- Jan 25, 2016 5:27:47 PM CET
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=90, XPosition=4,Updated=TO_TIMESTAMP('2016-01-25 17:27:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204135
;
-- Jan 25, 2016 5:27:48 PM CET
UPDATE AD_Field SET SeqNo=100,Updated=TO_TIMESTAMP('2016-01-25 17:27:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202244
;
-- Jan 25, 2016 5:27:48 PM CET
UPDATE AD_Field SET SeqNo=110,Updated=TO_TIMESTAMP('2016-01-25 17:27:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202248
;
-- Jan 25, 2016 5:28:00 PM CET
UPDATE AD_Field SET SortNo=1.0,Updated=TO_TIMESTAMP('2016-01-25 17:28:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204135
;
-- Jan 25, 2016 5:28:00 PM CET
UPDATE AD_ViewColumn SET SeqNo = 0,Updated=TO_TIMESTAMP('2016-01-25 17:28:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100
;
SELECT register_migration_script('201601161728_IDEMPIERE-3004.sql') FROM dual
;

View File

@ -0,0 +1,50 @@
-- Jan 20, 2016 2:26:58 PM CET
-- IDEMPIERE-2954
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200393,'0e4f4eec-17f8-478e-a598-ed833bf5493c',0,TO_TIMESTAMP('2016-01-20 14:26:57','YYYY-MM-DD HH24:MI:SS'),0,'D','Y','Could not convert currency {0} to base currency {1}','I',TO_TIMESTAMP('2016-01-20 14:26:57','YYYY-MM-DD HH24:MI:SS'),0,'ErrorConvertingCurrencyToProjectCurrency')
;
UPDATE AD_Message SET MsgText='Could not convert currency {0} to base currency {1} - converstion type : {2} / Date : {3}',Updated=TO_TIMESTAMP('2016-01-20 15:34:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Message_ID=200393
;
-- Jan 20, 2016 3:34:28 PM CET
UPDATE AD_Message SET MsgText='Could not convert currency {0} to project currency {1} - converstion type : {2} / Date : {3}',Updated=TO_TIMESTAMP('2016-01-20 15:34:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Message_ID=200393
;
-- Jan 20, 2016 3:34:38 PM CET
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200394,'64dd01ce-7afb-4db6-8641-bd80f7248ecd',0,TO_TIMESTAMP('2016-01-20 15:34:37','YYYY-MM-DD HH24:MI:SS'),0,'D','Y','Could not convert currency {0} to base currency {1} - converstion type : {2} / Date : {3}','I',TO_TIMESTAMP('2016-01-20 15:34:37','YYYY-MM-DD HH24:MI:SS'),0,'ErrorConvertingCurrencyToBaseCurrency')
;
-- Jan 20, 2016 3:35:50 PM CET
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200395,'66d383a0-ad94-435c-ac96-f03903fcda59',0,TO_TIMESTAMP('2016-01-20 15:35:50','YYYY-MM-DD HH24:MI:SS'),0,'D','Y','Could not convert allocation currency {0} to base currency {1} - conversion type : {2} / conversion date : {3}','I',TO_TIMESTAMP('2016-01-20 15:35:50','YYYY-MM-DD HH24:MI:SS'),0,'ErrorConvertingAllocationCurrencyToBaseCurrency')
;
-- Jan 20, 2016 3:36:05 PM CET
UPDATE AD_Message SET EntityType='D', MsgText='Could not convert currency {0} to base currency {1} - conversion type : {2} / conversion date : {3}',Updated=TO_TIMESTAMP('2016-01-20 15:36:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Message_ID=200394
;
-- Jan 20, 2016 3:36:15 PM CET
UPDATE AD_Message SET MsgText='Could not convert currency {0} to project currency {1} - conversion type : {2} / conversion date : {3}',Updated=TO_TIMESTAMP('2016-01-20 15:36:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Message_ID=200393
;
-- Jan 20, 2016 3:36:20 PM CET
UPDATE AD_Message SET EntityType='D',Updated=TO_TIMESTAMP('2016-01-20 15:36:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Message_ID=200395
;
-- Jan 20, 2016 3:36:59 PM CET
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200396,'449bfa95-a175-4862-98c2-525c6a564c60',0,TO_TIMESTAMP('2016-01-20 15:36:59','YYYY-MM-DD HH24:MI:SS'),0,'D','Y','Could not convert invoice currency {0} to base currency {1} - conversion type : {2} / conversion date : {3}','I',TO_TIMESTAMP('2016-01-20 15:36:59','YYYY-MM-DD HH24:MI:SS'),0,'ErrorConvertingInvoiceCurrencyToBaseCurrency')
;
-- Jan 20, 2016 4:47:30 PM CET
UPDATE AD_Message SET MsgText='Could not convert currency {0} to base currency {1} - conversion type : {2} / conversion date : {3,date,short}',Updated=TO_TIMESTAMP('2016-01-20 16:47:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200394
;
-- Jan 20, 2016 4:47:33 PM CET
UPDATE AD_Message SET MsgText='Could not convert currency {0} to project currency {1} - conversion type : {2} / conversion date : {3,date,short}',Updated=TO_TIMESTAMP('2016-01-20 16:47:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200393
;
-- Jan 20, 2016 4:47:37 PM CET
UPDATE AD_Message SET MsgText='Could not convert invoice currency {0} to base currency {1} - conversion type : {2} / conversion date : {3,date,short}',Updated=TO_TIMESTAMP('2016-01-20 16:47:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200396
;
SELECT register_migration_script('201601201427_IDEMPIERE-2954.sql') FROM dual
;

View File

@ -0,0 +1,8 @@
-- IDEMPIERE-3015
-- Jan 27, 2016 5:03:50 PM CET
UPDATE AD_Column SET IsParent='Y', IsUpdateable='N',Updated=TO_TIMESTAMP('2016-01-27 17:03:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=749
;
SELECT register_migration_script('201601271704_IDEMPIERE-3015.sql') FROM dual
;

View File

@ -0,0 +1,521 @@
DROP VIEW c_order_header_vt;
CREATE OR REPLACE VIEW c_order_header_vt AS
SELECT o.ad_client_id,
o.ad_org_id,
o.isactive,
o.created,
o.createdby,
o.updated,
o.updatedby,
dt.ad_language,
o.c_order_id,
o.issotrx,
o.documentno,
o.docstatus,
o.c_doctype_id,
o.c_bpartner_id,
bp.value AS bpvalue,
bp.taxid AS bptaxid,
bp.naics,
bp.duns,
oi.c_location_id AS org_location_id,
oi.taxid,
o.m_warehouse_id,
wh.c_location_id AS warehouse_location_id,
dt.printname AS documenttype,
dt.documentnote AS documenttypenote,
o.salesrep_id,
COALESCE(ubp.name, u.name) AS salesrep_name,
o.dateordered,
o.datepromised,
bpgt.greeting AS bpgreeting,
bp.name,
bp.name2,
bpcgt.greeting AS bpcontactgreeting,
bpc.title,
bpc.phone,
NULLIF(bpc.name, bp.name) AS contactname,
bpl.c_location_id,
l.postal || l.postal_add AS postal,
bp.referenceno,
o.bill_bpartner_id,
o.bill_location_id,
o.bill_user_id,
bbp.value AS bill_bpvalue,
bbp.taxid AS bill_bptaxid,
bbp.name AS bill_name,
bbp.name2 AS bill_name2,
bbpc.title AS bill_title,
bbpc.phone AS bill_phone,
NULLIF(bbpc.name, bbp.name) AS bill_contactname,
bbpl.c_location_id AS bill_c_location_id,
o.description,
o.poreference,
o.c_currency_id,
ptt.name AS paymentterm,
ptt.documentnote AS paymenttermnote,
o.c_charge_id,
o.chargeamt,
o.totallines,
o.grandtotal,
o.grandtotal AS amtinwords,
o.m_pricelist_id,
o.istaxincluded,
o.volume,
o.weight,
o.c_campaign_id,
o.c_project_id,
o.c_activity_id,
o.m_shipper_id,
o.deliveryrule,
o.deliveryviarule,
o.priorityrule,
o.invoicerule,
COALESCE(oi.logo_id, ci.logo_id) AS logo_id,
o.ad_orgtrx_id,
o.ad_user_id,
o.amountrefunded,
o.amounttendered,
o.c_bpartner_location_id,
o.c_cashline_id,
o.c_cashplanline_id,
o.c_conversiontype_id,
o.c_doctypetarget_id,
o.copyfrom,
o.c_payment_id,
o.c_paymentterm_id,
o.c_pos_id,
o.dateacct,
o.dateprinted,
o.docaction,
o.dropship_bpartner_id,
o.dropship_location_id,
o.dropship_user_id,
o.freightamt,
o.freightcostrule,
o.isapproved,
o.iscreditapproved,
o.isdelivered,
o.isdiscountprinted,
o.isdropship,
o.isinvoiced,
o.ispayschedulevalid,
o.isprinted,
o.isselected,
o.isselfservice,
o.istransferred,
o.link_order_id,
o.m_freightcategory_id,
o.ordertype,
o.pay_bpartner_id,
o.pay_location_id,
o.paymentrule,
o.posted,
o.processed,
o.processedon,
o.promotioncode,
o.ref_order_id,
o.sendemail,
o.user1_id,
o.user2_id,
wh.ad_org_id AS m_warehouse_ad_org_id,
wh.description AS m_warehouse_description,
wh.isactive AS m_warehouse_isactive,
wh.isdisallownegativeinv,
wh.isintransit,
wh.m_warehousesource_id,
wh.name AS m_warehouse_name,
wh.replenishmentclass,
wh.separator,
wh.value AS m_warehouse_value,
ptt.ad_org_id AS c_paymentterm_ad_org_id,
pt.afterdelivery,
ptt.description AS c_paymentterm_description,
pt.discount,
pt.discount2,
pt.discountdays,
pt.discountdays2,
pt.fixmonthcutoff,
pt.fixmonthday,
pt.fixmonthoffset,
pt.gracedays,
ptt.isactive AS c_paymentterm_isactive,
pt.isdefault,
pt.isduefixed,
pt.isnextbusinessday,
pt.isvalid,
pt.netday,
pt.netdays,
pt.paymenttermusage,
pt.value AS m_paymentterm_value,
bp.acqusitioncost AS bp_acqusitioncost,
bp.actuallifetimevalue AS bp_actuallifetimevalue,
bp.ad_language AS bp_ad_language,
bp.ad_orgbp_id AS bp_ad_orgbp_id,
bp.ad_org_id AS bp_ad_org_id,
bp.bpartner_parent_id AS bp_bpartner_parent_id,
bp.c_bp_group_id AS bp_c_bp_group_id,
bp.c_dunning_id AS bp_c_dunning_id,
bp.c_greeting_id AS bp_c_greeting_id,
bp.c_invoiceschedule_id AS bp_c_invoiceschedule_id,
bp.c_paymentterm_id AS bp_c_paymentterm_id,
bp.created AS bp_created,
bp.createdby AS bp_createdby,
bp.c_taxgroup_id AS bp_c_taxgroup_id,
bp.deliveryrule AS bp_deliveryrule,
bp.deliveryviarule AS bp_deliveryviarule,
bp.description AS bp_description,
bp.dunninggrace AS bp_dunninggrace,
bp.firstsale AS bp_firstsale,
bp.flatdiscount AS bp_flatdiscount,
bp.freightcostrule AS bp_freightcostrule,
bp.invoicerule AS bp_invoicerule,
bp.isactive AS bp_isactive,
bp.iscustomer AS bp_iscustomer,
bp.isdiscountprinted AS bp_isdiscountprinted,
bp.isemployee AS bp_isemployee,
bp.ismanufacturer AS bp_ismanufacturer,
bp.isonetime AS bp_isonetime,
bp.ispotaxexempt AS bp_ispotaxexempt,
bp.isprospect AS bp_isprospect,
bp.issalesrep AS bp_issalesrep,
bp.issummary AS bp_issummary,
bp.istaxexempt AS bp_istaxexempt,
bp.isvendor AS bp_isvendor,
bp.logo_id AS bp_logo_id,
bp.m_discountschema_id AS bp_m_discountschema_id,
bp.m_pricelist_id AS bp_m_pricelist_id,
bp.numberemployees AS bp_numberemployees,
bp.paymentrule AS bp_paymentrule,
bp.paymentrulepo AS bp_paymentrulepo,
bp.po_discountschema_id AS bp_po_discountschema_id,
bp.po_paymentterm_id AS bp_po_paymentterm_id,
bp.po_pricelist_id AS bp_po_pricelist_id,
bp.poreference AS bp_poreference,
bp.potentiallifetimevalue AS bp_potentiallifetimevalue,
bp.rating AS bp_rating,
bp.salesrep_id AS bp_salesrep_id,
bp.salesvolume AS bp_salesvolume,
bp.sendemail AS bp_sendemail,
bp.shareofcustomer AS bp_shareofcustomer,
bp.shelflifeminpct AS bp_shelflifeminpct,
bp.so_creditlimit AS bp_so_creditlimit,
bp.socreditstatus AS bp_socreditstatus,
bp.so_creditused AS bp_so_creditused,
bp.so_description AS bp_so_description,
bp.totalopenbalance AS bp_totalopenbalance,
bp.updated AS bp_updated,
bp.updatedby AS bp_updatedby,
bp.url AS bp_url,
bpgt.ad_org_id AS c_greeting_ad_org_id,
bpgt.isactive AS c_greeting_isactive,
bpg.isfirstnameonly,
bpgt.name AS c_greeting_name,
bpl.ad_org_id AS bp_location_ad_org_id,
bpl.c_bpartner_id AS bp_location_c_bpartner_id,
bpl.created AS bp_location_created,
bpl.createdby AS bp_location_createdby,
bpl.c_salesregion_id AS bp_location_c_salesregion_id,
bpl.fax AS bp_location_fax,
bpl.isactive AS bp_location_isactive,
bpl.isbillto AS bp_location_isbillto,
bpl.isdn AS bp_location_isdn,
bpl.ispayfrom AS bp_location_ispayfrom,
bpl.isremitto AS bp_location_isremitto,
bpl.isshipto AS bp_location_isshipto,
bpl.name AS bp_location_name,
bpl.phone AS bp_location_phone,
bpl.phone2 AS bp_location_phone2,
bpl.updated AS bp_location_updated,
bpl.updatedby AS bp_location_updatedby,
l.address1,
l.address2,
l.address3,
l.address4,
l.ad_org_id AS c_location_ad_org_id,
l.c_city_id,
l.c_country_id,
l.city,
l.created AS c_location_created,
l.createdby AS c_location_createdby,
l.c_region_id,
l.isactive AS c_location_isactive,
l.regionname,
l.updated AS c_location_updated,
l.updatedby AS c_location_updatedby,
bpc.ad_org_id AS ad_user_ad_org_id,
bpc.ad_orgtrx_id AS ad_user_ad_orgtrx_id,
bpc.birthday AS ad_user_ad_birthday,
bpc.c_bpartner_id AS ad_user_c_bpartner_id,
bpc.c_bpartner_location_id AS ad_user_c_bpartner_location_id,
bpc.c_greeting_id AS ad_user_c_greeting_id,
bpc.comments AS ad_user_comments,
bpc.created AS ad_user_created,
bpc.createdby AS ad_user_createdby,
bpc.description AS ad_user_description,
bpc.email AS ad_user_email,
bpc.fax AS ad_user_fax,
bpc.isactive AS ad_user_isactive,
bpc.lastcontact AS ad_user_lastcontact,
bpc.lastresult AS ad_user_lastresult,
bpc.phone2 AS ad_user_phone2,
bpc.supervisor_id AS ad_user_supervisor_id,
bpc.updated AS ad_user_updated,
bpc.updatedby AS ad_user_updatedby,
bpc.value AS ad_user_value,
bpcgt.ad_org_id AS c_user_greeting_ad_org_id,
bpcgt.isactive AS c_user_greeting_isactive,
bpcg.isfirstnameonly AS c_user_greeting_isfnameonly,
bpcgt.name AS c_user_greeting_name,
oi.ad_org_id AS ad_orginfo_ad_org_id,
oi.ad_orgtype_id,
oi.c_calendar_id,
oi.created AS ad_orginfo_created,
oi.createdby AS ad_orginfo_createdby,
oi.dropship_warehouse_id,
oi.duns AS ad_orginfo_duns,
oi.email AS ad_orginfo_email,
oi.fax AS ad_orginfo_fax,
oi.isactive AS ad_orginfo_isactive,
oi.m_warehouse_id AS ad_orginfo_m_warehouse_id,
oi.parent_org_id,
oi.phone AS ad_orginfo_phone,
oi.phone2 AS ad_orginfo_phone2,
oi.receiptfootermsg,
oi.supervisor_id,
oi.updated AS ad_orginfo_updated,
oi.updatedby AS ad_orginfo_updatedby,
u.ad_org_id AS salesrep_ad_org_id,
u.ad_orgtrx_id AS salesrep_ad_orgtrx_id,
u.birthday AS salesrep_ad_birthday,
u.c_bpartner_id AS salesrep_c_bpartner_id,
u.c_bpartner_location_id AS salesrep_c_bp_location_id,
u.c_greeting_id AS salesrep_c_greeting_id,
u.comments AS salesrep_comments,
u.created AS salesrep_created,
u.createdby AS salesrep_createdby,
u.description AS salesrep_description,
u.email AS salesrep_email,
u.fax AS salesrep_fax,
u.isactive AS salesrep_isactive,
u.lastcontact AS salesrep_lastcontact,
u.lastresult AS salesrep_lastresult,
u.phone AS salesrep_phone,
u.phone2 AS salesrep_phone2,
u.supervisor_id AS salesrep_supervisor_id,
u.title AS salesrep_title,
u.updated AS salesrep_updated,
u.updatedby AS salesrep_updatedby,
u.value AS salesrep_value,
ubp.acqusitioncost AS salesrep_bp_acqusitioncost,
ubp.actuallifetimevalue AS salesrep_bp_actuallifetimeval,
ubp.ad_language AS salesrep_bp_ad_language,
ubp.ad_orgbp_id AS salesrep_bp_ad_orgbp_id,
ubp.ad_org_id AS salesrep_bp_ad_org_id,
ubp.bpartner_parent_id AS salesrep_bp_bpartner_parent_id,
ubp.c_bp_group_id AS salesrep_bp_c_bp_group_id,
ubp.c_dunning_id AS salesrep_bp_c_dunning_id,
ubp.c_greeting_id AS salesrep_bp_c_greeting_id,
ubp.c_invoiceschedule_id AS salesrep_bp_c_invoicesched_id,
ubp.c_paymentterm_id AS salesrep_bp_c_paymentterm_id,
ubp.created AS salesrep_bp_created,
ubp.createdby AS salesrep_bp_createdby,
ubp.c_taxgroup_id AS salesrep_bp_c_taxgroup_id,
ubp.deliveryrule AS salesrep_bp_deliveryrule,
ubp.deliveryviarule AS salesrep_bp_deliveryviarule,
ubp.description AS salesrep_bp_description,
ubp.dunninggrace AS salesrep_bp_dunninggrace,
ubp.duns AS salesrep_bp_duns,
ubp.firstsale AS salesrep_bp_firstsale,
ubp.flatdiscount AS salesrep_bp_flatdiscount,
ubp.freightcostrule AS salesrep_bp_freightcostrule,
ubp.invoicerule AS salesrep_bp_invoicerule,
ubp.isactive AS salesrep_bp_isactive,
ubp.iscustomer AS salesrep_bp_iscustomer,
ubp.isdiscountprinted AS salesrep_bp_isdiscountprinted,
ubp.isemployee AS salesrep_bp_isemployee,
ubp.ismanufacturer AS salesrep_bp_ismanufacturer,
ubp.isonetime AS salesrep_bp_isonetime,
ubp.ispotaxexempt AS salesrep_bp_ispotaxexempt,
ubp.isprospect AS salesrep_bp_isprospect,
ubp.issalesrep AS salesrep_bp_issalesrep,
ubp.issummary AS salesrep_bp_issummary,
ubp.istaxexempt AS salesrep_bp_istaxexempt,
ubp.isvendor AS salesrep_bp_isvendor,
ubp.logo_id AS salesrep_bp_logo_id,
ubp.m_discountschema_id AS salesrep_bp_m_discountschm_id,
ubp.m_pricelist_id AS salesrep_bp_m_pricelist_id,
ubp.naics AS salesrep_bp_naics,
ubp.name2 AS salesrep_bp_name2,
ubp.numberemployees AS salesrep_bp_numberemployees,
ubp.paymentrule AS salesrep_bp_paymentrule,
ubp.paymentrulepo AS salesrep_bp_paymentrulepo,
ubp.po_discountschema_id AS salesrep_bp_po_discountschm_id,
ubp.po_paymentterm_id AS salesrep_bp_po_paymentterm_id,
ubp.po_pricelist_id AS salesrep_bp_po_pricelist_id,
ubp.poreference AS salesrep_bp_poreference,
ubp.potentiallifetimevalue AS salesrep_bp_potentiallifetime,
ubp.rating AS salesrep_bp_rating,
ubp.referenceno AS salesrep_bp_referenceno,
ubp.salesrep_id AS salesrep_bp_salesrep_id,
ubp.salesvolume AS salesrep_bp_salesvolume,
ubp.sendemail AS salesrep_bp_sendemail,
ubp.shareofcustomer AS salesrep_bp_shareofcustomer,
ubp.shelflifeminpct AS salesrep_bp_shelflifeminpct,
ubp.so_creditlimit AS salesrep_bp_so_creditlimit,
ubp.socreditstatus AS salesrep_bp_socreditstatus,
ubp.so_creditused AS salesrep_bp_so_creditused,
ubp.so_description AS salesrep_bp_so_description,
ubp.taxid AS salesrep_bp_taxid,
ubp.totalopenbalance AS salesrep_bp_totalopenbalance,
ubp.updated AS salesrep_bp_updated,
ubp.updatedby AS salesrep_bp_updatedby,
ubp.url AS salesrep_bp_url,
ubp.value AS salesrep_bp_value,
bbp.acqusitioncost AS bill_bp_acqusitioncost,
bbp.actuallifetimevalue AS bill_bp_actuallifetimevalue,
bbp.ad_language AS bill_bp_ad_language,
bbp.ad_orgbp_id AS bill_bp_ad_orgbp_id,
bbp.ad_org_id AS bill_bp_ad_org_id,
bbp.bpartner_parent_id AS bill_bp_bpartner_parent_id,
bbp.c_bp_group_id AS bill_bp_c_bp_group_id,
bbp.c_dunning_id AS bill_bp_c_dunning_id,
bbp.c_greeting_id AS bill_bp_c_greeting_id,
bbp.c_invoiceschedule_id AS bill_bp_c_invoiceschedule_id,
bbp.c_paymentterm_id AS bill_bp_c_paymentterm_id,
bbp.created AS bill_bp_created,
bbp.createdby AS bill_bp_createdby,
bbp.c_taxgroup_id AS bill_bp_c_taxgroup_id,
bbp.deliveryrule AS bill_bp_deliveryrule,
bbp.deliveryviarule AS bill_bp_deliveryviarule,
bbp.description AS bill_bp_description,
bbp.dunninggrace AS bill_bp_dunninggrace,
bbp.duns AS bill_bp_duns,
bbp.firstsale AS bill_bp_firstsale,
bbp.flatdiscount AS bill_bp_flatdiscount,
bbp.freightcostrule AS bill_bp_freightcostrule,
bbp.invoicerule AS bill_bp_invoicerule,
bbp.isactive AS bill_bp_isactive,
bbp.iscustomer AS bill_bp_iscustomer,
bbp.isdiscountprinted AS bill_bp_isdiscountprinted,
bbp.isemployee AS bill_bp_isemployee,
bbp.ismanufacturer AS bill_bp_ismanufacturer,
bbp.isonetime AS bill_bp_isonetime,
bbp.ispotaxexempt AS bill_bp_ispotaxexempt,
bbp.isprospect AS bill_bp_isprospect,
bbp.issalesrep AS bill_bp_issalesrep,
bbp.issummary AS bill_bp_issummary,
bbp.istaxexempt AS bill_bp_istaxexempt,
bbp.isvendor AS bill_bp_isvendor,
bbp.logo_id AS bill_bp_logo_id,
bbp.m_discountschema_id AS bill_bp_m_discountschema_id,
bbp.m_pricelist_id AS bill_bp_m_pricelist_id,
bbp.naics AS bill_bp_naics,
bbp.numberemployees AS bill_bp_numberemployees,
bbp.paymentrule AS bill_bp_paymentrule,
bbp.paymentrulepo AS bill_bp_paymentrulepo,
bbp.po_discountschema_id AS bill_bp_po_discountschema_id,
bbp.po_paymentterm_id AS bill_bp_po_paymentterm_id,
bbp.po_pricelist_id AS bill_bp_po_pricelist_id,
bbp.poreference AS bill_bp_poreference,
bbp.potentiallifetimevalue AS bill_bp_potentiallifetimevalue,
bbp.rating AS bill_bp_rating,
bbp.referenceno AS bill_bp_referenceno,
bbp.salesrep_id AS bill_bp_salesrep_id,
bbp.salesvolume AS bill_bp_salesvolume,
bbp.sendemail AS bill_bp_sendemail,
bbp.shareofcustomer AS bill_bp_shareofcustomer,
bbp.shelflifeminpct AS bill_bp_shelflifeminpct,
bbp.so_creditlimit AS bill_bp_so_creditlimit,
bbp.socreditstatus AS bill_bp_socreditstatus,
bbp.so_creditused AS bill_bp_so_creditused,
bbp.so_description AS bill_bp_so_description,
bbp.totalopenbalance AS bill_bp_totalopenbalance,
bbp.updated AS bill_bp_updated,
bbp.updatedby AS bill_bp_updatedby,
bbp.url AS bill_bp_url,
bbpl.ad_org_id AS bill_bp_location_ad_org_id,
bbpl.c_bpartner_id AS bill_bp_location_c_bpartner_id,
bbpl.created AS bill_bp_location_created,
bbpl.createdby AS bill_bp_location_createdby,
bbpl.c_salesregion_id AS bill_bp_location_c_salesreg_id,
bbpl.fax AS bill_bp_location_fax,
bbpl.isactive AS bill_bp_location_isactive,
bbpl.isbillto AS bill_bp_location_isbillto,
bbpl.isdn AS bill_bp_location_isdn,
bbpl.ispayfrom AS bill_bp_location_ispayfrom,
bbpl.isremitto AS bill_bp_location_isremitto,
bbpl.isshipto AS bill_bp_location_isshipto,
bbpl.name AS bill_bp_location_name,
bbpl.phone AS bill_bp_location_phone,
bbpl.phone2 AS bill_bp_location_phone2,
bbpl.updated AS bill_bp_location_updated,
bbpl.updatedby AS bill_bp_location_updatedby,
bbpc.ad_org_id AS bill_user_ad_org_id,
bbpc.ad_orgtrx_id AS bill_user_ad_orgtrx_id,
bbpc.birthday AS bill_user_ad_birthday,
bbpc.c_bpartner_id AS bill_user_c_bpartner_id,
bbpc.c_bpartner_location_id AS bill_user_c_bp_location_id,
bbpc.c_greeting_id AS bill_user_c_greeting_id,
bbpc.comments AS bill_user_comments,
bbpc.created AS bill_user_created,
bbpc.createdby AS bill_user_createdby,
bbpc.description AS bill_user_description,
bbpc.email AS bill_user_email,
bbpc.fax AS bill_user_fax,
bbpc.isactive AS bill_user_isactive,
bbpc.lastcontact AS bill_user_lastcontact,
bbpc.lastresult AS bill_user_lastresult,
bbpc.phone2 AS bill_user_phone2,
bbpc.supervisor_id AS bill_user_supervisor_id,
bbpc.updated AS bill_user_updated,
bbpc.updatedby AS bill_user_updatedby,
bbpc.value AS bill_user_value,
cur.cursymbol,
cur.description AS cur_description
FROM c_order o
JOIN c_doctype_trl dt
ON o.c_doctype_id = dt.c_doctype_id
JOIN m_warehouse wh
ON o.m_warehouse_id = wh.m_warehouse_id
JOIN c_paymentterm pt
ON o.c_paymentterm_id = pt.c_paymentterm_id
JOIN c_paymentterm_trl ptt
ON o.c_paymentterm_id = ptt.c_paymentterm_id AND dt.ad_language = ptt.ad_language
JOIN c_bpartner bp
ON o.c_bpartner_id = bp.c_bpartner_id
LEFT JOIN c_greeting bpg
ON bp.c_greeting_id = bpg.c_greeting_id
LEFT JOIN c_greeting_trl bpgt
ON bp.c_greeting_id = bpgt.c_greeting_id AND dt.ad_language = bpgt.ad_language
JOIN c_bpartner_location bpl
ON o.c_bpartner_location_id = bpl.c_bpartner_location_id
JOIN c_location l
ON bpl.c_location_id = l.c_location_id
LEFT JOIN ad_user bpc
ON o.ad_user_id = bpc.ad_user_id
LEFT JOIN c_greeting bpcg
ON bpc.c_greeting_id = bpcg.c_greeting_id
LEFT JOIN c_greeting_trl bpcgt
ON bpc.c_greeting_id = bpcgt.c_greeting_id AND dt.ad_language = bpcgt.ad_language
JOIN ad_orginfo oi
ON o.ad_org_id = oi.ad_org_id
JOIN ad_clientinfo ci
ON o.ad_client_id = ci.ad_client_id
LEFT JOIN ad_user u
ON o.salesrep_id = u.ad_user_id
LEFT JOIN c_bpartner ubp
ON u.c_bpartner_id = ubp.c_bpartner_id
JOIN c_bpartner bbp
ON o.bill_bpartner_id = bbp.c_bpartner_id
JOIN c_bpartner_location bbpl
ON o.bill_location_id = bbpl.c_bpartner_location_id
LEFT JOIN ad_user bbpc
ON o.bill_user_id = bbpc.ad_user_id
LEFT JOIN c_currency_trl cur
ON o.c_currency_id = cur.c_currency_id AND dt.ad_language = cur.ad_language
;
SELECT register_migration_script('201601271716_IDEMPIERE-3013.sql') FROM dual
;

View File

@ -0,0 +1,8 @@
-- IDEMPIERE-3022 Copy Columns from table error message
-- Feb 1, 2016 5:11:42 PM CET
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','Target table must not have columns',0,0,'Y',TO_TIMESTAMP('2016-02-01 17:11:42','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2016-02-01 17:11:42','YYYY-MM-DD HH24:MI:SS'),0,200398,'ErrorCopyColumns','D','e74d8970-44f1-4cd0-9b5e-ee21af6c286e')
;
SELECT register_migration_script('201602011711_IDEMPIERE-3022.sql') FROM dual
;

View File

@ -0,0 +1,52 @@
-- IDEMPIERE-3005 Copy view and view components
-- Feb 1, 2016 4:04:17 PM CET
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','Target table must not have view components',0,0,'Y',TO_TIMESTAMP('2016-02-01 16:04:16','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-02-01 16:04:16','YYYY-MM-DD HH24:MI:SS'),100,200397,'ErrorCopyView','D','9e9efdf9-cafd-4857-b4d5-37055b0d0786')
;
-- Feb 1, 2016 4:28:54 PM CET
INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,PrintName,EntityType,AD_Element_UU) VALUES (202975,0,0,'Y',TO_TIMESTAMP('2016-02-01 16:28:53','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-02-01 16:28:53','YYYY-MM-DD HH24:MI:SS'),100,'CopyComponentsFromView','Copy Components From View','Copy Components From View','D','667adbfe-8e70-450b-9c45-e042c12f518a')
;
-- Feb 1, 2016 4:30:59 PM CET
INSERT INTO AD_Process (AD_Process_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,IsReport,Value,IsDirectPrint,Classname,AccessLevel,EntityType,Statistic_Count,Statistic_Seconds,IsBetaFunctionality,IsServerProcess,ShowHelp,CopyFromProcess,AD_Process_UU) VALUES (200086,0,0,'Y',TO_TIMESTAMP('2016-02-01 16:30:59','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-02-01 16:30:59','YYYY-MM-DD HH24:MI:SS'),100,'Copy Components From View','Create dictionary view components for a table taking another as base','N','AD_Table_CopyComponentsFromView','N','org.compiere.process.CopyComponentsFromView','4','D',0,0,'N','N','Y','N','ebc55ee4-a02a-4505-9063-ae687e37ed6c')
;
-- Feb 1, 2016 4:32:56 PM CET
INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,IsRange,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200155,0,0,'Y',TO_TIMESTAMP('2016-02-01 16:32:56','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-02-01 16:32:56','YYYY-MM-DD HH24:MI:SS'),100,'Table','Database Table information','The Database Table provides the information of the table definition',200086,10,19,'N',0,'Y','AD_Table_ID','Y','D',126,'ce32a1c1-2820-4610-ac00-109ed3ac5b03','N')
;
-- Feb 1, 2016 4:33:43 PM CET
INSERT INTO AD_Column (AD_Column_ID,Version,Name,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,AD_Process_ID,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure) VALUES (212637,0,'Copy Components From View',100,'CopyComponentsFromView',1,'N','N','N','N','N',0,'N',28,0,0,'Y',TO_TIMESTAMP('2016-02-01 16:33:42','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-02-01 16:33:42','YYYY-MM-DD HH24:MI:SS'),100,202975,'Y',200086,'N','D','N','N','N','Y','c9a6c992-0cac-4559-b3e3-b9981cb5db4f','Y',0,'Y','N')
;
-- Feb 1, 2016 4:33:49 PM CET
INSERT INTO AD_TreeNode (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo, AD_TreeNode_UU) SELECT t.AD_Client_ID, 0, 'Y', statement_timestamp(), 100, statement_timestamp(), 100,t.AD_Tree_ID, 200004, 0, 999, Generate_UUID() FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='TL' AND t.AD_Table_ID=282 AND NOT EXISTS (SELECT * FROM AD_TreeNode e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=200004)
;
-- Feb 1, 2016 4:33:49 PM CET
ALTER TABLE AD_Table ADD COLUMN CopyComponentsFromView CHAR(1) DEFAULT NULL
;
-- Feb 1, 2016 4:34:53 PM CET
INSERT INTO AD_TreeNode (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo, AD_TreeNode_UU) SELECT t.AD_Client_ID, 0, 'Y', statement_timestamp(), 100, statement_timestamp(), 100,t.AD_Tree_ID, 200005, 0, 999, Generate_UUID() FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='TL' AND t.AD_Table_ID=282 AND NOT EXISTS (SELECT * FROM AD_TreeNode e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=200005)
;
-- Feb 1, 2016 4:34:53 PM CET
INSERT INTO AD_Field (AD_Field_ID,Name,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan) VALUES (204137,'Copy Components From View',100,212637,'Y',1,220,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2016-02-01 16:34:53','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-02-01 16:34:53','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','063d15a1-b7df-4f27-8d37-23360fae8f83','Y',190,2,2)
;
-- Feb 1, 2016 4:35:53 PM CET
UPDATE AD_Field SET DisplayLogic='@IsView@=''Y''',Updated=TO_TIMESTAMP('2016-02-01 16:35:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204137
;
-- Feb 3, 2016 5:06:14 PM CET
INSERT INTO AD_Val_Rule (AD_Val_Rule_ID,Name,Type,Code,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Val_Rule_UU) VALUES (200088,'AD_Table is View','S','AD_Table.IsView=''Y''',0,0,'Y',TO_TIMESTAMP('2016-02-03 17:06:14','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-02-03 17:06:14','YYYY-MM-DD HH24:MI:SS'),100,'D','84fba66f-4489-4993-8ea9-84fec646dd42')
;
-- Feb 3, 2016 5:06:28 PM CET
UPDATE AD_Process_Para SET AD_Val_Rule_ID=200088,Updated=TO_TIMESTAMP('2016-02-03 17:06:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=200155
;
SELECT register_migration_script('201602031708_IDEMPIERE-3005.sql') FROM dual
;

View File

@ -0,0 +1,8 @@
-- IDEMPIERE-3004 View Column - View Component require SeqNo
-- Feb 3, 2016 8:35:41 PM CET
UPDATE AD_Column SET IsUpdateable='Y',Updated=TO_TIMESTAMP('2016-02-03 20:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=210567
;
SELECT register_migration_script('201602032036_IDEMPIERE-3004.sql') FROM dual
;

View File

@ -0,0 +1,8 @@
-- IDEMPIERE-3027 'Closed' projects are still selectable in drop downs
-- Feb 4, 2016 2:27:17 PM UTC
UPDATE AD_Val_Rule SET Code='C_Project.Processed=''N'' AND C_Project.IsSummary=''N'' AND (C_Project.C_BPartner_ID IS NULL OR C_Project.C_BPartner_ID=@C_BPartner_ID@ OR C_Project.C_BPartnerSR_ID=@C_BPartner_ID@)',Updated=TO_TIMESTAMP('2016-02-04 14:27:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=227
;
SELECT register_migration_script('201602171450_IDEMPIERE-3027.sql') FROM dual
;

View File

@ -0,0 +1,26 @@
-- IDEMPIERE-2064 Show all DocAction button in trx windows in toolbar and window
update ad_column set istoolbarbutton='B' where ad_column_id in (
1789,
2171,
3495,
4324,
5497,
10797,
11480,
12076,
12120,
12282,
12319,
12330,
12412,
12449,
12461,
59447,
59452,
59480,
210983)
;
SELECT register_migration_script('201602191721_IDEMPIERE-2064.sql') FROM dual
;

View File

@ -0,0 +1,11 @@
-- IDEMPIERE-3052 Advanced Search on doctype on invoices or orders shows all the doctypes
update ad_column set AD_Val_Rule_ID=124 where AD_Column_ID=3493 and AD_Val_Rule_ID IS NULL
;
update ad_column set AD_Val_Rule_ID=133 where AD_Column_ID=2172 and AD_Val_Rule_ID IS NULL
;
SELECT register_migration_script('201603110209_IDEMPIERE-3052.sql') FROM dual
;

View File

@ -417,10 +417,13 @@ public class CalloutInOut extends CalloutEngine
{
if (ol.getC_Charge_ID() > 0 && ol.getM_Product_ID() <= 0) {
mTab.setValue("C_Charge_ID", new Integer(ol.getC_Charge_ID()));
mTab.setValue("M_Product_ID", null);
mTab.setValue("M_AttributeSetInstance_ID", null);
}
else {
mTab.setValue("M_Product_ID", new Integer(ol.getM_Product_ID()));
mTab.setValue("M_AttributeSetInstance_ID", new Integer(ol.getM_AttributeSetInstance_ID()));
mTab.setValue("C_Charge_ID", null);
}
//
mTab.setValue("C_UOM_ID", new Integer(ol.getC_UOM_ID()));
@ -472,10 +475,13 @@ public class CalloutInOut extends CalloutEngine
{
if (rl.getC_Charge_ID() > 0 && rl.getM_Product_ID() <= 0) {
mTab.setValue("C_Charge_ID", new Integer(rl.getC_Charge_ID()));
mTab.setValue("M_Product_ID", null);
mTab.setValue("M_AttributeSetInstance_ID", null);
}
else {
mTab.setValue("M_Product_ID", new Integer(rl.getM_Product_ID()));
mTab.setValue("M_AttributeSetInstance_ID", new Integer(rl.getM_AttributeSetInstance_ID()));
mTab.setValue("C_Charge_ID", null);
}
//
mTab.setValue("C_UOM_ID", new Integer(rl.getC_UOM_ID()));
@ -706,6 +712,9 @@ public class CalloutInOut extends CalloutEngine
// serialized ASI - force qty yo 1 - IDEMPIERE-1140
mTab.setValue("MovementQty", Env.ONE);
mTab.setValue("QtyEntered", Env.ONE);
MProduct product = MProduct.get(ctx, M_Product_ID);
if (product != null)
mTab.setValue("C_UOM_ID", product.getC_UOM_ID());
}
return "";
} // asi

View File

@ -22,6 +22,8 @@ import org.compiere.model.MTable;
import org.compiere.model.M_Element;
import org.compiere.model.PO;
import org.compiere.util.AdempiereSystemError;
import org.compiere.util.Env;
import org.compiere.util.Msg;
/**
* Copy columns from one table to other
@ -76,8 +78,7 @@ public class CopyColumnsFromTable extends SvrProcess
MTable targetTable = new MTable(getCtx(), p_target_AD_Table_ID, get_TrxName());
MColumn[] targetColumns = targetTable.getColumns(true);
if (targetColumns.length > 0)
// TODO: dictionary message
throw new AdempiereSystemError("Target table must not have columns");
throw new AdempiereSystemError(Msg.getMsg(Env.getCtx(), "ErrorCopyColumns"));
MTable sourceTable = new MTable(getCtx(), p_source_AD_Table_ID, get_TrxName());
MColumn[] sourceColumns = sourceTable.getColumns(true);

View File

@ -0,0 +1,133 @@
/**********************************************************************
* This file is part of iDempiere ERP Open Source *
* http://www.idempiere.org *
* *
* Copyright (C) Contributors *
* *
* 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. *
* *
* Contributors: *
* - Diego Ruiz *
**********************************************************************/
package org.compiere.process;
import java.util.logging.Level;
import org.compiere.model.MTable;
import org.compiere.model.MViewColumn;
import org.compiere.model.MViewComponent;
import org.compiere.model.PO;
import org.compiere.util.AdempiereSystemError;
import org.compiere.util.Env;
import org.compiere.util.Msg;
/**
* Copy components from one view to other
*
* @author Diego Ruiz - Bx Service GmbH
* @version $Id: CopyComponentsFromView
*/
public class CopyComponentsFromView extends SvrProcess {
/** Target Table */
private int p_target_AD_Table_ID = 0;
/** Source Table */
private int p_source_AD_Table_ID = 0;
/** Column Count */
private int m_count = 0;
/**
* Prepare - e.g., get Parameters.
*/
protected void prepare ()
{
ProcessInfoParameter[] para = getParameter();
for (int i = 0; i < para.length; i++)
{
String name = para[i].getParameterName();
if (para[i].getParameter() == null)
;
else if (name.equals("AD_Table_ID"))
p_source_AD_Table_ID = para[i].getParameterAsInt();
else
log.log(Level.SEVERE, "Unknown Parameter: " + name);
}
p_target_AD_Table_ID = getRecord_ID();
} // prepare
/**
* Process
* @return info
* @throws Exception
*/
protected String doIt () throws Exception
{
if (p_target_AD_Table_ID == 0)
throw new AdempiereSystemError("@NotFound@ @AD_Table_ID@ " + p_target_AD_Table_ID);
if (p_source_AD_Table_ID == 0)
throw new AdempiereSystemError("@NotFound@ @AD_Table_ID@ " + p_source_AD_Table_ID);
if (log.isLoggable(Level.INFO)) log.info("Source AD_Table_ID=" + p_source_AD_Table_ID
+ ", Target AD_Table_ID=" + p_target_AD_Table_ID);
MTable targetTable = new MTable(getCtx(), p_target_AD_Table_ID, get_TrxName());
MViewComponent[] targetViewComponents = targetTable.getViewComponent(true);
if (targetViewComponents.length > 0)
throw new AdempiereSystemError(Msg.getMsg(Env.getCtx(), "ErrorCopyView"));
MTable sourceTable = new MTable(getCtx(), p_source_AD_Table_ID, get_TrxName());
MViewComponent[] sourceViewComponents = sourceTable.getViewComponent(true);
for (int i = 0; i < sourceViewComponents.length; i++)
{
MViewComponent viewComponentTarget = new MViewComponent(targetTable);
PO.copyValues(sourceViewComponents[i], viewComponentTarget);
viewComponentTarget.setAD_Table_ID (targetTable.getAD_Table_ID());
viewComponentTarget.setEntityType(targetTable.getEntityType());
viewComponentTarget.setIsActive(sourceViewComponents[i].isActive());
viewComponentTarget.saveEx(get_TrxName());
copyViewColumns(sourceViewComponents[i] ,viewComponentTarget);
m_count++;
}
//
return "#" + m_count;
} // doIt
/**
* Copy view columns from one component to another
*/
public void copyViewColumns(MViewComponent sourceComponent, MViewComponent targetComponent) {
MViewColumn[] sourceColumns = sourceComponent.getColumns(true);
for (int i = 0; i < sourceColumns.length; i++)
{
MViewColumn columnTarget = new MViewColumn(targetComponent);
PO.copyValues(sourceColumns[i], columnTarget);
columnTarget.setAD_ViewComponent_ID(targetComponent.getAD_ViewComponent_ID());
columnTarget.setEntityType(targetComponent.getEntityType());
columnTarget.setIsActive(sourceColumns[i].isActive());
columnTarget.saveEx(get_TrxName());
}
}
}

View File

@ -23,6 +23,7 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.nio.charset.Charset;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.text.DecimalFormatSymbols;
import java.text.SimpleDateFormat;
@ -238,7 +239,7 @@ public class GridTabCSVImporter implements IGridTabImporter
createTrx(gridTab);
}
String recordResult = processRecord(importMode, gridTab, indxDetail, isDetail, idx, rowResult);
String recordResult = processRecord(importMode, gridTab, indxDetail, isDetail, idx, rowResult, childs);
rowResult.append(recordResult);
// write
@ -272,6 +273,13 @@ public class GridTabCSVImporter implements IGridTabImporter
} catch (IOException e) {
e.printStackTrace();
}
gridTab.getTableModel().setImportingMode(false,null);
for (GridTab detail : childs) {
detail.getTableModel().setImportingMode(false,null);
}
gridTab.dataRefreshAll();
}
if (logFile != null)
return logFile;
@ -308,10 +316,16 @@ public class GridTabCSVImporter implements IGridTabImporter
/**
* Commit the trx and writes in the file
*/
private void commitTrx(){
trx.commit();
private String commitTrx(){
try {
trx.commit(true);
} catch (SQLException e) {
setError(true);
return e.getLocalizedMessage();
}
for( String row : rowsTmpResult )
logFileW.write(row);
return null;
}
/**
@ -521,10 +535,12 @@ public class GridTabCSVImporter implements IGridTabImporter
if( trx != null ){
if( isError() ) {
gridTab.dataDelete();
rollbackTrx();
setError(false);
}else {
boolean commit = false;
if( isThereDocAction ){
boolean isError = false;
@ -542,27 +558,24 @@ public class GridTabCSVImporter implements IGridTabImporter
}
if( isError ){
gridTab.dataDelete();
rollbackTrx();
}else{
commitTrx();
commit = true;
}
}else{
commitTrx();
}
}
if( childs != null ){
if( masterRecord != null ){
gridTab.query(false);
gridTab.getTableModel().setImportingMode(false,null);
for( GridTab detail : childs )
if( detail.getTableModel().isOpen() ){
detail.query(true);
detail.getTableModel().setImportingMode(false,null);
}
commit = true;
}
if (commit) {
String commitResult = commitTrx();
if (isError()) {
rowsTmpResult.set(0,rowsTmpResult.get(0).replace(quoteChar + "\n",commitResult + quoteChar + "\n"));
gridTab.dataDelete();
rollbackTrx();
}
}
}
trx.close();
trx=null;
}
@ -597,7 +610,7 @@ public class GridTabCSVImporter implements IGridTabImporter
* @param rowResult
* @return
*/
private String processRecord(String importMode, GridTab gridTab, int indxDetail, boolean isDetail, int idx, StringBuilder rowResult){
private String processRecord(String importMode, GridTab gridTab, int indxDetail, boolean isDetail, int idx, StringBuilder rowResult, List<GridTab> childs){
String logMsg = null;
GridTab currentGridTab = null;
@ -633,6 +646,11 @@ public class GridTabCSVImporter implements IGridTabImporter
logMsg = "["+currentGridTab.getName()+"]"+"- Was not able to create a new record!";
}else{
currentGridTab.navigateCurrent();
if (! isDetail) {
for (GridTab child : childs) {
child.query(false);
}
}
}
}

View File

@ -183,14 +183,42 @@ public class Doc_Invoice extends Doc
BigDecimal LineNetAmtTax = tax.calculateTax(LineNetAmt, true, getStdPrecision());
if (log.isLoggable(Level.FINE)) log.fine("LineNetAmt=" + LineNetAmt + " - Tax=" + LineNetAmtTax);
LineNetAmt = LineNetAmt.subtract(LineNetAmtTax);
for (int t = 0; t < m_taxes.length; t++)
{
if (m_taxes[t].getC_Tax_ID() == C_Tax_ID)
if (tax.isSummary()) {
BigDecimal sumChildLineNetAmtTax = Env.ZERO;
DocTax taxToApplyDiff = null;
for (MTax childTax : tax.getChildTaxes(false)) {
if (!childTax.isZeroTax())
{
BigDecimal childLineNetAmtTax = childTax.calculateTax(LineNetAmt, false, getStdPrecision());
if (log.isLoggable(Level.FINE)) log.fine("LineNetAmt=" + LineNetAmt + " - Child Tax=" + childLineNetAmtTax);
for (int t = 0; t < m_taxes.length; t++)
{
if (m_taxes[t].getC_Tax_ID() == childTax.getC_Tax_ID())
{
m_taxes[t].addIncludedTax(childLineNetAmtTax);
taxToApplyDiff = m_taxes[t];
sumChildLineNetAmtTax = sumChildLineNetAmtTax.add(childLineNetAmtTax);
break;
}
}
}
}
BigDecimal diffChildVsSummary = LineNetAmtTax.subtract(sumChildLineNetAmtTax);
if (diffChildVsSummary.signum() != 0 && taxToApplyDiff != null) {
taxToApplyDiff.addIncludedTax(diffChildVsSummary);
}
} else {
for (int t = 0; t < m_taxes.length; t++)
{
m_taxes[t].addIncludedTax(LineNetAmtTax);
break;
if (m_taxes[t].getC_Tax_ID() == C_Tax_ID)
{
m_taxes[t].addIncludedTax(LineNetAmtTax);
break;
}
}
}
BigDecimal PriceListTax = tax.calculateTax(PriceList, true, getStdPrecision());
PriceList = PriceList.subtract(PriceListTax);
}
@ -220,9 +248,24 @@ public class Doc_Invoice extends Doc
BigDecimal diff = m_taxes[i].getIncludedTaxDifference();
for (int j = 0; j < dls.length; j++)
{
if (dls[j].getC_Tax_ID() == m_taxes[i].getC_Tax_ID())
{
dls[j].setLineNetAmtDifference(diff);
MTax lineTax = MTax.get(getCtx(), dls[j].getC_Tax_ID());
MTax[] composingTaxes = null;
if (lineTax.isSummary()) {
composingTaxes = lineTax.getChildTaxes(false);
} else {
composingTaxes = new MTax[1];
composingTaxes[0] = lineTax;
}
for (MTax mTax : composingTaxes) {
if (mTax.getC_Tax_ID() == m_taxes[i].getC_Tax_ID())
{
dls[j].setLineNetAmtDifference(diff);
m_taxes[i].addIncludedTax(diff.negate());
diff = Env.ZERO;
break;
}
}
if (diff.signum() == 0) {
break;
}
} // for all lines

View File

@ -76,11 +76,23 @@ public class Doc_Production extends Doc
private DocLine[] loadLines(X_M_Production prod)
{
ArrayList<DocLine> list = new ArrayList<DocLine>();
// Production
// -- ProductionLine - the real level
String sqlPL = "SELECT * FROM M_ProductionLine pl "
+ "WHERE pl.M_Production_ID=? "
+ "ORDER BY pl.Line";
String sqlPL = null;
if (prod.isUseProductionPlan()){
// Production
// -- ProductionLine - the real level
sqlPL = "SELECT * FROM "
+ " M_ProductionLine pro_line INNER JOIN M_ProductionPlan plan ON pro_line.M_ProductionPlan_id = plan.M_ProductionPlan_id "
+ " INNER JOIN M_Production pro ON pro.M_Production_id = plan.M_Production_id "
+ " WHERE pro.M_Production_ID=? "
+ " ORDER BY plan.M_ProductionPlan_id, pro_line.Line";
}else{
// Production
// -- ProductionLine - the real level
sqlPL = "SELECT * FROM M_ProductionLine pl "
+ "WHERE pl.M_Production_ID=? "
+ "ORDER BY pl.Line";
}
PreparedStatement pstmtPL = null;
ResultSet rsPL = null;
try
@ -99,7 +111,10 @@ public class Doc_Production extends Doc
DocLine docLine = new DocLine (line, this);
docLine.setQty (line.getMovementQty(), false);
// Identify finished BOM Product
docLine.setProductionBOM(line.getM_Product_ID() == prod.getM_Product_ID());
if (prod.isUseProductionPlan())
docLine.setProductionBOM(line.getM_Product_ID() == line.getM_ProductionPlan().getM_Product_ID());
else
docLine.setProductionBOM(line.getM_Product_ID() == prod.getM_Product_ID());
//
if (log.isLoggable(Level.FINE)) log.fine(docLine.toString());
list.add (docLine);
@ -149,6 +164,7 @@ public class Doc_Production extends Doc
// Line pointer
FactLine fl = null;
X_M_Production prod = (X_M_Production)getPO();
for (int i = 0; i < p_lines.length; i++)
{
DocLine line = p_lines[i];
@ -166,12 +182,18 @@ public class Doc_Production extends Doc
}
if (line.isProductionBOM())
{
X_M_ProductionLine endProLine = (X_M_ProductionLine)line.getPO();
Object parentEndPro = prod.isUseProductionPlan()?endProLine.getM_ProductionPlan_ID():endProLine.getM_Production_ID();
// Get BOM Cost - Sum of individual lines
BigDecimal bomCost = Env.ZERO;
for (int ii = 0; ii < p_lines.length; ii++)
{
DocLine line0 = p_lines[ii];
if (line0.getM_Production_ID() != line.getM_Production_ID())
X_M_ProductionLine bomProLine = (X_M_ProductionLine)line0.getPO();
Object parentBomPro = prod.isUseProductionPlan()?bomProLine.getM_ProductionPlan_ID():bomProLine.getM_Production_ID();
if (!parentBomPro.equals(parentEndPro))
continue;
//pb changed this 20/10/06
if (!line0.isProductionBOM())

View File

@ -196,6 +196,21 @@ public interface I_AD_ViewColumn
*/
public boolean isActive();
/** Column name SeqNo */
public static final String COLUMNNAME_SeqNo = "SeqNo";
/** Set Sequence.
* Method of ordering records;
lowest number comes first
*/
public void setSeqNo (int SeqNo);
/** Get Sequence.
* Method of ordering records;
lowest number comes first
*/
public int getSeqNo();
/** Column name Updated */
public static final String COLUMNNAME_Updated = "Updated";

View File

@ -54,7 +54,7 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction
/**
*
*/
private static final long serialVersionUID = 8726957992840702609L;
private static final long serialVersionUID = -7787519874581251920L;
/** Tolerance Gain and Loss */
private static final BigDecimal TOLERANCE = BigDecimal.valueOf(0.02);
@ -966,9 +966,8 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction
getC_Currency_ID(), paymentDate, convTypeID, getAD_Client_ID(), getAD_Org_ID());
if (amt == null)
{
m_processMsg = "Could not convert allocation C_Currency_ID=" + getC_Currency_ID()
+ " to base C_Currency_ID=" + MClient.get(getCtx()).getC_Currency_ID() + ", C_ConversionType_ID=" + convTypeID
+ ", conversion date= " + paymentDate;
m_processMsg = MConversionRateUtil.getErrorMessage(getCtx(), "ErrorConvertingAllocationCurrencyToBaseCurrency",
getC_Currency_ID(), MClient.get(getCtx()).getC_Currency_ID(), convTypeID, paymentDate, get_TrxName());
return false;
}
openBalanceDiff = openBalanceDiff.add(amt);
@ -980,9 +979,8 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction
getC_Currency_ID(), paymentDate, convTypeID, getAD_Client_ID(), getAD_Org_ID());
if (amt == null)
{
m_processMsg = "Could not convert allocation C_Currency_ID=" + getC_Currency_ID()
+ " to base C_Currency_ID=" + MClient.get(getCtx()).getC_Currency_ID() + ", C_ConversionType_ID=" + convTypeID
+ ", conversion date= " + paymentDate;
m_processMsg = MConversionRateUtil.getErrorMessage(getCtx(), "ErrorConvertingAllocationCurrencyToBaseCurrency",
getC_Currency_ID(), MClient.get(getCtx()).getC_Currency_ID(), convTypeID, paymentDate, get_TrxName());
return false;
}
openBalanceDiff = openBalanceDiff.add(amt);
@ -993,9 +991,8 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction
getC_Currency_ID(), getDateAcct(), convTypeID, getAD_Client_ID(), getAD_Org_ID());
if (allocAmtBase == null)
{
m_processMsg = "Could not convert allocation C_Currency_ID=" + getC_Currency_ID()
+ " to base C_Currency_ID=" + MClient.get(getCtx()).getC_Currency_ID() + ", C_ConversionType_ID=" + convTypeID
+ ", conversion date= " + getDateAcct();
m_processMsg = MConversionRateUtil.getErrorMessage(getCtx(), "ErrorConvertingAllocationCurrencyToBaseCurrency",
getC_Currency_ID(), MClient.get(getCtx()).getC_Currency_ID(), convTypeID, getDateAcct(), get_TrxName());
return false;
}
@ -1009,9 +1006,8 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction
getC_Currency_ID(), invoice.getDateAcct(), invoice.getC_ConversionType_ID(), getAD_Client_ID(), getAD_Org_ID());
if (amt == null)
{
m_processMsg = "Could not convert allocation C_Currency_ID=" + getC_Currency_ID()
+ " to base C_Currency_ID=" + MClient.get(getCtx()).getC_Currency_ID() + ", C_ConversionType_ID=" + invoice.getC_ConversionType_ID()
+ ", conversion date= " + invoice.getDateAcct();
m_processMsg = MConversionRateUtil.getErrorMessage(getCtx(), "ErrorConvertingAllocationCurrencyToBaseCurrency",
getC_Currency_ID(), MClient.get(getCtx()).getC_Currency_ID(), invoice.getC_ConversionType_ID(), invoice.getDateAcct(), get_TrxName());
return false;
}
openBalanceDiff = openBalanceDiff.add(amt);
@ -1028,9 +1024,8 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction
getC_Currency_ID(), invoice.getC_Currency_ID(), getDateAcct(), invoice.getC_ConversionType_ID(), getAD_Client_ID(), getAD_Org_ID());
if (allocAmt == null)
{
m_processMsg = "Could not convert allocation C_Currency_ID=" + getC_Currency_ID()
+ " to invoice C_Currency_ID=" + invoice.getC_Currency_ID() + ", C_ConversionType_ID=" + invoice.getC_ConversionType_ID()
+ ", conversion date= " + getDateAcct();
m_processMsg = MConversionRateUtil.getErrorMessage(getCtx(), "ErrorConvertingAllocationCurrencyToInvoiceCurrency",
getC_Currency_ID(), invoice.getC_Currency_ID(), invoice.getC_ConversionType_ID(), getDateAcct(), get_TrxName());
return false;
}
}
@ -1038,9 +1033,8 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction
invoice.getC_Currency_ID(), invoice.getDateAcct(), invoice.getC_ConversionType_ID(), getAD_Client_ID(), getAD_Org_ID());
if (invAmtAccted == null)
{
m_processMsg = "Could not convert invoice C_Currency_ID=" + getC_Currency_ID()
+ " to base C_Currency_ID=" + invoice.getC_Currency_ID() + ", C_ConversionType_ID=" + invoice.getC_ConversionType_ID()
+ ", date= " + invoice.getDateAcct();
m_processMsg = MConversionRateUtil.getErrorMessage(getCtx(), "ErrorConvertingInvoiceCurrencyToBaseCurrency",
invoice.getC_Currency_ID(), MClient.get(getCtx()).getC_Currency_ID(), invoice.getC_ConversionType_ID(), invoice.getDateAcct(), get_TrxName());
return false;
}
@ -1048,9 +1042,8 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction
invoice.getC_Currency_ID(), getDateAcct(), invoice.getC_ConversionType_ID(), getAD_Client_ID(), getAD_Org_ID());
if (allocAmtAccted == null)
{
m_processMsg = "Could not convert invoice C_Currency_ID=" + invoice.getC_Currency_ID()
+ " to base C_Currency_ID=" + MClient.get(getCtx()).getC_Currency_ID() + ", C_ConversionType_ID=" + invoice.getC_ConversionType_ID()
+ ", conversion date= " + getDateAcct();
m_processMsg = MConversionRateUtil.getErrorMessage(getCtx(), "ErrorConvertingInvoiceCurrencyToBaseCurrency",
invoice.getC_Currency_ID(), MClient.get(getCtx()).getC_Currency_ID(), invoice.getC_ConversionType_ID(), getDateAcct(), get_TrxName());
return false;
}

View File

@ -843,7 +843,7 @@ public class MColumn extends X_AD_Column
{
StringBuilder fkConstraintSql = new StringBuilder();
if (!column.isKey() && !column.getColumnName().equals(PO.getUUIDColumnName(table.getTableName())))
if (!column.isKey() && !column.getColumnName().equals(PO.getUUIDColumnName(table.getTableName())) && !column.isVirtualColumn())
{
int refid = column.getAD_Reference_ID();
if (refid != DisplayType.List && refid != DisplayType.Payment)

View File

@ -6,10 +6,12 @@ package org.compiere.model;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.Timestamp;
import java.util.Properties;
import java.util.logging.Level;
import org.compiere.util.CLogger;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.idempiere.exceptions.NoCurrencyConversionException;
/**
@ -100,4 +102,14 @@ public final class MConversionRateUtil
if (s_log.isLoggable(Level.FINE)) s_log.fine("amt=" + sourceAmt + " * " + rate + "=" + amt + ", scale=" + stdPrecision);
return amt;
} // convert
/** Return the message to show when no exchange rate is found */
public static String getErrorMessage(Properties ctx, String adMessage, int currencyFromID, int currencyToID, int convertionTypeID, Timestamp date, String trxName)
{
if (convertionTypeID == 0)
convertionTypeID = MConversionType.getDefault(Env.getAD_Client_ID(ctx));
String retValue = Msg.getMsg(ctx, adMessage,
new Object[] {MCurrency.get(ctx, currencyFromID).getISO_Code(), MCurrency.get(ctx, currencyToID).getISO_Code(), new MConversionType(ctx, convertionTypeID, trxName).getName(), date});
return retValue;
}
}

View File

@ -1053,12 +1053,12 @@ public class MInOut extends X_M_InOut implements DocAction
if (is_ValueChanged("AD_Org_ID"))
{
StringBuilder sql = new StringBuilder("UPDATE M_InOutLine ol")
.append(" SET AD_Org_ID =")
.append("(SELECT AD_Org_ID")
.append(" FROM M_InOut o WHERE ol.M_InOut_ID=o.M_InOut_ID) ")
.append("WHERE M_InOut_ID=").append(getC_Order_ID());
int no = DB.executeUpdate(sql.toString(), get_TrxName());
final String sql = "UPDATE M_InOutLine ol"
+ " SET AD_Org_ID ="
+ "(SELECT AD_Org_ID"
+ " FROM M_InOut o WHERE ol.M_InOut_ID=o.M_InOut_ID) "
+ "WHERE M_InOut_ID=?";
int no = DB.executeUpdateEx(sql, new Object[] {getM_InOut_ID()}, get_TrxName());
if (log.isLoggable(Level.FINE)) log.fine("Lines -> #" + no);
}
return true;
@ -1426,11 +1426,36 @@ public class MInOut extends X_M_InOut implements DocAction
// sLine.getM_AttributeSetInstance_ID() != 0
if (mtrx == null)
{
Timestamp dateMPolicy = getMovementDate();
if(sLine.getM_AttributeSetInstance_ID()>0){
Timestamp dateMPolicy= null;
MStorageOnHand[] storages = null;
if (sLine.getMovementQty().compareTo(Env.ZERO) > 0) {
// Find Date Material Policy bases on ASI
storages = MStorageOnHand.getWarehouse(getCtx(), 0,
sLine.getM_Product_ID(), sLine.getM_AttributeSetInstance_ID(), null,
MClient.MMPOLICY_FiFo.equals(product.getMMPolicy()), false,
sLine.getM_Locator_ID(), get_TrxName());
} else {
//Case of reversal
storages = MStorageOnHand.getWarehouse(getCtx(), 0,
sLine.getM_Product_ID(), sLine.getM_AttributeSetInstance_ID(), null,
MClient.MMPOLICY_FiFo.equals(product.getMMPolicy()), false,
sLine.getM_Locator_ID(), get_TrxName());
}
for (MStorageOnHand storage : storages) {
if (storage.getQtyOnHand().compareTo(sLine.getMovementQty()) >= 0) {
dateMPolicy = storage.getDateMaterialPolicy();
break;
}
}
if (dateMPolicy == null && storages.length > 0)
dateMPolicy = storages[0].getDateMaterialPolicy();
if (dateMPolicy==null && sLine.getM_AttributeSetInstance_ID()!=0) {
I_M_AttributeSetInstance asi = sLine.getM_AttributeSetInstance();
dateMPolicy = asi.getCreated();
}
} else if(dateMPolicy==null)
dateMPolicy = getMovementDate();
// Fallback: Update Storage - see also VMatch.createMatchRecord
if (!MStorageOnHand.add(getCtx(), getM_Warehouse_ID(),

View File

@ -334,6 +334,38 @@ public class MInventory extends X_M_Inventory implements DocAction
return DocAction.STATUS_Invalid;
}
// Validate mandatory ASI on lines - IDEMPIERE-1770 - ASI validation must be moved to MInventory.prepareIt
for (MInventoryLine line : lines) {
// Product requires ASI
if (line.getM_AttributeSetInstance_ID() == 0)
{
MProduct product = MProduct.get(getCtx(), line.getM_Product_ID());
if (product != null && product.isASIMandatory(line.isSOTrx()))
{
if (! product.getAttributeSet().excludeTableEntry(MInventoryLine.Table_ID, line.isSOTrx())) {
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
String docSubTypeInv = dt.getDocSubTypeInv();
BigDecimal qtyDiff = line.getQtyInternalUse();
if (MDocType.DOCSUBTYPEINV_PhysicalInventory.equals(docSubTypeInv))
qtyDiff = line.getQtyBook().subtract(line.getQtyCount());
// verify if the ASIs are captured on lineMA
MInventoryLineMA mas[] = MInventoryLineMA.get(getCtx(),
line.getM_InventoryLine_ID(), get_TrxName());
BigDecimal qtyma = Env.ZERO;
for (MInventoryLineMA ma : mas) {
if (! ma.isAutoGenerated()) {
qtyma = qtyma.add(ma.getMovementQty());
}
}
if (qtyma.subtract(qtyDiff).signum() != 0) {
m_processMsg = "@Line@ " + line.getLine() + ": @FillMandatory@ @M_AttributeSetInstance_ID@";
return DocAction.STATUS_Invalid;
}
}
}
} // No ASI
}
// TODO: Add up Amounts
// setApprovalAmt();

View File

@ -125,7 +125,7 @@ public class MInventoryLine extends X_M_InventoryLine
setQtyCount (QtyCount);
if (QtyInternalUse != null && QtyInternalUse.signum() != 0)
setQtyInternalUse (QtyInternalUse);
m_isManualEntry = false;
// m_isManualEntry = false;
} // MInventoryLine
public MInventoryLine (MInventory inventory,
@ -136,7 +136,7 @@ public class MInventoryLine extends X_M_InventoryLine
}
/** Manually created */
private boolean m_isManualEntry = true;
// private boolean m_isManualEntry = true;
/** Parent */
private MInventory m_parent = null;
/** Product */
@ -260,6 +260,7 @@ public class MInventoryLine extends X_M_InventoryLine
log.saveError("ParentComplete", Msg.translate(getCtx(), "M_InventoryLine"));
return false;
}
/* IDEMPIERE-1770 - ASI validation must be moved to MInventory.prepareIt, saving a line without ASI is ok on draft
if (m_isManualEntry)
{
// Product requires ASI
@ -279,7 +280,8 @@ public class MInventoryLine extends X_M_InventoryLine
}
} // No ASI
} // manual
*/
// Set Line No
if (getLine() == 0)
{

View File

@ -67,7 +67,7 @@ public class MInvoice extends X_C_Invoice implements DocAction
/**
*
*/
private static final long serialVersionUID = 6262118410996877227L;
private static final long serialVersionUID = -9210893813732918522L;
/**
* Get Payments Of BPartner
@ -1897,8 +1897,8 @@ public class MInvoice extends X_C_Invoice implements DocAction
getC_Currency_ID(), getDateAcct(), getC_ConversionType_ID(), getAD_Client_ID(), getAD_Org_ID());
if (invAmt == null)
{
m_processMsg = "Could not convert C_Currency_ID=" + getC_Currency_ID()
+ " to base C_Currency_ID=" + MClient.get(Env.getCtx()).getC_Currency_ID();
m_processMsg = MConversionRateUtil.getErrorMessage(getCtx(), "ErrorConvertingCurrencyToBaseCurrency",
getC_Currency_ID(), MClient.get(getCtx()).getC_Currency_ID(), getC_ConversionType_ID(), getDateAcct(), get_TrxName());
return DocAction.STATUS_Invalid;
}
// Total Balance
@ -1968,8 +1968,8 @@ public class MInvoice extends X_C_Invoice implements DocAction
getDateAcct(), 0, getAD_Client_ID(), getAD_Org_ID());
if (amt == null)
{
m_processMsg = "Could not convert C_Currency_ID=" + getC_Currency_ID()
+ " to Project C_Currency_ID=" + C_CurrencyTo_ID;
m_processMsg = MConversionRateUtil.getErrorMessage(getCtx(), "ErrorConvertingCurrencyToProjectCurrency",
getC_Currency_ID(), C_CurrencyTo_ID, 0, getDateAcct(), get_TrxName());
return DocAction.STATUS_Invalid;
}
BigDecimal newAmt = project.getInvoicedAmt();

View File

@ -290,7 +290,43 @@ public class MMovement extends X_M_Movement implements DocAction
m_processMsg = "@NoLines@";
return DocAction.STATUS_Invalid;
}
// Validate mandatory ASI on lines - IDEMPIERE-1770 - ASI validation must be moved to MMovement.prepareIt
for (MMovementLine line : lines) {
// Mandatory Instance
MProduct product = line.getProduct();
if (line.getM_AttributeSetInstance_ID() == 0) {
if (product != null && product.isASIMandatory(true)) {
if (! product.getAttributeSet().excludeTableEntry(MMovementLine.Table_ID, true)) { // outgoing
BigDecimal qtyDiff = line.getMovementQty();
// verify if the ASIs are captured on lineMA
MMovementLineMA mas[] = MMovementLineMA.get(getCtx(),
line.getM_MovementLine_ID(), get_TrxName());
BigDecimal qtyma = Env.ZERO;
for (MMovementLineMA ma : mas) {
if (! ma.isAutoGenerated()) {
qtyma = qtyma.add(ma.getMovementQty());
}
}
if (qtyma.subtract(qtyDiff).signum() != 0) {
m_processMsg = "@Line@ " + line.getLine() + ": @FillMandatory@ @M_AttributeSetInstance_ID@";
return DocAction.STATUS_Invalid;
}
}
}
}
if (line.getM_AttributeSetInstanceTo_ID() == 0)
{
if (product != null && product.isASIMandatory(false) && line.getM_AttributeSetInstanceTo_ID() == 0)
{
if (! product.getAttributeSet().excludeTableEntry(MMovementLine.Table_ID, false)) { // incoming
m_processMsg = "@Line@ " + line.getLine() + ": @FillMandatory@ @M_AttributeSetInstanceTo_ID@";
return DocAction.STATUS_Invalid;
}
}
} // ASI
}
// Confirmation
if (dt.isInTransit())
createConfirmation();

View File

@ -207,8 +207,9 @@ public class MMovementLine extends X_M_MovementLine
// Qty Precision
if (newRecord || is_ValueChanged(COLUMNNAME_MovementQty))
setMovementQty(getMovementQty());
// Mandatory Instance
/* IDEMPIERE-1770 - ASI validation must be moved to MMovement.prepareIt, saving a line without ASI is ok on draft
MProduct product = getProduct();
if (getM_AttributeSetInstance_ID() == 0) {
if (product != null && product.isASIMandatory(true)) {
@ -216,12 +217,13 @@ public class MMovementLine extends X_M_MovementLine
log.saveError("NoAttributeSet", product.getValue());
return false;
}
if (! product.getAttributeSet().excludeTableEntry(MMovementLine.Table_ID, true /*outgoing*/)) {
if (! product.getAttributeSet().excludeTableEntry(MMovementLine.Table_ID, true)) { // outgoing
log.saveError("FillMandatory", Msg.getElement(getCtx(), COLUMNNAME_M_AttributeSetInstance_ID));
return false;
}
}
}
*/
if (getM_AttributeSetInstanceTo_ID() == 0)
{
//instance id default to same for movement between locator
@ -230,18 +232,20 @@ public class MMovementLine extends X_M_MovementLine
if (getM_AttributeSetInstance_ID() != 0) //set to from
setM_AttributeSetInstanceTo_ID(getM_AttributeSetInstance_ID());
}
/* IDEMPIERE-1770 - ASI validation must be moved to MMovement.prepareIt, saving a line without ASI is ok on draft
if (product != null && product.isASIMandatory(false) && getM_AttributeSetInstanceTo_ID() == 0)
{
if (product.getAttributeSet()==null) {
log.saveError("NoAttributeSet", product.getValue());
return false;
}
if (! product.getAttributeSet().excludeTableEntry(MMovementLine.Table_ID, false /*incoming*/)) {
if (! product.getAttributeSet().excludeTableEntry(MMovementLine.Table_ID, false)) { // incoming
log.saveError("FillMandatory", Msg.getElement(getCtx(), COLUMNNAME_M_AttributeSetInstanceTo_ID));
return false;
}
}
*/
} // ASI
return true;

View File

@ -1019,12 +1019,19 @@ public class MOrderLine extends X_C_OrderLine
{
if (!success)
return success;
MTax tax = new MTax(getCtx(), getC_Tax_ID(), get_TrxName());
MTaxProvider provider = new MTaxProvider(tax.getCtx(), tax.getC_TaxProvider_ID(), tax.get_TrxName());
ITaxProvider calculator = Core.getTaxProvider(provider);
if (calculator == null)
throw new AdempiereException(Msg.getMsg(getCtx(), "TaxNoProvider"));
return calculator.recalculateTax(provider, this, newRecord);
if (getParent().isProcessed())
return success;
if ( newRecord
|| is_ValueChanged(MOrderLine.COLUMNNAME_C_Tax_ID)
|| is_ValueChanged(MOrderLine.COLUMNNAME_LineNetAmt)) {
MTax tax = new MTax(getCtx(), getC_Tax_ID(), get_TrxName());
MTaxProvider provider = new MTaxProvider(tax.getCtx(), tax.getC_TaxProvider_ID(), tax.get_TrxName());
ITaxProvider calculator = Core.getTaxProvider(provider);
if (calculator == null)
throw new AdempiereException(Msg.getMsg(getCtx(), "TaxNoProvider"));
return calculator.recalculateTax(provider, this, newRecord);
}
return success;
} // afterSave
/**

View File

@ -80,9 +80,7 @@ import org.compiere.util.ValueNamePair;
public class MPayment extends X_C_Payment
implements DocAction, ProcessCall, PaymentInterface
{
/**
*
*/
private static final long serialVersionUID = -7179638016937305380L;
/**
@ -1983,8 +1981,8 @@ public class MPayment extends X_C_Payment
getC_Currency_ID(), getDateAcct(), getC_ConversionType_ID(), getAD_Client_ID(), getAD_Org_ID());
if (payAmt == null)
{
m_processMsg = "Could not convert C_Currency_ID=" + getC_Currency_ID()
+ " to base C_Currency_ID=" + MClient.get(Env.getCtx()).getC_Currency_ID();
m_processMsg = MConversionRateUtil.getErrorMessage(getCtx(), "ErrorConvertingCurrencyToBaseCurrency",
getC_Currency_ID(), MClient.get(getCtx()).getC_Currency_ID(), getC_ConversionType_ID(), getDateAcct(), get_TrxName());
return DocAction.STATUS_Invalid;
}
// Total Balance

View File

@ -346,6 +346,13 @@ public class MPeriod extends X_C_Period
s_log.warning("Could not find C_DocType_ID (null or not Integer) for " + table.getTableName());
return true;
}
if (doctypeID == 0 && tableID == MOrder.Table_ID) {
idxdoctype = po.get_ColumnIndex("C_DocTypeTarget_ID");
objint = po.get_Value(idxdoctype);
if (objint != null && objint instanceof Integer) {
doctypeID = (Integer) objint;
}
}
MDocType dt = MDocType.get(ctx, doctypeID);
docBaseType = dt.getDocBaseType();
}

View File

@ -60,12 +60,12 @@ public class MProductPrice extends X_M_ProductPrice
/**
* Persistency Constructor
* @param ctx context
* @param ignored ignored
* @param M_ProductPrice_ID key
* @param trxName transaction
*/
public MProductPrice (Properties ctx, int M_ProductPrice_ID, String trxName)
{
super(ctx, 0, trxName);
super(ctx, M_ProductPrice_ID, trxName);
} // MProductPrice
/**

View File

@ -128,6 +128,26 @@ public class MRecurring extends X_C_Recurring
msg += journal.getDocumentNo();
setLastPO(journal);
}
else if (getRecurringType().equals(MRecurring.RECURRINGTYPE_Payment))
{
MPayment from = new MPayment(getCtx(), getC_Payment_ID(), get_TrxName());
MPayment to = new MPayment(getCtx(), 0, get_TrxName());
copyValues(from, to);
to.setAD_Org_ID(from.getAD_Org_ID());
to.setIsReconciled(false); // can't be already on a bank statement
to.setDateAcct(dateDoc);
to.setDateTrx(dateDoc);
to.setDocumentNo("");
to.setProcessed(false);
to.setPosted(false);
to.setDocStatus(MPayment.DOCSTATUS_Drafted);
to.setDocAction(MPayment.DOCACTION_Complete);
to.saveEx();
run.setC_Payment_ID(to.getC_Payment_ID());
msg += to.getDocumentNo();
setLastPO(to);
}
else
return "Invalid @RecurringType@ = " + getRecurringType();
run.saveEx(get_TrxName());

View File

@ -661,6 +661,7 @@ public class MTable extends X_AD_Table
Query query = new Query(getCtx(), MViewComponent.Table_Name, MViewComponent.COLUMNNAME_AD_Table_ID + "=?", get_TrxName());
query.setParameters(getAD_Table_ID());
query.setOrderBy(MViewComponent.COLUMNNAME_SeqNo);
query.setOnlyActiveRecords(true);
List<MTableIndex> list = query.<MTableIndex>list();
@ -698,4 +699,4 @@ public class MTable extends X_AD_Table
tablename.equals("M_AttributeSetInstance"));
}
} // MTable
} // MTable

View File

@ -988,7 +988,7 @@ public class MUser extends X_AD_User
rs = pstmt.executeQuery ();
if (rs.next())
{
retValue = new MUser (ctx, rs.getInt(1), null);
retValue = MUser.get(ctx, rs.getInt(1));
if (rs.next())
s_log.warning ("More then one user with Name/Password = " + name);
}

View File

@ -76,7 +76,7 @@ public class MViewComponent extends X_AD_ViewComponent {
Query query = new Query(getCtx(), MViewColumn.Table_Name, MViewColumn.COLUMNNAME_AD_ViewComponent_ID + "=?", get_TrxName());
query.setParameters(getAD_ViewComponent_ID());
query.setOrderBy(MViewColumn.COLUMNNAME_AD_ViewColumn_ID);
query.setOrderBy("SeqNo, AD_ViewColumn_ID");
List<MViewColumn> list = query.<MViewColumn>list();
m_columns = new MViewColumn[list.size()];

View File

@ -79,7 +79,7 @@ public class StandardTaxProvider implements ITaxProvider {
for (int j = 0; j < cTaxes.length; j++)
{
MTax cTax = cTaxes[j];
BigDecimal taxAmt = cTax.calculateTax(oTax.getTaxBaseAmt(), order.isTaxIncluded(), order.getPrecision());
BigDecimal taxAmt = cTax.calculateTax(oTax.getTaxBaseAmt(), false, order.getPrecision());
//
MOrderTax newOTax = new MOrderTax(order.getCtx(), 0, order.get_TrxName());
newOTax.setClientOrg(order);
@ -210,7 +210,7 @@ public class StandardTaxProvider implements ITaxProvider {
for (int j = 0; j < cTaxes.length; j++)
{
MTax cTax = cTaxes[j];
BigDecimal taxAmt = cTax.calculateTax(iTax.getTaxBaseAmt(), invoice.isTaxIncluded(), invoice.getPrecision());
BigDecimal taxAmt = cTax.calculateTax(iTax.getTaxBaseAmt(), false, invoice.getPrecision());
//
MInvoiceTax newITax = new MInvoiceTax(invoice.getCtx(), 0, invoice.get_TrxName());
newITax.setClientOrg(invoice);
@ -336,7 +336,7 @@ public class StandardTaxProvider implements ITaxProvider {
for (int j = 0; j < cTaxes.length; j++)
{
MTax cTax = cTaxes[j];
BigDecimal taxAmt = cTax.calculateTax(oTax.getTaxBaseAmt(), rma.isTaxIncluded(), rma.getPrecision());
BigDecimal taxAmt = cTax.calculateTax(oTax.getTaxBaseAmt(), false, rma.getPrecision());
//
MRMATax newOTax = new MRMATax(rma.getCtx(), 0, rma.get_TrxName());
newOTax.setClientOrg(rma);

View File

@ -29,7 +29,7 @@ public class X_AD_ViewColumn extends PO implements I_AD_ViewColumn, I_Persistent
/**
*
*/
private static final long serialVersionUID = 20151030L;
private static final long serialVersionUID = 20160125L;
/** Standard Constructor */
public X_AD_ViewColumn (Properties ctx, int AD_ViewColumn_ID, String trxName)
@ -252,4 +252,24 @@ public class X_AD_ViewColumn extends PO implements I_AD_ViewColumn, I_Persistent
{
return (String)get_Value(COLUMNNAME_Help);
}
/** Set Sequence.
@param SeqNo
Method of ordering records; lowest number comes first
*/
public void setSeqNo (int SeqNo)
{
set_Value (COLUMNNAME_SeqNo, Integer.valueOf(SeqNo));
}
/** Get Sequence.
@return Method of ordering records; lowest number comes first
*/
public int getSeqNo ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_SeqNo);
if (ii == null)
return 0;
return ii.intValue();
}
}

View File

@ -31,7 +31,7 @@ public class X_C_Recurring extends PO implements I_C_Recurring, I_Persistent
/**
*
*/
private static final long serialVersionUID = 20151030L;
private static final long serialVersionUID = 20151223L;
/** Standard Constructor */
public X_C_Recurring (Properties ctx, int C_Recurring_ID, String trxName)
@ -452,6 +452,8 @@ public class X_C_Recurring extends PO implements I_C_Recurring, I_Persistent
public static final String RECURRINGTYPE_GLJournal = "G";
/** Project = J */
public static final String RECURRINGTYPE_Project = "J";
/** Payment = P */
public static final String RECURRINGTYPE_Payment = "P";
/** Set Recurring Type.
@param RecurringType
Type of Recurring Document

View File

@ -559,13 +559,7 @@ public class MWFNode extends X_AD_WF_Node
*/
@Override
protected boolean beforeSave (boolean newRecord)
{
if(MWorkflow.WORKFLOWTYPE_Manufacturing.equals(getAD_Workflow().getWorkflowType()))
{
setAction(MWFNode.ACTION_WaitSleep);
return true;
}
{
String action = getAction();
if (action.equals(ACTION_WaitSleep))
;

View File

@ -1345,7 +1345,8 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
String adInfo = e.getAD_Message();
if ( ! prevdbInfo.equals(dbInfo)
&& ( GridTab.DEFAULT_STATUS_MESSAGE.equals(adInfo)
&& ( adInfo == null
|| GridTab.DEFAULT_STATUS_MESSAGE.equals(adInfo)
|| GridTable.DATA_REFRESH_MESSAGE.equals(adInfo)
|| GridTable.DATA_INSERTED_MESSAGE.equals(adInfo)
|| GridTable.DATA_UPDATE_COPIED_MESSAGE.equals(adInfo)

View File

@ -94,7 +94,7 @@ public class CompositeADTabbox extends AbstractADTabbox
@Override
public void onEvent(Event event) throws Exception {
if (DetailPane.ON_EDIT_EVENT.equals(event.getName())) {
if (headerTab.getGridTab().isNew()) return;
if (headerTab.getGridTab().isNew() && ! headerTab.needSave(true, false)) return;
final int row = getSelectedDetailADTabpanel() != null
? getSelectedDetailADTabpanel().getGridTab().getCurrentRow()
@ -228,6 +228,7 @@ public class CompositeADTabbox extends AbstractADTabbox
IADTabpanel selectedPanel = getSelectedDetailADTabpanel();
if (selectedPanel == null) return;
int newIndex = selectedPanel.getTabNo();
selectedPanel.query();
Executions.getCurrent().setAttribute(AD_TABBOX_ON_EDIT_DETAIL_ATTRIBUTE, selectedPanel);
Event selectionChanged = new Event(ON_SELECTION_CHANGED_EVENT, layout, new Object[]{oldIndex, newIndex});

View File

@ -231,6 +231,9 @@ public class DPRecentItems extends DashboardPanel implements EventListener<Event
for (MRecentItem ri : ris) {
if (ri.getAD_Window_ID() > 0 && MRole.getDefault().getWindowAccess(ri.getAD_Window_ID()) == null)
continue;
if (ri.getAD_Window_ID() > 0 && !MRole.getDefault().isRecordAccess(ri.getAD_Table_ID(), ri.getRecord_ID(), true))
continue;
String label = ri.getLabel();
if (label == null)
continue;

View File

@ -1647,6 +1647,8 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
// filter dynamic value
dynamicDisplay(null);
onQueryCallback (null);
}
@Override

View File

@ -1985,7 +1985,12 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
}
}
m_sqlUserOrder="";
executeQuery();
// event == null mean direct call from reset button
if (event == null)
m_count = 0;
else
executeQuery();
renderItems();
// IDEMPIERE-1334 after refresh, restore prev selected item start
// just evaluate display logic of process button when requery by use click requery button

View File

@ -271,19 +271,19 @@ public class ReportAction implements EventListener<Event>
int Record_ID = 0;
int[] RecordIDs = null;
MQuery query = new MQuery(gridTab.getTableName());
String whereClause;
StringBuilder whereClause = new StringBuilder("");
if (currentRowOnly)
{
Record_ID = gridTab.getRecord_ID();
whereClause = gridTab.getTableModel().getWhereClause(gridTab.getCurrentRow());
if (whereClause==null)
whereClause = gridTab.getTableModel().getSelectWhereClause();
whereClause.append(gridTab.getTableModel().getWhereClause(gridTab.getCurrentRow()));
if (whereClause.length() == 0)
whereClause.append(gridTab.getTableModel().getSelectWhereClause());
}
else
{
whereClause = gridTab.getTableModel().getSelectWhereClause();
whereClause.append(gridTab.getTableModel().getSelectWhereClause());
RecordIDs = new int[gridTab.getRowCount()];
for(int i = 0; i < gridTab.getRowCount(); i++)
{
@ -291,24 +291,34 @@ public class ReportAction implements EventListener<Event>
}
}
if (whereClause!=null && whereClause.length() > 0)
if (whereClause.length() > 0)
{
if (whereClause.indexOf('@') != -1) //replace variables in context
if (whereClause.indexOf("@") != -1) //replace variables in context
{
String context = Env.parseContext(Env.getCtx(), panel.getWindowNo(), whereClause, false);
String context = Env.parseContext(Env.getCtx(), panel.getWindowNo(), whereClause.toString(), false);
if(context != null && context.trim().length() > 0)
{
whereClause = context;
whereClause = new StringBuilder(context);
}
else
{
log.log(Level.WARNING, "Failed to parse where clause. whereClause= "+whereClause);
whereClause = ("1 = 2");
whereClause = new StringBuilder("1 = 2");
}
}
}
query.addRestriction(whereClause);
if (!currentRowOnly && gridTab.isOnlyCurrentRows() && gridTab.getTabNo() == 0)
{
if (whereClause.length() > 0)
whereClause.append(" AND ");
// Show only unprocessed or the one updated within x days
whereClause.append("(").append(gridTab.getTableName()).append(".Processed='N' OR ").append(gridTab.getTableName()).append(".Updated>");
whereClause.append("SysDate-1");
whereClause.append(")");
}
query.addRestriction(whereClause.toString());
PrintInfo info = new PrintInfo(pf.getName(), pf.getAD_Table_ID(), Record_ID);
info.setDescription(query.getInfo());

View File

@ -16,9 +16,13 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.logging.Level;
import javax.servlet.http.HttpServletRequest;
import org.adempiere.util.ServerContext;
import org.compiere.model.MSession;
import org.compiere.model.MUser;
@ -29,6 +33,7 @@ import org.compiere.util.Env;
import org.compiere.util.KeyNamePair;
import org.compiere.util.Language;
import org.compiere.util.Login;
import org.idempiere.adInterface.x10.ADLoginRequest;
/**
* @author deepak
@ -46,6 +51,12 @@ public class CompiereService {
private int m_M_Warehouse_ID;
private String m_locale;
private String m_userName;
private String m_password;
private int m_expiryMinutes;
private long m_lastAuthorizationTime;
private String m_IPAddress;
private static Map<String,CompiereService> csMap = new HashMap<String, CompiereService>();
private static Map<String,Properties> ctxMap = new HashMap<String, Properties>();
private boolean m_loggedin = false;
@ -68,7 +79,7 @@ public class CompiereService {
public final String dateFormatOnlyForCtx = "yyyy-MM-dd";
private boolean m_connected;
/**
*
* @return AD_Client_ID of current request
@ -131,12 +142,23 @@ public class CompiereService {
*/
public void disconnect()
{
if (m_connected)
{
Env.logout();
ServerContext.dispose();
m_loggedin = false;
m_connected = false;
// TODO: create a thread that checks expired connected compiereservices and log them out
if (! isExpired()) {
// do not close, save session in cache
if (! csMap.containsValue(this)) {
String key = getKey(m_AD_Client_ID,
m_AD_Org_ID,
m_userName,
m_AD_Role_ID,
m_M_Warehouse_ID,
m_locale,
m_password,
m_IPAddress);
csMap.put(key.toString(), this);
Properties savedCache = new Properties();
savedCache.putAll(Env.getCtx());
ctxMap.put(key.toString(), savedCache);
}
}
}
@ -328,4 +350,101 @@ public class CompiereService {
return m_userName;
}
/**
* @return set password
*/
public void setPassword(String pass) {
m_password = pass;
}
/**
* @return logged in password of current request
*/
public String getPassword() {
return m_password;
}
/**
* @return set expiry minutes
*/
public void setExpiryMinutes(int expiryMinutes) {
m_expiryMinutes = expiryMinutes;
}
/**
* @return logged in expiry minutes of current request
*/
public int getExpiryMinutes() {
return m_expiryMinutes;
}
public void refreshLastAuthorizationTime() {
m_lastAuthorizationTime = System.currentTimeMillis();
}
public void setIPAddress(String remoteAddr) {
m_IPAddress = remoteAddr;
}
public static CompiereService get(HttpServletRequest req, ADLoginRequest loginRequest) {
String key = getKey(loginRequest.getClientID(),
loginRequest.getOrgID(),
loginRequest.getUser(),
loginRequest.getRoleID(),
loginRequest.getWarehouseID(),
loginRequest.getLang(),
loginRequest.getPass(),
req.getRemoteAddr());
CompiereService l_cs = null;
if (csMap.containsKey(key)) {
l_cs = csMap.get(key);
if (l_cs != null) {
if (l_cs.isExpired()) {
l_cs = null;
} else {
Properties cachedCtx = ctxMap.get(key);
Env.getCtx().putAll(cachedCtx);
}
}
}
return l_cs;
}
private static String getKey(
int aD_Client_ID,
int aD_Org_ID,
String userName,
int aD_Role_ID,
int m_Warehouse_ID,
String locale,
String password,
String iPAddress) {
StringBuilder key = new StringBuilder()
.append(aD_Client_ID).append("|")
.append(aD_Org_ID).append("|")
.append(userName).append("|")
.append(aD_Role_ID).append("|")
.append(m_Warehouse_ID).append("|")
.append(locale).append("|")
.append(password).append("|")
.append(iPAddress);
return key.toString();
}
private boolean isExpired() {
boolean expired =
(
(getExpiryMinutes() <= 0)
|| (m_lastAuthorizationTime + (getExpiryMinutes() * 60000) <= System.currentTimeMillis())
);
if (m_connected && expired)
{
Env.logout();
ServerContext.dispose();
m_loggedin = false;
m_connected = false;
}
return expired;
}
}

View File

@ -85,6 +85,16 @@ public class AbstractService {
protected String login(ADLoginRequest loginRequest, String webService, String method, String serviceType) {
CompiereService m_cs = getCompiereService();
if (m_cs.getUserName() == null) {
HttpServletRequest req = getHttpServletRequest();
// search for a non-expired CompiereService with same login data
CompiereService cachedCs = CompiereService.get(req, loginRequest);
if (cachedCs != null) {
m_cs = cachedCs;
req.setAttribute(COMPIERE_SERVICE, cachedCs);
return authenticate(webService, method, serviceType, cachedCs); // already logged with same data
}
}
if (m_cs.isLoggedIn() && m_cs.getAD_Client_ID() == loginRequest.getClientID() && loginRequest.getClientID() == Env.getAD_Client_ID(Env.getCtx())
&& m_cs.getAD_Org_ID() == loginRequest.getOrgID() && m_cs.getAD_Role_ID() == loginRequest.getRoleID()
@ -99,6 +109,9 @@ public class AbstractService {
KeyNamePair[] clients = login.getClients(loginRequest.getUser(), loginRequest.getPass());
if (clients == null)
return "Error login - User invalid";
m_cs.setPassword(loginRequest.getPass());
m_cs.setExpiryMinutes(loginRequest.getStage());
m_cs.setIPAddress(getHttpServletRequest().getRemoteAddr());
boolean okclient = false;
KeyNamePair selectedClient = null;
@ -248,7 +261,9 @@ public class AbstractService {
String ret=invokeLoginValidator(null, m_cs.getCtx(), m_webservicetype, IWSValidator.TIMING_ON_AUTHORIZATION);
if(ret!=null && ret.length()>0)
return ret;
m_cs.refreshLastAuthorizationTime();
return null;
}

View File

@ -1,13 +1,13 @@
<project name="zklibrary" basedir="." default="copy">
<target name="copy">
<get src="http://mavensync.zkoss.org/maven2/org/zkoss/zk/zk/7.0.7.FL.20151022/zk-7.0.7.FL.20151022.jar" dest="lib/zk.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://mavensync.zkoss.org/maven2/org/zkoss/zk/zul/7.0.7.FL.20151022/zul-7.0.7.FL.20151022.jar" dest="lib/zul.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://mavensync.zkoss.org/maven2/org/zkoss/zk/zhtml/7.0.7.FL.20151022/zhtml-7.0.7.FL.20151022.jar" dest="lib/zhtml.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://mavensync.zkoss.org/maven2/org/zkoss/zk/zkplus/7.0.7.FL.20151022/zkplus-7.0.7.FL.20151022.jar" dest="lib/zkplus.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://mavensync.zkoss.org/maven2/org/zkoss/zk/zkbind/7.0.7.FL.20151022/zkbind-7.0.7.FL.20151022.jar" dest="lib/zkbind.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://mavensync.zkoss.org/maven2/org/zkoss/common/zcommon/7.0.7.FL.20151022/zcommon-7.0.7.FL.20151022.jar" dest="lib/zcommon.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://mavensync.zkoss.org/maven2/org/zkoss/common/zel/7.0.7.FL.20151022/zel-7.0.7.FL.20151022.jar" dest="lib/zel.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://mavensync.zkoss.org/maven2/org/zkoss/common/zweb/7.0.7.FL.20151022/zweb-7.0.7.FL.20151022.jar" dest="lib/zweb.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://downloads.sourceforge.net/project/idempiere/binary.file/jarfile/3.1/zk.jar" dest="lib/zk.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://downloads.sourceforge.net/project/idempiere/binary.file/jarfile/3.1/zul.jar" dest="lib/zul.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://downloads.sourceforge.net/project/idempiere/binary.file/jarfile/3.1/zhtml.jar" dest="lib/zhtml.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://downloads.sourceforge.net/project/idempiere/binary.file/jarfile/3.1/zkplus.jar" dest="lib/zkplus.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://downloads.sourceforge.net/project/idempiere/binary.file/jarfile/3.1/zkbind.jar" dest="lib/zkbind.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://downloads.sourceforge.net/project/idempiere/binary.file/jarfile/3.1/zcommon.jar" dest="lib/zcommon.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://downloads.sourceforge.net/project/idempiere/binary.file/jarfile/3.1/zel.jar" dest="lib/zel.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://downloads.sourceforge.net/project/idempiere/binary.file/jarfile/3.1/zweb.jar" dest="lib/zweb.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://mavensync.zkoss.org/maven2/org/zkoss/zkforge/ckez/4.4.6.2/ckez-4.4.6.2.jar" dest="lib/ckez.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://mavensync.zkoss.org/maven2/org/zkoss/zkforge/gmapsz/3.0.3/gmapsz-3.0.3.jar" dest="lib/gmapsz.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://mavensync.zkoss.org/maven2/org/zkoss/zkforge/timelinez/2.3.1_50/timelinez-2.3.1_50.jar" dest="lib/timelinez.jar" usetimestamp="true" verbose="true" retries="5" />