Эх сурвалжийг харах

fix billing with instant stop report missing info

shayne_lo 6 сар өмнө
parent
commit
9c064b328a

+ 6 - 4
EVCB_OCPP.WSServer/Message/CoreProfileHandler.cs

@@ -1238,6 +1238,10 @@ internal partial class ProfileHandler
 
                                     //tx.Cost = chargingCost + parkingCost;
 
+                                    await mainDbService.SetTransactionBillingDone(txEnergy.TxId, cost: chargingCost + parkingCost, receipt);
+
+                                    tx = await mainDbService.GetTransaction(txEnergy.TxId);
+
                                     var response = await customer.NotifyTransactionCompleted(tx, roundedPeriodEnergy);
 
                                     if (response != null)
@@ -1245,14 +1249,12 @@ internal partial class ProfileHandler
                                         couponPoint = response.CouponPoint == null ? couponPoint : response.CouponPoint.Value;
                                         farewellMessage = response.FarewellMessage == null ? farewellMessage : response.FarewellMessage;
 
-										if (response.Success)
-										{
+                                        if (response.Success)
+                                        {
                                             await mainDbService.ReportStopTx(feedto.Id, response);
                                         }
                                     }
 
-                                    await mainDbService.SetTransactionBillingDone(txEnergy.TxId, cost: chargingCost + parkingCost, receipt);
-
                                     await messageService.SendDataTransferRequest(
                                         session.ChargeBoxId,
                                         messageId: "FinalCost",