diff --git a/CHANGELOG.md b/CHANGELOG.md index 362a715a..7f1edd68 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,17 @@ # CHANGELOG +### Version 10.7 +- Removed ingredient purity and dilutant from Finished Product page for cleaner view +- Moved IFRA doc to a modal window +- Added a print button for the generated IFRA Doc +- Fix IFRA Document failing to be generated +- Formula Make page refactor +- Lids page minor update +- Added a pending materials page to list all pending materials and their quantity required for the pending formulas +- todo.php has been renamed to scheduledFormulas.php +- Add suppliers in pending formulas backend +- Choose which supplier you updating the stock when making a formula +- Show available stock from all the available suppliers when making a formula, instead of the preferred one only + ### Version 10.6 - Ingredient Where Used page minor improvements - Ingredient Usage & Limits page minor improvements diff --git a/VERSION.md b/VERSION.md index 12c0281a..4e74f9f0 100755 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -10.6 +10.7 diff --git a/core/list_pending_materials_data.php b/core/list_pending_materials_data.php new file mode 100644 index 00000000..843c8c15 --- /dev/null +++ b/core/list_pending_materials_data.php @@ -0,0 +1,50 @@ + diff --git a/core/pending_formulas_data.php b/core/pending_formulas_data.php index dc4196e6..acd6eec3 100644 --- a/core/pending_formulas_data.php +++ b/core/pending_formulas_data.php @@ -44,36 +44,42 @@ } foreach ($rs as $rq) { - $gING = mysqli_fetch_array(mysqli_query($conn, "SELECT cas,odor FROM ingredients WHERE name = '".$rq['ingredient']."'")); - $inventory = mysqli_fetch_array(mysqli_query($conn, "SELECT stock,mUnit FROM suppliers WHERE ingID = '".$rq['ingredient_id']."' AND preferred = '1'")); + $gING = mysqli_fetch_array(mysqli_query($conn, "SELECT cas, odor FROM ingredients WHERE name = '".$rq['ingredient']."'")); + $inventory = mysqli_fetch_array(mysqli_query($conn, "SELECT ingSupplierID, SUM(stock) OVER() AS stock, mUnit FROM suppliers WHERE ingID = '".$rq['ingredient_id']."'")); + $supplier = mysqli_fetch_array(mysqli_query($conn, "SELECT id, name FROM ingSuppliers WHERE id = '".$inventory['ingSupplierID']."'")); + $repq = mysqli_fetch_array(mysqli_query($conn, "SELECT name FROM ingredients WHERE id = '".$rq['replacement_id']."'")); - + $r['id'] = (int)$rq['id']; $r['fid'] = (string)$rq['fid']; $r['repID'] = (string)$rq['replacement_id']; $r['repName'] = (string)$repq['name']; $r['name'] = (string)$rq['name']; - $r['ingredient'] = (string)$rq['ingredient']; + $r['ingredient'] = (string)$rq['ingredient']; $r['ingID'] = (int)$rq['ingredient_id']; - $r['cas'] = (string)$gING['cas']?:'N/A'; - $r['odor'] = (string)$gING['odor']?:'N/A'; - + $r['cas'] = (string)$gING['cas'] ?: 'N/A'; + $r['odor'] = (string)$gING['odor'] ?: 'N/A'; + $r['concentration'] = (float)$rq['concentration']; $r['dilutant'] = (string)$rq['dilutant'] ?: 'None'; - $r['quantity'] = number_format((float)$rq['quantity'], $settings['qStep'],'.', '') ?: 0; - $r['originalQuantity'] = number_format((float)$rq['originalQuantity'], $settings['qStep'],'.', '') ?: 0; - $r['overdose'] = number_format((float)$rq['overdose'], $settings['qStep'],'.', '') ?: 0; - + $r['quantity'] = number_format((float)$rq['quantity'], $settings['qStep'], '.', '') ?: 0; + $r['originalQuantity'] = number_format((float)$rq['originalQuantity'], $settings['qStep'], '.', '') ?: 0; + $r['overdose'] = number_format((float)$rq['overdose'], $settings['qStep'], '.', '') ?: 0; + $r['inventory']['stock'] = (float)$inventory['stock'] ?: 0; $r['inventory']['mUnit'] = (string)$inventory['mUnit'] ?: $settings['mUnit']; + $r['inventory'][]['supplier'] = [ + 'name' => (string)$supplier['name'], + 'id' => (string)$supplier['id'] + ]; + $r['toAdd'] = (int)$rq['toAdd']; $r['toSkip'] = (int)$rq['skip']; - - - - $rx[]=$r; + + $rx[] = $r; } + foreach ($rsq as $rq) { $mg['total_mg'] += $rq['quantity']; } diff --git a/db/schema.ver b/db/schema.ver index 12c0281a..4e74f9f0 100644 --- a/db/schema.ver +++ b/db/schema.ver @@ -1 +1 @@ -10.6 +10.7 diff --git a/func/genBatchPDF.php b/func/genBatchPDF.php index 8c710642..4333cfa2 100644 --- a/func/genBatchPDF.php +++ b/func/genBatchPDF.php @@ -217,16 +217,17 @@ function Code39($xpos, $ypos, $code, $baseline=0.5, $height=5){ } while ($res_all_ing = mysqli_fetch_array($qAllIng)) { - $bldQ = mysqli_query($conn, "SELECT ing,name,cas,$defPercentage FROM ingredient_compounds WHERE ing = '".$res_all_ing['ingredient']."'"); - while($bld = mysqli_fetch_array($bldQ)){ - $pdf->Ln(); - $pdf->SetFont('Arial','',8); - - $pdf->Cell(68,8,$bld['ing'],1,0,'C'); - - $pdf->Cell(68,8,$bld['name'],1,0,'C'); - $pdf->Cell(68,8,$bld['cas'],1,0,'C'); - $pdf->Cell(68,8,$bld[$defPercentage],1,0,'C'); + if($bldQ = mysqli_query($conn, "SELECT ing,name,cas,$defPercentage FROM ingredient_compounds WHERE ing = '".$res_all_ing['ingredient']."'")){ + while($bld = mysqli_fetch_array($bldQ)){ + $pdf->Ln(); + $pdf->SetFont('Arial','',8); + + $pdf->Cell(68,8,$bld['ing'],1,0,'C'); + + $pdf->Cell(68,8,$bld['name'],1,0,'C'); + $pdf->Cell(68,8,$bld['cas'],1,0,'C'); + $pdf->Cell(68,8,$bld[$defPercentage],1,0,'C'); + } } } diff --git a/index.php b/index.php index 97a62bf7..1db7709a 100755 --- a/index.php +++ b/index.php @@ -183,7 +183,7 @@ function chkUpdate() {
  • Export to PDF
  • -
  • IFRA Document
  • -
  • View Box Back Label
  • @@ -111,13 +109,11 @@ - Ingredient - CAS# - Purity% - Dilutant - Quantity - Concentration - Cost + Ingredient + CAS# + Quantity () + Concentration% + Cost () - - - - None - - + - - Sub Total: @@ -190,8 +179,6 @@ - - Carrier/Solvent: @@ -199,8 +186,6 @@ - - Bottle: @@ -208,8 +193,6 @@ - - Lid: @@ -217,8 +200,6 @@ - - Batch No: @@ -226,8 +207,6 @@ - - - Total: @@ -236,11 +215,8 @@ -
    -

    -

    *Values in: red exceeds usage level, yellow have no usage level set, green are within usage level, blue are exceeding recommended usage level

    -
    - + +

    *Values in: red exceeds usage level, dark red banned/prohibited, yellow Specification,green are within usage level,blue are exceeding recommended usage level

    @@ -269,11 +245,8 @@ INFO: You need to create at least one formula first.'; + echo '
    INFO: You need to create at least one formula first.
    '; return; } if(mysqli_num_rows(mysqli_query($conn, "SELECT id FROM bottles"))== 0){ - echo '
    INFO: You need to add at least one bottle in your inventory first.
    '; + echo '
    INFO: You need to add at least one bottle in your inventory first.
    '; return; } if(mysqli_num_rows(mysqli_query($conn, "SELECT id FROM ingredients WHERE type = 'Carrier' OR type = 'Solvent'"))== 0){ - echo '
    INFO: You need to add at least one solvent or carrier first.
    '; + echo '
    INFO: You need to add at least one solvent or carrier first.
    '; return; } @@ -332,7 +304,7 @@ $fTypes[] = $fTypes_res; } ?> -
    +
    @@ -441,6 +413,27 @@
    + + + - + +