diff --git a/pkg/gen/pptasapi/embedded_spec.go b/pkg/gen/pptasapi/embedded_spec.go index 0c8c13f5247..ae36cf8c2a4 100644 --- a/pkg/gen/pptasapi/embedded_spec.go +++ b/pkg/gen/pptasapi/embedded_spec.go @@ -426,7 +426,7 @@ func init() { "example": "G" }, "orderNumber": { - "description": "not to be confused with Orders Number", + "description": "LoaDocID in lines of accounting table. Not to be confused with Orders Number.", "type": "string", "x-nullable": true, "example": "030-00362" @@ -586,7 +586,7 @@ func init() { "x-nullable": true }, "bcn": { - "description": "LoaSbaltmtRcpntID in lines_of_accounting", + "description": "LoaAlltSnID in lines_of_accounting", "type": "string", "x-nullable": true }, @@ -681,7 +681,7 @@ func init() { "x-nullable": true }, "objClass": { - "description": "LoaAlltSnID in lines_of_accounting", + "description": "LoaObjClsID in lines_of_accounting", "type": "string", "x-nullable": true }, @@ -694,7 +694,7 @@ func init() { "x-nullable": true }, "paa": { - "description": "LoaDocID in lines_of_accounting", + "description": "LoaInstlAcntgActID in lines_of_accounting", "type": "string", "x-nullable": true }, @@ -839,12 +839,12 @@ func init() { "example": "Destination" }, "subAllotCD": { - "description": "LoaInstlAcntgActID in lines_of_accounting", + "description": "LoaSbaltmtRcpntID in lines_of_accounting", "type": "string", "x-nullable": true }, "subhead": { - "description": "LoaObjClsID in lines_of_accounting", + "description": "LoaTrsySfxTx in lines_of_accounting", "type": "string", "x-nullable": true }, @@ -1315,7 +1315,7 @@ func init() { "example": "G" }, "orderNumber": { - "description": "not to be confused with Orders Number", + "description": "LoaDocID in lines of accounting table. Not to be confused with Orders Number.", "type": "string", "x-nullable": true, "example": "030-00362" @@ -1475,7 +1475,7 @@ func init() { "x-nullable": true }, "bcn": { - "description": "LoaSbaltmtRcpntID in lines_of_accounting", + "description": "LoaAlltSnID in lines_of_accounting", "type": "string", "x-nullable": true }, @@ -1570,7 +1570,7 @@ func init() { "x-nullable": true }, "objClass": { - "description": "LoaAlltSnID in lines_of_accounting", + "description": "LoaObjClsID in lines_of_accounting", "type": "string", "x-nullable": true }, @@ -1583,7 +1583,7 @@ func init() { "x-nullable": true }, "paa": { - "description": "LoaDocID in lines_of_accounting", + "description": "LoaInstlAcntgActID in lines_of_accounting", "type": "string", "x-nullable": true }, @@ -1728,12 +1728,12 @@ func init() { "example": "Destination" }, "subAllotCD": { - "description": "LoaInstlAcntgActID in lines_of_accounting", + "description": "LoaSbaltmtRcpntID in lines_of_accounting", "type": "string", "x-nullable": true }, "subhead": { - "description": "LoaObjClsID in lines_of_accounting", + "description": "LoaTrsySfxTx in lines_of_accounting", "type": "string", "x-nullable": true }, diff --git a/pkg/gen/pptasmessages/p_p_t_a_s_report.go b/pkg/gen/pptasmessages/p_p_t_a_s_report.go index d36335b5882..04d2c1ce029 100644 --- a/pkg/gen/pptasmessages/p_p_t_a_s_report.go +++ b/pkg/gen/pptasmessages/p_p_t_a_s_report.go @@ -69,7 +69,7 @@ type PPTASReport struct { // Example: G MiddleInitial *string `json:"middleInitial,omitempty"` - // not to be confused with Orders Number + // LoaDocID in lines of accounting table. Not to be confused with Orders Number. // Example: 030-00362 OrderNumber *string `json:"orderNumber,omitempty"` diff --git a/pkg/gen/pptasmessages/p_p_t_a_s_shipment.go b/pkg/gen/pptasmessages/p_p_t_a_s_shipment.go index c59cfc5eb70..51425c727df 100644 --- a/pkg/gen/pptasmessages/p_p_t_a_s_shipment.go +++ b/pkg/gen/pptasmessages/p_p_t_a_s_shipment.go @@ -29,7 +29,7 @@ type PPTASShipment struct { // Appropriation Appro *string `json:"appro,omitempty"` - // LoaSbaltmtRcpntID in lines_of_accounting + // LoaAlltSnID in lines_of_accounting Bcn *string `json:"bcn,omitempty"` // LoaPgmElmntID in lines_of_accounting @@ -92,7 +92,7 @@ type PPTASShipment struct { // net weight NetWeight *int64 `json:"netWeight,omitempty"` - // LoaAlltSnID in lines_of_accounting + // LoaObjClsID in lines_of_accounting ObjClass *string `json:"objClass,omitempty"` // origin address @@ -101,7 +101,7 @@ type PPTASShipment struct { // origin price OriginPrice *float64 `json:"originPrice,omitempty"` - // LoaDocID in lines_of_accounting + // LoaInstlAcntgActID in lines_of_accounting Paa *string `json:"paa,omitempty"` // packing price @@ -188,10 +188,10 @@ type PPTASShipment struct { // Example: Destination SitType *string `json:"sitType,omitempty"` - // LoaInstlAcntgActID in lines_of_accounting + // LoaSbaltmtRcpntID in lines_of_accounting SubAllotCD *string `json:"subAllotCD,omitempty"` - // LoaObjClsID in lines_of_accounting + // LoaTrsySfxTx in lines_of_accounting Subhead *string `json:"subhead,omitempty"` // travel advance diff --git a/pkg/services/pptas_report/pptas_report_list_fetcher.go b/pkg/services/pptas_report/pptas_report_list_fetcher.go index ad6fd620997..b51a14649ab 100644 --- a/pkg/services/pptas_report/pptas_report_list_fetcher.go +++ b/pkg/services/pptas_report/pptas_report_list_fetcher.go @@ -119,10 +119,6 @@ func (f *pptasReportListFetcher) BuildPPTASReportsFromMoves(appCtx appcontext.Ap report.TravelType = (*string)(orders.OrdersTypeDetail) } - if orders.SAC != nil { - report.OrderNumber = orders.SAC - } - err := populateShipmentFields(&report, appCtx, move, orders, f.tacFetcher, f.loaFetcher, f.estimator) if err != nil { return nil, err @@ -177,7 +173,7 @@ func populateShipmentFields( } // populate TGET data - tacErr := inputReportTAC(&pptasShipment, orders, appCtx, tacFetcher, loaFetcher) + tacErr := inputReportTAC(report, &pptasShipment, orders, appCtx, tacFetcher, loaFetcher) if tacErr != nil { return tacErr } @@ -516,7 +512,7 @@ func buildServiceItemCrate(serviceItem models.MTOServiceItem) pptasmessages.Crat } // inputs all TAC related fields and builds full line of accounting string -func inputReportTAC(pptasShipment *pptasmessages.PPTASShipment, orders models.Order, appCtx appcontext.AppContext, tacFetcher services.TransportationAccountingCodeFetcher, loa services.LineOfAccountingFetcher) error { +func inputReportTAC(report *models.PPTASReport, pptasShipment *pptasmessages.PPTASShipment, orders models.Order, appCtx appcontext.AppContext, tacFetcher services.TransportationAccountingCodeFetcher, loa services.LineOfAccountingFetcher) error { tac, err := tacFetcher.FetchOrderTransportationAccountingCodes(models.DepartmentIndicator(*orders.DepartmentIndicator), orders.IssueDate, *orders.TAC, appCtx) if err != nil { return err @@ -530,15 +526,19 @@ func inputReportTAC(pptasShipment *pptasmessages.PPTASShipment, orders models.Or pptasShipment.Loa = &longLoa pptasShipment.FiscalYear = tac[0].TacFyTxt pptasShipment.Appro = tac[0].LineOfAccounting.LoaBafID - pptasShipment.Subhead = tac[0].LineOfAccounting.LoaObjClsID - pptasShipment.ObjClass = tac[0].LineOfAccounting.LoaAlltSnID - pptasShipment.Bcn = tac[0].LineOfAccounting.LoaSbaltmtRcpntID - pptasShipment.SubAllotCD = tac[0].LineOfAccounting.LoaInstlAcntgActID + pptasShipment.Subhead = tac[0].LineOfAccounting.LoaTrsySfxTx + pptasShipment.ObjClass = tac[0].LineOfAccounting.LoaObjClsID + pptasShipment.Bcn = tac[0].LineOfAccounting.LoaAlltSnID + pptasShipment.SubAllotCD = tac[0].LineOfAccounting.LoaSbaltmtRcpntID pptasShipment.Aaa = tac[0].LineOfAccounting.LoaTrnsnID pptasShipment.TypeCD = tac[0].LineOfAccounting.LoaJbOrdNm - pptasShipment.Paa = tac[0].LineOfAccounting.LoaDocID + pptasShipment.Paa = tac[0].LineOfAccounting.LoaInstlAcntgActID pptasShipment.CostCD = tac[0].LineOfAccounting.LoaPgmElmntID pptasShipment.Ddcd = tac[0].LineOfAccounting.LoaDptID + + if report.OrderNumber == nil { + report.OrderNumber = tac[0].LineOfAccounting.LoaDocID + } } return nil diff --git a/swagger-def/definitions/PPTASReport.yaml b/swagger-def/definitions/PPTASReport.yaml index 89181be9d3a..1717be197fe 100644 --- a/swagger-def/definitions/PPTASReport.yaml +++ b/swagger-def/definitions/PPTASReport.yaml @@ -139,7 +139,7 @@ properties: type: string format: date orderNumber: - description: not to be confused with Orders Number + description: LoaDocID in lines of accounting table. Not to be confused with Orders Number. type: string example: '030-00362' x-nullable: true diff --git a/swagger-def/definitions/PPTASShipment.yaml b/swagger-def/definitions/PPTASShipment.yaml index 97b03ddc808..2db323ff437 100644 --- a/swagger-def/definitions/PPTASShipment.yaml +++ b/swagger-def/definitions/PPTASShipment.yaml @@ -21,19 +21,19 @@ properties: type: string x-nullable: true subhead: - description: LoaObjClsID in lines_of_accounting + description: LoaTrsySfxTx in lines_of_accounting type: string x-nullable: true objClass: - description: LoaAlltSnID in lines_of_accounting + description: LoaObjClsID in lines_of_accounting type: string x-nullable: true bcn: - description: LoaSbaltmtRcpntID in lines_of_accounting + description: LoaAlltSnID in lines_of_accounting type: string x-nullable: true subAllotCD: - description: LoaInstlAcntgActID in lines_of_accounting + description: LoaSbaltmtRcpntID in lines_of_accounting type: string x-nullable: true aaa: @@ -45,7 +45,7 @@ properties: type: string x-nullable: true paa: - description: LoaDocID in lines_of_accounting + description: LoaInstlAcntgActID in lines_of_accounting type: string x-nullable: true costCD: diff --git a/swagger/pptas.yaml b/swagger/pptas.yaml index 78fb09f97fc..6d78e9d956e 100644 --- a/swagger/pptas.yaml +++ b/swagger/pptas.yaml @@ -312,19 +312,19 @@ definitions: type: string x-nullable: true subhead: - description: LoaObjClsID in lines_of_accounting + description: LoaTrsySfxTx in lines_of_accounting type: string x-nullable: true objClass: - description: LoaAlltSnID in lines_of_accounting + description: LoaObjClsID in lines_of_accounting type: string x-nullable: true bcn: - description: LoaSbaltmtRcpntID in lines_of_accounting + description: LoaAlltSnID in lines_of_accounting type: string x-nullable: true subAllotCD: - description: LoaInstlAcntgActID in lines_of_accounting + description: LoaSbaltmtRcpntID in lines_of_accounting type: string x-nullable: true aaa: @@ -336,7 +336,7 @@ definitions: type: string x-nullable: true paa: - description: LoaDocID in lines_of_accounting + description: LoaInstlAcntgActID in lines_of_accounting type: string x-nullable: true costCD: @@ -677,7 +677,9 @@ definitions: type: string format: date orderNumber: - description: not to be confused with Orders Number + description: >- + LoaDocID in lines of accounting table. Not to be confused with Orders + Number. type: string example: 030-00362 x-nullable: true