|
From: <dai...@us...> - 2012-09-01 00:18:11
|
Revision: 5616
http://web-erp.svn.sourceforge.net/web-erp/?rev=5616&view=rev
Author: daintree
Date: 2012-09-01 00:18:04 +0000 (Sat, 01 Sep 2012)
Log Message:
-----------
accounts groups change option when deleting an existing account group that is used by several accounts
Modified Paths:
--------------
trunk/AccountGroups.php
trunk/GLAccounts.php
trunk/doc/Change.log
trunk/includes/footer.inc
Modified: trunk/AccountGroups.php
===================================================================
--- trunk/AccountGroups.php 2012-08-30 18:26:44 UTC (rev 5615)
+++ trunk/AccountGroups.php 2012-09-01 00:18:04 UTC (rev 5616)
@@ -40,6 +40,15 @@
$Errors = array();
+if (isset($_POST['MoveGroup'])) {
+ $sql="UPDATE chartmaster SET group_='" . $_POST['DestinyAccountGroup'] . "' WHERE group_='" . $_POST['OriginalAccountGroup'] . "'";
+ $ErrMsg = _('An error occurred in moving the account group');
+ $DbgMsg = _('The SQL that was used to moving the account group was');
+ $result = DB_query($sql,$db,$ErrMsg,$DbgMsg);
+ echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Review Account Groups') . '</a></div>';
+ prnMsg( _('All accounts in the account group:') . ' ' . $_POST['OriginalAccountGroup'] . ' ' . _('have been changed to the account group:') . ' ' . $_POST['DestinyAccountGroup'],'success');
+}
+
if (isset($_POST['submit'])) {
//initialise no input errors assumed initially before we test
@@ -180,7 +189,31 @@
if ($myrow['groups']>0) {
prnMsg( _('Cannot delete this account group because general ledger accounts have been created using this group'),'warn');
echo '<br />' . _('There are') . ' ' . $myrow['groups'] . ' ' . _('general ledger accounts that refer to this account group');
+ echo '<br /><form method="post" id="AccountGroups" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">';
+
+ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
+ echo '<table class="selection">';
+ echo '<input type="hidden" name="OriginalAccountGroup" value="' . $_GET['SelectedAccountGroup'] . '" />';
+ echo '<tr>
+ <td>' . _('Parent Group') . ':' . '</td>
+ <td><select tabindex="2" ' . (in_array('ParentGroupName',$Errors) ? 'class="selecterror"' : '' ) . ' name="DestinyAccountGroup">';
+ $sql = "SELECT groupname FROM accountgroups";
+ $GroupResult = DB_query($sql, $db,$ErrMsg,$DbgMsg);
+ while ($GroupRow = DB_fetch_array($GroupResult) ) {
+
+ if (isset($_POST['ParentGroupName']) AND $_POST['ParentGroupName']==$RroupRow['groupname']) {
+ echo '<option selected="selected" value="'.htmlentities($GroupRow['groupname'], ENT_QUOTES,'UTF-8').'">' .htmlentities($GroupRow['groupname'], ENT_QUOTES,'UTF-8'). '</option>';
+ } else {
+ echo '<option value="'.htmlentities($GroupRow['groupname'], ENT_QUOTES,'UTF-8').'">' .htmlentities($GroupRow['groupname'], ENT_QUOTES,'UTF-8').'</option>';
+ }
+ }
+ echo '</select>';
+ echo '</td></tr>';
+ echo '<tr>
+ <td colspan="2"><div class="centre"><input tabindex="6" type="submit" name="MoveGroup" value="' . _('Move Group') . '" /></div></td>
+ </tr>';
+
} else {
$sql = "SELECT COUNT(groupname) groupnames FROM accountgroups WHERE parentgroupname = '" . $_GET['SelectedAccountGroup'] . "'";
$ErrMsg = _('An error occurred in retrieving the parent group information');
@@ -190,6 +223,7 @@
if ($myrow['groupnames']>0) {
prnMsg( _('Cannot delete this account group because it is a parent account group of other account group(s)'),'warn');
echo '<br />' . _('There are') . ' ' . $myrow['groupnames'] . ' ' . _('account groups that have this group as its/there parent account group');
+
} else {
$sql="DELETE FROM accountgroups WHERE groupname='" . $_GET['SelectedAccountGroup'] . "'";
$ErrMsg = _('An error occurred in deleting the account group');
@@ -321,8 +355,8 @@
<td>' . $_POST['GroupName'] . '</td>
</tr>';
- } else { //end of if $_POST['SelectedAccountGroup'] only do the else when a new record is being entered
-
+ } elseif (!isset($_POST['MoveGroup'])) { //end of if $_POST['SelectedAccountGroup'] only do the else when a new record is being entered
+
if (!isset($_POST['SelectedAccountGroup'])){
$_POST['SelectedAccountGroup']='';
}
Modified: trunk/GLAccounts.php
===================================================================
--- trunk/GLAccounts.php 2012-08-30 18:26:44 UTC (rev 5615)
+++ trunk/GLAccounts.php 2012-09-01 00:18:04 UTC (rev 5616)
@@ -238,10 +238,12 @@
if (!isset($_POST['AccountName'])) {$_POST['AccountName']='';}
echo '<tr><td>' . _('Account Name') . ':</td><td><input type="text" size="51" maxlength="50" name="AccountName" value="' . $_POST['AccountName'] . '" /></td></tr>';
- $sql = 'SELECT groupname FROM accountgroups ORDER BY sequenceintb';
+ "$sql = 'SELECT groupname FROM accountgroups ORDER BY sequenceintb";
$result = DB_query($sql, $db);
- echo '<tr><td>' . _('Account Group') . ':</td><td><select name="Group">';
+ echo '<tr>
+ <td>' . _('Account Group') . ':</td>
+ <td><select name="Group">';
while ($myrow = DB_fetch_array($result)){
if (isset($_POST['Group']) and $myrow[0]==$_POST['Group']){
@@ -251,7 +253,9 @@
}
echo $myrow[0] . '">' . $myrow[0] . '</option>';
}
- echo '</select></td></tr></table>';
+ echo '</select></td>
+ </tr>
+ </table>';
if (!isset($_GET['SelectedAccount']) or $_GET['SelectedAccount']=='') {
echo '<script type="text/javascript">defaultControl(document.GLAccounts.AccountCode);</script>';
Modified: trunk/doc/Change.log
===================================================================
--- trunk/doc/Change.log 2012-08-30 18:26:44 UTC (rev 5615)
+++ trunk/doc/Change.log 2012-09-01 00:18:04 UTC (rev 5616)
@@ -1,4 +1,5 @@
webERP Change Log
+1/9/12 Carlos Rubio: AccountGroups.php now has option to move to alternative accountgroups
30/8/2012 Exson: fixed sql problem reported bymodpr0be
24/8/12 Serge Gélinas: Added new fr_CA.utf8 French Quebec translation
21/8/12 Phil: Stock.php could not change an item to an assembly if there were any old completed or deleted/rejected purchase orders for the item.
Modified: trunk/includes/footer.inc
===================================================================
--- trunk/includes/footer.inc 2012-08-30 18:26:44 UTC (rev 5615)
+++ trunk/includes/footer.inc 2012-09-01 00:18:04 UTC (rev 5616)
@@ -2,32 +2,28 @@
/* $Id$*/
-echo '</div>'; // BodyWrapDiv ===HJ===
-echo '</div>'; // BodyDiv ===HJ===
+echo '</div>'; // BodyWrapDiv
+echo '</div>'; // BodyDiv
-echo '<div id="FooterDiv">'; //===HJ===
-echo '<div id="FooterWrapDiv">'; //===HJ===
+echo '<div id="FooterDiv">';
+echo '<div id="FooterWrapDiv">';
-echo '<div id="FooterLogoDiv">'; //===HJ===
+echo '<div id="FooterLogoDiv">';
echo '<img src="'. $rootpath . '/' . $_SESSION['LogoFile'] . '" width="120" alt="webERP" title="webERP ' . _('Copyright') . ' © weberp.org - ' . date('Y') . '" /></td>';
echo '</div>';
-echo '<div id="FooterVersionDiv">'; //===HJ===
- echo 'webERP ' ._('version') .' ' . $_SESSION['VersionNumber'];
+echo '<div id="FooterVersionDiv">';
+ echo 'webERP ' ._('version') .' ' . $_SESSION['VersionNumber'] . ' ' . _('Copyright') . ' © 2004 - ' . Date('Y'). ' <a href="http://www.weberp.org/weberp/doc/Manual/ManualContributors.html">weberp.org</a>';
echo '</div>';
-echo '<div id="FooterTimeDiv">'; //===HJ===
+echo '<div id="FooterTimeDiv">';
echo DisplayDateTime();
echo '</div>';
-// if(http_file_exists('http://sflogo.sourceforge.net/sflogo.php')) {
-// echo '<tr><td class="footer"><a href="https://sourceforge.net/projects/web-erp"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=391629&type=12" width="120" height="30" border="0" alt="Get webERP web-based ERP Accounting at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a></td></tr>';
-// }
+echo '</div>'; // FooterWrapDiv
+echo '</div>'; // FooterDiv
-echo '</div>'; // FooterWrapDiv ===HJ===
-echo '</div>'; // FooterDiv ===HJ===
-
echo '</body>';
echo '</html>';
-?>
+?>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|