Skip to content

Commit

Permalink
Merge pull request #183 from globaldyne/v11.1
Browse files Browse the repository at this point in the history
V11.1
  • Loading branch information
globaldyne authored Aug 31, 2024
2 parents 3c288de + 9e3bf4f commit cc82631
Show file tree
Hide file tree
Showing 86 changed files with 4,236 additions and 12,006 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
# CHANGELOG
### Version 11.1
- When an ingredient is excluded from formula calculation will also be excluded from any IFRA validations
- Add a warning in a formula when the ingredient has ifra by passed
- Fix IFRA by pass in formulas
- Fix progress bar in formula view not showing properly
- Added currency list
- Set default currency to GBP
- Directory restructure - WIP
- Fix DeepSearch function not properly showing
- Change ingredient manage to id instead of a name
- Added a link to the full ingredient data in MakeFormula
- Removed row zoom for MakeFormula
- Bootbox 6.0 update
- Added deletion for batches
- Error handling for ingredient management
- PDF doc generation is now GA for ingredients
- Make formula improvements
- Bootstrap update to 5.3.3
- jquery update to 3.7.1
- Improved error handling when generating a batch document and archiving a formula
- Blocked auto update for versions before 10.x
- Fix formula archiving when deleting a formula
- Fix auto pdf generation when a formula is marked as complete

### Version 11.0
- Making SDS GA
- Added maximum allowed usage for a formula
Expand Down
2 changes: 1 addition & 1 deletion VERSION.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11.0
11.1
77 changes: 36 additions & 41 deletions core/full_formula_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,28 +195,43 @@

$u = searchIFRA($ing_q['cas'],$formula['ingredient'],null,$defCatClass);

if(($u['val'] || $u['type'] && $ing_q['byPassIFRA'] == 0)){
$r['usage_limit'] = (float)number_format((float)$u['val'], $settings['qStep']);
$r['usage_restriction'] = (string)$u['risk'] ?: 'N/A';
$r['usage_restriction_type'] = (string)$u['type'] ?: 'N/A';
$r['usage_regulator'] = (string)"IFRA";
}else{
$r['usage_limit'] = number_format((float)$ing_q["$defCatClass"], $settings['qStep']) ?: 100;
$r['usage_restriction'] = (int)$ing_q['classification'];
if (($u['val'] || $u['type']) && $ing_q['byPassIFRA'] === '0' && $formula['exclude_from_calculation'] == '0') {
$r['usage_limit'] = number_format((float)$u['val'], $settings['qStep']);
$r['usage_restriction'] = isset($u['risk']) ? (string)$u['risk'] : 'N/A';
$r['usage_restriction_type'] = isset($u['type']) ? (string)$u['type'] : 'N/A';
$r['usage_regulator'] = 'IFRA';


} else {
$r['usage_limit'] = number_format((float)($ing_q["$defCatClass"] ?? 100), $settings['qStep']);
$r['usage_restriction'] = (int)($ing_q['classification'] ?? 1);

if ($ing_q['classification'] == 1) {
$r['usage_restriction_type'] = 'RECOMMENDATION';
} elseif ($ing_q['classification'] == 2) {
$r['usage_restriction_type'] = 'RESTRICTION';
} elseif ($ing_q['classification'] == 3) {
$r['usage_restriction_type'] = 'SPECIFICATION';
} elseif ($ing_q['classification'] == 4) {
$r['usage_restriction_type'] = 'PROHIBITION';
} else {
$r['usage_restriction_type'] = 'RECOMMENDATION';

switch ($ing_q['classification']) {
case 1:
$r['usage_restriction_type'] = 'RECOMMENDATION';
break;
case 2:
$r['usage_restriction_type'] = 'RESTRICTION';
break;
case 3:
$r['usage_restriction_type'] = 'SPECIFICATION';
break;
case 4:
$r['usage_restriction_type'] = 'PROHIBITION';
break;
default:
$r['usage_restriction_type'] = 'RECOMMENDATION';
break;
}
$r['usage_regulator'] = (string)"PV";
$r['ingredient']['classification'] = (int)$ing_q['classification'] ?: 1;

$r['usage_regulator'] = 'PV';
$r['ingredient']['classification'] = (int)($ing_q['classification'] ?? 1);
}
if($ing_q['byPassIFRA'] === '0') {
$r['isIFRAbyPass'] = (int)0;
} else {
$r['isIFRAbyPass'] = (int)1;
}

if($meta['defView'] == '1'){
Expand Down Expand Up @@ -295,29 +310,9 @@

$m['max_usage'] = $lastValAccepted;
} else {
$m['max_usage'] = 'Unable to calculate';
$m['max_usage'] = 'Unable to calculate ';
}
/*
$new_conc = $_GET['final_total_ml'] ?: 100/100*$_GET['final_type_conc'] ?: 100;
$carrier = $_GET['final_total_ml'] ?: 100 - $new_conc;

if($m['total_ingredients'] != 0 && !$_POST['search']){
if( validateFormula($meta['fid'], $_GET['final_total_ml'] ?: 100, $new_conc, $mg['total_mg'], $_GET['val_cat']?: $defCatClass, $settings['qStep']) == TRUE){
$val_status = 1;
$val_msg = 'Your formula contains materials, exceeding and/or missing IFRA standards. Please alter your formula.';
}
}
$compliance['checked_for'] = (string)$_GET['val_cat'] ?: $defCatClass;
$compliance['final_total_ml'] = (int)$_GET['final_total_ml'] ?: 100;
$compliance['final_type_conc'] = (int)$_GET['final_type_conc'] ?: 100;
$compliance['carier'] = (int)$carier ?: 100;
$compliance['status'] = (int)$val_status ?: 0;
$compliance['message'] = (string)$val_msg ?: 'Formula is IFRA compliant';
$response['compliance'] = $compliance;
*/
$response['meta'] = $m;

$s['load_time'] = microtime(true) - $starttime;
Expand Down
6 changes: 3 additions & 3 deletions css/bootstrap.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/bootstrap.min.css.map

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion css/makeFormula.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@ table.dataTable {
page-break-after: auto;
}
}


.mfp-iframe-holder .mfp-content {
line-height: 0;
width: 80% !important;
max-width: 100% !important;
height: 1300px !important;
}
10 changes: 6 additions & 4 deletions css/sb-admin-2.css
Original file line number Diff line number Diff line change
Expand Up @@ -4917,6 +4917,7 @@ a.badge-dark:focus, a.badge-dark.focus {
.alert-dark .alert-link {
color: #18181c !important;
}
/*
@-webkit-keyframes progress-bar-stripes {
from {
Expand All @@ -4935,16 +4936,17 @@ a.badge-dark:focus, a.badge-dark.focus {
background-position: 0 0;
}
}
*/

.progress {
.formula-progress-bar {
display: flex;
height: 1rem;
overflow: hidden;
font-size: 0.75rem;
background-color: #eaecf4;
background-color: var( --bs-secondary-bg);
border-radius: 0.35rem;
}

/*
.progress-bar {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -4978,7 +4980,7 @@ a.badge-dark:focus, a.badge-dark.focus {
animation: none;
}
}

*/
.media {
display: flex;
align-items: flex-start;
Expand Down
Loading

0 comments on commit cc82631

Please sign in to comment.