hg merge release-4.1 (merge release4.1 into development)

This commit is contained in:
Carlos Ruiz 2017-04-04 23:44:37 +02:00
commit 50719be0ec
91 changed files with 603 additions and 351 deletions

View File

@ -1,5 +1,5 @@
CREATE OR REPLACE VIEW ad_field_v AS
SELECT t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, f.name, f.description, f.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, c.vformat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, c.iskey, c.isparent, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated, COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id, COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, COALESCE(f.isalwaysupdateable, c.isalwaysupdateable) AS isalwaysupdateable, COALESCE(f.readonlylogic, c.readonlylogic) AS readonlylogic, COALESCE(f.mandatorylogic, c.mandatorylogic) AS mandatorylogic, COALESCE(f.isupdateable, c.isupdateable) AS isupdateable, c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fg.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid, f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield, f.isdefaultfocus, c.ad_chart_id, f.ad_labelstyle_id, f.ad_fieldstyle_id, c.pa_dashboardcontent_id
SELECT t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, f.name, f.description, f.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, COALESCE(f.VFormat, c.VFormat) AS VFormat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, c.iskey, c.isparent, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated, COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id, COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, COALESCE(f.isalwaysupdateable, c.isalwaysupdateable) AS isalwaysupdateable, COALESCE(f.readonlylogic, c.readonlylogic) AS readonlylogic, COALESCE(f.mandatorylogic, c.mandatorylogic) AS mandatorylogic, COALESCE(f.isupdateable, c.isupdateable) AS isupdateable, c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fg.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid, f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield, f.isdefaultfocus, c.ad_chart_id, f.ad_labelstyle_id, f.ad_fieldstyle_id, c.pa_dashboardcontent_id
FROM ad_field f
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id

View File

@ -1,5 +1,5 @@
CREATE OR REPLACE VIEW ad_field_vt AS
SELECT trl.ad_language, t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, trl.name, trl.description, trl.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, c.vformat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, c.iskey, c.isparent, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated, COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id, COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, COALESCE(f.isalwaysupdateable, c.isalwaysupdateable) AS isalwaysupdateable, COALESCE(f.readonlylogic, c.readonlylogic) AS readonlylogic, COALESCE(f.mandatorylogic, c.mandatorylogic) AS mandatorylogic, COALESCE(f.isupdateable, c.isupdateable) AS isupdateable, c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fgt.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid, f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield, f.isdefaultfocus, c.ad_chart_id, f.ad_labelstyle_id, f.ad_fieldstyle_id, c.pa_dashboardcontent_id
SELECT trl.ad_language, t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, trl.name, trl.description, trl.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, COALESCE(f.VFormat, c.VFormat) AS VFormat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, c.iskey, c.isparent, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated, COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id, COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, COALESCE(f.isalwaysupdateable, c.isalwaysupdateable) AS isalwaysupdateable, COALESCE(f.readonlylogic, c.readonlylogic) AS readonlylogic, COALESCE(f.mandatorylogic, c.mandatorylogic) AS mandatorylogic, COALESCE(f.isupdateable, c.isupdateable) AS isupdateable, c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fgt.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid, f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield, f.isdefaultfocus, c.ad_chart_id, f.ad_labelstyle_id, f.ad_fieldstyle_id, c.pa_dashboardcontent_id
FROM ad_field f
JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id

View File

@ -1,6 +1,6 @@
CREATE OR REPLACE VIEW ad_field_v AS
SELECT t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, f.name, f.description, f.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline,
f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, c.vformat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue,
f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, COALESCE(f.VFormat, c.VFormat) AS VFormat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue,
c.iskey, c.isparent, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated, COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id,
c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id, COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, COALESCE(f.isalwaysupdateable, c.isalwaysupdateable) AS isalwaysupdateable,
COALESCE(f.readonlylogic, c.readonlylogic) AS readonlylogic, COALESCE(f.mandatorylogic, c.mandatorylogic) AS mandatorylogic, COALESCE(f.isupdateable, c.isupdateable) AS isupdateable,

View File

@ -1,6 +1,6 @@
CREATE OR REPLACE VIEW ad_field_vt AS
SELECT trl.ad_language, t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, trl.name, trl.description, trl.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno,
f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, c.vformat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue,
f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, COALESCE(f.VFormat, c.VFormat) AS VFormat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue,
c.iskey, c.isparent, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated, COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id,
c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id, COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, COALESCE(f.isalwaysupdateable,
c.isalwaysupdateable) AS isalwaysupdateable, COALESCE(f.readonlylogic, c.readonlylogic) AS readonlylogic, COALESCE(f.mandatorylogic, c.mandatorylogic) AS mandatorylogic, COALESCE(f.isupdateable, c.isupdateable) AS isupdateable,

View File

@ -0,0 +1,57 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Feb 27, 2017 12:25:32 PM GMT+08:00
-- 1007607 Implement generic UOM conversions
UPDATE AD_IndexColumn SET ColumnSQL='COALESCE(M_Product_ID,-1)',Updated=TO_DATE('2017-02-27 12:25:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_IndexColumn_ID=200656
;
-- Feb 27, 2017 12:25:46 PM GMT+08:00
DROP INDEX c_uom_conversion_product
;
-- Feb 27, 2017 12:25:46 PM GMT+08:00
CREATE UNIQUE INDEX c_uom_conversion_product ON C_UOM_Conversion (C_UOM_ID,C_UOM_To_ID,COALESCE(M_Product_ID,-1))
;
-- Feb 27, 2017 12:29:47 PM GMT+08:00
UPDATE AD_Field SET IsMandatory=NULL, AD_Val_Rule_ID=NULL, AD_Reference_Value_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-02-27 12:29:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10831
;
-- Feb 27, 2017 12:49:10 PM GMT+08:00
UPDATE AD_Val_Rule SET Code='(
EXISTS (
/* UOM is a default UOM and no product selected */
SELECT *
FROM C_UOM uu
WHERE C_UOM.C_UOM_ID=uu.C_UOM_ID AND IsActive =''Y'' AND IsDefault=''Y'' AND @M_Product_ID@=0
)
OR EXISTS (
/* UOM is the products UOM */
SELECT *
FROM M_Product p
WHERE C_UOM.C_UOM_ID=p.C_UOM_ID AND @M_Product_ID@=p.M_Product_ID
)
OR EXISTS (
/* For the products UOM there is a conversion that is explicitly bound to the product */
SELECT *
FROM M_Product p INNER JOIN C_UOM_Conversion c ON (p.C_UOM_ID=c.C_UOM_ID AND p.M_PRODUCT_ID=c.M_Product_ID AND c.IsActive =''Y'' )
WHERE C_UOM.C_UOM_ID=c.C_UOM_TO_ID AND @M_Product_ID@=p.M_Product_ID
)
OR EXISTS (
/* For the products UOM there is a conversion that is not bound to any product explicitly */
SELECT *
FROM M_Product p INNER JOIN C_UOM_Conversion c ON (p.C_UOM_ID=c.C_UOM_ID AND c.M_Product_ID IS NULL AND c.IsActive =''Y'' )
WHERE C_UOM.C_UOM_ID=c.C_UOM_TO_ID AND @M_Product_ID@=p.M_Product_ID
AND NOT EXISTS (
SELECT *
FROM M_Product p1 INNER JOIN C_UOM_Conversion c1 ON (p1.C_UOM_ID=c1.C_UOM_ID AND p1.M_PRODUCT_ID=c1.M_Product_ID AND c1.IsActive =''N'' )
WHERE c.C_UOM_ID=c1.C_UOM_ID AND c.C_UOM_TO_ID=c1.C_UOM_TO_ID AND p1.M_Product_ID=@M_Product_ID@
)
)
)',Updated=TO_DATE('2017-02-27 12:49:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=210
;
SELECT register_migration_script('201702271800_Ticket_1007607.sql') FROM dual
;

View File

@ -0,0 +1,11 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-3330 Shipment Line - movement qty field not shown until qty is changed
-- Mar 31, 2017 6:03:02 PM CEST
UPDATE AD_Column SET Callout='org.compiere.model.CalloutInOut.navigateInOutLine', IsUpdateable='N',Updated=TO_DATE('2017-03-31 18:03:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3529
;
SELECT register_migration_script('201703311809_IDEMPIERE-3330.sql') FROM dual
;

View File

@ -0,0 +1,27 @@
CREATE OR REPLACE VIEW ad_field_v AS
SELECT t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, f.name, f.description, f.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, COALESCE(f.VFormat, c.VFormat) AS VFormat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, c.iskey, c.isparent, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated, COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id, COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, COALESCE(f.isalwaysupdateable, c.isalwaysupdateable) AS isalwaysupdateable, COALESCE(f.readonlylogic, c.readonlylogic) AS readonlylogic, COALESCE(f.mandatorylogic, c.mandatorylogic) AS mandatorylogic, COALESCE(f.isupdateable, c.isupdateable) AS isupdateable, c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fg.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid, f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield, f.isdefaultfocus, c.ad_chart_id, f.ad_labelstyle_id, f.ad_fieldstyle_id, c.pa_dashboardcontent_id
FROM ad_field f
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id
LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id
JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id
LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id)
WHERE f.isactive = 'Y' AND c.isactive = 'Y'
;
CREATE OR REPLACE VIEW ad_field_vt AS
SELECT trl.ad_language, t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, trl.name, trl.description, trl.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, COALESCE(f.VFormat, c.VFormat) AS VFormat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, c.iskey, c.isparent, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated, COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id, COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, COALESCE(f.isalwaysupdateable, c.isalwaysupdateable) AS isalwaysupdateable, COALESCE(f.readonlylogic, c.readonlylogic) AS readonlylogic, COALESCE(f.mandatorylogic, c.mandatorylogic) AS mandatorylogic, COALESCE(f.isupdateable, c.isupdateable) AS isupdateable, c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fgt.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid, f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield, f.isdefaultfocus, c.ad_chart_id, f.ad_labelstyle_id, f.ad_fieldstyle_id, c.pa_dashboardcontent_id
FROM ad_field f
JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id
LEFT JOIN ad_fieldgroup_trl fgt ON f.ad_fieldgroup_id = fgt.ad_fieldgroup_id AND trl.ad_language = fgt.ad_language
LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id
JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id
LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id)
WHERE f.isactive = 'Y' AND c.isactive = 'Y'
;
SELECT register_migration_script('201704010847_IDEMPIERE-3115.sql') FROM dual
;

View File

@ -0,0 +1,54 @@
-- Feb 27, 2017 12:25:32 PM GMT+08:00
-- 1007607 Implement generic UOM conversions
UPDATE AD_IndexColumn SET ColumnSQL='COALESCE(M_Product_ID,-1)',Updated=TO_TIMESTAMP('2017-02-27 12:25:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_IndexColumn_ID=200656
;
-- Feb 27, 2017 12:25:46 PM GMT+08:00
DROP INDEX c_uom_conversion_product
;
-- Feb 27, 2017 12:25:46 PM GMT+08:00
CREATE UNIQUE INDEX c_uom_conversion_product ON C_UOM_Conversion (C_UOM_ID,C_UOM_To_ID,COALESCE(M_Product_ID,-1))
;
-- Feb 27, 2017 12:29:47 PM GMT+08:00
UPDATE AD_Field SET IsMandatory=NULL, AD_Val_Rule_ID=NULL, AD_Reference_Value_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-02-27 12:29:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10831
;
-- Feb 27, 2017 12:49:10 PM GMT+08:00
UPDATE AD_Val_Rule SET Code='(
EXISTS (
/* UOM is a default UOM and no product selected */
SELECT *
FROM C_UOM uu
WHERE C_UOM.C_UOM_ID=uu.C_UOM_ID AND IsActive =''Y'' AND IsDefault=''Y'' AND @M_Product_ID@=0
)
OR EXISTS (
/* UOM is the products UOM */
SELECT *
FROM M_Product p
WHERE C_UOM.C_UOM_ID=p.C_UOM_ID AND @M_Product_ID@=p.M_Product_ID
)
OR EXISTS (
/* For the products UOM there is a conversion that is explicitly bound to the product */
SELECT *
FROM M_Product p INNER JOIN C_UOM_Conversion c ON (p.C_UOM_ID=c.C_UOM_ID AND p.M_PRODUCT_ID=c.M_Product_ID AND c.IsActive =''Y'' )
WHERE C_UOM.C_UOM_ID=c.C_UOM_TO_ID AND @M_Product_ID@=p.M_Product_ID
)
OR EXISTS (
/* For the products UOM there is a conversion that is not bound to any product explicitly */
SELECT *
FROM M_Product p INNER JOIN C_UOM_Conversion c ON (p.C_UOM_ID=c.C_UOM_ID AND c.M_Product_ID IS NULL AND c.IsActive =''Y'' )
WHERE C_UOM.C_UOM_ID=c.C_UOM_TO_ID AND @M_Product_ID@=p.M_Product_ID
AND NOT EXISTS (
SELECT *
FROM M_Product p1 INNER JOIN C_UOM_Conversion c1 ON (p1.C_UOM_ID=c1.C_UOM_ID AND p1.M_PRODUCT_ID=c1.M_Product_ID AND c1.IsActive =''N'' )
WHERE c.C_UOM_ID=c1.C_UOM_ID AND c.C_UOM_TO_ID=c1.C_UOM_TO_ID AND p1.M_Product_ID=@M_Product_ID@
)
)
)',Updated=TO_TIMESTAMP('2017-02-27 12:49:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=210
;
SELECT register_migration_script('201702271800_Ticket_1007607.sql') FROM dual
;

View File

@ -0,0 +1,8 @@
-- IDEMPIERE-3330 Shipment Line - movement qty field not shown until qty is changed
-- Mar 31, 2017 6:03:02 PM CEST
UPDATE AD_Column SET Callout='org.compiere.model.CalloutInOut.navigateInOutLine', IsUpdateable='N',Updated=TO_TIMESTAMP('2017-03-31 18:03:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3529
;
SELECT register_migration_script('201703311809_IDEMPIERE-3330.sql') FROM dual
;

View File

@ -0,0 +1,42 @@
CREATE OR REPLACE VIEW ad_field_v AS
SELECT t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, f.name, f.description, f.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline,
f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, COALESCE(f.VFormat, c.VFormat) AS VFormat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue,
c.iskey, c.isparent, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated, COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id,
c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id, COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, COALESCE(f.isalwaysupdateable, c.isalwaysupdateable) AS isalwaysupdateable,
COALESCE(f.readonlylogic, c.readonlylogic) AS readonlylogic, COALESCE(f.mandatorylogic, c.mandatorylogic) AS mandatorylogic, COALESCE(f.isupdateable, c.isupdateable) AS isupdateable,
c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fg.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype,
fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid,
f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield, f.isdefaultfocus,
c.ad_chart_id, f.ad_labelstyle_id, f.ad_fieldstyle_id, c.pa_dashboardcontent_id
FROM ad_field f
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id
LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id
JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id
LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id)
WHERE f.isactive = 'Y' AND c.isactive = 'Y'
;
CREATE OR REPLACE VIEW ad_field_vt AS
SELECT trl.ad_language, t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, trl.name, trl.description, trl.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno,
f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, COALESCE(f.VFormat, c.VFormat) AS VFormat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue,
c.iskey, c.isparent, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated, COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id,
c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id, COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, COALESCE(f.isalwaysupdateable,
c.isalwaysupdateable) AS isalwaysupdateable, COALESCE(f.readonlylogic, c.readonlylogic) AS readonlylogic, COALESCE(f.mandatorylogic, c.mandatorylogic) AS mandatorylogic, COALESCE(f.isupdateable, c.isupdateable) AS isupdateable,
c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fgt.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype,
fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid,
f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield, f.isdefaultfocus, c.ad_chart_id, f.ad_labelstyle_id, f.ad_fieldstyle_id, c.pa_dashboardcontent_id
FROM ad_field f
JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id
LEFT JOIN ad_fieldgroup_trl fgt ON f.ad_fieldgroup_id = fgt.ad_fieldgroup_id AND trl.ad_language::text = fgt.ad_language::text
LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id
JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id
LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id)
WHERE f.isactive = 'Y' AND c.isactive = 'Y'
;
SELECT register_migration_script('201704010847_IDEMPIERE-3115.sql') FROM dual
;

View File

@ -719,4 +719,21 @@ public class CalloutInOut extends CalloutEngine
return "";
} // asi
public String navigateInOutLine(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value)
{
if (isCalloutActive() || value == null)
return "";
int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_Product_ID");
// No Product
if (M_Product_ID != 0) {
MProduct product = MProduct.get(ctx, M_Product_ID);
int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID");
boolean conversion = (C_UOM_To_ID != product.getC_UOM_ID());
Env.setContext(ctx, WindowNo, "UOMConversion", conversion ? "Y" : "N");
}
return "";
} // navigateInOutLine
} // CalloutInOut

View File

@ -232,7 +232,7 @@ public class DunningPrint extends SvrProcess
if (printed)
{
entry.setProcessed (true);
entry.save ();
entry.saveEx();
}
} // for all dunning letters

View File

@ -514,7 +514,7 @@ public class ImportGLJournal extends SvrProcess
// Set TrxOrg
sql = new StringBuilder ("UPDATE I_GLJournal i ")
.append("SET AD_OrgTrx_ID=(SELECT o.AD_Org_ID FROM AD_Org o")
.append(" WHERE o.Value=i.OrgValue AND o.IsSummary='N' AND i.AD_Client_ID=o.AD_Client_ID) ")
.append(" WHERE o.Value=i.OrgTrxValue AND o.IsSummary='N' AND i.AD_Client_ID=o.AD_Client_ID) ")
.append("WHERE AD_OrgTrx_ID IS NULL AND OrgTrxValue IS NOT NULL")
.append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
no = DB.executeUpdate(sql.toString(), get_TrxName());

View File

@ -609,7 +609,7 @@ public class ImportInvoice extends SvrProcess
imp.setAD_User_ID (user.getAD_User_ID ());
}
}
imp.save ();
imp.saveEx();
} // for all new BPartners
//
}

View File

@ -610,7 +610,7 @@ public class ImportOrder extends SvrProcess
imp.setAD_User_ID (user.getAD_User_ID ());
}
}
imp.save ();
imp.saveEx();
} // for all new BPartners
//
}

View File

@ -21,7 +21,6 @@ import java.sql.Timestamp;
import java.util.List;
import java.util.logging.Level;
import org.compiere.model.MAttributeSetInstance;
import org.compiere.model.MClient;
import org.compiere.model.MLocator;
import org.compiere.model.MProduct;
@ -158,10 +157,9 @@ public class M_Production_Run extends SvrProcess {
Timestamp dateMPolicy = production.getMovementDate();
if(pline.getM_AttributeSetInstance_ID()>0){
if(pline.getM_AttributeSetInstance_ID()>0){
MAttributeSetInstance asi = new MAttributeSetInstance(getCtx(), pline.getM_AttributeSetInstance_ID(), get_TrxName());
dateMPolicy = asi.getCreated();
}
Timestamp t = MStorageOnHand.getDateMaterialPolicy(pline.getM_Product_ID(), pline.getM_AttributeSetInstance_ID(), get_TrxName());
if (t != null)
dateMPolicy = t;
}
if (!MStorageOnHand.add(getCtx(), locator.getM_Warehouse_ID(),

View File

@ -161,7 +161,7 @@ public class ProjectGenPO extends SvrProcess
}
order.setClientOrg (projectLine.getAD_Client_ID (), AD_Org_ID);
order.setBPartner (bp);
order.save ();
order.saveEx();
// optionally save for consolidation
if (m_ConsolidateDocument)
m_pos.add(order);

View File

@ -258,7 +258,7 @@ public class TableCreateColumns extends SvrProcess
element.setName(uuidColumn);
element.setPrintName(uuidColumn);
}
element.save ();
element.saveEx();
}
column.setColumnName (element.getColumnName ());
column.setName (element.getName ());

View File

@ -192,4 +192,4 @@ Require-Bundle: org.eclipse.equinox.app;bundle-version="0.0.0",
com.itextpdf;bundle-version="0.0.0",
net.sf.supercsv.super-csv;bundle-version="0.0.0",
bcprov;bundle-version="1.54.0",
groovy-all;bundle-version="2.4.7"
groovy-all;bundle-version="[2.4.7,2.5.0)"

View File

@ -67,7 +67,7 @@ public class RequestEventHandler extends AbstractEventHandler implements Managed
MNote note = new MNote(Env.getCtx(), AD_Message_ID, eventData.getTo().getAD_User_ID(),
X_R_Request.Table_ID, eventData.getRequestID(),
eventData.getSubject(), eventData.getMessage(), null);
note.save();
note.saveEx();
}
}
else if (topic.equals(IEventTopics.PO_BEFORE_NEW) || topic.equals(IEventTopics.PO_BEFORE_CHANGE)
@ -390,7 +390,7 @@ public class RequestEventHandler extends AbstractEventHandler implements Managed
MNote note = new MNote(r.getCtx(), AD_Message_ID, AD_User_ID,
X_R_Request.Table_ID, r.getR_Request_ID(),
subject, message.toString(), r.get_TrxName());
note.save();
note.saveEx();
}
}
}

View File

@ -108,7 +108,7 @@ public class ProductPriceValidator implements ModelValidator {
{
pp1.setPrices(priceList, priceStd, priceLimit);
pp1.setIsActive(isActive);
pp1.save(po.get_TrxName());
pp1.saveEx(po.get_TrxName());
}
}
else if (type == TYPE_AFTER_DELETE)

View File

@ -1049,10 +1049,17 @@ class Doc_AllocationTax
total, m_WriteOffAmt, precision);
if (amount.signum() != 0)
{
fact.createLine (line, m_WriteOffAccount,
as.getC_Currency_ID(), amount, null);
fact.createLine (line, taxAcct,
as.getC_Currency_ID(), null, amount);
if (m_IsSOTrx) {
fact.createLine (line, m_WriteOffAccount,
as.getC_Currency_ID(), amount, null);
fact.createLine (line, taxAcct,
as.getC_Currency_ID(), null, amount);
} else {
fact.createLine (line, m_WriteOffAccount,
as.getC_Currency_ID(), amount.negate(), null);
fact.createLine (line, taxAcct,
as.getC_Currency_ID(), null, amount.negate());
}
}
}
// Original Tax is CR - need to correct it DR
@ -1062,10 +1069,17 @@ class Doc_AllocationTax
total, m_WriteOffAmt, precision);
if (amount.signum() != 0)
{
fact.createLine (line, taxAcct,
as.getC_Currency_ID(), amount, null);
fact.createLine (line, m_WriteOffAccount,
as.getC_Currency_ID(), null, amount);
if(m_IsSOTrx) {
fact.createLine (line, taxAcct,
as.getC_Currency_ID(), amount, null);
fact.createLine (line, m_WriteOffAccount,
as.getC_Currency_ID(), null, amount);
} else {
fact.createLine (line, taxAcct,
as.getC_Currency_ID(), amount.negate(), null);
fact.createLine (line, m_WriteOffAccount,
as.getC_Currency_ID(), null, amount.negate());
}
}
}
} // WriteOff

View File

@ -21,6 +21,7 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Savepoint;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
@ -901,11 +902,16 @@ public class Doc_Invoice extends Doc
BigDecimal allocationAmt = lca.getAmt();
BigDecimal estimatedAmt = BigDecimal.ZERO;
int oCurrencyId = 0;
boolean usesSchemaCurrency = false;
Timestamp oDateAcct = getDateAcct();
if (lca.getM_InOutLine_ID() > 0)
{
I_M_InOutLine iol = lca.getM_InOutLine();
if (iol.getC_OrderLine_ID() > 0)
{
oCurrencyId = iol.getC_OrderLine().getC_Currency_ID();
oDateAcct = iol.getC_OrderLine().getC_Order().getDateAcct();
MOrderLandedCostAllocation[] allocations = MOrderLandedCostAllocation.getOfOrderLine(iol.getC_OrderLine_ID(), getTrxName());
for(MOrderLandedCostAllocation allocation : allocations)
{
@ -945,7 +951,24 @@ public class Doc_Invoice extends Doc
//add back since the sum above would include the original trx
estimatedAmt = estimatedAmt.add(allocationAmt.negate());
}
}
}
//added for IDEMPIERE-3014
//convert to accounting schema currency
if (estimatedAmt.signum() > 0 && oCurrencyId != getC_Currency_ID())
{
estimatedAmt = MConversionRate.convert(getCtx(), estimatedAmt,
oCurrencyId, as.getC_Currency_ID(),
oDateAcct, getC_ConversionType_ID(),
getAD_Client_ID(), getAD_Org_ID());
allocationAmt = MConversionRate.convert(getCtx(), allocationAmt,
getC_Currency_ID(), as.getC_Currency_ID(),
getDateAcct(), getC_ConversionType_ID(),
getAD_Client_ID(), getAD_Org_ID());
setC_Currency_ID(as.getC_Currency_ID());
usesSchemaCurrency = true;
}
if (estimatedAmt.signum() > 0)
{
if (allocationAmt.signum() > 0)
@ -1073,7 +1096,9 @@ public class Doc_Invoice extends Doc
fl.setM_Product_ID(lca.getM_Product_ID());
fl.setQty(line.getQty());
}
}
}
if (usesSchemaCurrency)
setC_Currency_ID(line.getC_Currency_ID());
}
else
{

View File

@ -402,9 +402,12 @@ public class Doc_MatchInv extends Doc
}
String costingMethod = m_pc.getProduct().getCostingMethod(as);
MAccount account = m_pc.getAccount(ProductCost.ACCTTYPE_P_Asset, as);
if (m_pc.isService())
account = m_pc.getAccount(ProductCost.ACCTTYPE_P_Expense, as);
if (X_M_Cost.COSTINGMETHOD_AveragePO.equals(costingMethod)) {
MAccount account = zeroQty ? m_pc.getAccount(ProductCost.ACCTTYPE_P_AverageCostVariance, as) : m_pc.getAccount(ProductCost.ACCTTYPE_P_Asset, as);
if (zeroQty)
account = m_pc.getAccount(ProductCost.ACCTTYPE_P_AverageCostVariance, as);
FactLine line = fact.createLine(null,
m_pc.getAccount(ProductCost.ACCTTYPE_P_IPV, as),
as.getC_Currency_ID(), ipv.negate());
@ -413,8 +416,6 @@ public class Doc_MatchInv extends Doc
line = fact.createLine(null, account, as.getC_Currency_ID(), ipv);
updateFactLine(line);
} else if (X_M_Cost.COSTINGMETHOD_AverageInvoice.equals(costingMethod) && !zeroQty) {
MAccount account = m_pc.getAccount(ProductCost.ACCTTYPE_P_Asset, as);
FactLine line = fact.createLine(null,
m_pc.getAccount(ProductCost.ACCTTYPE_P_IPV, as),
as.getC_Currency_ID(), ipv.negate());

View File

@ -52,7 +52,7 @@ public class TemplateValidate extends SvrProcess
{
MTemplate thisTemplate = new MTemplate(getCtx (), getRecord_ID (), get_TrxName ());
thisTemplate.setIsValid (true);
thisTemplate.save ();
thisTemplate.saveEx();
return null;
}

View File

@ -184,7 +184,7 @@ public class WebProjectDeploy extends SvrProcess
thisHandler.cleanContainer(cc.get_ID());
// Reset Modified flag...
stage.setIsModified(false);
stage.save(stage.get_TrxName());
stage.saveEx(stage.get_TrxName());
}
if (child.isSummary())
copyStage (child, path + stage.getRelativeURL() + "/");

View File

@ -277,7 +277,7 @@ public class AttachmentFileSystem implements IAttachmentStore {
}
}
attach.m_items.remove(index);
attach.save(); // must save here as the operation cannot be rolled back on filesystem
attach.saveEx(); // must save here as the operation cannot be rolled back on filesystem
if (log.isLoggable(Level.CONFIG)) log.config("Index=" + index + " - NewSize=" + attach.m_items.size());
return true;
}

View File

@ -111,7 +111,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
/**
*
*/
private static final long serialVersionUID = 5446672147679386907L;
private static final long serialVersionUID = -2946624717834888117L;
public static final String DEFAULT_STATUS_MESSAGE = "NavigateOrUpdate";
@ -1583,6 +1583,17 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
return m_vo.IsInsertRecord;
} // isInsertRecord
/**
* Can we Delete Records?
* @return true not read only and allowed
*/
public boolean isDeleteRecord()
{
if (isReadOnly())
return false;
return m_vo.IsDeleteable;
} // isDeleteRecord
/**
* Is the Tab Visible.
* Called when constructing the window.

View File

@ -127,8 +127,8 @@ public class MCalendar extends X_C_Calendar
if (get_ID() == 0)
return null;
MYear year = new MYear (this);
if (year.save())
year.createStdPeriods(locale);
year.saveEx();
year.createStdPeriods(locale);
//
return year;
} // createYear

View File

@ -94,7 +94,7 @@ public class MCash extends X_C_Cash implements DocAction
// Create New Journal
retValue = new MCash (cb, dateAcct);
retValue.save(trxName);
retValue.saveEx(trxName);
return retValue;
} // get

View File

@ -93,7 +93,7 @@ public class MContainer extends X_CM_Container
if (cc == null) // new
cc = new MContainer (stage.getCtx (), 0, stage.get_TrxName ());
cc.setStage (project, stage, path);
cc.save ();
cc.saveEx();
if (!stage.isSummary ())
{
cc.updateElements (project, stage, stage.get_TrxName ());
@ -315,7 +315,7 @@ public class MContainer extends X_CM_Container
// PO.copyValues(new
// X_CM_CStage_Element(project.getCtx(),tableKeys[i],trxName),
// thisContainerElement);
thisContainerElement.save (trxName);
thisContainerElement.saveEx(trxName);
// Remove Container from cache
thisHandler.cleanContainerElement (thisContainerElement
.get_ID ());
@ -391,7 +391,7 @@ public class MContainer extends X_CM_Container
thisContainerTTable.setCM_Container_ID (stage.get_ID ());
PO.copyValues (new X_CM_CStageTTable (project.getCtx (),
tableKeys[i], trxName), thisContainerTTable);
thisContainerTTable.save (trxName);
thisContainerTTable.saveEx(trxName);
}
}
}

View File

@ -295,7 +295,7 @@ public class MDunningRunEntry extends X_C_DunningRunEntry
thisBPartner.setSOCreditStatus (X_C_BPartner.SOCREDITSTATUS_CreditStop);
if (level.isSetPaymentTerm ())
thisBPartner.setC_PaymentTerm_ID (level.getC_PaymentTerm_ID ());
thisBPartner.save ();
thisBPartner.saveEx();
}
}
return true;

View File

@ -132,7 +132,7 @@ public class MInOut extends X_M_InOut implements DocAction
}
// Create Line
if (retValue.get_ID() == 0) // not saved yet
retValue.save(trxName);
retValue.saveEx(trxName);
// Create a line until qty is reached
for (int ll = 0; ll < storages.length; ll++)
{
@ -148,11 +148,11 @@ public class MInOut extends X_M_InOut implements DocAction
.multiply(oLines[i].getQtyEntered())
.divide(oLines[i].getQtyOrdered(), 12, BigDecimal.ROUND_HALF_UP));
line.setC_Project_ID(oLines[i].getC_Project_ID());
line.save(trxName);
line.saveEx(trxName);
// Delivered everything ?
qty = qty.subtract(lineQty);
// storage[ll].changeQtyOnHand(lineQty, !order.isSOTrx()); // Credit Memo not considered
// storage[ll].save(get_TrxName());
// storage[ll].saveEx(get_TrxName());
if (qty.signum() == 0)
break;
}
@ -1452,10 +1452,7 @@ public class MInOut extends X_M_InOut implements DocAction
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)
if(dateMPolicy==null)
dateMPolicy = getMovementDate();
// Fallback: Update Storage - see also VMatch.createMatchRecord

View File

@ -151,13 +151,10 @@ public class MInOutLineMA extends X_M_InOutLineMA
{
if (M_AttributeSetInstance_ID > 0)
{
MAttributeSetInstance asi = new MAttributeSetInstance(parent.getCtx(), M_AttributeSetInstance_ID, parent.get_TrxName());
DateMaterialPolicy = asi.getCreated();
DateMaterialPolicy = MStorageOnHand.getDateMaterialPolicy(parent.getM_Product_ID(), M_AttributeSetInstance_ID, parent.get_TrxName());
}
else
{
if (DateMaterialPolicy == null)
DateMaterialPolicy = parent.getParent().getMovementDate();
}
}
setDateMaterialPolicy(DateMaterialPolicy);
setIsAutoGenerated(isAutoGenerated);
@ -269,7 +266,7 @@ public class MInOutLineMA extends X_M_InOutLineMA
Timestamp dateMPolicy = null;
if(getM_AttributeSetInstance_ID()>0)
{
dateMPolicy = getM_AttributeSetInstance().getCreated();
dateMPolicy = MStorageOnHand.getDateMaterialPolicy(line.getM_Product_ID(), getM_AttributeSetInstance_ID(), get_TrxName());
}
if(dateMPolicy == null)

View File

@ -568,10 +568,13 @@ public class MInventory extends X_M_Inventory implements DocAction
// Fallback
if (mtrx == null)
{
Timestamp dateMPolicy= getMovementDate();
I_M_AttributeSetInstance asi = line.getM_AttributeSetInstance();
if (asi != null)
dateMPolicy =asi.getCreated();
Timestamp dateMPolicy= qtyDiff.signum() > 0 ? getMovementDate() : null;
if (line.getM_AttributeSetInstance_ID() > 0)
{
Timestamp t = MStorageOnHand.getDateMaterialPolicy(line.getM_Product_ID(), line.getM_AttributeSetInstance_ID(), line.get_TrxName());
if (t != null)
dateMPolicy = t;
}
//Fallback: Update Storage - see also VMatch.createMatchRecord
if (!MStorageOnHand.add(getCtx(), getM_Warehouse_ID(),

View File

@ -167,10 +167,9 @@ public class MInventoryLineMA extends X_M_InventoryLineMA
{
if (M_AttributeSetInstance_ID > 0)
{
MAttributeSetInstance asi = new MAttributeSetInstance(parent.getCtx(), M_AttributeSetInstance_ID, parent.get_TrxName());
DateMaterialPolicy = asi.getCreated();
DateMaterialPolicy = MStorageOnHand.getDateMaterialPolicy(parent.getM_Product_ID(), M_AttributeSetInstance_ID, parent.get_TrxName());
}
else
if (DateMaterialPolicy == null)
{
DateMaterialPolicy = parent.getParent().getMovementDate();
}
@ -244,7 +243,7 @@ public class MInventoryLineMA extends X_M_InventoryLineMA
Timestamp dateMPolicy = null;
if(getM_AttributeSetInstance_ID()>0)
{
dateMPolicy = getM_AttributeSetInstance().getCreated();
dateMPolicy = MStorageOnHand.getDateMaterialPolicy(line.getM_Product_ID(), getM_AttributeSetInstance_ID(), get_TrxName());
}
if(dateMPolicy == null)

View File

@ -1581,7 +1581,7 @@ public class MInvoice extends X_C_Invoice implements DocAction
if (bom.getDescription() != null)
newLine.setDescription(bom.getDescription());
newLine.setPrice();
newLine.save(get_TrxName());
newLine.saveEx(get_TrxName());
}
// Convert into Comment Line
@ -2506,28 +2506,26 @@ public class MInvoice extends X_C_Invoice implements DocAction
msgall.toString(),
get_TrxName());
alloc.setAD_Org_ID(getAD_Org_ID());
if (alloc.save())
{
// Amount
BigDecimal gt = getGrandTotal(true);
if (!isSOTrx())
gt = gt.negate();
// Orig Line
MAllocationLine aLine = new MAllocationLine (alloc, gt,
alloc.saveEx();
// Amount
BigDecimal gt = getGrandTotal(true);
if (!isSOTrx())
gt = gt.negate();
// Orig Line
MAllocationLine aLine = new MAllocationLine (alloc, gt,
Env.ZERO, Env.ZERO, Env.ZERO);
aLine.setC_Invoice_ID(getC_Invoice_ID());
aLine.saveEx();
// Reversal Line
MAllocationLine rLine = new MAllocationLine (alloc, gt.negate(),
aLine.setC_Invoice_ID(getC_Invoice_ID());
aLine.saveEx();
// Reversal Line
MAllocationLine rLine = new MAllocationLine (alloc, gt.negate(),
Env.ZERO, Env.ZERO, Env.ZERO);
rLine.setC_Invoice_ID(reversal.getC_Invoice_ID());
rLine.saveEx();
// added AdempiereException by zuhri
if (!alloc.processIt(DocAction.ACTION_Complete))
throw new AdempiereException("Failed when processing document - " + alloc.getProcessMsg());
// end added
alloc.saveEx();
}
rLine.setC_Invoice_ID(reversal.getC_Invoice_ID());
rLine.saveEx();
// added AdempiereException by zuhri
if (!alloc.processIt(DocAction.ACTION_Complete))
throw new AdempiereException("Failed when processing document - " + alloc.getProcessMsg());
// end added
alloc.saveEx();
return reversal;
}

View File

@ -834,9 +834,13 @@ public class MJournal extends X_GL_Journal implements DocAction
// Journal
MJournal reverse = new MJournal (this);
reverse.setGL_JournalBatch_ID(GL_JournalBatch_ID);
reverse.setDateDoc(new Timestamp(System.currentTimeMillis()));
Timestamp reversalDate = Env.getContextAsDate(getCtx(), "#Date");
if (reversalDate == null) {
reversalDate = new Timestamp(System.currentTimeMillis());
}
reverse.setDateDoc(reversalDate);
reverse.set_ValueNoCheck ("C_Period_ID", null); // reset
reverse.setDateAcct(reverse.getDateDoc());
reverse.setDateAcct(reversalDate);
// Reverse indicator
StringBuilder msgd = new StringBuilder("(->").append(getDocumentNo()).append(")");
reverse.addDescription(msgd.toString());

View File

@ -713,8 +713,12 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction
// Reverse it
MJournalBatch reverse = new MJournalBatch (this);
reverse.setC_Period_ID(0);
reverse.setDateDoc(new Timestamp(System.currentTimeMillis()));
reverse.setDateAcct(reverse.getDateDoc());
Timestamp reversalDate = Env.getContextAsDate(getCtx(), "#Date");
if (reversalDate == null) {
reversalDate = new Timestamp(System.currentTimeMillis());
}
reverse.setDateDoc(reversalDate);
reverse.setDateAcct(reversalDate);
// Reverse indicator
StringBuilder msgd = new StringBuilder("(->").append(getDocumentNo()).append(")");
reverse.addDescription(msgd.toString());

View File

@ -522,7 +522,7 @@ public class MLdapProcessor extends X_AD_LdapProcessor implements AdempiereProce
access.setR_InterestArea_ID (R_InterestArea_ID);
access.setIsError (error != null);
access.setSummary (info);
access.save ();
access.saveEx();
} // logAccess
@Override

View File

@ -345,7 +345,7 @@ public class MMatchPO extends X_M_MatchPO
MInOutLine sLine, int C_OrderLine_ID, Timestamp dateTrx,
BigDecimal qty, String trxName) {
MMatchPO retValue = null;
String sql = "SELECT * FROM M_MatchPO WHERE C_OrderLine_ID=? ORDER BY M_MatchPO_ID";
String sql = "SELECT * FROM M_MatchPO WHERE C_OrderLine_ID=? and Reversal_ID IS NULL ORDER BY M_MatchPO_ID";
PreparedStatement pstmt = null;
ResultSet rs = null;
try
@ -932,13 +932,13 @@ public class MMatchPO extends X_M_MatchPO
if (validateOrderedQty)
{
MOrderLine line = new MOrderLine(getCtx(), getC_OrderLine_ID(), get_TrxName());
BigDecimal invoicedQty = DB.getSQLValueBD(get_TrxName(), "SELECT Coalesce(SUM(Qty),0) FROM M_MatchPO WHERE C_InvoiceLine_ID > 0 and C_OrderLine_ID=?" , getC_OrderLine_ID());
BigDecimal invoicedQty = DB.getSQLValueBD(get_TrxName(), "SELECT Coalesce(SUM(Qty),0) FROM M_MatchPO WHERE C_InvoiceLine_ID > 0 and C_OrderLine_ID=? AND Reversal_ID IS NULL" , getC_OrderLine_ID());
if (invoicedQty != null && invoicedQty.compareTo(line.getQtyOrdered()) > 0)
{
throw new IllegalStateException("Total matched invoiced qty > ordered qty. MatchedInvoicedQty="+invoicedQty+", OrderedQty="+line.getQtyOrdered()+", Line="+line);
}
BigDecimal deliveredQty = DB.getSQLValueBD(get_TrxName(), "SELECT Coalesce(SUM(Qty),0) FROM M_MatchPO WHERE M_InOutLine_ID > 0 and C_OrderLine_ID=?" , getC_OrderLine_ID());
BigDecimal deliveredQty = DB.getSQLValueBD(get_TrxName(), "SELECT Coalesce(SUM(Qty),0) FROM M_MatchPO WHERE M_InOutLine_ID > 0 and C_OrderLine_ID=? AND Reversal_ID IS NULL" , getC_OrderLine_ID());
if (deliveredQty != null && deliveredQty.compareTo(line.getQtyOrdered()) > 0)
{
throw new IllegalStateException("Total matched delivered qty > ordered qty. MatchedDeliveredQty="+deliveredQty+", OrderedQty="+line.getQtyOrdered()+", Line="+line);

View File

@ -536,32 +536,32 @@ public class MMovement extends X_M_Movement implements DocAction
if (dateMPolicy == null && storages.length > 0)
dateMPolicy = storages[0].getDateMaterialPolicy();
if (dateMPolicy==null && line.getM_AttributeSetInstanceTo_ID()!=0) {
I_M_AttributeSetInstance asi = line.getM_AttributeSetInstance();
dateMPolicy = asi.getCreated();
} else if(dateMPolicy==null)
dateMPolicy = getMovementDate();
MLocator locator = new MLocator (getCtx(), line.getM_Locator_ID(), get_TrxName());
//Update Storage
Timestamp effDateMPolicy = dateMPolicy;
if (dateMPolicy == null && line.getMovementQty().negate().signum() > 0)
effDateMPolicy = getMovementDate();
if (!MStorageOnHand.add(getCtx(),locator.getM_Warehouse_ID(),
line.getM_Locator_ID(),
line.getM_Product_ID(),
line.getM_AttributeSetInstance_ID(),
line.getMovementQty().negate(),dateMPolicy, get_TrxName()))
line.getMovementQty().negate(),effDateMPolicy, get_TrxName()))
{
String lastError = CLogger.retrieveErrorString("");
m_processMsg = "Cannot correct Inventory OnHand (MA) - " + lastError;
return DocAction.STATUS_Invalid;
}
//Update Storage
//Update Storage
effDateMPolicy = dateMPolicy;
if (dateMPolicy == null && line.getMovementQty().signum() > 0)
effDateMPolicy = getMovementDate();
MLocator locatorTo = new MLocator (getCtx(), line.getM_LocatorTo_ID(), get_TrxName());
if (!MStorageOnHand.add(getCtx(),locatorTo.getM_Warehouse_ID(),
line.getM_LocatorTo_ID(),
line.getM_Product_ID(),
line.getM_AttributeSetInstanceTo_ID(),
line.getMovementQty(),dateMPolicy, get_TrxName()))
line.getMovementQty(),effDateMPolicy, get_TrxName()))
{
String lastError = CLogger.retrieveErrorString("");
m_processMsg = "Cannot correct Inventory OnHand (MA) - " + lastError;

View File

@ -72,7 +72,7 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction
}
MMovementConfirm confirm = new MMovementConfirm (move);
confirm.save(move.get_TrxName());
confirm.saveEx(move.get_TrxName());
MMovementLine[] moveLines = move.getLines(false);
for (int i = 0; i < moveLines.length; i++)
{

View File

@ -169,10 +169,9 @@ public class MMovementLineMA extends X_M_MovementLineMA
{
if (M_AttributeSetInstance_ID > 0)
{
MAttributeSetInstance asi = new MAttributeSetInstance(parent.getCtx(), M_AttributeSetInstance_ID, parent.get_TrxName());
DateMaterialPolicy = asi.getCreated();
DateMaterialPolicy = MStorageOnHand.getDateMaterialPolicy(parent.getM_Product_ID(), M_AttributeSetInstance_ID, parent.get_TrxName());
}
else
if (DateMaterialPolicy == null)
{
DateMaterialPolicy = parent.getParent().getMovementDate();
}
@ -249,7 +248,7 @@ public class MMovementLineMA extends X_M_MovementLineMA
Timestamp dateMPolicy = null;
if(getM_AttributeSetInstance_ID()>0)
{
dateMPolicy = getM_AttributeSetInstance().getCreated();
dateMPolicy = MStorageOnHand.getDateMaterialPolicy(line.getM_Product_ID(), getM_AttributeSetInstance_ID(), get_TrxName());
}
if(dateMPolicy == null)

View File

@ -39,6 +39,7 @@ import org.compiere.process.DocAction;
import org.compiere.process.DocumentEngine;
import org.compiere.process.ProcessInfo;
import org.compiere.process.ServerProcessCtl;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Msg;
@ -1355,7 +1356,10 @@ public class MOrder extends X_C_Order implements DocAction
lines = getLines(true, MOrderLine.COLUMNNAME_M_Product_ID);
if (!reserveStock(dt, lines))
{
String innerMsg = CLogger.retrieveErrorString("");
m_processMsg = "Cannot reserve Stock";
if (! Util.isEmpty(innerMsg))
m_processMsg = m_processMsg + " -> " + innerMsg;
return DocAction.STATUS_Invalid;
}
if (!calculateTaxTotal())
@ -1616,7 +1620,7 @@ public class MOrder extends X_C_Order implements DocAction
newLine.setDescription (bomline.getDescription ());
//
newLine.setPrice ();
newLine.save (get_TrxName());
newLine.saveEx(get_TrxName());
}
} */
@ -1629,7 +1633,7 @@ public class MOrder extends X_C_Order implements DocAction
if (bom.getDescription() != null)
newLine.setDescription(bom.getDescription());
newLine.setPrice();
newLine.save(get_TrxName());
newLine.saveEx(get_TrxName());
}
// Convert into Comment Line
@ -1647,7 +1651,7 @@ public class MOrder extends X_C_Order implements DocAction
if (line.getDescription () != null)
description += " " + line.getDescription ();
line.setDescription (description);
line.save (get_TrxName());
line.saveEx(get_TrxName());
} // for all lines with BOM
m_lines = null; // force requery

View File

@ -93,7 +93,7 @@ public class MPackage extends X_M_Package
} // lines
retValue.setBoxCount(1);
retValue.save();
retValue.saveEx();
return retValue;
} // create

View File

@ -248,7 +248,7 @@ public class MPaymentTerm extends X_C_PaymentTerm
for (int i = 0; i < m_schedule.length; i++)
{
ips = new MInvoicePaySchedule (invoice, m_schedule[i]);
ips.save(invoice.get_TrxName());
ips.saveEx(invoice.get_TrxName());
if (log.isLoggable(Level.FINE)) log.fine(ips.toString());
remainder = remainder.subtract(ips.getDueAmt());
} // for all schedules
@ -256,7 +256,7 @@ public class MPaymentTerm extends X_C_PaymentTerm
if (remainder.compareTo(Env.ZERO) != 0 && ips != null)
{
ips.setDueAmt(ips.getDueAmt().add(remainder));
ips.save(invoice.get_TrxName());
ips.saveEx(invoice.get_TrxName());
if (log.isLoggable(Level.FINE)) log.fine("Remainder=" + remainder + " - " + ips);
}
@ -357,7 +357,7 @@ public class MPaymentTerm extends X_C_PaymentTerm
for (int i = 0; i < m_schedule.length; i++)
{
ops = new MOrderPaySchedule (order, m_schedule[i]);
ops.save(order.get_TrxName());
ops.saveEx(order.get_TrxName());
if (log.isLoggable(Level.FINE)) log.fine(ops.toString());
remainder = remainder.subtract(ops.getDueAmt());
} // for all schedules
@ -365,7 +365,7 @@ public class MPaymentTerm extends X_C_PaymentTerm
if (remainder.compareTo(Env.ZERO) != 0 && ops != null)
{
ops.setDueAmt(ops.getDueAmt().add(remainder));
ops.save(order.get_TrxName());
ops.saveEx(order.get_TrxName());
if (log.isLoggable(Level.FINE)) log.fine("Remainder=" + remainder + " - " + ops);
}

View File

@ -741,8 +741,8 @@ public class MPeriod extends X_C_Period
if (baseTypes.contains(DocBaseType))
continue;
MPeriodControl pc = new MPeriodControl(this, DocBaseType);
if (pc.save())
count++;
pc.saveEx();
count++;
baseTypes.add (DocBaseType);
}
if (log.isLoggable(Level.FINE)) log.fine("PeriodControl #" + count);

View File

@ -99,7 +99,9 @@ public class MProductionLine extends X_M_ProductionLine {
Timestamp dateMPolicy = date;
if(getM_AttributeSetInstance_ID()>0){
dateMPolicy = asi.getCreated();
Timestamp t = MStorageOnHand.getDateMaterialPolicy(getM_Product_ID(), getM_AttributeSetInstance_ID(), get_TrxName());
if (t != null)
dateMPolicy = t;
}
dateMPolicy = Util.removeTime(dateMPolicy);

View File

@ -42,10 +42,9 @@ public class MProductionLineMA extends X_M_ProductionLineMA {
{
if (asi > 0)
{
MAttributeSetInstance masi = new MAttributeSetInstance(parent.getCtx(), asi, parent.get_TrxName());
dateMaterialPolicy = masi.getCreated();
dateMaterialPolicy = MStorageOnHand.getDateMaterialPolicy(parent.getM_Product_ID(), asi, parent.get_TrxName());
}
else
if (dateMaterialPolicy == null)
{
dateMaterialPolicy = parent.getM_Production().getMovementDate();
}

View File

@ -358,13 +358,11 @@ public class MProject extends X_C_Project
toPhase.setC_Project_ID (getC_Project_ID ());
toPhase.setC_Order_ID (0);
toPhase.setIsComplete (false);
if (toPhase.save ())
{
count++;
taskCount += toPhase.copyTasksFrom (fromPhases[i]);
//BF 3067850 - monhate
lineCount += toPhase.copyLinesFrom(fromPhases[i]);
}
toPhase.saveEx();
count++;
taskCount += toPhase.copyTasksFrom (fromPhases[i]);
//BF 3067850 - monhate
lineCount += toPhase.copyLinesFrom(fromPhases[i]);
}
}
if (fromPhases.length != count)

View File

@ -167,8 +167,9 @@ public class MProjectIssue extends X_C_ProjectIssue
Timestamp dateMPolicy = getMovementDate();
if(getM_AttributeSetInstance_ID()>0){
MAttributeSetInstance asi = new MAttributeSetInstance(getCtx(), getM_AttributeSetInstance_ID(), get_TrxName());
dateMPolicy = asi.getCreated();
Timestamp t = MStorageOnHand.getDateMaterialPolicy(getM_Product_ID(), getM_AttributeSetInstance_ID(), get_TrxName());
if (t != null)
dateMPolicy = t;
}
if (MStorageOnHand.add(getCtx(), loc.getM_Warehouse_ID(), getM_Locator_ID(),

View File

@ -159,8 +159,8 @@ public class MProjectPhase extends X_C_ProjectPhase
PO.copyValues (fromLines[i], toLine, getAD_Client_ID (), getAD_Org_ID ());
toLine.setC_Project_ID(getC_Project_ID ());
toLine.setC_ProjectPhase_ID (getC_ProjectPhase_ID ());
if (toLine.save ())
count++;
toLine.saveEx();
count++;
}
if (fromLines.length != count)
log.warning("Count difference - ProjectLine=" + fromLines.length + " <> Saved=" + count);
@ -209,11 +209,10 @@ public class MProjectPhase extends X_C_ProjectPhase
MProjectTask toTask = new MProjectTask (getCtx (), 0, get_TrxName());
PO.copyValues (fromTasks[i], toTask, getAD_Client_ID (), getAD_Org_ID ());
toTask.setC_ProjectPhase_ID (getC_ProjectPhase_ID ());
if (toTask.save ()){
count++;
//BF 3067850 - monhate
countLine += toTask.copyLinesFrom(fromTasks[i]);
}
toTask.saveEx();
count++;
//BF 3067850 - monhate
countLine += toTask.copyLinesFrom(fromTasks[i]);
}
}
if (fromTasks.length != count)

View File

@ -134,8 +134,8 @@ public class MProjectTask extends X_C_ProjectTask
toLine.setC_Project_ID(getC_Project_ID(false));
toLine.setC_ProjectPhase_ID (getC_ProjectPhase_ID ());
toLine.setC_ProjectTask_ID(getC_ProjectTask_ID ());
if (toLine.save ())
count++;
toLine.saveEx();
count++;
}
if (fromLines.length != count)
log.warning("Count difference - ProjectLine=" + fromLines.length + " <> Saved=" + count);

View File

@ -80,15 +80,6 @@ public class MStorageOnHand extends X_M_StorageOnHand
sqlWhere += "(M_AttributeSetInstance_ID=? OR M_AttributeSetInstance_ID IS NULL)";
else
sqlWhere += "M_AttributeSetInstance_ID=?";
if (dateMPolicy == null)
{
if (M_AttributeSetInstance_ID > 0)
{
MAttributeSetInstance asi = new MAttributeSetInstance(ctx, M_AttributeSetInstance_ID, trxName);
dateMPolicy = asi.getCreated();
}
}
if (dateMPolicy != null)
sqlWhere += " AND DateMaterialPolicy=trunc(cast(? as date))";
@ -629,12 +620,10 @@ public class MStorageOnHand extends X_M_StorageOnHand
if (M_Locator_ID == 0)
throw new IllegalArgumentException("M_Locator_ID=0");
if (M_Product_ID == 0)
throw new IllegalArgumentException("M_Product_ID=0");
if (dateMPolicy == null)
dateMPolicy = new Timestamp(new Date().getTime());
dateMPolicy = Util.removeTime(dateMPolicy);
throw new IllegalArgumentException("M_Product_ID=0");
if (dateMPolicy != null)
dateMPolicy = Util.removeTime(dateMPolicy);
MStorageOnHand retValue = get(ctx, M_Locator_ID, M_Product_ID, M_AttributeSetInstance_ID,dateMPolicy, trxName);
if (retValue != null)
{
@ -648,6 +637,11 @@ public class MStorageOnHand extends X_M_StorageOnHand
if (locator.get_ID() != M_Locator_ID)
throw new IllegalArgumentException("Not found M_Locator_ID=" + M_Locator_ID);
//
if (dateMPolicy == null)
{
dateMPolicy = new Timestamp(new Date().getTime());
dateMPolicy = Util.removeTime(dateMPolicy);
}
retValue = new MStorageOnHand (locator, M_Product_ID, M_AttributeSetInstance_ID,dateMPolicy);
retValue.saveEx(trxName);
if (s_log.isLoggable(Level.FINE)) s_log.fine("New " + retValue);
@ -696,21 +690,9 @@ public class MStorageOnHand extends X_M_StorageOnHand
if (diffQtyOnHand == null || diffQtyOnHand.signum() == 0)
return true;
if (dateMPolicy == null)
{
if (M_AttributeSetInstance_ID > 0)
{
MAttributeSetInstance asi = new MAttributeSetInstance(ctx, M_AttributeSetInstance_ID, trxName);
dateMPolicy = asi.getCreated();
}
else
{
dateMPolicy = new Timestamp(System.currentTimeMillis());
}
}
dateMPolicy = Util.removeTime(dateMPolicy);
if (dateMPolicy != null)
dateMPolicy = Util.removeTime(dateMPolicy);
// Get Storage
MStorageOnHand storage = getCreate (ctx, M_Locator_ID, M_Product_ID, M_AttributeSetInstance_ID, dateMPolicy, trxName, true, 120);
// Verify
@ -1040,6 +1022,9 @@ public class MStorageOnHand extends X_M_StorageOnHand
*/
public static Timestamp getDateMaterialPolicy(int M_Product_ID, int M_AttributeSetInstance_ID,String trxName){
if (M_Product_ID <= 0 || M_AttributeSetInstance_ID <= 0)
return null;
String sql = "SELECT dateMaterialPolicy FROM M_StorageOnHand WHERE M_Product_ID=? and M_AttributeSetInstance_ID=?";
PreparedStatement pstmt = null;

View File

@ -497,11 +497,6 @@ public class MUOMConversion extends X_C_UOM_Conversion
if (M_Product_ID == 0)
return null;
MUOMConversion[] rates = getProductConversions(ctx, M_Product_ID);
if (rates.length == 0)
{
s_log.fine("None found");
return null;
}
for (int i = 0; i < rates.length; i++)
{
@ -509,7 +504,17 @@ public class MUOMConversion extends X_C_UOM_Conversion
if (rate.getC_UOM_To_ID() == C_UOM_To_ID)
return rate.getMultiplyRate();
}
s_log.fine("None applied");
List<MUOMConversion> conversions = new Query(ctx, Table_Name, "C_UOM_ID=? AND C_UOM_TO_ID=?", null)
.setParameters(MProduct.get(ctx, M_Product_ID).getC_UOM_ID(), C_UOM_To_ID)
.setOnlyActiveRecords(true)
.list();
for (int i = 0; i < conversions.size(); i++)
{
MUOMConversion rate = conversions.get(i);
if (rate.getC_UOM_To_ID() == C_UOM_To_ID)
return rate.getMultiplyRate();
}
return null;
} // getProductRateTo
@ -563,11 +568,6 @@ public class MUOMConversion extends X_C_UOM_Conversion
int M_Product_ID, int C_UOM_To_ID)
{
MUOMConversion[] rates = getProductConversions(ctx, M_Product_ID);
if (rates.length == 0)
{
s_log.fine("getProductRateFrom - none found");
return null;
}
for (int i = 0; i < rates.length; i++)
{
@ -575,7 +575,18 @@ public class MUOMConversion extends X_C_UOM_Conversion
if (rate.getC_UOM_To_ID() == C_UOM_To_ID)
return rate.getDivideRate();
}
s_log.fine("None applied");
List<MUOMConversion> conversions = new Query(ctx, Table_Name, "C_UOM_ID=? AND C_UOM_TO_ID=?", null)
.setParameters(MProduct.get(ctx, M_Product_ID).getC_UOM_ID(), C_UOM_To_ID)
.setOnlyActiveRecords(true)
.list();
for (int i = 0; i < conversions.size(); i++)
{
MUOMConversion rate = conversions.get(i);
if (rate.getC_UOM_To_ID() == C_UOM_To_ID)
return rate.getDivideRate();
}
return null;
} // getProductRateFrom

View File

@ -34,7 +34,7 @@ public class MUserPreference extends X_AD_UserPreference{
/**
*
*/
private static final long serialVersionUID = 4653362918831026642L;
private static final long serialVersionUID = -5816348717625872665L;
public MUserPreference(Properties ctx, int AD_UserPreference_ID,
String trxName) {
@ -55,21 +55,25 @@ public class MUserPreference extends X_AD_UserPreference{
super.setAD_User_ID(AD_User_ID);
} //setAD_User_ID
private static MUserPreference createUserPreferences(int AD_User_ID, int AD_Client_ID){
MUserPreference preferences = new MUserPreference(Env.getCtx(), 0, null);
private static MUserPreference createUserPreferences(int AD_User_ID, int AD_Client_ID, String trxName){
MUserPreference preferences = new MUserPreference(Env.getCtx(), 0, trxName);
preferences.setAD_User_ID(AD_User_ID);
preferences.setAD_Client_ID(AD_Client_ID);
preferences.saveEx();
return preferences;
} //createUserPreferences
public static MUserPreference getUserPreference(int AD_User_ID, int AD_Client_ID){
Query query = new Query(Env.getCtx(), MUserPreference.Table_Name, "AD_User_ID=? AND AD_Client_ID=?", null);
return getUserPreference(AD_User_ID, AD_Client_ID, null);
}
public static MUserPreference getUserPreference(int AD_User_ID, int AD_Client_ID, String trxName){
Query query = new Query(Env.getCtx(), MUserPreference.Table_Name, "AD_User_ID=? AND AD_Client_ID=?", trxName);
MUserPreference preferences = query.setParameters(new Object[]{AD_User_ID, AD_Client_ID}).firstOnly();
if(preferences==null){
preferences = createUserPreferences(AD_User_ID, AD_Client_ID);
preferences = createUserPreferences(AD_User_ID, AD_Client_ID, trxName);
}
return preferences;

View File

@ -146,16 +146,11 @@ public class SystemIDs
public final static int WINDOW_ACCOUNTCOMBINATION = 153;
public final static int WINDOW_CUSTOMERRETURN = 53097;
public final static int WINDOW_INVENTORYMOVE = 170;
public final static int WINDOW_LOT = 257;
public final static int WINDOW_MATERIALRECEIPT = 184;
public final static int WINDOW_MATERIALTRANSACTIONS_INDIRECTUSER = 223;
public final static int WINDOW_MY_REQUESTS = 237;
public final static int WINDOW_PHYSICALINVENTORY = 168;
public final static int WINDOW_PRODUCTION = 191;
public final static int WINDOW_REQUESTS_ALL = 232;
public final static int WINDOW_RETURNTOVENDOR = 53098;
public final static int WINDOW_SHIPMENT_CUSTOMER = 169;
public final static int WINDOW_WAREHOUSE_LOCATOR = 139;
public final static int WINDOW_WINDOW_TAB_FIELD = 102;

View File

@ -824,17 +824,32 @@ public class DataEngine
// Check Group Change ----------------------------------------
if (m_group.getGroupColumnCount() > 1) // one is GRANDTOTAL_
{
ArrayList<PrintDataColumn> changedGroups = new ArrayList<PrintDataColumn>();
ArrayList<Object> changedValues = new ArrayList<Object>();
boolean force = false;
// Check Columns for Function Columns
for (int i = pd.getColumnInfo().length-1; i >= 0; i--) // backwards (leaset group first)
for (int i = 0; i < pd.getColumnInfo().length; i++)
{
PrintDataColumn group_pdc = pd.getColumnInfo()[i];
if (!m_group.isGroupColumn(group_pdc.getColumnName()))
continue;
// Group change
Object value = m_group.groupChange(group_pdc.getColumnName(), rs.getObject(group_pdc.getAlias()));
Object value = m_group.groupChange(group_pdc.getColumnName(), rs.getObject(group_pdc.getAlias()), force);
if (value != null) // Group change
{
changedGroups.add(group_pdc);
changedValues.add(value);
force = true; // all subsequent groups force change
}
}
for (int j = changedGroups.size() - 1; j >= 0; j--) // backwards (least group first)
{
PrintDataColumn group_pdc = changedGroups.get(j);
Object value = changedValues.get(j);
char[] functions = m_group.getFunctions(group_pdc.getColumnName());
for (int f = 0; f < functions.length; f++)
{
@ -873,7 +888,6 @@ public class DataEngine
m_group.reset(group_pdc.getColumnName(), pdc.getColumnName());
}
} // Group change
} // for all columns
} // group change
// new row ---------------------------------------------------
@ -1035,7 +1049,7 @@ public class DataEngine
PrintDataColumn group_pdc = pd.getColumnInfo()[i];
if (!m_group.isGroupColumn(group_pdc.getColumnName()))
continue;
Object value = m_group.groupChange(group_pdc.getColumnName(), new Object());
Object value = m_group.groupChange(group_pdc.getColumnName(), new Object(), false);
if (value != null) // Group change
{
char[] functions = m_group.getFunctions(group_pdc.getColumnName());

View File

@ -95,7 +95,7 @@ public class PrintDataGroup
* @param value column value
* @return null if no group change otherwise old value
*/
public Object groupChange (String groupColumnName, Object value)
public Object groupChange (String groupColumnName, Object value, boolean force)
{
if (!isGroupColumn(groupColumnName))
return null;
@ -106,7 +106,7 @@ public class PrintDataGroup
if (m_groupMap.containsKey(groupColumnName))
{
Object oldValue = m_groupMap.get(groupColumnName);
if (newValue.equals(oldValue))
if (newValue.equals(oldValue) && !force )
return null;
m_groupMap.put(groupColumnName, newValue);
return oldValue;

View File

@ -549,7 +549,7 @@ public final class Env
if (s == null)
{
// Explicit Base Values
if (context.startsWith("#") || context.startsWith("$"))
if (context.startsWith("#") || context.startsWith("$") || context.startsWith("P|"))
return getContext(ctx, context);
if (onlyWindow) // no Default values
return "";
@ -2015,9 +2015,9 @@ public final class Env
public static int getZoomWindowID(int AD_Table_ID, int Record_ID, int windowNo)
{
int AD_Window_ID = MZoomCondition.findZoomWindowByTableId(AD_Table_ID, Record_ID, windowNo);
MTable table = MTable.get(Env.getCtx(), AD_Table_ID);
if (AD_Window_ID <= 0)
{
MTable table = MTable.get(Env.getCtx(), AD_Table_ID);
AD_Window_ID = table.getAD_Window_ID();
// Nothing to Zoom to
if (AD_Window_ID == 0)

View File

@ -98,7 +98,7 @@ public class Evaluator
}
String exprStrand = st.nextToken().trim();
if (exprStrand.matches("^@\\d+$"))
if (exprStrand.matches("^@\\d+$") || "@P".equals(exprStrand))
{
exprStrand = exprStrand.concat(st.nextToken());
exprStrand = exprStrand.concat(st.nextToken());
@ -112,7 +112,7 @@ public class Evaluator
//boolean temp = evaluateLogicTuple(source, st.nextToken());
exprStrand = st.nextToken().trim();
if (exprStrand.matches("^@\\d+$"))
if (exprStrand.matches("^@\\d+$") || "@P".equals(exprStrand))
{
exprStrand = exprStrand.concat(st.nextToken());
exprStrand = exprStrand.concat(st.nextToken());

View File

@ -466,7 +466,7 @@ public class WebLogin
thisBPBankAccount.setA_Name (WebUtil.getParamOrNull (m_request, "A_Name"));
thisBPBankAccount.setAccountNo (WebUtil.getParamOrNull (m_request, "AccountNo"));
thisBPBankAccount.setRoutingNo (WebUtil.getParamOrNull (m_request, "RoutingNo"));
thisBPBankAccount.save ();
thisBPBankAccount.saveEx();
}
else
log.log(Level.WARNING, "Unknown request='" + m_mode + "'");

View File

@ -488,7 +488,7 @@ public class WebUser
// save Location ***************************************
if (log.isLoggable(Level.FINE)) log.fine("LOC=" + m_loc);
m_loc.save ();
m_loc.saveEx();
// save BP Location ***************************************
if (m_bpl.getC_BPartner_ID () != m_bp.getC_BPartner_ID())

View File

@ -253,7 +253,7 @@ public class ImportFixedAsset extends SvrProcess
if (!bpl.save ())
continue;
}
ifa.save ();
ifa.saveEx();
} // for all new BPartners
rs.close ();
pstmt.close ();
@ -311,7 +311,7 @@ public class ImportFixedAsset extends SvrProcess
}
ifa.setM_Product_ID (product.getM_Product_ID());
ifa.save ();
ifa.saveEx();
} // for all new Products
rs.close ();
pstmt.close ();

View File

@ -21,7 +21,7 @@
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc}"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.adempiere.server.server_product"/>
<stringAttribute key="selected_target_plugins" value="bcpkix*1.55.0@default:default,bcpkix*1.56.0@default:default,bcprov*1.55.0@default:default,bcprov*1.56.0@default:default,com.itextpdf@default:default,com.sun.mail.javax.mail@default:default,groovy-all*2.4.7@default:default,groovy-all*2.4.8@default:default,javax.activation@default:default,javax.ejb@default:default,javax.jms@default:default,javax.management.j2ee-api@default:default,javax.transaction@default:false,javax.xml.rpc@default:default,javax.xml.soap@default:default,javax.xml@default:default,net.sf.supercsv.super-csv@default:default,org.apache.activemq.activemq-core@default:default,org.apache.activemq.kahadb@default:default,org.apache.ant@default:default,org.apache.commons.codec@default:false,org.apache.commons.collections@default:default,org.apache.commons.logging@default:default,org.apache.commons.net@default:default,org.apache.poi@default:default,org.apache.servicemix.bundles.cglib@default:default,org.cryptacular@default:default,org.eclipse.ant.core@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.util@default:default,org.eclipse.jetty.osgi-servlet-api@default:default,org.eclipse.osgi.compatibility.plugins@default:false,org.eclipse.osgi.compatibility.state@default:false,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.junit@default:default,org.passay@default:default,org.restlet@default:default,org.slf4j.api@default:default,org.slf4j.jcl@default:default"/>
<stringAttribute key="selected_target_plugins" value="bcpkix@default:default,bcprov@default:default,com.itextpdf@default:default,com.sun.mail.javax.mail@default:default,groovy-all@default:default,javax.activation@default:default,javax.ejb@default:default,javax.jms@default:default,javax.management.j2ee-api@default:default,javax.transaction@default:false,javax.xml.rpc@default:default,javax.xml.soap@default:default,javax.xml@default:default,net.sf.supercsv.super-csv@default:default,org.apache.activemq.activemq-core@default:default,org.apache.activemq.kahadb@default:default,org.apache.ant@default:default,org.apache.commons.codec@default:false,org.apache.commons.collections@default:default,org.apache.commons.logging@default:default,org.apache.commons.net@default:default,org.apache.poi@default:default,org.apache.servicemix.bundles.cglib@default:default,org.cryptacular@default:default,org.eclipse.ant.core@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.util@default:default,org.eclipse.jetty.osgi-servlet-api@default:default,org.eclipse.osgi.compatibility.plugins@default:false,org.eclipse.osgi.compatibility.state@default:false,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.junit@default:default,org.passay@default:default,org.restlet@default:default,org.slf4j.api@default:default,org.slf4j.jcl@default:default"/>
<stringAttribute key="selected_workspace_plugins" value="org.adempiere.base@default:default,org.adempiere.extend@default:false,org.adempiere.install@default:true,org.apache.ecs@default:default,org.compiere.db.oracle.provider@default:default,org.compiere.db.postgresql.provider@default:default,org.slf4j.jdk14@default:false"/>
<booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>

File diff suppressed because one or more lines are too long

View File

@ -24,7 +24,7 @@ fi
echo -------------------------------------
echo Re-Create DataPump directory
echo -------------------------------------
sqlplus $1@$ADEMPIERE_DB_SERVER/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateDataPumpDir.sql $IDEMPIERE_HOME/data
sqlplus $1@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateDataPumpDir.sql $IDEMPIERE_HOME/data
chgrp dba $IDEMPIERE_HOME/data
chmod 770 $IDEMPIERE_HOME/data

View File

@ -27,7 +27,7 @@ sqlplus $1/$2@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMP
echo -------------------------------------
echo Re-Create DataPump directory
echo -------------------------------------
sqlplus $3@$ADEMPIERE_DB_SERVER/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateDataPumpDir.sql $IDEMPIERE_HOME/data
sqlplus $3@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateDataPumpDir.sql $IDEMPIERE_HOME/data
chgrp dba $IDEMPIERE_HOME/data
chmod 770 $IDEMPIERE_HOME/data

View File

@ -28,7 +28,7 @@ sqlplus $1@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIER
echo -------------------------------------
echo Re-Create DataPump directory
echo -------------------------------------
sqlplus $1@$ADEMPIERE_DB_SERVER/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateDataPumpDir.sql $IDEMPIERE_HOME/data
sqlplus $1@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateDataPumpDir.sql $IDEMPIERE_HOME/data
chgrp dba $IDEMPIERE_HOME/data
chmod 770 $IDEMPIERE_HOME/data

View File

@ -29,7 +29,7 @@ sqlplus $1@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIER
echo -------------------------------------
echo Re-Create DataPump directory
echo -------------------------------------
sqlplus $1@$ADEMPIERE_DB_SERVER/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateDataPumpDir.sql $IDEMPIERE_HOME/data/seed
sqlplus $1@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateDataPumpDir.sql $IDEMPIERE_HOME/data/seed
chgrp dba $IDEMPIERE_HOME/data/seed
chmod 770 $IDEMPIERE_HOME/data/seed

View File

@ -18,14 +18,19 @@
@echo -------------------------------------
@sqlplus %1@%ADEMPIERE_DB_SERVER%:%ADEMPIERE_DB_PORT%/%ADEMPIERE_DB_NAME% @%IDEMPIERE_HOME%\Utils\%ADEMPIERE_DB_PATH%\CreateUser.sql %2 %3
@echo -------------------------------------
@echo Re-Create DataPump directory
@echo -------------------------------------
@sqlplus %1@%ADEMPIERE_DB_SERVER%:%ADEMPIERE_DB_PORT%/%ADEMPIERE_DB_NAME% @%IDEMPIERE_HOME%\Utils\%ADEMPIERE_DB_PATH%\CreateDataPumpDir.sql %IDEMPIERE_HOME%\data\seed
@echo -------------------------------------
@echo Import Adempiere.dmp
@echo -------------------------------------
@imp %1@%ADEMPIERE_DB_SERVER%:%ADEMPIERE_DB_PORT%/%ADEMPIERE_DB_NAME% FILE=%IDEMPIERE_HOME%\data\seed\Adempiere.dmp FROMUSER=(reference) TOUSER=%2 STATISTICS=RECALCULATE
@impdp %1@%ADEMPIERE_DB_SERVER%:%ADEMPIERE_DB_PORT%/%ADEMPIERE_DB_NAME% DIRECTORY=ADEMPIERE_DATA_PUMP_DIR DUMPFILE=Adempiere.dmp REMAP_SCHEMA=reference:%2
@echo --------========--------========--------========--------
@echo System Check - The Import phase showed warnings.
@echo This is OK as long as the following does not show errors
@echo Check System
@echo Import may show some warnings. This is OK as long as the following does not show errors
@echo --------========--------========--------========--------
@sqlplus %2/%3@%ADEMPIERE_DB_SERVER%:%ADEMPIERE_DB_PORT%/%ADEMPIERE_DB_NAME% @%IDEMPIERE_HOME%\Utils\%ADEMPIERE_DB_PATH%\AfterImport.sql

View File

@ -1234,12 +1234,15 @@ public final class APanel extends CPanel
changed = false;
boolean readOnly = m_curTab.isReadOnly();
boolean insertRecord = !readOnly;
boolean deleteRecord = !readOnly;
if (insertRecord)
insertRecord = m_curTab.isInsertRecord();
aNew.setEnabled(!changed && insertRecord);
aCopy.setEnabled(!changed && insertRecord);
aRefresh.setEnabled(!changed);
aDelete.setEnabled(!changed && !readOnly);
if (deleteRecord)
deleteRecord = m_curTab.isDeleteRecord();
aDelete.setEnabled(!changed && deleteRecord);
aDeleteSelection.setEnabled(!changed && !readOnly);
//
if (readOnly && m_curTab.isAlwaysUpdateField())

View File

@ -32,7 +32,6 @@ import java.util.logging.Level;
import javax.swing.JLabel;
import org.compiere.apps.AEnv;
import org.compiere.apps.AWindow;
import org.compiere.apps.ConfirmPanel;
import org.compiere.apps.StatusBar;
import org.compiere.grid.GridController;
@ -285,17 +284,7 @@ public class VTrxMaterial extends TrxMaterial
super.zoom();
// Zoom
panel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
AWindow frame = new AWindow(panel.getGraphicsConfiguration());
if (!frame.initWindow(AD_Window_ID, query))
{
panel.setCursor(Cursor.getDefaultCursor());
return;
}
AEnv.addToWindowManager(frame);
AEnv.showCenterScreen(frame);
frame = null;
panel.setCursor(Cursor.getDefaultCursor());
AEnv.zoom(AD_Table_ID, Record_ID);
} // zoom
} // VTrxMaterial

View File

@ -746,7 +746,7 @@ public class VPAttributeDialog extends CDialog
// New Instance
if (m_changed || m_masi.getM_AttributeSetInstance_ID() == 0)
{
m_masi.save ();
m_masi.saveEx();
m_M_AttributeSetInstance_ID = m_masi.getM_AttributeSetInstance_ID ();
m_M_AttributeSetInstanceName = m_masi.getDescription();
}
@ -789,7 +789,7 @@ public class VPAttributeDialog extends CDialog
if (m_changed)
{
m_masi.setDescription ();
m_masi.save ();
m_masi.saveEx();
}
m_M_AttributeSetInstance_ID = m_masi.getM_AttributeSetInstance_ID ();
m_M_AttributeSetInstanceName = m_masi.getDescription();

View File

@ -1575,6 +1575,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
boolean readOnly = adTabbox.getSelectedGridTab().isReadOnly();
boolean processed = adTabbox.getSelectedGridTab().isProcessed();
boolean insertRecord = !readOnly;
boolean deleteRecord = !readOnly;
if (!detailTab)
{
// update Change
@ -1587,7 +1588,11 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
toolbar.enableNew(!changed && insertRecord && !tabPanel.getGridTab().isSortTab());
toolbar.enableCopy(!changed && insertRecord && !tabPanel.getGridTab().isSortTab() && adTabbox.getSelectedGridTab().getRowCount()>0);
toolbar.enableRefresh(!changed);
toolbar.enableDelete(!changed && !readOnly && !tabPanel.getGridTab().isSortTab() && !processed);
if (deleteRecord)
{
deleteRecord = tabPanel.getGridTab().isDeleteRecord();
}
toolbar.enableDelete(!changed && deleteRecord && !tabPanel.getGridTab().isSortTab() && !processed);
//
if (readOnly && adTabbox.getSelectedGridTab().isAlwaysUpdateField())
{

View File

@ -58,7 +58,7 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
/**
*
*/
private static final long serialVersionUID = -5714780894880069158L;
private static final long serialVersionUID = 2142502910734162453L;
private static final String BTN_PROCESS_ID = "BtnProcess";
@ -664,12 +664,18 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
readOnly = true;
boolean insertRecord = !readOnly;
boolean deleteRecord = !readOnly;
if (insertRecord)
{
insertRecord = adtab.getGridTab().isInsertRecord();
}
boolean enableNew = !changed && insertRecord && !adtab.getGridTab().isSortTab();
boolean enableDelete = !changed && !readOnly && !adtab.getGridTab().isSortTab();
if (deleteRecord)
{
deleteRecord = adtab.getGridTab().isDeleteRecord();
}
boolean enableDelete = !changed && deleteRecord && !adtab.getGridTab().isSortTab();
ADWindow adwindow = ADWindow.findADWindow(this);
if (adwindow == null)

View File

@ -66,12 +66,6 @@ import org.zkoss.zul.Separator;
public class WTrxMaterial extends TrxMaterial
implements IFormController, EventListener<Event>, ValueChangeListener
{
/**
*
*/
@SuppressWarnings("unused")
private static final long serialVersionUID = -2141669182129214237L;
private CustomForm form = new CustomForm();
/** GridController */
@ -285,7 +279,7 @@ public class WTrxMaterial extends TrxMaterial
super.zoom();
// Zoom
AEnv.zoom(AD_Window_ID, query);
AEnv.zoom(AD_Table_ID, Record_ID);
} // zoom
public ADForm getForm()

View File

@ -470,7 +470,7 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener<Event>
private void addSQLWhere(StringBuffer sql, int index, String value)
{
if (!(value.equals("") || value.equals("%")) && index < m_queryColumns.size())
if (!(value.equals("")) && index < m_queryColumns.size())
{
// Angelo Dabala' (genied) nectosoft: [2893220] avoid to append string parameters directly because of special chars like quote(s)
sql.append(" AND UPPER(").append(m_queryColumnsSql.get(index).toString()).append(") LIKE ?");

View File

@ -2136,36 +2136,25 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
{
String tmp = colsql.substring(0, lastSpaceIdx).trim();
char last = tmp.charAt(tmp.length() - 1);
if (tmp.toLowerCase().endsWith("as"))
String alias = colsql.substring(lastSpaceIdx).trim();
boolean hasAlias = alias.matches("^[a-zA-Z_][a-zA-Z0-9_]*$"); // valid SQL alias - starts with letter then digits, letters, underscore
if (tmp.toLowerCase().endsWith("as") && hasAlias)
{
colsql = colsql.substring(lastSpaceIdx).trim();
colsql = alias;
}
else if (!(last == '*' || last == '-' || last == '+' || last == '/' || last == '>' || last == '<' || last == '='))
{
tmp = colsql.substring(lastSpaceIdx).trim();
if (tmp.startsWith("\"") && tmp.endsWith("\""))
if (alias.startsWith("\"") && alias.endsWith("\""))
{
colsql = colsql.substring(lastSpaceIdx).trim();
colsql = alias;
}
else
{
boolean hasAlias = true;
for(int i = 0; i < tmp.length(); i++)
{
char c = tmp.charAt(i);
if (Character.isLetterOrDigit(c))
{
continue;
}
else
{
hasAlias = false;
break;
}
}
if (hasAlias)
{
colsql = colsql.substring(lastSpaceIdx).trim();
colsql = alias;
}
}
}

View File

@ -528,6 +528,16 @@ public class LoginPanel extends Window implements EventListener<Event>
Env.verifyLanguage(ctx, language);
Env.setContext(ctx, Env.LANGUAGE, language.getAD_Language());
Env.setContext(ctx, AEnv.LOCALE, language.getLocale().toString());
//cph::erp added this in order to get the processing dialog in the correct language
Locale locale = language.getLocale();
try {
Clients.reloadMessages(locale);
} catch (IOException e) {
logger.log(Level.WARNING, e.getLocalizedMessage(), e);
}
Locales.setThreadLocal(locale);
// cph::erp end
return language;
}
/**

View File

@ -245,7 +245,7 @@ public class DunningPrint extends SvrProcess
if (printed)
{
entry.setProcessed (true);
entry.save ();
entry.saveEx();
}
} // for all dunning letters

View File

@ -979,7 +979,7 @@ public class WPAttributeDialog extends Window implements EventListener<Event>
// New Instance
if (m_changed || m_masi.getM_AttributeSetInstance_ID() == 0)
{
m_masi.save ();
m_masi.saveEx();
m_M_AttributeSetInstance_ID = m_masi.getM_AttributeSetInstance_ID ();
m_M_AttributeSetInstanceName = m_masi.getDescription();
}
@ -1026,7 +1026,7 @@ public class WPAttributeDialog extends Window implements EventListener<Event>
if (m_changed)
{
m_masi.setDescription ();
m_masi.save ();
m_masi.saveEx();
}
m_M_AttributeSetInstance_ID = m_masi.getM_AttributeSetInstance_ID ();
m_M_AttributeSetInstanceName = m_masi.getDescription();

View File

@ -24,6 +24,29 @@ Copyright (C) 2007 Ashley G Ramdass.
// just sent fake event when control is textfield and value is not yet sync to server
if (wgt.$instanceof(zul.inp.Textbox) && wgt.$n().value != wgt.getText())
zAu.send(new zk.Event(zk.Widget.$(wgt), 'onChange',{"value":wgt.$n().value}));
else if (zk.$import("ckez.CKeditor") != undefined && wgt.$instanceof(ckez.CKeditor)){//https://www.zkoss.org/javadoc/latest/jsdoc/_global_/zk.html#$import(_global_.String)
// CKEditor extend from zul.Widget not from wget zul.inp.InputWidget
// so some behavior is not same standard input
// this code bring from ckez.CKeditor.onBlur
var editor = wgt._editor;
if (wgt._tidChg) {
clearInterval(wgt._tidChg);
wgt._tidChg = null;
}
if (!editor.document)
editor.document = editor.element.getDocument();
if (wgt.$class._checkEditorDirty(editor)) { // Issue #13
var val = editor.getData();
wgt._value = val; //save for onRestore
//ZKCK-16, 17 use sendAhead to make sure onChange always happens first
wgt.fire('onChange', {value: val});
editor.resetDirty();
}
}
},
fireOnInitEdit: function (wgt) {

View File

@ -810,7 +810,7 @@ public class Allocation
}
MBPartner bpartner = new MBPartner(Env.getCtx(), m_C_BPartner_ID, trxName);
bpartner.setTotalOpenBalance();
bpartner.save();
bpartner.saveEx();
paymentList.clear();
amountList.clear();

View File

@ -13,9 +13,8 @@
*****************************************************************************/
package org.compiere.apps.form;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import static org.compiere.model.SystemIDs.WINDOW_MATERIALTRANSACTIONS_INDIRECTUSER;
import java.sql.Timestamp;
import java.util.logging.Level;
@ -23,10 +22,14 @@ import org.compiere.apps.IStatusBar;
import org.compiere.model.GridTab;
import org.compiere.model.GridWindow;
import org.compiere.model.GridWindowVO;
import org.compiere.model.I_C_ProjectIssue;
import org.compiere.model.I_M_InOutLine;
import org.compiere.model.I_M_InventoryLine;
import org.compiere.model.I_M_MovementLine;
import org.compiere.model.I_M_ProductionLine;
import org.compiere.model.I_M_Transaction;
import org.compiere.model.MQuery;
import static org.compiere.model.SystemIDs.*;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Msg;
@ -108,9 +111,8 @@ public class TrxMaterial {
statusBar.setStatusDB(Integer.toString(no));
} // refresh
public int AD_Window_ID;
public MQuery query;
public int AD_Table_ID;
public int Record_ID;
/**
* Zoom
*/
@ -118,85 +120,33 @@ public class TrxMaterial {
{
log.info("");
//
AD_Window_ID = 0;
String ColumnName = null;
String SQL = null;
//
int lineID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, "M_InOutLine_ID");
if (lineID != 0)
{
if (log.isLoggable(Level.FINE)) log.fine("M_InOutLine_ID=" + lineID);
if (Env.getContext(Env.getCtx(), m_WindowNo, "MovementType").startsWith("C"))
AD_Window_ID = WINDOW_SHIPMENT_CUSTOMER; // Customer
else
AD_Window_ID = WINDOW_MATERIALRECEIPT; // Vendor
ColumnName = "M_InOut_ID";
SQL = "SELECT M_InOut_ID FROM M_InOutLine WHERE M_InOutLine_ID=?";
}
else
{
lineID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, "M_InventoryLine_ID");
if (lineID != 0)
{
if (log.isLoggable(Level.FINE)) log.fine("M_InventoryLine_ID=" + lineID);
AD_Window_ID = WINDOW_PHYSICALINVENTORY;
ColumnName = "M_Inventory_ID";
SQL = "SELECT M_Inventory_ID FROM M_InventoryLine WHERE M_InventoryLine_ID=?";
}
else
{
lineID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, "M_MovementLine_ID");
if (lineID != 0)
{
if (log.isLoggable(Level.FINE)) log.fine("M_MovementLine_ID=" + lineID);
AD_Window_ID = WINDOW_INVENTORYMOVE;
ColumnName = "M_Movement_ID";
SQL = "SELECT M_Movement_ID FROM M_MovementLine WHERE M_MovementLine_ID=?";
}
else
{
lineID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, "M_ProductionLine_ID");
if (lineID != 0)
{
if (log.isLoggable(Level.FINE)) log.fine("M_ProductionLine_ID=" + lineID);
AD_Window_ID = WINDOW_PRODUCTION;
ColumnName = "M_Production_ID";
SQL = "SELECT M_Production_ID FROM M_ProductionLine WHERE M_ProductionLine_ID=?";
AD_Table_ID = 0;
Record_ID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, I_M_Transaction.COLUMNNAME_M_InOutLine_ID);
if (Record_ID != 0) {
AD_Table_ID = I_M_InOutLine.Table_ID;
} else {
Record_ID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, I_M_Transaction.COLUMNNAME_M_InventoryLine_ID);
if (Record_ID != 0) {
AD_Table_ID = I_M_InventoryLine.Table_ID;
} else {
Record_ID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, I_M_Transaction.COLUMNNAME_M_MovementLine_ID);
if (Record_ID != 0) {
AD_Table_ID = I_M_MovementLine.Table_ID;
} else {
Record_ID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, I_M_Transaction.COLUMNNAME_M_ProductionLine_ID);
if (Record_ID != 0) {
AD_Table_ID = I_M_ProductionLine.Table_ID;
} else {
Record_ID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, I_M_Transaction.COLUMNNAME_C_ProjectIssue_ID);
if (Record_ID != 0) {
AD_Table_ID = I_C_ProjectIssue.Table_ID;
} else {
log.warning("Not found zoom table WindowNo=" + m_WindowNo);
}
}
else
if (log.isLoggable(Level.FINE)) log.fine("Not found WindowNo=" + m_WindowNo);
}
}
}
if (AD_Window_ID == 0)
return;
// Get Parent ID
int parentID = 0;
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
pstmt = DB.prepareStatement(SQL, null);
pstmt.setInt(1, lineID);
rs = pstmt.executeQuery();
if (rs.next())
parentID = rs.getInt(1);
}
catch (SQLException e)
{
log.log(Level.SEVERE, SQL, e);
}
finally
{
DB.close(rs, pstmt);
rs = null;
pstmt = null;
}
query = MQuery.getEqualQuery(ColumnName, parentID);
if (log.isLoggable(Level.CONFIG)) log.config("AD_Window_ID=" + AD_Window_ID + " - " + query);
if (parentID == 0)
log.log(Level.SEVERE, "No ParentValue - " + SQL + " - " + lineID);
} // zoom

View File

@ -323,7 +323,7 @@ public class AssetServlet extends HttpServlet
if (msg.length () > 120)
msg = msg.substring (0, 119);
ad.setDeliveryConfirmation (msg);
ad.save ();
ad.saveEx();
// asset.saveEx(); not delivered
}
catch (Exception ex1)

View File

@ -294,7 +294,7 @@ public class PaymentServlet extends HttpServlet
{
if (log.isLoggable(Level.FINE)) log.fine(payment.getErrorMessage());
String errMsg = payment.getErrorMessage();
payment.save ();
payment.saveEx();
payment.setErrorMessage(errMsg);
request.getSession().setAttribute(WebSessionCtx.HDR_MESSAGE, errMsg);
//