@@ -213,6 +213,7 @@ codeunit 139611 "Shpfy Order Refund Test"
213213 JRefundLine: JsonObject ;
214214 ReturnLocations: Dictionary of [BigInteger , BigInteger ];
215215 RefundLineId: BigInteger ;
216+ LineItemId: BigInteger ;
216217 ReturnLocationId: BigInteger ;
217218 begin
218219 // [SCENARIO] Import refund lines with locations
@@ -222,10 +223,11 @@ codeunit 139611 "Shpfy Order Refund Test"
222223 RefundId := OrderRefundsHelper. CreateRefundHeader() ;
223224 // [GIVEN] Refund Line response
224225 RefundLineId := Any. IntegerInRange( 100000 , 999999 ) ;
225- CreateRefundLineResponse( JRefundLine, RefundLineId, 0 ) ;
226+ LineItemId := Any. IntegerInRange( 100000 , 999999 ) ;
227+ CreateRefundLineResponse( JRefundLine, RefundLineId, LineItemId, 0 ) ;
226228 // [GIVEN] Return Locations
227229 ReturnLocationId := Any. IntegerInRange( 100000 , 999999 ) ;
228- ReturnLocations. Add ( RefundLineId , ReturnLocationId) ;
230+ ReturnLocations. Add ( LineItemId , ReturnLocationId) ;
229231
230232 // [WHEN] Execute RefundsAPI.FillInRefundLine
231233 RefundsAPI. FillInRefundLine( RefundId, JRefundLine, false, ReturnLocations) ;
@@ -501,9 +503,17 @@ codeunit 139611 "Shpfy Order Refund Test"
501503
502504 local procedure CreateRefundLineResponse( var JRefundLine: JsonObject ; RefundLineId: BigInteger ; RefundLocationId: BigInteger )
503505 var
504- RefundLineLbl: Label ' {"lineItem": {"id": "gid://shopify/LineItem/%1"}, "quantity": 1, "restockType": "no_restock", "location": {"legacyResourceId": %2}} ' , Comment = ' %1 = RefundLineId, %2 = RefundLocationId ' , Locked = true ;
506+ LineItemId: BigInteger ;
505507 begin
506- JRefundLine. ReadFrom( StrSubstNo( RefundLineLbl, RefundLineId, RefundLocationId)) ;
508+ LineItemId := Any. IntegerInRange( 100000 , 999999 ) ;
509+ CreateRefundLineResponse( JRefundLine, RefundLineId, LineItemId, RefundLocationId) ;
510+ end ;
511+
512+ local procedure CreateRefundLineResponse( var JRefundLine: JsonObject ; RefundLineId: BigInteger ; LineItemId: BigInteger ; RefundLocationId: BigInteger )
513+ var
514+ RefundLineLbl: Label ' {"id": "gid://shopify/RefundLineItem/%1", "lineItem": {"id": "gid://shopify/LineItem/%2"}, "quantity": 1, "restockType": "no_restock", "location": {"legacyResourceId": %3}}' , Comment = ' %1 = RefundLineId, %2 = LineItemId, %3 = RefundLocationId' , Locked = true;
515+ begin
516+ JRefundLine. ReadFrom( StrSubstNo( RefundLineLbl, RefundLineId, LineItemId, RefundLocationId)) ;
507517 end ;
508518
509519 local procedure CerateProcessedShopifyOrder( var OrderId: BigInteger ; var OrderLineId: BigInteger )
0 commit comments