Ver Fonte

Bills - round to the nearest minute

Vijayakrishnan há 4 anos atrás
pai
commit
929d22bea5
1 ficheiros alterados com 13 adições e 1 exclusões
  1. 13 1
      resources/views/app/patient/note/dashboard.blade.php

+ 13 - 1
resources/views/app/patient/note/dashboard.blade.php

@@ -309,7 +309,19 @@
                                     </td>--}}
                                     <td class="pl-3">
                                         @if(strpos(strtolower($bill->code), 'treatment services') !== FALSE)
-                                            {{ time_in_hrminsec($bill->number_of_units * 3600) }}
+                                            <?php
+                                            $totalSeconds = $bill->number_of_units * 3600;
+                                            $remainder = $totalSeconds % 60;
+                                            if ($remainder !== 0) {
+                                                if ($remainder < 30) {
+                                                    $totalSeconds = $totalSeconds - $remainder;
+                                                }
+                                                else {
+                                                    $totalSeconds = $totalSeconds + (60 - $remainder);
+                                                }
+                                            }
+                                            ?>
+                                            {{ time_in_hrminsec($totalSeconds) }}
                                         @else
                                             @if(!!$bill->number_of_units)
                                                 {{ $bill->number_of_units }} unit(s)