| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <?php /** @noinspection PhpUnhandledExceptionInspection */
- namespace App;
- use App\Helpers\HtmlHelper;
- $core = Core::getInstance();
- $settings = $core->getSettings();
- $products = Product::query([], ["sort" => "name"]);
- $request = Request::fromRequest();
- $default_location_id = $request->int("add_location_id");
- $location_options = [];
- foreach(Customer::getAll() as $customer) {
- foreach($customer->getLocations() as $location) {
- $location_options[$location->id] = $location->getDisplayName();
- }
- }
- ?>
- <div class="modal fade" role="dialog" tabindex="-1" data-backdrop="static" id="new-document-modal">
- <div class="modal-dialog modal-lg">
- <form class="modal-content" method="post" action="/documents/submit">
- <?php
- View::include("modals/header", ["title" => __("New Document")]);
- ?>
- <input type="hidden" name="ticket_id" value="" />
- <div class="modal-body">
- <div class="mb-3">
- <label class="form-label" for="new-document-company-id"><?= htmlspecialchars(__("Company")) ?></label>
- <select class="form-select" name="company_id" id="new-document-company-id" required>
- <option value=""><?=htmlspecialchars(__("Select Company"))?></option>
- <?php
- HtmlHelper::renderOptions(Company::getOptions(), $settings->defaultCompanyId ?? null);
- ?>
- </select>
- </div>
- <div class="mb-3">
- <label class="form-label" for="new-document-supplier-id"><?= htmlspecialchars(__("Supplier")) ?></label>
- <select class="form-select" name="supplier_id" id="new-document-supplier-id">
- <option value=""><?=htmlspecialchars(__("Select Supplier"))?></option>
- <?php
- foreach(Supplier::getAll() as $supplier) {
- ?>
- <option value="<?=$supplier->id?>">
- <?=htmlspecialchars($supplier->name)?>
- </option>
- <?php
- }
- ?>
- </select>
- </div>
- <div class="mb-3">
- <label class="form-label" for="new-document-location-id"><?= htmlspecialchars(__("Location")) ?></label>
- <select class="form-select" name="location_id" id="new-document-location-id">
- <option value=""><?=htmlspecialchars(__("Select Location"))?></option>
- <?php
- HtmlHelper::renderOptions($location_options, $default_location_id);
- ?>
- </select>
- </div>
- <section id="new-document-aru-section">
- <h5><?=htmlspecialchars(__("ARU Item"))?></h5>
- <p><?=htmlspecialchars(__("Enter details of the part that is being returned if known."))?></p>
- <div class="mb-3">
- <label class="form-label" for="new-document-product-lookup">
- <?=htmlspecialchars(__("Product Lookup"))?>
- </label>
- <select class="form-control" id="new-document-product-lookup" data-placeholder="<?=htmlspecialchars(__("Select Product"))?>">
- <option value=""></option>
- <?php
- foreach($products as $product) {
- ?>
- <option value="<?=$product->id?>" data-name="<?=htmlspecialchars($product->name)?>">
- <?=htmlspecialchars($product->name)?> / <?=htmlspecialchars($product->sku)?>
- </option>
- <?php
- }
- ?>
- </select>
- </div>
- <div class="mb-3">
- <label class="form-label" for="new-document-item-description">
- <?=htmlspecialchars(__("Description"))?>
- </label>
- <input class="form-control" type="text" name="item_description" id="new-document-item-description" maxlength="255" placeholder="<?=htmlspecialchars(__("Type description"))?>" />
- </div>
- <div class="mb-3">
- <label class="form-label" for="new-document-item-serial-number">
- <?=htmlspecialchars(__("Serial Numbers"))?>
- </label>
- <textarea class="form-control" type="text" name="item_serial_number" id="new-document-item-serial-number" maxlength="64000" placeholder="<?=htmlspecialchars(__("Type serial numbers"))?>"></textarea>
- </div>
- </section>
- </div>
- <div class="modal-footer">
- <button type="submit" class="btn btn-success">
- <?= htmlspecialchars(__("Submit")) ?>
- </button>
- </div>
- </form>
- </div>
- </div>
|