Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Console/Commands/RestoreFromBackup.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function parse_sql(string $line): string {
/* we *could* have made the ^INSERT INTO blah VALUES$ turn on the capturing state, and closed it with
a ^(blahblah);$ but it's cleaner to not have to manage the state machine. We're just going to
assume that (blahblah), or (blahblah); are values for INSERT and are always acceptable. */
"<^/\*!40101 SET NAMES '?[a-zA-Z0-9_-]+'? \*/;$>" => false, //using weird delimiters (<,>) for readability. allow quoted or unquoted charsets
"<^/\*![0-9]{5} SET NAMES '?[a-zA-Z0-9_-]+'? \*/;$>" => false, //using weird delimiters (<,>) for readability. allow quoted or unquoted charsets
"<^/\*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' \*/;$>" => false, //same, now handle zero-values
];

Expand Down
10 changes: 5 additions & 5 deletions app/Helpers/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ public static function checkLowInventory()

foreach ($consumables as $consumable) {
$avail = $consumable->numRemaining();
if ($avail < ($consumable->min_amt) + $alert_threshold) {
if ($avail <= ($consumable->min_amt) + $alert_threshold) {
if ($consumable->qty > 0) {
$percent = number_format((($avail / $consumable->qty) * 100), 0);
} else {
Expand All @@ -803,7 +803,7 @@ public static function checkLowInventory()

foreach ($accessories as $accessory) {
$avail = $accessory->qty - $accessory->checkouts_count;
if ($avail < ($accessory->min_amt) + $alert_threshold) {
if ($avail <= ($accessory->min_amt) + $alert_threshold) {
if ($accessory->qty > 0) {
$percent = number_format((($avail / $accessory->qty) * 100), 0);
} else {
Expand All @@ -822,7 +822,7 @@ public static function checkLowInventory()

foreach ($components as $component) {
$avail = $component->numRemaining();
if ($avail < ($component->min_amt) + $alert_threshold) {
if ($avail <= ($component->min_amt) + $alert_threshold) {
if ($component->qty > 0) {
$percent = number_format((($avail / $component->qty) * 100), 0);
} else {
Expand All @@ -845,7 +845,7 @@ public static function checkLowInventory()
$total_owned = $asset->where('model_id', '=', $asset_model->id)->count();
$avail = $asset->where('model_id', '=', $asset_model->id)->whereNull('assigned_to')->count();

if ($avail < ($asset_model->min_amt) + $alert_threshold) {
if ($avail <= ($asset_model->min_amt) + $alert_threshold) {
if ($avail > 0) {
$percent = number_format((($avail / $total_owned) * 100), 0);
} else {
Expand All @@ -863,7 +863,7 @@ public static function checkLowInventory()

foreach ($licenses as $license){
$avail = $license->remaincount();
if ($avail < ($license->min_amt) + $alert_threshold) {
if ($avail <= ($license->min_amt) + $alert_threshold) {
if ($avail > 0) {
$percent = number_format((($avail / $license->min_amt) * 100), 0);
} else {
Expand Down
1 change: 1 addition & 0 deletions app/Importer/Importer.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ abstract class Importer
'min_amt' => 'minimum quantity',
'remote' => 'remote',
'vip' => 'vip',
'tag_color' => 'tag color',
];
/**
* Map of item fields->csv names
Expand Down
4 changes: 4 additions & 0 deletions app/Importer/LocationImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public function createLocationIfNotExists(array $row)
$this->item['manager'] = trim($this->findCsvMatch($row, 'manager'));
$this->item['manager_username'] = trim($this->findCsvMatch($row, 'manager_username'));
$this->item['notes'] = trim($this->findCsvMatch($row, 'notes'));
$this->item['tag_color'] = trim($this->findCsvMatch($row, 'tag_color'));


if ($this->findCsvMatch($row, 'parent_location')) {
Expand All @@ -96,6 +97,9 @@ public function createLocationIfNotExists(array $row)
$location->update($this->sanitizeItemForUpdating($location));
} else {
Log::debug('Creating location');
if ($this->findCsvMatch($row, 'company')) {
$this->item['company_id'] = $this->createOrFetchCompany(trim($this->findCsvMatch($row, 'company')));
}
$location->fill($this->sanitizeItemForStoring($location));
}

Expand Down
10 changes: 10 additions & 0 deletions app/Livewire/Importer.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ public function mount()

$this->locations_fields = [
'id' => trans('general.id'),
'company' => trans('general.company'),
'name' => trans('general.name'),
'address' => trans('general.address'),
'address2' => trans('general.importer.address2'),
Expand All @@ -360,6 +361,7 @@ public function mount()
'parent_location' => trans('admin/locations/table.parent'),
'state' => trans('general.state'),
'zip' => trans('general.zip'),
'tag_color' => trans('general.tag_color'),
];

$this->suppliers_fields = [
Expand Down Expand Up @@ -608,6 +610,14 @@ public function mount()
[
'Manager Username',
],
'tag_color' =>
[
'color',
'tag color',
'label color',
'color code',
trans('general.tag_color'),
],
];

$this->columnOptions[''] = $this->getColumns(''); //blank mode? I don't know what this is supposed to mean
Expand Down
3 changes: 2 additions & 1 deletion app/Notifications/AcceptanceItemDeclinedNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ public function toMail($notifiable)
'company_name' => $this->company_name,
'qty' => $this->qty,
'admin' => $this->admin,
'intro_text' => trans('mail.acceptance_declined_greeting'),
'user' => $this->assigned_to,
'intro_text' => trans('mail.acceptance_declined_greeting', ['user' => $this->assigned_to]),
])
->subject('⚠️ '.trans('mail.acceptance_declined', ['user' => $this->assigned_to, 'item' => $this->item_name]))
->withSymfonyMessage(function (Email $message) {
Expand Down
2 changes: 1 addition & 1 deletion app/Notifications/InventoryAlert.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class InventoryAlert extends Notification
public function __construct($params, $threshold)
{
$this->items = $params;
$this->threshold = $threshold;
$this->threshold = $threshold ?? 0;
}

/**
Expand Down
8 changes: 4 additions & 4 deletions config/version.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
return array (
'app_version' => 'v8.3.6',
'full_app_version' => 'v8.3.6 - build 20551-g523df21d8',
'build_version' => '20551',
'full_app_version' => 'v8.3.6 - build 20569-g9e23117f9',
'build_version' => '20569',
'prerelease_version' => '',
'hash_version' => 'g523df21d8',
'full_hash' => 'v8.3.6-144-g523df21d8',
'hash_version' => 'g9e23117f9',
'full_hash' => 'v8.3.6-16-g9e23117f9',
'branch' => 'develop',
);
Original file line number Diff line number Diff line change
Expand Up @@ -38,52 +38,51 @@ public function up(): void
switch ($setting->skin) {
case ('green' || 'green-dark'):
$header_color = '#00a65a';
$link_dark_color = '#00a65a';
$link_dark_color = '#9ACD32';
$link_light_color = '#00a65a';
$nav_color = '#ffffff';

case ('red' || 'red-dark'):
$header_color = '#dd4b39';
$link_dark_color = '#dd4b39';
$link_dark_color = '#ed9a9a';
$link_light_color = '#dd4b39';
$nav_color = '#ffffff';

case ('orange' || 'orange-dark'):
$header_color = '#FF851B';
$link_dark_color = '#FF851B';
$link_light_color = '#FF851B';
$link_dark_color = '#FFA500';
$link_light_color = '#FF8C00';
$nav_color = '#ffffff';

case ('black' || 'black-dark'):
$header_color = '#000000';
$link_dark_color = '#111';
$link_light_color = '#111';
$link_dark_color = '#d4d2d2';
$link_light_color = '#454759';
$nav_color = '#ffffff';

case ('purple' || 'purple-dark'):
$header_color = '#605ca8';
$link_dark_color = '#605ca8';
$link_dark_color = '#AC83FF';
$link_light_color = '#605ca8';
$nav_color = '#ffffff';

case ('yellow' || 'yellow-dark') :
$header_color = '#f39c12';
$link_dark_color = '#f39c12';
$link_light_color = '#f39c12';
$header_color = '#FBCC34';
$link_dark_color = '#F0E68C';
$link_light_color = '#a69f08';
$nav_color = '#ffffff';

case 'contrast':
$header_color = '#001F3F';
$link_dark_color = '#86cbf2';
$link_light_color = '#084d73';
$link_dark_color = '#a6c9ed';
$link_light_color = '#2d4863';
$nav_color = '#ffffff';
break;
}

// Override the header color if the settings have one
if ($setting->header_color) {
$header_color = $setting->header_color;
\Log::debug('A header color was found, so lets use that instead: '.$setting->header_color);
}


Expand Down
2 changes: 1 addition & 1 deletion resources/lang/en-US/admin/settings/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@
'labels_title' => 'Update Label Settings',
'labels_title_help' => 'Changes made here must be saved before they will be reflected in the labels or the preview below.',
'labels_help' => 'Barcodes &amp; label settings',
'purge_help' => 'Purge Deleted Records',
'purge_help' => 'Permanently delete soft-deleted records',
'ldap_extension_warning' => 'It does not look like the LDAP extension is installed or enabled on this server. You can still save your settings, but you will need to enable the LDAP extension for PHP before LDAP syncing or login will work.',
'ldap_ad' => 'LDAP/AD',
'ldap_test_label' => 'Test LDAP Sync',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/account/accept/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class="table table-striped snipe-table"
<td>{{ $acceptance->checkoutable_item_type }}</td>
<td>{{ $acceptance->qty ?? '1' }}</td>
<td>{{ ($acceptance->checkoutable) ? $acceptance->checkoutable->serial : '' }}</td>
<td><a href="{{ route('account.accept.item', $acceptance) }}" class="btn btn-default btn-sm">{{ trans('general.accept_decline') }}</a></td>
<td><a href="{{ route('account.accept.item', $acceptance) }}" class="btn btn-theme btn-sm">{{ trans('general.accept_decline') }}</a></td>
@else
<td> ----- </td>
<td> {{ trans('general.error_user_company_accept_view') }} </td>
Expand Down
4 changes: 2 additions & 2 deletions resources/views/blade/form-tooltip.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<a href="#" data-tooltip="true" title="{{ $slot }}" style="padding-left: 0px;">
<x-icon type="more-info" style="font-size: 20px;" />
<a href="#" data-tooltip="true" title="{{ $slot }}" style="padding-left: 0;">
<x-icon type="more-info" style="font-size: 20px; margin-top: 5px;" />
<span class="sr-only">{{ $slot }}</span>
</a>
3 changes: 2 additions & 1 deletion resources/views/blade/input/datepicker.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
])

<!-- Datepicker -->
<div class="input-group date {{ $col_size_class }}" data-provide="datepicker" data-date-today-highlight="true" data-date-language="{{ auth()->user()->locale }}" data-date-locale="{{ auth()->user()->locale }}" data-date-format="yyyy-mm-dd" data-date-autoclose="true" data-date-clear-btn="true"{{ $end_date ? ' data-date-end-date=' . $end_date : '' }}>
<div class="input-group date {{ $col_size_class }}"
data-provide="datepicker" data-date-today-highlight="true" data-date-language="{{ auth()->user()->locale }}" data-date-locale="{{ auth()->user()->locale }}" data-date-format="yyyy-mm-dd" data-date-autoclose="true" data-date-clear-btn="true" data-date-today-btn="true" {{ $end_date ? ' data-date-end-date=' . $end_date : '' }}>
<input type="text" placeholder="{{ trans('general.select_date') }}" value="{{ $value }}" maxlength="10" {{ $attributes->merge(['class' => 'form-control']) }} {{ $required=='1' ? 'required' : '' }}>
<span class="input-group-addon"><x-icon type="calendar" /></span>

Expand Down
Loading
Loading