From: Tim S. <ti...@we...> - 2010-12-26 12:19:05
|
Hi Phil, On 26 December 2010 08:33, <dai...@us...> wrote: > +ALTER TABLE `debtortrans` DROP FOREIGN KEY `debtortrans_ibfk_1` > Just for my understanding, why are we dropping this foreign key? Tim -- WebERP Africa Ltd +447710427049 +256752963327 +255784602561 www.weberpafrica.com |
From: Phil D. <ph...@lo...> - 2010-12-26 20:09:24
|
I got into an issue with changing a branch code using Z_ChangeBranchCode - as this foreign key from memory linked debtorno from debtortrans with debtorno in custbranch - so it was impossible to delete a custbranch that had been replaced using this script. Maybe there is a better way? Phil Tim Schofield wrote: > Hi Phil, > > On 26 December 2010 08:33, <dai...@us...> wrote: > > >> +ALTER TABLE `debtortrans` DROP FOREIGN KEY `debtortrans_ibfk_1` >> >> > > Just for my understanding, why are we dropping this foreign key? > > Tim > > |
From: Tim S. <ti...@we...> - 2010-12-27 01:01:19
|
I would have thought that getting rid of an important db constraint so that an obscure and seldom run admin script works was a case of a very small tail wagging a very big dog. Wouldn't it be better to simply turn foreign key checks off and then back on again in Z_ChangeBranchCode? Thanks Tim On 26 December 2010 21:12, Phil Daintree <ph...@lo...> wrote: > > I got into an issue with changing a branch code using Z_ChangeBranchCode > - as this foreign key from memory linked debtorno from debtortrans with > debtorno in custbranch - so it was impossible to delete a custbranch > that had been replaced using this script. > Maybe there is a better way? > > Phil > > Tim Schofield wrote: >> Hi Phil, >> >> On 26 December 2010 08:33, <dai...@us...> wrote: >> >> >>> +ALTER TABLE `debtortrans` DROP FOREIGN KEY `debtortrans_ibfk_1` >>> >>> >> >> Just for my understanding, why are we dropping this foreign key? >> >> Tim >> >> > > ------------------------------------------------------------------------------ > Learn how Oracle Real Application Clusters (RAC) One Node allows customers > to consolidate database storage, standardize their database environment, and, > should the need arise, upgrade to a full multi-node Oracle RAC database > without downtime or disruption > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > Web-erp-developers mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/web-erp-developers > -- WebERP Africa Ltd +447710427049 +256752963327 +255784602561 www.weberpafrica.com |
From: Phil D. <ph...@lo...> - 2010-12-27 04:44:11
|
Good idea - will do. Phil On 27/12/10 14:01, Tim Schofield wrote: > I would have thought that getting rid of an important db constraint so > that an obscure and seldom run admin script works was a case of a > very small tail wagging a very big dog. Wouldn't it be better to > simply turn foreign key checks off and then back on again in > Z_ChangeBranchCode? > > Thanks > Tim > > > On 26 December 2010 21:12, Phil Daintree<ph...@lo...> wrote: >> I got into an issue with changing a branch code using Z_ChangeBranchCode >> - as this foreign key from memory linked debtorno from debtortrans with >> debtorno in custbranch - so it was impossible to delete a custbranch >> that had been replaced using this script. >> Maybe there is a better way? >> >> Phil >> >> Tim Schofield wrote: >>> Hi Phil, >>> >>> On 26 December 2010 08:33,<dai...@us...> wrote: >>> >>> >>>> +ALTER TABLE `debtortrans` DROP FOREIGN KEY `debtortrans_ibfk_1` >>>> >>>> >>> Just for my understanding, why are we dropping this foreign key? >>> >>> Tim >>> >>> >> ------------------------------------------------------------------------------ >> Learn how Oracle Real Application Clusters (RAC) One Node allows customers >> to consolidate database storage, standardize their database environment, and, >> should the need arise, upgrade to a full multi-node Oracle RAC database >> without downtime or disruption >> http://p.sf.net/sfu/oracle-sfdevnl >> _______________________________________________ >> Web-erp-developers mailing list >> Web...@li... >> https://lists.sourceforge.net/lists/listinfo/web-erp-developers >> > > -- Phil |
From: Tim S. <ti...@we...> - 2012-02-29 09:53:15
|
Hi Phil, Did you really mean this change to the db upgrade script? I renamed the Z_CopyBOM.php script to CopyBOM.php as per my messages to this list. The db upgrade then renamed the record in the scripts table to use the correct new name. In this change what you have done is to remove this update and replace it with a delete to the old name, meaning that the new name wont get put in. Thanks Tim On 25 February 2012 01:49, <dai...@us...> wrote: > Revision: 4968 > http://web-erp.svn.sourceforge.net/web-erp/?rev=4968&view=rev > Author: daintree > Date: 2012-02-25 01:49:00 +0000 (Sat, 25 Feb 2012) > Log Message: > ----------- > added module to www-users > > Modified Paths: > -------------- > trunk/includes/ConnectDB.inc > trunk/sql/mysql/upgrade4.07-4.08.sql > > Modified: trunk/includes/ConnectDB.inc > =================================================================== > --- trunk/includes/ConnectDB.inc 2012-02-24 10:35:15 UTC (rev 4967) > +++ trunk/includes/ConnectDB.inc 2012-02-25 01:49:00 UTC (rev 4968) > @@ -4,7 +4,7 @@ > * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run > * if VersionNumber is < $Version then the DB update script is run */ > > -$Version='4.08.1'; //must update manually every time there is a DB change > +$Version='4.08'; //must update manually every time there is a DB change > > require_once ($PathPrefix .'includes/MiscFunctions.php'); > > > Modified: trunk/sql/mysql/upgrade4.07-4.08.sql > =================================================================== > --- trunk/sql/mysql/upgrade4.07-4.08.sql 2012-02-24 10:35:15 UTC (rev 4967) > +++ trunk/sql/mysql/upgrade4.07-4.08.sql 2012-02-25 01:49:00 UTC (rev 4968) > @@ -4,6 +4,7 @@ > INSERT INTO `scripts` (`script` ,`pagesecurity` ,`description`) VALUES ('reportwriter/admin/ReportCreator.php', '15', 'Report Writer'); > INSERT INTO `scripts` (`script` ,`pagesecurity` ,`description`) VALUES ('RecurringSalesOrdersProcess.php', '1', 'Process Recurring Sales Orders'); > > -UPDATE `scripts` SET `script`='CopyBOM.php' WHERE `script`='Z_CopyBOM.php'; > +DELETE `scripts` WHERE `script`='Z_CopyBOM.php'; > > -UPDATE config SET confvalue='4.08.1' WHERE confname='VersionNumber'; > \ No newline at end of file > +UPDATE `www_users` SET `modulesallowed` = CONCAT(`modulesallowed`,'0,'); > +UPDATE config SET confvalue='4.08' WHERE confname='VersionNumber'; > \ No newline at end of file > > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. > > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Web-erp-svn mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/web-erp-svn -- WebERP Africa Ltd +447710427049 +254706554559 www.weberpafrica.com |
From: Phil D. <ph...@lo...> - 2012-02-29 22:06:55
|
You're right Tim ... my bad. Need to fix this. Phil Quoting Tim Schofield <ti...@we...>: > Hi Phil, > > Did you really mean this change to the db upgrade script? I renamed > the Z_CopyBOM.php script to CopyBOM.php as per my messages to this > list. The db upgrade then renamed the record in the scripts table to > use the correct new name. > > In this change what you have done is to remove this update and replace > it with a delete to the old name, meaning that the new name wont get > put in. > > Thanks > Tim > > On 25 February 2012 01:49, <dai...@us...> wrote: >> Revision: 4968 >> http://web-erp.svn.sourceforge.net/web-erp/?rev=4968&view=rev >> Author: daintree >> Date: 2012-02-25 01:49:00 +0000 (Sat, 25 Feb 2012) >> Log Message: >> ----------- >> added module to www-users >> >> Modified Paths: >> -------------- >> trunk/includes/ConnectDB.inc >> trunk/sql/mysql/upgrade4.07-4.08.sql >> >> Modified: trunk/includes/ConnectDB.inc >> =================================================================== >> --- trunk/includes/ConnectDB.inc 2012-02-24 10:35:15 UTC (rev 4967) >> +++ trunk/includes/ConnectDB.inc 2012-02-25 01:49:00 UTC (rev 4968) >> @@ -4,7 +4,7 @@ >> * this value is saved in the $_SESSION['Versionumber'] when >> includes/GetConfig.php is run >> * if VersionNumber is < $Version then the DB update script is run */ >> >> -$Version='4.08.1'; //must update manually every time there is a DB change >> +$Version='4.08'; //must update manually every time there is a DB change >> >> require_once ($PathPrefix .'includes/MiscFunctions.php'); >> >> >> Modified: trunk/sql/mysql/upgrade4.07-4.08.sql >> =================================================================== >> --- trunk/sql/mysql/upgrade4.07-4.08.sql 2012-02-24 10:35:15 >> UTC (rev 4967) >> +++ trunk/sql/mysql/upgrade4.07-4.08.sql 2012-02-25 01:49:00 >> UTC (rev 4968) >> @@ -4,6 +4,7 @@ >> INSERT INTO `scripts` (`script` ,`pagesecurity` ,`description`) >> VALUES ('reportwriter/admin/ReportCreator.php', '15', 'Report >> Writer'); >> INSERT INTO `scripts` (`script` ,`pagesecurity` ,`description`) >> VALUES ('RecurringSalesOrdersProcess.php', '1', 'Process Recurring >> Sales Orders'); >> >> -UPDATE `scripts` SET `script`='CopyBOM.php' WHERE `script`='Z_CopyBOM.php'; >> +DELETE `scripts` WHERE `script`='Z_CopyBOM.php'; >> >> -UPDATE config SET confvalue='4.08.1' WHERE confname='VersionNumber'; >> \ No newline at end of file >> +UPDATE `www_users` SET `modulesallowed` = CONCAT(`modulesallowed`,'0,'); >> +UPDATE config SET confvalue='4.08' WHERE confname='VersionNumber'; >> \ No newline at end of file >> >> This was sent by the SourceForge.net collaborative development >> platform, the world's largest Open Source development site. >> >> >> ------------------------------------------------------------------------------ >> Virtualization & Cloud Management Using Capacity Planning >> Cloud computing makes use of virtualization - but cloud computing >> also focuses on allowing computing to be delivered as a service. >> http://www.accelacomm.com/jaw/sfnl/114/51521223/ >> _______________________________________________ >> Web-erp-svn mailing list >> Web...@li... >> https://lists.sourceforge.net/lists/listinfo/web-erp-svn > > > > -- > WebERP Africa Ltd > +447710427049 > +254706554559 > www.weberpafrica.com > |
From: Ricard A. <pak...@gm...> - 2012-05-28 02:35:01
|
> > Hi Tim: > > Those lines were not needed, just forgot to clean them up before uploading > to SVN. > > Thanks for double checking! > > Regards, > Ricard > > > 2012/5/26 Ricard Andreu <pak...@gm...> > >> Thanks Tim: I will double check on Monday. >> >> Regards, >> Ricard >> >> >> >> 2012/5/26 Ricard Andreu <pak...@gm...> >> >>> >>> Regards, >>> Ricard >>> >>> >>> >>> ---------- Forwarded message ---------- >>> From: Tim Schofield <ti...@we...> >>> Date: 2012/5/26 >>> Subject: Re: [Web-erp-svn] SF.net SVN: web-erp:[5397] trunk >>> To: te...@us... >>> >>> >>> Hi Ricard, >>> >>> On line 170 of this script should it read $myrow['stockid'] rather >>> than $myrow['stkcode']? >>> >>> Maybe I have misunderstood it but it is throwing a warning on this line, >>> >>> Thanks >>> Tim >>> >>> >>> On 24 May 2012 07:36, <te...@us...> wrote: >>> > Revision: 5397 >>> > http://web-erp.svn.sourceforge.net/web-erp/?rev=5397&view=rev >>> > Author: tehonu >>> > Date: 2012-05-24 06:36:42 +0000 (Thu, 24 May 2012) >>> > Log Message: >>> > ----------- >>> > NoSalesItems.php New script to show the items available for sale but >>> no sale in X days >>> > >>> > Modified Paths: >>> > -------------- >>> > trunk/includes/MainMenuLinksArray.php >>> > trunk/sql/mysql/upgrade4.07-4.08.sql >>> > >>> > Added Paths: >>> > ----------- >>> > trunk/NoSalesItems.php >>> > >>> > Added: trunk/NoSalesItems.php >>> > =================================================================== >>> > --- trunk/NoSalesItems.php (rev 0) >>> > +++ trunk/NoSalesItems.php 2012-05-24 06:36:42 UTC (rev 5397) >>> > @@ -0,0 +1,202 @@ >>> > +<?php >>> > + >>> > +/* $Id: NoSalesItems.php 2012-05-12 Kapal Laut $*/ >>> > + >>> > +/* Session started in session.inc for password checking and >>> authorisation level check >>> > +config.php is in turn included in session.inc*/ >>> > +include ('includes/session.inc'); >>> > +$title = _('No Sales Items Searching'); >>> > +include ('includes/header.inc'); >>> > +if (!(isset($_POST['Search']))) { >>> > +echo '<div class="centre"><p class="page_title_text"><img src="' . >>> $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('No >>> Sales Items') . '" alt="" />' . ' ' . _('No Sales Items') . '</p></div>'; >>> > + echo '<div class="page_help_text">' >>> > + . _('List of items with stock available during the last X days >>> at the selected locations but did not sell any quantity during these X >>> days.'). '<br />'. _( 'This list gets the no selling items, items at the >>> location just wasting space, or need a price reduction, etc.') . '<br />'. >>> _('Stock available during the last X days means there was a stock movement >>> that produced that item into that location before that day, and no other >>> positive stock movement has been created afterwards. No sell any quantity >>> means, there is no sales order for that item from that location.') . >>> '</div>'; >>> > +//check if input already >>> > + >>> > + echo '<br />'; >>> > + echo '<form action="' . >>> htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . >>> '?name="SelectCustomer" method="post">'; >>> > + echo '<input type="hidden" name="FormID" value="' . >>> $_SESSION['FormID'] . '" />'; >>> > + echo '<table class="selection">'; >>> > + >>> > + //to view store location >>> > + echo '<tr> >>> > + <td>'._('Select Location') . '</td> >>> > + <td>:</td> >>> > + <td><select name="Location[]" >>> multiple="multiple"> >>> > + <option value="All" >>> selected="selected">' . _('All') . '</option>';; >>> > + $sql = "SELECT loccode,locationname >>> > + FROM locations ORDER BY locationname"; >>> > + $locationresult = DB_query($sql, $db); >>> > + $i=0; >>> > + while ($myrow = DB_fetch_array($locationresult)) { >>> > + if(isset($_POST['Location'][$i]) AND $myrow['loccode'] >>> == $_POST['Location'][$i]){ >>> > + echo '<option selected="selected" value="' . >>> $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; >>> > + $i++; >>> > + } else { >>> > + echo '<option value="' . $myrow['loccode'] . >>> '">' . $myrow['locationname'] . '</option>'; >>> > + } >>> > + } >>> > + echo '</select></td> >>> > + </tr>'; >>> > + >>> > + //to view list of customer >>> > + echo '<tr> >>> > + <td width="150">' . _('Select Customer Type') >>> . '</td> >>> > + <td>:</td> >>> > + <td><select name="Customers">'; >>> > + >>> > + $sql = "SELECT typename, >>> > + typeid >>> > + FROM debtortype"; >>> > + $result = DB_query($sql, $db); >>> > + echo '<option value="All">' . _('All') . '</option>'; >>> > + while ($myrow = DB_fetch_array($result)) { >>> > + echo '<option value="' . $myrow['typeid'] . '">' . >>> $myrow['typename'] . '</option>'; >>> > + } >>> > + echo '</select></td> >>> > + </tr>'; >>> > + >>> > + // stock category selection >>> > + $SQL="SELECT categoryid,categorydescription >>> > + FROM stockcategory >>> > + ORDER BY categorydescription"; >>> > + $result1 = DB_query($SQL,$db); >>> > + echo '<tr> >>> > + <td width="150">' . _('In Stock Category') . ' >>> </td> >>> > + <td>:</td> >>> > + <td><select name="StockCat">'; >>> > + if (!isset($_POST['StockCat'])){ >>> > + $_POST['StockCat']='All'; >>> > + } >>> > + if ($_POST['StockCat']=='All'){ >>> > + echo '<option selected="selected" value="All">' . >>> _('All') . '</option>'; >>> > + } else { >>> > + echo '<option value="All">' . _('All') . '</option>'; >>> > + } >>> > + while ($myrow1 = DB_fetch_array($result1)) { >>> > + if ($myrow1['categoryid']==$_POST['StockCat']){ >>> > + echo '<option selected="selected" value="' . >>> $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; >>> > + } else { >>> > + echo '<option value="' . $myrow1['categoryid'] >>> . '">' . $myrow1['categorydescription'] . '</option>'; >>> > + } >>> > + } >>> > + >>> > + //View number of days >>> > + echo '<tr> >>> > + <td>' . _('Number Of Days') . ' </td> >>> > + <td>:</td> >>> > + <td><input class="number" tabindex="3" >>> type="text" name="NumberOfDays" size="8" maxlength="8" value="30" /></td> >>> > + </tr> >>> > + </table> >>> > + <br /> >>> > + <div class="centre"> >>> > + <input tabindex="5" type="submit" name="Search" >>> value="' . _('Search') . '" /> >>> > + </div> >>> > + </form>'; >>> > +} else { >>> > + >>> > + // everything below here to view NumberOfNoSalesItems on >>> selected location >>> > + $FromDate = >>> FormatDateForSQL(DateAdd(Date($_SESSION['DefaultDateFormat']),'d', >>> -filter_number_format($_POST['NumberOfDays']))); >>> > + $SQL = "SELECT stockmaster.stockid, >>> > + stockmaster.description, >>> > + stockmaster.units, >>> > + locstock.quantity, >>> > + locations.locationname >>> > + FROM stockmaster,locstock,locations >>> > + WHERE stockmaster.stockid = locstock.stockid >>> > + AND (locstock.loccode = >>> locations.loccode)"; >>> > + if ($_POST['Location'][0] == 'All') { >>> > + $WhereLocation = ' '; >>> > + } elseif (sizeof($_POST['Location']) == 1) { >>> > + $WhereLocation = " AND locstock.loccode ='" . >>> $_POST['Location'][0] . "' "; >>> > + } else { >>> > + $WhereLocation = " AND locstock.loccode IN("; >>> > + $commactr = 0; >>> > + foreach ($_POST['Location'] as $key => $value) { >>> > + $WhereLocation .= "'" . $value . "'"; >>> > + $commactr++; >>> > + if ($commactr < sizeof($_POST['Location'])) { >>> > + $WhereLocation .= ","; >>> > + } // End of if >>> > + } // End of foreach >>> > + $WhereLocation .= ')'; >>> > + } >>> > + $SQL = $SQL . $WhereLocation. " AND (locstock.quantity > 0) >>> > + AND NOT EXISTS ( >>> > + SELECT * >>> > + FROM salesorderdetails, salesorders >>> > + WHERE stockmaster.stockid = >>> salesorderdetails.stkcode >>> > + AND (salesorders.fromstkloc = >>> locstock.loccode) >>> > + AND (salesorderdetails.orderno >>> = salesorders.orderno) >>> > + AND >>> salesorderdetails.actualdispatchdate > '" . $FromDate . "') >>> > + AND NOT EXISTS ( >>> > + SELECT * >>> > + FROM stockmoves >>> > + WHERE stockmoves.loccode = locstock.loccode >>> > + AND stockmoves.stockid = >>> stockmaster.stockid >>> > + AND stockmoves.trandate >= '" >>> . $FromDate . "' >>> > + ) >>> > + AND EXISTS ( >>> > + SELECT * >>> > + FROM stockmoves >>> > + WHERE stockmoves.loccode = locstock.loccode >>> > + AND stockmoves.stockid = >>> stockmaster.stockid >>> > + AND stockmoves.trandate < '" . >>> $FromDate . "' >>> > + AND stockmoves.qty >0) "; >>> > + $SQL = $SQL. "ORDER BY stockmaster.stockid"; >>> > + $result = DB_query($SQL, $db); >>> > + echo '<p class="page_title_text" align="center"><strong>' . >>> _('No Sales Items') . '</strong></p>'; >>> > + echo '<form action="PDFNoSalesItems2.php" method="GET"> >>> > + <table class="selection">'; >>> > + echo '<input type="hidden" name="FormID" value="' . >>> $_SESSION['FormID'] . '" />'; >>> > + $TableHeader = '<tr> >>> > + <th>' . _('No') . >>> '</th> >>> > + <th>' . _('Location') >>> . '</th> >>> > + <th>' . _('Code') . >>> '</th> >>> > + <th>' . >>> _('Description') . '</th> >>> > + <th>' . _('On Hand') . >>> '</th> >>> > + <th>' . _('Units') . >>> '</th> >>> > + </tr>'; >>> > + echo $TableHeader; >>> > + echo '<input type="hidden" value="' . $_POST['Location'] . '" >>> name="Location" /> >>> > + <input type="hidden" value="' . >>> filter_number_format($_POST['NumberOfDays']) . '" name="NumberOfDays" /> >>> > + <input type="hidden" value="' . >>> $_POST['Customers'] . '" name="Customers" />'; >>> > + $k = 0; //row colour counter >>> > + $i = 1; >>> > + while ($myrow = DB_fetch_array($result)) { >>> > + //find the quantity onhand item >>> > + $sqloh = "SELECT sum(quantity) AS qty >>> > + FROM locstock >>> > + WHERE stockid='" . >>> $myrow['stkcode'] . "'"; >>> > + $oh = DB_query($sqloh, $db); >>> > + $ohRow = DB_fetch_row($oh); >>> > + if ($k == 1) { >>> > + echo '<tr class="EvenTableRows">'; >>> > + $k = 0; >>> > + } else { >>> > + echo '<tr class="OddTableRows">'; >>> > + $k = 1; >>> > + } >>> > + printf('<td class="number">%s</td> >>> > + <td>%s</td> >>> > + <td>%s</td> >>> > + <td>%s</td> >>> > + <td class="number">%s</td> >>> > + <td class="number">%s</td> >>> > + </tr>', >>> > + $i, >>> > + $myrow['locationname'], >>> > + $myrow['0'], >>> > + $myrow['description'], >>> > + $myrow['quantity'], //onhand >>> > + $myrow['units'] //unit >>> > + ); >>> > + $i++; >>> > + } >>> > + echo '</table>'; >>> > + echo '<br /> >>> > + >>> > + </form>'; >>> > +} >>> > +include ('includes/footer.inc'); >>> > +?> >>> > \ No newline at end of file >>> > >>> > Modified: trunk/includes/MainMenuLinksArray.php >>> > =================================================================== >>> > --- trunk/includes/MainMenuLinksArray.php 2012-05-23 09:30:51 >>> UTC (rev 5396) >>> > +++ trunk/includes/MainMenuLinksArray.php 2012-05-24 06:36:42 >>> UTC (rev 5397) >>> > @@ -54,6 +54,7 @@ >>> > >>> _('Delivery In Full On Time (DIFOT) >>> Report'), >>> > >>> _('Sales Order Detail Or Summary >>> Inquiries'), >>> > >>> _('Top Sales Items Report'), >>> > + >>> _('Worst Sales Items Report'), >>> > >>> _('Sales With Low Gross Profit Report') >>> > >>> ); >>> > >>> > @@ -69,6 +70,7 @@ >>> > >>> '/PDFDIFOT.php', >>> > >>> '/SalesInquiry.php', >>> > >>> '/TopItems.php', >>> > + >>> '/NoSalesItems.php', >>> > >>> '/PDFLowGP.php' >>> > >>> ); >>> > >>> > >>> > Modified: trunk/sql/mysql/upgrade4.07-4.08.sql >>> > =================================================================== >>> > --- trunk/sql/mysql/upgrade4.07-4.08.sql 2012-05-23 09:30:51 >>> UTC (rev 5396) >>> > +++ trunk/sql/mysql/upgrade4.07-4.08.sql 2012-05-24 06:36:42 >>> UTC (rev 5397) >>> > @@ -119,5 +119,8 @@ >>> > ALTER TABLE pctabs MODIFY column glaccountpcash varchar(20) NOT NULL >>> DEFAULT '0'; >>> > ALTER TABLE taxauthorities ADD CONSTRAINT taxauthorities_ibfk_1 >>> FOREIGN KEY (taxglcode) REFERENCES chartmaster(accountcode); >>> > ALTER TABLE taxauthorities ADD CONSTRAINT taxauthorities_ibfk_2 >>> FOREIGN KEY (purchtaxglaccount) REFERENCES chartmaster(accountcode); >>> > + >>> > +INSERT INTO scripts (script, pagesecurity, description) VALUES >>> ('NoSalesItems.php', '2', 'Shows the No Selling (worst) items'); >>> > + >>> > UPDATE config SET confvalue='4.08' WHERE confname='VersionNumber'; >>> > >>> > >>> > This was sent by the SourceForge.net collaborative development >>> platform, the world's largest Open Source development site. >>> > >>> > >>> > >>> ------------------------------------------------------------------------------ >>> > Live Security Virtual Conference >>> > Exclusive live event will cover all the ways today's security and >>> > threat landscape has changed and how IT managers can respond. >>> Discussions >>> > will include endpoint security, mobile security and the latest in >>> malware >>> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> > _______________________________________________ >>> > Web-erp-svn mailing list >>> > Web...@li... >>> > https://lists.sourceforge.net/lists/listinfo/web-erp-svn >>> >>> >>> >>> -- >>> WebERP Africa Ltd >>> +447710427049 >>> +254706554559 >>> www.weberpafrica.com >>> @TimSchofield2 >>> >>> >> > |
From: Pak R. <pak...@gm...> - 2016-10-11 00:55:31
|
Hi Exson: Sorry for the delay, but just today I checked this new script and I think it has a major issue (that can lead to accounting errors): it is not multicurrency-coded. It allows to transfer amounts from any currency tab to ant other, without the proper exchange rates. We could move 1.000.000 IDR into 1.000.000 USD, which would be nice but it's not correct. Probably restricting the "Tab To" drop down list to the tabs with the same currency as the "from" would do the trick, as we probably don't want employees to run their own exchange-currency side-business. Also, could you please let us know which is the situation where this script is used? If company assigns X money to user A and Y money to user B, is it ok for user A to send money to user B? Why not company assigning less to A and more to B? Or is there any situation I'm missing? Regards, Ricard 2016-08-31 18:58 GMT+08:00 Tim Schofield <tim...@gm...>: > Hi Exson, what is the use case for this script? Is it wise to have > funds allocated for one purpose to then be transferred for another > completely different use? > > Tim > > On 31 August 2016 at 07:32, <ex...@us...> wrote: > > Revision: 7605 > > http://sourceforge.net/p/web-erp/reponame/7605 > > Author: exsonqu > > Date: 2016-08-31 06:32:57 +0000 (Wed, 31 Aug 2016) > > Log Message: > > ----------- > > 31/08/16 Exson: Addd new feature assign cash from one tab to another. > > > > Modified Paths: > > -------------- > > trunk/includes/MainMenuLinksArray.php > > trunk/sql/mysql/upgrade4.13-4.13.1.sql > > > > Added Paths: > > ----------- > > trunk/PcAssignCashTabToTab.php > > > > Added: trunk/PcAssignCashTabToTab.php > > =================================================================== > > --- trunk/PcAssignCashTabToTab.php (rev 0) > > +++ trunk/PcAssignCashTabToTab.php 2016-08-31 06:32:57 UTC (rev > 7605) > > @@ -0,0 +1,393 @@ > > +<?php > > + > > +include('includes/session.inc'); > > +$Title = _('Assignment of Cash From Tab To Tab'); > > +/* webERP manual links before header.inc */ > > +$ViewTopic= 'PettyCash'; > > +$BookMark = 'CashAssignment'; > > +include('includes/header.inc'); > > + > > +if (isset($_POST['SelectedTabs'])){ > > + $SelectedTabs = mb_strtoupper($_POST['SelectedTabs']); > > +} elseif (isset($_GET['SelectedTabs'])){ > > + $SelectedTabs = mb_strtoupper($_GET['SelectedTabs']); > > +} > > + > > +if (isset($_POST['Days'])){ > > + $Days = $_POST['Days']; > > +} elseif (isset($_GET['Days'])){ > > + $Days = $_GET['Days']; > > +} > > + > > +if (isset($_POST['Cancel'])) { > > + unset($SelectedTabs); > > + unset($Days); > > + unset($_POST['Amount']); > > + unset($_POST['Notes']); > > + unset($_POST['Receipt']); > > +} > > + > > +if (isset($_POST['Process'])) { > > + if ($SelectedTabs=='') { > > + prnMsg(_('You Must First Select a Petty Cash Tab To > Assign Cash'),'error'); > > + unset($SelectedTabs); > > + } > > + if ($SelectedTabs == mb_strtoupper($_POST['SelectedTabsTo'])) { > > + prnMsg(_('The Tab selected From should not be the same > as the selected To'),'error'); > > + unset($SelectedTabs); > > + unset($_POST['SelectedTabsTo']); > > + unset($_POST['Process']); > > + } > > +} > > + > > +if (isset($_POST['Go'])) { > > + $InputError = 0; > > + if ($Days<=0) { > > + $InputError = 1; > > + prnMsg(_('The number of days must be a positive > number'),'error'); > > + $Days=30; > > + } > > +} > > + > > +if (isset($_POST['submit'])) { > > + //initialise no input errors assumed initially before we test > > + $InputError = 0; > > + > > + echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/money_add.png" > title="' . > > + _('Search') . '" alt="" />' . ' ' . $Title. '</p>'; > > + > > + /* actions to take once the user has clicked the submit button > > + ie the page has called itself with some user input */ > > + > > + $i=1; > > + > > + if ($_POST['Amount']==0) { > > + $InputError = 1; > > + prnMsg('<br />' . _('The Amount must be input'),'error'); > > + } > > + > > + $sqlLimit = "SELECT tablimit,tabcode > > + FROM pctabs > > + WHERE tabcode IN ('" . $SelectedTabs . > "','" . $_POST['SelectedTabsTo'] . "')"; > > + > > + $ResultLimit = DB_query($sqlLimit,$db); > > + while ($LimitRow=DB_fetch_array($ResultLimit)){ > > + if ($LimitRow['tabcode'] == $SelectedTabs) { > > + if (($_POST['CurrentAmount']+$_ > POST['Amount'])>$LimitRow['tablimit']){ > > + $InputError = 1; > > + prnMsg(_('The balance after this > assignment would be greater than the specified limit for this PC tab') . ' > ' . $LimitRow[1],'error'); > > + } > > + } elseif ($_POST['SelectedTabsToAmt'] - > $_POST['Amount']>$LimitRow['tablimit']) { > > + $InputError = 1; > > + prnMsg(_('The balance after this > assignment would be greater than the specified limit for this PC tab') . ' > ' . $LimitRow[1],'error'); > > + } > > + } > > + > > + if ($InputError !=1 ) { > > + // Add these 2 new record on submit > > + $sql = "INSERT INTO pcashdetails > > + (counterindex, > > + tabcode, > > + date, > > + codeexpense, > > + amount, > > + authorized, > > + posted, > > + notes, > > + receipt) > > + VALUES (NULL, > > + '" . $_POST['SelectedTabs'] . "', > > + '".FormatDateForSQL($_POST[' > Date'])."', > > + 'ASSIGNCASH', > > + '" . > filter_number_format($_POST['Amount']) . "', > > + '0000-00-00', > > + '0', > > + '" . $_POST['Notes'] . "', > > + '" . $_POST['Receipt'] . "' > > + ), > > + (NULL, > > + '" . $_POST['SelectedTabsTo'] . > "', > > + '" . > FormatDateForSQL($_POST['Date']) . "', > > + 'ASSIGNCASH', > > + '" . > filter_number_format(-$_POST['Amount']) . "', > > + '0000-00-00', > > + '0', > > + '" . $_POST['Notes'] . "', > > + '" . $_POST['Receipt'] . "')"; > > + $msg = _('Assignment of cash from PC Tab ') . ' ' . > $_POST['SelectedTabs'] . ' ' . _('to') . $_POST['SelectedTabsTo'] . ' ' . > _('has been created'); > > + } > > + > > + if ( $InputError !=1) { > > + //run the SQL from either of the above possibilites > > + $result = DB_query($sql,$db); > > + prnMsg($msg,'success'); > > + unset($_POST['SelectedExpense']); > > + unset($_POST['Amount']); > > + unset($_POST['Notes']); > > + unset($_POST['Receipt']); > > + unset($_POST['SelectedTabs']); > > + unset($_POST['Date']); > > + } > > + > > +} > > + > > +if (!isset($SelectedTabs)){ > > + > > + echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/money_add.png" > title="' . > > + _('Search') . '" alt="" />' . ' ' . $Title. '</p>'; > > + > > + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') > . '">'; > > + echo '<div>'; > > + echo '<input type="hidden" name="FormID" value="' . > $_SESSION['FormID'] . '" />'; > > + > > + $SQL = "SELECT tabcode > > + FROM pctabs > > + WHERE assigner='" . $_SESSION['UserID'] . "' > > + ORDER BY tabcode"; > > + > > + $result = DB_query($SQL,$db); > > + > > + echo '<br /><table class="selection">'; //Main table > > + > > + echo '<tr><td>' . _('Petty Cash Tab To Assign Cash From') . ':</td> > > + <td><select name="SelectedTabs">'; > > + while ($myrow = DB_fetch_array($result)) { > > + if (isset($_POST['SelectTabs']) and > $myrow['tabcode']==$_POST['SelectTabs']) { > > + echo '<option selected="selected" value="'; > > + } else { > > + echo '<option value="'; > > + } > > + echo $myrow['tabcode'] . '">' . $myrow['tabcode'] . > '</option>'; > > + } > > + > > + echo '</select></td></tr>'; > > + echo '<tr><td>' . _('Petty Cash Tab To Assign Cash To') . ':</td> > > + <td><select name="SelectedTabsTo">'; > > + DB_data_seek($result,0); > > + while ($myrow = DB_fetch_array($result)) { > > + if (isset($_POST['SelectTabsTo']) AND $myrow['tabcode'] > == $_POST['SelectTabs']) { > > + echo '<option selected="selected" value="'; > > + } else { > > + echo '<option value="'; > > + } > > + echo $myrow['tabcode'] . '">' . $myrow['tabcode'] . > '</option>'; > > + } > > + echo '</select></td></tr>'; > > + echo '</table>'; // close main table > > + DB_free_result($result); > > + > > + echo '<br /> > > + <div class="centre"> > > + <input type="submit" name="Process" value="' . > _('Accept') . '" /> > > + <input type="submit" name="Cancel" value="' . > _('Cancel') . '" /> > > + </div>'; > > + echo '</div> > > + </form>'; > > +} > > + > > +//end of ifs and buts! > > +if (isset($_POST['Process']) OR isset($SelectedTabs)) { > > + > > + if (!isset($_POST['submit'])) { > > + echo '<p class="page_title_text"><img > src="'.$RootPath.'/css/'.$Theme.'/images/money_add.png" title="' . > > + _('Search') . '" alt="" />' . ' ' . $Title. > '</p>'; > > + } > > + echo '<br /><div class="centre"><a href="' . > htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">' . > _('Select another tab') . '</a></div>'; > > + > > + > > + > > + if (! isset($_GET['edit']) OR isset ($_POST['GO'])){ > > + > > + if (isset($_POST['Cancel'])) { > > + unset($_POST['Amount']); > > + unset($_POST['Date']); > > + unset($_POST['Notes']); > > + unset($_POST['Receipt']); > > + } > > + > > + if(!isset ($Days)){ > > + $Days=30; > > + } > > + > > + /* Retrieve decimal places to display */ > > + $SqlDecimalPlaces="SELECT decimalplaces > > + FROM currencies,pctabs > > + WHERE currencies.currabrev = > pctabs.currency > > + AND tabcode='" . > $SelectedTabs . "'"; > > + $result = DB_query($SqlDecimalPlaces,$db); > > + $myrow=DB_fetch_array($result); > > + $CurrDecimalPlaces = $myrow['decimalplaces']; > > + > > + $sql = "SELECT * FROM pcashdetails > > + WHERE tabcode='" . $SelectedTabs . "' > > + AND date >=DATE_SUB(CURDATE(), INTERVAL > " . $Days . " DAY) > > + ORDER BY date, counterindex ASC"; > > + $result = DB_query($sql,$db); > > + > > + echo '<form method="post" action="' . > htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '"> > > + <div> > > + <input type="hidden" name="FormID" > value="' . $_SESSION['FormID'] . '" /> > > + <table class="selection"> > > + <tr> > > + <th colspan="8">' . _('Detail Of > PC Tab Movements For Last') .': > > + <input type="hidden" > name="SelectedTabs" value="' . $SelectedTabs . '" /> > > + <input type="text" > class="number" name="Days" value="' . $Days . '" maxlength="3" size="4" /> > ' . _('Days') . ' > > + <input type="submit" > name="Go" value="' . _('Go') . '" /></th> > > + </tr> > > + <tr> > > + <th>' . _('Date') . '</th> > > + <th>' . _('Expense Code') . > '</th> > > + <th>' . _('Amount') . '</th> > > + <th>' . _('Authorised') . '</th> > > + <th>' . _('Notes') . '</th> > > + <th>' . _('Receipt') . '</th> > > + </tr>'; > > + > > + $k=0; //row colour counter > > + > > + while ($myrow = DB_fetch_array($result)) { > > + if ($k==1){ > > + echo '<tr class="EvenTableRows">'; > > + $k=0; > > + } else { > > + echo '<tr class="OddTableRows">'; > > + $k=1; > > + } > > + > > + $sqldes="SELECT description > > + FROM pcexpenses > > + WHERE codeexpense='". > $myrow['3'] . "'"; > > + > > + $ResultDes = DB_query($sqldes,$db); > > + $Description=DB_fetch_array($ResultDes); > > + > > + if (!isset($Description['0'])){ > > + $Description['0']='ASSIGNCASH'; > > + } > > + > > + if (($myrow['authorized'] == '0000-00-00') and > ($Description['0'] == 'ASSIGNCASH')){ > > + // only cash assignations NOT authorized can be > modified or deleted > > + echo '<td>' . ConvertSQLDate($myrow['date']) . > '</td> > > + <td>' . $Description['0'] . '</td> > > + <td class="number">' . > locale_number_format($myrow['amount'],$CurrDecimalPlaces) . '</td> > > + <td>' . ConvertSQLDate($myrow['authorized']) > . '</td> > > + <td>' . $myrow['notes'] . '</td> > > + <td>' . $myrow['receipt'] . '</td> > > + </tr>'; > > + }else{ > > + echo '<td>' . ConvertSQLDate($myrow['date']) . > '</td> > > + <td>' . $Description['0'] . '</td> > > + <td class="number">' . > locale_number_format($myrow['amount'],$CurrDecimalPlaces) . '</td> > > + <td>' . ConvertSQLDate($myrow['authorized']) > . '</td> > > + <td>' . $myrow['notes'] . '</td> > > + <td>' . $myrow['receipt'] . '</td> > > + </tr>'; > > + } > > + } > > + //END WHILE LIST LOOP > > + > > + $sqlamount="SELECT sum(amount) as amt, > > + tabcode > > + FROM pcashdetails > > + WHERE tabcode IN > ('".$SelectedTabs."','" . $_POST['SelectedTabsTo'] . "') > > + GROUP BY tabcode"; > > + > > + $ResultAmount = DB_query($sqlamount,$db); > > + if (DB_num_rows($ResultAmount)>0) { > > + while ($AmountRow=DB_fetch_array($ResultAmount)) > { > > + if (is_null($AmountRow['amt'])) { > > + $AmountRow['amt'] = 0; > > + } > > + if ($AmountRow['tabcode'] == > $SelectedTabs) { > > + $SelectedTab = > array($AmountRow['amt'],$SelectedTabs); > > + } else { > > + $SelectedTabsTo = > array($AmountRow['amt'],$_POST['SelectedTabsTo']); > > + } > > + } > > + } > > + if (!isset($SelectedTab)) { > > + $SelectedTab = array(0,$SelectedTabs); > > + $SelectedTabsTo = array(0,$_POST[' > SelectedTabsTo']); > > + } > > + > > + > > + > > + echo '<tr> > > + <td colspan="2" > style="text-align:right"><b>' . _('Current balance') . ':</b></td> > > + <td>' . locale_number_format($ > SelectedTab['0'],$CurrDecimalPlaces) . '</td></tr> > > + <input type="hidden" > name="CurrentAmount" value="' . $SelectedTab[0] . '" /> > > + <input type="hidden" name="SelectedTabs" > value="' . $SelectedTab[1] . '" /> > > + <input type="hidden" > name="SelectedTabsTo" value="' . $SelectedTabsTo[1] . '" /> > > + <input type="hidden" > name="SelectedTabsToAmt" value="' . $SelectedTabsTo[0] . '" />'; > > + > > + > > + echo '</table>'; > > + echo '</div> > > + </form>'; > > + } > > + > > + > > + > > + echo '<form method="post" action="' . > htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') .'"> > > + <div> > > + <input type="hidden" name="FormID" > value="' . $_SESSION['FormID'] . '" />'; > > + > > +/* Ricard: needs revision of this date initialization */ > > + if (!isset($_POST['Date'])) { > > + $_POST['Date']=Date($_SESSION[ > 'DefaultDateFormat']); > > + } > > + > > + echo '<br /> > > + <table class="selection">'; //Main table > > + echo '<tr> > > + <th colspan="2"><h3>' . _('New > Cash Assignment') . '</h3></th> > > + </tr>'; > > + echo '<tr> > > + <td>' . _('Cash Assignation Date') . > ':</td> > > + <td><input type="text" class="date" > alt="'.$_SESSION['DefaultDateFormat'].'" name="Date" required="required" > autofocus="autofocus" size="10" maxlength="10" value="' . $_POST['Date'] . > '" /></td> > > + </tr>'; > > + > > + > > + if (!isset($_POST['Amount'])) { > > + $_POST['Amount']=0; > > + } > > + > > + echo '<tr> > > + <td>' . _('Amount') . ':</td> > > + <td><input type="text" class="number" > name="Amount" size="12" maxlength="11" value="' . > locale_number_format($_POST['Amount'],$CurrDecimalPlaces) . '" /></td> > > + </tr>'; > > + > > + if (!isset($_POST['Notes'])) { > > + $_POST['Notes']=''; > > + } > > + > > + echo '<tr> > > + <td>' . _('Notes') . ':</td> > > + <td><input type="text" name="Notes" > size="50" maxlength="49" value="' . $_POST['Notes'] . '" /></td> > > + </tr>'; > > + > > + if (!isset($_POST['Receipt'])) { > > + $_POST['Receipt']=''; > > + } > > + > > + echo '<tr> > > + <td>' . _('Receipt') . ':</td> > > + <td><input type="text" name="Receipt" > size="50" maxlength="49" value="' . $_POST['Receipt'] . '" /></td> > > + </tr> > > + </table> > > + <input type="hidden" name="CurrentAmount" > value="' . $SelectedTab['0']. '" /> > > + <input type="hidden" name="SelectedTabs" > value="' . $SelectedTabs . '" /> > > + <input type="hidden" name="Days" value="' > .$Days. '" /> > > + <input type="hidden" name="SelectedTabsTo" > value="' . $SelectedTabsTo[1] . '" /> > > + <input type="hidden" name="SelectedTabsToAmt" > value="' . $SelectedTabsTo[0] . '" /> > > + <br /> > > + <div class="centre"> > > + <input type="submit" name="submit" > value="' . _('Accept') . '" /> > > + <input type="submit" name="Cancel" > value="' . _('Cancel') . '" /></div> > > + </div> > > + </form>'; > > + > > +} > > + > > +include('includes/footer.inc'); > > +?> > > > > Modified: trunk/includes/MainMenuLinksArray.php > > =================================================================== > > --- trunk/includes/MainMenuLinksArray.php 2016-08-25 21:05:53 UTC > (rev 7604) > > +++ trunk/includes/MainMenuLinksArray.php 2016-08-31 06:32:57 UTC > (rev 7605) > > @@ -446,10 +446,12 @@ > > > '/MaintenanceTasks.php'); > > > > $MenuItems['PC']['Transactions']['Caption'] = array(_('Assign Cash to > PC Tab'), > > + _('Cash Transfer > Between Tabs'), > > > _('Claim Expenses From PC Tab'), > > > _('Expenses Authorisation')); > > > > $MenuItems['PC']['Transactions']['URL'] = > array('/PcAssignCashToTab.php', > > + > '/PcAssignCashTabToTab.php', > > > '/PcClaimExpensesFromTab.php', > > > '/PcAuthorizeExpenses.php'); > > > > > > Modified: trunk/sql/mysql/upgrade4.13-4.13.1.sql > > =================================================================== > > --- trunk/sql/mysql/upgrade4.13-4.13.1.sql 2016-08-25 21:05:53 UTC > (rev 7604) > > +++ trunk/sql/mysql/upgrade4.13-4.13.1.sql 2016-08-31 06:32:57 UTC > (rev 7605) > > @@ -8,5 +8,6 @@ > > -- standardise transaction date to DATE type: > > ALTER TABLE `debtortrans` CHANGE `trandate` `trandate` DATE NOT NULL > DEFAULT '0000-00-00'; > > ALTER table supplierdiscounts CONVERT TO CHARACTER SET utf8; > > +INSERT INTO scripts VALUES ('PcAssignCashTabToTab.php',12,'Assign cash > from one tab to another'); > > > > > > > > > > ------------------------------------------------------------ > ------------------ > > _______________________________________________ > > Web-erp-svn mailing list > > Web...@li... > > https://lists.sourceforge.net/lists/listinfo/web-erp-svn > > > > > > -- > Course View Towers, > Plot 21 Yusuf Lule Road, > Kampala > T +256 (0) 312 314 418 > M +256 (0) 752 963 325 > www.weberpafrica.com > Twitter: @TimSchofield2 > Blog: http://weberpafrica.blogspot.co.uk/ > |
From: ExsonQu <hex...@gm...> - 2016-10-14 10:53:33
|
*Hi, Richard,* Thank you for review the script. I've overlook the multiple currency situation. The scenario for this is that sometime manager has no time to assign money to members under him. So he assigned all of those money to a clerk and then the clerk allocate the money to other members. I'll find sometime to check the multiple currency issue later. My notebook just be recovered from network card problem, sorry for the late reply. Thanks and best regards! Exson -- View this message in context: http://weberp-accounting.1478800.n4.nabble.com/Re-Web-erp-svn-SF-net-SVN-web-erp-7605-trunk-tp4658706p4658707.html Sent from the web-ERP-developers mailing list archive at Nabble.com. |