public void testGenerateSummary_TwoItems_OneAccount() { PurapAccountingServiceFixture fixture = PurapAccountingServiceFixture.REQ_SUMMARY_TWO_ITEMS_ONE_ACCOUNT; List<SourceAccountingLine> originalSourceAccounts = fixture.getSourceAccountingLineList(); List<PurApItem> items = fixture.getItems(); List<SourceAccountingLine> sourceLines = purapAccountingService.generateSummary(items); assertEquals(sourceLines.size(), originalSourceAccounts.size()); checkAccountConsolidation(sourceLines, originalSourceAccounts); }
public void testGenerateSummary_OneItem_OneAccount() { // TestUtils.setSystemParameter(Document.class,PurapParameterConstants.ENABLE_SALES_TAX_IND,"Y"); PurapAccountingServiceFixture fixture = PurapAccountingServiceFixture.REQ_SUMMARY_ONE_ITEM_ONE_ACCOUNT; List<SourceAccountingLine> originalSourceAccounts = fixture.getSourceAccountingLineList(); List<PurApItem> items = fixture.getItems(); List<SourceAccountingLine> sourceLines = purapAccountingService.generateSummary(items); assertEquals(sourceLines.size(), originalSourceAccounts.size()); checkAccountConsolidation(sourceLines, originalSourceAccounts); }
public void testGenerateSummaryWithNoZeroTotalsUsingAlternateAmount_TwoItems_OneAccount() { PurapAccountingServiceFixture fixture = PurapAccountingServiceFixture.REQ_SUMMARY_TWO_ITEMS_ONE_ACCOUNT; List<SourceAccountingLine> originalSourceAccounts = fixture.getSourceAccountingLineList(); List<PurApItem> items = fixture.getItems(); GlobalVariables.getUserSession().setBackdoorUser("parke"); RequisitionDocumentFixture reqFixture = RequisitionDocumentFixture.REQ_ONLY_REQUIRED_FIELDS; RequisitionDocument req = reqFixture.createRequisitionDocument(); GlobalVariables.getUserSession().setBackdoorUser("kfs"); for (PurApItem item : items) { item.setPurapDocument(req); } List<SourceAccountingLine> sourceLines = purapAccountingService.generateSummaryWithNoZeroTotalsUsingAlternateAmount(items); assertEquals(sourceLines.size(), originalSourceAccounts.size()); checkAccountConsolidation(sourceLines, originalSourceAccounts); }