Class TestUtility
- java.lang.Object
-
- org.openbravo.test.base.OBBaseTest
-
- org.openbravo.advpaymentmngt.test.TestUtility
-
public class TestUtility extends OBBaseTest
-
-
Field Summary
-
Fields inherited from class org.openbravo.test.base.OBBaseTest
DOLLAR, DOLLAR_ID, EURO, EURO_ID, QA_TEST_ADMIN_USER_ID, QA_TEST_CLIENT_ID, QA_TEST_ORG_ID, TEST_BP_CATEGORY_ID, TEST_CLIENT_ID, TEST_LOCATION_ID, TEST_ORDER_ID, TEST_ORG_ID, TEST_ORG_TREE, TEST_PRODUCT_ID, TEST_ROLE_ID, TEST_US_ORG_ID, TEST_USER_ID, TEST_WAREHOUSE_ID, TEST2_USER_ID, userIds, watchFailures
-
-
Constructor Summary
Constructors Constructor Description TestUtility()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FIN_Payment
addPaymentFromInvoice(Invoice invoice, FIN_FinancialAccount account, BigDecimal amount, boolean isWriteOff)
static FIN_Payment
addPaymentFromOrder(Order order, FIN_FinancialAccount account, BigDecimal amount, boolean isWriteOff)
static FinAccPaymentMethod
associatePaymentMethod(FIN_FinancialAccount account, FIN_PaymentMethod paymentMethod)
static Invoice
createNewInvoice(Client client, Organization org, Date invoiceDate, Date accountingDate, Date taxDate, DocumentType documentType, BusinessPartner bp, Location loc, PriceList priceList, Currency currency, FIN_PaymentMethod paymentMethod, PaymentTerm paymentTerm, Product product, UOM uom, BigDecimal invoicedQuantity, BigDecimal netUnitPrice, BigDecimal netListPrice, BigDecimal priceLimit, TaxRate taxRate, BigDecimal lineNetAmount, boolean isReceipt)
static Order
createNewOrder(Client client, Organization org, Date orderDate, Date accountingDate, Date taxDate, DocumentType documentType, BusinessPartner bp, Location loc, Warehouse warehouse, String invoiceTerm, PriceList priceList, Currency currency, FIN_PaymentMethod paymentMethod, PaymentTerm paymentTerm, Product product, UOM uom, BigDecimal orderedQuantity, BigDecimal netUnitPrice, BigDecimal netListPrice, BigDecimal priceLimit, TaxRate taxRate, BigDecimal lineNetAmount, boolean isReceipt)
static FIN_PaymentProposal
createNewPaymentProposal(Client client, Organization org, FIN_FinancialAccount account, Currency currency, FIN_PaymentMethod paymentMethod)
static FIN_Payment
createRefundPayment(FIN_Payment payment, BigDecimal refundAmount)
Method used to generating payment document with refund amount.static <T extends BaseOBObject>
TgetOneInstance(Class<T> clazz, Value... values)
static FIN_FinancialAccount
insertFinancialAccount(String name, String description, Currency currency, String type, boolean isDefault, Location location, BusinessPartner businessPartner, String bankCode, String branchCode, String bankControlDigit, String iNeNo, String swiftCode, String accountControlDigit, String partialAccNo, String accountNo, String iban, BigDecimal currentBalance, BigDecimal creditLimit, MatchingAlgorithm matchingAlgorithm, boolean isValid, boolean checkIfExist)
static FIN_PaymentMethod
insertPaymentMethod(String name, String description, boolean isPayInAllowed, boolean isAutomaticReceipt, boolean isAutomaticDeposit, String payInExecutionType, PaymentExecutionProcess payInExecutionProcess, boolean isPayinDeferred, String uponReceiptUse, String uponDepositUse, String inUponClearingUse, boolean isPayOutAllowed, boolean isAutomaticPayment, boolean isAutomaticWithdrawn, String payOutExecutionType, PaymentExecutionProcess payOutExecutionProcess, boolean isPayoutDeferred, String uponPaymentUse, String uponWithdrawalUse, String outUponClearingUse, boolean isValid, boolean checkIfExist)
static boolean
processInvoice(Invoice invoice)
static boolean
processOrder(Order order)
static void
processPayment(FIN_Payment payment, String strDocAction)
static void
processPaymentProposal(FIN_PaymentProposal paymentProposal, String strDocAction)
static void
setTestContext()
static void
setTestContextSpain()
-
Methods inherited from class org.openbravo.test.base.OBBaseTest
addReadWriteAccess, classSetUp, commitTransaction, count, getConnectionProvider, getOneInstance, getRandomUser, getTestLogAppender, initializeDalLayer, initializeDisabledTestCases, initializeTestLogAppender, isErrorOccured, reportException, rollback, setLogStackTraces, setQAAdminContext, setSystemAdministratorContext, setTestAdminContext, setTestLogAppenderLevel, setTestUserContext, setUp, setUserContext, shouldMockServletContext, staticInitializeDalLayer, testDone
-
-
-
-
Method Detail
-
insertFinancialAccount
public static FIN_FinancialAccount insertFinancialAccount(String name, String description, Currency currency, String type, boolean isDefault, Location location, BusinessPartner businessPartner, String bankCode, String branchCode, String bankControlDigit, String iNeNo, String swiftCode, String accountControlDigit, String partialAccNo, String accountNo, String iban, BigDecimal currentBalance, BigDecimal creditLimit, MatchingAlgorithm matchingAlgorithm, boolean isValid, boolean checkIfExist)
-
insertPaymentMethod
public static FIN_PaymentMethod insertPaymentMethod(String name, String description, boolean isPayInAllowed, boolean isAutomaticReceipt, boolean isAutomaticDeposit, String payInExecutionType, PaymentExecutionProcess payInExecutionProcess, boolean isPayinDeferred, String uponReceiptUse, String uponDepositUse, String inUponClearingUse, boolean isPayOutAllowed, boolean isAutomaticPayment, boolean isAutomaticWithdrawn, String payOutExecutionType, PaymentExecutionProcess payOutExecutionProcess, boolean isPayoutDeferred, String uponPaymentUse, String uponWithdrawalUse, String outUponClearingUse, boolean isValid, boolean checkIfExist)
-
associatePaymentMethod
public static FinAccPaymentMethod associatePaymentMethod(FIN_FinancialAccount account, FIN_PaymentMethod paymentMethod)
-
createNewOrder
public static Order createNewOrder(Client client, Organization org, Date orderDate, Date accountingDate, Date taxDate, DocumentType documentType, BusinessPartner bp, Location loc, Warehouse warehouse, String invoiceTerm, PriceList priceList, Currency currency, FIN_PaymentMethod paymentMethod, PaymentTerm paymentTerm, Product product, UOM uom, BigDecimal orderedQuantity, BigDecimal netUnitPrice, BigDecimal netListPrice, BigDecimal priceLimit, TaxRate taxRate, BigDecimal lineNetAmount, boolean isReceipt) throws Exception
- Throws:
Exception
-
createNewInvoice
public static Invoice createNewInvoice(Client client, Organization org, Date invoiceDate, Date accountingDate, Date taxDate, DocumentType documentType, BusinessPartner bp, Location loc, PriceList priceList, Currency currency, FIN_PaymentMethod paymentMethod, PaymentTerm paymentTerm, Product product, UOM uom, BigDecimal invoicedQuantity, BigDecimal netUnitPrice, BigDecimal netListPrice, BigDecimal priceLimit, TaxRate taxRate, BigDecimal lineNetAmount, boolean isReceipt) throws Exception
- Throws:
Exception
-
processInvoice
public static boolean processInvoice(Invoice invoice) throws Exception
- Throws:
Exception
-
addPaymentFromInvoice
public static FIN_Payment addPaymentFromInvoice(Invoice invoice, FIN_FinancialAccount account, BigDecimal amount, boolean isWriteOff) throws Exception
- Throws:
Exception
-
addPaymentFromOrder
public static FIN_Payment addPaymentFromOrder(Order order, FIN_FinancialAccount account, BigDecimal amount, boolean isWriteOff) throws Exception
- Throws:
Exception
-
processPayment
public static void processPayment(FIN_Payment payment, String strDocAction) throws Exception
- Throws:
Exception
-
createRefundPayment
public static FIN_Payment createRefundPayment(FIN_Payment payment, BigDecimal refundAmount) throws Exception
Method used to generating payment document with refund amount.- Parameters:
payment
- Created Payment.refundAmount
- Refund Amount need to transfer to the customer.- Returns:
- Created FIN_Payment object.
- Throws:
Exception
- In case of executing invalid data.
-
processPaymentProposal
public static void processPaymentProposal(FIN_PaymentProposal paymentProposal, String strDocAction) throws Exception
- Throws:
Exception
-
createNewPaymentProposal
public static FIN_PaymentProposal createNewPaymentProposal(Client client, Organization org, FIN_FinancialAccount account, Currency currency, FIN_PaymentMethod paymentMethod)
-
getOneInstance
public static <T extends BaseOBObject> T getOneInstance(Class<T> clazz, Value... values)
-
setTestContext
public static void setTestContext()
-
setTestContextSpain
public static void setTestContextSpain()
-
-