diff --git a/base/src/org/compiere/model/I_C_Payment.java b/base/src/org/compiere/model/I_C_Payment.java index fe88cd592c..ce273b63e1 100644 --- a/base/src/org/compiere/model/I_C_Payment.java +++ b/base/src/org/compiere/model/I_C_Payment.java @@ -413,16 +413,14 @@ public interface I_C_Payment public org.compiere.model.I_C_PaymentBatch getC_PaymentBatch() throws RuntimeException; - /** Column name PaymentRelated_ID */ - public static final String COLUMNNAME_PaymentRelated_ID = "PaymentRelated_ID"; + /** Column name RelatedPayment_ID */ + public static final String COLUMNNAME_RelatedPayment_ID = "RelatedPayment_ID"; /** Set Payment Related */ - public void setPaymentRelated_ID (int PaymentRelated_ID); + public void setRelatedPayment_ID (int RelatedPayment_ID); /** Get Payment Related */ - public int getPaymentRelated_ID(); - - public org.compiere.model.I_C_Payment getC_PaymentRelated() throws RuntimeException; + public int getRelatedPayment_ID(); /** Column name C_POS_ID */ public static final String COLUMNNAME_C_POS_ID = "C_POS_ID"; @@ -795,15 +793,6 @@ public interface I_C_Payment */ public boolean isSelfService(); - /** Column name IsVoidRelatedDocument */ - public static final String COLUMNNAME_IsVoidRelatedDocument = "IsVoidRelatedDocument"; - - /** Set IsVoidRelatedDocument */ - public void setIsVoidRelatedDocument (boolean IsVoidRelatedDocument); - - /** Get IsVoidRelatedDocument */ - public boolean isVoidRelatedDocument(); - /** Column name Micr */ public static final String COLUMNNAME_Micr = "Micr"; diff --git a/base/src/org/compiere/model/MPaySelectionCheck.java b/base/src/org/compiere/model/MPaySelectionCheck.java index f080615c29..f2cc4cfbde 100644 --- a/base/src/org/compiere/model/MPaySelectionCheck.java +++ b/base/src/org/compiere/model/MPaySelectionCheck.java @@ -365,11 +365,12 @@ public static int confirmPrint (List paySelectionChecks, MPa receiptAccount.setC_BankAccount_ID(line.getC_BankAccountTo_ID()); receiptAccount.setIsReceipt(!payment.isReceipt()); receiptAccount.setC_DocType_ID(!payment.isReceipt()); - receiptAccount.setPaymentRelated_ID(payment.getC_Payment_ID()); + receiptAccount.setRelatedPayment_ID(payment.getC_Payment_ID()); receiptAccount.setTenderType(MPayment.TENDERTYPE_DirectDeposit); receiptAccount.saveEx(); receiptAccount.processIt(DocAction.ACTION_Complete); receiptAccount.saveEx(); + payment.setRelatedPayment_ID(receiptAccount.getC_Payment_ID()); } } } else { diff --git a/base/src/org/compiere/model/MPayment.java b/base/src/org/compiere/model/MPayment.java index f5327759e0..b15f8a89b1 100644 --- a/base/src/org/compiere/model/MPayment.java +++ b/base/src/org/compiere/model/MPayment.java @@ -2494,6 +2494,7 @@ public MPayment reverseIt(boolean isAccrual) public boolean reverseCorrectIt() { log.info(toString()); + String DocAction = getDocAction(); // Before reverseCorrect processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT); if (processMsg != null) @@ -2503,7 +2504,7 @@ public boolean reverseCorrectIt() return false; // Reverse all deposit from cash reverseGeneratedPayments(); - reverseRelatedPayments(); + reverseRelatedPayments(DocAction); // StringBuilder info = new StringBuilder(processMsg); // After reverseCorrect @@ -2544,13 +2545,14 @@ private void reverseGeneratedPayments() { /** * Reverse all payments generated by banktransfer */ - private void reverseRelatedPayments() { - if (isVoidRelatedDocument() && getPaymentRelated_ID() !=0){ - MPayment relatedPayment = (MPayment)getC_PaymentRelated(); + private void reverseRelatedPayments(String DocAction) { + if (getRelatedPayment_ID() !=0){ + MPayment relatedPayment = (MPayment)getRelatedPayment(); if (relatedPayment.isProcessing()) // to avoid endless loop return; if (relatedPayment.getDocStatus().equals(MPayment.DOCSTATUS_Completed)){ - relatedPayment.processIt(MPayment.DOCACTION_Void); + relatedPayment.processIt(DocAction); + relatedPayment.saveEx(); } else{ processMsg= Msg.getMsg(Env.getAD_Language(getCtx()), "The related document is not completed"); @@ -2568,6 +2570,7 @@ public boolean reverseAccrualIt() log.info(toString()); // Before reverseAccrual + String DocAction = MPayment.DOCACTION_Reverse_Accrual; processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL); if (processMsg != null) return false; @@ -2576,6 +2579,7 @@ public boolean reverseAccrualIt() return false; // After reverseAccrual + reverseRelatedPayments(DocAction); processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL); if (processMsg != null) return false; diff --git a/base/src/org/compiere/model/X_C_Payment.java b/base/src/org/compiere/model/X_C_Payment.java index 8a3e641250..9e18020775 100644 --- a/base/src/org/compiere/model/X_C_Payment.java +++ b/base/src/org/compiere/model/X_C_Payment.java @@ -688,26 +688,26 @@ public int getC_PaymentBatch_ID () return ii.intValue(); } - public org.compiere.model.I_C_Payment getC_PaymentRelated() throws RuntimeException + public org.compiere.model.I_C_Payment getRelatedPayment() throws RuntimeException { return (org.compiere.model.I_C_Payment)MTable.get(getCtx(), org.compiere.model.I_C_Payment.Table_Name) - .getPO(getPaymentRelated_ID(), get_TrxName()); } + .getPO(getRelatedPayment_ID(), get_TrxName()); } /** Set Payment Related. - @param PaymentRelated_ID Payment Related */ - public void setPaymentRelated_ID (int PaymentRelated_ID) + @param RelatedPayment_ID Payment Related */ + public void setRelatedPayment_ID (int RelatedPayment_ID) { - if (PaymentRelated_ID < 1) - set_Value (COLUMNNAME_PaymentRelated_ID, null); + if (RelatedPayment_ID < 1) + set_Value (COLUMNNAME_RelatedPayment_ID, null); else - set_Value (COLUMNNAME_PaymentRelated_ID, Integer.valueOf(PaymentRelated_ID)); + set_Value (COLUMNNAME_RelatedPayment_ID, Integer.valueOf(RelatedPayment_ID)); } /** Get Payment Related. @return Payment Related */ - public int getPaymentRelated_ID () + public int getRelatedPayment_ID () { - Integer ii = (Integer)get_Value(COLUMNNAME_PaymentRelated_ID); + Integer ii = (Integer)get_Value(COLUMNNAME_RelatedPayment_ID); if (ii == null) return 0; return ii.intValue(); @@ -1342,26 +1342,6 @@ public boolean isSelfService () return false; } - /** Set IsVoidRelatedDocument. - @param IsVoidRelatedDocument IsVoidRelatedDocument */ - public void setIsVoidRelatedDocument (boolean IsVoidRelatedDocument) - { - set_Value (COLUMNNAME_IsVoidRelatedDocument, Boolean.valueOf(IsVoidRelatedDocument)); - } - - /** Get IsVoidRelatedDocument. - @return IsVoidRelatedDocument */ - public boolean isVoidRelatedDocument () - { - Object oo = get_Value(COLUMNNAME_IsVoidRelatedDocument); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } /** Set Micr. @param Micr diff --git a/base/src/org/eevolution/process/BankTransfer.java b/base/src/org/eevolution/process/BankTransfer.java index b9cecd54c2..df0049bb3b 100644 --- a/base/src/org/eevolution/process/BankTransfer.java +++ b/base/src/org/eevolution/process/BankTransfer.java @@ -74,7 +74,7 @@ private void generateBankTransfer() { } MBankAccount mBankFrom = new MBankAccount(getCtx(), getCBankAccountId(), get_TrxName()); - MBankAccount mBankTo = new MBankAccount(getCtx(), getBankAccountToId(), get_TrxName()); + MBankAccount mBankTo = new MBankAccount(getCtx(), getToCBankAccountId(), get_TrxName()); MPayment paymentBankFrom = new MPayment(getCtx(), 0 , get_TrxName()); paymentBankFrom.setC_BankAccount_ID(mBankFrom.getC_BankAccount_ID()); @@ -112,7 +112,7 @@ private void generateBankTransfer() { paymentBankTo.setC_Charge_ID(getChargeId()); paymentBankTo.saveEx(); - paymentBankFrom.setPaymentRelated_ID(paymentBankTo.getC_Payment_ID()); + paymentBankFrom.setRelatedPayment_ID(paymentBankTo.getC_Payment_ID()); paymentBankFrom.saveEx(); paymentBankFrom.processIt(MPayment.DOCACTION_Complete); paymentBankFrom.saveEx(); @@ -125,7 +125,7 @@ private void generateBankTransfer() { + " @C_BankStatement_ID@ " + bsl.getC_BankStatement().getName() + "]"); } } - paymentBankTo.setPaymentRelated_ID(paymentBankFrom.getC_Payment_ID()); + paymentBankTo.setRelatedPayment_ID(paymentBankFrom.getC_Payment_ID()); paymentBankTo.saveEx(); paymentBankTo.processIt(MPayment.DOCACTION_Complete); paymentBankTo.saveEx(); diff --git a/base/src/org/eevolution/process/BankTransferAbstract.java b/base/src/org/eevolution/process/BankTransferAbstract.java index bb3d3a7763..b6df08206b 100644 --- a/base/src/org/eevolution/process/BankTransferAbstract.java +++ b/base/src/org/eevolution/process/BankTransferAbstract.java @@ -35,7 +35,7 @@ public abstract class BankTransferAbstract extends SvrProcess { /** Parameter Name for Bank Account From */ public static final String FROM_C_BANKACCOUNT_ID = "From_C_BankAccount_ID"; /** Parameter Name for Bank Account To */ - public static final String C_BANKACCOUNTTO_ID = "C_BankAccountTo_ID"; + public static final String TO_C_BANKACCOUNT_ID = "To_C_BankAccount_ID"; /** Parameter Name for Business Partner */ public static final String C_BPARTNER_ID = "C_BPartner_ID"; /** Parameter Name for Currency */ @@ -61,7 +61,7 @@ public abstract class BankTransferAbstract extends SvrProcess { /** Parameter Value for Bank Account From */ private int cBankAccountId; /** Parameter Value for Bank Account To */ - private int bankAccountToId; + private int toCBankAccountId; /** Parameter Value for Business Partner */ private int bPartnerId; /** Parameter Value for Currency */ @@ -88,7 +88,7 @@ public abstract class BankTransferAbstract extends SvrProcess { @Override protected void prepare() { cBankAccountId = getParameterAsInt(FROM_C_BANKACCOUNT_ID); - bankAccountToId = getParameterAsInt(C_BANKACCOUNTTO_ID); + toCBankAccountId = getParameterAsInt(TO_C_BANKACCOUNT_ID); bPartnerId = getParameterAsInt(C_BPARTNER_ID); currencyId = getParameterAsInt(C_CURRENCY_ID); conversionTypeId = getParameterAsInt(C_CONVERSIONTYPE_ID); @@ -113,13 +113,13 @@ protected void setCBankAccountId(int cBankAccountId) { } /** Getter Parameter Value for Bank Account To */ - protected int getBankAccountToId() { - return bankAccountToId; + protected int getToCBankAccountId() { + return toCBankAccountId; } /** Setter Parameter Value for Bank Account To */ - protected void setBankAccountToId(int bankAccountToId) { - this.bankAccountToId = bankAccountToId; + protected void setToCBankAccountId(int toCBankAccountId) { + this.toCBankAccountId = toCBankAccountId; } /** Getter Parameter Value for Business Partner */ diff --git a/migration/390lts-391/03961_1555_DeleteIsVoidRelatedDocument.xml b/migration/390lts-391/03961_1555_DeleteIsVoidRelatedDocument.xml new file mode 100644 index 0000000000..0faf4eacae --- /dev/null +++ b/migration/390lts-391/03961_1555_DeleteIsVoidRelatedDocument.xml @@ -0,0 +1,190 @@ + + + + https://github.com/adempiere/adempiere/issues/1555 + + + + + + + + + + + + es_MX + + + + 85506 + + + + ALTER TABLE c_payment DROP COLUMN isvoidrelateddocument; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + es_MX + 86859 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + es_MX + 59817 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/migration/390lts-391/03962_1555_RenameRelatedPayment.xml b/migration/390lts-391/03962_1555_RenameRelatedPayment.xml new file mode 100644 index 0000000000..31a4fb75c9 --- /dev/null +++ b/migration/390lts-391/03962_1555_RenameRelatedPayment.xml @@ -0,0 +1,34 @@ + + + + https://github.com/adempiere/adempiere/issues/1555 + + + RelatedPayment_ID + + + + + + RelatedPayment_ID + + + + + ALTER TABLE c_payment DROP COLUMN IF EXISTS paymentrelated_id; + + + + + + + + + + false + 85505 + es_MX + + + +