IDEMPIERE-5088 Implement Bank Transfer as Transactional Document like… (#1281)

* IDEMPIERE-5088 Implement Bank Transfer as Transactional Document like Payment

* IDEMPIERE-5088 Implement Bank Transfer as Transactional Document like Payment

- default to charge and to bpartner from the corresponding from fields
- add DateAcct, C_ConversionType_ID and IsOverrideCurrencyRate columns
- remove mandatory org linked bp requirement
- rename window to Bank/Cash Transfer and deactivate existing Bank/Cash
Transfer process.

* IDEMPIERE-5088 Change Bank Transfer Process to use (optionally) the new document

Co-authored-by: Carlos Ruiz <carg67@gmail.com>
This commit is contained in:
hengsin 2022-05-01 11:22:32 +08:00 committed by GitHub
parent ef085e72d6
commit 3f6ec68f37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 6035 additions and 30 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,506 @@
-- IDEMPIERE-5088 Implement Bank Transfer as Transactional Document like Payment
SELECT register_migration_script('202204131552_IDEMPIERE-5088.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Apr 13, 2022, 3:52:00 PM MYT
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,IsHtml) VALUES (214756,1,'Account Date','Accounting Date','The Accounting Date indicates the date to be used on the General Ledger account entries generated from this document. It is also used for any currency conversion.',200246,'DateAcct','@#Date@',7,'N','N','Y','N','N',0,'N',15,0,0,'Y',TO_TIMESTAMP('2022-04-13 15:51:58','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-04-13 15:51:58','YYYY-MM-DD HH24:MI:SS'),100,263,'Y','N','D','N','N','N','Y','03a2ce12-1343-477c-96d1-82ebbdd7d9c7','Y',0,'N','N','N')
;
-- Apr 13, 2022, 3:52:05 PM MYT
ALTER TABLE C_BankTransfer ADD DateAcct DATE NOT NULL
;
-- Apr 13, 2022, 3:53:38 PM MYT
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (214757,0,'Currency Type','Currency Conversion Rate Type','The Currency Conversion Rate Type lets you define different type of rates, e.g. Spot, Corporate and/or Sell/Buy rates.',200246,'C_ConversionType_ID',22,'N','N','N','N','N',0,'N',19,0,0,'Y',TO_TIMESTAMP('2022-04-13 15:53:38','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-04-13 15:53:38','YYYY-MM-DD HH24:MI:SS'),100,2278,'Y','N','D','N','N','N','Y','d6cc547a-b102-4a2e-afdc-e3a6c5adf290','Y',0,'N','N','N','N')
;
-- Apr 13, 2022, 3:53:43 PM MYT
UPDATE AD_Column SET FKConstraintName='CConversionType_CBankTransfer', FKConstraintType='N',Updated=TO_TIMESTAMP('2022-04-13 15:53:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=214757
;
-- Apr 13, 2022, 3:53:43 PM MYT
ALTER TABLE C_BankTransfer ADD C_ConversionType_ID NUMBER(10) DEFAULT NULL
;
-- Apr 13, 2022, 3:53:43 PM MYT
ALTER TABLE C_BankTransfer ADD CONSTRAINT CConversionType_CBankTransfer FOREIGN KEY (C_ConversionType_ID) REFERENCES c_conversiontype(c_conversiontype_id) DEFERRABLE INITIALLY DEFERRED
;
-- Apr 13, 2022, 3:56:10 PM MYT
UPDATE AD_Column SET Callout='org.compiere.model.CalloutBankTransfer.rate',Updated=TO_TIMESTAMP('2022-04-13 15:56:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=214757
;
-- Apr 13, 2022, 4:03:52 PM MYT
INSERT INTO AD_Val_Rule (AD_Val_Rule_ID,Name,Type,Code,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Val_Rule_UU) VALUES (200155,'C_BPartner of BankAccount Org','S','C_BPartner.AD_Org_ID IN (0, @C_BankAccount_ID.AD_Org_ID@)',0,0,'Y',TO_TIMESTAMP('2022-04-13 16:03:50','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-04-13 16:03:50','YYYY-MM-DD HH24:MI:SS'),100,'D','89ebf409-59e1-4575-8496-3d4b07797951')
;
-- Apr 13, 2022, 4:04:40 PM MYT
UPDATE AD_Val_Rule SET Name='C_BPartner of From BankAccount Org', Code='C_BPartner.AD_Org_ID IN (0, @From_C_BankAccount_ID.AD_Org_ID@)',Updated=TO_TIMESTAMP('2022-04-13 16:04:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=200155
;
-- Apr 13, 2022, 4:05:21 PM MYT
INSERT INTO AD_Val_Rule (AD_Val_Rule_ID,Name,Type,Code,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Val_Rule_UU) VALUES (200156,'C_BPartner of To BankAccount Org','S','C_BPartner.AD_Org_ID IN (0, @To_C_BankAccount_ID.AD_Org_ID@)',0,0,'Y',TO_TIMESTAMP('2022-04-13 16:05:20','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-04-13 16:05:20','YYYY-MM-DD HH24:MI:SS'),100,'D','a630438a-87ef-4720-80e8-d62e9824807d')
;
-- Apr 13, 2022, 4:05:41 PM MYT
UPDATE AD_Column SET AD_Val_Rule_ID=200155,Updated=TO_TIMESTAMP('2022-04-13 16:05:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=213676
;
-- Apr 13, 2022, 4:06:06 PM MYT
UPDATE AD_Column SET AD_Val_Rule_ID=200156,Updated=TO_TIMESTAMP('2022-04-13 16:06:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=213663
;
-- Apr 14, 2022, 11:00:50 AM MYT
UPDATE AD_Field SET IsReadOnly='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:00:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205817
;
-- Apr 14, 2022, 11:01:04 AM MYT
UPDATE AD_Field SET IsReadOnly='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:01:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205705
;
-- Apr 14, 2022, 11:02:09 AM MYT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLogic,DisplayLength,SeqNo,SortNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines,IsQuickEntry,IsDefaultFocus,IsAdvancedField,IsQuickForm) VALUES (206946,'Currency Type','Currency Conversion Rate Type','The Currency Conversion Rate Type lets you define different type of rates, e.g. Spot, Corporate and/or Sell/Buy rates.',200255,214757,'Y','@From_C_Currency_ID@!@To_C_Currency_ID@',0,210,0,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-04-14 11:02:07','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-04-14 11:02:07','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','ab8e070c-a8af-49b2-97fc-641c6f4a22b2','Y',220,1,2,1,'N','N','N','N')
;
-- Apr 14, 2022, 11:03:30 AM MYT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,SortNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines,IsQuickEntry,IsDefaultFocus,IsAdvancedField,IsQuickForm) VALUES (206947,'Account Date','Accounting Date','The Accounting Date indicates the date to be used on the General Ledger account entries generated from this document. It is also used for any currency conversion.',200255,214756,'Y',0,220,0,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-04-14 11:03:29','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-04-14 11:03:29','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','3965ebd9-79c8-4f7c-8037-5c7601b31caa','Y',230,1,2,1,'N','N','N','N')
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=60, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=4, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206947
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=70, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205693
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=80, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205694
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=90, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205817
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=100, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205695
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=110, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205696
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=120, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205697
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=130, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205810
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=140, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205698
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=150, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205699
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=160, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205705
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=170, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205700
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=180, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205701
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=190, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205702
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=200, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=1, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206946
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=210, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205703
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=220, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205811
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=230, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205686
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=240, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205685
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=250, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205690
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=80,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205817
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=90,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205692
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=100,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=206947
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=110,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205693
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=120,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205694
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=130,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205695
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=140,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205696
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=150,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205697
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=160,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205810
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=170,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205698
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=180,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205699
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=190,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205700
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=200,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205701
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=210,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205702
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=230,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205703
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=240,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205811
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=250,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205704
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=260,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205705
;
-- Apr 14, 2022, 11:07:20 AM MYT
UPDATE AD_Window SET Name='Bank/Cash Transfer',Updated=TO_TIMESTAMP('2022-04-14 11:07:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=200105
;
-- Apr 14, 2022, 11:07:20 AM MYT
UPDATE AD_Menu SET Name='Bank/Cash Transfer', Description='Manage Bank Transfer', IsActive='Y',Updated=TO_TIMESTAMP('2022-04-14 11:07:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=200160
;
-- Apr 14, 2022, 11:08:02 AM MYT
UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2022-04-14 11:08:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=53153
;
-- Apr 14, 2022, 11:08:02 AM MYT
UPDATE AD_Menu SET Name='Bank/Cash Transfer', Description='Bank/Cash Transfer let money tranfer between Banks', IsActive='N',Updated=TO_TIMESTAMP('2022-04-14 11:08:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53190
;
-- Apr 14, 2022, 11:08:22 AM MYT
UPDATE AD_Menu SET PredefinedContextVariables='IgnoreIsSOTrxInBPInfo=Y',Updated=TO_TIMESTAMP('2022-04-14 11:08:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=200160
;
-- Apr 14, 2022, 11:10:50 AM MYT
UPDATE AD_Window SET IsSOTrx='N',Updated=TO_TIMESTAMP('2022-04-14 11:10:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=200105
;
-- Apr 14, 2022, 11:48:25 AM MYT
UPDATE AD_Val_Rule SET Name='C_BPartner of From Organization', Code='C_BPartner.AD_Org_ID IN (0, @From_AD_Org_ID@)',Updated=TO_TIMESTAMP('2022-04-14 11:48:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=200155
;
-- Apr 14, 2022, 11:49:09 AM MYT
UPDATE AD_Val_Rule SET Name='C_BPartner of To Organization', Code='C_BPartner.AD_Org_ID IN (0, @To_AD_Org_ID@)',Updated=TO_TIMESTAMP('2022-04-14 11:49:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=200156
;
-- Apr 14, 2022, 11:49:17 AM MYT
UPDATE AD_System SET SupportUnits=1, DBAddress='jdbc:postgresql://localhost:5432/idempiere?encoding=unicode&applicationname=idempiere', NoProcessors=4, StatisticsInfo='C2U9B18P55I8L24M28', ProfileInfo='GardenWorld|SYSTEM|',Updated=TO_TIMESTAMP('2022-04-14 11:49:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_System_ID=0
;
-- Apr 14, 2022, 3:52:50 PM MYT
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (214758,0,'Override Currency Conversion Rate','Override Currency Conversion Rate',200246,'IsOverrideCurrencyRate','N',1,'N','N','Y','N','N',0,'N',20,0,0,'Y',TO_TIMESTAMP('2022-04-14 15:52:48','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-04-14 15:52:48','YYYY-MM-DD HH24:MI:SS'),100,203258,'Y','N','D','N','N','N','Y','582c15b1-c7a1-4f6b-acd1-95156c2e5385','N',0,'N','N','N','N')
;
-- Apr 14, 2022, 3:52:55 PM MYT
ALTER TABLE C_BankTransfer MODIFY To_C_BPartner_ID NUMBER(10)
;
-- Apr 14, 2022, 3:52:55 PM MYT
ALTER TABLE C_BankTransfer MODIFY From_C_BPartner_ID NUMBER(10)
;
-- Apr 14, 2022, 3:52:55 PM MYT
ALTER TABLE C_BankTransfer MODIFY C_ConversionType_ID NUMBER(10) DEFAULT NULL
;
-- Apr 14, 2022, 3:52:55 PM MYT
ALTER TABLE C_BankTransfer ADD IsOverrideCurrencyRate CHAR(1) DEFAULT 'N' CHECK (IsOverrideCurrencyRate IN ('Y','N')) NOT NULL
;
-- Apr 14, 2022, 3:54:51 PM MYT
UPDATE AD_Field SET DisplayLogic='@From_C_Currency_ID@=@To_C_Currency_ID@& @IsOverrideCurrencyRate@=Y', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, ReadOnlyLogic=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 15:54:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205703
;
-- Apr 14, 2022, 3:56:00 PM MYT
UPDATE AD_Field SET DisplayLogic='@From_C_Currency_ID@!@To_C_Currency_ID@& @IsOverrideCurrencyRate@=Y', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 15:56:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205703
;
-- Apr 14, 2022, 3:56:40 PM MYT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLogic,DisplayLength,SeqNo,SortNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines,IsQuickEntry,IsDefaultFocus,IsAdvancedField,IsQuickForm) VALUES (206948,'Override Currency Conversion Rate','Override Currency Conversion Rate',200255,214758,'Y','@From_C_Currency_ID@!@To_C_Currency_ID@',0,260,0,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-04-14 15:56:39','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-04-14 15:56:39','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','b3340877-88f6-43ad-b04b-1f02a46d0d0a','Y',270,1,2,1,'N','N','N','N')
;
-- Apr 14, 2022, 3:57:29 PM MYT
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=210, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=2, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 15:57:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206948
;
-- Apr 14, 2022, 3:57:29 PM MYT
UPDATE AD_Field SET SeqNo=220, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 15:57:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205703
;
-- Apr 14, 2022, 3:57:29 PM MYT
UPDATE AD_Field SET SeqNo=230, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 15:57:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205811
;
-- Apr 14, 2022, 3:57:29 PM MYT
UPDATE AD_Field SET SeqNo=240, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 15:57:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205686
;
-- Apr 14, 2022, 3:57:29 PM MYT
UPDATE AD_Field SET SeqNo=250, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 15:57:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205685
;
-- Apr 14, 2022, 3:57:29 PM MYT
UPDATE AD_Field SET SeqNo=260, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 15:57:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205690
;
-- Apr 14, 2022, 4:02:30 PM MYT
UPDATE AD_Column SET Callout=NULL,Updated=TO_TIMESTAMP('2022-04-14 16:02:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=214757
;
-- Apr 14, 2022, 4:02:40 PM MYT
UPDATE AD_Column SET Callout=NULL,Updated=TO_TIMESTAMP('2022-04-14 16:02:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=213656
;
-- Apr 14, 2022, 4:02:46 PM MYT
UPDATE AD_Column SET Callout=NULL,Updated=TO_TIMESTAMP('2022-04-14 16:02:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=213652
;
-- Apr 14, 2022, 4:02:53 PM MYT
UPDATE AD_Column SET Callout=NULL,Updated=TO_TIMESTAMP('2022-04-14 16:02:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=213662
;
-- Apr 14, 2022, 4:02:59 PM MYT
UPDATE AD_Column SET Callout=NULL,Updated=TO_TIMESTAMP('2022-04-14 16:02:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=213661
;
-- Apr 14, 2022, 4:03:04 PM MYT
UPDATE AD_Column SET Callout=NULL,Updated=TO_TIMESTAMP('2022-04-14 16:03:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=213657
;
-- Apr 15, 2022, 11:18:58 AM MYT
UPDATE AD_Field SET AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, ReadOnlyLogic='@From_C_Currency_ID@=@To_C_Currency_ID@|@IsOverrideCurrencyRate@=N', IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-15 11:18:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205702
;
-- Apr 15, 2022, 11:19:12 AM MYT
UPDATE AD_Field SET DisplayLogic='@From_C_Currency_ID@!@To_C_Currency_ID@&@IsOverrideCurrencyRate@=Y', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-15 11:19:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205703
;
-- Apr 15, 2022, 11:20:25 AM MYT
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=190, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=1, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-15 11:20:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206946
;
-- Apr 15, 2022, 11:20:25 AM MYT
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=200, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=2, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-15 11:20:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206948
;
-- Apr 15, 2022, 11:20:25 AM MYT
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=210, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=1, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-15 11:20:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205703
;
-- Apr 15, 2022, 11:20:25 AM MYT
UPDATE AD_Field SET SeqNo=220, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-15 11:20:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205702
;
-- Apr 15, 2022, 11:21:37 AM MYT
UPDATE AD_Field SET SeqNoGrid=170,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205705
;
-- Apr 15, 2022, 11:21:37 AM MYT
UPDATE AD_Field SET SeqNoGrid=180,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205698
;
-- Apr 15, 2022, 11:21:37 AM MYT
UPDATE AD_Field SET SeqNoGrid=190,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205699
;
-- Apr 15, 2022, 11:21:37 AM MYT
UPDATE AD_Field SET SeqNoGrid=200,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205700
;
-- Apr 15, 2022, 11:21:37 AM MYT
UPDATE AD_Field SET SeqNoGrid=210,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205701
;
-- Apr 15, 2022, 11:21:37 AM MYT
UPDATE AD_Field SET SeqNoGrid=230,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=206948
;
-- Apr 15, 2022, 11:21:37 AM MYT
UPDATE AD_Field SET SeqNoGrid=240,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205703
;
-- Apr 15, 2022, 11:21:37 AM MYT
UPDATE AD_Field SET SeqNoGrid=250,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205702
;
-- Apr 15, 2022, 11:21:37 AM MYT
UPDATE AD_Field SET SeqNoGrid=260,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205811
;
-- Apr 15, 2022, 11:21:37 AM MYT
UPDATE AD_Field SET SeqNoGrid=270,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205704
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205691
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=20,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205687
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=30,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205684
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=50,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205685
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=70,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205817
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=80,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205692
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=90,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=206947
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=100,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205693
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=110,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205694
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=120,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205695
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=130,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205696
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=140,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205697
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=150,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205810
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=160,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205705
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=170,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205698
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=180,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205699
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=190,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205700
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=200,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205701
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=210,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=206946
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=220,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=206948
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=230,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205703
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=240,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205702
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=250,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205811
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=260,IsDisplayedGrid='Y', Updated=getDate(), UpdatedBy=100 WHERE AD_Field_ID=205704
;
-- Apr 15, 2022, 3:25:07 PM MYT
UPDATE AD_Field SET DisplayLogic='@From_C_Currency_ID@!@To_C_Currency_ID@', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-15 15:25:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205703
;
-- Apr 15, 2022, 3:25:59 PM MYT
UPDATE AD_Column SET ReadOnlyLogic='@From_C_Currency_ID@=@To_C_Currency_ID@|@IsOverrideCurrencyRate@=N',Updated=TO_TIMESTAMP('2022-04-15 15:25:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=213662
;

View File

@ -0,0 +1,22 @@
-- IDEMPIERE-5088 Implement Bank Transfer as Transactional Document like Payment
SELECT register_migration_script('202204291835_IDEMPIERE-5088.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Apr 29, 2022, 6:35:01 PM CEST
UPDATE AD_Process SET IsActive='Y', Name='Bank/Cash Transfer Process', Description='Bank/Cash Transfer let money transfer between Banks',Updated=TO_TIMESTAMP('2022-04-29 18:35:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=53153
;
-- Apr 29, 2022, 6:35:01 PM CEST
UPDATE AD_Menu SET Name='Bank/Cash Transfer Process', Description='Bank/Cash Transfer let money transfer between Banks', IsActive='Y',Updated=TO_TIMESTAMP('2022-04-29 18:35:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53190
;
-- Apr 29, 2022, 7:08:32 PM CEST
INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,Help,PrintName,EntityType,AD_Element_UU) VALUES (203588,0,0,'Y',TO_TIMESTAMP('2022-04-29 19:08:15','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-04-29 19:08:15','YYYY-MM-DD HH24:MI:SS'),100,'IsCreateBankTransferDoc','Create Bank Transfer Document',NULL,NULL,'Create Bank Transfer Document','D','13f16541-d2b5-451e-9c5a-ee44647f5aa8')
;
-- Apr 29, 2022, 7:09:29 PM CEST
INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,AD_Process_ID,SeqNo,AD_Reference_ID,IsRange,FieldLength,IsMandatory,DefaultValue,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted,IsAutocomplete) VALUES (200385,0,0,'Y',TO_TIMESTAMP('2022-04-29 19:09:29','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-04-29 19:09:29','YYYY-MM-DD HH24:MI:SS'),100,'Create Bank Transfer Document',53153,130,20,'N',1,'Y','Y','IsCreateBankTransferDoc','Y','D',203588,'57fdbdce-fb7c-4acc-8db0-89d1ff02d309','N','N')
;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,503 @@
-- IDEMPIERE-5088 Implement Bank Transfer as Transactional Document like Payment
SELECT register_migration_script('202204131552_IDEMPIERE-5088.sql') FROM dual;
-- Apr 13, 2022, 3:52:00 PM MYT
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,IsHtml) VALUES (214756,1,'Account Date','Accounting Date','The Accounting Date indicates the date to be used on the General Ledger account entries generated from this document. It is also used for any currency conversion.',200246,'DateAcct','@#Date@',7,'N','N','Y','N','N',0,'N',15,0,0,'Y',TO_TIMESTAMP('2022-04-13 15:51:58','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-04-13 15:51:58','YYYY-MM-DD HH24:MI:SS'),100,263,'Y','N','D','N','N','N','Y','03a2ce12-1343-477c-96d1-82ebbdd7d9c7','Y',0,'N','N','N')
;
-- Apr 13, 2022, 3:52:05 PM MYT
ALTER TABLE C_BankTransfer ADD COLUMN DateAcct TIMESTAMP NOT NULL
;
-- Apr 13, 2022, 3:53:38 PM MYT
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (214757,0,'Currency Type','Currency Conversion Rate Type','The Currency Conversion Rate Type lets you define different type of rates, e.g. Spot, Corporate and/or Sell/Buy rates.',200246,'C_ConversionType_ID',22,'N','N','N','N','N',0,'N',19,0,0,'Y',TO_TIMESTAMP('2022-04-13 15:53:38','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-04-13 15:53:38','YYYY-MM-DD HH24:MI:SS'),100,2278,'Y','N','D','N','N','N','Y','d6cc547a-b102-4a2e-afdc-e3a6c5adf290','Y',0,'N','N','N','N')
;
-- Apr 13, 2022, 3:53:43 PM MYT
UPDATE AD_Column SET FKConstraintName='CConversionType_CBankTransfer', FKConstraintType='N',Updated=TO_TIMESTAMP('2022-04-13 15:53:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=214757
;
-- Apr 13, 2022, 3:53:43 PM MYT
ALTER TABLE C_BankTransfer ADD COLUMN C_ConversionType_ID NUMERIC(10) DEFAULT NULL
;
-- Apr 13, 2022, 3:53:43 PM MYT
ALTER TABLE C_BankTransfer ADD CONSTRAINT CConversionType_CBankTransfer FOREIGN KEY (C_ConversionType_ID) REFERENCES c_conversiontype(c_conversiontype_id) DEFERRABLE INITIALLY DEFERRED
;
-- Apr 13, 2022, 3:56:10 PM MYT
UPDATE AD_Column SET Callout='org.compiere.model.CalloutBankTransfer.rate',Updated=TO_TIMESTAMP('2022-04-13 15:56:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=214757
;
-- Apr 13, 2022, 4:03:52 PM MYT
INSERT INTO AD_Val_Rule (AD_Val_Rule_ID,Name,Type,Code,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Val_Rule_UU) VALUES (200155,'C_BPartner of BankAccount Org','S','C_BPartner.AD_Org_ID IN (0, @C_BankAccount_ID.AD_Org_ID@)',0,0,'Y',TO_TIMESTAMP('2022-04-13 16:03:50','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-04-13 16:03:50','YYYY-MM-DD HH24:MI:SS'),100,'D','89ebf409-59e1-4575-8496-3d4b07797951')
;
-- Apr 13, 2022, 4:04:40 PM MYT
UPDATE AD_Val_Rule SET Name='C_BPartner of From BankAccount Org', Code='C_BPartner.AD_Org_ID IN (0, @From_C_BankAccount_ID.AD_Org_ID@)',Updated=TO_TIMESTAMP('2022-04-13 16:04:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=200155
;
-- Apr 13, 2022, 4:05:21 PM MYT
INSERT INTO AD_Val_Rule (AD_Val_Rule_ID,Name,Type,Code,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Val_Rule_UU) VALUES (200156,'C_BPartner of To BankAccount Org','S','C_BPartner.AD_Org_ID IN (0, @To_C_BankAccount_ID.AD_Org_ID@)',0,0,'Y',TO_TIMESTAMP('2022-04-13 16:05:20','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-04-13 16:05:20','YYYY-MM-DD HH24:MI:SS'),100,'D','a630438a-87ef-4720-80e8-d62e9824807d')
;
-- Apr 13, 2022, 4:05:41 PM MYT
UPDATE AD_Column SET AD_Val_Rule_ID=200155,Updated=TO_TIMESTAMP('2022-04-13 16:05:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=213676
;
-- Apr 13, 2022, 4:06:06 PM MYT
UPDATE AD_Column SET AD_Val_Rule_ID=200156,Updated=TO_TIMESTAMP('2022-04-13 16:06:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=213663
;
-- Apr 14, 2022, 11:00:50 AM MYT
UPDATE AD_Field SET IsReadOnly='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:00:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205817
;
-- Apr 14, 2022, 11:01:04 AM MYT
UPDATE AD_Field SET IsReadOnly='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:01:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205705
;
-- Apr 14, 2022, 11:02:09 AM MYT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLogic,DisplayLength,SeqNo,SortNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines,IsQuickEntry,IsDefaultFocus,IsAdvancedField,IsQuickForm) VALUES (206946,'Currency Type','Currency Conversion Rate Type','The Currency Conversion Rate Type lets you define different type of rates, e.g. Spot, Corporate and/or Sell/Buy rates.',200255,214757,'Y','@From_C_Currency_ID@!@To_C_Currency_ID@',0,210,0,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-04-14 11:02:07','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-04-14 11:02:07','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','ab8e070c-a8af-49b2-97fc-641c6f4a22b2','Y',220,1,2,1,'N','N','N','N')
;
-- Apr 14, 2022, 11:03:30 AM MYT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,SortNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines,IsQuickEntry,IsDefaultFocus,IsAdvancedField,IsQuickForm) VALUES (206947,'Account Date','Accounting Date','The Accounting Date indicates the date to be used on the General Ledger account entries generated from this document. It is also used for any currency conversion.',200255,214756,'Y',0,220,0,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-04-14 11:03:29','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-04-14 11:03:29','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','3965ebd9-79c8-4f7c-8037-5c7601b31caa','Y',230,1,2,1,'N','N','N','N')
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=60, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=4, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206947
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=70, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205693
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=80, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205694
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=90, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205817
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=100, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205695
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=110, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205696
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=120, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205697
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=130, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205810
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=140, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205698
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=150, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205699
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=160, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205705
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=170, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205700
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=180, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205701
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=190, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205702
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=200, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=1, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206946
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=210, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205703
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=220, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205811
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=230, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205686
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=240, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205685
;
-- Apr 14, 2022, 11:05:59 AM MYT
UPDATE AD_Field SET SeqNo=250, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 11:05:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205690
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=80,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205817
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=90,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205692
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=100,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=206947
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=110,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205693
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=120,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205694
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=130,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205695
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=140,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205696
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=150,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205697
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=160,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205810
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=170,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205698
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=180,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205699
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=190,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205700
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=200,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205701
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=210,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205702
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=230,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205703
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=240,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205811
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=250,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205704
;
-- Apr 14, 2022, 11:06:26 AM MYT
UPDATE AD_Field SET SeqNoGrid=260,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205705
;
-- Apr 14, 2022, 11:07:20 AM MYT
UPDATE AD_Window SET Name='Bank/Cash Transfer',Updated=TO_TIMESTAMP('2022-04-14 11:07:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=200105
;
-- Apr 14, 2022, 11:07:20 AM MYT
UPDATE AD_Menu SET Name='Bank/Cash Transfer', Description='Manage Bank Transfer', IsActive='Y',Updated=TO_TIMESTAMP('2022-04-14 11:07:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=200160
;
-- Apr 14, 2022, 11:08:02 AM MYT
UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2022-04-14 11:08:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=53153
;
-- Apr 14, 2022, 11:08:02 AM MYT
UPDATE AD_Menu SET Name='Bank/Cash Transfer', Description='Bank/Cash Transfer let money tranfer between Banks', IsActive='N',Updated=TO_TIMESTAMP('2022-04-14 11:08:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53190
;
-- Apr 14, 2022, 11:08:22 AM MYT
UPDATE AD_Menu SET PredefinedContextVariables='IgnoreIsSOTrxInBPInfo=Y',Updated=TO_TIMESTAMP('2022-04-14 11:08:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=200160
;
-- Apr 14, 2022, 11:10:50 AM MYT
UPDATE AD_Window SET IsSOTrx='N',Updated=TO_TIMESTAMP('2022-04-14 11:10:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=200105
;
-- Apr 14, 2022, 11:48:25 AM MYT
UPDATE AD_Val_Rule SET Name='C_BPartner of From Organization', Code='C_BPartner.AD_Org_ID IN (0, @From_AD_Org_ID@)',Updated=TO_TIMESTAMP('2022-04-14 11:48:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=200155
;
-- Apr 14, 2022, 11:49:09 AM MYT
UPDATE AD_Val_Rule SET Name='C_BPartner of To Organization', Code='C_BPartner.AD_Org_ID IN (0, @To_AD_Org_ID@)',Updated=TO_TIMESTAMP('2022-04-14 11:49:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=200156
;
-- Apr 14, 2022, 11:49:17 AM MYT
UPDATE AD_System SET SupportUnits=1, DBAddress='jdbc:postgresql://localhost:5432/idempiere?encoding=unicode&applicationname=idempiere', NoProcessors=4, StatisticsInfo='C2U9B18P55I8L24M28', ProfileInfo='GardenWorld|SYSTEM|',Updated=TO_TIMESTAMP('2022-04-14 11:49:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_System_ID=0
;
-- Apr 14, 2022, 3:52:50 PM MYT
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (214758,0,'Override Currency Conversion Rate','Override Currency Conversion Rate',200246,'IsOverrideCurrencyRate','N',1,'N','N','Y','N','N',0,'N',20,0,0,'Y',TO_TIMESTAMP('2022-04-14 15:52:48','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-04-14 15:52:48','YYYY-MM-DD HH24:MI:SS'),100,203258,'Y','N','D','N','N','N','Y','582c15b1-c7a1-4f6b-acd1-95156c2e5385','N',0,'N','N','N','N')
;
-- Apr 14, 2022, 3:52:55 PM MYT
INSERT INTO t_alter_column values('c_banktransfer','To_C_BPartner_ID','NUMERIC(10)',null,null)
;
-- Apr 14, 2022, 3:52:55 PM MYT
INSERT INTO t_alter_column values('c_banktransfer','From_C_BPartner_ID','NUMERIC(10)',null,null)
;
-- Apr 14, 2022, 3:52:55 PM MYT
INSERT INTO t_alter_column values('c_banktransfer','C_ConversionType_ID','NUMERIC(10)',null,'NULL')
;
-- Apr 14, 2022, 3:52:55 PM MYT
ALTER TABLE C_BankTransfer ADD COLUMN IsOverrideCurrencyRate CHAR(1) DEFAULT 'N' CHECK (IsOverrideCurrencyRate IN ('Y','N')) NOT NULL
;
-- Apr 14, 2022, 3:54:51 PM MYT
UPDATE AD_Field SET DisplayLogic='@From_C_Currency_ID@=@To_C_Currency_ID@& @IsOverrideCurrencyRate@=Y', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, ReadOnlyLogic=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 15:54:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205703
;
-- Apr 14, 2022, 3:56:00 PM MYT
UPDATE AD_Field SET DisplayLogic='@From_C_Currency_ID@!@To_C_Currency_ID@& @IsOverrideCurrencyRate@=Y', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 15:56:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205703
;
-- Apr 14, 2022, 3:56:40 PM MYT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLogic,DisplayLength,SeqNo,SortNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines,IsQuickEntry,IsDefaultFocus,IsAdvancedField,IsQuickForm) VALUES (206948,'Override Currency Conversion Rate','Override Currency Conversion Rate',200255,214758,'Y','@From_C_Currency_ID@!@To_C_Currency_ID@',0,260,0,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-04-14 15:56:39','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-04-14 15:56:39','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','b3340877-88f6-43ad-b04b-1f02a46d0d0a','Y',270,1,2,1,'N','N','N','N')
;
-- Apr 14, 2022, 3:57:29 PM MYT
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=210, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=2, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 15:57:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206948
;
-- Apr 14, 2022, 3:57:29 PM MYT
UPDATE AD_Field SET SeqNo=220, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 15:57:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205703
;
-- Apr 14, 2022, 3:57:29 PM MYT
UPDATE AD_Field SET SeqNo=230, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 15:57:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205811
;
-- Apr 14, 2022, 3:57:29 PM MYT
UPDATE AD_Field SET SeqNo=240, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 15:57:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205686
;
-- Apr 14, 2022, 3:57:29 PM MYT
UPDATE AD_Field SET SeqNo=250, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 15:57:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205685
;
-- Apr 14, 2022, 3:57:29 PM MYT
UPDATE AD_Field SET SeqNo=260, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-14 15:57:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205690
;
-- Apr 14, 2022, 4:02:30 PM MYT
UPDATE AD_Column SET Callout=NULL,Updated=TO_TIMESTAMP('2022-04-14 16:02:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=214757
;
-- Apr 14, 2022, 4:02:40 PM MYT
UPDATE AD_Column SET Callout=NULL,Updated=TO_TIMESTAMP('2022-04-14 16:02:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=213656
;
-- Apr 14, 2022, 4:02:46 PM MYT
UPDATE AD_Column SET Callout=NULL,Updated=TO_TIMESTAMP('2022-04-14 16:02:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=213652
;
-- Apr 14, 2022, 4:02:53 PM MYT
UPDATE AD_Column SET Callout=NULL,Updated=TO_TIMESTAMP('2022-04-14 16:02:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=213662
;
-- Apr 14, 2022, 4:02:59 PM MYT
UPDATE AD_Column SET Callout=NULL,Updated=TO_TIMESTAMP('2022-04-14 16:02:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=213661
;
-- Apr 14, 2022, 4:03:04 PM MYT
UPDATE AD_Column SET Callout=NULL,Updated=TO_TIMESTAMP('2022-04-14 16:03:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=213657
;
-- Apr 15, 2022, 11:18:58 AM MYT
UPDATE AD_Field SET AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, ReadOnlyLogic='@From_C_Currency_ID@=@To_C_Currency_ID@|@IsOverrideCurrencyRate@=N', IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-15 11:18:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205702
;
-- Apr 15, 2022, 11:19:12 AM MYT
UPDATE AD_Field SET DisplayLogic='@From_C_Currency_ID@!@To_C_Currency_ID@&@IsOverrideCurrencyRate@=Y', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-15 11:19:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205703
;
-- Apr 15, 2022, 11:20:25 AM MYT
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=190, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=1, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-15 11:20:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206946
;
-- Apr 15, 2022, 11:20:25 AM MYT
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=200, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=2, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-15 11:20:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206948
;
-- Apr 15, 2022, 11:20:25 AM MYT
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=210, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=1, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-15 11:20:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205703
;
-- Apr 15, 2022, 11:20:25 AM MYT
UPDATE AD_Field SET SeqNo=220, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-15 11:20:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205702
;
-- Apr 15, 2022, 11:21:37 AM MYT
UPDATE AD_Field SET SeqNoGrid=170,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205705
;
-- Apr 15, 2022, 11:21:37 AM MYT
UPDATE AD_Field SET SeqNoGrid=180,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205698
;
-- Apr 15, 2022, 11:21:37 AM MYT
UPDATE AD_Field SET SeqNoGrid=190,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205699
;
-- Apr 15, 2022, 11:21:37 AM MYT
UPDATE AD_Field SET SeqNoGrid=200,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205700
;
-- Apr 15, 2022, 11:21:37 AM MYT
UPDATE AD_Field SET SeqNoGrid=210,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205701
;
-- Apr 15, 2022, 11:21:37 AM MYT
UPDATE AD_Field SET SeqNoGrid=230,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=206948
;
-- Apr 15, 2022, 11:21:37 AM MYT
UPDATE AD_Field SET SeqNoGrid=240,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205703
;
-- Apr 15, 2022, 11:21:37 AM MYT
UPDATE AD_Field SET SeqNoGrid=250,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205702
;
-- Apr 15, 2022, 11:21:37 AM MYT
UPDATE AD_Field SET SeqNoGrid=260,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205811
;
-- Apr 15, 2022, 11:21:37 AM MYT
UPDATE AD_Field SET SeqNoGrid=270,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205704
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205691
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=20,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205687
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=30,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205684
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=50,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205685
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=70,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205817
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=80,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205692
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=90,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=206947
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=100,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205693
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=110,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205694
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=120,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205695
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=130,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205696
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=140,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205697
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=150,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205810
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=160,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205705
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=170,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205698
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=180,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205699
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=190,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205700
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=200,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205701
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=210,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=206946
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=220,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=206948
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=230,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205703
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=240,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205702
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=250,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205811
;
-- Apr 15, 2022, 11:22:48 AM MYT
UPDATE AD_Field SET SeqNoGrid=260,IsDisplayedGrid='Y', Updated=statement_timestamp(), UpdatedBy=100 WHERE AD_Field_ID=205704
;
-- Apr 15, 2022, 3:25:07 PM MYT
UPDATE AD_Field SET DisplayLogic='@From_C_Currency_ID@!@To_C_Currency_ID@', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-04-15 15:25:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205703
;
-- Apr 15, 2022, 3:25:59 PM MYT
UPDATE AD_Column SET ReadOnlyLogic='@From_C_Currency_ID@=@To_C_Currency_ID@|@IsOverrideCurrencyRate@=N',Updated=TO_TIMESTAMP('2022-04-15 15:25:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=213662
;

View File

@ -0,0 +1,19 @@
-- IDEMPIERE-5088 Implement Bank Transfer as Transactional Document like Payment
SELECT register_migration_script('202204291835_IDEMPIERE-5088.sql') FROM dual;
-- Apr 29, 2022, 6:35:01 PM CEST
UPDATE AD_Process SET IsActive='Y', Name='Bank/Cash Transfer Process', Description='Bank/Cash Transfer let money transfer between Banks',Updated=TO_TIMESTAMP('2022-04-29 18:35:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=53153
;
-- Apr 29, 2022, 6:35:01 PM CEST
UPDATE AD_Menu SET Name='Bank/Cash Transfer Process', Description='Bank/Cash Transfer let money transfer between Banks', IsActive='Y',Updated=TO_TIMESTAMP('2022-04-29 18:35:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53190
;
-- Apr 29, 2022, 7:08:32 PM CEST
INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,Help,PrintName,EntityType,AD_Element_UU) VALUES (203588,0,0,'Y',TO_TIMESTAMP('2022-04-29 19:08:15','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-04-29 19:08:15','YYYY-MM-DD HH24:MI:SS'),100,'IsCreateBankTransferDoc','Create Bank Transfer Document',NULL,NULL,'Create Bank Transfer Document','D','13f16541-d2b5-451e-9c5a-ee44647f5aa8')
;
-- Apr 29, 2022, 7:09:29 PM CEST
INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,AD_Process_ID,SeqNo,AD_Reference_ID,IsRange,FieldLength,IsMandatory,DefaultValue,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted,IsAutocomplete) VALUES (200385,0,0,'Y',TO_TIMESTAMP('2022-04-29 19:09:29','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-04-29 19:09:29','YYYY-MM-DD HH24:MI:SS'),100,'Create Bank Transfer Document',53153,130,20,'N',1,'Y','Y','IsCreateBankTransferDoc','Y','D',203588,'57fdbdce-fb7c-4acc-8db0-89d1ff02d309','N','N')
;

View File

@ -0,0 +1,364 @@
/***********************************************************************
* This file is part of iDempiere ERP Open Source *
* http://www.idempiere.org *
* *
* Copyright (C) Contributors *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, *
* MA 02110-1301, USA. *
* *
* Contributors: *
* - hengsin *
**********************************************************************/
package org.adempiere.base.callout;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import org.adempiere.base.IColumnCallout;
import org.adempiere.base.annotation.Callout;
import org.compiere.model.GridField;
import org.compiere.model.GridTab;
import org.compiere.model.MBankAccount;
import org.compiere.model.MBankTransfer;
import org.compiere.model.MConversionRate;
import org.compiere.model.MCurrency;
import org.compiere.util.DB;
import org.compiere.util.Env;
/**
*
* @author hengsin
*
*/
@Callout(tableName = MBankTransfer.Table_Name,
columnName = {MBankTransfer.COLUMNNAME_PayDate, MBankTransfer.COLUMNNAME_From_Amt, MBankTransfer.COLUMNNAME_From_C_BankAccount_ID,
MBankTransfer.COLUMNNAME_From_C_Charge_ID, MBankTransfer.COLUMNNAME_From_TenderType, MBankTransfer.COLUMNNAME_From_C_Currency_ID,
MBankTransfer.COLUMNNAME_Rate, MBankTransfer.COLUMNNAME_To_C_BankAccount_ID, MBankTransfer.COLUMNNAME_To_C_Currency_ID,
MBankTransfer.COLUMNNAME_C_ConversionType_ID, MBankTransfer.COLUMNNAME_To_Amt})
public class CalloutBankTransfer implements IColumnCallout {
private static final Map<String, IColumnCallout> calloutMap = new HashMap<String, IColumnCallout>();
static {
calloutMap.put(MBankTransfer.COLUMNNAME_From_C_BankAccount_ID,
(ctx, windowNo, mTab, mField, value, oldValue) -> fromBankAccount(ctx, windowNo, mTab, mField, value));
calloutMap.put(MBankTransfer.COLUMNNAME_To_C_BankAccount_ID,
(ctx, windowNo, mTab, mField, value, oldValue) -> toBankAccount(ctx, windowNo, mTab, mField, value));
calloutMap.put(MBankTransfer.COLUMNNAME_From_Amt,
(ctx, windowNo, mTab, mField, value, oldValue) -> fromAmt(ctx, windowNo, mTab, mField));
calloutMap.put(MBankTransfer.COLUMNNAME_PayDate,
(ctx, windowNo, mTab, mField, value, oldValue) -> payDate(ctx, windowNo, mTab, mField));
calloutMap.put(MBankTransfer.COLUMNNAME_From_C_Charge_ID,
(ctx, windowNo, mTab, mField, value, oldValue) -> fromCharge(ctx, windowNo, mTab, mField));
calloutMap.put(MBankTransfer.COLUMNNAME_From_TenderType,
(ctx, windowNo, mTab, mField, value, oldValue) -> fromTenderType(ctx, windowNo, mTab, mField));
calloutMap.put(MBankTransfer.COLUMNNAME_From_C_Currency_ID,
(ctx, windowNo, mTab, mField, value, oldValue) -> fromCurrency(ctx, windowNo, mTab, mField));
calloutMap.put(MBankTransfer.COLUMNNAME_To_C_Currency_ID,
(ctx, windowNo, mTab, mField, value, oldValue) -> toCurrency(ctx, windowNo, mTab, mField));
calloutMap.put(MBankTransfer.COLUMNNAME_Rate,
(ctx, windowNo, mTab, mField, value, oldValue) -> rate(ctx, windowNo, mTab, mField, value));
calloutMap.put(MBankTransfer.COLUMNNAME_C_ConversionType_ID,
(ctx, windowNo, mTab, mField, value, oldValue) -> conversionType(ctx, windowNo, mTab, mField));
calloutMap.put(MBankTransfer.COLUMNNAME_To_Amt,
(ctx, windowNo, mTab, mField, value, oldValue) -> toAmt(ctx, windowNo, mTab, mField));
}
@Override
public String start(Properties ctx, int windowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
IColumnCallout callout = calloutMap.get(mField.getColumnName());
return callout != null ? callout.start(ctx, windowNo, mTab, mField, value, oldValue) : "";
}
private static String toAmt(Properties ctx, int windowNo, GridTab mTab, GridField mField) {
BigDecimal fromAmt = (BigDecimal) mTab.getValue(MBankTransfer.COLUMNNAME_From_Amt);
BigDecimal toAmt = (BigDecimal) mTab.getValue(MBankTransfer.COLUMNNAME_To_Amt);
if (fromAmt == null || toAmt == null)
return "";
Integer From_C_Currency_ID = (Integer) mTab.getValue(MBankTransfer.COLUMNNAME_From_C_Currency_ID);
Integer To_C_Currency_ID = (Integer) mTab.getValue(MBankTransfer.COLUMNNAME_To_C_Currency_ID);
if (From_C_Currency_ID != null && From_C_Currency_ID > 0 && To_C_Currency_ID != null && To_C_Currency_ID > 0) {
if (From_C_Currency_ID != To_C_Currency_ID) {
if ((Boolean)mTab.getValue(MBankTransfer.COLUMNNAME_IsOverrideCurrencyRate)) {
if (fromAmt.compareTo(BigDecimal.ZERO) != 0) {
BigDecimal rate = toAmt.divide(fromAmt, 12, RoundingMode.HALF_UP);
mTab.setValue(MBankTransfer.COLUMNNAME_Rate, rate);
}
}
}
}
return "";
}
private static String conversionType(Properties ctx, int windowNo, GridTab mTab, GridField mField) {
if (mField.getValue() != null && mTab.getValue(MBankTransfer.COLUMNNAME_To_AD_Org_ID) != null
&& mTab.getValue(MBankTransfer.COLUMNNAME_From_C_Currency_ID) != null) {
Integer AD_Client_ID = (Integer) mTab.getValue(MBankTransfer.COLUMNNAME_AD_Client_ID);
Integer AD_Org_ID = (Integer) mTab.getValue(MBankTransfer.COLUMNNAME_To_AD_Org_ID);
Integer From_C_Currency_ID = (Integer) mTab.getValue(MBankTransfer.COLUMNNAME_From_C_Currency_ID);
BigDecimal amt = (BigDecimal)mTab.getValue(MBankTransfer.COLUMNNAME_From_Amt);
if (amt.signum() != 0 && mTab.getValue(MBankTransfer.COLUMNNAME_To_C_Currency_ID) != null
&& mTab.getValue(MBankTransfer.COLUMNNAME_C_ConversionType_ID) != null
&& mTab.getValue(MBankTransfer.COLUMNNAME_PayDate) != null) {
if (!((Boolean)mTab.getValue(MBankTransfer.COLUMNNAME_IsOverrideCurrencyRate))) {
Timestamp payDate = (Timestamp) mTab.getValue(MBankTransfer.COLUMNNAME_PayDate);
Integer To_C_Currency_ID = (Integer) mTab.getValue(MBankTransfer.COLUMNNAME_To_C_Currency_ID);
Integer C_ConversionType_ID = (Integer) mTab.getValue(MBankTransfer.COLUMNNAME_C_ConversionType_ID);
BigDecimal rate = MConversionRate.getRate(From_C_Currency_ID, To_C_Currency_ID, payDate, C_ConversionType_ID, AD_Client_ID, AD_Org_ID);
if (rate != null) {
mTab.setValue(MBankTransfer.COLUMNNAME_Rate, rate);
return fromAmt(ctx, windowNo, mTab, mField);
}
}
}
}
return "";
}
private static String fromCurrency(Properties ctx, int windowNo, GridTab mTab, GridField mField) {
if (mField.getValue() != null && mTab.getValue(MBankTransfer.COLUMNNAME_To_AD_Org_ID) != null) {
Integer AD_Client_ID = (Integer) mTab.getValue(MBankTransfer.COLUMNNAME_AD_Client_ID);
Integer AD_Org_ID = (Integer) mTab.getValue(MBankTransfer.COLUMNNAME_To_AD_Org_ID);
Integer From_C_Currency_ID = (Integer) mField.getValue();
BigDecimal amt = (BigDecimal)mTab.getValue(MBankTransfer.COLUMNNAME_From_Amt);
if (amt.signum() != 0 && mTab.getValue(MBankTransfer.COLUMNNAME_To_C_Currency_ID) != null
&& mTab.getValue(MBankTransfer.COLUMNNAME_C_ConversionType_ID) != null
&& mTab.getValue(MBankTransfer.COLUMNNAME_PayDate) != null) {
if (!((Boolean)mTab.getValue(MBankTransfer.COLUMNNAME_IsOverrideCurrencyRate))) {
Timestamp payDate = (Timestamp) mTab.getValue(MBankTransfer.COLUMNNAME_PayDate);
Integer To_C_Currency_ID = (Integer) mTab.getValue(MBankTransfer.COLUMNNAME_To_C_Currency_ID);
Integer C_ConversionType_ID = (Integer) mTab.getValue(MBankTransfer.COLUMNNAME_C_ConversionType_ID);
BigDecimal rate = MConversionRate.getRate(From_C_Currency_ID, To_C_Currency_ID, payDate, C_ConversionType_ID, AD_Client_ID, AD_Org_ID);
if (rate != null) {
mTab.setValue(MBankTransfer.COLUMNNAME_Rate, rate);
return fromAmt(ctx, windowNo, mTab, mField);
}
}
}
}
return "";
}
private static String toCurrency(Properties ctx, int windowNo, GridTab mTab, GridField mField) {
if (mField.getValue() != null && mTab.getValue(MBankTransfer.COLUMNNAME_To_AD_Org_ID) != null) {
Integer AD_Client_ID = (Integer) mTab.getValue(MBankTransfer.COLUMNNAME_AD_Client_ID);
Integer AD_Org_ID = (Integer) mTab.getValue(MBankTransfer.COLUMNNAME_To_AD_Org_ID);
Integer To_C_Currency_ID = (Integer) mField.getValue();
BigDecimal amt = (BigDecimal)mTab.getValue(MBankTransfer.COLUMNNAME_From_Amt);
if (amt.signum() != 0 && mTab.getValue(MBankTransfer.COLUMNNAME_From_C_Currency_ID) != null
&& mTab.getValue(MBankTransfer.COLUMNNAME_C_ConversionType_ID) != null
&& mTab.getValue(MBankTransfer.COLUMNNAME_PayDate) != null) {
if (!((Boolean)mTab.getValue(MBankTransfer.COLUMNNAME_IsOverrideCurrencyRate))) {
Timestamp payDate = (Timestamp) mTab.getValue(MBankTransfer.COLUMNNAME_PayDate);
Integer From_C_Currency_ID = (Integer) mTab.getValue(MBankTransfer.COLUMNNAME_From_C_Currency_ID);
Integer C_ConversionType_ID = (Integer) mTab.getValue(MBankTransfer.COLUMNNAME_C_ConversionType_ID);
BigDecimal rate = MConversionRate.getRate(From_C_Currency_ID, To_C_Currency_ID, payDate, C_ConversionType_ID, AD_Client_ID, AD_Org_ID);
if (rate != null) {
mTab.setValue(MBankTransfer.COLUMNNAME_Rate, rate);
return fromAmt(ctx, windowNo, mTab, mField);
}
}
}
}
return "";
}
private static String fromTenderType(Properties ctx, int windowNo, GridTab mTab, GridField mField) {
mTab.setValue(MBankTransfer.COLUMNNAME_To_TenderType, mField.getValue());
return "";
}
private static String fromCharge(Properties ctx, int windowNo, GridTab mTab, GridField mField) {
mTab.setValue(MBankTransfer.COLUMNNAME_To_C_Charge_ID, mField.getValue());
return "";
}
private static String payDate(Properties ctx, int windowNo, GridTab mTab, GridField mField) {
mTab.setValue(MBankTransfer.COLUMNNAME_DateAcct, mField.getValue());
return "";
}
private static String fromBankAccount(Properties ctx, int windowNo, GridTab mTab, GridField mField, Object value)
{
Integer From_C_BankAccount_ID = (Integer) value; // Actually From_C_BankAccount_ID
if (From_C_BankAccount_ID == null || From_C_BankAccount_ID.intValue() == 0)
return "";
MBankAccount ba = MBankAccount.get(ctx, From_C_BankAccount_ID);
int AD_Org_ID = ba.getAD_Org_ID();
if (AD_Org_ID > 0)
{
mTab.setValue(MBankTransfer.COLUMNNAME_From_AD_Org_ID, AD_Org_ID);
}
else
{
AD_Org_ID = Env.getAD_Org_ID(Env.getCtx());
if (AD_Org_ID > 0)
mTab.setValue(MBankTransfer.COLUMNNAME_From_AD_Org_ID, AD_Org_ID);
}
if (ba.getC_Currency_ID() > 0)
mTab.setValue(MBankTransfer.COLUMNNAME_From_C_Currency_ID, ba.getC_Currency_ID());
int C_BPartner_ID = 0;
if (AD_Org_ID > 0)
{
String sql = "SELECT bp.C_BPartner_ID FROM C_BPartner bp "
+ "WHERE bp.AD_OrgBP_ID = ? "
+ "AND bp.IsActive = 'Y' ";
C_BPartner_ID = DB.getSQLValue(null, sql, AD_Org_ID);
}
if (C_BPartner_ID > 0)
{
mTab.setValue(MBankTransfer.COLUMNNAME_From_C_BPartner_ID, C_BPartner_ID);
}
else
{
mTab.setValue(MBankTransfer.COLUMNNAME_From_C_BPartner_ID, null);
}
return "";
}
private static String toBankAccount(Properties ctx, int windowNo, GridTab mTab, GridField mField, Object value)
{
Integer To_C_BankAccount_ID = (Integer) value; // Actually To_C_BankAccount_ID
if (To_C_BankAccount_ID == null || To_C_BankAccount_ID.intValue() == 0)
return "";
MBankAccount ba = MBankAccount.get(ctx, To_C_BankAccount_ID);
int AD_Org_ID = ba.getAD_Org_ID();
if (AD_Org_ID > 0)
{
mTab.setValue(MBankTransfer.COLUMNNAME_To_AD_Org_ID, ba.getAD_Org_ID());
}
else
{
AD_Org_ID = Env.getAD_Org_ID(Env.getCtx());
if (AD_Org_ID > 0)
mTab.setValue(MBankTransfer.COLUMNNAME_To_AD_Org_ID, AD_Org_ID);
}
if (ba.getC_Currency_ID() > 0)
mTab.setValue(MBankTransfer.COLUMNNAME_To_C_Currency_ID, ba.getC_Currency_ID());
int C_BPartner_ID = 0;
if (AD_Org_ID > 0)
{
String sql = "SELECT bp.C_BPartner_ID FROM C_BPartner bp "
+ "WHERE bp.AD_OrgBP_ID = ? "
+ "AND bp.IsActive = 'Y' ";
C_BPartner_ID = DB.getSQLValue(null, sql, AD_Org_ID);
}
if (C_BPartner_ID > 0)
{
mTab.setValue(MBankTransfer.COLUMNNAME_To_C_BPartner_ID, C_BPartner_ID);
}
else
{
if (mTab.getValue(MBankTransfer.COLUMNNAME_From_AD_Org_ID) != null &&
AD_Org_ID == (Integer)mTab.getValue(MBankTransfer.COLUMNNAME_From_AD_Org_ID) &&
mTab.getValue(MBankTransfer.COLUMNNAME_From_C_BPartner_ID) != null &&
((Integer)mTab.getValue(MBankTransfer.COLUMNNAME_From_C_BPartner_ID)) > 0)
{
mTab.setValue(MBankTransfer.COLUMNNAME_To_C_BPartner_ID, mTab.getValue(MBankTransfer.COLUMNNAME_From_C_BPartner_ID));
}
else
{
mTab.setValue(MBankTransfer.COLUMNNAME_To_C_BPartner_ID, null);
}
}
Integer From_C_Currency_ID = (Integer) mTab.getValue(MBankTransfer.COLUMNNAME_From_C_Currency_ID);
Integer To_C_Currency_ID = (Integer) mTab.getValue(MBankTransfer.COLUMNNAME_To_C_Currency_ID);
Timestamp PayDate = (Timestamp) mTab.getValue(MBankTransfer.COLUMNNAME_PayDate);
Integer AD_Client_ID = (Integer) mTab.getValue(MBankTransfer.COLUMNNAME_AD_Client_ID);
if (From_C_Currency_ID != null && From_C_Currency_ID > 0 && To_C_Currency_ID != null && To_C_Currency_ID > 0) {
if (From_C_Currency_ID == To_C_Currency_ID) {
mTab.setValue(MBankTransfer.COLUMNNAME_Rate, BigDecimal.ONE);
return fromAmt(ctx, windowNo, mTab, mField);
} else {
if (PayDate != null && AD_Client_ID != null
&& mTab.getValue(MBankTransfer.COLUMNNAME_C_ConversionType_ID) != null) {
Integer C_ConversionType_ID = (Integer) mTab.getValue(MBankTransfer.COLUMNNAME_C_ConversionType_ID);
BigDecimal rate = MConversionRate.getRate(From_C_Currency_ID, To_C_Currency_ID, PayDate, C_ConversionType_ID, AD_Client_ID, AD_Org_ID);
if (rate != null) {
mTab.setValue(MBankTransfer.COLUMNNAME_Rate, rate);
return fromAmt(ctx, windowNo, mTab, mField);
}
}
}
}
return "";
}
private static String rate(Properties ctx, int windowNo, GridTab mTab, GridField mField, Object value)
{
BigDecimal fromAmt = (BigDecimal) mTab.getValue(MBankTransfer.COLUMNNAME_From_Amt);
if (fromAmt == null)
return "";
Integer From_C_Currency_ID = (Integer) mTab.getValue(MBankTransfer.COLUMNNAME_From_C_Currency_ID);
Integer To_C_Currency_ID = (Integer) mTab.getValue(MBankTransfer.COLUMNNAME_To_C_Currency_ID);
if (From_C_Currency_ID != null && From_C_Currency_ID > 0 && To_C_Currency_ID != null && To_C_Currency_ID > 0) {
if (From_C_Currency_ID == To_C_Currency_ID) {
mTab.setValue(MBankTransfer.COLUMNNAME_Rate, BigDecimal.ONE);
return fromAmt(ctx, windowNo, mTab, mField);
} else {
if (fromAmt.signum() != 0) {
return fromAmt(ctx, windowNo, mTab, mField);
}
}
}
return "";
}
/**
*
* @param ctx
* @param WindowNo
* @param mTab
* @param mField
* @return error message (if any)
*/
private static String fromAmt(Properties ctx, int WindowNo, GridTab mTab, GridField mField)
{
BigDecimal rate = (BigDecimal) mTab.getValue(MBankTransfer.COLUMNNAME_Rate);
BigDecimal fromAmt = (BigDecimal) mTab.getValue(MBankTransfer.COLUMNNAME_From_Amt);
if (fromAmt == null || rate == null)
return "";
BigDecimal toAmt = rate.multiply(fromAmt);
Integer To_C_Currency_ID = (Integer) mTab.getValue(MBankTransfer.COLUMNNAME_To_C_Currency_ID);
if (To_C_Currency_ID != null && To_C_Currency_ID > 0) {
MCurrency cur = MCurrency.get(ctx, To_C_Currency_ID);
if (cur != null)
toAmt = toAmt.setScale(cur.getStdPrecision(), RoundingMode.HALF_UP);
}
mTab.setValue(MBankTransfer.COLUMNNAME_To_Amt, toAmt);
return "";
}
}

View File

@ -22,7 +22,7 @@ import org.compiere.util.KeyNamePair;
/** Generated Interface for C_AllocationLine /** Generated Interface for C_AllocationLine
* @author iDempiere (generated) * @author iDempiere (generated)
* @version Release 9 * @version Release 10
*/ */
public interface I_C_AllocationLine public interface I_C_AllocationLine
{ {
@ -44,8 +44,8 @@ public interface I_C_AllocationLine
/** Column name AD_Client_ID */ /** Column name AD_Client_ID */
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID"; public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
/** Get Client. /** Get Tenant.
* Client/Tenant for this installation. * Tenant for this installation.
*/ */
public int getAD_Client_ID(); public int getAD_Client_ID();
@ -53,12 +53,12 @@ public interface I_C_AllocationLine
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID"; public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
/** Set Organization. /** Set Organization.
* Organizational entity within client * Organizational entity within tenant
*/ */
public void setAD_Org_ID (int AD_Org_ID); public void setAD_Org_ID (int AD_Org_ID);
/** Get Organization. /** Get Organization.
* Organizational entity within client * Organizational entity within tenant
*/ */
public int getAD_Org_ID(); public int getAD_Org_ID();
@ -112,6 +112,21 @@ public interface I_C_AllocationLine
/** Get C_AllocationLine_UU */ /** Get C_AllocationLine_UU */
public String getC_AllocationLine_UU(); public String getC_AllocationLine_UU();
/** Column name C_BankTransfer_ID */
public static final String COLUMNNAME_C_BankTransfer_ID = "C_BankTransfer_ID";
/** Set Bank Transfer.
* Bank Transfer
*/
public void setC_BankTransfer_ID (int C_BankTransfer_ID);
/** Get Bank Transfer.
* Bank Transfer
*/
public int getC_BankTransfer_ID();
public org.compiere.model.I_C_BankTransfer getC_BankTransfer() throws RuntimeException;
/** Column name C_BPartner_ID */ /** Column name C_BPartner_ID */
public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID"; public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID";

View File

@ -0,0 +1,422 @@
/******************************************************************************
* Product: iDempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2012 ComPiere, Inc. All Rights Reserved. *
* This program is free software, you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY, without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program, if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
package org.compiere.model;
import java.math.BigDecimal;
import java.sql.Timestamp;
import org.compiere.util.KeyNamePair;
/** Generated Interface for C_BankTransfer
* @author iDempiere (generated)
* @version Release 10
*/
public interface I_C_BankTransfer
{
/** TableName=C_BankTransfer */
public static final String Table_Name = "C_BankTransfer";
/** AD_Table_ID=200246 */
public static final int Table_ID = 200246;
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
/** AccessLevel = 1 - Org
*/
BigDecimal accessLevel = BigDecimal.valueOf(1);
/** Load Meta Data */
/** Column name AD_Client_ID */
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
/** Get Tenant.
* Tenant for this installation.
*/
public int getAD_Client_ID();
/** Column name AD_Org_ID */
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
/** Set Organization.
* Organizational entity within tenant
*/
public void setAD_Org_ID (int AD_Org_ID);
/** Get Organization.
* Organizational entity within tenant
*/
public int getAD_Org_ID();
/** Column name C_BankTransfer_ID */
public static final String COLUMNNAME_C_BankTransfer_ID = "C_BankTransfer_ID";
/** Set Bank Transfer.
* Bank Transfer
*/
public void setC_BankTransfer_ID (int C_BankTransfer_ID);
/** Get Bank Transfer.
* Bank Transfer
*/
public int getC_BankTransfer_ID();
/** Column name C_BankTransfer_UU */
public static final String COLUMNNAME_C_BankTransfer_UU = "C_BankTransfer_UU";
/** Set C_BankTransfer_UU */
public void setC_BankTransfer_UU (String C_BankTransfer_UU);
/** Get C_BankTransfer_UU */
public String getC_BankTransfer_UU();
/** Column name C_ConversionType_ID */
public static final String COLUMNNAME_C_ConversionType_ID = "C_ConversionType_ID";
/** Set Currency Type.
* Currency Conversion Rate Type
*/
public void setC_ConversionType_ID (int C_ConversionType_ID);
/** Get Currency Type.
* Currency Conversion Rate Type
*/
public int getC_ConversionType_ID();
public org.compiere.model.I_C_ConversionType getC_ConversionType() throws RuntimeException;
/** Column name Created */
public static final String COLUMNNAME_Created = "Created";
/** Get Created.
* Date this record was created
*/
public Timestamp getCreated();
/** Column name CreatedBy */
public static final String COLUMNNAME_CreatedBy = "CreatedBy";
/** Get Created By.
* User who created this records
*/
public int getCreatedBy();
/** Column name DateAcct */
public static final String COLUMNNAME_DateAcct = "DateAcct";
/** Set Account Date.
* Accounting Date
*/
public void setDateAcct (Timestamp DateAcct);
/** Get Account Date.
* Accounting Date
*/
public Timestamp getDateAcct();
/** Column name Description */
public static final String COLUMNNAME_Description = "Description";
/** Set Description.
* Optional short description of the record
*/
public void setDescription (String Description);
/** Get Description.
* Optional short description of the record
*/
public String getDescription();
/** Column name DocAction */
public static final String COLUMNNAME_DocAction = "DocAction";
/** Set Document Action.
* The targeted status of the document
*/
public void setDocAction (String DocAction);
/** Get Document Action.
* The targeted status of the document
*/
public String getDocAction();
/** Column name DocStatus */
public static final String COLUMNNAME_DocStatus = "DocStatus";
/** Set Document Status.
* The current status of the document
*/
public void setDocStatus (String DocStatus);
/** Get Document Status.
* The current status of the document
*/
public String getDocStatus();
/** Column name DocumentNo */
public static final String COLUMNNAME_DocumentNo = "DocumentNo";
/** Set Document No.
* Document sequence number of the document
*/
public void setDocumentNo (String DocumentNo);
/** Get Document No.
* Document sequence number of the document
*/
public String getDocumentNo();
/** Column name From_AD_Org_ID */
public static final String COLUMNNAME_From_AD_Org_ID = "From_AD_Org_ID";
/** Set From Organization */
public void setFrom_AD_Org_ID (int From_AD_Org_ID);
/** Get From Organization */
public int getFrom_AD_Org_ID();
/** Column name From_Amt */
public static final String COLUMNNAME_From_Amt = "From_Amt";
/** Set From Amount */
public void setFrom_Amt (BigDecimal From_Amt);
/** Get From Amount */
public BigDecimal getFrom_Amt();
/** Column name From_C_BankAccount_ID */
public static final String COLUMNNAME_From_C_BankAccount_ID = "From_C_BankAccount_ID";
/** Set From Bank Account */
public void setFrom_C_BankAccount_ID (int From_C_BankAccount_ID);
/** Get From Bank Account */
public int getFrom_C_BankAccount_ID();
public org.compiere.model.I_C_BankAccount getFrom_C_BankAccount() throws RuntimeException;
/** Column name From_C_BPartner_ID */
public static final String COLUMNNAME_From_C_BPartner_ID = "From_C_BPartner_ID";
/** Set From Business Partner .
* Identifies a Business Partner
*/
public void setFrom_C_BPartner_ID (int From_C_BPartner_ID);
/** Get From Business Partner .
* Identifies a Business Partner
*/
public int getFrom_C_BPartner_ID();
public org.compiere.model.I_C_BPartner getFrom_C_BPartner() throws RuntimeException;
/** Column name From_C_Charge_ID */
public static final String COLUMNNAME_From_C_Charge_ID = "From_C_Charge_ID";
/** Set From Charge */
public void setFrom_C_Charge_ID (int From_C_Charge_ID);
/** Get From Charge */
public int getFrom_C_Charge_ID();
public org.compiere.model.I_C_Charge getFrom_C_Charge() throws RuntimeException;
/** Column name From_C_Currency_ID */
public static final String COLUMNNAME_From_C_Currency_ID = "From_C_Currency_ID";
/** Set From Bank Currency */
public void setFrom_C_Currency_ID (int From_C_Currency_ID);
/** Get From Bank Currency */
public int getFrom_C_Currency_ID();
public org.compiere.model.I_C_Currency getFrom_C_Currency() throws RuntimeException;
/** Column name From_TenderType */
public static final String COLUMNNAME_From_TenderType = "From_TenderType";
/** Set From Tender Type */
public void setFrom_TenderType (String From_TenderType);
/** Get From Tender Type */
public String getFrom_TenderType();
/** Column name IsActive */
public static final String COLUMNNAME_IsActive = "IsActive";
/** Set Active.
* The record is active in the system
*/
public void setIsActive (boolean IsActive);
/** Get Active.
* The record is active in the system
*/
public boolean isActive();
/** Column name IsOverrideCurrencyRate */
public static final String COLUMNNAME_IsOverrideCurrencyRate = "IsOverrideCurrencyRate";
/** Set Override Currency Conversion Rate.
* Override Currency Conversion Rate
*/
public void setIsOverrideCurrencyRate (boolean IsOverrideCurrencyRate);
/** Get Override Currency Conversion Rate.
* Override Currency Conversion Rate
*/
public boolean isOverrideCurrencyRate();
/** Column name PayDate */
public static final String COLUMNNAME_PayDate = "PayDate";
/** Set Payment date.
* Date Payment made
*/
public void setPayDate (Timestamp PayDate);
/** Get Payment date.
* Date Payment made
*/
public Timestamp getPayDate();
/** Column name Processed */
public static final String COLUMNNAME_Processed = "Processed";
/** Set Processed.
* The document has been processed
*/
public void setProcessed (boolean Processed);
/** Get Processed.
* The document has been processed
*/
public boolean isProcessed();
/** Column name Processing */
public static final String COLUMNNAME_Processing = "Processing";
/** Set Process Now */
public void setProcessing (boolean Processing);
/** Get Process Now */
public boolean isProcessing();
/** Column name Rate */
public static final String COLUMNNAME_Rate = "Rate";
/** Set Rate.
* Rate or Tax or Exchange
*/
public void setRate (BigDecimal Rate);
/** Get Rate.
* Rate or Tax or Exchange
*/
public BigDecimal getRate();
/** Column name To_AD_Org_ID */
public static final String COLUMNNAME_To_AD_Org_ID = "To_AD_Org_ID";
/** Set To Organization */
public void setTo_AD_Org_ID (int To_AD_Org_ID);
/** Get To Organization */
public int getTo_AD_Org_ID();
/** Column name To_Amt */
public static final String COLUMNNAME_To_Amt = "To_Amt";
/** Set To Amount */
public void setTo_Amt (BigDecimal To_Amt);
/** Get To Amount */
public BigDecimal getTo_Amt();
/** Column name To_C_BankAccount_ID */
public static final String COLUMNNAME_To_C_BankAccount_ID = "To_C_BankAccount_ID";
/** Set To Bank Account */
public void setTo_C_BankAccount_ID (int To_C_BankAccount_ID);
/** Get To Bank Account */
public int getTo_C_BankAccount_ID();
public org.compiere.model.I_C_BankAccount getTo_C_BankAccount() throws RuntimeException;
/** Column name To_C_BPartner_ID */
public static final String COLUMNNAME_To_C_BPartner_ID = "To_C_BPartner_ID";
/** Set To Business Partner .
* Identifies a Business Partner
*/
public void setTo_C_BPartner_ID (int To_C_BPartner_ID);
/** Get To Business Partner .
* Identifies a Business Partner
*/
public int getTo_C_BPartner_ID();
public org.compiere.model.I_C_BPartner getTo_C_BPartner() throws RuntimeException;
/** Column name To_C_Charge_ID */
public static final String COLUMNNAME_To_C_Charge_ID = "To_C_Charge_ID";
/** Set To Charge */
public void setTo_C_Charge_ID (int To_C_Charge_ID);
/** Get To Charge */
public int getTo_C_Charge_ID();
public org.compiere.model.I_C_Charge getTo_C_Charge() throws RuntimeException;
/** Column name To_C_Currency_ID */
public static final String COLUMNNAME_To_C_Currency_ID = "To_C_Currency_ID";
/** Set To Bank Currency */
public void setTo_C_Currency_ID (int To_C_Currency_ID);
/** Get To Bank Currency */
public int getTo_C_Currency_ID();
public org.compiere.model.I_C_Currency getTo_C_Currency() throws RuntimeException;
/** Column name To_TenderType */
public static final String COLUMNNAME_To_TenderType = "To_TenderType";
/** Set To Tender Type */
public void setTo_TenderType (String To_TenderType);
/** Get To Tender Type */
public String getTo_TenderType();
/** Column name Updated */
public static final String COLUMNNAME_Updated = "Updated";
/** Get Updated.
* Date this record was updated
*/
public Timestamp getUpdated();
/** Column name UpdatedBy */
public static final String COLUMNNAME_UpdatedBy = "UpdatedBy";
/** Get Updated By.
* User who updated this records
*/
public int getUpdatedBy();
}

View File

@ -22,7 +22,7 @@ import org.compiere.util.KeyNamePair;
/** Generated Interface for C_Payment /** Generated Interface for C_Payment
* @author iDempiere (generated) * @author iDempiere (generated)
* @version Release 9 * @version Release 10
*/ */
public interface I_C_Payment public interface I_C_Payment
{ {
@ -83,8 +83,8 @@ public interface I_C_Payment
/** Column name AD_Client_ID */ /** Column name AD_Client_ID */
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID"; public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
/** Get Client. /** Get Tenant.
* Client/Tenant for this installation. * Tenant for this installation.
*/ */
public int getAD_Client_ID(); public int getAD_Client_ID();
@ -92,12 +92,12 @@ public interface I_C_Payment
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID"; public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
/** Set Organization. /** Set Organization.
* Organizational entity within client * Organizational entity within tenant
*/ */
public void setAD_Org_ID (int AD_Org_ID); public void setAD_Org_ID (int AD_Org_ID);
/** Get Organization. /** Get Organization.
* Organizational entity within client * Organizational entity within tenant
*/ */
public int getAD_Org_ID(); public int getAD_Org_ID();
@ -235,6 +235,21 @@ public interface I_C_Payment
public org.compiere.model.I_C_BankAccount getC_BankAccount() throws RuntimeException; public org.compiere.model.I_C_BankAccount getC_BankAccount() throws RuntimeException;
/** Column name C_BankTransfer_ID */
public static final String COLUMNNAME_C_BankTransfer_ID = "C_BankTransfer_ID";
/** Set Bank Transfer.
* Bank Transfer
*/
public void setC_BankTransfer_ID (int C_BankTransfer_ID);
/** Get Bank Transfer.
* Bank Transfer
*/
public int getC_BankTransfer_ID();
public org.compiere.model.I_C_BankTransfer getC_BankTransfer() throws RuntimeException;
/** Column name C_BPartner_ID */ /** Column name C_BPartner_ID */
public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID"; public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID";

View File

@ -157,11 +157,24 @@ public class MAllocationLine extends X_C_AllocationLine
* @param C_CashLine_ID cash line * @param C_CashLine_ID cash line
*/ */
public void setPaymentInfo (int C_Payment_ID, int C_CashLine_ID) public void setPaymentInfo (int C_Payment_ID, int C_CashLine_ID)
{
setPaymentInfo(C_Payment_ID, C_CashLine_ID, 0);
}
/**
* Set Payment Info
* @param C_Payment_ID payment
* @param C_CashLine_ID cash line
* @param C_BankTransfer_ID
*/
public void setPaymentInfo (int C_Payment_ID, int C_CashLine_ID, int C_BankTransfer_ID)
{ {
if (C_Payment_ID != 0) if (C_Payment_ID != 0)
setC_Payment_ID(C_Payment_ID); setC_Payment_ID(C_Payment_ID);
if (C_CashLine_ID != 0) if (C_CashLine_ID != 0)
setC_CashLine_ID(C_CashLine_ID); setC_CashLine_ID(C_CashLine_ID);
if (C_BankTransfer_ID != 0)
setC_BankTransfer_ID(C_BankTransfer_ID);
} // setPaymentInfo } // setPaymentInfo
/** /**

View File

@ -0,0 +1,447 @@
/***********************************************************************
* This file is part of iDempiere ERP Open Source *
* http://www.idempiere.org *
* *
* Copyright (C) Contributors *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, *
* MA 02110-1301, USA. *
* *
* Contributors: *
* - hengsin *
**********************************************************************/
package org.compiere.model;
import java.io.File;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.Properties;
import java.util.logging.Level;
import org.compiere.process.DocAction;
import org.compiere.process.DocumentEngine;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Msg;
/**
*
* @author hengsin
*
*/
public class MBankTransfer extends X_C_BankTransfer implements DocAction {
/**
*
*/
private static final long serialVersionUID = -6091468617167291836L;
/**
*
* @param ctx
* @param C_BankTransfer_ID
* @param trxName
*/
public MBankTransfer(Properties ctx, int C_BankTransfer_ID, String trxName) {
super(ctx, C_BankTransfer_ID, trxName);
if (C_BankTransfer_ID == 0)
{
setDocAction(DOCACTION_Complete);
setDocStatus(DOCSTATUS_Drafted);
setPayDate(new Timestamp(System.currentTimeMillis()));
setProcessed(false);
}
}
/**
*
* @param ctx
* @param rs
* @param trxName
*/
public MBankTransfer(Properties ctx, ResultSet rs, String trxName)
{
super(ctx, rs, trxName);
}
@Override
protected boolean beforeSave(boolean newRecord) {
if (!super.beforeSave(newRecord))
return false;
if (getTo_C_BankAccount_ID() == getFrom_C_BankAccount_ID()) {
log.saveError("From Bank Account and To Bank Account must be different", toString());
return false;
}
if (getFrom_C_BankAccount().getAD_Org_ID() != 0 && getFrom_C_BankAccount().getAD_Org_ID() != getFrom_AD_Org_ID()) {
log.saveError("From Organization does not matches the organization of the From Bank Account", toString());
return false;
}
if (getFrom_C_Currency_ID() == 0) {
int From_C_Currency_ID = getFrom_C_BankAccount().getC_Currency_ID();
if (From_C_Currency_ID > 0)
setFrom_C_Currency_ID(From_C_Currency_ID);
}
if (getTo_AD_Org_ID() == 0) {
int To_AD_Org_ID = getTo_C_BankAccount().getAD_Org_ID();
if (To_AD_Org_ID > 0)
setTo_AD_Org_ID(To_AD_Org_ID);
}
if (getTo_C_Currency_ID() == 0) {
int To_C_Currency_ID = getTo_C_BankAccount().getC_Currency_ID();
if (To_C_Currency_ID > 0)
setTo_C_Currency_ID(To_C_Currency_ID);
}
if (getFrom_C_BPartner_ID() == 0) {
String sql = "SELECT bp.C_BPartner_ID FROM C_BPartner bp "
+ "WHERE bp.AD_OrgBP_ID IN (SELECT ba.AD_Org_ID FROM C_BankAccount ba WHERE ba.C_BankAccount_ID = ?)) "
+ "AND bp.IsActive = 'Y'";
int C_BPartner_ID = DB.getSQLValue(get_TrxName(), sql, getFrom_C_BankAccount_ID());
if (C_BPartner_ID > 0)
setFrom_C_BPartner_ID(C_BPartner_ID);
}
if (getTo_C_BPartner_ID() == 0) {
String sql = "SELECT bp.C_BPartner_ID FROM C_BPartner bp "
+ "WHERE bp.AD_OrgBP_ID IN (SELECT ba.AD_Org_ID FROM C_BankAccount ba WHERE ba.C_BankAccount_ID = ?)) "
+ "AND bp.IsActive = 'Y'";
int C_BPartner_ID = DB.getSQLValue(get_TrxName(), sql, getTo_C_BankAccount_ID());
if (C_BPartner_ID > 0) {
setTo_C_BPartner_ID(C_BPartner_ID);
} else if (getFrom_AD_Org_ID() == getTo_AD_Org_ID() && getFrom_C_BPartner_ID() > 0) {
setTo_C_BPartner_ID(getFrom_C_BPartner_ID());
}
}
if (getRate().doubleValue() == 0) {
if (getFrom_Amt().compareTo(BigDecimal.ZERO) != 0) {
BigDecimal rate = getTo_Amt().divide(getFrom_Amt(), 12, RoundingMode.HALF_UP);
setRate(rate);
}
} else {
BigDecimal toAmt = getRate().multiply(getFrom_Amt());
Integer To_C_Currency_ID = getTo_C_Currency_ID();
if (To_C_Currency_ID != null && To_C_Currency_ID > 0) {
MCurrency cur = MCurrency.get(p_ctx, To_C_Currency_ID);
if (cur != null)
toAmt = toAmt.setScale(cur.getStdPrecision(), RoundingMode.HALF_UP);
}
setTo_Amt(toAmt);
}
if (getTo_C_Charge_ID() == 0 && getFrom_C_Charge_ID() > 0) {
setTo_C_Charge_ID(getFrom_C_Charge_ID());
}
return true;
}
/** Process Message */
private String m_processMsg = null;
/** Just Prepared Flag */
private boolean m_justPrepared = false;
@Override
public boolean processIt(String action) throws Exception {
m_processMsg = null;
DocumentEngine engine = new DocumentEngine(this, getDocStatus());
return engine.processIt(action, getDocAction());
}
@Override
public boolean unlockIt() {
if (log.isLoggable(Level.INFO)) log.info("unlockIt - " + toString());
setProcessing(false);
return true;
}
@Override
public boolean invalidateIt() {
if (log.isLoggable(Level.INFO)) log.info("invalidateIt - " + toString());
return true;
}
@Override
public String prepareIt() {
if (log.isLoggable(Level.INFO)) log.info(toString());
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE);
if (m_processMsg != null)
return DocAction.STATUS_Invalid;
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);
if (m_processMsg != null)
return DocAction.STATUS_Invalid;
m_justPrepared = true;
return DocAction.STATUS_InProgress;
}
@Override
public boolean approveIt() {
if (log.isLoggable(Level.INFO)) log.info("approveIt - " + toString());
return true;
}
@Override
public boolean rejectIt() {
if (log.isLoggable(Level.INFO)) log.info("rejectIt - " + toString());
return true;
}
@Override
public String completeIt() {
// Re-Check
if (!m_justPrepared)
{
String status = prepareIt();
m_justPrepared = false;
if (!DocAction.STATUS_InProgress.equals(status))
return status;
}
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE);
if (m_processMsg != null)
return DocAction.STATUS_Invalid;
MClientInfo info = MClientInfo.get(getCtx(), getAD_Client_ID(), get_TrxName());
MAcctSchema as = MAcctSchema.get (getCtx(), info.getC_AcctSchema1_ID(), get_TrxName());
MPayment paymentBankFrom = new MPayment(getCtx(), 0, get_TrxName());
paymentBankFrom.setC_BankTransfer_ID(getC_BankTransfer_ID());
paymentBankFrom.setC_BankAccount_ID(getFrom_C_BankAccount_ID());
paymentBankFrom.setAD_Org_ID(getFrom_AD_Org_ID());
paymentBankFrom.setDocumentNo(getDocumentNo());
paymentBankFrom.setDateAcct(getDateAcct());
paymentBankFrom.setDateTrx(getPayDate());
paymentBankFrom.setTenderType(getFrom_TenderType());
paymentBankFrom.setDescription(getDescription());
paymentBankFrom.setC_BPartner_ID(getTo_C_BPartner_ID());
paymentBankFrom.setC_Currency_ID(getFrom_C_Currency_ID());
paymentBankFrom.setPayAmt(getFrom_Amt());
paymentBankFrom.setOverUnderAmt(Env.ZERO);
paymentBankFrom.setC_DocType_ID(false);
paymentBankFrom.setC_Charge_ID(getFrom_C_Charge_ID());
if (as.getC_Currency_ID() != getFrom_C_Currency_ID()) {
paymentBankFrom.setC_ConversionType_ID(getC_ConversionType_ID());
paymentBankFrom.setIsOverrideCurrencyRate(isOverrideCurrencyRate());
if (isOverrideCurrencyRate()) {
paymentBankFrom.setCurrencyRate(getRate());
paymentBankFrom.setConvertedAmt(getTo_Amt());
}
}
paymentBankFrom.saveEx();
if (!paymentBankFrom.processIt(MPayment.DOCACTION_Complete)) {
log.warning("Payment Process Failed: " + paymentBankFrom + " - " + paymentBankFrom.getProcessMsg());
throw new IllegalStateException("Payment Process Failed: " + paymentBankFrom + " - " + paymentBankFrom.getProcessMsg());
}
paymentBankFrom.saveEx();
MPayment paymentBankTo = new MPayment(getCtx(), 0, get_TrxName());
paymentBankTo.setC_BankTransfer_ID(getC_BankTransfer_ID());
paymentBankTo.setC_BankAccount_ID(getTo_C_BankAccount_ID());
paymentBankTo.setAD_Org_ID(getTo_AD_Org_ID());
paymentBankTo.setDocumentNo(getDocumentNo());
paymentBankTo.setDateAcct(getDateAcct());
paymentBankTo.setDateTrx(getPayDate());
paymentBankTo.setTenderType(getTo_TenderType());
paymentBankTo.setDescription(getDescription());
paymentBankTo.setC_BPartner_ID(getFrom_C_BPartner_ID());
paymentBankTo.setC_Currency_ID(getTo_C_Currency_ID());
paymentBankTo.setPayAmt(getTo_Amt());
paymentBankTo.setOverUnderAmt(Env.ZERO);
paymentBankTo.setC_DocType_ID(true);
paymentBankTo.setC_Charge_ID(getTo_C_Charge_ID());
if (as.getC_Currency_ID() != getTo_C_Currency_ID()) {
paymentBankTo.setC_ConversionType_ID(getC_ConversionType_ID());
paymentBankTo.setIsOverrideCurrencyRate(isOverrideCurrencyRate());
if (isOverrideCurrencyRate()) {
double dd = 1 / getRate().doubleValue();
paymentBankTo.setCurrencyRate(BigDecimal.valueOf(dd));
paymentBankTo.setConvertedAmt(getFrom_Amt());
}
}
paymentBankTo.saveEx();
if (!paymentBankTo.processIt(MPayment.DOCACTION_Complete)) {
log.warning("Payment Process Failed: " + paymentBankTo + " - " + paymentBankTo.getProcessMsg());
throw new IllegalStateException("Payment Process Failed: " + paymentBankTo + " - " + paymentBankTo.getProcessMsg());
}
paymentBankTo.saveEx();
//
setProcessed(true);
setDocAction(DOCACTION_Close);
return DocAction.STATUS_Completed;
}
@Override
public boolean voidIt() {
if (log.isLoggable(Level.INFO)) log.info("voidIt - " + toString());
// Before Void
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID);
if (m_processMsg != null)
return false;
int[] ids = MPayment.getAllIDs(MPayment.Table_Name, COLUMNNAME_C_BankTransfer_ID + "=" + getC_BankTransfer_ID(), get_TrxName());
for (int id : ids) {
MPayment payment = new MPayment(getCtx(), id, get_TrxName());
if (!payment.voidIt())
throw new IllegalStateException("Void Payment Failed: " + payment.getProcessMsg());
payment.saveEx();
}
// After Void
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID);
if (m_processMsg != null)
return false;
setProcessed(true);
setDocAction(DOCACTION_None);
return true;
}
@Override
public boolean closeIt() {
if (log.isLoggable(Level.INFO)) log.info("closeIt - " + toString());
// Before Close
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE);
if (m_processMsg != null)
return false;
// After Close
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE);
if (m_processMsg != null)
return false;
return true;
}
@Override
public boolean reverseCorrectIt() {
if (log.isLoggable(Level.INFO)) log.info("reverseCorrectIt - " + toString());
// Before reverseCorrect
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT);
if (m_processMsg != null)
return false;
int[] ids = MPayment.getAllIDs(MPayment.Table_Name, COLUMNNAME_C_BankTransfer_ID + "=" + getC_BankTransfer_ID(), get_TrxName());
for (int id : ids) {
MPayment payment = new MPayment(getCtx(), id, get_TrxName());
if (!payment.reverseCorrectIt())
throw new IllegalStateException("Reverse Payment Failed: " + payment.getProcessMsg());
}
// After reverseCorrect
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);
if (m_processMsg != null)
return false;
return false;
}
@Override
public boolean reverseAccrualIt() {
if (log.isLoggable(Level.INFO)) log.info("reverseAccrualIt - " + toString());
// Before reverseAccrual
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL);
if (m_processMsg != null)
return false;
int[] ids = MPayment.getAllIDs(MPayment.Table_Name, COLUMNNAME_C_BankTransfer_ID + "=" + getC_BankTransfer_ID(), get_TrxName());
for (int id : ids) {
MPayment payment = new MPayment(getCtx(), id, get_TrxName());
if (!payment.reverseAccrualIt())
throw new IllegalStateException("Reverse Payment Failed: " + payment.getProcessMsg());
}
// After reverseAccrual
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL);
if (m_processMsg != null)
return false;
return false;
}
@Override
public boolean reActivateIt() {
if (log.isLoggable(Level.INFO)) log.info("reActivateIt - " + toString());
// Before reActivate
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE);
if (m_processMsg != null)
return false;
// After reActivate
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE);
if (m_processMsg != null)
return false;
return false;
}
@Override
public String getSummary() {
StringBuilder sb = new StringBuilder();
sb.append(getDocumentNo());
// - Description
if (getDescription() != null && getDescription().length() > 0)
sb.append(" - ").append(getDescription());
return sb.toString();
}
@Override
public String getDocumentInfo() {
return Msg.getElement(getCtx(), COLUMNNAME_C_BankTransfer_ID) + " " + getDocumentNo();
}
@Override
public File createPDF() {
return null;
}
@Override
public String getProcessMsg() {
return m_processMsg;
}
@Override
public int getDoc_User_ID() {
return getCreatedBy();
}
@Override
public int getC_Currency_ID() {
return getFrom_C_Currency_ID();
}
@Override
public BigDecimal getApprovalAmt() {
return getFrom_Amt();
}
/**
* String Representation
* @return info
*/
public String toString() {
StringBuilder sb = new StringBuilder ("MBankTransfer[");
sb.append(get_ID()).append("-").append(getDocumentNo());
return sb.toString ();
} // toString
}

View File

@ -88,7 +88,7 @@ public class MPayment extends X_C_Payment
/** /**
* *
*/ */
private static final long serialVersionUID = 3236788845265387613L; private static final long serialVersionUID = -1581098289090430363L;
/** /**
* Get Payments Of BPartner * Get Payments Of BPartner
@ -111,6 +111,24 @@ public class MPayment extends X_C_Payment
return retValue; return retValue;
} // getOfBPartner } // getOfBPartner
/**
* Get Payments of Bank Transfer
* @param ctx context
* @param C_BankTransfer_ID id
* @param trxName transaction
* @return array
*/
public static MPayment[] getOfBankTransfer (Properties ctx, int C_BankTransfer_ID, String trxName)
{
final String whereClause = "C_BankTransfer_ID=?";
List <MPayment> list = new Query(ctx, Table_Name, whereClause, trxName)
.setParameters(C_BankTransfer_ID)
.setOrderBy(COLUMNNAME_C_Payment_ID)
.list();
MPayment[] retValue = new MPayment[list.size()];
list.toArray(retValue);
return retValue;
} // getOfBankTransfer
/************************************************************************** /**************************************************************************
* Default Constructor * Default Constructor
@ -2337,7 +2355,7 @@ public class MPayment extends X_C_Payment
aLine = new MAllocationLine (alloc, allocationAmt.negate(), aLine = new MAllocationLine (alloc, allocationAmt.negate(),
pa.getDiscountAmt().negate(), pa.getWriteOffAmt().negate(), pa.getOverUnderAmt().negate()); pa.getDiscountAmt().negate(), pa.getWriteOffAmt().negate(), pa.getOverUnderAmt().negate());
aLine.setDocInfo(pa.getC_BPartner_ID(), 0, pa.getC_Invoice_ID()); aLine.setDocInfo(pa.getC_BPartner_ID(), 0, pa.getC_Invoice_ID());
aLine.setPaymentInfo(getC_Payment_ID(), 0); aLine.setPaymentInfo(getC_Payment_ID(), 0, getC_BankTransfer_ID());
if (!aLine.save(get_TrxName())) if (!aLine.save(get_TrxName()))
log.warning("P.Allocations - line not saved"); log.warning("P.Allocations - line not saved");
else else
@ -2780,7 +2798,7 @@ public class MPayment extends X_C_Payment
aLine = new MAllocationLine (alloc, reversal.getPayAmt(true), aLine = new MAllocationLine (alloc, reversal.getPayAmt(true),
Env.ZERO, Env.ZERO, Env.ZERO); Env.ZERO, Env.ZERO, Env.ZERO);
aLine.setDocInfo(reversal.getC_BPartner_ID(), 0, 0); aLine.setDocInfo(reversal.getC_BPartner_ID(), 0, 0);
aLine.setPaymentInfo(reversal.getC_Payment_ID(), 0); aLine.setPaymentInfo(reversal.getC_Payment_ID(), 0, reversal.getC_BankTransfer_ID());
if (!aLine.save(get_TrxName())) if (!aLine.save(get_TrxName()))
log.warning("Automatic allocation - reversal line not saved"); log.warning("Automatic allocation - reversal line not saved");

View File

@ -26,7 +26,7 @@ import org.compiere.util.KeyNamePair;
/** Generated Model for C_AllocationLine /** Generated Model for C_AllocationLine
* @author iDempiere (generated) * @author iDempiere (generated)
* @version Release 9 - $Id$ */ * @version Release 10 - $Id$ */
@org.adempiere.base.Model(table="C_AllocationLine") @org.adempiere.base.Model(table="C_AllocationLine")
public class X_C_AllocationLine extends PO implements I_C_AllocationLine, I_Persistent public class X_C_AllocationLine extends PO implements I_C_AllocationLine, I_Persistent
{ {
@ -34,7 +34,7 @@ public class X_C_AllocationLine extends PO implements I_C_AllocationLine, I_Pers
/** /**
* *
*/ */
private static final long serialVersionUID = 20220116L; private static final long serialVersionUID = 20220405L;
/** Standard Constructor */ /** Standard Constructor */
public X_C_AllocationLine (Properties ctx, int C_AllocationLine_ID, String trxName) public X_C_AllocationLine (Properties ctx, int C_AllocationLine_ID, String trxName)
@ -176,6 +176,34 @@ public class X_C_AllocationLine extends PO implements I_C_AllocationLine, I_Pers
return (String)get_Value(COLUMNNAME_C_AllocationLine_UU); return (String)get_Value(COLUMNNAME_C_AllocationLine_UU);
} }
public org.compiere.model.I_C_BankTransfer getC_BankTransfer() throws RuntimeException
{
return (org.compiere.model.I_C_BankTransfer)MTable.get(getCtx(), org.compiere.model.I_C_BankTransfer.Table_ID)
.getPO(getC_BankTransfer_ID(), get_TrxName());
}
/** Set Bank Transfer.
@param C_BankTransfer_ID Bank Transfer
*/
public void setC_BankTransfer_ID (int C_BankTransfer_ID)
{
if (C_BankTransfer_ID < 1)
set_Value (COLUMNNAME_C_BankTransfer_ID, null);
else
set_Value (COLUMNNAME_C_BankTransfer_ID, Integer.valueOf(C_BankTransfer_ID));
}
/** Get Bank Transfer.
@return Bank Transfer
*/
public int getC_BankTransfer_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_BankTransfer_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException
{ {
return (org.compiere.model.I_C_BPartner)MTable.get(getCtx(), org.compiere.model.I_C_BPartner.Table_ID) return (org.compiere.model.I_C_BPartner)MTable.get(getCtx(), org.compiere.model.I_C_BPartner.Table_ID)

View File

@ -0,0 +1,805 @@
/******************************************************************************
* Product: iDempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2012 ComPiere, Inc. All Rights Reserved. *
* This program is free software, you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY, without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program, if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
/** Generated Model - DO NOT CHANGE */
package org.compiere.model;
import java.math.BigDecimal;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.Properties;
import org.compiere.util.Env;
/** Generated Model for C_BankTransfer
* @author iDempiere (generated)
* @version Release 10 - $Id$ */
@org.adempiere.base.Model(table="C_BankTransfer")
public class X_C_BankTransfer extends PO implements I_C_BankTransfer, I_Persistent
{
/**
*
*/
private static final long serialVersionUID = 20220414L;
/** Standard Constructor */
public X_C_BankTransfer (Properties ctx, int C_BankTransfer_ID, String trxName)
{
super (ctx, C_BankTransfer_ID, trxName);
/** if (C_BankTransfer_ID == 0)
{
setC_BankTransfer_ID (0);
setDateAcct (new Timestamp( System.currentTimeMillis() ));
// @#Date@
setDocAction (null);
// CO
setDocStatus (null);
// DR
setDocumentNo (null);
setFrom_AD_Org_ID (0);
setFrom_Amt (Env.ZERO);
setFrom_C_BankAccount_ID (0);
setFrom_C_BPartner_ID (0);
setFrom_C_Charge_ID (0);
setFrom_C_Currency_ID (0);
setFrom_TenderType (null);
// A
setIsOverrideCurrencyRate (false);
// N
setPayDate (new Timestamp( System.currentTimeMillis() ));
// @#Date@
setProcessed (false);
setRate (Env.ZERO);
setTo_AD_Org_ID (0);
setTo_Amt (Env.ZERO);
setTo_C_BankAccount_ID (0);
setTo_C_BPartner_ID (0);
setTo_C_Charge_ID (0);
setTo_C_Currency_ID (0);
setTo_TenderType (null);
// D
} */
}
/** Standard Constructor */
public X_C_BankTransfer (Properties ctx, int C_BankTransfer_ID, String trxName, String ... virtualColumns)
{
super (ctx, C_BankTransfer_ID, trxName, virtualColumns);
/** if (C_BankTransfer_ID == 0)
{
setC_BankTransfer_ID (0);
setDateAcct (new Timestamp( System.currentTimeMillis() ));
// @#Date@
setDocAction (null);
// CO
setDocStatus (null);
// DR
setDocumentNo (null);
setFrom_AD_Org_ID (0);
setFrom_Amt (Env.ZERO);
setFrom_C_BankAccount_ID (0);
setFrom_C_BPartner_ID (0);
setFrom_C_Charge_ID (0);
setFrom_C_Currency_ID (0);
setFrom_TenderType (null);
// A
setIsOverrideCurrencyRate (false);
// N
setPayDate (new Timestamp( System.currentTimeMillis() ));
// @#Date@
setProcessed (false);
setRate (Env.ZERO);
setTo_AD_Org_ID (0);
setTo_Amt (Env.ZERO);
setTo_C_BankAccount_ID (0);
setTo_C_BPartner_ID (0);
setTo_C_Charge_ID (0);
setTo_C_Currency_ID (0);
setTo_TenderType (null);
// D
} */
}
/** Load Constructor */
public X_C_BankTransfer (Properties ctx, ResultSet rs, String trxName)
{
super (ctx, rs, trxName);
}
/** AccessLevel
* @return 1 - Org
*/
protected int get_AccessLevel()
{
return accessLevel.intValue();
}
/** Load Meta Data */
protected POInfo initPO (Properties ctx)
{
POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName());
return poi;
}
public String toString()
{
StringBuilder sb = new StringBuilder ("X_C_BankTransfer[")
.append(get_ID()).append("]");
return sb.toString();
}
/** Set Bank Transfer.
@param C_BankTransfer_ID Bank Transfer
*/
public void setC_BankTransfer_ID (int C_BankTransfer_ID)
{
if (C_BankTransfer_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_BankTransfer_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_BankTransfer_ID, Integer.valueOf(C_BankTransfer_ID));
}
/** Get Bank Transfer.
@return Bank Transfer
*/
public int getC_BankTransfer_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_BankTransfer_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set C_BankTransfer_UU.
@param C_BankTransfer_UU C_BankTransfer_UU
*/
public void setC_BankTransfer_UU (String C_BankTransfer_UU)
{
set_Value (COLUMNNAME_C_BankTransfer_UU, C_BankTransfer_UU);
}
/** Get C_BankTransfer_UU.
@return C_BankTransfer_UU */
public String getC_BankTransfer_UU()
{
return (String)get_Value(COLUMNNAME_C_BankTransfer_UU);
}
public org.compiere.model.I_C_ConversionType getC_ConversionType() throws RuntimeException
{
return (org.compiere.model.I_C_ConversionType)MTable.get(getCtx(), org.compiere.model.I_C_ConversionType.Table_ID)
.getPO(getC_ConversionType_ID(), get_TrxName());
}
/** Set Currency Type.
@param C_ConversionType_ID Currency Conversion Rate Type
*/
public void setC_ConversionType_ID (int C_ConversionType_ID)
{
if (C_ConversionType_ID < 1)
set_Value (COLUMNNAME_C_ConversionType_ID, null);
else
set_Value (COLUMNNAME_C_ConversionType_ID, Integer.valueOf(C_ConversionType_ID));
}
/** Get Currency Type.
@return Currency Conversion Rate Type
*/
public int getC_ConversionType_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_ConversionType_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Account Date.
@param DateAcct Accounting Date
*/
public void setDateAcct (Timestamp DateAcct)
{
set_Value (COLUMNNAME_DateAcct, DateAcct);
}
/** Get Account Date.
@return Accounting Date
*/
public Timestamp getDateAcct()
{
return (Timestamp)get_Value(COLUMNNAME_DateAcct);
}
/** Set Description.
@param Description Optional short description of the record
*/
public void setDescription (String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
/** Get Description.
@return Optional short description of the record
*/
public String getDescription()
{
return (String)get_Value(COLUMNNAME_Description);
}
/** DocAction AD_Reference_ID=135 */
public static final int DOCACTION_AD_Reference_ID=135;
/** &lt;None&gt; = -- */
public static final String DOCACTION_None = "--";
/** Approve = AP */
public static final String DOCACTION_Approve = "AP";
/** Close = CL */
public static final String DOCACTION_Close = "CL";
/** Complete = CO */
public static final String DOCACTION_Complete = "CO";
/** Invalidate = IN */
public static final String DOCACTION_Invalidate = "IN";
/** Post = PO */
public static final String DOCACTION_Post = "PO";
/** Prepare = PR */
public static final String DOCACTION_Prepare = "PR";
/** Reverse - Accrual = RA */
public static final String DOCACTION_Reverse_Accrual = "RA";
/** Reverse - Correct = RC */
public static final String DOCACTION_Reverse_Correct = "RC";
/** Re-activate = RE */
public static final String DOCACTION_Re_Activate = "RE";
/** Reject = RJ */
public static final String DOCACTION_Reject = "RJ";
/** Void = VO */
public static final String DOCACTION_Void = "VO";
/** Wait Complete = WC */
public static final String DOCACTION_WaitComplete = "WC";
/** Unlock = XL */
public static final String DOCACTION_Unlock = "XL";
/** Set Document Action.
@param DocAction The targeted status of the document
*/
public void setDocAction (String DocAction)
{
set_Value (COLUMNNAME_DocAction, DocAction);
}
/** Get Document Action.
@return The targeted status of the document
*/
public String getDocAction()
{
return (String)get_Value(COLUMNNAME_DocAction);
}
/** DocStatus AD_Reference_ID=131 */
public static final int DOCSTATUS_AD_Reference_ID=131;
/** Unknown = ?? */
public static final String DOCSTATUS_Unknown = "??";
/** Approved = AP */
public static final String DOCSTATUS_Approved = "AP";
/** Closed = CL */
public static final String DOCSTATUS_Closed = "CL";
/** Completed = CO */
public static final String DOCSTATUS_Completed = "CO";
/** Drafted = DR */
public static final String DOCSTATUS_Drafted = "DR";
/** Invalid = IN */
public static final String DOCSTATUS_Invalid = "IN";
/** In Progress = IP */
public static final String DOCSTATUS_InProgress = "IP";
/** Not Approved = NA */
public static final String DOCSTATUS_NotApproved = "NA";
/** Reversed = RE */
public static final String DOCSTATUS_Reversed = "RE";
/** Voided = VO */
public static final String DOCSTATUS_Voided = "VO";
/** Waiting Confirmation = WC */
public static final String DOCSTATUS_WaitingConfirmation = "WC";
/** Waiting Payment = WP */
public static final String DOCSTATUS_WaitingPayment = "WP";
/** Set Document Status.
@param DocStatus The current status of the document
*/
public void setDocStatus (String DocStatus)
{
set_Value (COLUMNNAME_DocStatus, DocStatus);
}
/** Get Document Status.
@return The current status of the document
*/
public String getDocStatus()
{
return (String)get_Value(COLUMNNAME_DocStatus);
}
/** Set Document No.
@param DocumentNo Document sequence number of the document
*/
public void setDocumentNo (String DocumentNo)
{
set_Value (COLUMNNAME_DocumentNo, DocumentNo);
}
/** Get Document No.
@return Document sequence number of the document
*/
public String getDocumentNo()
{
return (String)get_Value(COLUMNNAME_DocumentNo);
}
/** Set From Organization.
@param From_AD_Org_ID From Organization
*/
public void setFrom_AD_Org_ID (int From_AD_Org_ID)
{
if (From_AD_Org_ID < 1)
set_Value (COLUMNNAME_From_AD_Org_ID, null);
else
set_Value (COLUMNNAME_From_AD_Org_ID, Integer.valueOf(From_AD_Org_ID));
}
/** Get From Organization.
@return From Organization */
public int getFrom_AD_Org_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_From_AD_Org_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set From Amount.
@param From_Amt From Amount
*/
public void setFrom_Amt (BigDecimal From_Amt)
{
set_Value (COLUMNNAME_From_Amt, From_Amt);
}
/** Get From Amount.
@return From Amount */
public BigDecimal getFrom_Amt()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_From_Amt);
if (bd == null)
return Env.ZERO;
return bd;
}
public org.compiere.model.I_C_BankAccount getFrom_C_BankAccount() throws RuntimeException
{
return (org.compiere.model.I_C_BankAccount)MTable.get(getCtx(), org.compiere.model.I_C_BankAccount.Table_ID)
.getPO(getFrom_C_BankAccount_ID(), get_TrxName());
}
/** Set From Bank Account.
@param From_C_BankAccount_ID From Bank Account
*/
public void setFrom_C_BankAccount_ID (int From_C_BankAccount_ID)
{
if (From_C_BankAccount_ID < 1)
set_Value (COLUMNNAME_From_C_BankAccount_ID, null);
else
set_Value (COLUMNNAME_From_C_BankAccount_ID, Integer.valueOf(From_C_BankAccount_ID));
}
/** Get From Bank Account.
@return From Bank Account */
public int getFrom_C_BankAccount_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_From_C_BankAccount_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_BPartner getFrom_C_BPartner() throws RuntimeException
{
return (org.compiere.model.I_C_BPartner)MTable.get(getCtx(), org.compiere.model.I_C_BPartner.Table_ID)
.getPO(getFrom_C_BPartner_ID(), get_TrxName());
}
/** Set From Business Partner .
@param From_C_BPartner_ID Identifies a Business Partner
*/
public void setFrom_C_BPartner_ID (int From_C_BPartner_ID)
{
if (From_C_BPartner_ID < 1)
set_Value (COLUMNNAME_From_C_BPartner_ID, null);
else
set_Value (COLUMNNAME_From_C_BPartner_ID, Integer.valueOf(From_C_BPartner_ID));
}
/** Get From Business Partner .
@return Identifies a Business Partner
*/
public int getFrom_C_BPartner_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_From_C_BPartner_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_Charge getFrom_C_Charge() throws RuntimeException
{
return (org.compiere.model.I_C_Charge)MTable.get(getCtx(), org.compiere.model.I_C_Charge.Table_ID)
.getPO(getFrom_C_Charge_ID(), get_TrxName());
}
/** Set From Charge.
@param From_C_Charge_ID From Charge
*/
public void setFrom_C_Charge_ID (int From_C_Charge_ID)
{
if (From_C_Charge_ID < 1)
set_Value (COLUMNNAME_From_C_Charge_ID, null);
else
set_Value (COLUMNNAME_From_C_Charge_ID, Integer.valueOf(From_C_Charge_ID));
}
/** Get From Charge.
@return From Charge */
public int getFrom_C_Charge_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_From_C_Charge_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_Currency getFrom_C_Currency() throws RuntimeException
{
return (org.compiere.model.I_C_Currency)MTable.get(getCtx(), org.compiere.model.I_C_Currency.Table_ID)
.getPO(getFrom_C_Currency_ID(), get_TrxName());
}
/** Set From Bank Currency.
@param From_C_Currency_ID From Bank Currency
*/
public void setFrom_C_Currency_ID (int From_C_Currency_ID)
{
if (From_C_Currency_ID < 1)
set_Value (COLUMNNAME_From_C_Currency_ID, null);
else
set_Value (COLUMNNAME_From_C_Currency_ID, Integer.valueOf(From_C_Currency_ID));
}
/** Get From Bank Currency.
@return From Bank Currency */
public int getFrom_C_Currency_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_From_C_Currency_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** From_TenderType AD_Reference_ID=214 */
public static final int FROM_TENDERTYPE_AD_Reference_ID=214;
/** Direct Deposit = A */
public static final String FROM_TENDERTYPE_DirectDeposit = "A";
/** Credit Card = C */
public static final String FROM_TENDERTYPE_CreditCard = "C";
/** Direct Debit = D */
public static final String FROM_TENDERTYPE_DirectDebit = "D";
/** Check = K */
public static final String FROM_TENDERTYPE_Check = "K";
/** Account = T */
public static final String FROM_TENDERTYPE_Account = "T";
/** Cash = X */
public static final String FROM_TENDERTYPE_Cash = "X";
/** Set From Tender Type.
@param From_TenderType From Tender Type
*/
public void setFrom_TenderType (String From_TenderType)
{
set_Value (COLUMNNAME_From_TenderType, From_TenderType);
}
/** Get From Tender Type.
@return From Tender Type */
public String getFrom_TenderType()
{
return (String)get_Value(COLUMNNAME_From_TenderType);
}
/** Set Override Currency Conversion Rate.
@param IsOverrideCurrencyRate Override Currency Conversion Rate
*/
public void setIsOverrideCurrencyRate (boolean IsOverrideCurrencyRate)
{
set_Value (COLUMNNAME_IsOverrideCurrencyRate, Boolean.valueOf(IsOverrideCurrencyRate));
}
/** Get Override Currency Conversion Rate.
@return Override Currency Conversion Rate
*/
public boolean isOverrideCurrencyRate()
{
Object oo = get_Value(COLUMNNAME_IsOverrideCurrencyRate);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Payment date.
@param PayDate Date Payment made
*/
public void setPayDate (Timestamp PayDate)
{
set_Value (COLUMNNAME_PayDate, PayDate);
}
/** Get Payment date.
@return Date Payment made
*/
public Timestamp getPayDate()
{
return (Timestamp)get_Value(COLUMNNAME_PayDate);
}
/** Set Processed.
@param Processed The document has been processed
*/
public void setProcessed (boolean Processed)
{
set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed));
}
/** Get Processed.
@return The document has been processed
*/
public boolean isProcessed()
{
Object oo = get_Value(COLUMNNAME_Processed);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Process Now.
@param Processing Process Now
*/
public void setProcessing (boolean Processing)
{
set_Value (COLUMNNAME_Processing, Boolean.valueOf(Processing));
}
/** Get Process Now.
@return Process Now */
public boolean isProcessing()
{
Object oo = get_Value(COLUMNNAME_Processing);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Rate.
@param Rate Rate or Tax or Exchange
*/
public void setRate (BigDecimal Rate)
{
set_Value (COLUMNNAME_Rate, Rate);
}
/** Get Rate.
@return Rate or Tax or Exchange
*/
public BigDecimal getRate()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Rate);
if (bd == null)
return Env.ZERO;
return bd;
}
/** Set To Organization.
@param To_AD_Org_ID To Organization
*/
public void setTo_AD_Org_ID (int To_AD_Org_ID)
{
if (To_AD_Org_ID < 1)
set_Value (COLUMNNAME_To_AD_Org_ID, null);
else
set_Value (COLUMNNAME_To_AD_Org_ID, Integer.valueOf(To_AD_Org_ID));
}
/** Get To Organization.
@return To Organization */
public int getTo_AD_Org_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_To_AD_Org_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set To Amount.
@param To_Amt To Amount
*/
public void setTo_Amt (BigDecimal To_Amt)
{
set_Value (COLUMNNAME_To_Amt, To_Amt);
}
/** Get To Amount.
@return To Amount */
public BigDecimal getTo_Amt()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_To_Amt);
if (bd == null)
return Env.ZERO;
return bd;
}
public org.compiere.model.I_C_BankAccount getTo_C_BankAccount() throws RuntimeException
{
return (org.compiere.model.I_C_BankAccount)MTable.get(getCtx(), org.compiere.model.I_C_BankAccount.Table_ID)
.getPO(getTo_C_BankAccount_ID(), get_TrxName());
}
/** Set To Bank Account.
@param To_C_BankAccount_ID To Bank Account
*/
public void setTo_C_BankAccount_ID (int To_C_BankAccount_ID)
{
if (To_C_BankAccount_ID < 1)
set_Value (COLUMNNAME_To_C_BankAccount_ID, null);
else
set_Value (COLUMNNAME_To_C_BankAccount_ID, Integer.valueOf(To_C_BankAccount_ID));
}
/** Get To Bank Account.
@return To Bank Account */
public int getTo_C_BankAccount_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_To_C_BankAccount_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_BPartner getTo_C_BPartner() throws RuntimeException
{
return (org.compiere.model.I_C_BPartner)MTable.get(getCtx(), org.compiere.model.I_C_BPartner.Table_ID)
.getPO(getTo_C_BPartner_ID(), get_TrxName());
}
/** Set To Business Partner .
@param To_C_BPartner_ID Identifies a Business Partner
*/
public void setTo_C_BPartner_ID (int To_C_BPartner_ID)
{
if (To_C_BPartner_ID < 1)
set_Value (COLUMNNAME_To_C_BPartner_ID, null);
else
set_Value (COLUMNNAME_To_C_BPartner_ID, Integer.valueOf(To_C_BPartner_ID));
}
/** Get To Business Partner .
@return Identifies a Business Partner
*/
public int getTo_C_BPartner_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_To_C_BPartner_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_Charge getTo_C_Charge() throws RuntimeException
{
return (org.compiere.model.I_C_Charge)MTable.get(getCtx(), org.compiere.model.I_C_Charge.Table_ID)
.getPO(getTo_C_Charge_ID(), get_TrxName());
}
/** Set To Charge.
@param To_C_Charge_ID To Charge
*/
public void setTo_C_Charge_ID (int To_C_Charge_ID)
{
if (To_C_Charge_ID < 1)
set_Value (COLUMNNAME_To_C_Charge_ID, null);
else
set_Value (COLUMNNAME_To_C_Charge_ID, Integer.valueOf(To_C_Charge_ID));
}
/** Get To Charge.
@return To Charge */
public int getTo_C_Charge_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_To_C_Charge_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_Currency getTo_C_Currency() throws RuntimeException
{
return (org.compiere.model.I_C_Currency)MTable.get(getCtx(), org.compiere.model.I_C_Currency.Table_ID)
.getPO(getTo_C_Currency_ID(), get_TrxName());
}
/** Set To Bank Currency.
@param To_C_Currency_ID To Bank Currency
*/
public void setTo_C_Currency_ID (int To_C_Currency_ID)
{
if (To_C_Currency_ID < 1)
set_Value (COLUMNNAME_To_C_Currency_ID, null);
else
set_Value (COLUMNNAME_To_C_Currency_ID, Integer.valueOf(To_C_Currency_ID));
}
/** Get To Bank Currency.
@return To Bank Currency */
public int getTo_C_Currency_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_To_C_Currency_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** To_TenderType AD_Reference_ID=214 */
public static final int TO_TENDERTYPE_AD_Reference_ID=214;
/** Direct Deposit = A */
public static final String TO_TENDERTYPE_DirectDeposit = "A";
/** Credit Card = C */
public static final String TO_TENDERTYPE_CreditCard = "C";
/** Direct Debit = D */
public static final String TO_TENDERTYPE_DirectDebit = "D";
/** Check = K */
public static final String TO_TENDERTYPE_Check = "K";
/** Account = T */
public static final String TO_TENDERTYPE_Account = "T";
/** Cash = X */
public static final String TO_TENDERTYPE_Cash = "X";
/** Set To Tender Type.
@param To_TenderType To Tender Type
*/
public void setTo_TenderType (String To_TenderType)
{
set_Value (COLUMNNAME_To_TenderType, To_TenderType);
}
/** Get To Tender Type.
@return To Tender Type */
public String getTo_TenderType()
{
return (String)get_Value(COLUMNNAME_To_TenderType);
}
}

View File

@ -26,7 +26,7 @@ import org.compiere.util.KeyNamePair;
/** Generated Model for C_Payment /** Generated Model for C_Payment
* @author iDempiere (generated) * @author iDempiere (generated)
* @version Release 9 - $Id$ */ * @version Release 10 - $Id$ */
@org.adempiere.base.Model(table="C_Payment") @org.adempiere.base.Model(table="C_Payment")
public class X_C_Payment extends PO implements I_C_Payment, I_Persistent public class X_C_Payment extends PO implements I_C_Payment, I_Persistent
{ {
@ -34,7 +34,7 @@ public class X_C_Payment extends PO implements I_C_Payment, I_Persistent
/** /**
* *
*/ */
private static final long serialVersionUID = 20220116L; private static final long serialVersionUID = 20220405L;
/** Standard Constructor */ /** Standard Constructor */
public X_C_Payment (Properties ctx, int C_Payment_ID, String trxName) public X_C_Payment (Properties ctx, int C_Payment_ID, String trxName)
@ -394,6 +394,34 @@ public class X_C_Payment extends PO implements I_C_Payment, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public org.compiere.model.I_C_BankTransfer getC_BankTransfer() throws RuntimeException
{
return (org.compiere.model.I_C_BankTransfer)MTable.get(getCtx(), org.compiere.model.I_C_BankTransfer.Table_ID)
.getPO(getC_BankTransfer_ID(), get_TrxName());
}
/** Set Bank Transfer.
@param C_BankTransfer_ID Bank Transfer
*/
public void setC_BankTransfer_ID (int C_BankTransfer_ID)
{
if (C_BankTransfer_ID < 1)
set_Value (COLUMNNAME_C_BankTransfer_ID, null);
else
set_Value (COLUMNNAME_C_BankTransfer_ID, Integer.valueOf(C_BankTransfer_ID));
}
/** Get Bank Transfer.
@return Bank Transfer
*/
public int getC_BankTransfer_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_BankTransfer_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException
{ {
return (org.compiere.model.I_C_BPartner)MTable.get(getCtx(), org.compiere.model.I_C_BPartner.Table_ID) return (org.compiere.model.I_C_BPartner)MTable.get(getCtx(), org.compiere.model.I_C_BPartner.Table_ID)

View File

@ -36,6 +36,7 @@ import org.compiere.acct.Doc;
import org.compiere.model.MAcctSchema; import org.compiere.model.MAcctSchema;
import org.compiere.model.MAllocationHdr; import org.compiere.model.MAllocationHdr;
import org.compiere.model.MBankStatement; import org.compiere.model.MBankStatement;
import org.compiere.model.MBankTransfer;
import org.compiere.model.MCash; import org.compiere.model.MCash;
import org.compiere.model.MClient; import org.compiere.model.MClient;
import org.compiere.model.MColumn; import org.compiere.model.MColumn;
@ -1229,6 +1230,16 @@ public class DocumentEngine implements DocAction
options[index++] = DocumentEngine.ACTION_Void; options[index++] = DocumentEngine.ACTION_Void;
} }
} }
/********************
* Bank Transfer Process
*/
else if (AD_Table_ID == MBankTransfer.Table_ID)
{
if(docStatus.equals(DocumentEngine.STATUS_Completed))
{
options[index++] = DocumentEngine.ACTION_Void;
}
}
if (po instanceof DocOptions) if (po instanceof DocOptions)
index = ((DocOptions) po).customizeValidActions(docStatus, processing, orderType, isSOTrx, index = ((DocOptions) po).customizeValidActions(docStatus, processing, orderType, isSOTrx,

View File

@ -12,6 +12,7 @@
* For the text or an alternative of this public license, you may reach us * * For the text or an alternative of this public license, you may reach us *
* Copyright (C) 2003-2008 e-Evolution,SC. All Rights Reserved. * * Copyright (C) 2003-2008 e-Evolution,SC. All Rights Reserved. *
* Contributor(s): Victor Perez www.e-evolution.com * * Contributor(s): Victor Perez www.e-evolution.com *
* Carlos Ruiz - globalqss - bxservice *
*****************************************************************************/ *****************************************************************************/
package org.eevolution.process; package org.eevolution.process;
@ -20,7 +21,7 @@ import java.math.BigDecimal;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.logging.Level; import java.util.logging.Level;
import org.compiere.model.MBankAccount; import org.compiere.model.MBankTransfer;
import org.compiere.model.MPayment; import org.compiere.model.MPayment;
import org.compiere.process.ProcessInfoParameter; import org.compiere.process.ProcessInfoParameter;
import org.compiere.process.SvrProcess; import org.compiere.process.SvrProcess;
@ -28,13 +29,14 @@ import org.compiere.util.AdempiereUserError;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Msg; import org.compiere.util.Msg;
import org.compiere.util.Util; import org.compiere.util.Util;
/** /**
* Bank Transfer. Generate two Payments entry * Bank Transfer. Generate two Payments entry
* *
* For Bank Transfer From Bank Account "A" * For Bank Transfer From Bank Account "A"
* *
* @author victor.perez@e-evoltuion.com * @author victor.perez@e-evoltuion.com
* @author Carlos Ruiz - globalqss - bxservice - add create bank transfer document
* *
**/ **/
@org.adempiere.base.annotation.Process @org.adempiere.base.annotation.Process
@ -53,6 +55,7 @@ public class BankTransfer extends SvrProcess
private Timestamp p_StatementDate = null; // Date Statement private Timestamp p_StatementDate = null; // Date Statement
private Timestamp p_DateAcct = null; // Date Account private Timestamp p_DateAcct = null; // Date Account
private int p_AD_Org_ID = 0; private int p_AD_Org_ID = 0;
private boolean p_IsCreateBankTransferDoc = false; // Create bank transfer document?
private int m_created = 0; private int m_created = 0;
/** /**
@ -88,6 +91,8 @@ public class BankTransfer extends SvrProcess
p_DateAcct = (Timestamp)para[i].getParameter(); p_DateAcct = (Timestamp)para[i].getParameter();
else if (name.equals("AD_Org_ID")) else if (name.equals("AD_Org_ID"))
p_AD_Org_ID = para[i].getParameterAsInt(); p_AD_Org_ID = para[i].getParameterAsInt();
else if (name.equals("IsCreateBankTransferDoc"))
p_IsCreateBankTransferDoc = para[i].getParameterAsBoolean();
else else
log.log(Level.SEVERE, "prepare - Unknown Parameter: " + name); log.log(Level.SEVERE, "prepare - Unknown Parameter: " + name);
} }
@ -103,7 +108,7 @@ public class BankTransfer extends SvrProcess
if (log.isLoggable(Level.INFO)) log.info("From Bank="+p_From_C_BankAccount_ID+" - To Bank="+p_To_C_BankAccount_ID if (log.isLoggable(Level.INFO)) log.info("From Bank="+p_From_C_BankAccount_ID+" - To Bank="+p_To_C_BankAccount_ID
+ " - C_BPartner_ID="+p_C_BPartner_ID+"- C_Charge_ID= "+p_C_Charge_ID+" - Amount="+p_Amount+" - DocumentNo="+p_DocumentNo + " - C_BPartner_ID="+p_C_BPartner_ID+"- C_Charge_ID= "+p_C_Charge_ID+" - Amount="+p_Amount+" - DocumentNo="+p_DocumentNo
+ " - Description="+p_Description+ " - Statement Date="+p_StatementDate+ + " - Description="+p_Description+ " - Statement Date="+p_StatementDate+
" - Date Account="+p_DateAcct); " - Date Account="+p_DateAcct+ " - Create Bank Transfer Doc="+p_IsCreateBankTransferDoc);
if (p_To_C_BankAccount_ID == 0 || p_From_C_BankAccount_ID == 0) if (p_To_C_BankAccount_ID == 0 || p_From_C_BankAccount_ID == 0)
throw new AdempiereUserError (Msg.parseTranslation(getCtx(), "@FillMandatory@: @To_C_BankAccount_ID@, @From_C_BankAccount_ID@")); throw new AdempiereUserError (Msg.parseTranslation(getCtx(), "@FillMandatory@: @To_C_BankAccount_ID@, @From_C_BankAccount_ID@"));
@ -135,7 +140,10 @@ public class BankTransfer extends SvrProcess
if (p_DateAcct == null) if (p_DateAcct == null)
p_DateAcct = p_StatementDate; p_DateAcct = p_StatementDate;
generateBankTransfer(); if (p_IsCreateBankTransferDoc)
generateBankTransferDoc();
else
generateBankTransfer();
return "@Created@ = " + m_created; return "@Created@ = " + m_created;
} // doIt } // doIt
@ -146,12 +154,8 @@ public class BankTransfer extends SvrProcess
*/ */
private void generateBankTransfer() private void generateBankTransfer()
{ {
MBankAccount mBankFrom = new MBankAccount(getCtx(),p_From_C_BankAccount_ID, get_TrxName());
MBankAccount mBankTo = new MBankAccount(getCtx(),p_To_C_BankAccount_ID, get_TrxName());
MPayment paymentBankFrom = new MPayment(getCtx(), 0 , get_TrxName()); MPayment paymentBankFrom = new MPayment(getCtx(), 0 , get_TrxName());
paymentBankFrom.setC_BankAccount_ID(mBankFrom.getC_BankAccount_ID()); paymentBankFrom.setC_BankAccount_ID(p_From_C_BankAccount_ID);
paymentBankFrom.setAD_Org_ID(p_AD_Org_ID); paymentBankFrom.setAD_Org_ID(p_AD_Org_ID);
if (!Util.isEmpty(p_DocumentNo, true)) if (!Util.isEmpty(p_DocumentNo, true))
paymentBankFrom.setDocumentNo(p_DocumentNo); paymentBankFrom.setDocumentNo(p_DocumentNo);
@ -179,7 +183,7 @@ public class BankTransfer extends SvrProcess
m_created++; m_created++;
MPayment paymentBankTo = new MPayment(getCtx(), 0 , get_TrxName()); MPayment paymentBankTo = new MPayment(getCtx(), 0 , get_TrxName());
paymentBankTo.setC_BankAccount_ID(mBankTo.getC_BankAccount_ID()); paymentBankTo.setC_BankAccount_ID(p_To_C_BankAccount_ID);
paymentBankTo.setAD_Org_ID(p_AD_Org_ID); paymentBankTo.setAD_Org_ID(p_AD_Org_ID);
if (!Util.isEmpty(p_DocumentNo, true)) if (!Util.isEmpty(p_DocumentNo, true))
paymentBankTo.setDocumentNo(p_DocumentNo); paymentBankTo.setDocumentNo(p_DocumentNo);
@ -205,8 +209,58 @@ public class BankTransfer extends SvrProcess
null, paymentBankTo.getC_DocType().getName() + " " + paymentBankTo.getDocumentNo(), null, paymentBankTo.getC_DocType().getName() + " " + paymentBankTo.getDocumentNo(),
MPayment.Table_ID, paymentBankTo.getC_Payment_ID()); MPayment.Table_ID, paymentBankTo.getC_Payment_ID());
m_created++; m_created++;
return;
} // generateBankTransfer } // generateBankTransfer
/**
* Generate Bank Transfer Document
* @throws Exception
*
*/
private void generateBankTransferDoc() throws Exception {
MBankTransfer bt = new MBankTransfer(getCtx(), 0, get_TrxName());
bt.setAD_Org_ID(p_AD_Org_ID);
bt.setDescription(p_Description);
if (!Util.isEmpty(p_DocumentNo, true))
bt.setDocumentNo(p_DocumentNo);
bt.setPayDate(p_StatementDate);
bt.setDateAcct(p_DateAcct);
bt.setFrom_C_BankAccount_ID(p_From_C_BankAccount_ID);
bt.setTo_C_BankAccount_ID(p_To_C_BankAccount_ID);
bt.setFrom_AD_Org_ID(p_AD_Org_ID);
bt.setTo_AD_Org_ID(p_AD_Org_ID);
bt.setFrom_C_Charge_ID(p_C_Charge_ID);
bt.setTo_C_Charge_ID(p_C_Charge_ID);
bt.setFrom_C_Currency_ID(p_C_Currency_ID);
bt.setTo_C_Currency_ID(p_C_Currency_ID);
bt.setFrom_Amt(p_Amount);
bt.setTo_Amt(p_Amount);
bt.setFrom_C_BPartner_ID(p_C_BPartner_ID);
bt.setTo_C_BPartner_ID(p_C_BPartner_ID);
bt.setFrom_TenderType(MPayment.TENDERTYPE_DirectDeposit);
bt.setTo_TenderType(MPayment.TENDERTYPE_DirectDeposit);
if (p_C_ConversionType_ID > 0)
bt.setC_ConversionType_ID(p_C_ConversionType_ID);
bt.setIsOverrideCurrencyRate(false);
bt.saveEx();
if(!bt.processIt(MBankTransfer.DOCACTION_Complete)) {
log.warning("Bank Transfer Process Failed: " + bt + " - " + bt.getProcessMsg());
throw new IllegalStateException("Bank Transfer Process Failed: " + bt + " - " + bt.getProcessMsg());
}
bt.saveEx();
addBufferLog(bt.getC_BankTransfer_ID(), bt.getPayDate(),
null, bt.getDocumentNo(),
MBankTransfer.Table_ID, bt.getC_BankTransfer_ID());
m_created++;
MPayment[] payments = MPayment.getOfBankTransfer(getCtx(), bt.getC_BankTransfer_ID(), get_TrxName());
for (MPayment payment : payments) {
addBufferLog(payment.getC_Payment_ID(), payment.getDateTrx(),
null, payment.getC_DocType().getName() + " " + payment.getDocumentNo(),
MPayment.Table_ID, payment.getC_Payment_ID());
m_created++;
}
} // generateBankTransfer
} // BankTransfer } // BankTransfer