IDEMPIERE-3171 Can't add record on POS Terminal / IDEMPIERE-170

This commit is contained in:
Carlos Ruiz 2016-09-03 15:42:01 +02:00
parent e6bc9b7cf2
commit 8f01084f7c
3 changed files with 57 additions and 4 deletions

View File

@ -0,0 +1,27 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-3171 Can't add record on POS Terminal, IDEMPIERE-170
-- Sep 3, 2016 2:31:03 PM GMT+01:00
UPDATE AD_Field SET IsDisplayed='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsDisplayedGrid='N', IsToolbarButton=NULL,Updated=TO_DATE('2016-09-03 14:31:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10802
;
-- Sep 3, 2016 2:31:33 PM GMT+01:00
UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2016-09-03 14:31:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=12750
;
-- Sep 3, 2016 2:31:40 PM GMT+01:00
UPDATE AD_Field SET DefaultValue='-1', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2016-09-03 14:31:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10802
;
-- Sep 3, 2016 2:39:09 PM GMT+01:00
ALTER TABLE C_POS MODIFY C_CashBook_ID NUMBER(10) DEFAULT NULL
;
-- Sep 3, 2016 2:39:09 PM GMT+01:00
ALTER TABLE C_POS MODIFY C_CashBook_ID NULL
;
SELECT register_migration_script('201609031532_IDEMPIERE-3171.sql') FROM dual
;

View File

@ -0,0 +1,24 @@
-- IDEMPIERE-3171 Can't add record on POS Terminal, IDEMPIERE-170
-- Sep 3, 2016 2:31:03 PM GMT+01:00
UPDATE AD_Field SET IsDisplayed='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsDisplayedGrid='N', IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2016-09-03 14:31:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10802
;
-- Sep 3, 2016 2:31:33 PM GMT+01:00
UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2016-09-03 14:31:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=12750
;
-- Sep 3, 2016 2:31:40 PM GMT+01:00
UPDATE AD_Field SET DefaultValue='-1', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2016-09-03 14:31:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10802
;
-- Sep 3, 2016 2:39:09 PM GMT+01:00
INSERT INTO t_alter_column values('c_pos','C_CashBook_ID','NUMERIC(10)',null,'NULL')
;
-- Sep 3, 2016 2:39:09 PM GMT+01:00
INSERT INTO t_alter_column values('c_pos','C_CashBook_ID',null,'NULL',null)
;
SELECT register_migration_script('201609031532_IDEMPIERE-3171.sql') FROM dual
;

View File

@ -120,15 +120,17 @@ public class MPOS extends X_C_POS
protected boolean beforeSave (boolean newRecord)
{
// Org Consistency
if (newRecord
|| is_ValueChanged("C_CashBook_ID") || is_ValueChanged("M_Warehouse_ID"))
if (newRecord || is_ValueChanged("C_BankAccount_ID"))
{
MCashBook cb = MCashBook.get(getCtx(), getC_CashBook_ID(), get_TrxName());
MBankAccount cb = MBankAccount.get(getCtx(), getC_BankAccount_ID());
if (cb.getAD_Org_ID() != getAD_Org_ID())
{
log.saveError("Error", Msg.parseTranslation(getCtx(), "@AD_Org_ID@: @C_CashBook_ID@"));
log.saveError("Error", Msg.parseTranslation(getCtx(), "@AD_Org_ID@: @C_BankAccount_ID@"));
return false;
}
}
if (newRecord || is_ValueChanged("M_Warehouse_ID"))
{
MWarehouse wh = MWarehouse.get(getCtx(), getM_Warehouse_ID(), get_TrxName());
if (wh.getAD_Org_ID() != getAD_Org_ID())
{