|
|
@@ -5,17 +5,36 @@ namespace App;
|
|
|
/**
|
|
|
* @var string $title
|
|
|
* @var Document[] $sales_orders
|
|
|
+ * @var bool $show_add_button
|
|
|
*/
|
|
|
|
|
|
+use App\Enums\DocumentTypes;
|
|
|
use App\Helpers\HtmlHelper;
|
|
|
|
|
|
$title ??= __("Sales Orders");
|
|
|
$show_location_column ??= true;
|
|
|
+$show_add_button ??= false;
|
|
|
|
|
|
?>
|
|
|
|
|
|
<section class="mb-4">
|
|
|
- <h3><?=htmlspecialchars($title)?></h3>
|
|
|
+ <div class="row">
|
|
|
+ <div class="col">
|
|
|
+ <h3><?=htmlspecialchars($title)?></h3>
|
|
|
+ </div>
|
|
|
+ <?php
|
|
|
+ if($show_add_button) {
|
|
|
+ ?>
|
|
|
+ <div class="col-auto">
|
|
|
+ <button type="button" id="new-document-button" class="btn btn-success" data-bs-toggle="modal" data-bs-target="#new-document-modal" data-type="<?=DocumentTypes::SALES_ORDER?>">
|
|
|
+ <i class="fa fa-fw fa-plus"></i>
|
|
|
+ <?=htmlspecialchars(__("Add"))?>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ </div>
|
|
|
<?php
|
|
|
if(empty($sales_orders)) {
|
|
|
HtmlHelper::renderInfoAlert(__("No sales orders to display."));
|