[Weberp-svn] SF.net SVN: weberp:[8486] trunk
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2012-01-30 12:57:03
|
Revision: 8486 http://weberp.svn.sourceforge.net/weberp/?rev=8486&view=rev Author: tim_schofield Date: 2012-01-30 12:56:55 +0000 (Mon, 30 Jan 2012) Log Message: ----------- Add in facility for separate issueing GL account for each stock category Modified Paths: -------------- trunk/InternalStockRequestFulfill.php trunk/StockCategories.php trunk/includes/SQL_CommonFunctions.inc trunk/includes/session.inc Added Paths: ----------- trunk/sql/mysql/updates/105.php Modified: trunk/InternalStockRequestFulfill.php =================================================================== --- trunk/InternalStockRequestFulfill.php 2012-01-29 20:48:00 UTC (rev 8485) +++ trunk/InternalStockRequestFulfill.php 2012-01-30 12:56:55 UTC (rev 8486) @@ -120,7 +120,7 @@ '" .$AdjustmentNumber . "', '" . $SQLAdjustmentDate . "', '" . $PeriodNo . "', - '" . $StockGLCodes['adjglact'] . "', + '" . $StockGLCodes['issueglact'] . "', '" . $StandardCost * -($Quantity) . "', '" . $Narrative . "', '" . $Tag . "' Modified: trunk/StockCategories.php =================================================================== --- trunk/StockCategories.php 2012-01-29 20:48:00 UTC (rev 8485) +++ trunk/StockCategories.php 2012-01-30 12:56:55 UTC (rev 8486) @@ -73,6 +73,7 @@ categorydescription = '" . $_POST['CategoryDescription'] . "', stockact = " . $_POST['StockAct'] . ", adjglact = " . $_POST['AdjGLAct'] . ", + issueglact = " . $_POST['IssueGLAct'] . ", purchpricevaract = " . $_POST['PurchPriceVarAct'] . ", materialuseagevarac = " . $_POST['MaterialUseageVarAc'] . ", wipact = " . $_POST['WIPAct'] . " @@ -142,6 +143,7 @@ categorydescription, stockact, adjglact, + issueglact, purchpricevaract, materialuseagevarac, wipact) @@ -151,6 +153,7 @@ '" . $_POST['CategoryDescription'] . "', " . $_POST['StockAct'] . ", " . $_POST['AdjGLAct'] . ", + " . $_POST['IssueGLAct'] . ", " . $_POST['PurchPriceVarAct'] . ", " . $_POST['MaterialUseageVarAc'] . ", " . $_POST['WIPAct'] . ")"; @@ -165,6 +168,7 @@ unset($_POST['CategoryDescription']); unset($_POST['StockAct']); unset($_POST['AdjGLAct']); + unset($_POST['IssueGLAct']); unset($_POST['PurchPriceVarAct']); unset($_POST['MaterialUseageVarAc']); unset($_POST['WIPAct']); @@ -216,6 +220,7 @@ stocktype, stockact, adjglact, + issueglact, purchpricevaract, materialuseagevarac, wipact @@ -228,6 +233,7 @@ <th>' . _('Type') . '</th> <th>' . _('Stock GL') . '</th> <th>' . _('Adjts GL') . '</th> + <th>' . _('Issues GL') . '</th> <th>' . _('Price Var GL') . '</th> <th>' . _('Usage Var GL') . '</th> <th>' . _('WIP GL') . '</th></tr>'; @@ -250,6 +256,7 @@ <td class="number">%s</td> <td class="number">%s</td> <td class="number">%s</td> + <td class="number">%s</td> <td><a href="%sSelectedCategory=%s">' . _('Edit') . '</td> <td><a href="%sSelectedCategory=%s&delete=yes" onclick="return confirm("' . _('Are you sure you wish to delete this stock category? Additional checks will be performed before actual deletion to ensure data integrity is not compromised.') . '");">' . _('Delete') . '</td> </tr>', @@ -258,6 +265,7 @@ $myrow['stocktype'], $myrow['stockact'], $myrow['adjglact'], + $myrow['issueglact'], $myrow['purchpricevaract'], $myrow['materialuseagevarac'], $myrow['wipact'], @@ -272,221 +280,238 @@ //end of ifs and buts! -?> +echo '<br />'; -<br /> -<?php -if (isset($SelectedCategory)) { ?> - <div class='centre'><a href="<?php echo $_SERVER['PHP_SELF'];?>"><?php echo _('Show All Stock Categories'); ?></a></div> -<?php } ?> +if (isset($SelectedCategory)) { + echo '<a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" >' . _('Show All Stock Categories') . '</a></div>'; +} -<br /> +echo '<br />'; -<?php +echo '<form name="CategoryForm" method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +if (isset($SelectedCategory)) { + //editing an existing stock category + if (!isset($_POST['UpdateTypes'])) { + $sql = "SELECT categoryid, + stocktype, + categorydescription, + stockact, + adjglact, + issueglact, + purchpricevaract, + materialuseagevarac, + wipact + FROM stockcategory + WHERE categoryid='" . $SelectedCategory . "'"; - echo '<form name="CategoryForm" method="post" action="' . $_SERVER['PHP_SELF'] . '">'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + $result = DB_query($sql, $db); + $myrow = DB_fetch_array($result); - if (isset($SelectedCategory)) { - //editing an existing stock category - if (!isset($_POST['UpdateTypes'])) { - $sql = "SELECT categoryid, - stocktype, - categorydescription, - stockact, - adjglact, - purchpricevaract, - materialuseagevarac, - wipact - FROM stockcategory - WHERE categoryid='" . $SelectedCategory . "'"; + $_POST['CategoryID'] = $myrow['categoryid']; + $_POST['StockType'] = $myrow['stocktype']; + $_POST['CategoryDescription'] = $myrow['categorydescription']; + $_POST['StockAct'] = $myrow['stockact']; + $_POST['AdjGLAct'] = $myrow['adjglact']; + $_POST['IssueGLAct'] = $myrow['issueglact']; + $_POST['PurchPriceVarAct'] = $myrow['purchpricevaract']; + $_POST['MaterialUseageVarAc'] = $myrow['materialuseagevarac']; + $_POST['WIPAct'] = $myrow['wipact']; + } + echo '<input type="hidden" name="SelectedCategory" value="' . $SelectedCategory . '" />'; + echo '<input type="hidden" name="CategoryID" value="' . $_POST['CategoryID'] . '" />'; + echo '<table class="selection"><tr><td>' . _('Category Code') . ':</td><td>' . $_POST['CategoryID'] . '</td></tr>'; - $result = DB_query($sql, $db); - $myrow = DB_fetch_array($result); +} else { //end of if $SelectedCategory only do the else when a new record is being entered + if (!isset($_POST['CategoryID'])) { + $_POST['CategoryID'] = ''; + } + echo '<table class="selection"><tr><td>' . _('Category Code') . ':</td> + <td><input type="text" name="CategoryID" size="7" maxlength="6" value="' . $_POST['CategoryID'] . '" /></td></tr>'; +} - $_POST['CategoryID'] = $myrow['categoryid']; - $_POST['StockType'] = $myrow['stocktype']; - $_POST['CategoryDescription'] = $myrow['categorydescription']; - $_POST['StockAct'] = $myrow['stockact']; - $_POST['AdjGLAct'] = $myrow['adjglact']; - $_POST['PurchPriceVarAct'] = $myrow['purchpricevaract']; - $_POST['MaterialUseageVarAc'] = $myrow['materialuseagevarac']; - $_POST['WIPAct'] = $myrow['wipact']; - } - echo '<input type="hidden" name="SelectedCategory" value="' . $SelectedCategory . '" />'; - echo '<input type="hidden" name="CategoryID" value="' . $_POST['CategoryID'] . '" />'; - echo '<table class="selection"><tr><td>' . _('Category Code') . ':</td><td>' . $_POST['CategoryID'] . '</td></tr>'; +//SQL to poulate account selection boxes +$sql = "SELECT accountcode, + accountname + FROM chartmaster + LEFT JOIN accountgroups + ON chartmaster.group_=accountgroups.groupname + WHERE accountgroups.pandl=0 + ORDER BY accountcode"; - } else { //end of if $SelectedCategory only do the else when a new record is being entered - if (!isset($_POST['CategoryID'])) { - $_POST['CategoryID'] = ''; - } - echo '<table class="selection"><tr><td>' . _('Category Code') . ':</td> - <td><input type="text" name="CategoryID" size="7" maxlength="6" value="' . $_POST['CategoryID'] . '" /></td></tr>'; - } +$BSAccountsResult = DB_query($sql,$db); - //SQL to poulate account selection boxes - $sql = "SELECT accountcode, - accountname - FROM chartmaster, - accountgroups - WHERE chartmaster.group_=accountgroups.groupname and - accountgroups.pandl=0 - ORDER BY accountcode"; +$sql = "SELECT accountcode, + accountname + FROM chartmaster + LEFT JOIN accountgroups + ON chartmaster.group_=accountgroups.groupname + WHERE accountgroups.pandl=1 + ORDER BY accountcode"; - $BSAccountsResult = DB_query($sql,$db); +$PnLAccountsResult = DB_query($sql,$db); - $sql = "SELECT accountcode, - accountname - FROM chartmaster, - accountgroups - WHERE chartmaster.group_=accountgroups.groupname and - accountgroups.pandl!=0 - ORDER BY accountcode"; +if (!isset($_POST['CategoryDescription'])) { + $_POST['CategoryDescription'] = ''; +} - $PnLAccountsResult = DB_query($sql,$db); +echo '<tr> + <td>' . _('Category Description') . ':</td> + <td><input type="text" name="CategoryDescription" size="22" maxlength="20" value="' . $_POST['CategoryDescription'] . '" /></td> + </tr>'; - if (!isset($_POST['CategoryDescription'])) { - $_POST['CategoryDescription'] = ''; - } - echo '<tr><td>' . _('Category Description') . ':</td> - <td><input type="text" name="CategoryDescription" size="22" maxlength="20" value="' . $_POST['CategoryDescription'] . '" /></td></tr>'; +echo '<tr> + <td>' . _('Stock Type') . ':</td> + <td><select name="StockType" onChange="ReloadForm(CategoryForm.UpdateTypes)" >'; +if (isset($_POST['StockType']) and $_POST['StockType']=='F') { + echo '<option selected="True" value="F">' . _('Finished Goods') . '</option>'; +} else { + echo '<option value="F">' . _('Finished Goods') . '</option>'; +} +if (isset($_POST['StockType']) and $_POST['StockType']=='M') { + echo '<option selected="True" value="M">' . _('Raw Materials') . '</option>'; +} else { + echo '<option value="M">' . _('Raw Materials') . '</option>'; +} +if (isset($_POST['StockType']) and $_POST['StockType']=='D') { + echo '<option selected="True" value="D">' . _('Dummy Item - (No Movements)') . '</option>'; +} else { + echo '<option value="D">' . _('Dummy Item - (No Movements)') . '</option>'; +} +if (isset($_POST['StockType']) and $_POST['StockType']=='L') { + echo '<option selected="True" value="L">' . _('Labour') . '</option>'; +} else { + echo '<option value="L">' . _('Labour') . '</option>'; +} +echo '</select></td></tr>'; - echo '<tr><td>' . _('Stock Type') . ':</td> - <td><select name="StockType" onChange="ReloadForm(CategoryForm.UpdateTypes)" >'; - if (isset($_POST['StockType']) and $_POST['StockType']=='F') { - echo '<option selected="True" value="F">' . _('Finished Goods') . '</option>'; - } else { - echo '<option value="F">' . _('Finished Goods') . '</option>'; - } - if (isset($_POST['StockType']) and $_POST['StockType']=='M') { - echo '<option selected="True" value="M">' . _('Raw Materials') . '</option>'; - } else { - echo '<option value="M">' . _('Raw Materials') . '</option>'; - } - if (isset($_POST['StockType']) and $_POST['StockType']=='D') { - echo '<option selected="True" value="D">' . _('Dummy Item - (No Movements)') . '</option>'; - } else { - echo '<option value="D">' . _('Dummy Item - (No Movements)') . '</option>'; - } - if (isset($_POST['StockType']) and $_POST['StockType']=='L') { - echo '<option selected="True" value="L">' . _('Labour') . '</option>'; - } else { - echo '<option value="L">' . _('Labour') . '</option>'; - } +echo '<input type="submit" name="UpdateTypes" style="visibility:hidden;width:1px" value="Not Seen" />'; +if (isset($_POST['StockType']) and $_POST['StockType']=='L') { + $Result = $PnLAccountsResult; + echo '<tr><td>' . _('Recovery GL Code'); +} else { + $Result = $BSAccountsResult; + echo '<tr><td>' . _('Stock GL Code'); +} +echo ':</td><td><select name="StockAct">'; - echo '</select></td></tr>'; +while ($myrow = DB_fetch_array($Result)){ - echo '<input type="submit" name="UpdateTypes" style="visibility:hidden;width:1px" value="Not Seen" />'; - if (isset($_POST['StockType']) and $_POST['StockType']=='L') { - $Result = $PnLAccountsResult; - echo '<tr><td>' . _('Recovery GL Code'); + if (isset($_POST['StockAct']) and $myrow['accountcode']==$_POST['StockAct']) { + echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } else { - $Result = $BSAccountsResult; - echo '<tr><td>' . _('Stock GL Code'); + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } - echo ':</td><td><select name="StockAct">'; +} //end while loop +DB_data_seek($PnLAccountsResult,0); +DB_data_seek($BSAccountsResult,0); +echo '</select></td></tr>'; - while ($myrow = DB_fetch_array($Result)){ +echo '<tr><td>' . _('WIP GL Code') . ':</td><td><select name="WIPAct">'; - if (isset($_POST['StockAct']) and $myrow['accountcode']==$_POST['StockAct']) { - echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; - } else { - echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; - } - } //end while loop - DB_data_seek($PnLAccountsResult,0); - DB_data_seek($BSAccountsResult,0); - echo '</select></td></tr>'; +while ($myrow = DB_fetch_array($BSAccountsResult)) { - echo '<tr><td>' . _('WIP GL Code') . ':</td><td><select name="WIPAct">'; + if (isset($_POST['WIPAct']) and $myrow['accountcode']==$_POST['WIPAct']) { + echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; + } else { + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; + } - while ($myrow = DB_fetch_array($BSAccountsResult)) { +} //end while loop +echo '</select></td></tr>'; +DB_data_seek($BSAccountsResult,0); - if (isset($_POST['WIPAct']) and $myrow['accountcode']==$_POST['WIPAct']) { - echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; - } else { - echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; - } +echo '<tr> + <td>' . _('Stock Adjustments GL Code') . ':</td> + <td><select name="AdjGLAct">'; - } //end while loop - echo '</select></td></tr>'; - DB_data_seek($BSAccountsResult,0); +while ($myrow = DB_fetch_array($PnLAccountsResult)) { + if (isset($_POST['AdjGLAct']) and $myrow['accountcode']==$_POST['AdjGLAct']) { + echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; + } else { + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; + } - echo '<tr><td>' . _('Stock Adjustments GL Code') . ':</td> - <td><select name="AdjGLAct">'; +} //end while loop +DB_data_seek($PnLAccountsResult,0); +echo '</select></td></tr>'; - while ($myrow = DB_fetch_array($PnLAccountsResult)) { - if (isset($_POST['AdjGLAct']) and $myrow['accountcode']==$_POST['AdjGLAct']) { - echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; - } else { - echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; - } +echo '<tr> + <td>' . _('Internal Stock Issues GL Code') . ':</td> + <td><select name="IssueGLAct">'; - } //end while loop - DB_data_seek($PnLAccountsResult,0); - echo '</select></td></tr>'; +while ($myrow = DB_fetch_array($PnLAccountsResult)) { + if (isset($_POST['IssueGLAct']) and $myrow['accountcode']==$_POST['IssueGLAct']) { + echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; + } else { + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; + } - echo '<tr><td>' . _('Price Variance GL Code') . ':</td> - <td><select name="PurchPriceVarAct">'; +} //end while loop +DB_data_seek($PnLAccountsResult,0); +echo '</select></td></tr>'; - while ($myrow = DB_fetch_array($PnLAccountsResult)) { - if (isset($_POST['PurchPriceVarAct']) and $myrow['accountcode']==$_POST['PurchPriceVarAct']) { - echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; - } else { - echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; - } +echo '<tr> + <td>' . _('Price Variance GL Code') . ':</td> + <td><select name="PurchPriceVarAct">'; - } //end while loop - DB_data_seek($PnLAccountsResult,0); - - echo '</select></td></tr><tr><td>'; - if (isset($_POST['StockType']) and $_POST['StockType']=='L') { - echo _('Labour Efficiency Variance GL Code'); +while ($myrow = DB_fetch_array($PnLAccountsResult)) { + if (isset($_POST['PurchPriceVarAct']) and $myrow['accountcode']==$_POST['PurchPriceVarAct']) { + echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } else { - echo _('Usage Variance GL Code'); + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } - echo ':</td><td><select name="MaterialUseageVarAc">'; - while ($myrow = DB_fetch_array($PnLAccountsResult)) { - if (isset($_POST['MaterialUseageVarAc']) and $myrow['accountcode']==$_POST['MaterialUseageVarAc']) { - echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; - } else { - echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; - } +} //end while loop +DB_data_seek($PnLAccountsResult,0); - } //end while loop - DB_free_result($PnLAccountsResult); - echo '</select></td></tr> - </table>'; - if (!isset($SelectedCategory)) { - $SelectedCategory=''; +echo '</select></td></tr><tr><td>'; +if (isset($_POST['StockType']) and $_POST['StockType']=='L') { + echo _('Labour Efficiency Variance GL Code'); +} else { + echo _('Usage Variance GL Code'); +} +echo ':</td><td><select name="MaterialUseageVarAc">'; + +while ($myrow = DB_fetch_array($PnLAccountsResult)) { + if (isset($_POST['MaterialUseageVarAc']) and $myrow['accountcode']==$_POST['MaterialUseageVarAc']) { + echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; + } else { + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } - if (isset($SelectedCategory)) { - //editing an existing stock category - $sql = "SELECT stkcatpropid, - label, - controltype, - defaultvalue, - numericvalue, - minimumvalue, - maximumvalue, - reqatsalesorder - FROM stockcatproperties - WHERE categoryid='" . $SelectedCategory . "' - ORDER BY stkcatpropid"; +} //end while loop +DB_free_result($PnLAccountsResult); +echo '</select></td></tr> + </table>'; +if (!isset($SelectedCategory)) { + $SelectedCategory=''; +} +if (isset($SelectedCategory)) { + //editing an existing stock category - $result = DB_query($sql, $db); + $sql = "SELECT stkcatpropid, + label, + controltype, + defaultvalue, + numericvalue, + minimumvalue, + maximumvalue, + reqatsalesorder + FROM stockcatproperties + WHERE categoryid='" . $SelectedCategory . "' + ORDER BY stkcatpropid"; + $result = DB_query($sql, $db); + /* echo '<br />Number of rows returned by the sql = ' . DB_num_rows($result) . '<br />The SQL was:<br />' . $sql; */ - echo '<br /><table class="selection">'; - $TableHeader = '<tr><th>' . _('Property Label') . '</th> + echo '<br /><table class="selection">'; + $TableHeader = '<tr><th>' . _('Property Label') . '</th> <th>' . _('Control Type') . '</th> <th>' . _('Default Value') . '</th> <th>' . _('Numeric Value') . '</th> @@ -494,90 +519,87 @@ <th>' . _('Maximum Value') . '</th> <th>' . _('Require in SO') . '</th> </tr>'; - echo $TableHeader; - $PropertyCounter =0; - $HeadingCounter =0; - while ($myrow = DB_fetch_array($result)) { - if ($HeadingCounter>15){ - echo $TableHeader; - $HeadingCounter=0; - } else { - $HeadingCounter++; - } - echo '<input type="hidden" name="PropID' . $PropertyCounter .'" value="' . $myrow['stkcatpropid'] . '" />'; - echo '<tr><td><input type="text" name="PropLabel' . $PropertyCounter . '" size="50" maxlength="100" value="' . $myrow['label'] . '" /></td> - <td><select name="PropControlType' . $PropertyCounter . '">'; - if ($myrow['controltype']==0){ - echo '<option selected="True" value="0">' . _('Text Box') . '</option>'; - } else { - echo '<option value="0">' . _('Text Box') . '</option>'; - } - if ($myrow['controltype']==1){ - echo '<option selected="True" value="1">' . _('Select Box') . '</option>'; - } else { - echo '<option value="1">' . _('Select Box') . '</option>'; - } - if ($myrow['controltype']==2){ - echo '<option selected="True" value="2">' . _('Check Box') . '</option>'; - } else { - echo '<option value="2">' . _('Check Box') . '</option>'; - } - if ($myrow['controltype']==3){ - echo '<option selected="True" value="3">' . _('Date Box') . '</option>'; - } else { - echo '<option value="3">' . _('Date Box') . '</option>'; - } + echo $TableHeader; + $PropertyCounter =0; + $HeadingCounter =0; + while ($myrow = DB_fetch_array($result)) { + if ($HeadingCounter>15){ + echo $TableHeader; + $HeadingCounter=0; + } else { + $HeadingCounter++; + } + echo '<input type="hidden" name="PropID' . $PropertyCounter .'" value="' . $myrow['stkcatpropid'] . '" />'; + echo '<tr><td><input type="text" name="PropLabel' . $PropertyCounter . '" size="50" maxlength="100" value="' . $myrow['label'] . '" /></td> + <td><select name="PropControlType' . $PropertyCounter . '">'; + if ($myrow['controltype']==0){ + echo '<option selected="True" value="0">' . _('Text Box') . '</option>'; + } else { + echo '<option value="0">' . _('Text Box') . '</option>'; + } + if ($myrow['controltype']==1){ + echo '<option selected="True" value="1">' . _('Select Box') . '</option>'; + } else { + echo '<option value="1">' . _('Select Box') . '</option>'; + } + if ($myrow['controltype']==2){ + echo '<option selected="True" value="2">' . _('Check Box') . '</option>'; + } else { + echo '<option value="2">' . _('Check Box') . '</option>'; + } + if ($myrow['controltype']==3){ + echo '<option selected="True" value="3">' . _('Date Box') . '</option>'; + } else { + echo '<option value="3">' . _('Date Box') . '</option>'; + } - echo '</select></td> + echo '</select></td> <td><input type="text" name="PropDefault' . $PropertyCounter . '" value="' . $myrow['defaultvalue'] . '" /></td>'; - if ($myrow['numericvalue']==1){ - echo '<td><input type="checkbox" name="PropNumeric' . $PropertyCounter . '" checked="True" />'; - } else { - echo '<td><input type="checkbox" name="PropNumeric' . $PropertyCounter . '" />'; - } + if ($myrow['numericvalue']==1){ + echo '<td><input type="checkbox" name="PropNumeric' . $PropertyCounter . '" checked="True" />'; + } else { + echo '<td><input type="checkbox" name="PropNumeric' . $PropertyCounter . '" />'; + } - echo '</td> - <td><input type="text" name="PropMinimum' . $PropertyCounter . '" value="' . $myrow['minimumvalue'] . '" /></td> - <td><input type="text" name="PropMaximum' . $PropertyCounter . '" value="' . $myrow['maximumvalue'] . '" /></td>'; + echo '</td> + <td><input type="text" name="PropMinimum' . $PropertyCounter . '" value="' . $myrow['minimumvalue'] . '" /></td> + <td><input type="text" name="PropMaximum' . $PropertyCounter . '" value="' . $myrow['maximumvalue'] . '" /></td>'; - if ($myrow['reqatsalesorder']==1){ - echo '<td align="center"><input type="checkbox" name="PropReqSO' . $PropertyCounter .'" checked="True" />'; - } else { - echo '<td align="center"><input type="checkbox" name="PropReqSO' . $PropertyCounter .'" />'; - } + if ($myrow['reqatsalesorder']==1){ + echo '<td align="center"><input type="checkbox" name="PropReqSO' . $PropertyCounter .'" checked="True" />'; + } else { + echo '<td align="center"><input type="checkbox" name="PropReqSO' . $PropertyCounter .'" />'; + } - echo '</td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?DeleteProperty=' . $myrow['stkcatpropid'] .'&SelectedCategory=' . $SelectedCategory . '" onclick=\'return confirm("' . _('Are you sure you wish to delete this property? All properties of this type set up for stock items will also be deleted.') . '");\'>' . _('Delete') . '</td></tr>'; + echo '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?DeleteProperty=' . $myrow['stkcatpropid'] .'&SelectedCategory=' . $SelectedCategory . '" onclick=\'return confirm("' . _('Are you sure you wish to delete this property? All properties of this type set up for stock items will also be deleted.') . '");\'>' . _('Delete') . '</td></tr>'; - $PropertyCounter++; - } //end loop around defined properties for this category - echo '<input type="hidden" name="PropID' . $PropertyCounter .'" value="NewProperty" />'; - echo '<tr><td><input type="text" name="PropLabel' . $PropertyCounter . '" size="50" maxlength="100" /></td> - <td><select name="PropControlType' . $PropertyCounter . '">'; - echo '<option selected="True" value="0">' . _('Text Box') . '</option>'; - echo '<option value="1">' . _('Select Box') . '</option>'; - echo '<option value="2">' . _('Check Box') . '</option>'; - echo '<option value="3">' . _('Date Box') . '</option>'; - echo '</select></td> - <td><input type="text" name="PropDefault' . $PropertyCounter . '" /></td> - <td><input type="checkbox" name="PropNumeric' . $PropertyCounter . '" /></td> - <td><input type="text" name="PropMinimum' . $PropertyCounter . '" /></td> - <td><input type="text" name="PropMaximum' . $PropertyCounter . '" /></td> - <td align="center"><input type="checkbox" name="PropReqSO' . $PropertyCounter .'" /></td></tr>'; - echo '</table>'; - echo '<input type="hidden" name="PropertyCounter" value="' . $PropertyCounter . '" />'; + $PropertyCounter++; + } //end loop around defined properties for this category + echo '<input type="hidden" name="PropID' . $PropertyCounter .'" value="NewProperty" />'; + echo '<tr><td><input type="text" name="PropLabel' . $PropertyCounter . '" size="50" maxlength="100" /></td> + <td><select name="PropControlType' . $PropertyCounter . '">'; + echo '<option selected="True" value="0">' . _('Text Box') . '</option>'; + echo '<option value="1">' . _('Select Box') . '</option>'; + echo '<option value="2">' . _('Check Box') . '</option>'; + echo '<option value="3">' . _('Date Box') . '</option>'; + echo '</select></td> + <td><input type="text" name="PropDefault' . $PropertyCounter . '" /></td> + <td><input type="checkbox" name="PropNumeric' . $PropertyCounter . '" /></td> + <td><input type="text" name="PropMinimum' . $PropertyCounter . '" /></td> + <td><input type="text" name="PropMaximum' . $PropertyCounter . '" /></td> + <td align="center"><input type="checkbox" name="PropReqSO' . $PropertyCounter .'" /></td></tr>'; + echo '</table>'; + echo '<input type="hidden" name="PropertyCounter" value="' . $PropertyCounter . '" />'; - } /* end if there is a category selected */ +} /* end if there is a category selected */ - echo '<br /><div class="centre"><input type="submit" name="submit" value="' . _('Enter Information') . '" /></div>'; +echo '<br /><div class="centre"><input type="submit" name="submit" value="' . _('Enter Information') . '" /></div>'; +echo '</form>'; - echo '</form>'; - - - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/includes/SQL_CommonFunctions.inc =================================================================== --- trunk/includes/SQL_CommonFunctions.inc 2012-01-29 20:48:00 UTC (rev 8485) +++ trunk/includes/SQL_CommonFunctions.inc 2012-01-30 12:56:55 UTC (rev 8486) @@ -42,6 +42,7 @@ /*Gets the GL Codes relevant to the stock item account from the stock category record */ $QuerySQL = "SELECT stockact, adjglact, + issueglact, purchpricevaract, materialuseagevarac, wipact Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2012-01-29 20:48:00 UTC (rev 8485) +++ trunk/includes/session.inc 2012-01-30 12:56:55 UTC (rev 8486) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=104; +$DBVersion=105; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Added: trunk/sql/mysql/updates/105.php =================================================================== --- trunk/sql/mysql/updates/105.php (rev 0) +++ trunk/sql/mysql/updates/105.php 2012-01-30 12:56:55 UTC (rev 8486) @@ -0,0 +1,14 @@ +<?php + +/* Include the new script for printing quotations in Portrait + */ + +AddColumn('issueglact', 'stockcategory', 'INT( 11 )', 'not null', 0, 'adjglact', $db); + +$sql="UPDATE stockcategory + SET issueglact=adjglact"; +$result=DB_query($sql, $db); + +UpdateDBNo(105, $db); + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |