Ejemplo n.º 1
0
 @ConfigureContext(session = appleton)
 public void testUpdateAccountAmounts_AfterFullEntry_AmountToPercent() {
   PurapAccountingServiceFixture fixture = PurapAccountingServiceFixture.PREQ_PRORATION_THIRDS;
   PurchasingAccountsPayableDocument preq = fixture.generatePaymentRequestDocument_OneItem();
   preq.setApplicationDocumentStatus(
       PurapConstants.PaymentRequestStatuses.APPDOC_DEPARTMENT_APPROVED);
   purapAccountingService.updateAccountAmounts(preq);
   PurApItem item = preq.getItems().get(0);
   int i = 0;
   for (PurApAccountingLine correctLine : fixture.getPurApAccountingLineList()) {
     PurApAccountingLine line = item.getSourceAccountingLines().get(i++);
     assertTrue(line.getAccountLinePercent().equals(correctLine.getAccountLinePercent()));
   }
 }
Ejemplo n.º 2
0
 @ConfigureContext(session = appleton)
 public void testUpdateAccountAmounts_BeforeFullEntry_AmountNotToPercent() {
   PurapAccountingServiceFixture fixture = PurapAccountingServiceFixture.PREQ_PRORATION_THIRDS;
   PurchasingAccountsPayableDocument preq = fixture.generatePaymentRequestDocument_OneItem();
   purapAccountingService.updateAccountAmounts(preq);
   PurApItem item = preq.getItems().get(0);
   int i = 0;
   boolean orResult = false;
   for (PurApAccountingLine correctLine : fixture.getPurApAccountingLineList()) {
     PurApAccountingLine line = item.getSourceAccountingLines().get(i++);
     if (!line.getAccountLinePercent().equals(correctLine.getAccountLinePercent())) {
       orResult = true;
       break;
     }
   }
   assertFalse(orResult);
 }