|
|
@@ -5,21 +5,33 @@ namespace App;
|
|
|
use App\Enums\DocumentTypes;
|
|
|
|
|
|
/**
|
|
|
+ * @var string $title
|
|
|
+ * @var int $type
|
|
|
* @var Document[] $documents
|
|
|
* @var Pagination $pagination
|
|
|
*/
|
|
|
|
|
|
+$is_invoice = ($type === DocumentTypes::INVOICE);
|
|
|
+$is_goods_in = ($type === DocumentTypes::GOODS_IN);
|
|
|
+$is_aru = ($type === DocumentTypes::ADVANCE_REPLACEMENT_UNIT);
|
|
|
+
|
|
|
?>
|
|
|
<div class="row mb-3">
|
|
|
<div class="col">
|
|
|
- <h3><?=htmlspecialchars(__("Goods-In"))?></h3>
|
|
|
- </div>
|
|
|
- <div class="col-auto">
|
|
|
- <a class="btn btn-success" data-bs-toggle="modal" data-bs-target="#new-document-modal" data-type="<?=DocumentTypes::GOODS_IN?>">
|
|
|
- <i class="fa fa-fw fa-plus"></i>
|
|
|
- <?=htmlspecialchars(__("Add"))?>
|
|
|
- </a>
|
|
|
+ <h3><?=htmlspecialchars($title)?></h3>
|
|
|
</div>
|
|
|
+ <?php
|
|
|
+ if($is_goods_in || $is_aru) {
|
|
|
+ ?>
|
|
|
+ <div class="col-auto">
|
|
|
+ <a class="btn btn-success" data-bs-toggle="modal" data-bs-target="#new-document-modal" data-type="<?=$type?>">
|
|
|
+ <i class="fa fa-fw fa-plus"></i>
|
|
|
+ <?=htmlspecialchars(__("Add"))?>
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
</div>
|
|
|
|
|
|
<?php
|
|
|
@@ -28,7 +40,7 @@ if(empty($documents)) {
|
|
|
?>
|
|
|
<div class="alert alert-info">
|
|
|
<i class="fa fa-fw fa-info-circle"></i>
|
|
|
- <?=htmlspecialchars(__("No goods-in documents to display."))?>
|
|
|
+ <?=htmlspecialchars(__("No documents to display."))?>
|
|
|
</div>
|
|
|
<?php
|
|
|
}
|
|
|
@@ -38,7 +50,20 @@ else {
|
|
|
<thead>
|
|
|
<tr>
|
|
|
<th><?=htmlspecialchars(__("Number"))?></th>
|
|
|
- <th><?=htmlspecialchars(__("Supplier / Location"))?></th>
|
|
|
+ <?php
|
|
|
+ if($is_goods_in) {
|
|
|
+ ?>
|
|
|
+ <th><?=htmlspecialchars(__("Location / Supplier"))?></th>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ ?>
|
|
|
+ <th><?=htmlspecialchars(__("Location"))?></th>
|
|
|
+ <th><?=htmlspecialchars(__("Status"))?></th>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+
|
|
|
<th><?=htmlspecialchars(__("Items"))?></th>
|
|
|
<th><?=htmlspecialchars(__("Actions"))?></th>
|
|
|
</tr>
|
|
|
@@ -57,18 +82,38 @@ else {
|
|
|
<?php
|
|
|
if($location) {
|
|
|
?>
|
|
|
- <a href="<?=htmlspecialchars($location->getUrl())?>"><?=htmlspecialchars($location->getDisplayName())?></a>
|
|
|
- <i class="fa fa-fw fa-shop"></i>
|
|
|
+ <a href="<?=htmlspecialchars($location->getUrl())?>">
|
|
|
+ <?=htmlspecialchars($location->getDisplayName())?>
|
|
|
+ </a>
|
|
|
<?php
|
|
|
}
|
|
|
- else if($supplier) {
|
|
|
+ if($supplier) {
|
|
|
?>
|
|
|
- <a href="<?=htmlspecialchars($supplier->getUrl())?>"><?=htmlspecialchars($supplier->name)?></a>
|
|
|
- <i class="fa fa-fw fa-truck"></i>
|
|
|
+ <a href="<?=htmlspecialchars($supplier->getUrl())?>">
|
|
|
+ <?=htmlspecialchars($supplier->name)?>
|
|
|
+ </a>
|
|
|
<?php
|
|
|
}
|
|
|
?>
|
|
|
</td>
|
|
|
+ <?php
|
|
|
+ if(!$is_goods_in) {
|
|
|
+ if($is_invoice) {
|
|
|
+ ?>
|
|
|
+ <td>
|
|
|
+ <?=htmlspecialchars($document->getDisplayInvoiceStatus())?>
|
|
|
+ </td>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ ?>
|
|
|
+ <td>
|
|
|
+ <?=htmlspecialchars($document->getDisplayAruStatus())?>
|
|
|
+ </td>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ?>
|
|
|
<td>
|
|
|
<ul class="list-unstyled mb-0">
|
|
|
<?php
|