show packages quantity loaded into container

This commit is contained in:
omair saleh
2021-11-02 21:32:20 +08:00
parent 9977d516e1
commit f5ea06e3fe
2 changed files with 7 additions and 1 deletions
@@ -51,7 +51,9 @@ class UpdateRemarkLogic extends AbstractControllerLogic
/**
* @param Request $request
* @return JsonResponse
* @throws ErrorException
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function logic(Request $request) : JsonResponse
{
@@ -26,6 +26,10 @@
<p class="no-margin fs-10 all-caps">ETA</p>
<p class="no-margin">{{item.transport ? item.transport.current_schedule.eta : 'n/a'}}</p>
</div>
<div class="col-auto">
<p class="no-margin fs-10 all-caps">Packages</p>
<p class="no-margin">{{ item.packing_lists.reduce((total, obj) => total + obj.packages.reduce((total, obj) => obj.quantity + total, 0), 0) }}</p>
</div>
<div class="col-auto">
<p class="no-margin fs-10 all-caps">Loaded CBM</p>
<p class="no-margin">{{ (Math.ceil((item.packing_lists.reduce((total, obj) => total + obj.packages.reduce((total, obj) => obj.cbm + total, 0), 0)) * 1000) / 1000).toFixed(3) }}</p>