Skip to content

Commit

Permalink
Merge pull request #14982 from transcom/MAIN-B-22777-PPM-Draft-Expens…
Browse files Browse the repository at this point in the history
…e-Defect

Main b 22777 ppm draft expense defect
  • Loading branch information
taeJungCaci authored Mar 8, 2025
2 parents dca9ab2 + a57f95d commit 91dc5e2
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/services/ppm_closeout/ppm_closeout.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ func (p *ppmCloseoutFetcher) GetExpenseStoragePrice(appCtx appcontext.AppContext
}

for _, movingExpense := range expenseItems {
if movingExpense.MovingExpenseType != nil && *movingExpense.MovingExpenseType == models.MovingExpenseReceiptTypeStorage && *movingExpense.Status == models.PPMDocumentStatusApproved {
if movingExpense.MovingExpenseType != nil && movingExpense.Status != nil && *movingExpense.MovingExpenseType == models.MovingExpenseReceiptTypeStorage && *movingExpense.Status == models.PPMDocumentStatusApproved {
storageExpensePrice += *movingExpense.Amount
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -869,8 +869,7 @@ func SubTotalExpenses(expenseDocuments models.MovingExpenses) map[string]float64
if expense.MovingExpenseType == nil || expense.Amount == nil {
continue
} // Added quick nil check to ensure SSW returns while moving expenses are being added still
var nilPPMDocumentStatus *models.PPMDocumentStatus
if expense.Status != nilPPMDocumentStatus && (*expense.Status == models.PPMDocumentStatusRejected || *expense.Status == models.PPMDocumentStatusExcluded) {
if expense.Status == nil || *expense.Status != models.PPMDocumentStatusApproved {
continue
}
expenseType, addToTotal := getExpenseType(expense)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,41 +442,49 @@ func (suite *ShipmentSummaryWorksheetServiceSuite) TestFormatValuesShipmentSumma
tollExpense := models.MovingExpenseReceiptTypeTolls
oilExpense := models.MovingExpenseReceiptTypeOil
amount := unit.Cents(10000)
statusApproved := models.PPMDocumentStatusApproved
movingExpenses := models.MovingExpenses{
{
MovingExpenseType: &tollExpense,
Amount: &amount,
PaidWithGTCC: &paidWithGTCCFalse,
Status: &statusApproved,
},
{
MovingExpenseType: &oilExpense,
Amount: &amount,
PaidWithGTCC: &paidWithGTCCFalse,
Status: &statusApproved,
},
{
MovingExpenseType: &oilExpense,
Amount: &amount,
PaidWithGTCC: &paidWithGTCCTrue,
Status: &statusApproved,
},
{
MovingExpenseType: &oilExpense,
Amount: &amount,
PaidWithGTCC: &paidWithGTCCFalse,
Status: &statusApproved,
},
{
MovingExpenseType: &tollExpense,
Amount: &amount,
PaidWithGTCC: &paidWithGTCCTrue,
Status: &statusApproved,
},
{
MovingExpenseType: &tollExpense,
Amount: &amount,
PaidWithGTCC: &paidWithGTCCTrue,
Status: &statusApproved,
},
{
MovingExpenseType: &tollExpense,
Amount: &amount,
PaidWithGTCC: &paidWithGTCCFalse,
Status: &statusApproved,
},
}

Expand Down Expand Up @@ -661,12 +669,14 @@ func (suite *ShipmentSummaryWorksheetServiceSuite) TestFormatAdditionalHHG() {
func (suite *ShipmentSummaryWorksheetServiceSuite) TestMemberPaidRemainingPPMEntitlementFormatValuesShipmentSummaryWorksheetFormPage2() {
storageExpense := models.MovingExpenseReceiptTypeStorage
amount := unit.Cents(10000)
statusApproved := models.PPMDocumentStatusApproved
movingExpenses := models.MovingExpenses{
{
MovingExpenseType: &storageExpense,
Amount: &amount,
PaidWithGTCC: models.BoolPointer(false),
SITReimburseableAmount: models.CentPointer(unit.Cents(100)),
Status: &statusApproved,
},
}

Expand Down Expand Up @@ -711,12 +721,14 @@ func (suite *ShipmentSummaryWorksheetServiceSuite) TestMemberPaidRemainingPPMEnt
func (suite *ShipmentSummaryWorksheetServiceSuite) TestAOAPacketPPMEntitlementFormatValuesShipmentSummaryWorksheetFormPage2() {
storageExpense := models.MovingExpenseReceiptTypeStorage
amount := unit.Cents(10000)
statusApproved := models.PPMDocumentStatusApproved
movingExpenses := models.MovingExpenses{
{
MovingExpenseType: &storageExpense,
Amount: &amount,
PaidWithGTCC: models.BoolPointer(false),
SITReimburseableAmount: models.CentPointer(unit.Cents(100)),
Status: &statusApproved,
},
}

Expand Down Expand Up @@ -747,12 +759,14 @@ func (suite *ShipmentSummaryWorksheetServiceSuite) TestAOAPacketPPMEntitlementFo
func (suite *ShipmentSummaryWorksheetServiceSuite) TestNullCheckForFinalIncentiveAndAOAPPMEntitlementFormatValuesShipmentSummaryWorksheetFormPage2() {
storageExpense := models.MovingExpenseReceiptTypeStorage
amount := unit.Cents(10000)
statusApproved := models.PPMDocumentStatusApproved
movingExpenses := models.MovingExpenses{
{
MovingExpenseType: &storageExpense,
Amount: &amount,
PaidWithGTCC: models.BoolPointer(false),
SITReimburseableAmount: models.CentPointer(unit.Cents(100)),
Status: &statusApproved,
},
}

Expand Down Expand Up @@ -796,12 +810,14 @@ func (suite *ShipmentSummaryWorksheetServiceSuite) TestNullCheckForFinalIncentiv
func (suite *ShipmentSummaryWorksheetServiceSuite) TestGTCCPaidRemainingPPMEntitlementFormatValuesShipmentSummaryWorksheetFormPage2() {
storageExpense := models.MovingExpenseReceiptTypeStorage
amount := unit.Cents(10000)
statusApproved := models.PPMDocumentStatusApproved
movingExpenses := models.MovingExpenses{
{
MovingExpenseType: &storageExpense,
Amount: &amount,
PaidWithGTCC: models.BoolPointer(true),
SITReimburseableAmount: models.CentPointer(unit.Cents(20000)),
Status: &statusApproved,
},
}

Expand Down Expand Up @@ -848,6 +864,7 @@ func (suite *ShipmentSummaryWorksheetServiceSuite) TestGroupExpenses() {
tollExpense := models.MovingExpenseReceiptTypeTolls
oilExpense := models.MovingExpenseReceiptTypeOil
amount := unit.Cents(10000)
statusApproved := models.PPMDocumentStatusApproved
testCases := []struct {
input models.MovingExpenses
expected map[string]float64
Expand All @@ -858,26 +875,31 @@ func (suite *ShipmentSummaryWorksheetServiceSuite) TestGroupExpenses() {
MovingExpenseType: &tollExpense,
Amount: &amount,
PaidWithGTCC: &paidWithGTCC,
Status: &statusApproved,
},
{
MovingExpenseType: &oilExpense,
Amount: &amount,
PaidWithGTCC: &paidWithGTCC,
Status: &statusApproved,
},
{
MovingExpenseType: &oilExpense,
Amount: &amount,
PaidWithGTCC: &paidWithGTCC,
Status: &statusApproved,
},
{
MovingExpenseType: &oilExpense,
Amount: &amount,
PaidWithGTCC: &paidWithGTCC,
Status: &statusApproved,
},
{
MovingExpenseType: &tollExpense,
Amount: &amount,
PaidWithGTCC: &paidWithGTCC,
Status: &statusApproved,
},
},
map[string]float64{
Expand Down Expand Up @@ -1374,22 +1396,27 @@ func (suite *ShipmentSummaryWorksheetServiceSuite) TestActualExpenseReimbursemen
}
storageExpense := models.MovingExpenseReceiptTypeStorage
contractedExpense := models.MovingExpenseReceiptTypeContractedExpense
statusApproved := models.PPMDocumentStatusApproved
movingExpenses := models.MovingExpenses{
{
MovingExpenseType: &contractedExpense,
PaidWithGTCC: models.BoolPointer(false),
Status: &statusApproved,
},
{
MovingExpenseType: &contractedExpense,
PaidWithGTCC: models.BoolPointer(true),
Status: &statusApproved,
},
{
MovingExpenseType: &storageExpense,
PaidWithGTCC: models.BoolPointer(false),
Status: &statusApproved,
},
{
MovingExpenseType: &storageExpense,
PaidWithGTCC: models.BoolPointer(true),
Status: &statusApproved,
},
}

Expand Down

0 comments on commit 91dc5e2

Please sign in to comment.