Merge with 15aebb85c791866dcec0bdd70dc75a728e703cbb
This commit is contained in:
commit
5a9ca8fac3
|
@ -0,0 +1,93 @@
|
|||
-- Oct 7, 2012 7:15:57 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_ToolBarButton (Name,ComponentName,Classname,IsCustomization,KeyStroke_KeyCode,KeyStroke_Modifiers,AD_Client_ID,AD_Org_ID,Created,CreatedBy,AD_ToolBarButton_ID,Updated,UpdatedBy,IsActive,AD_ToolBarButton_UU) VALUES ('zk Window - File Import','FileImport','org.idempiere.ui.window','N',0,0,0,0,TO_DATE('2012-10-07 19:15:57','YYYY-MM-DD HH24:MI:SS'),100,1000007,TO_DATE('2012-10-07 19:15:57','YYYY-MM-DD HH24:MI:SS'),100,'Y','afdd17a6-5fd1-411e-8596-5310aa68785f')
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:42:24 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','Field {0} not found',200082,'D','a41866df-ebaf-4ea4-a5be-694b21d076c6','FieldNotFound','Y',TO_DATE('2012-10-25 23:42:22','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-10-25 23:42:22','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:42:24 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200082 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:43:32 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','{0} not a window field',200083,'D','ff2e000e-330e-40d7-8da2-37c558c02fae','NotAWindowField','Y',TO_DATE('2012-10-25 23:43:31','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-10-25 23:43:31','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:43:32 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200083 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:45:01 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','{0} is readonly',200084,'D','914303a5-b1b7-46db-9d3d-953258f1815c','FieldIsReadOnly','Y',TO_DATE('2012-10-25 23:45:00','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-10-25 23:45:00','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:45:01 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200084 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:45:50 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','{0} is not displayed',200085,'D','6406807b-ead4-4bbe-9221-8d3936e77f22','FieldNotDisplayed','Y',TO_DATE('2012-10-25 23:45:49','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-10-25 23:45:49','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:45:50 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200085 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:46:55 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','{0} not resolved = ({1})',200086,'D','bbaa12b8-df37-4a2a-812f-144bbfdef1a9','ForeignNotResolved','Y',TO_DATE('2012-10-25 23:46:53','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-10-25 23:46:53','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:46:55 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200086 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:48:44 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','ERROR: {0} parent cannot be changed',200087,'D','a47623df-6f91-42ad-9172-2459a680c3cf','ParentCannotChange','Y',TO_DATE('2012-10-25 23:48:43','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-10-25 23:48:43','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:48:44 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200087 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:49:42 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','ERROR: {0} not editable',200088,'D','78a73537-7dee-44cc-b66d-76cfba2fb199','FieldNotEditable','Y',TO_DATE('2012-10-25 23:49:40','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-10-25 23:49:40','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:49:42 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200088 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:50:46 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','Successfully saved [{0}]',200089,'D','9d255a1a-e4ea-402b-98ee-ad168603b4c5','SuccessfullySaved','Y',TO_DATE('2012-10-25 23:50:45','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-10-25 23:50:45','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:50:46 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200089 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:50:57 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
UPDATE AD_Message SET MsgType='I',Updated=TO_DATE('2012-10-25 23:50:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200089
|
||||
;
|
||||
|
||||
SELECT register_migration_script('928_IDEMPIERE-454.sql') FROM dual
|
||||
;
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,29 @@
|
|||
-- Position new fixed assets fields according to new grid positioning
|
||||
|
||||
UPDATE AD_Field SET XPosition=3 WHERE ad_field_uu is null and seqnogrid is null AND IsSameLine='Y' AND IsActive='Y';
|
||||
|
||||
UPDATE AD_Field SET XPosition=1 WHERE ad_field_uu is null and seqnogrid is null AND IsSameline='N' AND IsActive='Y';
|
||||
|
||||
UPDATE AD_Field SET ColumnSpan=1 WHERE ad_field_uu is null and seqnogrid is null AND DisplayLength<30 AND IsActive='Y';
|
||||
|
||||
UPDATE AD_Field SET ColumnSpan=3 WHERE ad_field_uu is null and seqnogrid is null AND DisplayLength>=30 AND IsActive='Y';
|
||||
|
||||
UPDATE AD_Field SET NumLines=3 WHERE ad_field_uu is null and seqnogrid is null AND AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Reference_ID=14) AND IsActive='Y';
|
||||
|
||||
UPDATE AD_Field SET NumLines=5 WHERE ad_field_uu is null and seqnogrid is null AND AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Reference_ID=36) AND IsActive='Y';
|
||||
|
||||
UPDATE AD_Field SET NumLines=8 WHERE ad_field_uu is null and seqnogrid is null AND AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Reference_ID=34) AND IsActive='Y';
|
||||
|
||||
UPDATE AD_Field SET ColumnSpan=2 WHERE ad_field_uu is null and seqnogrid is null AND AD_Field_ID IN (SELECT AD_Field_ID FROM AD_Field WHERE XPosition=1 AND ColumnSpan=1 AND IsActive='Y');
|
||||
|
||||
UPDATE AD_Field SET XPosition=4,ColumnSpan=2 WHERE ad_field_uu is null and seqnogrid is null AND AD_Field_ID IN (SELECT AD_Field_ID FROM AD_Field WHERE XPosition=3 AND ColumnSpan=1 AND IsActive='Y');
|
||||
|
||||
UPDATE AD_Field SET XPosition=XPosition+1 WHERE ad_field_uu is null and seqnogrid is null AND AD_Field_ID IN (SELECT fi.AD_Field_ID FROM AD_Field fi INNER JOIN AD_Column c ON (fi.AD_Column_ID=C.AD_Column_ID) WHERE c.AD_Reference_ID in (20,28) AND fi.IsActive='Y');
|
||||
|
||||
UPDATE AD_Field SET ColumnSpan=5 WHERE ad_field_uu is null and seqnogrid is null AND AD_Field_ID IN (SELECT AD_Field_ID FROM AD_Field WHERE XPosition=1 AND ColumnSpan=3 AND IsActive='Y');
|
||||
|
||||
UPDATE AD_Field SET seqnogrid=seqno WHERE ad_field_uu is null and seqnogrid is null;
|
||||
|
||||
SELECT register_migration_script('946_IDEMPIERE-197_FixedAssets.sql') FROM dual
|
||||
;
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
-- Oct 7, 2012 7:15:57 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_ToolBarButton (Name,ComponentName,Classname,IsCustomization,KeyStroke_KeyCode,KeyStroke_Modifiers,AD_Client_ID,AD_Org_ID,Created,CreatedBy,AD_ToolBarButton_ID,Updated,UpdatedBy,IsActive,AD_ToolBarButton_UU) VALUES ('zk Window - File Import','FileImport','org.idempiere.ui.window','N',0,0,0,0,TO_TIMESTAMP('2012-10-07 19:15:57','YYYY-MM-DD HH24:MI:SS'),100,1000007,TO_TIMESTAMP('2012-10-07 19:15:57','YYYY-MM-DD HH24:MI:SS'),100,'Y','afdd17a6-5fd1-411e-8596-5310aa68785f')
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:42:24 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','Field {0} not found',200082,'D','a41866df-ebaf-4ea4-a5be-694b21d076c6','FieldNotFound','Y',TO_TIMESTAMP('2012-10-25 23:42:22','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-10-25 23:42:22','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:42:24 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200082 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:43:32 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','{0} not a window field',200083,'D','ff2e000e-330e-40d7-8da2-37c558c02fae','NotAWindowField','Y',TO_TIMESTAMP('2012-10-25 23:43:31','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-10-25 23:43:31','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:43:32 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200083 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:45:01 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','{0} is readonly',200084,'D','914303a5-b1b7-46db-9d3d-953258f1815c','FieldIsReadOnly','Y',TO_TIMESTAMP('2012-10-25 23:45:00','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-10-25 23:45:00','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:45:01 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200084 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:45:50 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','{0} is not displayed',200085,'D','6406807b-ead4-4bbe-9221-8d3936e77f22','FieldNotDisplayed','Y',TO_TIMESTAMP('2012-10-25 23:45:49','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-10-25 23:45:49','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:45:50 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200085 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:46:55 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','{0} not resolved = ({1})',200086,'D','bbaa12b8-df37-4a2a-812f-144bbfdef1a9','ForeignNotResolved','Y',TO_TIMESTAMP('2012-10-25 23:46:53','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-10-25 23:46:53','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:46:55 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200086 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:48:44 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','ERROR: {0} parent cannot be changed',200087,'D','a47623df-6f91-42ad-9172-2459a680c3cf','ParentCannotChange','Y',TO_TIMESTAMP('2012-10-25 23:48:43','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-10-25 23:48:43','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:48:44 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200087 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:49:42 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','ERROR: {0} not editable',200088,'D','78a73537-7dee-44cc-b66d-76cfba2fb199','FieldNotEditable','Y',TO_TIMESTAMP('2012-10-25 23:49:40','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-10-25 23:49:40','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:49:42 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200088 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:50:46 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','Successfully saved [{0}]',200089,'D','9d255a1a-e4ea-402b-98ee-ad168603b4c5','SuccessfullySaved','Y',TO_TIMESTAMP('2012-10-25 23:50:45','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-10-25 23:50:45','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:50:46 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200089 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Oct 25, 2012 11:50:57 PM COT
|
||||
-- IDEMPIERE-454 Easy import
|
||||
UPDATE AD_Message SET MsgType='I',Updated=TO_TIMESTAMP('2012-10-25 23:50:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200089
|
||||
;
|
||||
|
||||
SELECT register_migration_script('928_IDEMPIERE-454.sql') FROM dual
|
||||
;
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,29 @@
|
|||
-- Position new fixed assets fields according to new grid positioning
|
||||
|
||||
UPDATE AD_Field SET XPosition=3 WHERE ad_field_uu is null and seqnogrid is null AND IsSameLine='Y' AND IsActive='Y';
|
||||
|
||||
UPDATE AD_Field SET XPosition=1 WHERE ad_field_uu is null and seqnogrid is null AND IsSameline='N' AND IsActive='Y';
|
||||
|
||||
UPDATE AD_Field SET ColumnSpan=1 WHERE ad_field_uu is null and seqnogrid is null AND DisplayLength<30 AND IsActive='Y';
|
||||
|
||||
UPDATE AD_Field SET ColumnSpan=3 WHERE ad_field_uu is null and seqnogrid is null AND DisplayLength>=30 AND IsActive='Y';
|
||||
|
||||
UPDATE AD_Field SET NumLines=3 WHERE ad_field_uu is null and seqnogrid is null AND AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Reference_ID=14) AND IsActive='Y';
|
||||
|
||||
UPDATE AD_Field SET NumLines=5 WHERE ad_field_uu is null and seqnogrid is null AND AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Reference_ID=36) AND IsActive='Y';
|
||||
|
||||
UPDATE AD_Field SET NumLines=8 WHERE ad_field_uu is null and seqnogrid is null AND AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Reference_ID=34) AND IsActive='Y';
|
||||
|
||||
UPDATE AD_Field SET ColumnSpan=2 WHERE ad_field_uu is null and seqnogrid is null AND AD_Field_ID IN (SELECT AD_Field_ID FROM AD_Field WHERE XPosition=1 AND ColumnSpan=1 AND IsActive='Y');
|
||||
|
||||
UPDATE AD_Field SET XPosition=4,ColumnSpan=2 WHERE ad_field_uu is null and seqnogrid is null AND AD_Field_ID IN (SELECT AD_Field_ID FROM AD_Field WHERE XPosition=3 AND ColumnSpan=1 AND IsActive='Y');
|
||||
|
||||
UPDATE AD_Field SET XPosition=XPosition+1 WHERE ad_field_uu is null and seqnogrid is null AND AD_Field_ID IN (SELECT fi.AD_Field_ID FROM AD_Field fi INNER JOIN AD_Column c ON (fi.AD_Column_ID=C.AD_Column_ID) WHERE c.AD_Reference_ID in (20,28) AND fi.IsActive='Y');
|
||||
|
||||
UPDATE AD_Field SET ColumnSpan=5 WHERE ad_field_uu is null and seqnogrid is null AND AD_Field_ID IN (SELECT AD_Field_ID FROM AD_Field WHERE XPosition=1 AND ColumnSpan=3 AND IsActive='Y');
|
||||
|
||||
UPDATE AD_Field SET seqnogrid=seqno WHERE ad_field_uu is null and seqnogrid is null;
|
||||
|
||||
SELECT register_migration_script('946_IDEMPIERE-197_FixedAssets.sql') FROM dual
|
||||
;
|
||||
|
|
@ -299,7 +299,7 @@ public class AssetDelivery extends SvrProcess
|
|||
//
|
||||
log.fine((System.currentTimeMillis()-start) + " ms");
|
||||
// success
|
||||
StringBuilder msgreturn = new StringBuilder().append(user.getEMail()).append(" - ").append(asset.getProductVersionNo());
|
||||
StringBuilder msgreturn = new StringBuilder().append(user.getEMail()).append(" - ").append(asset.getVersionNo());
|
||||
return msgreturn.toString();
|
||||
} // deliverIt
|
||||
|
||||
|
|
|
@ -166,7 +166,6 @@ Export-Package: bsh,
|
|||
org.codehaus.groovy.vmplugin.v5,
|
||||
org.codehaus.groovy.vmplugin.v6,
|
||||
org.compiere,
|
||||
org.compiere.FA,
|
||||
org.compiere.acct,
|
||||
org.compiere.cm,
|
||||
org.compiere.db,
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
<extension-point id="org.adempiere.base.IModelFactory" name="Model Factory" schema="schema/org.adempiere.base.IModelFactory.exsd"/>
|
||||
<extension-point id="org.adempiere.base.IDocFactory" name="Financial Document Factory" schema="schema/org.adempiere.base.IDocFactory.exsd"/>
|
||||
<extension-point id="org.adempiere.base.IGridTabExporter" name="Grid data export extension" schema="schema/org.adempiere.base.IGridTabExporter.exsd"/>
|
||||
<extension-point id="org.adempiere.base.IGridTabImporter" name="Grid data import extension" schema="schema/org.adempiere.base.IGridTabImporter.exsd"/>
|
||||
<extension-point id="org.compiere.model.PaymentProcessor" name="Payment Processor" schema="schema/org.compiere.model.PaymentProcessor.exsd"/>
|
||||
<extension-point id="org.compiere.model.Callout" name="Callout" schema="schema/org.compiere.model.Callout.exsd"/>
|
||||
<extension
|
||||
|
@ -51,6 +52,15 @@
|
|||
priority="0">
|
||||
</exporter>
|
||||
</extension>
|
||||
<extension
|
||||
id="org.adempiere.impexp.GridTabCSVImporter"
|
||||
name="Grid data CSV importer"
|
||||
point="org.adempiere.base.IGridTabImporter">
|
||||
<importer
|
||||
class="org.adempiere.impexp.GridTabCSVImporter"
|
||||
priority="0">
|
||||
</importer>
|
||||
</extension>
|
||||
<extension
|
||||
id="org.adempiere.base.ModelGeneratorApplication"
|
||||
name="Model Generator"
|
||||
|
|
|
@ -0,0 +1,141 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- Schema file written by PDE -->
|
||||
<schema targetNamespace="org.adempiere.base" xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.schema plugin="org.adempiere.base" id="org.adempiere.base.IGridTabImporter" name="Grid data import extension"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
Extension point to provide import service for data from that is generated from the AD_Window definition. The client in use ( swing or zk ) is responsible to present all available import extension to user to pick the one to use.
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<element name="extension">
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.element />
|
||||
</appinfo>
|
||||
</annotation>
|
||||
<complexType>
|
||||
<choice>
|
||||
<element ref="importer"/>
|
||||
</choice>
|
||||
<attribute name="point" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="id" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute translatable="true"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="importer">
|
||||
<complexType>
|
||||
<attribute name="priority" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
numeric priority value, higher value is of higher priority.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="class" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Implementation class name for the org.adempiere.base.IGridTabImporter interface
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute kind="java" basedOn=":org.adempiere.base.IGridTabImporter"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="since"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
1.0.0
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="examples"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
<pre>
|
||||
<extension
|
||||
id="org.adempiere.impexp.GridTabCSVImporter"
|
||||
name="Grid data CSV importer"
|
||||
point="org.adempiere.base.IGridTabImporter">
|
||||
<importer
|
||||
class="org.adempiere.impexp.GridTabCSVImporter"
|
||||
priority="0">
|
||||
</importer>
|
||||
</extension>
|
||||
</pre>
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="apiinfo"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
The class attribute must represent an implementor of org.adempiere.base.IGridTabImporter
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="implementation"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
CSV import in org.adempiere.base
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="copyright"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
This file is part of iDempiere ERP http://www.idempiere.org.
|
||||
|
||||
Copyright (C) Carlos Ruiz
|
||||
Copyright (C) Trek Global
|
||||
|
||||
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.
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
</schema>
|
|
@ -19,6 +19,12 @@
|
|||
*****************************************************************************/
|
||||
package org.adempiere.base;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.adempiere.base.equinox.StackTraceCommand;
|
||||
import org.compiere.Adempiere;
|
||||
import org.eclipse.osgi.framework.console.CommandProvider;
|
||||
|
@ -44,9 +50,51 @@ public class BaseActivator implements BundleActivator {
|
|||
*/
|
||||
@Override
|
||||
public void start(BundleContext context) throws Exception {
|
||||
//Load Init Properties
|
||||
loadInitProperties(Adempiere.getAdempiereHome());
|
||||
bundleContext = context;
|
||||
context.registerService(CommandProvider.class.getName(), new StackTraceCommand(), null);
|
||||
}
|
||||
|
||||
/*
|
||||
* Load idempiereInit.properties into the system.
|
||||
*/
|
||||
private void loadInitProperties(String filePath) {
|
||||
|
||||
Properties props = new Properties();
|
||||
String fileName = filePath+ File.separator+"idempiereInit.properties";
|
||||
File env = new File (fileName);
|
||||
boolean loadOk = true;
|
||||
if (env.exists() && env.isFile() && env.canRead())
|
||||
{
|
||||
FileInputStream fis = null;
|
||||
try
|
||||
{
|
||||
fis = new FileInputStream(env);
|
||||
props.load(fis);
|
||||
}catch (Exception e){
|
||||
loadOk = false;
|
||||
System.err.println("Exception while loading idempiereInit.properties: "+ e.toString());
|
||||
}finally{
|
||||
try {
|
||||
fis.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (loadOk) {
|
||||
String key = null;
|
||||
String value =null;
|
||||
Enumeration<?> enumeration = props.propertyNames();
|
||||
while (enumeration.hasMoreElements()) {
|
||||
key = (String) enumeration.nextElement();
|
||||
value = props.getProperty(key);
|
||||
System.setProperty(key,value) ;
|
||||
//System.out.println("Loaded Key: "+ key + "- Value :"+value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
|
||||
|
|
|
@ -48,4 +48,9 @@ public interface IGridTabExporter {
|
|||
* @return mime type
|
||||
*/
|
||||
public String getContentType();
|
||||
|
||||
/**
|
||||
* @return suggested file name
|
||||
*/
|
||||
public String getSuggestedFileName(GridTab gridTab);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
/******************************************************************************
|
||||
* Product: iDempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 2012 Trek Global *
|
||||
* Copyright (C) 2012 Carlos Ruiz *
|
||||
* 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. *
|
||||
*****************************************************************************/
|
||||
package org.adempiere.base;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.List;
|
||||
|
||||
import org.compiere.model.GridTab;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Carlos Ruiz
|
||||
*
|
||||
*/
|
||||
public interface IGridTabImporter {
|
||||
|
||||
/**
|
||||
* export gridTab data to file
|
||||
* @param gridTab
|
||||
* @param childs
|
||||
* @param filestream
|
||||
* @param charset
|
||||
*/
|
||||
public File fileImport(GridTab gridTab, List<GridTab> childs, InputStream filestream, Charset charset);
|
||||
|
||||
/**
|
||||
* @return file extension
|
||||
*/
|
||||
public String getFileExtension();
|
||||
|
||||
/**
|
||||
* @return description for file extension
|
||||
*/
|
||||
public String getFileExtensionLabel();
|
||||
|
||||
/**
|
||||
* @return mime type
|
||||
*/
|
||||
public String getContentType();
|
||||
|
||||
/**
|
||||
* @return suggested file name
|
||||
*/
|
||||
public String getSuggestedFileName(GridTab gridTab);
|
||||
}
|
|
@ -17,6 +17,7 @@ package org.adempiere.impexp;
|
|||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
|
@ -25,6 +26,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import org.adempiere.base.IGridTabExporter;
|
||||
import org.adempiere.exceptions.AdempiereException;
|
||||
import org.adempiere.model.MTabCustomization;
|
||||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
|
@ -77,7 +79,9 @@ public class GridTabCSVExporter implements IGridTabExporter
|
|||
} else if (DisplayType.Time == column.getAD_Reference_ID()) {
|
||||
procArray.add(new Optional(new FmtDate("DisplayType.DEFAULT_TIME_FORMAT")));
|
||||
} else if (DisplayType.Integer == column.getAD_Reference_ID() || DisplayType.isNumeric(column.getAD_Reference_ID())) {
|
||||
procArray.add(new Optional(new FmtNumber(DisplayType.getNumberFormat(column.getAD_Reference_ID()))));
|
||||
DecimalFormat nf = DisplayType.getNumberFormat(column.getAD_Reference_ID());
|
||||
nf.setGroupingUsed(false);
|
||||
procArray.add(new Optional(new FmtNumber(nf)));
|
||||
} else if (DisplayType.YesNo == column.getAD_Reference_ID()) {
|
||||
procArray.add(new Optional(new FmtBool("Y", "N")));
|
||||
} else { // lookups and text
|
||||
|
@ -110,7 +114,7 @@ public class GridTabCSVExporter implements IGridTabExporter
|
|||
mapWriter.write(row, header, processors);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
throw new AdempiereException(e);
|
||||
} finally {
|
||||
if (mapWriter != null) {
|
||||
try {
|
||||
|
@ -125,7 +129,7 @@ public class GridTabCSVExporter implements IGridTabExporter
|
|||
|
||||
private Object resolveValue(GridTab gridTab, MTable table, MColumn column, int i, String headName) {
|
||||
Object value = null;
|
||||
if (headName.contains("[") && headName.endsWith("]")) {
|
||||
if (headName.indexOf("[") >= 0 && headName.endsWith("]")) {
|
||||
String foreignTable = column.getReferenceTableName();
|
||||
Object idO = gridTab.getValue(i, column.getColumnName());
|
||||
if (idO != null) {
|
||||
|
@ -157,12 +161,14 @@ public class GridTabCSVExporter implements IGridTabExporter
|
|||
String foreignTable = column.getReferenceTableName();
|
||||
if ( ! ("AD_Language".equals(foreignTable) || "AD_EntityType".equals(foreignTable))) {
|
||||
MTable fTable = MTable.get(Env.getCtx(), foreignTable);
|
||||
// Hardcoded / do not check for Value on AD_Org and AD_User, must use name for these two tables
|
||||
if (! ("AD_Org".equals(foreignTable) || "AD_User".equals(foreignTable))
|
||||
// Hardcoded / do not check for Value on AD_Org, AD_User and AD_Ref_List, must use name for these two tables
|
||||
if (! ("AD_Org".equals(foreignTable) || "AD_User".equals(foreignTable) || "AD_Ref_List".equals(foreignTable))
|
||||
&& fTable.getColumn("Value") != null) {
|
||||
name.append("[Value]"); // fully qualified
|
||||
} else if (fTable.getColumn("Name") != null) {
|
||||
name.append("[Name]");
|
||||
} else if (fTable.getColumn("DocumentNo") != null) {
|
||||
name.append("[DocumentNo]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -197,16 +203,16 @@ public class GridTabCSVExporter implements IGridTabExporter
|
|||
String[] customComponent = custom.split(";");
|
||||
String[] fieldIds = customComponent[0].split("[,]");
|
||||
List<GridField> fieldList = new ArrayList<GridField>();
|
||||
for(String fieldIdStr : fieldIds)
|
||||
for (String fieldIdStr : fieldIds)
|
||||
{
|
||||
fieldIdStr = fieldIdStr.trim();
|
||||
if (fieldIdStr.length() == 0) continue;
|
||||
int AD_Field_ID = Integer.parseInt(fieldIdStr);
|
||||
for(GridField gridField : tmpFields)
|
||||
for (GridField gridField : tmpFields)
|
||||
{
|
||||
if (gridField.getAD_Field_ID() == AD_Field_ID)
|
||||
{
|
||||
if(gridField.isDisplayedGrid())
|
||||
if (!gridField.isReadOnly() && gridField.isDisplayedGrid())
|
||||
fieldList.add(gridField);
|
||||
|
||||
break;
|
||||
|
@ -219,9 +225,11 @@ public class GridTabCSVExporter implements IGridTabExporter
|
|||
{
|
||||
ArrayList<GridField> gridFieldList = new ArrayList<GridField>();
|
||||
|
||||
for(GridField field:tmpFields)
|
||||
for (GridField field:tmpFields)
|
||||
{
|
||||
if(field.isDisplayedGrid())
|
||||
if ("AD_Client_ID".equals(field.getColumnName()))
|
||||
continue;
|
||||
if (field.isParentValue() || (!field.isReadOnly() && field.isDisplayedGrid()))
|
||||
gridFieldList.add(field);
|
||||
}
|
||||
|
||||
|
@ -238,19 +246,9 @@ public class GridTabCSVExporter implements IGridTabExporter
|
|||
return gridFields;
|
||||
}
|
||||
|
||||
public boolean isColumnPrinted(GridTab tab, int col)
|
||||
{
|
||||
GridField field = tab.getField(col);
|
||||
// field not displayed
|
||||
if (!field.isDisplayed())
|
||||
return false;
|
||||
// field encrypted
|
||||
if (field.isEncrypted())
|
||||
return false;
|
||||
// button without a reference value
|
||||
if (field.getDisplayType() == DisplayType.Button && field.getAD_Reference_Value_ID() == 0)
|
||||
return false;
|
||||
return true;
|
||||
@Override
|
||||
public String getSuggestedFileName(GridTab gridTab) {
|
||||
return "Export_" + gridTab.getTableName() + "." + getFileExtension();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,433 @@
|
|||
/******************************************************************************
|
||||
* Product: iDempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 2012 Carlos Ruiz *
|
||||
* Copyright (C) 2012 Trek Global *
|
||||
* 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. *
|
||||
*****************************************************************************/
|
||||
package org.adempiere.impexp;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.Charset;
|
||||
import java.sql.Timestamp;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.adempiere.base.IGridTabImporter;
|
||||
import org.adempiere.exceptions.AdempiereException;
|
||||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.MColumn;
|
||||
import org.compiere.model.MTable;
|
||||
import org.compiere.tools.FileUtil;
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.DisplayType;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.Language;
|
||||
import org.compiere.util.Msg;
|
||||
import org.compiere.util.Trx;
|
||||
import org.compiere.util.ValueNamePair;
|
||||
import org.supercsv.cellprocessor.Optional;
|
||||
import org.supercsv.cellprocessor.ParseBigDecimal;
|
||||
import org.supercsv.cellprocessor.ParseBool;
|
||||
import org.supercsv.cellprocessor.ParseDate;
|
||||
import org.supercsv.cellprocessor.ParseInt;
|
||||
import org.supercsv.cellprocessor.constraint.StrMinMax;
|
||||
import org.supercsv.cellprocessor.constraint.StrNotNullOrEmpty;
|
||||
import org.supercsv.cellprocessor.ift.CellProcessor;
|
||||
import org.supercsv.exception.SuperCsvCellProcessorException;
|
||||
import org.supercsv.io.CsvMapReader;
|
||||
import org.supercsv.io.ICsvMapReader;
|
||||
import org.supercsv.prefs.CsvPreference;
|
||||
|
||||
/**
|
||||
* CSV Importer for GridTab
|
||||
* @author Carlos Ruiz
|
||||
*/
|
||||
public class GridTabCSVImporter implements IGridTabImporter
|
||||
{
|
||||
private static final String ERROR_HEADER = "_ERROR_";
|
||||
private static final String LOG_HEADER = "_LOG_";
|
||||
/** Logger */
|
||||
private static CLogger log = CLogger.getCLogger(GridTabCSVImporter.class);
|
||||
boolean m_isError = false;
|
||||
|
||||
public File fileImport(GridTab gridTab, List<GridTab> childs, InputStream filestream, Charset charset) {
|
||||
|
||||
ICsvMapReader mapReader = null;
|
||||
File errFile = null;
|
||||
File logFile = null;
|
||||
FileWriter errFileW = null;
|
||||
FileWriter logFileW = null;
|
||||
CsvPreference csvpref = CsvPreference.STANDARD_PREFERENCE;
|
||||
String delimiter = String.valueOf((char) csvpref.getDelimiterChar());
|
||||
String quoteChar = String.valueOf((char) csvpref.getQuoteChar());
|
||||
try {
|
||||
String errFileName = FileUtil.getTempMailName("Import_" + gridTab.getTableName(), "_err.csv");
|
||||
errFile = new File(errFileName);
|
||||
errFileW = new FileWriter(errFile, false);
|
||||
mapReader = new CsvMapReader(new InputStreamReader(filestream), csvpref);
|
||||
|
||||
String[] header = mapReader.getHeader(true);
|
||||
List<CellProcessor> readProcArray = new ArrayList<CellProcessor>();
|
||||
for (int idx = 0; idx < header.length; idx++) {
|
||||
String headName = header[idx];
|
||||
if (headName.equals(ERROR_HEADER) || headName.equals(LOG_HEADER)) {
|
||||
header[idx] = null;
|
||||
readProcArray.add(null);
|
||||
continue;
|
||||
}
|
||||
String columnName = headName;
|
||||
boolean isForeign = headName.indexOf("[") > 0 && headName.endsWith("]");
|
||||
if (isForeign) {
|
||||
int end = headName.indexOf("[");
|
||||
columnName = headName.substring(0, end);
|
||||
}
|
||||
GridField field = gridTab.getField(columnName);
|
||||
if (field == null) {
|
||||
throw new AdempiereException(Msg.getMsg(Env.getCtx(), "FieldNotFound", new Object[] {columnName}));
|
||||
}
|
||||
MColumn column = MColumn.get(Env.getCtx(), field.getAD_Column_ID());
|
||||
// TODO: List columns can use RequireSubStr constraint
|
||||
if (column.isMandatory()) {
|
||||
if (DisplayType.Date == column.getAD_Reference_ID()) {
|
||||
readProcArray.add(new ParseDate(DisplayType.DEFAULT_DATE_FORMAT));
|
||||
} else if (DisplayType.DateTime == column.getAD_Reference_ID()) {
|
||||
readProcArray.add(new ParseDate(DisplayType.DEFAULT_TIMESTAMP_FORMAT));
|
||||
} else if (DisplayType.Time == column.getAD_Reference_ID()) {
|
||||
readProcArray.add(new ParseDate("DisplayType.DEFAULT_TIME_FORMAT"));
|
||||
} else if (DisplayType.Integer == column.getAD_Reference_ID()) {
|
||||
readProcArray.add(new ParseInt());
|
||||
} else if (DisplayType.isNumeric(column.getAD_Reference_ID())) {
|
||||
readProcArray.add(new ParseBigDecimal(new DecimalFormatSymbols(Language.getLoginLanguage().getLocale())));
|
||||
} else if (DisplayType.YesNo == column.getAD_Reference_ID()) {
|
||||
readProcArray.add(new ParseBool("y", "n"));
|
||||
} else if (DisplayType.isText(column.getAD_Reference_ID())) {
|
||||
readProcArray.add(new StrMinMax(1, column.getFieldLength()));
|
||||
} else { // mandatory lookups
|
||||
readProcArray.add(new StrNotNullOrEmpty());
|
||||
}
|
||||
} else {
|
||||
if (DisplayType.Date == column.getAD_Reference_ID()) {
|
||||
readProcArray.add(new Optional(new ParseDate(DisplayType.DEFAULT_DATE_FORMAT)));
|
||||
} else if (DisplayType.DateTime == column.getAD_Reference_ID()) {
|
||||
readProcArray.add(new Optional(new ParseDate(DisplayType.DEFAULT_TIMESTAMP_FORMAT)));
|
||||
} else if (DisplayType.Time == column.getAD_Reference_ID()) {
|
||||
readProcArray.add(new Optional(new ParseDate("DisplayType.DEFAULT_TIME_FORMAT")));
|
||||
} else if (DisplayType.Integer == column.getAD_Reference_ID()) {
|
||||
readProcArray.add(new Optional(new ParseInt()));
|
||||
} else if (DisplayType.isNumeric(column.getAD_Reference_ID())) {
|
||||
readProcArray.add(new Optional(new ParseBigDecimal(new DecimalFormatSymbols(Language.getLoginLanguage().getLocale()))));
|
||||
} else if (DisplayType.YesNo == column.getAD_Reference_ID()) {
|
||||
readProcArray.add(new Optional(new ParseBool("y", "n")));
|
||||
} else if (DisplayType.isText(column.getAD_Reference_ID())) {
|
||||
readProcArray.add(new Optional(new StrMinMax(1, column.getFieldLength())));
|
||||
} else { // optional lookups and text
|
||||
readProcArray.add(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
CellProcessor[] processors = readProcArray.toArray(new CellProcessor[readProcArray.size()]);
|
||||
|
||||
m_isError = false;
|
||||
// write the header
|
||||
String rawHeader = mapReader.getUntokenizedRow();
|
||||
errFileW.write(rawHeader + delimiter + ERROR_HEADER + "\n");
|
||||
|
||||
List<Map<String, Object>> data = new ArrayList<Map<String, Object>>();
|
||||
List<String> rawData = new ArrayList<String>();
|
||||
// pre-process to check for errors
|
||||
while (true) {
|
||||
Map<String, Object> map = null;
|
||||
boolean isLineError = false;
|
||||
StringBuilder errMsg = new StringBuilder();
|
||||
try {
|
||||
map = mapReader.read(header, processors);
|
||||
} catch (SuperCsvCellProcessorException e) {
|
||||
int idx = e.getCsvContext().getColumnNumber() - 1;
|
||||
errMsg.append(header[idx]).append(": ").append(e.getMessage());
|
||||
isLineError = true;
|
||||
}
|
||||
String rawLine = mapReader.getUntokenizedRow();
|
||||
if (! isLineError) {
|
||||
if (map == null)
|
||||
break;
|
||||
for (Entry<String, Object> set : map.entrySet()) {
|
||||
StringBuilder lineError = new StringBuilder();
|
||||
String headName = set.getKey();
|
||||
Object value = set.getValue();
|
||||
log.fine("Setting " + headName + " to " + value);
|
||||
|
||||
String columnName = headName;
|
||||
boolean isForeign = headName.indexOf("[") > 0 && headName.endsWith("]");
|
||||
String foreignColumn = null;
|
||||
if (isForeign) {
|
||||
int end = headName.indexOf("[");
|
||||
columnName = headName.substring(0, end);
|
||||
int startf = headName.indexOf("[")+1;
|
||||
int endf = headName.length()-1;
|
||||
foreignColumn = headName.substring(startf, endf);
|
||||
}
|
||||
GridField field = gridTab.getField(columnName);
|
||||
if (field == null) {
|
||||
lineError.append(Msg.getMsg(Env.getCtx(), "NotAWindowField", new Object[] {headName}));
|
||||
isLineError = true;
|
||||
}
|
||||
if (!isLineError && field.isReadOnly() && !field.isParentValue()) {
|
||||
lineError.append(Msg.getMsg(Env.getCtx(), "FieldIsReadOnly", new Object[] {headName}));
|
||||
isLineError = true;
|
||||
}
|
||||
if (!isLineError && ! ( field.isDisplayed() || field.isDisplayedGrid() )) {
|
||||
lineError.append(Msg.getMsg(Env.getCtx(), "FieldNotDisplayed", new Object[] {headName}));
|
||||
isLineError = true;
|
||||
}
|
||||
if (!isLineError) {
|
||||
MColumn column = MColumn.get(Env.getCtx(), field.getAD_Column_ID());
|
||||
if (isForeign) {
|
||||
String foreignTable = column.getReferenceTableName();
|
||||
String idS = null;
|
||||
int id = -1;
|
||||
if ("AD_Ref_List".equals(foreignTable)) {
|
||||
idS = resolveForeignList(column, foreignColumn, value);
|
||||
} else {
|
||||
id = resolveForeign(foreignTable, foreignColumn, value);
|
||||
}
|
||||
if (idS == null && id < 0) {
|
||||
lineError.append(Msg.getMsg(Env.getCtx(), "ForeignNotResolved", new Object[] {headName, value.toString()}));
|
||||
isLineError = true;
|
||||
}
|
||||
} else {
|
||||
// no validation here
|
||||
// TODO: we could validate length of string or min/max
|
||||
}
|
||||
}
|
||||
if (isLineError && lineError.length() > 0) {
|
||||
if (errMsg.length() > 0)
|
||||
errMsg.append(" / ");
|
||||
errMsg.append(lineError);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isLineError && ! m_isError)
|
||||
m_isError = true;
|
||||
if (!m_isError) {
|
||||
data.add(map);
|
||||
rawData.add(rawLine);
|
||||
}
|
||||
// write
|
||||
rawLine = rawLine + delimiter + quoteChar + errMsg.toString().replaceAll(quoteChar, "") + quoteChar + "\n";
|
||||
errFileW.write(rawLine);
|
||||
}
|
||||
|
||||
if (!m_isError) {
|
||||
String logFileName = FileUtil.getTempMailName("Import_" + gridTab.getTableName(), "_log.csv");
|
||||
logFile = new File(logFileName);
|
||||
logFileW = new FileWriter(logFile, false);
|
||||
|
||||
// write the header
|
||||
logFileW.write(rawHeader + delimiter + LOG_HEADER + "\n");
|
||||
|
||||
// no errors found - then process
|
||||
for (int idx = 0; idx < data.size(); idx++) {
|
||||
String rawLine = rawData.get(idx);
|
||||
String trxName = null;
|
||||
String logMsg = null;
|
||||
Trx trx = null;
|
||||
boolean error = false;
|
||||
try {
|
||||
trxName = "Import_" + gridTab.getTableName() + "_" + UUID.randomUUID();
|
||||
trx = Trx.get(trxName, true);
|
||||
Map<String, Object> map = data.get(idx);
|
||||
gridTab.getTableModel().setImportingMode(true, trxName);
|
||||
gridTab.dataNew(false);
|
||||
for (String headName : header) {
|
||||
if (headName == null)
|
||||
continue;
|
||||
Object value = map.get(headName);
|
||||
|
||||
String columnName = headName;
|
||||
boolean isForeign = headName.indexOf("[") > 0 && headName.endsWith("]");
|
||||
String foreignColumn = null;
|
||||
if (isForeign) {
|
||||
int end = headName.indexOf("[");
|
||||
columnName = headName.substring(0, end);
|
||||
int startf = headName.indexOf("[")+1;
|
||||
int endf = headName.length()-1;
|
||||
foreignColumn = headName.substring(startf, endf);
|
||||
}
|
||||
GridField field = gridTab.getField(columnName);
|
||||
if (field.isParentValue())
|
||||
continue;
|
||||
MColumn column = MColumn.get(Env.getCtx(), field.getAD_Column_ID());
|
||||
Object setValue = null;
|
||||
if (isForeign) {
|
||||
String foreignTable = column.getReferenceTableName();
|
||||
if ("AD_Ref_List".equals(foreignTable)) {
|
||||
String idS = resolveForeignList(column, foreignColumn, value);
|
||||
setValue = idS;
|
||||
} else {
|
||||
int id = resolveForeign(foreignTable, foreignColumn, value);
|
||||
setValue = id;
|
||||
if (field.isParentValue()) {
|
||||
int actualId = (Integer) field.getValue();
|
||||
if (actualId != id) {
|
||||
logMsg = Msg.getMsg(Env.getCtx(), "ParentCannotChange", new Object[] {headName});
|
||||
error = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (value != null) {
|
||||
if (value != null && value instanceof java.util.Date)
|
||||
value = new Timestamp(((java.util.Date)value).getTime());
|
||||
setValue = value;
|
||||
}
|
||||
}
|
||||
if (value != null) {
|
||||
if (field.isEditable(true)) {
|
||||
gridTab.setValue(columnName, setValue);
|
||||
} else {
|
||||
logMsg = Msg.getMsg(Env.getCtx(), "FieldNotEditable", new Object[] {headName});
|
||||
error = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (! error) {
|
||||
if (gridTab.dataSave(false)) {
|
||||
logMsg = Msg.getMsg(Env.getCtx(), "SuccessfullySaved", new Object[] {gridTab.getTableModel().getKeyID(gridTab.getCurrentRow())});
|
||||
} else {
|
||||
error = true;
|
||||
ValueNamePair ppE = CLogger.retrieveWarning();
|
||||
String info = null;
|
||||
if (ppE != null)
|
||||
info = ppE.getName();
|
||||
if (info == null)
|
||||
info = "";
|
||||
logMsg = Msg.getMsg(Env.getCtx(), "Error") + " " + Msg.getMsg(Env.getCtx(), "SaveError") + " (" + info + ")";
|
||||
gridTab.dataIgnore();
|
||||
}
|
||||
} else {
|
||||
gridTab.dataIgnore();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logMsg = Msg.getMsg(Env.getCtx(), "Error") + " " + e.getLocalizedMessage();
|
||||
error = true;
|
||||
} finally {
|
||||
if (trx != null) {
|
||||
if (error) {
|
||||
trx.rollback();
|
||||
} else {
|
||||
trx.commit();
|
||||
}
|
||||
trx.close();
|
||||
trx = null;
|
||||
}
|
||||
gridTab.getTableModel().setImportingMode(false, null);
|
||||
}
|
||||
// write
|
||||
logMsg = logMsg.replaceAll(delimiter, "");
|
||||
rawLine = rawLine + delimiter + quoteChar + logMsg + quoteChar + "\n";
|
||||
logFileW.write(rawLine);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
throw new AdempiereException(e);
|
||||
}
|
||||
finally {
|
||||
try {
|
||||
if (mapReader != null)
|
||||
mapReader.close();
|
||||
if (errFileW != null) {
|
||||
errFileW.flush();
|
||||
errFileW.close();
|
||||
}
|
||||
if (logFileW != null) {
|
||||
logFileW.flush();
|
||||
logFileW.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (logFile != null)
|
||||
return logFile;
|
||||
else
|
||||
return errFile;
|
||||
}
|
||||
|
||||
private String resolveForeignList(MColumn column, String foreignColumn, Object value) {
|
||||
String idS = null;
|
||||
StringBuilder select = new StringBuilder("SELECT Value FROM AD_Ref_List WHERE ")
|
||||
.append(foreignColumn).append("=? AND AD_Reference_ID=? AND IsActive='Y'");
|
||||
idS = DB.getSQLValueStringEx(null, select.toString(), value, column.getAD_Reference_Value_ID());
|
||||
return idS;
|
||||
}
|
||||
|
||||
private int resolveForeign(String foreignTable, String foreignColumn, Object value) {
|
||||
int id = -1;
|
||||
StringBuilder select = new StringBuilder("SELECT ")
|
||||
.append(foreignTable).append("_ID FROM ")
|
||||
.append(foreignTable).append(" WHERE ")
|
||||
.append(foreignColumn).append("=? AND IsActive='Y' AND AD_Client_ID=?");
|
||||
id = DB.getSQLValueEx(null, select.toString(), value, Env.getAD_Client_ID(Env.getCtx()));
|
||||
if (id == -1 && !"AD_Client".equals(foreignTable)) {
|
||||
MTable ft = MTable.get(Env.getCtx(), foreignTable);
|
||||
String accessLevel = ft.getAccessLevel();
|
||||
if ( MTable.ACCESSLEVEL_All.equals(accessLevel)
|
||||
|| MTable.ACCESSLEVEL_SystemOnly.equals(accessLevel)
|
||||
|| MTable.ACCESSLEVEL_SystemPlusClient.equals(accessLevel)) {
|
||||
// try System client if the table has System access
|
||||
id = DB.getSQLValueEx(null, select.toString(), value, 0);
|
||||
}
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileExtension() {
|
||||
return "csv";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileExtensionLabel() {
|
||||
return Msg.getMsg(Env.getCtx(), "FileCSV");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getContentType() {
|
||||
return "application/csv";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSuggestedFileName(GridTab gridTab) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String dt = sdf.format(cal.getTime());
|
||||
String localFile = "Import_" + gridTab.getTableName() + "_" + dt
|
||||
+ (m_isError ? "_err" : "_log")
|
||||
+ "." + getFileExtension();
|
||||
return localFile;
|
||||
}
|
||||
|
||||
}
|
|
@ -177,4 +177,9 @@ public class GridTabExcelExporter extends AbstractExcelExporter implements IGrid
|
|||
public String getContentType() {
|
||||
return "application/vnd.ms-excel";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSuggestedFileName(GridTab gridTab) {
|
||||
return gridTab.getName() + "." + getFileExtension();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,221 +0,0 @@
|
|||
/******************************************************************************
|
||||
* The contents of this file are subject to the Compiere License Version 1.1
|
||||
* ("License"); You may not use this file except in compliance with the License
|
||||
* You may obtain a copy of the License at http://www.compiere.org/license.html
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is Compiere ERP & CRM Business Solution
|
||||
* The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
|
||||
*
|
||||
* Copyright (C) 2005 Robert KLEIN. robeklein@gmail.com *
|
||||
* Contributor(s): ______________________________________.
|
||||
*****************************************************************************/
|
||||
package org.compiere.FA;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
|
||||
import org.compiere.model.MAssetChange;
|
||||
import org.compiere.model.MRefList;
|
||||
import org.compiere.model.X_A_Asset_Disposed;
|
||||
import org.compiere.model.X_A_Depreciation_Exp;
|
||||
import org.compiere.process.ProcessInfoParameter;
|
||||
import org.compiere.process.SvrProcess;
|
||||
import org.compiere.util.DB;
|
||||
|
||||
|
||||
/**
|
||||
* Dispose Asset
|
||||
*
|
||||
* @author Rob klein
|
||||
* @version $Id: AssetDisposed.java,v 1.0$
|
||||
*/
|
||||
public class AssetDisposed extends SvrProcess
|
||||
{
|
||||
/** Record ID */
|
||||
private int p_Asset_Disposed_ID = 0;
|
||||
private boolean m_DeleteOld = false;
|
||||
|
||||
/**
|
||||
* Prepare - e.g., get Parameters.
|
||||
*/
|
||||
protected void prepare()
|
||||
{
|
||||
ProcessInfoParameter[] para = getParameter();
|
||||
for (int i = 0; i < para.length; i++)
|
||||
{
|
||||
String name = para[i].getParameterName();
|
||||
if (para[i].getParameter() == null)
|
||||
;
|
||||
else if (name.equals("DeleteOld"))
|
||||
m_DeleteOld = "Y".equals(para[i].getParameter());
|
||||
else
|
||||
log.info("prepare - Unknown Parameter: " + name);
|
||||
}
|
||||
p_Asset_Disposed_ID = getRecord_ID();
|
||||
|
||||
|
||||
} // prepare
|
||||
|
||||
|
||||
/**
|
||||
* Build Depreciation Workfile
|
||||
* @return info
|
||||
* @throws Exception
|
||||
*/
|
||||
protected String doIt() throws java.lang.Exception
|
||||
{
|
||||
log.info("doIt - Asset_Disposed_ID=" + p_Asset_Disposed_ID);
|
||||
if (p_Asset_Disposed_ID == 0)
|
||||
throw new IllegalArgumentException("No Record");
|
||||
|
||||
String sql = null;
|
||||
|
||||
//
|
||||
int no = 0;
|
||||
BigDecimal v_Balance = new BigDecimal("0.0");
|
||||
X_A_Asset_Disposed AssetDisposed = new X_A_Asset_Disposed (getCtx(), p_Asset_Disposed_ID, null);
|
||||
String clientCheck = " AND AD_Client_ID=" + AssetDisposed.getAD_Client_ID();
|
||||
|
||||
if (m_DeleteOld)
|
||||
{
|
||||
sql = "DELETE A_DEPRECIATION_EXP "
|
||||
+ "WHERE Processed='Y'"
|
||||
+ " AND A_Entry_Type = 'DIS'" + clientCheck;
|
||||
|
||||
no = DB.executeUpdate (sql,null);
|
||||
log.info ("doIt - Delete old processed entries =" + no);
|
||||
}
|
||||
|
||||
sql = null;
|
||||
log.info("doIt - Starting Disposal = " + no);
|
||||
|
||||
sql = "SELECT A.A_ASSET_ID, A.POSTINGTYPE, A.A_DEPRECIATION_ACCT, "
|
||||
+ " A.A_ACCUMDEPRECIATION_ACCT, A.A_DISPOSAL_LOSS, A.A_DISPOSAL_REVENUE, "
|
||||
+ " A.A_ASSET_ACCT, A.A_SPLIT_PERCENT, A.AD_ORG_ID, A.AD_CLIENT_ID, "
|
||||
+ " B.A_ASSET_COST, B.A_ACCUMULATED_DEPR "
|
||||
+ " FROM A_ASSET_ACCT A, A_DEPRECIATION_WORKFILE B "
|
||||
+ " WHERE A.A_ASSET_ID = " + AssetDisposed.getA_Asset_ID()
|
||||
+ " and B.A_ASSET_ID = " + AssetDisposed.getA_Asset_ID()
|
||||
+ " and A.POSTINGTYPE = B.POSTINGTYPE"
|
||||
+ " and A.AD_CLIENT_ID = B.AD_CLIENT_ID";
|
||||
|
||||
PreparedStatement pstmt = null;
|
||||
pstmt = DB.prepareStatement (sql,null);
|
||||
log.info("doIt - SQL=" + sql);
|
||||
String v_PostingType = null;
|
||||
//X_A_Depreciation_Exp depexp = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
rs = pstmt.executeQuery();
|
||||
while (rs.next()){
|
||||
if (v_PostingType != null && (!v_PostingType.equals(rs.getString("PostingType"))))
|
||||
{
|
||||
sql = "UPDATE A_DEPRECIATION_WORKFILE "
|
||||
+ "SET A_ACCUMULATED_DEPR = " + v_Balance
|
||||
+ "WHERE A_DEPRECIATION_WORKFILE.A_ASSET_ID = " + AssetDisposed.getA_Asset_ID()
|
||||
+ "AND A_DEPRECIATION_WORKFILE.POSTINGTYPE = '" + v_PostingType + "'";
|
||||
DB.executeUpdate(sql,null);
|
||||
|
||||
v_Balance = new BigDecimal("0.0");
|
||||
v_PostingType = rs.getString("PostingType");
|
||||
}
|
||||
else if (v_PostingType == null)
|
||||
{
|
||||
v_PostingType = rs.getString("PostingType");
|
||||
}
|
||||
|
||||
// Create JV for the asset disposal - remove cost of asset on balance sheet
|
||||
X_A_Depreciation_Exp depexp0 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp0.setPostingType(rs.getString("PostingType"));
|
||||
depexp0.setA_Asset_ID(AssetDisposed.getA_Asset_ID());
|
||||
depexp0.setExpense(rs.getBigDecimal("A_Asset_Cost").multiply(new BigDecimal(-1)).multiply(rs.getBigDecimal("A_Split_Percent")));
|
||||
depexp0.setDateAcct(AssetDisposed.getDateAcct());
|
||||
depexp0.setA_Account_Number(rs.getInt("A_Asset_Acct"));
|
||||
depexp0.setDescription("Asset Disposed - Cost of Asset");
|
||||
depexp0.setIsDepreciated(true);
|
||||
depexp0.setA_Period(AssetDisposed.getC_Period_ID());
|
||||
depexp0.setA_Entry_Type("DIS");
|
||||
depexp0.saveEx();
|
||||
|
||||
X_A_Depreciation_Exp depexp1 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp1.setPostingType(rs.getString("PostingType"));
|
||||
depexp1.setA_Asset_ID(AssetDisposed.getA_Asset_ID());
|
||||
depexp1.setExpense(rs.getBigDecimal("A_Asset_Cost").multiply(rs.getBigDecimal("A_Split_Percent")));
|
||||
depexp1.setDateAcct(AssetDisposed.getDateAcct());
|
||||
depexp1.setA_Account_Number(rs.getInt("A_Disposal_Loss"));
|
||||
depexp1.setDescription("Asset Disposed - Cost of Asset");
|
||||
depexp1.setIsDepreciated(false);
|
||||
depexp1.setA_Period(AssetDisposed.getC_Period_ID());
|
||||
depexp1.setA_Entry_Type("DIS");
|
||||
depexp1.saveEx();
|
||||
|
||||
v_Balance = v_Balance.add(rs.getBigDecimal("A_Asset_Cost").multiply(rs.getBigDecimal("A_Split_Percent")));
|
||||
|
||||
// Create JV for the asset disposal - remove accumulated depreciation of the asset on balance sheet
|
||||
X_A_Depreciation_Exp depexp2 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp2.setPostingType(rs.getString("PostingType"));
|
||||
depexp2.setA_Asset_ID(AssetDisposed.getA_Asset_ID());
|
||||
depexp2.setExpense(rs.getBigDecimal("A_Accumulated_Depr").multiply(rs.getBigDecimal("A_Split_Percent")));
|
||||
depexp2.setDateAcct(AssetDisposed.getDateAcct());
|
||||
depexp2.setA_Account_Number(rs.getInt("A_Accumdepreciation_Acct"));
|
||||
depexp2.setDescription("Asset Disposed - Accum Depr");
|
||||
depexp2.setIsDepreciated(true);
|
||||
depexp2.setA_Period(AssetDisposed.getC_Period_ID());
|
||||
depexp2.setA_Entry_Type("DIS");
|
||||
depexp2.saveEx();
|
||||
|
||||
X_A_Depreciation_Exp depexp3 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp3.setPostingType(rs.getString("PostingType"));
|
||||
depexp3.setA_Asset_ID(AssetDisposed.getA_Asset_ID());
|
||||
depexp3.setExpense(rs.getBigDecimal("A_Accumulated_Depr").multiply(new BigDecimal(-1)).multiply(rs.getBigDecimal("A_Split_Percent")));
|
||||
depexp3.setDateAcct(AssetDisposed.getDateAcct());
|
||||
depexp3.setA_Account_Number(rs.getInt("A_Disposal_Loss"));
|
||||
depexp3.setDescription("Asset Disposed - Accum Depr");
|
||||
depexp3.setIsDepreciated(false);
|
||||
depexp3.setA_Period(AssetDisposed.getC_Period_ID());
|
||||
depexp3.setA_Entry_Type("DIS");
|
||||
depexp3.saveEx();
|
||||
}
|
||||
|
||||
sql = "UPDATE A_ASSET "
|
||||
+ "SET ISDISPOSED = 'Y',"
|
||||
+ " ASSETDISPOSALDATE = " + DB.TO_DATE(AssetDisposed.getA_Disposed_Date())
|
||||
+ " WHERE A_ASSET_ID = " + AssetDisposed.getA_Asset_ID();
|
||||
|
||||
DB.executeUpdate(sql,null);
|
||||
|
||||
sql = "UPDATE A_DEPRECIATION_WORKFILE "
|
||||
+ "SET A_ACCUMULATED_DEPR = " + v_Balance
|
||||
+ "WHERE A_DEPRECIATION_WORKFILE.A_ASSET_ID = " + AssetDisposed.getA_Asset_ID()
|
||||
+ "AND A_DEPRECIATION_WORKFILE.POSTINGTYPE = '" + v_PostingType + "'";
|
||||
DB.executeUpdate(sql,null);
|
||||
|
||||
MAssetChange change = new MAssetChange (getCtx(), 0, null);
|
||||
change.setA_Asset_ID(AssetDisposed.getA_Asset_ID());
|
||||
change.setChangeType("DIS");
|
||||
change.setTextDetails(MRefList.getListDescription (getCtx(),"A_Update_Type" , "DIS"));
|
||||
change.setAssetDisposalDate(AssetDisposed.getA_Disposed_Date());
|
||||
change.setAssetAccumDepreciationAmt(v_Balance);
|
||||
change.setIsFullyDepreciated(true);
|
||||
change.setIsDisposed(true);
|
||||
change.saveEx();
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.info("getDeliveries"+ e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
|
||||
}
|
||||
|
||||
return "";
|
||||
} // doIt
|
||||
|
||||
} // AssetDisposed
|
|
@ -1,410 +0,0 @@
|
|||
/******************************************************************************
|
||||
* The contents of this file are subject to the Compiere License Version 1.1
|
||||
* ("License"); You may not use this file except in compliance with the License
|
||||
* You may obtain a copy of the License at http://www.compiere.org/license.html
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is Compiere ERP & CRM Business Solution
|
||||
* The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
|
||||
*
|
||||
* Copyright (C) 2005 Robert KLEIN. robeklein@gmail.com *
|
||||
* Contributor(s): ______________________________________.
|
||||
*****************************************************************************/
|
||||
package org.compiere.FA;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
|
||||
import org.compiere.model.MAsset;
|
||||
import org.compiere.model.X_A_Asset_Reval_Entry;
|
||||
import org.compiere.model.X_A_Asset_Reval_Index;
|
||||
import org.compiere.model.X_A_Depreciation_Exp;
|
||||
import org.compiere.model.X_C_Period;
|
||||
import org.compiere.process.ProcessInfoParameter;
|
||||
import org.compiere.process.SvrProcess;
|
||||
import org.compiere.util.DB;
|
||||
|
||||
|
||||
/**
|
||||
* Asset Revaluation Entry
|
||||
*
|
||||
* @author Rob Klein
|
||||
* @version $Id: AssetRevalEntry.java,v 1.0$
|
||||
*/
|
||||
public class AssetRevalEntry extends SvrProcess
|
||||
{
|
||||
/** Record ID */
|
||||
private int p_Asset_Reval_Entry_ID = 0;
|
||||
private boolean m_DeleteOld = false;
|
||||
|
||||
/**
|
||||
* Prepare - e.g., get Parameters.
|
||||
*/
|
||||
protected void prepare()
|
||||
{
|
||||
ProcessInfoParameter[] para = getParameter();
|
||||
for (int i = 0; i < para.length; i++)
|
||||
{
|
||||
String name = para[i].getParameterName();
|
||||
if (para[i].getParameter() == null)
|
||||
;
|
||||
else if (name.equals("DeleteOld"))
|
||||
m_DeleteOld = "Y".equals(para[i].getParameter());
|
||||
else
|
||||
log.info("prepare - Unknown Parameter: " + name);
|
||||
}
|
||||
p_Asset_Reval_Entry_ID = getRecord_ID();
|
||||
} // prepare
|
||||
|
||||
|
||||
/**
|
||||
* Build Depreciation Workfile
|
||||
* @return info
|
||||
* @throws Exception
|
||||
*/
|
||||
protected String doIt() throws java.lang.Exception
|
||||
{
|
||||
log.info("doIt - Asset_Reval_Entry_ID=" + p_Asset_Reval_Entry_ID);
|
||||
if (p_Asset_Reval_Entry_ID == 0)
|
||||
throw new IllegalArgumentException("No Record");
|
||||
|
||||
//
|
||||
int no = 0;
|
||||
BigDecimal v_Cost_reval = new BigDecimal("0.0");
|
||||
BigDecimal v_Cost_reval_pior = new BigDecimal("0.0");
|
||||
BigDecimal v_Accum_reval = new BigDecimal("0.0");
|
||||
BigDecimal v_Accum_reval_prior = new BigDecimal("0.0");
|
||||
BigDecimal v_Current_exp_reval = new BigDecimal("0.0");
|
||||
BigDecimal v_Multipler = new BigDecimal("0.0");
|
||||
BigDecimal v_Dep_Exp_reval = new BigDecimal("0.0");
|
||||
|
||||
X_A_Asset_Reval_Entry AssetReval = new X_A_Asset_Reval_Entry (getCtx(), p_Asset_Reval_Entry_ID, null);
|
||||
X_C_Period Period = new X_C_Period (getCtx(), AssetReval.getC_Period_ID(), null);
|
||||
|
||||
String sql = null;
|
||||
log.info("doIt - Starting Transfer = " + no);
|
||||
String clientCheck = " AND AD_Client_ID=" + AssetReval.getAD_Client_ID();
|
||||
|
||||
sql = "SELECT A.A_REVAL_COST_OFFSET, A.A_REVAL_ACCUMDEP_OFFSET_CUR, A.A_REVAL_DEPEXP_OFFSET "
|
||||
+ " A.A_ACCUMDEPRECIATION_ACCT, A.A_ASSET_ACCT, A.A_DEPRECIATION_ACCT, "
|
||||
+ " A.A_REVAL_ACCUMDEP_OFFSET_PRIOR, A.A_REVAL_COST_OFFSET_PRIOR "
|
||||
+ " B.A_ASSET_ID, B.A_ASSET_COST, B.A_ACCUMULATED_DEPR, B.A_ASSET_COST_REVAL, B.A_ACCUMULATED_DEPR_REVAL"
|
||||
+ " FROM A_ASSET_ACCT A, A_DEPRECIATION_WORKFILE B"
|
||||
+ " WHERE A.POSTINGTYPE = '" + AssetReval.getPostingType()
|
||||
+ " AND B.POSTINGTYPE = '" + AssetReval.getPostingType()
|
||||
+ " AND A.AD_Client_ID=" + AssetReval.getAD_Client_ID()
|
||||
+ " AND B.AD_Client_ID=" + AssetReval.getAD_Client_ID()
|
||||
+ " AND A.AD_Asset_ID = A.AD_Asset_ID";
|
||||
|
||||
PreparedStatement pstmt = null;
|
||||
pstmt = DB.prepareStatement (sql,null);
|
||||
log.info("doIt - SQL=" + sql);
|
||||
ResultSet rs = null;
|
||||
X_A_Depreciation_Exp depexp = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
|
||||
if (m_DeleteOld)
|
||||
{
|
||||
sql = "DELETE A_DEPRECIATION_EXP "
|
||||
+ "WHERE Processed='Y'"
|
||||
+ " AND A_Entry_Type = 'RVL'" + clientCheck;
|
||||
|
||||
no = DB.executeUpdate (sql,null);
|
||||
log.info ("doIt - Delete old processed entries =" + no);
|
||||
}
|
||||
try {
|
||||
|
||||
rs = pstmt.executeQuery();
|
||||
|
||||
while (rs.next()){
|
||||
|
||||
String sql2 = "select A_ASSET_REVAL_INDEX_ID from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code()
|
||||
+ " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < "
|
||||
+ AssetReval.getA_Effective_Date()
|
||||
+ ")";
|
||||
|
||||
X_A_Asset_Reval_Index ARevalIndex = new X_A_Asset_Reval_Index (getCtx(), DB.getSQLValue(null ,sql), null);
|
||||
MAsset Asset = new MAsset (getCtx(), rs.getInt("A_Asset_ID"), null);
|
||||
|
||||
if (AssetReval.getA_Reval_Multiplier().equals(X_A_Asset_Reval_Entry.A_REVAL_MULTIPLIER_Index))
|
||||
{
|
||||
|
||||
if (AssetReval.getA_Reval_Effective_Date().equals(X_A_Asset_Reval_Entry.A_REVAL_EFFECTIVE_DATE_DateAquired)){
|
||||
sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code()
|
||||
+ " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < "
|
||||
+ Asset.getA_Asset_CreateDate()
|
||||
+ ")";
|
||||
|
||||
}
|
||||
else if (AssetReval.getA_Reval_Effective_Date().equals(X_A_Asset_Reval_Entry.A_REVAL_EFFECTIVE_DATE_RevaluationDate)){
|
||||
sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code()
|
||||
+ " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < "
|
||||
+ Asset.getA_Asset_RevalDate()
|
||||
+ ")";
|
||||
|
||||
}
|
||||
else if (AssetReval.getA_Reval_Effective_Date().equals(X_A_Asset_Reval_Entry.A_REVAL_EFFECTIVE_DATE_DateDepreciationStarted)){
|
||||
sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code()
|
||||
+ " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < "
|
||||
+ Asset.getAssetServiceDate()
|
||||
+ ")";
|
||||
|
||||
}
|
||||
PreparedStatement pstmt2 = null;
|
||||
pstmt2 = DB.prepareStatement (sql2,null);
|
||||
ResultSet rs2 = null;
|
||||
log.info("doIt - SQL2=" + sql2);
|
||||
try {
|
||||
rs2 = pstmt2.executeQuery();
|
||||
while (rs2.next()){
|
||||
v_Multipler = ARevalIndex.getA_Reval_Rate().divide(rs2.getBigDecimal("A_REVAL_MULTIPLIER"),8);
|
||||
}
|
||||
|
||||
v_Cost_reval = ((rs.getBigDecimal("A_Asset_Cost").subtract(rs.getBigDecimal("A_ASSET_COST_REVAL"))).multiply( v_Multipler)).subtract(rs.getBigDecimal("A_Asset_Cost"));
|
||||
v_Accum_reval = ((rs.getBigDecimal("A_ACCUMULATED_DEPR").subtract(rs.getBigDecimal("A_ACCUMULATED_DEPR_REVAL"))).multiply( v_Multipler)).subtract(rs.getBigDecimal("A_ACCUMULATED_DEPR"));
|
||||
|
||||
sql2 = "SELECT SUM(CHANGEAMT) AS SUM_CHANGEAMT FROM A_ASSET_CHANGE WHERE A_ASSET_ID = "
|
||||
+ rs.getInt("A_Asset_ID")+ " AND CHANGETYPE = 'D'";
|
||||
pstmt2 = DB.prepareStatement (sql2,null);
|
||||
log.info("doIt - SQL2=" + sql2);
|
||||
try {
|
||||
rs2 = pstmt2.executeQuery();
|
||||
while (rs2.next()){
|
||||
v_Dep_Exp_reval = (rs2.getBigDecimal("SUM_CHANGEAMT").multiply( v_Multipler)).subtract(rs.getBigDecimal("SUM_CHANGEAMT"));
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.info("getDeliveries"+ e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt2);
|
||||
rs2 = null; pstmt2 = null;
|
||||
}
|
||||
|
||||
// Create JV for the Reval Cost Amounts
|
||||
X_A_Depreciation_Exp depexp0 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp0.setPostingType(AssetReval.getPostingType());
|
||||
depexp0.setA_Asset_ID(Asset.getA_Asset_ID());
|
||||
depexp0.setExpense(v_Cost_reval);
|
||||
depexp0.setDateAcct(AssetReval.getDateAcct());
|
||||
depexp0.setA_Account_Number(rs.getInt("A_ASSET_ACCT"));
|
||||
depexp0.setDescription("Asset Revaluation");
|
||||
depexp0.setIsDepreciated(false);
|
||||
depexp0.setA_Period(AssetReval.getC_Period_ID());
|
||||
depexp0.setA_Entry_Type("RVL");
|
||||
depexp0.saveEx();
|
||||
|
||||
X_A_Depreciation_Exp depexp1 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp1.setPostingType(AssetReval.getPostingType());
|
||||
depexp1.setA_Asset_ID(Asset.getA_Asset_ID());
|
||||
depexp1.setExpense(v_Cost_reval.multiply(new BigDecimal(-1)));
|
||||
depexp1.setDateAcct(AssetReval.getDateAcct());
|
||||
depexp1.setA_Account_Number(rs.getInt("A_REVAL_COST_OFFSET"));
|
||||
depexp1.setDescription("Asset Revaluation");
|
||||
depexp1.setIsDepreciated(false);
|
||||
depexp1.setA_Period(AssetReval.getC_Period_ID());
|
||||
depexp1.setA_Entry_Type("RVL");
|
||||
depexp1.saveEx();
|
||||
|
||||
// Create JV for the Reval Accum Depr Amounts
|
||||
X_A_Depreciation_Exp depexp2 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp2.setPostingType(AssetReval.getPostingType());
|
||||
depexp2.setA_Asset_ID(Asset.getA_Asset_ID());
|
||||
depexp2.setExpense(v_Accum_reval);
|
||||
depexp2.setDateAcct(AssetReval.getDateAcct());
|
||||
depexp2.setA_Account_Number(rs.getInt("A_ACCUMDEPRECIATION_ACCT"));
|
||||
depexp2.setDescription("Asset Revaluation");
|
||||
depexp2.setIsDepreciated(false);
|
||||
depexp2.setA_Period(AssetReval.getC_Period_ID());
|
||||
depexp2.setA_Entry_Type("RVL");
|
||||
depexp2.saveEx();
|
||||
|
||||
X_A_Depreciation_Exp depexp3 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp3.setPostingType(AssetReval.getPostingType());
|
||||
depexp3.setA_Asset_ID(Asset.getA_Asset_ID());
|
||||
depexp3.setExpense(v_Accum_reval.multiply(new BigDecimal(-1)));
|
||||
depexp3.setDateAcct(AssetReval.getDateAcct());
|
||||
depexp3.setA_Account_Number(rs.getInt("A_ACCUMULATED_DEPR_REVAL"));
|
||||
depexp3.setDescription("Asset Revaluation");
|
||||
depexp3.setIsDepreciated(false);
|
||||
depexp3.setA_Period(AssetReval.getC_Period_ID());
|
||||
depexp3.setA_Entry_Type("RVL");
|
||||
depexp3.saveEx();
|
||||
|
||||
// Create JV for the Reval Depreciation Expense Amounts
|
||||
X_A_Depreciation_Exp depexp4 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp4.setPostingType(AssetReval.getPostingType());
|
||||
depexp4.setA_Asset_ID(Asset.getA_Asset_ID());
|
||||
depexp4.setExpense(v_Dep_Exp_reval);
|
||||
depexp4.setDateAcct(AssetReval.getDateAcct());
|
||||
depexp4.setA_Account_Number(rs.getInt("A_DEPRECIATION_ACCT"));
|
||||
depexp4.setDescription("Asset Revaluation");
|
||||
depexp4.setIsDepreciated(false);
|
||||
depexp4.setA_Period(AssetReval.getC_Period_ID());
|
||||
depexp4.setA_Entry_Type("RVL");
|
||||
depexp4.saveEx();
|
||||
|
||||
X_A_Depreciation_Exp depexp5 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp5.setPostingType(AssetReval.getPostingType());
|
||||
depexp5.setA_Asset_ID(Asset.getA_Asset_ID());
|
||||
depexp5.setExpense(v_Dep_Exp_reval.multiply(new BigDecimal(-1)));
|
||||
depexp5.setDateAcct(AssetReval.getDateAcct());
|
||||
depexp5.setA_Account_Number(rs.getInt("A_REVAL_DEPEXP_OFFSET"));
|
||||
depexp5.setDescription("Asset Revaluation");
|
||||
depexp5.setIsDepreciated(false);
|
||||
depexp5.setA_Period(AssetReval.getC_Period_ID());
|
||||
depexp5.setA_Entry_Type("RVL");
|
||||
depexp5.saveEx();
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.info("getDeliveries"+ e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
} }
|
||||
else if (AssetReval.getA_Reval_Multiplier().equals(X_A_Asset_Reval_Entry.A_REVAL_MULTIPLIER_Factor))
|
||||
{
|
||||
|
||||
|
||||
if (AssetReval.getA_Reval_Effective_Date().equals(X_A_Asset_Reval_Entry.A_REVAL_EFFECTIVE_DATE_DateAquired)){
|
||||
sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code()
|
||||
+ " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < "
|
||||
+ Asset.getA_Asset_CreateDate()
|
||||
+ ")";
|
||||
|
||||
}
|
||||
else if (AssetReval.getA_Reval_Effective_Date().equals(X_A_Asset_Reval_Entry.A_REVAL_EFFECTIVE_DATE_RevaluationDate)){
|
||||
sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code()
|
||||
+ " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < "
|
||||
+ Asset.getA_Asset_RevalDate()
|
||||
+ ")";
|
||||
|
||||
}
|
||||
else if (AssetReval.getA_Reval_Effective_Date().equals(X_A_Asset_Reval_Entry.A_REVAL_EFFECTIVE_DATE_DateDepreciationStarted)){
|
||||
sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code()
|
||||
+ " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < "
|
||||
+ Asset.getAssetServiceDate()
|
||||
+ ")";
|
||||
|
||||
}
|
||||
PreparedStatement pstmt2 = null;
|
||||
pstmt2 = DB.prepareStatement (sql2,null);
|
||||
log.info("doIt - SQL2=" + sql2);
|
||||
try {
|
||||
ResultSet rs2 = pstmt2.executeQuery();
|
||||
while (rs2.next()){
|
||||
v_Multipler = rs2.getBigDecimal("A_REVAL_MULTIPLIER");
|
||||
}
|
||||
v_Cost_reval = ((rs.getBigDecimal("A_Asset_Cost").subtract(rs.getBigDecimal("A_ASSET_COST_REVAL"))).multiply( v_Multipler)).subtract(rs.getBigDecimal("A_Asset_Cost"));
|
||||
v_Accum_reval = ((rs.getBigDecimal("A_ACCUMULATED_DEPR").subtract(rs.getBigDecimal("A_ACCUMULATED_DEPR_REVAL"))).multiply( v_Multipler)).subtract(rs.getBigDecimal("A_ACCUMULATED_DEPR"));
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.info("getDeliveries"+ e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
} }
|
||||
|
||||
v_Cost_reval = ((rs.getBigDecimal("A_Asset_Cost").subtract(rs.getBigDecimal("A_ASSET_COST_REVAL"))).multiply( v_Multipler)).subtract(rs.getBigDecimal("A_Asset_Cost"));
|
||||
v_Accum_reval = ((rs.getBigDecimal("A_ACCUMULATED_DEPR").subtract(rs.getBigDecimal("A_ACCUMULATED_DEPR_REVAL"))).multiply( v_Multipler)).subtract(rs.getBigDecimal("A_ACCUMULATED_DEPR"));
|
||||
|
||||
// Create JV for the Reval Cost Amounts
|
||||
X_A_Depreciation_Exp depexp0 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp0.setPostingType(AssetReval.getPostingType());
|
||||
depexp0.setA_Asset_ID(Asset.getA_Asset_ID());
|
||||
depexp0.setExpense(v_Cost_reval);
|
||||
depexp0.setDateAcct(AssetReval.getDateAcct());
|
||||
depexp0.setA_Account_Number(rs.getInt("A_ASSET_ACCT"));
|
||||
depexp0.setDescription("Asset Revaluation");
|
||||
depexp0.setIsDepreciated(false);
|
||||
depexp0.setA_Period(AssetReval.getC_Period_ID());
|
||||
depexp0.setA_Entry_Type("RVL");
|
||||
depexp0.saveEx();
|
||||
|
||||
X_A_Depreciation_Exp depexp1 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp1.setPostingType(AssetReval.getPostingType());
|
||||
depexp1.setA_Asset_ID(Asset.getA_Asset_ID());
|
||||
depexp1.setExpense(v_Cost_reval.multiply(new BigDecimal(-1)));
|
||||
depexp1.setDateAcct(AssetReval.getDateAcct());
|
||||
depexp1.setA_Account_Number(rs.getInt("A_REVAL_COST_OFFSET"));
|
||||
depexp1.setDescription("Asset Revaluation");
|
||||
depexp1.setIsDepreciated(false);
|
||||
depexp1.setA_Period(AssetReval.getC_Period_ID());
|
||||
depexp1.setA_Entry_Type("RVL");
|
||||
depexp1.saveEx();
|
||||
|
||||
// Create JV for the Reval Accum Depr Amounts
|
||||
X_A_Depreciation_Exp depexp2 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp2.setPostingType(AssetReval.getPostingType());
|
||||
depexp2.setA_Asset_ID(Asset.getA_Asset_ID());
|
||||
depexp2.setExpense(v_Accum_reval);
|
||||
depexp2.setDateAcct(AssetReval.getDateAcct());
|
||||
depexp2.setA_Account_Number(rs.getInt("A_ACCUMDEPRECIATION_ACCT"));
|
||||
depexp2.setDescription("Asset Revaluation");
|
||||
depexp2.setIsDepreciated(false);
|
||||
depexp2.setA_Period(AssetReval.getC_Period_ID());
|
||||
depexp2.setA_Entry_Type("RVL");
|
||||
depexp2.saveEx();
|
||||
|
||||
X_A_Depreciation_Exp depexp3 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp3.setPostingType(AssetReval.getPostingType());
|
||||
depexp3.setA_Asset_ID(Asset.getA_Asset_ID());
|
||||
depexp3.setExpense(v_Accum_reval.multiply(new BigDecimal(-1)));
|
||||
depexp3.setDateAcct(AssetReval.getDateAcct());
|
||||
depexp3.setA_Account_Number(rs.getInt("A_ACCUMULATED_DEPR_REVAL"));
|
||||
depexp3.setDescription("Asset Revaluation");
|
||||
depexp3.setIsDepreciated(false);
|
||||
depexp3.setA_Period(AssetReval.getC_Period_ID());
|
||||
depexp3.setA_Entry_Type("RVL");
|
||||
depexp3.saveEx();
|
||||
|
||||
// Create JV for the Reval Depreciation Expense Amounts
|
||||
X_A_Depreciation_Exp depexp4 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp4.setPostingType(AssetReval.getPostingType());
|
||||
depexp4.setA_Asset_ID(Asset.getA_Asset_ID());
|
||||
depexp4.setExpense(v_Accum_reval);
|
||||
depexp4.setDateAcct(AssetReval.getDateAcct());
|
||||
depexp4.setA_Account_Number(rs.getInt("A_DEPRECIATION_ACCT"));
|
||||
depexp4.setDescription("Asset Revaluation");
|
||||
depexp4.setIsDepreciated(false);
|
||||
depexp4.setA_Period(AssetReval.getC_Period_ID());
|
||||
depexp4.setA_Entry_Type("RVL");
|
||||
depexp4.saveEx();
|
||||
|
||||
X_A_Depreciation_Exp depexp5 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp5.setPostingType(AssetReval.getPostingType());
|
||||
depexp5.setA_Asset_ID(Asset.getA_Asset_ID());
|
||||
depexp5.setExpense(v_Accum_reval.multiply(new BigDecimal(-1)));
|
||||
depexp5.setDateAcct(AssetReval.getDateAcct());
|
||||
depexp5.setA_Account_Number(rs.getInt("A_REVAL_DEPEXP_OFFSET"));
|
||||
depexp5.setDescription("Asset Revaluation");
|
||||
depexp5.setIsDepreciated(false);
|
||||
depexp5.setA_Period(AssetReval.getC_Period_ID());
|
||||
depexp5.setA_Entry_Type("RVL");
|
||||
depexp5.saveEx();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.info("getDeliveries"+ e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
}
|
||||
return "";
|
||||
} // doIt
|
||||
|
||||
} // AssetRevalEntry
|
|
@ -1,601 +0,0 @@
|
|||
/******************************************************************************
|
||||
* The contents of this file are subject to the Compiere License Version 1.1
|
||||
* ("License"); You may not use this file except in compliance with the License
|
||||
* You may obtain a copy of the License at http://www.compiere.org/license.html
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is Compiere ERP & CRM Business Solution
|
||||
* The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
|
||||
*
|
||||
* Copyright (C) 2005 Robert KLEIN. robeklein@gmail.com *
|
||||
* Contributor(s): ______________________________________.
|
||||
*****************************************************************************/
|
||||
package org.compiere.FA;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
|
||||
import org.compiere.model.MAsset;
|
||||
import org.compiere.model.MAssetAcct;
|
||||
import org.compiere.model.MAssetAddition;
|
||||
import org.compiere.model.MAssetChange;
|
||||
import org.compiere.model.MDepreciationWorkfile;
|
||||
import org.compiere.model.MRefList;
|
||||
import org.compiere.model.X_A_Asset_Split;
|
||||
import org.compiere.model.X_A_Depreciation_Exp;
|
||||
import org.compiere.process.SvrProcess;
|
||||
import org.compiere.util.DB;
|
||||
|
||||
|
||||
/**
|
||||
* Split an Asset
|
||||
*
|
||||
* @author Rob Klein
|
||||
* @version $Id: AssetSplit,v 1.0 $
|
||||
*/
|
||||
public class AssetSplit extends SvrProcess
|
||||
{
|
||||
/** Record ID */
|
||||
private int p_Asset_Split_ID = 0;
|
||||
//private boolean m_DeleteOld = false;
|
||||
|
||||
/**
|
||||
* Prepare - e.g., get Parameters.
|
||||
*/
|
||||
protected void prepare()
|
||||
{
|
||||
//ProcessInfoParameter[] para = getParameter();
|
||||
p_Asset_Split_ID = getRecord_ID();
|
||||
} // prepare
|
||||
|
||||
|
||||
/**
|
||||
* Transfer Asset
|
||||
* @return info
|
||||
* @throws Exception
|
||||
*/
|
||||
protected String doIt() throws java.lang.Exception
|
||||
{
|
||||
log.info("doIt - Asset_Split_ID=" + p_Asset_Split_ID);
|
||||
if (p_Asset_Split_ID == 0)
|
||||
throw new IllegalArgumentException("No Record");
|
||||
|
||||
//
|
||||
int no = 0;
|
||||
BigDecimal v_AccumBalance_New = new BigDecimal("0.0");
|
||||
BigDecimal v_CostBalance_New = new BigDecimal("0.0");
|
||||
BigDecimal v_QTY_New = new BigDecimal("0.0");
|
||||
BigDecimal v_SalvageValue_New = new BigDecimal("0.0");
|
||||
BigDecimal v_AccumBalance_Org = new BigDecimal("0.0");
|
||||
BigDecimal v_CostBalance_Org = new BigDecimal("0.0");
|
||||
BigDecimal v_QTY_Org = new BigDecimal("0.0");
|
||||
BigDecimal v_SalvageValue_Org = new BigDecimal("0.0");
|
||||
BigDecimal v_multiplier_New = new BigDecimal("0.0");
|
||||
BigDecimal v_ManDep_Org = new BigDecimal("0.0");
|
||||
BigDecimal v_ManDep_New = new BigDecimal("0.0");
|
||||
|
||||
int v_AssetNumber = 0, A_Accumdepreciation_Acct = 0;
|
||||
int A_Cost_Acct = 0, A_DepExp_Acct = 0;
|
||||
|
||||
log.info("doIt - Starting Split = " + no);
|
||||
|
||||
X_A_Asset_Split AssetSplit = new X_A_Asset_Split (getCtx(), p_Asset_Split_ID, null);
|
||||
MAsset Asset = new MAsset (getCtx(), AssetSplit.getA_Asset_ID(), null);
|
||||
MDepreciationWorkfile assetwk = new MDepreciationWorkfile (getCtx(), AssetSplit.getA_Depreciation_Workfile_ID(), null);
|
||||
MAssetAcct assetacct = new MAssetAcct (getCtx(), AssetSplit.getA_Asset_Acct_ID(), null);
|
||||
|
||||
v_AccumBalance_Org = assetwk.getA_Accumulated_Depr();
|
||||
v_SalvageValue_Org = assetwk.getA_Salvage_Value();
|
||||
v_CostBalance_Org = assetwk.getA_Asset_Cost();
|
||||
v_QTY_Org = AssetSplit.getA_QTY_Current();
|
||||
v_ManDep_Org = assetacct.getA_Depreciation_Manual_Amount();
|
||||
|
||||
if (AssetSplit.getA_Split_Type().compareTo("PER") == 0){
|
||||
v_multiplier_New = AssetSplit.getA_Percent_Split();
|
||||
v_AccumBalance_New = v_AccumBalance_Org.multiply(AssetSplit.getA_Percent_Split());
|
||||
v_CostBalance_New = v_CostBalance_Org.multiply(AssetSplit.getA_Percent_Split());
|
||||
v_QTY_New = v_QTY_Org.multiply(AssetSplit.getA_Percent_Split());
|
||||
v_SalvageValue_New = v_SalvageValue_Org.multiply(AssetSplit.getA_Percent_Split());
|
||||
v_AccumBalance_Org = v_AccumBalance_Org.subtract(v_AccumBalance_New);
|
||||
v_CostBalance_Org = v_CostBalance_Org.subtract(v_CostBalance_New);
|
||||
v_QTY_Org = v_QTY_Org.subtract(v_QTY_New);
|
||||
v_SalvageValue_Org = v_SalvageValue_Org.subtract(v_SalvageValue_New);
|
||||
v_ManDep_New = v_ManDep_Org.multiply(AssetSplit.getA_Percent_Split());
|
||||
v_ManDep_Org =v_ManDep_Org.subtract(v_ManDep_New);
|
||||
}
|
||||
else if (AssetSplit.getA_Split_Type().compareTo("QTY")==0) {
|
||||
v_multiplier_New = AssetSplit.getA_QTY_Split().setScale(5, BigDecimal.ROUND_HALF_UP).divide(v_QTY_Org.setScale(5, BigDecimal.ROUND_HALF_UP), 0);
|
||||
v_AccumBalance_New = v_AccumBalance_Org .multiply(v_multiplier_New);
|
||||
v_CostBalance_New = v_CostBalance_Org .multiply(v_multiplier_New);
|
||||
v_QTY_New = AssetSplit.getA_QTY_Split();
|
||||
v_SalvageValue_New = v_SalvageValue_Org.multiply(v_multiplier_New);
|
||||
v_AccumBalance_Org = v_AccumBalance_Org.subtract(v_AccumBalance_New);
|
||||
v_CostBalance_Org = v_CostBalance_Org .subtract(v_CostBalance_New);
|
||||
v_QTY_Org = v_QTY_Org .subtract(v_QTY_New);
|
||||
v_SalvageValue_Org = v_SalvageValue_Org .subtract(v_SalvageValue_New);
|
||||
v_ManDep_New = v_ManDep_Org.multiply(v_multiplier_New);
|
||||
v_ManDep_Org =v_ManDep_Org.subtract(v_ManDep_New);
|
||||
}
|
||||
else if (AssetSplit.getA_Split_Type().compareTo("AMT")==0) {
|
||||
v_multiplier_New = AssetSplit.getA_Amount_Split().setScale(5, BigDecimal.ROUND_HALF_UP).divide(v_CostBalance_Org.setScale(5, BigDecimal.ROUND_HALF_UP), 0);
|
||||
v_AccumBalance_New = v_AccumBalance_Org .multiply(v_multiplier_New);
|
||||
v_CostBalance_New = AssetSplit.getA_Amount_Split();
|
||||
v_QTY_New = v_QTY_Org .multiply(v_multiplier_New);
|
||||
v_SalvageValue_New = v_SalvageValue_Org.multiply(v_multiplier_New);
|
||||
v_AccumBalance_Org = v_AccumBalance_Org.subtract(v_AccumBalance_New);
|
||||
v_CostBalance_Org = v_CostBalance_Org.subtract(v_CostBalance_New);
|
||||
v_QTY_Org = v_QTY_Org.subtract(v_QTY_New);
|
||||
v_SalvageValue_Org = v_SalvageValue_Org.subtract(v_SalvageValue_New);
|
||||
v_ManDep_New = v_ManDep_Org.multiply(v_multiplier_New);
|
||||
v_ManDep_Org =v_ManDep_Org.subtract(v_ManDep_New);
|
||||
}
|
||||
|
||||
|
||||
if (AssetSplit.getA_Asset_ID_To() == 0)
|
||||
{
|
||||
//Insert New Asset
|
||||
MAsset AssetNew = new MAsset (getCtx(), 0, null);
|
||||
AssetNew.setValue(Asset.getValue());
|
||||
AssetNew.setA_Parent_Asset_ID(Asset.getA_Asset_ID());
|
||||
AssetNew.setName(Asset.getName());
|
||||
AssetNew.setDescription(Asset.getDescription());
|
||||
AssetNew.setHelp(Asset.getHelp());
|
||||
AssetNew.setA_Asset_Group_ID(Asset.getA_Asset_Group_ID());
|
||||
AssetNew.setM_Product_ID(Asset.getM_Product_ID());
|
||||
AssetNew.setSerNo(Asset.getSerNo());
|
||||
AssetNew.setLot(Asset.getLot());
|
||||
AssetNew.setVersionNo(Asset.getVersionNo());
|
||||
AssetNew.setGuaranteeDate(Asset.getGuaranteeDate());
|
||||
AssetNew.setAssetServiceDate(Asset.getAssetServiceDate());
|
||||
AssetNew.setUseLifeMonths(Asset.getUseLifeMonths());
|
||||
AssetNew.setUseLifeYears(Asset.getUseLifeYears());
|
||||
AssetNew.setUseUnits(Asset.getUseUnits());
|
||||
AssetNew.setIsOwned(Asset.isOwned());
|
||||
AssetNew.setIsDepreciated(Asset.isDepreciated());
|
||||
AssetNew.setAssetDepreciationDate(Asset.getAssetDepreciationDate());
|
||||
AssetNew.setIsInPosession(Asset.isInPosession());
|
||||
AssetNew.setLocationComment( "Split from Asset #" +AssetSplit.getA_Asset_ID());
|
||||
AssetNew.setC_BPartner_ID(Asset.getC_BPartner_ID());
|
||||
AssetNew.setC_BPartner_Location_ID(Asset.getC_BPartner_Location_ID());
|
||||
AssetNew.setA_QTY_Current(v_QTY_New);
|
||||
AssetNew.setA_QTY_Original(v_QTY_New);
|
||||
AssetNew.saveEx();
|
||||
|
||||
|
||||
v_AssetNumber = AssetNew.getA_Asset_ID();
|
||||
|
||||
//Create Asset Addition Record
|
||||
MAssetAddition assetadd = new MAssetAddition (getCtx(), 0, null);
|
||||
assetadd.setA_Asset_ID(AssetNew.getA_Asset_ID());
|
||||
assetadd.setAssetValueAmt(v_CostBalance_New );
|
||||
assetadd.setDescription("Split from Asset #" + AssetSplit.getA_Asset_ID());
|
||||
assetadd.setA_CapvsExp("Cap");
|
||||
assetadd.setA_SourceType("MAN");
|
||||
assetadd.setA_QTY_Current(v_QTY_New);
|
||||
assetadd.setPostingType(AssetSplit.getPostingType());
|
||||
assetadd.setM_InOutLine_ID(1);
|
||||
assetadd.saveEx();
|
||||
|
||||
|
||||
String sql2 = "SELECT A_Asset_Acct_ID "
|
||||
+ "FROM A_Asset_Acct "
|
||||
+ "WHERE A_Asset_ID= " + v_AssetNumber
|
||||
+ "AND PostingType = '" + AssetSplit.getPostingType() +"'";
|
||||
|
||||
int v_NewAssetAcctID = 0;
|
||||
v_NewAssetAcctID = DB.getSQLValue(null, sql2);
|
||||
|
||||
//Insert the New Asset in the Account File
|
||||
MAssetAcct assetacctnew = new MAssetAcct (getCtx(), v_NewAssetAcctID, null);
|
||||
assetacctnew.setA_Asset_ID(v_AssetNumber);
|
||||
assetacctnew.setC_AcctSchema_ID(assetacct.getC_AcctSchema_ID());
|
||||
assetacctnew.setA_Depreciation_ID(assetacct.getA_Depreciation_ID());
|
||||
assetacctnew.setA_Depreciation_Acct(assetacct.getA_Depreciation_Acct());
|
||||
assetacctnew.setA_Accumdepreciation_Acct(assetacct.getA_Accumdepreciation_Acct());
|
||||
assetacctnew.setA_Disposal_Loss(assetacct.getA_Disposal_Loss());
|
||||
assetacctnew.setA_Disposal_Revenue(assetacct.getA_Disposal_Revenue());
|
||||
assetacctnew.setA_Asset_Acct(assetacct.getA_Asset_Acct());
|
||||
assetacctnew.setA_Asset_Spread_ID(assetacct.getA_Asset_Spread_ID());
|
||||
assetacctnew.setA_Depreciation_Method_ID(assetacct.getA_Depreciation_Method_ID());
|
||||
assetacctnew.setA_Period_Start(assetacct.getA_Period_Start());
|
||||
assetacctnew.setA_Period_End(assetacct.getA_Period_End());
|
||||
assetacctnew.setA_Split_Percent(assetacct.getA_Split_Percent());
|
||||
assetacctnew.setA_Reval_Cal_Method(assetacct.getA_Reval_Cal_Method());
|
||||
assetacctnew.setA_Salvage_Value(v_SalvageValue_New);
|
||||
assetacctnew.setPostingType(assetacct.getPostingType());
|
||||
assetacctnew.setA_Depreciation_Conv_ID(assetacct.getA_Depreciation_Conv_ID());
|
||||
assetacctnew.setA_Depreciation_Manual_Amount(v_ManDep_New);
|
||||
assetacctnew.setA_Depreciation_Manual_Period(assetacct.getA_Depreciation_Manual_Period());
|
||||
if (assetacct.getA_Depreciation_Manual_Period() == null)
|
||||
assetacctnew.setA_Depreciation_Manual_Period(" ");
|
||||
else
|
||||
assetacctnew.setA_Depreciation_Manual_Period(assetacct.getA_Depreciation_Manual_Period());
|
||||
assetacctnew.saveEx();
|
||||
|
||||
|
||||
sql2 = null;
|
||||
sql2 = "SELECT A_Depreciation_Workfile_ID "
|
||||
+ "FROM A_Depreciation_Workfile "
|
||||
+ "WHERE A_Asset_ID= " + v_AssetNumber
|
||||
+ " AND PostingType = '" + AssetSplit.getPostingType() +"'";
|
||||
|
||||
int v_NewWorkfileID = 0;
|
||||
v_NewWorkfileID = DB.getSQLValue(null, sql2);
|
||||
|
||||
|
||||
//Insert the New Asset in the Deprecation Workfile
|
||||
MDepreciationWorkfile assetwknew = new MDepreciationWorkfile (getCtx(), v_NewWorkfileID, null);
|
||||
assetwknew.setA_Asset_ID(v_AssetNumber);
|
||||
assetwknew.setA_Asset_Cost(assetwknew.getA_Asset_Cost().add(v_CostBalance_New));
|
||||
assetwknew.setA_Accumulated_Depr(v_AccumBalance_New);
|
||||
assetwknew.setA_Life_Period(assetwk.getA_Life_Period());
|
||||
assetwknew.setA_Period_Posted(assetwk.getA_Period_Posted());
|
||||
assetwknew.setA_Salvage_Value(v_SalvageValue_New);
|
||||
assetwknew.setA_Asset_Life_Years(assetwk.getA_Asset_Life_Years());
|
||||
assetwknew.setPostingType(assetwk.getPostingType());
|
||||
assetwknew.setA_QTY_Current(assetwknew.getA_QTY_Current().add(v_QTY_New));
|
||||
assetwknew.setIsDepreciated(assetwk.isDepreciated());
|
||||
assetwknew.setA_Asset_Life_Current_Year(assetwk.getA_Asset_Life_Current_Year());
|
||||
assetwknew.setA_Curr_Dep_Exp(new BigDecimal (0.0));
|
||||
assetwknew.saveEx();
|
||||
|
||||
|
||||
//Record transaction in Asset History
|
||||
MAssetChange change = new MAssetChange (getCtx(), 0, null);
|
||||
change.setAssetValueAmt(v_CostBalance_New );
|
||||
change.setPostingType(assetacct.getPostingType());
|
||||
change.setA_Asset_ID(AssetNew.getA_Asset_ID());
|
||||
change.setAssetAccumDepreciationAmt(v_AccumBalance_New);
|
||||
change.setA_Salvage_Value(v_SalvageValue_New);
|
||||
change.setPostingType(assetacct.getPostingType());
|
||||
change.setA_Split_Percent(assetacct.getA_Split_Percent());
|
||||
change.setConventionType(assetacct.getA_Depreciation_Conv_ID());
|
||||
change.setA_Asset_ID(AssetNew.getA_Asset_ID());
|
||||
change.setDepreciationType(assetacct.getA_Depreciation_ID());
|
||||
change.setA_Asset_Spread_Type(assetacct.getA_Asset_Spread_ID());
|
||||
change.setA_Period_Start(assetacct.getA_Period_Start());
|
||||
change.setA_Period_End(assetacct.getA_Period_End());
|
||||
change.setIsInPosession(AssetNew.isOwned());
|
||||
change.setIsDisposed(AssetNew.isDisposed());
|
||||
change.setIsDepreciated(AssetNew.isDepreciated());
|
||||
change.setIsFullyDepreciated(AssetNew.isFullyDepreciated());
|
||||
change.setA_Depreciation_Calc_Type(assetacct.getA_Depreciation_Method_ID());
|
||||
change.setA_Asset_Acct(assetacct.getA_Asset_Acct());
|
||||
change.setC_AcctSchema_ID(assetacct.getC_AcctSchema_ID());
|
||||
change.setA_Accumdepreciation_Acct(assetacct.getA_Accumdepreciation_Acct());
|
||||
change.setA_Depreciation_Acct(assetacct.getA_Depreciation_Acct());
|
||||
change.setA_Disposal_Revenue(assetacct.getA_Disposal_Revenue());
|
||||
change.setA_Disposal_Loss(assetacct.getA_Disposal_Loss());
|
||||
change.setA_Reval_Accumdep_Offset_Cur(assetacct.getA_Reval_Accumdep_Offset_Cur());
|
||||
change.setA_Reval_Accumdep_Offset_Prior(assetacct.getA_Reval_Accumdep_Offset_Prior());
|
||||
if (assetacct.getA_Reval_Cal_Method() == null)
|
||||
change.setA_Reval_Cal_Method(" ");
|
||||
else
|
||||
change.setA_Reval_Cal_Method(assetacct.getA_Reval_Cal_Method());
|
||||
change.setA_Reval_Cost_Offset(assetacct.getA_Reval_Cost_Offset());
|
||||
change.setA_Reval_Cost_Offset_Prior(assetacct.getA_Reval_Cost_Offset_Prior());
|
||||
change.setA_Reval_Depexp_Offset(assetacct.getA_Reval_Depexp_Offset());
|
||||
change.setA_Depreciation_Manual_Amount(assetacct.getA_Depreciation_Manual_Amount());
|
||||
if (assetacct.getA_Depreciation_Manual_Period() == null)
|
||||
change.setA_Depreciation_Manual_Period(" ");
|
||||
else
|
||||
change.setA_Depreciation_Manual_Period(assetacct.getA_Depreciation_Manual_Period());
|
||||
change.setA_Depreciation_Table_Header_ID(assetacct.getA_Depreciation_Table_Header_ID());
|
||||
change.setA_Depreciation_Variable_Perc(assetacct.getA_Depreciation_Variable_Perc());
|
||||
change.setA_Parent_Asset_ID(Asset.getA_Parent_Asset_ID());
|
||||
change.setChangeType("SPL");
|
||||
change.setTextDetails(MRefList.getListDescription (getCtx(),"A_Update_Type" , "SPL"));
|
||||
change.setLot(AssetNew.getLot());
|
||||
change.setSerNo(AssetNew.getSerNo());
|
||||
change.setVersionNo(AssetNew.getVersionNo());
|
||||
change.setUseLifeMonths(AssetNew.getUseLifeMonths());
|
||||
change.setUseLifeYears(AssetNew.getUseLifeYears());
|
||||
change.setLifeUseUnits(AssetNew.getLifeUseUnits());
|
||||
change.setAssetDisposalDate(AssetNew.getAssetDisposalDate());
|
||||
change.setAssetServiceDate(AssetNew.getAssetServiceDate());
|
||||
change.setC_BPartner_Location_ID(AssetNew.getC_BPartner_Location_ID());
|
||||
change.setC_BPartner_ID(AssetNew.getC_BPartner_ID());
|
||||
change.setA_QTY_Current(AssetNew.getA_QTY_Current());
|
||||
change.setA_QTY_Original(AssetNew.getA_QTY_Original());
|
||||
change.saveEx();
|
||||
|
||||
|
||||
//Record Account Numbers for JE's
|
||||
A_Accumdepreciation_Acct = assetacctnew.getA_Accumdepreciation_Acct();
|
||||
A_Cost_Acct = assetacctnew.getA_Asset_Acct();
|
||||
A_DepExp_Acct = assetacctnew.getA_Depreciation_Acct();
|
||||
}
|
||||
else
|
||||
{
|
||||
v_AssetNumber = AssetSplit.getA_Asset_ID_To();
|
||||
|
||||
//Update Target Asset Record
|
||||
MAsset AssetNew = new MAsset (getCtx(), v_AssetNumber, null);
|
||||
AssetNew.setA_QTY_Current(AssetNew.getA_QTY_Current().add(v_QTY_New));
|
||||
AssetNew.setA_QTY_Original(AssetNew.getA_QTY_Original().add(v_QTY_New));
|
||||
AssetNew.saveEx();
|
||||
|
||||
//Create Asset Addition Record
|
||||
MAssetAddition assetadd = new MAssetAddition (getCtx(), 0, null);
|
||||
assetadd.setA_Asset_ID(v_AssetNumber);
|
||||
assetadd.setAssetValueAmt(v_CostBalance_New );
|
||||
assetadd.setDescription("Split from Asset #" + AssetSplit.getA_Asset_ID());
|
||||
assetadd.setA_CapvsExp("Cap");
|
||||
assetadd.setA_SourceType("MAN");
|
||||
assetadd.setA_QTY_Current(v_QTY_New);
|
||||
assetadd.setPostingType(AssetSplit.getPostingType());
|
||||
assetadd.setM_InOutLine_ID(1);
|
||||
assetadd.saveEx();
|
||||
|
||||
|
||||
String sql2 = "SELECT A_Asset_Acct_ID "
|
||||
+ "FROM A_Asset_Acct "
|
||||
+ "WHERE A_Asset_ID= " + v_AssetNumber
|
||||
+ "AND PostingType = '" + AssetSplit.getPostingType() +"'";
|
||||
|
||||
int v_NewAssetAcctID = 0;
|
||||
v_NewAssetAcctID = DB.getSQLValue(null, sql2);
|
||||
|
||||
//Update Target Asset in the Account File
|
||||
MAssetAcct assetacctnew = new MAssetAcct (getCtx(), v_NewAssetAcctID, null);
|
||||
assetacctnew.setA_Salvage_Value(assetacctnew.getA_Salvage_Value().add(v_SalvageValue_New));
|
||||
assetacctnew.setA_Depreciation_Manual_Amount(assetacctnew.getA_Depreciation_Manual_Amount().add(v_ManDep_New));
|
||||
assetacctnew.saveEx();
|
||||
|
||||
|
||||
sql2 = null;
|
||||
sql2 = "SELECT A_Depreciation_Workfile_ID "
|
||||
+ "FROM A_Depreciation_Workfile "
|
||||
+ "WHERE A_Asset_ID= " + v_AssetNumber
|
||||
+ " AND PostingType = '" + AssetSplit.getPostingType() +"'";
|
||||
|
||||
int v_NewWorkfileID = 0;
|
||||
v_NewWorkfileID = DB.getSQLValue(null, sql2);
|
||||
|
||||
|
||||
//Update Target Asset in the Deprecation Workfile
|
||||
MDepreciationWorkfile assetwknew = new MDepreciationWorkfile (getCtx(), v_NewWorkfileID, null);
|
||||
assetwknew.setA_Asset_Cost(assetwknew.getA_Asset_Cost().add(v_CostBalance_New));
|
||||
assetwknew.setA_Accumulated_Depr(assetwknew.getA_Accumulated_Depr().add(v_AccumBalance_New));
|
||||
assetwknew.setA_Salvage_Value(assetwknew.getA_Salvage_Value().add(v_SalvageValue_New));
|
||||
assetwknew.setA_QTY_Current(assetwknew.getA_QTY_Current().add(v_QTY_New));
|
||||
assetwknew.saveEx();
|
||||
|
||||
|
||||
//Record transaction in Asset History
|
||||
MAssetChange change = new MAssetChange (getCtx(), 0, null);
|
||||
change.setAssetValueAmt(v_CostBalance_New );
|
||||
change.setPostingType(assetacct.getPostingType());
|
||||
change.setA_Asset_ID(AssetNew.getA_Asset_ID());
|
||||
change.setAssetAccumDepreciationAmt(v_AccumBalance_New);
|
||||
change.setA_Salvage_Value(v_SalvageValue_New);
|
||||
change.setPostingType(assetacct.getPostingType());
|
||||
change.setA_Split_Percent(assetacct.getA_Split_Percent());
|
||||
change.setConventionType(assetacct.getA_Depreciation_Conv_ID());
|
||||
change.setA_Asset_ID(AssetNew.getA_Asset_ID());
|
||||
change.setDepreciationType(assetacct.getA_Depreciation_ID());
|
||||
change.setA_Asset_Spread_Type(assetacct.getA_Asset_Spread_ID());
|
||||
change.setA_Period_Start(assetacct.getA_Period_Start());
|
||||
change.setA_Period_End(assetacct.getA_Period_End());
|
||||
change.setIsInPosession(AssetNew.isOwned());
|
||||
change.setIsDisposed(AssetNew.isDisposed());
|
||||
change.setIsDepreciated(AssetNew.isDepreciated());
|
||||
change.setIsFullyDepreciated(AssetNew.isFullyDepreciated());
|
||||
change.setA_Depreciation_Calc_Type(assetacct.getA_Depreciation_Method_ID());
|
||||
change.setA_Asset_Acct(assetacct.getA_Asset_Acct());
|
||||
change.setC_AcctSchema_ID(assetacct.getC_AcctSchema_ID());
|
||||
change.setA_Accumdepreciation_Acct(assetacct.getA_Accumdepreciation_Acct());
|
||||
change.setA_Depreciation_Acct(assetacct.getA_Depreciation_Acct());
|
||||
change.setA_Disposal_Revenue(assetacct.getA_Disposal_Revenue());
|
||||
change.setA_Disposal_Loss(assetacct.getA_Disposal_Loss());
|
||||
change.setA_Reval_Accumdep_Offset_Cur(assetacct.getA_Reval_Accumdep_Offset_Cur());
|
||||
change.setA_Reval_Accumdep_Offset_Prior(assetacct.getA_Reval_Accumdep_Offset_Prior());
|
||||
change.setA_Reval_Cal_Method(assetacct.getA_Reval_Cal_Method());
|
||||
change.setA_Reval_Cost_Offset(assetacct.getA_Reval_Cost_Offset());
|
||||
change.setA_Reval_Cost_Offset_Prior(assetacct.getA_Reval_Cost_Offset_Prior());
|
||||
change.setA_Reval_Depexp_Offset(assetacct.getA_Reval_Depexp_Offset());
|
||||
change.setA_Depreciation_Manual_Amount(assetacct.getA_Depreciation_Manual_Amount());
|
||||
if (assetacct.getA_Reval_Cal_Method() == null)
|
||||
change.setA_Reval_Cal_Method(" ");
|
||||
else
|
||||
change.setA_Reval_Cal_Method(assetacct.getA_Reval_Cal_Method());
|
||||
if (assetacct.getA_Depreciation_Manual_Period() == null)
|
||||
change.setA_Depreciation_Manual_Period(" ");
|
||||
else
|
||||
change.setA_Depreciation_Manual_Period(assetacct.getA_Depreciation_Manual_Period());
|
||||
change.setA_Depreciation_Table_Header_ID(assetacct.getA_Depreciation_Table_Header_ID());
|
||||
change.setA_Depreciation_Variable_Perc(assetacct.getA_Depreciation_Variable_Perc());
|
||||
change.setA_Parent_Asset_ID(Asset.getA_Parent_Asset_ID());
|
||||
change.setChangeType("SPL");
|
||||
change.setTextDetails(MRefList.getListDescription (getCtx(),"A_Update_Type" , "SPL"));
|
||||
change.setLot(AssetNew.getLot());
|
||||
change.setSerNo(AssetNew.getSerNo());
|
||||
change.setVersionNo(AssetNew.getVersionNo());
|
||||
change.setUseLifeMonths(AssetNew.getUseLifeMonths());
|
||||
change.setUseLifeYears(AssetNew.getUseLifeYears());
|
||||
change.setLifeUseUnits(AssetNew.getLifeUseUnits());
|
||||
change.setAssetDisposalDate(AssetNew.getAssetDisposalDate());
|
||||
change.setAssetServiceDate(AssetNew.getAssetServiceDate());
|
||||
change.setC_BPartner_Location_ID(AssetNew.getC_BPartner_Location_ID());
|
||||
change.setC_BPartner_ID(AssetNew.getC_BPartner_ID());
|
||||
change.setA_QTY_Current(AssetNew.getA_QTY_Current());
|
||||
change.setA_QTY_Original(AssetNew.getA_QTY_Original());
|
||||
change.saveEx();
|
||||
|
||||
|
||||
//Record Account Numbers for JE's
|
||||
A_Accumdepreciation_Acct = assetacctnew.getA_Accumdepreciation_Acct();
|
||||
A_Cost_Acct = assetacctnew.getA_Asset_Acct();
|
||||
A_DepExp_Acct = assetacctnew.getA_Depreciation_Acct();
|
||||
|
||||
}
|
||||
|
||||
// Update original Asset
|
||||
Asset.setA_QTY_Current(v_QTY_Org);
|
||||
Asset.saveEx();
|
||||
|
||||
// Update original asset for the split
|
||||
MAssetAddition assetaddold = new MAssetAddition (getCtx(), 0, null);
|
||||
assetaddold.setA_Asset_ID(Asset.getA_Asset_ID());
|
||||
assetaddold.setAssetValueAmt(v_CostBalance_New.multiply( new BigDecimal(-1)));
|
||||
assetaddold.setDescription("Split to Asset #" + v_AssetNumber);
|
||||
assetaddold.setA_CapvsExp("Cap");
|
||||
assetaddold.setA_SourceType("MAN");
|
||||
assetaddold.setA_QTY_Current(v_QTY_New.multiply( new BigDecimal(-1)));
|
||||
assetaddold.setPostingType(AssetSplit.getPostingType());
|
||||
assetaddold.setM_InOutLine_ID(1);
|
||||
assetaddold.saveEx();
|
||||
|
||||
//Update the Original Asset in the Account File
|
||||
assetacct.setA_Salvage_Value(v_SalvageValue_Org);
|
||||
assetacct.setA_Depreciation_Manual_Amount(v_ManDep_Org);
|
||||
assetacct.saveEx();
|
||||
|
||||
//Update the Original Asset in the Deprecation Workfile
|
||||
assetwk.setA_Asset_Cost(v_CostBalance_Org);
|
||||
assetwk.setA_Accumulated_Depr(v_AccumBalance_Org);
|
||||
assetwk.setA_Salvage_Value(v_SalvageValue_Org);
|
||||
assetwk.setA_QTY_Current(v_QTY_Org);
|
||||
assetwk.saveEx();
|
||||
|
||||
MAssetChange change1 = new MAssetChange (getCtx(), 0, null);
|
||||
change1.setChangeType("SPL");
|
||||
change1.setTextDetails(MRefList.getListDescription (getCtx(),"A_Update_Type" , "SPL"));
|
||||
change1.setAssetValueAmt(v_CostBalance_New.multiply(new BigDecimal(-1)));
|
||||
change1.setPostingType(assetacct.getPostingType());
|
||||
if (assetacct.getA_Reval_Cal_Method() == null)
|
||||
change1.setA_Reval_Cal_Method(" ");
|
||||
else
|
||||
change1.setA_Reval_Cal_Method(assetacct.getA_Reval_Cal_Method());
|
||||
if (assetacct.getA_Depreciation_Manual_Period() == null)
|
||||
change1.setA_Depreciation_Manual_Period(" ");
|
||||
else
|
||||
change1.setA_Depreciation_Manual_Period(assetacct.getA_Depreciation_Manual_Period());
|
||||
change1.setA_Asset_ID(Asset.getA_Asset_ID());
|
||||
change1.setAssetAccumDepreciationAmt(v_AccumBalance_New.multiply(new BigDecimal(-1)));
|
||||
change1.setA_Salvage_Value(v_SalvageValue_New.multiply(new BigDecimal(-1)));
|
||||
change1.setA_QTY_Current(v_QTY_New.multiply(new BigDecimal(-1)));
|
||||
change1.saveEx();
|
||||
|
||||
//Create Journal Entries for the split
|
||||
X_A_Depreciation_Exp depexp2 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
//Create JV for the accumulated depreciation of the asset
|
||||
depexp2.setPostingType(AssetSplit.getPostingType());
|
||||
depexp2.setA_Asset_ID(v_AssetNumber);
|
||||
depexp2.setExpense(v_AccumBalance_New.multiply(new BigDecimal(-1)));
|
||||
depexp2.setDateAcct(AssetSplit.getDateAcct());
|
||||
depexp2.setA_Account_Number(A_Accumdepreciation_Acct);
|
||||
depexp2.setDescription("Asset Split Accum Dep");
|
||||
depexp2.setIsDepreciated(false);
|
||||
depexp2.setA_Period(AssetSplit.getC_Period_ID());
|
||||
depexp2.setA_Entry_Type("SPL");
|
||||
depexp2.saveEx();
|
||||
|
||||
|
||||
X_A_Depreciation_Exp depexp3 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp3.setPostingType(AssetSplit.getPostingType());
|
||||
depexp3.setA_Asset_ID(AssetSplit.getA_Asset_ID());
|
||||
depexp3.setExpense(v_AccumBalance_New);
|
||||
depexp3.setDateAcct(AssetSplit.getDateAcct());
|
||||
depexp3.setA_Account_Number(assetacct.getA_Accumdepreciation_Acct());
|
||||
depexp3.setDescription("Asset Split Accum Dep");
|
||||
depexp3.setIsDepreciated(false);
|
||||
depexp3.setA_Period(AssetSplit.getC_Period_ID());
|
||||
depexp3.setA_Entry_Type("SPL");
|
||||
depexp3.saveEx();
|
||||
|
||||
X_A_Depreciation_Exp depexp4 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
//Create JV for the Cost of the asset
|
||||
depexp4.setPostingType(AssetSplit.getPostingType());
|
||||
depexp4.setA_Asset_ID(v_AssetNumber);
|
||||
depexp4.setExpense(v_CostBalance_New);
|
||||
depexp4.setDateAcct(AssetSplit.getDateAcct());
|
||||
depexp4.setA_Account_Number(A_Cost_Acct);
|
||||
depexp4.setDescription("Asset Split Cost");
|
||||
depexp4.setIsDepreciated(false);
|
||||
depexp4.setA_Period(AssetSplit.getC_Period_ID());
|
||||
depexp4.setA_Entry_Type("SPL");
|
||||
depexp4.saveEx();
|
||||
|
||||
X_A_Depreciation_Exp depexp5 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp5.setPostingType(AssetSplit.getPostingType());
|
||||
depexp5.setA_Asset_ID(AssetSplit.getA_Asset_ID());
|
||||
depexp5.setExpense(v_CostBalance_New.multiply(new BigDecimal(-1)));
|
||||
depexp5.setDateAcct(AssetSplit.getDateAcct());
|
||||
depexp5.setA_Account_Number(assetacct.getA_Asset_Acct());
|
||||
depexp5.setDescription("Asset Split Cost");
|
||||
depexp5.setIsDepreciated(false);
|
||||
depexp5.setA_Period(AssetSplit.getC_Period_ID());
|
||||
depexp5.setA_Entry_Type("SPL");
|
||||
depexp5.saveEx();
|
||||
|
||||
|
||||
String sql = null;
|
||||
log.info("doIt - Finishing Split = " + no);
|
||||
|
||||
sql = "SELECT A_ASSET_ID, CHANGEAMT "
|
||||
+ "FROM A_ASSET_CHANGE "
|
||||
+ "WHERE A_ASSET_CHANGE.A_ASSET_ID = " + AssetSplit.getA_Asset_ID()
|
||||
+ " AND A_ASSET_CHANGE.POSTINGTYPE = '" + AssetSplit.getPostingType()
|
||||
+ "' AND A_ASSET_CHANGE.CHANGETYPE= 'D' "
|
||||
+ "AND TRUNC(A_ASSET_CHANGE.DATEACCT, 'YY') = TRUNC( " + DB.TO_DATE(AssetSplit.getDateAcct()) + ", 'YY') "
|
||||
+ "AND TRUNC(A_ASSET_CHANGE.DATEACCT, 'MM') <= TRUNC( " + DB.TO_DATE(AssetSplit.getDateAcct()) + ", 'MM') "
|
||||
+ "AND A_ASSET_CHANGE.C_VALIDCOMBINATION_ID = " + assetacct.getA_Depreciation_Acct();
|
||||
|
||||
PreparedStatement pstmt = null;
|
||||
pstmt = DB.prepareStatement (sql,null);
|
||||
log.info("doIt - SQL=" + sql);
|
||||
BigDecimal v_Balance = new BigDecimal("0.0");
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
rs = pstmt.executeQuery();
|
||||
if (AssetSplit.isA_Transfer_Balance_IS()==true)
|
||||
{
|
||||
while (rs.next());
|
||||
v_Balance = v_Balance.add(rs.getBigDecimal("ChangeAmt"));
|
||||
|
||||
// Create JV for YTD Depreciation Expense
|
||||
X_A_Depreciation_Exp depexp0 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp0.setPostingType(AssetSplit.getPostingType());
|
||||
depexp0.setA_Asset_ID(v_AssetNumber);
|
||||
depexp0.setExpense(v_Balance.multiply(v_multiplier_New));
|
||||
depexp0.setDateAcct(AssetSplit.getDateAcct());
|
||||
depexp0.setA_Account_Number(A_DepExp_Acct);
|
||||
depexp0.setDescription("Asset Split YTD Depreciation Expense");
|
||||
depexp0.setIsDepreciated(false);
|
||||
depexp0.setA_Period(AssetSplit.getC_Period_ID());
|
||||
depexp0.setA_Entry_Type("SPL");
|
||||
depexp0.saveEx();
|
||||
|
||||
X_A_Depreciation_Exp depexp1 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp1.setPostingType(AssetSplit.getPostingType());
|
||||
depexp1.setA_Asset_ID(AssetSplit.getA_Asset_ID());
|
||||
depexp1.setExpense(v_Balance.multiply(new BigDecimal(-1)).multiply(v_multiplier_New));
|
||||
depexp1.setDateAcct(AssetSplit.getDateAcct());
|
||||
depexp1.setA_Account_Number(assetacct.getA_Depreciation_Acct());
|
||||
depexp1.setDescription("Asset Split YTD Depreciation Expense");
|
||||
depexp1.setIsDepreciated(false);
|
||||
depexp1.setA_Period(AssetSplit.getC_Period_ID());
|
||||
depexp1.setA_Entry_Type("SPL");
|
||||
depexp1.saveEx();
|
||||
}
|
||||
|
||||
rs.close();
|
||||
pstmt.close();
|
||||
pstmt = null;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.info("AssetSplit"+ e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
}
|
||||
return "";
|
||||
} // doIt
|
||||
|
||||
} // AssetSplit
|
|
@ -1,273 +0,0 @@
|
|||
/******************************************************************************
|
||||
* The contents of this file are subject to the Compiere License Version 1.1
|
||||
* ("License"); You may not use this file except in compliance with the License
|
||||
* You may obtain a copy of the License at http://www.compiere.org/license.html
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is Compiere ERP & CRM Business Solution
|
||||
* The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
|
||||
*
|
||||
* Copyright (C) 2005 Robert KLEIN. robeklein@gmail.com *
|
||||
* Contributor(s): ______________________________________.
|
||||
*****************************************************************************/
|
||||
package org.compiere.FA;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
|
||||
import org.compiere.model.MAssetChange;
|
||||
import org.compiere.model.MAssetTransfer;
|
||||
import org.compiere.model.MRefList;
|
||||
import org.compiere.model.X_A_Depreciation_Exp;
|
||||
import org.compiere.process.ProcessInfoParameter;
|
||||
import org.compiere.process.SvrProcess;
|
||||
import org.compiere.util.DB;
|
||||
|
||||
/**
|
||||
* Asset Transfer
|
||||
*
|
||||
* @author Rob Klein
|
||||
* @version $Id: AssetTransfer.java,v 1.0 $
|
||||
*/
|
||||
public class AssetTransfer extends SvrProcess
|
||||
{
|
||||
/** Record ID */
|
||||
private int p_Asset_Transfer_ID = 0;
|
||||
private boolean m_DeleteOld = false;
|
||||
|
||||
/**
|
||||
* Prepare - e.g., get Parameters.
|
||||
*/
|
||||
protected void prepare()
|
||||
{
|
||||
ProcessInfoParameter[] para = getParameter();
|
||||
for (int i = 0; i < para.length; i++)
|
||||
{
|
||||
String name = para[i].getParameterName();
|
||||
if (para[i].getParameter() == null)
|
||||
;
|
||||
else if (name.equals("DeleteOld"))
|
||||
m_DeleteOld = "Y".equals(para[i].getParameter());
|
||||
else
|
||||
log.info("prepare - Unknown Parameter: " + name);
|
||||
}
|
||||
p_Asset_Transfer_ID = getRecord_ID();
|
||||
} // prepare
|
||||
|
||||
|
||||
/**
|
||||
* Build Depreciation Workfile
|
||||
* @return info
|
||||
* @throws Exception
|
||||
*/
|
||||
protected String doIt() throws java.lang.Exception
|
||||
{
|
||||
log.info("doIt - Asset_Transfer_ID=" + p_Asset_Transfer_ID);
|
||||
if (p_Asset_Transfer_ID == 0)
|
||||
throw new IllegalArgumentException("No Record");
|
||||
|
||||
//
|
||||
int no = 0;
|
||||
BigDecimal v_Balance = new BigDecimal("0.0");
|
||||
|
||||
MAssetTransfer AssetTransfer = new MAssetTransfer (getCtx(), p_Asset_Transfer_ID, null);
|
||||
//X_C_Period Period = new X_C_Period (getCtx(), AssetTransfer.getC_Period_ID(), null);
|
||||
|
||||
String sql = null;
|
||||
log.info("doIt - Starting Transfer = " + no);
|
||||
|
||||
sql = "SELECT A_ASSET_ID, CHANGEAMT "
|
||||
+ "FROM A_ASSET_CHANGE "
|
||||
+ "WHERE A_ASSET_CHANGE.A_ASSET_ID = " + AssetTransfer.getA_Asset_ID()
|
||||
+ " AND A_ASSET_CHANGE.POSTINGTYPE = '" + AssetTransfer.getPostingType()
|
||||
+ "' AND A_ASSET_CHANGE.CHANGETYPE= 'D' "
|
||||
+ "AND TRUNC(A_ASSET_CHANGE.DATEACCT, 'YY') = TRUNC( " + DB.TO_DATE(AssetTransfer.getDateAcct()) + ", 'YY') "
|
||||
+ "AND TRUNC(A_ASSET_CHANGE.DATEACCT, 'MM') <= TRUNC( " + DB.TO_DATE(AssetTransfer.getDateAcct()) + ", 'MM') "
|
||||
+ "AND A_ASSET_CHANGE.C_VALIDCOMBINATION_ID = " + AssetTransfer.getA_Depreciation_Acct();
|
||||
|
||||
PreparedStatement pstmt = null;
|
||||
pstmt = DB.prepareStatement (sql,null);
|
||||
log.info("doIt - SQL=" + sql);
|
||||
ResultSet rs = null;
|
||||
//X_A_Depreciation_Exp depexp = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
|
||||
String clientCheck = " AND AD_Client_ID=" + AssetTransfer.getAD_Client_ID();
|
||||
|
||||
if (m_DeleteOld)
|
||||
{
|
||||
sql = "DELETE A_DEPRECIATION_EXP "
|
||||
+ "WHERE Processed='Y'"
|
||||
+ " AND A_Entry_Type = 'TRN'" + clientCheck;
|
||||
|
||||
no = DB.executeUpdate (sql,null);
|
||||
log.info ("doIt - Delete old processed entries =" + no);
|
||||
}
|
||||
try {
|
||||
|
||||
rs = pstmt.executeQuery();
|
||||
if (AssetTransfer.isA_Transfer_Balance_IS()==true)
|
||||
{
|
||||
while (rs.next());
|
||||
v_Balance = v_Balance.add(rs.getBigDecimal("ChangeAmt"));
|
||||
|
||||
// Create JV for the Income Statement Amounts
|
||||
X_A_Depreciation_Exp depexp0 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp0.setPostingType(AssetTransfer.getPostingType());
|
||||
depexp0.setA_Asset_ID(AssetTransfer.getA_Asset_ID());
|
||||
depexp0.setExpense(v_Balance);
|
||||
depexp0.setDateAcct(AssetTransfer.getDateAcct());
|
||||
depexp0.setA_Account_Number(AssetTransfer.getA_Depreciation_Acct_New());
|
||||
depexp0.setDescription("Asset Transfer");
|
||||
depexp0.setIsDepreciated(false);
|
||||
depexp0.setA_Period(AssetTransfer.getC_Period_ID());
|
||||
depexp0.setA_Entry_Type("TRN");
|
||||
depexp0.saveEx();
|
||||
|
||||
X_A_Depreciation_Exp depexp1 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp1.setPostingType(AssetTransfer.getPostingType());
|
||||
depexp1.setA_Asset_ID(AssetTransfer.getA_Asset_ID());
|
||||
depexp1.setExpense(v_Balance.multiply(new BigDecimal(-1)));
|
||||
depexp1.setDateAcct(AssetTransfer.getDateAcct());
|
||||
depexp1.setA_Account_Number(AssetTransfer.getA_Depreciation_Acct_New());
|
||||
depexp1.setDescription("Asset Transfer");
|
||||
depexp1.setIsDepreciated(false);
|
||||
depexp1.setA_Period(AssetTransfer.getC_Period_ID());
|
||||
depexp1.setA_Entry_Type("TRN");
|
||||
depexp1.saveEx();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.info("getDeliveries"+ e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
}
|
||||
|
||||
sql = null;
|
||||
|
||||
sql = "SELECT A_ASSET_COST, A_ACCUMULATED_DEPR "
|
||||
+ "FROM A_DEPRECIATION_WORKFILE "
|
||||
+ "WHERE A_ASSET_ID = " + AssetTransfer.getA_Asset_ID()
|
||||
+ " AND POSTINGTYPE = '" + AssetTransfer.getPostingType()
|
||||
+ "' AND AD_CLIENT_ID = " + AssetTransfer.getAD_Client_ID()
|
||||
+ " AND AD_ORG_ID = " + AssetTransfer.getAD_Org_ID();
|
||||
|
||||
pstmt = null;
|
||||
pstmt = DB.prepareStatement (sql,ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE,null);
|
||||
|
||||
try {
|
||||
rs = pstmt.executeQuery();
|
||||
rs.first();
|
||||
|
||||
X_A_Depreciation_Exp depexp2 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
|
||||
// Create JV for the accumulated depreciation of the asset
|
||||
depexp2.setPostingType(AssetTransfer.getPostingType());
|
||||
depexp2.setA_Asset_ID(AssetTransfer.getA_Asset_ID());
|
||||
depexp2.setExpense(rs.getBigDecimal("A_ACCUMULATED_DEPR"));
|
||||
depexp2.setDateAcct(AssetTransfer.getDateAcct());
|
||||
depexp2.setA_Account_Number(AssetTransfer.getA_Accumdepreciation_Acct_New());
|
||||
depexp2.setDescription("Asset Transfer Accum Dep");
|
||||
depexp2.setIsDepreciated(false);
|
||||
depexp2.setA_Period(AssetTransfer.getC_Period_ID());
|
||||
depexp2.setA_Entry_Type("TRN");
|
||||
depexp2.saveEx();
|
||||
|
||||
X_A_Depreciation_Exp depexp3 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp3.setPostingType(AssetTransfer.getPostingType());
|
||||
depexp3.setA_Asset_ID(AssetTransfer.getA_Asset_ID());
|
||||
depexp3.setExpense(rs.getBigDecimal("A_ACCUMULATED_DEPR").multiply(new BigDecimal(-1)));
|
||||
depexp3.setDateAcct(AssetTransfer.getDateAcct());
|
||||
depexp3.setA_Account_Number(AssetTransfer.getA_Accumdepreciation_Acct());
|
||||
depexp3.setDescription("Asset Transfer Accum Dep");
|
||||
depexp3.setIsDepreciated(false);
|
||||
depexp3.setA_Period(AssetTransfer.getC_Period_ID());
|
||||
depexp3.setA_Entry_Type("TRN");
|
||||
depexp3.saveEx();
|
||||
|
||||
X_A_Depreciation_Exp depexp4 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
// Create JV for the Cost of the asset
|
||||
depexp4.setPostingType(AssetTransfer.getPostingType());
|
||||
depexp4.setA_Asset_ID(AssetTransfer.getA_Asset_ID());
|
||||
depexp4.setExpense(rs.getBigDecimal("A_Asset_Cost"));
|
||||
depexp4.setDateAcct(AssetTransfer.getDateAcct());
|
||||
depexp4.setA_Account_Number(AssetTransfer.getA_Asset_Acct_New());
|
||||
depexp4.setDescription("Asset Transfer Cost");
|
||||
depexp4.setIsDepreciated(false);
|
||||
depexp4.setA_Period(AssetTransfer.getC_Period_ID());
|
||||
depexp4.setA_Entry_Type("TRN");
|
||||
depexp4.saveEx();
|
||||
|
||||
X_A_Depreciation_Exp depexp5 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp5.setPostingType(AssetTransfer.getPostingType());
|
||||
depexp5.setA_Asset_ID(AssetTransfer.getA_Asset_ID());
|
||||
depexp5.setExpense(rs.getBigDecimal("A_Asset_Cost").multiply(new BigDecimal(-1)));
|
||||
depexp5.setDateAcct(AssetTransfer.getDateAcct());
|
||||
depexp5.setA_Account_Number(AssetTransfer.getA_Asset_Acct());
|
||||
depexp5.setDescription("Asset Transfer Cost");
|
||||
depexp5.setIsDepreciated(false);
|
||||
depexp5.setA_Period(AssetTransfer.getC_Period_ID());
|
||||
depexp5.setA_Entry_Type("TRN");
|
||||
depexp5.saveEx();
|
||||
|
||||
|
||||
// Update Asset Setup for New Accounts
|
||||
sql = null;
|
||||
|
||||
sql = "UPDATE A_ASSET_ACCT "
|
||||
+ "SET A_DEPRECIATION_ACCT = " + AssetTransfer.getA_Depreciation_Acct_New()
|
||||
+ ", A_ACCUMDEPRECIATION_ACCT = " + AssetTransfer.getA_Accumdepreciation_Acct_New()
|
||||
+ ", A_DISPOSAL_LOSS = " + AssetTransfer.getA_Disposal_Loss_New()
|
||||
+ ", A_DISPOSAL_REVENUE = " + AssetTransfer.getA_Disposal_Revenue_New()
|
||||
+ ", A_ASSET_ACCT = "+ AssetTransfer.getA_Asset_Acct_New()
|
||||
+ " WHERE A_ASSET_ID = " + AssetTransfer.getA_Asset_ID()
|
||||
+ " AND POSTINGTYPE = '" + AssetTransfer.getPostingType()
|
||||
+ "' AND A_PERIOD_START = " + AssetTransfer.getA_Period_Start()
|
||||
+ " AND A_PERIOD_END = " + AssetTransfer.getA_Period_End();
|
||||
|
||||
|
||||
MAssetChange change = new MAssetChange (getCtx(), 0, null);
|
||||
change.setChangeType("TRN");
|
||||
change.setTextDetails(MRefList.getListDescription (getCtx(),"A_Update_Type" , "TRN"));
|
||||
change.setPostingType(AssetTransfer.getPostingType());
|
||||
change.setA_Split_Percent(AssetTransfer.getA_Split_Percent());
|
||||
change.setA_Asset_ID(AssetTransfer.getA_Asset_ID());
|
||||
change.setA_Period_Start(AssetTransfer.getA_Period_Start());
|
||||
change.setA_Period_End(AssetTransfer.getA_Period_End());
|
||||
change.setA_Asset_Acct(AssetTransfer.getA_Asset_Acct_New());
|
||||
change.setC_AcctSchema_ID(AssetTransfer.getC_AcctSchema_ID());
|
||||
change.setA_Accumdepreciation_Acct(AssetTransfer.getA_Accumdepreciation_Acct_New());
|
||||
change.setA_Depreciation_Acct(AssetTransfer.getA_Depreciation_Acct_New());
|
||||
change.setA_Disposal_Revenue(AssetTransfer.getA_Disposal_Revenue_New());
|
||||
change.setA_Disposal_Loss(AssetTransfer.getA_Disposal_Loss_New());
|
||||
change.setAssetAccumDepreciationAmt(rs.getBigDecimal("A_ACCUMULATED_DEPR"));
|
||||
change.setAssetBookValueAmt(rs.getBigDecimal("A_Asset_Cost"));
|
||||
change.setChangeAmt(v_Balance);
|
||||
change.saveEx();
|
||||
|
||||
DB.executeUpdate(sql,null);
|
||||
|
||||
AssetTransfer.setIsActive(false);
|
||||
AssetTransfer.saveEx();
|
||||
|
||||
// Remove Entry from Processing file
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.info("TransferAssets"+ e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
}
|
||||
return "";
|
||||
} // doIt
|
||||
|
||||
} // AssetTransfer
|
|
@ -1,388 +0,0 @@
|
|||
/******************************************************************************
|
||||
* The contents of this file are subject to the Compiere License Version 1.1
|
||||
* ("License"); You may not use this file except in compliance with the License
|
||||
* You may obtain a copy of the License at http://www.compiere.org/license.html
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is Compiere ERP & CRM Business Solution
|
||||
* The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
|
||||
*
|
||||
* Copyright (C) 2005 Robert KLEIN. robeklein@gmail.com *
|
||||
* Contributor(s): ______________________________________.
|
||||
*****************************************************************************/
|
||||
package org.compiere.FA;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Calendar;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
import org.compiere.model.X_A_Depreciation;
|
||||
import org.compiere.model.X_A_Depreciation_Convention;
|
||||
import org.compiere.model.X_A_Depreciation_Exp;
|
||||
import org.compiere.model.X_A_Depreciation_Forecast;
|
||||
import org.compiere.model.X_A_Depreciation_Method;
|
||||
import org.compiere.model.X_A_Depreciation_Workfile;
|
||||
import org.compiere.process.ProcessInfoParameter;
|
||||
import org.compiere.process.SvrProcess;
|
||||
import org.compiere.util.DB;
|
||||
|
||||
/**
|
||||
* Build Depreciation Forecast File
|
||||
*
|
||||
* @author Rob Klein
|
||||
* @version $Id: BuildDepForecastFile.java,v 1.0 $
|
||||
*/
|
||||
|
||||
public class BuildDepForecastFile extends SvrProcess
|
||||
{
|
||||
/** Record ID */
|
||||
private int p_Depreciation_Build_ID = 0;
|
||||
private boolean m_DeleteOld = false;
|
||||
|
||||
/**
|
||||
* Prepare - e.g., get Parameters.
|
||||
*/
|
||||
protected void prepare()
|
||||
{
|
||||
ProcessInfoParameter[] para = getParameter();
|
||||
for (int i = 0; i < para.length; i++)
|
||||
{
|
||||
String name = para[i].getParameterName();
|
||||
if (para[i].getParameter() == null)
|
||||
;
|
||||
else if (name.equals("DeleteOld"))
|
||||
m_DeleteOld = "Y".equals(para[i].getParameter());
|
||||
else
|
||||
log.info("prepare - Unknown Parameter: " + name);
|
||||
}
|
||||
p_Depreciation_Build_ID = getRecord_ID();
|
||||
} // prepare
|
||||
|
||||
|
||||
/**
|
||||
* Build Depreciation Workfile
|
||||
* @return info
|
||||
* @throws Exception
|
||||
*/
|
||||
protected String doIt() throws java.lang.Exception
|
||||
{
|
||||
log.info("doIt - Depreciation_Build_ID=" + p_Depreciation_Build_ID);
|
||||
if (p_Depreciation_Build_ID == 0)
|
||||
throw new IllegalArgumentException("No Record");
|
||||
String clientCheck = " AND AD_Client_ID=" + getAD_Client_ID();
|
||||
//
|
||||
int no = 0;
|
||||
|
||||
if (m_DeleteOld)
|
||||
{
|
||||
String sql = "DELETE A_DEPRECIATION_EXP "
|
||||
+ "WHERE A_Entry_Type = 'FOR'" + clientCheck;
|
||||
|
||||
no = DB.executeUpdate (sql,null);
|
||||
log.info ("doIt - Delete old processed entries =" + no);
|
||||
}
|
||||
|
||||
|
||||
X_A_Depreciation_Forecast DepBuild = new X_A_Depreciation_Forecast (getCtx(), p_Depreciation_Build_ID, null);
|
||||
String sql = null;
|
||||
sql = "DELETE FROM A_DEPRECIATION_EXP WHERE PostingType"
|
||||
+ " = '" + DepBuild.getPostingType() + "' and A_Asset_ID"
|
||||
+ " >= " + DepBuild.getA_Start_Asset_ID() + " and A_Asset_ID "
|
||||
+ " <= " + DepBuild.getA_End_Asset_ID()
|
||||
+ " and A_Entry_Type = 'FOR'"
|
||||
+ clientCheck;
|
||||
|
||||
no = DB.executeUpdate(sql,null);
|
||||
log.info("doIt - Clear DepExpense = " + no);
|
||||
|
||||
sql = null;
|
||||
sql = "UPDATE A_DEPRECIATION_WORKFILE SET A_CURR_DEP_EXP = 0, A_CURRENT_PERIOD = 0 WHERE POSTINGTYPE"
|
||||
+ " = '" + DepBuild.getPostingType() + "' and A_Asset_ID"
|
||||
+ " >= " + DepBuild.getA_Start_Asset_ID() + " and A_Asset_ID "
|
||||
+ " <= " + DepBuild.getA_End_Asset_ID()
|
||||
+ clientCheck;
|
||||
|
||||
no = DB.executeUpdate(sql,null);
|
||||
log.info("doIt - DepExpense Reset= " + no);
|
||||
|
||||
sql = null;
|
||||
sql =" SELECT A_ASSET.A_ASSET_ID, A_ASSET.USELIFEYEARS, A_ASSET.USELIFEMONTHS, A_ASSET.LIFEUSEUNITS, "
|
||||
+" A_ASSET.USEUNITS, A_ASSET.ISOWNED, A_ASSET.ISDISPOSED,A_DEPRECIATION_WORKFILE.A_PERIOD_POSTED, "
|
||||
+" A_DEPRECIATION_WORKFILE.A_CURR_DEP_EXP, A_ASSET.ASSETDEPRECIATIONDATE, A_ASSET.ISFULLYDEPRECIATED, "
|
||||
+" A_ASSET.ASSETSERVICEDATE, A_DEPRECIATION_WORKFILE.A_ASSET_ID as v_Asset_ID, A_DEPRECIATION_WORKFILE.POSTINGTYPE, "
|
||||
+" A_DEPRECIATION_FORECAST.A_START_ASSET_ID, A_DEPRECIATION_FORECAST.A_END_ASSET_ID, A_DEPRECIATION_WORKFILE.A_ACCUMULATED_DEPR,"
|
||||
+" A_DEPRECIATION_FORECAST.AD_CLIENT_ID, A_DEPRECIATION_FORECAST.AD_ORG_ID, A_DEPRECIATION_WORKFILE.A_SALVAGE_VALUE,"
|
||||
+" A_DEPRECIATION_FORECAST.CREATEDBY, A_DEPRECIATION_FORECAST.UPDATEDBY, A_DEPRECIATION_FORECAST.POSTINGTYPE as v_PostingType,"
|
||||
+" A_DEPRECIATION_WORKFILE.A_DEPRECIATION_WORKFILE_ID, A_DEPRECIATION_FORECAST.DATEDOC, A_DEPRECIATION_WORKFILE.A_ASSET_COST"
|
||||
+" FROM A_DEPRECIATION_WORKFILE, A_ASSET, A_DEPRECIATION_FORECAST "
|
||||
+" WHERE A_ASSET.A_ASSET_ID = A_DEPRECIATION_WORKFILE.A_ASSET_ID AND A_ASSET.ISOWNED = 'Y' AND A_DEPRECIATION_FORECAST.A_START_ASSET_ID <= A_ASSET.A_ASSET_ID"
|
||||
+" AND A_DEPRECIATION_FORECAST.A_END_ASSET_ID >= A_ASSET.A_ASSET_ID AND A_ASSET.ISFULLYDEPRECIATED = 'N' AND A_ASSET.ISDEPRECIATED = 'Y'"
|
||||
+" AND A_DEPRECIATION_WORKFILE.POSTINGTYPE = ? ";
|
||||
|
||||
PreparedStatement pstmt = null;
|
||||
pstmt = DB.prepareStatement (sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE,null);
|
||||
try {
|
||||
|
||||
pstmt.setString(1, DepBuild.getPostingType());
|
||||
ResultSet rs = pstmt.executeQuery();
|
||||
while (rs.next()){
|
||||
X_A_Depreciation_Workfile assetwk = new X_A_Depreciation_Workfile (getCtx(), rs.getInt("A_DEPRECIATION_WORKFILE_ID"), null);
|
||||
String sql2 = null;
|
||||
sql2 =" SELECT * FROM A_ASSET_ACCT WHERE PostingType"
|
||||
+ " = '" + DepBuild.getPostingType() + "' and A_Asset_ID"
|
||||
+ " = " + rs.getInt("A_ASSET_ID");
|
||||
|
||||
PreparedStatement pstmt2 = null;
|
||||
pstmt2 = DB.prepareStatement (sql2, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE,null);
|
||||
try {
|
||||
|
||||
ResultSet rs2 = pstmt2.executeQuery();
|
||||
//CallableStatement cs;
|
||||
BigDecimal v_Dep_Exp_Inception = new BigDecimal("0.0");
|
||||
BigDecimal v_Dep_Exp_Inception2 = new BigDecimal("0.0");
|
||||
BigDecimal v_HalfYearConv = new BigDecimal("0.0");
|
||||
BigDecimal v_HalfYearConv_Adj = new BigDecimal("0.0");
|
||||
BigDecimal v_Dep_Exp_Adjustment = new BigDecimal("0.0");
|
||||
BigDecimal v_Dep_Exp_Monthly = new BigDecimal("0.0");
|
||||
BigDecimal v_total_adjustment = new BigDecimal("0.0");
|
||||
int asset_id_current = 0;
|
||||
double v_current=0;
|
||||
BigDecimal v_current_adj = new BigDecimal(0.0);
|
||||
|
||||
while (rs2.next()){
|
||||
//X_A_Asset_Acct assetacct = new X_A_Asset_Acct (getCtx(), rs2.getInt("A_ASSET_ACCT_ID"), null);
|
||||
X_A_Depreciation depreciation = new X_A_Depreciation (getCtx(), rs2.getInt("A_DEPRECIATION_ID"), null);
|
||||
X_A_Depreciation_Convention depreciation_conv = new X_A_Depreciation_Convention (getCtx(), rs2.getInt("A_DEPRECIATION_CONV_ID"), null);
|
||||
X_A_Depreciation_Exp depexp = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
//Date d1,d2;
|
||||
//d1 = rs.getDate("ASSETSERVICEDATE");
|
||||
//d2 = rs.getDate("DATEDOC");
|
||||
Calendar calendar = new GregorianCalendar();
|
||||
calendar.setTime(rs.getDate("ASSETSERVICEDATE"));
|
||||
int AssetServiceDateYear = calendar.get(Calendar.YEAR);
|
||||
int AssetServiceDateMonth = calendar.get(Calendar.MONTH);
|
||||
calendar.setTime(rs.getDate("DATEDOC"));
|
||||
int DateAcctYear = calendar.get(Calendar.YEAR);
|
||||
int DateAcctMonth = calendar.get(Calendar.MONTH);
|
||||
|
||||
double v_period = (Math.ceil(DateAcctMonth)+ (Math.floor(DateAcctYear) - Math.floor(AssetServiceDateYear))*12 - Math.floor(AssetServiceDateMonth)) ;
|
||||
//Record booked depreciation expense
|
||||
if (rs2.getInt("A_ASSET_ID")!=asset_id_current )
|
||||
{
|
||||
v_current_adj = new BigDecimal(0.0);
|
||||
depexp.setPostingType(DepBuild.getPostingType());
|
||||
depexp.setA_Asset_ID(rs.getInt("A_ASSET_ID"));
|
||||
depexp.setA_Account_Number(rs2.getInt("A_Depreciation_Acct"));
|
||||
depexp.setPostingType(rs.getString("PostingType"));
|
||||
depexp.setExpense(assetwk.getA_Accumulated_Depr().setScale(5, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(rs2.getFloat("A_Split_Percent"))));
|
||||
depexp.setDescription("Actual Depreciation Expense Booked");
|
||||
depexp.setA_Period(rs.getInt("A_Period_Posted"));
|
||||
depexp.setIsDepreciated(true);
|
||||
depexp.setDateAcct(assetwk.getAssetDepreciationDate());
|
||||
depexp.setA_Entry_Type("FOR");
|
||||
depexp.saveEx();
|
||||
}
|
||||
else
|
||||
{
|
||||
v_current_adj = v_current_adj.subtract(new BigDecimal(0.0));
|
||||
}
|
||||
int method = 0;
|
||||
method = rs2.getInt("A_DEPRECIATION_METHOD_ID");
|
||||
|
||||
//Set depreciation date and record in workfile
|
||||
Calendar cal = GregorianCalendar.getInstance();
|
||||
Timestamp ts;
|
||||
ts =(rs.getTimestamp("ASSETSERVICEDATE"));
|
||||
cal.setTime(ts);
|
||||
assetwk.setDateAcct(ts);
|
||||
assetwk.setA_Period_Forecast(new BigDecimal(assetwk.getA_Period_Posted()));
|
||||
assetwk.saveEx();
|
||||
|
||||
|
||||
//Calculate life to date depreciation
|
||||
while (v_current < v_period ){
|
||||
v_Dep_Exp_Inception2 = Depreciation.Dep_Type(depreciation.getDepreciationType(),rs2.getInt("A_Asset_ID"),v_current, rs2.getString("PostingType"), rs2.getInt("A_ASSET_ACCT_ID"), v_Dep_Exp_Inception);
|
||||
//cs = DB.prepareCall("{ ? = call "+ depreciation.getDepreciationType() + "(" + rs2.getInt("A_Asset_ID") + "," + (v_current) + ",'" + rs2.getString("PostingType") + "'," + rs2.getInt("A_ASSET_ACCT_ID") + "," + v_Dep_Exp_Inception + ")}");
|
||||
//cs.registerOutParameter(1, java.sql.Types.DECIMAL);
|
||||
//cs.execute();
|
||||
//v_Dep_Exp_Inception2 = cs.getBigDecimal(1);
|
||||
//cs.close();
|
||||
v_HalfYearConv_Adj = new BigDecimal(Conventions.Dep_Convention(depreciation_conv.getConventionType(),rs2.getInt("A_Asset_ID"), rs2.getString("PostingType"), rs2.getInt("A_ASSET_ACCT_ID"), 1, (v_current -1 )));
|
||||
//cs = DB.prepareCall("{ ? = call " + depreciation_conv.getConventionType() + "(" + rs2.getInt("A_Asset_ID") + ",'" + rs2.getString("PostingType") + "'," + rs2.getInt("A_ASSET_ACCT_ID") + ", 1 ," + (v_current -1 )+ ")}");
|
||||
//cs.registerOutParameter(1, java.sql.Types.DECIMAL);
|
||||
//cs.execute();
|
||||
//v_HalfYearConv_Adj = cs.getBigDecimal(1);
|
||||
//cs.close();
|
||||
v_HalfYearConv = v_HalfYearConv.add(v_HalfYearConv_Adj);
|
||||
cal.add(Calendar.MONTH, 1);
|
||||
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
|
||||
ts.setTime(cal.getTimeInMillis());
|
||||
assetwk.setDateAcct(ts);
|
||||
v_current_adj = v_current_adj.add((v_HalfYearConv_Adj));
|
||||
assetwk.setA_Period_Forecast(v_current_adj);
|
||||
assetwk.saveEx();
|
||||
v_Dep_Exp_Inception = v_Dep_Exp_Inception .add(v_Dep_Exp_Inception2.multiply(v_HalfYearConv_Adj));
|
||||
v_current = v_current + 1;
|
||||
}
|
||||
|
||||
//log.info("doIt - Booked Expense= "+assetwk.getA_Accumulated_Depr());
|
||||
//log.info("doIt - Calculated Expense= "+v_Dep_Exp_Inception);
|
||||
|
||||
|
||||
//Calculate necessary adjustment per period
|
||||
X_A_Depreciation_Method depreciation_method = new X_A_Depreciation_Method (getCtx(), method, null);
|
||||
if (v_Dep_Exp_Inception.compareTo( assetwk.getA_Accumulated_Depr())!=0)
|
||||
{
|
||||
v_Dep_Exp_Adjustment = DepreciationAdj.Dep_Adj(depreciation_method.getDepreciationType(),rs2.getInt("A_Asset_ID") , (v_Dep_Exp_Inception.subtract(assetwk.getA_Accumulated_Depr())) , (Math.floor(DateAcctMonth)), rs2.getString("PostingType") , rs2.getInt("A_ASSET_ACCT_ID"));
|
||||
//cs = DB.prepareCall("{ ? = call " + depreciation_method.getDepreciationType() + "(" + rs2.getInt("A_Asset_ID") + "," + (v_Dep_Exp_Inception.subtract(assetwk.getA_Accumulated_Depr())) + "," + (Math.floor(d2.getMonth()))+ ",'" + rs2.getString("PostingType") + "'," +rs2.getInt("A_ASSET_ACCT_ID") +")}");
|
||||
//cs.registerOutParameter(1, java.sql.Types.DECIMAL);
|
||||
//cs.execute();
|
||||
//v_Dep_Exp_Adjustment = cs.getBigDecimal(1);
|
||||
//cs.close();
|
||||
v_total_adjustment = v_Dep_Exp_Inception.subtract(assetwk.getA_Accumulated_Depr());
|
||||
}
|
||||
|
||||
v_current = v_current+1;
|
||||
//v_Dep_Exp_Inception = (rs.getBigDecimal("A_ACCUMULATED_DEPR"));
|
||||
BigDecimal v_period_adj = new BigDecimal(rs2.getInt("A_PERIOD_END"));
|
||||
int lastdepexp2=0;
|
||||
|
||||
while (v_current_adj.compareTo(v_period_adj)<0){
|
||||
//Calculation depreciation expense
|
||||
v_Dep_Exp_Monthly = Depreciation.Dep_Type(depreciation.getDepreciationType(),rs2.getInt("A_Asset_ID"),v_current-1, rs2.getString("PostingType"), rs2.getInt("A_ASSET_ACCT_ID"), v_Dep_Exp_Inception);
|
||||
//cs = DB.prepareCall("{ ? = call " + depreciation.getDepreciationType() + "(" + rs2.getInt("A_Asset_ID") +", "+ (v_current-1) +" ,'" + rs2.getString("PostingType") + "'," + rs2.getInt("A_ASSET_ACCT_ID") + " , " + (v_Dep_Exp_Inception) + ")}");
|
||||
//cs.registerOutParameter(1, java.sql.Types.DECIMAL);
|
||||
//cs.execute();
|
||||
//v_Dep_Exp_Monthly = cs.getBigDecimal(1);
|
||||
//cs.close();
|
||||
//Adjust for half year convention
|
||||
//log.info(depreciation_conv.getConventionType());
|
||||
//log.info(""+rs2.getInt("A_Asset_ID"));
|
||||
v_HalfYearConv_Adj = new BigDecimal(Conventions.Dep_Convention(depreciation_conv.getConventionType(),rs2.getInt("A_Asset_ID"), rs2.getString("PostingType"), rs2.getInt("A_ASSET_ACCT_ID"), 0, 1 ));
|
||||
//log.info(""+v_HalfYearConv_Adj);
|
||||
//cs = DB.prepareCall("{ ? = call " + depreciation_conv.getConventionType() + "(" + rs2.getInt("A_Asset_ID") +",'" + rs2.getString("PostingType") + "'," + rs2.getInt("A_ASSET_ACCT_ID") + " , 0, 1)}");
|
||||
//cs.registerOutParameter(1, java.sql.Types.DECIMAL);
|
||||
//cs.execute();
|
||||
//v_HalfYearConv_Adj = cs.getBigDecimal(1);
|
||||
//cs.close();
|
||||
v_Dep_Exp_Monthly = v_Dep_Exp_Monthly.multiply((v_HalfYearConv_Adj));
|
||||
v_HalfYearConv = v_HalfYearConv.add( v_HalfYearConv_Adj);
|
||||
|
||||
X_A_Depreciation_Exp depexp2 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
if (v_total_adjustment.setScale(2, BigDecimal.ROUND_HALF_UP).compareTo(new BigDecimal (0.00))!=0)
|
||||
{
|
||||
|
||||
//Record necessary adjustments
|
||||
|
||||
X_A_Depreciation_Exp depexp1 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp1.setA_Entry_Type("FOR");
|
||||
depexp1.setA_Asset_ID(rs.getInt("A_ASSET_ID"));
|
||||
depexp1.setA_Account_Number(rs2.getInt("A_Depreciation_Acct"));
|
||||
depexp1.setPostingType(rs.getString("PostingType"));
|
||||
depexp1.setExpense(v_Dep_Exp_Adjustment.setScale(5, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(rs2.getFloat("A_Split_Percent"))));
|
||||
depexp1.setDescription("Forecasted Depreciation Expense Adj.");
|
||||
depexp1.setA_Period((int)v_current);
|
||||
depexp1.setIsDepreciated(true);
|
||||
depexp1.setDateAcct(ts);
|
||||
depexp1.saveEx();
|
||||
v_total_adjustment = v_total_adjustment.setScale(5, BigDecimal.ROUND_HALF_UP).subtract(v_Dep_Exp_Adjustment.setScale(5, BigDecimal.ROUND_HALF_UP));
|
||||
|
||||
//Record adjusted expense
|
||||
depexp2.setPostingType(DepBuild.getPostingType());
|
||||
depexp2.setA_Asset_ID(rs.getInt("A_ASSET_ID"));
|
||||
depexp2.setA_Account_Number(rs2.getInt("A_Depreciation_Acct"));
|
||||
depexp2.setPostingType(rs.getString("PostingType"));
|
||||
depexp2.setExpense((v_Dep_Exp_Monthly.setScale(2, BigDecimal.ROUND_HALF_UP)).multiply(new BigDecimal(rs2.getFloat("A_Split_Percent"))));
|
||||
depexp2.setDescription("Forecasted Depreciation Expense");
|
||||
depexp2.setA_Period((int)v_current);
|
||||
depexp2.setIsDepreciated(true);
|
||||
depexp2.setDateAcct(ts);
|
||||
depexp2.setA_Entry_Type("FOR");
|
||||
depexp2.saveEx();
|
||||
v_Dep_Exp_Inception = v_Dep_Exp_Inception.add((v_Dep_Exp_Monthly.setScale(2, BigDecimal.ROUND_HALF_UP))).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Record expense
|
||||
depexp2.setPostingType(DepBuild.getPostingType());
|
||||
depexp2.setA_Asset_ID(rs.getInt("A_ASSET_ID"));
|
||||
depexp2.setExpense(v_Dep_Exp_Adjustment.setScale(2, BigDecimal.ROUND_HALF_UP));
|
||||
depexp2.setA_Account_Number(rs2.getInt("A_Depreciation_Acct"));
|
||||
depexp2.setPostingType(rs.getString("PostingType"));
|
||||
depexp2.setExpense(v_Dep_Exp_Monthly.setScale(2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(rs2.getFloat("A_Split_Percent"))));
|
||||
depexp2.setDescription("Forecasted Depreciation Expense");
|
||||
depexp2.setA_Period((int)v_current);
|
||||
depexp2.setIsDepreciated(true);
|
||||
depexp2.setDateAcct(ts);
|
||||
depexp2.setA_Entry_Type("FOR");
|
||||
depexp2.saveEx();
|
||||
v_Dep_Exp_Inception = v_Dep_Exp_Inception.add(v_Dep_Exp_Monthly).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
lastdepexp2 = depexp2.get_ID();
|
||||
//Advance calender
|
||||
cal.add(Calendar.MONTH, 1);
|
||||
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
|
||||
ts.setTime(cal.getTimeInMillis());
|
||||
v_current_adj = v_current_adj.add((v_HalfYearConv_Adj)).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
|
||||
//record in workfile
|
||||
assetwk.setA_Period_Forecast(v_current_adj);
|
||||
assetwk.setDateAcct(ts);
|
||||
assetwk.saveEx();
|
||||
v_current = v_current + 1;
|
||||
}
|
||||
//adjust last entry for rounding errors
|
||||
X_A_Depreciation_Exp depexp2 = new X_A_Depreciation_Exp (getCtx(), lastdepexp2, null);
|
||||
depexp2.setExpense(depexp2.getExpense().add(((rs.getBigDecimal("A_ASSET_COST").subtract(rs.getBigDecimal("A_SALVAGE_VALUE").subtract(v_total_adjustment))).subtract(v_Dep_Exp_Inception)).multiply(new BigDecimal(rs2.getFloat("A_Split_Percent")))));
|
||||
depexp2.saveEx();
|
||||
asset_id_current = rs2.getInt("A_ASSET_ID");
|
||||
log.info("Asset #"+asset_id_current);
|
||||
}
|
||||
rs2.close();
|
||||
pstmt2.close();
|
||||
pstmt2 = null;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.info("getAssets"+ e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
if (pstmt2 != null)
|
||||
pstmt2.close ();
|
||||
}
|
||||
catch (Exception e)
|
||||
{}
|
||||
pstmt2 = null;
|
||||
}
|
||||
}
|
||||
rs.close();
|
||||
pstmt.close();
|
||||
pstmt = null;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.info("getAssets"+ e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
if (pstmt != null)
|
||||
pstmt.close ();
|
||||
}
|
||||
catch (Exception e)
|
||||
{}
|
||||
pstmt = null;
|
||||
}
|
||||
|
||||
return "";
|
||||
} // doIt
|
||||
|
||||
} // BuildDepForecastFile
|
|
@ -1,431 +0,0 @@
|
|||
/******************************************************************************
|
||||
* The contents of this file are subject to the Compiere License Version 1.1
|
||||
* ("License"); You may not use this file except in compliance with the License
|
||||
* You may obtain a copy of the License at http://www.compiere.org/license.html
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is Compiere ERP & CRM Business Solution
|
||||
* The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
|
||||
*
|
||||
* Copyright (C) 2005 Robert KLEIN. robeklein@gmail.com *
|
||||
* Contributor(s): ______________________________________.
|
||||
*****************************************************************************/
|
||||
package org.compiere.FA;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Calendar;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
import org.compiere.model.X_A_Depreciation;
|
||||
import org.compiere.model.X_A_Depreciation_Build;
|
||||
import org.compiere.model.X_A_Depreciation_Convention;
|
||||
import org.compiere.model.X_A_Depreciation_Exp;
|
||||
import org.compiere.model.X_A_Depreciation_Method;
|
||||
import org.compiere.model.X_A_Depreciation_Workfile;
|
||||
import org.compiere.process.ProcessInfoParameter;
|
||||
import org.compiere.process.SvrProcess;
|
||||
import org.compiere.util.DB;
|
||||
|
||||
/**
|
||||
* Build Depreciation Work File
|
||||
*
|
||||
* @author Rob Klein
|
||||
* @version $Id: BuildDepWorkFile.java,v 1.0 $
|
||||
*/
|
||||
|
||||
public class BuildDepWorkFile extends SvrProcess
|
||||
{
|
||||
/** Record ID */
|
||||
private int p_Depreciation_Build_ID = 0;
|
||||
private boolean m_DeleteOld = false;
|
||||
|
||||
/**
|
||||
* Prepare - e.g., get Parameters.
|
||||
*/
|
||||
protected void prepare()
|
||||
{
|
||||
ProcessInfoParameter[] para = getParameter();
|
||||
for (int i = 0; i < para.length; i++)
|
||||
{
|
||||
String name = para[i].getParameterName();
|
||||
if (para[i].getParameter() == null)
|
||||
;
|
||||
else if (name.equals("DeleteOld"))
|
||||
m_DeleteOld = "Y".equals(para[i].getParameter());
|
||||
else
|
||||
log.info("prepare - Unknown Parameter: " + name);
|
||||
}
|
||||
p_Depreciation_Build_ID = getRecord_ID();
|
||||
} // prepare
|
||||
|
||||
|
||||
/**
|
||||
* Build Depreciation Workfile
|
||||
* @return info
|
||||
* @throws Exception
|
||||
*/
|
||||
protected String doIt() throws java.lang.Exception
|
||||
{
|
||||
log.info("doIt - Depreciation_Build_ID=" + p_Depreciation_Build_ID);
|
||||
if (p_Depreciation_Build_ID == 0)
|
||||
throw new IllegalArgumentException("No Record");
|
||||
String clientCheck = " AND AD_Client_ID=" + getAD_Client_ID();
|
||||
//
|
||||
int no = 0;
|
||||
|
||||
//if (m_DeleteOld)
|
||||
//{
|
||||
// String sql = "DELETE A_DEPRECIATION_EXP "
|
||||
// + "WHERE A_Entry_Type = 'FOR'" + clientCheck;
|
||||
//
|
||||
// no = DB.executeUpdate (sql);
|
||||
// log.info ("doIt - Delete old processed entries =" + no);
|
||||
//}
|
||||
|
||||
|
||||
X_A_Depreciation_Build DepBuild = new X_A_Depreciation_Build (getCtx(), p_Depreciation_Build_ID, null);
|
||||
String sql = null;
|
||||
sql = "DELETE FROM A_DEPRECIATION_EXP WHERE PostingType"
|
||||
+ " = '" + DepBuild.getPostingType() + "' and A_Asset_ID"
|
||||
+ " >= " + DepBuild.getA_Start_Asset_ID() + " and A_Asset_ID "
|
||||
+ " <= " + DepBuild.getA_End_Asset_ID()
|
||||
+ " AND A_Entry_Type = 'DEP'"
|
||||
+ clientCheck;
|
||||
|
||||
no = DB.executeUpdate(sql,null);
|
||||
log.info("doIt - Clear DepExpense = " + no);
|
||||
|
||||
sql = null;
|
||||
sql = "UPDATE A_DEPRECIATION_WORKFILE SET A_CURR_DEP_EXP = 0, A_CURRENT_PERIOD = 0 WHERE POSTINGTYPE"
|
||||
+ " = '" + DepBuild.getPostingType() + "' and A_Asset_ID"
|
||||
+ " >= " + DepBuild.getA_Start_Asset_ID() + " and A_Asset_ID "
|
||||
+ " <= " + DepBuild.getA_End_Asset_ID()
|
||||
+ clientCheck;
|
||||
|
||||
no = DB.executeUpdate(sql,null);
|
||||
log.info("doIt - DepExpense Reset= " + no);
|
||||
|
||||
sql = null;
|
||||
sql =" SELECT A_ASSET.A_ASSET_ID, A_ASSET.USELIFEYEARS, A_ASSET.USELIFEMONTHS, A_ASSET.LIFEUSEUNITS, "
|
||||
+ "A_ASSET.USEUNITS, A_ASSET.ISOWNED, A_ASSET.ISDISPOSED,A_DEPRECIATION_WORKFILE.A_PERIOD_POSTED, "
|
||||
+ " A_DEPRECIATION_WORKFILE.A_CURR_DEP_EXP, A_ASSET.ASSETDEPRECIATIONDATE, A_ASSET.ISFULLYDEPRECIATED, "
|
||||
+ " A_ASSET.ASSETSERVICEDATE, A_DEPRECIATION_WORKFILE.A_ASSET_ID as v_Asset_ID, A_DEPRECIATION_WORKFILE.POSTINGTYPE, "
|
||||
+ " A_DEPRECIATION_BUILD.A_START_ASSET_ID, A_DEPRECIATION_BUILD.A_END_ASSET_ID, A_DEPRECIATION_WORKFILE.A_ACCUMULATED_DEPR, "
|
||||
+ " A_DEPRECIATION_BUILD.PERIODNO, A_DEPRECIATION_BUILD.AD_CLIENT_ID, A_DEPRECIATION_BUILD.AD_ORG_ID, "
|
||||
+ " A_DEPRECIATION_BUILD.CREATEDBY, A_DEPRECIATION_BUILD.UPDATEDBY, A_DEPRECIATION_BUILD.POSTINGTYPE as v_PostingType, "
|
||||
+ " A_DEPRECIATION_BUILD.DATEACCT, A_DEPRECIATION_BUILD.C_PERIOD_ID, A_DEPRECIATION_WORKFILE.A_DEPRECIATION_WORKFILE_ID, "
|
||||
+ " A_DEPRECIATION_BUILD.DATEDOC "
|
||||
+ " FROM A_DEPRECIATION_WORKFILE, A_ASSET, A_DEPRECIATION_BUILD "
|
||||
+ " WHERE A_ASSET.A_ASSET_ID = A_DEPRECIATION_WORKFILE.A_ASSET_ID AND A_ASSET.ISOWNED = 'Y' AND "
|
||||
+ " A_DEPRECIATION_BUILD.DATEACCT >= A_ASSET.ASSETSERVICEDATE AND A_DEPRECIATION_BUILD.A_START_ASSET_ID <= A_ASSET.A_ASSET_ID "
|
||||
+ " AND A_DEPRECIATION_BUILD.A_END_ASSET_ID >= A_ASSET.A_ASSET_ID AND A_ASSET.ISFULLYDEPRECIATED = 'N' AND A_ASSET.ISDEPRECIATED = 'Y' "
|
||||
+ " AND A_DEPRECIATION_WORKFILE.POSTINGTYPE = ? ";
|
||||
|
||||
PreparedStatement pstmt = null;
|
||||
pstmt = DB.prepareStatement (sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE,null);
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
|
||||
pstmt.setString(1, DepBuild.getPostingType());
|
||||
rs = pstmt.executeQuery();
|
||||
while (rs.next()){
|
||||
X_A_Depreciation_Workfile assetwk = new X_A_Depreciation_Workfile (getCtx(), rs.getInt("A_DEPRECIATION_WORKFILE_ID"), null);
|
||||
String sql2 = null;
|
||||
sql2 =" SELECT * FROM A_ASSET_ACCT WHERE PostingType"
|
||||
+ " = '" + DepBuild.getPostingType() + "' and A_Asset_ID"
|
||||
+ " = " + rs.getInt("A_ASSET_ID");
|
||||
|
||||
PreparedStatement pstmt2 = null;
|
||||
pstmt2 = DB.prepareStatement (sql2, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE,null);
|
||||
ResultSet rs2 = null;
|
||||
try {
|
||||
|
||||
rs2 = pstmt2.executeQuery();
|
||||
//CallableStatement cs;
|
||||
BigDecimal v_Dep_Exp_Inception = new BigDecimal("0.0");
|
||||
BigDecimal v_Dep_Exp_Inception2 = new BigDecimal("0.0");
|
||||
BigDecimal v_HalfYearConv = new BigDecimal("0.0");
|
||||
BigDecimal v_HalfYearConv_Adj = new BigDecimal("0.0");
|
||||
BigDecimal v_Dep_Exp_Adjustment = new BigDecimal("0.0");
|
||||
BigDecimal v_Dep_Exp_Monthly = new BigDecimal("0.0");
|
||||
BigDecimal v_total_adjustment = new BigDecimal("0.0");
|
||||
int asset_id_current = 0;
|
||||
double v_current=0;
|
||||
BigDecimal v_current_adj = new BigDecimal(0.0);
|
||||
|
||||
while (rs2.next()){
|
||||
//X_A_Asset_Acct assetacct = new X_A_Asset_Acct (getCtx(), rs2.getInt("A_ASSET_ACCT_ID"), null);
|
||||
X_A_Depreciation depreciation = new X_A_Depreciation (getCtx(), rs2.getInt("A_DEPRECIATION_ID"), null);
|
||||
X_A_Depreciation_Convention depreciation_conv = new X_A_Depreciation_Convention (getCtx(), rs2.getInt("A_DEPRECIATION_CONV_ID"), null);
|
||||
//X_A_Depreciation_Exp depexp = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
//Date d1,d2;
|
||||
//d1 = rs.getDate("ASSETSERVICEDATE");
|
||||
//d2 = rs.getDate("DATEACCT");
|
||||
Calendar calendar = new GregorianCalendar();
|
||||
calendar.setTime(rs.getDate("ASSETSERVICEDATE"));
|
||||
int AssetServiceDateYear = calendar.get(Calendar.YEAR);
|
||||
int AssetServiceDateMonth = calendar.get(Calendar.MONTH);
|
||||
calendar.setTime(rs.getDate("DATEACCT"));
|
||||
int DateAcctYear = calendar.get(Calendar.YEAR);
|
||||
int DateAcctMonth = calendar.get(Calendar.MONTH);
|
||||
double v_period = (Math.ceil(DateAcctMonth)+ (Math.floor(DateAcctYear) - Math.floor(AssetServiceDateYear))*12 - Math.floor(AssetServiceDateMonth)) ;
|
||||
//Record booked depreciation expense
|
||||
|
||||
if (rs2.getInt("A_ASSET_ID")!=asset_id_current )
|
||||
{
|
||||
v_current_adj = new BigDecimal(0.0);
|
||||
//depexp.setPostingType(DepBuild.getPostingType());
|
||||
//depexp.setA_Asset_ID(rs.getInt("A_ASSET_ID"));
|
||||
//depexp.setA_Account_Number(rs2.getInt("A_Depreciation_Acct"));
|
||||
//depexp.setPostingType(rs.getString("PostingType"));
|
||||
//depexp.setExpense(assetwk.getA_Accumulated_Depr().setScale(5, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(rs2.getFloat("A_Split_Percent"))));
|
||||
//depexp.setDescription("Actual Depreciation Expense Booked");
|
||||
//depexp.setA_Period(rs.getInt("A_Period_Posted"));
|
||||
//depexp.setIsDepreciated(true);
|
||||
//depexp.setDateAcct(assetwk.getAssetDepreciationDate());
|
||||
//depexp.setA_Entry_Type("DEP");
|
||||
//depexp.saveEx();
|
||||
}
|
||||
else
|
||||
{
|
||||
v_current_adj = v_current_adj.subtract(new BigDecimal(0.0));
|
||||
}
|
||||
|
||||
int method = 0;
|
||||
method = rs2.getInt("A_DEPRECIATION_METHOD_ID");
|
||||
|
||||
//Set depreciation date and record in workfile
|
||||
Calendar cal = GregorianCalendar.getInstance();
|
||||
Timestamp ts;
|
||||
ts =(rs.getTimestamp("ASSETSERVICEDATE"));
|
||||
cal.setTime(ts);
|
||||
assetwk.setDateAcct(ts);
|
||||
assetwk.setA_Period_Forecast(new BigDecimal(assetwk.getA_Period_Posted()));
|
||||
assetwk.saveEx();
|
||||
|
||||
|
||||
//Calculate life to date depreciation
|
||||
while (v_current < v_period ){
|
||||
v_Dep_Exp_Inception2 = Depreciation.Dep_Type(depreciation.getDepreciationType(),rs2.getInt("A_Asset_ID"),v_current, rs2.getString("PostingType"), rs2.getInt("A_ASSET_ACCT_ID"), v_Dep_Exp_Inception);
|
||||
//cs = DB.prepareCall("{ ? = call "+ depreciation.getDepreciationType() + "(" + rs2.getInt("A_Asset_ID") + "," + (v_current) + ",'" + rs2.getString("PostingType") + "'," + rs2.getInt("A_ASSET_ACCT_ID") + "," + v_Dep_Exp_Inception + ")}");
|
||||
//cs.registerOutParameter(1, java.sql.Types.DECIMAL);
|
||||
//cs.execute();
|
||||
//v_Dep_Exp_Inception2 = cs.getBigDecimal(1);
|
||||
//cs.close();
|
||||
v_HalfYearConv_Adj = new BigDecimal(Conventions.Dep_Convention(depreciation_conv.getConventionType(),rs2.getInt("A_Asset_ID"), rs2.getString("PostingType"), rs2.getInt("A_ASSET_ACCT_ID"), 1, (v_current -1 )));
|
||||
//cs = DB.prepareCall("{ ? = call " + depreciation_conv.getConventionType() + "(" + rs2.getInt("A_Asset_ID") + ",'" + rs2.getString("PostingType") + "'," + rs2.getInt("A_ASSET_ACCT_ID") + ", 1 ," + (v_current -1 )+ ")}");
|
||||
//cs.registerOutParameter(1, java.sql.Types.DECIMAL);
|
||||
//cs.execute();
|
||||
//v_HalfYearConv_Adj = cs.getBigDecimal(1);
|
||||
//cs.close();
|
||||
v_HalfYearConv = v_HalfYearConv.add(v_HalfYearConv_Adj);
|
||||
cal.add(Calendar.MONTH, 1);
|
||||
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
|
||||
ts.setTime(cal.getTimeInMillis());
|
||||
assetwk.setDateAcct(ts);
|
||||
v_current_adj = v_current_adj.add((v_HalfYearConv_Adj));
|
||||
assetwk.setA_Period_Forecast(v_current_adj);
|
||||
assetwk.saveEx();
|
||||
v_Dep_Exp_Inception = v_Dep_Exp_Inception .add(v_Dep_Exp_Inception2.multiply(v_HalfYearConv_Adj));
|
||||
v_current = v_current + 1;
|
||||
}
|
||||
|
||||
//log.info("doIt - Booked Expense= "+assetwk.getA_Accumulated_Depr());
|
||||
//log.info("doIt - Calculated Expense= "+v_Dep_Exp_Inception);
|
||||
|
||||
|
||||
//Calculate necessary adjustment per period
|
||||
X_A_Depreciation_Method depreciation_method = new X_A_Depreciation_Method (getCtx(), method, null);
|
||||
if (v_Dep_Exp_Inception.compareTo( assetwk.getA_Accumulated_Depr())!=0)
|
||||
{
|
||||
v_Dep_Exp_Adjustment = DepreciationAdj.Dep_Adj(depreciation_method.getDepreciationType(),rs2.getInt("A_Asset_ID") , (v_Dep_Exp_Inception.subtract(assetwk.getA_Accumulated_Depr())) , (Math.floor(DateAcctMonth)), rs2.getString("PostingType") , rs2.getInt("A_ASSET_ACCT_ID"));
|
||||
//cs = DB.prepareCall("{ ? = call " + depreciation_method.getDepreciationType() + "(" + rs2.getInt("A_Asset_ID") + "," + (v_Dep_Exp_Inception.subtract(assetwk.getA_Accumulated_Depr())) + "," + (Math.floor(d2.getMonth()))+ ",'" + rs2.getString("PostingType") + "'," +rs2.getInt("A_ASSET_ACCT_ID") +")}");
|
||||
//cs.registerOutParameter(1, java.sql.Types.DECIMAL);
|
||||
//cs.execute();
|
||||
//v_Dep_Exp_Adjustment = cs.getBigDecimal(1);
|
||||
//cs.close();
|
||||
//log.info("doIt - callable statement #3= "+v_Dep_Exp_Adjustment);
|
||||
v_total_adjustment = v_Dep_Exp_Inception.subtract(assetwk.getA_Accumulated_Depr());
|
||||
}
|
||||
|
||||
|
||||
//Record necessary adjustments
|
||||
if (v_Dep_Exp_Adjustment.setScale(2, BigDecimal.ROUND_HALF_UP).compareTo(new BigDecimal (0.00))!=0)
|
||||
{
|
||||
X_A_Depreciation_Exp depexp1 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp1.setA_Entry_Type("DEP");
|
||||
depexp1.setA_Asset_ID(rs.getInt("A_ASSET_ID"));
|
||||
depexp1.setA_Account_Number(rs2.getInt("A_Depreciation_Acct"));
|
||||
depexp1.setPostingType(rs.getString("PostingType"));
|
||||
depexp1.setExpense(v_Dep_Exp_Adjustment.setScale(2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(rs2.getFloat("A_Split_Percent"))));
|
||||
depexp1.setDescription("Depreciation Expense Adj.");
|
||||
depexp1.setA_Period(rs.getInt("C_Period_ID"));
|
||||
depexp1.setIsDepreciated(true);
|
||||
depexp1.setDateAcct(rs.getTimestamp("DateAcct"));
|
||||
depexp1.saveEx();
|
||||
|
||||
X_A_Depreciation_Exp depexp2 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp2.setA_Asset_ID(rs.getInt("A_ASSET_ID"));
|
||||
depexp2.setA_Account_Number(rs2.getInt("A_AccumDepreciation_Acct"));
|
||||
depexp2.setPostingType(rs.getString("PostingType"));
|
||||
depexp2.setExpense(v_Dep_Exp_Adjustment.setScale(2, BigDecimal.ROUND_HALF_UP).multiply( new BigDecimal(-1 * rs2.getFloat("A_Split_Percent"))));
|
||||
depexp2.setDescription("Depreciation Expense Adj.");
|
||||
depexp2.setA_Period(rs.getInt("C_Period_ID"));
|
||||
depexp2.setIsDepreciated(false);
|
||||
depexp2.setDateAcct(rs.getTimestamp("DateAcct"));
|
||||
depexp2.setA_Entry_Type("DEP");
|
||||
depexp2.saveEx();
|
||||
|
||||
v_total_adjustment = v_total_adjustment.setScale(5, BigDecimal.ROUND_HALF_UP).subtract(v_Dep_Exp_Adjustment.setScale(5, BigDecimal.ROUND_HALF_UP));
|
||||
}
|
||||
v_current = v_current+1;
|
||||
//v_Dep_Exp_Inception = (rs.getBigDecimal("A_ACCUMULATED_DEPR"));
|
||||
//BigDecimal v_period_adj = new BigDecimal(rs2.getInt("A_PERIOD_END"));
|
||||
int lastdepexp2=0;
|
||||
|
||||
|
||||
//Calculation depreciation expense
|
||||
v_Dep_Exp_Monthly = Depreciation.Dep_Type(depreciation.getDepreciationType(),rs2.getInt("A_Asset_ID"),v_current-1, rs2.getString("PostingType"), rs2.getInt("A_ASSET_ACCT_ID"), v_Dep_Exp_Inception);
|
||||
//cs = DB.prepareCall("{ ? = call " + depreciation.getDepreciationType() + "(" + rs2.getInt("A_Asset_ID") +", "+ (v_current-1) +" ,'" + rs2.getString("PostingType") + "'," + rs2.getInt("A_ASSET_ACCT_ID") + " , " + (v_Dep_Exp_Inception) + ")}");
|
||||
//cs.registerOutParameter(1, java.sql.Types.DECIMAL);
|
||||
//cs.execute();
|
||||
//v_Dep_Exp_Monthly = cs.getBigDecimal(1);
|
||||
//cs.close();
|
||||
//log.info("This is v_Dep_Exp_Monthly "+v_Dep_Exp_Monthly);
|
||||
//Adjust for half year convention
|
||||
v_HalfYearConv_Adj = new BigDecimal(Conventions.Dep_Convention(depreciation_conv.getConventionType(),rs2.getInt("A_Asset_ID"), rs2.getString("PostingType"), rs2.getInt("A_ASSET_ACCT_ID"), 0, 1 ));
|
||||
//cs = DB.prepareCall("{ ? = call " + depreciation_conv.getConventionType() + "(" + rs2.getInt("A_Asset_ID") +",'" + rs2.getString("PostingType") + "'," + rs2.getInt("A_ASSET_ACCT_ID") + " , 0, 1)}");
|
||||
//cs.registerOutParameter(1, java.sql.Types.DECIMAL);
|
||||
//cs.execute();
|
||||
//v_HalfYearConv_Adj = cs.getBigDecimal(1);
|
||||
//cs.close();
|
||||
//log.info("This is v_HalfYearConv_Adj "+v_HalfYearConv_Adj);
|
||||
v_Dep_Exp_Monthly = v_Dep_Exp_Monthly.multiply((v_HalfYearConv_Adj));
|
||||
//log.info("This is v_Dep_Exp_Monthly "+v_Dep_Exp_Monthly);
|
||||
v_HalfYearConv = v_HalfYearConv.add( v_HalfYearConv_Adj);
|
||||
|
||||
X_A_Depreciation_Exp depexp2 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
if (v_total_adjustment.setScale(2, BigDecimal.ROUND_HALF_UP).compareTo(new BigDecimal (0.00))!=0)
|
||||
{
|
||||
|
||||
//Record necessary adjustments
|
||||
//X_A_Depreciation_Exp depexp1 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
//depexp1.setA_Entry_Type("FOR");
|
||||
//depexp1.setA_Asset_ID(rs.getInt("A_ASSET_ID"));
|
||||
//depexp1.setA_Account_Number(rs2.getInt("A_Depreciation_Acct"));
|
||||
//depexp1.setPostingType(rs.getString("PostingType"));
|
||||
//depexp1.setExpense(v_Dep_Exp_Adjustment.setScale(5, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(rs2.getFloat("A_Split_Percent"))));
|
||||
//depexp1.setDescription("Forecasted Depreciation Expense Adj.");
|
||||
//depexp1.setA_Period((int)v_current);
|
||||
//depexp1.setIsDepreciated(true);
|
||||
//depexp1.setDateAcct(ts);
|
||||
//depexp1.saveEx();
|
||||
|
||||
|
||||
v_total_adjustment = v_total_adjustment.setScale(5, BigDecimal.ROUND_HALF_UP).subtract(v_Dep_Exp_Adjustment.setScale(5, BigDecimal.ROUND_HALF_UP));
|
||||
|
||||
//Record adjusted expense
|
||||
depexp2.setPostingType(DepBuild.getPostingType());
|
||||
depexp2.setA_Asset_ID(rs.getInt("A_ASSET_ID"));
|
||||
depexp2.setA_Account_Number(rs2.getInt("A_Depreciation_Acct"));
|
||||
depexp2.setPostingType(rs.getString("PostingType"));
|
||||
depexp2.setExpense((v_Dep_Exp_Monthly.setScale(2, BigDecimal.ROUND_HALF_UP)).multiply(new BigDecimal(rs2.getFloat("A_Split_Percent"))));
|
||||
depexp2.setDescription("Depreciation Expense");
|
||||
depexp2.setA_Period(rs.getInt("C_Period_ID"));
|
||||
depexp2.setIsDepreciated(true);
|
||||
depexp2.setDateAcct(rs.getTimestamp("DateAcct"));
|
||||
depexp2.setA_Entry_Type("DEP");
|
||||
depexp2.saveEx();
|
||||
|
||||
X_A_Depreciation_Exp depexp3 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp3.setA_Asset_ID(rs.getInt("A_ASSET_ID"));
|
||||
depexp3.setA_Account_Number(rs2.getInt("A_AccumDepreciation_Acct"));
|
||||
depexp3.setPostingType(rs.getString("PostingType"));
|
||||
depexp3.setExpense(v_Dep_Exp_Monthly.setScale(2, BigDecimal.ROUND_HALF_UP).multiply( new BigDecimal(-1 * rs2.getFloat("A_Split_Percent"))));
|
||||
depexp3.setDescription("Depreciation Expense");
|
||||
depexp3.setA_Period(rs.getInt("C_Period_ID"));
|
||||
depexp3.setIsDepreciated(false);
|
||||
depexp3.setDateAcct(rs.getTimestamp("DateAcct"));
|
||||
depexp3.setA_Entry_Type("DEP");
|
||||
depexp3.saveEx();
|
||||
|
||||
v_Dep_Exp_Inception = v_Dep_Exp_Inception.add((v_Dep_Exp_Monthly.setScale(2, BigDecimal.ROUND_HALF_UP))).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Record expense
|
||||
depexp2.setA_Asset_ID(rs.getInt("A_ASSET_ID"));
|
||||
depexp2.setA_Account_Number(rs2.getInt("A_Depreciation_Acct"));
|
||||
depexp2.setPostingType(rs.getString("PostingType"));
|
||||
depexp2.setExpense(v_Dep_Exp_Monthly.setScale(2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(rs2.getFloat("A_Split_Percent"))));
|
||||
depexp2.setDescription("Depreciation Expense");
|
||||
depexp2.setA_Period(rs.getInt("C_Period_ID"));
|
||||
depexp2.setIsDepreciated(true);
|
||||
depexp2.setDateAcct(rs.getTimestamp("DateAcct"));
|
||||
depexp2.setA_Entry_Type("DEP");
|
||||
depexp2.saveEx();
|
||||
|
||||
X_A_Depreciation_Exp depexp3 = new X_A_Depreciation_Exp (getCtx(), 0, null);
|
||||
depexp3.setA_Asset_ID(rs.getInt("A_ASSET_ID"));
|
||||
depexp3.setA_Account_Number(rs2.getInt("A_AccumDepreciation_Acct"));
|
||||
depexp3.setPostingType(rs.getString("PostingType"));
|
||||
depexp3.setExpense(v_Dep_Exp_Monthly.setScale(2, BigDecimal.ROUND_HALF_UP).multiply( new BigDecimal(-1 * rs2.getFloat("A_Split_Percent"))));
|
||||
depexp3.setDescription("Depreciation Expense");
|
||||
depexp3.setA_Period(rs.getInt("C_Period_ID"));
|
||||
depexp3.setIsDepreciated(false);
|
||||
depexp3.setDateAcct(rs.getTimestamp("DateAcct"));
|
||||
depexp3.setA_Entry_Type("DEP");
|
||||
depexp3.saveEx();
|
||||
|
||||
|
||||
v_Dep_Exp_Inception = v_Dep_Exp_Inception.add(v_Dep_Exp_Monthly).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
|
||||
}
|
||||
lastdepexp2 = depexp2.get_ID();
|
||||
|
||||
//Advance calender
|
||||
cal.add(Calendar.MONTH, 1);
|
||||
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
|
||||
ts.setTime(cal.getTimeInMillis());
|
||||
v_current_adj = v_current_adj.add((v_HalfYearConv_Adj)).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
|
||||
//record in workfile
|
||||
assetwk.setA_Period_Forecast(v_current_adj);
|
||||
assetwk.setDateAcct(ts);
|
||||
assetwk.setA_Current_Period((int)v_current);
|
||||
assetwk.saveEx();
|
||||
|
||||
asset_id_current = rs2.getInt("A_ASSET_ID");
|
||||
log.info(""+asset_id_current);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.info("getAssets"+ e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs2 = null; pstmt2 = null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.info("getAssets"+ e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
}
|
||||
|
||||
return "";
|
||||
} // doIt
|
||||
|
||||
} // InvoiceCreateInOut
|
|
@ -1,407 +0,0 @@
|
|||
/******************************************************************************
|
||||
* The contents of this file are subject to the Compiere License Version 1.1
|
||||
* ("License"); You may not use this file except in compliance with the License
|
||||
* You may obtain a copy of the License at http://www.compiere.org/license.html
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is Compiere ERP & CRM Business Solution
|
||||
* The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
|
||||
*
|
||||
* Copyright (C) 2005 Robert Klein. robeklein@hotmail.com
|
||||
* _____________________________________________
|
||||
*****************************************************************************/
|
||||
package org.compiere.FA;
|
||||
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.Calendar;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
import org.compiere.util.DB;
|
||||
|
||||
/**
|
||||
* Fixed Asset Conventions
|
||||
*
|
||||
* @author Rob Klein
|
||||
* @version $Id: Conventions.java,v 1.0 $
|
||||
*
|
||||
*/
|
||||
public class Conventions {
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
static public double Dep_Convention(String Type,int p_A_ASSET_ID, String p_POSTINGTYPE, int p_A_ASSET_ACCT_ID, int p_Flag, double p_Period)
|
||||
{
|
||||
|
||||
if(Type.compareTo("FMCON")==0)
|
||||
return FMCON(p_A_ASSET_ID, p_POSTINGTYPE, p_A_ASSET_ACCT_ID, p_Flag, p_Period);
|
||||
else if(Type.compareTo("FYCON")==0)
|
||||
return FYCON(p_A_ASSET_ID, p_POSTINGTYPE, p_A_ASSET_ACCT_ID, p_Flag, p_Period);
|
||||
else if(Type.compareTo("DYCON")==0)
|
||||
return DYCON(p_A_ASSET_ID, p_POSTINGTYPE, p_A_ASSET_ACCT_ID, p_Flag, p_Period);
|
||||
else if(Type.compareTo("MMCON")==0)
|
||||
return MMCON(p_A_ASSET_ID, p_POSTINGTYPE, p_A_ASSET_ACCT_ID, p_Flag, p_Period);
|
||||
else if(Type.compareTo("MQCON")==0)
|
||||
return MQCON(p_A_ASSET_ID, p_POSTINGTYPE, p_A_ASSET_ACCT_ID, p_Flag, p_Period);
|
||||
else if(Type.compareTo("HYCON")==0)
|
||||
return HYCON(p_A_ASSET_ID, p_POSTINGTYPE, p_A_ASSET_ACCT_ID, p_Flag, p_Period);
|
||||
else
|
||||
return 0.0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
static public double FMCON(int p_A_ASSET_ID, String p_POSTINGTYPE, int p_A_ASSET_ACCT_ID, int p_Flag, double p_Period)
|
||||
{
|
||||
return 1.0;
|
||||
|
||||
}
|
||||
|
||||
static public double HYCON(int p_A_ASSET_ID, String p_POSTINGTYPE, int p_A_ASSET_ACCT_ID, int p_Flag, double p_Period)
|
||||
{
|
||||
int v_adj=0;
|
||||
StringBuffer sqlB = new StringBuffer ("SELECT A_ASSET.ASSETSERVICEDATE, A_DEPRECIATION_WORKFILE.A_PERIOD_POSTED,"
|
||||
+ " A_DEPRECIATION_WORKFILE.A_ASSET_LIFE_YEARS, A_DEPRECIATION_WORKFILE.A_LIFE_PERIOD,"
|
||||
+ " A_DEPRECIATION_WORKFILE.DATEACCT"
|
||||
+ " FROM A_DEPRECIATION_WORKFILE, A_ASSET"
|
||||
+ " WHERE A_ASSET.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A_DEPRECIATION_WORKFILE.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A_DEPRECIATION_WORKFILE.POSTINGTYPE = '" + p_POSTINGTYPE+"'");
|
||||
|
||||
PreparedStatement pstmt = null;
|
||||
pstmt = DB.prepareStatement (sqlB.toString(),null);
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
rs = pstmt.executeQuery();
|
||||
while (rs.next()){
|
||||
Calendar calendar = new GregorianCalendar();
|
||||
calendar.setTime(rs.getDate("ASSETSERVICEDATE"));
|
||||
int AssetServiceDateYear = calendar.get(Calendar.YEAR);
|
||||
int AssetServiceDateMonth = calendar.get(Calendar.MONTH);
|
||||
calendar.setTime(rs.getDate("DATEACCT"));
|
||||
int DateAcctYear = calendar.get(Calendar.YEAR);
|
||||
|
||||
|
||||
int v_Months_of_Half_Year = (12-(AssetServiceDateMonth)+1);
|
||||
|
||||
//ADJUST PERIOD FOR MID-MONTH CONVENTION
|
||||
if(DateAcctYear == AssetServiceDateYear)
|
||||
v_adj = 6/v_Months_of_Half_Year;
|
||||
else
|
||||
v_adj = 1;
|
||||
|
||||
if(p_Flag == 2){
|
||||
//ADJUST COST CORRECTIONS FOR HALF-YEAR CONVENTION
|
||||
if (p_Period == AssetServiceDateYear)
|
||||
v_adj = 6/v_Months_of_Half_Year;
|
||||
else
|
||||
v_adj = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("HYCON"+e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
}
|
||||
return v_adj;
|
||||
|
||||
}
|
||||
|
||||
static public double FYCON(int p_A_ASSET_ID, String p_POSTINGTYPE, int p_A_ASSET_ACCT_ID, int p_Flag, double p_Period)
|
||||
{
|
||||
int v_adj=0;
|
||||
StringBuffer sqlB = new StringBuffer ("SELECT A_ASSET.ASSETSERVICEDATE,"
|
||||
+ " A_DEPRECIATION_WORKFILE.A_PERIOD_POSTED,"
|
||||
+ " A_DEPRECIATION_WORKFILE.A_ASSET_LIFE_YEARS, A_DEPRECIATION_WORKFILE.A_LIFE_PERIOD,"
|
||||
+ " A_DEPRECIATION_WORKFILE.DATEACCT"
|
||||
+ " FROM A_DEPRECIATION_WORKFILE, A_ASSET"
|
||||
+ " WHERE A_ASSET.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A_DEPRECIATION_WORKFILE.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A_DEPRECIATION_WORKFILE.POSTINGTYPE = '" + p_POSTINGTYPE+"'");
|
||||
|
||||
|
||||
PreparedStatement pstmt = null;
|
||||
pstmt = DB.prepareStatement (sqlB.toString(),null);
|
||||
try {
|
||||
ResultSet rs = pstmt.executeQuery();
|
||||
while (rs.next()){
|
||||
Calendar calendar = new GregorianCalendar();
|
||||
calendar.setTime(rs.getDate("ASSETSERVICEDATE"));
|
||||
int AssetServiceDateYear = calendar.get(Calendar.YEAR);
|
||||
int AssetServiceDateMonth = calendar.get(Calendar.MONTH);
|
||||
calendar.setTime(rs.getDate("DATEACCT"));
|
||||
int DateAcctYear = calendar.get(Calendar.YEAR);
|
||||
|
||||
int v_Months_of_Full_Year = 12 - AssetServiceDateMonth;
|
||||
if(p_Flag < 2){
|
||||
//ADJUST PERIOD FOR FULL-YEAR CONVENTION
|
||||
if(DateAcctYear == AssetServiceDateYear)
|
||||
v_adj = 12/v_Months_of_Full_Year;
|
||||
else
|
||||
v_adj = 1;
|
||||
}
|
||||
if(p_Flag == 2){
|
||||
//ADJUST COST CORRECTIONS FOR FULL-YEAR CONVENTION
|
||||
v_adj = 12/v_Months_of_Full_Year;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("FYCON"+e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
if (pstmt != null)
|
||||
pstmt.close ();
|
||||
}
|
||||
catch (Exception e)
|
||||
{}
|
||||
pstmt = null;
|
||||
}
|
||||
|
||||
return v_adj;
|
||||
|
||||
}
|
||||
|
||||
static public double DYCON(int p_A_ASSET_ID, String p_POSTINGTYPE, int p_A_ASSET_ACCT_ID, int p_Flag, double p_Period)
|
||||
{
|
||||
int v_adj=0;
|
||||
StringBuffer sqlB = new StringBuffer ("SELECT A_ASSET.ASSETSERVICEDATE,"
|
||||
+ " A_DEPRECIATION_WORKFILE.A_PERIOD_POSTED,"
|
||||
+ " A_DEPRECIATION_WORKFILE.A_ASSET_LIFE_YEARS, A_DEPRECIATION_WORKFILE.A_LIFE_PERIOD,"
|
||||
+ " A_DEPRECIATION_WORKFILE.DATEACCT"
|
||||
+ " FROM A_DEPRECIATION_WORKFILE, A_ASSET"
|
||||
+ " WHERE A_ASSET.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A_DEPRECIATION_WORKFILE.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A_DEPRECIATION_WORKFILE.POSTINGTYPE = '" + p_POSTINGTYPE+"'");
|
||||
|
||||
|
||||
PreparedStatement pstmt = null;
|
||||
pstmt = DB.prepareStatement (sqlB.toString(),null);
|
||||
try {
|
||||
ResultSet rs = pstmt.executeQuery();
|
||||
while (rs.next()){
|
||||
|
||||
Calendar calendar = new GregorianCalendar();
|
||||
calendar.setTime(rs.getDate("ASSETSERVICEDATE"));
|
||||
int AssetServiceDateYear = calendar.get(Calendar.YEAR);
|
||||
int AssetServiceDateMonth = calendar.get(Calendar.MONTH);
|
||||
int AssetServiceDateDay = calendar.get(Calendar.DAY_OF_YEAR);
|
||||
calendar.setTime(rs.getDate("DATEACCT"));
|
||||
int DateAcctYear = calendar.get(Calendar.YEAR);
|
||||
int DateAcctMonth = calendar.get(Calendar.MONTH);
|
||||
|
||||
if(p_Flag ==0){
|
||||
|
||||
//ADJUST PERIOD FOR DAY CONVENTION
|
||||
if(DateAcctYear == AssetServiceDateYear){
|
||||
return ((365-(double)AssetServiceDateDay)/365);
|
||||
}
|
||||
else if ((DateAcctYear*12 + DateAcctMonth) == (AssetServiceDateYear+rs.getInt("A_ASSET_LIFE_YEARS"))*12 + AssetServiceDateMonth)
|
||||
return ((double)AssetServiceDateDay/365);
|
||||
else if ((DateAcctYear*12 + DateAcctMonth) > (AssetServiceDateYear+rs.getInt("A_ASSET_LIFE_YEARS"))*12 + AssetServiceDateMonth)
|
||||
return ((double)AssetServiceDateDay/365);
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(p_Flag ==1){
|
||||
//ADJUST PERIOD FOR DAY CONVENTION
|
||||
if(DateAcctYear == AssetServiceDateYear){
|
||||
return ((365-(double)AssetServiceDateDay)/365);
|
||||
}
|
||||
if(DateAcctYear == (AssetServiceDateYear+rs.getInt("A_ASSET_LIFE_YEARS")+1))
|
||||
return ((double)AssetServiceDateDay/365);
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(p_Flag == 2){
|
||||
//ADJUST PERIOD FOR DAY CONVENTION
|
||||
return ((365-(double)AssetServiceDateDay)/365);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("DYCON"+e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
if (pstmt != null)
|
||||
pstmt.close ();
|
||||
}
|
||||
catch (Exception e)
|
||||
{}
|
||||
pstmt = null;
|
||||
}
|
||||
|
||||
return v_adj;
|
||||
|
||||
}
|
||||
static public double MMCON(int p_A_ASSET_ID, String p_POSTINGTYPE, int p_A_ASSET_ACCT_ID, int p_Flag, double p_Period)
|
||||
{
|
||||
int v_adj=0;
|
||||
StringBuffer sqlB = new StringBuffer ("SELECT A_ASSET.ASSETSERVICEDATE,"
|
||||
+ " A_DEPRECIATION_WORKFILE.A_PERIOD_POSTED,"
|
||||
+ " A_DEPRECIATION_WORKFILE.A_ASSET_LIFE_YEARS, A_DEPRECIATION_WORKFILE.A_LIFE_PERIOD,"
|
||||
+ " A_DEPRECIATION_WORKFILE.DATEACCT"
|
||||
+ " FROM A_DEPRECIATION_WORKFILE, A_ASSET"
|
||||
+ " WHERE A_ASSET.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A_DEPRECIATION_WORKFILE.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A_DEPRECIATION_WORKFILE.POSTINGTYPE = '" + p_POSTINGTYPE+"'");
|
||||
|
||||
|
||||
PreparedStatement pstmt = null;
|
||||
pstmt = DB.prepareStatement (sqlB.toString(),null);
|
||||
try {
|
||||
ResultSet rs = pstmt.executeQuery();
|
||||
while (rs.next()){
|
||||
Calendar calendar = new GregorianCalendar();
|
||||
calendar.setTime(rs.getDate("ASSETSERVICEDATE"));
|
||||
int AssetServiceDateMonth = calendar.get(Calendar.MONTH);
|
||||
calendar.setTime(rs.getDate("DATEACCT"));
|
||||
int DateAcctMonth = calendar.get(Calendar.MONTH);
|
||||
if(p_Flag ==0){
|
||||
if(DateAcctMonth - AssetServiceDateMonth >1)
|
||||
return 1;
|
||||
else
|
||||
return .5;
|
||||
}
|
||||
if(p_Flag ==1){
|
||||
if(p_Period == 0)
|
||||
return .5;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
if(p_Flag == 2){
|
||||
if (p_Period - AssetServiceDateMonth >1)
|
||||
return 1;
|
||||
else
|
||||
return .5;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("MMCON"+e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
if (pstmt != null)
|
||||
pstmt.close ();
|
||||
}
|
||||
catch (Exception e)
|
||||
{}
|
||||
pstmt = null;
|
||||
}
|
||||
return v_adj;
|
||||
}
|
||||
|
||||
static public double MQCON(int p_A_ASSET_ID, String p_POSTINGTYPE, int p_A_ASSET_ACCT_ID, int p_Flag, double p_Period)
|
||||
{
|
||||
int v_adj=0;
|
||||
StringBuffer sqlB = new StringBuffer ("SELECT A_ASSET.ASSETSERVICEDATE,"
|
||||
+ " A_DEPRECIATION_WORKFILE.A_PERIOD_POSTED,"
|
||||
+ " A_DEPRECIATION_WORKFILE.A_ASSET_LIFE_YEARS, A_DEPRECIATION_WORKFILE.A_LIFE_PERIOD,"
|
||||
+ " A_DEPRECIATION_WORKFILE.DATEACCT"
|
||||
+ " FROM A_DEPRECIATION_WORKFILE, A_ASSET"
|
||||
+ " WHERE A_ASSET.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A_DEPRECIATION_WORKFILE.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A_DEPRECIATION_WORKFILE.POSTINGTYPE = '" + p_POSTINGTYPE+"'");
|
||||
|
||||
|
||||
PreparedStatement pstmt = null;
|
||||
pstmt = DB.prepareStatement (sqlB.toString(),null);
|
||||
try {
|
||||
ResultSet rs = pstmt.executeQuery();
|
||||
while (rs.next()){
|
||||
Calendar calendar = new GregorianCalendar();
|
||||
calendar.setTime(rs.getDate("ASSETSERVICEDATE"));
|
||||
int AssetServiceDateYear = calendar.get(Calendar.YEAR);
|
||||
int AssetServiceDateMonth = calendar.get(Calendar.MONTH);
|
||||
calendar.setTime(rs.getDate("DATEACCT"));
|
||||
int DateAcctYear = calendar.get(Calendar.YEAR);
|
||||
int DateAcctMonth = calendar.get(Calendar.MONTH);
|
||||
if(p_Flag <2){
|
||||
|
||||
//ADJUST PERIOD FOR MID-QUARTER CONVENTION
|
||||
if(DateAcctYear == AssetServiceDateYear){
|
||||
if(AssetServiceDateMonth < 4 )
|
||||
return .875;
|
||||
else if (AssetServiceDateMonth < 7 )
|
||||
return .625;
|
||||
else if (AssetServiceDateMonth < 10 )
|
||||
return .375;
|
||||
else if (AssetServiceDateMonth > 9 )
|
||||
return .125;
|
||||
}
|
||||
else if(DateAcctYear*12 + DateAcctMonth >= ((AssetServiceDateYear+rs.getInt("A_ASSET_LIFE_YEARS"))*12 + AssetServiceDateMonth)){
|
||||
if(AssetServiceDateMonth < 4 )
|
||||
return .125;
|
||||
else if (AssetServiceDateMonth < 7 )
|
||||
return .375;
|
||||
else if (AssetServiceDateMonth < 10 )
|
||||
return .625;
|
||||
else if (AssetServiceDateMonth > 9 )
|
||||
return .875;
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(p_Flag == 2){
|
||||
if(AssetServiceDateMonth< 4 )
|
||||
return .875;
|
||||
else if (AssetServiceDateMonth < 7 )
|
||||
return .625;
|
||||
else if (AssetServiceDateMonth < 10 )
|
||||
return .375;
|
||||
else if (AssetServiceDateMonth > 9 )
|
||||
return .125;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("MQCON"+e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
if (pstmt != null)
|
||||
pstmt.close ();
|
||||
}
|
||||
catch (Exception e)
|
||||
{}
|
||||
pstmt = null;
|
||||
}
|
||||
return v_adj;
|
||||
}
|
||||
|
||||
|
||||
}// Conventions
|
||||
|
|
@ -1,383 +0,0 @@
|
|||
/******************************************************************************
|
||||
* The contents of this file are subject to the Compiere License Version 1.1
|
||||
* ("License"); You may not use this file except in compliance with the License
|
||||
* You may obtain a copy of the License at http://www.compiere.org/license.html
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is Compiere ERP & CRM Business Solution
|
||||
* The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
|
||||
*
|
||||
* Copyright (C) 2005 Robert KLEIN. robeklein@gmail.com *
|
||||
* Contributor(s): ______________________________________.
|
||||
*****************************************************************************/
|
||||
package org.compiere.FA;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
|
||||
import org.compiere.model.MAssetAcct;
|
||||
import org.compiere.model.MAssetChange;
|
||||
import org.compiere.model.MRefList;
|
||||
import org.compiere.model.X_A_Asset;
|
||||
import org.compiere.model.X_A_Asset_Addition;
|
||||
import org.compiere.model.X_A_Asset_Group_Acct;
|
||||
import org.compiere.model.X_A_Depreciation_Workfile;
|
||||
import org.compiere.model.X_GL_JournalLine;
|
||||
import org.compiere.process.ProcessInfoParameter;
|
||||
import org.compiere.process.SvrProcess;
|
||||
import org.compiere.util.DB;
|
||||
|
||||
/**
|
||||
* Create Asset from FA GL Process
|
||||
*
|
||||
* @author Rob Klein
|
||||
* @version $Id: CreateGLAsset.java,v 1.0 $
|
||||
*/
|
||||
public class CreateGLAsset extends SvrProcess
|
||||
{
|
||||
|
||||
private int p_client = 0;
|
||||
//private int p_org = 0;
|
||||
|
||||
/**
|
||||
* Prepare - e.g., get Parameters.
|
||||
*/
|
||||
protected void prepare()
|
||||
{
|
||||
ProcessInfoParameter[] para = getParameter();
|
||||
for (int i = 0; i < para.length; i++)
|
||||
{
|
||||
String name = para[i].getParameterName();
|
||||
if (para[i].getParameter() == null)
|
||||
;
|
||||
else if (name.equals("AD_Client_ID"))
|
||||
p_client = para[i].getParameterAsInt();
|
||||
else
|
||||
log.info("prepare - Unknown Parameter: " + name);
|
||||
}
|
||||
} // prepare
|
||||
|
||||
|
||||
/**
|
||||
* Process Invoices
|
||||
* @return info
|
||||
* @throws Exception
|
||||
*/
|
||||
protected String doIt() throws java.lang.Exception
|
||||
{
|
||||
log.info("Starting inbound invoice process");
|
||||
// int uselifemonths = 0;
|
||||
// int uselifeyears = 0;
|
||||
|
||||
String sql =" SELECT * FROM GL_JOURNALLINE WHERE A_Processed <> 'Y' and AD_Client_ID = ?"
|
||||
+ " and A_CreateAsset = 'Y' and Processed = 'Y'";
|
||||
log.info(sql);
|
||||
PreparedStatement pstmt = null;
|
||||
pstmt = DB.prepareStatement(sql,get_TrxName());
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
pstmt.setInt(1, p_client);
|
||||
rs = pstmt.executeQuery();
|
||||
|
||||
while (rs.next()){
|
||||
|
||||
X_A_Asset asset = new X_A_Asset (getCtx(), rs.getInt("A_Asset_ID"), get_TrxName());
|
||||
X_GL_JournalLine JVLine = new X_GL_JournalLine (getCtx(), rs.getInt("GL_JournalLine_ID"), get_TrxName());
|
||||
String sql2 ="SELECT C.AccountType FROM GL_JournalLine A, C_ValidCombination B, C_ElementValue C WHERE A.GL_JournalLine_ID = ?" +
|
||||
" and A.C_ValidCombination_ID = B.C_ValidCombination_ID and B.Account_ID = C.C_ElementValue_ID";
|
||||
String acctType = DB.getSQLValueString(get_TrxName(),sql2, JVLine.getGL_JournalLine_ID());
|
||||
if (acctType.equals("A")){
|
||||
sql ="SELECT * FROM A_Asset_Group_Acct WHERE A_Asset_Group_ID = ? AND IsActive='Y'";
|
||||
log.info("yes");
|
||||
pstmt = null;
|
||||
pstmt = DB.prepareStatement(sql,get_TrxName());
|
||||
if(asset.getA_Asset_ID()==0) {
|
||||
int groupId = JVLine.getA_Asset_Group_ID();
|
||||
pstmt.setInt(1, groupId);
|
||||
} else
|
||||
pstmt.setInt(1, asset.getA_Asset_Group_ID());
|
||||
ResultSet rs2 = pstmt.executeQuery();
|
||||
|
||||
while (rs2.next()){
|
||||
|
||||
X_A_Asset_Group_Acct assetgrpacct = new X_A_Asset_Group_Acct (getCtx(), rs2,get_TrxName());
|
||||
MAssetAcct assetacct = new MAssetAcct (getCtx(), 0, get_TrxName());
|
||||
if (assetgrpacct.isProcessing()== true){
|
||||
sql2 = "SELECT COUNT(*) FROM A_Depreciation_Workfile WHERE A_Asset_ID=? and"
|
||||
+ " PostingType = '"+assetgrpacct.getPostingType()+"'";
|
||||
if (DB.getSQLValue(get_TrxName(),sql2, asset.getA_Asset_ID())== 0)
|
||||
{
|
||||
asset.setIsOwned(true);
|
||||
asset.setIsDepreciated(assetgrpacct.isProcessing());
|
||||
asset.setA_Asset_CreateDate(JVLine.getDateAcct());
|
||||
asset.setIsInPosession(true);
|
||||
if(JVLine.getDescription()!= null)
|
||||
asset.setName(JVLine.getDescription());
|
||||
else
|
||||
asset.setName("Asset created from JV");
|
||||
asset.setHelp("Created from JV #" + JVLine.getGL_Journal_ID() + " on line #" + JVLine.getLine());
|
||||
asset.setDescription(JVLine.getDescription());
|
||||
asset.setUseLifeMonths(assetgrpacct.getUseLifeMonths());
|
||||
asset.setUseLifeYears(assetgrpacct.getUseLifeYears());
|
||||
asset.setA_Asset_Group_ID(assetgrpacct.getA_Asset_Group_ID());
|
||||
asset.setA_QTY_Current(JVLine.getQty());
|
||||
asset.setA_QTY_Original(JVLine.getQty());
|
||||
asset.saveEx();
|
||||
asset.setA_Parent_Asset_ID(asset.getA_Asset_ID());
|
||||
asset.saveEx();
|
||||
|
||||
boolean isdepreciate = assetgrpacct.isProcessing();
|
||||
|
||||
if (isdepreciate == true)
|
||||
{
|
||||
assetacct.setPostingType(assetgrpacct.getPostingType());
|
||||
assetacct.setA_Split_Percent(assetgrpacct.getA_Split_Percent());
|
||||
assetacct.setA_Depreciation_Conv_ID(assetgrpacct.getConventionType());
|
||||
assetacct.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
assetacct.setA_Depreciation_ID(assetgrpacct.getDepreciationType());
|
||||
assetacct.setA_Asset_Spread_ID(assetgrpacct.getA_Asset_Spread_Type());
|
||||
assetacct.setA_Period_Start(1);
|
||||
|
||||
if (asset.getUseLifeMonths() == 0 & asset.getUseLifeYears() == 0){
|
||||
assetacct.setA_Period_End(assetgrpacct.getUseLifeMonths());
|
||||
asset.setUseLifeYears(assetgrpacct.getUseLifeYears());
|
||||
asset.setUseLifeMonths(assetgrpacct.getUseLifeMonths());
|
||||
asset.setIsDepreciated(true);
|
||||
asset.setIsOwned(true);
|
||||
asset.saveEx();
|
||||
// uselifemonths = assetgrpacct.getUseLifeMonths();
|
||||
// uselifeyears = assetgrpacct.getUseLifeYears();
|
||||
|
||||
}
|
||||
else if(asset.getUseLifeMonths() == 0){
|
||||
assetacct.setA_Period_End(asset.getUseLifeYears()*12);
|
||||
asset.setUseLifeMonths(asset.getUseLifeYears()*12);
|
||||
asset.setIsDepreciated(true);
|
||||
asset.setIsOwned(true);
|
||||
asset.saveEx();
|
||||
// uselifemonths = asset.getUseLifeYears()*12;
|
||||
// uselifeyears = asset.getUseLifeYears();
|
||||
}
|
||||
else{
|
||||
assetacct.setA_Period_End(asset.getUseLifeMonths());
|
||||
// uselifemonths = asset.getUseLifeMonths();
|
||||
// uselifeyears = asset.getUseLifeYears();
|
||||
}
|
||||
|
||||
assetacct.setA_Depreciation_Method_ID(assetgrpacct.getA_Depreciation_Calc_Type());
|
||||
assetacct.setA_Asset_Acct(assetgrpacct.getA_Asset_Acct());
|
||||
assetacct.setC_AcctSchema_ID(assetgrpacct.getC_AcctSchema_ID());
|
||||
assetacct.setA_Salvage_Value(new BigDecimal (0.0));
|
||||
assetacct.setA_Accumdepreciation_Acct(assetgrpacct.getA_Accumdepreciation_Acct());
|
||||
assetacct.setA_Depreciation_Acct(assetgrpacct.getA_Depreciation_Acct());
|
||||
assetacct.setA_Disposal_Revenue(assetgrpacct.getA_Disposal_Revenue());
|
||||
assetacct.setA_Disposal_Loss(assetgrpacct.getA_Disposal_Loss());
|
||||
assetacct.setA_Reval_Accumdep_Offset_Cur(assetgrpacct.getA_Reval_Accumdep_Offset_Cur());
|
||||
assetacct.setA_Reval_Accumdep_Offset_Prior(assetgrpacct.getA_Reval_Accumdep_Offset_Prior());
|
||||
assetacct.setA_Reval_Cal_Method(assetgrpacct.getA_Reval_Cal_Method());
|
||||
assetacct.setA_Reval_Cost_Offset(assetgrpacct.getA_Reval_Cost_Offset());
|
||||
assetacct.setA_Reval_Cost_Offset_Prior(assetgrpacct.getA_Reval_Cost_Offset_Prior());
|
||||
assetacct.setA_Reval_Depexp_Offset(assetgrpacct.getA_Reval_Depexp_Offset());
|
||||
assetacct.setA_Depreciation_Manual_Amount(assetgrpacct.getA_Depreciation_Manual_Amount());
|
||||
assetacct.setA_Depreciation_Manual_Period(assetgrpacct.getA_Depreciation_Manual_Period());
|
||||
assetacct.setA_Depreciation_Table_Header_ID(assetgrpacct.getA_Depreciation_Table_Header_ID());
|
||||
assetacct.setA_Depreciation_Variable_Perc(assetgrpacct.getA_Depreciation_Variable_Perc());
|
||||
assetacct.setProcessing(false);
|
||||
assetacct.saveEx();
|
||||
|
||||
MAssetChange change = new MAssetChange (getCtx(), 0, get_TrxName());
|
||||
change.setPostingType(assetacct.getPostingType());
|
||||
change.setA_Split_Percent(assetacct.getA_Split_Percent());
|
||||
change.setConventionType(assetacct.getA_Depreciation_Conv_ID());
|
||||
change.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
change.setDepreciationType(assetacct.getA_Depreciation_ID());
|
||||
change.setA_Asset_Spread_Type(assetacct.getA_Asset_Spread_ID());
|
||||
change.setA_Period_Start(assetacct.getA_Period_Start());
|
||||
change.setA_Period_End(assetacct.getA_Period_End());
|
||||
change.setIsInPosession(asset.isOwned());
|
||||
change.setIsDisposed(asset.isDisposed());
|
||||
change.setIsDepreciated(asset.isDepreciated());
|
||||
change.setIsFullyDepreciated(asset.isFullyDepreciated());
|
||||
change.setA_Depreciation_Calc_Type(assetacct.getA_Depreciation_Method_ID());
|
||||
change.setA_Asset_Acct(assetacct.getA_Asset_Acct());
|
||||
change.setC_AcctSchema_ID(assetacct.getC_AcctSchema_ID());
|
||||
change.setA_Accumdepreciation_Acct(assetacct.getA_Accumdepreciation_Acct());
|
||||
change.setA_Depreciation_Acct(assetacct.getA_Depreciation_Acct());
|
||||
change.setA_Disposal_Revenue(assetacct.getA_Disposal_Revenue());
|
||||
change.setA_Disposal_Loss(assetacct.getA_Disposal_Loss());
|
||||
change.setA_Reval_Accumdep_Offset_Cur(assetacct.getA_Reval_Accumdep_Offset_Cur());
|
||||
change.setA_Reval_Accumdep_Offset_Prior(assetacct.getA_Reval_Accumdep_Offset_Prior());
|
||||
change.setA_Reval_Cal_Method(assetacct.getA_Reval_Cal_Method());
|
||||
change.setA_Reval_Cost_Offset(assetacct.getA_Reval_Cost_Offset());
|
||||
change.setA_Reval_Cost_Offset_Prior(assetacct.getA_Reval_Cost_Offset_Prior());
|
||||
change.setA_Reval_Depexp_Offset(assetacct.getA_Reval_Depexp_Offset());
|
||||
change.setA_Depreciation_Manual_Amount(assetacct.getA_Depreciation_Manual_Amount());
|
||||
change.setA_Depreciation_Manual_Period(assetacct.getA_Depreciation_Manual_Period());
|
||||
change.setA_Depreciation_Table_Header_ID(assetacct.getA_Depreciation_Table_Header_ID());
|
||||
change.setA_Depreciation_Variable_Perc(assetacct.getA_Depreciation_Variable_Perc());
|
||||
change.setA_Parent_Asset_ID(asset.getA_Parent_Asset_ID());
|
||||
change.setChangeType("CRT");
|
||||
change.setTextDetails(MRefList.getListDescription (getCtx(),"A_Update_Type" , "CRT"));
|
||||
change.setIsInPosession(asset.isOwned());
|
||||
change.setIsDisposed(asset.isDisposed());
|
||||
change.setIsDepreciated(asset.isDepreciated());
|
||||
change.setIsFullyDepreciated(asset.isFullyDepreciated());
|
||||
change.setLot(asset.getLot());
|
||||
change.setSerNo(asset.getSerNo());
|
||||
change.setVersionNo(asset.getVersionNo());
|
||||
change.setUseLifeMonths(asset.getUseLifeMonths());
|
||||
change.setUseLifeYears(asset.getUseLifeYears());
|
||||
change.setLifeUseUnits(asset.getLifeUseUnits());
|
||||
change.setAssetDisposalDate(asset.getAssetDisposalDate());
|
||||
change.setAssetServiceDate(asset.getAssetServiceDate());
|
||||
change.setC_BPartner_Location_ID(asset.getC_BPartner_Location_ID());
|
||||
change.setC_BPartner_ID(asset.getC_BPartner_ID());
|
||||
change.setAssetValueAmt(JVLine.getAmtAcctDr().subtract(JVLine.getAmtAcctCr()));
|
||||
change.setA_Asset_CreateDate(asset.getA_Asset_CreateDate());
|
||||
change.setAD_User_ID(asset.getAD_User_ID());
|
||||
change.setC_Location_ID(asset.getC_Location_ID());
|
||||
change.saveEx();
|
||||
}
|
||||
|
||||
|
||||
|
||||
X_A_Depreciation_Workfile assetwk = new X_A_Depreciation_Workfile (getCtx(), 0, get_TrxName());
|
||||
assetwk.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
assetwk.setA_Life_Period(assetgrpacct.getUseLifeMonths());
|
||||
assetwk.setA_Asset_Life_Years(assetgrpacct.getUseLifeYears());
|
||||
assetwk.setA_Asset_Cost(assetwk.getA_Asset_Cost().add(JVLine.getAmtAcctDr().subtract(JVLine.getAmtAcctCr())));
|
||||
assetwk.setA_Accumulated_Depr(new BigDecimal (0.0));
|
||||
assetwk.setA_Salvage_Value(new BigDecimal (0.0));
|
||||
assetwk.setA_Period_Posted(0);
|
||||
assetwk.setA_Asset_Life_Current_Year(new BigDecimal (0.0));
|
||||
assetwk.setA_Curr_Dep_Exp(new BigDecimal (0.0));
|
||||
assetwk.setA_QTY_Current(JVLine.getQty());
|
||||
assetwk.setIsDepreciated(assetgrpacct.isProcessing());
|
||||
assetwk.setPostingType(assetgrpacct.getPostingType());
|
||||
assetwk.saveEx();
|
||||
|
||||
X_A_Asset_Addition assetadd = new X_A_Asset_Addition (getCtx(), 0, get_TrxName());
|
||||
assetadd.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
assetadd.setAssetValueAmt(JVLine.getAmtAcctDr().subtract(JVLine.getAmtAcctCr()));
|
||||
assetadd.setA_SourceType("JRN");
|
||||
assetadd.setA_CapvsExp("Cap");
|
||||
assetadd.setA_QTY_Current(JVLine.getQty());
|
||||
assetadd.setDocumentNo(""+JVLine.getGL_Journal_ID());
|
||||
assetadd.setGL_JournalBatch_ID(JVLine.getGL_Journal_ID());
|
||||
assetadd.setLine(JVLine.getLine());
|
||||
assetadd.setDescription(JVLine.getDescription());
|
||||
assetadd.setPostingType(assetwk.getPostingType());
|
||||
assetadd.saveEx();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
sql2 ="SELECT * FROM A_Depreciation_Workfile WHERE A_Asset_ID = ? and PostingType = ?";
|
||||
PreparedStatement pstmt2 = null;
|
||||
pstmt2 = DB.prepareStatement(sql2,get_TrxName());
|
||||
ResultSet rs3 = null;
|
||||
log.info("no");
|
||||
try {
|
||||
pstmt2.setInt(1, asset.getA_Asset_ID());
|
||||
pstmt2.setString(2, assetgrpacct.getPostingType());
|
||||
rs3 = pstmt2.executeQuery();
|
||||
while (rs3.next()){
|
||||
X_A_Depreciation_Workfile assetwk = new X_A_Depreciation_Workfile (getCtx(), rs3, get_TrxName());
|
||||
assetwk.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
assetwk.setA_Life_Period(assetgrpacct.getUseLifeMonths());
|
||||
assetwk.setA_Asset_Life_Years(assetgrpacct.getUseLifeYears());
|
||||
assetwk.setA_Asset_Cost(assetwk.getA_Asset_Cost().add(JVLine.getAmtAcctDr().subtract(JVLine.getAmtAcctCr())));
|
||||
assetwk.setA_QTY_Current(assetwk.getA_QTY_Current().add(JVLine.getQty()));
|
||||
assetwk.setIsDepreciated(assetgrpacct.isProcessing());
|
||||
assetwk.saveEx();
|
||||
|
||||
X_A_Asset_Addition assetadd = new X_A_Asset_Addition (getCtx(), 0, get_TrxName());
|
||||
assetadd.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
assetadd.setAssetValueAmt((JVLine.getAmtAcctDr().subtract(JVLine.getAmtAcctCr())));
|
||||
assetadd.setA_SourceType("JRN");
|
||||
assetadd.setA_CapvsExp("Cap");
|
||||
assetadd.setA_QTY_Current(JVLine.getQty());
|
||||
assetadd.setDocumentNo(""+JVLine.getGL_Journal_ID());
|
||||
assetadd.setGL_JournalBatch_ID(JVLine.getGL_Journal_ID());
|
||||
assetadd.setLine(JVLine.getLine());
|
||||
assetadd.setDescription(JVLine.getDescription());
|
||||
assetadd.setPostingType(assetwk.getPostingType());
|
||||
assetadd.saveEx();
|
||||
|
||||
|
||||
asset.setA_QTY_Original(assetadd.getA_QTY_Current().add(asset.getA_QTY_Original()));
|
||||
asset.setA_QTY_Current(assetadd.getA_QTY_Current().add(asset.getA_QTY_Current()));
|
||||
asset.saveEx();
|
||||
|
||||
MAssetChange change = new MAssetChange (getCtx(), 0, get_TrxName());
|
||||
change.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
change.setChangeType("ADD");
|
||||
change.setTextDetails(MRefList.getListDescription (getCtx(),"A_Update_Type" , "ADD"));
|
||||
change.setPostingType(assetwk.getPostingType());
|
||||
change.setAssetValueAmt(assetadd.getAssetValueAmt());
|
||||
change.setA_QTY_Current(assetadd.getA_QTY_Current());
|
||||
change.saveEx();
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.info("getAssets "+ e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs3, pstmt2);
|
||||
rs3 = null; pstmt2 = null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (acctType.equals("E"))
|
||||
{
|
||||
X_A_Asset_Addition assetadd = new X_A_Asset_Addition (getCtx(), 0, get_TrxName());
|
||||
assetadd.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
assetadd.setAssetValueAmt((JVLine.getAmtAcctDr().subtract(JVLine.getAmtAcctCr())));
|
||||
assetadd.setA_SourceType("JRN");
|
||||
assetadd.setA_CapvsExp("Exp");
|
||||
assetadd.setA_QTY_Current(JVLine.getQty());
|
||||
assetadd.setDocumentNo(""+JVLine.getGL_Journal_ID());
|
||||
assetadd.setGL_JournalBatch_ID(JVLine.getGL_Journal_ID());
|
||||
assetadd.setLine(JVLine.getLine());
|
||||
assetadd.setDescription(JVLine.getDescription());
|
||||
assetadd.setPostingType("A");
|
||||
assetadd.saveEx();
|
||||
|
||||
MAssetChange change = new MAssetChange (getCtx(), 0, get_TrxName());
|
||||
change.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
change.setA_QTY_Current(assetadd.getA_QTY_Current());
|
||||
change.setChangeType("EXP");
|
||||
change.setTextDetails(MRefList.getListDescription (getCtx(),"A_Update_Type" , "EXP"));
|
||||
assetadd.setPostingType("A");
|
||||
change.setAssetValueAmt(assetadd.getAssetValueAmt());
|
||||
change.setA_QTY_Current(assetadd.getA_QTY_Current());
|
||||
change.saveEx();
|
||||
}
|
||||
JVLine.set_ValueOfColumn(I_CustomColumn.A_Processed, Boolean.TRUE);
|
||||
JVLine.saveEx();
|
||||
}
|
||||
rs.close();
|
||||
pstmt.close();
|
||||
pstmt = null;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.info("getAssets "+ e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
}
|
||||
return "";
|
||||
} // doIt
|
||||
|
||||
} // CreateGLAsset
|
|
@ -1,648 +0,0 @@
|
|||
/******************************************************************************
|
||||
* The contents of this file are subject to the Compiere License Version 1.1
|
||||
* ("License"); You may not use this file except in compliance with the License
|
||||
* You may obtain a copy of the License at http://www.compiere.org/license.html
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is Compiere ERP & CRM Business Solution
|
||||
* The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
|
||||
* Portions created by Jorg Janke are Copyright (C) 1999-2004 Jorg Janke, parts
|
||||
* created by ComPiere are Copyright (C) ComPiere, Inc.; All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
*****************************************************************************/
|
||||
package org.compiere.FA;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.compiere.model.MAssetAcct;
|
||||
import org.compiere.model.MAssetChange;
|
||||
import org.compiere.model.MRefList;
|
||||
import org.compiere.model.X_A_Asset;
|
||||
import org.compiere.model.X_A_Asset_Addition;
|
||||
import org.compiere.model.X_A_Asset_Group_Acct;
|
||||
import org.compiere.model.X_A_Depreciation_Exp;
|
||||
import org.compiere.model.X_A_Depreciation_Workfile;
|
||||
import org.compiere.model.X_C_BPartner;
|
||||
import org.compiere.model.X_C_Invoice;
|
||||
import org.compiere.model.X_C_InvoiceLine;
|
||||
import org.compiere.model.X_M_Product;
|
||||
import org.compiere.process.ProcessInfoParameter;
|
||||
import org.compiere.process.SvrProcess;
|
||||
import org.compiere.util.DB;
|
||||
|
||||
/**
|
||||
* Create Asset from Invoice Process
|
||||
*
|
||||
* @author Rob Klein
|
||||
*
|
||||
*/
|
||||
public class CreateInvoicedAsset extends SvrProcess
|
||||
{
|
||||
|
||||
private int p_client = 0;
|
||||
//private int p_org = 0;
|
||||
|
||||
/**
|
||||
* Prepare - e.g., get Parameters.
|
||||
*/
|
||||
protected void prepare()
|
||||
{
|
||||
ProcessInfoParameter[] para = getParameter();
|
||||
for (int i = 0; i < para.length; i++)
|
||||
{
|
||||
String name = para[i].getParameterName();
|
||||
if (para[i].getParameter() == null)
|
||||
;
|
||||
else if (name.equals("AD_Client_ID"))
|
||||
p_client = para[i].getParameterAsInt();
|
||||
else
|
||||
log.info("prepare - Unknown Parameter: " + name);
|
||||
}
|
||||
} // prepare
|
||||
|
||||
|
||||
/**
|
||||
* Process Invoices
|
||||
* @return info
|
||||
* @throws Exception
|
||||
*/
|
||||
protected String doIt() throws java.lang.Exception
|
||||
{
|
||||
log.info("Starting inbound invoice process");
|
||||
int uselifemonths = 0;
|
||||
int uselifeyears = 0;
|
||||
int C_Period_ID=0;
|
||||
int invoiceAcct=0;
|
||||
//Yvonne: add in recordInsertedCount
|
||||
int recordInsertedCount = 0;
|
||||
//Yvonne: changed A_Processed is null to A_Processed='N'
|
||||
String sql =" SELECT * FROM C_InvoiceLine WHERE A_Processed='N' and AD_Client_ID = ?"
|
||||
+ " and A_CreateAsset = 'Y' and Processed = 'Y'";
|
||||
|
||||
log.info("sql"+sql+p_client);
|
||||
PreparedStatement pstmt = null;
|
||||
pstmt = DB.prepareStatement(sql,get_TrxName());
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
pstmt.setInt(1, p_client);
|
||||
rs = pstmt.executeQuery();
|
||||
int i=0;
|
||||
|
||||
while (rs.next()){
|
||||
i=i+1;
|
||||
log.info("here is the counter "+i);
|
||||
X_A_Asset asset = new X_A_Asset (getCtx(), rs.getInt("A_Asset_ID"), get_TrxName());
|
||||
|
||||
X_C_Invoice Invoice = new X_C_Invoice (getCtx(), rs.getInt("C_Invoice_ID"), get_TrxName());
|
||||
X_C_InvoiceLine InvoiceLine = new X_C_InvoiceLine (getCtx(), rs, get_TrxName());
|
||||
X_M_Product product = new X_M_Product (getCtx(), InvoiceLine.getM_Product_ID(), get_TrxName());
|
||||
//X_M_Product_Category productcat = new X_M_Product_Category (getCtx(), product.getM_Product_Category_ID(), get_TrxName());
|
||||
|
||||
|
||||
//X_A_Asset_Addition assetadd = new X_A_Asset_Addition (getCtx(), 0);
|
||||
X_C_BPartner business = new X_C_BPartner (getCtx(), Invoice.getC_BPartner_ID(), get_TrxName());
|
||||
|
||||
if (rs.getString("A_CapvsExp").equals("Cap")){
|
||||
String sqla ="SELECT * FROM A_Asset_Group_Acct WHERE A_Asset_Group_ID = ? AND IsActive='Y'";
|
||||
|
||||
PreparedStatement pstmt1 = null;
|
||||
pstmt1 = DB.prepareStatement(sqla,get_TrxName());
|
||||
if(asset.getA_Asset_ID()==0) {
|
||||
int groupId = InvoiceLine.getA_Asset_Group_ID();
|
||||
pstmt1.setInt(1, groupId);
|
||||
} else
|
||||
pstmt1.setInt(1, asset.getA_Asset_Group_ID());
|
||||
ResultSet rs2 = pstmt1.executeQuery();
|
||||
|
||||
while (rs2.next()){
|
||||
|
||||
X_A_Asset_Group_Acct assetgrpacct = new X_A_Asset_Group_Acct (getCtx(), rs2,get_TrxName());
|
||||
MAssetAcct assetacct = new MAssetAcct (getCtx(), 0, get_TrxName());
|
||||
if (assetgrpacct.isProcessing()== true){
|
||||
String sql2 = "SELECT COUNT(*) FROM A_Depreciation_Workfile WHERE A_Asset_ID=? and"
|
||||
+ " PostingType = '"+assetgrpacct.getPostingType()+"'";
|
||||
if (DB.getSQLValue(get_TrxName(),sql2, asset.getA_Asset_ID())== 0)
|
||||
{
|
||||
|
||||
asset.setIsOwned(true);
|
||||
asset.setIsDepreciated(assetgrpacct.isProcessing());
|
||||
asset.setA_Asset_CreateDate(Invoice.getDateInvoiced());
|
||||
asset.setIsInPosession(true);
|
||||
if (InvoiceLine.getM_Product_ID()>0)
|
||||
asset.setName(product.getName()+"-"+business.getName()+"-"+Invoice.getDocumentNo());
|
||||
else
|
||||
asset.setName(business.getName()+"-"+Invoice.getDocumentNo());
|
||||
asset.setHelp("Created from Invoice #" + rs.getInt("C_Invoice_ID") + " on line #" + InvoiceLine.getLine());
|
||||
asset.setDescription(InvoiceLine.getDescription());
|
||||
asset.setUseLifeMonths(assetgrpacct.getUseLifeMonths());
|
||||
asset.setUseLifeYears(assetgrpacct.getUseLifeYears());
|
||||
asset.setA_Asset_Group_ID(assetgrpacct.getA_Asset_Group_ID());
|
||||
asset.setA_QTY_Current(InvoiceLine.getQtyEntered());
|
||||
asset.setA_QTY_Original(InvoiceLine.getQtyEntered());
|
||||
asset.saveEx();
|
||||
asset.setA_Parent_Asset_ID(asset.getA_Asset_ID());
|
||||
asset.saveEx();
|
||||
|
||||
boolean isdepreciate = assetgrpacct.isProcessing();
|
||||
|
||||
if (isdepreciate == true)
|
||||
{
|
||||
assetacct.setPostingType(assetgrpacct.getPostingType());
|
||||
assetacct.setA_Split_Percent(assetgrpacct.getA_Split_Percent());
|
||||
assetacct.setA_Depreciation_Conv_ID(assetgrpacct.getConventionType());
|
||||
assetacct.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
assetacct.setA_Depreciation_ID(assetgrpacct.getDepreciationType());
|
||||
assetacct.setA_Asset_Spread_ID(assetgrpacct.getA_Asset_Spread_Type());
|
||||
assetacct.setA_Period_Start(1);
|
||||
|
||||
if (asset.getUseLifeMonths() == 0 & asset.getUseLifeYears() == 0){
|
||||
assetacct.setA_Period_End(assetgrpacct.getUseLifeMonths());
|
||||
asset.setUseLifeYears(assetgrpacct.getUseLifeYears());
|
||||
asset.setUseLifeMonths(assetgrpacct.getUseLifeMonths());
|
||||
asset.setIsDepreciated(true);
|
||||
asset.setIsOwned(true);
|
||||
asset.saveEx();
|
||||
uselifemonths = assetgrpacct.getUseLifeMonths();
|
||||
uselifeyears = assetgrpacct.getUseLifeYears();
|
||||
|
||||
}
|
||||
else if(asset.getUseLifeMonths() == 0){
|
||||
assetacct.setA_Period_End(asset.getUseLifeYears()*12);
|
||||
asset.setUseLifeMonths(asset.getUseLifeYears()*12);
|
||||
asset.setIsDepreciated(true);
|
||||
asset.setIsOwned(true);
|
||||
asset.saveEx();
|
||||
uselifemonths = asset.getUseLifeYears()*12;
|
||||
uselifeyears = asset.getUseLifeYears();
|
||||
}
|
||||
else{
|
||||
assetacct.setA_Period_End(asset.getUseLifeMonths());
|
||||
uselifemonths = asset.getUseLifeMonths();
|
||||
uselifeyears = asset.getUseLifeYears();}
|
||||
|
||||
assetacct.setA_Depreciation_Method_ID(assetgrpacct.getA_Depreciation_Calc_Type());
|
||||
assetacct.setA_Asset_Acct(assetgrpacct.getA_Asset_Acct());
|
||||
assetacct.setC_AcctSchema_ID(assetgrpacct.getC_AcctSchema_ID());
|
||||
assetacct.setA_Accumdepreciation_Acct(assetgrpacct.getA_Accumdepreciation_Acct());
|
||||
assetacct.setA_Depreciation_Acct(assetgrpacct.getA_Depreciation_Acct());
|
||||
assetacct.setA_Disposal_Revenue(assetgrpacct.getA_Disposal_Revenue());
|
||||
assetacct.setA_Disposal_Loss(assetgrpacct.getA_Disposal_Loss());
|
||||
assetacct.setA_Salvage_Value(new BigDecimal(0.0));
|
||||
assetacct.setA_Reval_Accumdep_Offset_Cur(assetgrpacct.getA_Reval_Accumdep_Offset_Cur());
|
||||
assetacct.setA_Reval_Accumdep_Offset_Prior(assetgrpacct.getA_Reval_Accumdep_Offset_Prior());
|
||||
assetacct.setA_Reval_Cal_Method(assetgrpacct.getA_Reval_Cal_Method());
|
||||
assetacct.setA_Reval_Cost_Offset(assetgrpacct.getA_Reval_Cost_Offset());
|
||||
assetacct.setA_Reval_Cost_Offset_Prior(assetgrpacct.getA_Reval_Cost_Offset_Prior());
|
||||
assetacct.setA_Reval_Depexp_Offset(assetgrpacct.getA_Reval_Depexp_Offset());
|
||||
assetacct.setA_Depreciation_Manual_Amount(assetgrpacct.getA_Depreciation_Manual_Amount());
|
||||
assetacct.setA_Depreciation_Manual_Period(assetgrpacct.getA_Depreciation_Manual_Period());
|
||||
assetacct.setA_Depreciation_Table_Header_ID(assetgrpacct.getA_Depreciation_Table_Header_ID());
|
||||
assetacct.setA_Depreciation_Variable_Perc(assetgrpacct.getA_Depreciation_Variable_Perc());
|
||||
assetacct.setProcessing(false);
|
||||
assetacct.getAD_Client_ID();
|
||||
assetacct.saveEx();
|
||||
|
||||
MAssetChange change = new MAssetChange (getCtx(), 0, get_TrxName());
|
||||
change.setPostingType(assetacct.getPostingType());
|
||||
change.setA_Split_Percent(assetacct.getA_Split_Percent());
|
||||
change.setConventionType(assetacct.getA_Depreciation_Conv_ID());
|
||||
change.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
change.setDepreciationType(assetacct.getA_Depreciation_ID());
|
||||
change.setA_Asset_Spread_Type(assetacct.getA_Asset_Spread_ID());
|
||||
change.setA_Period_Start(assetacct.getA_Period_Start());
|
||||
change.setA_Period_End(assetacct.getA_Period_End());
|
||||
change.setIsInPosession(asset.isOwned());
|
||||
change.setIsDisposed(asset.isDisposed());
|
||||
change.setIsDepreciated(asset.isDepreciated());
|
||||
change.setIsFullyDepreciated(asset.isFullyDepreciated());
|
||||
change.setA_Depreciation_Calc_Type(assetacct.getA_Depreciation_Method_ID());
|
||||
change.setA_Asset_Acct(assetacct.getA_Asset_Acct());
|
||||
change.setC_AcctSchema_ID(assetacct.getC_AcctSchema_ID());
|
||||
change.setA_Accumdepreciation_Acct(assetacct.getA_Accumdepreciation_Acct());
|
||||
change.setA_Depreciation_Acct(assetacct.getA_Depreciation_Acct());
|
||||
change.setA_Disposal_Revenue(assetacct.getA_Disposal_Revenue());
|
||||
change.setA_Disposal_Loss(assetacct.getA_Disposal_Loss());
|
||||
change.setA_Reval_Accumdep_Offset_Cur(assetacct.getA_Reval_Accumdep_Offset_Cur());
|
||||
change.setA_Reval_Accumdep_Offset_Prior(assetacct.getA_Reval_Accumdep_Offset_Prior());
|
||||
change.setA_Reval_Cal_Method(assetacct.getA_Reval_Cal_Method());
|
||||
change.setA_Reval_Cost_Offset(assetacct.getA_Reval_Cost_Offset());
|
||||
change.setA_Reval_Cost_Offset_Prior(assetacct.getA_Reval_Cost_Offset_Prior());
|
||||
change.setA_Reval_Depexp_Offset(assetacct.getA_Reval_Depexp_Offset());
|
||||
change.setA_Depreciation_Manual_Amount(assetacct.getA_Depreciation_Manual_Amount());
|
||||
change.setA_Depreciation_Manual_Period(assetacct.getA_Depreciation_Manual_Period());
|
||||
change.setA_Depreciation_Table_Header_ID(assetacct.getA_Depreciation_Table_Header_ID());
|
||||
change.setA_Depreciation_Variable_Perc(assetacct.getA_Depreciation_Variable_Perc());
|
||||
change.setA_Parent_Asset_ID(asset.getA_Parent_Asset_ID());
|
||||
change.setChangeType("CRT");
|
||||
change.setTextDetails(MRefList.getListDescription (getCtx(),"A_Update_Type" , "CRT"));
|
||||
change.setIsInPosession(asset.isOwned());
|
||||
change.setIsDisposed(asset.isDisposed());
|
||||
change.setIsDepreciated(asset.isDepreciated());
|
||||
change.setIsFullyDepreciated(asset.isFullyDepreciated());
|
||||
change.setLot(asset.getLot());
|
||||
change.setSerNo(asset.getSerNo());
|
||||
change.setVersionNo(asset.getVersionNo());
|
||||
change.setUseLifeMonths(asset.getUseLifeMonths());
|
||||
change.setUseLifeYears(asset.getUseLifeYears());
|
||||
change.setLifeUseUnits(asset.getLifeUseUnits());
|
||||
change.setAssetDisposalDate(asset.getAssetDisposalDate());
|
||||
change.setAssetServiceDate(asset.getAssetServiceDate());
|
||||
change.setC_BPartner_Location_ID(asset.getC_BPartner_Location_ID());
|
||||
change.setC_BPartner_ID(asset.getC_BPartner_ID());
|
||||
change.setAssetValueAmt(InvoiceLine.getLineTotalAmt());
|
||||
change.setA_QTY_Current(InvoiceLine.getQtyEntered());
|
||||
change.setA_QTY_Original(InvoiceLine.getQtyEntered());
|
||||
change.setA_Asset_CreateDate(asset.getA_Asset_CreateDate());
|
||||
change.setAD_User_ID(asset.getAD_User_ID());
|
||||
change.setC_Location_ID(asset.getC_Location_ID());
|
||||
change.saveEx();
|
||||
}
|
||||
|
||||
|
||||
|
||||
X_A_Depreciation_Workfile assetwk = new X_A_Depreciation_Workfile (getCtx(), 0, get_TrxName());
|
||||
assetwk.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
assetwk.setA_Life_Period(assetgrpacct.getUseLifeMonths());
|
||||
assetwk.setA_Asset_Life_Years(assetgrpacct.getUseLifeYears());
|
||||
assetwk.setA_Asset_Cost(assetwk.getA_Asset_Cost().add(InvoiceLine.getLineTotalAmt()));
|
||||
assetwk.setA_QTY_Current(InvoiceLine.getQtyEntered());
|
||||
assetwk.setIsDepreciated(assetgrpacct.isProcessing());
|
||||
assetwk.setPostingType(assetgrpacct.getPostingType());
|
||||
assetwk.setA_Accumulated_Depr(new BigDecimal (0.0));
|
||||
assetwk.setA_Period_Posted(0);
|
||||
assetwk.setA_Asset_Life_Current_Year(new BigDecimal (0.0));
|
||||
assetwk.setA_Curr_Dep_Exp(new BigDecimal (0.0));
|
||||
assetwk.saveEx();
|
||||
|
||||
X_A_Asset_Addition assetadd = new X_A_Asset_Addition (getCtx(), 0, get_TrxName());
|
||||
assetadd.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
assetadd.setAssetValueAmt(InvoiceLine.getLineTotalAmt());
|
||||
assetadd.setA_SourceType("INV");
|
||||
assetadd.setA_CapvsExp("Cap");
|
||||
assetadd.setM_InOutLine_ID(rs.getInt("C_Invoice_ID"));
|
||||
assetadd.setC_Invoice_ID(rs.getInt("C_Invoice_ID"));
|
||||
assetadd.setDocumentNo(Invoice.getDocumentNo());
|
||||
assetadd.setLine(InvoiceLine.getLine());
|
||||
assetadd.setDescription(InvoiceLine.getDescription());
|
||||
assetadd.setA_QTY_Current(InvoiceLine.getQtyEntered());
|
||||
assetadd.setPostingType(assetwk.getPostingType());
|
||||
assetadd.saveEx();
|
||||
|
||||
String sql1 = "SELECT C_Period_ID "
|
||||
+ "FROM C_Period "
|
||||
+ "WHERE C_Year_ID IN "
|
||||
+ " (SELECT C_Year_ID FROM C_Year WHERE C_Calendar_ID ="
|
||||
+ " (SELECT C_Calendar_ID FROM AD_ClientInfo WHERE AD_Client_ID=?))"
|
||||
+ " AND ? BETWEEN StartDate AND EndDate"
|
||||
+ " AND PeriodType='S'";
|
||||
|
||||
try
|
||||
{
|
||||
PreparedStatement pstmt4 = DB.prepareStatement(sql1,get_TrxName());
|
||||
pstmt4.setInt(1, asset.getAD_Client_ID());
|
||||
pstmt4.setTimestamp(2, Invoice.getDateAcct());
|
||||
ResultSet rs4 = pstmt4.executeQuery();
|
||||
if (rs4.next())
|
||||
C_Period_ID = rs4.getInt(1);
|
||||
DB.close(rs4, pstmt4);
|
||||
pstmt4 = null;
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
log.log(Level.SEVERE, "Journal_Period - DateAcct", e);
|
||||
return e.getLocalizedMessage();
|
||||
}
|
||||
|
||||
/**Code below is for future functionality
|
||||
int DocumentNo = MSequence.getNextID (Env.getAD_Client_ID(Env.getCtx()), "DocumentNo_M_InOut", get_TrxName());
|
||||
|
||||
|
||||
//Adjust Inventory Quantity
|
||||
X_M_InOut mInOut = new X_M_InOut (getCtx(), 0, get_TrxName());
|
||||
mInOut.setC_BPartner_ID (Invoice.getC_BPartner_ID());
|
||||
mInOut.setC_BPartner_Location_ID (Invoice.getC_BPartner_Location_ID());
|
||||
mInOut.setC_DocType_ID (Invoice.getC_DocType_ID());
|
||||
mInOut.setDateAcct (new Timestamp(System.currentTimeMillis())); // @#Date@
|
||||
mInOut.setDeliveryRule ("A"); // A
|
||||
mInOut.setDeliveryViaRule ("P"); // P
|
||||
mInOut.setDocAction ("CO"); // CO
|
||||
mInOut.setDocStatus ("DR"); // DR
|
||||
mInOut.setDescription("Invoice transfered to assets");
|
||||
mInOut.setDocumentNo (""+DocumentNo);
|
||||
mInOut.setFreightCostRule ("I"); // I
|
||||
mInOut.setPriorityRule("5");
|
||||
mInOut.setIsApproved (false);
|
||||
mInOut.setIsInDispute (false);
|
||||
mInOut.setIsInTransit (false);
|
||||
mInOut.setIsPrinted (false);
|
||||
mInOut.setIsSOTrx (false); // @IsSOTrx@
|
||||
mInOut.setM_InOut_ID (0);
|
||||
mInOut.setM_Warehouse_ID (0);
|
||||
mInOut.setMovementDate (new Timestamp(System.currentTimeMillis())); // @#Date@
|
||||
mInOut.setMovementType ("V-");
|
||||
mInOut.setPosted (false);
|
||||
mInOut.setProcessed (false);
|
||||
mInOut.setSendEMail (false);
|
||||
mInOut.saveEx();
|
||||
|
||||
X_M_InOutLine mInOutLine = new X_M_InOutLine (getCtx(), 0, get_TrxName());
|
||||
mInOutLine.setC_UOM_ID (InvoiceLine.getC_UOM_ID()); // @#C_UOM_ID@
|
||||
mInOutLine.setIsDescription (false); // N
|
||||
mInOutLine.setIsInvoiced (false);
|
||||
mInOutLine.setLine (10); // @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM M_InOutLine WHERE M_InOut_ID=@M_InOut_ID@
|
||||
mInOutLine.setM_AttributeSetInstance_ID (InvoiceLine.getM_AttributeSetInstance_ID());
|
||||
mInOutLine.setM_InOut_ID (mInOut.getM_InOut_ID());
|
||||
mInOutLine.setM_Locator_ID (0); // @M_Locator_ID@
|
||||
mInOutLine.setM_Product_ID (InvoiceLine.getM_Product_ID());
|
||||
mInOutLine.setMovementQty (InvoiceLine.getQtyInvoiced()); // 1
|
||||
mInOutLine.setProcessed (false);
|
||||
mInOutLine.setQtyEntered (Env.ZERO); // 1
|
||||
**/
|
||||
|
||||
//Determine non tax accounts to credit
|
||||
invoiceAcct = determineAcct (assetacct.getC_AcctSchema_ID(), InvoiceLine.getM_Product_ID(), InvoiceLine.getC_Charge_ID(), InvoiceLine.getLineNetAmt());
|
||||
|
||||
//Create Journal Entries for the new asset
|
||||
X_A_Depreciation_Exp depexp2 = new X_A_Depreciation_Exp (getCtx(), 0, get_TrxName());
|
||||
depexp2.setPostingType(assetacct.getPostingType());
|
||||
depexp2.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
depexp2.setExpense(InvoiceLine.getLineTotalAmt());
|
||||
depexp2.setDateAcct(Invoice.getDateAcct());
|
||||
depexp2.setA_Account_Number(assetacct.getA_Asset_Acct());
|
||||
depexp2.setDescription("Create Asset from Invoice");
|
||||
depexp2.setIsDepreciated(false);
|
||||
depexp2.setA_Period(C_Period_ID);
|
||||
depexp2.setA_Entry_Type("NEW");
|
||||
depexp2.saveEx();
|
||||
recordInsertedCount++;
|
||||
|
||||
X_A_Depreciation_Exp depexp3 = new X_A_Depreciation_Exp (getCtx(), 0, get_TrxName());
|
||||
depexp3.setPostingType(assetacct.getPostingType());
|
||||
depexp3.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
depexp3.setExpense(InvoiceLine.getLineNetAmt().multiply(new BigDecimal (-1)));
|
||||
depexp3.setDateAcct(Invoice.getDateAcct());
|
||||
depexp3.setA_Account_Number(invoiceAcct);
|
||||
depexp3.setDescription("Create Asset from Invoice");
|
||||
depexp3.setIsDepreciated(false);
|
||||
depexp3.setA_Period(C_Period_ID);
|
||||
depexp3.setA_Entry_Type("NEW");
|
||||
depexp3.saveEx();
|
||||
recordInsertedCount++;
|
||||
|
||||
//Determine if tax adjustment is necessary
|
||||
if (InvoiceLine.getTaxAmt().compareTo(new BigDecimal (0))!=0){
|
||||
|
||||
invoiceAcct = determineTaxAcct (assetacct.getC_AcctSchema_ID(), InvoiceLine.getC_Tax_ID());
|
||||
|
||||
X_A_Depreciation_Exp depexp4 = new X_A_Depreciation_Exp (getCtx(), 0, get_TrxName());
|
||||
depexp4.setPostingType(assetacct.getPostingType());
|
||||
depexp4.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
depexp4.setExpense(InvoiceLine.getTaxAmt().multiply(new BigDecimal (-1)));
|
||||
depexp4.setDateAcct(Invoice.getDateAcct());
|
||||
depexp4.setA_Account_Number(invoiceAcct);
|
||||
depexp4.setDescription("Create Asset from Invoice");
|
||||
depexp4.setIsDepreciated(false);
|
||||
depexp4.setA_Period(C_Period_ID);
|
||||
depexp4.setA_Entry_Type("NEW");
|
||||
depexp4.saveEx();
|
||||
recordInsertedCount++;
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sql2 ="SELECT * FROM A_Depreciation_Workfile WHERE A_Asset_ID = ? and PostingType = ?";
|
||||
PreparedStatement pstmt2 = null;
|
||||
pstmt2 = DB.prepareStatement(sql2,get_TrxName());
|
||||
ResultSet rs3 = null;
|
||||
try {
|
||||
pstmt2.setInt(1, asset.getA_Asset_ID());
|
||||
pstmt2.setString(2, assetgrpacct.getPostingType());
|
||||
rs3 = pstmt2.executeQuery();
|
||||
while (rs3.next()){
|
||||
X_A_Depreciation_Workfile assetwk = new X_A_Depreciation_Workfile (getCtx(), rs3, get_TrxName());
|
||||
assetwk.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
assetwk.setA_Life_Period(assetgrpacct.getUseLifeMonths());
|
||||
assetwk.setA_Asset_Life_Years(assetgrpacct.getUseLifeYears());
|
||||
assetwk.setA_Asset_Cost(assetwk.getA_Asset_Cost().add(InvoiceLine.getLineTotalAmt()));
|
||||
assetwk.setIsDepreciated(assetgrpacct.isProcessing());
|
||||
assetwk.setA_QTY_Current(InvoiceLine.getQtyEntered());
|
||||
assetwk.saveEx();
|
||||
|
||||
X_A_Asset_Addition assetadd = new X_A_Asset_Addition (getCtx(), 0, get_TrxName());
|
||||
assetadd.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
assetadd.setAssetValueAmt(InvoiceLine.getLineTotalAmt());
|
||||
assetadd.setA_SourceType("INV");
|
||||
assetadd.setA_CapvsExp("Cap");
|
||||
assetadd.setM_InOutLine_ID(rs.getInt("C_Invoice_ID"));
|
||||
assetadd.setC_Invoice_ID(rs.getInt("C_Invoice_ID"));
|
||||
assetadd.setDocumentNo(Invoice.getDocumentNo());
|
||||
assetadd.setLine(InvoiceLine.getLine());
|
||||
assetadd.setDescription(InvoiceLine.getDescription());
|
||||
assetadd.setA_QTY_Current(InvoiceLine.getQtyEntered());
|
||||
assetadd.setPostingType(assetwk.getPostingType());
|
||||
assetadd.saveEx();
|
||||
|
||||
|
||||
asset.setA_QTY_Original(assetadd.getA_QTY_Current().add(asset.getA_QTY_Original()));
|
||||
asset.setA_QTY_Current(assetadd.getA_QTY_Current().add(asset.getA_QTY_Current()));
|
||||
asset.saveEx();
|
||||
|
||||
MAssetChange change = new MAssetChange (getCtx(), 0, get_TrxName());
|
||||
change.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
change.setA_QTY_Current(assetadd.getA_QTY_Current());
|
||||
change.setChangeType("ADD");
|
||||
change.setTextDetails(MRefList.getListDescription (getCtx(),"A_Update_Type" , "ADD"));
|
||||
change.setPostingType(assetwk.getPostingType());
|
||||
change.setAssetValueAmt(assetadd.getAssetValueAmt());
|
||||
change.setA_QTY_Current(assetadd.getA_QTY_Current());
|
||||
change.saveEx();
|
||||
|
||||
|
||||
|
||||
|
||||
//Determine non tax accounts to credit
|
||||
invoiceAcct = determineAcct (assetacct.getC_AcctSchema_ID(), InvoiceLine.getM_Product_ID(), InvoiceLine.getC_Charge_ID(), InvoiceLine.getLineNetAmt());
|
||||
|
||||
//Create Journal Entries for the new asset
|
||||
X_A_Depreciation_Exp depexp2 = new X_A_Depreciation_Exp (getCtx(), 0, get_TrxName());
|
||||
depexp2.setPostingType(assetacct.getPostingType());
|
||||
depexp2.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
depexp2.setExpense(InvoiceLine.getLineTotalAmt());
|
||||
depexp2.setDateAcct(Invoice.getDateAcct());
|
||||
depexp2.setA_Account_Number(assetacct.getA_Asset_Acct());
|
||||
depexp2.setDescription("Create Asset from Invoice");
|
||||
depexp2.setIsDepreciated(false);
|
||||
depexp2.setA_Period(C_Period_ID);
|
||||
depexp2.setA_Entry_Type("NEW");
|
||||
depexp2.saveEx();
|
||||
recordInsertedCount++;
|
||||
|
||||
X_A_Depreciation_Exp depexp3 = new X_A_Depreciation_Exp (getCtx(), 0, get_TrxName());
|
||||
depexp3.setPostingType(assetacct.getPostingType());
|
||||
depexp3.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
depexp3.setExpense(InvoiceLine.getLineNetAmt().multiply(new BigDecimal (-1)));
|
||||
depexp3.setDateAcct(Invoice.getDateAcct());
|
||||
depexp3.setA_Account_Number(invoiceAcct);
|
||||
depexp3.setDescription("Create Asset from Invoice");
|
||||
depexp3.setIsDepreciated(false);
|
||||
depexp3.setA_Period(C_Period_ID);
|
||||
depexp3.setA_Entry_Type("NEW");
|
||||
depexp3.saveEx();
|
||||
recordInsertedCount++;
|
||||
|
||||
//Determine if tax adjustment is necessary
|
||||
if (InvoiceLine.getTaxAmt().compareTo(new BigDecimal (0))!=0){
|
||||
|
||||
invoiceAcct = determineTaxAcct (assetacct.getC_AcctSchema_ID(), InvoiceLine.getC_Tax_ID());
|
||||
|
||||
X_A_Depreciation_Exp depexp4 = new X_A_Depreciation_Exp (getCtx(), 0, get_TrxName());
|
||||
depexp4.setPostingType(assetacct.getPostingType());
|
||||
depexp4.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
depexp4.setExpense(InvoiceLine.getTaxAmt().multiply(new BigDecimal (-1)));
|
||||
depexp4.setDateAcct(Invoice.getDateAcct());
|
||||
depexp4.setA_Account_Number(invoiceAcct);
|
||||
depexp4.setDescription("Create Asset from Invoice");
|
||||
depexp4.setIsDepreciated(false);
|
||||
depexp4.setA_Period(C_Period_ID);
|
||||
depexp4.setA_Entry_Type("NEW");
|
||||
depexp4.saveEx();
|
||||
recordInsertedCount++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.info("getAssets "+ e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs3, pstmt2);
|
||||
pstmt2 = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
DB.close(rs2, pstmt1);
|
||||
pstmt1 = null;
|
||||
}
|
||||
else if (rs.getString("A_CapvsExp").equals("Exp"))
|
||||
{
|
||||
X_A_Asset_Addition assetadd = new X_A_Asset_Addition (getCtx(), 0, get_TrxName());
|
||||
assetadd.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
assetadd.setAssetValueAmt(InvoiceLine.getLineTotalAmt());
|
||||
assetadd.setA_SourceType("INV");
|
||||
assetadd.setA_CapvsExp("Exp");
|
||||
assetadd.setM_InOutLine_ID(rs.getInt("C_Invoice_ID"));
|
||||
assetadd.setC_Invoice_ID(rs.getInt("C_Invoice_ID"));
|
||||
assetadd.setDocumentNo(Invoice.getDocumentNo());
|
||||
assetadd.setLine(InvoiceLine.getLine());
|
||||
assetadd.setDescription(InvoiceLine.getDescription());
|
||||
assetadd.setA_QTY_Current(InvoiceLine.getQtyEntered());
|
||||
assetadd.setPostingType("A");
|
||||
assetadd.saveEx();
|
||||
|
||||
MAssetChange change = new MAssetChange (getCtx(), 0, get_TrxName());
|
||||
change.setA_Asset_ID(asset.getA_Asset_ID());
|
||||
change.setA_QTY_Current(assetadd.getA_QTY_Current());
|
||||
change.setChangeType("EXP");
|
||||
change.setTextDetails(MRefList.getListDescription (getCtx(),"A_Update_Type" , "EXP"));
|
||||
assetadd.setPostingType("A");
|
||||
change.setAssetValueAmt(assetadd.getAssetValueAmt());
|
||||
change.setA_QTY_Current(assetadd.getA_QTY_Current());
|
||||
change.saveEx();
|
||||
}
|
||||
InvoiceLine.set_ValueOfColumn(I_CustomColumn.A_Processed, Boolean.TRUE);
|
||||
InvoiceLine.saveEx();
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.info("getAssets "+ e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
pstmt = null;
|
||||
}
|
||||
|
||||
if (recordInsertedCount > 0)
|
||||
{
|
||||
return recordInsertedCount + " record(s) inserted.";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "Zero record inserted.";
|
||||
}
|
||||
} // doIt
|
||||
|
||||
/**
|
||||
* Get non tax posting accounts for invoice.
|
||||
*
|
||||
*
|
||||
*/
|
||||
private int determineAcct (int C_AcctSchema_ID, int M_Product_ID, int C_Charge_ID, BigDecimal lineAmt)
|
||||
{
|
||||
int invoiceAcct =0;
|
||||
if (M_Product_ID == 0 && C_Charge_ID != 0)
|
||||
{
|
||||
String sqlb = "SELECT CH_Expense_Acct FROM C_Charge_Acct WHERE C_Charge_ID=? and C_AcctSchema_ID=?";
|
||||
invoiceAcct = DB.getSQLValue(get_TrxName(),sqlb,C_Charge_ID,C_AcctSchema_ID);
|
||||
}
|
||||
|
||||
else if(M_Product_ID != 0){
|
||||
if(lineAmt.signum() > 0){
|
||||
String sqlb = "SELECT P_Expense_Acct FROM M_Product_Acct WHERE M_Product_ID=? and C_AcctSchema_ID=?";
|
||||
invoiceAcct = DB.getSQLValue(get_TrxName(),sqlb,M_Product_ID,C_AcctSchema_ID);
|
||||
}
|
||||
else{
|
||||
String sqlb = "SELECT P_Revenue_Acct FROM M_Product_Acct WHERE M_Product_ID=? and C_AcctSchema_ID=?";
|
||||
invoiceAcct = DB.getSQLValue(get_TrxName(),sqlb,M_Product_ID,C_AcctSchema_ID);
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(lineAmt.signum() > 0){
|
||||
String sqlb = "SELECT P_Expense_Acct "
|
||||
+ "FROM M_Product_Category pc, M_Product_Category_Acct pca "
|
||||
+ "WHERE pc.M_Product_Category_ID=pca.M_Product_Category_ID"
|
||||
+ " AND pca.C_AcctSchema_ID=? "
|
||||
+ "ORDER BY pc.IsDefault DESC, pc.Created";
|
||||
invoiceAcct = DB.getSQLValue(get_TrxName(),sqlb,C_AcctSchema_ID);
|
||||
}
|
||||
else{
|
||||
String sqlb = "SELECT P_Revenue_Acct "
|
||||
+ "FROM M_Product_Category pc, M_Product_Category_Acct pca "
|
||||
+ "WHERE pc.M_Product_Category_ID=pca.M_Product_Category_ID"
|
||||
+ " AND pca.C_AcctSchema_ID=? "
|
||||
+ "ORDER BY pc.IsDefault DESC, pc.Created";
|
||||
invoiceAcct = DB.getSQLValue(get_TrxName(),sqlb,C_AcctSchema_ID);
|
||||
}
|
||||
|
||||
}
|
||||
return invoiceAcct;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tax posting accounts for invoice.
|
||||
*
|
||||
*
|
||||
*/
|
||||
private int determineTaxAcct (int C_AcctSchema_ID, int C_Tax_ID)
|
||||
{
|
||||
int invoiceAcct =0;
|
||||
|
||||
String sqlb = "SELECT T_Expense_Acct FROM C_Tax_Acct WHERE C_AcctSchema_ID=? and C_Tax_ID=?";
|
||||
invoiceAcct = DB.getSQLValue(get_TrxName(),sqlb,C_AcctSchema_ID,C_Tax_ID);
|
||||
|
||||
return invoiceAcct;
|
||||
}
|
||||
|
||||
} // InvoiceCreateInOut
|
|
@ -1,918 +0,0 @@
|
|||
/******************************************************************************
|
||||
* The contents of this file are subject to the Compiere License Version 1.1
|
||||
* ("License"); You may not use this file except in compliance with the License
|
||||
* You may obtain a copy of the License at http://www.compiere.org/license.html
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is Compiere ERP & CRM Business Solution
|
||||
* The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
|
||||
*
|
||||
* Copyright (C) 2005 Robert Klein. robeklein@hotmail.com
|
||||
* _____________________________________________
|
||||
*****************************************************************************/
|
||||
package org.compiere.FA;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.Calendar;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
import org.compiere.util.DB;
|
||||
/**
|
||||
* Fixed Asset Depreciation
|
||||
*
|
||||
* @author Rob Klein
|
||||
* @version $Id: Conventions.java,v 1.0 $
|
||||
*
|
||||
*/
|
||||
public class Depreciation {
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
static public BigDecimal Dep_Type(String Type,int p_A_ASSET_ID, double p_A_CURRENT_PERIOD, String p_POSTINGTYPE,
|
||||
int p_A_ASSET_ACCT_ID, BigDecimal p_Accum_Dep)
|
||||
{
|
||||
BigDecimal A_Period_Exp = new BigDecimal(0.0);
|
||||
if(Type.compareTo("DB150")==0){
|
||||
A_Period_Exp = DB150( 0, p_A_ASSET_ID, p_A_CURRENT_PERIOD, p_POSTINGTYPE, p_A_ASSET_ACCT_ID, p_Accum_Dep);
|
||||
//System.out.println("DB150 Main: "+A_Period_Exp);
|
||||
return A_Period_Exp;
|
||||
}
|
||||
else if(Type.compareTo("DB1SL")==0){
|
||||
A_Period_Exp = DB150( 1, p_A_ASSET_ID, p_A_CURRENT_PERIOD, p_POSTINGTYPE, p_A_ASSET_ACCT_ID, p_Accum_Dep);
|
||||
//System.out.println("DB1SL Main: "+A_Period_Exp);
|
||||
return A_Period_Exp;
|
||||
}
|
||||
else if(Type.compareTo("DB200")==0){
|
||||
A_Period_Exp = DB200( 0, p_A_ASSET_ID, p_A_CURRENT_PERIOD, p_POSTINGTYPE, p_A_ASSET_ACCT_ID, p_Accum_Dep);
|
||||
//System.out.println("DB200 Main: "+A_Period_Exp);
|
||||
return A_Period_Exp;
|
||||
}
|
||||
else if(Type.compareTo("DB2SL")==0){
|
||||
A_Period_Exp = DB200( 1, p_A_ASSET_ID, p_A_CURRENT_PERIOD, p_POSTINGTYPE, p_A_ASSET_ACCT_ID, p_Accum_Dep);
|
||||
//System.out.println("DB2SL Main: "+A_Period_Exp);
|
||||
return A_Period_Exp;
|
||||
}
|
||||
else if(Type.compareTo("VAR")==0){
|
||||
A_Period_Exp = DBVAR( 0, p_A_ASSET_ID, p_A_CURRENT_PERIOD, p_POSTINGTYPE, p_A_ASSET_ACCT_ID, p_Accum_Dep);
|
||||
//System.out.println("VAR Main: "+A_Period_Exp);
|
||||
return A_Period_Exp;
|
||||
}
|
||||
else if(Type.compareTo("VARSL")==0){
|
||||
A_Period_Exp = DBVAR( 1, p_A_ASSET_ID, p_A_CURRENT_PERIOD, p_POSTINGTYPE, p_A_ASSET_ACCT_ID, p_Accum_Dep);
|
||||
//System.out.println("VARSL Main: "+A_Period_Exp);
|
||||
return A_Period_Exp;
|
||||
}
|
||||
else if(Type.compareTo("MAN")==0){
|
||||
A_Period_Exp = MAN( 1, p_A_ASSET_ID, p_A_CURRENT_PERIOD, p_POSTINGTYPE, p_A_ASSET_ACCT_ID, p_Accum_Dep);
|
||||
//System.out.println("MAN Main: "+A_Period_Exp);
|
||||
return A_Period_Exp;
|
||||
}
|
||||
else if(Type.compareTo("SL")==0){
|
||||
A_Period_Exp = SL( 1, p_A_ASSET_ID, p_A_CURRENT_PERIOD, p_POSTINGTYPE, p_A_ASSET_ACCT_ID, p_Accum_Dep);
|
||||
//System.out.println("SL Main: "+A_Period_Exp);
|
||||
return A_Period_Exp;
|
||||
}
|
||||
else if(Type.compareTo("SYD")==0){
|
||||
A_Period_Exp = SYD( 1, p_A_ASSET_ID, p_A_CURRENT_PERIOD, p_POSTINGTYPE, p_A_ASSET_ACCT_ID, p_Accum_Dep);
|
||||
//System.out.println("SYD Main: "+A_Period_Exp);
|
||||
return A_Period_Exp;
|
||||
}
|
||||
else if(Type.compareTo("TAB")==0){
|
||||
A_Period_Exp = TAB( 1, p_A_ASSET_ID, p_A_CURRENT_PERIOD, p_POSTINGTYPE, p_A_ASSET_ACCT_ID, p_Accum_Dep);
|
||||
//System.out.println("TAB Main: "+A_Period_Exp);
|
||||
return A_Period_Exp;
|
||||
}
|
||||
else
|
||||
return new BigDecimal(0.0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
static public BigDecimal DB150(int p_SL, int p_A_ASSET_ID, double p_A_CURRENT_PERIOD, String p_POSTINGTYPE,
|
||||
int p_A_ASSET_ACCT_ID, BigDecimal p_Accum_Dep)
|
||||
{
|
||||
BigDecimal v_DB = new BigDecimal(0.0);
|
||||
BigDecimal v_Accum_Dep = new BigDecimal(0.0);
|
||||
BigDecimal v_SL = new BigDecimal(0.0);
|
||||
BigDecimal A_Period_Exp = new BigDecimal(0.0);
|
||||
int v_counter = 0;
|
||||
double v_months = 0;
|
||||
int v_firstyr = 0;
|
||||
double v_monthadj = 0;
|
||||
BigDecimal v_adj = new BigDecimal(0.0);
|
||||
BigDecimal v_Base_Amount = new BigDecimal(0.0);
|
||||
BigDecimal v_Salvage_Amount = new BigDecimal(0.0);
|
||||
double v_Life_Periods = 0;
|
||||
double v_Life_Years = 0;
|
||||
String v_con_type = null;
|
||||
|
||||
StringBuffer sqlB = new StringBuffer ("SELECT A.A_ASSET_COST, A.A_SALVAGE_VALUE, A.A_LIFE_PERIOD, A.A_ASSET_LIFE_YEARS, A.DATEACCT,"
|
||||
+ " D.ASSETSERVICEDATE, C.CONVENTIONTYPE "
|
||||
+ " FROM A_DEPRECIATION_WORKFILE A, A_ASSET_ACCT B,A_ASSET D,A_DEPRECIATION_CONVENTION C "
|
||||
+ " WHERE A.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND B.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A_PERIOD_POSTED+1 >= A_PERIOD_START AND A_PERIOD_POSTED+1 <= A_PERIOD_END "
|
||||
+ " AND A.POSTINGTYPE = '" + p_POSTINGTYPE
|
||||
+ "' AND B.POSTINGTYPE = '" + p_POSTINGTYPE
|
||||
+ "' AND B.A_ASSET_ACCT_ID = " + p_A_ASSET_ACCT_ID
|
||||
+ " AND D.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND B.A_DEPRECIATION_CONV_ID = C.A_DEPRECIATION_CONVENTION_ID");
|
||||
//System.out.println("DB150: "+sqlB.toString());
|
||||
PreparedStatement pstmt = null;
|
||||
pstmt = DB.prepareStatement (sqlB.toString(),null);
|
||||
try {
|
||||
ResultSet rs = pstmt.executeQuery();
|
||||
while (rs.next()){
|
||||
Calendar calendar = new GregorianCalendar();
|
||||
calendar.setTime(rs.getDate("ASSETSERVICEDATE"));
|
||||
int AssetServiceDateYear = calendar.get(Calendar.YEAR);
|
||||
int AssetServiceDateMonth = calendar.get(Calendar.MONTH);
|
||||
calendar.setTime(rs.getDate("DATEACCT"));
|
||||
int DateAcctYear = calendar.get(Calendar.YEAR);
|
||||
|
||||
v_Base_Amount = rs.getBigDecimal("A_ASSET_COST");
|
||||
v_Salvage_Amount = rs.getBigDecimal("A_SALVAGE_VALUE");
|
||||
v_Life_Periods = rs.getDouble("A_LIFE_PERIOD");
|
||||
v_Life_Years = rs.getDouble("A_ASSET_LIFE_YEARS");
|
||||
v_con_type = rs.getString("CONVENTIONTYPE");
|
||||
|
||||
double v_period = DateAcctYear - AssetServiceDateYear;
|
||||
while (v_counter <= v_period){
|
||||
if(v_firstyr == 0){
|
||||
v_DB = (v_Base_Amount.subtract(v_Accum_Dep).subtract(v_Salvage_Amount)).multiply(new BigDecimal(1.5/v_Life_Years));
|
||||
v_months = 12 - AssetServiceDateMonth +1;
|
||||
if (v_con_type.compareTo("HYCON") ==0){
|
||||
v_adj = new BigDecimal(Conventions.HYCON(p_A_ASSET_ID,p_POSTINGTYPE,p_A_ASSET_ACCT_ID,2,AssetServiceDateYear));
|
||||
v_DB =(v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP));
|
||||
v_Accum_Dep = v_Accum_Dep.add(v_DB.multiply(v_adj).multiply(new BigDecimal(v_months)));
|
||||
v_monthadj = 6-v_months;
|
||||
}
|
||||
else if (v_con_type.compareTo("FYCON") ==0){
|
||||
v_adj = new BigDecimal(Conventions.FYCON(p_A_ASSET_ID,p_POSTINGTYPE,p_A_ASSET_ACCT_ID,0,AssetServiceDateYear));
|
||||
v_DB =(v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP));
|
||||
v_Accum_Dep = v_Accum_Dep.add(v_DB.multiply(v_adj).multiply(new BigDecimal(v_months)));
|
||||
v_monthadj = 12-v_months;
|
||||
}
|
||||
else if (v_con_type.compareTo("DYCON") ==0){
|
||||
v_adj = new BigDecimal(Conventions.DYCON(p_A_ASSET_ID,p_POSTINGTYPE,p_A_ASSET_ACCT_ID,2,AssetServiceDateYear));
|
||||
v_Accum_Dep = v_Accum_Dep.add(v_DB.multiply(v_adj));
|
||||
v_DB =(v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP));
|
||||
v_monthadj = 0;
|
||||
}
|
||||
else if (v_con_type.compareTo("MQCON") ==0){
|
||||
v_adj = new BigDecimal(Conventions.MQCON(p_A_ASSET_ID,p_POSTINGTYPE,p_A_ASSET_ACCT_ID,2,AssetServiceDateYear));
|
||||
v_Accum_Dep = v_Accum_Dep.add(v_DB.multiply(v_adj));
|
||||
v_DB =(v_DB.divide(new BigDecimal(v_months),2, BigDecimal.ROUND_HALF_UP));
|
||||
v_monthadj = 0;
|
||||
}
|
||||
else if (v_con_type.compareTo("FMCON") ==0){
|
||||
v_adj = new BigDecimal(Conventions.FMCON(p_A_ASSET_ID,p_POSTINGTYPE,p_A_ASSET_ACCT_ID,2,AssetServiceDateYear));
|
||||
v_DB =(v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP));
|
||||
v_Accum_Dep = v_Accum_Dep.add(v_DB.multiply(new BigDecimal(v_months)));
|
||||
v_monthadj = 0;
|
||||
}
|
||||
else if (v_con_type.compareTo("MMCON") ==0){
|
||||
|
||||
v_Accum_Dep = v_Accum_Dep.add(v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP)).multiply(new BigDecimal(.5)).add(v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP)).multiply(new BigDecimal(v_months-1));
|
||||
v_adj = new BigDecimal(Conventions.MMCON(p_A_ASSET_ID,p_POSTINGTYPE,p_A_ASSET_ACCT_ID,2,AssetServiceDateMonth+1));
|
||||
v_DB =(v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP)).multiply(v_adj);
|
||||
v_monthadj = 0;
|
||||
}
|
||||
v_firstyr = 1;
|
||||
}
|
||||
else{
|
||||
v_DB = (v_Base_Amount.subtract(v_Accum_Dep).subtract(v_Salvage_Amount)).multiply(new BigDecimal(1.5/v_Life_Years));
|
||||
v_Accum_Dep = v_Accum_Dep.add(v_DB);
|
||||
v_DB =(v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP));
|
||||
}
|
||||
v_counter = v_counter+1;
|
||||
}
|
||||
A_Period_Exp = v_DB;
|
||||
|
||||
if (p_SL ==1 ){
|
||||
if (v_Life_Periods-(p_A_CURRENT_PERIOD+v_monthadj)>0 )
|
||||
v_SL = ((v_Base_Amount.subtract(v_Salvage_Amount).subtract(p_Accum_Dep)).divide(new BigDecimal(v_Life_Periods-(p_A_CURRENT_PERIOD+v_monthadj)),2, BigDecimal.ROUND_HALF_UP));
|
||||
|
||||
if (A_Period_Exp.compareTo(v_SL)==-1)
|
||||
A_Period_Exp = v_SL;
|
||||
|
||||
if (v_Base_Amount.subtract(p_Accum_Dep).subtract(A_Period_Exp).compareTo(v_Salvage_Amount)==-1 )
|
||||
A_Period_Exp =v_Base_Amount.subtract(p_Accum_Dep).subtract(v_Salvage_Amount);
|
||||
}
|
||||
|
||||
}
|
||||
//System.out.println("DB150: "+A_Period_Exp);
|
||||
return A_Period_Exp;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("DB150: "+e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
if (pstmt != null)
|
||||
pstmt.close ();
|
||||
}
|
||||
catch (Exception e)
|
||||
{}
|
||||
pstmt = null;
|
||||
}
|
||||
return A_Period_Exp;
|
||||
}
|
||||
|
||||
static public BigDecimal DB200(int p_SL,int p_A_ASSET_ID, double p_A_CURRENT_PERIOD, String p_POSTINGTYPE,
|
||||
int p_A_ASSET_ACCT_ID, BigDecimal p_Accum_Dep)
|
||||
{
|
||||
BigDecimal v_DB = new BigDecimal(0.0);
|
||||
BigDecimal v_Accum_Dep = new BigDecimal(0.0);
|
||||
BigDecimal v_SL = new BigDecimal(0.0);
|
||||
BigDecimal A_Period_Exp = new BigDecimal(0.0);
|
||||
int v_counter = 0;
|
||||
double v_months = 0;
|
||||
int v_firstyr = 0;
|
||||
double v_monthadj = 0;
|
||||
BigDecimal v_adj = new BigDecimal(0.0);
|
||||
BigDecimal v_Base_Amount = new BigDecimal(0.0);
|
||||
BigDecimal v_Salvage_Amount = new BigDecimal(0.0);
|
||||
double v_Life_Periods = 0;
|
||||
double v_Life_Years = 0;
|
||||
String v_con_type = null;
|
||||
|
||||
StringBuffer sqlB = new StringBuffer ("SELECT A.A_ASSET_COST, A.A_SALVAGE_VALUE, A.A_LIFE_PERIOD, A.A_ASSET_LIFE_YEARS, A.DATEACCT,"
|
||||
+ " D.ASSETSERVICEDATE, C.CONVENTIONTYPE "
|
||||
+ " FROM A_DEPRECIATION_WORKFILE A, A_ASSET_ACCT B,A_ASSET D,A_DEPRECIATION_CONVENTION C "
|
||||
+ " WHERE A.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND B.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A_PERIOD_POSTED+1 >= A_PERIOD_START AND A_PERIOD_POSTED+1 <= A_PERIOD_END "
|
||||
+ " AND A.POSTINGTYPE = '" + p_POSTINGTYPE
|
||||
+ "' AND B.POSTINGTYPE = '" + p_POSTINGTYPE
|
||||
+ "' AND B.A_ASSET_ACCT_ID = " + p_A_ASSET_ACCT_ID
|
||||
+ " AND D.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND B.A_DEPRECIATION_CONV_ID = C.A_DEPRECIATION_CONVENTION_ID");
|
||||
//System.out.println("DB200: "+sqlB.toString());
|
||||
PreparedStatement pstmt = null;
|
||||
pstmt = DB.prepareStatement (sqlB.toString(),null);
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
rs = pstmt.executeQuery();
|
||||
while (rs.next()){
|
||||
Calendar calendar = new GregorianCalendar();
|
||||
calendar.setTime(rs.getDate("ASSETSERVICEDATE"));
|
||||
int AssetServiceDateYear = calendar.get(Calendar.YEAR);
|
||||
int AssetServiceDateMonth = calendar.get(Calendar.MONTH);
|
||||
calendar.setTime(rs.getDate("DATEACCT"));
|
||||
int DateAcctYear = calendar.get(Calendar.YEAR);
|
||||
v_counter = 0;
|
||||
v_months = 0;
|
||||
v_firstyr = 0;
|
||||
v_monthadj = 0;
|
||||
v_adj = new BigDecimal(0.0);
|
||||
v_Base_Amount = rs.getBigDecimal("A_ASSET_COST");
|
||||
v_Salvage_Amount = rs.getBigDecimal("A_SALVAGE_VALUE");
|
||||
v_Life_Periods = rs.getDouble("A_LIFE_PERIOD");
|
||||
v_Life_Years = rs.getDouble("A_ASSET_LIFE_YEARS");
|
||||
v_con_type = rs.getString("CONVENTIONTYPE");
|
||||
|
||||
double v_period = DateAcctYear - AssetServiceDateYear;
|
||||
while (v_counter <= v_period){
|
||||
if(v_firstyr == 0){
|
||||
v_DB = (v_Base_Amount.subtract(v_Accum_Dep).subtract(v_Salvage_Amount)).multiply(new BigDecimal(2/v_Life_Years));
|
||||
v_months = 12 - AssetServiceDateMonth +1;
|
||||
if (v_con_type.compareTo("HYCON") ==0){
|
||||
v_adj = new BigDecimal(Conventions.HYCON(p_A_ASSET_ID,p_POSTINGTYPE,p_A_ASSET_ACCT_ID,2,AssetServiceDateYear));
|
||||
v_DB =(v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP));
|
||||
v_Accum_Dep = v_Accum_Dep.add(v_DB.multiply(v_adj).multiply(new BigDecimal(v_months)));
|
||||
v_monthadj = 6-v_months;
|
||||
}
|
||||
else if (v_con_type.compareTo("FYCON") ==0){
|
||||
|
||||
v_adj = new BigDecimal(Conventions.FYCON(p_A_ASSET_ID,p_POSTINGTYPE,p_A_ASSET_ACCT_ID,0,AssetServiceDateYear));
|
||||
v_DB =(v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP));
|
||||
v_Accum_Dep = v_Accum_Dep.add(v_DB.multiply(v_adj).multiply(new BigDecimal(v_months)));
|
||||
v_monthadj = 12-v_months;
|
||||
}
|
||||
else if (v_con_type.compareTo("DYCON") ==0){
|
||||
v_adj = new BigDecimal(Conventions.DYCON(p_A_ASSET_ID,p_POSTINGTYPE,p_A_ASSET_ACCT_ID,2,AssetServiceDateYear));
|
||||
v_Accum_Dep = v_Accum_Dep.add(v_DB.multiply(v_adj));
|
||||
v_DB =(v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP));
|
||||
v_monthadj = 0;
|
||||
}
|
||||
else if (v_con_type.compareTo("MQCON") ==0){
|
||||
v_adj = new BigDecimal(Conventions.MQCON(p_A_ASSET_ID,p_POSTINGTYPE,p_A_ASSET_ACCT_ID,2,AssetServiceDateYear));
|
||||
v_Accum_Dep = v_Accum_Dep.add(v_DB.multiply(v_adj));
|
||||
v_DB =(v_DB.divide(new BigDecimal(v_months),2, BigDecimal.ROUND_HALF_UP));
|
||||
v_monthadj = 0;
|
||||
}
|
||||
else if (v_con_type.compareTo("FMCON") ==0){
|
||||
v_adj = new BigDecimal(Conventions.FMCON(p_A_ASSET_ID,p_POSTINGTYPE,p_A_ASSET_ACCT_ID,2,AssetServiceDateYear));
|
||||
v_DB =(v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP));
|
||||
v_Accum_Dep = v_Accum_Dep.add(v_DB.multiply(new BigDecimal(v_months)));
|
||||
v_monthadj = 0;
|
||||
}
|
||||
else if (v_con_type.compareTo("MMCON") ==0){
|
||||
|
||||
v_Accum_Dep = v_Accum_Dep.add(v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP)).multiply(new BigDecimal(.5)).add(v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP)).multiply(new BigDecimal(v_months-1));
|
||||
v_adj = new BigDecimal(Conventions.MMCON(p_A_ASSET_ID,p_POSTINGTYPE,p_A_ASSET_ACCT_ID,2,AssetServiceDateMonth+1));
|
||||
v_DB = (v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP)).multiply(v_adj);
|
||||
v_monthadj = 0;
|
||||
}
|
||||
v_firstyr = 1;
|
||||
}
|
||||
else{
|
||||
v_DB = (v_Base_Amount.subtract(v_Accum_Dep).subtract(v_Salvage_Amount)).multiply(new BigDecimal(2/v_Life_Years));
|
||||
v_Accum_Dep = v_Accum_Dep.add(v_DB);
|
||||
v_DB =(v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP));
|
||||
}
|
||||
v_counter = v_counter+1;
|
||||
}
|
||||
A_Period_Exp = v_DB;
|
||||
if (p_SL ==1 ){
|
||||
if (v_Life_Periods-(p_A_CURRENT_PERIOD+v_monthadj)>0 )
|
||||
v_SL = ((v_Base_Amount.subtract(v_Salvage_Amount).subtract(p_Accum_Dep)).divide(new BigDecimal(v_Life_Periods-(p_A_CURRENT_PERIOD+v_monthadj)),2, BigDecimal.ROUND_HALF_UP));
|
||||
|
||||
if (A_Period_Exp.compareTo(v_SL)==-1)
|
||||
A_Period_Exp = v_SL;
|
||||
|
||||
if (v_Base_Amount.subtract(p_Accum_Dep).subtract(A_Period_Exp).compareTo(v_Salvage_Amount)==-1 )
|
||||
A_Period_Exp =v_Base_Amount.subtract(p_Accum_Dep).subtract(v_Salvage_Amount);
|
||||
}
|
||||
}
|
||||
//System.out.println("DB200: "+A_Period_Exp);
|
||||
return A_Period_Exp;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("DB200: "+e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
}
|
||||
return A_Period_Exp;
|
||||
}
|
||||
|
||||
static public BigDecimal DBVAR(int p_SL,int p_A_ASSET_ID, double p_A_CURRENT_PERIOD, String p_POSTINGTYPE,
|
||||
int p_A_ASSET_ACCT_ID, BigDecimal p_Accum_Dep)
|
||||
{
|
||||
BigDecimal v_DB = new BigDecimal(0.0);
|
||||
BigDecimal v_Accum_Dep = new BigDecimal(0.0);
|
||||
BigDecimal v_SL = new BigDecimal(0.0);
|
||||
BigDecimal A_Period_Exp = new BigDecimal(0.0);
|
||||
double v_Var = 0.0;
|
||||
int v_counter = 0;
|
||||
double v_months = 0;
|
||||
int v_firstyr = 0;
|
||||
double v_monthadj = 0;
|
||||
BigDecimal v_adj = new BigDecimal(0.0);
|
||||
BigDecimal v_Base_Amount = new BigDecimal(0.0);
|
||||
BigDecimal v_Salvage_Amount = new BigDecimal(0.0);
|
||||
double v_Life_Periods = 0;
|
||||
double v_Life_Years = 0;
|
||||
String v_con_type = null;
|
||||
|
||||
StringBuffer sqlB = new StringBuffer ("SELECT A.A_ASSET_COST, A.A_SALVAGE_VALUE, A.A_LIFE_PERIOD, A.A_ASSET_LIFE_YEARS, A.DATEACCT,"
|
||||
+ " D.ASSETSERVICEDATE, C.CONVENTIONTYPE, A_DEPRECIATION_VARIABLE_PERC "
|
||||
+ " FROM A_DEPRECIATION_WORKFILE A, A_ASSET_ACCT B,A_ASSET D,A_DEPRECIATION_CONVENTION C "
|
||||
+ " WHERE A.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND B.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A_PERIOD_POSTED+1 >= A_PERIOD_START AND A_PERIOD_POSTED+1 <= A_PERIOD_END "
|
||||
+ " AND A.POSTINGTYPE = '" + p_POSTINGTYPE
|
||||
+ "' AND B.POSTINGTYPE = '" + p_POSTINGTYPE
|
||||
+ "' AND B.A_ASSET_ACCT_ID = " + p_A_ASSET_ACCT_ID
|
||||
+ " AND D.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND B.A_DEPRECIATION_CONV_ID = C.A_DEPRECIATION_CONVENTION_ID");
|
||||
//System.out.println("DBVAR: "+sqlB.toString());
|
||||
PreparedStatement pstmt = null;
|
||||
pstmt = DB.prepareStatement (sqlB.toString(),null);
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
rs = pstmt.executeQuery();
|
||||
while (rs.next()){
|
||||
v_counter = 0;
|
||||
v_months = 0;
|
||||
v_firstyr = 0;
|
||||
v_monthadj = 0;
|
||||
v_Var=rs.getDouble("A_DEPRECIATION_VARIABLE_PERC");
|
||||
v_adj = new BigDecimal(0.0);
|
||||
v_Base_Amount = rs.getBigDecimal("A_ASSET_COST");
|
||||
v_Salvage_Amount = rs.getBigDecimal("A_SALVAGE_VALUE");
|
||||
v_Life_Periods = rs.getDouble("A_LIFE_PERIOD");
|
||||
v_Life_Years = rs.getDouble("A_ASSET_LIFE_YEARS");
|
||||
v_con_type = rs.getString("CONVENTIONTYPE");
|
||||
Calendar calendar = new GregorianCalendar();
|
||||
calendar.setTime(rs.getDate("ASSETSERVICEDATE"));
|
||||
int AssetServiceDateYear = calendar.get(Calendar.YEAR);
|
||||
int AssetServiceDateMonth = calendar.get(Calendar.MONTH);
|
||||
calendar.setTime(rs.getDate("DATEACCT"));
|
||||
int DateAcctYear = calendar.get(Calendar.YEAR);
|
||||
|
||||
double v_period = DateAcctYear - AssetServiceDateYear;
|
||||
while (v_counter <= v_period){
|
||||
if(v_firstyr == 0){
|
||||
v_DB = (v_Base_Amount.subtract(v_Accum_Dep).subtract(v_Salvage_Amount)).multiply(new BigDecimal(v_Var/v_Life_Years));
|
||||
v_months = 12 - AssetServiceDateMonth +1;
|
||||
if (v_con_type.compareTo("HYCON") ==0){
|
||||
v_adj = new BigDecimal(Conventions.HYCON(p_A_ASSET_ID,p_POSTINGTYPE,p_A_ASSET_ACCT_ID,2,AssetServiceDateYear));
|
||||
v_DB =(v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP));
|
||||
v_Accum_Dep = v_Accum_Dep.add(v_DB.multiply(v_adj).multiply(new BigDecimal(v_months)));
|
||||
v_monthadj = 6-v_months;
|
||||
}
|
||||
else if (v_con_type.compareTo("FYCON") ==0){
|
||||
v_adj = new BigDecimal(Conventions.FYCON(p_A_ASSET_ID,p_POSTINGTYPE,p_A_ASSET_ACCT_ID,0,AssetServiceDateYear));
|
||||
v_DB =(v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP));
|
||||
v_Accum_Dep = v_Accum_Dep.add(v_DB.multiply(v_adj).multiply(new BigDecimal(v_months)));
|
||||
v_monthadj = 12-v_months;
|
||||
}
|
||||
else if (v_con_type.compareTo("DYCON") ==0){
|
||||
v_adj = new BigDecimal(Conventions.DYCON(p_A_ASSET_ID,p_POSTINGTYPE,p_A_ASSET_ACCT_ID,2,AssetServiceDateYear));
|
||||
v_Accum_Dep = v_Accum_Dep.add(v_DB.multiply(v_adj));
|
||||
v_DB =(v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP));
|
||||
v_monthadj = 0;
|
||||
}
|
||||
else if (v_con_type.compareTo("MQCON") ==0){
|
||||
v_adj = new BigDecimal(Conventions.MQCON(p_A_ASSET_ID,p_POSTINGTYPE,p_A_ASSET_ACCT_ID,2,AssetServiceDateYear));
|
||||
v_Accum_Dep = v_Accum_Dep.add(v_DB.multiply(v_adj));
|
||||
v_DB =(v_DB.divide(new BigDecimal(v_months),2, BigDecimal.ROUND_HALF_UP));
|
||||
v_monthadj = 0;
|
||||
}
|
||||
else if (v_con_type.compareTo("FMCON") ==0){
|
||||
v_adj = new BigDecimal(Conventions.FMCON(p_A_ASSET_ID,p_POSTINGTYPE,p_A_ASSET_ACCT_ID,2,AssetServiceDateYear));
|
||||
v_DB =(v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP));
|
||||
v_Accum_Dep = v_Accum_Dep.add(v_DB.multiply(new BigDecimal(v_months)));
|
||||
v_monthadj = 0;
|
||||
}
|
||||
else if (v_con_type.compareTo("MMCON") ==0){
|
||||
|
||||
v_Accum_Dep = v_Accum_Dep.add(v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP)).multiply(new BigDecimal(.5)).add(v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP)).multiply(new BigDecimal(v_months-1));
|
||||
v_adj = new BigDecimal(Conventions.MMCON(p_A_ASSET_ID,p_POSTINGTYPE,p_A_ASSET_ACCT_ID,2,AssetServiceDateMonth+1));
|
||||
v_DB = (v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP).multiply(v_adj));
|
||||
v_monthadj = 0;
|
||||
}
|
||||
v_firstyr = 1;
|
||||
}
|
||||
else{
|
||||
v_DB = (v_Base_Amount.subtract(v_Accum_Dep).subtract(v_Salvage_Amount)).multiply(new BigDecimal(v_Var/v_Life_Years));
|
||||
v_Accum_Dep = v_Accum_Dep.add(v_DB);
|
||||
v_DB =(v_DB.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP));
|
||||
}
|
||||
v_counter = v_counter+1;
|
||||
}
|
||||
A_Period_Exp = v_DB;
|
||||
if (p_SL ==1 ){
|
||||
if (v_Life_Periods-(p_A_CURRENT_PERIOD+v_monthadj)>0 )
|
||||
v_SL = ((v_Base_Amount.subtract(v_Salvage_Amount).subtract(p_Accum_Dep)).divide(new BigDecimal(v_Life_Periods-(p_A_CURRENT_PERIOD+v_monthadj)),2, BigDecimal.ROUND_HALF_UP));
|
||||
|
||||
if (A_Period_Exp.compareTo(v_SL)==-1)
|
||||
A_Period_Exp = v_SL;
|
||||
|
||||
if (v_Base_Amount.subtract(p_Accum_Dep).subtract(A_Period_Exp).compareTo(v_Salvage_Amount)==-1 )
|
||||
A_Period_Exp =v_Base_Amount.subtract(p_Accum_Dep).subtract(v_Salvage_Amount);
|
||||
}
|
||||
}
|
||||
//System.out.println("DBVAR: "+A_Period_Exp);
|
||||
return A_Period_Exp;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("DBVAR: "+e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
}
|
||||
return A_Period_Exp;
|
||||
}
|
||||
|
||||
static public BigDecimal MAN(int p_SL,int p_A_ASSET_ID, double p_A_CURRENT_PERIOD, String p_POSTINGTYPE,
|
||||
int p_A_ASSET_ACCT_ID, BigDecimal p_Accum_Dep)
|
||||
{
|
||||
int v_Dep_Mon = 0;
|
||||
BigDecimal v_Dep_Sprd = new BigDecimal(0.0);
|
||||
BigDecimal A_Period_Exp = new BigDecimal(0.0);
|
||||
|
||||
StringBuffer sqlB = new StringBuffer ("SELECT B.A_ASSET_COST, B.A_SALVAGE_VALUE, B.A_LIFE_PERIOD, "
|
||||
+ " A_ASSET_LIFE_YEARS, A_ASSET_LIFE_CURRENT_YEAR,A_ACCUMULATED_DEPR, A_DEPRECIATION_MANUAL_AMOUNT, "
|
||||
+ " A_ASSET_SPREAD_ID, A_DEPRECIATION_MANUAL_PERIOD, A.AD_Client_ID "
|
||||
+ " FROM A_DEPRECIATION_WORKFILE B, A_ASSET_ACCT A "
|
||||
+ " WHERE B.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND B.POSTINGTYPE = '"+p_POSTINGTYPE
|
||||
+ "' AND A.POSTINGTYPE = '"+p_POSTINGTYPE
|
||||
+ "' AND A.A_ASSET_ACCT_ID = " + p_A_ASSET_ACCT_ID);
|
||||
//System.out.println("MAN: "+sqlB.toString());
|
||||
PreparedStatement pstmt = null;
|
||||
pstmt = DB.prepareStatement (sqlB.toString(),null);
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
rs = pstmt.executeQuery();
|
||||
while (rs.next()){
|
||||
if (rs.getString("A_DEPRECIATION_MANUAL_PERIOD").compareTo("PR")==0)
|
||||
A_Period_Exp = rs.getBigDecimal("A_DEPRECIATION_MANUAL_AMOUNT");
|
||||
else if (rs.getString("A_DEPRECIATION_MANUAL_PERIOD").compareTo("YR")==0){
|
||||
if (p_A_CURRENT_PERIOD == -1){
|
||||
//System.out.println("MAN YR - A_CURRENT_PERIOD = -1 ");
|
||||
StringBuffer sql3 = new StringBuffer("SELECT PeriodNo"
|
||||
+ " FROM C_Period WHERE C_Period_ID = 183 "
|
||||
+ " AND AD_Client_ID = ? ");
|
||||
v_Dep_Mon = DB.getSQLValue(null, sql3.toString(), rs.getInt("AD_Client_ID"));
|
||||
}
|
||||
else{
|
||||
//System.out.println("MAN YR - A_CURRENT_PERIOD = " + p_A_CURRENT_PERIOD);
|
||||
v_Dep_Mon = (int)p_A_CURRENT_PERIOD - (int)(Math.ceil((double)p_A_CURRENT_PERIOD/12)*12-12) ;
|
||||
}
|
||||
//System.out.println("MAN v_Dep_Mon: "+v_Dep_Mon);
|
||||
if (v_Dep_Mon==1){
|
||||
StringBuffer sql3 = new StringBuffer("SELECT A_Period_1"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("A_ASSET_SPREAD_ID"));
|
||||
//System.out.println("MAN YR - SpreadAmnt = " + sql3.toString());
|
||||
}
|
||||
else if (v_Dep_Mon==2){
|
||||
StringBuffer sql3 = new StringBuffer("SELECT A_Period_2"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("A_ASSET_SPREAD_ID"));
|
||||
//System.out.println("MAN YR - SpreadAmnt = " + sql3.toString());
|
||||
}
|
||||
else if (v_Dep_Mon==3){
|
||||
StringBuffer sql3 = new StringBuffer("SELECT A_Period_3"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("A_ASSET_SPREAD_ID"));
|
||||
//System.out.println("MAN YR - SpreadAmnt = " + sql3.toString());
|
||||
}
|
||||
else if (v_Dep_Mon==4){
|
||||
StringBuffer sql3 = new StringBuffer("SELECT A_Period_4"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("A_ASSET_SPREAD_ID"));
|
||||
//System.out.println("MAN YR - SpreadAmnt = " + sql3.toString());
|
||||
}
|
||||
else if (v_Dep_Mon==5){
|
||||
StringBuffer sql3 = new StringBuffer("SELECT A_Period_5"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("A_ASSET_SPREAD_ID"));
|
||||
//System.out.println("MAN YR - SpreadAmnt = " + sql3.toString());
|
||||
}
|
||||
else if (v_Dep_Mon==6){
|
||||
StringBuffer sql3 = new StringBuffer("SELECT A_Period_6"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("A_ASSET_SPREAD_ID"));
|
||||
//System.out.println("MAN YR - SpreadAmnt = " + sql3.toString());
|
||||
}
|
||||
else if (v_Dep_Mon==7){
|
||||
StringBuffer sql3 = new StringBuffer("SELECT A_Period_7"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("A_ASSET_SPREAD_ID"));
|
||||
//System.out.println("MAN YR - SpreadAmnt = " + sql3.toString());
|
||||
}
|
||||
else if (v_Dep_Mon==8){
|
||||
StringBuffer sql3 = new StringBuffer("SELECT A_Period_8"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("A_ASSET_SPREAD_ID"));
|
||||
//System.out.println("MAN YR - SpreadAmnt = " + sql3.toString());
|
||||
}
|
||||
else if (v_Dep_Mon==9){
|
||||
StringBuffer sql3 = new StringBuffer("SELECT A_Period_9"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("A_ASSET_SPREAD_ID"));
|
||||
//System.out.println("MAN YR - SpreadAmnt = " + sql3.toString());
|
||||
}
|
||||
else if (v_Dep_Mon==10){
|
||||
StringBuffer sql3 = new StringBuffer("SELECT A_Period_10"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("A_ASSET_SPREAD_ID"));
|
||||
//System.out.println("MAN YR - SpreadAmnt = " + sql3.toString());
|
||||
}
|
||||
else if (v_Dep_Mon==11)
|
||||
{
|
||||
StringBuffer sql3 = new StringBuffer("SELECT A_Period_11"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("A_ASSET_SPREAD_ID"));
|
||||
//System.out.println("MAN YR - SpreadAmnt = " + sql3.toString());
|
||||
}
|
||||
else if (v_Dep_Mon==12){
|
||||
StringBuffer sql3 = new StringBuffer("SELECT A_Period_12"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("A_ASSET_SPREAD_ID"));
|
||||
//System.out.println("MAN YR - SpreadAmnt = " + sql3.toString());
|
||||
}
|
||||
else if (v_Dep_Mon==13){
|
||||
StringBuffer sql3 = new StringBuffer("SELECT A_Period_13"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("A_ASSET_SPREAD_ID"));
|
||||
//System.out.println("MAN YR - SpreadAmnt = " + sql3.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
StringBuffer sql3 = new StringBuffer("SELECT A_Period_14"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("A_ASSET_SPREAD_ID"));
|
||||
//System.out.println("MAN YR - SpreadAmnt = " + sql3.toString());
|
||||
}
|
||||
//System.out.println("MAN v_Dep_Sprd: "+v_Dep_Sprd);
|
||||
A_Period_Exp = rs.getBigDecimal("A_DEPRECIATION_MANUAL_AMOUNT").multiply(v_Dep_Sprd);
|
||||
}
|
||||
|
||||
}
|
||||
//System.out.println("MAN: "+A_Period_Exp);
|
||||
return A_Period_Exp;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("MAN: "+e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
}
|
||||
return A_Period_Exp;
|
||||
}
|
||||
static public BigDecimal SL(int p_SL,int p_A_ASSET_ID, double p_A_CURRENT_PERIOD, String p_POSTINGTYPE,
|
||||
int p_A_ASSET_ACCT_ID, BigDecimal p_Accum_Dep)
|
||||
{
|
||||
BigDecimal A_Period_Exp = new BigDecimal(0.0);
|
||||
StringBuffer sqlB = new StringBuffer ("SELECT A_DEPRECIATION_WORKFILE.A_ASSET_COST, "
|
||||
+ " A_DEPRECIATION_WORKFILE.A_SALVAGE_VALUE, A_DEPRECIATION_WORKFILE.A_LIFE_PERIOD"
|
||||
+ " FROM A_DEPRECIATION_WORKFILE, A_ASSET_ACCT"
|
||||
+ " WHERE A_DEPRECIATION_WORKFILE.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A_ASSET_ACCT.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A_DEPRECIATION_WORKFILE.POSTINGTYPE = '"+p_POSTINGTYPE
|
||||
+ "' AND A_ASSET_ACCT.POSTINGTYPE = '"+p_POSTINGTYPE
|
||||
+ "' AND A_ASSET_ACCT.A_ASSET_ACCT_ID = " + p_A_ASSET_ACCT_ID);
|
||||
|
||||
//System.out.println("SL: "+sqlB.toString());
|
||||
PreparedStatement pstmt = null;
|
||||
pstmt = DB.prepareStatement (sqlB.toString(),null);
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
rs = pstmt.executeQuery();
|
||||
while (rs.next()){
|
||||
A_Period_Exp = ((rs.getBigDecimal("A_ASSET_COST").subtract(rs.getBigDecimal("A_SALVAGE_VALUE"))).divide( rs.getBigDecimal("A_LIFE_PERIOD"),2, BigDecimal.ROUND_HALF_UP));
|
||||
}
|
||||
return A_Period_Exp;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("SL: "+e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
}
|
||||
return A_Period_Exp;
|
||||
}
|
||||
|
||||
static public BigDecimal UOP(int p_SL,int p_A_ASSET_ID, int p_A_CURRENT_PERIOD, String p_POSTINGTYPE,
|
||||
int p_A_ASSET_ACCT_ID, BigDecimal p_Accum_Dep)
|
||||
{
|
||||
BigDecimal A_Period_Exp = new BigDecimal(0.0);
|
||||
StringBuffer sqlB = new StringBuffer ("SELECT A_DEPRECIATION_WORKFILE.A_ASSET_COST, "
|
||||
+ " A_DEPRECIATION_WORKFILE.A_SALVAGE_VALUE, A_DEPRECIATION_WORKFILE.A_LIFE_PERIOD"
|
||||
+ " A_ASSET.LIFEUSEUNITS, A_ASSET.USEUNITS, A_DEPRECIATION_WORKFILE.A_ACCUMULATED_DEPR"
|
||||
+ " FROM A_DEPRECIATION_WORKFILE, A_ASSET_ACCT"
|
||||
+ " WHERE A_DEPRECIATION_WORKFILE.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A_ASSET_ACCT.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A_DEPRECIATION_WORKFILE.POSTINGTYPE = '"+p_POSTINGTYPE
|
||||
+ "' AND A_ASSET_ACCT.POSTINGTYPE = '"+p_POSTINGTYPE
|
||||
+ "' AND A_ASSET_ACCT.A_ASSET_ACCT_ID = " + p_A_ASSET_ACCT_ID);
|
||||
//System.out.println("UOP: "+sqlB.toString());
|
||||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
pstmt = DB.prepareStatement (sqlB.toString(),null);
|
||||
try {
|
||||
rs = pstmt.executeQuery();
|
||||
while (rs.next()){
|
||||
A_Period_Exp = (rs.getBigDecimal("A_ASSET_COST").subtract(rs.getBigDecimal("A_SALVAGE_VALUE"))
|
||||
.multiply(new BigDecimal(rs.getDouble("USEUNITS")/rs.getDouble("LIFEUSEUNITS")))
|
||||
.subtract(rs.getBigDecimal("A_ACCUMULATED_DEPR")));
|
||||
}
|
||||
//System.out.println("UOP: "+A_Period_Exp);
|
||||
return A_Period_Exp;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("UOP: "+e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
}
|
||||
return A_Period_Exp;
|
||||
}
|
||||
static public BigDecimal SYD(int p_SL,int p_A_ASSET_ID, double p_A_CURRENT_PERIOD, String p_POSTINGTYPE, int p_A_ASSET_ACCT_ID, BigDecimal p_Accum_Dep)
|
||||
{
|
||||
BigDecimal A_Period_Exp = new BigDecimal(0.0);
|
||||
StringBuffer sqlB = new StringBuffer ("SELECT A_DEPRECIATION_WORKFILE.A_ASSET_COST, "
|
||||
+ " A_DEPRECIATION_WORKFILE.A_SALVAGE_VALUE, A_DEPRECIATION_WORKFILE.A_LIFE_PERIOD, "
|
||||
+ " A_DEPRECIATION_WORKFILE.A_ASSET_LIFE_CURRENT_YEAR, A_DEPRECIATION_WORKFILE.A_ASSET_LIFE_YEARS, "
|
||||
+ " A_ASSET.ASSETSERVICEDATE, A_DEPRECIATION_BUILD.DATEACCT"
|
||||
+ " FROM A_DEPRECIATION_WORKFILE, A_ASSET_ACCT, A_ASSET, A_DEPRECIATION_BUILD"
|
||||
+ " WHERE A_DEPRECIATION_WORKFILE.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A_ASSET_ACCT.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A_ASSET.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A_PERIOD_POSTED+1 >= A_PERIOD_START AND A_PERIOD_POSTED+1 <= A_PERIOD_END "
|
||||
+ " AND A_DEPRECIATION_WORKFILE.POSTINGTYPE = '"+p_POSTINGTYPE
|
||||
+ "' AND A_ASSET_ACCT.POSTINGTYPE = '"+p_POSTINGTYPE
|
||||
+ "' AND A_ASSET_ACCT.A_ASSET_ACCT_ID = " + p_A_ASSET_ACCT_ID);
|
||||
|
||||
//System.out.println("SYD: "+sqlB.toString());
|
||||
PreparedStatement pstmt = null;
|
||||
pstmt = DB.prepareStatement (sqlB.toString(),null);
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
rs = pstmt.executeQuery();
|
||||
while (rs.next()){
|
||||
int v_life_current_year = (int)(p_A_CURRENT_PERIOD/(12))+1;
|
||||
|
||||
|
||||
A_Period_Exp = ((rs.getBigDecimal("A_ASSET_COST").subtract(rs.getBigDecimal("A_SALVAGE_VALUE")))
|
||||
.multiply(new BigDecimal(2*(rs.getInt("A_ASSET_LIFE_YEARS")-v_life_current_year+1)))
|
||||
.divide(new BigDecimal(rs.getInt("A_ASSET_LIFE_YEARS")*(rs.getInt("A_ASSET_LIFE_YEARS")+1)),2, BigDecimal.ROUND_HALF_UP));
|
||||
A_Period_Exp = A_Period_Exp.divide(new BigDecimal(12.0),2, BigDecimal.ROUND_HALF_UP);
|
||||
|
||||
}
|
||||
//System.out.println("SYD: "+A_Period_Exp);
|
||||
return A_Period_Exp;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("SYD: "+e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
}
|
||||
return A_Period_Exp;
|
||||
}
|
||||
|
||||
static public BigDecimal TAB(int p_SL,int p_A_ASSET_ID, double p_A_CURRENT_PERIOD, String p_POSTINGTYPE,
|
||||
int p_A_ASSET_ACCT_ID, BigDecimal p_Accum_Dep)
|
||||
{
|
||||
BigDecimal A_Period_Exp = new BigDecimal(0.0);
|
||||
BigDecimal v_Dep_Rate = new BigDecimal(0.0);
|
||||
BigDecimal v_Dep_Sprd = new BigDecimal(0.0);
|
||||
int v_Dep_Mon = 0;
|
||||
int v_Dep_Per = 0;
|
||||
StringBuffer sqlB = new StringBuffer ("SELECT A.A_ASSET_COST, A.A_SALVAGE_VALUE, A.A_LIFE_PERIOD,"
|
||||
+ " B.A_DEPRECIATION_TABLE_HEADER_ID, A.AD_Client_ID, C.A_TERM, C.A_Depreciation_Table_Code "
|
||||
+ " FROM A_DEPRECIATION_WORKFILE A, A_ASSET_ACCT B, A_Depreciation_Table_Header C"
|
||||
+ " WHERE A.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND B.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A.POSTINGTYPE = '"+p_POSTINGTYPE
|
||||
+ "' AND B.POSTINGTYPE = '"+p_POSTINGTYPE
|
||||
+ "' AND B.A_ASSET_ACCT_ID = " + p_A_ASSET_ACCT_ID
|
||||
+ "' AND C.A_DEPRECIATION_TABLE_HEADER_ID = A_DEPRECIATION_TABLE_HEADER_ID");
|
||||
|
||||
//System.out.println("TAB: "+sqlB.toString());
|
||||
PreparedStatement pstmt = null;
|
||||
pstmt = DB.prepareStatement (sqlB.toString(),null);
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
rs = pstmt.executeQuery();
|
||||
while (rs.next()){
|
||||
|
||||
|
||||
if (rs.getString("A_TERM").compareTo("PR")==0){
|
||||
StringBuffer sql3 = new StringBuffer("SELECT A_Depreciation_Rate"
|
||||
+ " FROM A_Depreciation_Table_Detail WHERE A_DEPRECIATION_TABLE_CODE = " + rs.getString("A_Depreciation_Table_Code")
|
||||
+ " AND A_Period = ? ");
|
||||
v_Dep_Rate = DB.getSQLValueBD(null, sql3.toString(), (int)p_A_CURRENT_PERIOD);
|
||||
A_Period_Exp = (rs.getBigDecimal("A_ASSET_COST").subtract(rs.getBigDecimal("A_SALVAGE_VALUE")).multiply(v_Dep_Rate));
|
||||
}
|
||||
else if (rs.getString("A_TERM").compareTo("YR")==0){
|
||||
StringBuffer sql3 = new StringBuffer("SELECT A_Depreciation_Rate"
|
||||
+ " FROM A_Depreciation_Table_Detail WHERE A_DEPRECIATION_TABLE_CODE = " + rs.getString("A_Depreciation_Table_Code")
|
||||
+ " AND A_Period = ? ");
|
||||
v_Dep_Rate = DB.getSQLValueBD(null, sql3.toString(), (int)(Math.ceil((double)p_A_CURRENT_PERIOD+1)/12));
|
||||
|
||||
sql3 = new StringBuffer("SELECT C_Period_ID"
|
||||
+ " FROM A_Depreciation_Build ");
|
||||
v_Dep_Per = DB.getSQLValue(null, sql3.toString());
|
||||
|
||||
if (p_A_CURRENT_PERIOD == -1){
|
||||
sql3 = new StringBuffer("SELECT PeriodNo"
|
||||
+ " FROM C_Period WHERE C_Period_ID = " + v_Dep_Per
|
||||
+ " AND AD_Client_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("AD_Client_ID"));
|
||||
}
|
||||
else
|
||||
|
||||
v_Dep_Mon = (int)p_A_CURRENT_PERIOD - (int)(Math.ceil((double)p_A_CURRENT_PERIOD)/12*12-12) ;
|
||||
|
||||
if (v_Dep_Mon==1){
|
||||
sql3 = new StringBuffer("SELECT A_Period_1"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = " + rs.getString("A_Depreciation_Table_Code")
|
||||
+ " AND AD_Client_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("AD_Client_ID"));
|
||||
}
|
||||
else if (v_Dep_Mon==2){
|
||||
sql3 = new StringBuffer("SELECT A_Period_2"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = " + rs.getString("A_Depreciation_Table_Code")
|
||||
+ " AND AD_Client_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("AD_Client_ID"));
|
||||
}
|
||||
else if (v_Dep_Mon==3){
|
||||
sql3 = new StringBuffer("SELECT A_Period_3"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = " + rs.getString("A_Depreciation_Table_Code")
|
||||
+ " AND AD_Client_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("AD_Client_ID"));
|
||||
}
|
||||
else if (v_Dep_Mon==4){
|
||||
sql3 = new StringBuffer("SELECT A_Period_4"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = " + rs.getString("A_Depreciation_Table_Code")
|
||||
+ " AND AD_Client_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("AD_Client_ID"));
|
||||
}
|
||||
else if (v_Dep_Mon==5){
|
||||
sql3 = new StringBuffer("SELECT A_Period_5"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = " + rs.getString("A_Depreciation_Table_Code")
|
||||
+ " AND AD_Client_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("AD_Client_ID"));
|
||||
}
|
||||
else if (v_Dep_Mon==6){
|
||||
sql3 = new StringBuffer("SELECT A_Period_6"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = " + rs.getString("A_Depreciation_Table_Code")
|
||||
+ " AND AD_Client_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("AD_Client_ID"));
|
||||
}
|
||||
else if (v_Dep_Mon==7){
|
||||
sql3 = new StringBuffer("SELECT A_Period_7"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = " + rs.getString("A_Depreciation_Table_Code")
|
||||
+ " AND AD_Client_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("AD_Client_ID"));
|
||||
}
|
||||
else if (v_Dep_Mon==8){
|
||||
sql3 = new StringBuffer("SELECT A_Period_8"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = " + rs.getString("A_Depreciation_Table_Code")
|
||||
+ " AND AD_Client_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("AD_Client_ID"));
|
||||
}
|
||||
else if (v_Dep_Mon==9){
|
||||
sql3 = new StringBuffer("SELECT A_Period_9"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = " + rs.getString("A_Depreciation_Table_Code")
|
||||
+ " AND AD_Client_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("AD_Client_ID"));
|
||||
}
|
||||
else if (v_Dep_Mon==10){
|
||||
sql3 = new StringBuffer("SELECT A_Period_10"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = " + rs.getString("A_Depreciation_Table_Code")
|
||||
+ " AND AD_Client_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("AD_Client_ID"));
|
||||
}
|
||||
else if (v_Dep_Mon==11){
|
||||
sql3 = new StringBuffer("SELECT A_Period_11"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = " + rs.getString("A_Depreciation_Table_Code")
|
||||
+ " AND AD_Client_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("AD_Client_ID"));
|
||||
}
|
||||
else if (v_Dep_Mon==12){
|
||||
sql3 = new StringBuffer("SELECT A_Period_12"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = " + rs.getString("A_Depreciation_Table_Code")
|
||||
+ " AND AD_Client_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("AD_Client_ID"));
|
||||
}
|
||||
else if (v_Dep_Mon==13){
|
||||
sql3 = new StringBuffer("SELECT A_Period_13"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = " + rs.getString("A_Depreciation_Table_Code")
|
||||
+ " AND AD_Client_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("AD_Client_ID"));
|
||||
}
|
||||
else{
|
||||
sql3 = new StringBuffer("SELECT A_Period_14"
|
||||
+ " FROM A_Asset_Spread WHERE A_Asset_Spread_ID = " + rs.getString("A_Depreciation_Table_Code")
|
||||
+ " AND AD_Client_ID = ? ");
|
||||
v_Dep_Sprd = DB.getSQLValueBD(null, sql3.toString(), rs.getInt("AD_Client_ID"));
|
||||
}
|
||||
|
||||
A_Period_Exp = (rs.getBigDecimal("A_ASSET_COST").subtract(rs.getBigDecimal("A_SALVAGE_VALUE")).multiply(v_Dep_Rate).multiply(v_Dep_Sprd));
|
||||
}
|
||||
|
||||
}
|
||||
//System.out.println("TAB: "+A_Period_Exp);
|
||||
return A_Period_Exp;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("TAB: "+e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
|
||||
}
|
||||
return A_Period_Exp;
|
||||
}
|
||||
|
||||
}// Depreciation
|
|
@ -1,149 +0,0 @@
|
|||
/******************************************************************************
|
||||
* The contents of this file are subject to the Compiere License Version 1.1
|
||||
* ("License"); You may not use this file except in compliance with the License
|
||||
* You may obtain a copy of the License at http://www.compiere.org/license.html
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is Compiere ERP & CRM Business Solution
|
||||
* The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
|
||||
*
|
||||
* Copyright (C) 2005 Robert Klein. robeklein@hotmail.com
|
||||
* _____________________________________________
|
||||
*****************************************************************************/
|
||||
package org.compiere.FA;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
|
||||
import org.compiere.util.DB;
|
||||
/**
|
||||
* Fixed Asset Depreciation
|
||||
*
|
||||
* @author Rob Klein
|
||||
* @version $Id: Conventions.java,v 1.0 $
|
||||
*
|
||||
*/
|
||||
public class DepreciationAdj {
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
static public BigDecimal Dep_Adj(String Type, int p_A_ASSET_ID, BigDecimal p_A_ASSET_ADJUSTMENT, double p_A_PERIODNO,
|
||||
String p_POSTINGTYPE,int p_A_ASSET_ACCT_ID)
|
||||
{
|
||||
BigDecimal A_Dep_Adj = new BigDecimal(0.0);
|
||||
if(Type.compareTo("MDI")==0){
|
||||
A_Dep_Adj = MDI( p_A_ASSET_ID, p_A_ASSET_ADJUSTMENT, p_A_PERIODNO,
|
||||
p_POSTINGTYPE, p_A_ASSET_ACCT_ID);
|
||||
//System.out.println("MDI Main: "+A_Dep_Adj);
|
||||
return A_Dep_Adj;
|
||||
}
|
||||
else if(Type.compareTo("LDI")==0){
|
||||
A_Dep_Adj = LDI( p_A_ASSET_ID, p_A_ASSET_ADJUSTMENT, p_A_PERIODNO,
|
||||
p_POSTINGTYPE, p_A_ASSET_ACCT_ID);
|
||||
//System.out.println("LDI Main: "+A_Dep_Adj);
|
||||
return A_Dep_Adj;
|
||||
}
|
||||
else if(Type.compareTo("YDI")==0){
|
||||
A_Dep_Adj = YDI( p_A_ASSET_ID, p_A_ASSET_ADJUSTMENT, p_A_PERIODNO,
|
||||
p_POSTINGTYPE, p_A_ASSET_ACCT_ID);
|
||||
//System.out.println("YDI Main: "+A_Dep_Adj);
|
||||
return A_Dep_Adj;
|
||||
}
|
||||
else
|
||||
return new BigDecimal(0.0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
static public BigDecimal LDI( int p_A_ASSET_ID, BigDecimal p_A_ASSET_ADJUSTMENT, double p_A_PERIODNO,
|
||||
String p_POSTINGTYPE,int p_A_ASSET_ACCT_ID)
|
||||
{
|
||||
|
||||
BigDecimal A_Dep_Adj = new BigDecimal(0.0);
|
||||
|
||||
StringBuffer sqlB = new StringBuffer ("SELECT A_DEPRECIATION_WORKFILE.A_LIFE_PERIOD, A_DEPRECIATION_WORKFILE.A_PERIOD_POSTED"
|
||||
+ " FROM A_DEPRECIATION_WORKFILE"
|
||||
+ " WHERE A_DEPRECIATION_WORKFILE.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A_DEPRECIATION_WORKFILE.POSTINGTYPE = '" + p_POSTINGTYPE +"'");
|
||||
|
||||
//System.out.println("LDI: "+sqlB.toString());
|
||||
PreparedStatement pstmt = null;
|
||||
pstmt = DB.prepareStatement (sqlB.toString(),null);
|
||||
try {
|
||||
ResultSet rs = pstmt.executeQuery();
|
||||
while (rs.next()){
|
||||
A_Dep_Adj = p_A_ASSET_ADJUSTMENT.divide(new BigDecimal(rs.getDouble("A_LIFE_PERIOD")-rs.getDouble("A_PERIOD_POSTED")+1),2, BigDecimal.ROUND_HALF_UP);
|
||||
|
||||
}
|
||||
//System.out.println("LDI: "+A_Period_Exp);
|
||||
return A_Dep_Adj;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("LDI: "+e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
if (pstmt != null)
|
||||
pstmt.close ();
|
||||
}
|
||||
catch (Exception e)
|
||||
{}
|
||||
pstmt = null;
|
||||
}
|
||||
return A_Dep_Adj;
|
||||
}
|
||||
|
||||
static public BigDecimal MDI( int p_A_ASSET_ID, BigDecimal p_A_ASSET_ADJUSTMENT, double p_A_PERIODNO,
|
||||
String p_POSTINGTYPE,int p_A_ASSET_ACCT_ID)
|
||||
{
|
||||
return p_A_ASSET_ADJUSTMENT;
|
||||
}
|
||||
|
||||
static public BigDecimal YDI( int p_A_ASSET_ID, BigDecimal p_A_ASSET_ADJUSTMENT, double p_A_PERIODNO,
|
||||
String p_POSTINGTYPE,int p_A_ASSET_ACCT_ID)
|
||||
{
|
||||
|
||||
BigDecimal A_Dep_Adj = new BigDecimal(0.0);
|
||||
|
||||
StringBuffer sqlB = new StringBuffer ("SELECT A_DEPRECIATION_WORKFILE.A_LIFE_PERIOD, A_DEPRECIATION_WORKFILE.A_PERIOD_POSTED"
|
||||
+ " FROM A_DEPRECIATION_WORKFILE"
|
||||
+ " WHERE A_DEPRECIATION_WORKFILE.A_ASSET_ID = " + p_A_ASSET_ID
|
||||
+ " AND A_DEPRECIATION_WORKFILE.POSTINGTYPE = '" + p_POSTINGTYPE +"'");
|
||||
|
||||
//System.out.println("DB150: "+sqlB.toString());
|
||||
PreparedStatement pstmt = null;
|
||||
pstmt = DB.prepareStatement (sqlB.toString(),null);
|
||||
try {
|
||||
ResultSet rs = pstmt.executeQuery();
|
||||
while (rs.next()){
|
||||
A_Dep_Adj = p_A_ASSET_ADJUSTMENT.divide(new BigDecimal(12-p_A_PERIODNO),2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
//System.out.println("LDI: "+A_Period_Exp);
|
||||
return A_Dep_Adj;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("LDI: "+e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
if (pstmt != null)
|
||||
pstmt.close ();
|
||||
}
|
||||
catch (Exception e)
|
||||
{}
|
||||
pstmt = null;
|
||||
}
|
||||
return A_Dep_Adj;
|
||||
}
|
||||
|
||||
}// Depreciation
|
|
@ -1,12 +0,0 @@
|
|||
package org.compiere.FA;
|
||||
|
||||
/**
|
||||
* Column name constant for fixed asset customization to core tables.
|
||||
* @author Low Heng Sin
|
||||
*
|
||||
*/
|
||||
public interface I_CustomColumn {
|
||||
|
||||
public final static String A_Asset_Group_ID = "A_Asset_Group_ID";
|
||||
public final static String A_Processed = "A_Processed";
|
||||
}
|
|
@ -1,485 +0,0 @@
|
|||
/******************************************************************************
|
||||
* The contents of this file are subject to the Compiere License Version 1.1
|
||||
* ("License"); You may not use this file except in compliance with the License
|
||||
* You may obtain a copy of the License at http://www.compiere.org/license.html
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is Compiere ERP & CRM Business Solution
|
||||
* The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
|
||||
*
|
||||
* Copyright (C) 2005 Robert KLEIN. robeklein@gmail.com *
|
||||
* Contributor(s): ______________________________________.
|
||||
*****************************************************************************/
|
||||
package org.compiere.FA;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
import org.compiere.process.ProcessInfoParameter;
|
||||
import org.compiere.process.SvrProcess;
|
||||
import org.compiere.util.DB;
|
||||
|
||||
/**
|
||||
* Import Assets
|
||||
*
|
||||
* @author Rob Klein
|
||||
* @version $Id: ImportAsset.java,v 1.0 $
|
||||
*/
|
||||
public class ImportAsset extends SvrProcess
|
||||
{
|
||||
/**
|
||||
* Import Asset
|
||||
*/
|
||||
public ImportAsset()
|
||||
{
|
||||
super();
|
||||
|
||||
} // ImportAsset
|
||||
|
||||
/** Client to be imported to */
|
||||
private int m_AD_Client_ID = 0;
|
||||
/** Delete old Imported */
|
||||
private boolean m_deleteOldImported = false;
|
||||
|
||||
/** Organization to be imported to */
|
||||
private int m_AD_Org_ID = 0;
|
||||
/** Effective */
|
||||
private Timestamp m_DateValue = null;
|
||||
|
||||
/**
|
||||
* Prepare - e.g., get Parameters.
|
||||
*/
|
||||
protected void prepare()
|
||||
{
|
||||
ProcessInfoParameter[] para = getParameter();
|
||||
for (int i = 0; i < para.length; i++)
|
||||
{
|
||||
String name = para[i].getParameterName();
|
||||
if (name.equals("AD_Client_ID"))
|
||||
m_AD_Client_ID = (para[i].getParameterAsInt());
|
||||
else if (name.equals("DeleteOldImported"))
|
||||
m_deleteOldImported = "Y".equals(para[i].getParameter());
|
||||
else
|
||||
log.info("ImportAsset.prepare - Unknown Parameter: " + name);
|
||||
}
|
||||
m_DateValue = new Timestamp (System.currentTimeMillis());
|
||||
//java.util.Date today = new java.util.Date();
|
||||
//m_DateValue = new java.sql.Date(today.getTime());
|
||||
|
||||
} // prepare
|
||||
|
||||
|
||||
/**
|
||||
* Perform process.
|
||||
* @return Message
|
||||
* @throws Exception
|
||||
*/
|
||||
protected String doIt() throws java.lang.Exception
|
||||
{
|
||||
StringBuffer sql = null;
|
||||
int no = 0;
|
||||
String clientCheck = " AND AD_Client_ID=" + m_AD_Client_ID;
|
||||
|
||||
// **** Prepare ****
|
||||
|
||||
// Delete Old Imported
|
||||
/**if (m_deleteOldImported)
|
||||
{
|
||||
sql = new StringBuffer ("DELETE I_Asset "
|
||||
+ "WHERE I_IsImported='Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString());
|
||||
}**/
|
||||
|
||||
// Set Client, Org, IaActive, Created/Updated, ProductType
|
||||
sql = new StringBuffer ("UPDATE I_Asset "
|
||||
+ "SET AD_Client_ID = COALESCE (AD_Client_ID, ").append(m_AD_Client_ID).append("),"
|
||||
+ " AD_Org_ID = COALESCE (AD_Org_ID, 0),"
|
||||
+ " IsActive = COALESCE (IsActive, 'Y'),"
|
||||
+ " CreatedBy = COALESCE (CreatedBy, 0),"
|
||||
+ " UpdatedBy = COALESCE (UpdatedBy, 0),"
|
||||
+ " I_ErrorMsg = NULL,"
|
||||
+ " I_IsImported = 'N' "
|
||||
+ "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
no = DB.executeUpdate(sql.toString(),null);
|
||||
|
||||
|
||||
// Set Currency
|
||||
/**sql = new StringBuffer ("UPDATE I_Asset i "
|
||||
+ "SET ISO_Code=(SELECT ISO_Code FROM C_Currency c"
|
||||
+ " INNER JOIN C_AcctSchema a ON (a.C_Currency_ID=c.C_Currency_ID)"
|
||||
+ " INNER JOIN AD_ClientInfo ci ON (a.C_AcctSchema_ID=ci.C_AcctSchema1_ID)"
|
||||
+ " WHERE ci.AD_Client_ID=i.AD_Client_ID) "
|
||||
+ "WHERE C_Currency_ID IS NULL AND ISO_Code IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString());
|
||||
Log.trace(Log.l5_DData, "ImportAsset.doIt", "Set Currency Default=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Asset i "
|
||||
+ "SET C_Currency_ID=(SELECT C_Currency_ID FROM C_Currency c"
|
||||
+ " WHERE i.ISO_Code=c.ISO_Code AND c.AD_Client_ID IN (0,i.AD_Client_ID)) "
|
||||
+ "WHERE C_Currency_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString());
|
||||
Log.trace(Log.l5_DData, "ImportAsset.doIt", "Set Currency=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Asset "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Currency,' "
|
||||
+ "WHERE C_Currency_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString());
|
||||
Log.trace(Log.l3_Util, "ImportAsset.doIt", "Invalid Currency=" + no);
|
||||
**/
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
int noInsert = 0;
|
||||
int noUpdate = 0;
|
||||
//int noInsertPO = 0;
|
||||
//int noUpdatePO = 0;
|
||||
|
||||
// Go through Records
|
||||
sql = new StringBuffer ("SELECT I_Asset_ID, A_Asset_ID "
|
||||
+ "FROM I_Asset WHERE I_IsImported='N'").append(clientCheck).append(" Order By I_Asset_ID");
|
||||
// Connection conn = DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED);
|
||||
try
|
||||
{
|
||||
// Insert Asset from Import
|
||||
StringBuffer sqlA = new StringBuffer ("INSERT INTO A_Asset (A_Asset_ID,"
|
||||
+ "AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,"
|
||||
+ "Value,Name,Description,Help,"
|
||||
+ "A_Asset_Group_ID,M_Product_ID,SerNo,LOT,VersionNo,GuaranteeDate,"
|
||||
+ "AssetServiceDate,IsOwned,AssetDepreciationDate, UseLifeYears, UseLifeMonths,"
|
||||
+ "LifeUseUnits, UseUnits, Isdisposed, AssetDisposalDate, IsInPosession,"
|
||||
+ "LocationComment, M_Locator_ID, C_BPartner_ID, C_BPartner_Location_ID,"
|
||||
+ "C_Location_ID, IsDepreciated, IsFullyDepreciated, AD_User_ID,"
|
||||
+ "M_AttributeSetInstance_ID, A_Parent_Asset_ID, A_QTY_Original,"
|
||||
+ "A_QTY_Current) "
|
||||
+ "SELECT ?,"
|
||||
+ "AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,"
|
||||
+ "Value,Name,Description,Help,"
|
||||
+ "A_Asset_Group_ID,M_Product_ID,SerNo,LOT,VersionNo,GuaranteeDate,"
|
||||
+ "AssetServiceDate,IsOwned,AssetDepreciationDate, UseLifeYears, UseLifeMonths,"
|
||||
+ "LifeUseUnits, UseUnits, Isdisposed, AssetDisposalDate, IsInPosession,"
|
||||
+ "LocationComment, M_Locator_ID, C_BPartner_ID, C_BPartner_Location_ID,"
|
||||
+ "C_Location_ID, IsDepreciated, IsFullyDepreciated, AD_User_ID,"
|
||||
+ "M_AttributeSetInstance_ID, A_Parent_Asset_ID, A_QTY_Original,"
|
||||
+ "A_QTY_Current "
|
||||
+ "FROM I_Asset "
|
||||
+ "WHERE I_Asset_ID=?");
|
||||
PreparedStatement pstmt_insertProduct = DB.prepareStatement(sqlA.toString(), ResultSet.TYPE_SCROLL_INSENSITIVE,
|
||||
ResultSet.CONCUR_UPDATABLE, null);
|
||||
|
||||
// Update Assets from Import
|
||||
StringBuffer sqlB = new StringBuffer ("UPDATE A_Asset "
|
||||
+ "SET (A_Asset_ID,"
|
||||
+ "AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,"
|
||||
+ "Value,Name,Description,Help,"
|
||||
+ "A_Asset_Group_ID,M_Product_ID,SerNo,LOT,VersionNo,GuaranteeDate,"
|
||||
+ "AssetServiceDate,IsOwned,AssetDepreciationDate, UseLifeYears, UseLifeMonths,"
|
||||
+ "LifeUseUnits, UseUnits, Isdisposed, AssetDisposalDate, IsInPosession,"
|
||||
+ "LocationComment, M_Locator_ID, C_BPartner_ID, C_BPartner_Location_ID,"
|
||||
+ "C_Location_ID, IsDepreciated, IsFullyDepreciated, AD_User_ID,"
|
||||
+ "M_AttributeSetInstance_ID, A_Parent_Asset_ID, A_QTY_Original,"
|
||||
+ "A_QTY_Current) = "
|
||||
+ "(SELECT A_Asset_ID,"
|
||||
+ "AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,"
|
||||
+ "Value,Name,Description,Help,"
|
||||
+ "A_Asset_Group_ID,M_Product_ID,SerNo,LOT,VersionNo,GuaranteeDate,"
|
||||
+ "AssetServiceDate,IsOwned,AssetDepreciationDate, UseLifeYears, UseLifeMonths,"
|
||||
+ "LifeUseUnits, UseUnits, Isdisposed, AssetDisposalDate, IsInPosession,"
|
||||
+ "LocationComment, M_Locator_ID, C_BPartner_ID, C_BPartner_Location_ID,"
|
||||
+ "C_Location_ID, IsDepreciated, IsFullyDepreciated, AD_User_ID,"
|
||||
+ "M_AttributeSetInstance_ID, A_Parent_Asset_ID, A_QTY_Original,"
|
||||
+ "A_QTY_Current "
|
||||
+ "FROM I_Asset "
|
||||
+ "WHERE I_Asset_ID=?) "
|
||||
+ "WHERE A_Asset_ID=?");
|
||||
PreparedStatement pstmt_updateProduct = DB.prepareStatement(sqlB.toString(), ResultSet.TYPE_SCROLL_SENSITIVE,
|
||||
ResultSet.CONCUR_UPDATABLE, null);
|
||||
|
||||
// Insert Asset Accounts from Import
|
||||
StringBuffer sqlC = new StringBuffer ("INSERT INTO A_Asset_Acct ("
|
||||
+ "A_ASSET_ID, C_ACCTSCHEMA_ID, AD_CLIENT_ID,"
|
||||
+ "AD_ORG_ID,ISACTIVE, CREATED, CREATEDBY, UPDATED ,UPDATEDBY,"
|
||||
+ "A_DEPRECIATION_ID, A_DEPRECIATION_ACCT, A_ACCUMDEPRECIATION_ACCT,"
|
||||
+ "A_DISPOSAL_LOSS, A_DISPOSAL_REVENUE, A_ASSET_ACCT,A_ASSET_SPREAD_ID,"
|
||||
+ "A_DEPRECIATION_METHOD_ID,A_PERIOD_START,A_PERIOD_END, A_DEPRECIATION_CONV_ID,"
|
||||
+ "A_SALVAGE_VALUE, POSTINGTYPE, A_SPLIT_PERCENT, A_DEPRECIATION_MANUAL_AMOUNT, "
|
||||
+ "A_DEPRECIATION_MANUAL_PERIOD, A_DEPRECIATION_VARIABLE_PERC, A_ASSET_ACCT_ID) "
|
||||
+ "SELECT ?,C_ACCTSCHEMA_ID,"
|
||||
+ "AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,"
|
||||
+ "DEPRECIATIONTYPE, A_DEPRECIATION_ACCT, A_ACCUMDEPRECIATION_ACCT,"
|
||||
+ "A_DISPOSAL_LOSS, A_DISPOSAL_REVENUE, A_ASSET_ACCT,A_ASSET_SPREAD_TYPE,"
|
||||
+ "A_DEPRECIATION_CALC_TYPE,A_PERIOD_START,A_PERIOD_END, CONVENTIONTYPE,"
|
||||
+ "A_SALVAGE_VALUE, POSTINGTYPE, A_SPLIT_PERCENT, A_DEPRECIATION_MANUAL_AMOUNT,"
|
||||
+ "A_DEPRECIATION_MANUAL_PERIOD, A_DEPRECIATION_VARIABLE_PERC, ? "
|
||||
+ "FROM I_Asset "
|
||||
+ "WHERE I_Asset_ID=?");
|
||||
PreparedStatement pstmt_insertAssetAcct = DB.prepareStatement(sqlC.toString(), ResultSet.TYPE_SCROLL_INSENSITIVE,
|
||||
ResultSet.CONCUR_UPDATABLE, null);
|
||||
|
||||
// Insert Asset Balances from Import
|
||||
StringBuffer sqlD = new StringBuffer ("INSERT INTO A_DEPRECIATION_WORKFILE ("
|
||||
+ "A_DEPRECIATION_WORKFILE_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE,"
|
||||
+ "CREATED, CREATEDBY, UPDATED, UPDATEDBY, A_ASSET_ID, A_ASSET_COST,"
|
||||
+ "A_ACCUMULATED_DEPR, A_CALC_ACCUMULATED_DEPR, A_LIFE_PERIOD,"
|
||||
+ "A_PERIOD_POSTED, A_CURRENT_PERIOD, A_PRIOR_YEAR_ACCUMULATED_DEPR,"
|
||||
+ "A_BASE_AMOUNT, A_SALVAGE_VALUE, A_CURR_DEP_EXP, A_ASSET_LIFE_YEARS,"
|
||||
+ "A_ASSET_LIFE_CURRENT_YEAR, ISDEPRECIATED, POSTINGTYPE, A_QTY_CURRENT"
|
||||
+ ")"
|
||||
+ "SELECT "
|
||||
+ "?, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE,"
|
||||
+ "CREATED, CREATEDBY, UPDATED, UPDATEDBY, ?, A_ASSET_COST,"
|
||||
+ "A_ACCUMULATED_DEPR, A_CALC_ACCUMULATED_DEPR, A_LIFE_PERIOD,"
|
||||
+ "A_PERIOD_POSTED, A_CURRENT_PERIOD, A_PRIOR_YEAR_ACCUMULATED_DEPR,"
|
||||
+ "A_BASE_AMOUNT, A_SALVAGE_VALUE, A_CURR_DEP_EXP, A_ASSET_LIFE_YEARS,"
|
||||
+ "A_ASSET_LIFE_CURRENT_YEAR, ISDEPRECIATED, POSTINGTYPE, A_QTY_CURRENT"
|
||||
+ " "
|
||||
+ "FROM I_Asset "
|
||||
+ "WHERE I_Asset_ID=?");
|
||||
PreparedStatement pstmt_insertAssetBal = DB.prepareStatement(sqlD.toString(), ResultSet.TYPE_SCROLL_INSENSITIVE,
|
||||
ResultSet.CONCUR_UPDATABLE, null);
|
||||
|
||||
// Insert Asset Additions from Import
|
||||
StringBuffer sqlE = new StringBuffer ("INSERT INTO A_Asset_Addition ("
|
||||
+ " A_ASSET_ADDITION_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE,"
|
||||
+ " CREATED, CREATEDBY, UPDATED, UPDATEDBY, A_ASSET_ID,"
|
||||
+ " ASSETVALUEAMT, DESCRIPTION, M_INOUTLINE_ID, "
|
||||
+ " POSTINGTYPE, A_QTY_CURRENT, A_SOURCETYPE, A_CAPVSEXP) "
|
||||
+ "SELECT "
|
||||
+ " ?, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE,"
|
||||
+ " CREATED, CREATEDBY, UPDATED, UPDATEDBY, ?,"
|
||||
+ " A_ASSET_COST, 'Imported Asset', '1', "
|
||||
+ " POSTINGTYPE, A_QTY_CURRENT, 'IMP', 'Cap' "
|
||||
+ "FROM I_Asset "
|
||||
+ "WHERE I_Asset_ID=?");
|
||||
PreparedStatement pstmt_insertAssetAdd = DB.prepareStatement(sqlE.toString(), ResultSet.TYPE_SCROLL_INSENSITIVE,
|
||||
ResultSet.CONCUR_UPDATABLE, null);
|
||||
|
||||
// Insert Asset Additions from Import
|
||||
StringBuffer sqlF = new StringBuffer ("INSERT INTO A_Asset_Change ("
|
||||
+ "A_ASSET_CHANGE_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, "
|
||||
+ "CREATED, CREATEDBY, UPDATED, UPDATEDBY, A_ASSET_ID, "
|
||||
+ "CHANGETYPE, USELIFEYEARS, "
|
||||
+ "USELIFEMONTHS, LIFEUSEUNITS, ASSETDEPRECIATIONDATE, "
|
||||
+ "A_ASSET_ADDITION_ID, SERNO,"
|
||||
+ "LOT, VERSIONNO, ASSETACCUMDEPRECIATIONAMT, TEXTDETAILS, "
|
||||
+ "ASSETSERVICEDATE, ASSETBOOKVALUEAMT, ASSETMARKETVALUEAMT, "
|
||||
+ "ASSETVALUEAMT, ASSETDISPOSALDATE, A_PARENT_ASSET_ID, "
|
||||
+ "C_BPARTNER_ID, C_BPARTNER_LOCATION_ID, C_LOCATION_ID, "
|
||||
+ "A_DEPRECIATION_ACCT, A_ACCUMDEPRECIATION_ACCT, A_DISPOSAL_LOSS, "
|
||||
+ "A_DISPOSAL_REVENUE, A_ASSET_ACCT, A_ASSET_SPREAD_TYPE, "
|
||||
+ "A_DEPRECIATION_CALC_TYPE, A_PERIOD_START, A_PERIOD_END, "
|
||||
+ "A_SALVAGE_VALUE, POSTINGTYPE, A_ASSET_ACCT_ID, CONVENTIONTYPE, "
|
||||
+ "A_SPLIT_PERCENT, DEPRECIATIONTYPE, A_QTY_CURRENT, ISDEPRECIATED, "
|
||||
+ "ISFULLYDEPRECIATED, ISINPOSESSION, ISDISPOSED, ISOWNED) "
|
||||
+ "SELECT "
|
||||
+ "?, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, "
|
||||
+ "CREATED, CREATEDBY, UPDATED, UPDATEDBY, ?, "
|
||||
+ "'IMP', USELIFEYEARS, "
|
||||
+ "USELIFEMONTHS, LIFEUSEUNITS, ASSETDEPRECIATIONDATE, "
|
||||
+ "?, SERNO, "
|
||||
+ "LOT, VERSIONNO, A_ACCUMULATED_DEPR, 'Imported Fixed Asset', "
|
||||
+ "ASSETSERVICEDATE, A_BASE_AMOUNT, ASSETMARKETVALUEAMT, "
|
||||
+ "A_ASSET_COST, ASSETDISPOSALDATE, A_PARENT_ASSET_ID, "
|
||||
+ "C_BPARTNER_ID, C_BPARTNER_LOCATION_ID, C_LOCATION_ID, "
|
||||
+ "A_DEPRECIATION_ACCT, A_ACCUMDEPRECIATION_ACCT, A_DISPOSAL_LOSS, "
|
||||
+ "A_DISPOSAL_REVENUE, A_ASSET_ACCT, A_ASSET_SPREAD_TYPE, "
|
||||
+ "A_DEPRECIATION_CALC_TYPE, A_PERIOD_START, A_PERIOD_END, "
|
||||
+ "A_SALVAGE_VALUE, POSTINGTYPE, ?, CONVENTIONTYPE, "
|
||||
+ "A_SPLIT_PERCENT, DEPRECIATIONTYPE, A_QTY_CURRENT, ISDEPRECIATED, "
|
||||
+ "ISFULLYDEPRECIATED, ISINPOSESSION, ISDISPOSED, ISOWNED "
|
||||
+ "FROM I_Asset "
|
||||
+ "WHERE I_Asset_ID=?");
|
||||
PreparedStatement pstmt_insertAssetChg = DB.prepareStatement(sqlF.toString(), ResultSet.TYPE_SCROLL_INSENSITIVE,
|
||||
ResultSet.CONCUR_UPDATABLE, null);
|
||||
/*
|
||||
// Update Asset Accounts from Import
|
||||
PreparedStatement pstmt_updateAssetAcct = conn.prepareStatement
|
||||
("UPDATE A_Asset_Acct "
|
||||
+ "SET("
|
||||
+ "A_ASSET_ID, C_ACCTSCHEMA_ID, AD_CLIENT_ID"
|
||||
+ "AD_ORG_ID,ISACTIVE, CREATED, CREATEDBY, UPDATED ,UPDATEDBY"
|
||||
+ "A_DEPRECIATION_ID, A_DEPRECIATION_ACCT, A_ACCUMDEPRECIATION_ACCT"
|
||||
+ "A_DISPOSAL_LOSS, A_DISPOSAL_REVENUE, A_ASSET_ACCT,A_ASSET_SPREAD_ID"
|
||||
+ "A_DEPRECIATION_METHOD_ID,A_PERIOD_START,A_PERIOD_END"
|
||||
+ "A_SALVAGE_VALUE, POSTINGTYPE, A_SPLIT_PERCENT) = "
|
||||
+ "(SELECT ?,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,"
|
||||
+ "DEPRECIATIONTYPE, A_DEPRECIATION_ACCT, A_ACCUMDEPRECIATION_ACCT"
|
||||
+ "A_DISPOSAL_LOSS, A_DISPOSAL_REVENUE, A_ASSET_ACCT,A_ASSET_SPREAD_TYPE"
|
||||
+ "A_DEPRECIATION_METHOD_ID,A_PERIOD_START,A_PERIOD_END"
|
||||
+ "A_SALVAGE_VALUE, POSTINGTYPE, A_SPLIT_PERCENT"
|
||||
+ "FROM I_Asset "
|
||||
+ "WHERE I_Asset_ID=?) "
|
||||
+ "WHERE A_Asset_ID=?");
|
||||
|
||||
*/
|
||||
// Set Imported = Y
|
||||
PreparedStatement pstmt_setImported = DB.prepareStatement
|
||||
("UPDATE I_Asset SET I_IsImported='Y', "
|
||||
//+ "Updated= TO_DATE('"+m_DateValue+"','YYYY-MM-DD HH24:MI:SS.FFF') "
|
||||
+ "Processed='Y' WHERE I_Asset_ID=?",ResultSet.TYPE_SCROLL_INSENSITIVE,
|
||||
ResultSet.CONCUR_UPDATABLE, null);
|
||||
|
||||
//
|
||||
PreparedStatement pstmt = DB.prepareStatement(sql.toString(),ResultSet.TYPE_SCROLL_INSENSITIVE,
|
||||
ResultSet.CONCUR_UPDATABLE, null);
|
||||
ResultSet rs = pstmt.executeQuery();
|
||||
int x = 0;
|
||||
|
||||
while (rs.next())
|
||||
{
|
||||
x=x+1;
|
||||
|
||||
int I_Asset_ID = rs.getInt(1);
|
||||
int A_Asset_ID = rs.getInt(2);
|
||||
int A_Asset_Acct_ID = 0;
|
||||
int A_DEPRECIATION_WORKFILE_ID = 0;
|
||||
int A_ASSET_ADDITION_ID = 0;
|
||||
int A_ASSET_CHANGE_ID = 0;
|
||||
boolean newAsset = true;
|
||||
|
||||
if (A_Asset_ID == 0)
|
||||
{
|
||||
A_Asset_ID = DB.getNextID(m_AD_Client_ID, "A_Asset", null);
|
||||
A_Asset_Acct_ID = DB.getNextID(m_AD_Client_ID, "A_Asset_Acct", null);
|
||||
A_DEPRECIATION_WORKFILE_ID = DB.getNextID(m_AD_Client_ID, "A_Depreciation_Workfile", null);
|
||||
A_ASSET_ADDITION_ID = DB.getNextID(m_AD_Client_ID, "A_Asset_Addition", null);
|
||||
A_ASSET_CHANGE_ID = DB.getNextID(m_AD_Client_ID, "A_Asset_Change", null);
|
||||
|
||||
newAsset = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// Check to see if Asset_ID exists
|
||||
int found = DB.getSQLValue(null,"SELECT COUNT(*) FROM A_ASSET WHERE A_ASSET_ID = " + A_Asset_ID + clientCheck);
|
||||
if (found == 0)
|
||||
{
|
||||
|
||||
newAsset = true;
|
||||
A_DEPRECIATION_WORKFILE_ID = DB.getNextID(m_AD_Client_ID, "A_Depreciation_Workfile", null);
|
||||
A_ASSET_ADDITION_ID = DB.getNextID(m_AD_Client_ID, "A_Asset_Addition", null);
|
||||
A_ASSET_CHANGE_ID = DB.getNextID(m_AD_Client_ID, "A_Asset_Change", null);
|
||||
A_Asset_Acct_ID = DB.getNextID(m_AD_Client_ID, "A_Asset_Acct", null);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
newAsset = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Product
|
||||
if (newAsset) // Insert new Asset
|
||||
{
|
||||
|
||||
pstmt_insertProduct.setInt(1, A_Asset_ID);
|
||||
pstmt_insertProduct.setInt(2, I_Asset_ID);
|
||||
|
||||
pstmt_insertAssetAcct.setInt(1, A_Asset_ID);
|
||||
pstmt_insertAssetAcct.setInt(2, A_Asset_Acct_ID);
|
||||
pstmt_insertAssetAcct.setInt(3, I_Asset_ID);
|
||||
|
||||
pstmt_insertAssetBal.setInt(1, A_DEPRECIATION_WORKFILE_ID);
|
||||
pstmt_insertAssetBal.setInt(2, A_Asset_ID);
|
||||
pstmt_insertAssetBal.setInt(3, I_Asset_ID);
|
||||
|
||||
pstmt_insertAssetAdd.setInt(1, A_ASSET_ADDITION_ID);
|
||||
pstmt_insertAssetAdd.setInt(2, A_Asset_ID);
|
||||
pstmt_insertAssetAdd.setInt(3, I_Asset_ID);
|
||||
|
||||
pstmt_insertAssetChg.setInt(1, A_ASSET_CHANGE_ID);
|
||||
pstmt_insertAssetChg.setInt(2, A_Asset_ID);
|
||||
pstmt_insertAssetChg.setInt(3, A_ASSET_ADDITION_ID);
|
||||
pstmt_insertAssetChg.setInt(4, A_Asset_Acct_ID);
|
||||
pstmt_insertAssetChg.setInt(5, I_Asset_ID);
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
no = pstmt_insertProduct.executeUpdate();
|
||||
no = pstmt_insertAssetAcct.executeUpdate();
|
||||
no = pstmt_insertAssetBal.executeUpdate();
|
||||
no = pstmt_insertAssetAdd.executeUpdate();
|
||||
no = pstmt_insertAssetChg.executeUpdate();
|
||||
|
||||
noInsert++;
|
||||
}
|
||||
catch (SQLException ex)
|
||||
{
|
||||
|
||||
sql = new StringBuffer ("UPDATE I_Asset "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=").append(DB.TO_STRING("Insert Asset: " + ex.toString()))
|
||||
.append(" WHERE I_Asset_ID=").append(I_Asset_ID);
|
||||
|
||||
DB.executeUpdate(sql.toString(),null);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else // Update Asset
|
||||
{
|
||||
|
||||
pstmt_updateProduct.setInt(1, I_Asset_ID);
|
||||
pstmt_updateProduct.setInt(2, A_Asset_ID);
|
||||
|
||||
try
|
||||
{
|
||||
//String sqlcall = "UPDATE A_Asset SET(AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Value,Name,Description,Help,A_Asset_Group_ID,M_Product_ID,SerNo,LOT,VersionNo,GuaranteeDate,AssetServiceDate,IsOwned,AssetDepreciationDate, UseLifeYears, UseLifeMonths,LifeUseUnits, UseUnits, Isdisposed, AssetDisposalDate, IsInPosession,LocationComment, M_Locator_ID, C_BPartner_ID, C_BPartner_Location_ID,C_Location_ID, IsDepreciated, IsFullyDepreciated, AD_User_ID,M_AttributeSetInstance_ID, A_Parent_Asset_ID, A_QTY_Original,A_QTY_Current) = (SELECT AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Value,Name,Description,Help,A_Asset_Group_ID,M_Product_ID,SerNo,LOT,VersionNo,GuaranteeDate,AssetServiceDate,IsOwned,AssetDepreciationDate, UseLifeYears, UseLifeMonths,LifeUseUnits, UseUnits, Isdisposed, AssetDisposalDate, IsInPosession,LocationComment, M_Locator_ID, C_BPartner_ID, C_BPartner_Location_ID,C_Location_ID, IsDepreciated, IsFullyDepreciated, AD_User_ID,M_AttributeSetInstance_ID, A_Parent_Asset_ID, A_QTY_Original,A_QTY_Current FROM I_Asset WHERE I_Asset_ID=1000000) WHERE A_Asset_ID=2005000";
|
||||
//pstmt_updateProduct = prepareStatement(sqlB.toString(), ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE, null);
|
||||
pstmt_updateProduct.executeUpdate();
|
||||
noUpdate++;
|
||||
}
|
||||
catch (SQLException ex)
|
||||
{
|
||||
|
||||
sql = new StringBuffer ("UPDATE I_Asset "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=").append(DB.TO_STRING("Update Asset: " + ex.toString()))
|
||||
.append(" WHERE I_Asset_ID=").append(I_Asset_ID);
|
||||
//DB.executeUpdate(sql.toString());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
pstmt_setImported.setInt(1, I_Asset_ID);
|
||||
no = pstmt_setImported.executeUpdate();
|
||||
//conn.commit();
|
||||
} // for all I_Asset
|
||||
rs.close();
|
||||
pstmt.close();
|
||||
|
||||
//
|
||||
pstmt_insertProduct.close();
|
||||
pstmt_updateProduct.close();
|
||||
pstmt_setImported.close();
|
||||
//
|
||||
//conn.close();
|
||||
//conn = null;
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
|
||||
throw new Exception ("ImportAsset3.doIt", e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
// Set Error to indicator to not imported
|
||||
sql = new StringBuffer ("UPDATE I_Asset "
|
||||
+ "SET I_IsImported='N' "
|
||||
//+ "Updated= TO_DATE('"+m_DateValue+"','YYYY-MM-DD HH24:MI:SS.FFF') "
|
||||
+ "WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(),null);
|
||||
addLog (0, null, new BigDecimal (no), "@Errors@");
|
||||
addLog (0, null, new BigDecimal (noInsert), "@A_Asset_ID@: @Inserted@");
|
||||
addLog (0, null, new BigDecimal (noUpdate), "@A_Asset_ID@: @Updated@");
|
||||
return "";
|
||||
} // doIt
|
||||
|
||||
} // ImportAsset
|
|
@ -1,980 +0,0 @@
|
|||
/******************************************************************************
|
||||
* The contents of this file are subject to the Compiere License Version 1.1
|
||||
* ("License"); You may not use this file except in compliance with the License
|
||||
* You may obtain a copy of the License at http://www.compiere.org/license.html
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is Compiere ERP & CRM Business Solution
|
||||
* The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
|
||||
*
|
||||
* Copyright (C) 2005 Robert KLEIN. robeklein@gmail.com *
|
||||
* Contributor(s): ______________________________________.
|
||||
*****************************************************************************/
|
||||
package org.compiere.FA;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.CallableStatement;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
import org.compiere.model.MAccount;
|
||||
import org.compiere.model.MAssetChange;
|
||||
import org.compiere.model.MJournal;
|
||||
import org.compiere.model.MJournalBatch;
|
||||
import org.compiere.model.MJournalLine;
|
||||
import org.compiere.model.MXIFAJournal;
|
||||
import org.compiere.model.X_I_FAJournal;
|
||||
import org.compiere.process.ProcessInfoParameter;
|
||||
import org.compiere.process.SvrProcess;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.TimeUtil;
|
||||
|
||||
|
||||
/**
|
||||
* Import GL Journal Batch/JournalLine from I_FAJournal
|
||||
*
|
||||
* @author Rob Klein
|
||||
* @version $Id: ImportFAJournal2.java,v 1.0 $
|
||||
*/
|
||||
public class ImportFAJournal2 extends SvrProcess
|
||||
{
|
||||
/** Client to be imported to */
|
||||
private int m_AD_Client_ID = 0;
|
||||
/** Organization to be imported to */
|
||||
private int m_AD_Org_ID = 0;
|
||||
/** Acct Schema to be imported to */
|
||||
private int m_C_AcctSchema_ID = 0;
|
||||
/** Default Date */
|
||||
private Timestamp m_DateAcct = null;
|
||||
/** Delete old Imported */
|
||||
private boolean m_DeleteOldImported = false;
|
||||
/** Don't import */
|
||||
private boolean m_IsValidateOnly = false;
|
||||
/** Import if no Errors */
|
||||
private boolean m_IsImportOnlyNoErrors = true;
|
||||
/** Entry Type */
|
||||
private String m_EntryType = null;
|
||||
|
||||
/** Record ID */
|
||||
private int p_Depreciation_Entry_ID = 0;
|
||||
|
||||
/**
|
||||
* Prepare - e.g., get Parameters.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Prepare - e.g., get Parameters.
|
||||
*/
|
||||
protected void prepare()
|
||||
{
|
||||
ProcessInfoParameter[] para = getParameter();
|
||||
for (int i = 0; i < para.length; i++)
|
||||
{
|
||||
String name = para[i].getParameterName();
|
||||
|
||||
p_Depreciation_Entry_ID = getRecord_ID();
|
||||
|
||||
if (para[i].getParameter() == null)
|
||||
;
|
||||
else if (name.equals("AD_Client_ID"))
|
||||
m_AD_Client_ID = ((BigDecimal)para[i].getParameter()).intValue();
|
||||
else if (name.equals("AD_Org_ID"))
|
||||
m_AD_Org_ID = ((BigDecimal)para[i].getParameter()).intValue();
|
||||
else if (name.equals("C_AcctSchema_ID"))
|
||||
m_C_AcctSchema_ID = ((BigDecimal)para[i].getParameter()).intValue();
|
||||
else if (name.equals("DateAcct"))
|
||||
m_DateAcct = (Timestamp)para[i].getParameter();
|
||||
else if (name.equals("IsValidateOnly"))
|
||||
m_IsValidateOnly = "Y".equals(para[i].getParameter());
|
||||
else if (name.equals("IsImportOnlyNoErrors"))
|
||||
m_IsImportOnlyNoErrors = "Y".equals(para[i].getParameter());
|
||||
else if (name.equals("DeleteOldImported"))
|
||||
m_DeleteOldImported = "Y".equals(para[i].getParameter());
|
||||
else
|
||||
log.info("prepare - Unknown Parameter: " + name);
|
||||
}
|
||||
} // prepare
|
||||
|
||||
CallableStatement cs;
|
||||
|
||||
/**
|
||||
* Perform process.
|
||||
* @return Message
|
||||
* @throws Exception
|
||||
*/
|
||||
protected String doIt() throws java.lang.Exception
|
||||
{
|
||||
log.info("IsValidateOnly=" + m_IsValidateOnly + ", IsImportOnlyNoErrors=" + m_IsImportOnlyNoErrors);
|
||||
StringBuffer sql = null;
|
||||
int no = 0;
|
||||
String clientCheck = " AND AD_Client_ID=" + m_AD_Client_ID;
|
||||
|
||||
// Clear imported and processed records
|
||||
|
||||
String sqldel = null;
|
||||
|
||||
sqldel = "SELECT A_ENTRY_TYPE "
|
||||
+ "FROM A_DEPRECIATION_ENTRY "
|
||||
+ "WHERE A_DEPRECIATION_ENTRY.A_DEPRECIATION_ENTRY_ID = ?";
|
||||
|
||||
m_EntryType = DB.getSQLValueString(get_TrxName(), sqldel, p_Depreciation_Entry_ID);
|
||||
|
||||
if (m_DeleteOldImported)
|
||||
{
|
||||
sql = new StringBuffer ("DELETE I_FAJournal "
|
||||
+ "WHERE I_IsImported='Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Delete Old Impored =" + no);
|
||||
|
||||
sql = new StringBuffer ("DELETE A_Depreciation_Exp "
|
||||
+ "WHERE A_Entry_Type = '"+ m_EntryType + "'"
|
||||
+ " AND Processed='Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Delete Old Impored =" + no);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// **** Copy from Workfile to Entry File ****
|
||||
|
||||
log.info("doIt - Depreciation_Build_Entry_ID=" + p_Depreciation_Entry_ID);
|
||||
if (p_Depreciation_Entry_ID == 0)
|
||||
throw new IllegalArgumentException("No Record");
|
||||
//
|
||||
|
||||
//X_A_Depreciation_Build DepBuild = new X_A_Depreciation_Build (getCtx(), p_Depreciation_Entry_ID);
|
||||
|
||||
String sqlst = null;
|
||||
|
||||
sqlst = "SELECT A_DEPRECIATION_EXP.AD_CLIENT_ID, A_DEPRECIATION_EXP.CREATED, A_DEPRECIATION_EXP.CREATEDBY, "
|
||||
+ "A_DEPRECIATION_EXP.UPDATED, A_DEPRECIATION_EXP.UPDATEDBY, A_DEPRECIATION_EXP.DESCRIPTION, "
|
||||
+ "A_DEPRECIATION_EXP.AD_ORG_ID, A_DEPRECIATION_EXP.A_ACCOUNT_NUMBER,A_DEPRECIATION_ENTRY.C_CURRENCY_ID, "
|
||||
+ "A_DEPRECIATION_EXP.EXPENSE, A_DEPRECIATION_EXP.A_ASSET_ID, A_DEPRECIATION_EXP.ISDEPRECIATED, "
|
||||
+ "A_DEPRECIATION_EXP.PROCESSED, A_DEPRECIATION_EXP.A_DEPRECIATION_EXP_ID, A_DEPRECIATION_EXP.A_Period,"
|
||||
+ "A_DEPRECIATION_ENTRY.DATEACCT, A_DEPRECIATION_ENTRY.POSTINGTYPE, A_DEPRECIATION_ENTRY.A_ENTRY_TYPE,"
|
||||
+ "A_DEPRECIATION_ENTRY.PROCESSED AS ENTRY_PROCESS,A_DEPRECIATION_ENTRY.GL_CATEGORY_ID, "
|
||||
+ "A_DEPRECIATION_ENTRY.C_DOCTYPE_ID,A_DEPRECIATION_ENTRY.C_ACCTSCHEMA_ID, A_DEPRECIATION_ENTRY.A_DEPRECIATION_ENTRY_ID "
|
||||
+ "FROM A_DEPRECIATION_EXP, A_DEPRECIATION_ENTRY "
|
||||
+ "WHERE A_DEPRECIATION_EXP.PROCESSED = 'N' AND A_DEPRECIATION_ENTRY.PROCESSED = 'N' AND "
|
||||
+ "A_DEPRECIATION_EXP.A_PERIOD = A_DEPRECIATION_ENTRY.C_PERIOD_ID "
|
||||
+ "AND A_DEPRECIATION_ENTRY.POSTINGTYPE = A_DEPRECIATION_EXP.POSTINGTYPE AND "
|
||||
+ "A_DEPRECIATION_EXP.A_ENTRY_TYPE = A_DEPRECIATION_ENTRY.A_ENTRY_TYPE";
|
||||
|
||||
PreparedStatement pstmt = null;
|
||||
pstmt = DB.prepareStatement (sqlst, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE,get_TrxName());
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
int v_FirstTime = 0;
|
||||
String v_C_BatchNo = "";
|
||||
BigDecimal v_AMTSOURCEDR ;
|
||||
BigDecimal v_AMTSOURCECR ;
|
||||
int v_ID_START = 10;
|
||||
rs = pstmt.executeQuery();
|
||||
while (rs.next())
|
||||
{
|
||||
|
||||
X_I_FAJournal FAInsert = new X_I_FAJournal (getCtx (), 0, get_TrxName());
|
||||
if (v_FirstTime == 0)
|
||||
{
|
||||
v_C_BatchNo = DB.getDocumentNo(rs.getInt("C_DOCTYPE_ID"), get_TrxName(), true, FAInsert);
|
||||
|
||||
v_FirstTime = 1;
|
||||
}
|
||||
|
||||
String v_Line_Description = rs.getString("DESCRIPTION") + " - FA # " + rs.getInt("A_ASSET_ID");
|
||||
|
||||
if (rs.getBigDecimal("EXPENSE").compareTo(new BigDecimal("0.0"))== 1)
|
||||
{
|
||||
v_AMTSOURCEDR = rs.getBigDecimal("EXPENSE") ;
|
||||
v_AMTSOURCECR = Env.ZERO;
|
||||
}
|
||||
else
|
||||
{
|
||||
v_AMTSOURCECR = (rs.getBigDecimal("EXPENSE").multiply(new BigDecimal("-1.0")));
|
||||
v_AMTSOURCEDR = Env.ZERO;
|
||||
}
|
||||
|
||||
FAInsert.setI_IsImported(false);
|
||||
FAInsert.setProcessed(false);
|
||||
FAInsert.setBatchDocumentNo(v_C_BatchNo);
|
||||
FAInsert.setBatchDescription (rs.getString("DESCRIPTION"));
|
||||
FAInsert.setPostingType(rs.getString("POSTINGTYPE"));
|
||||
FAInsert.setC_AcctSchema_ID(rs.getInt("C_ACCTSCHEMA_ID"));
|
||||
FAInsert.setC_DocType_ID( rs.getInt("C_DOCTYPE_ID"));
|
||||
FAInsert.setGL_Category_ID(rs.getInt("GL_CATEGORY_ID"));
|
||||
FAInsert.setLine( v_ID_START);
|
||||
FAInsert.setDateAcct (rs.getTimestamp("DATEACCT"));
|
||||
FAInsert.setC_Period_ID(rs.getInt("A_Period"));
|
||||
FAInsert.setDescription ( v_Line_Description);
|
||||
FAInsert.setAmtSourceDr ( v_AMTSOURCEDR);
|
||||
FAInsert.setAmtSourceCr ( v_AMTSOURCECR);
|
||||
FAInsert.setC_Currency_ID ( rs.getInt("C_CURRENCY_ID"));
|
||||
FAInsert.setQty (Env.ZERO);
|
||||
FAInsert.setC_ValidCombination_ID ( rs.getInt("A_ACCOUNT_NUMBER"));
|
||||
FAInsert.setA_Asset_ID ( rs.getInt("A_ASSET_ID"));
|
||||
FAInsert.setIsDepreciated ( rs.getString("ISDEPRECIATED"));
|
||||
|
||||
v_ID_START = v_ID_START+10;
|
||||
FAInsert.saveEx();
|
||||
|
||||
String sql4 = "UPDATE A_DEPRECIATION_EXP SET PROCESSED = 'Y' "
|
||||
+ " WHERE A_DEPRECIATION_EXP_ID = " + rs.getInt("A_DEPRECIATION_EXP_ID");
|
||||
no = DB.executeUpdate (sql4,get_TrxName());
|
||||
|
||||
sql4 = new String ("UPDATE A_DEPRECIATION_ENTRY SET PROCESSED = 'Y', ISACTIVE = 'N' "
|
||||
+ " WHERE A_DEPRECIATION_ENTRY_ID = " + rs.getInt("A_DEPRECIATION_ENTRY_ID"));
|
||||
no = DB.executeUpdate (sql4,get_TrxName());
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.info("ImportFAJournal2"+ e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
}
|
||||
|
||||
// Set IsActive, Created/Updated
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal "
|
||||
+ "SET IsActive = COALESCE (IsActive, 'Y'),"
|
||||
+ " Created = COALESCE (Created, SysDate),"
|
||||
+ " CreatedBy = COALESCE (CreatedBy, 0),"
|
||||
+ " Updated = COALESCE (Updated, SysDate),"
|
||||
+ " UpdatedBy = COALESCE (UpdatedBy, 0),"
|
||||
+ " I_ErrorMsg = NULL,"
|
||||
+ " I_IsImported = 'N' "
|
||||
+ "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Reset=" + no);
|
||||
|
||||
// Set Client from Name
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET AD_Client_ID=(SELECT c.AD_Client_ID FROM AD_Client c WHERE c.Value=i.ClientValue) "
|
||||
+ "WHERE (AD_Client_ID IS NULL OR AD_Client_ID=0) AND ClientValue IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'");
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Set Client from Value=" + no);
|
||||
|
||||
// Set Client, Doc Org, AcctSchema, DatAcct
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal "
|
||||
+ "SET AD_Client_ID = COALESCE (AD_Client_ID,").append (m_AD_Client_ID).append ("),"
|
||||
+ " AD_OrgDoc_ID = COALESCE (AD_OrgDoc_ID,").append (m_AD_Org_ID).append ("),");
|
||||
if (m_C_AcctSchema_ID != 0)
|
||||
sql.append(" C_AcctSchema_ID = COALESCE (C_AcctSchema_ID,").append (m_C_AcctSchema_ID).append ("),");
|
||||
if (m_DateAcct != null)
|
||||
sql.append(" DateAcct = COALESCE (DateAcct,").append (DB.TO_DATE(m_DateAcct)).append ("),");
|
||||
sql.append(" Updated = COALESCE (Updated, SysDate) "
|
||||
+ "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Client/DocOrg/Default=" + no);
|
||||
|
||||
// Error Doc Org
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal o "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Doc Org, '"
|
||||
+ "WHERE (AD_OrgDoc_ID IS NULL OR AD_OrgDoc_ID=0"
|
||||
+ " OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
if (no != 0)
|
||||
log.info ("doIt - Invalid Doc Org=" + no);
|
||||
|
||||
// Set AcctSchema
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET C_AcctSchema_ID=(SELECT a.C_AcctSchema_ID FROM C_AcctSchema a"
|
||||
+ " WHERE i.AcctSchemaName=a.Name AND i.AD_Client_ID=a.AD_Client_ID) "
|
||||
+ "WHERE C_AcctSchema_ID IS NULL AND AcctSchemaName IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Set AcctSchema from Name=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET C_AcctSchema_ID=(SELECT c.C_AcctSchema1_ID FROM AD_ClientInfo c WHERE c.AD_Client_ID=i.AD_Client_ID) "
|
||||
+ "WHERE C_AcctSchema_ID IS NULL AND AcctSchemaName IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Set AcctSchema from Client=" + no);
|
||||
// Error AcctSchema
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid AcctSchema, '"
|
||||
+ "WHERE (C_AcctSchema_ID IS NULL OR C_AcctSchema_ID=0"
|
||||
+ " OR NOT EXISTS (SELECT * FROM C_AcctSchema a WHERE i.AD_Client_ID=a.AD_Client_ID))"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
if (no != 0)
|
||||
log.info ("doIt - Invalid AcctSchema=" + no);
|
||||
|
||||
// Set DateAcct (mandatory)
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET DateAcct=SysDate "
|
||||
+ "WHERE DateAcct IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Set DateAcct=" + no);
|
||||
|
||||
// Document Type
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET C_DocType_ID=(SELECT d.C_DocType_ID FROM C_DocType d"
|
||||
+ " WHERE d.Name=i.DocTypeName AND d.DocBaseType='GLJ' AND i.AD_Client_ID=d.AD_Client_ID) "
|
||||
+ "WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Set DocType=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocType, '"
|
||||
+ "WHERE (C_DocType_ID IS NULL OR C_DocType_ID=0"
|
||||
+ " OR NOT EXISTS (SELECT * FROM C_DocType d WHERE i.AD_Client_ID=d.AD_Client_ID AND d.DocBaseType='GLJ'))"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
if (no != 0)
|
||||
log.info ("doIt - Invalid DocType=" + no);
|
||||
|
||||
// GL Category
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET GL_Category_ID=(SELECT c.GL_Category_ID FROM GL_Category c"
|
||||
+ " WHERE c.Name=i.CategoryName AND i.AD_Client_ID=c.AD_Client_ID) "
|
||||
+ "WHERE GL_Category_ID IS NULL AND CategoryName IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Set DocType=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Category, '"
|
||||
+ "WHERE (GL_Category_ID IS NULL OR GL_Category_ID=0)"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
if (no != 0)
|
||||
log.info ("doIt - Invalid Category=" + no);
|
||||
|
||||
// Set Currency
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET C_Currency_ID=(SELECT c.C_Currency_ID FROM C_Currency c"
|
||||
+ " WHERE c.ISO_Code=i.ISO_Code AND c.AD_Client_ID IN (0,i.AD_Client_ID)) "
|
||||
+ "WHERE C_Currency_ID IS NULL AND ISO_Code IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Set Currency from ISO=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET C_Currency_ID=(SELECT a.C_Currency_ID FROM C_AcctSchema a"
|
||||
+ " WHERE a.C_AcctSchema_ID=i.C_AcctSchema_ID AND a.AD_Client_ID=i.AD_Client_ID)"
|
||||
+ "WHERE C_Currency_ID IS NULL AND ISO_Code IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Set Default Currency=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Currency, '"
|
||||
+ "WHERE (C_Currency_ID IS NULL OR C_Currency_ID=0)"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
if (no != 0)
|
||||
log.info ("doIt - Invalid Currency=" + no);
|
||||
|
||||
// Set Conversion Type
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET ConversionTypeValue='S' "
|
||||
+ "WHERE C_ConversionType_ID IS NULL AND ConversionTypeValue IS NULL"
|
||||
+ " AND I_IsImported='N'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Set CurrencyType Value to Spot =" + no);
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET C_ConversionType_ID=(SELECT c.C_ConversionType_ID FROM C_ConversionType c"
|
||||
+ " WHERE c.Value=i.ConversionTypeValue AND c.AD_Client_ID IN (0,i.AD_Client_ID)) "
|
||||
+ "WHERE C_ConversionType_ID IS NULL AND ConversionTypeValue IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Set CurrencyType from Value=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid CurrencyType, '"
|
||||
+ "WHERE (C_ConversionType_ID IS NULL OR C_ConversionType_ID=0) AND ConversionTypeValue IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
if (no != 0)
|
||||
log.info ("doIt - Invalid CurrencyTypeValue=" + no);
|
||||
|
||||
|
||||
|
||||
// Set/Overwrite Home Currency Rate
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET CurrencyRate=1"
|
||||
+ "WHERE EXISTS (SELECT * FROM C_AcctSchema a"
|
||||
+ " WHERE a.C_AcctSchema_ID=i.C_AcctSchema_ID AND a.C_Currency_ID=i.C_Currency_ID)"
|
||||
+ " AND C_Currency_ID IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Set Home CurrencyRate=" + no);
|
||||
// Set Currency Rate
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET CurrencyRate=(SELECT r.MultiplyRate FROM C_Conversion_Rate r, C_AcctSchema s"
|
||||
+ " WHERE s.C_AcctSchema_ID=i.C_AcctSchema_ID AND s.AD_Client_ID=i.AD_Client_ID"
|
||||
+ " AND r.C_Currency_ID=i.C_Currency_ID AND r.C_Currency_ID_TO=s.C_Currency_ID"
|
||||
+ " AND r.AD_Client_ID=i.AD_Client_ID AND r.AD_Org_ID=i.AD_OrgDoc_ID"
|
||||
+ " AND r.C_ConversionType_ID=i.C_ConversionType_ID"
|
||||
+ " AND i.DateAcct BETWEEN r.ValidFrom AND r.ValidTo AND ROWNUM=1"
|
||||
// ORDER BY ValidFrom DESC
|
||||
+ ") WHERE CurrencyRate IS NULL OR CurrencyRate=0 AND C_Currency_ID>0"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Set Org Rate=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET CurrencyRate=(SELECT r.MultiplyRate FROM C_Conversion_Rate r, C_AcctSchema s"
|
||||
+ " WHERE s.C_AcctSchema_ID=i.C_AcctSchema_ID AND s.AD_Client_ID=i.AD_Client_ID"
|
||||
+ " AND r.C_Currency_ID=i.C_Currency_ID AND r.C_Currency_ID_TO=s.C_Currency_ID"
|
||||
+ " AND r.AD_Client_ID=i.AD_Client_ID"
|
||||
+ " AND r.C_ConversionType_ID=i.C_ConversionType_ID"
|
||||
+ " AND i.DateAcct BETWEEN r.ValidFrom AND r.ValidTo AND ROWNUM=1"
|
||||
// ORDER BY ValidFrom DESC
|
||||
+ ") WHERE CurrencyRate IS NULL OR CurrencyRate=0 AND C_Currency_ID>0"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Set Client Rate=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Rate, '"
|
||||
+ "WHERE CurrencyRate IS NULL OR CurrencyRate=0"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
if (no != 0)
|
||||
log.info ("doIt - No Rate=" + no);
|
||||
|
||||
// Set Period
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET C_Period_ID=(SELECT p.C_Period_ID FROM C_Period p"
|
||||
+ " INNER JOIN C_Year y ON (y.C_Year_ID=p.C_Year_ID)"
|
||||
+ " INNER JOIN AD_ClientInfo c ON (c.C_Calendar_ID=y.C_Calendar_ID)"
|
||||
+ " WHERE c.AD_Client_ID=i.AD_Client_ID"
|
||||
+ " AND i.DateAcct BETWEEN p.StartDate AND p.EndDate AND p.PeriodType='S' AND ROWNUM=1) "
|
||||
+ "WHERE C_Period_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Set Period=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Period, '"
|
||||
+ "WHERE C_Period_ID IS NULL OR C_Period_ID<>"
|
||||
+ "(SELECT C_Period_ID FROM C_Period p"
|
||||
+ " INNER JOIN C_Year y ON (y.C_Year_ID=p.C_Year_ID)"
|
||||
+ " INNER JOIN AD_ClientInfo c ON (c.C_Calendar_ID=y.C_Calendar_ID) "
|
||||
+ " WHERE c.AD_Client_ID=i.AD_Client_ID"
|
||||
+ " AND i.DateAcct BETWEEN p.StartDate AND p.EndDate AND p.PeriodType='S' AND ROWNUM=1)"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
if (no != 0)
|
||||
log.info ("doIt - Invalid Period=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET I_ErrorMsg=I_ErrorMsg||'WARN=Period Closed, ' "
|
||||
+ "WHERE C_Period_ID IS NOT NULL AND NOT EXISTS"
|
||||
+ " (SELECT * FROM C_PeriodControl pc WHERE pc.C_Period_ID=i.C_Period_ID AND DocBaseType='GLJ' AND PeriodStatus='O') "
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
if (no != 0)
|
||||
log.info ("doIt - Period Closed=" + no);
|
||||
|
||||
// Posting Type
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET PostingType='A' "
|
||||
+ "WHERE PostingType IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Set Actual PostingType=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid PostingType, ' "
|
||||
+ "WHERE PostingType IS NULL OR NOT EXISTS"
|
||||
+ " (SELECT * FROM AD_Ref_List r WHERE r.AD_Reference_ID=125 AND i.PostingType=r.Value)"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
if (no != 0)
|
||||
log.info ("doIt - Invalid PostingTypee=" + no);
|
||||
|
||||
|
||||
// ** Account Elements (optional) **
|
||||
// (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0)
|
||||
|
||||
// Set Org from Name
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET AD_Org_ID=(SELECT o.AD_Org_ID FROM AD_Org o"
|
||||
+ " WHERE o.Value=i.OrgValue AND o.IsSummary='N' AND i.AD_Client_ID=o.AD_Client_ID) "
|
||||
+ "WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0) AND OrgValue IS NOT NULL"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'");
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Set Org from Value=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET AD_Org_ID=AD_OrgDoc_ID "
|
||||
+ "WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0) AND OrgValue IS NULL AND AD_OrgDoc_ID IS NOT NULL AND AD_OrgDoc_ID<>0"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Set Org from Doc Org=" + no);
|
||||
// Error Org
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal o "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '"
|
||||
+ "WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0"
|
||||
+ " OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
if (no != 0)
|
||||
log.info ("doIt - Invalid Org=" + no);
|
||||
|
||||
// Set Account
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET Account_ID=(SELECT ev.C_ElementValue_ID FROM C_ElementValue ev"
|
||||
+ " INNER JOIN C_Element e ON (e.C_Element_ID=ev.C_Element_ID)"
|
||||
+ " INNER JOIN C_AcctSchema_Element ase ON (e.C_Element_ID=ase.C_Element_ID AND ase.ElementType='AC')"
|
||||
+ " WHERE ev.Value=i.AccountValue AND ev.IsSummary='N'"
|
||||
+ " AND i.C_AcctSchema_ID=ase.C_AcctSchema_ID AND i.AD_Client_ID=ev.AD_Client_ID AND ROWNUM=1) "
|
||||
+ "WHERE Account_ID IS NULL AND AccountValue IS NOT NULL"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Set Account from Value=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Account, '"
|
||||
+ "WHERE (Account_ID IS NULL OR Account_ID=0)"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
if (no != 0)
|
||||
log.info ("doIt - Invalid Account=" + no);
|
||||
|
||||
// Set BPartner
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET C_BPartner_ID=(SELECT bp.C_BPartner_ID FROM C_BPartner bp"
|
||||
+ " WHERE bp.Value=i.BPartnerValue AND bp.IsSummary='N' AND i.AD_Client_ID=bp.AD_Client_ID) "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Set BPartner from Value=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid BPartner, '"
|
||||
+ "WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
if (no != 0)
|
||||
log.info ("doIt - Invalid BPartner=" + no);
|
||||
|
||||
// Set Product
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET M_Product_ID=(SELECT p.M_Product_ID FROM M_Product p"
|
||||
+ " WHERE (p.Value=i.ProductValue OR p.UPC=i.UPC OR p.SKU=i.SKU)"
|
||||
+ " AND p.IsSummary='N' AND i.AD_Client_ID=p.AD_Client_ID AND ROWNUM=1) "
|
||||
+ "WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL OR UPC IS NOT NULL OR SKU IS NOT NULL)"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Set Product from Value=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Product, '"
|
||||
+ "WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL OR UPC IS NOT NULL OR SKU IS NOT NULL)"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
if (no != 0)
|
||||
log.info ("doIt - Invalid Product=" + no);
|
||||
|
||||
// Set Project
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET C_Project_ID=(SELECT p.C_Project_ID FROM C_Project p"
|
||||
+ " WHERE p.Value=i.ProjectValue AND p.IsSummary='N' AND i.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE C_Project_ID IS NULL AND ProjectValue IS NOT NULL"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Set Project from Value=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Project, '"
|
||||
+ "WHERE C_Project_ID IS NULL AND ProjectValue IS NOT NULL"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
if (no != 0)
|
||||
log.info ("doIt - Invalid Project=" + no);
|
||||
|
||||
// Set TrxOrg
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET AD_OrgTrx_ID=(SELECT o.AD_Org_ID FROM AD_Org o"
|
||||
+ " WHERE o.Value=i.OrgValue AND o.IsSummary='N' AND i.AD_Client_ID=o.AD_Client_ID) "
|
||||
+ "WHERE AD_OrgTrx_ID IS NULL AND OrgTrxValue IS NOT NULL"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Set OrgTrx from Value=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid OrgTrx, '"
|
||||
+ "WHERE AD_OrgTrx_ID IS NULL AND OrgTrxValue IS NOT NULL"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
if (no != 0)
|
||||
log.info ("doIt - Invalid OrgTrx=" + no);
|
||||
|
||||
|
||||
// Source Amounts
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal "
|
||||
+ "SET AmtSourceDr = 0 "
|
||||
+ "WHERE AmtSourceDr IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),null);
|
||||
log.info ("doIt - Set 0 Source Dr=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal "
|
||||
+ "SET AmtSourceCr = 0 "
|
||||
+ "WHERE AmtSourceCr IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Set 0 Source Cr=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET I_ErrorMsg=I_ErrorMsg||'WARN=Zero Source Balance, ' "
|
||||
+ "WHERE (AmtSourceDr-AmtSourceCr)=0"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
if (no != 0)
|
||||
log.info ("doIt - Zero Source Balance=" + no);
|
||||
|
||||
// Accounted Amounts (Only if No Error)
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal "
|
||||
+ "SET AmtAcctDr = ROUND(AmtSourceDr * CurrencyRate, 2) " // HARDCODED rounding
|
||||
+ "WHERE AmtAcctDr IS NULL OR AmtAcctDr=0"
|
||||
+ " AND I_IsImported='N'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Calculate Acct Dr=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal "
|
||||
+ "SET AmtAcctCr = ROUND(AmtSourceCr * CurrencyRate, 2) "
|
||||
+ "WHERE AmtAcctCr IS NULL OR AmtAcctCr=0"
|
||||
+ " AND I_IsImported='N'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
log.info ("doIt - Calculate Acct Cr=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET I_ErrorMsg=I_ErrorMsg||'WARN=Zero Acct Balance, ' "
|
||||
+ "WHERE (AmtSourceDr-AmtSourceCr)<>0 AND (AmtAcctDr-AmtAcctCr)=0"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
if (no != 0)
|
||||
log.info ("doIt - Zero Acct Balance=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal i "
|
||||
+ "SET I_ErrorMsg=I_ErrorMsg||'WARN=Check Acct Balance, ' "
|
||||
+ "WHERE ABS(AmtAcctDr-AmtAcctCr)>100000000" // 100 mio
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (),get_TrxName());
|
||||
if (no != 0)
|
||||
log.info ("doIt - Chack Acct Balance=" + no);
|
||||
|
||||
|
||||
/*********************************************************************/
|
||||
|
||||
// Get Balance
|
||||
sql = new StringBuffer ("SELECT SUM(AmtSourceDr)-SUM(AmtSourceCr), SUM(AmtAcctDr)-SUM(AmtAcctCr) "
|
||||
+ "FROM I_FAJournal "
|
||||
+ "WHERE I_IsImported='N'").append (clientCheck);
|
||||
pstmt = null;
|
||||
try
|
||||
{
|
||||
pstmt = DB.prepareStatement (sql.toString(),get_TrxName());
|
||||
rs = pstmt.executeQuery ();
|
||||
if (rs.next ())
|
||||
{
|
||||
BigDecimal source = rs.getBigDecimal(1);
|
||||
BigDecimal acct = rs.getBigDecimal(2);
|
||||
if (source != null && source.compareTo(Env.ZERO) == 0
|
||||
&& acct != null && acct.compareTo(Env.ZERO) == 0)
|
||||
log.info ("doIt - Import Balance = 0");
|
||||
else
|
||||
log.info("doIt - Balance Source=" + source + ", Acct=" + acct);
|
||||
if (source != null)
|
||||
addLog (0, null, source, "@AmtSourceDr@ - @AmtSourceCr@");
|
||||
if (acct != null)
|
||||
addLog (0, null, acct, "@AmtAcctDr@- @AmtAcctCr@");
|
||||
}
|
||||
}
|
||||
catch (SQLException ex)
|
||||
{
|
||||
log.info ("doIt - get balance"+ ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
}
|
||||
|
||||
// Count Errors
|
||||
int errors = DB.getSQLValue(get_TrxName(), "SELECT COUNT(*) FROM I_FAJournal WHERE I_IsImported NOT IN ('Y','N')" + clientCheck);
|
||||
|
||||
if (errors != 0)
|
||||
{
|
||||
if (m_IsValidateOnly || m_IsImportOnlyNoErrors)
|
||||
throw new Exception ("@Errors@=" + errors);
|
||||
}
|
||||
else if (m_IsValidateOnly)
|
||||
return "@Errors@=" + errors;
|
||||
|
||||
log.info("doIt - Validation Errors=" + errors);
|
||||
|
||||
/*********************************************************************/
|
||||
|
||||
int noInsert = 0;
|
||||
int noInsertJournal = 0;
|
||||
int noInsertLine = 0;
|
||||
//int oldA_Asset_Id = 0;
|
||||
|
||||
MJournalBatch batch = null; // Change Batch per Batch DocumentNo
|
||||
String BatchDocumentNo = "";
|
||||
MJournal journal = null;
|
||||
String JournalDocumentNo = "";
|
||||
Timestamp DateAcct = null;
|
||||
|
||||
// Go through Journal Records
|
||||
sql = new StringBuffer ("SELECT * FROM I_FAJournal "
|
||||
+ "WHERE I_IsImported='N'").append (clientCheck)
|
||||
.append(" ORDER BY BatchDocumentNo, JournalDocumentNo, C_AcctSchema_ID, PostingType, C_DocType_ID, GL_Category_ID, C_Currency_ID, TRUNC(DateAcct), Line, I_FAJournal_ID");
|
||||
try
|
||||
{
|
||||
pstmt = DB.prepareStatement (sql.toString (),get_TrxName());
|
||||
rs = pstmt.executeQuery ();
|
||||
//
|
||||
while (rs.next())
|
||||
{
|
||||
MXIFAJournal imp = new MXIFAJournal (getCtx (), rs, get_TrxName());
|
||||
|
||||
// Batch
|
||||
String impBatchDocumentNo = imp.getBatchDocumentNo();
|
||||
if (impBatchDocumentNo == null)
|
||||
impBatchDocumentNo = "";
|
||||
if (batch == null || !BatchDocumentNo.equals(impBatchDocumentNo))
|
||||
{
|
||||
BatchDocumentNo = impBatchDocumentNo; // cannot compare real DocumentNo
|
||||
batch = new MJournalBatch (getCtx(), 0, get_TrxName());
|
||||
batch.setClientOrg(imp.getAD_Client_ID(), imp.getAD_OrgDoc_ID());
|
||||
if (imp.getBatchDocumentNo() != null && imp.getBatchDocumentNo().length() > 0)
|
||||
batch.setDocumentNo (imp.getBatchDocumentNo());
|
||||
batch.setC_DocType_ID(imp.getC_DocType_ID());
|
||||
batch.setDateDoc(imp.getDateAcct());
|
||||
batch.setDateAcct(imp.getDateAcct());
|
||||
batch.setGL_Category_ID(imp.getGL_Category_ID());
|
||||
batch.setC_Period_ID(imp.getC_Period_ID());
|
||||
batch.setC_Currency_ID(imp.getC_Currency_ID());
|
||||
String description = imp.getBatchDescription();
|
||||
if (description == null || description.length() == 0)
|
||||
description = "*Import-";
|
||||
else
|
||||
description += " *Import-";
|
||||
description += new Timestamp(System.currentTimeMillis());
|
||||
batch.setDescription(description);
|
||||
if (!batch.save())
|
||||
{
|
||||
log.info("doIt - Batch not saved");
|
||||
break;
|
||||
}
|
||||
noInsert++;
|
||||
journal = null;
|
||||
}
|
||||
// Journal
|
||||
String impJournalDocumentNo = imp.getJournalDocumentNo();
|
||||
if (impJournalDocumentNo == null)
|
||||
impJournalDocumentNo = "";
|
||||
Timestamp impDateAcct = TimeUtil.getDay(imp.getDateAcct());
|
||||
if (journal == null || !JournalDocumentNo.equals(impJournalDocumentNo)
|
||||
|| journal.getC_AcctSchema_ID() != imp.getC_AcctSchema_ID()
|
||||
|| journal.getC_DocType_ID() != imp.getC_DocType_ID()
|
||||
|| journal.getGL_Category_ID() != imp.getGL_Category_ID()
|
||||
|| !journal.getPostingType().equals(imp.getPostingType())
|
||||
|| journal.getC_Currency_ID() != imp.getC_Currency_ID()
|
||||
|| !impDateAcct.equals(DateAcct)
|
||||
)
|
||||
{
|
||||
JournalDocumentNo = impJournalDocumentNo; // cannot compare real DocumentNo
|
||||
DateAcct = impDateAcct;
|
||||
journal = new MJournal (getCtx(), 0, get_TrxName());
|
||||
journal.setGL_JournalBatch_ID(batch.getGL_JournalBatch_ID());
|
||||
journal.setClientOrg(imp.getAD_Client_ID(), imp.getAD_OrgDoc_ID());
|
||||
//
|
||||
String description = imp.getBatchDescription();
|
||||
if (description == null || description.length() == 0)
|
||||
description = "(Import)";
|
||||
journal.setDescription (description);
|
||||
if (imp.getJournalDocumentNo() != null && imp.getJournalDocumentNo().length() > 0)
|
||||
journal.setDocumentNo (imp.getJournalDocumentNo());
|
||||
//
|
||||
journal.setC_AcctSchema_ID (imp.getC_AcctSchema_ID());
|
||||
journal.setC_DocType_ID (imp.getC_DocType_ID());
|
||||
journal.setGL_Category_ID (imp.getGL_Category_ID());
|
||||
journal.setPostingType (imp.getPostingType());
|
||||
journal.setC_ConversionType_ID (imp.getC_ConversionType_ID());
|
||||
//
|
||||
journal.setCurrency (imp.getC_Currency_ID(), imp.getC_ConversionType_ID(), imp.getCurrencyRate());
|
||||
//
|
||||
journal.setC_Period_ID(imp.getC_Period_ID());
|
||||
journal.setDateAcct(imp.getDateAcct()); // sets Period if not defined
|
||||
journal.setDateDoc (imp.getDateAcct());
|
||||
//
|
||||
if (!journal.save())
|
||||
{
|
||||
log.info("doIt - Journal not saved");
|
||||
break;
|
||||
}
|
||||
noInsertJournal++;
|
||||
}
|
||||
|
||||
// Lines
|
||||
MJournalLine line = new MJournalLine (journal);
|
||||
//
|
||||
line.setDescription(imp.getDescription());
|
||||
line.setCurrency (imp.getC_Currency_ID(), imp.getC_ConversionType_ID(), imp.getCurrencyRate());
|
||||
// Set/Get Account Combination
|
||||
if (imp.getC_ValidCombination_ID() == 0)
|
||||
{
|
||||
MAccount acct = MAccount.get(getCtx(), imp.getAD_Client_ID(), imp.getAD_Org_ID(),
|
||||
imp.getC_AcctSchema_ID(), imp.getAccount_ID(),imp.getC_SubAcct_ID(),
|
||||
//imp.getC_AcctSchema_ID(), imp.getAccount_ID(),
|
||||
imp.getM_Product_ID(), imp.getC_BPartner_ID(), imp.getAD_OrgTrx_ID(),
|
||||
imp.getC_LocFrom_ID(), imp.getC_LocTo_ID(), imp.getC_SalesRegion_ID(),
|
||||
imp.getC_Project_ID(), imp.getC_Campaign_ID(), imp.getC_Activity_ID(),
|
||||
imp.getUser1_ID(), imp.getUser2_ID(),imp.getUserElement1_ID(),imp.getUserElement2_ID());
|
||||
//imp.getUser1_ID(), imp.getUser2_ID());
|
||||
if (acct != null && acct.get_ID() == 0)
|
||||
acct.saveEx();
|
||||
if (acct == null || acct.get_ID() == 0)
|
||||
{
|
||||
imp.setI_ErrorMsg("ERROR creating Account");
|
||||
imp.setI_IsImported(false);
|
||||
imp.saveEx();
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
line.setC_ValidCombination_ID(acct.get_ID());
|
||||
imp.setC_ValidCombination_ID(acct.get_ID());
|
||||
}
|
||||
}
|
||||
else
|
||||
line.setC_ValidCombination_ID (imp.getC_ValidCombination_ID());
|
||||
//
|
||||
line.setLine (imp.getLine());
|
||||
line.setAmtSourceCr (imp.getAmtSourceCr());
|
||||
line.setAmtSourceDr (imp.getAmtSourceDr());
|
||||
line.setAmtAcct (imp.getAmtAcctDr(), imp.getAmtAcctCr());
|
||||
line.setDateAcct (imp.getDateAcct());
|
||||
//
|
||||
line.setC_UOM_ID(imp.getC_UOM_ID());
|
||||
line.setQty(imp.getQty());
|
||||
//
|
||||
if (line.save())
|
||||
{
|
||||
imp.setGL_JournalBatch_ID(batch.getGL_JournalBatch_ID());
|
||||
imp.setGL_Journal_ID(journal.getGL_Journal_ID());
|
||||
imp.setGL_JournalLine_ID(line.getGL_JournalLine_ID());
|
||||
imp.setI_IsImported(true);
|
||||
imp.setProcessed(true);
|
||||
sql = new StringBuffer ("UPDATE A_DEPRECIATION_WORKFILE "
|
||||
+"SET A_ACCUMULATED_DEPR = A_ACCUMULATED_DEPR + ")
|
||||
.append(imp.getExpenseDr()).append(" - ").append(imp.getExpenseCr())
|
||||
.append(", A_PERIOD_POSTED = A_CURRENT_PERIOD")
|
||||
.append(", ASSETDEPRECIATIONDATE = ").append (DB.TO_DATE(imp.getDateAcct()))
|
||||
.append(" WHERE A_ASSET_ID = ").append(imp.getA_Asset_ID())
|
||||
.append(" AND ISACTIVE = '").append(imp.getIsDepreciated())
|
||||
.append("' AND POSTINGTYPE = '").append(imp.getPostingType())
|
||||
.append("'");
|
||||
no = DB.executeUpdate(sql.toString(),get_TrxName());
|
||||
log.info("doIt - SET Accumulated Depreciation =" + no);
|
||||
|
||||
// Copy Expense Worktable to Import Worktable
|
||||
String impgetIsDepreciated = imp.getIsDepreciated();
|
||||
//impgetIsDepreciated = impgetIsDepreciated + "STOP";
|
||||
|
||||
if(impgetIsDepreciated.equals("Y"))
|
||||
{
|
||||
cs = DB.prepareCall("{call AD_Sequence_Next(?,?,?)}");
|
||||
cs.setString(1, "A_Asset_Change");
|
||||
cs.setInt(2,imp.getAD_Client_ID());
|
||||
cs.registerOutParameter(3, java.sql.Types.INTEGER);
|
||||
cs.execute();
|
||||
|
||||
|
||||
MAssetChange assetChange = new MAssetChange (getCtx(), 0, get_TrxName());
|
||||
assetChange.setA_Asset_Change_ID(cs.getInt(3));
|
||||
assetChange.set_ValueOfColumn("AD_CLIENT_ID", imp.getAD_Client_ID());
|
||||
assetChange.setAD_Org_ID(imp.getAD_OrgDoc_ID());
|
||||
assetChange.set_ValueOfColumn("CREATEDBY", getAD_User_ID());
|
||||
assetChange.set_ValueOfColumn("UPDATEDBY", getAD_User_ID());
|
||||
assetChange.setChangeType("DEP");
|
||||
assetChange.setChangeAmt(imp.getAmtAcctTotal());
|
||||
assetChange.setA_Asset_ID(imp.getA_Asset_ID());
|
||||
assetChange.setTextDetails(imp.getDescription());
|
||||
assetChange.setC_ValidCombination_ID(imp.getC_ValidCombination_ID());
|
||||
assetChange.setDateAcct(imp.getDateAcct());
|
||||
assetChange.setPostingType(imp.getPostingType());
|
||||
assetChange.saveEx();
|
||||
|
||||
}
|
||||
else if(impgetIsDepreciated.equals("B"))
|
||||
{
|
||||
cs = DB.prepareCall("{call AD_Sequence_Next(?,?,?)}");
|
||||
cs.setString(1, "A_Asset_Change");
|
||||
cs.setInt(2,imp.getAD_Client_ID());
|
||||
cs.registerOutParameter(3, java.sql.Types.INTEGER);
|
||||
cs.execute();
|
||||
|
||||
MAssetChange assetChange = new MAssetChange (getCtx(), 0, get_TrxName());
|
||||
assetChange.setA_Asset_Change_ID(cs.getInt(3));
|
||||
assetChange.set_ValueOfColumn("AD_CLIENT_ID", imp.getAD_Client_ID());
|
||||
assetChange.setAD_Org_ID(imp.getAD_OrgDoc_ID());
|
||||
assetChange.set_ValueOfColumn("CREATEDBY", getAD_User_ID());
|
||||
assetChange.set_ValueOfColumn("UPDATEDBY", getAD_User_ID());
|
||||
assetChange.setChangeType("BUD");
|
||||
assetChange.setChangeAmt(imp.getAmtAcctTotal());
|
||||
assetChange.setA_Asset_ID(imp.getA_Asset_ID());
|
||||
assetChange.setTextDetails(imp.getDescription());
|
||||
assetChange.setC_ValidCombination_ID(imp.getC_ValidCombination_ID());
|
||||
assetChange.setDateAcct(imp.getDateAcct());
|
||||
assetChange.setPostingType(imp.getPostingType());
|
||||
assetChange.saveEx();
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (imp.save())
|
||||
noInsertLine++;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.severe("doIt"+ e);
|
||||
}
|
||||
// clean up
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
}
|
||||
|
||||
// Set Error to indicator to not imported
|
||||
sql = new StringBuffer ("UPDATE I_FAJournal "
|
||||
+ "SET I_IsImported='N', Updated=SysDate "
|
||||
+ "WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(),get_TrxName());
|
||||
addLog (0, null, new BigDecimal (no), "@Errors@");
|
||||
//
|
||||
addLog (0, null, new BigDecimal (noInsert), "@GL_JournalBatch_ID@: @Inserted@");
|
||||
addLog (0, null, new BigDecimal (noInsertJournal), "@GL_Journal_ID@: @Inserted@");
|
||||
addLog (0, null, new BigDecimal (noInsertLine), "@GL_JournalLine_ID@: @Inserted@");
|
||||
//int test = DB.getSQLValue("SELECT 2*2 from dual");
|
||||
|
||||
|
||||
String sql3 = null;
|
||||
|
||||
sql3 = "SELECT A_ASSET.A_ASSET_ID, A_ASSET.ISFULLYDEPRECIATED, A_DEPRECIATION_WORKFILE.A_PERIOD_POSTED, "
|
||||
+ "A_DEPRECIATION_WORKFILE.A_LIFE_PERIOD "
|
||||
+ "FROM A_DEPRECIATION_WORKFILE,A_ASSET "
|
||||
+ "WHERE A_ASSET.A_ASSET_ID = A_DEPRECIATION_WORKFILE.A_ASSET_ID "
|
||||
+ "AND A_DEPRECIATION_WORKFILE.A_PERIOD_POSTED = A_DEPRECIATION_WORKFILE.A_LIFE_PERIOD ";
|
||||
|
||||
try
|
||||
{
|
||||
pstmt = DB.prepareStatement(sql3,get_TrxName());
|
||||
rs = pstmt.executeQuery();
|
||||
while (rs.next()){
|
||||
|
||||
String sql4 = "UPDATE A_ASSET SET ISFULLYDEPRECIATED = 'Y' WHERE A_Asset_ID = " + rs.getInt("A_ASSET_ID");
|
||||
no = DB.executeUpdate (sql4,get_TrxName());
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.info("Post Depreciation"+ e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
}
|
||||
return "";
|
||||
} // doIt
|
||||
|
||||
} // ImportFAJournal2
|
|
@ -0,0 +1,180 @@
|
|||
package org.compiere.acct;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.compiere.model.I_C_Project;
|
||||
import org.compiere.model.I_C_Project_Acct;
|
||||
import org.compiere.model.MAccount;
|
||||
import org.compiere.model.MAcctSchema;
|
||||
import org.compiere.model.MAssetAcct;
|
||||
import org.compiere.model.MAssetAddition;
|
||||
import org.compiere.model.MCharge;
|
||||
import org.compiere.model.MDocType;
|
||||
import org.compiere.model.MProject;
|
||||
import org.compiere.model.ProductCost;
|
||||
import org.compiere.model.X_C_Project_Acct;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
|
||||
|
||||
/**
|
||||
* @author Teo_Sarca, SC ARHIPAC SERVICE SRL
|
||||
*/
|
||||
public class Doc_AssetAddition extends Doc
|
||||
{
|
||||
public Doc_AssetAddition (MAcctSchema as, ResultSet rs, String trxName)
|
||||
{
|
||||
super(as, MAssetAddition.class, rs, MDocType.DOCBASETYPE_GLDocument, trxName);
|
||||
}
|
||||
|
||||
|
||||
protected String loadDocumentDetails()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public BigDecimal getBalance()
|
||||
{
|
||||
return Env.ZERO;
|
||||
}
|
||||
|
||||
/**
|
||||
* Produce inregistrarea:
|
||||
* <pre>
|
||||
* 20.., 21..[A_Asset_Acct] = 23..[P_Asset_Acct/Project Acct]
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
public ArrayList<Fact> createFacts(MAcctSchema as)
|
||||
{
|
||||
MAssetAddition assetAdd = getAssetAddition();
|
||||
ArrayList<Fact> facts = new ArrayList<Fact>();
|
||||
Fact fact = new Fact(this, as, assetAdd.getPostingType());
|
||||
facts.add(fact);
|
||||
//
|
||||
if (MAssetAddition.A_SOURCETYPE_Imported.equals(assetAdd.getA_SourceType())
|
||||
|| MAssetAddition.A_CAPVSEXP_Expense.equals(assetAdd.getA_CapvsExp())) //@win prevent create journal if expense addition
|
||||
{
|
||||
// no accounting if is imported record
|
||||
return facts;
|
||||
}
|
||||
//
|
||||
BigDecimal assetValueAmt = assetAdd.getAssetValueAmt();
|
||||
FactLine[] fls = FactUtil.createSimpleOperation(fact, null,
|
||||
getA_Asset_Acct(), getP_Asset_Acct(as),
|
||||
as.getC_Currency_ID(),
|
||||
assetValueAmt,
|
||||
false);
|
||||
// Set BPartner and C_Project dimension for "Imobilizari in curs / Property Being"
|
||||
final int invoiceBP_ID = getInvoicePartner_ID();
|
||||
final int invoiceProject_ID = getInvoiceProject_ID();
|
||||
if (invoiceBP_ID > 0)
|
||||
{
|
||||
fls[1].setC_BPartner_ID(invoiceBP_ID);
|
||||
}
|
||||
if (invoiceProject_ID >0)
|
||||
{
|
||||
fls[1].setC_Project_ID(invoiceProject_ID);
|
||||
}
|
||||
//
|
||||
return facts;
|
||||
}
|
||||
|
||||
private MAssetAddition getAssetAddition()
|
||||
{
|
||||
return (MAssetAddition)getPO();
|
||||
}
|
||||
|
||||
private MAccount getP_Asset_Acct(MAcctSchema as)
|
||||
{
|
||||
MAssetAddition assetAdd = getAssetAddition();
|
||||
// Source Account
|
||||
MAccount pAssetAcct = null;
|
||||
if (MAssetAddition.A_SOURCETYPE_Project.equals(assetAdd.getA_SourceType()))
|
||||
{
|
||||
I_C_Project prj = assetAdd.getC_Project();
|
||||
return getProjectAcct(prj, as);
|
||||
}
|
||||
else if (MAssetAddition.A_SOURCETYPE_Manual.equals(assetAdd.getA_SourceType())
|
||||
&& getC_Charge_ID() > 0) // backward compatibility: only if charge defined; if not fallback to product account
|
||||
{
|
||||
pAssetAcct = MCharge.getAccount(getC_Charge_ID(), as, null);
|
||||
return pAssetAcct;
|
||||
}
|
||||
else if (MAssetAddition.A_SOURCETYPE_Invoice.equals(assetAdd.getA_SourceType())
|
||||
&& assetAdd.getC_InvoiceLine().getC_Project_ID() > 0)
|
||||
{
|
||||
I_C_Project prj = assetAdd.getC_InvoiceLine().getC_Project();
|
||||
return getProjectAcct(prj, as);
|
||||
}
|
||||
else
|
||||
{
|
||||
pAssetAcct = getP_Expense_Acct(assetAdd.getM_Product_ID(), as);
|
||||
}
|
||||
//
|
||||
return pAssetAcct;
|
||||
}
|
||||
|
||||
public MAccount getP_Expense_Acct(int M_Product_ID, MAcctSchema as)
|
||||
{
|
||||
ProductCost pc = new ProductCost(getCtx(), M_Product_ID, 0, null);
|
||||
return pc.getAccount(ProductCost.ACCTTYPE_P_Expense, as);
|
||||
}
|
||||
|
||||
|
||||
private MAccount getProjectAcct(I_C_Project prj, MAcctSchema as)
|
||||
{
|
||||
// TODO: keep in sync with org.compiere.acct.Doc_ProjectIssue.createFacts(MAcctSchema) logic
|
||||
String projectCategory = prj.getProjectCategory();
|
||||
String acctName = X_C_Project_Acct.COLUMNNAME_PJ_WIP_Acct;
|
||||
if (MProject.PROJECTCATEGORY_AssetProject.equals(projectCategory))
|
||||
acctName = X_C_Project_Acct.COLUMNNAME_PJ_Asset_Acct;
|
||||
//
|
||||
String sql = "SELECT "+acctName
|
||||
+ " FROM "+I_C_Project_Acct.Table_Name
|
||||
+ " WHERE "+I_C_Project_Acct.COLUMNNAME_C_Project_ID+"=?"
|
||||
+" AND "+I_C_Project_Acct.COLUMNNAME_C_AcctSchema_ID+"=?"
|
||||
;
|
||||
int acct_id = DB.getSQLValueEx(getTrxName(), sql, prj.getC_Project_ID(), as.get_ID());
|
||||
return MAccount.get(getCtx(), acct_id);
|
||||
}
|
||||
|
||||
private MAccount getA_Asset_Acct()
|
||||
{
|
||||
MAssetAddition assetAdd = getAssetAddition();
|
||||
int acct_id = MAssetAcct
|
||||
.forA_Asset_ID(getCtx(), assetAdd.getA_Asset_ID(), assetAdd.getPostingType(), assetAdd.getDateAcct(), null)
|
||||
.getA_Asset_Acct();
|
||||
return MAccount.get(getCtx(), acct_id);
|
||||
}
|
||||
|
||||
public int getInvoicePartner_ID()
|
||||
{
|
||||
MAssetAddition assetAdd = getAssetAddition();
|
||||
if (MAssetAddition.A_SOURCETYPE_Invoice.equals(assetAdd.getA_SourceType())
|
||||
&& assetAdd.getC_Invoice_ID() > 0)
|
||||
{
|
||||
return assetAdd.getC_Invoice().getC_BPartner_ID();
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
public int getInvoiceProject_ID()
|
||||
{
|
||||
MAssetAddition assetAdd = getAssetAddition();
|
||||
if (MAssetAddition.A_SOURCETYPE_Invoice.equals(assetAdd.getA_SourceType())
|
||||
&& assetAdd.getC_Invoice_ID() > 0)
|
||||
{
|
||||
return assetAdd.getC_InvoiceLine().getC_Project_ID();
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package org.compiere.acct;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.compiere.model.MAccount;
|
||||
import org.compiere.model.MAcctSchema;
|
||||
import org.compiere.model.MAssetAcct;
|
||||
import org.compiere.model.MAssetDisposed;
|
||||
import org.compiere.model.MDocType;
|
||||
import org.compiere.util.Env;
|
||||
|
||||
|
||||
/**
|
||||
* @author Teo_Sarca, SC ARHIPAC SERVICE SRL
|
||||
*/
|
||||
public class Doc_AssetDisposed extends Doc
|
||||
{
|
||||
/**
|
||||
* @param ass
|
||||
* @param clazz
|
||||
* @param rs
|
||||
* @param defaultDocumentType
|
||||
* @param trxName
|
||||
*/
|
||||
public Doc_AssetDisposed (MAcctSchema as, ResultSet rs, String trxName)
|
||||
{
|
||||
super(as, MAssetDisposed.class, rs, MDocType.DOCBASETYPE_GLDocument, trxName);
|
||||
}
|
||||
|
||||
|
||||
protected String loadDocumentDetails()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public BigDecimal getBalance()
|
||||
{
|
||||
return Env.ZERO;
|
||||
}
|
||||
|
||||
|
||||
public ArrayList<Fact> createFacts(MAcctSchema as)
|
||||
{
|
||||
MAssetDisposed assetDisp = (MAssetDisposed)getPO();
|
||||
|
||||
ArrayList<Fact> facts = new ArrayList<Fact>();
|
||||
Fact fact = new Fact(this, as, assetDisp.getPostingType());
|
||||
facts.add(fact);
|
||||
//
|
||||
fact.createLine(null, getAccount(MAssetAcct.COLUMNNAME_A_Asset_Acct)
|
||||
, as.getC_Currency_ID()
|
||||
, Env.ZERO, assetDisp.getA_Disposal_Amt());
|
||||
fact.createLine(null, getAccount(MAssetAcct.COLUMNNAME_A_Accumdepreciation_Acct)
|
||||
, as.getC_Currency_ID()
|
||||
, assetDisp.getA_Accumulated_Depr_Delta(), Env.ZERO);
|
||||
fact.createLine(null, getAccount(MAssetAcct.COLUMNNAME_A_Disposal_Loss_Acct)
|
||||
, as.getC_Currency_ID()
|
||||
, assetDisp.getExpense(), Env.ZERO);
|
||||
//
|
||||
return facts;
|
||||
}
|
||||
|
||||
private MAccount getAccount(String accountName)
|
||||
{
|
||||
MAssetDisposed assetDisp = (MAssetDisposed)getPO();
|
||||
MAssetAcct assetAcct = MAssetAcct.forA_Asset_ID(getCtx(), assetDisp.getA_Asset_ID(), assetDisp.getPostingType(), assetDisp.getDateAcct(),null);
|
||||
int account_id = (Integer)assetAcct.get_Value(accountName);
|
||||
return MAccount.get(getCtx(), account_id);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
package org.compiere.acct;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.compiere.model.MAccount;
|
||||
import org.compiere.model.MAcctSchema;
|
||||
import org.compiere.model.MAssetAcct;
|
||||
import org.compiere.model.MAssetReval;
|
||||
import org.compiere.model.MDocType;
|
||||
import org.compiere.util.Env;
|
||||
|
||||
|
||||
/**
|
||||
* @author Anca Bradau www.arhipac.ro
|
||||
*
|
||||
*/
|
||||
public class Doc_AssetReval extends Doc
|
||||
{
|
||||
|
||||
|
||||
private final String POSTINGTYPE_Actual = "A";
|
||||
public Doc_AssetReval (MAcctSchema as, ResultSet rs, String trxName)
|
||||
{
|
||||
super(as, MAssetReval.class, rs, MDocType.DOCBASETYPE_GLJournal, trxName);
|
||||
}
|
||||
|
||||
|
||||
public ArrayList<Fact> createFacts(MAcctSchema as)
|
||||
{
|
||||
MAssetAcct assetAcct = getAssetAcct();
|
||||
MAssetReval assetRe = getAssetReval();
|
||||
|
||||
ArrayList<Fact> facts = new ArrayList<Fact>();
|
||||
Fact fact = new Fact(this, as, assetAcct.getPostingType());
|
||||
facts.add(fact);
|
||||
|
||||
MAccount dr = MAccount.get(getCtx(), assetAcct.getA_Asset_Acct());
|
||||
MAccount cr = MAccount.get(getCtx(), assetAcct.getA_Reval_Cost_Offset_Acct());
|
||||
FactUtil.createSimpleOperation(fact, null, dr, cr, as.getC_Currency_ID(),
|
||||
assetRe.getA_Asset_Cost_Change().subtract(assetRe.getA_Asset_Cost()), false);
|
||||
|
||||
|
||||
MAccount drd = MAccount.get(getCtx(), assetAcct.getA_Reval_Cost_Offset_Acct());
|
||||
MAccount crd = MAccount.get(getCtx(), assetAcct.getA_Accumdepreciation_Acct());
|
||||
FactUtil.createSimpleOperation(fact, null, drd, crd, as.getC_Currency_ID(),
|
||||
assetRe.getA_Change_Acumulated_Depr().subtract(assetRe.getA_Accumulated_Depr()), false);
|
||||
|
||||
|
||||
return facts;
|
||||
}
|
||||
|
||||
|
||||
public BigDecimal getBalance()
|
||||
{
|
||||
return Env.ZERO;
|
||||
}
|
||||
|
||||
|
||||
protected String loadDocumentDetails()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
public String getPostingType()
|
||||
{
|
||||
return POSTINGTYPE_Actual;
|
||||
}
|
||||
|
||||
private MAssetAcct getAssetAcct()
|
||||
{
|
||||
return MAssetAcct.forA_Asset_ID(getCtx(), getA_Asset_ID(), getPostingType() , getDateAcct(), null);
|
||||
}
|
||||
private MAssetReval getAssetReval()
|
||||
{
|
||||
return (MAssetReval)getPO();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get A_Asset_ID
|
||||
* @return Asset
|
||||
*/
|
||||
public int getA_Asset_ID()
|
||||
{
|
||||
int index = p_po.get_ColumnIndex("A_Asset_ID");
|
||||
if (index != -1)
|
||||
{
|
||||
Integer ii = (Integer)p_po.get_Value(index);
|
||||
if (ii != null)
|
||||
return ii.intValue();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
package org.compiere.acct;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.compiere.model.MAccount;
|
||||
import org.compiere.model.MAcctSchema;
|
||||
import org.compiere.model.MAssetTransfer;
|
||||
import org.compiere.model.MDepreciationWorkfile;
|
||||
import org.compiere.model.MDocType;
|
||||
import org.compiere.util.Env;
|
||||
|
||||
|
||||
/**
|
||||
* @author Anca Bradau www.arhipac.ro
|
||||
*
|
||||
*/
|
||||
public class Doc_AssetTransfer extends Doc
|
||||
{
|
||||
|
||||
public Doc_AssetTransfer (MAcctSchema as, ResultSet rs, String trxName)
|
||||
{
|
||||
super(as, MAssetTransfer.class, rs, MDocType.DOCBASETYPE_GLJournal, trxName);
|
||||
}
|
||||
|
||||
|
||||
protected String loadDocumentDetails()
|
||||
{
|
||||
// Fix C_Period_ID
|
||||
// MAssetTransfer assetTr = getAssetTransfer();
|
||||
// assetTr.setC_Period_ID();
|
||||
// assetTr.saveEx();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public BigDecimal getBalance() {
|
||||
return Env.ZERO;
|
||||
}
|
||||
/**
|
||||
* Produce inregistrarea:
|
||||
* <pre>
|
||||
* 20.., 21..[A_Asset_New_Acct] = 23..[A_Asset_Acct]
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
public ArrayList<Fact> createFacts(MAcctSchema as)
|
||||
{
|
||||
MAssetTransfer assetTr = getAssetTransfer();
|
||||
MDepreciationWorkfile wk = getAssetWorkfile();
|
||||
//MDepreciationExp exp = getExpense();
|
||||
|
||||
ArrayList<Fact> facts = new ArrayList<Fact>();
|
||||
Fact fact = new Fact(this, as, assetTr.getPostingType());
|
||||
facts.add(fact);
|
||||
//
|
||||
// Change Asset Account
|
||||
if (assetTr.getA_Asset_New_Acct() != assetTr.getA_Asset_Acct())
|
||||
{
|
||||
MAccount dr = MAccount.get(getCtx(), assetTr.getA_Asset_New_Acct());
|
||||
MAccount cr = MAccount.get(getCtx(), assetTr.getA_Asset_Acct());
|
||||
FactUtil.createSimpleOperation(fact, null, dr, cr, as.getC_Currency_ID(),
|
||||
wk.getA_Asset_Cost(), false);
|
||||
}
|
||||
//
|
||||
// Change Asset Accum. Depr. Account
|
||||
if (assetTr.getA_Accumdepreciation_New_Acct() != assetTr.getA_Accumdepreciation_Acct())
|
||||
{
|
||||
MAccount cr = MAccount.get(getCtx(), assetTr.getA_Accumdepreciation_New_Acct());
|
||||
MAccount dr = MAccount.get(getCtx(), assetTr.getA_Accumdepreciation_Acct());
|
||||
FactUtil.createSimpleOperation(fact, null, dr, cr, as.getC_Currency_ID(),
|
||||
wk.getA_Accumulated_Depr(), false);
|
||||
//exp.getA_Accumulated_Depr(), false);
|
||||
}
|
||||
//
|
||||
return facts;
|
||||
}
|
||||
/*private MDepreciationExp getExpense() {
|
||||
|
||||
return MDepreciationExp.get(getCtx(), 1712112);
|
||||
}*/
|
||||
|
||||
private MAssetTransfer getAssetTransfer()
|
||||
{
|
||||
return (MAssetTransfer)getPO();
|
||||
}
|
||||
private MDepreciationWorkfile getAssetWorkfile()
|
||||
{
|
||||
MAssetTransfer assetTr = getAssetTransfer();
|
||||
return MDepreciationWorkfile.get(getCtx(), assetTr.getA_Asset_ID(), assetTr.getPostingType(), getTrxName());
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,90 @@
|
|||
package org.compiere.acct;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.compiere.model.MAccount;
|
||||
import org.compiere.model.MAcctSchema;
|
||||
import org.compiere.model.MDepreciationEntry;
|
||||
import org.compiere.model.MDepreciationExp;
|
||||
import org.compiere.util.Env;
|
||||
|
||||
|
||||
/**
|
||||
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
||||
* @version $Id$
|
||||
*
|
||||
*/
|
||||
public class Doc_DepreciationEntry extends Doc
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
* @param ass accounting schemata
|
||||
* @param rs record
|
||||
* @parem trxName trx
|
||||
*/
|
||||
public Doc_DepreciationEntry (MAcctSchema as, ResultSet rs, String trxName)
|
||||
{
|
||||
super(as, MDepreciationEntry.class, rs, null, trxName);
|
||||
} // Doc_A_Depreciation_Entry
|
||||
|
||||
/** Posting Type */
|
||||
private String m_PostingType = null;
|
||||
private int m_C_AcctSchema_ID = 0;
|
||||
|
||||
|
||||
protected String loadDocumentDetails ()
|
||||
{
|
||||
MDepreciationEntry entry = (MDepreciationEntry)getPO();
|
||||
m_PostingType = entry.getPostingType();
|
||||
m_C_AcctSchema_ID = entry.getC_AcctSchema_ID();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private DocLine createLine(MDepreciationExp depexp)
|
||||
{
|
||||
if (!depexp.isProcessed())
|
||||
return null;
|
||||
DocLine docLine = new DocLine (depexp, this);
|
||||
return docLine;
|
||||
}
|
||||
|
||||
|
||||
public BigDecimal getBalance()
|
||||
{
|
||||
BigDecimal retValue = Env.ZERO;
|
||||
return retValue;
|
||||
} // getBalance
|
||||
|
||||
|
||||
public ArrayList<Fact> createFacts (MAcctSchema as)
|
||||
{
|
||||
ArrayList<Fact> facts = new ArrayList<Fact>();
|
||||
// Other Acct Schema
|
||||
if (as.getC_AcctSchema_ID() != m_C_AcctSchema_ID)
|
||||
return facts;
|
||||
|
||||
// create Fact Header
|
||||
Fact fact = new Fact (this, as, m_PostingType);
|
||||
|
||||
MDepreciationEntry entry = (MDepreciationEntry)getPO();
|
||||
Iterator<MDepreciationExp> it = entry.getLinesIterator(false);
|
||||
while(it.hasNext())
|
||||
{
|
||||
MDepreciationExp depexp = it.next();
|
||||
DocLine line = createLine(depexp);
|
||||
BigDecimal expenseAmt = depexp.getExpense();
|
||||
//
|
||||
MAccount dr_acct = MAccount.get(getCtx(), depexp.getDR_Account_ID());
|
||||
MAccount cr_acct = MAccount.get(getCtx(), depexp.getCR_Account_ID());
|
||||
FactUtil.createSimpleOperation(fact, line, dr_acct, cr_acct, as.getC_Currency_ID(), expenseAmt, false);
|
||||
}
|
||||
//
|
||||
facts.add(fact);
|
||||
return facts;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.compiere.acct;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.compiere.model.MAccount;
|
||||
|
||||
/**
|
||||
* @author ancu
|
||||
*
|
||||
*/
|
||||
public final class FactUtil
|
||||
{
|
||||
|
||||
/**
|
||||
* Create a simple acct transaction, as fellows:
|
||||
* <pre>
|
||||
* if signSensitive == true then
|
||||
* if amt >= 0
|
||||
* account_DR DR amt
|
||||
* account_CR CR amt
|
||||
* if amt < 0
|
||||
* account_CR DR -amt
|
||||
* account_DR CR -amt
|
||||
* if signSensitive == false then:
|
||||
* account_DR DR amt
|
||||
* account_CR CR -amt
|
||||
* (same as when signSensitive==true and amt>=0)
|
||||
* </pre>
|
||||
* Note:
|
||||
* <ul>
|
||||
* <li>Operation index is automatically incremented
|
||||
* </ul>
|
||||
* @param docLine Document line or null
|
||||
* @param account_DR DR account
|
||||
* @param account_CR CR account
|
||||
* @param C_Currency_ID Currency
|
||||
* @param Amt amount
|
||||
* @param signSensitive if true, the DR and CR account will switch when amount is negative
|
||||
* @return resulting two fact lines
|
||||
* @category arhipac
|
||||
*/
|
||||
public static FactLine[] createSimpleOperation (
|
||||
Fact fact,
|
||||
DocLine docLine,
|
||||
MAccount account_DR, MAccount account_CR,
|
||||
int C_Currency_ID, BigDecimal amt, boolean signSensitive)
|
||||
{
|
||||
FactLine[] lines = new FactLine[2];
|
||||
//newTrxIndex();
|
||||
if (signSensitive) {
|
||||
lines[0] = fact.createLine(docLine, account_DR, C_Currency_ID, amt);
|
||||
lines[1] = fact.createLine(docLine, account_CR, C_Currency_ID, amt.negate());
|
||||
}
|
||||
else {
|
||||
lines[0] = fact.createLine(docLine, account_DR, C_Currency_ID, amt, null);
|
||||
lines[1] = fact.createLine(docLine, account_CR, C_Currency_ID, null, amt);
|
||||
}
|
||||
//newTrxIndex();
|
||||
//
|
||||
return lines;
|
||||
} // createLine
|
||||
}
|
|
@ -94,7 +94,7 @@ public class GridTable extends AbstractTableModel
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 4648364477309024202L;
|
||||
private static final long serialVersionUID = 2328810326636468776L;
|
||||
|
||||
public static final String DATA_REFRESH_MESSAGE = "Refreshed";
|
||||
|
||||
|
@ -2040,10 +2040,12 @@ public class GridTable extends AbstractTableModel
|
|||
//
|
||||
MTable table = MTable.get (m_ctx, m_AD_Table_ID);
|
||||
PO po = null;
|
||||
if (! m_importing) // Just use trx when importing
|
||||
m_trxName = null;
|
||||
if (Record_ID != -1)
|
||||
po = table.getPO(Record_ID, null);
|
||||
po = table.getPO(Record_ID, m_trxName);
|
||||
else // Multi - Key
|
||||
po = table.getPO(getWhereClause(rowData), null);
|
||||
po = table.getPO(getWhereClause(rowData), m_trxName);
|
||||
// No Persistent Object
|
||||
if (po == null)
|
||||
throw new ClassNotFoundException ("No Persistent Object");
|
||||
|
@ -2374,6 +2376,10 @@ public class GridTable extends AbstractTableModel
|
|||
/** LOB Info */
|
||||
private ArrayList<PO_LOB> m_lobInfo = null;
|
||||
|
||||
// IDEMPIERE-454 Easy import
|
||||
private boolean m_importing = false;
|
||||
private String m_trxName = null;
|
||||
|
||||
/**
|
||||
* Reset LOB info
|
||||
*/
|
||||
|
@ -3707,10 +3713,19 @@ public class GridTable extends AbstractTableModel
|
|||
PO po = null;
|
||||
int Record_ID = getKeyID(row);
|
||||
if (Record_ID != -1)
|
||||
po = table.getPO(Record_ID, null);
|
||||
po = table.getPO(Record_ID, m_trxName);
|
||||
else // Multi - Key
|
||||
po = table.getPO(getWhereClause(getDataAtRow(row)), null);
|
||||
po = table.getPO(getWhereClause(getDataAtRow(row)), m_trxName);
|
||||
return po;
|
||||
}
|
||||
|
||||
public void setImportingMode(boolean importing, String trxName) {
|
||||
m_importing = importing;
|
||||
m_trxName = trxName;
|
||||
}
|
||||
|
||||
public boolean isImporting() {
|
||||
return m_importing;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_A_Asset
|
|||
public static final String Table_Name = "A_Asset";
|
||||
|
||||
/** AD_Table_ID=539 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 539;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -41,13 +41,33 @@ public interface I_A_Asset
|
|||
|
||||
/** Load Meta Data */
|
||||
|
||||
/** Column name A_Asset_Action */
|
||||
public static final String COLUMNNAME_A_Asset_Action = "A_Asset_Action";
|
||||
|
||||
/** Set Asset Action */
|
||||
public void setA_Asset_Action (String A_Asset_Action);
|
||||
|
||||
/** Get Asset Action */
|
||||
public String getA_Asset_Action();
|
||||
|
||||
/** Column name A_Asset_Class_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Class_ID = "A_Asset_Class_ID";
|
||||
|
||||
/** Set Asset class */
|
||||
public void setA_Asset_Class_ID (int A_Asset_Class_ID);
|
||||
|
||||
/** Get Asset class */
|
||||
public int getA_Asset_Class_ID();
|
||||
|
||||
public org.compiere.model.I_A_Asset_Class getA_Asset_Class() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_CreateDate */
|
||||
public static final String COLUMNNAME_A_Asset_CreateDate = "A_Asset_CreateDate";
|
||||
|
||||
/** Set Asset Creation Date */
|
||||
/** Set Create Date */
|
||||
public void setA_Asset_CreateDate (Timestamp A_Asset_CreateDate);
|
||||
|
||||
/** Get Asset Creation Date */
|
||||
/** Get Create Date */
|
||||
public Timestamp getA_Asset_CreateDate();
|
||||
|
||||
/** Column name A_Asset_Group_ID */
|
||||
|
@ -63,7 +83,7 @@ public interface I_A_Asset
|
|||
*/
|
||||
public int getA_Asset_Group_ID();
|
||||
|
||||
public I_A_Asset_Group getA_Asset_Group() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Asset_Group getA_Asset_Group() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_ID */
|
||||
public static final String COLUMNNAME_A_Asset_ID = "A_Asset_ID";
|
||||
|
@ -81,12 +101,50 @@ public interface I_A_Asset
|
|||
/** Column name A_Asset_RevalDate */
|
||||
public static final String COLUMNNAME_A_Asset_RevalDate = "A_Asset_RevalDate";
|
||||
|
||||
/** Set Asset Reval. Date */
|
||||
/** Set Revaluation Date */
|
||||
public void setA_Asset_RevalDate (Timestamp A_Asset_RevalDate);
|
||||
|
||||
/** Get Asset Reval. Date */
|
||||
/** Get Revaluation Date */
|
||||
public Timestamp getA_Asset_RevalDate();
|
||||
|
||||
/** Column name A_Asset_Status */
|
||||
public static final String COLUMNNAME_A_Asset_Status = "A_Asset_Status";
|
||||
|
||||
/** Set Asset Status */
|
||||
public void setA_Asset_Status (String A_Asset_Status);
|
||||
|
||||
/** Get Asset Status */
|
||||
public String getA_Asset_Status();
|
||||
|
||||
/** Column name A_AssetType */
|
||||
public static final String COLUMNNAME_A_AssetType = "A_AssetType";
|
||||
|
||||
/** Set Asset Type */
|
||||
public void setA_AssetType (String A_AssetType);
|
||||
|
||||
/** Get Asset Type */
|
||||
public String getA_AssetType();
|
||||
|
||||
/** Column name A_Asset_Type_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Type_ID = "A_Asset_Type_ID";
|
||||
|
||||
/** Set Asset Type */
|
||||
public void setA_Asset_Type_ID (int A_Asset_Type_ID);
|
||||
|
||||
/** Get Asset Type */
|
||||
public int getA_Asset_Type_ID();
|
||||
|
||||
public org.compiere.model.I_A_Asset_Type getA_Asset_Type() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_UU */
|
||||
public static final String COLUMNNAME_A_Asset_UU = "A_Asset_UU";
|
||||
|
||||
/** Set A_Asset_UU */
|
||||
public void setA_Asset_UU (String A_Asset_UU);
|
||||
|
||||
/** Get A_Asset_UU */
|
||||
public String getA_Asset_UU();
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
||||
|
@ -121,37 +179,46 @@ public interface I_A_Asset
|
|||
*/
|
||||
public int getAD_User_ID();
|
||||
|
||||
public I_AD_User getAD_User() throws RuntimeException;
|
||||
public org.compiere.model.I_AD_User getAD_User() throws RuntimeException;
|
||||
|
||||
/** Column name A_Parent_Asset_ID */
|
||||
public static final String COLUMNNAME_A_Parent_Asset_ID = "A_Parent_Asset_ID";
|
||||
|
||||
/** Set Asset ID */
|
||||
/** Set Parent Asset */
|
||||
public void setA_Parent_Asset_ID (int A_Parent_Asset_ID);
|
||||
|
||||
/** Get Asset ID */
|
||||
/** Get Parent Asset */
|
||||
public int getA_Parent_Asset_ID();
|
||||
|
||||
public I_A_Asset getA_Parent_Asset() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Asset getA_Parent_Asset() throws RuntimeException;
|
||||
|
||||
/** Column name A_QTY_Current */
|
||||
public static final String COLUMNNAME_A_QTY_Current = "A_QTY_Current";
|
||||
|
||||
/** Set Quantity */
|
||||
/** Set Current Qty */
|
||||
public void setA_QTY_Current (BigDecimal A_QTY_Current);
|
||||
|
||||
/** Get Quantity */
|
||||
/** Get Current Qty */
|
||||
public BigDecimal getA_QTY_Current();
|
||||
|
||||
/** Column name A_QTY_Original */
|
||||
public static final String COLUMNNAME_A_QTY_Original = "A_QTY_Original";
|
||||
|
||||
/** Set Original Qty */
|
||||
/** Set A_QTY_Original */
|
||||
public void setA_QTY_Original (BigDecimal A_QTY_Original);
|
||||
|
||||
/** Get Original Qty */
|
||||
/** Get A_QTY_Original */
|
||||
public BigDecimal getA_QTY_Original();
|
||||
|
||||
/** Column name AssetActivationDate */
|
||||
public static final String COLUMNNAME_AssetActivationDate = "AssetActivationDate";
|
||||
|
||||
/** Set Activation Date */
|
||||
public void setAssetActivationDate (Timestamp AssetActivationDate);
|
||||
|
||||
/** Get Activation Date */
|
||||
public Timestamp getAssetActivationDate();
|
||||
|
||||
/** Column name AssetDepreciationDate */
|
||||
public static final String COLUMNNAME_AssetDepreciationDate = "AssetDepreciationDate";
|
||||
|
||||
|
@ -191,6 +258,21 @@ public interface I_A_Asset
|
|||
*/
|
||||
public Timestamp getAssetServiceDate();
|
||||
|
||||
/** Column name C_Activity_ID */
|
||||
public static final String COLUMNNAME_C_Activity_ID = "C_Activity_ID";
|
||||
|
||||
/** Set Activity.
|
||||
* Business Activity
|
||||
*/
|
||||
public void setC_Activity_ID (int C_Activity_ID);
|
||||
|
||||
/** Get Activity.
|
||||
* Business Activity
|
||||
*/
|
||||
public int getC_Activity_ID();
|
||||
|
||||
public org.compiere.model.I_C_Activity getC_Activity() throws RuntimeException;
|
||||
|
||||
/** Column name C_BPartner_ID */
|
||||
public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID";
|
||||
|
||||
|
@ -204,7 +286,7 @@ public interface I_A_Asset
|
|||
*/
|
||||
public int getC_BPartner_ID();
|
||||
|
||||
public I_C_BPartner getC_BPartner() throws RuntimeException;
|
||||
public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException;
|
||||
|
||||
/** Column name C_BPartner_Location_ID */
|
||||
public static final String COLUMNNAME_C_BPartner_Location_ID = "C_BPartner_Location_ID";
|
||||
|
@ -219,7 +301,7 @@ public interface I_A_Asset
|
|||
*/
|
||||
public int getC_BPartner_Location_ID();
|
||||
|
||||
public I_C_BPartner_Location getC_BPartner_Location() throws RuntimeException;
|
||||
public org.compiere.model.I_C_BPartner_Location getC_BPartner_Location() throws RuntimeException;
|
||||
|
||||
/** Column name C_BPartnerSR_ID */
|
||||
public static final String COLUMNNAME_C_BPartnerSR_ID = "C_BPartnerSR_ID";
|
||||
|
@ -234,7 +316,7 @@ public interface I_A_Asset
|
|||
*/
|
||||
public int getC_BPartnerSR_ID();
|
||||
|
||||
public I_C_BPartner getC_BPartnerSR() throws RuntimeException;
|
||||
public org.compiere.model.I_C_BPartner getC_BPartnerSR() throws RuntimeException;
|
||||
|
||||
/** Column name C_Location_ID */
|
||||
public static final String COLUMNNAME_C_Location_ID = "C_Location_ID";
|
||||
|
@ -264,7 +346,7 @@ public interface I_A_Asset
|
|||
*/
|
||||
public int getC_Project_ID();
|
||||
|
||||
public I_C_Project getC_Project() throws RuntimeException;
|
||||
public org.compiere.model.I_C_Project getC_Project() throws RuntimeException;
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
@ -321,6 +403,15 @@ public interface I_A_Asset
|
|||
*/
|
||||
public String getHelp();
|
||||
|
||||
/** Column name InventoryNo */
|
||||
public static final String COLUMNNAME_InventoryNo = "InventoryNo";
|
||||
|
||||
/** Set Inventory No */
|
||||
public void setInventoryNo (String InventoryNo);
|
||||
|
||||
/** Get Inventory No */
|
||||
public String getInventoryNo();
|
||||
|
||||
/** Column name IsActive */
|
||||
public static final String COLUMNNAME_IsActive = "IsActive";
|
||||
|
||||
|
@ -451,7 +542,7 @@ public interface I_A_Asset
|
|||
*/
|
||||
public int getLease_BPartner_ID();
|
||||
|
||||
public I_C_BPartner getLease_BPartner() throws RuntimeException;
|
||||
public org.compiere.model.I_C_BPartner getLease_BPartner() throws RuntimeException;
|
||||
|
||||
/** Column name LeaseTerminationDate */
|
||||
public static final String COLUMNNAME_LeaseTerminationDate = "LeaseTerminationDate";
|
||||
|
@ -505,6 +596,28 @@ public interface I_A_Asset
|
|||
*/
|
||||
public String getLot();
|
||||
|
||||
/** Column name ManufacturedYear */
|
||||
public static final String COLUMNNAME_ManufacturedYear = "ManufacturedYear";
|
||||
|
||||
/** Set Manufactured Year */
|
||||
public void setManufacturedYear (int ManufacturedYear);
|
||||
|
||||
/** Get Manufactured Year */
|
||||
public int getManufacturedYear();
|
||||
|
||||
/** Column name Manufacturer */
|
||||
public static final String COLUMNNAME_Manufacturer = "Manufacturer";
|
||||
|
||||
/** Set Manufacturer.
|
||||
* Manufacturer of the Product
|
||||
*/
|
||||
public void setManufacturer (String Manufacturer);
|
||||
|
||||
/** Get Manufacturer.
|
||||
* Manufacturer of the Product
|
||||
*/
|
||||
public String getManufacturer();
|
||||
|
||||
/** Column name M_AttributeSetInstance_ID */
|
||||
public static final String COLUMNNAME_M_AttributeSetInstance_ID = "M_AttributeSetInstance_ID";
|
||||
|
||||
|
@ -533,7 +646,7 @@ public interface I_A_Asset
|
|||
*/
|
||||
public int getM_InOutLine_ID();
|
||||
|
||||
public I_M_InOutLine getM_InOutLine() throws RuntimeException;
|
||||
public org.compiere.model.I_M_InOutLine getM_InOutLine() throws RuntimeException;
|
||||
|
||||
/** Column name M_Locator_ID */
|
||||
public static final String COLUMNNAME_M_Locator_ID = "M_Locator_ID";
|
||||
|
@ -563,7 +676,7 @@ public interface I_A_Asset
|
|||
*/
|
||||
public int getM_Product_ID();
|
||||
|
||||
public I_M_Product getM_Product() throws RuntimeException;
|
||||
public org.compiere.model.I_M_Product getM_Product() throws RuntimeException;
|
||||
|
||||
/** Column name Name */
|
||||
public static final String COLUMNNAME_Name = "Name";
|
||||
|
@ -581,13 +694,13 @@ public interface I_A_Asset
|
|||
/** Column name NextMaintenenceDate */
|
||||
public static final String COLUMNNAME_NextMaintenenceDate = "NextMaintenenceDate";
|
||||
|
||||
/** Set Next Maintenance.
|
||||
* Next Maintenance Date
|
||||
/** Set Next Maintenence.
|
||||
* Next Maintenence Date
|
||||
*/
|
||||
public void setNextMaintenenceDate (Timestamp NextMaintenenceDate);
|
||||
|
||||
/** Get Next Maintenance.
|
||||
* Next Maintenance Date
|
||||
/** Get Next Maintenence.
|
||||
* Next Maintenence Date
|
||||
*/
|
||||
public Timestamp getNextMaintenenceDate();
|
||||
|
||||
|
@ -595,15 +708,28 @@ public interface I_A_Asset
|
|||
public static final String COLUMNNAME_NextMaintenenceUnit = "NextMaintenenceUnit";
|
||||
|
||||
/** Set Next Unit.
|
||||
* Next Maintenance Unit
|
||||
* Next Maintenence Unit
|
||||
*/
|
||||
public void setNextMaintenenceUnit (int NextMaintenenceUnit);
|
||||
|
||||
/** Get Next Unit.
|
||||
* Next Maintenance Unit
|
||||
* Next Maintenence Unit
|
||||
*/
|
||||
public int getNextMaintenenceUnit();
|
||||
|
||||
/** 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";
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_A_Asset_Acct
|
|||
public static final String Table_Name = "A_Asset_Acct";
|
||||
|
||||
/** AD_Table_ID=53123 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53123;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -44,10 +44,10 @@ public interface I_A_Asset_Acct
|
|||
/** Column name A_Accumdepreciation_Acct */
|
||||
public static final String COLUMNNAME_A_Accumdepreciation_Acct = "A_Accumdepreciation_Acct";
|
||||
|
||||
/** Set Accumulated Depreciation */
|
||||
/** Set Accumulated Depreciation Account */
|
||||
public void setA_Accumdepreciation_Acct (int A_Accumdepreciation_Acct);
|
||||
|
||||
/** Get Accumulated Depreciation */
|
||||
/** Get Accumulated Depreciation Account */
|
||||
public int getA_Accumdepreciation_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Accumdepreciation_A() throws RuntimeException;
|
||||
|
@ -55,10 +55,10 @@ public interface I_A_Asset_Acct
|
|||
/** Column name A_Asset_Acct */
|
||||
public static final String COLUMNNAME_A_Asset_Acct = "A_Asset_Acct";
|
||||
|
||||
/** Set Asset Cost Account */
|
||||
/** Set Asset Acct */
|
||||
public void setA_Asset_Acct (int A_Asset_Acct);
|
||||
|
||||
/** Get Asset Cost Account */
|
||||
/** Get Asset Acct */
|
||||
public int getA_Asset_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Asset_A() throws RuntimeException;
|
||||
|
@ -66,12 +66,21 @@ public interface I_A_Asset_Acct
|
|||
/** Column name A_Asset_Acct_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Acct_ID = "A_Asset_Acct_ID";
|
||||
|
||||
/** Set Asset Acct. */
|
||||
/** Set A_Asset_Acct_ID */
|
||||
public void setA_Asset_Acct_ID (int A_Asset_Acct_ID);
|
||||
|
||||
/** Get Asset Acct. */
|
||||
/** Get A_Asset_Acct_ID */
|
||||
public int getA_Asset_Acct_ID();
|
||||
|
||||
/** Column name A_Asset_Acct_UU */
|
||||
public static final String COLUMNNAME_A_Asset_Acct_UU = "A_Asset_Acct_UU";
|
||||
|
||||
/** Set A_Asset_Acct_UU */
|
||||
public void setA_Asset_Acct_UU (String A_Asset_Acct_UU);
|
||||
|
||||
/** Get A_Asset_Acct_UU */
|
||||
public String getA_Asset_Acct_UU();
|
||||
|
||||
/** Column name A_Asset_ID */
|
||||
public static final String COLUMNNAME_A_Asset_ID = "A_Asset_ID";
|
||||
|
||||
|
@ -85,16 +94,18 @@ public interface I_A_Asset_Acct
|
|||
*/
|
||||
public int getA_Asset_ID();
|
||||
|
||||
public org.compiere.model.I_A_Asset getA_Asset() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_Spread_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Spread_ID = "A_Asset_Spread_ID";
|
||||
|
||||
/** Set Asset Spread */
|
||||
/** Set A_Asset_Spread_ID */
|
||||
public void setA_Asset_Spread_ID (int A_Asset_Spread_ID);
|
||||
|
||||
/** Get Asset Spread */
|
||||
/** Get A_Asset_Spread_ID */
|
||||
public int getA_Asset_Spread_ID();
|
||||
|
||||
public I_A_Asset_Spread getA_Asset_Spread() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Asset_Spread getA_Asset_Spread() throws RuntimeException;
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
@ -107,14 +118,25 @@ public interface I_A_Asset_Acct
|
|||
/** Column name A_Depreciation_Acct */
|
||||
public static final String COLUMNNAME_A_Depreciation_Acct = "A_Depreciation_Acct";
|
||||
|
||||
/** Set Depreciation Expense Account */
|
||||
/** Set Depreciation Account */
|
||||
public void setA_Depreciation_Acct (int A_Depreciation_Acct);
|
||||
|
||||
/** Get Depreciation Expense Account */
|
||||
/** Get Depreciation Account */
|
||||
public int getA_Depreciation_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Depreciation_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Depreciation_Conv_F_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_Conv_F_ID = "A_Depreciation_Conv_F_ID";
|
||||
|
||||
/** Set Depreciation Convention (fiscal) */
|
||||
public void setA_Depreciation_Conv_F_ID (int A_Depreciation_Conv_F_ID);
|
||||
|
||||
/** Get Depreciation Convention (fiscal) */
|
||||
public int getA_Depreciation_Conv_F_ID();
|
||||
|
||||
public org.compiere.model.I_A_Depreciation_Convention getA_Depreciation_Conv_F() throws RuntimeException;
|
||||
|
||||
/** Column name A_Depreciation_Conv_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_Conv_ID = "A_Depreciation_Conv_ID";
|
||||
|
||||
|
@ -124,68 +146,99 @@ public interface I_A_Asset_Acct
|
|||
/** Get Convention Type */
|
||||
public int getA_Depreciation_Conv_ID();
|
||||
|
||||
public I_A_Depreciation_Convention getA_Depreciation_Conv() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Depreciation_Convention getA_Depreciation_Conv() throws RuntimeException;
|
||||
|
||||
/** Column name A_Depreciation_F_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_F_ID = "A_Depreciation_F_ID";
|
||||
|
||||
/** Set Depreciation (fiscal) */
|
||||
public void setA_Depreciation_F_ID (int A_Depreciation_F_ID);
|
||||
|
||||
/** Get Depreciation (fiscal) */
|
||||
public int getA_Depreciation_F_ID();
|
||||
|
||||
public org.compiere.model.I_A_Depreciation getA_Depreciation_F() throws RuntimeException;
|
||||
|
||||
/** Column name A_Depreciation_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_ID = "A_Depreciation_ID";
|
||||
|
||||
/** Set Depreciation Type */
|
||||
/** Set Depreciation */
|
||||
public void setA_Depreciation_ID (int A_Depreciation_ID);
|
||||
|
||||
/** Get Depreciation Type */
|
||||
/** Get Depreciation */
|
||||
public int getA_Depreciation_ID();
|
||||
|
||||
public I_A_Depreciation getA_Depreciation() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Depreciation getA_Depreciation() throws RuntimeException;
|
||||
|
||||
/** Column name A_Depreciation_Manual_Amount */
|
||||
public static final String COLUMNNAME_A_Depreciation_Manual_Amount = "A_Depreciation_Manual_Amount";
|
||||
|
||||
/** Set Depreciation Manual Amount */
|
||||
/** Set A_Depreciation_Manual_Amount */
|
||||
public void setA_Depreciation_Manual_Amount (BigDecimal A_Depreciation_Manual_Amount);
|
||||
|
||||
/** Get Depreciation Manual Amount */
|
||||
/** Get A_Depreciation_Manual_Amount */
|
||||
public BigDecimal getA_Depreciation_Manual_Amount();
|
||||
|
||||
/** Column name A_Depreciation_Manual_Period */
|
||||
public static final String COLUMNNAME_A_Depreciation_Manual_Period = "A_Depreciation_Manual_Period";
|
||||
|
||||
/** Set Depreciation Manual Period */
|
||||
/** Set A_Depreciation_Manual_Period */
|
||||
public void setA_Depreciation_Manual_Period (String A_Depreciation_Manual_Period);
|
||||
|
||||
/** Get Depreciation Manual Period */
|
||||
/** Get A_Depreciation_Manual_Period */
|
||||
public String getA_Depreciation_Manual_Period();
|
||||
|
||||
/** Column name A_Depreciation_Method_F_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_Method_F_ID = "A_Depreciation_Method_F_ID";
|
||||
|
||||
/** Set Depreciation Method (fiscal) */
|
||||
public void setA_Depreciation_Method_F_ID (int A_Depreciation_Method_F_ID);
|
||||
|
||||
/** Get Depreciation Method (fiscal) */
|
||||
public int getA_Depreciation_Method_F_ID();
|
||||
|
||||
public org.compiere.model.I_A_Depreciation_Method getA_Depreciation_Method_F() throws RuntimeException;
|
||||
|
||||
/** Column name A_Depreciation_Method_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_Method_ID = "A_Depreciation_Method_ID";
|
||||
|
||||
/** Set Depreciation Calculation Type */
|
||||
/** Set Depreciation Method */
|
||||
public void setA_Depreciation_Method_ID (int A_Depreciation_Method_ID);
|
||||
|
||||
/** Get Depreciation Calculation Type */
|
||||
/** Get Depreciation Method */
|
||||
public int getA_Depreciation_Method_ID();
|
||||
|
||||
public I_A_Depreciation_Method getA_Depreciation_Method() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Depreciation_Method getA_Depreciation_Method() throws RuntimeException;
|
||||
|
||||
/** Column name A_Depreciation_Table_Header_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_Table_Header_ID = "A_Depreciation_Table_Header_ID";
|
||||
|
||||
/** Set Depreciation Table Header */
|
||||
/** Set A_Depreciation_Table_Header_ID */
|
||||
public void setA_Depreciation_Table_Header_ID (int A_Depreciation_Table_Header_ID);
|
||||
|
||||
/** Get Depreciation Table Header */
|
||||
/** Get A_Depreciation_Table_Header_ID */
|
||||
public int getA_Depreciation_Table_Header_ID();
|
||||
|
||||
public I_A_Depreciation_Table_Header getA_Depreciation_Table_Header() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Depreciation_Table_Header getA_Depreciation_Table_Header() throws RuntimeException;
|
||||
|
||||
/** Column name A_Depreciation_Variable_Perc */
|
||||
public static final String COLUMNNAME_A_Depreciation_Variable_Perc = "A_Depreciation_Variable_Perc";
|
||||
|
||||
/** Set Depreciation Variable Perc. */
|
||||
/** Set Variable Percent */
|
||||
public void setA_Depreciation_Variable_Perc (BigDecimal A_Depreciation_Variable_Perc);
|
||||
|
||||
/** Get Depreciation Variable Perc. */
|
||||
/** Get Variable Percent */
|
||||
public BigDecimal getA_Depreciation_Variable_Perc();
|
||||
|
||||
/** Column name A_Depreciation_Variable_Perc_F */
|
||||
public static final String COLUMNNAME_A_Depreciation_Variable_Perc_F = "A_Depreciation_Variable_Perc_F";
|
||||
|
||||
/** Set Variable Percent (fiscal) */
|
||||
public void setA_Depreciation_Variable_Perc_F (BigDecimal A_Depreciation_Variable_Perc_F);
|
||||
|
||||
/** Get Variable Percent (fiscal) */
|
||||
public BigDecimal getA_Depreciation_Variable_Perc_F();
|
||||
|
||||
/** Column name A_Disposal_Gain */
|
||||
public static final String COLUMNNAME_A_Disposal_Gain = "A_Disposal_Gain";
|
||||
|
||||
|
@ -197,6 +250,17 @@ public interface I_A_Asset_Acct
|
|||
|
||||
public I_C_ValidCombination getA_Disposal_G() throws RuntimeException;
|
||||
|
||||
/** Column name A_Disposal_Gain_Acct */
|
||||
public static final String COLUMNNAME_A_Disposal_Gain_Acct = "A_Disposal_Gain_Acct";
|
||||
|
||||
/** Set Disposal Gain Acct */
|
||||
public void setA_Disposal_Gain_Acct (int A_Disposal_Gain_Acct);
|
||||
|
||||
/** Get Disposal Gain Acct */
|
||||
public int getA_Disposal_Gain_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Disposal_Gain_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Disposal_Loss */
|
||||
public static final String COLUMNNAME_A_Disposal_Loss = "A_Disposal_Loss";
|
||||
|
||||
|
@ -208,6 +272,17 @@ public interface I_A_Asset_Acct
|
|||
|
||||
public I_C_ValidCombination getA_Disposal_L() throws RuntimeException;
|
||||
|
||||
/** Column name A_Disposal_Loss_Acct */
|
||||
public static final String COLUMNNAME_A_Disposal_Loss_Acct = "A_Disposal_Loss_Acct";
|
||||
|
||||
/** Set Disposal Loss Acct */
|
||||
public void setA_Disposal_Loss_Acct (int A_Disposal_Loss_Acct);
|
||||
|
||||
/** Get Disposal Loss Acct */
|
||||
public int getA_Disposal_Loss_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Disposal_Loss_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Disposal_Revenue */
|
||||
public static final String COLUMNNAME_A_Disposal_Revenue = "A_Disposal_Revenue";
|
||||
|
||||
|
@ -219,6 +294,17 @@ public interface I_A_Asset_Acct
|
|||
|
||||
public I_C_ValidCombination getA_Disposal_Reve() throws RuntimeException;
|
||||
|
||||
/** Column name A_Disposal_Revenue_Acct */
|
||||
public static final String COLUMNNAME_A_Disposal_Revenue_Acct = "A_Disposal_Revenue_Acct";
|
||||
|
||||
/** Set Disposal Revenue Acct */
|
||||
public void setA_Disposal_Revenue_Acct (int A_Disposal_Revenue_Acct);
|
||||
|
||||
/** Get Disposal Revenue Acct */
|
||||
public int getA_Disposal_Revenue_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Disposal_Revenue_A() throws RuntimeException;
|
||||
|
||||
/** Column name AD_Org_ID */
|
||||
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
|
||||
|
||||
|
@ -235,19 +321,19 @@ public interface I_A_Asset_Acct
|
|||
/** Column name A_Period_End */
|
||||
public static final String COLUMNNAME_A_Period_End = "A_Period_End";
|
||||
|
||||
/** Set Period End */
|
||||
/** Set A_Period_End */
|
||||
public void setA_Period_End (int A_Period_End);
|
||||
|
||||
/** Get Period End */
|
||||
/** Get A_Period_End */
|
||||
public int getA_Period_End();
|
||||
|
||||
/** Column name A_Period_Start */
|
||||
public static final String COLUMNNAME_A_Period_Start = "A_Period_Start";
|
||||
|
||||
/** Set Period Start */
|
||||
/** Set A_Period_Start */
|
||||
public void setA_Period_Start (int A_Period_Start);
|
||||
|
||||
/** Get Period Start */
|
||||
/** Get A_Period_Start */
|
||||
public int getA_Period_Start();
|
||||
|
||||
/** Column name A_Reval_Accumdep_Offset_Cur */
|
||||
|
@ -272,13 +358,35 @@ public interface I_A_Asset_Acct
|
|||
|
||||
public I_C_ValidCombination getA_Reval_Accumdep_Offset_Pr() throws RuntimeException;
|
||||
|
||||
/** Column name A_Reval_Adep_Offset_Cur_Acct */
|
||||
public static final String COLUMNNAME_A_Reval_Adep_Offset_Cur_Acct = "A_Reval_Adep_Offset_Cur_Acct";
|
||||
|
||||
/** Set A_Reval_Accumdep_Offset_Cur */
|
||||
public void setA_Reval_Adep_Offset_Cur_Acct (int A_Reval_Adep_Offset_Cur_Acct);
|
||||
|
||||
/** Get A_Reval_Accumdep_Offset_Cur */
|
||||
public int getA_Reval_Adep_Offset_Cur_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Reval_Adep_Offset_Cur_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Reval_Adep_Offset_Prior_Acct */
|
||||
public static final String COLUMNNAME_A_Reval_Adep_Offset_Prior_Acct = "A_Reval_Adep_Offset_Prior_Acct";
|
||||
|
||||
/** Set A_Reval_Accumdep_Offset_Prior */
|
||||
public void setA_Reval_Adep_Offset_Prior_Acct (int A_Reval_Adep_Offset_Prior_Acct);
|
||||
|
||||
/** Get A_Reval_Accumdep_Offset_Prior */
|
||||
public int getA_Reval_Adep_Offset_Prior_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Reval_Adep_Offset_Prior_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Reval_Cal_Method */
|
||||
public static final String COLUMNNAME_A_Reval_Cal_Method = "A_Reval_Cal_Method";
|
||||
|
||||
/** Set Revaluation Calculation Method */
|
||||
/** Set A_Reval_Cal_Method */
|
||||
public void setA_Reval_Cal_Method (String A_Reval_Cal_Method);
|
||||
|
||||
/** Get Revaluation Calculation Method */
|
||||
/** Get A_Reval_Cal_Method */
|
||||
public String getA_Reval_Cal_Method();
|
||||
|
||||
/** Column name A_Reval_Cost_Offset */
|
||||
|
@ -292,6 +400,17 @@ public interface I_A_Asset_Acct
|
|||
|
||||
public I_C_ValidCombination getA_Reval_Cost_Off() throws RuntimeException;
|
||||
|
||||
/** Column name A_Reval_Cost_Offset_Acct */
|
||||
public static final String COLUMNNAME_A_Reval_Cost_Offset_Acct = "A_Reval_Cost_Offset_Acct";
|
||||
|
||||
/** Set Reval Cost Offset Acct */
|
||||
public void setA_Reval_Cost_Offset_Acct (int A_Reval_Cost_Offset_Acct);
|
||||
|
||||
/** Get Reval Cost Offset Acct */
|
||||
public int getA_Reval_Cost_Offset_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Reval_Cost_Offset_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Reval_Cost_Offset_Prior */
|
||||
public static final String COLUMNNAME_A_Reval_Cost_Offset_Prior = "A_Reval_Cost_Offset_Prior";
|
||||
|
||||
|
@ -303,6 +422,17 @@ public interface I_A_Asset_Acct
|
|||
|
||||
public I_C_ValidCombination getA_Reval_Cost_Offset_Pr() throws RuntimeException;
|
||||
|
||||
/** Column name A_Reval_Cost_Offset_Prior_Acct */
|
||||
public static final String COLUMNNAME_A_Reval_Cost_Offset_Prior_Acct = "A_Reval_Cost_Offset_Prior_Acct";
|
||||
|
||||
/** Set Reval Cost Offset Prior Acct */
|
||||
public void setA_Reval_Cost_Offset_Prior_Acct (int A_Reval_Cost_Offset_Prior_Acct);
|
||||
|
||||
/** Get Reval Cost Offset Prior Acct */
|
||||
public int getA_Reval_Cost_Offset_Prior_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Reval_Cost_Offset_Prior_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Reval_Depexp_Offset */
|
||||
public static final String COLUMNNAME_A_Reval_Depexp_Offset = "A_Reval_Depexp_Offset";
|
||||
|
||||
|
@ -314,22 +444,33 @@ public interface I_A_Asset_Acct
|
|||
|
||||
public I_C_ValidCombination getA_Reval_Depexp_Off() throws RuntimeException;
|
||||
|
||||
/** Column name A_Reval_Depexp_Offset_Acct */
|
||||
public static final String COLUMNNAME_A_Reval_Depexp_Offset_Acct = "A_Reval_Depexp_Offset_Acct";
|
||||
|
||||
/** Set Reval Depexp Offset Acct */
|
||||
public void setA_Reval_Depexp_Offset_Acct (int A_Reval_Depexp_Offset_Acct);
|
||||
|
||||
/** Get Reval Depexp Offset Acct */
|
||||
public int getA_Reval_Depexp_Offset_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Reval_Depexp_Offset_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Salvage_Value */
|
||||
public static final String COLUMNNAME_A_Salvage_Value = "A_Salvage_Value";
|
||||
|
||||
/** Set Salvage Value */
|
||||
/** Set Asset Salvage Value */
|
||||
public void setA_Salvage_Value (BigDecimal A_Salvage_Value);
|
||||
|
||||
/** Get Salvage Value */
|
||||
/** Get Asset Salvage Value */
|
||||
public BigDecimal getA_Salvage_Value();
|
||||
|
||||
/** Column name A_Split_Percent */
|
||||
public static final String COLUMNNAME_A_Split_Percent = "A_Split_Percent";
|
||||
|
||||
/** Set Split Percentage */
|
||||
/** Set Split Percent */
|
||||
public void setA_Split_Percent (BigDecimal A_Split_Percent);
|
||||
|
||||
/** Get Split Percentage */
|
||||
/** Get Split Percent */
|
||||
public BigDecimal getA_Split_Percent();
|
||||
|
||||
/** Column name C_AcctSchema_ID */
|
||||
|
@ -345,7 +486,7 @@ public interface I_A_Asset_Acct
|
|||
*/
|
||||
public int getC_AcctSchema_ID();
|
||||
|
||||
public I_C_AcctSchema getC_AcctSchema() throws RuntimeException;
|
||||
public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException;
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
@ -413,4 +554,17 @@ public interface I_A_Asset_Acct
|
|||
* User who updated this records
|
||||
*/
|
||||
public int getUpdatedBy();
|
||||
|
||||
/** Column name ValidFrom */
|
||||
public static final String COLUMNNAME_ValidFrom = "ValidFrom";
|
||||
|
||||
/** Set Valid from.
|
||||
* Valid from including this date (first day)
|
||||
*/
|
||||
public void setValidFrom (Timestamp ValidFrom);
|
||||
|
||||
/** Get Valid from.
|
||||
* Valid from including this date (first day)
|
||||
*/
|
||||
public Timestamp getValidFrom();
|
||||
}
|
||||
|
|
|
@ -31,16 +31,43 @@ public interface I_A_Asset_Addition
|
|||
public static final String Table_Name = "A_Asset_Addition";
|
||||
|
||||
/** AD_Table_ID=53137 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53137;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
/** AccessLevel = 7 - System - Client - Org
|
||||
/** AccessLevel = 3 - Client - Org
|
||||
*/
|
||||
BigDecimal accessLevel = BigDecimal.valueOf(7);
|
||||
BigDecimal accessLevel = BigDecimal.valueOf(3);
|
||||
|
||||
/** Load Meta Data */
|
||||
|
||||
/** Column name A_Accumulated_Depr */
|
||||
public static final String COLUMNNAME_A_Accumulated_Depr = "A_Accumulated_Depr";
|
||||
|
||||
/** Set Accumulated Depreciation */
|
||||
public void setA_Accumulated_Depr (BigDecimal A_Accumulated_Depr);
|
||||
|
||||
/** Get Accumulated Depreciation */
|
||||
public BigDecimal getA_Accumulated_Depr();
|
||||
|
||||
/** Column name A_Accumulated_Depr_Adjust */
|
||||
public static final String COLUMNNAME_A_Accumulated_Depr_Adjust = "A_Accumulated_Depr_Adjust";
|
||||
|
||||
/** Set Adjust Accumulated Depreciation */
|
||||
public void setA_Accumulated_Depr_Adjust (boolean A_Accumulated_Depr_Adjust);
|
||||
|
||||
/** Get Adjust Accumulated Depreciation */
|
||||
public boolean isA_Accumulated_Depr_Adjust();
|
||||
|
||||
/** Column name A_Accumulated_Depr_F */
|
||||
public static final String COLUMNNAME_A_Accumulated_Depr_F = "A_Accumulated_Depr_F";
|
||||
|
||||
/** Set Accumulated Depreciation (fiscal) */
|
||||
public void setA_Accumulated_Depr_F (BigDecimal A_Accumulated_Depr_F);
|
||||
|
||||
/** Get Accumulated Depreciation (fiscal) */
|
||||
public BigDecimal getA_Accumulated_Depr_F();
|
||||
|
||||
/** Column name A_Asset_Addition_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Addition_ID = "A_Asset_Addition_ID";
|
||||
|
||||
|
@ -50,6 +77,15 @@ public interface I_A_Asset_Addition
|
|||
/** Get Asset Addition */
|
||||
public int getA_Asset_Addition_ID();
|
||||
|
||||
/** Column name A_Asset_Addition_UU */
|
||||
public static final String COLUMNNAME_A_Asset_Addition_UU = "A_Asset_Addition_UU";
|
||||
|
||||
/** Set A_Asset_Addition_UU */
|
||||
public void setA_Asset_Addition_UU (String A_Asset_Addition_UU);
|
||||
|
||||
/** Get A_Asset_Addition_UU */
|
||||
public String getA_Asset_Addition_UU();
|
||||
|
||||
/** Column name A_Asset_ID */
|
||||
public static final String COLUMNNAME_A_Asset_ID = "A_Asset_ID";
|
||||
|
||||
|
@ -63,15 +99,26 @@ public interface I_A_Asset_Addition
|
|||
*/
|
||||
public int getA_Asset_ID();
|
||||
|
||||
public org.compiere.model.I_A_Asset getA_Asset() throws RuntimeException;
|
||||
|
||||
/** Column name A_CapvsExp */
|
||||
public static final String COLUMNNAME_A_CapvsExp = "A_CapvsExp";
|
||||
|
||||
/** Set Capital vs Expense */
|
||||
/** Set Capital/Expense */
|
||||
public void setA_CapvsExp (String A_CapvsExp);
|
||||
|
||||
/** Get Capital vs Expense */
|
||||
/** Get Capital/Expense */
|
||||
public String getA_CapvsExp();
|
||||
|
||||
/** Column name A_CreateAsset */
|
||||
public static final String COLUMNNAME_A_CreateAsset = "A_CreateAsset";
|
||||
|
||||
/** Set Create Asset */
|
||||
public void setA_CreateAsset (boolean A_CreateAsset);
|
||||
|
||||
/** Get Create Asset */
|
||||
public boolean isA_CreateAsset();
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
||||
|
@ -93,24 +140,78 @@ public interface I_A_Asset_Addition
|
|||
*/
|
||||
public int getAD_Org_ID();
|
||||
|
||||
/** Column name A_Life_Period_Max */
|
||||
public static final String COLUMNNAME_A_Life_Period_Max = "A_Life_Period_Max";
|
||||
|
||||
/** Set Life periods (max) */
|
||||
public void setA_Life_Period_Max (int A_Life_Period_Max);
|
||||
|
||||
/** Get Life periods (max) */
|
||||
public int getA_Life_Period_Max();
|
||||
|
||||
/** Column name A_Life_Period_Min */
|
||||
public static final String COLUMNNAME_A_Life_Period_Min = "A_Life_Period_Min";
|
||||
|
||||
/** Set Life periods (min) */
|
||||
public void setA_Life_Period_Min (int A_Life_Period_Min);
|
||||
|
||||
/** Get Life periods (min) */
|
||||
public int getA_Life_Period_Min();
|
||||
|
||||
/** Column name A_Period_Start */
|
||||
public static final String COLUMNNAME_A_Period_Start = "A_Period_Start";
|
||||
|
||||
/** Set A_Period_Start */
|
||||
public void setA_Period_Start (int A_Period_Start);
|
||||
|
||||
/** Get A_Period_Start */
|
||||
public int getA_Period_Start();
|
||||
|
||||
/** Column name A_QTY_Current */
|
||||
public static final String COLUMNNAME_A_QTY_Current = "A_QTY_Current";
|
||||
|
||||
/** Set Quantity */
|
||||
/** Set Current Qty */
|
||||
public void setA_QTY_Current (BigDecimal A_QTY_Current);
|
||||
|
||||
/** Get Quantity */
|
||||
/** Get Current Qty */
|
||||
public BigDecimal getA_QTY_Current();
|
||||
|
||||
/** Column name A_Salvage_Value */
|
||||
public static final String COLUMNNAME_A_Salvage_Value = "A_Salvage_Value";
|
||||
|
||||
/** Set Asset Salvage Value */
|
||||
public void setA_Salvage_Value (BigDecimal A_Salvage_Value);
|
||||
|
||||
/** Get Asset Salvage Value */
|
||||
public BigDecimal getA_Salvage_Value();
|
||||
|
||||
/** Column name A_SourceType */
|
||||
public static final String COLUMNNAME_A_SourceType = "A_SourceType";
|
||||
|
||||
/** Set Source of Entry */
|
||||
/** Set Source Type */
|
||||
public void setA_SourceType (String A_SourceType);
|
||||
|
||||
/** Get Source of Entry */
|
||||
/** Get Source Type */
|
||||
public String getA_SourceType();
|
||||
|
||||
/** Column name AssetAmtEntered */
|
||||
public static final String COLUMNNAME_AssetAmtEntered = "AssetAmtEntered";
|
||||
|
||||
/** Set Entered Amount */
|
||||
public void setAssetAmtEntered (BigDecimal AssetAmtEntered);
|
||||
|
||||
/** Get Entered Amount */
|
||||
public BigDecimal getAssetAmtEntered();
|
||||
|
||||
/** Column name AssetSourceAmt */
|
||||
public static final String COLUMNNAME_AssetSourceAmt = "AssetSourceAmt";
|
||||
|
||||
/** Set Source Amount */
|
||||
public void setAssetSourceAmt (BigDecimal AssetSourceAmt);
|
||||
|
||||
/** Get Source Amount */
|
||||
public BigDecimal getAssetSourceAmt();
|
||||
|
||||
/** Column name AssetValueAmt */
|
||||
public static final String COLUMNNAME_AssetValueAmt = "AssetValueAmt";
|
||||
|
||||
|
@ -124,6 +225,51 @@ public interface I_A_Asset_Addition
|
|||
*/
|
||||
public BigDecimal getAssetValueAmt();
|
||||
|
||||
/** Column name C_Charge_ID */
|
||||
public static final String COLUMNNAME_C_Charge_ID = "C_Charge_ID";
|
||||
|
||||
/** Set Charge.
|
||||
* Additional document charges
|
||||
*/
|
||||
public void setC_Charge_ID (int C_Charge_ID);
|
||||
|
||||
/** Get Charge.
|
||||
* Additional document charges
|
||||
*/
|
||||
public int getC_Charge_ID();
|
||||
|
||||
public org.compiere.model.I_C_Charge getC_Charge() throws RuntimeException;
|
||||
|
||||
/** 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 C_Currency_ID */
|
||||
public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID";
|
||||
|
||||
/** Set Currency.
|
||||
* The Currency for this record
|
||||
*/
|
||||
public void setC_Currency_ID (int C_Currency_ID);
|
||||
|
||||
/** Get Currency.
|
||||
* The Currency for this record
|
||||
*/
|
||||
public int getC_Currency_ID();
|
||||
|
||||
public org.compiere.model.I_C_Currency getC_Currency() throws RuntimeException;
|
||||
|
||||
/** Column name C_Invoice_ID */
|
||||
public static final String COLUMNNAME_C_Invoice_ID = "C_Invoice_ID";
|
||||
|
||||
|
@ -137,7 +283,37 @@ public interface I_A_Asset_Addition
|
|||
*/
|
||||
public int getC_Invoice_ID();
|
||||
|
||||
public I_C_Invoice getC_Invoice() throws RuntimeException;
|
||||
public org.compiere.model.I_C_Invoice getC_Invoice() throws RuntimeException;
|
||||
|
||||
/** Column name C_InvoiceLine_ID */
|
||||
public static final String COLUMNNAME_C_InvoiceLine_ID = "C_InvoiceLine_ID";
|
||||
|
||||
/** Set Invoice Line.
|
||||
* Invoice Detail Line
|
||||
*/
|
||||
public void setC_InvoiceLine_ID (int C_InvoiceLine_ID);
|
||||
|
||||
/** Get Invoice Line.
|
||||
* Invoice Detail Line
|
||||
*/
|
||||
public int getC_InvoiceLine_ID();
|
||||
|
||||
public org.compiere.model.I_C_InvoiceLine getC_InvoiceLine() throws RuntimeException;
|
||||
|
||||
/** Column name C_Project_ID */
|
||||
public static final String COLUMNNAME_C_Project_ID = "C_Project_ID";
|
||||
|
||||
/** Set Project.
|
||||
* Financial Project
|
||||
*/
|
||||
public void setC_Project_ID (int C_Project_ID);
|
||||
|
||||
/** Get Project.
|
||||
* Financial Project
|
||||
*/
|
||||
public int getC_Project_ID();
|
||||
|
||||
public org.compiere.model.I_C_Project getC_Project() throws RuntimeException;
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
@ -155,6 +331,67 @@ public interface I_A_Asset_Addition
|
|||
*/
|
||||
public int getCreatedBy();
|
||||
|
||||
/** Column name CurrencyRate */
|
||||
public static final String COLUMNNAME_CurrencyRate = "CurrencyRate";
|
||||
|
||||
/** Set Rate.
|
||||
* Currency Conversion Rate
|
||||
*/
|
||||
public void setCurrencyRate (BigDecimal CurrencyRate);
|
||||
|
||||
/** Get Rate.
|
||||
* Currency Conversion Rate
|
||||
*/
|
||||
public BigDecimal getCurrencyRate();
|
||||
|
||||
/** 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 DateDoc */
|
||||
public static final String COLUMNNAME_DateDoc = "DateDoc";
|
||||
|
||||
/** Set Document Date.
|
||||
* Date of the Document
|
||||
*/
|
||||
public void setDateDoc (Timestamp DateDoc);
|
||||
|
||||
/** Get Document Date.
|
||||
* Date of the Document
|
||||
*/
|
||||
public Timestamp getDateDoc();
|
||||
|
||||
/** Column name DeltaUseLifeYears */
|
||||
public static final String COLUMNNAME_DeltaUseLifeYears = "DeltaUseLifeYears";
|
||||
|
||||
/** Set Delta Use Life Years */
|
||||
public void setDeltaUseLifeYears (int DeltaUseLifeYears);
|
||||
|
||||
/** Get Delta Use Life Years */
|
||||
public int getDeltaUseLifeYears();
|
||||
|
||||
/** Column name DeltaUseLifeYears_F */
|
||||
public static final String COLUMNNAME_DeltaUseLifeYears_F = "DeltaUseLifeYears_F";
|
||||
|
||||
/** Set Delta Use Life Years (fiscal).
|
||||
* Delta Use Life Years (fiscal)
|
||||
*/
|
||||
public void setDeltaUseLifeYears_F (int DeltaUseLifeYears_F);
|
||||
|
||||
/** Get Delta Use Life Years (fiscal).
|
||||
* Delta Use Life Years (fiscal)
|
||||
*/
|
||||
public int getDeltaUseLifeYears_F();
|
||||
|
||||
/** Column name Description */
|
||||
public static final String COLUMNNAME_Description = "Description";
|
||||
|
||||
|
@ -168,6 +405,32 @@ public interface I_A_Asset_Addition
|
|||
*/
|
||||
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";
|
||||
|
||||
|
@ -194,7 +457,18 @@ public interface I_A_Asset_Addition
|
|||
*/
|
||||
public int getGL_JournalBatch_ID();
|
||||
|
||||
public I_GL_JournalBatch getGL_JournalBatch() throws RuntimeException;
|
||||
public org.compiere.model.I_GL_JournalBatch getGL_JournalBatch() throws RuntimeException;
|
||||
|
||||
/** Column name I_FixedAsset_ID */
|
||||
public static final String COLUMNNAME_I_FixedAsset_ID = "I_FixedAsset_ID";
|
||||
|
||||
/** Set Imported Fixed Asset */
|
||||
public void setI_FixedAsset_ID (int I_FixedAsset_ID);
|
||||
|
||||
/** Get Imported Fixed Asset */
|
||||
public int getI_FixedAsset_ID();
|
||||
|
||||
public org.compiere.model.I_I_FixedAsset getI_FixedAsset() throws RuntimeException;
|
||||
|
||||
/** Column name IsActive */
|
||||
public static final String COLUMNNAME_IsActive = "IsActive";
|
||||
|
@ -209,6 +483,19 @@ public interface I_A_Asset_Addition
|
|||
*/
|
||||
public boolean isActive();
|
||||
|
||||
/** Column name IsApproved */
|
||||
public static final String COLUMNNAME_IsApproved = "IsApproved";
|
||||
|
||||
/** Set Approved.
|
||||
* Indicates if this document requires approval
|
||||
*/
|
||||
public void setIsApproved (boolean IsApproved);
|
||||
|
||||
/** Get Approved.
|
||||
* Indicates if this document requires approval
|
||||
*/
|
||||
public boolean isApproved();
|
||||
|
||||
/** Column name Line */
|
||||
public static final String COLUMNNAME_Line = "Line";
|
||||
|
||||
|
@ -222,6 +509,21 @@ public interface I_A_Asset_Addition
|
|||
*/
|
||||
public int getLine();
|
||||
|
||||
/** Column name M_AttributeSetInstance_ID */
|
||||
public static final String COLUMNNAME_M_AttributeSetInstance_ID = "M_AttributeSetInstance_ID";
|
||||
|
||||
/** Set Attribute Set Instance.
|
||||
* Product Attribute Set Instance
|
||||
*/
|
||||
public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID);
|
||||
|
||||
/** Get Attribute Set Instance.
|
||||
* Product Attribute Set Instance
|
||||
*/
|
||||
public int getM_AttributeSetInstance_ID();
|
||||
|
||||
public I_M_AttributeSetInstance getM_AttributeSetInstance() throws RuntimeException;
|
||||
|
||||
/** Column name M_InOutLine_ID */
|
||||
public static final String COLUMNNAME_M_InOutLine_ID = "M_InOutLine_ID";
|
||||
|
||||
|
@ -235,6 +537,66 @@ public interface I_A_Asset_Addition
|
|||
*/
|
||||
public int getM_InOutLine_ID();
|
||||
|
||||
public org.compiere.model.I_M_InOutLine getM_InOutLine() throws RuntimeException;
|
||||
|
||||
/** Column name M_Locator_ID */
|
||||
public static final String COLUMNNAME_M_Locator_ID = "M_Locator_ID";
|
||||
|
||||
/** Set Locator.
|
||||
* Warehouse Locator
|
||||
*/
|
||||
public void setM_Locator_ID (int M_Locator_ID);
|
||||
|
||||
/** Get Locator.
|
||||
* Warehouse Locator
|
||||
*/
|
||||
public int getM_Locator_ID();
|
||||
|
||||
public I_M_Locator getM_Locator() throws RuntimeException;
|
||||
|
||||
/** Column name M_MatchInv_ID */
|
||||
public static final String COLUMNNAME_M_MatchInv_ID = "M_MatchInv_ID";
|
||||
|
||||
/** Set Match Invoice.
|
||||
* Match Shipment/Receipt to Invoice
|
||||
*/
|
||||
public void setM_MatchInv_ID (int M_MatchInv_ID);
|
||||
|
||||
/** Get Match Invoice.
|
||||
* Match Shipment/Receipt to Invoice
|
||||
*/
|
||||
public int getM_MatchInv_ID();
|
||||
|
||||
public org.compiere.model.I_M_MatchInv getM_MatchInv() throws RuntimeException;
|
||||
|
||||
/** Column name M_Product_ID */
|
||||
public static final String COLUMNNAME_M_Product_ID = "M_Product_ID";
|
||||
|
||||
/** Set Product.
|
||||
* Product, Service, Item
|
||||
*/
|
||||
public void setM_Product_ID (int M_Product_ID);
|
||||
|
||||
/** Get Product.
|
||||
* Product, Service, Item
|
||||
*/
|
||||
public int getM_Product_ID();
|
||||
|
||||
public org.compiere.model.I_M_Product getM_Product() throws RuntimeException;
|
||||
|
||||
/** Column name Posted */
|
||||
public static final String COLUMNNAME_Posted = "Posted";
|
||||
|
||||
/** Set Posted.
|
||||
* Posting status
|
||||
*/
|
||||
public void setPosted (boolean Posted);
|
||||
|
||||
/** Get Posted.
|
||||
* Posting status
|
||||
*/
|
||||
public boolean isPosted();
|
||||
|
||||
/** Column name PostingType */
|
||||
public static final String COLUMNNAME_PostingType = "PostingType";
|
||||
|
||||
|
@ -248,6 +610,41 @@ public interface I_A_Asset_Addition
|
|||
*/
|
||||
public String getPostingType();
|
||||
|
||||
/** 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 ProcessedOn */
|
||||
public static final String COLUMNNAME_ProcessedOn = "ProcessedOn";
|
||||
|
||||
/** Set Processed On.
|
||||
* The date+time (expressed in decimal format) when the document has been processed
|
||||
*/
|
||||
public void setProcessedOn (BigDecimal ProcessedOn);
|
||||
|
||||
/** Get Processed On.
|
||||
* The date+time (expressed in decimal format) when the document has been processed
|
||||
*/
|
||||
public BigDecimal getProcessedOn();
|
||||
|
||||
/** 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 Updated */
|
||||
public static final String COLUMNNAME_Updated = "Updated";
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_A_Asset_Change
|
|||
public static final String Table_Name = "A_Asset_Change";
|
||||
|
||||
/** AD_Table_ID=53133 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53133;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -44,10 +44,10 @@ public interface I_A_Asset_Change
|
|||
/** Column name A_Accumdepreciation_Acct */
|
||||
public static final String COLUMNNAME_A_Accumdepreciation_Acct = "A_Accumdepreciation_Acct";
|
||||
|
||||
/** Set Accumulated Depreciation */
|
||||
/** Set Accumulated Depreciation Account */
|
||||
public void setA_Accumdepreciation_Acct (int A_Accumdepreciation_Acct);
|
||||
|
||||
/** Get Accumulated Depreciation */
|
||||
/** Get Accumulated Depreciation Account */
|
||||
public int getA_Accumdepreciation_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Accumdepreciation_A() throws RuntimeException;
|
||||
|
@ -55,10 +55,10 @@ public interface I_A_Asset_Change
|
|||
/** Column name A_Asset_Acct */
|
||||
public static final String COLUMNNAME_A_Asset_Acct = "A_Asset_Acct";
|
||||
|
||||
/** Set Asset Cost Account */
|
||||
/** Set Asset Acct */
|
||||
public void setA_Asset_Acct (int A_Asset_Acct);
|
||||
|
||||
/** Get Asset Cost Account */
|
||||
/** Get Asset Acct */
|
||||
public int getA_Asset_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Asset_A() throws RuntimeException;
|
||||
|
@ -66,10 +66,10 @@ public interface I_A_Asset_Change
|
|||
/** Column name A_Asset_Acct_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Acct_ID = "A_Asset_Acct_ID";
|
||||
|
||||
/** Set Asset Acct. */
|
||||
/** Set A_Asset_Acct_ID */
|
||||
public void setA_Asset_Acct_ID (int A_Asset_Acct_ID);
|
||||
|
||||
/** Get Asset Acct. */
|
||||
/** Get A_Asset_Acct_ID */
|
||||
public int getA_Asset_Acct_ID();
|
||||
|
||||
/** Column name A_Asset_Addition_ID */
|
||||
|
@ -84,19 +84,28 @@ public interface I_A_Asset_Change
|
|||
/** Column name A_Asset_Change_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Change_ID = "A_Asset_Change_ID";
|
||||
|
||||
/** Set Asset Change */
|
||||
/** Set A_Asset_Change_ID */
|
||||
public void setA_Asset_Change_ID (int A_Asset_Change_ID);
|
||||
|
||||
/** Get Asset Change */
|
||||
/** Get A_Asset_Change_ID */
|
||||
public int getA_Asset_Change_ID();
|
||||
|
||||
/** Column name A_Asset_Change_UU */
|
||||
public static final String COLUMNNAME_A_Asset_Change_UU = "A_Asset_Change_UU";
|
||||
|
||||
/** Set A_Asset_Change_UU */
|
||||
public void setA_Asset_Change_UU (String A_Asset_Change_UU);
|
||||
|
||||
/** Get A_Asset_Change_UU */
|
||||
public String getA_Asset_Change_UU();
|
||||
|
||||
/** Column name A_Asset_CreateDate */
|
||||
public static final String COLUMNNAME_A_Asset_CreateDate = "A_Asset_CreateDate";
|
||||
|
||||
/** Set Asset Creation Date */
|
||||
/** Set Create Date */
|
||||
public void setA_Asset_CreateDate (Timestamp A_Asset_CreateDate);
|
||||
|
||||
/** Get Asset Creation Date */
|
||||
/** Get Create Date */
|
||||
public Timestamp getA_Asset_CreateDate();
|
||||
|
||||
/** Column name A_Asset_ID */
|
||||
|
@ -112,7 +121,7 @@ public interface I_A_Asset_Change
|
|||
*/
|
||||
public int getA_Asset_ID();
|
||||
|
||||
public I_A_Asset getA_Asset() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Asset getA_Asset() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_Retirement_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Retirement_ID = "A_Asset_Retirement_ID";
|
||||
|
@ -130,22 +139,22 @@ public interface I_A_Asset_Change
|
|||
/** Column name A_Asset_RevalDate */
|
||||
public static final String COLUMNNAME_A_Asset_RevalDate = "A_Asset_RevalDate";
|
||||
|
||||
/** Set Asset Reval. Date */
|
||||
/** Set Revaluation Date */
|
||||
public void setA_Asset_RevalDate (Timestamp A_Asset_RevalDate);
|
||||
|
||||
/** Get Asset Reval. Date */
|
||||
/** Get Revaluation Date */
|
||||
public Timestamp getA_Asset_RevalDate();
|
||||
|
||||
/** Column name A_Asset_Spread_Type */
|
||||
public static final String COLUMNNAME_A_Asset_Spread_Type = "A_Asset_Spread_Type";
|
||||
|
||||
/** Set Asset Spread Type */
|
||||
/** Set Spread Type */
|
||||
public void setA_Asset_Spread_Type (int A_Asset_Spread_Type);
|
||||
|
||||
/** Get Asset Spread Type */
|
||||
/** Get Spread Type */
|
||||
public int getA_Asset_Spread_Type();
|
||||
|
||||
public I_A_Asset_Spread getA_Asset_Spread_T() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Asset_Spread getA_Asset_Spread_T() throws RuntimeException;
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
@ -158,10 +167,10 @@ public interface I_A_Asset_Change
|
|||
/** Column name A_Depreciation_Acct */
|
||||
public static final String COLUMNNAME_A_Depreciation_Acct = "A_Depreciation_Acct";
|
||||
|
||||
/** Set Depreciation Expense Account */
|
||||
/** Set Depreciation Account */
|
||||
public void setA_Depreciation_Acct (int A_Depreciation_Acct);
|
||||
|
||||
/** Get Depreciation Expense Account */
|
||||
/** Get Depreciation Account */
|
||||
public int getA_Depreciation_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Depreciation_A() throws RuntimeException;
|
||||
|
@ -169,50 +178,50 @@ public interface I_A_Asset_Change
|
|||
/** Column name A_Depreciation_Calc_Type */
|
||||
public static final String COLUMNNAME_A_Depreciation_Calc_Type = "A_Depreciation_Calc_Type";
|
||||
|
||||
/** Set Depreciation Calculation Type */
|
||||
/** Set Calculation Type */
|
||||
public void setA_Depreciation_Calc_Type (int A_Depreciation_Calc_Type);
|
||||
|
||||
/** Get Depreciation Calculation Type */
|
||||
/** Get Calculation Type */
|
||||
public int getA_Depreciation_Calc_Type();
|
||||
|
||||
public I_A_Depreciation_Method getA_Depreciation_Calc_T() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Depreciation_Method getA_Depreciation_Calc_T() throws RuntimeException;
|
||||
|
||||
/** Column name A_Depreciation_Manual_Amount */
|
||||
public static final String COLUMNNAME_A_Depreciation_Manual_Amount = "A_Depreciation_Manual_Amount";
|
||||
|
||||
/** Set Depreciation Manual Amount */
|
||||
/** Set A_Depreciation_Manual_Amount */
|
||||
public void setA_Depreciation_Manual_Amount (BigDecimal A_Depreciation_Manual_Amount);
|
||||
|
||||
/** Get Depreciation Manual Amount */
|
||||
/** Get A_Depreciation_Manual_Amount */
|
||||
public BigDecimal getA_Depreciation_Manual_Amount();
|
||||
|
||||
/** Column name A_Depreciation_Manual_Period */
|
||||
public static final String COLUMNNAME_A_Depreciation_Manual_Period = "A_Depreciation_Manual_Period";
|
||||
|
||||
/** Set Depreciation Manual Period */
|
||||
/** Set A_Depreciation_Manual_Period */
|
||||
public void setA_Depreciation_Manual_Period (String A_Depreciation_Manual_Period);
|
||||
|
||||
/** Get Depreciation Manual Period */
|
||||
/** Get A_Depreciation_Manual_Period */
|
||||
public String getA_Depreciation_Manual_Period();
|
||||
|
||||
/** Column name A_Depreciation_Table_Header_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_Table_Header_ID = "A_Depreciation_Table_Header_ID";
|
||||
|
||||
/** Set Depreciation Table Header */
|
||||
/** Set A_Depreciation_Table_Header_ID */
|
||||
public void setA_Depreciation_Table_Header_ID (int A_Depreciation_Table_Header_ID);
|
||||
|
||||
/** Get Depreciation Table Header */
|
||||
/** Get A_Depreciation_Table_Header_ID */
|
||||
public int getA_Depreciation_Table_Header_ID();
|
||||
|
||||
public I_A_Depreciation_Table_Header getA_Depreciation_Table_Header() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Depreciation_Table_Header getA_Depreciation_Table_Header() throws RuntimeException;
|
||||
|
||||
/** Column name A_Depreciation_Variable_Perc */
|
||||
public static final String COLUMNNAME_A_Depreciation_Variable_Perc = "A_Depreciation_Variable_Perc";
|
||||
|
||||
/** Set Depreciation Variable Perc. */
|
||||
/** Set Variable Percent */
|
||||
public void setA_Depreciation_Variable_Perc (BigDecimal A_Depreciation_Variable_Perc);
|
||||
|
||||
/** Get Depreciation Variable Perc. */
|
||||
/** Get Variable Percent */
|
||||
public BigDecimal getA_Depreciation_Variable_Perc();
|
||||
|
||||
/** Column name A_Disposal_Loss */
|
||||
|
@ -226,6 +235,17 @@ public interface I_A_Asset_Change
|
|||
|
||||
public I_C_ValidCombination getA_Disposal_L() throws RuntimeException;
|
||||
|
||||
/** Column name A_Disposal_Loss_Acct */
|
||||
public static final String COLUMNNAME_A_Disposal_Loss_Acct = "A_Disposal_Loss_Acct";
|
||||
|
||||
/** Set Disposal Loss Acct */
|
||||
public void setA_Disposal_Loss_Acct (int A_Disposal_Loss_Acct);
|
||||
|
||||
/** Get Disposal Loss Acct */
|
||||
public int getA_Disposal_Loss_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Disposal_Loss_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Disposal_Revenue */
|
||||
public static final String COLUMNNAME_A_Disposal_Revenue = "A_Disposal_Revenue";
|
||||
|
||||
|
@ -237,6 +257,17 @@ public interface I_A_Asset_Change
|
|||
|
||||
public I_C_ValidCombination getA_Disposal_Reve() throws RuntimeException;
|
||||
|
||||
/** Column name A_Disposal_Revenue_Acct */
|
||||
public static final String COLUMNNAME_A_Disposal_Revenue_Acct = "A_Disposal_Revenue_Acct";
|
||||
|
||||
/** Set Disposal Revenue Acct */
|
||||
public void setA_Disposal_Revenue_Acct (int A_Disposal_Revenue_Acct);
|
||||
|
||||
/** Get Disposal Revenue Acct */
|
||||
public int getA_Disposal_Revenue_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Disposal_Revenue_A() throws RuntimeException;
|
||||
|
||||
/** Column name AD_Org_ID */
|
||||
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
|
||||
|
||||
|
@ -263,53 +294,53 @@ public interface I_A_Asset_Change
|
|||
*/
|
||||
public int getAD_User_ID();
|
||||
|
||||
public I_AD_User getAD_User() throws RuntimeException;
|
||||
public org.compiere.model.I_AD_User getAD_User() throws RuntimeException;
|
||||
|
||||
/** Column name A_Parent_Asset_ID */
|
||||
public static final String COLUMNNAME_A_Parent_Asset_ID = "A_Parent_Asset_ID";
|
||||
|
||||
/** Set Asset ID */
|
||||
/** Set Parent Asset */
|
||||
public void setA_Parent_Asset_ID (int A_Parent_Asset_ID);
|
||||
|
||||
/** Get Asset ID */
|
||||
/** Get Parent Asset */
|
||||
public int getA_Parent_Asset_ID();
|
||||
|
||||
public I_A_Asset getA_Parent_Asset() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Asset getA_Parent_Asset() throws RuntimeException;
|
||||
|
||||
/** Column name A_Period_End */
|
||||
public static final String COLUMNNAME_A_Period_End = "A_Period_End";
|
||||
|
||||
/** Set Period End */
|
||||
/** Set A_Period_End */
|
||||
public void setA_Period_End (int A_Period_End);
|
||||
|
||||
/** Get Period End */
|
||||
/** Get A_Period_End */
|
||||
public int getA_Period_End();
|
||||
|
||||
/** Column name A_Period_Start */
|
||||
public static final String COLUMNNAME_A_Period_Start = "A_Period_Start";
|
||||
|
||||
/** Set Period Start */
|
||||
/** Set A_Period_Start */
|
||||
public void setA_Period_Start (int A_Period_Start);
|
||||
|
||||
/** Get Period Start */
|
||||
/** Get A_Period_Start */
|
||||
public int getA_Period_Start();
|
||||
|
||||
/** Column name A_QTY_Current */
|
||||
public static final String COLUMNNAME_A_QTY_Current = "A_QTY_Current";
|
||||
|
||||
/** Set Quantity */
|
||||
/** Set Current Qty */
|
||||
public void setA_QTY_Current (BigDecimal A_QTY_Current);
|
||||
|
||||
/** Get Quantity */
|
||||
/** Get Current Qty */
|
||||
public BigDecimal getA_QTY_Current();
|
||||
|
||||
/** Column name A_QTY_Original */
|
||||
public static final String COLUMNNAME_A_QTY_Original = "A_QTY_Original";
|
||||
|
||||
/** Set Original Qty */
|
||||
/** Set A_QTY_Original */
|
||||
public void setA_QTY_Original (BigDecimal A_QTY_Original);
|
||||
|
||||
/** Get Original Qty */
|
||||
/** Get A_QTY_Original */
|
||||
public BigDecimal getA_QTY_Original();
|
||||
|
||||
/** Column name A_Reval_Accumdep_Offset_Cur */
|
||||
|
@ -330,13 +361,31 @@ public interface I_A_Asset_Change
|
|||
/** Get Revaluation Accumulated Depreciation Offset for Prior Year */
|
||||
public int getA_Reval_Accumdep_Offset_Prior();
|
||||
|
||||
/** Column name A_Reval_Adep_Offset_Cur_Acct */
|
||||
public static final String COLUMNNAME_A_Reval_Adep_Offset_Cur_Acct = "A_Reval_Adep_Offset_Cur_Acct";
|
||||
|
||||
/** Set A_Reval_Accumdep_Offset_Cur */
|
||||
public void setA_Reval_Adep_Offset_Cur_Acct (int A_Reval_Adep_Offset_Cur_Acct);
|
||||
|
||||
/** Get A_Reval_Accumdep_Offset_Cur */
|
||||
public int getA_Reval_Adep_Offset_Cur_Acct();
|
||||
|
||||
/** Column name A_Reval_Adep_Offset_Prior_Acct */
|
||||
public static final String COLUMNNAME_A_Reval_Adep_Offset_Prior_Acct = "A_Reval_Adep_Offset_Prior_Acct";
|
||||
|
||||
/** Set A_Reval_Accumdep_Offset_Prior */
|
||||
public void setA_Reval_Adep_Offset_Prior_Acct (int A_Reval_Adep_Offset_Prior_Acct);
|
||||
|
||||
/** Get A_Reval_Accumdep_Offset_Prior */
|
||||
public int getA_Reval_Adep_Offset_Prior_Acct();
|
||||
|
||||
/** Column name A_Reval_Cal_Method */
|
||||
public static final String COLUMNNAME_A_Reval_Cal_Method = "A_Reval_Cal_Method";
|
||||
|
||||
/** Set Revaluation Calculation Method */
|
||||
/** Set A_Reval_Cal_Method */
|
||||
public void setA_Reval_Cal_Method (String A_Reval_Cal_Method);
|
||||
|
||||
/** Get Revaluation Calculation Method */
|
||||
/** Get A_Reval_Cal_Method */
|
||||
public String getA_Reval_Cal_Method();
|
||||
|
||||
/** Column name A_Reval_Cost_Offset */
|
||||
|
@ -348,6 +397,15 @@ public interface I_A_Asset_Change
|
|||
/** Get Revaluation Cost Offset for Current Year */
|
||||
public int getA_Reval_Cost_Offset();
|
||||
|
||||
/** Column name A_Reval_Cost_Offset_Acct */
|
||||
public static final String COLUMNNAME_A_Reval_Cost_Offset_Acct = "A_Reval_Cost_Offset_Acct";
|
||||
|
||||
/** Set Reval Cost Offset Acct */
|
||||
public void setA_Reval_Cost_Offset_Acct (int A_Reval_Cost_Offset_Acct);
|
||||
|
||||
/** Get Reval Cost Offset Acct */
|
||||
public int getA_Reval_Cost_Offset_Acct();
|
||||
|
||||
/** Column name A_Reval_Cost_Offset_Prior */
|
||||
public static final String COLUMNNAME_A_Reval_Cost_Offset_Prior = "A_Reval_Cost_Offset_Prior";
|
||||
|
||||
|
@ -357,6 +415,15 @@ public interface I_A_Asset_Change
|
|||
/** Get Revaluation Cost Offset for Prior Year */
|
||||
public int getA_Reval_Cost_Offset_Prior();
|
||||
|
||||
/** Column name A_Reval_Cost_Offset_Prior_Acct */
|
||||
public static final String COLUMNNAME_A_Reval_Cost_Offset_Prior_Acct = "A_Reval_Cost_Offset_Prior_Acct";
|
||||
|
||||
/** Set Reval Cost Offset Prior Acct */
|
||||
public void setA_Reval_Cost_Offset_Prior_Acct (int A_Reval_Cost_Offset_Prior_Acct);
|
||||
|
||||
/** Get Reval Cost Offset Prior Acct */
|
||||
public int getA_Reval_Cost_Offset_Prior_Acct();
|
||||
|
||||
/** Column name A_Reval_Depexp_Offset */
|
||||
public static final String COLUMNNAME_A_Reval_Depexp_Offset = "A_Reval_Depexp_Offset";
|
||||
|
||||
|
@ -366,40 +433,49 @@ public interface I_A_Asset_Change
|
|||
/** Get Revaluation Expense Offs */
|
||||
public int getA_Reval_Depexp_Offset();
|
||||
|
||||
/** Column name A_Reval_Depexp_Offset_Acct */
|
||||
public static final String COLUMNNAME_A_Reval_Depexp_Offset_Acct = "A_Reval_Depexp_Offset_Acct";
|
||||
|
||||
/** Set Reval Depexp Offset Acct */
|
||||
public void setA_Reval_Depexp_Offset_Acct (int A_Reval_Depexp_Offset_Acct);
|
||||
|
||||
/** Get Reval Depexp Offset Acct */
|
||||
public int getA_Reval_Depexp_Offset_Acct();
|
||||
|
||||
/** Column name A_Salvage_Value */
|
||||
public static final String COLUMNNAME_A_Salvage_Value = "A_Salvage_Value";
|
||||
|
||||
/** Set Salvage Value */
|
||||
/** Set Asset Salvage Value */
|
||||
public void setA_Salvage_Value (BigDecimal A_Salvage_Value);
|
||||
|
||||
/** Get Salvage Value */
|
||||
/** Get Asset Salvage Value */
|
||||
public BigDecimal getA_Salvage_Value();
|
||||
|
||||
/** Column name A_Split_Percent */
|
||||
public static final String COLUMNNAME_A_Split_Percent = "A_Split_Percent";
|
||||
|
||||
/** Set Split Percentage */
|
||||
/** Set Split Percent */
|
||||
public void setA_Split_Percent (BigDecimal A_Split_Percent);
|
||||
|
||||
/** Get Split Percentage */
|
||||
/** Get Split Percent */
|
||||
public BigDecimal getA_Split_Percent();
|
||||
|
||||
/** Column name AssetAccumDepreciationAmt */
|
||||
public static final String COLUMNNAME_AssetAccumDepreciationAmt = "AssetAccumDepreciationAmt";
|
||||
|
||||
/** Set Asset Accum. Depreciation Amt. */
|
||||
/** Set AssetAccumDepreciationAmt */
|
||||
public void setAssetAccumDepreciationAmt (BigDecimal AssetAccumDepreciationAmt);
|
||||
|
||||
/** Get Asset Accum. Depreciation Amt. */
|
||||
/** Get AssetAccumDepreciationAmt */
|
||||
public BigDecimal getAssetAccumDepreciationAmt();
|
||||
|
||||
/** Column name AssetBookValueAmt */
|
||||
public static final String COLUMNNAME_AssetBookValueAmt = "AssetBookValueAmt";
|
||||
|
||||
/** Set Asset Book value amt. */
|
||||
/** Set AssetBookValueAmt */
|
||||
public void setAssetBookValueAmt (BigDecimal AssetBookValueAmt);
|
||||
|
||||
/** Get Asset Book value amt. */
|
||||
/** Get AssetBookValueAmt */
|
||||
public BigDecimal getAssetBookValueAmt();
|
||||
|
||||
/** Column name AssetDepreciationDate */
|
||||
|
@ -480,7 +556,7 @@ public interface I_A_Asset_Change
|
|||
*/
|
||||
public int getC_AcctSchema_ID();
|
||||
|
||||
public I_C_AcctSchema getC_AcctSchema() throws RuntimeException;
|
||||
public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException;
|
||||
|
||||
/** Column name C_BPartner_ID */
|
||||
public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID";
|
||||
|
@ -495,6 +571,8 @@ public interface I_A_Asset_Change
|
|||
*/
|
||||
public int getC_BPartner_ID();
|
||||
|
||||
public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException;
|
||||
|
||||
/** Column name C_BPartner_Location_ID */
|
||||
public static final String COLUMNNAME_C_BPartner_Location_ID = "C_BPartner_Location_ID";
|
||||
|
||||
|
@ -508,7 +586,7 @@ public interface I_A_Asset_Change
|
|||
*/
|
||||
public int getC_BPartner_Location_ID();
|
||||
|
||||
public I_C_BPartner_Location getC_BPartner_Location() throws RuntimeException;
|
||||
public org.compiere.model.I_C_BPartner_Location getC_BPartner_Location() throws RuntimeException;
|
||||
|
||||
/** Column name ChangeAmt */
|
||||
public static final String COLUMNNAME_ChangeAmt = "ChangeAmt";
|
||||
|
@ -561,7 +639,7 @@ public interface I_A_Asset_Change
|
|||
/** Get ConventionType */
|
||||
public int getConventionType();
|
||||
|
||||
public I_A_Depreciation_Convention getConventionT() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Depreciation_Convention getConventionT() throws RuntimeException;
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
@ -616,7 +694,7 @@ public interface I_A_Asset_Change
|
|||
/** Get DepreciationType */
|
||||
public int getDepreciationType();
|
||||
|
||||
public I_A_Depreciation getDepreciationT() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Depreciation getDepreciationT() throws RuntimeException;
|
||||
|
||||
/** Column name IsActive */
|
||||
public static final String COLUMNNAME_IsActive = "IsActive";
|
||||
|
|
|
@ -0,0 +1,229 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2007 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 A_Asset_Class
|
||||
* @author Adempiere (generated)
|
||||
* @version Release 3.6.0LTS
|
||||
*/
|
||||
public interface I_A_Asset_Class
|
||||
{
|
||||
|
||||
/** TableName=A_Asset_Class */
|
||||
public static final String Table_Name = "A_Asset_Class";
|
||||
|
||||
/** AD_Table_ID=53269 */
|
||||
public static final int Table_ID = 53269;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
/** AccessLevel = 7 - System - Client - Org
|
||||
*/
|
||||
BigDecimal accessLevel = BigDecimal.valueOf(7);
|
||||
|
||||
/** Load Meta Data */
|
||||
|
||||
/** Column name A_Asset_Class_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Class_ID = "A_Asset_Class_ID";
|
||||
|
||||
/** Set Asset class */
|
||||
public void setA_Asset_Class_ID (int A_Asset_Class_ID);
|
||||
|
||||
/** Get Asset class */
|
||||
public int getA_Asset_Class_ID();
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
||||
/** Get Client.
|
||||
* Client/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 client
|
||||
*/
|
||||
public void setAD_Org_ID (int AD_Org_ID);
|
||||
|
||||
/** Get Organization.
|
||||
* Organizational entity within client
|
||||
*/
|
||||
public int getAD_Org_ID();
|
||||
|
||||
/** Column name A_Life_Period_2004 */
|
||||
public static final String COLUMNNAME_A_Life_Period_2004 = "A_Life_Period_2004";
|
||||
|
||||
/** Set Life Periods 2004 (min) */
|
||||
public void setA_Life_Period_2004 (int A_Life_Period_2004);
|
||||
|
||||
/** Get Life Periods 2004 (min) */
|
||||
public int getA_Life_Period_2004();
|
||||
|
||||
/** Column name A_Life_Period_Max */
|
||||
public static final String COLUMNNAME_A_Life_Period_Max = "A_Life_Period_Max";
|
||||
|
||||
/** Set Life periods (max) */
|
||||
public void setA_Life_Period_Max (int A_Life_Period_Max);
|
||||
|
||||
/** Get Life periods (max) */
|
||||
public int getA_Life_Period_Max();
|
||||
|
||||
/** Column name A_Life_Period_Min */
|
||||
public static final String COLUMNNAME_A_Life_Period_Min = "A_Life_Period_Min";
|
||||
|
||||
/** Set Life periods (min) */
|
||||
public void setA_Life_Period_Min (int A_Life_Period_Min);
|
||||
|
||||
/** Get Life periods (min) */
|
||||
public int getA_Life_Period_Min();
|
||||
|
||||
/** Column name A_Value_2004 */
|
||||
public static final String COLUMNNAME_A_Value_2004 = "A_Value_2004";
|
||||
|
||||
/** Set Value 2004 */
|
||||
public void setA_Value_2004 (String A_Value_2004);
|
||||
|
||||
/** Get Value 2004 */
|
||||
public String getA_Value_2004();
|
||||
|
||||
/** 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 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 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 MFX_Clasa */
|
||||
public static final String COLUMNNAME_MFX_Clasa = "MFX_Clasa";
|
||||
|
||||
/** Set Fixed Asset Class */
|
||||
public void setMFX_Clasa (int MFX_Clasa);
|
||||
|
||||
/** Get Fixed Asset Class */
|
||||
public int getMFX_Clasa();
|
||||
|
||||
/** Column name MFX_Grupa */
|
||||
public static final String COLUMNNAME_MFX_Grupa = "MFX_Grupa";
|
||||
|
||||
/** Set Fixed Asset Group */
|
||||
public void setMFX_Grupa (int MFX_Grupa);
|
||||
|
||||
/** Get Fixed Asset Group */
|
||||
public int getMFX_Grupa();
|
||||
|
||||
/** Column name MFX_SubClasa */
|
||||
public static final String COLUMNNAME_MFX_SubClasa = "MFX_SubClasa";
|
||||
|
||||
/** Set Fixed Asset Subclass */
|
||||
public void setMFX_SubClasa (int MFX_SubClasa);
|
||||
|
||||
/** Get Fixed Asset Subclass */
|
||||
public int getMFX_SubClasa();
|
||||
|
||||
/** Column name MFX_SubGrupa */
|
||||
public static final String COLUMNNAME_MFX_SubGrupa = "MFX_SubGrupa";
|
||||
|
||||
/** Set Fixed Asset Subgroup */
|
||||
public void setMFX_SubGrupa (int MFX_SubGrupa);
|
||||
|
||||
/** Get Fixed Asset Subgroup */
|
||||
public int getMFX_SubGrupa();
|
||||
|
||||
/** Column name Name */
|
||||
public static final String COLUMNNAME_Name = "Name";
|
||||
|
||||
/** Set Name.
|
||||
* Alphanumeric identifier of the entity
|
||||
*/
|
||||
public void setName (String Name);
|
||||
|
||||
/** Get Name.
|
||||
* Alphanumeric identifier of the entity
|
||||
*/
|
||||
public String getName();
|
||||
|
||||
/** 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();
|
||||
|
||||
/** Column name Value */
|
||||
public static final String COLUMNNAME_Value = "Value";
|
||||
|
||||
/** Set Search Key.
|
||||
* Search key for the record in the format required - must be unique
|
||||
*/
|
||||
public void setValue (String Value);
|
||||
|
||||
/** Get Search Key.
|
||||
* Search key for the record in the format required - must be unique
|
||||
*/
|
||||
public String getValue();
|
||||
}
|
|
@ -31,7 +31,7 @@ public interface I_A_Asset_Delivery
|
|||
public static final String Table_Name = "A_Asset_Delivery";
|
||||
|
||||
/** AD_Table_ID=541 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 541;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -54,6 +54,15 @@ public interface I_A_Asset_Delivery
|
|||
*/
|
||||
public int getA_Asset_Delivery_ID();
|
||||
|
||||
/** Column name A_Asset_Delivery_UU */
|
||||
public static final String COLUMNNAME_A_Asset_Delivery_UU = "A_Asset_Delivery_UU";
|
||||
|
||||
/** Set A_Asset_Delivery_UU */
|
||||
public void setA_Asset_Delivery_UU (String A_Asset_Delivery_UU);
|
||||
|
||||
/** Get A_Asset_Delivery_UU */
|
||||
public String getA_Asset_Delivery_UU();
|
||||
|
||||
/** Column name A_Asset_ID */
|
||||
public static final String COLUMNNAME_A_Asset_ID = "A_Asset_ID";
|
||||
|
||||
|
@ -67,7 +76,7 @@ public interface I_A_Asset_Delivery
|
|||
*/
|
||||
public int getA_Asset_ID();
|
||||
|
||||
public I_A_Asset getA_Asset() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Asset getA_Asset() throws RuntimeException;
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
@ -103,7 +112,7 @@ public interface I_A_Asset_Delivery
|
|||
*/
|
||||
public int getAD_User_ID();
|
||||
|
||||
public I_AD_User getAD_User() throws RuntimeException;
|
||||
public org.compiere.model.I_AD_User getAD_User() throws RuntimeException;
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
@ -212,7 +221,7 @@ public interface I_A_Asset_Delivery
|
|||
*/
|
||||
public int getM_InOutLine_ID();
|
||||
|
||||
public I_M_InOutLine getM_InOutLine() throws RuntimeException;
|
||||
public org.compiere.model.I_M_InOutLine getM_InOutLine() throws RuntimeException;
|
||||
|
||||
/** Column name MovementDate */
|
||||
public static final String COLUMNNAME_MovementDate = "MovementDate";
|
||||
|
@ -240,7 +249,7 @@ public interface I_A_Asset_Delivery
|
|||
*/
|
||||
public int getM_ProductDownload_ID();
|
||||
|
||||
public I_M_ProductDownload getM_ProductDownload() throws RuntimeException;
|
||||
public org.compiere.model.I_M_ProductDownload getM_ProductDownload() throws RuntimeException;
|
||||
|
||||
/** Column name Referrer */
|
||||
public static final String COLUMNNAME_Referrer = "Referrer";
|
||||
|
@ -314,12 +323,12 @@ public interface I_A_Asset_Delivery
|
|||
public static final String COLUMNNAME_URL = "URL";
|
||||
|
||||
/** Set URL.
|
||||
* Full URL address - e.g. http://www.adempiere.org
|
||||
* Full URL address - e.g. http://www.idempiere.org
|
||||
*/
|
||||
public void setURL (String URL);
|
||||
|
||||
/** Get URL.
|
||||
* Full URL address - e.g. http://www.adempiere.org
|
||||
* Full URL address - e.g. http://www.idempiere.org
|
||||
*/
|
||||
public String getURL();
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_A_Asset_Disposed
|
|||
public static final String Table_Name = "A_Asset_Disposed";
|
||||
|
||||
/** AD_Table_ID=53127 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53127;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -41,15 +41,60 @@ public interface I_A_Asset_Disposed
|
|||
|
||||
/** Load Meta Data */
|
||||
|
||||
/** Column name A_Accumulated_Depr */
|
||||
public static final String COLUMNNAME_A_Accumulated_Depr = "A_Accumulated_Depr";
|
||||
|
||||
/** Set Accumulated Depreciation */
|
||||
public void setA_Accumulated_Depr (BigDecimal A_Accumulated_Depr);
|
||||
|
||||
/** Get Accumulated Depreciation */
|
||||
public BigDecimal getA_Accumulated_Depr();
|
||||
|
||||
/** Column name A_Accumulated_Depr_Delta */
|
||||
public static final String COLUMNNAME_A_Accumulated_Depr_Delta = "A_Accumulated_Depr_Delta";
|
||||
|
||||
/** Set Accumulated Depreciation (delta) */
|
||||
public void setA_Accumulated_Depr_Delta (BigDecimal A_Accumulated_Depr_Delta);
|
||||
|
||||
/** Get Accumulated Depreciation (delta) */
|
||||
public BigDecimal getA_Accumulated_Depr_Delta();
|
||||
|
||||
/** Column name A_Activation_Method */
|
||||
public static final String COLUMNNAME_A_Activation_Method = "A_Activation_Method";
|
||||
|
||||
/** Set Activation Method */
|
||||
public void setA_Activation_Method (String A_Activation_Method);
|
||||
|
||||
/** Get Activation Method */
|
||||
public String getA_Activation_Method();
|
||||
|
||||
/** Column name A_Asset_Cost */
|
||||
public static final String COLUMNNAME_A_Asset_Cost = "A_Asset_Cost";
|
||||
|
||||
/** Set Asset Cost */
|
||||
public void setA_Asset_Cost (BigDecimal A_Asset_Cost);
|
||||
|
||||
/** Get Asset Cost */
|
||||
public BigDecimal getA_Asset_Cost();
|
||||
|
||||
/** Column name A_Asset_Disposed_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Disposed_ID = "A_Asset_Disposed_ID";
|
||||
|
||||
/** Set Disposed Asset */
|
||||
/** Set Asset Disposed */
|
||||
public void setA_Asset_Disposed_ID (int A_Asset_Disposed_ID);
|
||||
|
||||
/** Get Disposed Asset */
|
||||
/** Get Asset Disposed */
|
||||
public int getA_Asset_Disposed_ID();
|
||||
|
||||
/** Column name A_Asset_Disposed_UU */
|
||||
public static final String COLUMNNAME_A_Asset_Disposed_UU = "A_Asset_Disposed_UU";
|
||||
|
||||
/** Set A_Asset_Disposed_UU */
|
||||
public void setA_Asset_Disposed_UU (String A_Asset_Disposed_UU);
|
||||
|
||||
/** Get A_Asset_Disposed_UU */
|
||||
public String getA_Asset_Disposed_UU();
|
||||
|
||||
/** Column name A_Asset_ID */
|
||||
public static final String COLUMNNAME_A_Asset_ID = "A_Asset_ID";
|
||||
|
||||
|
@ -63,6 +108,17 @@ public interface I_A_Asset_Disposed
|
|||
*/
|
||||
public int getA_Asset_ID();
|
||||
|
||||
public org.compiere.model.I_A_Asset getA_Asset() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_Status */
|
||||
public static final String COLUMNNAME_A_Asset_Status = "A_Asset_Status";
|
||||
|
||||
/** Set Asset Status */
|
||||
public void setA_Asset_Status (String A_Asset_Status);
|
||||
|
||||
/** Get Asset Status */
|
||||
public String getA_Asset_Status();
|
||||
|
||||
/** Column name A_Asset_Trade_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Trade_ID = "A_Asset_Trade_ID";
|
||||
|
||||
|
@ -72,7 +128,7 @@ public interface I_A_Asset_Disposed
|
|||
/** Get Asset Trade */
|
||||
public int getA_Asset_Trade_ID();
|
||||
|
||||
public I_A_Asset getA_Asset_Trade() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Asset getA_Asset_Trade() throws RuntimeException;
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
@ -82,6 +138,15 @@ public interface I_A_Asset_Disposed
|
|||
*/
|
||||
public int getAD_Client_ID();
|
||||
|
||||
/** Column name A_Disposal_Amt */
|
||||
public static final String COLUMNNAME_A_Disposal_Amt = "A_Disposal_Amt";
|
||||
|
||||
/** Set Disposal Amount */
|
||||
public void setA_Disposal_Amt (BigDecimal A_Disposal_Amt);
|
||||
|
||||
/** Get Disposal Amount */
|
||||
public BigDecimal getA_Disposal_Amt();
|
||||
|
||||
/** Column name A_Disposed_Date */
|
||||
public static final String COLUMNNAME_A_Disposed_Date = "A_Disposed_Date";
|
||||
|
||||
|
@ -94,19 +159,19 @@ public interface I_A_Asset_Disposed
|
|||
/** Column name A_Disposed_Method */
|
||||
public static final String COLUMNNAME_A_Disposed_Method = "A_Disposed_Method";
|
||||
|
||||
/** Set Disposal Method */
|
||||
/** Set Disposed Method */
|
||||
public void setA_Disposed_Method (String A_Disposed_Method);
|
||||
|
||||
/** Get Disposal Method */
|
||||
/** Get Disposed Method */
|
||||
public String getA_Disposed_Method();
|
||||
|
||||
/** Column name A_Disposed_Reason */
|
||||
public static final String COLUMNNAME_A_Disposed_Reason = "A_Disposed_Reason";
|
||||
|
||||
/** Set Disposed Reason Code */
|
||||
/** Set Disposed Reason */
|
||||
public void setA_Disposed_Reason (String A_Disposed_Reason);
|
||||
|
||||
/** Get Disposed Reason Code */
|
||||
/** Get Disposed Reason */
|
||||
public String getA_Disposed_Reason();
|
||||
|
||||
/** Column name AD_Org_ID */
|
||||
|
@ -125,12 +190,42 @@ public interface I_A_Asset_Disposed
|
|||
/** Column name A_Proceeds */
|
||||
public static final String COLUMNNAME_A_Proceeds = "A_Proceeds";
|
||||
|
||||
/** Set Proceeds */
|
||||
/** Set Asset Proceeds */
|
||||
public void setA_Proceeds (BigDecimal A_Proceeds);
|
||||
|
||||
/** Get Proceeds */
|
||||
/** Get Asset Proceeds */
|
||||
public BigDecimal getA_Proceeds();
|
||||
|
||||
/** Column name C_Invoice_ID */
|
||||
public static final String COLUMNNAME_C_Invoice_ID = "C_Invoice_ID";
|
||||
|
||||
/** Set Invoice.
|
||||
* Invoice Identifier
|
||||
*/
|
||||
public void setC_Invoice_ID (int C_Invoice_ID);
|
||||
|
||||
/** Get Invoice.
|
||||
* Invoice Identifier
|
||||
*/
|
||||
public int getC_Invoice_ID();
|
||||
|
||||
public org.compiere.model.I_C_Invoice getC_Invoice() throws RuntimeException;
|
||||
|
||||
/** Column name C_InvoiceLine_ID */
|
||||
public static final String COLUMNNAME_C_InvoiceLine_ID = "C_InvoiceLine_ID";
|
||||
|
||||
/** Set Invoice Line.
|
||||
* Invoice Detail Line
|
||||
*/
|
||||
public void setC_InvoiceLine_ID (int C_InvoiceLine_ID);
|
||||
|
||||
/** Get Invoice Line.
|
||||
* Invoice Detail Line
|
||||
*/
|
||||
public int getC_InvoiceLine_ID();
|
||||
|
||||
public org.compiere.model.I_C_InvoiceLine getC_InvoiceLine() throws RuntimeException;
|
||||
|
||||
/** Column name C_Period_ID */
|
||||
public static final String COLUMNNAME_C_Period_ID = "C_Period_ID";
|
||||
|
||||
|
@ -144,7 +239,7 @@ public interface I_A_Asset_Disposed
|
|||
*/
|
||||
public int getC_Period_ID();
|
||||
|
||||
public I_C_Period getC_Period() throws RuntimeException;
|
||||
public org.compiere.model.I_C_Period getC_Period() throws RuntimeException;
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
@ -188,6 +283,67 @@ public interface I_A_Asset_Disposed
|
|||
*/
|
||||
public Timestamp getDateDoc();
|
||||
|
||||
/** 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 Expense */
|
||||
public static final String COLUMNNAME_Expense = "Expense";
|
||||
|
||||
/** Set Expense */
|
||||
public void setExpense (BigDecimal Expense);
|
||||
|
||||
/** Get Expense */
|
||||
public BigDecimal getExpense();
|
||||
|
||||
/** Column name IsActive */
|
||||
public static final String COLUMNNAME_IsActive = "IsActive";
|
||||
|
||||
|
@ -201,6 +357,58 @@ public interface I_A_Asset_Disposed
|
|||
*/
|
||||
public boolean isActive();
|
||||
|
||||
/** Column name IsApproved */
|
||||
public static final String COLUMNNAME_IsApproved = "IsApproved";
|
||||
|
||||
/** Set Approved.
|
||||
* Indicates if this document requires approval
|
||||
*/
|
||||
public void setIsApproved (boolean IsApproved);
|
||||
|
||||
/** Get Approved.
|
||||
* Indicates if this document requires approval
|
||||
*/
|
||||
public boolean isApproved();
|
||||
|
||||
/** Column name IsDisposed */
|
||||
public static final String COLUMNNAME_IsDisposed = "IsDisposed";
|
||||
|
||||
/** Set Disposed.
|
||||
* The asset is disposed
|
||||
*/
|
||||
public void setIsDisposed (boolean IsDisposed);
|
||||
|
||||
/** Get Disposed.
|
||||
* The asset is disposed
|
||||
*/
|
||||
public boolean isDisposed();
|
||||
|
||||
/** Column name Posted */
|
||||
public static final String COLUMNNAME_Posted = "Posted";
|
||||
|
||||
/** Set Posted.
|
||||
* Posting status
|
||||
*/
|
||||
public void setPosted (boolean Posted);
|
||||
|
||||
/** Get Posted.
|
||||
* Posting status
|
||||
*/
|
||||
public boolean isPosted();
|
||||
|
||||
/** Column name PostingType */
|
||||
public static final String COLUMNNAME_PostingType = "PostingType";
|
||||
|
||||
/** Set PostingType.
|
||||
* The type of posted amount for the transaction
|
||||
*/
|
||||
public void setPostingType (String PostingType);
|
||||
|
||||
/** Get PostingType.
|
||||
* The type of posted amount for the transaction
|
||||
*/
|
||||
public String getPostingType();
|
||||
|
||||
/** Column name Processed */
|
||||
public static final String COLUMNNAME_Processed = "Processed";
|
||||
|
||||
|
@ -214,6 +422,19 @@ public interface I_A_Asset_Disposed
|
|||
*/
|
||||
public boolean isProcessed();
|
||||
|
||||
/** Column name ProcessedOn */
|
||||
public static final String COLUMNNAME_ProcessedOn = "ProcessedOn";
|
||||
|
||||
/** Set Processed On.
|
||||
* The date+time (expressed in decimal format) when the document has been processed
|
||||
*/
|
||||
public void setProcessedOn (BigDecimal ProcessedOn);
|
||||
|
||||
/** Get Processed On.
|
||||
* The date+time (expressed in decimal format) when the document has been processed
|
||||
*/
|
||||
public BigDecimal getProcessedOn();
|
||||
|
||||
/** Column name Processing */
|
||||
public static final String COLUMNNAME_Processing = "Processing";
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_A_Asset_Group
|
|||
public static final String Table_Name = "A_Asset_Group";
|
||||
|
||||
/** AD_Table_ID=542 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 542;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -41,6 +41,17 @@ public interface I_A_Asset_Group
|
|||
|
||||
/** Load Meta Data */
|
||||
|
||||
/** Column name A_Asset_Class_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Class_ID = "A_Asset_Class_ID";
|
||||
|
||||
/** Set Asset class */
|
||||
public void setA_Asset_Class_ID (int A_Asset_Class_ID);
|
||||
|
||||
/** Get Asset class */
|
||||
public int getA_Asset_Class_ID();
|
||||
|
||||
public org.compiere.model.I_A_Asset_Class getA_Asset_Class() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_Group_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Group_ID = "A_Asset_Group_ID";
|
||||
|
||||
|
@ -54,6 +65,26 @@ public interface I_A_Asset_Group
|
|||
*/
|
||||
public int getA_Asset_Group_ID();
|
||||
|
||||
/** Column name A_Asset_Group_UU */
|
||||
public static final String COLUMNNAME_A_Asset_Group_UU = "A_Asset_Group_UU";
|
||||
|
||||
/** Set A_Asset_Group_UU */
|
||||
public void setA_Asset_Group_UU (String A_Asset_Group_UU);
|
||||
|
||||
/** Get A_Asset_Group_UU */
|
||||
public String getA_Asset_Group_UU();
|
||||
|
||||
/** Column name A_Asset_Type_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Type_ID = "A_Asset_Type_ID";
|
||||
|
||||
/** Set Asset Type */
|
||||
public void setA_Asset_Type_ID (int A_Asset_Type_ID);
|
||||
|
||||
/** Get Asset Type */
|
||||
public int getA_Asset_Type_ID();
|
||||
|
||||
public org.compiere.model.I_A_Asset_Type getA_Asset_Type() throws RuntimeException;
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
||||
|
@ -143,6 +174,19 @@ public interface I_A_Asset_Group
|
|||
*/
|
||||
public boolean isCreateAsActive();
|
||||
|
||||
/** Column name IsDefault */
|
||||
public static final String COLUMNNAME_IsDefault = "IsDefault";
|
||||
|
||||
/** Set Default.
|
||||
* Default value
|
||||
*/
|
||||
public void setIsDefault (boolean IsDefault);
|
||||
|
||||
/** Get Default.
|
||||
* Default value
|
||||
*/
|
||||
public boolean isDefault();
|
||||
|
||||
/** Column name IsDepreciated */
|
||||
public static final String COLUMNNAME_IsDepreciated = "IsDepreciated";
|
||||
|
||||
|
@ -156,6 +200,15 @@ public interface I_A_Asset_Group
|
|||
*/
|
||||
public boolean isDepreciated();
|
||||
|
||||
/** Column name IsFixedAsset */
|
||||
public static final String COLUMNNAME_IsFixedAsset = "IsFixedAsset";
|
||||
|
||||
/** Set IsFixedAsset */
|
||||
public void setIsFixedAsset (boolean IsFixedAsset);
|
||||
|
||||
/** Get IsFixedAsset */
|
||||
public boolean isFixedAsset();
|
||||
|
||||
/** Column name IsOneAssetPerUOM */
|
||||
public static final String COLUMNNAME_IsOneAssetPerUOM = "IsOneAssetPerUOM";
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_A_Asset_Group_Acct
|
|||
public static final String Table_Name = "A_Asset_Group_Acct";
|
||||
|
||||
/** AD_Table_ID=53130 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53130;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -44,10 +44,10 @@ public interface I_A_Asset_Group_Acct
|
|||
/** Column name A_Accumdepreciation_Acct */
|
||||
public static final String COLUMNNAME_A_Accumdepreciation_Acct = "A_Accumdepreciation_Acct";
|
||||
|
||||
/** Set Accumulated Depreciation */
|
||||
/** Set Accumulated Depreciation Account */
|
||||
public void setA_Accumdepreciation_Acct (int A_Accumdepreciation_Acct);
|
||||
|
||||
/** Get Accumulated Depreciation */
|
||||
/** Get Accumulated Depreciation Account */
|
||||
public int getA_Accumdepreciation_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Accumdepreciation_A() throws RuntimeException;
|
||||
|
@ -55,10 +55,10 @@ public interface I_A_Asset_Group_Acct
|
|||
/** Column name A_Asset_Acct */
|
||||
public static final String COLUMNNAME_A_Asset_Acct = "A_Asset_Acct";
|
||||
|
||||
/** Set Asset Cost Account */
|
||||
/** Set Asset Acct */
|
||||
public void setA_Asset_Acct (int A_Asset_Acct);
|
||||
|
||||
/** Get Asset Cost Account */
|
||||
/** Get Asset Acct */
|
||||
public int getA_Asset_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Asset_A() throws RuntimeException;
|
||||
|
@ -66,12 +66,21 @@ public interface I_A_Asset_Group_Acct
|
|||
/** Column name A_Asset_Group_Acct_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Group_Acct_ID = "A_Asset_Group_Acct_ID";
|
||||
|
||||
/** Set Asset Group Acct. */
|
||||
/** Set Asset Group Accounting */
|
||||
public void setA_Asset_Group_Acct_ID (int A_Asset_Group_Acct_ID);
|
||||
|
||||
/** Get Asset Group Acct. */
|
||||
/** Get Asset Group Accounting */
|
||||
public int getA_Asset_Group_Acct_ID();
|
||||
|
||||
/** Column name A_Asset_Group_Acct_UU */
|
||||
public static final String COLUMNNAME_A_Asset_Group_Acct_UU = "A_Asset_Group_Acct_UU";
|
||||
|
||||
/** Set A_Asset_Group_Acct_UU */
|
||||
public void setA_Asset_Group_Acct_UU (String A_Asset_Group_Acct_UU);
|
||||
|
||||
/** Get A_Asset_Group_Acct_UU */
|
||||
public String getA_Asset_Group_Acct_UU();
|
||||
|
||||
/** Column name A_Asset_Group_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Group_ID = "A_Asset_Group_ID";
|
||||
|
||||
|
@ -85,18 +94,18 @@ public interface I_A_Asset_Group_Acct
|
|||
*/
|
||||
public int getA_Asset_Group_ID();
|
||||
|
||||
public I_A_Asset_Group getA_Asset_Group() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Asset_Group getA_Asset_Group() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_Spread_Type */
|
||||
public static final String COLUMNNAME_A_Asset_Spread_Type = "A_Asset_Spread_Type";
|
||||
|
||||
/** Set Asset Spread Type */
|
||||
/** Set Spread Type */
|
||||
public void setA_Asset_Spread_Type (int A_Asset_Spread_Type);
|
||||
|
||||
/** Get Asset Spread Type */
|
||||
/** Get Spread Type */
|
||||
public int getA_Asset_Spread_Type();
|
||||
|
||||
public I_A_Asset_Spread getA_Asset_Spread_T() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Asset_Spread getA_Asset_Spread_T() throws RuntimeException;
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
@ -109,10 +118,10 @@ public interface I_A_Asset_Group_Acct
|
|||
/** Column name A_Depreciation_Acct */
|
||||
public static final String COLUMNNAME_A_Depreciation_Acct = "A_Depreciation_Acct";
|
||||
|
||||
/** Set Depreciation Expense Account */
|
||||
/** Set Depreciation Account */
|
||||
public void setA_Depreciation_Acct (int A_Depreciation_Acct);
|
||||
|
||||
/** Get Depreciation Expense Account */
|
||||
/** Get Depreciation Account */
|
||||
public int getA_Depreciation_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Depreciation_A() throws RuntimeException;
|
||||
|
@ -120,61 +129,127 @@ public interface I_A_Asset_Group_Acct
|
|||
/** Column name A_Depreciation_Calc_Type */
|
||||
public static final String COLUMNNAME_A_Depreciation_Calc_Type = "A_Depreciation_Calc_Type";
|
||||
|
||||
/** Set Depreciation Calculation Type */
|
||||
/** Set Calculation Type */
|
||||
public void setA_Depreciation_Calc_Type (int A_Depreciation_Calc_Type);
|
||||
|
||||
/** Get Depreciation Calculation Type */
|
||||
/** Get Calculation Type */
|
||||
public int getA_Depreciation_Calc_Type();
|
||||
|
||||
public I_A_Depreciation_Method getA_Depreciation_Calc_T() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Depreciation_Method getA_Depreciation_Calc_T() throws RuntimeException;
|
||||
|
||||
/** Column name A_Depreciation_Conv_F_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_Conv_F_ID = "A_Depreciation_Conv_F_ID";
|
||||
|
||||
/** Set Depreciation Convention (fiscal) */
|
||||
public void setA_Depreciation_Conv_F_ID (int A_Depreciation_Conv_F_ID);
|
||||
|
||||
/** Get Depreciation Convention (fiscal) */
|
||||
public int getA_Depreciation_Conv_F_ID();
|
||||
|
||||
public org.compiere.model.I_A_Depreciation_Convention getA_Depreciation_Conv_F() throws RuntimeException;
|
||||
|
||||
/** Column name A_Depreciation_Conv_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_Conv_ID = "A_Depreciation_Conv_ID";
|
||||
|
||||
/** Set Convention Type */
|
||||
public void setA_Depreciation_Conv_ID (int A_Depreciation_Conv_ID);
|
||||
|
||||
/** Get Convention Type */
|
||||
public int getA_Depreciation_Conv_ID();
|
||||
|
||||
public org.compiere.model.I_A_Depreciation_Convention getA_Depreciation_Conv() throws RuntimeException;
|
||||
|
||||
/** Column name A_Depreciation_F_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_F_ID = "A_Depreciation_F_ID";
|
||||
|
||||
/** Set Depreciation (fiscal) */
|
||||
public void setA_Depreciation_F_ID (int A_Depreciation_F_ID);
|
||||
|
||||
/** Get Depreciation (fiscal) */
|
||||
public int getA_Depreciation_F_ID();
|
||||
|
||||
public org.compiere.model.I_A_Depreciation getA_Depreciation_F() throws RuntimeException;
|
||||
|
||||
/** Column name A_Depreciation_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_ID = "A_Depreciation_ID";
|
||||
|
||||
/** Set Depreciation Type */
|
||||
/** Set Depreciation */
|
||||
public void setA_Depreciation_ID (int A_Depreciation_ID);
|
||||
|
||||
/** Get Depreciation Type */
|
||||
/** Get Depreciation */
|
||||
public int getA_Depreciation_ID();
|
||||
|
||||
public org.compiere.model.I_A_Depreciation getA_Depreciation() throws RuntimeException;
|
||||
|
||||
/** Column name A_Depreciation_Manual_Amount */
|
||||
public static final String COLUMNNAME_A_Depreciation_Manual_Amount = "A_Depreciation_Manual_Amount";
|
||||
|
||||
/** Set Depreciation Manual Amount */
|
||||
/** Set A_Depreciation_Manual_Amount */
|
||||
public void setA_Depreciation_Manual_Amount (BigDecimal A_Depreciation_Manual_Amount);
|
||||
|
||||
/** Get Depreciation Manual Amount */
|
||||
/** Get A_Depreciation_Manual_Amount */
|
||||
public BigDecimal getA_Depreciation_Manual_Amount();
|
||||
|
||||
/** Column name A_Depreciation_Manual_Period */
|
||||
public static final String COLUMNNAME_A_Depreciation_Manual_Period = "A_Depreciation_Manual_Period";
|
||||
|
||||
/** Set Depreciation Manual Period */
|
||||
/** Set A_Depreciation_Manual_Period */
|
||||
public void setA_Depreciation_Manual_Period (String A_Depreciation_Manual_Period);
|
||||
|
||||
/** Get Depreciation Manual Period */
|
||||
/** Get A_Depreciation_Manual_Period */
|
||||
public String getA_Depreciation_Manual_Period();
|
||||
|
||||
/** Column name A_Depreciation_Method_F_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_Method_F_ID = "A_Depreciation_Method_F_ID";
|
||||
|
||||
/** Set Depreciation Method (fiscal) */
|
||||
public void setA_Depreciation_Method_F_ID (int A_Depreciation_Method_F_ID);
|
||||
|
||||
/** Get Depreciation Method (fiscal) */
|
||||
public int getA_Depreciation_Method_F_ID();
|
||||
|
||||
public org.compiere.model.I_A_Depreciation_Method getA_Depreciation_Method_F() throws RuntimeException;
|
||||
|
||||
/** Column name A_Depreciation_Method_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_Method_ID = "A_Depreciation_Method_ID";
|
||||
|
||||
/** Set Depreciation Method */
|
||||
public void setA_Depreciation_Method_ID (int A_Depreciation_Method_ID);
|
||||
|
||||
/** Get Depreciation Method */
|
||||
public int getA_Depreciation_Method_ID();
|
||||
|
||||
public org.compiere.model.I_A_Depreciation_Method getA_Depreciation_Method() throws RuntimeException;
|
||||
|
||||
/** Column name A_Depreciation_Table_Header_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_Table_Header_ID = "A_Depreciation_Table_Header_ID";
|
||||
|
||||
/** Set Depreciation Table Header */
|
||||
/** Set A_Depreciation_Table_Header_ID */
|
||||
public void setA_Depreciation_Table_Header_ID (int A_Depreciation_Table_Header_ID);
|
||||
|
||||
/** Get Depreciation Table Header */
|
||||
/** Get A_Depreciation_Table_Header_ID */
|
||||
public int getA_Depreciation_Table_Header_ID();
|
||||
|
||||
public I_A_Depreciation_Table_Header getA_Depreciation_Table_Header() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Depreciation_Table_Header getA_Depreciation_Table_Header() throws RuntimeException;
|
||||
|
||||
/** Column name A_Depreciation_Variable_Perc */
|
||||
public static final String COLUMNNAME_A_Depreciation_Variable_Perc = "A_Depreciation_Variable_Perc";
|
||||
|
||||
/** Set Depreciation Variable Perc. */
|
||||
/** Set Variable Percent */
|
||||
public void setA_Depreciation_Variable_Perc (BigDecimal A_Depreciation_Variable_Perc);
|
||||
|
||||
/** Get Depreciation Variable Perc. */
|
||||
/** Get Variable Percent */
|
||||
public BigDecimal getA_Depreciation_Variable_Perc();
|
||||
|
||||
/** Column name A_Depreciation_Variable_Perc_F */
|
||||
public static final String COLUMNNAME_A_Depreciation_Variable_Perc_F = "A_Depreciation_Variable_Perc_F";
|
||||
|
||||
/** Set Variable Percent (fiscal) */
|
||||
public void setA_Depreciation_Variable_Perc_F (BigDecimal A_Depreciation_Variable_Perc_F);
|
||||
|
||||
/** Get Variable Percent (fiscal) */
|
||||
public BigDecimal getA_Depreciation_Variable_Perc_F();
|
||||
|
||||
/** Column name A_Disposal_Gain */
|
||||
public static final String COLUMNNAME_A_Disposal_Gain = "A_Disposal_Gain";
|
||||
|
||||
|
@ -186,6 +261,17 @@ public interface I_A_Asset_Group_Acct
|
|||
|
||||
public I_C_ValidCombination getA_Disposal_G() throws RuntimeException;
|
||||
|
||||
/** Column name A_Disposal_Gain_Acct */
|
||||
public static final String COLUMNNAME_A_Disposal_Gain_Acct = "A_Disposal_Gain_Acct";
|
||||
|
||||
/** Set Disposal Gain Acct */
|
||||
public void setA_Disposal_Gain_Acct (int A_Disposal_Gain_Acct);
|
||||
|
||||
/** Get Disposal Gain Acct */
|
||||
public int getA_Disposal_Gain_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Disposal_Gain_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Disposal_Loss */
|
||||
public static final String COLUMNNAME_A_Disposal_Loss = "A_Disposal_Loss";
|
||||
|
||||
|
@ -197,6 +283,17 @@ public interface I_A_Asset_Group_Acct
|
|||
|
||||
public I_C_ValidCombination getA_Disposal_L() throws RuntimeException;
|
||||
|
||||
/** Column name A_Disposal_Loss_Acct */
|
||||
public static final String COLUMNNAME_A_Disposal_Loss_Acct = "A_Disposal_Loss_Acct";
|
||||
|
||||
/** Set Disposal Loss Acct */
|
||||
public void setA_Disposal_Loss_Acct (int A_Disposal_Loss_Acct);
|
||||
|
||||
/** Get Disposal Loss Acct */
|
||||
public int getA_Disposal_Loss_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Disposal_Loss_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Disposal_Revenue */
|
||||
public static final String COLUMNNAME_A_Disposal_Revenue = "A_Disposal_Revenue";
|
||||
|
||||
|
@ -208,6 +305,17 @@ public interface I_A_Asset_Group_Acct
|
|||
|
||||
public I_C_ValidCombination getA_Disposal_Reve() throws RuntimeException;
|
||||
|
||||
/** Column name A_Disposal_Revenue_Acct */
|
||||
public static final String COLUMNNAME_A_Disposal_Revenue_Acct = "A_Disposal_Revenue_Acct";
|
||||
|
||||
/** Set Disposal Revenue Acct */
|
||||
public void setA_Disposal_Revenue_Acct (int A_Disposal_Revenue_Acct);
|
||||
|
||||
/** Get Disposal Revenue Acct */
|
||||
public int getA_Disposal_Revenue_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Disposal_Revenue_A() throws RuntimeException;
|
||||
|
||||
/** Column name AD_Org_ID */
|
||||
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
|
||||
|
||||
|
@ -243,13 +351,35 @@ public interface I_A_Asset_Group_Acct
|
|||
|
||||
public I_C_ValidCombination getA_Reval_Accumdep_Offset_Pr() throws RuntimeException;
|
||||
|
||||
/** Column name A_Reval_Adep_Offset_Cur_Acct */
|
||||
public static final String COLUMNNAME_A_Reval_Adep_Offset_Cur_Acct = "A_Reval_Adep_Offset_Cur_Acct";
|
||||
|
||||
/** Set A_Reval_Accumdep_Offset_Cur */
|
||||
public void setA_Reval_Adep_Offset_Cur_Acct (int A_Reval_Adep_Offset_Cur_Acct);
|
||||
|
||||
/** Get A_Reval_Accumdep_Offset_Cur */
|
||||
public int getA_Reval_Adep_Offset_Cur_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Reval_Adep_Offset_Cur_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Reval_Adep_Offset_Prior_Acct */
|
||||
public static final String COLUMNNAME_A_Reval_Adep_Offset_Prior_Acct = "A_Reval_Adep_Offset_Prior_Acct";
|
||||
|
||||
/** Set A_Reval_Accumdep_Offset_Prior */
|
||||
public void setA_Reval_Adep_Offset_Prior_Acct (int A_Reval_Adep_Offset_Prior_Acct);
|
||||
|
||||
/** Get A_Reval_Accumdep_Offset_Prior */
|
||||
public int getA_Reval_Adep_Offset_Prior_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Reval_Adep_Offset_Prior_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Reval_Cal_Method */
|
||||
public static final String COLUMNNAME_A_Reval_Cal_Method = "A_Reval_Cal_Method";
|
||||
|
||||
/** Set Revaluation Calculation Method */
|
||||
/** Set A_Reval_Cal_Method */
|
||||
public void setA_Reval_Cal_Method (String A_Reval_Cal_Method);
|
||||
|
||||
/** Get Revaluation Calculation Method */
|
||||
/** Get A_Reval_Cal_Method */
|
||||
public String getA_Reval_Cal_Method();
|
||||
|
||||
/** Column name A_Reval_Cost_Offset */
|
||||
|
@ -263,6 +393,17 @@ public interface I_A_Asset_Group_Acct
|
|||
|
||||
public I_C_ValidCombination getA_Reval_Cost_Off() throws RuntimeException;
|
||||
|
||||
/** Column name A_Reval_Cost_Offset_Acct */
|
||||
public static final String COLUMNNAME_A_Reval_Cost_Offset_Acct = "A_Reval_Cost_Offset_Acct";
|
||||
|
||||
/** Set Reval Cost Offset Acct */
|
||||
public void setA_Reval_Cost_Offset_Acct (int A_Reval_Cost_Offset_Acct);
|
||||
|
||||
/** Get Reval Cost Offset Acct */
|
||||
public int getA_Reval_Cost_Offset_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Reval_Cost_Offset_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Reval_Cost_Offset_Prior */
|
||||
public static final String COLUMNNAME_A_Reval_Cost_Offset_Prior = "A_Reval_Cost_Offset_Prior";
|
||||
|
||||
|
@ -274,6 +415,17 @@ public interface I_A_Asset_Group_Acct
|
|||
|
||||
public I_C_ValidCombination getA_Reval_Cost_Offset_Pr() throws RuntimeException;
|
||||
|
||||
/** Column name A_Reval_Cost_Offset_Prior_Acct */
|
||||
public static final String COLUMNNAME_A_Reval_Cost_Offset_Prior_Acct = "A_Reval_Cost_Offset_Prior_Acct";
|
||||
|
||||
/** Set Reval Cost Offset Prior Acct */
|
||||
public void setA_Reval_Cost_Offset_Prior_Acct (int A_Reval_Cost_Offset_Prior_Acct);
|
||||
|
||||
/** Get Reval Cost Offset Prior Acct */
|
||||
public int getA_Reval_Cost_Offset_Prior_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Reval_Cost_Offset_Prior_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Reval_Depexp_Offset */
|
||||
public static final String COLUMNNAME_A_Reval_Depexp_Offset = "A_Reval_Depexp_Offset";
|
||||
|
||||
|
@ -285,13 +437,24 @@ public interface I_A_Asset_Group_Acct
|
|||
|
||||
public I_C_ValidCombination getA_Reval_Depexp_Off() throws RuntimeException;
|
||||
|
||||
/** Column name A_Reval_Depexp_Offset_Acct */
|
||||
public static final String COLUMNNAME_A_Reval_Depexp_Offset_Acct = "A_Reval_Depexp_Offset_Acct";
|
||||
|
||||
/** Set Reval Depexp Offset Acct */
|
||||
public void setA_Reval_Depexp_Offset_Acct (int A_Reval_Depexp_Offset_Acct);
|
||||
|
||||
/** Get Reval Depexp Offset Acct */
|
||||
public int getA_Reval_Depexp_Offset_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Reval_Depexp_Offset_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Split_Percent */
|
||||
public static final String COLUMNNAME_A_Split_Percent = "A_Split_Percent";
|
||||
|
||||
/** Set Split Percentage */
|
||||
/** Set Split Percent */
|
||||
public void setA_Split_Percent (BigDecimal A_Split_Percent);
|
||||
|
||||
/** Get Split Percentage */
|
||||
/** Get Split Percent */
|
||||
public BigDecimal getA_Split_Percent();
|
||||
|
||||
/** Column name C_AcctSchema_ID */
|
||||
|
@ -307,7 +470,7 @@ public interface I_A_Asset_Group_Acct
|
|||
*/
|
||||
public int getC_AcctSchema_ID();
|
||||
|
||||
public I_C_AcctSchema getC_AcctSchema() throws RuntimeException;
|
||||
public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException;
|
||||
|
||||
/** Column name ConventionType */
|
||||
public static final String COLUMNNAME_ConventionType = "ConventionType";
|
||||
|
@ -318,7 +481,7 @@ public interface I_A_Asset_Group_Acct
|
|||
/** Get ConventionType */
|
||||
public int getConventionType();
|
||||
|
||||
public I_A_Depreciation_Convention getConventionT() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Depreciation_Convention getConventionT() throws RuntimeException;
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
@ -345,7 +508,7 @@ public interface I_A_Asset_Group_Acct
|
|||
/** Get DepreciationType */
|
||||
public int getDepreciationType();
|
||||
|
||||
public I_A_Depreciation getDepreciationT() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Depreciation getDepreciationT() throws RuntimeException;
|
||||
|
||||
/** Column name IsActive */
|
||||
public static final String COLUMNNAME_IsActive = "IsActive";
|
||||
|
@ -411,6 +574,15 @@ public interface I_A_Asset_Group_Acct
|
|||
*/
|
||||
public int getUseLifeMonths();
|
||||
|
||||
/** Column name UseLifeMonths_F */
|
||||
public static final String COLUMNNAME_UseLifeMonths_F = "UseLifeMonths_F";
|
||||
|
||||
/** Set Use Life - Months (fiscal) */
|
||||
public void setUseLifeMonths_F (int UseLifeMonths_F);
|
||||
|
||||
/** Get Use Life - Months (fiscal) */
|
||||
public int getUseLifeMonths_F();
|
||||
|
||||
/** Column name UseLifeYears */
|
||||
public static final String COLUMNNAME_UseLifeYears = "UseLifeYears";
|
||||
|
||||
|
@ -423,4 +595,13 @@ public interface I_A_Asset_Group_Acct
|
|||
* Years of the usable life of the asset
|
||||
*/
|
||||
public int getUseLifeYears();
|
||||
|
||||
/** Column name UseLifeYears_F */
|
||||
public static final String COLUMNNAME_UseLifeYears_F = "UseLifeYears_F";
|
||||
|
||||
/** Set Use Life - Years (fiscal) */
|
||||
public void setUseLifeYears_F (int UseLifeYears_F);
|
||||
|
||||
/** Get Use Life - Years (fiscal) */
|
||||
public int getUseLifeYears_F();
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_A_Asset_Info_Fin
|
|||
public static final String Table_Name = "A_Asset_Info_Fin";
|
||||
|
||||
/** AD_Table_ID=53132 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53132;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -54,15 +54,26 @@ public interface I_A_Asset_Info_Fin
|
|||
*/
|
||||
public int getA_Asset_ID();
|
||||
|
||||
public org.compiere.model.I_A_Asset getA_Asset() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_Info_Fin_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Info_Fin_ID = "A_Asset_Info_Fin_ID";
|
||||
|
||||
/** Set Asset Info Fin. */
|
||||
/** Set Asset Info Financial ID */
|
||||
public void setA_Asset_Info_Fin_ID (int A_Asset_Info_Fin_ID);
|
||||
|
||||
/** Get Asset Info Fin. */
|
||||
/** Get Asset Info Financial ID */
|
||||
public int getA_Asset_Info_Fin_ID();
|
||||
|
||||
/** Column name A_Asset_Info_Fin_UU */
|
||||
public static final String COLUMNNAME_A_Asset_Info_Fin_UU = "A_Asset_Info_Fin_UU";
|
||||
|
||||
/** Set A_Asset_Info_Fin_UU */
|
||||
public void setA_Asset_Info_Fin_UU (String A_Asset_Info_Fin_UU);
|
||||
|
||||
/** Get A_Asset_Info_Fin_UU */
|
||||
public String getA_Asset_Info_Fin_UU();
|
||||
|
||||
/** Column name A_Contract_Date */
|
||||
public static final String COLUMNNAME_A_Contract_Date = "A_Contract_Date";
|
||||
|
||||
|
@ -96,37 +107,37 @@ public interface I_A_Asset_Info_Fin
|
|||
/** Column name A_Due_On */
|
||||
public static final String COLUMNNAME_A_Due_On = "A_Due_On";
|
||||
|
||||
/** Set Payment Due Date */
|
||||
/** Set Asset Due On */
|
||||
public void setA_Due_On (String A_Due_On);
|
||||
|
||||
/** Get Payment Due Date */
|
||||
/** Get Asset Due On */
|
||||
public String getA_Due_On();
|
||||
|
||||
/** Column name A_Expired_Date */
|
||||
public static final String COLUMNNAME_A_Expired_Date = "A_Expired_Date";
|
||||
|
||||
/** Set Contract Expiration Date */
|
||||
/** Set Asset Expired Date */
|
||||
public void setA_Expired_Date (Timestamp A_Expired_Date);
|
||||
|
||||
/** Get Contract Expiration Date */
|
||||
/** Get Asset Expired Date */
|
||||
public Timestamp getA_Expired_Date();
|
||||
|
||||
/** Column name A_Finance_Meth */
|
||||
public static final String COLUMNNAME_A_Finance_Meth = "A_Finance_Meth";
|
||||
|
||||
/** Set Finance Method */
|
||||
/** Set Asset Finance Method */
|
||||
public void setA_Finance_Meth (String A_Finance_Meth);
|
||||
|
||||
/** Get Finance Method */
|
||||
/** Get Asset Finance Method */
|
||||
public String getA_Finance_Meth();
|
||||
|
||||
/** Column name A_Monthly_Payment */
|
||||
public static final String COLUMNNAME_A_Monthly_Payment = "A_Monthly_Payment";
|
||||
|
||||
/** Set Monthly Payment */
|
||||
/** Set Asset Monthly Payment */
|
||||
public void setA_Monthly_Payment (BigDecimal A_Monthly_Payment);
|
||||
|
||||
/** Get Monthly Payment */
|
||||
/** Get Asset Monthly Payment */
|
||||
public BigDecimal getA_Monthly_Payment();
|
||||
|
||||
/** Column name A_Purchase_Option */
|
||||
|
@ -159,10 +170,10 @@ public interface I_A_Asset_Info_Fin
|
|||
/** Column name A_Purchase_Price */
|
||||
public static final String COLUMNNAME_A_Purchase_Price = "A_Purchase_Price";
|
||||
|
||||
/** Set Option Purchase Price */
|
||||
/** Set Purchase Price */
|
||||
public void setA_Purchase_Price (BigDecimal A_Purchase_Price);
|
||||
|
||||
/** Get Option Purchase Price */
|
||||
/** Get Purchase Price */
|
||||
public BigDecimal getA_Purchase_Price();
|
||||
|
||||
/** Column name C_BPartner_ID */
|
||||
|
@ -178,6 +189,8 @@ public interface I_A_Asset_Info_Fin
|
|||
*/
|
||||
public int getC_BPartner_ID();
|
||||
|
||||
public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException;
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
||||
|
@ -207,6 +220,19 @@ public interface I_A_Asset_Info_Fin
|
|||
*/
|
||||
public boolean isActive();
|
||||
|
||||
/** 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 TextMsg */
|
||||
public static final String COLUMNNAME_TextMsg = "TextMsg";
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_A_Asset_Info_Ins
|
|||
public static final String Table_Name = "A_Asset_Info_Ins";
|
||||
|
||||
/** AD_Table_ID=53135 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53135;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -57,12 +57,21 @@ public interface I_A_Asset_Info_Ins
|
|||
/** Column name A_Asset_Info_Ins_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Info_Ins_ID = "A_Asset_Info_Ins_ID";
|
||||
|
||||
/** Set Asset Info Ins. */
|
||||
/** Set A_Asset_Info_Ins_ID */
|
||||
public void setA_Asset_Info_Ins_ID (int A_Asset_Info_Ins_ID);
|
||||
|
||||
/** Get Asset Info Ins. */
|
||||
/** Get A_Asset_Info_Ins_ID */
|
||||
public int getA_Asset_Info_Ins_ID();
|
||||
|
||||
/** Column name A_Asset_Info_Ins_UU */
|
||||
public static final String COLUMNNAME_A_Asset_Info_Ins_UU = "A_Asset_Info_Ins_UU";
|
||||
|
||||
/** Set A_Asset_Info_Ins_UU */
|
||||
public void setA_Asset_Info_Ins_UU (String A_Asset_Info_Ins_UU);
|
||||
|
||||
/** Get A_Asset_Info_Ins_UU */
|
||||
public String getA_Asset_Info_Ins_UU();
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
||||
|
@ -87,10 +96,10 @@ public interface I_A_Asset_Info_Ins
|
|||
/** Column name A_Ins_Premium */
|
||||
public static final String COLUMNNAME_A_Ins_Premium = "A_Ins_Premium";
|
||||
|
||||
/** Set Insurance Premium */
|
||||
/** Set Asset Insurance Premium */
|
||||
public void setA_Ins_Premium (BigDecimal A_Ins_Premium);
|
||||
|
||||
/** Get Insurance Premium */
|
||||
/** Get Asset Insurance Premium */
|
||||
public BigDecimal getA_Ins_Premium();
|
||||
|
||||
/** Column name A_Insurance_Co */
|
||||
|
@ -105,37 +114,37 @@ public interface I_A_Asset_Info_Ins
|
|||
/** Column name A_Ins_Value */
|
||||
public static final String COLUMNNAME_A_Ins_Value = "A_Ins_Value";
|
||||
|
||||
/** Set Insured Value */
|
||||
/** Set Asset Insurance Value */
|
||||
public void setA_Ins_Value (BigDecimal A_Ins_Value);
|
||||
|
||||
/** Get Insured Value */
|
||||
/** Get Asset Insurance Value */
|
||||
public BigDecimal getA_Ins_Value();
|
||||
|
||||
/** Column name A_Policy_No */
|
||||
public static final String COLUMNNAME_A_Policy_No = "A_Policy_No";
|
||||
|
||||
/** Set Policy Number */
|
||||
/** Set Asset Policy No */
|
||||
public void setA_Policy_No (String A_Policy_No);
|
||||
|
||||
/** Get Policy Number */
|
||||
/** Get Asset Policy No */
|
||||
public String getA_Policy_No();
|
||||
|
||||
/** Column name A_Renewal_Date */
|
||||
public static final String COLUMNNAME_A_Renewal_Date = "A_Renewal_Date";
|
||||
|
||||
/** Set Policy Renewal Date */
|
||||
/** Set Asset Renewal Date */
|
||||
public void setA_Renewal_Date (Timestamp A_Renewal_Date);
|
||||
|
||||
/** Get Policy Renewal Date */
|
||||
/** Get Asset Renewal Date */
|
||||
public Timestamp getA_Renewal_Date();
|
||||
|
||||
/** Column name A_Replace_Cost */
|
||||
public static final String COLUMNNAME_A_Replace_Cost = "A_Replace_Cost";
|
||||
|
||||
/** Set Replacement Costs */
|
||||
/** Set Asset Replace Cost */
|
||||
public void setA_Replace_Cost (BigDecimal A_Replace_Cost);
|
||||
|
||||
/** Get Replacement Costs */
|
||||
/** Get Asset Replace Cost */
|
||||
public BigDecimal getA_Replace_Cost();
|
||||
|
||||
/** Column name Created */
|
||||
|
@ -170,10 +179,10 @@ public interface I_A_Asset_Info_Ins
|
|||
/** Column name Text */
|
||||
public static final String COLUMNNAME_Text = "Text";
|
||||
|
||||
/** Set Text */
|
||||
/** Set Description */
|
||||
public void setText (String Text);
|
||||
|
||||
/** Get Text */
|
||||
/** Get Description */
|
||||
public String getText();
|
||||
|
||||
/** Column name Updated */
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_A_Asset_Info_Lic
|
|||
public static final String Table_Name = "A_Asset_Info_Lic";
|
||||
|
||||
/** AD_Table_ID=53134 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53134;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -54,15 +54,26 @@ public interface I_A_Asset_Info_Lic
|
|||
*/
|
||||
public int getA_Asset_ID();
|
||||
|
||||
public org.compiere.model.I_A_Asset getA_Asset() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_Info_Lic_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Info_Lic_ID = "A_Asset_Info_Lic_ID";
|
||||
|
||||
/** Set Asset Info Lic. */
|
||||
/** Set A_Asset_Info_Lic_ID */
|
||||
public void setA_Asset_Info_Lic_ID (int A_Asset_Info_Lic_ID);
|
||||
|
||||
/** Get Asset Info Lic. */
|
||||
/** Get A_Asset_Info_Lic_ID */
|
||||
public int getA_Asset_Info_Lic_ID();
|
||||
|
||||
/** Column name A_Asset_Info_Lic_UU */
|
||||
public static final String COLUMNNAME_A_Asset_Info_Lic_UU = "A_Asset_Info_Lic_UU";
|
||||
|
||||
/** Set A_Asset_Info_Lic_UU */
|
||||
public void setA_Asset_Info_Lic_UU (String A_Asset_Info_Lic_UU);
|
||||
|
||||
/** Get A_Asset_Info_Lic_UU */
|
||||
public String getA_Asset_Info_Lic_UU();
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
||||
|
@ -96,28 +107,28 @@ public interface I_A_Asset_Info_Lic
|
|||
/** Column name A_License_Fee */
|
||||
public static final String COLUMNNAME_A_License_Fee = "A_License_Fee";
|
||||
|
||||
/** Set License Fee */
|
||||
/** Set Asset License Fee */
|
||||
public void setA_License_Fee (BigDecimal A_License_Fee);
|
||||
|
||||
/** Get License Fee */
|
||||
/** Get Asset License Fee */
|
||||
public BigDecimal getA_License_Fee();
|
||||
|
||||
/** Column name A_License_No */
|
||||
public static final String COLUMNNAME_A_License_No = "A_License_No";
|
||||
|
||||
/** Set License No */
|
||||
/** Set Asset License No */
|
||||
public void setA_License_No (String A_License_No);
|
||||
|
||||
/** Get License No */
|
||||
/** Get Asset License No */
|
||||
public String getA_License_No();
|
||||
|
||||
/** Column name A_Renewal_Date */
|
||||
public static final String COLUMNNAME_A_Renewal_Date = "A_Renewal_Date";
|
||||
|
||||
/** Set Policy Renewal Date */
|
||||
/** Set Asset Renewal Date */
|
||||
public void setA_Renewal_Date (Timestamp A_Renewal_Date);
|
||||
|
||||
/** Get Policy Renewal Date */
|
||||
/** Get Asset Renewal Date */
|
||||
public Timestamp getA_Renewal_Date();
|
||||
|
||||
/** Column name A_State */
|
||||
|
@ -162,13 +173,26 @@ public interface I_A_Asset_Info_Lic
|
|||
*/
|
||||
public boolean isActive();
|
||||
|
||||
/** 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 Text */
|
||||
public static final String COLUMNNAME_Text = "Text";
|
||||
|
||||
/** Set Text */
|
||||
/** Set Description */
|
||||
public void setText (String Text);
|
||||
|
||||
/** Get Text */
|
||||
/** Get Description */
|
||||
public String getText();
|
||||
|
||||
/** Column name Updated */
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_A_Asset_Info_Oth
|
|||
public static final String Table_Name = "A_Asset_Info_Oth";
|
||||
|
||||
/** AD_Table_ID=53136 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53136;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -57,12 +57,21 @@ public interface I_A_Asset_Info_Oth
|
|||
/** Column name A_Asset_Info_Oth_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Info_Oth_ID = "A_Asset_Info_Oth_ID";
|
||||
|
||||
/** Set Asset Info Oth. */
|
||||
/** Set A_Asset_Info_Oth_ID */
|
||||
public void setA_Asset_Info_Oth_ID (int A_Asset_Info_Oth_ID);
|
||||
|
||||
/** Get Asset Info Oth. */
|
||||
/** Get A_Asset_Info_Oth_ID */
|
||||
public int getA_Asset_Info_Oth_ID();
|
||||
|
||||
/** Column name A_Asset_Info_Oth_UU */
|
||||
public static final String COLUMNNAME_A_Asset_Info_Oth_UU = "A_Asset_Info_Oth_UU";
|
||||
|
||||
/** Set A_Asset_Info_Oth_UU */
|
||||
public void setA_Asset_Info_Oth_UU (String A_Asset_Info_Oth_UU);
|
||||
|
||||
/** Get A_Asset_Info_Oth_UU */
|
||||
public String getA_Asset_Info_Oth_UU();
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
||||
|
@ -87,136 +96,136 @@ public interface I_A_Asset_Info_Oth
|
|||
/** Column name A_User1 */
|
||||
public static final String COLUMNNAME_A_User1 = "A_User1";
|
||||
|
||||
/** Set User 1 */
|
||||
/** Set A_User1 */
|
||||
public void setA_User1 (String A_User1);
|
||||
|
||||
/** Get User 1 */
|
||||
/** Get A_User1 */
|
||||
public String getA_User1();
|
||||
|
||||
/** Column name A_User10 */
|
||||
public static final String COLUMNNAME_A_User10 = "A_User10";
|
||||
|
||||
/** Set User 10 */
|
||||
/** Set A_User10 */
|
||||
public void setA_User10 (String A_User10);
|
||||
|
||||
/** Get User 10 */
|
||||
/** Get A_User10 */
|
||||
public String getA_User10();
|
||||
|
||||
/** Column name A_User11 */
|
||||
public static final String COLUMNNAME_A_User11 = "A_User11";
|
||||
|
||||
/** Set User 11 */
|
||||
/** Set A_User11 */
|
||||
public void setA_User11 (String A_User11);
|
||||
|
||||
/** Get User 11 */
|
||||
/** Get A_User11 */
|
||||
public String getA_User11();
|
||||
|
||||
/** Column name A_User12 */
|
||||
public static final String COLUMNNAME_A_User12 = "A_User12";
|
||||
|
||||
/** Set User 12 */
|
||||
/** Set A_User12 */
|
||||
public void setA_User12 (String A_User12);
|
||||
|
||||
/** Get User 12 */
|
||||
/** Get A_User12 */
|
||||
public String getA_User12();
|
||||
|
||||
/** Column name A_User13 */
|
||||
public static final String COLUMNNAME_A_User13 = "A_User13";
|
||||
|
||||
/** Set User 13 */
|
||||
/** Set A_User13 */
|
||||
public void setA_User13 (String A_User13);
|
||||
|
||||
/** Get User 13 */
|
||||
/** Get A_User13 */
|
||||
public String getA_User13();
|
||||
|
||||
/** Column name A_User14 */
|
||||
public static final String COLUMNNAME_A_User14 = "A_User14";
|
||||
|
||||
/** Set User 14 */
|
||||
/** Set A_User14 */
|
||||
public void setA_User14 (String A_User14);
|
||||
|
||||
/** Get User 14 */
|
||||
/** Get A_User14 */
|
||||
public String getA_User14();
|
||||
|
||||
/** Column name A_User15 */
|
||||
public static final String COLUMNNAME_A_User15 = "A_User15";
|
||||
|
||||
/** Set User 15 */
|
||||
/** Set A_User15 */
|
||||
public void setA_User15 (String A_User15);
|
||||
|
||||
/** Get User 15 */
|
||||
/** Get A_User15 */
|
||||
public String getA_User15();
|
||||
|
||||
/** Column name A_User2 */
|
||||
public static final String COLUMNNAME_A_User2 = "A_User2";
|
||||
|
||||
/** Set User 2 */
|
||||
/** Set A_User2 */
|
||||
public void setA_User2 (String A_User2);
|
||||
|
||||
/** Get User 2 */
|
||||
/** Get A_User2 */
|
||||
public String getA_User2();
|
||||
|
||||
/** Column name A_User3 */
|
||||
public static final String COLUMNNAME_A_User3 = "A_User3";
|
||||
|
||||
/** Set User 3 */
|
||||
/** Set A_User3 */
|
||||
public void setA_User3 (String A_User3);
|
||||
|
||||
/** Get User 3 */
|
||||
/** Get A_User3 */
|
||||
public String getA_User3();
|
||||
|
||||
/** Column name A_User4 */
|
||||
public static final String COLUMNNAME_A_User4 = "A_User4";
|
||||
|
||||
/** Set User 4 */
|
||||
/** Set A_User4 */
|
||||
public void setA_User4 (String A_User4);
|
||||
|
||||
/** Get User 4 */
|
||||
/** Get A_User4 */
|
||||
public String getA_User4();
|
||||
|
||||
/** Column name A_User5 */
|
||||
public static final String COLUMNNAME_A_User5 = "A_User5";
|
||||
|
||||
/** Set User 5 */
|
||||
/** Set A_User5 */
|
||||
public void setA_User5 (String A_User5);
|
||||
|
||||
/** Get User 5 */
|
||||
/** Get A_User5 */
|
||||
public String getA_User5();
|
||||
|
||||
/** Column name A_User6 */
|
||||
public static final String COLUMNNAME_A_User6 = "A_User6";
|
||||
|
||||
/** Set User 6 */
|
||||
/** Set A_User6 */
|
||||
public void setA_User6 (String A_User6);
|
||||
|
||||
/** Get User 6 */
|
||||
/** Get A_User6 */
|
||||
public String getA_User6();
|
||||
|
||||
/** Column name A_User7 */
|
||||
public static final String COLUMNNAME_A_User7 = "A_User7";
|
||||
|
||||
/** Set User 7 */
|
||||
/** Set A_User7 */
|
||||
public void setA_User7 (String A_User7);
|
||||
|
||||
/** Get User 7 */
|
||||
/** Get A_User7 */
|
||||
public String getA_User7();
|
||||
|
||||
/** Column name A_User8 */
|
||||
public static final String COLUMNNAME_A_User8 = "A_User8";
|
||||
|
||||
/** Set User 8 */
|
||||
/** Set A_User8 */
|
||||
public void setA_User8 (String A_User8);
|
||||
|
||||
/** Get User 8 */
|
||||
/** Get A_User8 */
|
||||
public String getA_User8();
|
||||
|
||||
/** Column name A_User9 */
|
||||
public static final String COLUMNNAME_A_User9 = "A_User9";
|
||||
|
||||
/** Set User 9 */
|
||||
/** Set A_User9 */
|
||||
public void setA_User9 (String A_User9);
|
||||
|
||||
/** Get User 9 */
|
||||
/** Get A_User9 */
|
||||
public String getA_User9();
|
||||
|
||||
/** Column name Created */
|
||||
|
@ -251,10 +260,10 @@ public interface I_A_Asset_Info_Oth
|
|||
/** Column name Text */
|
||||
public static final String COLUMNNAME_Text = "Text";
|
||||
|
||||
/** Set Text */
|
||||
/** Set Description */
|
||||
public void setText (String Text);
|
||||
|
||||
/** Get Text */
|
||||
/** Get Description */
|
||||
public String getText();
|
||||
|
||||
/** Column name Updated */
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_A_Asset_Info_Tax
|
|||
public static final String Table_Name = "A_Asset_Info_Tax";
|
||||
|
||||
/** AD_Table_ID=53131 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53131;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -63,6 +63,15 @@ public interface I_A_Asset_Info_Tax
|
|||
/** Get Asset Info Tax */
|
||||
public int getA_Asset_Info_Tax_ID();
|
||||
|
||||
/** Column name A_Asset_Info_Tax_UU */
|
||||
public static final String COLUMNNAME_A_Asset_Info_Tax_UU = "A_Asset_Info_Tax_UU";
|
||||
|
||||
/** Set A_Asset_Info_Tax_UU */
|
||||
public void setA_Asset_Info_Tax_UU (String A_Asset_Info_Tax_UU);
|
||||
|
||||
/** Get A_Asset_Info_Tax_UU */
|
||||
public String getA_Asset_Info_Tax_UU();
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
||||
|
@ -87,28 +96,28 @@ public interface I_A_Asset_Info_Tax
|
|||
/** Column name A_Finance_Meth */
|
||||
public static final String COLUMNNAME_A_Finance_Meth = "A_Finance_Meth";
|
||||
|
||||
/** Set Finance Method */
|
||||
/** Set Asset Finance Method */
|
||||
public void setA_Finance_Meth (String A_Finance_Meth);
|
||||
|
||||
/** Get Finance Method */
|
||||
/** Get Asset Finance Method */
|
||||
public String getA_Finance_Meth();
|
||||
|
||||
/** Column name A_Investment_CR */
|
||||
public static final String COLUMNNAME_A_Investment_CR = "A_Investment_CR";
|
||||
|
||||
/** Set Investment Credit */
|
||||
/** Set Asset Investment CR */
|
||||
public void setA_Investment_CR (int A_Investment_CR);
|
||||
|
||||
/** Get Investment Credit */
|
||||
/** Get Asset Investment CR */
|
||||
public int getA_Investment_CR();
|
||||
|
||||
/** Column name A_New_Used */
|
||||
public static final String COLUMNNAME_A_New_Used = "A_New_Used";
|
||||
|
||||
/** Set Purchased New? */
|
||||
/** Set Asset New Used */
|
||||
public void setA_New_Used (boolean A_New_Used);
|
||||
|
||||
/** Get Purchased New? */
|
||||
/** Get Asset New Used */
|
||||
public boolean isA_New_Used();
|
||||
|
||||
/** Column name A_State */
|
||||
|
@ -127,10 +136,10 @@ public interface I_A_Asset_Info_Tax
|
|||
/** Column name A_Tax_Entity */
|
||||
public static final String COLUMNNAME_A_Tax_Entity = "A_Tax_Entity";
|
||||
|
||||
/** Set Tax Entity */
|
||||
/** Set Asset Tax Entity */
|
||||
public void setA_Tax_Entity (String A_Tax_Entity);
|
||||
|
||||
/** Get Tax Entity */
|
||||
/** Get Asset Tax Entity */
|
||||
public String getA_Tax_Entity();
|
||||
|
||||
/** Column name Created */
|
||||
|
|
|
@ -0,0 +1,200 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2007 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 A_Asset_Product
|
||||
* @author Adempiere (generated)
|
||||
* @version Release 3.6.0LTS
|
||||
*/
|
||||
public interface I_A_Asset_Product
|
||||
{
|
||||
|
||||
/** TableName=A_Asset_Product */
|
||||
public static final String Table_Name = "A_Asset_Product";
|
||||
|
||||
/** AD_Table_ID=53270 */
|
||||
public static final int Table_ID = 53270;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
/** AccessLevel = 3 - Client - Org
|
||||
*/
|
||||
BigDecimal accessLevel = BigDecimal.valueOf(3);
|
||||
|
||||
/** Load Meta Data */
|
||||
|
||||
/** Column name A_Asset_ID */
|
||||
public static final String COLUMNNAME_A_Asset_ID = "A_Asset_ID";
|
||||
|
||||
/** Set Asset.
|
||||
* Asset used internally or by customers
|
||||
*/
|
||||
public void setA_Asset_ID (int A_Asset_ID);
|
||||
|
||||
/** Get Asset.
|
||||
* Asset used internally or by customers
|
||||
*/
|
||||
public int getA_Asset_ID();
|
||||
|
||||
public org.compiere.model.I_A_Asset getA_Asset() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_Product_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Product_ID = "A_Asset_Product_ID";
|
||||
|
||||
/** Set Asset Product */
|
||||
public void setA_Asset_Product_ID (int A_Asset_Product_ID);
|
||||
|
||||
/** Get Asset Product */
|
||||
public int getA_Asset_Product_ID();
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
||||
/** Get Client.
|
||||
* Client/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 client
|
||||
*/
|
||||
public void setAD_Org_ID (int AD_Org_ID);
|
||||
|
||||
/** Get Organization.
|
||||
* Organizational entity within client
|
||||
*/
|
||||
public int getAD_Org_ID();
|
||||
|
||||
/** Column name A_QTY_Current */
|
||||
public static final String COLUMNNAME_A_QTY_Current = "A_QTY_Current";
|
||||
|
||||
/** Set Current Qty */
|
||||
public void setA_QTY_Current (BigDecimal A_QTY_Current);
|
||||
|
||||
/** Get Current Qty */
|
||||
public BigDecimal getA_QTY_Current();
|
||||
|
||||
/** 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 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 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 M_AttributeSetInstance_ID */
|
||||
public static final String COLUMNNAME_M_AttributeSetInstance_ID = "M_AttributeSetInstance_ID";
|
||||
|
||||
/** Set Attribute Set Instance.
|
||||
* Product Attribute Set Instance
|
||||
*/
|
||||
public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID);
|
||||
|
||||
/** Get Attribute Set Instance.
|
||||
* Product Attribute Set Instance
|
||||
*/
|
||||
public int getM_AttributeSetInstance_ID();
|
||||
|
||||
public I_M_AttributeSetInstance getM_AttributeSetInstance() throws RuntimeException;
|
||||
|
||||
/** Column name M_Locator_ID */
|
||||
public static final String COLUMNNAME_M_Locator_ID = "M_Locator_ID";
|
||||
|
||||
/** Set Locator.
|
||||
* Warehouse Locator
|
||||
*/
|
||||
public void setM_Locator_ID (int M_Locator_ID);
|
||||
|
||||
/** Get Locator.
|
||||
* Warehouse Locator
|
||||
*/
|
||||
public int getM_Locator_ID();
|
||||
|
||||
public I_M_Locator getM_Locator() throws RuntimeException;
|
||||
|
||||
/** Column name M_Product_ID */
|
||||
public static final String COLUMNNAME_M_Product_ID = "M_Product_ID";
|
||||
|
||||
/** Set Product.
|
||||
* Product, Service, Item
|
||||
*/
|
||||
public void setM_Product_ID (int M_Product_ID);
|
||||
|
||||
/** Get Product.
|
||||
* Product, Service, Item
|
||||
*/
|
||||
public int getM_Product_ID();
|
||||
|
||||
public org.compiere.model.I_M_Product getM_Product() throws RuntimeException;
|
||||
|
||||
/** 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();
|
||||
}
|
|
@ -31,7 +31,7 @@ public interface I_A_Asset_Retirement
|
|||
public static final String Table_Name = "A_Asset_Retirement";
|
||||
|
||||
/** AD_Table_ID=540 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 540;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -54,7 +54,7 @@ public interface I_A_Asset_Retirement
|
|||
*/
|
||||
public int getA_Asset_ID();
|
||||
|
||||
public I_A_Asset getA_Asset() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Asset getA_Asset() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_Retirement_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Retirement_ID = "A_Asset_Retirement_ID";
|
||||
|
@ -69,6 +69,15 @@ public interface I_A_Asset_Retirement
|
|||
*/
|
||||
public int getA_Asset_Retirement_ID();
|
||||
|
||||
/** Column name A_Asset_Retirement_UU */
|
||||
public static final String COLUMNNAME_A_Asset_Retirement_UU = "A_Asset_Retirement_UU";
|
||||
|
||||
/** Set A_Asset_Retirement_UU */
|
||||
public void setA_Asset_Retirement_UU (String A_Asset_Retirement_UU);
|
||||
|
||||
/** Get A_Asset_Retirement_UU */
|
||||
public String getA_Asset_Retirement_UU();
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
||||
|
@ -129,7 +138,7 @@ public interface I_A_Asset_Retirement
|
|||
*/
|
||||
public int getC_InvoiceLine_ID();
|
||||
|
||||
public I_C_InvoiceLine getC_InvoiceLine() throws RuntimeException;
|
||||
public org.compiere.model.I_C_InvoiceLine getC_InvoiceLine() throws RuntimeException;
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
|
|
@ -0,0 +1,295 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2007 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 A_Asset_Reval
|
||||
* @author Adempiere (generated)
|
||||
* @version Release 3.6.0LTS
|
||||
*/
|
||||
public interface I_A_Asset_Reval
|
||||
{
|
||||
|
||||
/** TableName=A_Asset_Reval */
|
||||
public static final String Table_Name = "A_Asset_Reval";
|
||||
|
||||
/** AD_Table_ID=53275 */
|
||||
public static final int Table_ID = 53275;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
/** AccessLevel = 3 - Client - Org
|
||||
*/
|
||||
BigDecimal accessLevel = BigDecimal.valueOf(3);
|
||||
|
||||
/** Load Meta Data */
|
||||
|
||||
/** Column name A_Accumulated_Depr */
|
||||
public static final String COLUMNNAME_A_Accumulated_Depr = "A_Accumulated_Depr";
|
||||
|
||||
/** Set Accumulated Depreciation */
|
||||
public void setA_Accumulated_Depr (BigDecimal A_Accumulated_Depr);
|
||||
|
||||
/** Get Accumulated Depreciation */
|
||||
public BigDecimal getA_Accumulated_Depr();
|
||||
|
||||
/** Column name A_Asset_Cost */
|
||||
public static final String COLUMNNAME_A_Asset_Cost = "A_Asset_Cost";
|
||||
|
||||
/** Set Asset Cost */
|
||||
public void setA_Asset_Cost (BigDecimal A_Asset_Cost);
|
||||
|
||||
/** Get Asset Cost */
|
||||
public BigDecimal getA_Asset_Cost();
|
||||
|
||||
/** Column name A_Asset_Cost_Change */
|
||||
public static final String COLUMNNAME_A_Asset_Cost_Change = "A_Asset_Cost_Change";
|
||||
|
||||
/** Set Asset Cost Change */
|
||||
public void setA_Asset_Cost_Change (BigDecimal A_Asset_Cost_Change);
|
||||
|
||||
/** Get Asset Cost Change */
|
||||
public BigDecimal getA_Asset_Cost_Change();
|
||||
|
||||
/** Column name A_Asset_ID */
|
||||
public static final String COLUMNNAME_A_Asset_ID = "A_Asset_ID";
|
||||
|
||||
/** Set Asset.
|
||||
* Asset used internally or by customers
|
||||
*/
|
||||
public void setA_Asset_ID (int A_Asset_ID);
|
||||
|
||||
/** Get Asset.
|
||||
* Asset used internally or by customers
|
||||
*/
|
||||
public int getA_Asset_ID();
|
||||
|
||||
public org.compiere.model.I_A_Asset getA_Asset() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_Reval_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Reval_ID = "A_Asset_Reval_ID";
|
||||
|
||||
/** Set Asset Revaluation */
|
||||
public void setA_Asset_Reval_ID (int A_Asset_Reval_ID);
|
||||
|
||||
/** Get Asset Revaluation */
|
||||
public int getA_Asset_Reval_ID();
|
||||
|
||||
/** Column name A_Change_Acumulated_Depr */
|
||||
public static final String COLUMNNAME_A_Change_Acumulated_Depr = "A_Change_Acumulated_Depr";
|
||||
|
||||
/** Set Change Acumulated Depreciation */
|
||||
public void setA_Change_Acumulated_Depr (BigDecimal A_Change_Acumulated_Depr);
|
||||
|
||||
/** Get Change Acumulated Depreciation */
|
||||
public BigDecimal getA_Change_Acumulated_Depr();
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
||||
/** Get Client.
|
||||
* Client/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 client
|
||||
*/
|
||||
public void setAD_Org_ID (int AD_Org_ID);
|
||||
|
||||
/** Get Organization.
|
||||
* Organizational entity within client
|
||||
*/
|
||||
public int getAD_Org_ID();
|
||||
|
||||
/** 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 DateDoc */
|
||||
public static final String COLUMNNAME_DateDoc = "DateDoc";
|
||||
|
||||
/** Set Document Date.
|
||||
* Date of the Document
|
||||
*/
|
||||
public void setDateDoc (Timestamp DateDoc);
|
||||
|
||||
/** Get Document Date.
|
||||
* Date of the Document
|
||||
*/
|
||||
public Timestamp getDateDoc();
|
||||
|
||||
/** 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 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 Posted */
|
||||
public static final String COLUMNNAME_Posted = "Posted";
|
||||
|
||||
/** Set Posted.
|
||||
* Posting status
|
||||
*/
|
||||
public void setPosted (boolean Posted);
|
||||
|
||||
/** Get Posted.
|
||||
* Posting status
|
||||
*/
|
||||
public boolean isPosted();
|
||||
|
||||
/** Column name PostingType */
|
||||
public static final String COLUMNNAME_PostingType = "PostingType";
|
||||
|
||||
/** Set PostingType.
|
||||
* The type of posted amount for the transaction
|
||||
*/
|
||||
public void setPostingType (String PostingType);
|
||||
|
||||
/** Get PostingType.
|
||||
* The type of posted amount for the transaction
|
||||
*/
|
||||
public String getPostingType();
|
||||
|
||||
/** 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 ProcessedOn */
|
||||
public static final String COLUMNNAME_ProcessedOn = "ProcessedOn";
|
||||
|
||||
/** Set Processed On.
|
||||
* The date+time (expressed in decimal format) when the document has been processed
|
||||
*/
|
||||
public void setProcessedOn (BigDecimal ProcessedOn);
|
||||
|
||||
/** Get Processed On.
|
||||
* The date+time (expressed in decimal format) when the document has been processed
|
||||
*/
|
||||
public BigDecimal getProcessedOn();
|
||||
|
||||
/** 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 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();
|
||||
}
|
|
@ -31,7 +31,7 @@ public interface I_A_Asset_Reval_Entry
|
|||
public static final String Table_Name = "A_Asset_Reval_Entry";
|
||||
|
||||
/** AD_Table_ID=53119 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53119;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -50,6 +50,15 @@ public interface I_A_Asset_Reval_Entry
|
|||
/** Get Asset Reval. Entry */
|
||||
public int getA_Asset_Reval_Entry_ID();
|
||||
|
||||
/** Column name A_Asset_Reval_Entry_UU */
|
||||
public static final String COLUMNNAME_A_Asset_Reval_Entry_UU = "A_Asset_Reval_Entry_UU";
|
||||
|
||||
/** Set A_Asset_Reval_Entry_UU */
|
||||
public void setA_Asset_Reval_Entry_UU (String A_Asset_Reval_Entry_UU);
|
||||
|
||||
/** Get A_Asset_Reval_Entry_UU */
|
||||
public String getA_Asset_Reval_Entry_UU();
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
||||
|
@ -83,10 +92,10 @@ public interface I_A_Asset_Reval_Entry
|
|||
/** Column name A_Reval_Cal_Method */
|
||||
public static final String COLUMNNAME_A_Reval_Cal_Method = "A_Reval_Cal_Method";
|
||||
|
||||
/** Set Revaluation Calculation Method */
|
||||
/** Set A_Reval_Cal_Method */
|
||||
public void setA_Reval_Cal_Method (String A_Reval_Cal_Method);
|
||||
|
||||
/** Get Revaluation Calculation Method */
|
||||
/** Get A_Reval_Cal_Method */
|
||||
public String getA_Reval_Cal_Method();
|
||||
|
||||
/** Column name A_Reval_Effective_Date */
|
||||
|
@ -129,7 +138,7 @@ public interface I_A_Asset_Reval_Entry
|
|||
*/
|
||||
public int getC_AcctSchema_ID();
|
||||
|
||||
public I_C_AcctSchema getC_AcctSchema() throws RuntimeException;
|
||||
public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException;
|
||||
|
||||
/** Column name C_Currency_ID */
|
||||
public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID";
|
||||
|
@ -144,7 +153,7 @@ public interface I_A_Asset_Reval_Entry
|
|||
*/
|
||||
public int getC_Currency_ID();
|
||||
|
||||
public I_C_Currency getC_Currency() throws RuntimeException;
|
||||
public org.compiere.model.I_C_Currency getC_Currency() throws RuntimeException;
|
||||
|
||||
/** Column name C_DocType_ID */
|
||||
public static final String COLUMNNAME_C_DocType_ID = "C_DocType_ID";
|
||||
|
@ -159,7 +168,7 @@ public interface I_A_Asset_Reval_Entry
|
|||
*/
|
||||
public int getC_DocType_ID();
|
||||
|
||||
public I_C_DocType getC_DocType() throws RuntimeException;
|
||||
public org.compiere.model.I_C_DocType getC_DocType() throws RuntimeException;
|
||||
|
||||
/** Column name C_Period_ID */
|
||||
public static final String COLUMNNAME_C_Period_ID = "C_Period_ID";
|
||||
|
@ -174,7 +183,7 @@ public interface I_A_Asset_Reval_Entry
|
|||
*/
|
||||
public int getC_Period_ID();
|
||||
|
||||
public I_C_Period getC_Period() throws RuntimeException;
|
||||
public org.compiere.model.I_C_Period getC_Period() throws RuntimeException;
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
@ -257,7 +266,7 @@ public interface I_A_Asset_Reval_Entry
|
|||
*/
|
||||
public int getGL_Category_ID();
|
||||
|
||||
public I_GL_Category getGL_Category() throws RuntimeException;
|
||||
public org.compiere.model.I_GL_Category getGL_Category() throws RuntimeException;
|
||||
|
||||
/** Column name IsActive */
|
||||
public static final String COLUMNNAME_IsActive = "IsActive";
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_A_Asset_Reval_Index
|
|||
public static final String Table_Name = "A_Asset_Reval_Index";
|
||||
|
||||
/** AD_Table_ID=53120 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53120;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -50,6 +50,15 @@ public interface I_A_Asset_Reval_Index
|
|||
/** Get Asset Reval Index */
|
||||
public int getA_Asset_Reval_Index_ID();
|
||||
|
||||
/** Column name A_Asset_Reval_Index_UU */
|
||||
public static final String COLUMNNAME_A_Asset_Reval_Index_UU = "A_Asset_Reval_Index_UU";
|
||||
|
||||
/** Set A_Asset_Reval_Index_UU */
|
||||
public void setA_Asset_Reval_Index_UU (String A_Asset_Reval_Index_UU);
|
||||
|
||||
/** Get A_Asset_Reval_Index_UU */
|
||||
public String getA_Asset_Reval_Index_UU();
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_A_Asset_Split
|
|||
public static final String Table_Name = "A_Asset_Split";
|
||||
|
||||
/** AD_Table_ID=53122 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53122;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -53,10 +53,10 @@ public interface I_A_Asset_Split
|
|||
/** Column name A_Asset_Acct_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Acct_ID = "A_Asset_Acct_ID";
|
||||
|
||||
/** Set Asset Acct. */
|
||||
/** Set A_Asset_Acct_ID */
|
||||
public void setA_Asset_Acct_ID (int A_Asset_Acct_ID);
|
||||
|
||||
/** Get Asset Acct. */
|
||||
/** Get A_Asset_Acct_ID */
|
||||
public int getA_Asset_Acct_ID();
|
||||
|
||||
/** Column name A_Asset_Cost */
|
||||
|
@ -90,7 +90,7 @@ public interface I_A_Asset_Split
|
|||
/** Get To Asset ID */
|
||||
public int getA_Asset_ID_To();
|
||||
|
||||
public I_A_Asset getA_Asset_To() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Asset getA_Asset_To() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_Split_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Split_ID = "A_Asset_Split_ID";
|
||||
|
@ -101,6 +101,15 @@ public interface I_A_Asset_Split
|
|||
/** Get Asset Split */
|
||||
public int getA_Asset_Split_ID();
|
||||
|
||||
/** Column name A_Asset_Split_UU */
|
||||
public static final String COLUMNNAME_A_Asset_Split_UU = "A_Asset_Split_UU";
|
||||
|
||||
/** Set A_Asset_Split_UU */
|
||||
public void setA_Asset_Split_UU (String A_Asset_Split_UU);
|
||||
|
||||
/** Get A_Asset_Split_UU */
|
||||
public String getA_Asset_Split_UU();
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
||||
|
@ -112,10 +121,10 @@ public interface I_A_Asset_Split
|
|||
/** Column name A_Depreciation_Workfile_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_Workfile_ID = "A_Depreciation_Workfile_ID";
|
||||
|
||||
/** Set Depreciation Workfile */
|
||||
/** Set A_Depreciation_Workfile_ID */
|
||||
public void setA_Depreciation_Workfile_ID (int A_Depreciation_Workfile_ID);
|
||||
|
||||
/** Get Depreciation Workfile */
|
||||
/** Get A_Depreciation_Workfile_ID */
|
||||
public int getA_Depreciation_Workfile_ID();
|
||||
|
||||
/** Column name AD_Org_ID */
|
||||
|
@ -152,10 +161,10 @@ public interface I_A_Asset_Split
|
|||
/** Column name A_QTY_Current */
|
||||
public static final String COLUMNNAME_A_QTY_Current = "A_QTY_Current";
|
||||
|
||||
/** Set Quantity */
|
||||
/** Set Current Qty */
|
||||
public void setA_QTY_Current (BigDecimal A_QTY_Current);
|
||||
|
||||
/** Get Quantity */
|
||||
/** Get Current Qty */
|
||||
public BigDecimal getA_QTY_Current();
|
||||
|
||||
/** Column name A_QTY_Split */
|
||||
|
@ -179,10 +188,10 @@ public interface I_A_Asset_Split
|
|||
/** Column name A_Transfer_Balance_IS */
|
||||
public static final String COLUMNNAME_A_Transfer_Balance_IS = "A_Transfer_Balance_IS";
|
||||
|
||||
/** Set Transfer Balance IS */
|
||||
/** Set A_Transfer_Balance_IS */
|
||||
public void setA_Transfer_Balance_IS (boolean A_Transfer_Balance_IS);
|
||||
|
||||
/** Get Transfer Balance IS */
|
||||
/** Get A_Transfer_Balance_IS */
|
||||
public boolean isA_Transfer_Balance_IS();
|
||||
|
||||
/** Column name C_Period_ID */
|
||||
|
@ -198,7 +207,7 @@ public interface I_A_Asset_Split
|
|||
*/
|
||||
public int getC_Period_ID();
|
||||
|
||||
public I_C_Period getC_Period() throws RuntimeException;
|
||||
public org.compiere.model.I_C_Period getC_Period() throws RuntimeException;
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_A_Asset_Spread
|
|||
public static final String Table_Name = "A_Asset_Spread";
|
||||
|
||||
/** AD_Table_ID=53126 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53126;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -44,21 +44,30 @@ public interface I_A_Asset_Spread
|
|||
/** Column name A_Asset_Spread_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Spread_ID = "A_Asset_Spread_ID";
|
||||
|
||||
/** Set Asset Spread */
|
||||
/** Set A_Asset_Spread_ID */
|
||||
public void setA_Asset_Spread_ID (int A_Asset_Spread_ID);
|
||||
|
||||
/** Get Asset Spread */
|
||||
/** Get A_Asset_Spread_ID */
|
||||
public int getA_Asset_Spread_ID();
|
||||
|
||||
/** Column name A_Asset_Spread_Type */
|
||||
public static final String COLUMNNAME_A_Asset_Spread_Type = "A_Asset_Spread_Type";
|
||||
|
||||
/** Set Asset Spread Type */
|
||||
/** Set Spread Type */
|
||||
public void setA_Asset_Spread_Type (String A_Asset_Spread_Type);
|
||||
|
||||
/** Get Asset Spread Type */
|
||||
/** Get Spread Type */
|
||||
public String getA_Asset_Spread_Type();
|
||||
|
||||
/** Column name A_Asset_Spread_UU */
|
||||
public static final String COLUMNNAME_A_Asset_Spread_UU = "A_Asset_Spread_UU";
|
||||
|
||||
/** Set A_Asset_Spread_UU */
|
||||
public void setA_Asset_Spread_UU (String A_Asset_Spread_UU);
|
||||
|
||||
/** Get A_Asset_Spread_UU */
|
||||
public String getA_Asset_Spread_UU();
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_A_Asset_Transfer
|
|||
public static final String Table_Name = "A_Asset_Transfer";
|
||||
|
||||
/** AD_Table_ID=53128 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53128;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -44,12 +44,14 @@ public interface I_A_Asset_Transfer
|
|||
/** Column name A_Accumdepreciation_Acct */
|
||||
public static final String COLUMNNAME_A_Accumdepreciation_Acct = "A_Accumdepreciation_Acct";
|
||||
|
||||
/** Set Accumulated Depreciation */
|
||||
/** Set Accumulated Depreciation Account */
|
||||
public void setA_Accumdepreciation_Acct (int A_Accumdepreciation_Acct);
|
||||
|
||||
/** Get Accumulated Depreciation */
|
||||
/** Get Accumulated Depreciation Account */
|
||||
public int getA_Accumdepreciation_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Accumdepreciation_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Accumdepreciation_Acct_New */
|
||||
public static final String COLUMNNAME_A_Accumdepreciation_Acct_New = "A_Accumdepreciation_Acct_New";
|
||||
|
||||
|
@ -64,28 +66,50 @@ public interface I_A_Asset_Transfer
|
|||
/** Column name A_Accumdepreciation_Acct_Str */
|
||||
public static final String COLUMNNAME_A_Accumdepreciation_Acct_Str = "A_Accumdepreciation_Acct_Str";
|
||||
|
||||
/** Set Old Accum Depreciation Acct */
|
||||
/** Set Old Asset Cost Acct */
|
||||
public void setA_Accumdepreciation_Acct_Str (String A_Accumdepreciation_Acct_Str);
|
||||
|
||||
/** Get Old Accum Depreciation Acct */
|
||||
/** Get Old Asset Cost Acct */
|
||||
public String getA_Accumdepreciation_Acct_Str();
|
||||
|
||||
/** Column name A_Accumdepreciation_New_Acct */
|
||||
public static final String COLUMNNAME_A_Accumdepreciation_New_Acct = "A_Accumdepreciation_New_Acct";
|
||||
|
||||
/** Set Accumulated Depreciation Account (new) */
|
||||
public void setA_Accumdepreciation_New_Acct (int A_Accumdepreciation_New_Acct);
|
||||
|
||||
/** Get Accumulated Depreciation Account (new) */
|
||||
public int getA_Accumdepreciation_New_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Accumdepreciation_New_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Accumulated_Depr_F */
|
||||
public static final String COLUMNNAME_A_Accumulated_Depr_F = "A_Accumulated_Depr_F";
|
||||
|
||||
/** Set Accumulated Depreciation (fiscal) */
|
||||
public void setA_Accumulated_Depr_F (BigDecimal A_Accumulated_Depr_F);
|
||||
|
||||
/** Get Accumulated Depreciation (fiscal) */
|
||||
public BigDecimal getA_Accumulated_Depr_F();
|
||||
|
||||
/** Column name A_Asset_Acct */
|
||||
public static final String COLUMNNAME_A_Asset_Acct = "A_Asset_Acct";
|
||||
|
||||
/** Set Asset Cost Account */
|
||||
/** Set Asset Acct */
|
||||
public void setA_Asset_Acct (int A_Asset_Acct);
|
||||
|
||||
/** Get Asset Cost Account */
|
||||
/** Get Asset Acct */
|
||||
public int getA_Asset_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Asset_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_Acct_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Acct_ID = "A_Asset_Acct_ID";
|
||||
|
||||
/** Set Asset Acct. */
|
||||
/** Set A_Asset_Acct_ID */
|
||||
public void setA_Asset_Acct_ID (int A_Asset_Acct_ID);
|
||||
|
||||
/** Get Asset Acct. */
|
||||
/** Get A_Asset_Acct_ID */
|
||||
public int getA_Asset_Acct_ID();
|
||||
|
||||
/** Column name A_Asset_Acct_New */
|
||||
|
@ -102,10 +126,10 @@ public interface I_A_Asset_Transfer
|
|||
/** Column name A_Asset_Acct_Str */
|
||||
public static final String COLUMNNAME_A_Asset_Acct_Str = "A_Asset_Acct_Str";
|
||||
|
||||
/** Set Old Asset Cost Acct */
|
||||
/** Set A_Asset_Acct_Str */
|
||||
public void setA_Asset_Acct_Str (String A_Asset_Acct_Str);
|
||||
|
||||
/** Get Old Asset Cost Acct */
|
||||
/** Get A_Asset_Acct_Str */
|
||||
public String getA_Asset_Acct_Str();
|
||||
|
||||
/** Column name A_Asset_ID */
|
||||
|
@ -121,15 +145,46 @@ public interface I_A_Asset_Transfer
|
|||
*/
|
||||
public int getA_Asset_ID();
|
||||
|
||||
public org.compiere.model.I_A_Asset getA_Asset() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_New_Acct */
|
||||
public static final String COLUMNNAME_A_Asset_New_Acct = "A_Asset_New_Acct";
|
||||
|
||||
/** Set Asset Acct (new) */
|
||||
public void setA_Asset_New_Acct (int A_Asset_New_Acct);
|
||||
|
||||
/** Get Asset Acct (new) */
|
||||
public int getA_Asset_New_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Asset_New_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_Transfer_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Transfer_ID = "A_Asset_Transfer_ID";
|
||||
|
||||
/** Set Asset Transfer */
|
||||
/** Set A_Asset_Transfer_ID */
|
||||
public void setA_Asset_Transfer_ID (int A_Asset_Transfer_ID);
|
||||
|
||||
/** Get Asset Transfer */
|
||||
/** Get A_Asset_Transfer_ID */
|
||||
public int getA_Asset_Transfer_ID();
|
||||
|
||||
/** Column name A_Asset_Transfer_UU */
|
||||
public static final String COLUMNNAME_A_Asset_Transfer_UU = "A_Asset_Transfer_UU";
|
||||
|
||||
/** Set A_Asset_Transfer_UU */
|
||||
public void setA_Asset_Transfer_UU (String A_Asset_Transfer_UU);
|
||||
|
||||
/** Get A_Asset_Transfer_UU */
|
||||
public String getA_Asset_Transfer_UU();
|
||||
|
||||
/** Column name A_CapvsExp */
|
||||
public static final String COLUMNNAME_A_CapvsExp = "A_CapvsExp";
|
||||
|
||||
/** Set Capital/Expense */
|
||||
public void setA_CapvsExp (String A_CapvsExp);
|
||||
|
||||
/** Get Capital/Expense */
|
||||
public String getA_CapvsExp();
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
||||
|
@ -141,12 +196,14 @@ public interface I_A_Asset_Transfer
|
|||
/** Column name A_Depreciation_Acct */
|
||||
public static final String COLUMNNAME_A_Depreciation_Acct = "A_Depreciation_Acct";
|
||||
|
||||
/** Set Depreciation Expense Account */
|
||||
/** Set Depreciation Account */
|
||||
public void setA_Depreciation_Acct (int A_Depreciation_Acct);
|
||||
|
||||
/** Get Depreciation Expense Account */
|
||||
/** Get Depreciation Account */
|
||||
public int getA_Depreciation_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Depreciation_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Depreciation_Acct_New */
|
||||
public static final String COLUMNNAME_A_Depreciation_Acct_New = "A_Depreciation_Acct_New";
|
||||
|
||||
|
@ -161,12 +218,23 @@ public interface I_A_Asset_Transfer
|
|||
/** Column name A_Depreciation_Acct_Str */
|
||||
public static final String COLUMNNAME_A_Depreciation_Acct_Str = "A_Depreciation_Acct_Str";
|
||||
|
||||
/** Set Old Depreciation Exp Acct */
|
||||
/** Set A_Depreciation_Acct_Str */
|
||||
public void setA_Depreciation_Acct_Str (String A_Depreciation_Acct_Str);
|
||||
|
||||
/** Get Old Depreciation Exp Acct */
|
||||
/** Get A_Depreciation_Acct_Str */
|
||||
public String getA_Depreciation_Acct_Str();
|
||||
|
||||
/** Column name A_Depreciation_New_Acct */
|
||||
public static final String COLUMNNAME_A_Depreciation_New_Acct = "A_Depreciation_New_Acct";
|
||||
|
||||
/** Set Depreciation Acct (new) */
|
||||
public void setA_Depreciation_New_Acct (int A_Depreciation_New_Acct);
|
||||
|
||||
/** Get Depreciation Acct (new) */
|
||||
public int getA_Depreciation_New_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Depreciation_New_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Disposal_Loss */
|
||||
public static final String COLUMNNAME_A_Disposal_Loss = "A_Disposal_Loss";
|
||||
|
||||
|
@ -176,6 +244,17 @@ public interface I_A_Asset_Transfer
|
|||
/** Get Loss on Disposal */
|
||||
public int getA_Disposal_Loss();
|
||||
|
||||
/** Column name A_Disposal_Loss_Acct */
|
||||
public static final String COLUMNNAME_A_Disposal_Loss_Acct = "A_Disposal_Loss_Acct";
|
||||
|
||||
/** Set Disposal Loss Acct */
|
||||
public void setA_Disposal_Loss_Acct (int A_Disposal_Loss_Acct);
|
||||
|
||||
/** Get Disposal Loss Acct */
|
||||
public int getA_Disposal_Loss_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Disposal_Loss_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Disposal_Loss_New */
|
||||
public static final String COLUMNNAME_A_Disposal_Loss_New = "A_Disposal_Loss_New";
|
||||
|
||||
|
@ -187,13 +266,24 @@ public interface I_A_Asset_Transfer
|
|||
|
||||
public I_C_ValidCombination getA_Disposal_Loss_() throws RuntimeException;
|
||||
|
||||
/** Column name A_Disposal_Loss_New_Acct */
|
||||
public static final String COLUMNNAME_A_Disposal_Loss_New_Acct = "A_Disposal_Loss_New_Acct";
|
||||
|
||||
/** Set Disposal Loss Acct (new) */
|
||||
public void setA_Disposal_Loss_New_Acct (int A_Disposal_Loss_New_Acct);
|
||||
|
||||
/** Get Disposal Loss Acct (new) */
|
||||
public int getA_Disposal_Loss_New_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Disposal_Loss_New_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Disposal_Loss_Str */
|
||||
public static final String COLUMNNAME_A_Disposal_Loss_Str = "A_Disposal_Loss_Str";
|
||||
|
||||
/** Set Old Disposal Loss */
|
||||
/** Set Disposal Loss Str */
|
||||
public void setA_Disposal_Loss_Str (String A_Disposal_Loss_Str);
|
||||
|
||||
/** Get Old Disposal Loss */
|
||||
/** Get Disposal Loss Str */
|
||||
public String getA_Disposal_Loss_Str();
|
||||
|
||||
/** Column name A_Disposal_Revenue */
|
||||
|
@ -205,6 +295,17 @@ public interface I_A_Asset_Transfer
|
|||
/** Get Disposal Revenue */
|
||||
public int getA_Disposal_Revenue();
|
||||
|
||||
/** Column name A_Disposal_Revenue_Acct */
|
||||
public static final String COLUMNNAME_A_Disposal_Revenue_Acct = "A_Disposal_Revenue_Acct";
|
||||
|
||||
/** Set Disposal Revenue Acct */
|
||||
public void setA_Disposal_Revenue_Acct (int A_Disposal_Revenue_Acct);
|
||||
|
||||
/** Get Disposal Revenue Acct */
|
||||
public int getA_Disposal_Revenue_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Disposal_Revenue_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Disposal_Revenue_New */
|
||||
public static final String COLUMNNAME_A_Disposal_Revenue_New = "A_Disposal_Revenue_New";
|
||||
|
||||
|
@ -216,13 +317,24 @@ public interface I_A_Asset_Transfer
|
|||
|
||||
public I_C_ValidCombination getA_Disposal_Revenue_() throws RuntimeException;
|
||||
|
||||
/** Column name A_Disposal_Revenue_New_Acct */
|
||||
public static final String COLUMNNAME_A_Disposal_Revenue_New_Acct = "A_Disposal_Revenue_New_Acct";
|
||||
|
||||
/** Set Disposal Revenue Acct (new) */
|
||||
public void setA_Disposal_Revenue_New_Acct (int A_Disposal_Revenue_New_Acct);
|
||||
|
||||
/** Get Disposal Revenue Acct (new) */
|
||||
public int getA_Disposal_Revenue_New_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Disposal_Revenue_New_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Disposal_Revenue_Str */
|
||||
public static final String COLUMNNAME_A_Disposal_Revenue_Str = "A_Disposal_Revenue_Str";
|
||||
|
||||
/** Set Old Disposal Revenue */
|
||||
/** Set Disposal Revenue Str */
|
||||
public void setA_Disposal_Revenue_Str (String A_Disposal_Revenue_Str);
|
||||
|
||||
/** Get Old Disposal Revenue */
|
||||
/** Get Disposal Revenue Str */
|
||||
public String getA_Disposal_Revenue_Str();
|
||||
|
||||
/** Column name AD_Org_ID */
|
||||
|
@ -241,46 +353,46 @@ public interface I_A_Asset_Transfer
|
|||
/** Column name A_Period_End */
|
||||
public static final String COLUMNNAME_A_Period_End = "A_Period_End";
|
||||
|
||||
/** Set Period End */
|
||||
/** Set A_Period_End */
|
||||
public void setA_Period_End (int A_Period_End);
|
||||
|
||||
/** Get Period End */
|
||||
/** Get A_Period_End */
|
||||
public int getA_Period_End();
|
||||
|
||||
/** Column name A_Period_Start */
|
||||
public static final String COLUMNNAME_A_Period_Start = "A_Period_Start";
|
||||
|
||||
/** Set Period Start */
|
||||
/** Set A_Period_Start */
|
||||
public void setA_Period_Start (int A_Period_Start);
|
||||
|
||||
/** Get Period Start */
|
||||
/** Get A_Period_Start */
|
||||
public int getA_Period_Start();
|
||||
|
||||
/** Column name A_Split_Percent */
|
||||
public static final String COLUMNNAME_A_Split_Percent = "A_Split_Percent";
|
||||
|
||||
/** Set Split Percentage */
|
||||
/** Set Split Percent */
|
||||
public void setA_Split_Percent (BigDecimal A_Split_Percent);
|
||||
|
||||
/** Get Split Percentage */
|
||||
/** Get Split Percent */
|
||||
public BigDecimal getA_Split_Percent();
|
||||
|
||||
/** Column name A_Transfer_Balance */
|
||||
public static final String COLUMNNAME_A_Transfer_Balance = "A_Transfer_Balance";
|
||||
|
||||
/** Set Transfer Balance Sheet */
|
||||
/** Set A_Transfer_Balance */
|
||||
public void setA_Transfer_Balance (boolean A_Transfer_Balance);
|
||||
|
||||
/** Get Transfer Balance Sheet */
|
||||
/** Get A_Transfer_Balance */
|
||||
public boolean isA_Transfer_Balance();
|
||||
|
||||
/** Column name A_Transfer_Balance_IS */
|
||||
public static final String COLUMNNAME_A_Transfer_Balance_IS = "A_Transfer_Balance_IS";
|
||||
|
||||
/** Set Transfer Balance IS */
|
||||
/** Set A_Transfer_Balance_IS */
|
||||
public void setA_Transfer_Balance_IS (boolean A_Transfer_Balance_IS);
|
||||
|
||||
/** Get Transfer Balance IS */
|
||||
/** Get A_Transfer_Balance_IS */
|
||||
public boolean isA_Transfer_Balance_IS();
|
||||
|
||||
/** Column name C_AcctSchema_ID */
|
||||
|
@ -296,7 +408,7 @@ public interface I_A_Asset_Transfer
|
|||
*/
|
||||
public int getC_AcctSchema_ID();
|
||||
|
||||
public I_C_AcctSchema getC_AcctSchema() throws RuntimeException;
|
||||
public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException;
|
||||
|
||||
/** Column name C_Period_ID */
|
||||
public static final String COLUMNNAME_C_Period_ID = "C_Period_ID";
|
||||
|
@ -311,7 +423,7 @@ public interface I_A_Asset_Transfer
|
|||
*/
|
||||
public int getC_Period_ID();
|
||||
|
||||
public I_C_Period getC_Period() throws RuntimeException;
|
||||
public org.compiere.model.I_C_Period getC_Period() throws RuntimeException;
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
@ -342,6 +454,58 @@ public interface I_A_Asset_Transfer
|
|||
*/
|
||||
public Timestamp getDateAcct();
|
||||
|
||||
/** Column name DateDoc */
|
||||
public static final String COLUMNNAME_DateDoc = "DateDoc";
|
||||
|
||||
/** Set Document Date.
|
||||
* Date of the Document
|
||||
*/
|
||||
public void setDateDoc (Timestamp DateDoc);
|
||||
|
||||
/** Get Document Date.
|
||||
* Date of the Document
|
||||
*/
|
||||
public Timestamp getDateDoc();
|
||||
|
||||
/** 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 IsActive */
|
||||
public static final String COLUMNNAME_IsActive = "IsActive";
|
||||
|
||||
|
@ -355,6 +519,19 @@ public interface I_A_Asset_Transfer
|
|||
*/
|
||||
public boolean isActive();
|
||||
|
||||
/** Column name Posted */
|
||||
public static final String COLUMNNAME_Posted = "Posted";
|
||||
|
||||
/** Set Posted.
|
||||
* Posting status
|
||||
*/
|
||||
public void setPosted (boolean Posted);
|
||||
|
||||
/** Get Posted.
|
||||
* Posting status
|
||||
*/
|
||||
public boolean isPosted();
|
||||
|
||||
/** Column name PostingType */
|
||||
public static final String COLUMNNAME_PostingType = "PostingType";
|
||||
|
||||
|
@ -381,6 +558,19 @@ public interface I_A_Asset_Transfer
|
|||
*/
|
||||
public boolean isProcessed();
|
||||
|
||||
/** Column name ProcessedOn */
|
||||
public static final String COLUMNNAME_ProcessedOn = "ProcessedOn";
|
||||
|
||||
/** Set Processed On.
|
||||
* The date+time (expressed in decimal format) when the document has been processed
|
||||
*/
|
||||
public void setProcessedOn (BigDecimal ProcessedOn);
|
||||
|
||||
/** Get Processed On.
|
||||
* The date+time (expressed in decimal format) when the document has been processed
|
||||
*/
|
||||
public BigDecimal getProcessedOn();
|
||||
|
||||
/** Column name Processing */
|
||||
public static final String COLUMNNAME_Processing = "Processing";
|
||||
|
||||
|
|
|
@ -0,0 +1,196 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2007 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 A_Asset_Type
|
||||
* @author Adempiere (generated)
|
||||
* @version Release 3.6.0LTS
|
||||
*/
|
||||
public interface I_A_Asset_Type
|
||||
{
|
||||
|
||||
/** TableName=A_Asset_Type */
|
||||
public static final String Table_Name = "A_Asset_Type";
|
||||
|
||||
/** AD_Table_ID=53276 */
|
||||
public static final int Table_ID = 53276;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
/** AccessLevel = 3 - Client - Org
|
||||
*/
|
||||
BigDecimal accessLevel = BigDecimal.valueOf(3);
|
||||
|
||||
/** Load Meta Data */
|
||||
|
||||
/** Column name A_Asset_Type_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Type_ID = "A_Asset_Type_ID";
|
||||
|
||||
/** Set Asset Type */
|
||||
public void setA_Asset_Type_ID (int A_Asset_Type_ID);
|
||||
|
||||
/** Get Asset Type */
|
||||
public int getA_Asset_Type_ID();
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
||||
/** Get Client.
|
||||
* Client/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 client
|
||||
*/
|
||||
public void setAD_Org_ID (int AD_Org_ID);
|
||||
|
||||
/** Get Organization.
|
||||
* Organizational entity within client
|
||||
*/
|
||||
public int getAD_Org_ID();
|
||||
|
||||
/** 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 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 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 IsDepreciable */
|
||||
public static final String COLUMNNAME_IsDepreciable = "IsDepreciable";
|
||||
|
||||
/** Set Is Depreciable.
|
||||
* This asset CAN be depreciated
|
||||
*/
|
||||
public void setIsDepreciable (String IsDepreciable);
|
||||
|
||||
/** Get Is Depreciable.
|
||||
* This asset CAN be depreciated
|
||||
*/
|
||||
public String getIsDepreciable();
|
||||
|
||||
/** Column name IsInPosession */
|
||||
public static final String COLUMNNAME_IsInPosession = "IsInPosession";
|
||||
|
||||
/** Set In Possession.
|
||||
* The asset is in the possession of the organization
|
||||
*/
|
||||
public void setIsInPosession (String IsInPosession);
|
||||
|
||||
/** Get In Possession.
|
||||
* The asset is in the possession of the organization
|
||||
*/
|
||||
public String getIsInPosession();
|
||||
|
||||
/** Column name IsOwned */
|
||||
public static final String COLUMNNAME_IsOwned = "IsOwned";
|
||||
|
||||
/** Set Owned.
|
||||
* The asset is owned by the organization
|
||||
*/
|
||||
public void setIsOwned (String IsOwned);
|
||||
|
||||
/** Get Owned.
|
||||
* The asset is owned by the organization
|
||||
*/
|
||||
public String getIsOwned();
|
||||
|
||||
/** Column name Name */
|
||||
public static final String COLUMNNAME_Name = "Name";
|
||||
|
||||
/** Set Name.
|
||||
* Alphanumeric identifier of the entity
|
||||
*/
|
||||
public void setName (String Name);
|
||||
|
||||
/** Get Name.
|
||||
* Alphanumeric identifier of the entity
|
||||
*/
|
||||
public String getName();
|
||||
|
||||
/** 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();
|
||||
|
||||
/** Column name Value */
|
||||
public static final String COLUMNNAME_Value = "Value";
|
||||
|
||||
/** Set Search Key.
|
||||
* Search key for the record in the format required - must be unique
|
||||
*/
|
||||
public void setValue (String Value);
|
||||
|
||||
/** Get Search Key.
|
||||
* Search key for the record in the format required - must be unique
|
||||
*/
|
||||
public String getValue();
|
||||
}
|
|
@ -31,7 +31,7 @@ public interface I_A_Asset_Use
|
|||
public static final String Table_Name = "A_Asset_Use";
|
||||
|
||||
/** AD_Table_ID=53138 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53138;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -54,15 +54,26 @@ public interface I_A_Asset_Use
|
|||
*/
|
||||
public int getA_Asset_ID();
|
||||
|
||||
public org.compiere.model.I_A_Asset getA_Asset() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_Use_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Use_ID = "A_Asset_Use_ID";
|
||||
|
||||
/** Set Asset Use */
|
||||
/** Set A_Asset_Use_ID */
|
||||
public void setA_Asset_Use_ID (int A_Asset_Use_ID);
|
||||
|
||||
/** Get Asset Use */
|
||||
/** Get A_Asset_Use_ID */
|
||||
public int getA_Asset_Use_ID();
|
||||
|
||||
/** Column name A_Asset_Use_UU */
|
||||
public static final String COLUMNNAME_A_Asset_Use_UU = "A_Asset_Use_UU";
|
||||
|
||||
/** Set A_Asset_Use_UU */
|
||||
public void setA_Asset_Use_UU (String A_Asset_Use_UU);
|
||||
|
||||
/** Get A_Asset_Use_UU */
|
||||
public String getA_Asset_Use_UU();
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_A_Depreciation
|
|||
public static final String Table_Name = "A_Depreciation";
|
||||
|
||||
/** AD_Table_ID=53112 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53112;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -52,12 +52,21 @@ public interface I_A_Depreciation
|
|||
/** Column name A_Depreciation_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_ID = "A_Depreciation_ID";
|
||||
|
||||
/** Set Depreciation Type */
|
||||
/** Set Depreciation */
|
||||
public void setA_Depreciation_ID (int A_Depreciation_ID);
|
||||
|
||||
/** Get Depreciation Type */
|
||||
/** Get Depreciation */
|
||||
public int getA_Depreciation_ID();
|
||||
|
||||
/** Column name A_Depreciation_UU */
|
||||
public static final String COLUMNNAME_A_Depreciation_UU = "A_Depreciation_UU";
|
||||
|
||||
/** Set A_Depreciation_UU */
|
||||
public void setA_Depreciation_UU (String A_Depreciation_UU);
|
||||
|
||||
/** Get A_Depreciation_UU */
|
||||
public String getA_Depreciation_UU();
|
||||
|
||||
/** Column name AD_Org_ID */
|
||||
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
|
||||
|
||||
|
@ -151,10 +160,10 @@ public interface I_A_Depreciation
|
|||
/** Column name Text */
|
||||
public static final String COLUMNNAME_Text = "Text";
|
||||
|
||||
/** Set Text */
|
||||
/** Set Description */
|
||||
public void setText (String Text);
|
||||
|
||||
/** Get Text */
|
||||
/** Get Description */
|
||||
public String getText();
|
||||
|
||||
/** Column name Updated */
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_A_Depreciation_Build
|
|||
public static final String Table_Name = "A_Depreciation_Build";
|
||||
|
||||
/** AD_Table_ID=53129 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53129;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -52,12 +52,21 @@ public interface I_A_Depreciation_Build
|
|||
/** Column name A_Depreciation_Build_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_Build_ID = "A_Depreciation_Build_ID";
|
||||
|
||||
/** Set Depreciation Build */
|
||||
/** Set Build Depreciation */
|
||||
public void setA_Depreciation_Build_ID (int A_Depreciation_Build_ID);
|
||||
|
||||
/** Get Depreciation Build */
|
||||
/** Get Build Depreciation */
|
||||
public int getA_Depreciation_Build_ID();
|
||||
|
||||
/** Column name A_Depreciation_Build_UU */
|
||||
public static final String COLUMNNAME_A_Depreciation_Build_UU = "A_Depreciation_Build_UU";
|
||||
|
||||
/** Set A_Depreciation_Build_UU */
|
||||
public void setA_Depreciation_Build_UU (String A_Depreciation_Build_UU);
|
||||
|
||||
/** Get A_Depreciation_Build_UU */
|
||||
public String getA_Depreciation_Build_UU();
|
||||
|
||||
/** Column name AD_Org_ID */
|
||||
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
|
||||
|
||||
|
@ -74,24 +83,24 @@ public interface I_A_Depreciation_Build
|
|||
/** Column name A_End_Asset_ID */
|
||||
public static final String COLUMNNAME_A_End_Asset_ID = "A_End_Asset_ID";
|
||||
|
||||
/** Set End Aset ID */
|
||||
/** Set To Asset */
|
||||
public void setA_End_Asset_ID (int A_End_Asset_ID);
|
||||
|
||||
/** Get End Aset ID */
|
||||
/** Get To Asset */
|
||||
public int getA_End_Asset_ID();
|
||||
|
||||
public I_A_Asset getA_End_Asset() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Asset getA_End_Asset() throws RuntimeException;
|
||||
|
||||
/** Column name A_Start_Asset_ID */
|
||||
public static final String COLUMNNAME_A_Start_Asset_ID = "A_Start_Asset_ID";
|
||||
|
||||
/** Set Start Asset */
|
||||
/** Set From Asset */
|
||||
public void setA_Start_Asset_ID (int A_Start_Asset_ID);
|
||||
|
||||
/** Get Start Asset */
|
||||
/** Get From Asset */
|
||||
public int getA_Start_Asset_ID();
|
||||
|
||||
public I_A_Asset getA_Start_Asset() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Asset getA_Start_Asset() throws RuntimeException;
|
||||
|
||||
/** Column name C_Period_ID */
|
||||
public static final String COLUMNNAME_C_Period_ID = "C_Period_ID";
|
||||
|
@ -106,7 +115,7 @@ public interface I_A_Depreciation_Build
|
|||
*/
|
||||
public int getC_Period_ID();
|
||||
|
||||
public I_C_Period getC_Period() throws RuntimeException;
|
||||
public org.compiere.model.I_C_Period getC_Period() throws RuntimeException;
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_A_Depreciation_Convention
|
|||
public static final String Table_Name = "A_Depreciation_Convention";
|
||||
|
||||
/** AD_Table_ID=53125 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53125;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -58,6 +58,15 @@ public interface I_A_Depreciation_Convention
|
|||
/** Get Depreciation Convention */
|
||||
public int getA_Depreciation_Convention_ID();
|
||||
|
||||
/** Column name A_Depreciation_Convention_UU */
|
||||
public static final String COLUMNNAME_A_Depreciation_Convention_UU = "A_Depreciation_Convention_UU";
|
||||
|
||||
/** Set A_Depreciation_Convention_UU */
|
||||
public void setA_Depreciation_Convention_UU (String A_Depreciation_Convention_UU);
|
||||
|
||||
/** Get A_Depreciation_Convention_UU */
|
||||
public String getA_Depreciation_Convention_UU();
|
||||
|
||||
/** Column name AD_Org_ID */
|
||||
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
|
||||
|
||||
|
|
|
@ -31,13 +31,13 @@ public interface I_A_Depreciation_Entry
|
|||
public static final String Table_Name = "A_Depreciation_Entry";
|
||||
|
||||
/** AD_Table_ID=53121 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53121;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
/** AccessLevel = 7 - System - Client - Org
|
||||
/** AccessLevel = 3 - Client - Org
|
||||
*/
|
||||
BigDecimal accessLevel = BigDecimal.valueOf(7);
|
||||
BigDecimal accessLevel = BigDecimal.valueOf(3);
|
||||
|
||||
/** Load Meta Data */
|
||||
|
||||
|
@ -58,6 +58,15 @@ public interface I_A_Depreciation_Entry
|
|||
/** Get Depreciation Entry */
|
||||
public int getA_Depreciation_Entry_ID();
|
||||
|
||||
/** Column name A_Depreciation_Entry_UU */
|
||||
public static final String COLUMNNAME_A_Depreciation_Entry_UU = "A_Depreciation_Entry_UU";
|
||||
|
||||
/** Set A_Depreciation_Entry_UU */
|
||||
public void setA_Depreciation_Entry_UU (String A_Depreciation_Entry_UU);
|
||||
|
||||
/** Get A_Depreciation_Entry_UU */
|
||||
public String getA_Depreciation_Entry_UU();
|
||||
|
||||
/** Column name AD_Org_ID */
|
||||
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
|
||||
|
||||
|
@ -93,7 +102,7 @@ public interface I_A_Depreciation_Entry
|
|||
*/
|
||||
public int getC_AcctSchema_ID();
|
||||
|
||||
public I_C_AcctSchema getC_AcctSchema() throws RuntimeException;
|
||||
public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException;
|
||||
|
||||
/** Column name C_Currency_ID */
|
||||
public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID";
|
||||
|
@ -108,7 +117,7 @@ public interface I_A_Depreciation_Entry
|
|||
*/
|
||||
public int getC_Currency_ID();
|
||||
|
||||
public I_C_Currency getC_Currency() throws RuntimeException;
|
||||
public org.compiere.model.I_C_Currency getC_Currency() throws RuntimeException;
|
||||
|
||||
/** Column name C_DocType_ID */
|
||||
public static final String COLUMNNAME_C_DocType_ID = "C_DocType_ID";
|
||||
|
@ -123,7 +132,7 @@ public interface I_A_Depreciation_Entry
|
|||
*/
|
||||
public int getC_DocType_ID();
|
||||
|
||||
public I_C_DocType getC_DocType() throws RuntimeException;
|
||||
public org.compiere.model.I_C_DocType getC_DocType() throws RuntimeException;
|
||||
|
||||
/** Column name C_Period_ID */
|
||||
public static final String COLUMNNAME_C_Period_ID = "C_Period_ID";
|
||||
|
@ -138,7 +147,7 @@ public interface I_A_Depreciation_Entry
|
|||
*/
|
||||
public int getC_Period_ID();
|
||||
|
||||
public I_C_Period getC_Period() throws RuntimeException;
|
||||
public org.compiere.model.I_C_Period getC_Period() throws RuntimeException;
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
@ -195,6 +204,32 @@ public interface I_A_Depreciation_Entry
|
|||
*/
|
||||
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";
|
||||
|
||||
|
@ -221,7 +256,7 @@ public interface I_A_Depreciation_Entry
|
|||
*/
|
||||
public int getGL_Category_ID();
|
||||
|
||||
public I_GL_Category getGL_Category() throws RuntimeException;
|
||||
public org.compiere.model.I_GL_Category getGL_Category() throws RuntimeException;
|
||||
|
||||
/** Column name IsActive */
|
||||
public static final String COLUMNNAME_IsActive = "IsActive";
|
||||
|
@ -236,6 +271,32 @@ public interface I_A_Depreciation_Entry
|
|||
*/
|
||||
public boolean isActive();
|
||||
|
||||
/** Column name IsApproved */
|
||||
public static final String COLUMNNAME_IsApproved = "IsApproved";
|
||||
|
||||
/** Set Approved.
|
||||
* Indicates if this document requires approval
|
||||
*/
|
||||
public void setIsApproved (boolean IsApproved);
|
||||
|
||||
/** Get Approved.
|
||||
* Indicates if this document requires approval
|
||||
*/
|
||||
public boolean isApproved();
|
||||
|
||||
/** Column name Posted */
|
||||
public static final String COLUMNNAME_Posted = "Posted";
|
||||
|
||||
/** Set Posted.
|
||||
* Posting status
|
||||
*/
|
||||
public void setPosted (boolean Posted);
|
||||
|
||||
/** Get Posted.
|
||||
* Posting status
|
||||
*/
|
||||
public boolean isPosted();
|
||||
|
||||
/** Column name PostingType */
|
||||
public static final String COLUMNNAME_PostingType = "PostingType";
|
||||
|
||||
|
@ -262,6 +323,19 @@ public interface I_A_Depreciation_Entry
|
|||
*/
|
||||
public boolean isProcessed();
|
||||
|
||||
/** Column name ProcessedOn */
|
||||
public static final String COLUMNNAME_ProcessedOn = "ProcessedOn";
|
||||
|
||||
/** Set Processed On.
|
||||
* The date+time (expressed in decimal format) when the document has been processed
|
||||
*/
|
||||
public void setProcessedOn (BigDecimal ProcessedOn);
|
||||
|
||||
/** Get Processed On.
|
||||
* The date+time (expressed in decimal format) when the document has been processed
|
||||
*/
|
||||
public BigDecimal getProcessedOn();
|
||||
|
||||
/** Column name Processing */
|
||||
public static final String COLUMNNAME_Processing = "Processing";
|
||||
|
||||
|
|
|
@ -31,26 +31,102 @@ public interface I_A_Depreciation_Exp
|
|||
public static final String Table_Name = "A_Depreciation_Exp";
|
||||
|
||||
/** AD_Table_ID=53115 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53115;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
/** AccessLevel = 7 - System - Client - Org
|
||||
/** AccessLevel = 3 - Client - Org
|
||||
*/
|
||||
BigDecimal accessLevel = BigDecimal.valueOf(7);
|
||||
BigDecimal accessLevel = BigDecimal.valueOf(3);
|
||||
|
||||
/** Load Meta Data */
|
||||
|
||||
/** Column name A_Account_Number */
|
||||
public static final String COLUMNNAME_A_Account_Number = "A_Account_Number";
|
||||
/** Column name A_Account_Number_Acct */
|
||||
public static final String COLUMNNAME_A_Account_Number_Acct = "A_Account_Number_Acct";
|
||||
|
||||
/** Set Account Number */
|
||||
public void setA_Account_Number (int A_Account_Number);
|
||||
/** Set A_Account_Number_Acct */
|
||||
public void setA_Account_Number_Acct (int A_Account_Number_Acct);
|
||||
|
||||
/** Get Account Number */
|
||||
public int getA_Account_Number();
|
||||
/** Get A_Account_Number_Acct */
|
||||
public int getA_Account_Number_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Account_Num() throws RuntimeException;
|
||||
public I_C_ValidCombination getA_Account_Number_A() throws RuntimeException;
|
||||
|
||||
/** Column name A_Accumulated_Depr */
|
||||
public static final String COLUMNNAME_A_Accumulated_Depr = "A_Accumulated_Depr";
|
||||
|
||||
/** Set Accumulated Depreciation */
|
||||
public void setA_Accumulated_Depr (BigDecimal A_Accumulated_Depr);
|
||||
|
||||
/** Get Accumulated Depreciation */
|
||||
public BigDecimal getA_Accumulated_Depr();
|
||||
|
||||
/** Column name A_Accumulated_Depr_Delta */
|
||||
public static final String COLUMNNAME_A_Accumulated_Depr_Delta = "A_Accumulated_Depr_Delta";
|
||||
|
||||
/** Set Accumulated Depreciation (delta) */
|
||||
public void setA_Accumulated_Depr_Delta (BigDecimal A_Accumulated_Depr_Delta);
|
||||
|
||||
/** Get Accumulated Depreciation (delta) */
|
||||
public BigDecimal getA_Accumulated_Depr_Delta();
|
||||
|
||||
/** Column name A_Accumulated_Depr_F */
|
||||
public static final String COLUMNNAME_A_Accumulated_Depr_F = "A_Accumulated_Depr_F";
|
||||
|
||||
/** Set Accumulated Depreciation (fiscal) */
|
||||
public void setA_Accumulated_Depr_F (BigDecimal A_Accumulated_Depr_F);
|
||||
|
||||
/** Get Accumulated Depreciation (fiscal) */
|
||||
public BigDecimal getA_Accumulated_Depr_F();
|
||||
|
||||
/** Column name A_Accumulated_Depr_F_Delta */
|
||||
public static final String COLUMNNAME_A_Accumulated_Depr_F_Delta = "A_Accumulated_Depr_F_Delta";
|
||||
|
||||
/** Set Accumulated Depreciation - fiscal (delta) */
|
||||
public void setA_Accumulated_Depr_F_Delta (BigDecimal A_Accumulated_Depr_F_Delta);
|
||||
|
||||
/** Get Accumulated Depreciation - fiscal (delta) */
|
||||
public BigDecimal getA_Accumulated_Depr_F_Delta();
|
||||
|
||||
/** Column name A_Asset_Addition_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Addition_ID = "A_Asset_Addition_ID";
|
||||
|
||||
/** Set Asset Addition */
|
||||
public void setA_Asset_Addition_ID (int A_Asset_Addition_ID);
|
||||
|
||||
/** Get Asset Addition */
|
||||
public int getA_Asset_Addition_ID();
|
||||
|
||||
public org.compiere.model.I_A_Asset_Addition getA_Asset_Addition() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_Cost */
|
||||
public static final String COLUMNNAME_A_Asset_Cost = "A_Asset_Cost";
|
||||
|
||||
/** Set Asset Cost */
|
||||
public void setA_Asset_Cost (BigDecimal A_Asset_Cost);
|
||||
|
||||
/** Get Asset Cost */
|
||||
public BigDecimal getA_Asset_Cost();
|
||||
|
||||
/** Column name A_Asset_Cost_Delta */
|
||||
public static final String COLUMNNAME_A_Asset_Cost_Delta = "A_Asset_Cost_Delta";
|
||||
|
||||
/** Set Delta Asset Cost */
|
||||
public void setA_Asset_Cost_Delta (BigDecimal A_Asset_Cost_Delta);
|
||||
|
||||
/** Get Delta Asset Cost */
|
||||
public BigDecimal getA_Asset_Cost_Delta();
|
||||
|
||||
/** Column name A_Asset_Disposed_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Disposed_ID = "A_Asset_Disposed_ID";
|
||||
|
||||
/** Set Asset Disposed */
|
||||
public void setA_Asset_Disposed_ID (int A_Asset_Disposed_ID);
|
||||
|
||||
/** Get Asset Disposed */
|
||||
public int getA_Asset_Disposed_ID();
|
||||
|
||||
public org.compiere.model.I_A_Asset_Disposed getA_Asset_Disposed() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_ID */
|
||||
public static final String COLUMNNAME_A_Asset_ID = "A_Asset_ID";
|
||||
|
@ -65,6 +141,26 @@ public interface I_A_Depreciation_Exp
|
|||
*/
|
||||
public int getA_Asset_ID();
|
||||
|
||||
public org.compiere.model.I_A_Asset getA_Asset() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_Remaining */
|
||||
public static final String COLUMNNAME_A_Asset_Remaining = "A_Asset_Remaining";
|
||||
|
||||
/** Set Remaining Amt */
|
||||
public void setA_Asset_Remaining (BigDecimal A_Asset_Remaining);
|
||||
|
||||
/** Get Remaining Amt */
|
||||
public BigDecimal getA_Asset_Remaining();
|
||||
|
||||
/** Column name A_Asset_Remaining_F */
|
||||
public static final String COLUMNNAME_A_Asset_Remaining_F = "A_Asset_Remaining_F";
|
||||
|
||||
/** Set Remaining Amt (fiscal) */
|
||||
public void setA_Asset_Remaining_F (BigDecimal A_Asset_Remaining_F);
|
||||
|
||||
/** Get Remaining Amt (fiscal) */
|
||||
public BigDecimal getA_Asset_Remaining_F();
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
||||
|
@ -73,15 +169,35 @@ public interface I_A_Depreciation_Exp
|
|||
*/
|
||||
public int getAD_Client_ID();
|
||||
|
||||
/** Column name A_Depreciation_Entry_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_Entry_ID = "A_Depreciation_Entry_ID";
|
||||
|
||||
/** Set Depreciation Entry */
|
||||
public void setA_Depreciation_Entry_ID (int A_Depreciation_Entry_ID);
|
||||
|
||||
/** Get Depreciation Entry */
|
||||
public int getA_Depreciation_Entry_ID();
|
||||
|
||||
public org.compiere.model.I_A_Depreciation_Entry getA_Depreciation_Entry() throws RuntimeException;
|
||||
|
||||
/** Column name A_Depreciation_Exp_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_Exp_ID = "A_Depreciation_Exp_ID";
|
||||
|
||||
/** Set Depreciation Exp. */
|
||||
/** Set A_Depreciation_Exp_ID */
|
||||
public void setA_Depreciation_Exp_ID (int A_Depreciation_Exp_ID);
|
||||
|
||||
/** Get Depreciation Exp. */
|
||||
/** Get A_Depreciation_Exp_ID */
|
||||
public int getA_Depreciation_Exp_ID();
|
||||
|
||||
/** Column name A_Depreciation_Exp_UU */
|
||||
public static final String COLUMNNAME_A_Depreciation_Exp_UU = "A_Depreciation_Exp_UU";
|
||||
|
||||
/** Set A_Depreciation_Exp_UU */
|
||||
public void setA_Depreciation_Exp_UU (String A_Depreciation_Exp_UU);
|
||||
|
||||
/** Get A_Depreciation_Exp_UU */
|
||||
public String getA_Depreciation_Exp_UU();
|
||||
|
||||
/** Column name AD_Org_ID */
|
||||
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
|
||||
|
||||
|
@ -107,12 +223,27 @@ public interface I_A_Depreciation_Exp
|
|||
/** Column name A_Period */
|
||||
public static final String COLUMNNAME_A_Period = "A_Period";
|
||||
|
||||
/** Set Period/Yearly */
|
||||
/** Set Asset Period */
|
||||
public void setA_Period (int A_Period);
|
||||
|
||||
/** Get Period/Yearly */
|
||||
/** Get Asset Period */
|
||||
public int getA_Period();
|
||||
|
||||
/** Column name CR_Account_ID */
|
||||
public static final String COLUMNNAME_CR_Account_ID = "CR_Account_ID";
|
||||
|
||||
/** Set Account (credit).
|
||||
* Account used
|
||||
*/
|
||||
public void setCR_Account_ID (int CR_Account_ID);
|
||||
|
||||
/** Get Account (credit).
|
||||
* Account used
|
||||
*/
|
||||
public int getCR_Account_ID();
|
||||
|
||||
public I_C_ValidCombination getCR_Account() throws RuntimeException;
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
||||
|
@ -155,6 +286,21 @@ public interface I_A_Depreciation_Exp
|
|||
*/
|
||||
public String getDescription();
|
||||
|
||||
/** Column name DR_Account_ID */
|
||||
public static final String COLUMNNAME_DR_Account_ID = "DR_Account_ID";
|
||||
|
||||
/** Set Account (debit).
|
||||
* Account used
|
||||
*/
|
||||
public void setDR_Account_ID (int DR_Account_ID);
|
||||
|
||||
/** Get Account (debit).
|
||||
* Account used
|
||||
*/
|
||||
public int getDR_Account_ID();
|
||||
|
||||
public I_C_ValidCombination getDR_Account() throws RuntimeException;
|
||||
|
||||
/** Column name Expense */
|
||||
public static final String COLUMNNAME_Expense = "Expense";
|
||||
|
||||
|
@ -164,6 +310,28 @@ public interface I_A_Depreciation_Exp
|
|||
/** Get Expense */
|
||||
public BigDecimal getExpense();
|
||||
|
||||
/** Column name Expense_F */
|
||||
public static final String COLUMNNAME_Expense_F = "Expense_F";
|
||||
|
||||
/** Set Expense (fiscal) */
|
||||
public void setExpense_F (BigDecimal Expense_F);
|
||||
|
||||
/** Get Expense (fiscal) */
|
||||
public BigDecimal getExpense_F();
|
||||
|
||||
/** Column name Help */
|
||||
public static final String COLUMNNAME_Help = "Help";
|
||||
|
||||
/** Set Comment/Help.
|
||||
* Comment or Hint
|
||||
*/
|
||||
public void setHelp (String Help);
|
||||
|
||||
/** Get Comment/Help.
|
||||
* Comment or Hint
|
||||
*/
|
||||
public String getHelp();
|
||||
|
||||
/** Column name IsActive */
|
||||
public static final String COLUMNNAME_IsActive = "IsActive";
|
||||
|
||||
|
@ -216,6 +384,15 @@ public interface I_A_Depreciation_Exp
|
|||
*/
|
||||
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 Updated */
|
||||
public static final String COLUMNNAME_Updated = "Updated";
|
||||
|
||||
|
@ -231,4 +408,26 @@ public interface I_A_Depreciation_Exp
|
|||
* User who updated this records
|
||||
*/
|
||||
public int getUpdatedBy();
|
||||
|
||||
/** Column name UseLifeMonths */
|
||||
public static final String COLUMNNAME_UseLifeMonths = "UseLifeMonths";
|
||||
|
||||
/** Set Usable Life - Months.
|
||||
* Months of the usable life of the asset
|
||||
*/
|
||||
public void setUseLifeMonths (int UseLifeMonths);
|
||||
|
||||
/** Get Usable Life - Months.
|
||||
* Months of the usable life of the asset
|
||||
*/
|
||||
public int getUseLifeMonths();
|
||||
|
||||
/** Column name UseLifeMonths_F */
|
||||
public static final String COLUMNNAME_UseLifeMonths_F = "UseLifeMonths_F";
|
||||
|
||||
/** Set Use Life - Months (fiscal) */
|
||||
public void setUseLifeMonths_F (int UseLifeMonths_F);
|
||||
|
||||
/** Get Use Life - Months (fiscal) */
|
||||
public int getUseLifeMonths_F();
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_A_Depreciation_Forecast
|
|||
public static final String Table_Name = "A_Depreciation_Forecast";
|
||||
|
||||
/** AD_Table_ID=53118 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53118;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -58,6 +58,15 @@ public interface I_A_Depreciation_Forecast
|
|||
/** Get Depreciation Forecast */
|
||||
public int getA_Depreciation_Forecast_ID();
|
||||
|
||||
/** Column name A_Depreciation_Forecast_UU */
|
||||
public static final String COLUMNNAME_A_Depreciation_Forecast_UU = "A_Depreciation_Forecast_UU";
|
||||
|
||||
/** Set A_Depreciation_Forecast_UU */
|
||||
public void setA_Depreciation_Forecast_UU (String A_Depreciation_Forecast_UU);
|
||||
|
||||
/** Get A_Depreciation_Forecast_UU */
|
||||
public String getA_Depreciation_Forecast_UU();
|
||||
|
||||
/** Column name AD_Org_ID */
|
||||
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
|
||||
|
||||
|
@ -74,24 +83,24 @@ public interface I_A_Depreciation_Forecast
|
|||
/** Column name A_End_Asset_ID */
|
||||
public static final String COLUMNNAME_A_End_Asset_ID = "A_End_Asset_ID";
|
||||
|
||||
/** Set End Aset ID */
|
||||
/** Set To Asset */
|
||||
public void setA_End_Asset_ID (int A_End_Asset_ID);
|
||||
|
||||
/** Get End Aset ID */
|
||||
/** Get To Asset */
|
||||
public int getA_End_Asset_ID();
|
||||
|
||||
public I_A_Asset getA_End_Asset() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Asset getA_End_Asset() throws RuntimeException;
|
||||
|
||||
/** Column name A_Start_Asset_ID */
|
||||
public static final String COLUMNNAME_A_Start_Asset_ID = "A_Start_Asset_ID";
|
||||
|
||||
/** Set Start Asset */
|
||||
/** Set From Asset */
|
||||
public void setA_Start_Asset_ID (int A_Start_Asset_ID);
|
||||
|
||||
/** Get Start Asset */
|
||||
/** Get From Asset */
|
||||
public int getA_Start_Asset_ID();
|
||||
|
||||
public I_A_Asset getA_Start_Asset() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Asset getA_Start_Asset() throws RuntimeException;
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_A_Depreciation_Method
|
|||
public static final String Table_Name = "A_Depreciation_Method";
|
||||
|
||||
/** AD_Table_ID=53124 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53124;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -52,12 +52,21 @@ public interface I_A_Depreciation_Method
|
|||
/** Column name A_Depreciation_Method_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_Method_ID = "A_Depreciation_Method_ID";
|
||||
|
||||
/** Set Depreciation Calculation Type */
|
||||
/** Set Depreciation Method */
|
||||
public void setA_Depreciation_Method_ID (int A_Depreciation_Method_ID);
|
||||
|
||||
/** Get Depreciation Calculation Type */
|
||||
/** Get Depreciation Method */
|
||||
public int getA_Depreciation_Method_ID();
|
||||
|
||||
/** Column name A_Depreciation_Method_UU */
|
||||
public static final String COLUMNNAME_A_Depreciation_Method_UU = "A_Depreciation_Method_UU";
|
||||
|
||||
/** Set A_Depreciation_Method_UU */
|
||||
public void setA_Depreciation_Method_UU (String A_Depreciation_Method_UU);
|
||||
|
||||
/** Get A_Depreciation_Method_UU */
|
||||
public String getA_Depreciation_Method_UU();
|
||||
|
||||
/** Column name AD_Org_ID */
|
||||
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
|
||||
|
||||
|
@ -151,10 +160,10 @@ public interface I_A_Depreciation_Method
|
|||
/** Column name Text */
|
||||
public static final String COLUMNNAME_Text = "Text";
|
||||
|
||||
/** Set Text */
|
||||
/** Set Description */
|
||||
public void setText (String Text);
|
||||
|
||||
/** Get Text */
|
||||
/** Get Description */
|
||||
public String getText();
|
||||
|
||||
/** Column name Updated */
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_A_Depreciation_Table_Detail
|
|||
public static final String Table_Name = "A_Depreciation_Table_Detail";
|
||||
|
||||
/** AD_Table_ID=53113 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53113;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -76,6 +76,15 @@ public interface I_A_Depreciation_Table_Detail
|
|||
/** Get Depreciation Table Detail */
|
||||
public int getA_Depreciation_Table_Detail_ID();
|
||||
|
||||
/** Column name A_Depreciation_Table_Detail_UU */
|
||||
public static final String COLUMNNAME_A_Depreciation_Table_Detail_UU = "A_Depreciation_Table_Detail_UU";
|
||||
|
||||
/** Set A_Depreciation_Table_Detail_UU */
|
||||
public void setA_Depreciation_Table_Detail_UU (String A_Depreciation_Table_Detail_UU);
|
||||
|
||||
/** Get A_Depreciation_Table_Detail_UU */
|
||||
public String getA_Depreciation_Table_Detail_UU();
|
||||
|
||||
/** Column name AD_Org_ID */
|
||||
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
|
||||
|
||||
|
@ -92,10 +101,10 @@ public interface I_A_Depreciation_Table_Detail
|
|||
/** Column name A_Period */
|
||||
public static final String COLUMNNAME_A_Period = "A_Period";
|
||||
|
||||
/** Set Period/Yearly */
|
||||
/** Set Asset Period */
|
||||
public void setA_Period (int A_Period);
|
||||
|
||||
/** Get Period/Yearly */
|
||||
/** Get Asset Period */
|
||||
public int getA_Period();
|
||||
|
||||
/** Column name A_Table_Rate_Type */
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_A_Depreciation_Table_Header
|
|||
public static final String Table_Name = "A_Depreciation_Table_Header";
|
||||
|
||||
/** AD_Table_ID=53114 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53114;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -61,12 +61,21 @@ public interface I_A_Depreciation_Table_Header
|
|||
/** Column name A_Depreciation_Table_Header_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_Table_Header_ID = "A_Depreciation_Table_Header_ID";
|
||||
|
||||
/** Set Depreciation Table Header */
|
||||
/** Set A_Depreciation_Table_Header_ID */
|
||||
public void setA_Depreciation_Table_Header_ID (int A_Depreciation_Table_Header_ID);
|
||||
|
||||
/** Get Depreciation Table Header */
|
||||
/** Get A_Depreciation_Table_Header_ID */
|
||||
public int getA_Depreciation_Table_Header_ID();
|
||||
|
||||
/** Column name A_Depreciation_Table_Header_UU */
|
||||
public static final String COLUMNNAME_A_Depreciation_Table_Header_UU = "A_Depreciation_Table_Header_UU";
|
||||
|
||||
/** Set A_Depreciation_Table_Header_UU */
|
||||
public void setA_Depreciation_Table_Header_UU (String A_Depreciation_Table_Header_UU);
|
||||
|
||||
/** Get A_Depreciation_Table_Header_UU */
|
||||
public String getA_Depreciation_Table_Header_UU();
|
||||
|
||||
/** Column name AD_Org_ID */
|
||||
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_A_Depreciation_Workfile
|
|||
public static final String Table_Name = "A_Depreciation_Workfile";
|
||||
|
||||
/** AD_Table_ID=53116 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53116;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -50,6 +50,15 @@ public interface I_A_Depreciation_Workfile
|
|||
/** Get Accumulated Depreciation */
|
||||
public BigDecimal getA_Accumulated_Depr();
|
||||
|
||||
/** Column name A_Accumulated_Depr_F */
|
||||
public static final String COLUMNNAME_A_Accumulated_Depr_F = "A_Accumulated_Depr_F";
|
||||
|
||||
/** Set Accumulated Depreciation (fiscal) */
|
||||
public void setA_Accumulated_Depr_F (BigDecimal A_Accumulated_Depr_F);
|
||||
|
||||
/** Get Accumulated Depreciation (fiscal) */
|
||||
public BigDecimal getA_Accumulated_Depr_F();
|
||||
|
||||
/** Column name A_Asset_Cost */
|
||||
public static final String COLUMNNAME_A_Asset_Cost = "A_Asset_Cost";
|
||||
|
||||
|
@ -72,49 +81,78 @@ public interface I_A_Depreciation_Workfile
|
|||
*/
|
||||
public int getA_Asset_ID();
|
||||
|
||||
public org.compiere.model.I_A_Asset getA_Asset() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_Life_Current_Year */
|
||||
public static final String COLUMNNAME_A_Asset_Life_Current_Year = "A_Asset_Life_Current_Year";
|
||||
|
||||
/** Set Asset Life Current Year */
|
||||
/** Set A_Asset_Life_Current_Year */
|
||||
public void setA_Asset_Life_Current_Year (BigDecimal A_Asset_Life_Current_Year);
|
||||
|
||||
/** Get Asset Life Current Year */
|
||||
/** Get A_Asset_Life_Current_Year */
|
||||
public BigDecimal getA_Asset_Life_Current_Year();
|
||||
|
||||
/** Column name A_Asset_Life_Years */
|
||||
public static final String COLUMNNAME_A_Asset_Life_Years = "A_Asset_Life_Years";
|
||||
|
||||
/** Set Asset Life Years */
|
||||
/** Set Life Years */
|
||||
public void setA_Asset_Life_Years (int A_Asset_Life_Years);
|
||||
|
||||
/** Get Asset Life Years */
|
||||
/** Get Life Years */
|
||||
public int getA_Asset_Life_Years();
|
||||
|
||||
/** Column name A_Asset_Life_Years_F */
|
||||
public static final String COLUMNNAME_A_Asset_Life_Years_F = "A_Asset_Life_Years_F";
|
||||
|
||||
/** Set Life Years (fiscal) */
|
||||
public void setA_Asset_Life_Years_F (int A_Asset_Life_Years_F);
|
||||
|
||||
/** Get Life Years (fiscal) */
|
||||
public int getA_Asset_Life_Years_F();
|
||||
|
||||
/** Column name A_Asset_Remaining */
|
||||
public static final String COLUMNNAME_A_Asset_Remaining = "A_Asset_Remaining";
|
||||
|
||||
/** Set Remaining Amt */
|
||||
public void setA_Asset_Remaining (BigDecimal A_Asset_Remaining);
|
||||
|
||||
/** Get Remaining Amt */
|
||||
public BigDecimal getA_Asset_Remaining();
|
||||
|
||||
/** Column name A_Asset_Remaining_F */
|
||||
public static final String COLUMNNAME_A_Asset_Remaining_F = "A_Asset_Remaining_F";
|
||||
|
||||
/** Set Remaining Amt (fiscal) */
|
||||
public void setA_Asset_Remaining_F (BigDecimal A_Asset_Remaining_F);
|
||||
|
||||
/** Get Remaining Amt (fiscal) */
|
||||
public BigDecimal getA_Asset_Remaining_F();
|
||||
|
||||
/** Column name A_Base_Amount */
|
||||
public static final String COLUMNNAME_A_Base_Amount = "A_Base_Amount";
|
||||
|
||||
/** Set Base Amount */
|
||||
/** Set A_Base_Amount */
|
||||
public void setA_Base_Amount (BigDecimal A_Base_Amount);
|
||||
|
||||
/** Get Base Amount */
|
||||
/** Get A_Base_Amount */
|
||||
public BigDecimal getA_Base_Amount();
|
||||
|
||||
/** Column name A_Calc_Accumulated_Depr */
|
||||
public static final String COLUMNNAME_A_Calc_Accumulated_Depr = "A_Calc_Accumulated_Depr";
|
||||
|
||||
/** Set Calc. Accumulated Depr. */
|
||||
/** Set A_Calc_Accumulated_Depr */
|
||||
public void setA_Calc_Accumulated_Depr (BigDecimal A_Calc_Accumulated_Depr);
|
||||
|
||||
/** Get Calc. Accumulated Depr. */
|
||||
/** Get A_Calc_Accumulated_Depr */
|
||||
public BigDecimal getA_Calc_Accumulated_Depr();
|
||||
|
||||
/** Column name A_Curr_Dep_Exp */
|
||||
public static final String COLUMNNAME_A_Curr_Dep_Exp = "A_Curr_Dep_Exp";
|
||||
|
||||
/** Set Curr. Dep. Exp. */
|
||||
/** Set A_Curr_Dep_Exp */
|
||||
public void setA_Curr_Dep_Exp (BigDecimal A_Curr_Dep_Exp);
|
||||
|
||||
/** Get Curr. Dep. Exp. */
|
||||
/** Get A_Curr_Dep_Exp */
|
||||
public BigDecimal getA_Curr_Dep_Exp();
|
||||
|
||||
/** Column name A_Current_Period */
|
||||
|
@ -137,12 +175,21 @@ public interface I_A_Depreciation_Workfile
|
|||
/** Column name A_Depreciation_Workfile_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_Workfile_ID = "A_Depreciation_Workfile_ID";
|
||||
|
||||
/** Set Depreciation Workfile */
|
||||
/** Set A_Depreciation_Workfile_ID */
|
||||
public void setA_Depreciation_Workfile_ID (int A_Depreciation_Workfile_ID);
|
||||
|
||||
/** Get Depreciation Workfile */
|
||||
/** Get A_Depreciation_Workfile_ID */
|
||||
public int getA_Depreciation_Workfile_ID();
|
||||
|
||||
/** Column name A_Depreciation_Workfile_UU */
|
||||
public static final String COLUMNNAME_A_Depreciation_Workfile_UU = "A_Depreciation_Workfile_UU";
|
||||
|
||||
/** Set A_Depreciation_Workfile_UU */
|
||||
public void setA_Depreciation_Workfile_UU (String A_Depreciation_Workfile_UU);
|
||||
|
||||
/** Get A_Depreciation_Workfile_UU */
|
||||
public String getA_Depreciation_Workfile_UU();
|
||||
|
||||
/** Column name AD_Org_ID */
|
||||
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
|
||||
|
||||
|
@ -156,58 +203,114 @@ public interface I_A_Depreciation_Workfile
|
|||
*/
|
||||
public int getAD_Org_ID();
|
||||
|
||||
/** Column name A_Expense_SL */
|
||||
public static final String COLUMNNAME_A_Expense_SL = "A_Expense_SL";
|
||||
|
||||
/** Set SL Expense/Period */
|
||||
public void setA_Expense_SL (BigDecimal A_Expense_SL);
|
||||
|
||||
/** Get SL Expense/Period */
|
||||
public BigDecimal getA_Expense_SL();
|
||||
|
||||
/** Column name A_Expense_SL_F */
|
||||
public static final String COLUMNNAME_A_Expense_SL_F = "A_Expense_SL_F";
|
||||
|
||||
/** Set SL Expense/Period (fiscal) */
|
||||
public void setA_Expense_SL_F (BigDecimal A_Expense_SL_F);
|
||||
|
||||
/** Get SL Expense/Period (fiscal) */
|
||||
public BigDecimal getA_Expense_SL_F();
|
||||
|
||||
/** Column name A_FundingMode_ID */
|
||||
public static final String COLUMNNAME_A_FundingMode_ID = "A_FundingMode_ID";
|
||||
|
||||
/** Set Asset Funding Mode */
|
||||
public void setA_FundingMode_ID (int A_FundingMode_ID);
|
||||
|
||||
/** Get Asset Funding Mode */
|
||||
public int getA_FundingMode_ID();
|
||||
|
||||
public org.compiere.model.I_A_FundingMode getA_FundingMode() throws RuntimeException;
|
||||
|
||||
/** Column name A_Life_Period */
|
||||
public static final String COLUMNNAME_A_Life_Period = "A_Life_Period";
|
||||
|
||||
/** Set A_Life_Period */
|
||||
/** Set Life Periods */
|
||||
public void setA_Life_Period (int A_Life_Period);
|
||||
|
||||
/** Get A_Life_Period */
|
||||
/** Get Life Periods */
|
||||
public int getA_Life_Period();
|
||||
|
||||
/** Column name A_Life_Period_F */
|
||||
public static final String COLUMNNAME_A_Life_Period_F = "A_Life_Period_F";
|
||||
|
||||
/** Set Life Period (fiscal) */
|
||||
public void setA_Life_Period_F (int A_Life_Period_F);
|
||||
|
||||
/** Get Life Period (fiscal) */
|
||||
public int getA_Life_Period_F();
|
||||
|
||||
/** Column name A_Life_Period_Max */
|
||||
public static final String COLUMNNAME_A_Life_Period_Max = "A_Life_Period_Max";
|
||||
|
||||
/** Set Life periods (max) */
|
||||
public void setA_Life_Period_Max (int A_Life_Period_Max);
|
||||
|
||||
/** Get Life periods (max) */
|
||||
public int getA_Life_Period_Max();
|
||||
|
||||
/** Column name A_Life_Period_Min */
|
||||
public static final String COLUMNNAME_A_Life_Period_Min = "A_Life_Period_Min";
|
||||
|
||||
/** Set Life periods (min) */
|
||||
public void setA_Life_Period_Min (int A_Life_Period_Min);
|
||||
|
||||
/** Get Life periods (min) */
|
||||
public int getA_Life_Period_Min();
|
||||
|
||||
/** Column name A_Period_Forecast */
|
||||
public static final String COLUMNNAME_A_Period_Forecast = "A_Period_Forecast";
|
||||
|
||||
/** Set Forecast Period */
|
||||
/** Set A_Period_Forecast */
|
||||
public void setA_Period_Forecast (BigDecimal A_Period_Forecast);
|
||||
|
||||
/** Get Forecast Period */
|
||||
/** Get A_Period_Forecast */
|
||||
public BigDecimal getA_Period_Forecast();
|
||||
|
||||
/** Column name A_Period_Posted */
|
||||
public static final String COLUMNNAME_A_Period_Posted = "A_Period_Posted";
|
||||
|
||||
/** Set Period Posted */
|
||||
/** Set A_Period_Posted */
|
||||
public void setA_Period_Posted (int A_Period_Posted);
|
||||
|
||||
/** Get Period Posted */
|
||||
/** Get A_Period_Posted */
|
||||
public int getA_Period_Posted();
|
||||
|
||||
/** Column name A_Prior_Year_Accumulated_Depr */
|
||||
public static final String COLUMNNAME_A_Prior_Year_Accumulated_Depr = "A_Prior_Year_Accumulated_Depr";
|
||||
|
||||
/** Set Prior. Year Accumulated Depr. */
|
||||
/** Set A_Prior_Year_Accumulated_Depr */
|
||||
public void setA_Prior_Year_Accumulated_Depr (BigDecimal A_Prior_Year_Accumulated_Depr);
|
||||
|
||||
/** Get Prior. Year Accumulated Depr. */
|
||||
/** Get A_Prior_Year_Accumulated_Depr */
|
||||
public BigDecimal getA_Prior_Year_Accumulated_Depr();
|
||||
|
||||
/** Column name A_QTY_Current */
|
||||
public static final String COLUMNNAME_A_QTY_Current = "A_QTY_Current";
|
||||
|
||||
/** Set Quantity */
|
||||
/** Set Current Qty */
|
||||
public void setA_QTY_Current (BigDecimal A_QTY_Current);
|
||||
|
||||
/** Get Quantity */
|
||||
/** Get Current Qty */
|
||||
public BigDecimal getA_QTY_Current();
|
||||
|
||||
/** Column name A_Salvage_Value */
|
||||
public static final String COLUMNNAME_A_Salvage_Value = "A_Salvage_Value";
|
||||
|
||||
/** Set Salvage Value */
|
||||
/** Set Asset Salvage Value */
|
||||
public void setA_Salvage_Value (BigDecimal A_Salvage_Value);
|
||||
|
||||
/** Get Salvage Value */
|
||||
/** Get Asset Salvage Value */
|
||||
public BigDecimal getA_Salvage_Value();
|
||||
|
||||
/** Column name AssetDepreciationDate */
|
||||
|
@ -223,6 +326,37 @@ public interface I_A_Depreciation_Workfile
|
|||
*/
|
||||
public Timestamp getAssetDepreciationDate();
|
||||
|
||||
/** Column name A_Tip_Finantare */
|
||||
public static final String COLUMNNAME_A_Tip_Finantare = "A_Tip_Finantare";
|
||||
|
||||
/** Set Financing Type.
|
||||
* Financing Type
|
||||
*/
|
||||
public void setA_Tip_Finantare (String A_Tip_Finantare);
|
||||
|
||||
/** Get Financing Type.
|
||||
* Financing Type
|
||||
*/
|
||||
public String getA_Tip_Finantare();
|
||||
|
||||
/** Column name A_Valoare_Cofinantare */
|
||||
public static final String COLUMNNAME_A_Valoare_Cofinantare = "A_Valoare_Cofinantare";
|
||||
|
||||
/** Set Own contribution */
|
||||
public void setA_Valoare_Cofinantare (BigDecimal A_Valoare_Cofinantare);
|
||||
|
||||
/** Get Own contribution */
|
||||
public BigDecimal getA_Valoare_Cofinantare();
|
||||
|
||||
/** Column name A_Valoare_Tert */
|
||||
public static final String COLUMNNAME_A_Valoare_Tert = "A_Valoare_Tert";
|
||||
|
||||
/** Set Third contribution */
|
||||
public void setA_Valoare_Tert (BigDecimal A_Valoare_Tert);
|
||||
|
||||
/** Get Third contribution */
|
||||
public BigDecimal getA_Valoare_Tert();
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
||||
|
@ -252,6 +386,19 @@ public interface I_A_Depreciation_Workfile
|
|||
*/
|
||||
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 IsActive */
|
||||
public static final String COLUMNNAME_IsActive = "IsActive";
|
||||
|
||||
|
@ -291,6 +438,19 @@ public interface I_A_Depreciation_Workfile
|
|||
*/
|
||||
public String getPostingType();
|
||||
|
||||
/** 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";
|
||||
|
||||
|
@ -315,4 +475,48 @@ public interface I_A_Depreciation_Workfile
|
|||
* User who updated this records
|
||||
*/
|
||||
public int getUpdatedBy();
|
||||
|
||||
/** Column name UseLifeMonths */
|
||||
public static final String COLUMNNAME_UseLifeMonths = "UseLifeMonths";
|
||||
|
||||
/** Set Usable Life - Months.
|
||||
* Months of the usable life of the asset
|
||||
*/
|
||||
public void setUseLifeMonths (int UseLifeMonths);
|
||||
|
||||
/** Get Usable Life - Months.
|
||||
* Months of the usable life of the asset
|
||||
*/
|
||||
public int getUseLifeMonths();
|
||||
|
||||
/** Column name UseLifeMonths_F */
|
||||
public static final String COLUMNNAME_UseLifeMonths_F = "UseLifeMonths_F";
|
||||
|
||||
/** Set Use Life - Months (fiscal) */
|
||||
public void setUseLifeMonths_F (int UseLifeMonths_F);
|
||||
|
||||
/** Get Use Life - Months (fiscal) */
|
||||
public int getUseLifeMonths_F();
|
||||
|
||||
/** Column name UseLifeYears */
|
||||
public static final String COLUMNNAME_UseLifeYears = "UseLifeYears";
|
||||
|
||||
/** Set Usable Life - Years.
|
||||
* Years of the usable life of the asset
|
||||
*/
|
||||
public void setUseLifeYears (int UseLifeYears);
|
||||
|
||||
/** Get Usable Life - Years.
|
||||
* Years of the usable life of the asset
|
||||
*/
|
||||
public int getUseLifeYears();
|
||||
|
||||
/** Column name UseLifeYears_F */
|
||||
public static final String COLUMNNAME_UseLifeYears_F = "UseLifeYears_F";
|
||||
|
||||
/** Set Use Life - Years (fiscal) */
|
||||
public void setUseLifeYears_F (int UseLifeYears_F);
|
||||
|
||||
/** Get Use Life - Years (fiscal) */
|
||||
public int getUseLifeYears_F();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,157 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2007 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 A_FundingMode
|
||||
* @author Adempiere (generated)
|
||||
* @version Release 3.6.0LTS
|
||||
*/
|
||||
public interface I_A_FundingMode
|
||||
{
|
||||
|
||||
/** TableName=A_FundingMode */
|
||||
public static final String Table_Name = "A_FundingMode";
|
||||
|
||||
/** AD_Table_ID=53273 */
|
||||
public static final int Table_ID = 53273;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
/** AccessLevel = 7 - System - Client - Org
|
||||
*/
|
||||
BigDecimal accessLevel = BigDecimal.valueOf(7);
|
||||
|
||||
/** Load Meta Data */
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
||||
/** Get Client.
|
||||
* Client/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 client
|
||||
*/
|
||||
public void setAD_Org_ID (int AD_Org_ID);
|
||||
|
||||
/** Get Organization.
|
||||
* Organizational entity within client
|
||||
*/
|
||||
public int getAD_Org_ID();
|
||||
|
||||
/** Column name A_FundingMode_ID */
|
||||
public static final String COLUMNNAME_A_FundingMode_ID = "A_FundingMode_ID";
|
||||
|
||||
/** Set Asset Funding Mode */
|
||||
public void setA_FundingMode_ID (int A_FundingMode_ID);
|
||||
|
||||
/** Get Asset Funding Mode */
|
||||
public int getA_FundingMode_ID();
|
||||
|
||||
/** 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 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 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 Name */
|
||||
public static final String COLUMNNAME_Name = "Name";
|
||||
|
||||
/** Set Name.
|
||||
* Alphanumeric identifier of the entity
|
||||
*/
|
||||
public void setName (String Name);
|
||||
|
||||
/** Get Name.
|
||||
* Alphanumeric identifier of the entity
|
||||
*/
|
||||
public String getName();
|
||||
|
||||
/** 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();
|
||||
|
||||
/** Column name Value */
|
||||
public static final String COLUMNNAME_Value = "Value";
|
||||
|
||||
/** Set Search Key.
|
||||
* Search key for the record in the format required - must be unique
|
||||
*/
|
||||
public void setValue (String Value);
|
||||
|
||||
/** Get Search Key.
|
||||
* Search key for the record in the format required - must be unique
|
||||
*/
|
||||
public String getValue();
|
||||
}
|
|
@ -31,7 +31,7 @@ public interface I_I_Asset
|
|||
public static final String Table_Name = "I_Asset";
|
||||
|
||||
/** AD_Table_ID=53139 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53139;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -44,10 +44,10 @@ public interface I_I_Asset
|
|||
/** Column name A_Accumdepreciation_Acct */
|
||||
public static final String COLUMNNAME_A_Accumdepreciation_Acct = "A_Accumdepreciation_Acct";
|
||||
|
||||
/** Set Accumulated Depreciation */
|
||||
/** Set Accumulated Depreciation Account */
|
||||
public void setA_Accumdepreciation_Acct (int A_Accumdepreciation_Acct);
|
||||
|
||||
/** Get Accumulated Depreciation */
|
||||
/** Get Accumulated Depreciation Account */
|
||||
public int getA_Accumdepreciation_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Accumdepreciation_A() throws RuntimeException;
|
||||
|
@ -64,10 +64,10 @@ public interface I_I_Asset
|
|||
/** Column name A_Asset_Acct */
|
||||
public static final String COLUMNNAME_A_Asset_Acct = "A_Asset_Acct";
|
||||
|
||||
/** Set Asset Cost Account */
|
||||
/** Set Asset Acct */
|
||||
public void setA_Asset_Acct (int A_Asset_Acct);
|
||||
|
||||
/** Get Asset Cost Account */
|
||||
/** Get Asset Acct */
|
||||
public int getA_Asset_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Asset_A() throws RuntimeException;
|
||||
|
@ -94,7 +94,7 @@ public interface I_I_Asset
|
|||
*/
|
||||
public int getA_Asset_Group_ID();
|
||||
|
||||
public I_A_Asset_Group getA_Asset_Group() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Asset_Group getA_Asset_Group() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_ID */
|
||||
public static final String COLUMNNAME_A_Asset_ID = "A_Asset_ID";
|
||||
|
@ -112,57 +112,57 @@ public interface I_I_Asset
|
|||
/** Column name A_Asset_Life_Current_Year */
|
||||
public static final String COLUMNNAME_A_Asset_Life_Current_Year = "A_Asset_Life_Current_Year";
|
||||
|
||||
/** Set Asset Life Current Year */
|
||||
/** Set A_Asset_Life_Current_Year */
|
||||
public void setA_Asset_Life_Current_Year (int A_Asset_Life_Current_Year);
|
||||
|
||||
/** Get Asset Life Current Year */
|
||||
/** Get A_Asset_Life_Current_Year */
|
||||
public int getA_Asset_Life_Current_Year();
|
||||
|
||||
/** Column name A_Asset_Life_Years */
|
||||
public static final String COLUMNNAME_A_Asset_Life_Years = "A_Asset_Life_Years";
|
||||
|
||||
/** Set Asset Life Years */
|
||||
/** Set Life Years */
|
||||
public void setA_Asset_Life_Years (int A_Asset_Life_Years);
|
||||
|
||||
/** Get Asset Life Years */
|
||||
/** Get Life Years */
|
||||
public int getA_Asset_Life_Years();
|
||||
|
||||
/** Column name A_Asset_Spread_Type */
|
||||
public static final String COLUMNNAME_A_Asset_Spread_Type = "A_Asset_Spread_Type";
|
||||
|
||||
/** Set Asset Spread Type */
|
||||
/** Set Spread Type */
|
||||
public void setA_Asset_Spread_Type (int A_Asset_Spread_Type);
|
||||
|
||||
/** Get Asset Spread Type */
|
||||
/** Get Spread Type */
|
||||
public int getA_Asset_Spread_Type();
|
||||
|
||||
public I_A_Asset_Spread getA_Asset_Spread_T() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Asset_Spread getA_Asset_Spread_T() throws RuntimeException;
|
||||
|
||||
/** Column name A_Base_Amount */
|
||||
public static final String COLUMNNAME_A_Base_Amount = "A_Base_Amount";
|
||||
|
||||
/** Set Base Amount */
|
||||
/** Set A_Base_Amount */
|
||||
public void setA_Base_Amount (BigDecimal A_Base_Amount);
|
||||
|
||||
/** Get Base Amount */
|
||||
/** Get A_Base_Amount */
|
||||
public BigDecimal getA_Base_Amount();
|
||||
|
||||
/** Column name A_Calc_Accumulated_Depr */
|
||||
public static final String COLUMNNAME_A_Calc_Accumulated_Depr = "A_Calc_Accumulated_Depr";
|
||||
|
||||
/** Set Calc. Accumulated Depr. */
|
||||
/** Set A_Calc_Accumulated_Depr */
|
||||
public void setA_Calc_Accumulated_Depr (BigDecimal A_Calc_Accumulated_Depr);
|
||||
|
||||
/** Get Calc. Accumulated Depr. */
|
||||
/** Get A_Calc_Accumulated_Depr */
|
||||
public BigDecimal getA_Calc_Accumulated_Depr();
|
||||
|
||||
/** Column name A_Curr_Dep_Exp */
|
||||
public static final String COLUMNNAME_A_Curr_Dep_Exp = "A_Curr_Dep_Exp";
|
||||
|
||||
/** Set Curr. Dep. Exp. */
|
||||
/** Set A_Curr_Dep_Exp */
|
||||
public void setA_Curr_Dep_Exp (BigDecimal A_Curr_Dep_Exp);
|
||||
|
||||
/** Get Curr. Dep. Exp. */
|
||||
/** Get A_Curr_Dep_Exp */
|
||||
public BigDecimal getA_Curr_Dep_Exp();
|
||||
|
||||
/** Column name A_Current_Period */
|
||||
|
@ -185,10 +185,10 @@ public interface I_I_Asset
|
|||
/** Column name A_Depreciation_Acct */
|
||||
public static final String COLUMNNAME_A_Depreciation_Acct = "A_Depreciation_Acct";
|
||||
|
||||
/** Set Depreciation Expense Account */
|
||||
/** Set Depreciation Account */
|
||||
public void setA_Depreciation_Acct (int A_Depreciation_Acct);
|
||||
|
||||
/** Get Depreciation Expense Account */
|
||||
/** Get Depreciation Account */
|
||||
public int getA_Depreciation_Acct();
|
||||
|
||||
public I_C_ValidCombination getA_Depreciation_A() throws RuntimeException;
|
||||
|
@ -196,50 +196,50 @@ public interface I_I_Asset
|
|||
/** Column name A_Depreciation_Calc_Type */
|
||||
public static final String COLUMNNAME_A_Depreciation_Calc_Type = "A_Depreciation_Calc_Type";
|
||||
|
||||
/** Set Depreciation Calculation Type */
|
||||
/** Set Calculation Type */
|
||||
public void setA_Depreciation_Calc_Type (int A_Depreciation_Calc_Type);
|
||||
|
||||
/** Get Depreciation Calculation Type */
|
||||
/** Get Calculation Type */
|
||||
public int getA_Depreciation_Calc_Type();
|
||||
|
||||
public I_A_Depreciation_Method getA_Depreciation_Calc_T() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Depreciation_Method getA_Depreciation_Calc_T() throws RuntimeException;
|
||||
|
||||
/** Column name A_Depreciation_Manual_Amount */
|
||||
public static final String COLUMNNAME_A_Depreciation_Manual_Amount = "A_Depreciation_Manual_Amount";
|
||||
|
||||
/** Set Depreciation Manual Amount */
|
||||
/** Set A_Depreciation_Manual_Amount */
|
||||
public void setA_Depreciation_Manual_Amount (BigDecimal A_Depreciation_Manual_Amount);
|
||||
|
||||
/** Get Depreciation Manual Amount */
|
||||
/** Get A_Depreciation_Manual_Amount */
|
||||
public BigDecimal getA_Depreciation_Manual_Amount();
|
||||
|
||||
/** Column name A_Depreciation_Manual_Period */
|
||||
public static final String COLUMNNAME_A_Depreciation_Manual_Period = "A_Depreciation_Manual_Period";
|
||||
|
||||
/** Set Depreciation Manual Period */
|
||||
/** Set A_Depreciation_Manual_Period */
|
||||
public void setA_Depreciation_Manual_Period (String A_Depreciation_Manual_Period);
|
||||
|
||||
/** Get Depreciation Manual Period */
|
||||
/** Get A_Depreciation_Manual_Period */
|
||||
public String getA_Depreciation_Manual_Period();
|
||||
|
||||
/** Column name A_Depreciation_Table_Header_ID */
|
||||
public static final String COLUMNNAME_A_Depreciation_Table_Header_ID = "A_Depreciation_Table_Header_ID";
|
||||
|
||||
/** Set Depreciation Table Header */
|
||||
/** Set A_Depreciation_Table_Header_ID */
|
||||
public void setA_Depreciation_Table_Header_ID (int A_Depreciation_Table_Header_ID);
|
||||
|
||||
/** Get Depreciation Table Header */
|
||||
/** Get A_Depreciation_Table_Header_ID */
|
||||
public int getA_Depreciation_Table_Header_ID();
|
||||
|
||||
public I_A_Depreciation_Table_Header getA_Depreciation_Table_Header() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Depreciation_Table_Header getA_Depreciation_Table_Header() throws RuntimeException;
|
||||
|
||||
/** Column name A_Depreciation_Variable_Perc */
|
||||
public static final String COLUMNNAME_A_Depreciation_Variable_Perc = "A_Depreciation_Variable_Perc";
|
||||
|
||||
/** Set Depreciation Variable Perc. */
|
||||
/** Set Variable Percent */
|
||||
public void setA_Depreciation_Variable_Perc (BigDecimal A_Depreciation_Variable_Perc);
|
||||
|
||||
/** Get Depreciation Variable Perc. */
|
||||
/** Get Variable Percent */
|
||||
public BigDecimal getA_Depreciation_Variable_Perc();
|
||||
|
||||
/** Column name A_Disposal_Loss */
|
||||
|
@ -293,73 +293,73 @@ public interface I_I_Asset
|
|||
/** Column name A_Life_Period */
|
||||
public static final String COLUMNNAME_A_Life_Period = "A_Life_Period";
|
||||
|
||||
/** Set A_Life_Period */
|
||||
/** Set Life Periods */
|
||||
public void setA_Life_Period (int A_Life_Period);
|
||||
|
||||
/** Get A_Life_Period */
|
||||
/** Get Life Periods */
|
||||
public int getA_Life_Period();
|
||||
|
||||
/** Column name A_Parent_Asset_ID */
|
||||
public static final String COLUMNNAME_A_Parent_Asset_ID = "A_Parent_Asset_ID";
|
||||
|
||||
/** Set Asset ID */
|
||||
/** Set Parent Asset */
|
||||
public void setA_Parent_Asset_ID (int A_Parent_Asset_ID);
|
||||
|
||||
/** Get Asset ID */
|
||||
/** Get Parent Asset */
|
||||
public int getA_Parent_Asset_ID();
|
||||
|
||||
/** Column name A_Period_End */
|
||||
public static final String COLUMNNAME_A_Period_End = "A_Period_End";
|
||||
|
||||
/** Set Period End */
|
||||
/** Set A_Period_End */
|
||||
public void setA_Period_End (int A_Period_End);
|
||||
|
||||
/** Get Period End */
|
||||
/** Get A_Period_End */
|
||||
public int getA_Period_End();
|
||||
|
||||
/** Column name A_Period_Posted */
|
||||
public static final String COLUMNNAME_A_Period_Posted = "A_Period_Posted";
|
||||
|
||||
/** Set Period Posted */
|
||||
/** Set A_Period_Posted */
|
||||
public void setA_Period_Posted (int A_Period_Posted);
|
||||
|
||||
/** Get Period Posted */
|
||||
/** Get A_Period_Posted */
|
||||
public int getA_Period_Posted();
|
||||
|
||||
/** Column name A_Period_Start */
|
||||
public static final String COLUMNNAME_A_Period_Start = "A_Period_Start";
|
||||
|
||||
/** Set Period Start */
|
||||
/** Set A_Period_Start */
|
||||
public void setA_Period_Start (int A_Period_Start);
|
||||
|
||||
/** Get Period Start */
|
||||
/** Get A_Period_Start */
|
||||
public int getA_Period_Start();
|
||||
|
||||
/** Column name A_Prior_Year_Accumulated_Depr */
|
||||
public static final String COLUMNNAME_A_Prior_Year_Accumulated_Depr = "A_Prior_Year_Accumulated_Depr";
|
||||
|
||||
/** Set Prior. Year Accumulated Depr. */
|
||||
/** Set A_Prior_Year_Accumulated_Depr */
|
||||
public void setA_Prior_Year_Accumulated_Depr (BigDecimal A_Prior_Year_Accumulated_Depr);
|
||||
|
||||
/** Get Prior. Year Accumulated Depr. */
|
||||
/** Get A_Prior_Year_Accumulated_Depr */
|
||||
public BigDecimal getA_Prior_Year_Accumulated_Depr();
|
||||
|
||||
/** Column name A_QTY_Current */
|
||||
public static final String COLUMNNAME_A_QTY_Current = "A_QTY_Current";
|
||||
|
||||
/** Set Quantity */
|
||||
/** Set Current Qty */
|
||||
public void setA_QTY_Current (int A_QTY_Current);
|
||||
|
||||
/** Get Quantity */
|
||||
/** Get Current Qty */
|
||||
public int getA_QTY_Current();
|
||||
|
||||
/** Column name A_QTY_Original */
|
||||
public static final String COLUMNNAME_A_QTY_Original = "A_QTY_Original";
|
||||
|
||||
/** Set Original Qty */
|
||||
/** Set A_QTY_Original */
|
||||
public void setA_QTY_Original (int A_QTY_Original);
|
||||
|
||||
/** Get Original Qty */
|
||||
/** Get A_QTY_Original */
|
||||
public int getA_QTY_Original();
|
||||
|
||||
/** Column name A_Reval_Accumdep_Offset_Cur */
|
||||
|
@ -387,10 +387,10 @@ public interface I_I_Asset
|
|||
/** Column name A_Reval_Cal_Method */
|
||||
public static final String COLUMNNAME_A_Reval_Cal_Method = "A_Reval_Cal_Method";
|
||||
|
||||
/** Set Revaluation Calculation Method */
|
||||
/** Set A_Reval_Cal_Method */
|
||||
public void setA_Reval_Cal_Method (String A_Reval_Cal_Method);
|
||||
|
||||
/** Get Revaluation Calculation Method */
|
||||
/** Get A_Reval_Cal_Method */
|
||||
public String getA_Reval_Cal_Method();
|
||||
|
||||
/** Column name A_Reval_Cost_Offset */
|
||||
|
@ -429,19 +429,19 @@ public interface I_I_Asset
|
|||
/** Column name A_Salvage_Value */
|
||||
public static final String COLUMNNAME_A_Salvage_Value = "A_Salvage_Value";
|
||||
|
||||
/** Set Salvage Value */
|
||||
/** Set Asset Salvage Value */
|
||||
public void setA_Salvage_Value (BigDecimal A_Salvage_Value);
|
||||
|
||||
/** Get Salvage Value */
|
||||
/** Get Asset Salvage Value */
|
||||
public BigDecimal getA_Salvage_Value();
|
||||
|
||||
/** Column name A_Split_Percent */
|
||||
public static final String COLUMNNAME_A_Split_Percent = "A_Split_Percent";
|
||||
|
||||
/** Set Split Percentage */
|
||||
/** Set Split Percent */
|
||||
public void setA_Split_Percent (BigDecimal A_Split_Percent);
|
||||
|
||||
/** Get Split Percentage */
|
||||
/** Get Split Percent */
|
||||
public BigDecimal getA_Split_Percent();
|
||||
|
||||
/** Column name AssetDepreciationDate */
|
||||
|
@ -509,7 +509,7 @@ public interface I_I_Asset
|
|||
*/
|
||||
public int getC_AcctSchema_ID();
|
||||
|
||||
public I_C_AcctSchema getC_AcctSchema() throws RuntimeException;
|
||||
public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException;
|
||||
|
||||
/** Column name C_BPartner_ID */
|
||||
public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID";
|
||||
|
@ -524,7 +524,7 @@ public interface I_I_Asset
|
|||
*/
|
||||
public int getC_BPartner_ID();
|
||||
|
||||
public I_C_BPartner getC_BPartner() throws RuntimeException;
|
||||
public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException;
|
||||
|
||||
/** Column name C_BPartner_Location_ID */
|
||||
public static final String COLUMNNAME_C_BPartner_Location_ID = "C_BPartner_Location_ID";
|
||||
|
@ -539,7 +539,7 @@ public interface I_I_Asset
|
|||
*/
|
||||
public int getC_BPartner_Location_ID();
|
||||
|
||||
public I_C_BPartner_Location getC_BPartner_Location() throws RuntimeException;
|
||||
public org.compiere.model.I_C_BPartner_Location getC_BPartner_Location() throws RuntimeException;
|
||||
|
||||
/** Column name C_Location_ID */
|
||||
public static final String COLUMNNAME_C_Location_ID = "C_Location_ID";
|
||||
|
@ -554,7 +554,7 @@ public interface I_I_Asset
|
|||
*/
|
||||
public int getC_Location_ID();
|
||||
|
||||
public I_C_Location getC_Location() throws RuntimeException;
|
||||
public org.compiere.model.I_C_Location getC_Location() throws RuntimeException;
|
||||
|
||||
/** Column name ConventionType */
|
||||
public static final String COLUMNNAME_ConventionType = "ConventionType";
|
||||
|
@ -565,7 +565,7 @@ public interface I_I_Asset
|
|||
/** Get ConventionType */
|
||||
public int getConventionType();
|
||||
|
||||
public I_A_Depreciation_Convention getConventionT() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Depreciation_Convention getConventionT() throws RuntimeException;
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
@ -592,7 +592,7 @@ public interface I_I_Asset
|
|||
/** Get DepreciationType */
|
||||
public int getDepreciationType();
|
||||
|
||||
public I_A_Depreciation getDepreciationT() throws RuntimeException;
|
||||
public org.compiere.model.I_A_Depreciation getDepreciationT() throws RuntimeException;
|
||||
|
||||
/** Column name Description */
|
||||
public static final String COLUMNNAME_Description = "Description";
|
||||
|
@ -642,6 +642,15 @@ public interface I_I_Asset
|
|||
/** Get Asset */
|
||||
public int getI_Asset_ID();
|
||||
|
||||
/** Column name I_Asset_UU */
|
||||
public static final String COLUMNNAME_I_Asset_UU = "I_Asset_UU";
|
||||
|
||||
/** Set I_Asset_UU */
|
||||
public void setI_Asset_UU (String I_Asset_UU);
|
||||
|
||||
/** Get I_Asset_UU */
|
||||
public String getI_Asset_UU();
|
||||
|
||||
/** Column name I_ErrorMsg */
|
||||
public static final String COLUMNNAME_I_ErrorMsg = "I_ErrorMsg";
|
||||
|
||||
|
@ -813,7 +822,7 @@ public interface I_I_Asset
|
|||
*/
|
||||
public int getM_Locator_ID();
|
||||
|
||||
public I_M_Locator getM_Locator() throws RuntimeException;
|
||||
public org.compiere.model.I_M_Locator getM_Locator() throws RuntimeException;
|
||||
|
||||
/** Column name M_Product_ID */
|
||||
public static final String COLUMNNAME_M_Product_ID = "M_Product_ID";
|
||||
|
@ -828,7 +837,7 @@ public interface I_I_Asset
|
|||
*/
|
||||
public int getM_Product_ID();
|
||||
|
||||
public I_M_Product getM_Product() throws RuntimeException;
|
||||
public org.compiere.model.I_M_Product getM_Product() throws RuntimeException;
|
||||
|
||||
/** Column name Name */
|
||||
public static final String COLUMNNAME_Name = "Name";
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_I_FAJournal
|
|||
public static final String Table_Name = "I_FAJournal";
|
||||
|
||||
/** AD_Table_ID=53117 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 53117;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -67,7 +67,7 @@ public interface I_I_FAJournal
|
|||
*/
|
||||
public int getAccount_ID();
|
||||
|
||||
public I_C_ElementValue getAccount() throws RuntimeException;
|
||||
public org.compiere.model.I_C_ElementValue getAccount() throws RuntimeException;
|
||||
|
||||
/** Column name AccountValue */
|
||||
public static final String COLUMNNAME_AccountValue = "AccountValue";
|
||||
|
@ -255,7 +255,7 @@ public interface I_I_FAJournal
|
|||
*/
|
||||
public int getC_AcctSchema_ID();
|
||||
|
||||
public I_C_AcctSchema getC_AcctSchema() throws RuntimeException;
|
||||
public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException;
|
||||
|
||||
/** Column name C_Activity_ID */
|
||||
public static final String COLUMNNAME_C_Activity_ID = "C_Activity_ID";
|
||||
|
@ -270,7 +270,7 @@ public interface I_I_FAJournal
|
|||
*/
|
||||
public int getC_Activity_ID();
|
||||
|
||||
public I_C_Activity getC_Activity() throws RuntimeException;
|
||||
public org.compiere.model.I_C_Activity getC_Activity() throws RuntimeException;
|
||||
|
||||
/** Column name CategoryName */
|
||||
public static final String COLUMNNAME_CategoryName = "CategoryName";
|
||||
|
@ -298,7 +298,7 @@ public interface I_I_FAJournal
|
|||
*/
|
||||
public int getC_BPartner_ID();
|
||||
|
||||
public I_C_BPartner getC_BPartner() throws RuntimeException;
|
||||
public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException;
|
||||
|
||||
/** Column name C_Campaign_ID */
|
||||
public static final String COLUMNNAME_C_Campaign_ID = "C_Campaign_ID";
|
||||
|
@ -313,7 +313,7 @@ public interface I_I_FAJournal
|
|||
*/
|
||||
public int getC_Campaign_ID();
|
||||
|
||||
public I_C_Campaign getC_Campaign() throws RuntimeException;
|
||||
public org.compiere.model.I_C_Campaign getC_Campaign() throws RuntimeException;
|
||||
|
||||
/** Column name C_ConversionType_ID */
|
||||
public static final String COLUMNNAME_C_ConversionType_ID = "C_ConversionType_ID";
|
||||
|
@ -341,7 +341,7 @@ public interface I_I_FAJournal
|
|||
*/
|
||||
public int getC_Currency_ID();
|
||||
|
||||
public I_C_Currency getC_Currency() throws RuntimeException;
|
||||
public org.compiere.model.I_C_Currency getC_Currency() throws RuntimeException;
|
||||
|
||||
/** Column name C_DocType_ID */
|
||||
public static final String COLUMNNAME_C_DocType_ID = "C_DocType_ID";
|
||||
|
@ -356,7 +356,7 @@ public interface I_I_FAJournal
|
|||
*/
|
||||
public int getC_DocType_ID();
|
||||
|
||||
public I_C_DocType getC_DocType() throws RuntimeException;
|
||||
public org.compiere.model.I_C_DocType getC_DocType() throws RuntimeException;
|
||||
|
||||
/** Column name ClientValue */
|
||||
public static final String COLUMNNAME_ClientValue = "ClientValue";
|
||||
|
@ -423,7 +423,7 @@ public interface I_I_FAJournal
|
|||
*/
|
||||
public int getC_Period_ID();
|
||||
|
||||
public I_C_Period getC_Period() throws RuntimeException;
|
||||
public org.compiere.model.I_C_Period getC_Period() throws RuntimeException;
|
||||
|
||||
/** Column name C_Project_ID */
|
||||
public static final String COLUMNNAME_C_Project_ID = "C_Project_ID";
|
||||
|
@ -438,7 +438,7 @@ public interface I_I_FAJournal
|
|||
*/
|
||||
public int getC_Project_ID();
|
||||
|
||||
public I_C_Project getC_Project() throws RuntimeException;
|
||||
public org.compiere.model.I_C_Project getC_Project() throws RuntimeException;
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
@ -469,7 +469,7 @@ public interface I_I_FAJournal
|
|||
*/
|
||||
public int getC_SalesRegion_ID();
|
||||
|
||||
public I_C_SalesRegion getC_SalesRegion() throws RuntimeException;
|
||||
public org.compiere.model.I_C_SalesRegion getC_SalesRegion() throws RuntimeException;
|
||||
|
||||
/** Column name C_SubAcct_ID */
|
||||
public static final String COLUMNNAME_C_SubAcct_ID = "C_SubAcct_ID";
|
||||
|
@ -497,7 +497,7 @@ public interface I_I_FAJournal
|
|||
*/
|
||||
public int getC_UOM_ID();
|
||||
|
||||
public I_C_UOM getC_UOM() throws RuntimeException;
|
||||
public org.compiere.model.I_C_UOM getC_UOM() throws RuntimeException;
|
||||
|
||||
/** Column name CurrencyRate */
|
||||
public static final String COLUMNNAME_CurrencyRate = "CurrencyRate";
|
||||
|
@ -534,7 +534,7 @@ public interface I_I_FAJournal
|
|||
*/
|
||||
public int getC_ValidCombination_ID();
|
||||
|
||||
public I_C_ValidCombination getC_ValidCombination() throws RuntimeException;
|
||||
public org.compiere.model.I_C_ValidCombination getC_ValidCombination() throws RuntimeException;
|
||||
|
||||
/** Column name DateAcct */
|
||||
public static final String COLUMNNAME_DateAcct = "DateAcct";
|
||||
|
@ -588,7 +588,7 @@ public interface I_I_FAJournal
|
|||
*/
|
||||
public int getGL_Budget_ID();
|
||||
|
||||
public I_GL_Budget getGL_Budget() throws RuntimeException;
|
||||
public org.compiere.model.I_GL_Budget getGL_Budget() throws RuntimeException;
|
||||
|
||||
/** Column name GL_Category_ID */
|
||||
public static final String COLUMNNAME_GL_Category_ID = "GL_Category_ID";
|
||||
|
@ -603,7 +603,7 @@ public interface I_I_FAJournal
|
|||
*/
|
||||
public int getGL_Category_ID();
|
||||
|
||||
public I_GL_Category getGL_Category() throws RuntimeException;
|
||||
public org.compiere.model.I_GL_Category getGL_Category() throws RuntimeException;
|
||||
|
||||
/** Column name GL_JournalBatch_ID */
|
||||
public static final String COLUMNNAME_GL_JournalBatch_ID = "GL_JournalBatch_ID";
|
||||
|
@ -618,7 +618,7 @@ public interface I_I_FAJournal
|
|||
*/
|
||||
public int getGL_JournalBatch_ID();
|
||||
|
||||
public I_GL_JournalBatch getGL_JournalBatch() throws RuntimeException;
|
||||
public org.compiere.model.I_GL_JournalBatch getGL_JournalBatch() throws RuntimeException;
|
||||
|
||||
/** Column name GL_Journal_ID */
|
||||
public static final String COLUMNNAME_GL_Journal_ID = "GL_Journal_ID";
|
||||
|
@ -633,7 +633,7 @@ public interface I_I_FAJournal
|
|||
*/
|
||||
public int getGL_Journal_ID();
|
||||
|
||||
public I_GL_Journal getGL_Journal() throws RuntimeException;
|
||||
public org.compiere.model.I_GL_Journal getGL_Journal() throws RuntimeException;
|
||||
|
||||
/** Column name GL_JournalLine_ID */
|
||||
public static final String COLUMNNAME_GL_JournalLine_ID = "GL_JournalLine_ID";
|
||||
|
@ -648,7 +648,7 @@ public interface I_I_FAJournal
|
|||
*/
|
||||
public int getGL_JournalLine_ID();
|
||||
|
||||
public I_GL_JournalLine getGL_JournalLine() throws RuntimeException;
|
||||
public org.compiere.model.I_GL_JournalLine getGL_JournalLine() throws RuntimeException;
|
||||
|
||||
/** Column name I_ErrorMsg */
|
||||
public static final String COLUMNNAME_I_ErrorMsg = "I_ErrorMsg";
|
||||
|
@ -672,6 +672,15 @@ public interface I_I_FAJournal
|
|||
/** Get FA Journal */
|
||||
public int getI_FAJournal_ID();
|
||||
|
||||
/** Column name I_FAJournal_UU */
|
||||
public static final String COLUMNNAME_I_FAJournal_UU = "I_FAJournal_UU";
|
||||
|
||||
/** Set I_FAJournal_UU */
|
||||
public void setI_FAJournal_UU (String I_FAJournal_UU);
|
||||
|
||||
/** Get I_FAJournal_UU */
|
||||
public String getI_FAJournal_UU();
|
||||
|
||||
/** Column name I_IsImported */
|
||||
public static final String COLUMNNAME_I_IsImported = "I_IsImported";
|
||||
|
||||
|
@ -763,7 +772,7 @@ public interface I_I_FAJournal
|
|||
*/
|
||||
public int getM_Product_ID();
|
||||
|
||||
public I_M_Product getM_Product() throws RuntimeException;
|
||||
public org.compiere.model.I_M_Product getM_Product() throws RuntimeException;
|
||||
|
||||
/** Column name OrgTrxValue */
|
||||
public static final String COLUMNNAME_OrgTrxValue = "OrgTrxValue";
|
||||
|
@ -920,7 +929,7 @@ public interface I_I_FAJournal
|
|||
*/
|
||||
public int getUser1_ID();
|
||||
|
||||
public I_C_ElementValue getUser1() throws RuntimeException;
|
||||
public org.compiere.model.I_C_ElementValue getUser1() throws RuntimeException;
|
||||
|
||||
/** Column name User2_ID */
|
||||
public static final String COLUMNNAME_User2_ID = "User2_ID";
|
||||
|
@ -935,7 +944,7 @@ public interface I_I_FAJournal
|
|||
*/
|
||||
public int getUser2_ID();
|
||||
|
||||
public I_C_ElementValue getUser2() throws RuntimeException;
|
||||
public org.compiere.model.I_C_ElementValue getUser2() throws RuntimeException;
|
||||
|
||||
/** Column name UserElement1_ID */
|
||||
public static final String COLUMNNAME_UserElement1_ID = "UserElement1_ID";
|
||||
|
|
|
@ -0,0 +1,585 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2007 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 I_FixedAsset
|
||||
* @author Adempiere (generated)
|
||||
* @version Release 3.6.0LTS
|
||||
*/
|
||||
public interface I_I_FixedAsset
|
||||
{
|
||||
|
||||
/** TableName=I_FixedAsset */
|
||||
public static final String Table_Name = "I_FixedAsset";
|
||||
|
||||
/** AD_Table_ID=53277 */
|
||||
public static final int Table_ID = 53277;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
/** AccessLevel = 3 - Client - Org
|
||||
*/
|
||||
BigDecimal accessLevel = BigDecimal.valueOf(3);
|
||||
|
||||
/** Load Meta Data */
|
||||
|
||||
/** Column name A_Accumulated_Depr */
|
||||
public static final String COLUMNNAME_A_Accumulated_Depr = "A_Accumulated_Depr";
|
||||
|
||||
/** Set Accumulated Depreciation */
|
||||
public void setA_Accumulated_Depr (BigDecimal A_Accumulated_Depr);
|
||||
|
||||
/** Get Accumulated Depreciation */
|
||||
public BigDecimal getA_Accumulated_Depr();
|
||||
|
||||
/** Column name A_Accumulated_Depr_F */
|
||||
public static final String COLUMNNAME_A_Accumulated_Depr_F = "A_Accumulated_Depr_F";
|
||||
|
||||
/** Set Accumulated Depreciation (fiscal) */
|
||||
public void setA_Accumulated_Depr_F (BigDecimal A_Accumulated_Depr_F);
|
||||
|
||||
/** Get Accumulated Depreciation (fiscal) */
|
||||
public BigDecimal getA_Accumulated_Depr_F();
|
||||
|
||||
/** Column name A_Asset_Class_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Class_ID = "A_Asset_Class_ID";
|
||||
|
||||
/** Set Asset class */
|
||||
public void setA_Asset_Class_ID (int A_Asset_Class_ID);
|
||||
|
||||
/** Get Asset class */
|
||||
public int getA_Asset_Class_ID();
|
||||
|
||||
public org.compiere.model.I_A_Asset_Class getA_Asset_Class() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_Class_Value */
|
||||
public static final String COLUMNNAME_A_Asset_Class_Value = "A_Asset_Class_Value";
|
||||
|
||||
/** Set Asset Class Key */
|
||||
public void setA_Asset_Class_Value (String A_Asset_Class_Value);
|
||||
|
||||
/** Get Asset Class Key */
|
||||
public String getA_Asset_Class_Value();
|
||||
|
||||
/** Column name A_Asset_Cost */
|
||||
public static final String COLUMNNAME_A_Asset_Cost = "A_Asset_Cost";
|
||||
|
||||
/** Set Asset Cost */
|
||||
public void setA_Asset_Cost (BigDecimal A_Asset_Cost);
|
||||
|
||||
/** Get Asset Cost */
|
||||
public BigDecimal getA_Asset_Cost();
|
||||
|
||||
/** Column name A_Asset_Group_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Group_ID = "A_Asset_Group_ID";
|
||||
|
||||
/** Set Asset Group.
|
||||
* Group of Assets
|
||||
*/
|
||||
public void setA_Asset_Group_ID (int A_Asset_Group_ID);
|
||||
|
||||
/** Get Asset Group.
|
||||
* Group of Assets
|
||||
*/
|
||||
public int getA_Asset_Group_ID();
|
||||
|
||||
public org.compiere.model.I_A_Asset_Group getA_Asset_Group() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_Group_Value */
|
||||
public static final String COLUMNNAME_A_Asset_Group_Value = "A_Asset_Group_Value";
|
||||
|
||||
/** Set Asset Group Key */
|
||||
public void setA_Asset_Group_Value (String A_Asset_Group_Value);
|
||||
|
||||
/** Get Asset Group Key */
|
||||
public String getA_Asset_Group_Value();
|
||||
|
||||
/** Column name A_Asset_ID */
|
||||
public static final String COLUMNNAME_A_Asset_ID = "A_Asset_ID";
|
||||
|
||||
/** Set Asset.
|
||||
* Asset used internally or by customers
|
||||
*/
|
||||
public void setA_Asset_ID (int A_Asset_ID);
|
||||
|
||||
/** Get Asset.
|
||||
* Asset used internally or by customers
|
||||
*/
|
||||
public int getA_Asset_ID();
|
||||
|
||||
public org.compiere.model.I_A_Asset getA_Asset() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_Type_ID */
|
||||
public static final String COLUMNNAME_A_Asset_Type_ID = "A_Asset_Type_ID";
|
||||
|
||||
/** Set Asset Type */
|
||||
public void setA_Asset_Type_ID (int A_Asset_Type_ID);
|
||||
|
||||
/** Get Asset Type */
|
||||
public int getA_Asset_Type_ID();
|
||||
|
||||
public org.compiere.model.I_A_Asset_Type getA_Asset_Type() throws RuntimeException;
|
||||
|
||||
/** Column name A_Asset_Type_Value */
|
||||
public static final String COLUMNNAME_A_Asset_Type_Value = "A_Asset_Type_Value";
|
||||
|
||||
/** Set Asset Type Value */
|
||||
public void setA_Asset_Type_Value (String A_Asset_Type_Value);
|
||||
|
||||
/** Get Asset Type Value */
|
||||
public String getA_Asset_Type_Value();
|
||||
|
||||
/** Column name A_Current_Period */
|
||||
public static final String COLUMNNAME_A_Current_Period = "A_Current_Period";
|
||||
|
||||
/** Set Current Period */
|
||||
public void setA_Current_Period (int A_Current_Period);
|
||||
|
||||
/** Get Current Period */
|
||||
public int getA_Current_Period();
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
||||
/** Get Client.
|
||||
* Client/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 client
|
||||
*/
|
||||
public void setAD_Org_ID (int AD_Org_ID);
|
||||
|
||||
/** Get Organization.
|
||||
* Organizational entity within client
|
||||
*/
|
||||
public int getAD_Org_ID();
|
||||
|
||||
/** Column name A_Remaining_Period */
|
||||
public static final String COLUMNNAME_A_Remaining_Period = "A_Remaining_Period";
|
||||
|
||||
/** Set Remaining Period */
|
||||
public void setA_Remaining_Period (int A_Remaining_Period);
|
||||
|
||||
/** Get Remaining Period */
|
||||
public int getA_Remaining_Period();
|
||||
|
||||
/** Column name A_Salvage_Value */
|
||||
public static final String COLUMNNAME_A_Salvage_Value = "A_Salvage_Value";
|
||||
|
||||
/** Set Asset Salvage Value */
|
||||
public void setA_Salvage_Value (BigDecimal A_Salvage_Value);
|
||||
|
||||
/** Get Asset Salvage Value */
|
||||
public BigDecimal getA_Salvage_Value();
|
||||
|
||||
/** Column name AssetDepreciationDate */
|
||||
public static final String COLUMNNAME_AssetDepreciationDate = "AssetDepreciationDate";
|
||||
|
||||
/** Set Asset Depreciation Date.
|
||||
* Date of last depreciation
|
||||
*/
|
||||
public void setAssetDepreciationDate (Timestamp AssetDepreciationDate);
|
||||
|
||||
/** Get Asset Depreciation Date.
|
||||
* Date of last depreciation
|
||||
*/
|
||||
public Timestamp getAssetDepreciationDate();
|
||||
|
||||
/** Column name AssetPeriodDepreciationAmt */
|
||||
public static final String COLUMNNAME_AssetPeriodDepreciationAmt = "AssetPeriodDepreciationAmt";
|
||||
|
||||
/** Set Depreciation Amount / Period.
|
||||
* Applies to Straight Line depreciation
|
||||
*/
|
||||
public void setAssetPeriodDepreciationAmt (BigDecimal AssetPeriodDepreciationAmt);
|
||||
|
||||
/** Get Depreciation Amount / Period.
|
||||
* Applies to Straight Line depreciation
|
||||
*/
|
||||
public BigDecimal getAssetPeriodDepreciationAmt();
|
||||
|
||||
/** Column name AssetServiceDate */
|
||||
public static final String COLUMNNAME_AssetServiceDate = "AssetServiceDate";
|
||||
|
||||
/** Set In Service Date.
|
||||
* Date when Asset was put into service
|
||||
*/
|
||||
public void setAssetServiceDate (Timestamp AssetServiceDate);
|
||||
|
||||
/** Get In Service Date.
|
||||
* Date when Asset was put into service
|
||||
*/
|
||||
public Timestamp getAssetServiceDate();
|
||||
|
||||
/** Column name BPartner_Value */
|
||||
public static final String COLUMNNAME_BPartner_Value = "BPartner_Value";
|
||||
|
||||
/** Set Business Partner Key.
|
||||
* The Key of the Business Partner
|
||||
*/
|
||||
public void setBPartner_Value (String BPartner_Value);
|
||||
|
||||
/** Get Business Partner Key.
|
||||
* The Key of the Business Partner
|
||||
*/
|
||||
public String getBPartner_Value();
|
||||
|
||||
/** Column name C_BPartnerSR_ID */
|
||||
public static final String COLUMNNAME_C_BPartnerSR_ID = "C_BPartnerSR_ID";
|
||||
|
||||
/** Set BPartner (Agent).
|
||||
* Business Partner (Agent or Sales Rep)
|
||||
*/
|
||||
public void setC_BPartnerSR_ID (int C_BPartnerSR_ID);
|
||||
|
||||
/** Get BPartner (Agent).
|
||||
* Business Partner (Agent or Sales Rep)
|
||||
*/
|
||||
public int getC_BPartnerSR_ID();
|
||||
|
||||
public org.compiere.model.I_C_BPartner getC_BPartnerSR() throws RuntimeException;
|
||||
|
||||
/** Column name C_City_ID */
|
||||
public static final String COLUMNNAME_C_City_ID = "C_City_ID";
|
||||
|
||||
/** Set City.
|
||||
* City
|
||||
*/
|
||||
public void setC_City_ID (int C_City_ID);
|
||||
|
||||
/** Get City.
|
||||
* City
|
||||
*/
|
||||
public int getC_City_ID();
|
||||
|
||||
public org.compiere.model.I_C_City getC_City() throws RuntimeException;
|
||||
|
||||
/** Column name C_City_Value */
|
||||
public static final String COLUMNNAME_C_City_Value = "C_City_Value";
|
||||
|
||||
/** Set City Value */
|
||||
public void setC_City_Value (String C_City_Value);
|
||||
|
||||
/** Get City Value */
|
||||
public String getC_City_Value();
|
||||
|
||||
/** 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 C_UOM_ID */
|
||||
public static final String COLUMNNAME_C_UOM_ID = "C_UOM_ID";
|
||||
|
||||
/** Set UOM.
|
||||
* Unit of Measure
|
||||
*/
|
||||
public void setC_UOM_ID (int C_UOM_ID);
|
||||
|
||||
/** Get UOM.
|
||||
* Unit of Measure
|
||||
*/
|
||||
public int getC_UOM_ID();
|
||||
|
||||
public org.compiere.model.I_C_UOM getC_UOM() throws RuntimeException;
|
||||
|
||||
/** 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 I_ErrorMsg */
|
||||
public static final String COLUMNNAME_I_ErrorMsg = "I_ErrorMsg";
|
||||
|
||||
/** Set Import Error Message.
|
||||
* Messages generated from import process
|
||||
*/
|
||||
public void setI_ErrorMsg (String I_ErrorMsg);
|
||||
|
||||
/** Get Import Error Message.
|
||||
* Messages generated from import process
|
||||
*/
|
||||
public String getI_ErrorMsg();
|
||||
|
||||
/** Column name I_FixedAsset_ID */
|
||||
public static final String COLUMNNAME_I_FixedAsset_ID = "I_FixedAsset_ID";
|
||||
|
||||
/** Set Imported Fixed Asset */
|
||||
public void setI_FixedAsset_ID (int I_FixedAsset_ID);
|
||||
|
||||
/** Get Imported Fixed Asset */
|
||||
public int getI_FixedAsset_ID();
|
||||
|
||||
/** Column name I_IsImported */
|
||||
public static final String COLUMNNAME_I_IsImported = "I_IsImported";
|
||||
|
||||
/** Set Imported.
|
||||
* Has this import been processed
|
||||
*/
|
||||
public void setI_IsImported (boolean I_IsImported);
|
||||
|
||||
/** Get Imported.
|
||||
* Has this import been processed
|
||||
*/
|
||||
public boolean isI_IsImported();
|
||||
|
||||
/** Column name InventoryNo */
|
||||
public static final String COLUMNNAME_InventoryNo = "InventoryNo";
|
||||
|
||||
/** Set Inventory No */
|
||||
public void setInventoryNo (String InventoryNo);
|
||||
|
||||
/** Get Inventory No */
|
||||
public String getInventoryNo();
|
||||
|
||||
/** 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 LocatorValue */
|
||||
public static final String COLUMNNAME_LocatorValue = "LocatorValue";
|
||||
|
||||
/** Set Locator Key.
|
||||
* Key of the Warehouse Locator
|
||||
*/
|
||||
public void setLocatorValue (String LocatorValue);
|
||||
|
||||
/** Get Locator Key.
|
||||
* Key of the Warehouse Locator
|
||||
*/
|
||||
public String getLocatorValue();
|
||||
|
||||
/** Column name M_Locator_ID */
|
||||
public static final String COLUMNNAME_M_Locator_ID = "M_Locator_ID";
|
||||
|
||||
/** Set Locator.
|
||||
* Warehouse Locator
|
||||
*/
|
||||
public void setM_Locator_ID (int M_Locator_ID);
|
||||
|
||||
/** Get Locator.
|
||||
* Warehouse Locator
|
||||
*/
|
||||
public int getM_Locator_ID();
|
||||
|
||||
public org.compiere.model.I_M_Locator getM_Locator() throws RuntimeException;
|
||||
|
||||
/** Column name M_Product_ID */
|
||||
public static final String COLUMNNAME_M_Product_ID = "M_Product_ID";
|
||||
|
||||
/** Set Product.
|
||||
* Product, Service, Item
|
||||
*/
|
||||
public void setM_Product_ID (int M_Product_ID);
|
||||
|
||||
/** Get Product.
|
||||
* Product, Service, Item
|
||||
*/
|
||||
public int getM_Product_ID();
|
||||
|
||||
public org.compiere.model.I_M_Product getM_Product() throws RuntimeException;
|
||||
|
||||
/** Column name Name */
|
||||
public static final String COLUMNNAME_Name = "Name";
|
||||
|
||||
/** Set Name.
|
||||
* Alphanumeric identifier of the entity
|
||||
*/
|
||||
public void setName (String Name);
|
||||
|
||||
/** Get Name.
|
||||
* Alphanumeric identifier of the entity
|
||||
*/
|
||||
public String getName();
|
||||
|
||||
/** 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 ProductValue */
|
||||
public static final String COLUMNNAME_ProductValue = "ProductValue";
|
||||
|
||||
/** Set Product Key.
|
||||
* Key of the Product
|
||||
*/
|
||||
public void setProductValue (String ProductValue);
|
||||
|
||||
/** Get Product Key.
|
||||
* Key of the Product
|
||||
*/
|
||||
public String getProductValue();
|
||||
|
||||
/** Column name Qty */
|
||||
public static final String COLUMNNAME_Qty = "Qty";
|
||||
|
||||
/** Set Quantity.
|
||||
* Quantity
|
||||
*/
|
||||
public void setQty (BigDecimal Qty);
|
||||
|
||||
/** Get Quantity.
|
||||
* Quantity
|
||||
*/
|
||||
public BigDecimal getQty();
|
||||
|
||||
/** Column name SeqNo */
|
||||
public static final String COLUMNNAME_SeqNo = "SeqNo";
|
||||
|
||||
/** Set Sequence.
|
||||
* Method of ordering records;
|
||||
lowest number comes first
|
||||
*/
|
||||
public void setSeqNo (int SeqNo);
|
||||
|
||||
/** Get Sequence.
|
||||
* Method of ordering records;
|
||||
lowest number comes first
|
||||
*/
|
||||
public int getSeqNo();
|
||||
|
||||
/** Column name UOMSymbol */
|
||||
public static final String COLUMNNAME_UOMSymbol = "UOMSymbol";
|
||||
|
||||
/** Set Symbol.
|
||||
* Symbol for a Unit of Measure
|
||||
*/
|
||||
public void setUOMSymbol (String UOMSymbol);
|
||||
|
||||
/** Get Symbol.
|
||||
* Symbol for a Unit of Measure
|
||||
*/
|
||||
public String getUOMSymbol();
|
||||
|
||||
/** 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();
|
||||
|
||||
/** Column name UseLifeMonths */
|
||||
public static final String COLUMNNAME_UseLifeMonths = "UseLifeMonths";
|
||||
|
||||
/** Set Usable Life - Months.
|
||||
* Months of the usable life of the asset
|
||||
*/
|
||||
public void setUseLifeMonths (int UseLifeMonths);
|
||||
|
||||
/** Get Usable Life - Months.
|
||||
* Months of the usable life of the asset
|
||||
*/
|
||||
public int getUseLifeMonths();
|
||||
|
||||
/** Column name UseLifeMonths_F */
|
||||
public static final String COLUMNNAME_UseLifeMonths_F = "UseLifeMonths_F";
|
||||
|
||||
/** Set Use Life - Months (fiscal) */
|
||||
public void setUseLifeMonths_F (int UseLifeMonths_F);
|
||||
|
||||
/** Get Use Life - Months (fiscal) */
|
||||
public int getUseLifeMonths_F();
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,168 +1,184 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2006 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.sql.PreparedStatement;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.compiere.util.DB;
|
||||
import org.apache.commons.collections.keyvalue.MultiKey;
|
||||
import org.compiere.model.MAccount;
|
||||
import org.compiere.model.MAcctSchema;
|
||||
import org.compiere.model.ProductCost;
|
||||
import org.compiere.model.Query;
|
||||
import org.compiere.util.CCache;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.TimeUtil;
|
||||
|
||||
/**
|
||||
* Asset Addition Model
|
||||
*
|
||||
*
|
||||
* Asset Acct Model
|
||||
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
||||
*/
|
||||
public class MAssetAcct extends X_A_Asset_Acct {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 4779953750434068382L;
|
||||
public class MAssetAcct extends X_A_Asset_Acct
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* Default ConstructorX_A_Asset_Group_Acct
|
||||
*
|
||||
* @param ctx
|
||||
* context
|
||||
* @param M_InventoryLine_ID
|
||||
* line
|
||||
* DO NOT USE DIRECTLY
|
||||
*/
|
||||
public MAssetAcct(Properties ctx, int X_A_Asset_Acct_ID, String trxName) {
|
||||
super(ctx, X_A_Asset_Acct_ID, trxName);
|
||||
if (X_A_Asset_Acct_ID == 0) {
|
||||
//
|
||||
public MAssetAcct (Properties ctx, int X_A_Asset_Acct_ID, String trxName)
|
||||
{
|
||||
super (ctx,X_A_Asset_Acct_ID, trxName);
|
||||
if (X_A_Asset_Acct_ID == 0)
|
||||
{
|
||||
setA_Salvage_Value(Env.ZERO);
|
||||
}
|
||||
} // MAssetAddition
|
||||
|
||||
}
|
||||
|
||||
public MAssetAcct (Properties ctx, ResultSet rs, String trxName)
|
||||
{
|
||||
super (ctx, rs, trxName);
|
||||
}
|
||||
|
||||
/** Static Cache: A_Asset_Acct_ID -> MAssetAcct */
|
||||
private static CCache<Integer,MAssetAcct> s_cache = new CCache<Integer,MAssetAcct>(Table_Name, 5);
|
||||
/** Static Cache: Asset,PostingType,DateAcct -> MAssetAcct */
|
||||
private static CCache<MultiKey,MAssetAcct> s_cacheAsset = new CCache<MultiKey,MAssetAcct>(Table_Name+"_Asset", 5);
|
||||
|
||||
/**
|
||||
* Load Constructor
|
||||
*
|
||||
* @param ctx
|
||||
* context
|
||||
* @param rs
|
||||
* result set
|
||||
* Get Asset Accounting (from cache)
|
||||
* @param ctx context
|
||||
* @param A_Asset_Acct_ID asset accounting id
|
||||
* @return asset accounting or null if not found
|
||||
*/
|
||||
public MAssetAcct(Properties ctx, ResultSet rs, String trxName) {
|
||||
super(ctx, rs, trxName);
|
||||
} // MInventoryLine
|
||||
|
||||
protected boolean afterSave(boolean newRecord, boolean success) {
|
||||
log.info("afterSave");
|
||||
int p_actasset_ID = getA_Asset_Acct_ID();
|
||||
int p_A_Asset_ID = getA_Asset_ID();
|
||||
|
||||
if (isProcessing() == true) {
|
||||
MAssetChange change = new MAssetChange(getCtx(), 0, null);
|
||||
change.setChangeType("SET");
|
||||
change.setTextDetails(MRefList.getListDescription(getCtx(),
|
||||
"A_Update_Type", "SET"));
|
||||
change.setPostingType(getPostingType());
|
||||
change.setA_Split_Percent(getA_Split_Percent());
|
||||
change.setConventionType(getA_Depreciation_Conv_ID());
|
||||
change.setA_Salvage_Value(getA_Salvage_Value());
|
||||
change.setA_Asset_ID(getA_Asset_ID());
|
||||
change.setDepreciationType(getA_Depreciation_ID());
|
||||
change.setA_Asset_Spread_Type(getA_Asset_Spread_ID());
|
||||
change.setA_Period_Start(getA_Period_Start());
|
||||
change.setA_Period_End(getA_Period_End());
|
||||
change.setA_Depreciation_Calc_Type(getA_Depreciation_Method_ID());
|
||||
change.setA_Asset_Acct(getA_Asset_Acct());
|
||||
change.setC_AcctSchema_ID(getC_AcctSchema_ID());
|
||||
change.setA_Accumdepreciation_Acct(getA_Accumdepreciation_Acct());
|
||||
change.setA_Depreciation_Acct(getA_Depreciation_Acct());
|
||||
change.setA_Disposal_Revenue(getA_Disposal_Revenue());
|
||||
change.setA_Disposal_Loss(getA_Disposal_Loss());
|
||||
change.setA_Reval_Accumdep_Offset_Cur(getA_Reval_Accumdep_Offset_Cur());
|
||||
change.setA_Reval_Accumdep_Offset_Prior(getA_Reval_Accumdep_Offset_Prior());
|
||||
if (getA_Reval_Cal_Method() == null)
|
||||
change.setA_Reval_Cal_Method("DFT");
|
||||
else
|
||||
change.setA_Reval_Cal_Method(getA_Reval_Cal_Method());
|
||||
change.setA_Reval_Cost_Offset(getA_Reval_Cost_Offset());
|
||||
change.setA_Reval_Cost_Offset_Prior(getA_Reval_Cost_Offset_Prior());
|
||||
change.setA_Reval_Depexp_Offset(getA_Reval_Depexp_Offset());
|
||||
change.setA_Depreciation_Manual_Amount(getA_Depreciation_Manual_Amount());
|
||||
change.setA_Depreciation_Manual_Period(getA_Depreciation_Manual_Period());
|
||||
change.setA_Depreciation_Table_Header_ID(getA_Depreciation_Table_Header_ID());
|
||||
change.setA_Depreciation_Variable_Perc(getA_Depreciation_Variable_Perc());
|
||||
change.saveEx();
|
||||
|
||||
String sql = "SELECT * FROM A_Depreciation_Workfile WHERE A_Asset_ID=? AND IsActive='Y'";
|
||||
PreparedStatement pstmt = null;
|
||||
try {
|
||||
pstmt = DB.prepareStatement(sql, null);
|
||||
pstmt.setInt(1, p_A_Asset_ID);
|
||||
ResultSet rs = pstmt.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
// MADepreciationWorkfile asset = new MADepreciationWorkfile
|
||||
// (getCtx(), rs.getInt("A_Depreciation_Workfile_ID"));
|
||||
X_A_Depreciation_Workfile assetwk = new X_A_Depreciation_Workfile(
|
||||
getCtx(), rs, null);
|
||||
assetwk.setA_Salvage_Value(getA_Salvage_Value());
|
||||
assetwk.saveEx();
|
||||
}
|
||||
rs.close();
|
||||
pstmt.close();
|
||||
pstmt = null;
|
||||
} catch (Exception e) {
|
||||
log.info("getAssets" + e);
|
||||
} finally {
|
||||
try {
|
||||
if (pstmt != null)
|
||||
pstmt.close();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
pstmt = null;
|
||||
}
|
||||
|
||||
} else {
|
||||
X_A_Asset_Acct assetacct = new X_A_Asset_Acct(getCtx(),
|
||||
p_actasset_ID, this.get_TrxName());
|
||||
assetacct.setPostingType(getPostingType());
|
||||
assetacct.setA_Split_Percent(getA_Split_Percent());
|
||||
assetacct.setA_Depreciation_Conv_ID(getA_Depreciation_Conv_ID());
|
||||
assetacct.setA_Salvage_Value(getA_Salvage_Value());
|
||||
assetacct.setA_Asset_ID(getA_Asset_ID());
|
||||
assetacct.setA_Depreciation_ID(getA_Depreciation_ID());
|
||||
assetacct.setA_Asset_Spread_ID(getA_Asset_Spread_ID());
|
||||
assetacct.setA_Period_Start(getA_Period_Start());
|
||||
assetacct.setA_Depreciation_Method_ID(getA_Depreciation_Method_ID());
|
||||
assetacct.setA_Asset_Acct(getA_Asset_Acct());
|
||||
assetacct.setC_AcctSchema_ID(getC_AcctSchema_ID());
|
||||
assetacct.setA_Accumdepreciation_Acct(getA_Accumdepreciation_Acct());
|
||||
assetacct.setA_Depreciation_Acct(getA_Depreciation_Acct());
|
||||
assetacct.setA_Disposal_Revenue(getA_Disposal_Revenue());
|
||||
assetacct.setA_Disposal_Loss(getA_Disposal_Loss());
|
||||
assetacct.setA_Reval_Accumdep_Offset_Cur(getA_Reval_Accumdep_Offset_Cur());
|
||||
assetacct.setA_Reval_Accumdep_Offset_Prior(getA_Reval_Accumdep_Offset_Prior());
|
||||
assetacct.setA_Reval_Cal_Method(getA_Reval_Cal_Method());
|
||||
assetacct.setA_Reval_Cost_Offset(getA_Reval_Cost_Offset());
|
||||
assetacct.setA_Reval_Cost_Offset_Prior(getA_Reval_Cost_Offset_Prior());
|
||||
assetacct.setA_Reval_Depexp_Offset(getA_Reval_Depexp_Offset());
|
||||
assetacct.setA_Depreciation_Manual_Amount(getA_Depreciation_Manual_Amount());
|
||||
assetacct.setA_Depreciation_Manual_Period(getA_Depreciation_Manual_Period());
|
||||
assetacct.setA_Depreciation_Table_Header_ID(getA_Depreciation_Table_Header_ID());
|
||||
assetacct.setA_Depreciation_Variable_Perc(getA_Depreciation_Variable_Perc());
|
||||
assetacct.setProcessing(true);
|
||||
assetacct.saveEx();
|
||||
public static MAssetAcct get (Properties ctx, int A_Asset_Acct_ID)
|
||||
{
|
||||
MAssetAcct acct = s_cache.get(A_Asset_Acct_ID);
|
||||
if (acct != null)
|
||||
{
|
||||
return acct;
|
||||
}
|
||||
acct = new MAssetAcct(ctx, A_Asset_Acct_ID, null);
|
||||
if (acct.get_ID() > 0)
|
||||
{
|
||||
addToCache(acct, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
acct = null;
|
||||
}
|
||||
return acct;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get asset accounting.
|
||||
* @param ctx context
|
||||
* @param A_Asset_ID asset
|
||||
* @param postingType Posting type
|
||||
* @param dateAcct check ValidFrom
|
||||
* @return asset accounting for the given asset
|
||||
*/
|
||||
public static MAssetAcct forA_Asset_ID (Properties ctx, int A_Asset_ID, String postingType, Timestamp dateAcct, String trxName)
|
||||
{
|
||||
MultiKey key = new MultiKey(A_Asset_ID, postingType, dateAcct);
|
||||
MAssetAcct acct = null;
|
||||
if (trxName == null)
|
||||
{
|
||||
// do not use cache
|
||||
//acct = s_cacheAsset.get(key);
|
||||
}
|
||||
if (acct != null)
|
||||
{
|
||||
return acct;
|
||||
}
|
||||
//
|
||||
ArrayList<Object> params = new ArrayList<Object>();
|
||||
StringBuffer whereClause = new StringBuffer(COLUMNNAME_A_Asset_ID+"=? AND "+COLUMNNAME_PostingType+"=?");
|
||||
params.add(A_Asset_ID);
|
||||
params.add(postingType);
|
||||
if (dateAcct != null)
|
||||
{
|
||||
whereClause.append(" AND " + COLUMNNAME_ValidFrom).append("<=?");
|
||||
params.add(dateAcct);
|
||||
}
|
||||
acct = new Query(ctx, Table_Name, whereClause.toString(), trxName)
|
||||
.setParameters(params)
|
||||
.setOrderBy(COLUMNNAME_ValidFrom+" DESC NULLS LAST")
|
||||
.first();
|
||||
if (trxName == null)
|
||||
{
|
||||
addToCache(acct, key);
|
||||
}
|
||||
return acct;
|
||||
}
|
||||
|
||||
private static void addToCache(MAssetAcct acct, MultiKey keyAsset)
|
||||
{
|
||||
if (acct == null || acct.get_ID() <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
s_cache.put(acct.get_ID(), acct);
|
||||
if (keyAsset != null)
|
||||
{
|
||||
s_cacheAsset.put(keyAsset, acct);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create new asset accounting from asset group accounting
|
||||
* @param asset asset
|
||||
* @param assetgrpacct asset group accounting
|
||||
*/
|
||||
public MAssetAcct(MAsset asset, MAssetGroupAcct assetgrpacct)
|
||||
{
|
||||
this(assetgrpacct.getCtx(), 0, asset.get_TrxName());
|
||||
|
||||
SetGetUtil.copyValues(this, assetgrpacct, null, null);
|
||||
setA_Asset_ID(asset.getA_Asset_ID());
|
||||
if (asset.getA_Depreciation_ID() > 0)
|
||||
{
|
||||
setA_Depreciation_ID(asset.getA_Depreciation_ID());
|
||||
}
|
||||
if (asset.getA_Depreciation_F_ID() > 0)
|
||||
{
|
||||
setA_Depreciation_F_ID(asset.getA_Depreciation_F_ID());
|
||||
}
|
||||
setA_Period_Start(1);
|
||||
setA_Period_End(asset.getUseLifeMonths());
|
||||
//~ setProcessing(false);
|
||||
dump();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public BigDecimal getA_Depreciation_Variable_Perc(boolean fiscal)
|
||||
{
|
||||
return fiscal ? getA_Depreciation_Variable_Perc_F() : getA_Depreciation_Variable_Perc();
|
||||
}
|
||||
|
||||
|
||||
public MAcctSchema getC_AcctSchema()
|
||||
{
|
||||
return MAcctSchema.get(getCtx(), getC_AcctSchema_ID());
|
||||
}
|
||||
|
||||
public MAccount getP_Asset_Acct(int M_Product_ID)
|
||||
{
|
||||
MAcctSchema as = getC_AcctSchema();
|
||||
ProductCost pc = new ProductCost(getCtx(), M_Product_ID, 0, null);
|
||||
return pc.getAccount(ProductCost.ACCTTYPE_P_Asset, as);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean beforeSave(boolean newRecord) {
|
||||
if (getValidFrom() == null && newRecord)
|
||||
{
|
||||
setValidFrom(TimeUtil.getDay(1970, 01, 01)); // FIXME
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // MAssetAddition
|
||||
|
||||
|
||||
} // class MAssetAcct
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,36 +1,38 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2006 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 *
|
||||
* The contents of this file are subject to the Compiere License Version 1.1
|
||||
* ("License"); You may not use this file except in compliance with the License
|
||||
* You may obtain a copy of the License at http://www.compiere.org/license.html
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is Compiere ERP & CRM Smart Business Solution
|
||||
* The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
|
||||
* Portions created by Jorg Janke are Copyright (C) 1999-2003 Jorg Janke, parts
|
||||
* created by ComPiere are Copyright (C) ComPiere, Inc.; All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
*****************************************************************************/
|
||||
package org.compiere.model;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.compiere.model.MRefList;
|
||||
import org.compiere.model.PO;
|
||||
import org.compiere.util.CLogMgt;
|
||||
import org.compiere.util.CLogger;
|
||||
|
||||
/**
|
||||
* Asset Addition Model
|
||||
*
|
||||
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
||||
*
|
||||
*/
|
||||
public class MAssetChange extends X_A_Asset_Change
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 5906751299228645904L;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** Static Logger */
|
||||
private static CLogger s_log = CLogger.getCLogger(MAssetChange.class);
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
* @param ctx context
|
||||
|
@ -39,12 +41,8 @@ public class MAssetChange extends X_A_Asset_Change
|
|||
public MAssetChange (Properties ctx, int A_Asset_Change_ID, String trxName)
|
||||
{
|
||||
super (ctx, A_Asset_Change_ID, trxName);
|
||||
if (A_Asset_Change_ID == 0)
|
||||
{
|
||||
//
|
||||
|
||||
}
|
||||
} // MAssetAddition
|
||||
} // MAssetChange
|
||||
|
||||
/**
|
||||
* Load Constructor
|
||||
* @param ctx context
|
||||
|
@ -61,11 +59,94 @@ public class MAssetChange extends X_A_Asset_Change
|
|||
* @return true
|
||||
*/
|
||||
protected boolean beforeSave (boolean newRecord)
|
||||
{
|
||||
if (getA_Reval_Cal_Method() == null)
|
||||
setA_Reval_Cal_Method("DFT");
|
||||
{
|
||||
String textDetails = getTextDetails();
|
||||
if (textDetails == null || textDetails.length() == 0) {
|
||||
setTextDetails(MRefList.getListDescription (getCtx(),"A_Update_Type" , getChangeType()));
|
||||
}
|
||||
return true;
|
||||
} // beforeSave
|
||||
|
||||
|
||||
} // MAssetAddition
|
||||
/** ARHIPAC: TEO: BEGIN ------------------------------------------------------------------ */
|
||||
public void setSerno(String value) { setSerNo(value); }
|
||||
public void setVersionno(String value) { setVersionNo(value); }
|
||||
public void setAd_User_ID(int value) { setAD_User_ID(value); }
|
||||
|
||||
public static MAssetChange createAddition(MAssetAddition assetAdd, MDepreciationWorkfile assetwk) {
|
||||
MAssetChange change = new MAssetChange (assetAdd.getCtx(), 0, assetAdd.get_TrxName());
|
||||
change.setAD_Org_ID(assetAdd.getAD_Org_ID()); //@win added
|
||||
change.setA_Asset_ID(assetAdd.getA_Asset_ID());
|
||||
change.setA_QTY_Current(assetAdd.getA_QTY_Current());
|
||||
change.setChangeType("ADD");
|
||||
change.setTextDetails(MRefList.getListDescription (assetAdd.getCtx(),"A_Update_Type" , "ADD"));
|
||||
change.setPostingType(assetwk.getPostingType());
|
||||
change.setAssetValueAmt(assetAdd.getAssetValueAmt());
|
||||
change.setA_QTY_Current(assetAdd.getA_QTY_Current());
|
||||
change.saveEx();
|
||||
|
||||
return change;
|
||||
}
|
||||
|
||||
public static MAssetChange create(Properties ctx, String changeType, PO[] pos, String trxName) {
|
||||
return create(ctx, changeType, pos, false, trxName);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* @param ctx
|
||||
* @param changeType
|
||||
* @param pos
|
||||
* @param trxName
|
||||
* @return
|
||||
*/
|
||||
public static MAssetChange createAndSave(Properties ctx, String changeType, PO[] pos, String trxName) {
|
||||
return null;
|
||||
//~ return create(ctx, changeType, pos, true, trxName);
|
||||
}
|
||||
|
||||
public static MAssetChange create(Properties ctx, String changeType, PO[] pos, boolean save, String trxName) {
|
||||
s_log.fine("Entering: changeType=" + changeType);
|
||||
if (pos == null || pos.length == 0) {
|
||||
s_log.fine("Entering/Leaving: POs is empty");
|
||||
return null;
|
||||
}
|
||||
MAssetChange change = new MAssetChange (ctx, 0, trxName);
|
||||
change.setChangeType(changeType);
|
||||
for (PO po : pos) {
|
||||
change.addChanges(po);
|
||||
}
|
||||
if (save) {
|
||||
change.saveEx();
|
||||
}
|
||||
//
|
||||
s_log.fine("Leaving: change=" + change);
|
||||
return change;
|
||||
}
|
||||
|
||||
public void addChanges(PO po) {
|
||||
if(CLogMgt.isLevelFine()) log.fine("Entering: po=" + po);
|
||||
if (po == null) {
|
||||
return;
|
||||
}
|
||||
/* arhipac: teo_sarca: TODO need to integrate
|
||||
for(int idx = 0; idx < po.get_ColumnCount_P(); idx++) {
|
||||
//~ if(!po.is_ValueChanged(idx)) {
|
||||
//~ continue;
|
||||
//~ }
|
||||
String colName = po.get_ColumnName_P(idx);
|
||||
int idx2 = get_ColumnIndex(colName);
|
||||
if(idx2 < 0) {
|
||||
if(CLogMgt.isLevelFine()) log.fine("Setting " + colName + ": SKIP (idx2 < 0)");
|
||||
continue;
|
||||
}
|
||||
|
||||
Object value = po.get_Value(idx2);
|
||||
set_Value(colName, value);
|
||||
if(CLogMgt.isLevelFine()) log.fine("Setting " + colName + "=" + value + " (from " + po.getClass() + ", idx=" + idx + ", idx2=" + idx2 + ")");
|
||||
}
|
||||
*/
|
||||
//
|
||||
if(CLogMgt.isLevelFine()) log.fine("Leaving: po=" + po);
|
||||
}
|
||||
/** ARHIPAC: TEO: END ------------------------------------------------------------------ */
|
||||
} // MAssetChange
|
|
@ -0,0 +1,210 @@
|
|||
package org.compiere.model;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Calendar;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.compiere.model.Query;
|
||||
import org.compiere.util.CCache;
|
||||
import org.compiere.util.CLogMgt;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.TimeUtil;
|
||||
import org.idempiere.fa.feature.UseLifeImpl;
|
||||
|
||||
/** Asset Class
|
||||
* @author Teo Sarca, SC Arhipac SRL
|
||||
* @version $Id$
|
||||
*/
|
||||
public class MAssetClass extends X_A_Asset_Class
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public MAssetClass(Properties ctx, int A_Asset_Class_ID, String trxName)
|
||||
{
|
||||
super (ctx, A_Asset_Class_ID, trxName);
|
||||
} // MAssetClass
|
||||
|
||||
/**
|
||||
* Load Constructor
|
||||
* @param ctx context
|
||||
* @param rs result set record
|
||||
*/
|
||||
public MAssetClass (Properties ctx, ResultSet rs, String trxName)
|
||||
{
|
||||
super (ctx, rs, trxName);
|
||||
} // MAssetClass
|
||||
|
||||
/** */
|
||||
private static CCache<Integer, MAssetClass> s_cache = new CCache<Integer, MAssetClass>("A_Asset_Class", 20);
|
||||
|
||||
/** Get Asset Class from cache
|
||||
* @param ctx context
|
||||
* @param id A_Asset_Class_ID
|
||||
* @return MAssetClass or null if not found
|
||||
*/
|
||||
public static MAssetClass get(Properties ctx, int id) {
|
||||
if (id <= 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
MAssetClass assetClass = s_cache.get(id);
|
||||
if (assetClass == null) {
|
||||
assetClass = new MAssetClass(ctx, id, null);
|
||||
}
|
||||
if (assetClass.get_ID() != id) {
|
||||
return null;
|
||||
}
|
||||
s_cache.put(id, assetClass);
|
||||
return assetClass;
|
||||
} // get
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static MAssetClass get(Properties ctx, String value)
|
||||
{
|
||||
// TODO: maybe logging
|
||||
final String whereClause = "UPPER(Value)=UPPER(?) AND AD_Client_ID IN (0,?)";
|
||||
return new Query(ctx, Table_Name, whereClause, null)
|
||||
.setParameters(new Object[]{value, Env.getAD_Client_ID(ctx)})
|
||||
.setOrderBy("AD_Client_ID DESC")
|
||||
.firstOnly();
|
||||
} // get
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void setDescription() {
|
||||
StringBuffer description = new StringBuffer();
|
||||
String value = getValue();
|
||||
if (value != null) {
|
||||
description.append(value).append(" ");
|
||||
}
|
||||
|
||||
String name = getName();
|
||||
if (name != null) {
|
||||
description.append(name);
|
||||
}
|
||||
super.setDescription(description.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void setLevels() {
|
||||
setMFX_Grupa(0);
|
||||
setMFX_SubGrupa(0);
|
||||
setMFX_Clasa(0);
|
||||
setMFX_SubClasa(0);
|
||||
|
||||
String value = getValue();
|
||||
if (value == null || value.length() == 0)
|
||||
return;
|
||||
|
||||
String[] arr = value.split("\\.");
|
||||
try {
|
||||
if (arr.length >= 1)
|
||||
setMFX_Grupa(Integer.valueOf(arr[0]));
|
||||
if (arr.length >= 2)
|
||||
setMFX_SubGrupa(Integer.valueOf(arr[1]));
|
||||
if (arr.length >= 3)
|
||||
setMFX_Clasa(Integer.valueOf(arr[2]));
|
||||
if (arr.length >= 4)
|
||||
setMFX_SubClasa(Integer.valueOf(arr[3]));
|
||||
} catch (NumberFormatException e) {
|
||||
log.warning("@Error@ @Value@=" + value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public int getA_Life_Period_Min(Timestamp serviceDate) {
|
||||
Calendar cal = TimeUtil.getCalendar(serviceDate);
|
||||
if (cal.get(Calendar.YEAR) >= 2004) {
|
||||
return getA_Life_Period_Min();
|
||||
}
|
||||
else {
|
||||
return getA_Life_Period_2004();
|
||||
}
|
||||
}
|
||||
|
||||
/** Validate */
|
||||
public String validate(boolean saveError, int A_Life_Period, Timestamp serviceDate) {
|
||||
log.fine("Entering");
|
||||
int A_Life_Period_Min = 0;
|
||||
int A_Life_Period_Max = 1000000;
|
||||
Calendar cal = TimeUtil.getCalendar(serviceDate);
|
||||
if (cal.get(Calendar.YEAR) >= 2004) {
|
||||
A_Life_Period_Min = getA_Life_Period_Min();
|
||||
A_Life_Period_Max = getA_Life_Period_Max();
|
||||
}
|
||||
else {
|
||||
A_Life_Period_Min = getA_Life_Period_2004();
|
||||
A_Life_Period_Max = getA_Life_Period_2004();
|
||||
}
|
||||
// logging:
|
||||
if (CLogMgt.isLevelFine()) {
|
||||
log.fine("serviceDate=" + serviceDate + ", A_Life_Period_Min=" + A_Life_Period_Min + ", A_Life_Period_Max=" + A_Life_Period_Max + ", A_Life_Period=" + A_Life_Period);
|
||||
}
|
||||
|
||||
|
||||
if (A_Life_Period < A_Life_Period_Min || A_Life_Period > A_Life_Period_Max) {
|
||||
String errmsg = "@UseLifeMonths@=" + A_Life_Period + " @NotBetween@ " + A_Life_Period_Min + " - " + A_Life_Period_Max;
|
||||
if (saveError) {
|
||||
log.saveError("Error", errmsg);
|
||||
}
|
||||
if(CLogMgt.isLevelFine()) {
|
||||
log.fine("Leaving: " + errmsg);
|
||||
Thread.dumpStack();
|
||||
}
|
||||
return errmsg;
|
||||
}
|
||||
|
||||
log.fine("Leaving: OK!");
|
||||
return "";
|
||||
}
|
||||
|
||||
/** Validate UseLifeImpl model
|
||||
*/
|
||||
public boolean validate(UseLifeImpl asset) {
|
||||
if(CLogMgt.isLevelFine()) log.fine("Entering: UseLifeImpl=" + asset);
|
||||
|
||||
if (!asset.isFiscal()) {
|
||||
log.fine("Leaving: fiscal=false [RETURN TRUE]");
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
log.fine("asset is fiscal");
|
||||
}
|
||||
|
||||
int A_Life_Period = asset.getUseLifeMonths();
|
||||
Timestamp serviceDate = asset.getAssetServiceDate();
|
||||
String errmsg = validate(true, A_Life_Period, serviceDate);
|
||||
boolean ok = (errmsg == null || errmsg.length() == 0);
|
||||
|
||||
log.fine("Leaving: ok=" + ok);
|
||||
return ok;
|
||||
}
|
||||
|
||||
/** Depreciated check
|
||||
*
|
||||
*/
|
||||
public boolean isDepreciated() {
|
||||
return !(getA_Life_Period_Min() == 0 && getA_Life_Period_Max() ==0);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public boolean beforeSave (boolean newRecord) {
|
||||
setDescription();
|
||||
if (is_ValueChanged("Value")) {
|
||||
setValue(getValue().trim());
|
||||
setLevels();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,428 @@
|
|||
package org.compiere.model;
|
||||
|
||||
import java.io.File;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.compiere.process.DocAction;
|
||||
import org.compiere.process.DocumentEngine;
|
||||
import org.compiere.util.Env;
|
||||
import org.idempiere.fa.exceptions.AssetAlreadyDepreciatedException;
|
||||
import org.idempiere.fa.exceptions.AssetNotImplementedException;
|
||||
import org.idempiere.fa.exceptions.AssetNotSupportedException;
|
||||
import org.idempiere.fa.exceptions.AssetStatusChangedException;
|
||||
import org.idempiere.fa.util.POCacheLocal;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Asset Disposal Model
|
||||
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
||||
*/
|
||||
public class MAssetDisposed extends X_A_Asset_Disposed
|
||||
implements DocAction
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1763997880662445638L;
|
||||
|
||||
public MAssetDisposed (Properties ctx, int A_Asset_Disposed_ID, String trxName)
|
||||
{
|
||||
super (ctx, A_Asset_Disposed_ID, trxName);
|
||||
if (A_Asset_Disposed_ID == 0)
|
||||
{
|
||||
setProcessed (false);
|
||||
setProcessing (false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//@win: autocreate asset disposal from ar invoice
|
||||
public static MAssetDisposed createAssetDisposed (MInvoiceLine invLine) {
|
||||
MAssetDisposed assetDisposed = new MAssetDisposed(invLine);
|
||||
assetDisposed.dump();
|
||||
return assetDisposed;
|
||||
}
|
||||
|
||||
private MAssetDisposed (MInvoiceLine invLine) {
|
||||
this(invLine.getCtx(),0,invLine.get_TrxName());
|
||||
log.finest("Entering: Project=" + invLine);
|
||||
setAD_Org_ID(invLine.getAD_Org_ID());
|
||||
setPostingType(POSTINGTYPE_Actual);
|
||||
setDateDoc(invLine.getC_Invoice().getDateInvoiced());
|
||||
setDateAcct(invLine.getC_Invoice().getDateInvoiced());
|
||||
setA_Disposed_Date(invLine.getC_Invoice().getDateInvoiced());
|
||||
setA_Disposed_Method(A_DISPOSED_METHOD_Trade);
|
||||
setA_Asset_ID(invLine.getA_Asset_ID());
|
||||
set_ValueNoCheck("C_Invoice_ID", invLine.getC_Invoice_ID());
|
||||
setM_InvoiceLine(invLine);
|
||||
saveEx(invLine.get_TrxName());
|
||||
}
|
||||
|
||||
private final POCacheLocal<MInvoiceLine> m_cacheInvoiceLine = POCacheLocal.newInstance(this, MInvoiceLine.class);
|
||||
public MInvoiceLine getM_InvoiceLine(boolean requery)
|
||||
{
|
||||
return m_cacheInvoiceLine.get(requery);
|
||||
}
|
||||
private void setM_InvoiceLine(MInvoiceLine invLine)
|
||||
{
|
||||
set_Value("C_InvoiceLine_ID", invLine.get_ID());
|
||||
m_cacheInvoiceLine.set(invLine);
|
||||
}
|
||||
//end @win: autocreate asset disposal from ar invoice
|
||||
|
||||
public MAssetDisposed (Properties ctx, ResultSet rs, String trxName)
|
||||
{
|
||||
super (ctx, rs, trxName);
|
||||
}
|
||||
|
||||
public MAsset getAsset()
|
||||
{
|
||||
return MAsset.get(getCtx(), getA_Asset_ID(), null);
|
||||
}
|
||||
|
||||
|
||||
public boolean processIt (String processAction)
|
||||
{
|
||||
m_processMsg = null;
|
||||
DocumentEngine engine = new DocumentEngine (this, getDocStatus());
|
||||
return engine.processIt (processAction, getDocAction());
|
||||
} // processIt
|
||||
|
||||
/** Process Message */
|
||||
private String m_processMsg = null;
|
||||
/** Just Prepared Flag */
|
||||
private boolean m_justPrepared = false;
|
||||
|
||||
|
||||
public boolean unlockIt()
|
||||
{
|
||||
setProcessing(false);
|
||||
return true;
|
||||
} // unlockIt
|
||||
|
||||
|
||||
public boolean invalidateIt()
|
||||
{
|
||||
return false;
|
||||
} // invalidateIt
|
||||
|
||||
|
||||
public String prepareIt()
|
||||
{
|
||||
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE);
|
||||
if (m_processMsg != null)
|
||||
{
|
||||
return DocAction.STATUS_Invalid;
|
||||
}
|
||||
|
||||
MPeriod.testPeriodOpen(getCtx(), getDateAcct(), MDocType.DOCBASETYPE_GLDocument, getAD_Org_ID());
|
||||
|
||||
//saveEx() //commented by @win
|
||||
updateFromAsset(this);
|
||||
saveEx(get_TrxName()); //added by @win
|
||||
if (is_Changed())
|
||||
{
|
||||
throw new AssetStatusChangedException();
|
||||
}
|
||||
|
||||
// Check that the FA is not just depreciated
|
||||
MDepreciationWorkfile assetwk = MDepreciationWorkfile.get(getCtx(), getA_Asset_ID(), getPostingType(), get_TrxName());
|
||||
if (assetwk.isDepreciated(getDateAcct()))
|
||||
{
|
||||
throw new AssetAlreadyDepreciatedException();
|
||||
}
|
||||
MDepreciationExp.checkExistsNotProcessedEntries(getCtx(), getA_Asset_ID(), getDateAcct(), getPostingType(), get_TrxName());
|
||||
|
||||
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);
|
||||
if (m_processMsg != null)
|
||||
{
|
||||
return DocAction.STATUS_Invalid;
|
||||
}
|
||||
//
|
||||
m_justPrepared = true;
|
||||
setDocAction(DOCACTION_Complete);
|
||||
return DocAction.STATUS_InProgress;
|
||||
} // prepareIt
|
||||
|
||||
|
||||
public boolean approveIt()
|
||||
{
|
||||
log.info("approveIt - " + toString());
|
||||
setIsApproved(true);
|
||||
return true;
|
||||
} // approveIt
|
||||
|
||||
|
||||
public boolean rejectIt()
|
||||
{
|
||||
log.info("rejectIt - " + toString());
|
||||
setIsApproved(false);
|
||||
return true;
|
||||
} // rejectIt
|
||||
|
||||
|
||||
public String completeIt()
|
||||
{
|
||||
// Re-Check
|
||||
if (!m_justPrepared)
|
||||
{
|
||||
String status = prepareIt();
|
||||
if (!DocAction.STATUS_InProgress.equals(status))
|
||||
return status;
|
||||
}
|
||||
|
||||
String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE);
|
||||
if (valid != null)
|
||||
{
|
||||
m_processMsg = valid;
|
||||
return DocAction.STATUS_Invalid;
|
||||
}
|
||||
|
||||
// Implicit Approval
|
||||
if (!isApproved())
|
||||
approveIt();
|
||||
log.info(toString());
|
||||
//
|
||||
|
||||
//loading asset
|
||||
MAsset asset = getAsset();
|
||||
log.fine("asset=" + asset);
|
||||
|
||||
// Activation
|
||||
if(!isDisposal())
|
||||
{
|
||||
String method = getA_Activation_Method();
|
||||
if(method.equals(A_ACTIVATION_METHOD_Activation))
|
||||
{ // reactivation
|
||||
asset.changeStatus(MAsset.A_ASSET_STATUS_Activated, getDateDoc());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new AssetNotSupportedException(COLUMNNAME_A_Activation_Method, method);
|
||||
}
|
||||
}
|
||||
// Preservation/Partial Retirement/etc
|
||||
else
|
||||
{
|
||||
String method = getA_Disposed_Method();
|
||||
if (A_DISPOSED_METHOD_Preservation.equals(method))
|
||||
{
|
||||
asset.changeStatus(MAsset.A_ASSET_STATUS_Preservation, getDateDoc());
|
||||
}
|
||||
else if (A_DISPOSED_METHOD_Simple.equals(method)
|
||||
|| A_DISPOSED_METHOD_Trade.equals(method)
|
||||
)
|
||||
{
|
||||
asset.changeStatus(MAsset.A_ASSET_STATUS_Disposed, null);
|
||||
setA_Disposal_Amt(getA_Asset_Cost());
|
||||
setA_Accumulated_Depr_Delta(getA_Accumulated_Depr());
|
||||
setExpense(getA_Disposal_Amt().subtract(getA_Accumulated_Depr_Delta()));
|
||||
createDisposal();
|
||||
}
|
||||
else if (A_DISPOSED_METHOD_PartialRetirement.equals(method))
|
||||
{
|
||||
createDisposal();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new AssetNotSupportedException(COLUMNNAME_A_Disposed_Method, method);
|
||||
}
|
||||
}
|
||||
|
||||
asset.saveEx(get_TrxName());
|
||||
|
||||
|
||||
// User Validation
|
||||
valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE);
|
||||
if (valid != null)
|
||||
{
|
||||
m_processMsg = valid;
|
||||
return DocAction.STATUS_Invalid;
|
||||
}
|
||||
|
||||
// Done
|
||||
setProcessed(true);
|
||||
setDocAction(DOCACTION_Close);
|
||||
return DocAction.STATUS_Completed;
|
||||
} // completeIt
|
||||
|
||||
|
||||
public boolean voidIt()
|
||||
{
|
||||
throw new AssetNotImplementedException("");
|
||||
} // voidIt
|
||||
|
||||
|
||||
public boolean closeIt()
|
||||
{
|
||||
setDocAction(DOCACTION_None);
|
||||
return true;
|
||||
} // closeIt
|
||||
|
||||
|
||||
public boolean reverseCorrectIt()
|
||||
{
|
||||
throw new AssetNotImplementedException("");
|
||||
} // reverseCorrectionIt
|
||||
|
||||
|
||||
public boolean reverseAccrualIt()
|
||||
{
|
||||
throw new AssetNotImplementedException("");
|
||||
}
|
||||
|
||||
|
||||
public boolean reActivateIt()
|
||||
{
|
||||
throw new AssetNotImplementedException("");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getSummary()
|
||||
{
|
||||
return new StringBuffer()
|
||||
.append(getDocumentNo()).append("/").append(getDateDoc())
|
||||
.toString();
|
||||
}
|
||||
|
||||
|
||||
public String getProcessMsg()
|
||||
{
|
||||
return m_processMsg;
|
||||
} // getProcessMsg
|
||||
|
||||
|
||||
public int getDoc_User_ID()
|
||||
{
|
||||
return getCreatedBy();
|
||||
}
|
||||
|
||||
|
||||
public BigDecimal getApprovalAmt()
|
||||
{
|
||||
return Env.ZERO;
|
||||
}
|
||||
|
||||
|
||||
public int getC_Currency_ID()
|
||||
{
|
||||
return MClient.get(getCtx(), getAD_Client_ID()).getAcctSchema().getC_Currency_ID();
|
||||
}
|
||||
|
||||
|
||||
protected boolean beforeSave (boolean newRecord)
|
||||
{
|
||||
if (getDateAcct() == null)
|
||||
{
|
||||
setDateAcct(getDateDoc());
|
||||
}
|
||||
if (newRecord || is_ValueChanged(COLUMNNAME_DateAcct))
|
||||
{
|
||||
setC_Period_ID(MPeriod.get(getCtx(), getDateAcct(), getAD_Org_ID()).get_ID());
|
||||
}
|
||||
if (getA_Disposed_Date() == null)
|
||||
{
|
||||
setA_Disposed_Date(getDateAcct());
|
||||
}
|
||||
/* commented by @win - asset type
|
||||
if (!MAssetType.isFixedAsset(getA_Asset_ID()))
|
||||
{
|
||||
throw new AssetException("This is not a Fixed Asset!");
|
||||
}
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy fields from A_Asset
|
||||
* @param model
|
||||
* @param A_Asset_ID
|
||||
*/
|
||||
public static void updateFromAsset(I_A_Asset_Disposed bean)
|
||||
{
|
||||
int asset_id = bean.getA_Asset_ID();
|
||||
SetGetUtil.copyValues(
|
||||
SetGetUtil.wrap(bean),
|
||||
MAsset.Table_Name, asset_id,
|
||||
new String[] {
|
||||
MAsset.COLUMNNAME_IsDisposed,
|
||||
MAsset.COLUMNNAME_A_Asset_Status,
|
||||
"AD_Org_ID",
|
||||
}
|
||||
);
|
||||
|
||||
MDepreciationWorkfile wk = MDepreciationWorkfile.get(Env.getCtx(), asset_id, bean.getPostingType(), null);
|
||||
if (wk != null)
|
||||
{
|
||||
bean.setA_Asset_Cost(wk.getA_Asset_Cost());
|
||||
bean.setA_Accumulated_Depr(wk.getA_Accumulated_Depr());
|
||||
}
|
||||
else
|
||||
{
|
||||
bean.setA_Asset_Cost(Env.ZERO);
|
||||
bean.setA_Accumulated_Depr(Env.ZERO);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public File createPDF ()
|
||||
{
|
||||
return null;
|
||||
} // createPDF
|
||||
|
||||
|
||||
public String getDocumentInfo()
|
||||
{
|
||||
return getDocumentNo();
|
||||
} // getDocumentInfo
|
||||
|
||||
/**
|
||||
* Check if this is a disposal (if the asset is not disposed)
|
||||
* @return true if is disposal
|
||||
*/
|
||||
public boolean isDisposal()
|
||||
{
|
||||
return !isDisposed();
|
||||
}
|
||||
|
||||
public static void setA_Disposal_Amt(I_A_Asset_Disposed bean)
|
||||
{
|
||||
int precision = 2;
|
||||
BigDecimal A_Asset_Cost = bean.getA_Asset_Cost();
|
||||
BigDecimal A_Disposal_Amt = bean.getA_Disposal_Amt();
|
||||
BigDecimal coef = Env.ZERO;
|
||||
if (A_Asset_Cost.signum() != 0)
|
||||
{
|
||||
coef = A_Disposal_Amt.divide(A_Asset_Cost, 12, RoundingMode.HALF_UP);
|
||||
}
|
||||
//
|
||||
BigDecimal A_Accumulated_Depr = bean.getA_Accumulated_Depr();
|
||||
BigDecimal A_Accumulated_Depr_Delta = A_Accumulated_Depr.multiply(coef).setScale(precision, RoundingMode.HALF_UP);
|
||||
BigDecimal Expense = A_Disposal_Amt.subtract(A_Accumulated_Depr_Delta);
|
||||
//
|
||||
bean.setA_Accumulated_Depr_Delta(A_Accumulated_Depr_Delta);
|
||||
bean.setExpense(Expense);
|
||||
}
|
||||
|
||||
private void createDisposal()
|
||||
{
|
||||
MDepreciationWorkfile assetwk = MDepreciationWorkfile.get(getCtx(), getA_Asset_ID(), getPostingType(), get_TrxName());
|
||||
assetwk.adjustCost(getA_Disposal_Amt().negate(), Env.ZERO, false);
|
||||
assetwk.adjustAccumulatedDepr(getA_Accumulated_Depr_Delta().negate(), getA_Accumulated_Depr_Delta().negate(), false);
|
||||
assetwk.saveEx();
|
||||
assetwk.buildDepreciation();
|
||||
//
|
||||
// Delete not processed expense entries
|
||||
List<MDepreciationExp> list = MDepreciationExp.getNotProcessedEntries(getCtx(), getA_Asset_ID(), getPostingType(), get_TrxName());
|
||||
for (MDepreciationExp ex : list)
|
||||
{
|
||||
ex.deleteEx(false);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,86 +1,169 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2006 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.sql.ResultSet;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.compiere.util.CCache;
|
||||
import org.compiere.util.DB;
|
||||
|
||||
/**
|
||||
* Asset Group Model
|
||||
*
|
||||
* @author Jorg Janke
|
||||
* @version $Id: MAssetGroup.java,v 1.2 2006/07/30 00:51:05 jjanke Exp $
|
||||
* Asset Group Model
|
||||
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
||||
*/
|
||||
public class MAssetGroup extends X_A_Asset_Group
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** Cache: ID -> MAssetGroup */
|
||||
private static CCache<Integer, MAssetGroup> s_cache = new CCache<Integer, MAssetGroup>(Table_Name, 10, 0);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1364948077775028283L;
|
||||
|
||||
/**
|
||||
* Get from Cache
|
||||
* Default Constructor
|
||||
* @param ctx context
|
||||
* @param A_Asset_Group_ID id
|
||||
* @return category
|
||||
*/
|
||||
public static MAssetGroup get (Properties ctx, int A_Asset_Group_ID)
|
||||
{
|
||||
Integer ii = new Integer (A_Asset_Group_ID);
|
||||
MAssetGroup pc = (MAssetGroup)s_cache.get(ii);
|
||||
if (pc == null)
|
||||
pc = new MAssetGroup (ctx, A_Asset_Group_ID, null);
|
||||
return pc;
|
||||
} // get
|
||||
|
||||
/** Categopry Cache */
|
||||
private static CCache<MAssetGroup, Object> s_cache = new CCache<MAssetGroup, Object> ("A_Asset_Group", 10);
|
||||
|
||||
/**
|
||||
* Standard Constructor
|
||||
* @param ctx context
|
||||
* @param A_Asset_Group_ID id
|
||||
* @param trxName trx
|
||||
* @param A_Asset_Group_ID
|
||||
*/
|
||||
public MAssetGroup (Properties ctx, int A_Asset_Group_ID, String trxName)
|
||||
{
|
||||
super (ctx, A_Asset_Group_ID, trxName);
|
||||
if (A_Asset_Group_ID == 0)
|
||||
{
|
||||
// setName (null);
|
||||
setIsDepreciated (false);
|
||||
setIsOneAssetPerUOM (false);
|
||||
setIsOwned (false);
|
||||
setIsCreateAsActive(true);
|
||||
setIsTrackIssues(false);
|
||||
}
|
||||
super (ctx,A_Asset_Group_ID, trxName);
|
||||
} // MAssetGroup
|
||||
|
||||
|
||||
/**
|
||||
* Load Cosntructor
|
||||
* Load Constructor
|
||||
* @param ctx context
|
||||
* @param rs result set
|
||||
* @param trxName trx
|
||||
*/
|
||||
public MAssetGroup (Properties ctx, ResultSet rs, String trxName)
|
||||
{
|
||||
super (ctx, rs, trxName);
|
||||
super (ctx, rs, trxName);
|
||||
} // MAssetGroup
|
||||
|
||||
/**
|
||||
* Get Asset Group [CACHE]
|
||||
* @param ctx context
|
||||
* @param A_Asset_Group_ID asset group id
|
||||
* @return asset group or null
|
||||
*/
|
||||
public static MAssetGroup get(Properties ctx, int A_Asset_Group_ID)
|
||||
{
|
||||
if (A_Asset_Group_ID <= 0)
|
||||
return null;
|
||||
// Try cache
|
||||
MAssetGroup ag = s_cache.get(A_Asset_Group_ID);
|
||||
if (ag != null)
|
||||
return ag;
|
||||
// Load
|
||||
ag = new MAssetGroup(ctx, A_Asset_Group_ID, null);
|
||||
if (ag != null && ag.get_ID() != A_Asset_Group_ID)
|
||||
ag = null;
|
||||
//
|
||||
return ag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get default asset group ID for given model.
|
||||
* WARNING: trxName = null.
|
||||
* @param m reference model (used to get AD_Client_ID)
|
||||
* @return default asset group ID or 0 if not found
|
||||
*/
|
||||
public static int getDefault_ID(SetGetModel m)
|
||||
{
|
||||
int AD_Client_ID = SetGetUtil.get_AttrValueAsInt(m, "AD_Client_ID");
|
||||
/* commented by @win
|
||||
int A_AssetType_ID = SetGetUtil.get_AttrValueAsInt(m, MAssetType.COLUMNNAME_A_Asset_Type_ID);
|
||||
*/
|
||||
final String sql = "SELECT "+COLUMNNAME_A_Asset_Group_ID
|
||||
+ " FROM "+Table_Name
|
||||
+ " WHERE AD_Client_ID=?"
|
||||
// + " AND NVL("+COLUMNNAME_A_Asset_Type_ID+",0) IN (0,?)" //commented by @win
|
||||
+ " ORDER BY "+COLUMNNAME_IsDefault+" DESC"
|
||||
+", "+COLUMNNAME_A_Asset_Group_ID+" ASC" // default first, older first
|
||||
;
|
||||
/* modify by @win
|
||||
int id = DB.getSQLValueEx(null, sql, AD_Client_ID, A_AssetType_ID);
|
||||
*/
|
||||
int id = DB.getSQLValueEx(null, sql, AD_Client_ID);
|
||||
// modify by @win
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Asset
|
||||
* - updates asset M_AssetGroup_ID if is null
|
||||
*/
|
||||
public static void updateAsset(SetGetModel m, int A_Asset_Group_ID)
|
||||
{
|
||||
/* commented by @win
|
||||
int i = (Integer) m.get_AttrValue(MAsset.COLUMNNAME_A_Asset_Type_ID);
|
||||
MAssetType type = MAssetType.get(m.getCtx(), m.get_AttrValue(MAsset.COLUMNNAME_A_Asset_Type_ID));
|
||||
if (type == null)
|
||||
return;
|
||||
|
||||
if (A_Asset_Group_ID > 0)
|
||||
{
|
||||
if (!type.isFixedAsset())
|
||||
{
|
||||
return;
|
||||
}
|
||||
MAssetGroup assetGrp = MAssetGroup.get(m.getCtx(), A_Asset_Group_ID);
|
||||
int A_Asset_Class_ID = assetGrp.getA_Asset_Class_ID();
|
||||
if (A_Asset_Class_ID > 0)
|
||||
{
|
||||
m.set_AttrValue(MAsset.COLUMNNAME_A_Asset_Class_ID, A_Asset_Class_ID);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
A_Asset_Group_ID = MAssetGroup.getDefault_ID(SetGetUtil.wrap(m));
|
||||
m.set_AttrValue(MAsset.COLUMNNAME_A_Asset_Group_ID, A_Asset_Group_ID);
|
||||
}
|
||||
*/
|
||||
if (A_Asset_Group_ID < 0) {
|
||||
A_Asset_Group_ID = MAssetGroup.getDefault_ID(SetGetUtil.wrap(m));
|
||||
m.set_AttrValue(MAsset.COLUMNNAME_A_Asset_Group_ID, A_Asset_Group_ID);
|
||||
}
|
||||
|
||||
//end modify by @win
|
||||
}
|
||||
|
||||
|
||||
protected boolean beforeSave (boolean newRecord)
|
||||
{
|
||||
/* commented by @win
|
||||
MAssetType type = MAssetType.get(getCtx(), getA_Asset_Type_ID());
|
||||
if (type != null)
|
||||
{
|
||||
type.update(SetGetUtil.wrap(this), newRecord == true);
|
||||
}
|
||||
*/
|
||||
//end commented by @win
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
protected boolean afterSave (boolean newRecord, boolean success)
|
||||
{
|
||||
if(!success)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
//
|
||||
if (newRecord)
|
||||
{
|
||||
// If this is not the default group, then copy accounting settings from default group
|
||||
int default_id = getDefault_ID(SetGetUtil.wrap(this));
|
||||
if (default_id > 0 && default_id != get_ID())
|
||||
{
|
||||
for (MAssetGroupAcct acct : MAssetGroupAcct.forA_Asset_Group_ID(getCtx(), default_id))
|
||||
{
|
||||
MAssetGroupAcct newAcct = acct.copy(this);
|
||||
newAcct.saveEx(get_TrxName());
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
return true;
|
||||
}
|
||||
} // MAssetGroup
|
||||
|
||||
|
|
|
@ -1,48 +1,54 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2006 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.sql.ResultSet;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.compiere.model.Query;
|
||||
import org.idempiere.fa.feature.UseLife;
|
||||
import org.idempiere.fa.feature.UseLifeImpl;
|
||||
|
||||
/**
|
||||
* Asset Addition Model
|
||||
*
|
||||
*
|
||||
* Asset Group Accounting Model
|
||||
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
||||
*/
|
||||
public class MAssetGroupAcct extends X_A_Asset_Group_Acct
|
||||
implements UseLife
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
* Get Asset Group Accountings for given group
|
||||
*/
|
||||
private static final long serialVersionUID = 1097065220838511473L;
|
||||
public static List<MAssetGroupAcct> forA_Asset_Group_ID(Properties ctx, int A_Asset_Group_ID)
|
||||
{
|
||||
return new Query(ctx, Table_Name, COLUMNNAME_A_Asset_Group_ID+"=?", null)
|
||||
.setParameters(new Object[]{A_Asset_Group_ID})
|
||||
.list();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Asset Group Accountings for given group
|
||||
*/
|
||||
public static MAssetGroupAcct forA_Asset_Group_ID(Properties ctx, int A_Asset_Group_ID, String postingType)
|
||||
{
|
||||
final String whereClause = COLUMNNAME_A_Asset_Group_ID+"=? AND "+COLUMNNAME_PostingType+"=?";
|
||||
return new Query(ctx, Table_Name, whereClause, null)
|
||||
.setParameters(new Object[]{A_Asset_Group_ID, postingType})
|
||||
.firstOnly();
|
||||
}
|
||||
|
||||
/**
|
||||
* Default ConstructorX_A_Asset_Group_Acct
|
||||
* @param ctx context
|
||||
* @param M_InventoryLine_ID line
|
||||
* @param X_A_Asset_Group_Acct_ID id
|
||||
*/
|
||||
public MAssetGroupAcct (Properties ctx, int X_A_Asset_Group_Acct_ID, String trxName)
|
||||
{
|
||||
super (ctx,X_A_Asset_Group_Acct_ID, trxName);
|
||||
if (X_A_Asset_Group_Acct_ID == 0)
|
||||
{
|
||||
//
|
||||
}
|
||||
} // MAssetAddition
|
||||
} // MAssetGroupAcct
|
||||
|
||||
/**
|
||||
* Load Constructor
|
||||
* @param ctx context
|
||||
|
@ -51,9 +57,81 @@ public class MAssetGroupAcct extends X_A_Asset_Group_Acct
|
|||
public MAssetGroupAcct (Properties ctx, ResultSet rs, String trxName)
|
||||
{
|
||||
super (ctx, rs, trxName);
|
||||
} // MInventoryLine
|
||||
} // MAssetGroupAcct
|
||||
|
||||
/** Asset Group */
|
||||
private MAssetGroup m_parent = null;
|
||||
|
||||
/**
|
||||
* Get Asset Group
|
||||
*/
|
||||
public MAssetGroup getParent()
|
||||
{
|
||||
if (m_parent == null)
|
||||
{
|
||||
int A_Asset_Group_ID = getA_Asset_Group_ID();
|
||||
if (is_new())
|
||||
{
|
||||
m_parent = new MAssetGroup(getCtx(), A_Asset_Group_ID, get_TrxName());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_parent = MAssetGroup.get(getCtx(), A_Asset_Group_ID);
|
||||
}
|
||||
}
|
||||
return m_parent;
|
||||
}
|
||||
|
||||
/* commented by @win
|
||||
public int getA_Asset_Class_ID()
|
||||
{
|
||||
return getParent().getA_Asset_Class_ID();
|
||||
}
|
||||
*/
|
||||
|
||||
public Timestamp getAssetServiceDate()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clone this object, using specified group
|
||||
* @param grp the new asset group
|
||||
* @return new asset group accounting (NOTE: it's not saved)
|
||||
*/
|
||||
public MAssetGroupAcct copy(MAssetGroup grp)
|
||||
{
|
||||
MAssetGroupAcct newAcct = new MAssetGroupAcct(grp.getCtx(), 0, grp.get_TrxName());
|
||||
copyValues(this, newAcct, grp.getAD_Client_ID(), grp.getAD_Org_ID());
|
||||
newAcct.setA_Asset_Group_ID(grp.getA_Asset_Group_ID());
|
||||
return newAcct;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
} // MAssetAddition
|
||||
public boolean beforeSave(boolean newRecord)
|
||||
{
|
||||
if (! UseLifeImpl.get(this).validate())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean set_AttrValue(String ColumnName, Object value) {
|
||||
int index = get_ColumnIndex(ColumnName);
|
||||
if (index < 0)
|
||||
return false;
|
||||
return set_ValueNoCheck(ColumnName, value);
|
||||
}
|
||||
public Object get_AttrValue(String ColumnName) {
|
||||
int index = get_ColumnIndex(ColumnName);
|
||||
if (index < 0)
|
||||
return null;
|
||||
return get_Value(index);
|
||||
}
|
||||
public boolean is_AttrValueChanged(String ColumnName) {
|
||||
int index = get_ColumnIndex(ColumnName);
|
||||
if (index < 0)
|
||||
return false;
|
||||
return is_ValueChanged(index);
|
||||
}
|
||||
} // MAssetGroupAcct
|
||||
|
|
|
@ -0,0 +1,93 @@
|
|||
package org.compiere.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.compiere.model.Query;
|
||||
|
||||
/**
|
||||
* Asset Product
|
||||
* @author Teo Sarca, SC ARHIPAC SERIVCE SRL
|
||||
*/
|
||||
public class MAssetProduct extends X_A_Asset_Product
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** Standard Constructor */
|
||||
public MAssetProduct (Properties ctx, int A_Asset_Product_ID, String trxName)
|
||||
{
|
||||
super (ctx, A_Asset_Product_ID, trxName);
|
||||
}
|
||||
|
||||
/** Load Constructor */
|
||||
public MAssetProduct (Properties ctx, ResultSet rs, String trxName)
|
||||
{
|
||||
super (ctx, rs, trxName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set product and ASI
|
||||
* @param M_Product_ID
|
||||
* @param M_ASI_ID
|
||||
*/
|
||||
public void setProduct(int M_Product_ID, int M_ASI_ID)
|
||||
{
|
||||
setM_Product_ID(M_Product_ID);
|
||||
setM_AttributeSetInstance_ID(M_ASI_ID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get/Create Asset Product.
|
||||
* Doesn't save newly create one.
|
||||
* @param ctx
|
||||
* @param A_Asset_ID
|
||||
* @param M_Product_ID
|
||||
* @param M_ASI_ID
|
||||
* @param trxName
|
||||
* @return MAssetProduct
|
||||
*/
|
||||
public static MAssetProduct getCreate(Properties ctx,
|
||||
int A_Asset_ID, int M_Product_ID, int M_ASI_ID,
|
||||
String trxName)
|
||||
{
|
||||
if (M_Product_ID <= 0) {
|
||||
return null;
|
||||
}
|
||||
final String whereClause = COLUMNNAME_A_Asset_ID + "=?"
|
||||
+ " AND " + COLUMNNAME_M_Product_ID + "=?"
|
||||
+ " AND " + COLUMNNAME_M_AttributeSetInstance_ID + "=?";
|
||||
MAssetProduct ap = new Query(ctx, MAssetProduct.Table_Name, whereClause, trxName)
|
||||
.setParameters(new Object[]{A_Asset_ID, M_Product_ID, M_ASI_ID})
|
||||
.firstOnly();
|
||||
// If found, return
|
||||
if (ap != null)
|
||||
return ap;
|
||||
|
||||
// Create new
|
||||
ap = new MAssetProduct(ctx, 0, trxName);
|
||||
ap.setA_Asset_ID(A_Asset_ID);
|
||||
ap.setProduct(M_Product_ID, M_ASI_ID);
|
||||
|
||||
return ap;
|
||||
} // get
|
||||
|
||||
/**
|
||||
* Add given qty to current qty
|
||||
* @param qty
|
||||
*/
|
||||
public void addA_Qty_Current(BigDecimal qty)
|
||||
{
|
||||
setA_QTY_Current(getA_QTY_Current().add(qty));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update given asset.
|
||||
* Note: does not save asset
|
||||
*/
|
||||
public void updateAsset(MAsset asset)
|
||||
{
|
||||
asset.setM_Product_ID(getM_Product_ID());
|
||||
asset.setM_AttributeSetInstance_ID(getM_AttributeSetInstance_ID());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,258 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.compiere.model;
|
||||
|
||||
import java.io.File;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.adempiere.exceptions.AdempiereException;
|
||||
import org.compiere.model.MDocType;
|
||||
import org.compiere.model.MPeriod;
|
||||
import org.compiere.model.ModelValidationEngine;
|
||||
import org.compiere.model.ModelValidator;
|
||||
import org.compiere.process.DocAction;
|
||||
import org.compiere.process.DocumentEngine;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.TimeUtil;
|
||||
|
||||
|
||||
/**
|
||||
* @author Anca Bradau www.arhipac.ro
|
||||
*
|
||||
*/
|
||||
public class MAssetReval extends X_A_Asset_Reval
|
||||
implements DocAction
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private boolean m_justPrepared = false;
|
||||
|
||||
public MAssetReval(Properties ctx, int X_A_Asset_Reval_ID, String trxName)
|
||||
{
|
||||
super(ctx, X_A_Asset_Reval_ID, trxName);
|
||||
if (X_A_Asset_Reval_ID == 0)
|
||||
{
|
||||
setDocStatus(DOCSTATUS_Drafted);
|
||||
setDocAction(DOCACTION_Complete);
|
||||
setProcessed(false);
|
||||
}
|
||||
}
|
||||
public MAssetReval(Properties ctx, ResultSet rs, String trxName)
|
||||
{
|
||||
super (ctx, rs, trxName);
|
||||
}
|
||||
|
||||
public boolean approveIt()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean closeIt() {
|
||||
setDocAction(DOCACTION_None);
|
||||
return true;
|
||||
}
|
||||
|
||||
public String prepareIt()
|
||||
{
|
||||
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE);
|
||||
if (m_processMsg != null)
|
||||
{
|
||||
return DocAction.STATUS_Invalid;
|
||||
}
|
||||
// test if period is open
|
||||
MPeriod.testPeriodOpen(getCtx(), getDateAcct(), MDocType.DOCBASETYPE_GLJournal, getAD_Org_ID());
|
||||
|
||||
// test if asset is already Depreciated
|
||||
MDepreciationWorkfile assetwk = MDepreciationWorkfile.get(getCtx(), getA_Asset_ID(), getPostingType());
|
||||
|
||||
if (!assetwk.isDepreciated(getDateAcct()))
|
||||
{
|
||||
throw new AdempiereException("Asset is not depreciated at this moment");
|
||||
|
||||
}
|
||||
|
||||
// test if Asset Cost and Accumulated Depreciation are changed
|
||||
if (assetwk.getA_Asset_Cost().equals(getA_Asset_Cost_Change())
|
||||
&& assetwk.getA_Accumulated_Depr().equals(getA_Change_Acumulated_Depr()))
|
||||
{
|
||||
throw new AdempiereException("Nothing has changed");
|
||||
}
|
||||
|
||||
//test if Asset Cost is changed
|
||||
if (assetwk.getA_Asset_Cost().equals(getA_Asset_Cost_Change())
|
||||
&& !assetwk.getA_Accumulated_Depr().equals(getA_Change_Acumulated_Depr()))
|
||||
{
|
||||
throw new AdempiereException("It has changed the cost of Asset");
|
||||
}
|
||||
|
||||
// test if Accumulated depreciation is changed
|
||||
if (!assetwk.getA_Asset_Cost().equals(getA_Asset_Cost_Change())
|
||||
&& assetwk.getA_Accumulated_Depr().equals(getA_Change_Acumulated_Depr()))
|
||||
{
|
||||
throw new AdempiereException("It has changed the cumulative depreciation");
|
||||
}
|
||||
|
||||
if (!isLastDepreciated(getDateAcct()))
|
||||
{
|
||||
throw new AdempiereException("It can only review the last month processed");
|
||||
}
|
||||
|
||||
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);
|
||||
if (m_processMsg != null)
|
||||
return DocAction.STATUS_Invalid;
|
||||
|
||||
m_justPrepared = true;
|
||||
if (!DOCACTION_Complete.equals(getDocAction()))
|
||||
setDocAction(DOCACTION_Complete);
|
||||
return DocAction.STATUS_InProgress;
|
||||
}
|
||||
//return true if is last record depreciated
|
||||
public boolean isLastDepreciated(Timestamp date)
|
||||
{
|
||||
MDepreciationWorkfile assetwk = MDepreciationWorkfile.get(getCtx(), getA_Asset_ID(), getPostingType());
|
||||
Timestamp lastActionDate = assetwk.getLastActionDate();
|
||||
boolean isLastDepr = TimeUtil.getMonthLastDay(date).equals(lastActionDate);
|
||||
return isLastDepr;
|
||||
|
||||
}
|
||||
|
||||
public String completeIt() {
|
||||
|
||||
if (!m_justPrepared)
|
||||
{
|
||||
String status = prepareIt();
|
||||
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;
|
||||
|
||||
MDepreciationWorkfile assetwk = MDepreciationWorkfile.get(getCtx(), getA_Asset_ID(), getPostingType(), get_TrxName());
|
||||
assetwk.setA_Asset_Cost(getA_Asset_Cost_Change());
|
||||
assetwk.setA_Accumulated_Depr(getA_Change_Acumulated_Depr());
|
||||
assetwk.saveEx();
|
||||
MAsset asset = MAsset.get(getCtx(), getA_Asset_ID(), get_TrxName());
|
||||
asset.setA_Asset_RevalDate(this.getDateDoc());
|
||||
asset.saveEx();
|
||||
//rebuild depreciation
|
||||
/* commented out by @win, deprecating existing design
|
||||
assetwk.buildDepreciation();
|
||||
*/
|
||||
|
||||
// User Validation
|
||||
String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE);
|
||||
if (valid != null)
|
||||
{
|
||||
m_processMsg = valid;
|
||||
return DocAction.STATUS_Invalid;
|
||||
}
|
||||
|
||||
// Set the definite document number after completed (if needed)
|
||||
//setDefiniteDocumentNo();
|
||||
|
||||
setProcessed(true);
|
||||
setDocAction(DOCACTION_Close);
|
||||
return DocAction.STATUS_Completed;
|
||||
}
|
||||
|
||||
public File createPDF()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public BigDecimal getApprovalAmt()
|
||||
{
|
||||
return Env.ZERO;
|
||||
}
|
||||
|
||||
public int getC_Currency_ID()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getDoc_User_ID()
|
||||
{
|
||||
return getCreatedBy();
|
||||
}
|
||||
|
||||
public String getDocumentInfo()
|
||||
{
|
||||
return getDocumentNo() + "/" + getDateAcct();
|
||||
}
|
||||
|
||||
public String getProcessMsg() {
|
||||
return m_processMsg;
|
||||
}
|
||||
private String m_processMsg = null;
|
||||
|
||||
|
||||
public String getSummary()
|
||||
{
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("@DocumentNo@ #").append(getDocumentNo());
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public boolean invalidateIt()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean processIt(String action) throws Exception
|
||||
{
|
||||
m_processMsg = null;
|
||||
DocumentEngine engine = new DocumentEngine (this, getDocStatus());
|
||||
return engine.processIt (action, getDocAction());
|
||||
}
|
||||
|
||||
|
||||
public boolean reActivateIt()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean rejectIt()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean reverseAccrualIt()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean reverseCorrectIt()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean unlockIt()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean voidIt()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public String getDocumentNo()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
/** Before save
|
||||
* @param newRecord
|
||||
* @return true on success
|
||||
*/
|
||||
//protected boolean beforeSave (boolean newRecord)
|
||||
//{
|
||||
//return true;
|
||||
//}
|
||||
|
||||
}
|
|
@ -1,60 +1,267 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2006 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 *
|
||||
* The contents of this file are subject to the Compiere License Version 1.1
|
||||
* ("License"); You may not use this file except in compliance with the License
|
||||
* You may obtain a copy of the License at http://www.compiere.org/license.html
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is Compiere ERP & CRM Smart Business Solution
|
||||
* The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
|
||||
* Portions created by Jorg Janke are Copyright (C) 1999-2003 Jorg Janke, parts
|
||||
* created by ComPiere are Copyright (C) ComPiere, Inc.; All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
*****************************************************************************/
|
||||
package org.compiere.model;
|
||||
|
||||
import java.io.File;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.adempiere.exceptions.AdempiereException;
|
||||
import org.compiere.model.MDocType;
|
||||
import org.compiere.model.MPeriod;
|
||||
import org.compiere.model.ModelValidationEngine;
|
||||
import org.compiere.model.ModelValidator;
|
||||
import org.compiere.model.PO;
|
||||
import org.compiere.process.DocAction;
|
||||
import org.compiere.process.DocumentEngine;
|
||||
import org.compiere.util.Env;
|
||||
import org.idempiere.fa.exceptions.AssetAlreadyDepreciatedException;
|
||||
|
||||
|
||||
/**
|
||||
* Asset Trnasfer Model
|
||||
*
|
||||
* Asset Transfer Model
|
||||
* @author www.arhipac.ro
|
||||
*
|
||||
*/
|
||||
public class MAssetTransfer extends X_A_Asset_Transfer
|
||||
implements DocAction
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 6542200284709386238L;
|
||||
/**
|
||||
* Default ConstructorX_A_Asset_Group_Acct
|
||||
* @param ctx context
|
||||
* @param M_InventoryLine_ID line
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
/** Just Prepared Flag */
|
||||
private boolean m_justPrepared = false;
|
||||
|
||||
public MAssetTransfer (Properties ctx, int X_A_Asset_Transfer_ID, String trxName)
|
||||
{
|
||||
{
|
||||
super (ctx,X_A_Asset_Transfer_ID, trxName);
|
||||
if (X_A_Asset_Transfer_ID == 0)
|
||||
{
|
||||
//
|
||||
setDocStatus(DOCSTATUS_Drafted);
|
||||
setDocAction(DOCACTION_Complete);
|
||||
setProcessed(false);
|
||||
}
|
||||
|
||||
} // MAssetAddition
|
||||
/**
|
||||
* Load Constructor
|
||||
* @param ctx context
|
||||
* @param rs result set
|
||||
*/
|
||||
}
|
||||
|
||||
public MAssetTransfer (Properties ctx, ResultSet rs, String trxName)
|
||||
{
|
||||
super (ctx, rs, trxName);
|
||||
} // MInventoryLine
|
||||
}
|
||||
|
||||
|
||||
protected boolean beforeSave(boolean newRecord)
|
||||
{
|
||||
setC_Period_ID();
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setC_Period_ID()
|
||||
{
|
||||
MPeriod period = MPeriod.get(getCtx(), getDateAcct(), getAD_Org_ID());
|
||||
if (period == null)
|
||||
{
|
||||
throw new AdempiereException("@NotFound@ @C_Period_ID@");
|
||||
}
|
||||
setC_Period_ID(period.get_ID());
|
||||
}
|
||||
|
||||
|
||||
public boolean approveIt() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean closeIt() {
|
||||
setDocAction(DOCACTION_None);
|
||||
return true;
|
||||
}
|
||||
|
||||
public File createPDF() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public BigDecimal getApprovalAmt() {
|
||||
return Env.ZERO;
|
||||
}
|
||||
|
||||
public int getC_Currency_ID() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getDoc_User_ID() {
|
||||
return getCreatedBy();
|
||||
}
|
||||
|
||||
public String getDocumentInfo() {
|
||||
return getDocumentNo() + "/" + getDateAcct();
|
||||
}
|
||||
|
||||
public String getProcessMsg() {
|
||||
return m_processMsg;
|
||||
}
|
||||
private String m_processMsg = null;
|
||||
|
||||
|
||||
public String getSummary() {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("@DocumentNo@ #").append(getDocumentNo());
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public boolean invalidateIt() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String prepareIt()
|
||||
{
|
||||
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE);
|
||||
if (m_processMsg != null)
|
||||
{
|
||||
return DocAction.STATUS_Invalid;
|
||||
}
|
||||
// test if period is open
|
||||
MPeriod.testPeriodOpen(getCtx(), getDateAcct(), MDocType.DOCBASETYPE_GLJournal, getAD_Org_ID());
|
||||
|
||||
MDepreciationWorkfile assetwk = MDepreciationWorkfile.get(getCtx(), getA_Asset_ID(), getPostingType());
|
||||
if (assetwk.isDepreciated(getDateAcct()))
|
||||
{
|
||||
throw new AssetAlreadyDepreciatedException();
|
||||
}
|
||||
|
||||
// Check if the accounts have changed in the meantime
|
||||
MAssetAcct assetAcct = MAssetAcct.forA_Asset_ID(getCtx(), getA_Asset_ID(), getPostingType(), getDateAcct(), get_TrxName());
|
||||
if (assetAcct.getA_Asset_Acct() != getA_Asset_Acct()
|
||||
|| assetAcct.getA_Accumdepreciation_Acct() != getA_Accumdepreciation_Acct()
|
||||
|| assetAcct.getA_Depreciation_Acct() != getA_Depreciation_Acct()
|
||||
|| assetAcct.getA_Disposal_Revenue_Acct() != getA_Disposal_Revenue_Acct()
|
||||
|| assetAcct.getA_Disposal_Loss_Acct() != getA_Disposal_Loss_Acct()
|
||||
)
|
||||
{
|
||||
throw new AdempiereException("The accounts have been changed");
|
||||
}
|
||||
//Check that at least one account is changed
|
||||
{
|
||||
MAssetAcct acct = MAssetAcct.forA_Asset_ID(getCtx(), getA_Asset_ID(), getPostingType(), getDateAcct(), get_TrxName());
|
||||
if (acct.getA_Asset_Acct() == getA_Asset_New_Acct()
|
||||
&& acct.getA_Accumdepreciation_Acct() == getA_Accumdepreciation_New_Acct()
|
||||
&& acct.getA_Depreciation_Acct() == getA_Depreciation_New_Acct()
|
||||
&& acct.getA_Disposal_Revenue_Acct() == getA_Disposal_Revenue_New_Acct()
|
||||
&& acct.getA_Disposal_Loss_Acct() == getA_Disposal_Loss_New_Acct()
|
||||
)
|
||||
{
|
||||
throw new AdempiereException("An account has been changed");
|
||||
}
|
||||
}
|
||||
//doc check if the date is equal to its accounting for the expense table
|
||||
if (assetwk.getDateAcct().equals(getDateAcct()))
|
||||
{
|
||||
throw new AdempiereException("Last day of month. Accounts will be changed next month");
|
||||
}
|
||||
|
||||
//check if they are unprocessed records
|
||||
MDepreciationExp.checkExistsNotProcessedEntries(getCtx(), getA_Asset_ID(), getDateAcct(), getPostingType(), get_TrxName());
|
||||
|
||||
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);
|
||||
if (m_processMsg != null)
|
||||
return DocAction.STATUS_Invalid;
|
||||
|
||||
m_justPrepared = true;
|
||||
if (!DOCACTION_Complete.equals(getDocAction()))
|
||||
setDocAction(DOCACTION_Complete);
|
||||
return DocAction.STATUS_InProgress;
|
||||
}
|
||||
|
||||
|
||||
public String completeIt()
|
||||
{
|
||||
// Re-Check
|
||||
if (!m_justPrepared)
|
||||
{
|
||||
String status = prepareIt();
|
||||
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;
|
||||
|
||||
|
||||
// create new MAssetAcct
|
||||
MAssetAcct assetAcctPrev = MAssetAcct.forA_Asset_ID(getCtx(), getA_Asset_ID(), getPostingType(), getDateAcct(), get_TrxName());
|
||||
MAssetAcct assetAcct = new MAssetAcct(getCtx(), 0, get_TrxName());
|
||||
PO.copyValues(assetAcctPrev, assetAcct);
|
||||
assetAcct.setA_Asset_Acct(getA_Asset_New_Acct());
|
||||
assetAcct.setA_Accumdepreciation_Acct(getA_Accumdepreciation_New_Acct());
|
||||
assetAcct.setValidFrom(getDateAcct());
|
||||
assetAcct.saveEx();
|
||||
|
||||
MDepreciationWorkfile wk = MDepreciationWorkfile.get(getCtx(), getA_Asset_ID(), getPostingType(), get_TrxName());
|
||||
/* commented out by @win, deprecating existing design
|
||||
wk.buildDepreciation();
|
||||
*/
|
||||
|
||||
// User Validation
|
||||
String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE);
|
||||
if (valid != null)
|
||||
{
|
||||
m_processMsg = valid;
|
||||
return DocAction.STATUS_Invalid;
|
||||
}
|
||||
|
||||
// Set the definite document number after completed (if needed)
|
||||
//setDefiniteDocumentNo();
|
||||
|
||||
setProcessed(true);
|
||||
setDocAction(DOCACTION_Close);
|
||||
return DocAction.STATUS_Completed;
|
||||
}
|
||||
|
||||
|
||||
public boolean processIt(String action) throws Exception {
|
||||
m_processMsg = null;
|
||||
DocumentEngine engine = new DocumentEngine (this, getDocStatus());
|
||||
return engine.processIt (action, getDocAction());
|
||||
}
|
||||
|
||||
public boolean reActivateIt() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean rejectIt() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean reverseAccrualIt() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean reverseCorrectIt() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean unlockIt() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean voidIt() {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // MAssetAddition
|
||||
|
||||
public String getDocumentNo() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
} // MAssetTransfer
|
||||
|
|
|
@ -0,0 +1,231 @@
|
|||
package org.compiere.model;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.compiere.model.CalloutEngine;
|
||||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.Query;
|
||||
import org.compiere.util.ArhRuntimeException;
|
||||
import org.compiere.util.CCache;
|
||||
import org.compiere.util.Env;
|
||||
|
||||
/**
|
||||
* Asset Type
|
||||
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
||||
*/
|
||||
public class MAssetType extends X_A_Asset_Type
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String A_ASSET_TYPE_MFX = "MFX";
|
||||
public static final String A_ASSET_TYPE_INV = "INV";
|
||||
|
||||
public static final int A_ASSET_TYPE_ID_MFX = 1;
|
||||
public static final int A_ASSET_TYPE_ID_INV = 2;
|
||||
public static final int A_ASSET_TYPE_ID_SUP = 3;
|
||||
/** Obiecte tert */
|
||||
public static final int A_ASSET_TYPE_ID_OIN = 4;
|
||||
|
||||
public static interface Model
|
||||
{
|
||||
/** Get Context */
|
||||
public Properties getCtx();
|
||||
/** Get Asset Type */
|
||||
public int getA_Asset_Type_ID();
|
||||
/** Get In Possession. The asset is in the possession of the organization */
|
||||
public boolean isInPosession();
|
||||
/** Get Owned. The asset is owned by the organization */
|
||||
public boolean isOwned();
|
||||
/** Get Is Depreciated */
|
||||
public boolean isDepreciated();
|
||||
};
|
||||
|
||||
/** Static Cache: A_Asset_Type.A_Asset_Type_ID-> MAssetType */
|
||||
private static CCache<Integer,MAssetType> s_cache = new CCache<Integer,MAssetType>(Table_Name, 10, 0);
|
||||
|
||||
/** Get Asset Type
|
||||
* @param ctx context
|
||||
* @param A_Asset_Type_ID
|
||||
* @return asset type object
|
||||
*/
|
||||
public static MAssetType get (Properties ctx, int A_Asset_Type_ID)
|
||||
{
|
||||
if (A_Asset_Type_ID <= 0)
|
||||
return null;
|
||||
MAssetType o = s_cache.get(A_Asset_Type_ID);
|
||||
if (o != null)
|
||||
return o;
|
||||
o = new MAssetType(ctx, A_Asset_Type_ID, null);
|
||||
if (o.get_ID() > 0) {
|
||||
s_cache.put(A_Asset_Type_ID, o);
|
||||
return o;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/** Get Asset Type
|
||||
* @param ctx context
|
||||
* @param id id as Number
|
||||
* @return asset type object
|
||||
*/
|
||||
public static MAssetType get (Properties ctx, Object id)
|
||||
{
|
||||
if (id == null)
|
||||
return null;
|
||||
return get(ctx, ((Number)id).intValue());
|
||||
}
|
||||
|
||||
/** Standard Constructor */
|
||||
public MAssetType (Properties ctx, int A_Asset_Type_ID, String trxName)
|
||||
{
|
||||
super (ctx, A_Asset_Type_ID, trxName);
|
||||
}
|
||||
|
||||
/** Load Constructor */
|
||||
public MAssetType (Properties ctx, ResultSet rs, String trxName)
|
||||
{
|
||||
super (ctx, rs, trxName);
|
||||
}
|
||||
|
||||
/** Is Fixed Asset
|
||||
*/
|
||||
public boolean isFixedAsset()
|
||||
{
|
||||
return A_ASSET_TYPE_MFX.equals(getValue());
|
||||
}
|
||||
|
||||
public static boolean isFixedAsset(int A_Asset_ID)
|
||||
{
|
||||
final String whereClause = MAsset.COLUMNNAME_A_Asset_ID+"=?"
|
||||
+" AND "+MAsset.COLUMNNAME_A_AssetType+"=?";
|
||||
|
||||
return new Query(Env.getCtx(), MAsset.Table_Name, whereClause, null)
|
||||
.setParameters(new Object[]{A_Asset_ID, A_ASSET_TYPE_MFX})
|
||||
.match();
|
||||
}
|
||||
|
||||
public static boolean isFixedAsset(MAsset asset)
|
||||
{
|
||||
return asset != null && A_ASSET_TYPE_MFX.equals(asset.getA_Asset_Type());
|
||||
}
|
||||
|
||||
public static boolean isFixedAssetGroup(Properties ctx, int A_Asset_Group_ID)
|
||||
{
|
||||
if (A_Asset_Group_ID <= 0)
|
||||
return false;
|
||||
MAssetGroup assetGroup = MAssetGroup.get(ctx, A_Asset_Group_ID);
|
||||
//
|
||||
int assetType_ID = assetGroup.getA_Asset_Type_ID();
|
||||
if (assetType_ID <= 0)
|
||||
return false;
|
||||
MAssetType assetType = MAssetType.get(ctx, assetType_ID);
|
||||
//
|
||||
return assetType.isFixedAsset();
|
||||
}
|
||||
|
||||
/** Is Inventory Object
|
||||
*/
|
||||
public boolean isInventoryObject() {
|
||||
return A_ASSET_TYPE_INV.equals(getValue());
|
||||
}
|
||||
|
||||
/** Convert an Yes-No-Unknown field to Boolean */
|
||||
protected static Boolean getBoolean (String value, boolean useDefaults)
|
||||
{
|
||||
if (value == null || value.length() == 0)
|
||||
return null;
|
||||
String f = value.substring(0, 1);
|
||||
if ("N".equals(f))
|
||||
return Boolean.FALSE;
|
||||
else if ("Y".equals(f))
|
||||
return Boolean.TRUE;
|
||||
else if ("X".equals(f) && useDefaults)
|
||||
return getBoolean(value.substring(1), false);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate a Model
|
||||
* @param m model
|
||||
* @thorows ContextUserException
|
||||
*/
|
||||
public static void validate(Model m)
|
||||
{
|
||||
// Load Asset Type
|
||||
MAssetType assetType = MAssetType.get(m.getCtx(), m.getA_Asset_Type_ID());
|
||||
if (assetType == null)
|
||||
{
|
||||
throw new ArhRuntimeException(m.getCtx(), "@NotFound@ @A_Asset_Type_ID@")
|
||||
.addInfo("@A_Asset_Type_ID", m.getA_Asset_Type_ID());
|
||||
}
|
||||
|
||||
ArhRuntimeException err = new ArhRuntimeException(m.getCtx(), "");
|
||||
Boolean f = getBoolean(assetType.getIsOwned(), false);
|
||||
if (f != null && f.booleanValue() != m.isOwned()) {
|
||||
err.addInfo("@IsOwned@ <> @" + f + "@");
|
||||
}
|
||||
f = getBoolean(assetType.getIsInPosession(), false);
|
||||
if (f != null && f.booleanValue() != m.isInPosession()) {
|
||||
err.addInfo("@IsInPosession@ <> @" + f + "@");
|
||||
}
|
||||
f = getBoolean(assetType.getIsDepreciable(), false);
|
||||
if (f != null && f.booleanValue() != m.isDepreciated()) {
|
||||
err.addInfo("@IsDepreciated@ <> @" + f + "@");
|
||||
}
|
||||
|
||||
if (err.hasInfo())
|
||||
throw err;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the given SetGetModel; Does not set A_Asset_Type_ID
|
||||
* @param model
|
||||
* @param useDefaults in case is not a concrete value, use defaults
|
||||
*/
|
||||
public boolean update(SetGetModel model, boolean useDefaults)
|
||||
{
|
||||
// boolean useDefaults = true;
|
||||
Boolean f = getBoolean(getIsOwned(), useDefaults);
|
||||
if (f != null)
|
||||
model.set_AttrValue("IsOwned", f);
|
||||
f = getBoolean(getIsInPosession(), useDefaults);
|
||||
if (f != null)
|
||||
model.set_AttrValue("IsInPosession", f);
|
||||
f = getBoolean(getIsDepreciable(), useDefaults);
|
||||
if (f != null) {
|
||||
model.set_AttrValue("IsDepreciated", f);
|
||||
}
|
||||
|
||||
if (!isFixedAsset()) {
|
||||
model.set_AttrValue("A_Asset_Class_ID", null);
|
||||
}
|
||||
|
||||
model.set_AttrValue("A_Asset_Type", getValue());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Callout Class */
|
||||
public static class Callout extends CalloutEngine
|
||||
{
|
||||
public String assetType(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value) {
|
||||
if (isCalloutActive())
|
||||
return "";
|
||||
|
||||
int A_Asset_Type_ID = 0;
|
||||
if (value != null && value instanceof Number)
|
||||
A_Asset_Type_ID = ((Number)value).intValue();
|
||||
else
|
||||
return "";
|
||||
MAssetType assetType = MAssetType.get(ctx, A_Asset_Type_ID);
|
||||
if (assetType != null)
|
||||
assetType.update(SetGetUtil.wrap(mTab), true);
|
||||
//
|
||||
return "";
|
||||
}
|
||||
};
|
||||
|
||||
} // class MAssetType
|
|
@ -1,36 +1,14 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2006 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 *
|
||||
* Copyright (C) 2005 Robert KLEIN. robeklein@gmail.com *
|
||||
* Contributor(s): ______________________________________.
|
||||
*****************************************************************************/
|
||||
|
||||
package org.compiere.model;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.compiere.model.MRefList;
|
||||
import org.compiere.util.DB;
|
||||
/** Generated Model for A_Asset_Use
|
||||
** @version $Id: X_A_Asset.java,v 1.88 2004/08/27 21:26:37 jjanke Exp $ */
|
||||
public class MAssetUse extends X_A_Asset_Use
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -1247516669047870893L;
|
||||
|
||||
public MAssetUse (Properties ctx, int A_Asset_Use_ID, String trxName)
|
||||
{
|
||||
super (ctx, A_Asset_Use_ID, trxName);
|
||||
|
@ -65,9 +43,9 @@ protected boolean afterSave (boolean newRecord,boolean success)
|
|||
|
||||
|
||||
String sql = "SELECT SUM(USEUNITS) FROM A_Asset_use WHERE A_Asset_ID=? and usedate <= SYSDATE";
|
||||
total_unitsused = DB.getSQLValue(null, sql, getA_Asset_ID());
|
||||
total_unitsused = DB.getSQLValueEx(null, sql, getA_Asset_ID());
|
||||
|
||||
MAsset asset = new MAsset (getCtx(), p_A_Asset_ID, null);
|
||||
MAsset asset = MAsset.get(getCtx(), p_A_Asset_ID, null);
|
||||
asset.setUseUnits(total_unitsused);
|
||||
asset.setProcessing(false);
|
||||
asset.saveEx();
|
||||
|
|
|
@ -0,0 +1,103 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.compiere.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
import org.compiere.util.CLogMgt;
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.Env;
|
||||
import org.idempiere.exceptions.NoCurrencyConversionException;
|
||||
|
||||
/**
|
||||
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
||||
*/
|
||||
public final class MConversionRateUtil
|
||||
{
|
||||
/** Logger */
|
||||
private static final CLogger s_log = CLogger.getCLogger (MConversionRateUtil.class);
|
||||
|
||||
private MConversionRateUtil()
|
||||
{
|
||||
// nothing
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an amount to base currency and update model fields (CurrencyRate, "AmtName").
|
||||
* @param model
|
||||
* @param DateName conversion date field name
|
||||
* @param SourceAmtName source amount field name
|
||||
* @param AmtName converted amount field name (optional); if null then the converted amount field will not be updated
|
||||
* @param changedColumnName the column that has changed (the controller); optional
|
||||
* @return converted amount or null if error
|
||||
*/
|
||||
public static BigDecimal convertBase(SetGetModel model, String DateName,
|
||||
String SourceAmtName, String AmtName, String changedColumnName)
|
||||
{
|
||||
// If Currency changed, reset rate
|
||||
if (changedColumnName != null && "C_Currency_ID".equalsIgnoreCase(changedColumnName))
|
||||
{
|
||||
model.set_AttrValue("CurrencyRate", Env.ZERO);
|
||||
}
|
||||
|
||||
// Source Amount
|
||||
BigDecimal sourceAmt = SetGetUtil.get_AttrValueAsBigDecimal(model, SourceAmtName);
|
||||
if (sourceAmt == null || sourceAmt.signum() == 0)
|
||||
{
|
||||
if (AmtName != null)
|
||||
{
|
||||
model.set_AttrValue(AmtName, Env.ZERO);
|
||||
}
|
||||
return Env.ZERO;
|
||||
}
|
||||
|
||||
// AD_Client_ID
|
||||
int AD_Client_ID = SetGetUtil.get_AttrValueAsInt(model, "AD_Client_ID");
|
||||
|
||||
// Currency To
|
||||
int C_Currency_ID_To = MClient.get(model.getCtx(), AD_Client_ID).getAcctSchema().getC_Currency_ID();
|
||||
//~ model.set_AttrValue("C_Currency_ID_To", Integer.valueOf(C_Currency_ID_To));
|
||||
|
||||
// Get Rate
|
||||
BigDecimal rate = SetGetUtil.get_AttrValueAsBigDecimal(model, "CurrencyRate");
|
||||
if (rate == null || rate.signum() == 0)
|
||||
{
|
||||
int AD_Org_ID = SetGetUtil.get_AttrValueAsInt(model, "AD_Client_ID");
|
||||
Timestamp ConvDate = SetGetUtil.get_AttrValueAsDate(model, DateName);
|
||||
int C_Currency_ID = SetGetUtil.get_AttrValueAsInt(model, "C_Currency_ID");
|
||||
if (C_Currency_ID == C_Currency_ID_To)
|
||||
{
|
||||
rate = Env.ONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
int C_ConversionType_ID = SetGetUtil.get_AttrValueAsInt(model, "C_ConversionType_ID");
|
||||
rate = MConversionRate.getRate (C_Currency_ID, C_Currency_ID_To,
|
||||
ConvDate, C_ConversionType_ID,
|
||||
AD_Client_ID, AD_Org_ID);
|
||||
if (rate == null)
|
||||
{ // NoCurrencyConversion
|
||||
throw new NoCurrencyConversionException(C_Currency_ID, C_Currency_ID_To,
|
||||
ConvDate, C_ConversionType_ID,
|
||||
AD_Client_ID, AD_Org_ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
model.set_AttrValue("CurrencyRate", rate);
|
||||
|
||||
// Calculate converted amount
|
||||
BigDecimal amt = sourceAmt.multiply(rate);
|
||||
int stdPrecision = MCurrency.getStdPrecision(model.getCtx(), C_Currency_ID_To);
|
||||
amt = amt.setScale(stdPrecision, RoundingMode.HALF_UP);
|
||||
|
||||
// Update model
|
||||
if (AmtName != null)
|
||||
model.set_AttrValue(AmtName, amt);
|
||||
// Return amt
|
||||
if (CLogMgt.isLevelFine()) s_log.fine("amt=" + sourceAmt + " * " + rate + "=" + amt + ", scale=" + stdPrecision);
|
||||
return amt;
|
||||
} // convert
|
||||
}
|
|
@ -0,0 +1,469 @@
|
|||
package org.compiere.model;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.Properties;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.compiere.model.Query;
|
||||
import org.compiere.util.CCache;
|
||||
import org.compiere.util.CLogMgt;
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.Env;
|
||||
import org.idempiere.fa.exceptions.AssetNotImplementedException;
|
||||
import org.idempiere.fa.exceptions.AssetNotSupportedException;
|
||||
|
||||
|
||||
/**
|
||||
* Depreciation Engine (eg. SL, ARH_VAR ...)
|
||||
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
||||
*/
|
||||
public class MDepreciation extends X_A_Depreciation
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** Standard Constructor */
|
||||
public MDepreciation (Properties ctx, int A_Depreciation_ID, String trxName)
|
||||
{
|
||||
super (ctx, A_Depreciation_ID, trxName);
|
||||
} // MDepreciation
|
||||
|
||||
/**
|
||||
* Load Constructor
|
||||
* @param ctx context
|
||||
* @param rs result set record
|
||||
*/
|
||||
public MDepreciation (Properties ctx, ResultSet rs, String trxName)
|
||||
{
|
||||
super (ctx, rs, trxName);
|
||||
} // MDepreciation
|
||||
|
||||
/** Cache */
|
||||
private static CCache<Integer,MDepreciation>
|
||||
s_cache = new CCache<Integer,MDepreciation>(Table_Name, 5);
|
||||
/** Cache for type */
|
||||
private static CCache<String,MDepreciation>
|
||||
s_cache_forType = new CCache<String,MDepreciation>(Table_Name+"_DepreciationType", 5);
|
||||
/** Static logger */
|
||||
private static Logger s_log = CLogger.getCLogger(MDepreciation.class);
|
||||
/** The accuracy of calculation on depreciation */
|
||||
private final static int m_precision = 2;
|
||||
|
||||
/* Constrants */
|
||||
private static final BigDecimal BD_12 = BigDecimal.valueOf(12);
|
||||
|
||||
private static void addToCache(MDepreciation depr)
|
||||
{
|
||||
if (depr == null)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
s_cache.put(depr.get_ID(), depr);
|
||||
String key = "" + depr.getAD_Client_ID() + "_" + depr.getDepreciationType();
|
||||
s_cache_forType.put(key, depr);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Depreciation method
|
||||
* @param ctx
|
||||
* @param A_Depreciation_ID depreciation id
|
||||
*/
|
||||
public static MDepreciation get(Properties ctx, int A_Depreciation_ID)
|
||||
{
|
||||
MDepreciation depr = s_cache.get(A_Depreciation_ID);
|
||||
if (depr != null)
|
||||
{
|
||||
return depr;
|
||||
}
|
||||
depr = new MDepreciation(ctx, A_Depreciation_ID, null);
|
||||
if (depr.get_ID() > 0)
|
||||
{
|
||||
addToCache(depr);
|
||||
}
|
||||
else
|
||||
{
|
||||
depr = null;
|
||||
}
|
||||
return depr;
|
||||
} // get
|
||||
|
||||
/**
|
||||
* Get Depreciation method
|
||||
* @param ctx
|
||||
* @param depreciationType depreciation type (e.g. SL)
|
||||
*/
|
||||
public static MDepreciation get(Properties ctx, String depreciationType)
|
||||
{
|
||||
int AD_Client_ID = Env.getAD_Client_ID(ctx);
|
||||
String key = "" + AD_Client_ID + "_" + depreciationType;
|
||||
MDepreciation depr = s_cache_forType.get(key);
|
||||
if (depr != null)
|
||||
{
|
||||
return depr;
|
||||
}
|
||||
|
||||
final String whereClause = COLUMNNAME_DepreciationType+"=?"
|
||||
+" AND AD_Client_ID IN (0,?)";
|
||||
depr = new Query(ctx, Table_Name, whereClause, null)
|
||||
.setOrderBy("AD_Client_ID DESC")
|
||||
.setParameters(new Object[]{depreciationType, AD_Client_ID})
|
||||
.firstOnly();
|
||||
addToCache(depr);
|
||||
return depr;
|
||||
} // get
|
||||
|
||||
/**
|
||||
* Returns the precision of calculation of depreciation
|
||||
* @return accuracy of calculation of depreciation
|
||||
*/
|
||||
public static int getPrecision()
|
||||
{
|
||||
return m_precision;
|
||||
}
|
||||
|
||||
/**
|
||||
* Needs to be adjusted in last month's amortization
|
||||
*/
|
||||
public boolean requireLastPeriodAdjustment()
|
||||
{
|
||||
return !"ARH_ZERO".equals(getDepreciationType());
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the value of depreciation over time
|
||||
* @param assetwk - Fixed Assets worksheet
|
||||
* @param assetAcct - FA default accounting elements
|
||||
* @param A_Current_Period - current period
|
||||
* @param Accum_Dep accumulated depreciation until present period
|
||||
* @return amortized value
|
||||
*/
|
||||
public BigDecimal invoke(MDepreciationWorkfile assetwk, MAssetAcct assetAcct,
|
||||
int A_Current_Period, BigDecimal Accum_Dep)
|
||||
{
|
||||
String depreciationType = getDepreciationType();
|
||||
BigDecimal retValue = null;
|
||||
//~ int offset = getFixMonthOffset();
|
||||
//~ A_Current_Period += offset;
|
||||
|
||||
if(CLogMgt.isLevelFinest())
|
||||
{
|
||||
log.fine("Entering: DepreciationType=" + depreciationType
|
||||
+ ", assetwk=" + assetwk+ ", assetacct=" + assetAcct
|
||||
+ ", A_Current_Period=" + A_Current_Period //+ " (offset=" + offset + ")"
|
||||
+ ", Accum_Dep=" + Accum_Dep
|
||||
);
|
||||
}
|
||||
|
||||
if (!canInvoke(assetwk, assetAcct, A_Current_Period, Accum_Dep))
|
||||
{
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
if (depreciationType.equalsIgnoreCase("SL"))
|
||||
{
|
||||
retValue = apply_SL(assetwk, assetAcct, A_Current_Period, Accum_Dep);
|
||||
}
|
||||
else if (depreciationType.equalsIgnoreCase("ARH_VAR"))
|
||||
{
|
||||
retValue = apply_ARH_VAR(assetwk, assetAcct, A_Current_Period, Accum_Dep);
|
||||
}
|
||||
else if (depreciationType.equalsIgnoreCase("ARH_AD1"))
|
||||
{
|
||||
retValue = apply_ARH_AD1(assetwk, assetAcct, A_Current_Period, Accum_Dep);
|
||||
}
|
||||
else if (depreciationType.equalsIgnoreCase("ARH_AD2"))
|
||||
{
|
||||
retValue = apply_ARH_AD2(assetwk, assetAcct, A_Current_Period, Accum_Dep);
|
||||
}
|
||||
else if (depreciationType.equalsIgnoreCase("ARH_ZERO"))
|
||||
{
|
||||
retValue = apply_ARH_ZERO(assetwk, assetAcct, A_Current_Period, Accum_Dep);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new AssetNotSupportedException(COLUMNNAME_DepreciationType, depreciationType);
|
||||
}
|
||||
//
|
||||
if (retValue == null)
|
||||
{
|
||||
retValue = BigDecimal.ZERO;
|
||||
}
|
||||
retValue = retValue.setScale(getPrecision(), RoundingMode.HALF_UP);
|
||||
//
|
||||
if(CLogMgt.isLevelFinest()) log.fine("Leaving: retValue=" + retValue);
|
||||
return retValue;
|
||||
} // invoke
|
||||
|
||||
/**
|
||||
* Check if the method can be invoked to give parameters
|
||||
* @param assetwk
|
||||
* @param assetAcct
|
||||
* @param A_Current_Period between 0 to UseLifeMonths - 1
|
||||
* @param Accum_Dep
|
||||
*/
|
||||
public boolean canInvoke(MDepreciationWorkfile assetwk, MAssetAcct assetAcct,
|
||||
int A_Current_Period, BigDecimal Accum_Dep)
|
||||
{
|
||||
//~ MDepreciationWorkfile wk = MDepreciationWorkfile.get(getCtx(), A_Asset_ID, PostingType);
|
||||
if (assetwk == null)
|
||||
{
|
||||
log.warning("@NotFound@ @A_Depreciation_Workfile_ID@");
|
||||
return false;
|
||||
}
|
||||
//TODO review this method - red1
|
||||
int offset = 0 ; //getFixMonthOffset(); this field does not exist in AD nor DB but exists in X_. - red1
|
||||
int lifePeriods = assetwk.getUseLifeMonths(assetwk.isFiscal());
|
||||
boolean ok = (offset <= A_Current_Period);
|
||||
|
||||
if(CLogMgt.isLevelFinest()) log.finest("A_Current_Period=" + A_Current_Period + ", lifePeriods=" + lifePeriods + " (offset=" + offset + ") ==> OK=" + ok);
|
||||
return ok;
|
||||
} // canInvoke
|
||||
|
||||
/**
|
||||
* Without depreciation
|
||||
* @param A_Asset_ID Assets IDs (ignored)
|
||||
* @param A_Current_Period current period (in months, between 0 and UseLifeMonths - 1) (ignored)
|
||||
* @param PostingType posting type (eg. A - Actual, S - Statistics ...) (ignored)
|
||||
* @param A_Asset_Acct_ID FA accounting IDs (see table A_Asset_Acct) (ignored)
|
||||
* @param Accum_Dep Accumulated depreciation from this method (ignored)
|
||||
* @return Env.ZERO
|
||||
*/
|
||||
private BigDecimal apply_ARH_ZERO (MDepreciationWorkfile wk, MAssetAcct assetAcct,
|
||||
int A_Current_Period, BigDecimal Accum_Dep)
|
||||
{
|
||||
return Env.ZERO;
|
||||
}
|
||||
|
||||
/** Linear depreciation regime
|
||||
* @param A_Asset_ID Assets IDs
|
||||
* @param A_Current_Period current period (in months, between 0 and UseLifeMonths - 1)
|
||||
* @param PostingType posting type (eg. A - Actual, S - Statistics ...)
|
||||
* @param A_Asset_Acct_ID FA accounting IDs (see table A_Asset_Acct)
|
||||
* @param Accum_Dep Accumulated depreciation from this method
|
||||
* @return depreciation for the current month
|
||||
*/
|
||||
private BigDecimal apply_SL (MDepreciationWorkfile wk, MAssetAcct assetAcct,
|
||||
int A_Current_Period, BigDecimal Accum_Dep)
|
||||
{
|
||||
BigDecimal remainingPeriods = new BigDecimal(wk.getRemainingPeriods(A_Current_Period - 1));
|
||||
BigDecimal remainingAmt = wk.getRemainingCost(Accum_Dep);
|
||||
BigDecimal amtPerPeriod = Env.ZERO;
|
||||
if (remainingPeriods.signum() != 0)
|
||||
{
|
||||
amtPerPeriod = remainingAmt.divide(remainingPeriods, getPrecision(), RoundingMode.HALF_UP);
|
||||
}
|
||||
|
||||
if(CLogMgt.isLevelFinest())
|
||||
{
|
||||
log.finest("currentPeriod=" + A_Current_Period + ", remainingAmt=" + remainingAmt + ", remainingPeriods=" + remainingPeriods + " => amtPerPeriod=" + amtPerPeriod);
|
||||
}
|
||||
|
||||
return amtPerPeriod;
|
||||
}
|
||||
|
||||
/**
|
||||
* Accelerated depreciation regime
|
||||
* @param A_Current_Period current period (in months, between 0 and UseLifeMonths - 1)
|
||||
* @param PostingType posting type (eg. A - Actual, S - Statistics ...)
|
||||
* @param A_Asset_Acct_ID FA accounting IDs (see table A_Asset_Acct)
|
||||
* @param Accum_Dep Accumulated depreciation from this method
|
||||
* @return depreciation for the current month
|
||||
*/
|
||||
private BigDecimal apply_ARH_VAR (MDepreciationWorkfile wk, MAssetAcct acct,
|
||||
int A_Current_Period, BigDecimal Accum_Dep)
|
||||
{
|
||||
BigDecimal amt = wk.getActualCost();
|
||||
BigDecimal varPercent = acct.getA_Depreciation_Variable_Perc(wk.isFiscal()).setScale(getPrecision(), RoundingMode.HALF_UP);
|
||||
//~ int lifePeriods = wk.getUseLifeMonths(wk.isFiscal());
|
||||
BigDecimal assetExp = BigDecimal.ZERO;
|
||||
|
||||
// First time in first year
|
||||
if (A_Current_Period == 0)
|
||||
{
|
||||
assetExp = amt.multiply(varPercent);
|
||||
}
|
||||
// Periods of the first year (without first)
|
||||
else if (A_Current_Period < 12)
|
||||
{
|
||||
// do nothing;
|
||||
}
|
||||
// Following periods
|
||||
else
|
||||
{
|
||||
BigDecimal remainingAmt = wk.getRemainingCost(Accum_Dep);
|
||||
BigDecimal remainingPeriods = new BigDecimal(wk.getRemainingPeriods(A_Current_Period));
|
||||
assetExp = remainingAmt.divide(remainingPeriods, getPrecision(), RoundingMode.HALF_UP);
|
||||
// logging
|
||||
if (CLogMgt.isLevelFinest()) {
|
||||
log.fine("remainingAmt=" + remainingAmt + ", remainingPeriods=" + remainingPeriods+ " => assetExp=" + assetExp);
|
||||
}
|
||||
}
|
||||
|
||||
return assetExp;
|
||||
}
|
||||
|
||||
|
||||
/** Digressive depreciation regime (AD1)
|
||||
* @param A_Current_Period current period (in months, between 0 and UseLifeMonths - 1)
|
||||
* @param PostingType posting type (eg. A - Actual, S - Statistics ...)
|
||||
* @param A_Asset_Acct_ID FA accounting IDs (see table A_Asset_Acct)
|
||||
* @param Accum_Dep Accumulated depreciation from this method
|
||||
* @return depreciation for the current month
|
||||
* TODO RE TEST IT!
|
||||
*/
|
||||
private BigDecimal apply_ARH_AD1(MDepreciationWorkfile wk, MAssetAcct assetAcct, int A_Current_Period,BigDecimal Accum_Dep)
|
||||
{
|
||||
//~ /** Current Worksheet */
|
||||
//~ MDepreciationWorkfile wk = MDepreciationWorkfile.get(getCtx(), A_Asset_ID, PostingType);
|
||||
|
||||
/** FAs' value = acquisition value - the amount recovered */
|
||||
BigDecimal assetAmt = wk.getActualCost();
|
||||
/** Life in months */
|
||||
int A_Life_Period = wk.getA_Life_Period();
|
||||
/** Year = integer part of (current period / 12) => first year will be 0 */
|
||||
int A_Current_Year = (int)(A_Current_Period / 12);
|
||||
/** Life in years = integer part of (the life in months / 12) => first year will be 0 */
|
||||
int A_Life_Year = (int)(A_Life_Period / 12);
|
||||
//~ /** Number of years of use remaining (including current year) */
|
||||
//~ int A_RemainingLife_Year = A_Life_Year - A_Current_Year;
|
||||
|
||||
|
||||
/** Coefficient K */
|
||||
/* @win : looks like a country specific requirement
|
||||
BigDecimal coef_K = get_AD_K(A_Life_Year);
|
||||
*/
|
||||
|
||||
/** Linear damping coefficient for one year = 1 / total number of years */
|
||||
BigDecimal coef_sl = BigDecimal.ONE.divide(new BigDecimal(A_Life_Year), getPrecision() + 2, RoundingMode.DOWN);
|
||||
/** Degressive damping coefficient for one year = one-year linear depreciation * coeficient K */
|
||||
//BigDecimal coef_ad1 = coef_sl.multiply(coef_K); //commented by @win
|
||||
BigDecimal coef_ad1 = coef_sl.multiply(new BigDecimal(2.0)); //added by @win
|
||||
|
||||
/** AD2 */
|
||||
//~ BigDecimal DUR = BD_100.multiply(
|
||||
|
||||
// logging
|
||||
if (CLogMgt.isLevelFinest()) {
|
||||
log.fine("assetAmt=" + assetAmt + ", A_Life_Period=" + A_Life_Period);
|
||||
log.fine("A_Current_Year=" + A_Current_Year + ", A_Life_Year=" + A_Life_Year);
|
||||
//log.fine("coef_K=" + coef_K + ", coef_sl=" + coef_sl + ", coef_ad1=" + coef_ad1); //commented out by @win
|
||||
}
|
||||
|
||||
/** Depreciation for the current year, is calculated below */
|
||||
BigDecimal amtPerYear = BigDecimal.ZERO;
|
||||
/** They went on linear depreciation */
|
||||
boolean is_SL = false;
|
||||
/** Year linear depreciation = depreciation remaining / number of years remaining (including this year) */
|
||||
BigDecimal amt_sl = BigDecimal.ZERO;
|
||||
/** Remaining depreciation */
|
||||
BigDecimal amt_r = assetAmt;
|
||||
|
||||
for (int curr_year = 0; curr_year <= A_Current_Year; curr_year++) {
|
||||
if (!is_SL) {
|
||||
/** Number of years of use remaining (including current year) */
|
||||
int A_RemainingLife_Year = A_Life_Year - curr_year;
|
||||
/** Degressive current year depreciation */
|
||||
BigDecimal amt_ad1 = amt_r.multiply(coef_ad1);
|
||||
/** Year linear depreciation = depreciation remaining / number of years remaining (including this year) */
|
||||
amt_sl = amt_r.divide(new BigDecimal(A_RemainingLife_Year), getPrecision(), RoundingMode.HALF_UP);
|
||||
// logging
|
||||
if (CLogMgt.isLevelFinest()) {
|
||||
s_log.fine("amt_r=" + amt_r + ", amt_ad1=amt_r*coef_ad1=" + amt_ad1 + ", amt_sl=amt_r/A_RemainingLife_Year=" + amt_sl + ", A_Current_Year=" + A_Current_Year + ", A_RemainingLife_Year=" + A_RemainingLife_Year);
|
||||
}
|
||||
|
||||
/** If the first year or if the value depreciation value depreciation degressive more linear ... */
|
||||
if (curr_year == 0 || amt_ad1.compareTo(amt_sl) >= 0) {
|
||||
amtPerYear = amt_ad1;
|
||||
}
|
||||
else {
|
||||
amtPerYear = amt_sl;
|
||||
is_SL = true;
|
||||
s_log.fine("*** PASS IT ON linear amt_sl= " + amt_sl + " ***");
|
||||
}
|
||||
}
|
||||
else {
|
||||
amtPerYear = amt_sl;
|
||||
s_log.fine("* linear *");
|
||||
}
|
||||
|
||||
amt_r = amt_r.subtract(amtPerYear);
|
||||
if (CLogMgt.isLevelFinest()) s_log.fine("year=" + curr_year + ", amtPerYear=" + amtPerYear + ", amt_r=" + amt_r); //logging
|
||||
}
|
||||
if (CLogMgt.isLevelFinest()) s_log.fine("amt_r=" + amt_r + ", amtPerYear=" + amtPerYear); //logging
|
||||
|
||||
/** Damping value for the current month */
|
||||
BigDecimal assetExp = getPeriodExp(A_Current_Period, amtPerYear);
|
||||
|
||||
/** Depreciation refund */
|
||||
if (CLogMgt.isLevelFinest()) log.fine("assetExp=" + assetExp);
|
||||
return assetExp;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private BigDecimal apply_ARH_AD2(MDepreciationWorkfile wk, MAssetAcct assetAcct, int A_Current_Period,BigDecimal Accum_Dep)
|
||||
{
|
||||
throw new AssetNotImplementedException("AD2");
|
||||
}
|
||||
|
||||
/** For depreciation regime skimmed returns coefficient K depending on the life of FAs
|
||||
* @param A_Life_Year life in years
|
||||
* @return coeficient K degressive method for
|
||||
* @see #apply_ARH_AD1(int, int, String, int, BigDecimal)
|
||||
*/
|
||||
private static BigDecimal get_AD_K(int A_Life_Year)
|
||||
{
|
||||
if (A_Life_Year < 2) {
|
||||
throw new IllegalArgumentException("@A_Life_Year@ = " + A_Life_Year + " < 2");
|
||||
}
|
||||
// A_Life_Year in [2, 5]
|
||||
else if (A_Life_Year <= 5) {
|
||||
return new BigDecimal(1.5);
|
||||
}
|
||||
// A_Life_Year in (5, 10]
|
||||
else if (A_Life_Year <= 10) {
|
||||
return new BigDecimal(2.0);
|
||||
}
|
||||
// A_Life_Year in (10, infinit)
|
||||
else {
|
||||
return new BigDecimal(2.5);
|
||||
}
|
||||
}
|
||||
|
||||
/** Calculate the value of depreciation over a month (period). In the last month of the year we add errors from the adjustment calculation
|
||||
* @param A_Current_Period current month's index
|
||||
* @param amtPerYear value of depreciation per year
|
||||
* @return rounded value to the nearest month/decimal getPrecision ()
|
||||
*/
|
||||
protected BigDecimal getPeriodExp(int A_Current_Period, BigDecimal amtPerYear)
|
||||
{
|
||||
/** Monthly amount */
|
||||
BigDecimal amtPerMonth = amtPerYear.divide(BD_12, getPrecision(), RoundingMode.HALF_UP);
|
||||
/** Value adjustment */
|
||||
BigDecimal adj = BigDecimal.ZERO;
|
||||
/** The amount a month (with adjustments) */
|
||||
BigDecimal assetExp = amtPerMonth;
|
||||
|
||||
// if last month of the year, calculate the adjustment
|
||||
// NOTE: All adjusted value shall be rounded to getPrecision () decimal
|
||||
if (A_Current_Period % 12 == 11)
|
||||
{
|
||||
adj = amtPerYear.subtract(amtPerMonth.multiply(BD_12));
|
||||
assetExp = assetExp.add(adj).setScale(getPrecision(), RoundingMode.HALF_UP);
|
||||
}
|
||||
|
||||
if (CLogMgt.isLevelFinest())
|
||||
{
|
||||
log.fine("amtPerYear=" + amtPerYear + ", amtPerMonth=" + amtPerMonth + ", adj=" + adj + " => assetExp=" + assetExp);
|
||||
}
|
||||
return assetExp;
|
||||
}
|
||||
|
||||
public int getFixMonthOffset() {
|
||||
// IDEMPIERE-197 Stabilize Fixed Assets
|
||||
// MDepreciationWorkfile is requiring this missing column
|
||||
// TODO: Adding this method to compile correctly and future research
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package org.compiere.model;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.util.Properties;
|
||||
|
||||
|
||||
/** Depreciation Build
|
||||
* @author Teo Sarca, SC ARHIPAC SRL
|
||||
* @version $Id$ -- Release 2.5.3a - 2006-06-22 18:03:22.896
|
||||
*/
|
||||
public class MDepreciationBuild extends X_A_Depreciation_Build
|
||||
{
|
||||
/** Standard Constructor */
|
||||
public MDepreciationBuild (Properties ctx, int A_Depreciation_Build_ID, String trxName)
|
||||
{
|
||||
super (ctx, A_Depreciation_Build_ID, trxName);
|
||||
/** if (A_Depreciation_Build_ID == 0)
|
||||
{
|
||||
setA_Depreciation_Build_ID (0);
|
||||
}
|
||||
*/
|
||||
}
|
||||
/** Load Constructor */
|
||||
public MDepreciationBuild (Properties ctx, ResultSet rs, String trxName)
|
||||
{
|
||||
super (ctx, rs, trxName);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,116 @@
|
|||
package org.compiere.model;
|
||||
import java.sql.*;
|
||||
import java.math.*;
|
||||
import java.util.*;
|
||||
import java.util.logging.*;
|
||||
import org.compiere.model.*;
|
||||
import org.compiere.util.*;
|
||||
|
||||
/** Convention for the first year of depreciation (ex. FMCON, FYCON ...)
|
||||
* @author Teo Sarca, SC Arhipac SRL
|
||||
* @version $Id$
|
||||
*/
|
||||
public class MDepreciationConvention extends X_A_Depreciation_Convention
|
||||
{
|
||||
/**
|
||||
* Default Constructor
|
||||
* @param ctx context
|
||||
* @param A_Depreciation_Convention_ID id
|
||||
* @param trxName transaction name
|
||||
*/
|
||||
public MDepreciationConvention(Properties ctx, int A_Depreciation_Convention_ID, String trxName)
|
||||
{
|
||||
super (ctx, A_Depreciation_Convention_ID, trxName);
|
||||
//~ if (A_Depreciation_Convention_ID == 0)
|
||||
//~ {
|
||||
//~ }
|
||||
} // MDepreciationConvention
|
||||
|
||||
/**
|
||||
* Load Constructor
|
||||
* @param ctx context
|
||||
* @param rs result set record
|
||||
*/
|
||||
public MDepreciationConvention (Properties ctx, ResultSet rs, String trxName)
|
||||
{
|
||||
super (ctx, rs, trxName);
|
||||
} // MDepreciationConvention
|
||||
|
||||
/** Cache */
|
||||
private static CCache<Integer,MDepreciationConvention> s_cache = new CCache<Integer,MDepreciationConvention>("A_Depreciation_Convention", 5);
|
||||
//~ /** Static logger */
|
||||
//~ private static Logger s_log = CLogger.getCLogger(MDepreciationConvention.class);
|
||||
|
||||
public static MDepreciationConvention get(Properties ctx, int A_Depreciation_Convention_ID) {
|
||||
Integer key = Integer.valueOf(A_Depreciation_Convention_ID);
|
||||
MDepreciationConvention conv = s_cache.get(key);
|
||||
if (conv != null) {
|
||||
return conv;
|
||||
}
|
||||
conv = new MDepreciationConvention(ctx, A_Depreciation_Convention_ID, null);
|
||||
if (conv.get_ID() > 0) {
|
||||
s_cache.put(key, conv);
|
||||
} else {
|
||||
conv = null;
|
||||
}
|
||||
return conv;
|
||||
} // get
|
||||
|
||||
/** */
|
||||
public BigDecimal invoke (MDepreciationWorkfile assetwk, MAssetAcct assetAcct, int Flag, int Period) {
|
||||
return invoke(assetwk.getA_Asset_ID(), assetAcct.getPostingType(), assetAcct.get_ID(), Flag, Period);
|
||||
}
|
||||
|
||||
/** */
|
||||
public BigDecimal invoke (int A_Asset_ID, String PostingType, int A_Asset_Acct_ID, int Flag, int Period) {
|
||||
String conventionType = getConventionType();
|
||||
BigDecimal retValue = null;
|
||||
|
||||
if(CLogMgt.isLevelFine())
|
||||
log.fine("Entering: ConventionType=" + conventionType
|
||||
+ "A_Asset_ID=" + A_Asset_ID + ", PostingType=" + PostingType + ", A_Asset_Acct_ID=" + A_Asset_Acct_ID
|
||||
+ ", Flag=" + Flag + ", Period=" + Period
|
||||
);
|
||||
|
||||
if (conventionType.equalsIgnoreCase("FMCON")) {
|
||||
return apply_FMCON(A_Asset_ID, PostingType, A_Asset_Acct_ID, Flag, Period);
|
||||
}
|
||||
else {
|
||||
String sql = "{ ? = call "+ conventionType + "(?, ?, ?, ?, ?) }";
|
||||
CallableStatement cs = null;
|
||||
try {
|
||||
cs = DB.prepareCall(sql);
|
||||
cs.registerOutParameter(1, java.sql.Types.DECIMAL);
|
||||
cs.setInt(2, A_Asset_ID);
|
||||
cs.setString(3, PostingType);
|
||||
cs.setInt(4, A_Asset_Acct_ID);
|
||||
cs.setInt(5, Flag);
|
||||
cs.setInt(6, Period);
|
||||
cs.execute();
|
||||
retValue = cs.getBigDecimal(1);
|
||||
cs.close();
|
||||
} catch (Exception e) {
|
||||
log.log(Level.SEVERE, sql, e);
|
||||
}
|
||||
finally {
|
||||
try {
|
||||
if (cs != null) cs.close();
|
||||
} catch (SQLException e) {
|
||||
log.log(Level.FINEST, "Error", e);
|
||||
}
|
||||
cs = null;
|
||||
}
|
||||
}
|
||||
//
|
||||
if (retValue == null) {
|
||||
retValue = BigDecimal.ZERO;
|
||||
}
|
||||
//
|
||||
if(CLogMgt.isLevelFine()) log.fine("Leaving: retValue=" + retValue);
|
||||
return retValue;
|
||||
}
|
||||
|
||||
public BigDecimal apply_FMCON(int A_Asset_ID, String PostingType, int A_Asset_Acct_ID, int Flag, int Period) {
|
||||
return BigDecimal.ONE;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,373 @@
|
|||
package org.compiere.model;
|
||||
|
||||
import java.io.File;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.adempiere.exceptions.AdempiereException;
|
||||
import org.compiere.model.MAcctSchema;
|
||||
import org.compiere.model.MClient;
|
||||
import org.compiere.model.MPeriod;
|
||||
import org.compiere.model.ModelValidationEngine;
|
||||
import org.compiere.model.ModelValidator;
|
||||
import org.compiere.model.Query;
|
||||
import org.compiere.process.DocAction;
|
||||
import org.compiere.process.DocumentEngine;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.TimeUtil;
|
||||
import org.compiere.util.Trx;
|
||||
import org.compiere.util.TrxRunnable;
|
||||
import org.idempiere.fa.exceptions.AssetArrayException;
|
||||
import org.idempiere.fa.exceptions.AssetException;
|
||||
|
||||
|
||||
/**
|
||||
* Depreciation Entry
|
||||
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
||||
*/
|
||||
public class MDepreciationEntry extends X_A_Depreciation_Entry
|
||||
implements DocAction
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** Standard Constructor */
|
||||
public MDepreciationEntry(Properties ctx, int A_Depreciation_Entry_ID, String trxName)
|
||||
{
|
||||
super (ctx, A_Depreciation_Entry_ID, trxName);
|
||||
if (A_Depreciation_Entry_ID == 0)
|
||||
{
|
||||
MAcctSchema acctSchema = MClient.get(getCtx()).getAcctSchema();
|
||||
setC_AcctSchema_ID(acctSchema.get_ID());
|
||||
setC_Currency_ID(acctSchema.getC_Currency_ID());
|
||||
setA_Entry_Type (A_ENTRY_TYPE_Depreciation); // TODO: workaround
|
||||
setPostingType (POSTINGTYPE_Actual); // A
|
||||
setProcessed (false);
|
||||
setProcessing (false);
|
||||
setPosted(false);
|
||||
}
|
||||
}
|
||||
|
||||
/** Load Constructor */
|
||||
public MDepreciationEntry (Properties ctx, ResultSet rs, String trxName)
|
||||
{
|
||||
super (ctx, rs, trxName);
|
||||
}
|
||||
|
||||
|
||||
protected boolean beforeSave(boolean newRecord)
|
||||
{
|
||||
setC_Period_ID();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
protected boolean afterSave(boolean newRecord, boolean success)
|
||||
{
|
||||
if (!success)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!isProcessed() && (newRecord || is_ValueChanged(COLUMNNAME_DateAcct)))
|
||||
{
|
||||
selectLines();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
protected boolean afterDelete(boolean success)
|
||||
{
|
||||
if (!success)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
unselectLines();
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setC_Period_ID()
|
||||
{
|
||||
MPeriod period = MPeriod.get(getCtx(), getDateAcct(), getAD_Org_ID());
|
||||
if (period == null)
|
||||
{
|
||||
throw new AdempiereException("@NotFound@ @C_Period_ID@");
|
||||
}
|
||||
setC_Period_ID(period.get_ID());
|
||||
}
|
||||
|
||||
private void unselectLines()
|
||||
{
|
||||
String sql = "UPDATE " + MDepreciationExp.Table_Name + " SET "
|
||||
+ MDepreciationExp.COLUMNNAME_A_Depreciation_Entry_ID + "=NULL "
|
||||
+ " WHERE "
|
||||
+ MDepreciationExp.COLUMNNAME_A_Depreciation_Entry_ID + "=?";
|
||||
int id = get_ID();
|
||||
if (id <= 0)
|
||||
{ // Use old ID is current ID is missing (i.e. object was deleted)
|
||||
id = get_IDOld();
|
||||
}
|
||||
int no = DB.executeUpdateEx(sql, new Object[]{id}, get_TrxName());
|
||||
log.fine("Updated #" + no);
|
||||
}
|
||||
|
||||
private void selectLines()
|
||||
{
|
||||
// Reset selected lines:
|
||||
unselectLines();
|
||||
// Select lines:
|
||||
final String sql = "UPDATE " + MDepreciationExp.Table_Name + " SET "
|
||||
+ MDepreciationExp.COLUMNNAME_A_Depreciation_Entry_ID + "=?"
|
||||
+ " WHERE "
|
||||
+ MDepreciationExp.COLUMNNAME_A_Depreciation_Entry_ID + " IS NULL"
|
||||
+ " AND TRUNC("+MDepreciationExp.COLUMNNAME_DateAcct+",'MONTH') = ?"
|
||||
+ " AND AD_Client_ID=? AND AD_Org_ID=?";
|
||||
;
|
||||
Timestamp dateAcct = TimeUtil.trunc(getDateAcct(), TimeUtil.TRUNC_MONTH);
|
||||
int no = DB.executeUpdateEx(sql, new Object[]{get_ID(), dateAcct, getAD_Client_ID(), getAD_Org_ID()}, get_TrxName());
|
||||
log.fine("Updated #" + no);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Lines
|
||||
*/
|
||||
public Iterator<MDepreciationExp> getLinesIterator(boolean onlyNotProcessed)
|
||||
{
|
||||
final String trxName = get_TrxName();
|
||||
final List<Object> params = new ArrayList<Object>();
|
||||
String whereClause = MDepreciationExp.COLUMNNAME_A_Depreciation_Entry_ID+"=?";
|
||||
params.add(get_ID());
|
||||
|
||||
if (onlyNotProcessed)
|
||||
{
|
||||
whereClause += " AND "+MDepreciationExp.COLUMNNAME_Processed+"=?";
|
||||
params.add(false);
|
||||
}
|
||||
|
||||
// ORDER BY clause - very important
|
||||
String orderBy = MDepreciationExp.COLUMNNAME_A_Asset_ID
|
||||
+","+MDepreciationExp.COLUMNNAME_PostingType
|
||||
+","+MDepreciationExp.COLUMNNAME_A_Period
|
||||
+","+MDepreciationExp.COLUMNNAME_A_Entry_Type;
|
||||
|
||||
Iterator<MDepreciationExp> it = new Query(getCtx(), MDepreciationExp.Table_Name, whereClause, trxName)
|
||||
.setOrderBy(orderBy)
|
||||
.setParameters(params)
|
||||
.iterate();
|
||||
return it;
|
||||
}
|
||||
|
||||
|
||||
public boolean processIt (String processAction)
|
||||
{
|
||||
m_processMsg = null;
|
||||
DocumentEngine engine = new DocumentEngine (this, getDocStatus());
|
||||
return engine.processIt (processAction, getDocAction());
|
||||
} // processIt
|
||||
|
||||
/** Process Message */
|
||||
private String m_processMsg = null;
|
||||
/** Just Prepared Flag */
|
||||
private boolean m_justPrepared = false;
|
||||
|
||||
|
||||
public boolean unlockIt()
|
||||
{
|
||||
log.info("unlockIt - " + toString());
|
||||
// setProcessing(false);
|
||||
return true;
|
||||
} // unlockIt
|
||||
|
||||
|
||||
public boolean invalidateIt()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public String prepareIt()
|
||||
{
|
||||
log.info(toString());
|
||||
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE);
|
||||
if (m_processMsg != null)
|
||||
{
|
||||
return DocAction.STATUS_Invalid;
|
||||
}
|
||||
|
||||
MPeriod.testPeriodOpen(getCtx(), getDateAcct(), getC_DocType_ID(), getAD_Org_ID());
|
||||
|
||||
m_justPrepared = true;
|
||||
|
||||
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);
|
||||
if (m_processMsg != null)
|
||||
{
|
||||
return DocAction.STATUS_Invalid;
|
||||
}
|
||||
|
||||
setDocAction(DOCACTION_Complete);
|
||||
return DocAction.STATUS_InProgress;
|
||||
}
|
||||
|
||||
|
||||
public boolean approveIt()
|
||||
{
|
||||
log.info("approveIt - " + toString());
|
||||
setIsApproved(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public boolean rejectIt()
|
||||
{
|
||||
log.info("rejectIt - " + toString());
|
||||
setIsApproved(false);
|
||||
return true;
|
||||
} // rejectIt
|
||||
|
||||
|
||||
public String completeIt()
|
||||
{
|
||||
// Re-Check
|
||||
if (!m_justPrepared)
|
||||
{
|
||||
String status = prepareIt();
|
||||
if (!DocAction.STATUS_InProgress.equals(status))
|
||||
return status;
|
||||
}
|
||||
// Implicit Approval
|
||||
if (!isApproved())
|
||||
{
|
||||
approveIt();
|
||||
}
|
||||
|
||||
final MPeriod period = MPeriod.get(getCtx(), getC_Period_ID());
|
||||
|
||||
final ArrayList<Exception> errors = new ArrayList<Exception>();
|
||||
final Iterator<MDepreciationExp> it = getLinesIterator(true);
|
||||
//
|
||||
while(it.hasNext())
|
||||
{
|
||||
try
|
||||
{
|
||||
Trx.run(get_TrxName(), new TrxRunnable(){
|
||||
|
||||
public void run(String trxName)
|
||||
{
|
||||
MDepreciationExp depexp = it.next();
|
||||
// Check if is in Period
|
||||
if (!period.isInPeriod(depexp.getDateAcct()))
|
||||
{
|
||||
throw new AssetException("The date is not within this Period"
|
||||
+" ("+depexp+", Data="+depexp.getDateAcct()+", Period="+period.getName()+")"); // TODO: translate
|
||||
}
|
||||
depexp.process();
|
||||
}});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.log(Level.SEVERE, e.getLocalizedMessage(), e);
|
||||
errors.add(e);
|
||||
}
|
||||
}
|
||||
//
|
||||
if (errors.size() > 0)
|
||||
{
|
||||
throw new AssetArrayException(errors);
|
||||
}
|
||||
|
||||
// User Validation
|
||||
String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE);
|
||||
if (valid != null)
|
||||
{
|
||||
m_processMsg = valid;
|
||||
return DocAction.STATUS_Invalid;
|
||||
}
|
||||
|
||||
setProcessed(true);
|
||||
setDocAction(DOCACTION_Close);
|
||||
return DocAction.STATUS_Completed;
|
||||
} // completeIt
|
||||
|
||||
|
||||
public boolean voidIt()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public boolean closeIt()
|
||||
{
|
||||
setDocAction(DOCACTION_None);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public boolean reverseCorrectIt()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public boolean reverseAccrualIt()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public boolean reActivateIt()
|
||||
{
|
||||
return false;
|
||||
} // reActivateIt
|
||||
|
||||
|
||||
|
||||
public String getSummary()
|
||||
{
|
||||
return toString();
|
||||
}
|
||||
|
||||
|
||||
public String getProcessMsg()
|
||||
{
|
||||
return m_processMsg;
|
||||
}
|
||||
|
||||
|
||||
public int getDoc_User_ID()
|
||||
{
|
||||
return getCreatedBy();
|
||||
}
|
||||
|
||||
|
||||
public BigDecimal getApprovalAmt()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public File createPDF ()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public String getDocumentInfo()
|
||||
{
|
||||
return getDocumentNo();
|
||||
}
|
||||
|
||||
public static void deleteFacts(MDepreciationExp depexp)
|
||||
{
|
||||
final String sql = "DELETE FROM Fact_Acct WHERE AD_Table_ID=? AND Record_ID=? AND Line_ID=?";
|
||||
Object[] params = new Object[]{Table_ID, depexp.getA_Depreciation_Entry_ID(), depexp.get_ID()};
|
||||
DB.executeUpdateEx(sql, params, depexp.get_TrxName());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,301 @@
|
|||
package org.compiere.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.compiere.model.MDocType;
|
||||
import org.compiere.model.MPeriod;
|
||||
import org.compiere.model.Query;
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Msg;
|
||||
import org.compiere.util.TimeUtil;
|
||||
import org.idempiere.fa.exceptions.AssetException;
|
||||
import org.idempiere.fa.exceptions.AssetNotActiveException;
|
||||
|
||||
|
||||
public class MDepreciationExp extends X_A_Depreciation_Exp
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static CLogger s_log = CLogger.getCLogger(MDepreciationExp.class);
|
||||
private CLogger log = CLogger.getCLogger(this.getClass());
|
||||
|
||||
/** Standard Constructor */
|
||||
public MDepreciationExp(Properties ctx, int A_Depreciation_Exp_ID, String trxName)
|
||||
{
|
||||
super (ctx, A_Depreciation_Exp_ID, trxName);
|
||||
/**
|
||||
if (A_Depreciation_Exp_ID == 0)
|
||||
{
|
||||
setA_Account_Number (0);
|
||||
setA_Asset_ID (0);
|
||||
setA_Depreciation_Exp_ID (0);
|
||||
setA_Entry_Type (null);
|
||||
setA_Period (0);
|
||||
setDescription (null);
|
||||
setExpense (Env.ZERO);
|
||||
setIsDepreciated (false);
|
||||
setProcessed (false);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
/** Load Constructor */
|
||||
public MDepreciationExp (Properties ctx, ResultSet rs, String trxName)
|
||||
{
|
||||
super (ctx, rs, trxName);
|
||||
}
|
||||
|
||||
/** Gets depreciation expense
|
||||
* @param ctx context
|
||||
* @param A_Depreciation_Exp_ID depreciation expense id
|
||||
* @return depreciation expense or null if A_Depreciation_Exp_ID=0 or not found
|
||||
*/
|
||||
public static MDepreciationExp get(Properties ctx, int A_Depreciation_Exp_ID) {
|
||||
if (A_Depreciation_Exp_ID <= 0) {
|
||||
return null;
|
||||
}
|
||||
MDepreciationExp depexp = new MDepreciationExp(ctx, A_Depreciation_Exp_ID, null);
|
||||
if (depexp.get_ID() != A_Depreciation_Exp_ID) {
|
||||
depexp = null;
|
||||
}
|
||||
return depexp;
|
||||
}
|
||||
|
||||
/** Create entry
|
||||
*/
|
||||
public static MDepreciationExp createEntry (Properties ctx, String entryType, int A_Asset_ID
|
||||
, int A_Period, Timestamp DateAcct, String postingType
|
||||
, int drAcct, int crAcct, BigDecimal expense
|
||||
, String description
|
||||
, MDepreciationWorkfile assetwk)
|
||||
{
|
||||
MDepreciationExp depexp = new MDepreciationExp(ctx, 0, null);
|
||||
depexp.setA_Entry_Type(entryType);
|
||||
depexp.setA_Asset_ID(A_Asset_ID);
|
||||
depexp.setDR_Account_ID(drAcct);
|
||||
depexp.setCR_Account_ID(crAcct);
|
||||
depexp.setA_Account_Number_Acct(drAcct); // TODO: DELETEME
|
||||
depexp.setPostingType(postingType);
|
||||
depexp.setExpense(expense);
|
||||
depexp.setDescription(Msg.parseTranslation(ctx, description));
|
||||
depexp.setA_Period(A_Period);
|
||||
depexp.setIsDepreciated(true);
|
||||
depexp.setDateAcct(DateAcct);
|
||||
//
|
||||
depexp.updateFrom(assetwk);
|
||||
//
|
||||
s_log.fine("depexp=" + depexp);
|
||||
return depexp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update fields from asset workfile
|
||||
* @param wk asset workfile
|
||||
*/
|
||||
public void updateFrom(MDepreciationWorkfile wk)
|
||||
{
|
||||
setA_Asset_Cost(wk.getA_Asset_Cost());
|
||||
setA_Accumulated_Depr(wk.getA_Accumulated_Depr());
|
||||
setA_Accumulated_Depr_F(wk.getA_Accumulated_Depr_F());
|
||||
setUseLifeMonths(wk.getUseLifeMonths());
|
||||
setUseLifeMonths_F(wk.getUseLifeMonths_F());
|
||||
setA_Asset_Remaining(wk.getA_Asset_Remaining());
|
||||
setA_Asset_Remaining_F(wk.getA_Asset_Remaining_F());
|
||||
}
|
||||
|
||||
private MDepreciationWorkfile getA_Depreciation_Workfile()
|
||||
{
|
||||
return MDepreciationWorkfile.get(getCtx(), getA_Asset_ID(), getPostingType(), get_TrxName());
|
||||
}
|
||||
|
||||
/** Create Depreciation Entries
|
||||
* Produce record:
|
||||
* <pre>
|
||||
* 68.. = 28.. depreciation value
|
||||
* </pre>
|
||||
*/
|
||||
public static Collection<MDepreciationExp> createDepreciation (
|
||||
MDepreciationWorkfile assetwk,
|
||||
int PeriodNo, Timestamp dateAcct,
|
||||
BigDecimal amt, BigDecimal amt_F,
|
||||
BigDecimal accumAmt, BigDecimal accumAmt_F,
|
||||
String help, String trxName)
|
||||
{
|
||||
ArrayList<MDepreciationExp> list = new ArrayList<MDepreciationExp>();
|
||||
Properties ctx = assetwk.getCtx();
|
||||
MAssetAcct assetAcct = assetwk.getA_AssetAcct(dateAcct, trxName);
|
||||
MDepreciationExp depexp = null;
|
||||
|
||||
depexp = createEntry (ctx, A_ENTRY_TYPE_Depreciation, assetwk.getA_Asset_ID(), PeriodNo, dateAcct, assetwk.getPostingType()
|
||||
, assetAcct.getA_Depreciation_Acct(), assetAcct.getA_Accumdepreciation_Acct()
|
||||
, amt
|
||||
, "@AssetDepreciationAmt@"
|
||||
, assetwk);
|
||||
if(depexp != null) {
|
||||
depexp.setAD_Org_ID(assetwk.getA_Asset().getAD_Org_ID()); // added by zuhri
|
||||
if (accumAmt != null)
|
||||
depexp.setA_Accumulated_Depr(accumAmt);
|
||||
if (accumAmt_F != null)
|
||||
depexp.setA_Accumulated_Depr_F(accumAmt_F);
|
||||
if (help != null && help.length() > 0)
|
||||
depexp.setHelp(help);
|
||||
depexp.setExpense_F(amt_F);
|
||||
depexp.setA_Accumulated_Depr_Delta(amt);
|
||||
depexp.setA_Accumulated_Depr_F_Delta(amt_F);
|
||||
depexp.saveEx(assetwk.get_TrxName());
|
||||
list.add(depexp);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process this entry and save the modified workfile.
|
||||
*/
|
||||
public void process()
|
||||
{
|
||||
if(isProcessed())
|
||||
{
|
||||
log.fine("@AlreadyProcessed@");
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
MDepreciationWorkfile assetwk = getA_Depreciation_Workfile();
|
||||
if (assetwk == null)
|
||||
{
|
||||
throw new AssetException("@NotFound@ @A_Depreciation_Workfile_ID@");
|
||||
}
|
||||
//
|
||||
String entryType = getA_Entry_Type();
|
||||
if (MDepreciationExp.A_ENTRY_TYPE_Depreciation.equals(entryType))
|
||||
{
|
||||
checkExistsNotProcessedEntries(getCtx(), getA_Asset_ID(), getDateAcct(), getPostingType(), get_TrxName());
|
||||
//
|
||||
// Check if the asset is Active:
|
||||
if (!assetwk.getAsset().getA_Asset_Status().equals(MAsset.A_ASSET_STATUS_Activated))
|
||||
{
|
||||
throw new AssetNotActiveException(assetwk.getAsset().get_ID());
|
||||
}
|
||||
//
|
||||
setDateAcct(assetwk.getDateAcct());
|
||||
assetwk.adjustAccumulatedDepr(getExpense(), getExpense_F(), false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// nothing to do for other entry types
|
||||
}
|
||||
//
|
||||
setProcessed(true);
|
||||
updateFrom(assetwk);
|
||||
saveEx();
|
||||
|
||||
//
|
||||
// Update workfile
|
||||
assetwk.setA_Current_Period();
|
||||
assetwk.saveEx();
|
||||
}
|
||||
|
||||
|
||||
protected boolean beforeDelete()
|
||||
{
|
||||
if (isProcessed())
|
||||
{
|
||||
// TODO : check if we can reverse it (check period, check dateacct etc)
|
||||
MDepreciationWorkfile assetwk = getA_Depreciation_Workfile();
|
||||
assetwk.adjustAccumulatedDepr(getA_Accumulated_Depr().negate(), getA_Accumulated_Depr_F().negate(), false);
|
||||
assetwk.saveEx();
|
||||
}
|
||||
// Try to delete postings
|
||||
if (isPosted())
|
||||
{
|
||||
MPeriod.testPeriodOpen(getCtx(), getDateAcct(), MDocType.DOCBASETYPE_GLDocument, getAD_Org_ID());
|
||||
MDepreciationEntry.deleteFacts(this);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
protected boolean afterDelete(boolean success)
|
||||
{
|
||||
if (!success)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
//
|
||||
// If it was processed, we need to update workfile's current period
|
||||
if (isProcessed())
|
||||
{
|
||||
MDepreciationWorkfile wk = getA_Depreciation_Workfile();
|
||||
wk.setA_Current_Period();
|
||||
wk.saveEx();
|
||||
}
|
||||
//
|
||||
return true;
|
||||
}
|
||||
|
||||
protected boolean isPosted()
|
||||
{
|
||||
return isProcessed() && getA_Depreciation_Entry_ID() > 0;
|
||||
}
|
||||
|
||||
public static void checkExistsNotProcessedEntries(Properties ctx,
|
||||
int A_Asset_ID, Timestamp dateAcct, String postingType,
|
||||
String trxName)
|
||||
{
|
||||
final String whereClause = MDepreciationExp.COLUMNNAME_A_Asset_ID+"=?"
|
||||
+" AND TRUNC("+MDepreciationExp.COLUMNNAME_DateAcct+",'MONTH')<?"
|
||||
+" AND "+MDepreciationExp.COLUMNNAME_PostingType+"=?"
|
||||
+" AND "+MDepreciationExp.COLUMNNAME_Processed+"=?";
|
||||
boolean match = new Query(ctx, MDepreciationExp.Table_Name, whereClause, trxName)
|
||||
.setParameters(new Object[]{A_Asset_ID, TimeUtil.getMonthFirstDay(dateAcct), postingType, false})
|
||||
.match();
|
||||
if (match)
|
||||
{
|
||||
throw new AssetException("There are unprocessed records to date");
|
||||
}
|
||||
}
|
||||
|
||||
public static List<MDepreciationExp> getNotProcessedEntries(Properties ctx,
|
||||
int A_Asset_ID, String postingType,
|
||||
String trxName)
|
||||
{
|
||||
final String whereClause = MDepreciationExp.COLUMNNAME_A_Asset_ID+"=?"
|
||||
+" AND "+MDepreciationExp.COLUMNNAME_PostingType+"=?"
|
||||
+" AND "+MDepreciationExp.COLUMNNAME_Processed+"=?";
|
||||
List<MDepreciationExp> list = new Query(ctx, MDepreciationExp.Table_Name, whereClause, trxName)
|
||||
.setParameters(new Object[]{A_Asset_ID, postingType, false})
|
||||
.list();
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
public void setProcessed(boolean Processed)
|
||||
{
|
||||
super.setProcessed(Processed);
|
||||
//
|
||||
if (get_ID() > 0)
|
||||
{
|
||||
final String sql = "UPDATE "+Table_Name+" SET Processed=? WHERE "+COLUMNNAME_A_Depreciation_Exp_ID+"=?";
|
||||
DB.executeUpdateEx(sql, new Object[]{Processed, get_ID()}, get_TrxName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return getClass().getSimpleName()+"["+get_ID()
|
||||
+",A_Asset_ID="+getA_Asset_ID()
|
||||
+",A_Period="+getA_Period()
|
||||
+",DateAcct="+getDateAcct()
|
||||
+",Expense="+getExpense()
|
||||
+",Entry_ID="+getA_Depreciation_Entry_ID()
|
||||
+"]";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,245 @@
|
|||
package org.compiere.model;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.sql.CallableStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.adempiere.exceptions.DBException;
|
||||
import org.compiere.model.Query;
|
||||
import org.compiere.util.CCache;
|
||||
import org.compiere.util.CLogMgt;
|
||||
import org.compiere.util.DB;
|
||||
|
||||
/**
|
||||
* Method of adjusting the difference between depreciation (Calculated) and registered as (booked).
|
||||
* ex. MDI, LDI, YDI ...
|
||||
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
||||
*/
|
||||
public class MDepreciationMethod extends X_A_Depreciation_Method
|
||||
{
|
||||
/** Standard Constructor */
|
||||
public MDepreciationMethod (Properties ctx, int A_Depreciation_Method_ID, String trxName)
|
||||
{
|
||||
super (ctx, A_Depreciation_Method_ID, trxName);
|
||||
} // MDepreciationMethod
|
||||
|
||||
/**
|
||||
* Load Constructor
|
||||
* @param ctx context
|
||||
* @param rs result set record
|
||||
*/
|
||||
public MDepreciationMethod (Properties ctx, ResultSet rs, String trxName)
|
||||
{
|
||||
super (ctx, rs, trxName);
|
||||
} // MDepreciationMethod
|
||||
|
||||
/** Cache */
|
||||
private static CCache<Integer,MDepreciationMethod>
|
||||
s_cache = new CCache<Integer,MDepreciationMethod>(Table_Name, 5);
|
||||
/** Cache for type */
|
||||
private static CCache<String,MDepreciationMethod>
|
||||
s_cache_forType = new CCache<String,MDepreciationMethod>(Table_Name+"_DepreciationType", 5);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static void addToCache(MDepreciationMethod depr)
|
||||
{
|
||||
if (depr == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
s_cache.put(depr.get_ID(), depr);
|
||||
s_cache_forType.put(depr.getDepreciationType(), depr);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static int getPrecision()
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static MDepreciationMethod get(Properties ctx, int A_Depreciation_Method_ID)
|
||||
{
|
||||
MDepreciationMethod depr = s_cache.get(A_Depreciation_Method_ID);
|
||||
if (depr != null)
|
||||
{
|
||||
return depr;
|
||||
}
|
||||
depr = new MDepreciationMethod(ctx, A_Depreciation_Method_ID, null);
|
||||
if (depr.get_ID() > 0)
|
||||
{
|
||||
addToCache(depr);
|
||||
}
|
||||
else
|
||||
{
|
||||
depr = null;
|
||||
}
|
||||
return depr;
|
||||
} // get
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static MDepreciationMethod get(Properties ctx, String depreciationType)
|
||||
{
|
||||
String key = depreciationType;
|
||||
MDepreciationMethod depr = s_cache_forType.get(key);
|
||||
if (depr != null)
|
||||
{
|
||||
return depr;
|
||||
}
|
||||
depr = new Query(ctx, Table_Name, COLUMNNAME_DepreciationType+"=?", null)
|
||||
.setParameters(new Object[]{depreciationType})
|
||||
.firstOnly();
|
||||
addToCache(depr);
|
||||
return depr;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static BigDecimal invoke (Properties ctx, String depreciationType,
|
||||
int A_Asset_ID, BigDecimal A_Asset_Adjustment,
|
||||
int A_PeriodNo, String PostingType, int A_Asset_Acct_ID)
|
||||
{
|
||||
MDepreciationMethod depr = get(ctx, depreciationType);
|
||||
if (depr == null)
|
||||
{
|
||||
throw new IllegalArgumentException("@NotFound@ @DepreciationType@ " + depreciationType);
|
||||
}
|
||||
return depr.invoke(A_Asset_ID, A_Asset_Adjustment, A_PeriodNo, PostingType, A_Asset_Acct_ID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate adjustment
|
||||
* @return adjustment to be applied in the specified period
|
||||
*/
|
||||
public BigDecimal invoke (MDepreciationWorkfile assetwk,
|
||||
MAssetAcct assetAcct, BigDecimal A_Asset_Adjustment,
|
||||
int A_PeriodNo)
|
||||
{
|
||||
return invoke(assetwk.getA_Asset_ID(), A_Asset_Adjustment, A_PeriodNo, assetAcct.getPostingType(), assetAcct.get_ID());
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate adjustment
|
||||
* @return adjustment to be applied in the specified period
|
||||
*/
|
||||
public BigDecimal invoke (int A_Asset_ID, BigDecimal A_Asset_Adjustment,
|
||||
int A_PeriodNo, String PostingType, int A_Asset_Acct_ID)
|
||||
{
|
||||
String depreciationType = getDepreciationType();
|
||||
BigDecimal retValue = null;
|
||||
|
||||
if(CLogMgt.isLevelFine())
|
||||
log.fine("Entering: DepreciationMethodType=" + depreciationType
|
||||
+ ", A_Asset_ID=" + A_Asset_ID + ", A_Asset_Adjustment=" + A_Asset_Adjustment
|
||||
+ ", A_PeriodNo=" + A_PeriodNo + ", PostingType=" + PostingType + ", A_Asset_Acct_ID=" + A_Asset_Acct_ID
|
||||
);
|
||||
|
||||
if (depreciationType.equalsIgnoreCase("MDI"))
|
||||
{
|
||||
retValue = apply_MDI(A_Asset_ID, A_Asset_Adjustment, A_PeriodNo, PostingType, A_Asset_Acct_ID);
|
||||
}
|
||||
else if (depreciationType.equalsIgnoreCase("YDI"))
|
||||
{
|
||||
retValue = apply_YDI(A_Asset_ID, A_Asset_Adjustment, A_PeriodNo, PostingType, A_Asset_Acct_ID);
|
||||
}
|
||||
else if (depreciationType.equalsIgnoreCase("LDI"))
|
||||
{
|
||||
retValue = apply_LDI(A_Asset_ID, A_Asset_Adjustment, A_PeriodNo, PostingType, A_Asset_Acct_ID);
|
||||
}
|
||||
else
|
||||
{
|
||||
String sql = "{ ? = call "+ depreciationType + "(?, ?, ?, ?, ?) }";
|
||||
CallableStatement cs = null;
|
||||
try
|
||||
{
|
||||
cs = DB.prepareCall(sql);
|
||||
cs.registerOutParameter(1, java.sql.Types.DECIMAL);
|
||||
cs.setInt(2, A_Asset_ID);
|
||||
cs.setBigDecimal(3, A_Asset_Adjustment);
|
||||
cs.setInt(4, A_PeriodNo);
|
||||
cs.setString(5, PostingType);
|
||||
cs.setInt(6, A_Asset_Acct_ID);
|
||||
cs.execute();
|
||||
retValue = cs.getBigDecimal(1);
|
||||
cs.close();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
throw new DBException(e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(cs);
|
||||
cs = null;
|
||||
}
|
||||
}
|
||||
//
|
||||
if (retValue == null)
|
||||
{
|
||||
retValue = BigDecimal.ZERO;
|
||||
}
|
||||
//
|
||||
if(CLogMgt.isLevelFine()) log.fine("Leaving: retValue=" + retValue);
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/** MDI - adjustment is made in the current month
|
||||
*
|
||||
*/
|
||||
public BigDecimal apply_MDI (int A_Asset_ID, BigDecimal A_Asset_Adjustment, int A_PeriodNo, String PostingType, int A_Asset_Acct_ID)
|
||||
{
|
||||
return A_Asset_Adjustment;
|
||||
}
|
||||
|
||||
/** YDI -adjustment is made for periods of the year remains
|
||||
*
|
||||
*/
|
||||
public BigDecimal apply_YDI (int A_Asset_ID, BigDecimal A_Asset_Adjustment, int A_PeriodNo, String PostingType, int A_Asset_Acct_ID)
|
||||
{
|
||||
BigDecimal remainingPeriods = new BigDecimal(12 - A_PeriodNo);
|
||||
if (remainingPeriods.signum() == 0) {
|
||||
log.warning("A_PeriodNo=" + A_PeriodNo + " => remainingPeriods=" + remainingPeriods);
|
||||
}
|
||||
BigDecimal periodAdjustment = A_Asset_Adjustment.divide(remainingPeriods, getPrecision(), RoundingMode.HALF_UP);
|
||||
|
||||
if(CLogMgt.isLevelFine()) {
|
||||
log.fine("A_Asset_Adjustment=" + A_Asset_Adjustment + ", remainingPeriods=" + remainingPeriods + " => periodAdjustment=" + periodAdjustment);
|
||||
}
|
||||
return periodAdjustment;
|
||||
}
|
||||
|
||||
/** LDI - adjustment is made on the remaining life
|
||||
*
|
||||
*/
|
||||
public BigDecimal apply_LDI (int A_Asset_ID, BigDecimal A_Asset_Adjustment, int A_PeriodNo, String PostingType, int A_Asset_Acct_ID)
|
||||
{
|
||||
MDepreciationWorkfile wk = MDepreciationWorkfile.get(getCtx(), A_Asset_ID, PostingType);
|
||||
|
||||
int A_Life_Period = wk.getA_Life_Period();
|
||||
int A_Period_Posted = wk.getA_Period_Posted();
|
||||
BigDecimal remainingPeriods = new BigDecimal(A_Life_Period - A_Period_Posted + 1);
|
||||
if (remainingPeriods.signum() == 0) {
|
||||
log.warning("A_Life_Period=" + A_Life_Period + ", A_Period_Posted=" + A_Period_Posted + " => remainingPeriods=" + remainingPeriods);
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
BigDecimal periodAdjustment = A_Asset_Adjustment.divide(remainingPeriods, getPrecision(), RoundingMode.HALF_UP);
|
||||
|
||||
if(CLogMgt.isLevelFine()) {
|
||||
log.fine("A_Asset_Adjustment=" + A_Asset_Adjustment + ", remainingPeriods=" + remainingPeriods + " => periodAdjustment=" + periodAdjustment);
|
||||
}
|
||||
return periodAdjustment;
|
||||
}
|
||||
}
|
|
@ -1,38 +1,39 @@
|
|||
/******************************************************************************
|
||||
* The contents of this file are subject to the Compiere License Version 1.1
|
||||
* ("License"); You may not use this file except in compliance with the License
|
||||
* You may obtain a copy of the License at http://www.compiere.org/license.html
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is Compiere ERP & CRM Smart Business Solution
|
||||
* The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
|
||||
* Portions created by Jorg Janke are Copyright (C) 1999-2003 Jorg Janke, parts
|
||||
* created by ComPiere are Copyright (C) ComPiere, Inc.; All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
*****************************************************************************/
|
||||
package org.compiere.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collection;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.adempiere.exceptions.AdempiereException;
|
||||
import org.apache.commons.collections.keyvalue.MultiKey;
|
||||
import org.compiere.model.Query;
|
||||
import org.compiere.util.CCache;
|
||||
import org.compiere.util.CLogMgt;
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.TimeUtil;
|
||||
import org.idempiere.fa.feature.UseLife;
|
||||
import org.idempiere.fa.feature.UseLifeImpl;
|
||||
|
||||
|
||||
/**
|
||||
* Depreciation Workfile Model
|
||||
*
|
||||
*
|
||||
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
||||
*/
|
||||
public class MDepreciationWorkfile extends X_A_Depreciation_Workfile
|
||||
implements UseLife
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 9075233803956474274L;
|
||||
private static final long serialVersionUID = -3814417671427820714L;
|
||||
|
||||
/**
|
||||
* Default Constructor X_A_Depreciation_Workfile
|
||||
* Default Constructor
|
||||
* @param ctx context
|
||||
* @param M_InventoryLine_ID line
|
||||
*/
|
||||
|
@ -41,9 +42,15 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile
|
|||
super (ctx,A_Depreciation_Workfile_ID, trxName);
|
||||
if (A_Depreciation_Workfile_ID == 0)
|
||||
{
|
||||
//
|
||||
setPostingType(POSTINGTYPE_Actual);
|
||||
setA_QTY_Current(Env.ZERO);
|
||||
setA_Asset_Cost(Env.ZERO);
|
||||
setA_Accumulated_Depr(Env.ZERO);
|
||||
setA_Period_Posted(0);
|
||||
setA_Current_Period(0);
|
||||
}
|
||||
} // MAssetAddition
|
||||
} // MDepreciationWorkfile
|
||||
|
||||
/**
|
||||
* Load Constructor
|
||||
* @param ctx context
|
||||
|
@ -52,71 +59,733 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile
|
|||
public MDepreciationWorkfile (Properties ctx, ResultSet rs, String trxName)
|
||||
{
|
||||
super (ctx, rs, trxName);
|
||||
} // MInventoryLine
|
||||
|
||||
} // MDepreciationWorkfile
|
||||
|
||||
/** Asset (parent) */
|
||||
private MAsset m_asset = null;
|
||||
|
||||
/** Get Asset */
|
||||
public MAsset getAsset() {
|
||||
return getAsset(false);
|
||||
}
|
||||
|
||||
/** Get asset using this trxName
|
||||
* @param requery requery asset
|
||||
* @return parent asset
|
||||
*/
|
||||
public MAsset getAsset(boolean requery)
|
||||
{
|
||||
if (m_asset == null || requery) {
|
||||
m_asset = MAsset.get(getCtx(), getA_Asset_ID(), get_TrxName());
|
||||
}
|
||||
if (m_asset.get_ID() <= 0) {
|
||||
m_asset = null;
|
||||
}
|
||||
return m_asset;
|
||||
}
|
||||
|
||||
/** Set asset
|
||||
* @param asset
|
||||
*/
|
||||
public void setAsset(MAsset asset)
|
||||
{
|
||||
setA_Asset_ID(asset.get_ID());
|
||||
m_asset = asset;
|
||||
}
|
||||
|
||||
/** Gets asset's service date (commissioning)
|
||||
* @return asset service date
|
||||
*/
|
||||
|
||||
public Timestamp getAssetServiceDate()
|
||||
{
|
||||
MAsset asset = getAsset();
|
||||
if (asset == null) {
|
||||
return null;
|
||||
}
|
||||
return asset.getAssetServiceDate();
|
||||
}
|
||||
|
||||
|
||||
/** Gets asset's class
|
||||
* @return asset class id
|
||||
*/
|
||||
/* commented out by @win
|
||||
public int getA_Asset_Class_ID()
|
||||
{
|
||||
MAsset asset = getAsset();
|
||||
if (asset == null) {
|
||||
return 0;
|
||||
}
|
||||
return asset.getA_Asset_Class_ID();
|
||||
}
|
||||
*/ // end comment by @win
|
||||
|
||||
/** After save
|
||||
* @param newRecord
|
||||
* @return true on success
|
||||
*/
|
||||
protected boolean afterSave (boolean newRecord)
|
||||
{
|
||||
|
||||
log.info ("beforeSave");
|
||||
//int p_A_Asset_ID = 0;
|
||||
int p_wkasset_ID = 0;
|
||||
//p_A_Asset_ID = getA_Asset_ID();
|
||||
p_wkasset_ID = getA_Depreciation_Workfile_ID();
|
||||
StringBuilder sqlB = new StringBuilder ("UPDATE A_Depreciation_Workfile ")
|
||||
.append("SET Processing = 'Y'")
|
||||
.append(" WHERE A_Depreciation_Workfile_ID = " ).append(p_wkasset_ID );
|
||||
|
||||
int no = DB.executeUpdate (sqlB.toString(),null);
|
||||
if (no == -1)
|
||||
log.info("Update to Deprecaition Workfile failed");
|
||||
if(m_buildDepreciation)
|
||||
{
|
||||
buildDepreciation();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* after Save
|
||||
* @param newRecord new
|
||||
* @return true
|
||||
*/
|
||||
|
||||
protected boolean beforeSave (boolean newRecord)
|
||||
{
|
||||
log.info ("Entering: trxName=" + get_TrxName());
|
||||
|
||||
log.info ("beforeSave");
|
||||
int p_A_Asset_ID = 0;
|
||||
//int p_wkasset_ID = 0;
|
||||
p_A_Asset_ID = getA_Asset_ID();
|
||||
//p_wkasset_ID = getA_Depreciation_Workfile_ID();
|
||||
// copy UseLife to A_Life
|
||||
if (newRecord) { //@win: should only update only if newrecord
|
||||
setA_Life_Period(getUseLifeMonths());
|
||||
setA_Asset_Life_Years(getUseLifeYears());
|
||||
setA_Life_Period_F(getUseLifeMonths_F());
|
||||
setA_Asset_Life_Years_F(getUseLifeYears_F());
|
||||
}
|
||||
|
||||
log.info ("afterSave");
|
||||
X_A_Asset asset = new X_A_Asset (getCtx(), p_A_Asset_ID, null);
|
||||
asset.setA_QTY_Current(getA_QTY_Current());
|
||||
asset.setA_QTY_Original(getA_QTY_Current());
|
||||
asset.saveEx();
|
||||
|
||||
if (getA_Accumulated_Depr().equals(null))
|
||||
setA_Accumulated_Depr(new BigDecimal(0.0));
|
||||
|
||||
if (new BigDecimal(getA_Period_Posted()).equals(null))
|
||||
setA_Period_Posted(0);
|
||||
|
||||
|
||||
MAssetChange change = new MAssetChange (getCtx(), 0,null);
|
||||
log.info("0");
|
||||
String sql2 = "SELECT COUNT(*) FROM A_Depreciation_Workfile WHERE A_Asset_ID=? AND PostingType = ?";
|
||||
if (DB.getSQLValue(null, sql2, p_A_Asset_ID,getPostingType())!= 0)
|
||||
// If it is fully amortized, change the state's FA
|
||||
MAsset asset = getAsset(true);
|
||||
if (MAsset.A_ASSET_STATUS_Activated.equals(asset.getA_Asset_Status())
|
||||
&& isFullyDepreciated())
|
||||
{
|
||||
change.setA_Asset_ID(p_A_Asset_ID);
|
||||
change.setChangeType("BAL");
|
||||
change.setTextDetails(MRefList.getListDescription (getCtx(),"A_Update_Type" , "BAL"));
|
||||
change.setPostingType(getPostingType());
|
||||
change.setAssetValueAmt(getA_Asset_Cost());
|
||||
change.setA_QTY_Current(getA_QTY_Current());
|
||||
change.setA_QTY_Original(getA_QTY_Current());
|
||||
change.setAssetAccumDepreciationAmt(getA_Accumulated_Depr());
|
||||
change.saveEx();
|
||||
}
|
||||
return true;
|
||||
asset.changeStatus(MAsset.A_ASSET_STATUS_Depreciated, null);
|
||||
asset.saveEx();
|
||||
}
|
||||
|
||||
// Fix DateAcct
|
||||
if(is_ValueChanged(COLUMNNAME_DateAcct))
|
||||
{
|
||||
setDateAcct(TimeUtil.getMonthLastDay(getDateAcct()));
|
||||
}
|
||||
|
||||
//
|
||||
BigDecimal cost = getA_Asset_Cost();
|
||||
BigDecimal accumDep_C = getA_Accumulated_Depr();
|
||||
setA_Asset_Remaining(cost.subtract(accumDep_C));
|
||||
BigDecimal accumDep_F = getA_Accumulated_Depr_F();
|
||||
setA_Asset_Remaining_F(cost.subtract(accumDep_F));
|
||||
|
||||
// Financing
|
||||
{
|
||||
String mainColumnName = null;
|
||||
if (newRecord || is_ValueChanged(COLUMNNAME_A_Asset_Cost))
|
||||
{
|
||||
mainColumnName = COLUMNNAME_A_Asset_Cost;
|
||||
}
|
||||
else if (is_ValueChanged(COLUMNNAME_A_Valoare_Cofinantare))
|
||||
{
|
||||
mainColumnName = COLUMNNAME_A_Valoare_Cofinantare;
|
||||
}
|
||||
else if (is_ValueChanged(COLUMNNAME_A_Valoare_Tert))
|
||||
{
|
||||
mainColumnName = COLUMNNAME_A_Valoare_Tert;
|
||||
}
|
||||
updateFinantare(this, mainColumnName);
|
||||
}
|
||||
|
||||
|
||||
log.info("Leaving: trxName=" + get_TrxName() + " [RETURN TRUE]");
|
||||
return true;
|
||||
} // beforeSave
|
||||
|
||||
/**
|
||||
* Asset is fully depreciated
|
||||
* <ul>
|
||||
* <li>If PostingType != ACTUAL then return false
|
||||
* <li>Do not check your current asset
|
||||
* </ul>
|
||||
* @return true if the asset is fully depreciated, false otherwise
|
||||
*/
|
||||
public boolean isFullyDepreciated()
|
||||
{
|
||||
if(!getPostingType().equals(POSTINGTYPE_Actual))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// check if is fully depreciated
|
||||
BigDecimal remainingAmt_C = getRemainingCost(null, false);
|
||||
BigDecimal remainingAmt_F = getRemainingCost(null, true);
|
||||
if(remainingAmt_C.signum() == 0 && remainingAmt_F.signum() == 0)
|
||||
{
|
||||
//if A_Asset_Cost is 0 have a voided addition, in this case asset is not full depreciated
|
||||
if (getA_Asset_Cost().signum() == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
//
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public MDepreciationWorkfile(MAsset asset, String postingType, MAssetGroupAcct assetgrpacct)
|
||||
{
|
||||
this(asset.getCtx(), 0, asset.get_TrxName());
|
||||
setA_Asset_ID(asset.getA_Asset_ID());
|
||||
setAD_Org_ID(asset.getAD_Org_ID()); //@win added
|
||||
setA_Asset_Cost(asset.getA_Asset_Cost());
|
||||
setA_Accumulated_Depr(asset.getA_Accumulated_Depr());
|
||||
setA_Accumulated_Depr_F(asset.getA_Accumulated_Depr_F());
|
||||
setA_Current_Period(asset.getA_Current_Period());
|
||||
|
||||
setIsDepreciated(asset.isDepreciated());
|
||||
setPostingType(postingType);
|
||||
//
|
||||
// Copy UseLife values from asset group to workfile
|
||||
if (assetgrpacct == null)
|
||||
{
|
||||
assetgrpacct = MAssetGroupAcct.forA_Asset_Group_ID(asset.getCtx(), asset.getA_Asset_Group_ID(), postingType);
|
||||
}
|
||||
UseLifeImpl.copyValues(this, assetgrpacct);
|
||||
|
||||
//
|
||||
// Set Date Acct from Asset
|
||||
Timestamp dateAcct = asset.getDateAcct();
|
||||
if (dateAcct != null)
|
||||
{
|
||||
dateAcct = TimeUtil.addMonths(dateAcct, 1);
|
||||
setDateAcct(dateAcct);
|
||||
}
|
||||
//
|
||||
// Set UseLife values from asset (if any)
|
||||
if (asset.getUseLifeMonths() > 0)
|
||||
{
|
||||
UseLifeImpl.get(this, false).setUseLifeMonths(asset.getUseLifeMonths());
|
||||
}
|
||||
if (asset.getUseLifeMonths_F() > 0)
|
||||
{
|
||||
UseLifeImpl.get(this, true).setUseLifeMonths(asset.getUseLifeMonths_F());
|
||||
}
|
||||
//
|
||||
dump();
|
||||
}
|
||||
|
||||
/** Logger */
|
||||
private CLogger log = CLogger.getCLogger(getClass());
|
||||
|
||||
public static Collection<MDepreciationWorkfile> forA_Asset_ID(Properties ctx, int asset_id, String trxName)
|
||||
{
|
||||
return new Query(ctx, Table_Name, MDepreciationWorkfile.COLUMNNAME_A_Asset_ID+"=?", trxName)
|
||||
.setParameters(new Object[]{asset_id})
|
||||
.list();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param ctx
|
||||
* @param A_Asset_ID
|
||||
* @param postingType
|
||||
* @return workfile
|
||||
* @see #get(Properties, int, String, String)
|
||||
*/
|
||||
public static MDepreciationWorkfile get (Properties ctx, int A_Asset_ID, String postingType)
|
||||
{
|
||||
return get(ctx, A_Asset_ID, postingType, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get/load workfile from cache (if trxName is null)
|
||||
* @param ctx
|
||||
* @param A_Asset_ID
|
||||
* @param postingType
|
||||
* @param trxName
|
||||
* @return workfile
|
||||
*/
|
||||
public static MDepreciationWorkfile get (Properties ctx, int A_Asset_ID, String postingType, String trxName)
|
||||
{
|
||||
if (A_Asset_ID <= 0 || postingType == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
final MultiKey key = new MultiKey(A_Asset_ID, postingType);
|
||||
if (trxName == null)
|
||||
{
|
||||
MDepreciationWorkfile wk = s_cacheAsset.get(key);
|
||||
if (wk != null)
|
||||
return wk;
|
||||
}
|
||||
/* @win temporary change as this code is causing duplicate create MDepreciationWorkfile on asset addition
|
||||
final String whereClause = COLUMNNAME_A_Asset_ID+"=?"
|
||||
+" AND "+COLUMNNAME_PostingType+"=? AND "+COLUMNNAME_A_QTY_Current+">?";
|
||||
MDepreciationWorkfile wk = new Query(ctx, MDepreciationWorkfile.Table_Name, whereClause, trxName)
|
||||
.setParameters(new Object[]{A_Asset_ID, postingType, 0})
|
||||
.firstOnly();
|
||||
*/
|
||||
final String whereClause = COLUMNNAME_A_Asset_ID+"=?"
|
||||
+" AND "+COLUMNNAME_PostingType+"=? ";
|
||||
MDepreciationWorkfile wk = new Query(ctx, MDepreciationWorkfile.Table_Name, whereClause, trxName)
|
||||
.setParameters(new Object[]{A_Asset_ID, postingType})
|
||||
.firstOnly();
|
||||
|
||||
|
||||
if (trxName == null && wk != null)
|
||||
{
|
||||
s_cacheAsset.put(key, wk);
|
||||
}
|
||||
return wk;
|
||||
}
|
||||
/** Static cache: Asset/PostingType -> Workfile */
|
||||
private static CCache<MultiKey, MDepreciationWorkfile>
|
||||
s_cacheAsset = new CCache<MultiKey, MDepreciationWorkfile>(Table_Name+"_Asset", 10);
|
||||
|
||||
/** Returns the date of the last action
|
||||
*/
|
||||
public Timestamp getLastActionDate()
|
||||
{
|
||||
return TimeUtil.getMonthLastDay(TimeUtil.addMonths(getDateAcct(), -1));
|
||||
}
|
||||
|
||||
/** Check if the asset is depreciated at the specified date
|
||||
* @param date
|
||||
* @return true if you amortized until the specified date, otherwise false
|
||||
*/
|
||||
public boolean isDepreciated(Timestamp date)
|
||||
{
|
||||
Timestamp lastActionDate = getLastActionDate();
|
||||
boolean isDepr = !date.after(lastActionDate); // date <= lastActionDate
|
||||
|
||||
log.fine("LastActionDate=" + lastActionDate + ", GivenDate=" + date + " => isDepreciated=" + isDepr);
|
||||
return isDepr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Asset Accounting for this workfile
|
||||
* @return asset accounting model
|
||||
*/
|
||||
public MAssetAcct getA_AssetAcct(Timestamp dateAcct, String trxName)
|
||||
{
|
||||
return MAssetAcct.forA_Asset_ID(getCtx(), getA_Asset_ID(), getPostingType(), dateAcct, trxName);
|
||||
}
|
||||
|
||||
} // MAssetAddition
|
||||
/** Returns the current cost of FAs. It is calculated as the difference between acquisition value and the value that you (A_Salvage_Value)
|
||||
* @return the current cost of FAs
|
||||
*/
|
||||
public BigDecimal getActualCost()
|
||||
{
|
||||
return getActualCost(getA_Asset_Cost());
|
||||
}
|
||||
|
||||
/** */
|
||||
public BigDecimal getActualCost(BigDecimal assetCost)
|
||||
{
|
||||
return assetCost.subtract(getA_Salvage_Value());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param deltaAmt
|
||||
* @param deltaQty
|
||||
* @param reset
|
||||
*/
|
||||
public void adjustCost(BigDecimal deltaAmt, BigDecimal deltaQty, boolean reset)
|
||||
{
|
||||
BigDecimal newCost = Env.ZERO;
|
||||
BigDecimal newQty = Env.ZERO;
|
||||
if (!reset)
|
||||
{
|
||||
newCost = getA_Asset_Cost();
|
||||
newQty = getA_QTY_Current();
|
||||
}
|
||||
newCost = newCost.add(deltaAmt);
|
||||
newQty = newQty.add(deltaQty);
|
||||
|
||||
// TODO: crashes if I cancel an Issue:
|
||||
// if (newQty.signum() < 0) {
|
||||
// throw new ArhRuntimeException(getCtx(), "@A_QTY_Current@ < 0");
|
||||
// }
|
||||
|
||||
//
|
||||
// There must be verified that the remaining value to be greater than the amount diminished
|
||||
// total devaluation because if the entire asset value (A_Asset_Cost) must be brought to 0.
|
||||
// if (deltaAmt.signum() < 0)
|
||||
// {
|
||||
// BigDecimal remainingAmt_C = getRemainingCost(null, false);
|
||||
// if (remainingAmt_C.compareTo(deltaAmt.negate()) < 0)
|
||||
// {
|
||||
// throw new ArhRuntimeException(getCtx(), "@A_Asset_Remaining@ < @DeltaAmt@")
|
||||
// .addInfo("@A_Asset_Cost@=", getA_Asset_Cost())
|
||||
// .addInfo("@A_Accumulated_Depr@=", getA_Accumulated_Depr());
|
||||
// }
|
||||
// BigDecimal remainingAmt_F = getRemainingCost(null, true);
|
||||
// if (remainingAmt_F.compareTo(deltaAmt.negate()) < 0)
|
||||
// {
|
||||
// throw new ArhRuntimeException(getCtx(), "@A_Asset_Remaining_F@ < @DeltaAmt@")
|
||||
// .addInfo("@A_Asset_Cost=@", getA_Asset_Cost())
|
||||
// .addInfo("@A_Accumulated_Depr@=", getA_Accumulated_Depr_F());
|
||||
// }
|
||||
// }
|
||||
|
||||
setA_Asset_Cost(newCost);
|
||||
setA_QTY_Current(newQty);
|
||||
|
||||
if(CLogMgt.isLevelFine()) log.fine("adjustCost(" + deltaAmt + ", " + deltaQty + ", reset=" + reset + ") => amt=" + getA_Asset_Cost() + ", qty=" + getA_QTY_Current());
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjust Accumulated depreciation
|
||||
* @param amt
|
||||
* @param amt_F
|
||||
* @param reset
|
||||
* @return
|
||||
*/
|
||||
public boolean adjustAccumulatedDepr(BigDecimal amt, BigDecimal amt_F, boolean reset)
|
||||
{
|
||||
if (amt == null)
|
||||
{
|
||||
amt = Env.ZERO;
|
||||
}
|
||||
if (amt_F == null)
|
||||
{
|
||||
amt_F = Env.ZERO;
|
||||
}
|
||||
setA_Accumulated_Depr(amt.add(reset ? Env.ZERO : getA_Accumulated_Depr()));
|
||||
setA_Accumulated_Depr_F(amt_F.add(reset ? Env.ZERO : getA_Accumulated_Depr_F()));
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjust use life years
|
||||
*/
|
||||
public void adjustUseLife(int deltaUseLifeYears, int deltaUseLifeYears_F, boolean reset)
|
||||
{
|
||||
if(CLogMgt.isLevelFine()) log.fine("Entering: deltaUseLifeYears=" + deltaUseLifeYears + ", deltaUseLifeYears_F=" + deltaUseLifeYears_F);
|
||||
//
|
||||
UseLifeImpl.get(this, false).adjustUseLifeYears(deltaUseLifeYears, reset);
|
||||
UseLifeImpl.get(this, true).adjustUseLifeYears(deltaUseLifeYears_F, reset);
|
||||
//
|
||||
if(CLogMgt.isLevelFine()) log.fine("Leaving");
|
||||
}
|
||||
|
||||
/** */
|
||||
public int getUseLifeMonths(boolean fiscal)
|
||||
{
|
||||
return fiscal ? getUseLifeMonths_F() : getUseLifeMonths();
|
||||
}
|
||||
|
||||
/** */
|
||||
public BigDecimal getA_Accumulated_Depr(boolean fiscal)
|
||||
{
|
||||
return fiscal ? getA_Accumulated_Depr_F() : getA_Accumulated_Depr();
|
||||
}
|
||||
|
||||
/** */
|
||||
public BigDecimal getAccumulatedCost()
|
||||
{
|
||||
return getA_Accumulated_Depr(isFiscal());
|
||||
}
|
||||
|
||||
/** */
|
||||
public BigDecimal getReevaluationCost()
|
||||
{
|
||||
return Env.ZERO;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the residual (remaining) value
|
||||
*/
|
||||
public BigDecimal getRemainingCost(BigDecimal accumAmt, boolean fiscal)
|
||||
{
|
||||
BigDecimal cost = getActualCost();
|
||||
if (accumAmt == null) {
|
||||
accumAmt = getA_Accumulated_Depr(fiscal);
|
||||
}
|
||||
return cost.subtract(accumAmt);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the residual (remaining) value
|
||||
*/
|
||||
public BigDecimal getRemainingCost(BigDecimal accumAmt)
|
||||
{
|
||||
return getRemainingCost(accumAmt, isFiscal());
|
||||
}
|
||||
|
||||
/** */
|
||||
public int getRemainingPeriods(int A_Current_Period, MDepreciation method)
|
||||
{
|
||||
int useLifePeriods = getUseLifeMonths(isFiscal());
|
||||
if (method != null) {
|
||||
useLifePeriods += method.getFixMonthOffset();
|
||||
}
|
||||
int currentPeriod = (A_Current_Period >= 0 ? A_Current_Period : getA_Current_Period());
|
||||
return useLifePeriods - currentPeriod;
|
||||
}
|
||||
/** */
|
||||
public int getRemainingPeriods(int A_Current_Period)
|
||||
{
|
||||
return getRemainingPeriods(A_Current_Period, null);
|
||||
}
|
||||
|
||||
/** */
|
||||
private boolean m_isFiscal = false;
|
||||
/** */
|
||||
public boolean isFiscal()
|
||||
{
|
||||
return m_isFiscal;
|
||||
}
|
||||
/**
|
||||
* Set fiscal flag (temporary - is not modifing the workfile)
|
||||
* @param fiscal
|
||||
*/
|
||||
public void setFiscal(boolean fiscal)
|
||||
{
|
||||
m_isFiscal = fiscal;
|
||||
}
|
||||
|
||||
/** Increment the current period (A_Current_Period) 1, and a month DateAcct */
|
||||
public void incA_Current_Period()
|
||||
{
|
||||
int old_period = getA_Current_Period();
|
||||
Timestamp old_date = getDateAcct();
|
||||
int new_period = old_period + 1;
|
||||
Timestamp new_date = TimeUtil.addMonths(getDateAcct(), 1);
|
||||
setA_Current_Period(new_period);
|
||||
setDateAcct(new_date);
|
||||
//
|
||||
if(CLogMgt.isLevelFine()) log.fine("(A_Current_Period, DateAcct)=(" + old_period + ", " + old_date + ")->(" + new_period + ", " + new_date + ")");
|
||||
}
|
||||
|
||||
/**
|
||||
* Set A Current Period (and Data Act) processed just after the last expense.
|
||||
* Do not save.
|
||||
*/
|
||||
public void setA_Current_Period()
|
||||
{
|
||||
String whereClause = MDepreciationExp.COLUMNNAME_A_Asset_ID+"=?"
|
||||
+" AND "+MDepreciationExp.COLUMNNAME_PostingType+"=?"
|
||||
+" AND "+MDepreciationExp.COLUMNNAME_Processed+"=? AND IsActive=?"
|
||||
;
|
||||
//
|
||||
MDepreciationExp depexp = new Query(getCtx(), MDepreciationExp.Table_Name, whereClause, get_TrxName())
|
||||
.setParameters(new Object[]{getA_Asset_ID(), getPostingType(), true, true})
|
||||
.setOrderBy(MDepreciationExp.COLUMNNAME_A_Period+" DESC"
|
||||
+","+MDepreciationExp.COLUMNNAME_DateAcct+" DESC")
|
||||
.first();
|
||||
if (depexp != null)
|
||||
{
|
||||
setA_Current_Period(depexp.getA_Period());
|
||||
setDateAcct(depexp.getDateAcct());
|
||||
incA_Current_Period();
|
||||
}
|
||||
else
|
||||
{
|
||||
log.info("There are no records from which to infer its");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** Build depreciation flag - if true, the depreciation should be built after save */
|
||||
private boolean m_buildDepreciation = false;
|
||||
|
||||
/**
|
||||
* Build depreciation (A_Depreciation_Exp) entries. More exactly, is deleting not Processed entries.
|
||||
* and create new ones again.
|
||||
* WARNING: IS NOT modifying workfile (this)
|
||||
*/
|
||||
|
||||
public void buildDepreciation()
|
||||
{
|
||||
if (!isDepreciated())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
StringBuffer sb = new StringBuffer();
|
||||
load(get_TrxName()); // reload workfile
|
||||
MAssetAcct assetacct = getA_AssetAcct(null, get_TrxName());
|
||||
// TODO: teo_sarca: need to evaluate what happens when we change Depreciation method !!!
|
||||
MDepreciation depreciation_C = MDepreciation.get(getCtx(), assetacct.getA_Depreciation_ID());
|
||||
MDepreciation depreciation_F = MDepreciation.get(getCtx(), assetacct.getA_Depreciation_F_ID());
|
||||
//~ int offset_C = depreciation_C.getFixMonthOffset();
|
||||
//~ int offset_F = depreciation_F.getFixMonthOffset();
|
||||
int offset_C = 0, offset_F = 0;
|
||||
|
||||
BigDecimal assetCost = getActualCost();
|
||||
BigDecimal accumDep_C = getA_Accumulated_Depr(false);
|
||||
BigDecimal accumDep_F = getA_Accumulated_Depr(true);
|
||||
int lifePeriods_C = getUseLifeMonths(false) + offset_C;
|
||||
int lifePeriods_F = getUseLifeMonths(true) + offset_F;
|
||||
int lifePeriods = (lifePeriods_C > lifePeriods_F ? lifePeriods_C : lifePeriods_F);
|
||||
BigDecimal exp_C = Env.ZERO;
|
||||
BigDecimal exp_F = Env.ZERO;
|
||||
|
||||
//logging
|
||||
if(CLogMgt.isLevelFine())
|
||||
{
|
||||
sb.append("currentPeriod=" + getA_Current_Period() + ", AssetServiceDate=" + getAssetDepreciationDate() + "\n");
|
||||
sb.append("offset: C|F=" + offset_C + "|" + offset_F + "\n");
|
||||
sb.append("life: C|F=" + lifePeriods_C + "|" + lifePeriods_F + " + offset =" + lifePeriods + "\n");
|
||||
}
|
||||
|
||||
truncDepreciation();
|
||||
int A_Current_Period = getA_Current_Period();
|
||||
for (int currentPeriod = A_Current_Period, cnt = 1; currentPeriod <= lifePeriods; currentPeriod++, cnt++)
|
||||
{
|
||||
exp_C = Env.ZERO;
|
||||
exp_F = Env.ZERO;
|
||||
|
||||
String help = "" + accumDep_C + "|" + accumDep_F + " + ";
|
||||
|
||||
if (lifePeriods_C > currentPeriod || !depreciation_C.requireLastPeriodAdjustment())
|
||||
{
|
||||
setFiscal(false);
|
||||
exp_C = depreciation_C.invoke(this, assetacct, currentPeriod, accumDep_C);
|
||||
accumDep_C = accumDep_C.add(exp_C);
|
||||
}
|
||||
else if (lifePeriods_C == currentPeriod)
|
||||
{ // last period
|
||||
exp_C = assetCost.subtract(accumDep_C);
|
||||
accumDep_C = assetCost;
|
||||
}
|
||||
|
||||
if (lifePeriods_F > currentPeriod || !depreciation_F.requireLastPeriodAdjustment())
|
||||
{
|
||||
setFiscal(true);
|
||||
exp_F = depreciation_F.invoke(this, assetacct, currentPeriod, accumDep_F);
|
||||
accumDep_F = accumDep_F.add(exp_F);
|
||||
}
|
||||
else if (lifePeriods_F == currentPeriod)
|
||||
{ // last period (fiscal)
|
||||
exp_F = assetCost.subtract(accumDep_F);
|
||||
accumDep_F = assetCost;
|
||||
}
|
||||
|
||||
help += "" + exp_C + "|" + exp_F + " = " + accumDep_C + "|" + accumDep_F;
|
||||
|
||||
// added by zuhri
|
||||
int months = 0;
|
||||
|
||||
months = months + (currentPeriod - A_Current_Period);
|
||||
Timestamp dateAcct = TimeUtil.getMonthLastDay(TimeUtil.addMonths(getDateAcct(), months));
|
||||
|
||||
MDepreciationExp.createDepreciation (this, currentPeriod, dateAcct,
|
||||
exp_C, exp_F,
|
||||
accumDep_C, accumDep_F,
|
||||
help, get_TrxName());
|
||||
if(CLogMgt.isLevelFine())
|
||||
{
|
||||
String info = "" + cnt + ": period=" + currentPeriod + "/" + lifePeriods_C + "|" + lifePeriods_F
|
||||
+ ", exp=" + exp_C + "|" + exp_F + ", accumDep=" + accumDep_C + "|" + accumDep_F
|
||||
+ ", DateAcct=" + dateAcct;
|
||||
log.fine("=> " + info + Env.NL + Env.NL);
|
||||
sb.append(info + Env.NL);
|
||||
}
|
||||
} // for
|
||||
log.fine(sb.toString());
|
||||
|
||||
m_buildDepreciation = false;
|
||||
} // buildDepreciation
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Truncate not processed depreciation entries.
|
||||
* IS NOT modifying workfile.
|
||||
*/
|
||||
public void truncDepreciation()
|
||||
{
|
||||
String trxName = get_TrxName();
|
||||
|
||||
int A_Current_Period = getA_Current_Period();
|
||||
final String sql = "DELETE FROM "+MDepreciationExp.Table_Name
|
||||
+" WHERE "
|
||||
+MDepreciationExp.COLUMNNAME_Processed+"=?"
|
||||
+" AND "+MDepreciationExp.COLUMNNAME_A_Period+">=?"
|
||||
+" AND "+MDepreciationExp.COLUMNNAME_A_Asset_ID+"=?"
|
||||
+" AND "+MDepreciationExp.COLUMNNAME_PostingType+"=?"
|
||||
;
|
||||
Object[] params = new Object[]{false, A_Current_Period, getA_Asset_ID(), getPostingType()};
|
||||
int no = DB.executeUpdateEx(sql, params, trxName);
|
||||
log.fine("sql=" + sql + "\nDeleted #" + no);
|
||||
} // truncDepreciation
|
||||
|
||||
/**
|
||||
* Update Founding Mode related fields
|
||||
* @param m model
|
||||
* @param changedColumnName column name that has been changed
|
||||
*/
|
||||
public static void updateFinantare(SetGetModel m, String changedColumnName)
|
||||
{
|
||||
//Own contribution:
|
||||
BigDecimal valCofinantare = SetGetUtil.get_AttrValueAsBigDecimal(m, COLUMNNAME_A_Valoare_Cofinantare);
|
||||
// Asset Value:
|
||||
BigDecimal assetCost = SetGetUtil.get_AttrValueAsBigDecimal(m, COLUMNNAME_A_Asset_Cost);
|
||||
// Third value:
|
||||
BigDecimal valTert = SetGetUtil.get_AttrValueAsBigDecimal(m, COLUMNNAME_A_Valoare_Tert);
|
||||
|
||||
// Calculate values
|
||||
if (valCofinantare.signum() == 0 && valTert.signum() == 0)
|
||||
{
|
||||
// Values have never been set, so put everything on their own financing
|
||||
valCofinantare = assetCost;
|
||||
valTert = Env.ZERO;
|
||||
}
|
||||
else if (COLUMNNAME_A_Asset_Cost.equals(changedColumnName))
|
||||
{
|
||||
valCofinantare = assetCost.subtract(valTert);
|
||||
}
|
||||
else if (COLUMNNAME_A_Valoare_Cofinantare.equals(changedColumnName))
|
||||
{
|
||||
valTert = assetCost.subtract(valCofinantare);
|
||||
}
|
||||
else if (COLUMNNAME_A_Valoare_Tert.equals(changedColumnName))
|
||||
{
|
||||
valCofinantare = assetCost.subtract(valTert);
|
||||
}
|
||||
else
|
||||
{
|
||||
valTert = assetCost.subtract(valCofinantare);
|
||||
}
|
||||
|
||||
// Financing Type
|
||||
String tipFinantare = A_TIP_FINANTARE_Cofinantare;
|
||||
if (valTert.signum() == 0)
|
||||
{
|
||||
tipFinantare = A_TIP_FINANTARE_Proprie;
|
||||
}
|
||||
else if (valCofinantare.signum() == 0)
|
||||
{
|
||||
tipFinantare = A_TIP_FINANTARE_Terti;
|
||||
}
|
||||
//
|
||||
// Set values
|
||||
m.set_AttrValue(COLUMNNAME_A_Tip_Finantare, tipFinantare);
|
||||
m.set_AttrValue(COLUMNNAME_A_Valoare_Cofinantare, valCofinantare);
|
||||
m.set_AttrValue(COLUMNNAME_A_Valoare_Tert, valTert);
|
||||
//
|
||||
// If the method is invoked for a persistent object when reset mode of financing
|
||||
if (A_TIP_FINANTARE_Proprie.equals(tipFinantare) && SetGetUtil.isPersistent(m))
|
||||
{
|
||||
m.set_AttrValue(COLUMNNAME_A_FundingMode_ID, null);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean set_AttrValue(String ColumnName, Object value) {
|
||||
int index = get_ColumnIndex(ColumnName);
|
||||
if (index < 0)
|
||||
return false;
|
||||
return set_ValueNoCheck(ColumnName, value);
|
||||
}
|
||||
public Object get_AttrValue(String ColumnName) {
|
||||
int index = get_ColumnIndex(ColumnName);
|
||||
if (index < 0)
|
||||
return null;
|
||||
return get_Value(index);
|
||||
}
|
||||
public boolean is_AttrValueChanged(String ColumnName) {
|
||||
int index = get_ColumnIndex(ColumnName);
|
||||
if (index < 0)
|
||||
return false;
|
||||
return is_ValueChanged(index);
|
||||
}
|
||||
} // MDepreciationWorkfile
|
||||
|
|
|
@ -0,0 +1,330 @@
|
|||
package org.compiere.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.adempiere.exceptions.FillMandatoryException;
|
||||
import org.compiere.model.MClient;
|
||||
import org.compiere.model.MProduct;
|
||||
import org.compiere.model.MUOM;
|
||||
import org.compiere.util.CLogMgt;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.DisplayType;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.Msg;
|
||||
import org.compiere.util.Util;
|
||||
|
||||
/**
|
||||
* @author Teo Sarca, SC ARHIPAC SRL
|
||||
* @version $Id
|
||||
*/
|
||||
public class MIFixedAsset extends X_I_FixedAsset
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** Default depreciation method */
|
||||
private static final String s_defaultDepreciationType = "SL";
|
||||
|
||||
/** Standard Constructor */
|
||||
public MIFixedAsset (Properties ctx, int I_FixedAsset_ID, String trxName)
|
||||
{
|
||||
super (ctx, I_FixedAsset_ID, trxName);
|
||||
} // MIFixedAsset
|
||||
|
||||
/**
|
||||
* Load Constructor
|
||||
* @param ctx context
|
||||
* @param rs result set record
|
||||
*/
|
||||
public MIFixedAsset (Properties ctx, ResultSet rs, String trxName)
|
||||
{
|
||||
super (ctx, rs, trxName);
|
||||
} // MIFixedAsset
|
||||
|
||||
/** Create / Load product
|
||||
* @return product
|
||||
*/
|
||||
public MProduct getCreateProduct()
|
||||
{
|
||||
Properties ctx = getCtx();
|
||||
String trxName = get_TrxName();
|
||||
|
||||
int M_Product_ID = getM_Product_ID();
|
||||
if (M_Product_ID <= 0) {
|
||||
StringBuffer whereClause = new StringBuffer();
|
||||
String key = getProductValue();
|
||||
if (key == null || key.trim().length() == 0) {
|
||||
key = getName();
|
||||
whereClause.append("UPPER(Name)=");
|
||||
}
|
||||
else {
|
||||
whereClause.append("UPPER(Value)=");
|
||||
}
|
||||
if (key == null || key.trim().length() == 0) {
|
||||
throw new FillMandatoryException(COLUMNNAME_ProductValue, COLUMNNAME_Name);
|
||||
}
|
||||
key = key.toUpperCase();
|
||||
whereClause.append(DB.TO_STRING(key));
|
||||
whereClause.append(" AND AD_Client_ID=").append(getAD_Client_ID());
|
||||
String sql = "SELECT M_Product_ID FROM M_Product WHERE " + whereClause.toString();
|
||||
M_Product_ID = DB.getSQLValueEx(trxName, sql);
|
||||
log.fine("M_Product_ID=" + M_Product_ID + " -- sql=" + sql);
|
||||
}
|
||||
|
||||
MProduct prod = null;
|
||||
// Create MProduct:
|
||||
if (M_Product_ID <= 0)
|
||||
{
|
||||
prod = new MProduct(ctx, 0, trxName);
|
||||
prod.setName(getName());
|
||||
String value = getProductValue();
|
||||
if (value != null && value.trim().length() > 0) {
|
||||
prod.setValue(value);
|
||||
}
|
||||
|
||||
prod.setM_Product_Category_ID(m_M_Product_Category_ID);
|
||||
if (getC_UOM_ID() > 0)
|
||||
{
|
||||
prod.setC_UOM_ID(getC_UOM_ID());
|
||||
}
|
||||
else
|
||||
{
|
||||
prod.setC_UOM_ID(MUOM.getDefault_UOM_ID(ctx));
|
||||
}
|
||||
// Default Tax Category:
|
||||
String sql = "SELECT C_TaxCategory_ID FROM C_TaxCategory WHERE AD_Client_ID IN (0,?) ORDER BY IsDefault DESC, AD_Client_ID DESC, C_TaxCategory_ID";
|
||||
int C_TaxCategory_ID = DB.getSQLValueEx(null, sql, Env.getAD_Client_ID(ctx));
|
||||
prod.setC_TaxCategory_ID(C_TaxCategory_ID);
|
||||
//
|
||||
prod.saveEx(trxName);
|
||||
}
|
||||
else {
|
||||
prod = new MProduct(ctx, M_Product_ID, trxName);
|
||||
}
|
||||
|
||||
setProduct(prod);
|
||||
return prod;
|
||||
} // getCreateProduct
|
||||
|
||||
/**
|
||||
*/
|
||||
private void fixAmount(int idx) {
|
||||
//~ try {
|
||||
BigDecimal amt = (BigDecimal)get_Value(idx);
|
||||
if (amt == null)
|
||||
return;
|
||||
|
||||
int precision = getStdPrecision();
|
||||
BigDecimal newAmt = amt.setScale(getStdPrecision(), RoundingMode.HALF_UP);
|
||||
set_Value(idx, newAmt);
|
||||
if(CLogMgt.isLevelFine()) log.fine(getInventoryNo() + ": " + get_ColumnName(idx) + "=" + amt + "->" + newAmt + " (precision=" + precision + ")");
|
||||
//~ } catch (Exception e) {}
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
private void fixKeyValue(int idx) {
|
||||
//~ try {
|
||||
String name = (String)get_Value(idx);
|
||||
if (name == null)
|
||||
return;
|
||||
String newName = name.trim().replaceAll("[ ]+", " ");
|
||||
if(CLogMgt.isLevelFine()) log.fine(getInventoryNo() + ": " + get_ColumnName(idx) + "=[" + name + "]->[" + newName + "]");
|
||||
set_Value(idx, newName);
|
||||
//~ } catch (Exception e) {}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void process()
|
||||
{
|
||||
if (isProcessed()) {
|
||||
return ;
|
||||
}
|
||||
try {
|
||||
if (getUseLifeMonths() <= 0)
|
||||
{
|
||||
throw new FillMandatoryException(COLUMNNAME_UseLifeMonths);
|
||||
}
|
||||
/*//comment by @win
|
||||
if (getA_Asset_Class_ID() <= 0)
|
||||
{
|
||||
throw new FillMandatoryException(COLUMNNAME_A_Asset_Class_ID);
|
||||
}
|
||||
|
||||
// Fix Asset Class
|
||||
MAssetClass assetClass = MAssetClass.get(getCtx(), getA_Asset_Class_ID());
|
||||
setA_Asset_Class_Value(assetClass.getValue());
|
||||
*/ //end comment by @win
|
||||
|
||||
// Round amounts:
|
||||
int col_count = get_ColumnCount();
|
||||
for (int idx = 0; idx < col_count; idx++)
|
||||
{
|
||||
int dt = get_ColumnDisplayType(idx);
|
||||
if (DisplayType.Amount == dt)
|
||||
fixAmount(idx);
|
||||
else if (DisplayType.isText(dt))
|
||||
fixKeyValue(idx);
|
||||
}
|
||||
|
||||
// Create/Set Product
|
||||
MProduct product = getCreateProduct();
|
||||
log.fine("product=" + product);
|
||||
if (getM_Product_ID() <= 0) {
|
||||
throw new FillMandatoryException(COLUMNNAME_M_Product_ID);
|
||||
}
|
||||
|
||||
// Check Asset Group
|
||||
int A_Asset_Group_ID = getA_Asset_Group_ID();
|
||||
if (A_Asset_Group_ID <= 0)
|
||||
{
|
||||
if (m_A_Asset_Group_ID > 0) {
|
||||
A_Asset_Group_ID = m_A_Asset_Group_ID;
|
||||
}
|
||||
else {
|
||||
A_Asset_Group_ID = product.getA_Asset_Group_ID();
|
||||
}
|
||||
}
|
||||
if (A_Asset_Group_ID > 0)
|
||||
{
|
||||
setA_Asset_Group_ID(A_Asset_Group_ID);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new FillMandatoryException(COLUMNNAME_A_Asset_Group_ID);
|
||||
}
|
||||
|
||||
// Set DateAcct
|
||||
if (getA_Remaining_Period() == 0)
|
||||
{
|
||||
setDateAcct(getAssetDepreciationDate());
|
||||
}
|
||||
else
|
||||
{
|
||||
Timestamp dateAcct = getDateAcct();
|
||||
if (dateAcct == null)
|
||||
{
|
||||
dateAcct = Env.getContextAsDate(getCtx(), "#Date");
|
||||
setDateAcct(dateAcct);
|
||||
}
|
||||
}
|
||||
if (getDateAcct() == null)
|
||||
{
|
||||
throw new FillMandatoryException(COLUMNNAME_DateAcct);
|
||||
}
|
||||
|
||||
// Set Processed
|
||||
setProcessed(true);
|
||||
setI_ErrorMsg(null);
|
||||
|
||||
// Save
|
||||
saveEx();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
setError(e.getLocalizedMessage());
|
||||
saveEx();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Este MF-ul depreciat integral
|
||||
*/
|
||||
public boolean isFullyDepreciated()
|
||||
{
|
||||
BigDecimal cost = getA_Asset_Cost();
|
||||
BigDecimal depr_c = getA_Accumulated_Depr();
|
||||
BigDecimal depr_f = getA_Accumulated_Depr_F();
|
||||
|
||||
return cost.compareTo(depr_c) == 0 && cost.compareTo(depr_f) == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Asset is Depreciating
|
||||
*/
|
||||
public boolean isDepreciating()
|
||||
{
|
||||
/* commented by @win
|
||||
MAssetClass assetClass = MAssetClass.get(getCtx(), getA_Asset_Class_ID());
|
||||
if (assetClass == null)
|
||||
return false;
|
||||
return assetClass.isDepreciated();
|
||||
*/
|
||||
//change logic to assetGroup
|
||||
MAssetGroup assetGroup = MAssetGroup.get(getCtx(), getA_Asset_Group_ID());
|
||||
if (assetGroup == null)
|
||||
return false;
|
||||
return assetGroup.isDepreciated();
|
||||
//end modify by @win
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public int getA_Last_Period()
|
||||
{
|
||||
int life = getUseLifeMonths();
|
||||
int life_f = getUseLifeMonths_F();
|
||||
return life > life_f ? life : life_f;
|
||||
}
|
||||
|
||||
/** */
|
||||
private int m_M_Product_Category_ID = 0;
|
||||
public void setDefault_Product_Category_ID(int M_Product_Category_ID) {
|
||||
m_M_Product_Category_ID = M_Product_Category_ID;
|
||||
}
|
||||
|
||||
/** */
|
||||
private int m_A_Asset_Group_ID = 0;
|
||||
public void setDefault_Asset_Group_ID(int A_Asset_Group_ID) {
|
||||
m_A_Asset_Group_ID = A_Asset_Group_ID;
|
||||
}
|
||||
|
||||
/** Product */
|
||||
private MProduct m_product = null;
|
||||
public void setProduct(MProduct product) {
|
||||
m_product = product;
|
||||
setM_Product_ID(product.get_ID());
|
||||
setProductValue(product.getValue());
|
||||
if (Util.isEmpty(getName()))
|
||||
setName(product.getName());
|
||||
}
|
||||
public MProduct getProduct() {
|
||||
if (m_product == null && getM_Product_ID() > 0) {
|
||||
m_product = new MProduct(getCtx(), getM_Product_ID(), get_TrxName());
|
||||
}
|
||||
return m_product;
|
||||
}
|
||||
|
||||
/** Depreciation Method */
|
||||
public int getA_Depreciation_ID() {
|
||||
MDepreciation depr = MDepreciation.get(getCtx(), s_defaultDepreciationType);
|
||||
return depr != null ? depr.get_ID() : 0;
|
||||
}
|
||||
public int getA_Depreciation_F_ID() {
|
||||
return getA_Depreciation_ID();
|
||||
}
|
||||
|
||||
/** Currency */
|
||||
public int getStdPrecision() {
|
||||
return MClient.get(getCtx()).getAcctSchema().getStdPrecision();
|
||||
}
|
||||
|
||||
/** String representation */
|
||||
public String getSummary() {
|
||||
return getInventoryNo() + " - " + getName();
|
||||
}
|
||||
|
||||
/** Sets custom error
|
||||
*
|
||||
*/
|
||||
public void setError(String msg) {
|
||||
String msg_trl = Msg.parseTranslation(getCtx(), msg);
|
||||
setI_ErrorMsg(msg_trl);
|
||||
}
|
||||
}
|
|
@ -1482,6 +1482,7 @@ public class MInOut extends X_M_InOut implements DocAction
|
|||
if (product != null
|
||||
&& isSOTrx()
|
||||
&& product.isCreateAsset()
|
||||
&& !product.getM_Product_Category().getA_Asset_Group().isFixedAsset()
|
||||
&& sLine.getMovementQty().signum() > 0
|
||||
&& !isReversal())
|
||||
{
|
||||
|
@ -2105,8 +2106,7 @@ public class MInOut extends X_M_InOut implements DocAction
|
|||
if (asset != null)
|
||||
{
|
||||
asset.setIsActive(false);
|
||||
StringBuilder msgadd = new StringBuilder("(").append(reversal.getDocumentNo()).append(" #").append(rLine.getLine()).append("<-)");
|
||||
asset.addDescription(msgadd.toString());
|
||||
asset.setDescription(asset.getDescription() + " (" + reversal.getDocumentNo() + " #" + rLine.getLine() + "<-)");
|
||||
asset.saveEx();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,83 +1,78 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2006 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.ResultSet;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.compiere.util.Env;
|
||||
|
||||
/*******************************************************************************
|
||||
* Generated Model for A_Asset
|
||||
*
|
||||
* @version $Id: X_A_Asset.java,v 1.88 2004/08/27 21:26:37 jjanke Exp $ *
|
||||
******************************************************************************/
|
||||
public class MXIFAJournal extends X_I_FAJournal {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -3922040740843729868L;
|
||||
|
||||
public MXIFAJournal(Properties ctx, int I_FAJournal_ID, String trxName) {
|
||||
super(ctx, I_FAJournal_ID, trxName);
|
||||
if (I_FAJournal_ID == 0) {
|
||||
// setIsDepreciated (false);
|
||||
// setIsFullyDepreciated (false);
|
||||
// setValue (null);
|
||||
// setName (null);
|
||||
// setIsInPosession (false);
|
||||
// setIsOwned (false);
|
||||
// setA_Asset_Group_ID (0);
|
||||
// setIsDisposed (false);
|
||||
// setM_AttributeSetInstance_ID(0);
|
||||
}
|
||||
} // MAsset
|
||||
import java.util.*;
|
||||
import java.sql.*;
|
||||
import java.math.*;
|
||||
import org.compiere.model.*;
|
||||
import org.compiere.util.*;
|
||||
/** Generated Model for A_Asset
|
||||
** @version $Id: X_A_Asset.java,v 1.88 2004/08/27 21:26:37 jjanke Exp $ */
|
||||
public class MXIFAJournal extends X_I_FAJournal
|
||||
{
|
||||
public MXIFAJournal (Properties ctx, int I_FAJournal_ID, String trxName)
|
||||
{
|
||||
super (ctx, I_FAJournal_ID, trxName);
|
||||
// if (I_FAJournal_ID == 0)
|
||||
// {
|
||||
// setIsDepreciated (false);
|
||||
// setIsFullyDepreciated (false);
|
||||
// setValue (null);
|
||||
// setName (null);
|
||||
// setIsInPosession (false);
|
||||
// setIsOwned (false);
|
||||
// setA_Asset_Group_ID (0);
|
||||
// setIsDisposed (false);
|
||||
// setM_AttributeSetInstance_ID(0);
|
||||
// }
|
||||
} // MXIFAJournal
|
||||
|
||||
/**
|
||||
* Load Constructor
|
||||
*
|
||||
* @param ctx
|
||||
* context
|
||||
* @param rs
|
||||
* result set record
|
||||
* Load Constructor
|
||||
* @param ctx context
|
||||
* @param rs result set record
|
||||
*/
|
||||
public MXIFAJournal(Properties ctx, ResultSet rs, String trxName) {
|
||||
super(ctx, rs, trxName);
|
||||
} // MAsset
|
||||
public MXIFAJournal (Properties ctx, ResultSet rs, String trxName)
|
||||
{
|
||||
super (ctx, rs, trxName);
|
||||
} // MAsset
|
||||
|
||||
public BigDecimal getExpenseDr() {
|
||||
BigDecimal bd = getAmtAcctDr();
|
||||
return bd;
|
||||
|
||||
public BigDecimal getExpenseDr()
|
||||
{
|
||||
BigDecimal bd = getAmtAcctDr();
|
||||
return bd;
|
||||
}
|
||||
|
||||
public BigDecimal getExpenseCr() {
|
||||
BigDecimal bd = getAmtAcctCr();
|
||||
return bd;
|
||||
public BigDecimal getExpenseCr()
|
||||
{
|
||||
BigDecimal bd = getAmtAcctCr();
|
||||
return bd;
|
||||
}
|
||||
|
||||
public BigDecimal getAmtAcctTotal() {
|
||||
BigDecimal dr = getAmtAcctDr();
|
||||
BigDecimal cr = getAmtAcctCr();
|
||||
BigDecimal bd = (dr).subtract(cr);
|
||||
if (bd == null)
|
||||
return Env.ZERO;
|
||||
return bd;
|
||||
}
|
||||
public BigDecimal getAmtAcctTotal()
|
||||
{
|
||||
BigDecimal dr = getAmtAcctDr();
|
||||
BigDecimal cr = getAmtAcctCr();
|
||||
BigDecimal bd = (dr).subtract(cr);
|
||||
if (bd == null) return Env.ZERO;
|
||||
return bd;
|
||||
}
|
||||
/** Set Currency Type.
|
||||
Currency Conversion Rate Type */
|
||||
public void setC_ConversionType_ID (int C_ConversionType_ID)
|
||||
{
|
||||
if (C_ConversionType_ID == 0) set_Value ("C_ConversionType_ID", null);
|
||||
else
|
||||
set_Value ("C_ConversionType_ID", Integer.valueOf(C_ConversionType_ID));
|
||||
}
|
||||
/** Get Currency Type.
|
||||
Currency Conversion Rate Type */
|
||||
public int getC_ConversionType_ID()
|
||||
{
|
||||
Integer ii = (Integer)get_Value("C_ConversionType_ID");
|
||||
if (ii == null) return 0;
|
||||
return ii.intValue();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package org.compiere.model;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* Set Get Object interface
|
||||
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
||||
*/
|
||||
public interface SetGetModel
|
||||
{
|
||||
public Properties getCtx();
|
||||
public String get_TrxName();
|
||||
//
|
||||
public int get_Table_ID();
|
||||
public String get_TableName();
|
||||
//
|
||||
public boolean set_AttrValue(String name, Object value);
|
||||
public Object get_AttrValue(String name);
|
||||
public boolean is_AttrValueChanged(String ColumnName);
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue