Class FIN_AddPayment
- java.lang.Object
-
- org.openbravo.advpaymentmngt.process.FIN_AddPayment
-
public class FIN_AddPayment extends Object
-
-
Constructor Summary
Constructors Constructor Description FIN_AddPayment()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static FIN_PaymentScheduleDetail
createPSD(BigDecimal amount, FIN_PaymentSchedule paymentSchedule, FIN_PaymentSchedule paymentScheduleInvoice, Organization organization, BusinessPartner businessPartner)
Method to create a new Payment Schedule Detail (PSD)static FIN_PaymentScheduleDetail
createPSD(BigDecimal amount, FIN_PaymentSchedule paymentSchedule, FIN_PaymentSchedule paymentScheduleInvoice, FIN_PaymentDetail paymentDetails, Organization organization, BusinessPartner businessPartner)
Method to create a new Payment Schedule Detail (PSD)static FIN_Payment
createRefundPayment(ConnectionProvider conProvider, VariablesSecureApp vars, FIN_Payment payment, BigDecimal refundAmount)
static FIN_Payment
createRefundPayment(ConnectionProvider conProvider, VariablesSecureApp vars, FIN_Payment payment, BigDecimal refundAmount, BigDecimal conversionRate)
static List<FIN_PaymentScheduleDetail>
getOutstandingPSDs(FIN_PaymentScheduleDetail paymentScheduleDetail)
static List<String>
getPaymentFromPaymentProposal(FIN_PaymentProposal paymentProposal)
Method used to get a list of payments identifiers associated to a payment proposalstatic <T extends BaseOBObject>
HashMap<String,BigDecimal>getSelectedBaseOBObjectAmount(VariablesSecureApp vars, List<T> selectedBaseOBObjects, String htmlElementId)
Creates a HashMap with the BaseOBObject id's and the amount gotten from the Session.static List<FIN_PaymentScheduleDetail>
getSelectedPaymentDetails(List<FIN_PaymentScheduleDetail> scheduledPaymentDetails, String strSelectedPaymentDetailsIds)
It adds to the scheduledPaymentDetails List the FIN_PaymentScheduleDetails given in the strSelectedPaymentDetailsIds comma separated String of Id's that are not yet included on it.static void
mergePaymentScheduleDetails(FIN_PaymentScheduleDetail psd)
This method groups several payment schedule details by {PaymentDetails, OrderPaymenSchedule, InvoicePaymentSchedule}.static OBError
processBankStatement(VariablesSecureApp vars, ConnectionProvider conn, String strBankStatementAction, String strBankStatementId)
It calls the Bank Statement Process for the given bank statement and action.static OBError
processPayment(VariablesSecureApp vars, ConnectionProvider conn, String strAction, FIN_Payment payment)
It calls the PAyment Process for the given payment and action.static OBError
processPayment(VariablesSecureApp vars, ConnectionProvider conn, String strAction, FIN_Payment payment, String comingFrom)
It calls the PAyment Process for the given payment, action and origin.static OBError
processPayment(VariablesSecureApp vars, ConnectionProvider conn, String strAction, FIN_Payment payment, String comingFrom, String selectedCreditLineIds)
It calls the PAyment Process for the given payment, action and origin.static OBError
processPayment(ProcessBundle pb, String strAction, FIN_Payment payment, String comingFrom, String selectedCreditLineIds, boolean doFlush)
It calls the Payment Process using the given ProcessBundlestatic OBError
processPaymentProposal(VariablesSecureApp vars, ConnectionProvider conn, String strProcessProposalAction, String strFinPaymentProposalId)
It calls the Payment Proposal Process for the given payment proposal and action.static void
removeGLItem(FIN_Payment payment, FIN_PaymentDetail paymentDetail)
Removes the Payment Detail from the Payment when the Detail is related to a GLItemstatic void
saveGLItem(FIN_Payment payment, BigDecimal glitemAmount, GLItem glitem)
static void
saveGLItem(FIN_Payment payment, BigDecimal glitemAmount, GLItem glitem, String paymentId)
It adds to the Payment a new Payment Detail with the given GL Item and amount.static void
saveGLItem(FIN_Payment payment, BigDecimal glitemAmount, GLItem glitem, String paymentId, boolean doFlush)
It adds to the Payment a new Payment Detail with the given GL Item and amount.static void
saveGLItem(FIN_Payment payment, BigDecimal glitemAmount, GLItem glitem, BusinessPartner businessPartner, Product product, Project project, Campaign campaign, ABCActivity activity, SalesRegion salesRegion)
It adds to the Payment a new Payment Detail with the given GL Item, amount and accounting dimensionsstatic void
saveGLItem(FIN_Payment payment, BigDecimal glitemAmount, GLItem glitem, BusinessPartner businessPartner, Product product, Project project, Campaign campaign, ABCActivity activity, SalesRegion salesRegion, Costcenter costCenter, UserDimension1 user1, UserDimension2 user2)
It adds to the Payment a new Payment Detail with the given GL Item, amount and accounting dimensionsstatic FIN_Payment
savePayment(FIN_Payment payment, boolean isReceipt, DocumentType docType, String strPaymentDocumentNo, BusinessPartner businessPartner, FIN_PaymentMethod paymentMethod, FIN_FinancialAccount finAccount, String strPaymentAmount, Date paymentDate, Organization organization, String referenceNo, List<FIN_PaymentScheduleDetail> selectedPaymentScheduleDetails, HashMap<String,BigDecimal> selectedPaymentScheduleDetailsAmounts, boolean isWriteoff, boolean isRefund)
static FIN_Payment
savePayment(FIN_Payment payment, boolean isReceipt, DocumentType docType, String strPaymentDocumentNo, BusinessPartner businessPartner, FIN_PaymentMethod paymentMethod, FIN_FinancialAccount finAccount, String strPaymentAmount, Date paymentDate, Organization organization, String referenceNo, List<FIN_PaymentScheduleDetail> selectedPaymentScheduleDetails, HashMap<String,BigDecimal> selectedPaymentScheduleDetailsAmounts, boolean isWriteoff, boolean isRefund, boolean doFlush)
Saves the payment and the payment details based on the given Payment Schedule Details.static FIN_Payment
savePayment(FIN_Payment payment, boolean isReceipt, DocumentType docType, String strPaymentDocumentNo, BusinessPartner businessPartner, FIN_PaymentMethod paymentMethod, FIN_FinancialAccount finAccount, String strPaymentAmount, Date paymentDate, Organization organization, String referenceNo, List<FIN_PaymentScheduleDetail> selectedPaymentScheduleDetails, HashMap<String,BigDecimal> selectedPaymentScheduleDetailsAmounts, boolean isWriteoff, boolean isRefund, Currency paymentCurrency, BigDecimal finTxnConvertRate, BigDecimal finTxnAmount)
Saves the payment and the payment details based on the given Payment Schedule Details.static FIN_Payment
savePayment(FIN_Payment payment, boolean isReceipt, DocumentType docType, String strPaymentDocumentNo, BusinessPartner businessPartner, FIN_PaymentMethod paymentMethod, FIN_FinancialAccount finAccount, String strPaymentAmount, Date paymentDate, Organization organization, String referenceNo, List<FIN_PaymentScheduleDetail> selectedPaymentScheduleDetails, HashMap<String,BigDecimal> selectedPaymentScheduleDetailsAmounts, boolean isWriteoff, boolean isRefund, Currency paymentCurrency, BigDecimal finTxnConvertRate, BigDecimal finTxnAmount, boolean doFlush, String paymentId)
Saves the payment and the payment details based on the given Payment Schedule Details.static void
savePaymentProposal(FIN_PaymentProposal paymentProposal, BigDecimal paymentAmount, List<FIN_PaymentScheduleDetail> selectedPaymentScheduleDetails, HashMap<String,BigDecimal> selectedPaymentScheduleDetailAmounts, BigDecimal writeOffAmt)
Adds new Details to the given Payment Proposal based on the List of Payment Schedule Details.static FIN_Payment
setFinancialTransactionAmountAndRate(VariablesSecureApp vars, FIN_Payment payment, BigDecimal finTxnConvertRate, BigDecimal finTxnAmount)
static FIN_Payment
setFinancialTransactionAmountAndRate(FIN_Payment payment, BigDecimal finTxnConvertRate, BigDecimal finTxnAmount)
static BigDecimal
updatePaymentDetail(FIN_PaymentScheduleDetail paymentScheduleDetail, FIN_Payment payment, BigDecimal paymentDetailAmount, boolean isWriteoff)
Updates the paymentScheduleDetail with the paymentDetailAmount.static BigDecimal
updatePaymentDetail(FIN_PaymentScheduleDetail paymentScheduleDetail, FIN_Payment payment, BigDecimal paymentDetailAmount, boolean isWriteoff, boolean doFlush)
Updates the paymentScheduleDetail with the paymentDetailAmount.static void
updatePaymentScheduleAmounts(FIN_PaymentDetail paymentDetail, FIN_PaymentSchedule paymentSchedule, BigDecimal amount, BigDecimal writeOffAmount)
Update Payment Schedule amounts with the amount of the Payment Schedule Detail or Payment Detail.static void
updatePaymentScheduleAmounts(FIN_PaymentSchedule paymentSchedule, BigDecimal amount, BigDecimal writeOffAmount)
Deprecated.This method doesn't support Cash VAT flow, so it's better to useupdatePaymentDetail(FIN_PaymentScheduleDetail, FIN_Payment, BigDecimal, boolean)
-
-
-
Method Detail
-
savePayment
public static FIN_Payment savePayment(FIN_Payment payment, boolean isReceipt, DocumentType docType, String strPaymentDocumentNo, BusinessPartner businessPartner, FIN_PaymentMethod paymentMethod, FIN_FinancialAccount finAccount, String strPaymentAmount, Date paymentDate, Organization organization, String referenceNo, List<FIN_PaymentScheduleDetail> selectedPaymentScheduleDetails, HashMap<String,BigDecimal> selectedPaymentScheduleDetailsAmounts, boolean isWriteoff, boolean isRefund, Currency paymentCurrency, BigDecimal finTxnConvertRate, BigDecimal finTxnAmount, boolean doFlush, String paymentId)
Saves the payment and the payment details based on the given Payment Schedule Details. If no FIN_Payment is given it creates a new one. If the Payment Scheduled Detail is not completely paid and the difference is not written a new Payment Schedule Detail is created with the difference. If a Refund Amount is given an extra Payment Detail will be created with it.- Parameters:
payment
- FIN_Payment where new payment details will be saved.isReceipt
- boolean to define if the Payment is a Receipt Payment (true) or a Payable Payment (false). Used when no FIN_Payment is given.docType
- DocumentType of the Payment. Used when no FIN_Payment is given.strPaymentDocumentNo
- String with the Document Number of the new payment. Used when no FIN_Payment is given.businessPartner
- BusinessPartner of the new Payment. Used when no FIN_Payment is given.paymentMethod
- FIN_PaymentMethod of the new Payment. Used when no FIN_Payment is given.finAccount
- FIN_FinancialAccount of the new Payment. Used when no FIN_Payment is given.strPaymentAmount
- String with the Payment Amount of the new Payment. Used when no FIN_Payment is given.paymentDate
- Date when the Payment is done. Used when no FIN_Payment is given.organization
- Organization of the new Payment. Used when no FIN_Payment is given.selectedPaymentScheduleDetails
- List of FIN_PaymentScheduleDetail to be included in the Payment. If one of the items is contained in other payment the method will throw an exception. Prevent invoice/order to be paid several times.selectedPaymentScheduleDetailsAmounts
- HashMap with the Amount to be paid for each Scheduled Payment Detail.isWriteoff
- Boolean to write off the difference when the payment amount is lower than the Payment Scheduled PAyment Detail amount.isRefund
- Not used.paymentCurrency
- The currency that the payment is being made in. Will default to financial account currency if not specifiedfinTxnConvertRate
- Exchange rate to convert between payment currency and financial account currency for this payment. Defaults to 1.0 if not suppliedfinTxnAmount
- Amount of payment in currency of financial accountdoFlush
- Force to flush inside the method after creating the paymentpaymentId
- id to set in new entities- Returns:
- The FIN_Payment OBObject containing all the Payment Details.
-
savePayment
public static FIN_Payment savePayment(FIN_Payment payment, boolean isReceipt, DocumentType docType, String strPaymentDocumentNo, BusinessPartner businessPartner, FIN_PaymentMethod paymentMethod, FIN_FinancialAccount finAccount, String strPaymentAmount, Date paymentDate, Organization organization, String referenceNo, List<FIN_PaymentScheduleDetail> selectedPaymentScheduleDetails, HashMap<String,BigDecimal> selectedPaymentScheduleDetailsAmounts, boolean isWriteoff, boolean isRefund, Currency paymentCurrency, BigDecimal finTxnConvertRate, BigDecimal finTxnAmount)
Saves the payment and the payment details based on the given Payment Schedule Details. If no FIN_Payment is given it creates a new one. If the Payment Scheduled Detail is not completely paid and the difference is not written a new Payment Schedule Detail is created with the difference. If a Refund Amount is given an extra Payment Detail will be created with it.- Parameters:
payment
- FIN_Payment where new payment details will be saved.isReceipt
- boolean to define if the Payment is a Receipt Payment (true) or a Payable Payment (false). Used when no FIN_Payment is given.docType
- DocumentType of the Payment. Used when no FIN_Payment is given.strPaymentDocumentNo
- String with the Document Number of the new payment. Used when no FIN_Payment is given.businessPartner
- BusinessPartner of the new Payment. Used when no FIN_Payment is given.paymentMethod
- FIN_PaymentMethod of the new Payment. Used when no FIN_Payment is given.finAccount
- FIN_FinancialAccount of the new Payment. Used when no FIN_Payment is given.strPaymentAmount
- String with the Payment Amount of the new Payment. Used when no FIN_Payment is given.paymentDate
- Date when the Payment is done. Used when no FIN_Payment is given.organization
- Organization of the new Payment. Used when no FIN_Payment is given.selectedPaymentScheduleDetails
- List of FIN_PaymentScheduleDetail to be included in the Payment. If one of the items is contained in other payment the method will throw an exception. Prevent invoice/order to be paid several times.selectedPaymentScheduleDetailsAmounts
- HashMap with the Amount to be paid for each Scheduled Payment Detail.isWriteoff
- Boolean to write off the difference when the payment amount is lower than the Payment Scheduled PAyment Detail amount.isRefund
- Not used.paymentCurrency
- The currency that the payment is being made in. Will default to financial account currency if not specifiedfinTxnConvertRate
- Exchange rate to convert between payment currency and financial account currency for this payment. Defaults to 1.0 if not suppliedfinTxnAmount
- Amount of payment in currency of financial account- Returns:
- The FIN_Payment OBObject containing all the Payment Details.
-
savePayment
public static FIN_Payment savePayment(FIN_Payment payment, boolean isReceipt, DocumentType docType, String strPaymentDocumentNo, BusinessPartner businessPartner, FIN_PaymentMethod paymentMethod, FIN_FinancialAccount finAccount, String strPaymentAmount, Date paymentDate, Organization organization, String referenceNo, List<FIN_PaymentScheduleDetail> selectedPaymentScheduleDetails, HashMap<String,BigDecimal> selectedPaymentScheduleDetailsAmounts, boolean isWriteoff, boolean isRefund)
-
savePayment
public static FIN_Payment savePayment(FIN_Payment payment, boolean isReceipt, DocumentType docType, String strPaymentDocumentNo, BusinessPartner businessPartner, FIN_PaymentMethod paymentMethod, FIN_FinancialAccount finAccount, String strPaymentAmount, Date paymentDate, Organization organization, String referenceNo, List<FIN_PaymentScheduleDetail> selectedPaymentScheduleDetails, HashMap<String,BigDecimal> selectedPaymentScheduleDetailsAmounts, boolean isWriteoff, boolean isRefund, boolean doFlush)
Saves the payment and the payment details based on the given Payment Schedule Details. If no FIN_Payment is given it creates a new one. If the Payment Scheduled Detail is not completely paid and the difference is not written a new Payment Schedule Detail is created with the difference. If a Refund Amount is given an extra Payment Detail will be created with it.- Parameters:
payment
- FIN_Payment where new payment details will be saved.isReceipt
- boolean to define if the Payment is a Receipt Payment (true) or a Payable Payment (false). Used when no FIN_Payment is given.docType
- DocumentType of the Payment. Used when no FIN_Payment is given.strPaymentDocumentNo
- String with the Document Number of the new payment. Used when no FIN_Payment is given.businessPartner
- BusinessPartner of the new Payment. Used when no FIN_Payment is given.paymentMethod
- FIN_PaymentMethod of the new Payment. Used when no FIN_Payment is given.finAccount
- FIN_FinancialAccount of the new Payment. Used when no FIN_Payment is given.strPaymentAmount
- String with the Payment Amount of the new Payment. Used when no FIN_Payment is given.paymentDate
- Date when the Payment is done. Used when no FIN_Payment is given.organization
- Organization of the new Payment. Used when no FIN_Payment is given.selectedPaymentScheduleDetails
- List of FIN_PaymentScheduleDetail to be included in the Payment. If one of the items is contained in other payment the method will throw an exception. Prevent invoice/order to be paid several times.selectedPaymentScheduleDetailsAmounts
- HashMap with the Amount to be paid for each Scheduled Payment Detail.isWriteoff
- Boolean to write off the difference when the payment amount is lower than the Payment Scheduled PAyment Detail amount.isRefund
- Not used.doFlush
- Force to flush inside the method after creating the payment- Returns:
- The FIN_Payment OBObject containing all the Payment Details.
-
updatePaymentDetail
public static BigDecimal updatePaymentDetail(FIN_PaymentScheduleDetail paymentScheduleDetail, FIN_Payment payment, BigDecimal paymentDetailAmount, boolean isWriteoff) throws OBException
Updates the paymentScheduleDetail with the paymentDetailAmount. If it is not related to the Payment a new Payment Detail is created. If isWriteoff is true and the amount is different to the outstanding amount the difference is written off.- Parameters:
paymentScheduleDetail
- the Payment Schedule Detail to be assigned to the Paymentpayment
- the FIN_Payment that it is being paidpaymentDetailAmount
- the amount of this paymentScheduleDetail that it is being paidisWriteoff
- flag to write off the difference when there is an outstanding amount remaining to pay- Returns:
- a BigDecimal with the amount newly assigned to the payment. For example, when the paymentScheduleDetail is already related to the payment and its amount is not changed BigDecimal.ZERO is returned.
- Throws:
OBException
- when the paymentDetailAmount is related to a different payment.
-
updatePaymentDetail
public static BigDecimal updatePaymentDetail(FIN_PaymentScheduleDetail paymentScheduleDetail, FIN_Payment payment, BigDecimal paymentDetailAmount, boolean isWriteoff, boolean doFlush) throws OBException
Updates the paymentScheduleDetail with the paymentDetailAmount. If it is not related to the Payment a new Payment Detail is created. If isWriteoff is true and the amount is different to the outstanding amount the difference is written off.- Parameters:
paymentScheduleDetail
- the Payment Schedule Detail to be assigned to the Paymentpayment
- the FIN_Payment that it is being paidpaymentDetailAmount
- the amount of this paymentScheduleDetail that it is being paidisWriteoff
- flag to write off the difference when there is an outstanding amount remaining to paydoFlush
- Force to flush inside the method- Returns:
- a BigDecimal with the amount newly assigned to the payment. For example, when the paymentScheduleDetail is already related to the payment and its amount is not changed BigDecimal.ZERO is returned.
- Throws:
OBException
- when the paymentDetailAmount is related to a different payment.
-
setFinancialTransactionAmountAndRate
public static FIN_Payment setFinancialTransactionAmountAndRate(VariablesSecureApp vars, FIN_Payment payment, BigDecimal finTxnConvertRate, BigDecimal finTxnAmount)
-
setFinancialTransactionAmountAndRate
public static FIN_Payment setFinancialTransactionAmountAndRate(FIN_Payment payment, BigDecimal finTxnConvertRate, BigDecimal finTxnAmount)
-
createRefundPayment
public static FIN_Payment createRefundPayment(ConnectionProvider conProvider, VariablesSecureApp vars, FIN_Payment payment, BigDecimal refundAmount)
-
createRefundPayment
public static FIN_Payment createRefundPayment(ConnectionProvider conProvider, VariablesSecureApp vars, FIN_Payment payment, BigDecimal refundAmount, BigDecimal conversionRate)
-
savePaymentProposal
public static void savePaymentProposal(FIN_PaymentProposal paymentProposal, BigDecimal paymentAmount, List<FIN_PaymentScheduleDetail> selectedPaymentScheduleDetails, HashMap<String,BigDecimal> selectedPaymentScheduleDetailAmounts, BigDecimal writeOffAmt)
Adds new Details to the given Payment Proposal based on the List of Payment Schedule Details.- Parameters:
paymentProposal
- FIN_PaymentProposal where new Details are added.paymentAmount
- Total amount to be paid.selectedPaymentScheduleDetails
- List of FIN_PaymentScheduleDetail that needs to be added to the Payment Proposal.selectedPaymentScheduleDetailAmounts
- HashMap with the Amount to be paid for each Scheduled Payment Detail.writeOffAmt
- Total amount to be written off.
-
saveGLItem
public static void saveGLItem(FIN_Payment payment, BigDecimal glitemAmount, GLItem glitem, String paymentId)
It adds to the Payment a new Payment Detail with the given GL Item and amount.- Parameters:
payment
- Payment where the new Payment Detail needs to be added.glitemAmount
- Amount of the new Payment Detail.glitem
- GLItem to be set in the new Payment Detail.paymentId
- id to set in new entities
-
saveGLItem
public static void saveGLItem(FIN_Payment payment, BigDecimal glitemAmount, GLItem glitem, String paymentId, boolean doFlush)
It adds to the Payment a new Payment Detail with the given GL Item and amount.- Parameters:
payment
- Payment where the new Payment Detail needs to be added.glitemAmount
- Amount of the new Payment Detail.glitem
- GLItem to be set in the new Payment Detail.paymentId
- id to set in new entitiesdoFlush
- Do the flush during the process
-
saveGLItem
public static void saveGLItem(FIN_Payment payment, BigDecimal glitemAmount, GLItem glitem)
-
saveGLItem
public static void saveGLItem(FIN_Payment payment, BigDecimal glitemAmount, GLItem glitem, BusinessPartner businessPartner, Product product, Project project, Campaign campaign, ABCActivity activity, SalesRegion salesRegion, Costcenter costCenter, UserDimension1 user1, UserDimension2 user2)
It adds to the Payment a new Payment Detail with the given GL Item, amount and accounting dimensions- Parameters:
payment
- Payment where the new Payment Detail needs to be added.glitemAmount
- Amount of the new Payment Detail.glitem
- GLItem to be set in the new Payment Detail.businessPartner
- accounting dimensionproduct
- accounting dimensionproject
- accounting dimensioncampaign
- accounting dimensionactivity
- accounting dimensionsalesRegion
- accounting dimensioncostCenter
- accounting dimensionuser1
- accounting dimensionuser2
- accounting dimension
-
saveGLItem
public static void saveGLItem(FIN_Payment payment, BigDecimal glitemAmount, GLItem glitem, BusinessPartner businessPartner, Product product, Project project, Campaign campaign, ABCActivity activity, SalesRegion salesRegion)
It adds to the Payment a new Payment Detail with the given GL Item, amount and accounting dimensions- Parameters:
payment
- Payment where the new Payment Detail needs to be added.glitemAmount
- Amount of the new Payment Detail.glitem
- GLItem to be set in the new Payment Detail.businessPartner
- accounting dimensionproduct
- accounting dimensionproject
- accounting dimensioncampaign
- accounting dimensionactivity
- accounting dimensionsalesRegion
- accounting dimension
-
removeGLItem
public static void removeGLItem(FIN_Payment payment, FIN_PaymentDetail paymentDetail)
Removes the Payment Detail from the Payment when the Detail is related to a GLItem- Parameters:
payment
- FIN_Payment that contains the Payment Detail.paymentDetail
- FIN_PaymentDetail to be removed.
-
getSelectedPaymentDetails
public static List<FIN_PaymentScheduleDetail> getSelectedPaymentDetails(List<FIN_PaymentScheduleDetail> scheduledPaymentDetails, String strSelectedPaymentDetailsIds)
It adds to the scheduledPaymentDetails List the FIN_PaymentScheduleDetails given in the strSelectedPaymentDetailsIds comma separated String of Id's that are not yet included on it.- Parameters:
scheduledPaymentDetails
- List of FIN_PaymentScheduleDetail.strSelectedPaymentDetailsIds
- String of comma separated id's that needs to be included in the List if they are not present.- Returns:
- returns a List of FIN_PaymentScheduleDetail including all the Payment Schedule Details.
-
getSelectedBaseOBObjectAmount
public static <T extends BaseOBObject> HashMap<String,BigDecimal> getSelectedBaseOBObjectAmount(VariablesSecureApp vars, List<T> selectedBaseOBObjects, String htmlElementId) throws javax.servlet.ServletException
Creates a HashMap with the BaseOBObject id's and the amount gotten from the Session. The amounts are stored in Session like "htmlElementId"+basobObject.Id- Parameters:
vars
- VariablseSecureApp with the session data.selectedBaseOBObjects
- List of bobs that need to be included in the HashMap.- Returns:
- A HashMap mapping the Id with the corresponding amount.
- Throws:
javax.servlet.ServletException
-
mergePaymentScheduleDetails
public static void mergePaymentScheduleDetails(FIN_PaymentScheduleDetail psd)
This method groups several payment schedule details by {PaymentDetails, OrderPaymenSchedule, InvoicePaymentSchedule}.- Parameters:
psd
- Payment Schedule Detail base. The amount will be updated here.
-
updatePaymentScheduleAmounts
@Deprecated public static void updatePaymentScheduleAmounts(FIN_PaymentSchedule paymentSchedule, BigDecimal amount, BigDecimal writeOffAmount)
Deprecated.This method doesn't support Cash VAT flow, so it's better to useupdatePaymentDetail(FIN_PaymentScheduleDetail, FIN_Payment, BigDecimal, boolean)
Update Payment Schedule amounts with the amount of the Payment Schedule Detail or Payment Detail. Useful when paying orders- Parameters:
paymentSchedule
- Payment Schedule to be updatedamount
- Amount of the Payment Schedule Detail or Payment DetailwriteOffAmount
- Write off amount, null or 0 if not applicable.
-
updatePaymentScheduleAmounts
public static void updatePaymentScheduleAmounts(FIN_PaymentDetail paymentDetail, FIN_PaymentSchedule paymentSchedule, BigDecimal amount, BigDecimal writeOffAmount)
Update Payment Schedule amounts with the amount of the Payment Schedule Detail or Payment Detail. Useful when paying invoices. It supports Invoices with Cash VAT, creating the records into the Cash VAT management table (InvoiceTaxCashVAT)- Parameters:
paymentDetail
- paymentpaymentSchedule
- Payment Schedule to be updatedamount
- Amount of the Payment Schedule Detail or Payment DetailwriteOffAmount
- Write off amount, null or 0 if not applicable.
-
getPaymentFromPaymentProposal
public static List<String> getPaymentFromPaymentProposal(FIN_PaymentProposal paymentProposal)
Method used to get a list of payments identifiers associated to a payment proposal- Parameters:
paymentProposal
-- Returns:
- List of payment identifiers
-
processPayment
public static OBError processPayment(VariablesSecureApp vars, ConnectionProvider conn, String strAction, FIN_Payment payment) throws Exception
It calls the PAyment Process for the given payment and action.- Parameters:
vars
- VariablesSecureApp with the session data.conn
- ConnectionProvider with the connection being used.strAction
- String with the action of the process. {P, D, R}payment
- FIN_Payment that needs to be processed.- Returns:
- a OBError with the result message of the process.
- Throws:
Exception
-
processPayment
public static OBError processPayment(VariablesSecureApp vars, ConnectionProvider conn, String strAction, FIN_Payment payment, String comingFrom) throws Exception
It calls the PAyment Process for the given payment, action and origin.- Parameters:
vars
- VariablesSecureApp with the session data.conn
- ConnectionProvider with the connection being used.strAction
- String with the action of the process. {P, D, R}payment
- FIN_Payment that needs to be processed.comingFrom
- Origin where the process is invoked- Returns:
- a OBError with the result message of the process.
- Throws:
Exception
-
processPayment
public static OBError processPayment(VariablesSecureApp vars, ConnectionProvider conn, String strAction, FIN_Payment payment, String comingFrom, String selectedCreditLineIds) throws Exception
It calls the PAyment Process for the given payment, action and origin.- Parameters:
vars
- VariablesSecureApp with the session data.conn
- ConnectionProvider with the connection being used.strAction
- String with the action of the process. {P, D, R}payment
- FIN_Payment that needs to be processed.comingFrom
- Origin where the process is invokedselectedCreditLineIds
- Id's of selected lines in Credit to Use grid- Returns:
- a OBError with the result message of the process.
- Throws:
Exception
-
processPayment
public static OBError processPayment(ProcessBundle pb, String strAction, FIN_Payment payment, String comingFrom, String selectedCreditLineIds, boolean doFlush) throws Exception
It calls the Payment Process using the given ProcessBundle- Parameters:
pb
- ProcessBundle already created and initialized. This improves the performance when calling this method in a looppayment
- FIN_Payment that needs to be processed.comingFrom
- Origin where the process is invokedselectedCreditLineIds
- Id's of selected lines in Credit to Use griddoFlush
- Force to flush inside the method- Returns:
- a OBError with the result message of the process.
- Throws:
Exception
-
processPaymentProposal
public static OBError processPaymentProposal(VariablesSecureApp vars, ConnectionProvider conn, String strProcessProposalAction, String strFinPaymentProposalId) throws Exception
It calls the Payment Proposal Process for the given payment proposal and action.- Parameters:
vars
- VariablesSecureApp with the session data.conn
- ConnectionProvider with the connection being used.strProcessProposalAction
- String with the action of the process. {GSP, RE}strFinPaymentProposalId
- String with FIN_PaymentProposal Id to be processed.- Returns:
- a OBError with the result message of the process.
- Throws:
Exception
-
processBankStatement
public static OBError processBankStatement(VariablesSecureApp vars, ConnectionProvider conn, String strBankStatementAction, String strBankStatementId) throws Exception
It calls the Bank Statement Process for the given bank statement and action.- Parameters:
vars
- VariablesSecureApp with the session data.conn
- ConnectionProvider with the connection being used.strBankStatementAction
- String with the action of the process. {P, R}strBankStatementId
- String with FIN_BankStatement Id to be processed.- Returns:
- a OBError with the result message of the process.
- Throws:
Exception
-
getOutstandingPSDs
public static List<FIN_PaymentScheduleDetail> getOutstandingPSDs(FIN_PaymentScheduleDetail paymentScheduleDetail)
-
createPSD
public static FIN_PaymentScheduleDetail createPSD(BigDecimal amount, FIN_PaymentSchedule paymentSchedule, FIN_PaymentSchedule paymentScheduleInvoice, Organization organization, BusinessPartner businessPartner)
Method to create a new Payment Schedule Detail (PSD)- Parameters:
amount
- Amount of the PSDpaymentSchedule
- The PS that the PSD will belong topaymentScheduleInvoice
- The PS Invoice that the PSD will belong tobusinessPartner
- The BP of the PSD- Returns:
- newPSD The newly created PSD
-
createPSD
public static FIN_PaymentScheduleDetail createPSD(BigDecimal amount, FIN_PaymentSchedule paymentSchedule, FIN_PaymentSchedule paymentScheduleInvoice, FIN_PaymentDetail paymentDetails, Organization organization, BusinessPartner businessPartner)
Method to create a new Payment Schedule Detail (PSD)- Parameters:
amount
- Amount of the PSDpaymentSchedule
- The PS that the PSD will belong topaymentScheduleInvoice
- The PS Invoice that the PSD will belong topaymentDetails
- The PD to which the PSD will be relatedbusinessPartner
- The BP of the PSD- Returns:
- newPSD The newly created PSD
-
-