|
|
@@ -1,12 +1,18 @@
|
|
|
<?php
|
|
|
namespace App;
|
|
|
|
|
|
+use App\Helpers\HtmlHelper;
|
|
|
+
|
|
|
/**
|
|
|
* @var Customer $customer
|
|
|
*/
|
|
|
|
|
|
$customers = isset($customer) ? [$customer] : Customer::getAll();
|
|
|
|
|
|
+$core = Core::getInstance();
|
|
|
+$settings = $core->getSettings();
|
|
|
+$default_company_id = $settings->defaultCompanyId ?? null;
|
|
|
+
|
|
|
?>
|
|
|
<div class="modal fade" role="dialog" tabindex="-1" data-backdrop="static" id="new-sale-modal">
|
|
|
<div class="modal-dialog modal-lg">
|
|
|
@@ -19,15 +25,10 @@ $customers = isset($customer) ? [$customer] : Customer::getAll();
|
|
|
<label for="new-sale-company-id" class="form-label">
|
|
|
<?=htmlspecialchars(__("Company"))?>
|
|
|
</label>
|
|
|
- <select class="form-control" name="company_id" id="new-sale-company-id">
|
|
|
+ <select class="form-control" name="company_id" id="new-sale-company-id" required>
|
|
|
+ <option value=""><?=htmlspecialchars(__("Select Company"))?></option>
|
|
|
<?php
|
|
|
- foreach(Company::getAll() as $company) {
|
|
|
- ?>
|
|
|
- <option value="<?=$company->id?>">
|
|
|
- <?=htmlspecialchars($company->name)?>
|
|
|
- </option>
|
|
|
- <?php
|
|
|
- }
|
|
|
+ HtmlHelper::renderOptions(Company::getOptions(), $default_company_id);
|
|
|
?>
|
|
|
</select>
|
|
|
</div>
|