Skip to content

Commit

Permalink
B 22726 INT (#14839)
Browse files Browse the repository at this point in the history
* now ppm disbursement subtracts gtc charges

* updated test
  • Loading branch information
loganwc authored Feb 20, 2025
1 parent d39530d commit 54f1fbe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,11 @@ func formatDisbursement(expensesMap map[string]float64, ppmRemainingEntitlement
disbursementGTCC = 0
} else {
// Disbursement Member is remaining entitlement plus member SIT minus GTCC Disbursement, not less than 0.
disbursementMember = ppmRemainingEntitlement + expensesMap["StorageMemberPaid"]
totalGTCCPaid := expensesMap["TotalGTCCPaid"] + expensesMap["StorageGTCCPaid"]
disbursementMember = ppmRemainingEntitlement - totalGTCCPaid + expensesMap["StorageMemberPaid"]
if disbursementMember < 0 {
disbursementMember = 0
}
}

// Return formatted values in string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -801,16 +801,16 @@ func (suite *ShipmentSummaryWorksheetServiceSuite) TestGTCCPaidRemainingPPMEntit
MovingExpenseType: &storageExpense,
Amount: &amount,
PaidWithGTCC: models.BoolPointer(true),
SITReimburseableAmount: models.CentPointer(unit.Cents(200)),
SITReimburseableAmount: models.CentPointer(unit.Cents(20000)),
},
}

locator := "ABCDEF-01"
id := uuid.Must(uuid.NewV4())
PPMShipments := []models.PPMShipment{
{
FinalIncentive: models.CentPointer(unit.Cents(600)),
AdvanceAmountReceived: models.CentPointer(unit.Cents(100)),
FinalIncentive: models.CentPointer(unit.Cents(60000)),
AdvanceAmountReceived: models.CentPointer(unit.Cents(10000)),
ID: id,
Shipment: models.MTOShipment{
ShipmentLocator: &locator,
Expand Down Expand Up @@ -840,8 +840,8 @@ func (suite *ShipmentSummaryWorksheetServiceSuite) TestGTCCPaidRemainingPPMEntit
mockPPMCloseoutFetcher := &mocks.PPMCloseoutFetcher{}
sswPPMComputer := NewSSWPPMComputer(mockPPMCloseoutFetcher)
sswPage2, _ := sswPPMComputer.FormatValuesShipmentSummaryWorksheetFormPage2(ssd, true, expensesMap)
suite.Equal("$5.00", sswPage2.PPMRemainingEntitlement)
suite.Equal(expectedDisbursementString(500, 500), sswPage2.Disbursement)
suite.Equal("$500.00", sswPage2.PPMRemainingEntitlement)
suite.Equal(expectedDisbursementString(10000, 40000), sswPage2.Disbursement)
}
func (suite *ShipmentSummaryWorksheetServiceSuite) TestGroupExpenses() {
paidWithGTCC := false
Expand Down

0 comments on commit 54f1fbe

Please sign in to comment.