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;
}
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);
}
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);
}
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);
}
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);
}
Aggregations