Search in sources :

Example 1 with TaxRule

use of edu.cornell.kfs.pmw.batch.TaxRule in project cu-kfs by CU-CommunityApps.

the class PaymentWorksTaxRuleDependencyServiceImpl method buildKfsVendorDataWrapper.

@Override
public KfsVendorDataWrapper buildKfsVendorDataWrapper(PaymentWorksVendor pmwVendor, Map<String, List<PaymentWorksIsoFipsCountryItem>> paymentWorksIsoToFipsCountryMap) {
    LOG.info("buildKfsVendorDataWrapper, entering");
    KfsVendorDataWrapper vendorDataWrapper = new KfsVendorDataWrapper();
    VendorHeader vendorHeader = vendorDataWrapper.getVendorDetail().getVendorHeader();
    String vendorFipsCountryCode = convertIsoCountryCodeToFipsCountryCode(pmwVendor.getRequestingCompanyTaxCountry(), paymentWorksIsoToFipsCountryMap);
    vendorHeader.setVendorForeignIndicator(!isUnitedStatesFipsCountryCode(vendorFipsCountryCode));
    vendorHeader.setVendorCorpCitizenCode(vendorFipsCountryCode);
    TaxRule taxRule = determineTaxRuleToUseForDataPopulation(pmwVendor, vendorFipsCountryCode);
    LOG.info("buildKfsVendorDataWrapper, vendor request " + pmwVendor.getPmwVendorRequestId() + " tax rule" + taxRule);
    populateTaxRuleDependentAttributes(pmwVendor, vendorDataWrapper, taxRule);
    return vendorDataWrapper;
}
Also used : VendorHeader(org.kuali.kfs.vnd.businessobject.VendorHeader) TaxRule(edu.cornell.kfs.pmw.batch.TaxRule) KfsVendorDataWrapper(edu.cornell.kfs.pmw.batch.businessobject.KfsVendorDataWrapper)

Example 2 with TaxRule

use of edu.cornell.kfs.pmw.batch.TaxRule in project cu-kfs by CU-CommunityApps.

the class PaymentWorksTaxRuleDependencyServiceImplTest method testDetermineTaxRuleToUseForDataPopulationOther.

@Test
void testDetermineTaxRuleToUseForDataPopulationOther() {
    PaymentWorksVendor pmwVendor = new PaymentWorksVendor();
    TaxRule actualResults = taxRuleService.determineTaxRuleToUseForDataPopulation(pmwVendor, KFSConstants.COUNTRY_CODE_UNITED_STATES);
    assertEquals(TaxRule.OTHER, actualResults);
}
Also used : PaymentWorksVendor(edu.cornell.kfs.pmw.batch.businessobject.PaymentWorksVendor) TaxRule(edu.cornell.kfs.pmw.batch.TaxRule) Test(org.junit.jupiter.api.Test)

Example 3 with TaxRule

use of edu.cornell.kfs.pmw.batch.TaxRule in project cu-kfs by CU-CommunityApps.

the class PaymentWorksTaxRuleDependencyServiceImplTest method testDetermineTaxRuleToUseForDataPopulationIndividualUsSSN.

@Test
void testDetermineTaxRuleToUseForDataPopulationIndividualUsSSN() {
    PaymentWorksVendor pmwVendor = new PaymentWorksVendor();
    pmwVendor.setRequestingCompanyTaxClassificationCode(PaymentWorksConstants.INDIVIDUAL_SOLE_PROPRIETOR_TAX_CLASSIFICATION_INDICATOR);
    pmwVendor.setRequestingCompanyTinType(PaymentWorksConstants.PaymentWorksTinType.SSN.getPmwCodeAsString());
    TaxRule actualResults = taxRuleService.determineTaxRuleToUseForDataPopulation(pmwVendor, KFSConstants.COUNTRY_CODE_UNITED_STATES);
    assertEquals(TaxRule.INDIVIDUAL_US_SSN, actualResults);
}
Also used : PaymentWorksVendor(edu.cornell.kfs.pmw.batch.businessobject.PaymentWorksVendor) TaxRule(edu.cornell.kfs.pmw.batch.TaxRule) Test(org.junit.jupiter.api.Test)

Example 4 with TaxRule

use of edu.cornell.kfs.pmw.batch.TaxRule in project cu-kfs by CU-CommunityApps.

the class PaymentWorksTaxRuleDependencyServiceImplTest method testDetermineTaxRuleToUseForDataPopulationIndividualUsEIN.

@Test
void testDetermineTaxRuleToUseForDataPopulationIndividualUsEIN() {
    PaymentWorksVendor pmwVendor = new PaymentWorksVendor();
    pmwVendor.setRequestingCompanyTaxClassificationCode(PaymentWorksConstants.INDIVIDUAL_SOLE_PROPRIETOR_TAX_CLASSIFICATION_INDICATOR);
    pmwVendor.setRequestingCompanyTinType(PaymentWorksConstants.PaymentWorksTinType.FEIN.getPmwCodeAsString());
    TaxRule actualResults = taxRuleService.determineTaxRuleToUseForDataPopulation(pmwVendor, KFSConstants.COUNTRY_CODE_UNITED_STATES);
    assertEquals(TaxRule.INDIVIDUAL_US_EIN, actualResults);
}
Also used : PaymentWorksVendor(edu.cornell.kfs.pmw.batch.businessobject.PaymentWorksVendor) TaxRule(edu.cornell.kfs.pmw.batch.TaxRule) Test(org.junit.jupiter.api.Test)

Example 5 with TaxRule

use of edu.cornell.kfs.pmw.batch.TaxRule in project cu-kfs by CU-CommunityApps.

the class PaymentWorksTaxRuleDependencyServiceImplTest method testDetermineTaxRuleToUseForDataPopulationNotIndividualUs.

@Test
void testDetermineTaxRuleToUseForDataPopulationNotIndividualUs() {
    PaymentWorksVendor pmwVendor = new PaymentWorksVendor();
    pmwVendor.setRequestingCompanyTaxClassificationCode(PaymentWorksConstants.C_CORPORATION_TAX_CLASSIFICATION_INDICATOR);
    TaxRule actualResults = taxRuleService.determineTaxRuleToUseForDataPopulation(pmwVendor, KFSConstants.COUNTRY_CODE_UNITED_STATES);
    assertEquals(TaxRule.NOT_INDIVIDUAL_US, actualResults);
}
Also used : PaymentWorksVendor(edu.cornell.kfs.pmw.batch.businessobject.PaymentWorksVendor) TaxRule(edu.cornell.kfs.pmw.batch.TaxRule) Test(org.junit.jupiter.api.Test)

Aggregations

TaxRule (edu.cornell.kfs.pmw.batch.TaxRule)8 PaymentWorksVendor (edu.cornell.kfs.pmw.batch.businessobject.PaymentWorksVendor)7 Test (org.junit.jupiter.api.Test)7 KfsVendorDataWrapper (edu.cornell.kfs.pmw.batch.businessobject.KfsVendorDataWrapper)1 VendorHeader (org.kuali.kfs.vnd.businessobject.VendorHeader)1