From 940d33bc664245041533608b59b7722c140423ac Mon Sep 17 00:00:00 2001 From: Nicolas Micoud Date: Tue, 21 Jan 2020 14:10:09 +0100 Subject: [PATCH] IDEMPIERE-4152 : Payment Allocation : notify user when date changes --- .../i7.1/oracle/202001211400_IDEMPIERE-4152.sql | 10 ++++++++++ .../i7.1/postgresql/202001211400_IDEMPIERE-4152.sql | 7 +++++++ .../org/adempiere/webui/apps/form/WAllocation.java | 12 +++++++++--- 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 migration/i7.1/oracle/202001211400_IDEMPIERE-4152.sql create mode 100644 migration/i7.1/postgresql/202001211400_IDEMPIERE-4152.sql diff --git a/migration/i7.1/oracle/202001211400_IDEMPIERE-4152.sql b/migration/i7.1/oracle/202001211400_IDEMPIERE-4152.sql new file mode 100644 index 0000000000..011c70da8a --- /dev/null +++ b/migration/i7.1/oracle/202001211400_IDEMPIERE-4152.sql @@ -0,0 +1,10 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-4152 - Payment Allocation : notify user when date changes +-- 2020-01-21 02:03:32 +INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','Allocation date updated',0,0,'Y',TO_DATE('2020-01-21 14:03:32','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2020-01-21 14:03:32','YYYY-MM-DD HH24:MI:SS'),100,200592,'AllocationDateUpdated','D','c5cb7231-9ccc-4219-aaab-46ac3de8a372') +; + +SELECT register_migration_script('202001211400_IDEMPIERE-4152.sql') FROM dual +; diff --git a/migration/i7.1/postgresql/202001211400_IDEMPIERE-4152.sql b/migration/i7.1/postgresql/202001211400_IDEMPIERE-4152.sql new file mode 100644 index 0000000000..de424f46ef --- /dev/null +++ b/migration/i7.1/postgresql/202001211400_IDEMPIERE-4152.sql @@ -0,0 +1,7 @@ +-- IDEMPIERE-4152 - Payment Allocation : notify user when date changes +-- 2020-01-21 02:03:32 +INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','Allocation date updated',0,0,'Y',TO_TIMESTAMP('2020-01-21 14:03:32','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2020-01-21 14:03:32','YYYY-MM-DD HH24:MI:SS'),100,200592,'AllocationDateUpdated','D','c5cb7231-9ccc-4219-aaab-46ac3de8a372') +; + +SELECT register_migration_script('202001211400_IDEMPIERE-4152.sql') FROM dual +; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WAllocation.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WAllocation.java index 7adcedeca7..42a8a6afcd 100755 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WAllocation.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WAllocation.java @@ -66,6 +66,7 @@ import org.compiere.util.TrxRunnable; import org.compiere.util.Util; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zk.ui.util.Clients; import org.zkoss.zul.Borderlayout; import org.zkoss.zul.Center; import org.zkoss.zul.Div; @@ -703,10 +704,15 @@ public class WAllocation extends Allocation paymentInfo.setText(calculatePayment(paymentTable, multiCurrency.isSelected())); invoiceInfo.setText(calculateInvoice(invoiceTable, multiCurrency.isSelected())); - + // Set AllocationDate - if (allocDate != null) - dateField.setValue(allocDate); + if (allocDate != null) { + if (! allocDate.equals(dateField.getValue())) { + Clients.showNotification(Msg.getMsg(Env.getCtx(), "AllocationDateUpdated"), Clients.NOTIFICATION_TYPE_INFO, dateField.getComponent(), "start_before", -1, true); + dateField.setValue(allocDate); + } + } + // Set Allocation Currency allocCurrencyLabel.setText(currencyPick.getDisplay()); // Difference