| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?php /** @noinspection PhpUnhandledExceptionInspection */
- namespace App;
- /**
- * @var Sale[] $sales
- */
- $core = Core::getInstance();
- $user = $core->getUser();
- ?>
- <table class="table table-bordered table-hover mb-3">
- <thead>
- <tr>
- <th><?=htmlspecialchars(__("Ref."))?></th>
- <th><?=htmlspecialchars(__("Date"))?></th>
- <th><?=htmlspecialchars(__("Location"))?></th>
- <th><?=htmlspecialchars(__("Status"))?></th>
- <th><?=htmlspecialchars(__("Items"))?></th>
- <th><?=htmlspecialchars(__("Value"))?></th>
- <th><?=htmlspecialchars(__("Predicted Sold Date"))?></th>
- <th><?=htmlspecialchars(__("Last Updated"))?></th>
- <th><?=htmlspecialchars(__("Actions"))?></th>
- </tr>
- </thead>
- <tbody>
- <?php
- foreach($sales as $sale) {
- $location = $sale->getLocation();
- ?>
- <tr>
- <td class="text-end">
- <a href="<?=htmlspecialchars($sale->getUrl())?>"><?=htmlspecialchars($sale->getReference())?></a>
- </td>
- <td>
- <?=htmlspecialchars($user->formatDate($sale->getDateTimeCreated()))?>
- </td>
- <td>
- <a href="<?=htmlspecialchars($location->getUrl())?>">
- <?=htmlspecialchars($location->getDisplayName())?>
- </a>
- </td>
- <td>
- <?=htmlspecialchars($sale->getDisplayStatus())?>
- </td>
- <td>
- <?php
- foreach($sale->getItems() as $item) {
- ?>
- <?=htmlspecialchars($item->getProduct()->name)?> × <?=$item->quantity?><br />
- <?php
- }
- ?>
- </td>
- <td class="text-end">
- <?=htmlspecialchars($sale->getDisplayAmount())?>
- </td>
- <td>
- <?=htmlspecialchars($sale->getDisplayPredictedSoldDate())?>
- </td>
- <td>
- <?php
- $dt_updated = $sale->getDateTimeUpdated();
- if($dt_updated) {
- echo $dt_updated->diffForHumans();
- }
- ?>
- </td>
- <td class="p-1">
- <a class="btn btn-sm btn-primary" href="<?=htmlspecialchars($sale->getUrl())?>">
- <?=htmlspecialchars(__("View"))?>
- </a>
- </td>
- </tr>
- <?php
- }
- ?>
- </tbody>
- </table>
|