IDEMPIERE-5233 - Invoice created from the Commission Run window cannot be easly found after created (#1256)

This commit is contained in:
Diego Ruiz 2022-03-18 14:37:31 +01:00 committed by GitHub
parent a7ab3a8345
commit 4f5c3360fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 137 additions and 8 deletions

View File

@ -0,0 +1,42 @@
-- IDEMPIERE-5233 - Invoice created from the Commission Run window cannot be easly found after created
SELECT register_migration_script('202203171704_IDEMPIERE-5233.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Mar 17, 2022, 5:04:47 PM CET
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,IsHtml) VALUES (214715,0,'Invoice','Invoice Identifier','The Invoice Document.',436,'C_Invoice_ID',22,'N','N','N','N','N',0,'N',30,0,0,'Y',TO_TIMESTAMP('2022-03-17 17:04:46','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-03-17 17:04:46','YYYY-MM-DD HH24:MI:SS'),100,1008,'N','N','D','N','N','N','Y','2e785622-37fb-49d3-b0a2-0794efd14079','N',0,'N','N','N')
;
-- Mar 17, 2022, 5:05:01 PM CET
UPDATE AD_Column SET FKConstraintName='CInvoice_CCommissionRun', FKConstraintType='N',Updated=TO_TIMESTAMP('2022-03-17 17:05:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=214715
;
-- Mar 17, 2022, 5:05:01 PM CET
ALTER TABLE C_CommissionRun ADD C_Invoice_ID NUMBER(10) DEFAULT NULL
;
-- Mar 17, 2022, 5:05:01 PM CET
ALTER TABLE C_CommissionRun ADD CONSTRAINT CInvoice_CCommissionRun FOREIGN KEY (C_Invoice_ID) REFERENCES c_invoice(c_invoice_id) DEFERRABLE INITIALLY DEFERRED
;
-- Mar 17, 2022, 5:05:39 PM CET
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (206917,'Invoice','Invoice Identifier','The Invoice Document.',362,214715,'Y',22,120,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-03-17 17:05:38','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-03-17 17:05:38','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','d8469e95-9b96-41d4-986f-775856d7b44a','Y',120,2)
;
-- Mar 17, 2022, 5:06:11 PM CET
UPDATE AD_Field SET AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=4, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-17 17:06:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206917
;
-- Mar 17, 2022, 5:06:32 PM CET
UPDATE AD_Field SET IsReadOnly='Y', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-17 17:06:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206917
;
-- Mar 17, 2022, 5:07:40 PM CET
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=130, IsReadOnly='Y', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-17 17:07:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4569
;
-- Mar 17, 2022, 5:10:22 PM CET
UPDATE AD_Field SET AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, ReadOnlyLogic='@Processed@=''Y''', IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-17 17:10:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4568
;

View File

@ -0,0 +1,39 @@
-- IDEMPIERE-5233 - Invoice created from the Commission Run window cannot be easly found after created
SELECT register_migration_script('202203171704_IDEMPIERE-5233.sql') FROM dual;
-- Mar 17, 2022, 5:04:47 PM CET
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,IsHtml) VALUES (214715,0,'Invoice','Invoice Identifier','The Invoice Document.',436,'C_Invoice_ID',22,'N','N','N','N','N',0,'N',30,0,0,'Y',TO_TIMESTAMP('2022-03-17 17:04:46','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-03-17 17:04:46','YYYY-MM-DD HH24:MI:SS'),100,1008,'N','N','D','N','N','N','Y','2e785622-37fb-49d3-b0a2-0794efd14079','N',0,'N','N','N')
;
-- Mar 17, 2022, 5:05:01 PM CET
UPDATE AD_Column SET FKConstraintName='CInvoice_CCommissionRun', FKConstraintType='N',Updated=TO_TIMESTAMP('2022-03-17 17:05:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=214715
;
-- Mar 17, 2022, 5:05:01 PM CET
ALTER TABLE C_CommissionRun ADD COLUMN C_Invoice_ID NUMERIC(10) DEFAULT NULL
;
-- Mar 17, 2022, 5:05:01 PM CET
ALTER TABLE C_CommissionRun ADD CONSTRAINT CInvoice_CCommissionRun FOREIGN KEY (C_Invoice_ID) REFERENCES c_invoice(c_invoice_id) DEFERRABLE INITIALLY DEFERRED
;
-- Mar 17, 2022, 5:05:39 PM CET
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (206917,'Invoice','Invoice Identifier','The Invoice Document.',362,214715,'Y',22,120,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-03-17 17:05:38','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-03-17 17:05:38','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','d8469e95-9b96-41d4-986f-775856d7b44a','Y',120,2)
;
-- Mar 17, 2022, 5:06:11 PM CET
UPDATE AD_Field SET AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=4, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-17 17:06:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206917
;
-- Mar 17, 2022, 5:06:32 PM CET
UPDATE AD_Field SET IsReadOnly='Y', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-17 17:06:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206917
;
-- Mar 17, 2022, 5:07:40 PM CET
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=130, IsReadOnly='Y', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-17 17:07:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4569
;
-- Mar 17, 2022, 5:10:22 PM CET
UPDATE AD_Field SET AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, ReadOnlyLogic='@Processed@=''Y''', IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-03-17 17:10:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4568
;

View File

@ -100,10 +100,15 @@ public class CommissionAPInvoice extends SvrProcess
iLine.setTax(); iLine.setTax();
if (!iLine.save()) if (!iLine.save())
throw new IllegalStateException("CommissionAPInvoice - cannot save Invoice Line"); throw new IllegalStateException("CommissionAPInvoice - cannot save Invoice Line");
comRun.setC_Invoice_ID(invoice.getC_Invoice_ID());
comRun.setProcessed(true);
comRun.saveEx();
// //
addBufferLog(invoice.get_ID(), null, null, Msg.getElement(getCtx(), MInvoice.COLUMNNAME_C_Invoice_ID) + " #" + invoice.getDocumentNo(), MInvoice.Table_ID, invoice.get_ID()); addBufferLog(invoice.get_ID(), null, null, Msg.getElement(getCtx(), MInvoice.COLUMNNAME_C_Invoice_ID) + " #" + invoice.getDocumentNo(), MInvoice.Table_ID, invoice.get_ID());
// //
return "@Success@"; return "@Created@";
} // doIt } // doIt
} // CommissionAPInvoice } // CommissionAPInvoice

View File

@ -22,7 +22,7 @@ import org.compiere.util.KeyNamePair;
/** Generated Interface for C_CommissionRun /** Generated Interface for C_CommissionRun
* @author iDempiere (generated) * @author iDempiere (generated)
* @version Release 9 * @version Release 10
*/ */
public interface I_C_CommissionRun public interface I_C_CommissionRun
{ {
@ -44,8 +44,8 @@ public interface I_C_CommissionRun
/** Column name AD_Client_ID */ /** Column name AD_Client_ID */
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID"; public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
/** Get Client. /** Get Tenant.
* Client/Tenant for this installation. * Tenant for this installation.
*/ */
public int getAD_Client_ID(); public int getAD_Client_ID();
@ -53,12 +53,12 @@ public interface I_C_CommissionRun
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID"; public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
/** Set Organization. /** Set Organization.
* Organizational entity within client * Organizational entity within tenant
*/ */
public void setAD_Org_ID (int AD_Org_ID); public void setAD_Org_ID (int AD_Org_ID);
/** Get Organization. /** Get Organization.
* Organizational entity within client * Organizational entity within tenant
*/ */
public int getAD_Org_ID(); public int getAD_Org_ID();
@ -99,6 +99,21 @@ public interface I_C_CommissionRun
/** Get C_CommissionRun_UU */ /** Get C_CommissionRun_UU */
public String getC_CommissionRun_UU(); public String getC_CommissionRun_UU();
/** 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 Created */ /** Column name Created */
public static final String COLUMNNAME_Created = "Created"; public static final String COLUMNNAME_Created = "Created";

View File

@ -26,7 +26,7 @@ import org.compiere.util.KeyNamePair;
/** Generated Model for C_CommissionRun /** Generated Model for C_CommissionRun
* @author iDempiere (generated) * @author iDempiere (generated)
* @version Release 9 - $Id$ */ * @version Release 10 - $Id$ */
@org.adempiere.base.Model(table="C_CommissionRun") @org.adempiere.base.Model(table="C_CommissionRun")
public class X_C_CommissionRun extends PO implements I_C_CommissionRun, I_Persistent public class X_C_CommissionRun extends PO implements I_C_CommissionRun, I_Persistent
{ {
@ -34,7 +34,7 @@ public class X_C_CommissionRun extends PO implements I_C_CommissionRun, I_Persis
/** /**
* *
*/ */
private static final long serialVersionUID = 20220116L; private static final long serialVersionUID = 20220317L;
/** Standard Constructor */ /** Standard Constructor */
public X_C_CommissionRun (Properties ctx, int C_CommissionRun_ID, String trxName) public X_C_CommissionRun (Properties ctx, int C_CommissionRun_ID, String trxName)
@ -159,6 +159,34 @@ public class X_C_CommissionRun extends PO implements I_C_CommissionRun, I_Persis
return (String)get_Value(COLUMNNAME_C_CommissionRun_UU); return (String)get_Value(COLUMNNAME_C_CommissionRun_UU);
} }
public org.compiere.model.I_C_Invoice getC_Invoice() throws RuntimeException
{
return (org.compiere.model.I_C_Invoice)MTable.get(getCtx(), org.compiere.model.I_C_Invoice.Table_ID)
.getPO(getC_Invoice_ID(), get_TrxName());
}
/** Set Invoice.
@param C_Invoice_ID Invoice Identifier
*/
public void setC_Invoice_ID (int C_Invoice_ID)
{
if (C_Invoice_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_Invoice_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_Invoice_ID, Integer.valueOf(C_Invoice_ID));
}
/** Get Invoice.
@return Invoice Identifier
*/
public int getC_Invoice_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_Invoice_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Description. /** Set Description.
@param Description Optional short description of the record @param Description Optional short description of the record
*/ */