From: <dai...@us...> - 2014-10-25 04:54:17
|
Revision: 6937 http://sourceforge.net/p/web-erp/reponame/6937 Author: daintree Date: 2014-10-25 04:54:02 +0000 (Sat, 25 Oct 2014) Log Message: ----------- xmlrpc local version - just the stuff we need Added Paths: ----------- trunk/xmlrpc/ trunk/xmlrpc/lib/ trunk/xmlrpc/lib/xmlrpc.inc trunk/xmlrpc/lib/xmlrpc_wrappers.inc trunk/xmlrpc/lib/xmlrpcs.inc Added: trunk/xmlrpc/lib/xmlrpc.inc =================================================================== --- trunk/xmlrpc/lib/xmlrpc.inc (rev 0) +++ trunk/xmlrpc/lib/xmlrpc.inc 2014-10-25 04:54:02 UTC (rev 6937) @@ -0,0 +1,3776 @@ +<?php +// by Edd Dumbill (C) 1999-2002 +// <ed...@us...> +// $Id: xmlrpc.inc,v 1.174 2009/03/16 19:36:38 ggiunta Exp $ + +// Copyright (c) 1999,2000,2002 Edd Dumbill. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// * Neither the name of the "XML-RPC for PHP" nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +// OF THE POSSIBILITY OF SUCH DAMAGE. + + if(!function_exists('xml_parser_create')) + { + // For PHP 4 onward, XML functionality is always compiled-in on windows: + // no more need to dl-open it. It might have been compiled out on *nix... + if(strtoupper(substr(PHP_OS, 0, 3) != 'WIN')) + { + dl('xml.so'); + } + } + + // G. Giunta 2005/01/29: declare global these variables, + // so that xmlrpc.inc will work even if included from within a function + // Milosch: 2005/08/07 - explicitly request these via $GLOBALS where used. + $GLOBALS['xmlrpcI4']='i4'; + $GLOBALS['xmlrpcInt']='int'; + $GLOBALS['xmlrpcBoolean']='boolean'; + $GLOBALS['xmlrpcDouble']='double'; + $GLOBALS['xmlrpcString']='string'; + $GLOBALS['xmlrpcDateTime']='dateTime.iso8601'; + $GLOBALS['xmlrpcBase64']='base64'; + $GLOBALS['xmlrpcArray']='array'; + $GLOBALS['xmlrpcStruct']='struct'; + $GLOBALS['xmlrpcValue']='undefined'; + + $GLOBALS['xmlrpcTypes']=array( + $GLOBALS['xmlrpcI4'] => 1, + $GLOBALS['xmlrpcInt'] => 1, + $GLOBALS['xmlrpcBoolean'] => 1, + $GLOBALS['xmlrpcString'] => 1, + $GLOBALS['xmlrpcDouble'] => 1, + $GLOBALS['xmlrpcDateTime'] => 1, + $GLOBALS['xmlrpcBase64'] => 1, + $GLOBALS['xmlrpcArray'] => 2, + $GLOBALS['xmlrpcStruct'] => 3 + ); + + $GLOBALS['xmlrpc_valid_parents'] = array( + 'VALUE' => array('MEMBER', 'DATA', 'PARAM', 'FAULT'), + 'BOOLEAN' => array('VALUE'), + 'I4' => array('VALUE'), + 'INT' => array('VALUE'), + 'STRING' => array('VALUE'), + 'DOUBLE' => array('VALUE'), + 'DATETIME.ISO8601' => array('VALUE'), + 'BASE64' => array('VALUE'), + 'MEMBER' => array('STRUCT'), + 'NAME' => array('MEMBER'), + 'DATA' => array('ARRAY'), + 'ARRAY' => array('VALUE'), + 'STRUCT' => array('VALUE'), + 'PARAM' => array('PARAMS'), + 'METHODNAME' => array('METHODCALL'), + 'PARAMS' => array('METHODCALL', 'METHODRESPONSE'), + 'FAULT' => array('METHODRESPONSE'), + 'NIL' => array('VALUE'), // only used when extension activated + 'EX:NIL' => array('VALUE') // only used when extension activated + ); + + // define extra types for supporting NULL (useful for json or <NIL/>) + $GLOBALS['xmlrpcNull']='null'; + $GLOBALS['xmlrpcTypes']['null']=1; + + // Not in use anymore since 2.0. Shall we remove it? + /// @deprecated + $GLOBALS['xmlEntities']=array( + 'amp' => '&', + 'quot' => '"', + 'lt' => '<', + 'gt' => '>', + 'apos' => "'" + ); + + // tables used for transcoding different charsets into us-ascii xml + + $GLOBALS['xml_iso88591_Entities']=array(); + $GLOBALS['xml_iso88591_Entities']['in'] = array(); + $GLOBALS['xml_iso88591_Entities']['out'] = array(); + for ($i = 0; $i < 32; $i++) + { + $GLOBALS['xml_iso88591_Entities']['in'][] = chr($i); + $GLOBALS['xml_iso88591_Entities']['out'][] = '&#'.$i.';'; + } + for ($i = 160; $i < 256; $i++) + { + $GLOBALS['xml_iso88591_Entities']['in'][] = chr($i); + $GLOBALS['xml_iso88591_Entities']['out'][] = '&#'.$i.';'; + } + + /// @todo add to iso table the characters from cp_1252 range, i.e. 128 to 159? + /// These will NOT be present in true ISO-8859-1, but will save the unwary + /// windows user from sending junk (though no luck when reciving them...) + /* + $GLOBALS['xml_cp1252_Entities']=array(); + for ($i = 128; $i < 160; $i++) + { + $GLOBALS['xml_cp1252_Entities']['in'][] = chr($i); + } + $GLOBALS['xml_cp1252_Entities']['out'] = array( + '€', '?', '‚', 'ƒ', + '„', '…', '†', '‡', + 'ˆ', '‰', 'Š', '‹', + 'Œ', '?', 'Ž', '?', + '?', '‘', '’', '“', + '”', '•', '–', '—', + '˜', '™', 'š', '›', + 'œ', '?', 'ž', 'Ÿ' + ); + */ + + $GLOBALS['xmlrpcerr'] = array( + 'unknown_method'=>1, + 'invalid_return'=>2, + 'incorrect_params'=>3, + 'introspect_unknown'=>4, + 'http_error'=>5, + 'no_data'=>6, + 'no_ssl'=>7, + 'curl_fail'=>8, + 'invalid_request'=>15, + 'no_curl'=>16, + 'server_error'=>17, + 'multicall_error'=>18, + 'multicall_notstruct'=>9, + 'multicall_nomethod'=>10, + 'multicall_notstring'=>11, + 'multicall_recursion'=>12, + 'multicall_noparams'=>13, + 'multicall_notarray'=>14, + + 'cannot_decompress'=>103, + 'decompress_fail'=>104, + 'dechunk_fail'=>105, + 'server_cannot_decompress'=>106, + 'server_decompress_fail'=>107 + ); + + $GLOBALS['xmlrpcstr'] = array( + 'unknown_method'=>'Unknown method', + 'invalid_return'=>'Invalid return payload: enable debugging to examine incoming payload', + 'incorrect_params'=>'Incorrect parameters passed to method', + 'introspect_unknown'=>"Can't introspect: method unknown", + 'http_error'=>"Didn't receive 200 OK from remote server.", + 'no_data'=>'No data received from server.', + 'no_ssl'=>'No SSL support compiled in.', + 'curl_fail'=>'CURL error', + 'invalid_request'=>'Invalid request payload', + 'no_curl'=>'No CURL support compiled in.', + 'server_error'=>'Internal server error', + 'multicall_error'=>'Received from server invalid multicall response', + 'multicall_notstruct'=>'system.multicall expected struct', + 'multicall_nomethod'=>'missing methodName', + 'multicall_notstring'=>'methodName is not a string', + 'multicall_recursion'=>'recursive system.multicall forbidden', + 'multicall_noparams'=>'missing params', + 'multicall_notarray'=>'params is not an array', + + 'cannot_decompress'=>'Received from server compressed HTTP and cannot decompress', + 'decompress_fail'=>'Received from server invalid compressed HTTP', + 'dechunk_fail'=>'Received from server invalid chunked HTTP', + 'server_cannot_decompress'=>'Received from client compressed HTTP request and cannot decompress', + 'server_decompress_fail'=>'Received from client invalid compressed HTTP request' + ); + + // The charset encoding used by the server for received messages and + // by the client for received responses when received charset cannot be determined + // or is not supported + $GLOBALS['xmlrpc_defencoding']='UTF-8'; + + // The encoding used internally by PHP. + // String values received as xml will be converted to this, and php strings will be converted to xml + // as if having been coded with this + $GLOBALS['xmlrpc_internalencoding']='ISO-8859-1'; + + $GLOBALS['xmlrpcName']='XML-RPC for PHP'; + $GLOBALS['xmlrpcVersion']='3.0.0.beta'; + + // let user errors start at 800 + $GLOBALS['xmlrpcerruser']=800; + // let XML parse errors start at 100 + $GLOBALS['xmlrpcerrxml']=100; + + // formulate backslashes for escaping regexp + // Not in use anymore since 2.0. Shall we remove it? + /// @deprecated + $GLOBALS['xmlrpc_backslash']=chr(92).chr(92); + + // set to TRUE to enable correct decoding of <NIL/> and <EX:NIL/> values + $GLOBALS['xmlrpc_null_extension']=false; + + // set to TRUE to enable encoding of php NULL values to <EX:NIL/> instead of <NIL/> + $GLOBALS['xmlrpc_null_apache_encoding']=false; + + // used to store state during parsing + // quick explanation of components: + // ac - used to accumulate values + // isf - used to indicate a parsing fault (2) or xmlrpcresp fault (1) + // isf_reason - used for storing xmlrpcresp fault string + // lv - used to indicate "looking for a value": implements + // the logic to allow values with no types to be strings + // params - used to store parameters in method calls + // method - used to store method name + // stack - array with genealogy of xml elements names: + // used to validate nesting of xmlrpc elements + $GLOBALS['_xh']=null; + + /** + * Convert a string to the correct XML representation in a target charset + * To help correct communication of non-ascii chars inside strings, regardless + * of the charset used when sending requests, parsing them, sending responses + * and parsing responses, an option is to convert all non-ascii chars present in the message + * into their equivalent 'charset entity'. Charset entities enumerated this way + * are independent of the charset encoding used to transmit them, and all XML + * parsers are bound to understand them. + * Note that in the std case we are not sending a charset encoding mime type + * along with http headers, so we are bound by RFC 3023 to emit strict us-ascii. + * + * @todo do a bit of basic benchmarking (strtr vs. str_replace) + * @todo make usage of iconv() or recode_string() or mb_string() where available + */ + function xmlrpc_encode_entitites($data, $src_encoding='', $dest_encoding='') + { + if ($src_encoding == '') + { + // lame, but we know no better... + $src_encoding = $GLOBALS['xmlrpc_internalencoding']; + } + + switch(strtoupper($src_encoding.'_'.$dest_encoding)) + { + case 'ISO-8859-1_': + case 'ISO-8859-1_US-ASCII': + $escaped_data = str_replace(array('&', '"', "'", '<', '>'), array('&', '"', ''', '<', '>'), $data); + $escaped_data = str_replace($GLOBALS['xml_iso88591_Entities']['in'], $GLOBALS['xml_iso88591_Entities']['out'], $escaped_data); + break; + case 'ISO-8859-1_UTF-8': + $escaped_data = str_replace(array('&', '"', "'", '<', '>'), array('&', '"', ''', '<', '>'), $data); + $escaped_data = utf8_encode($escaped_data); + break; + case 'ISO-8859-1_ISO-8859-1': + case 'US-ASCII_US-ASCII': + case 'US-ASCII_UTF-8': + case 'US-ASCII_': + case 'US-ASCII_ISO-8859-1': + case 'UTF-8_UTF-8': + //case 'CP1252_CP1252': + $escaped_data = str_replace(array('&', '"', "'", '<', '>'), array('&', '"', ''', '<', '>'), $data); + break; + case 'UTF-8_': + case 'UTF-8_US-ASCII': + case 'UTF-8_ISO-8859-1': + // NB: this will choke on invalid UTF-8, going most likely beyond EOF + $escaped_data = ''; + // be kind to users creating string xmlrpcvals out of different php types + $data = (string) $data; + $ns = strlen ($data); + for ($nn = 0; $nn < $ns; $nn++) + { + $ch = $data[$nn]; + $ii = ord($ch); + //1 7 0bbbbbbb (127) + if ($ii < 128) + { + /// @todo shall we replace this with a (supposedly) faster str_replace? + switch($ii){ + case 34: + $escaped_data .= '"'; + break; + case 38: + $escaped_data .= '&'; + break; + case 39: + $escaped_data .= '''; + break; + case 60: + $escaped_data .= '<'; + break; + case 62: + $escaped_data .= '>'; + break; + default: + $escaped_data .= $ch; + } // switch + } + //2 11 110bbbbb 10bbbbbb (2047) + else if ($ii>>5 == 6) + { + $b1 = ($ii & 31); + $ii = ord($data[$nn+1]); + $b2 = ($ii & 63); + $ii = ($b1 * 64) + $b2; + $ent = sprintf ('&#%d;', $ii); + $escaped_data .= $ent; + $nn += 1; + } + //3 16 1110bbbb 10bbbbbb 10bbbbbb + else if ($ii>>4 == 14) + { + $b1 = ($ii & 15); + $ii = ord($data[$nn+1]); + $b2 = ($ii & 63); + $ii = ord($data[$nn+2]); + $b3 = ($ii & 63); + $ii = ((($b1 * 64) + $b2) * 64) + $b3; + $ent = sprintf ('&#%d;', $ii); + $escaped_data .= $ent; + $nn += 2; + } + //4 21 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb + else if ($ii>>3 == 30) + { + $b1 = ($ii & 7); + $ii = ord($data[$nn+1]); + $b2 = ($ii & 63); + $ii = ord($data[$nn+2]); + $b3 = ($ii & 63); + $ii = ord($data[$nn+3]); + $b4 = ($ii & 63); + $ii = ((((($b1 * 64) + $b2) * 64) + $b3) * 64) + $b4; + $ent = sprintf ('&#%d;', $ii); + $escaped_data .= $ent; + $nn += 3; + } + } + break; +/* + case 'CP1252_': + case 'CP1252_US-ASCII': + $escaped_data = str_replace(array('&', '"', "'", '<', '>'), array('&', '"', ''', '<', '>'), $data); + $escaped_data = str_replace($GLOBALS['xml_iso88591_Entities']['in'], $GLOBALS['xml_iso88591_Entities']['out'], $escaped_data); + $escaped_data = str_replace($GLOBALS['xml_cp1252_Entities']['in'], $GLOBALS['xml_cp1252_Entities']['out'], $escaped_data); + break; + case 'CP1252_UTF-8': + $escaped_data = str_replace(array('&', '"', "'", '<', '>'), array('&', '"', ''', '<', '>'), $data); + /// @todo we could use real UTF8 chars here instead of xml entities... (note that utf_8 encode all allone will NOT convert them) + $escaped_data = str_replace($GLOBALS['xml_cp1252_Entities']['in'], $GLOBALS['xml_cp1252_Entities']['out'], $escaped_data); + $escaped_data = utf8_encode($escaped_data); + break; + case 'CP1252_ISO-8859-1': + $escaped_data = str_replace(array('&', '"', "'", '<', '>'), array('&', '"', ''', '<', '>'), $data); + // we might as well replave all funky chars with a '?' here, but we are kind and leave it to the receiving application layer to decide what to do with these weird entities... + $escaped_data = str_replace($GLOBALS['xml_cp1252_Entities']['in'], $GLOBALS['xml_cp1252_Entities']['out'], $escaped_data); + break; +*/ + default: + $escaped_data = ''; + error_log("Converting from $src_encoding to $dest_encoding: not supported..."); + } + return $escaped_data; + } + + /// xml parser handler function for opening element tags + function xmlrpc_se($parser, $name, $attrs, $accept_single_vals=false) + { + // if invalid xmlrpc already detected, skip all processing + if ($GLOBALS['_xh']['isf'] < 2) + { + // check for correct element nesting + // top level element can only be of 2 types + /// @todo optimization creep: save this check into a bool variable, instead of using count() every time: + /// there is only a single top level element in xml anyway + if (count($GLOBALS['_xh']['stack']) == 0) + { + if ($name != 'METHODRESPONSE' && $name != 'METHODCALL' && ( + $name != 'VALUE' && !$accept_single_vals)) + { + $GLOBALS['_xh']['isf'] = 2; + $GLOBALS['_xh']['isf_reason'] = 'missing top level xmlrpc element'; + return; + } + else + { + $GLOBALS['_xh']['rt'] = strtolower($name); + $GLOBALS['_xh']['rt'] = strtolower($name); + } + } + else + { + // not top level element: see if parent is OK + $parent = end($GLOBALS['_xh']['stack']); + if (!array_key_exists($name, $GLOBALS['xmlrpc_valid_parents']) || !in_array($parent, $GLOBALS['xmlrpc_valid_parents'][$name])) + { + $GLOBALS['_xh']['isf'] = 2; + $GLOBALS['_xh']['isf_reason'] = "xmlrpc element $name cannot be child of $parent"; + return; + } + } + + switch($name) + { + // optimize for speed switch cases: most common cases first + case 'VALUE': + /// @todo we could check for 2 VALUE elements inside a MEMBER or PARAM element + $GLOBALS['_xh']['vt']='value'; // indicator: no value found yet + $GLOBALS['_xh']['ac']=''; + $GLOBALS['_xh']['lv']=1; + $GLOBALS['_xh']['php_class']=null; + break; + case 'I4': + case 'INT': + case 'STRING': + case 'BOOLEAN': + case 'DOUBLE': + case 'DATETIME.ISO8601': + case 'BASE64': + if ($GLOBALS['_xh']['vt']!='value') + { + //two data elements inside a value: an error occurred! + $GLOBALS['_xh']['isf'] = 2; + $GLOBALS['_xh']['isf_reason'] = "$name element following a {$GLOBALS['_xh']['vt']} element inside a single value"; + return; + } + $GLOBALS['_xh']['ac']=''; // reset the accumulator + break; + case 'STRUCT': + case 'ARRAY': + if ($GLOBALS['_xh']['vt']!='value') + { + //two data elements inside a value: an error occurred! + $GLOBALS['_xh']['isf'] = 2; + $GLOBALS['_xh']['isf_reason'] = "$name element following a {$GLOBALS['_xh']['vt']} element inside a single value"; + return; + } + // create an empty array to hold child values, and push it onto appropriate stack + $cur_val = array(); + $cur_val['values'] = array(); + $cur_val['type'] = $name; + // check for out-of-band information to rebuild php objs + // and in case it is found, save it + if (@isset($attrs['PHP_CLASS'])) + { + $cur_val['php_class'] = $attrs['PHP_CLASS']; + } + $GLOBALS['_xh']['valuestack'][] = $cur_val; + $GLOBALS['_xh']['vt']='data'; // be prepared for a data element next + break; + case 'DATA': + if ($GLOBALS['_xh']['vt']!='data') + { + //two data elements inside a value: an error occurred! + $GLOBALS['_xh']['isf'] = 2; + $GLOBALS['_xh']['isf_reason'] = "found two data elements inside an array element"; + return; + } + case 'METHODCALL': + case 'METHODRESPONSE': + case 'PARAMS': + // valid elements that add little to processing + break; + case 'METHODNAME': + case 'NAME': + /// @todo we could check for 2 NAME elements inside a MEMBER element + $GLOBALS['_xh']['ac']=''; + break; + case 'FAULT': + $GLOBALS['_xh']['isf']=1; + break; + case 'MEMBER': + $GLOBALS['_xh']['valuestack'][count($GLOBALS['_xh']['valuestack'])-1]['name']=''; // set member name to null, in case we do not find in the xml later on + //$GLOBALS['_xh']['ac']=''; + // Drop trough intentionally + case 'PARAM': + // clear value type, so we can check later if no value has been passed for this param/member + $GLOBALS['_xh']['vt']=null; + break; + case 'NIL': + case 'EX:NIL': + if ($GLOBALS['xmlrpc_null_extension']) + { + if ($GLOBALS['_xh']['vt']!='value') + { + //two data elements inside a value: an error occurred! + $GLOBALS['_xh']['isf'] = 2; + $GLOBALS['_xh']['isf_reason'] = "$name element following a {$GLOBALS['_xh']['vt']} element inside a single value"; + return; + } + $GLOBALS['_xh']['ac']=''; // reset the accumulator + break; + } + // we do not support the <NIL/> extension, so + // drop through intentionally + default: + /// INVALID ELEMENT: RAISE ISF so that it is later recognized!!! + $GLOBALS['_xh']['isf'] = 2; + $GLOBALS['_xh']['isf_reason'] = "found not-xmlrpc xml element $name"; + break; + } + + // Save current element name to stack, to validate nesting + $GLOBALS['_xh']['stack'][] = $name; + + /// @todo optimization creep: move this inside the big switch() above + if($name!='VALUE') + { + $GLOBALS['_xh']['lv']=0; + } + } + } + + /// Used in decoding xml chunks that might represent single xmlrpc values + function xmlrpc_se_any($parser, $name, $attrs) + { + xmlrpc_se($parser, $name, $attrs, true); + } + + /// xml parser handler function for close element tags + function xmlrpc_ee($parser, $name, $rebuild_xmlrpcvals = true) + { + if ($GLOBALS['_xh']['isf'] < 2) + { + // push this element name from stack + // NB: if XML validates, correct opening/closing is guaranteed and + // we do not have to check for $name == $curr_elem. + // we also checked for proper nesting at start of elements... + $curr_elem = array_pop($GLOBALS['_xh']['stack']); + + switch($name) + { + case 'VALUE': + // This if() detects if no scalar was inside <VALUE></VALUE> + if ($GLOBALS['_xh']['vt']=='value') + { + $GLOBALS['_xh']['value']=$GLOBALS['_xh']['ac']; + $GLOBALS['_xh']['vt']=$GLOBALS['xmlrpcString']; + } + + if ($rebuild_xmlrpcvals) + { + // build the xmlrpc val out of the data received, and substitute it + $temp = new xmlrpcval($GLOBALS['_xh']['value'], $GLOBALS['_xh']['vt']); + // in case we got info about underlying php class, save it + // in the object we're rebuilding + if (isset($GLOBALS['_xh']['php_class'])) + $temp->_php_class = $GLOBALS['_xh']['php_class']; + // check if we are inside an array or struct: + // if value just built is inside an array, let's move it into array on the stack + $vscount = count($GLOBALS['_xh']['valuestack']); + if ($vscount && $GLOBALS['_xh']['valuestack'][$vscount-1]['type']=='ARRAY') + { + $GLOBALS['_xh']['valuestack'][$vscount-1]['values'][] = $temp; + } + else + { + $GLOBALS['_xh']['value'] = $temp; + } + } + else + { + /// @todo this needs to treat correctly php-serialized objects, + /// since std deserializing is done by php_xmlrpc_decode, + /// which we will not be calling... + if (isset($GLOBALS['_xh']['php_class'])) + { + } + + // check if we are inside an array or struct: + // if value just built is inside an array, let's move it into array on the stack + $vscount = count($GLOBALS['_xh']['valuestack']); + if ($vscount && $GLOBALS['_xh']['valuestack'][$vscount-1]['type']=='ARRAY') + { + $GLOBALS['_xh']['valuestack'][$vscount-1]['values'][] = $GLOBALS['_xh']['value']; + } + } + break; + case 'BOOLEAN': + case 'I4': + case 'INT': + case 'STRING': + case 'DOUBLE': + case 'DATETIME.ISO8601': + case 'BASE64': + $GLOBALS['_xh']['vt']=strtolower($name); + /// @todo: optimization creep - remove the if/elseif cycle below + /// since the case() in which we are already did that + if ($name=='STRING') + { + $GLOBALS['_xh']['value']=$GLOBALS['_xh']['ac']; + } + elseif ($name=='DATETIME.ISO8601') + { + if (!preg_match('/^[0-9]{8}T[0-9]{2}:[0-9]{2}:[0-9]{2}$/', $GLOBALS['_xh']['ac'])) + { + error_log('XML-RPC: invalid value received in DATETIME: '.$GLOBALS['_xh']['ac']); + } + $GLOBALS['_xh']['vt']=$GLOBALS['xmlrpcDateTime']; + $GLOBALS['_xh']['value']=$GLOBALS['_xh']['ac']; + } + elseif ($name=='BASE64') + { + /// @todo check for failure of base64 decoding / catch warnings + $GLOBALS['_xh']['value']=base64_decode($GLOBALS['_xh']['ac']); + } + elseif ($name=='BOOLEAN') + { + // special case here: we translate boolean 1 or 0 into PHP + // constants true or false. + // Strings 'true' and 'false' are accepted, even though the + // spec never mentions them (see eg. Blogger api docs) + // NB: this simple checks helps a lot sanitizing input, ie no + // security problems around here + if ($GLOBALS['_xh']['ac']=='1' || strcasecmp($GLOBALS['_xh']['ac'], 'true') == 0) + { + $GLOBALS['_xh']['value']=true; + } + else + { + // log if receiveing something strange, even though we set the value to false anyway + if ($GLOBALS['_xh']['ac']!='0' && strcasecmp($GLOBALS['_xh']['ac'], 'false') != 0) + error_log('XML-RPC: invalid value received in BOOLEAN: '.$GLOBALS['_xh']['ac']); + $GLOBALS['_xh']['value']=false; + } + } + elseif ($name=='DOUBLE') + { + // we have a DOUBLE + // we must check that only 0123456789-.<space> are characters here + // NOTE: regexp could be much stricter than this... + if (!preg_match('/^[+-eE0123456789 \t.]+$/', $GLOBALS['_xh']['ac'])) + { + /// @todo: find a better way of throwing an error than this! + error_log('XML-RPC: non numeric value received in DOUBLE: '.$GLOBALS['_xh']['ac']); + $GLOBALS['_xh']['value']='ERROR_NON_NUMERIC_FOUND'; + } + else + { + // it's ok, add it on + $GLOBALS['_xh']['value']=(double)$GLOBALS['_xh']['ac']; + } + } + else + { + // we have an I4/INT + // we must check that only 0123456789-<space> are characters here + if (!preg_match('/^[+-]?[0123456789 \t]+$/', $GLOBALS['_xh']['ac'])) + { + /// @todo find a better way of throwing an error than this! + error_log('XML-RPC: non numeric value received in INT: '.$GLOBALS['_xh']['ac']); + $GLOBALS['_xh']['value']='ERROR_NON_NUMERIC_FOUND'; + } + else + { + // it's ok, add it on + $GLOBALS['_xh']['value']=(int)$GLOBALS['_xh']['ac']; + } + } + //$GLOBALS['_xh']['ac']=''; // is this necessary? + $GLOBALS['_xh']['lv']=3; // indicate we've found a value + break; + case 'NAME': + $GLOBALS['_xh']['valuestack'][count($GLOBALS['_xh']['valuestack'])-1]['name'] = $GLOBALS['_xh']['ac']; + break; + case 'MEMBER': + //$GLOBALS['_xh']['ac']=''; // is this necessary? + // add to array in the stack the last element built, + // unless no VALUE was found + if ($GLOBALS['_xh']['vt']) + { + $vscount = count($GLOBALS['_xh']['valuestack']); + $GLOBALS['_xh']['valuestack'][$vscount-1]['values'][$GLOBALS['_xh']['valuestack'][$vscount-1]['name']] = $GLOBALS['_xh']['value']; + } else + error_log('XML-RPC: missing VALUE inside STRUCT in received xml'); + break; + case 'DATA': + //$GLOBALS['_xh']['ac']=''; // is this necessary? + $GLOBALS['_xh']['vt']=null; // reset this to check for 2 data elements in a row - even if they're empty + break; + case 'STRUCT': + case 'ARRAY': + // fetch out of stack array of values, and promote it to current value + $curr_val = array_pop($GLOBALS['_xh']['valuestack']); + $GLOBALS['_xh']['value'] = $curr_val['values']; + $GLOBALS['_xh']['vt']=strtolower($name); + if (isset($curr_val['php_class'])) + { + $GLOBALS['_xh']['php_class'] = $curr_val['php_class']; + } + break; + case 'PARAM': + // add to array of params the current value, + // unless no VALUE was found + if ($GLOBALS['_xh']['vt']) + { + $GLOBALS['_xh']['params'][]=$GLOBALS['_xh']['value']; + $GLOBALS['_xh']['pt'][]=$GLOBALS['_xh']['vt']; + } + else + error_log('XML-RPC: missing VALUE inside PARAM in received xml'); + break; + case 'METHODNAME': + $GLOBALS['_xh']['method']=preg_replace('/^[\n\r\t ]+/', '', $GLOBALS['_xh']['ac']); + break; + case 'NIL': + case 'EX:NIL': + if ($GLOBALS['xmlrpc_null_extension']) + { + $GLOBALS['_xh']['vt']='null'; + $GLOBALS['_xh']['value']=null; + $GLOBALS['_xh']['lv']=3; + break; + } + // drop through intentionally if nil extension not enabled + case 'PARAMS': + case 'FAULT': + case 'METHODCALL': + case 'METHORESPONSE': + break; + default: + // End of INVALID ELEMENT! + // shall we add an assert here for unreachable code??? + break; + } + } + } + + /// Used in decoding xmlrpc requests/responses without rebuilding xmlrpc values + function xmlrpc_ee_fast($parser, $name) + { + xmlrpc_ee($parser, $name, false); + } + + /// xml parser handler function for character data + function xmlrpc_cd($parser, $data) + { + // skip processing if xml fault already detected + if ($GLOBALS['_xh']['isf'] < 2) + { + // "lookforvalue==3" means that we've found an entire value + // and should discard any further character data + if($GLOBALS['_xh']['lv']!=3) + { + // G. Giunta 2006-08-23: useless change of 'lv' from 1 to 2 + //if($GLOBALS['_xh']['lv']==1) + //{ + // if we've found text and we're just in a <value> then + // say we've found a value + //$GLOBALS['_xh']['lv']=2; + //} + // we always initialize the accumulator before starting parsing, anyway... + //if(!@isset($GLOBALS['_xh']['ac'])) + //{ + // $GLOBALS['_xh']['ac'] = ''; + //} + $GLOBALS['_xh']['ac'].=$data; + } + } + } + + /// xml parser handler function for 'other stuff', ie. not char data or + /// element start/end tag. In fact it only gets called on unknown entities... + function xmlrpc_dh($parser, $data) + { + // skip processing if xml fault already detected + if ($GLOBALS['_xh']['isf'] < 2) + { + if(substr($data, 0, 1) == '&' && substr($data, -1, 1) == ';') + { + // G. Giunta 2006-08-25: useless change of 'lv' from 1 to 2 + //if($GLOBALS['_xh']['lv']==1) + //{ + // $GLOBALS['_xh']['lv']=2; + //} + $GLOBALS['_xh']['ac'].=$data; + } + } + return true; + } + + class xmlrpc_client + { + var $path; + var $server; + var $port=0; + var $method='http'; + var $errno; + var $errstr; + var $debug=0; + var $username=''; + var $password=''; + var $authtype=1; + var $cert=''; + var $certpass=''; + var $cacert=''; + var $cacertdir=''; + var $key=''; + var $keypass=''; + var $verifypeer=true; + var $verifyhost=1; + var $no_multicall=false; + var $proxy=''; + ... [truncated message content] |
From: <rc...@us...> - 2014-10-25 19:25:20
|
Revision: 6940 http://sourceforge.net/p/web-erp/reponame/6940 Author: rchacon Date: 2014-10-25 19:25:12 +0000 (Sat, 25 Oct 2014) Log Message: ----------- Minor changes (script Id, cleans */). Modified Paths: -------------- trunk/AccountGroups.php trunk/index.php Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2014-10-25 07:08:51 UTC (rev 6939) +++ trunk/AccountGroups.php 2014-10-25 19:25:12 UTC (rev 6940) @@ -2,11 +2,11 @@ /* $Id$*/ include('includes/session.inc'); + $Title = _('Account Groups'); -/* Manual links before header.inc */ $ViewTopic= 'GeneralLedger';// Filename in ManualContents.php's TOC. -$BookMark = 'AccountGroups';// Anchor's id in the manual's html document.*/ -include('includes/header.inc'); +$BookMark = 'AccountGroups';// Anchor's id in the manual's html document. +include('includes/header.inc');// Manual links before header.inc. include('includes/SQL_CommonFunctions.inc'); Modified: trunk/index.php =================================================================== --- trunk/index.php 2014-10-25 07:08:51 UTC (rev 6939) +++ trunk/index.php 2014-10-25 19:25:12 UTC (rev 6940) @@ -1,4 +1,6 @@ <?php +/* $Id$*/ + $PageSecurity=0; include('includes/session.inc'); |
From: <dai...@us...> - 2014-10-26 23:18:16
|
Revision: 6941 http://sourceforge.net/p/web-erp/reponame/6941 Author: daintree Date: 2014-10-26 23:18:08 +0000 (Sun, 26 Oct 2014) Log Message: ----------- remove $db from DB_query calls Modified Paths: -------------- trunk/AccountGroups.php trunk/AccountSections.php trunk/AddCustomerContacts.php trunk/AddCustomerNotes.php trunk/AddCustomerTypeNotes.php trunk/AgedControlledInventory.php trunk/AgedDebtors.php trunk/AgedSuppliers.php trunk/Areas.php trunk/AuditTrail.php trunk/BOMExtendedQty.php trunk/BOMIndented.php trunk/BOMIndentedReverse.php trunk/BOMInquiry.php trunk/BOMListing.php trunk/BOMs.php trunk/BankAccountUsers.php trunk/BankAccounts.php trunk/BankMatching.php trunk/BankReconciliation.php trunk/COGSGLPostings.php trunk/CompanyPreferences.php trunk/ConfirmDispatch_Invoice.php trunk/ContractBOM.php trunk/ContractCosting.php trunk/Contracts.php trunk/CopyBOM.php trunk/CounterReturns.php trunk/CounterSales.php trunk/CreditStatus.php trunk/Credit_Invoice.php trunk/Currencies.php trunk/CustEDISetup.php trunk/CustItem.php trunk/CustLoginSetup.php trunk/CustWhereAlloc.php trunk/CustomerAllocations.php trunk/CustomerBranches.php trunk/CustomerInquiry.php trunk/CustomerPurchases.php trunk/CustomerReceipt.php trunk/CustomerTransInquiry.php trunk/CustomerTypes.php trunk/Customers.php trunk/DailyBankTransactions.php trunk/DailySalesInquiry.php trunk/Dashboard.php trunk/DebtorsAtPeriodEnd.php trunk/DeliveryDetails.php trunk/Departments.php trunk/DiscountCategories.php trunk/DiscountMatrix.php trunk/EDIMessageFormat.php trunk/EDIProcessOrders.php trunk/EDISendInvoices.php trunk/EDISendInvoices_Reece.php trunk/EmailConfirmation.php trunk/EmailCustTrans.php trunk/ExchangeRateTrend.php trunk/FTP_RadioBeacon.php trunk/Factors.php trunk/FixedAssetCategories.php trunk/FixedAssetDepreciation.php trunk/FixedAssetItems.php trunk/FixedAssetLocations.php trunk/FixedAssetRegister.php trunk/FixedAssetTransfer.php trunk/FreightCosts.php trunk/GLAccountCSV.php trunk/GLAccountInquiry.php trunk/GLAccountReport.php trunk/GLAccounts.php trunk/GLBalanceSheet.php trunk/GLBudgets.php trunk/GLCodesInquiry.php trunk/GLJournal.php trunk/GLJournalInquiry.php trunk/GLProfit_Loss.php trunk/GLTagProfit_Loss.php trunk/GLTags.php trunk/GLTransInquiry.php trunk/GLTrialBalance.php trunk/GLTrialBalance_csv.php trunk/GeocodeSetup.php trunk/GoodsReceived.php trunk/ImportBankTrans.php trunk/ImportBankTransAnalysis.php trunk/InternalStockCategoriesByRole.php trunk/InternalStockRequest.php trunk/InternalStockRequestAuthorisation.php trunk/InternalStockRequestFulfill.php trunk/InventoryPlanning.php trunk/InventoryPlanningPrefSupplier.php trunk/InventoryQuantities.php trunk/InventoryValuation.php trunk/Labels.php trunk/Locations.php trunk/MRP.php trunk/MRPCalendar.php trunk/MRPCreateDemands.php trunk/MRPDemandTypes.php trunk/MRPDemands.php trunk/MRPPlannedPurchaseOrders.php trunk/MRPPlannedWorkOrders.php trunk/MRPReport.php trunk/MRPReschedules.php trunk/MRPShortages.php trunk/MailInventoryValuation.php trunk/MailingGroupMaintenance.php trunk/MaintenanceReminders.php trunk/MaintenanceTasks.php trunk/MaintenanceUserSchedule.php trunk/Manufacturers.php trunk/MaterialsNotUsed.php trunk/NoSalesItems.php trunk/OffersReceived.php trunk/OrderDetails.php trunk/OutstandingGRNs.php trunk/PDFBankingSummary.php trunk/PDFChequeListing.php trunk/PDFCustTransListing.php trunk/PDFCustomerList.php trunk/PDFDIFOT.php trunk/PDFDeliveryDifferences.php trunk/PDFFGLabel.php trunk/PDFGLJournal.php trunk/PDFGrn.php trunk/PDFLowGP.php trunk/PDFOrderStatus.php trunk/PDFOrdersInvoiced.php trunk/PDFPeriodStockTransListing.php trunk/PDFPickingList.php trunk/PDFPriceList.php trunk/PDFPrintLabel.php trunk/PDFQALabel.php trunk/PDFQuotation.php trunk/PDFQuotationPortrait.php trunk/PDFReceipt.php trunk/PDFRemittanceAdvice.php trunk/PDFSellThroughSupportClaim.php trunk/PDFStockCheckComparison.php trunk/PDFStockLocTransfer.php trunk/PDFStockNegatives.php trunk/PDFStockTransfer.php trunk/PDFSuppTransListing.php trunk/PDFTopItems.php trunk/PDFWOPrint.php trunk/POReport.php trunk/PO_AuthorisationLevels.php trunk/PO_AuthoriseMyOrders.php trunk/PO_Chk_ShiptRef_JobRef.php trunk/PO_Header.php trunk/PO_Items.php trunk/PO_OrderDetails.php trunk/PO_PDFPurchOrder.php trunk/PO_SelectOSPurchOrder.php trunk/PO_SelectPurchOrder.php trunk/PageSecurity.php trunk/PaymentAllocations.php trunk/PaymentMethods.php trunk/PaymentTerms.php trunk/Payments.php trunk/PcAssignCashToTab.php trunk/PcAuthorizeExpenses.php trunk/PcClaimExpensesFromTab.php trunk/PcExpenses.php trunk/PcExpensesTypeTab.php trunk/PcReportTab.php trunk/PcTabs.php trunk/PcTypeTabs.php trunk/PeriodsInquiry.php trunk/PriceMatrix.php trunk/Prices.php trunk/PricesBasedOnMarkUp.php trunk/PricesByCost.php trunk/Prices_Customer.php trunk/PrintCustOrder.php trunk/PrintCustOrder_generic.php trunk/PrintCustStatements.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/PrintWOItemSlip.php trunk/PurchData.php trunk/PurchaseByPrefSupplier.php trunk/RecurringSalesOrders.php trunk/RecurringSalesOrdersProcess.php trunk/RelatedItemsUpdate.php trunk/ReorderLevel.php trunk/ReorderLevelLocation.php trunk/ReprintGRN.php trunk/ReverseGRN.php trunk/SMTPServer.php trunk/SalesAnalReptCols.php trunk/SalesAnalRepts.php trunk/SalesByTypePeriodInquiry.php trunk/SalesCategories.php trunk/SalesCategoryPeriodInquiry.php trunk/SalesGLPostings.php trunk/SalesGraph.php trunk/SalesInquiry.php trunk/SalesPeople.php trunk/SalesTopCustomersInquiry.php trunk/SalesTopItemsInquiry.php trunk/SalesTypes.php trunk/SecurityTokens.php trunk/SelectAsset.php trunk/SelectCompletedOrder.php trunk/SelectContract.php trunk/SelectCreditItems.php trunk/SelectCustomer.php trunk/SelectGLAccount.php trunk/SelectOrderItems.php trunk/SelectProduct.php trunk/SelectRecurringSalesOrder.php trunk/SelectSalesOrder.php trunk/SelectSupplier.php trunk/SelectWorkOrder.php trunk/SellThroughSupport.php trunk/ShipmentCosting.php trunk/Shipments.php trunk/Shippers.php trunk/Shipt_Select.php trunk/ShiptsList.php trunk/ShopParameters.php trunk/SpecialOrder.php trunk/StockAdjustments.php trunk/StockCategories.php trunk/StockCheck.php trunk/StockClone.php trunk/StockCostUpdate.php trunk/StockCounts.php trunk/StockDispatch.php trunk/StockLocMovements.php trunk/StockLocStatus.php trunk/StockLocTransfer.php trunk/StockLocTransferReceive.php trunk/StockMovements.php trunk/StockQties_csv.php trunk/StockQuantityByDate.php trunk/StockReorderLevel.php trunk/StockSerialItemResearch.php trunk/StockSerialItems.php trunk/StockStatus.php trunk/StockTransfers.php trunk/StockUsage.php trunk/StockUsageGraph.php trunk/Stocks.php trunk/SuppContractChgs.php trunk/SuppCreditGRNs.php trunk/SuppFixedAssetChgs.php trunk/SuppInvGRNs.php trunk/SuppLoginSetup.php trunk/SuppPaymentRun.php trunk/SuppPriceList.php trunk/SuppShiptChgs.php trunk/SuppTransGLAnalysis.php trunk/SupplierAllocations.php trunk/SupplierBalsAtPeriodEnd.php trunk/SupplierContacts.php trunk/SupplierCredit.php trunk/SupplierInquiry.php trunk/SupplierInvoice.php trunk/SupplierPriceList.php trunk/SupplierTenderCreate.php trunk/SupplierTenders.php trunk/SupplierTransInquiry.php trunk/SupplierTypes.php trunk/Suppliers.php trunk/SystemParameters.php trunk/Tax.php trunk/TaxAuthorities.php trunk/TaxAuthorityRates.php trunk/TaxCategories.php trunk/TaxGroups.php trunk/TaxProvinces.php trunk/TopItems.php trunk/UnitsOfMeasure.php trunk/UpgradeDatabase.php trunk/UserSettings.php trunk/WOCanBeProducedNow.php trunk/WOSerialNos.php trunk/WWW_Access.php trunk/WWW_Users.php trunk/WhereUsedInquiry.php trunk/WorkCentres.php trunk/WorkOrderCosting.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/WorkOrderReceive.php trunk/WorkOrderStatus.php trunk/Z_BottomUpCosts.php trunk/Z_ChangeBranchCode.php trunk/Z_ChangeCustomerCode.php trunk/Z_ChangeGLAccountCode.php trunk/Z_ChangeLocationCode.php trunk/Z_ChangeStockCategory.php trunk/Z_ChangeStockCode.php trunk/Z_ChangeSupplierCode.php trunk/Z_CheckAllocationsFrom.php trunk/Z_CheckAllocs.php trunk/Z_CheckDebtorsControl.php trunk/Z_CheckGLTransBalance.php trunk/Z_ClearPOBackOrders.php trunk/Z_CreateChartDetails.php trunk/Z_CreateCompany.php trunk/Z_CreateCompanyTemplateFile.php trunk/Z_CurrencyDebtorsBalances.php trunk/Z_CurrencySuppliersBalances.php trunk/Z_DataExport.php trunk/Z_DeleteCreditNote.php trunk/Z_DeleteInvoice.php trunk/Z_DeleteOldPrices.php trunk/Z_DeleteSalesTransActions.php trunk/Z_DescribeTable.php trunk/Z_ImportChartOfAccounts.php trunk/Z_ImportDebtors.php trunk/Z_ImportFixedAssets.php trunk/Z_ImportGLAccountGroups.php trunk/Z_ImportGLAccountSections.php trunk/Z_ImportGLTransactions.php trunk/Z_ImportPartCodes.php trunk/Z_ImportPriceList.php trunk/Z_ImportStocks.php trunk/Z_ImportSuppliers.php trunk/Z_ItemsWithoutPicture.php trunk/Z_MakeLocUsers.php trunk/Z_MakeNewCompany.php trunk/Z_MakeStockLocns.php trunk/Z_ReApplyCostToSA.php trunk/Z_RePostGLFromPeriod.php trunk/Z_ReverseSuppPaymentRun.php trunk/Z_SalesIntegrityCheck.php trunk/Z_UpdateChartDetailsBFwd.php trunk/Z_UpdateSalesAnalysisWithLatestCustomerData.php trunk/Z_Upgrade3.10.php trunk/Z_Upgrade_3.01-3.02.php trunk/Z_Upgrade_3.04-3.05.php trunk/Z_Upgrade_3.05-3.06.php trunk/Z_Upgrade_3.07-3.08.php trunk/Z_Upgrade_3.08-3.09.php trunk/Z_Upgrade_3.09-3.10.php trunk/Z_Upgrade_3.10-3.11.php trunk/Z_Upgrade_3.11-4.00.php trunk/api/api_branches.php trunk/api/api_currencies.php trunk/api/api_customers.php trunk/api/api_customertypes.php trunk/api/api_debtortransactions.php trunk/api/api_glaccounts.php trunk/api/api_glgroups.php trunk/api/api_glsections.php trunk/api/api_holdreasons.php trunk/api/api_locations.php trunk/api/api_login.php trunk/api/api_paymentterms.php trunk/api/api_salesareas.php trunk/api/api_salesman.php trunk/api/api_salesorders.php trunk/api/api_salestypes.php trunk/api/api_session.inc trunk/api/api_shippers.php trunk/api/api_stock.php trunk/api/api_stockcategories.php trunk/api/api_suppliers.php trunk/api/api_taxgroups.php trunk/api/api_webERPsettings.php trunk/api/api_workorders.php trunk/doc/Change.log trunk/geo_displaymap_customers.php trunk/geo_displaymap_suppliers.php trunk/geocode.php trunk/geocode_genxml_customers.php trunk/geocode_genxml_suppliers.php trunk/includes/AccountSectionsDef.inc trunk/includes/Add_SerialItems.php trunk/includes/ConnectDB_mysql.inc trunk/includes/ConnectDB_mysqli.inc trunk/includes/ConnectDB_postgres.inc trunk/includes/ConstructSQLForUserDefinedSalesReport.inc trunk/includes/Contract_Readin.php trunk/includes/DateFunctions.inc trunk/includes/DefineCartClass.php trunk/includes/DefineContractClass.php trunk/includes/DefineOfferClass.php trunk/includes/DefineReceiptClass.php trunk/includes/DefineSerialItems.php trunk/includes/DefineShiptClass.php trunk/includes/DefineSuppTransClass.php trunk/includes/DefineTenderClass.php trunk/includes/EDIconfig.inc trunk/includes/FreightCalculation.inc trunk/includes/GLPostings.inc trunk/includes/GetConfig.php trunk/includes/GetPaymentMethods.php trunk/includes/GetPrice.inc trunk/includes/GetSalesTransGLCodes.inc trunk/includes/InputSerialItems.php trunk/includes/InputSerialItemsExisting.php trunk/includes/MiscFunctions.php trunk/includes/OutputSerialItems.php trunk/includes/PDFAgedDebtorsPageHeader.inc trunk/includes/PDFPaymentRun_PymtFooter.php trunk/includes/PDFTopItemsHeader.inc trunk/includes/PO_PDFOrderPageHeader.inc trunk/includes/PO_ReadInOrder.inc trunk/includes/SQL_CommonFunctions.inc trunk/includes/SelectOrderItems_IntoCart.inc trunk/includes/UserLogin.php trunk/includes/Z_POSDataCreation.php trunk/index.php trunk/locale/zh_CN.utf8/Manual/ManualAPIFunctions.php trunk/locale/zh_HK.utf8/Manual/ManualAPIFunctions.php trunk/reportwriter/FormMaker.php trunk/reportwriter/ReportMaker.php trunk/reportwriter/WriteForm.inc trunk/reportwriter/WriteReport.inc trunk/reportwriter/admin/RCFunctions.inc trunk/reportwriter/admin/ReportCreator.php trunk/reportwriter/install/ReportListForm.php trunk/reportwriter/install/ReportListLinks.php Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2014-10-25 19:25:12 UTC (rev 6940) +++ trunk/AccountGroups.php 2014-10-26 23:18:08 UTC (rev 6941) @@ -24,7 +24,7 @@ FROM accountgroups WHERE groupname='" . $GroupName ."'"; - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); + $result = DB_query($sql,$ErrMsg,$DbgMsg); $myrow = DB_fetch_row($result); if ($ParentGroupName == $myrow[0]){ return true; @@ -48,7 +48,7 @@ $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 move the account group was'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); + $result = DB_query($sql,$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'); } @@ -72,7 +72,7 @@ $DbgMsg = _('The SQL that was used to retrieve the information was'); $ErrMsg = _('Could not check whether the group exists because'); - $result=DB_query($sql, $db,$ErrMsg,$DbgMsg); + $result=DB_query($sql,$ErrMsg,$DbgMsg); $myrow=DB_fetch_row($result); if ($myrow[0] != 0 AND $_POST['SelectedAccountGroup'] == '') { @@ -109,7 +109,7 @@ $DbgMsg = _('The SQL that was used to retrieve the information was'); $ErrMsg = _('Could not check whether the group is recursive because'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); + $result = DB_query($sql,$ErrMsg,$DbgMsg); $ParentGroupRow = DB_fetch_array($result); $_POST['SequenceInTB'] = $ParentGroupRow['sequenceintb']; @@ -151,13 +151,13 @@ $ErrMsg = _('An error occurred in renaming the account group'); $DbgMsg = _('The SQL that was used to rename the account group was'); - $result = DB_query($sql, $db, $ErrMsg, $DbgMsg); + $result = DB_query($sql, $ErrMsg, $DbgMsg); $sql = "UPDATE accountgroups SET parentgroupname='" . $_POST['GroupName'] . "' WHERE parentgroupname='" . $_POST['SelectedAccountGroup'] . "'"; - $result = DB_query($sql, $db, $ErrMsg, $DbgMsg); + $result = DB_query($sql, $ErrMsg, $DbgMsg); DB_ReinstateForeignKeys($db); } @@ -194,7 +194,7 @@ if ($InputError!=1){ //run the SQL from either of the above possibilites - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); + $result = DB_query($sql,$ErrMsg,$DbgMsg); prnMsg($msg,'success'); unset ($_POST['SelectedAccountGroup']); unset ($_POST['GroupName']); @@ -208,7 +208,7 @@ $sql= "SELECT COUNT(group_) AS groups FROM chartmaster WHERE chartmaster.group_='" . $_GET['SelectedAccountGroup'] . "'"; $ErrMsg = _('An error occurred in retrieving the group information from chartmaster'); $DbgMsg = _('The SQL that was used to retrieve the information was'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); + $result = DB_query($sql,$ErrMsg,$DbgMsg); $myrow = DB_fetch_array($result); if ($myrow['groups']>0) { prnMsg( _('Cannot delete this account group because general ledger accounts have been created using this group'),'warn'); @@ -223,7 +223,7 @@ <td><select tabindex="2" ' . (in_array('ParentGroupName',$Errors) ? 'class="selecterror"' : '' ) . ' name="DestinyAccountGroup">'; $sql = "SELECT groupname FROM accountgroups"; - $GroupResult = DB_query($sql, $db,$ErrMsg,$DbgMsg); + $GroupResult = DB_query($sql,$ErrMsg,$DbgMsg); while ($GroupRow = DB_fetch_array($GroupResult) ) { if (isset($_POST['ParentGroupName']) AND $_POST['ParentGroupName']==$GroupRow['groupname']) { @@ -243,7 +243,7 @@ $sql = "SELECT COUNT(groupname) groupnames FROM accountgroups WHERE parentgroupname = '" . $_GET['SelectedAccountGroup'] . "'"; $ErrMsg = _('An error occurred in retrieving the parent group information'); $DbgMsg = _('The SQL that was used to retrieve the information was'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); + $result = DB_query($sql,$ErrMsg,$DbgMsg); $myrow = DB_fetch_array($result); if ($myrow['groupnames']>0) { prnMsg( _('Cannot delete this account group because it is a parent account group of other account group(s)'),'warn'); @@ -253,7 +253,7 @@ $sql="DELETE FROM accountgroups WHERE groupname='" . $_GET['SelectedAccountGroup'] . "'"; $ErrMsg = _('An error occurred in deleting the account group'); $DbgMsg = _('The SQL that was used to delete the account group was'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); + $result = DB_query($sql,$ErrMsg,$DbgMsg); prnMsg( $_GET['SelectedAccountGroup'] . ' ' . _('group has been deleted') . '!','success'); } @@ -281,7 +281,7 @@ $DbgMsg = _('The sql that was used to retrieve the account group information was '); $ErrMsg = _('Could not get account groups because'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); + $result = DB_query($sql,$ErrMsg,$DbgMsg); echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme.'/images/maintenance.png" title="' . _('Search') . '" />' . ' ' . $Title . '</p><br />'; echo '<table class="selection"> @@ -353,7 +353,7 @@ $ErrMsg = _('An error occurred in retrieving the account group information'); $DbgMsg = _('The SQL that was used to retrieve the account group and that failed in the process was'); - $result = DB_query($sql, $db,$ErrMsg,$DbgMsg); + $result = DB_query($sql,$ErrMsg,$DbgMsg); if (DB_num_rows($result) == 0) { prnMsg( _('The account group name does not exist in the database'),'error'); include('includes/footer.inc'); @@ -408,7 +408,7 @@ <td><select tabindex="2" ' . (in_array('ParentGroupName',$Errors) ? 'class="selecterror"' : '' ) . ' name="ParentGroupName">'; $sql = "SELECT groupname FROM accountgroups"; - $groupresult = DB_query($sql, $db,$ErrMsg,$DbgMsg); + $groupresult = DB_query($sql,$ErrMsg,$DbgMsg); if (!isset($_POST['ParentGroupName'])){ echo '<option selected="selected" value="">' ._('Top Level Group') . '</option>'; } else { @@ -430,7 +430,7 @@ <td><select tabindex="3" ' . (in_array('SectionInAccounts',$Errors) ? 'class="selecterror"' : '' ) . ' name="SectionInAccounts">'; $sql = "SELECT sectionid, sectionname FROM accountsection ORDER BY sectionid"; - $secresult = DB_query($sql, $db,$ErrMsg,$DbgMsg); + $secresult = DB_query($sql,$ErrMsg,$DbgMsg); while( $secrow = DB_fetch_array($secresult) ) { if ($_POST['SectionInAccounts']==$secrow['sectionid']) { echo '<option selected="selected" value="'.$secrow['sectionid'].'">' . $secrow['sectionname'].' ('.$secrow['sectionid'].')</option>'; Modified: trunk/AccountSections.php =================================================================== --- trunk/AccountSections.php 2014-10-25 19:25:12 UTC (rev 6940) +++ trunk/AccountSections.php 2014-10-26 23:18:08 UTC (rev 6941) @@ -10,25 +10,25 @@ // SOME TEST TO ENSURE THAT AT LEAST INCOME AND COST OF SALES ARE THERE $sql= "SELECT sectionid FROM accountsection WHERE sectionid=1"; - $result = DB_query($sql,$db); + $result = DB_query($sql); if( DB_num_rows($result) == 0 ) { $sql = "INSERT INTO accountsection (sectionid, sectionname) VALUES (1, 'Income')"; - $result = DB_query($sql,$db); + $result = DB_query($sql); } $sql= "SELECT sectionid FROM accountsection WHERE sectionid=2"; - $result = DB_query($sql,$db); + $result = DB_query($sql); if( DB_num_rows($result) == 0 ) { $sql = "INSERT INTO accountsection (sectionid, sectionname) VALUES (2, 'Cost Of Sales')"; - $result = DB_query($sql,$db); + $result = DB_query($sql); } // DONE WITH MINIMUM TESTS @@ -54,7 +54,7 @@ $sql="SELECT sectionid FROM accountsection WHERE sectionid='".$_POST['SectionID']."'"; - $result=DB_query($sql, $db); + $result=DB_query($sql); if ((DB_num_rows($result)!=0 AND !isset($_POST['SelectedSectionID']))) { $InputError = 1; @@ -110,7 +110,7 @@ if ($InputError!=1){ //run the SQL from either of the above possibilites - $result = DB_query($sql,$db); + $result = DB_query($sql); prnMsg($msg,'success'); unset ($_POST['SelectedSectionID']); unset ($_POST['SectionID']); @@ -122,7 +122,7 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'accountgroups' $sql= "SELECT COUNT(sectioninaccounts) AS sections FROM accountgroups WHERE sectioninaccounts='" . $_GET['SelectedSectionID'] . "'"; - $result = DB_query($sql,$db); + $result = DB_query($sql); $myrow = DB_fetch_array($result); if ($myrow['sections']>0) { prnMsg( _('Cannot delete this account section because general ledger accounts groups have been created using this section'),'warn'); @@ -133,12 +133,12 @@ } else { //Fetch section name $sql = "SELECT sectionname FROM accountsection WHERE sectionid='".$_GET['SelectedSectionID'] . "'"; - $result = DB_query($sql,$db); + $result = DB_query($sql); $myrow = DB_fetch_array($result); $SectionName = $myrow['sectionname']; $sql="DELETE FROM accountsection WHERE sectionid='" . $_GET['SelectedSectionID'] . "'"; - $result = DB_query($sql,$db); + $result = DB_query($sql); prnMsg( $SectionName . ' ' . _('section has been deleted') . '!','success'); } //end if account group used in GL accounts @@ -165,7 +165,7 @@ ORDER BY sectionid"; $ErrMsg = _('Could not get account group sections because'); - $result = DB_query($sql,$db,$ErrMsg); + $result = DB_query($sql,$ErrMsg); echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme.'/images/maintenance.png" title="' . _('Search') . '" />' . ' ' . $Title . '</p><br />'; echo '<table class="selection"> @@ -218,7 +218,7 @@ FROM accountsection WHERE sectionid='" . $_GET['SelectedSectionID'] ."'"; - $result = DB_query($sql, $db); + $result = DB_query($sql); if ( DB_num_rows($result) == 0 ) { prnMsg( _('Could not retrieve the requested section please try again.'),'warn'); unset($_GET['SelectedSectionID']); Modified: trunk/AddCustomerContacts.php =================================================================== --- trunk/AddCustomerContacts.php 2014-10-25 19:25:12 UTC (rev 6940) +++ trunk/AddCustomerContacts.php 2014-10-26 23:18:08 UTC (rev 6941) @@ -19,7 +19,7 @@ } echo '<a href="' . $RootPath . '/Customers.php?DebtorNo=' . $DebtorNo . '">' . _('Back to Customers') . '</a><br />'; $SQLname="SELECT name FROM debtorsmaster WHERE debtorno='" . $DebtorNo . "'"; -$Result = DB_query($SQLname,$db); +$Result = DB_query($SQLname); $row = DB_fetch_array($Result); if (!isset($_GET['Id'])) { echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Contacts for Customer') . ': <b>' . htmlspecialchars($row['name'], ENT_QUOTES, 'UTF-8') . '</b></p><br />'; @@ -75,7 +75,7 @@ } if ($InputError !=1) { - $result = DB_query($sql,$db); + $result = DB_query($sql); //echo '<br />' . $sql; echo '<br />'; @@ -97,7 +97,7 @@ $sql="DELETE FROM custcontacts WHERE contid='" . $Id . "' AND debtorno='" . $DebtorNo . "'"; - $result = DB_query($sql,$db); + $result = DB_query($sql); echo '<br />'; prnMsg( _('The contact record has been deleted'), 'success'); @@ -118,7 +118,7 @@ FROM custcontacts WHERE debtorno='".$DebtorNo."' ORDER BY contid"; - $result = DB_query($sql,$db); + $result = DB_query($sql); //echo '<br />' . $sql; echo '<table class="selection">'; @@ -187,7 +187,7 @@ WHERE contid='".$Id."' AND debtorno='".$DebtorNo."'"; - $result = DB_query($sql, $db); + $result = DB_query($sql); $myrow = DB_fetch_array($result); $_POST['Con_ID'] = $myrow['contid']; Modified: trunk/AddCustomerNotes.php =================================================================== --- trunk/AddCustomerNotes.php 2014-10-25 19:25:12 UTC (rev 6940) +++ trunk/AddCustomerNotes.php 2014-10-26 23:18:08 UTC (rev 6941) @@ -65,7 +65,7 @@ } if ($InputError !=1) { - $result = DB_query($sql,$db); + $result = DB_query($sql); //echo '<br />' . $sql; echo '<br />'; @@ -85,7 +85,7 @@ $sql="DELETE FROM custnotes WHERE noteid='".$Id."' AND debtorno='".$DebtorNo."'"; - $result = DB_query($sql,$db); + $result = DB_query($sql); echo '<br />'; prnMsg( _('The contact note record has been deleted'), 'success'); @@ -96,7 +96,7 @@ if (!isset($Id)) { $SQLname="SELECT * FROM debtorsmaster WHERE debtorno='".$DebtorNo."'"; - $Result = DB_query($SQLname,$db); + $Result = DB_query($SQLname); $row = DB_fetch_array($Result); echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . _('Notes for Customer').': <b>' .$row['name'] . '</b></p> <br />'; @@ -110,7 +110,7 @@ FROM custnotes WHERE debtorno='".$DebtorNo."' ORDER BY date DESC"; - $result = DB_query($sql,$db); + $result = DB_query($sql); echo '<table class="selection"> <tr> @@ -178,7 +178,7 @@ WHERE noteid='".$Id."' AND debtorno='".$DebtorNo."'"; - $result = DB_query($sql, $db); + $result = DB_query($sql); $myrow = DB_fetch_array($result); Modified: trunk/AddCustomerTypeNotes.php =================================================================== --- trunk/AddCustomerTypeNotes.php 2014-10-25 19:25:12 UTC (rev 6940) +++ trunk/AddCustomerTypeNotes.php 2014-10-26 23:18:08 UTC (rev 6941) @@ -62,7 +62,7 @@ } if ($InputError !=1) { - $result = DB_query($sql,$db); + $result = DB_query($sql); echo '<br />'; prnMsg($msg, 'success'); @@ -78,7 +78,7 @@ $sql="DELETE FROM debtortypenotes WHERE noteid='".$Id."' AND typeid='".$DebtorType."'"; - $result = DB_query($sql,$db); + $result = DB_query($sql); echo '<br />'; prnMsg( _('The contact group note record has been deleted'), 'success'); @@ -89,7 +89,7 @@ if (!isset($Id)) { $SQLname="SELECT typename from debtortype where typeid='".$DebtorType."'"; - $result = DB_query($SQLname,$db); + $result = DB_query($SQLname); $myrow = DB_fetch_array($result); echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/customer.png" title="' . _('Search') . '" alt="" />' . _('Notes for Customer Type').': <b>' .$myrow['typename'] . '</b></p> <br />'; @@ -103,7 +103,7 @@ FROM debtortypenotes WHERE typeid='".$DebtorType."' ORDER BY date DESC"; - $result = DB_query($sql,$db); + $result = DB_query($sql); //echo '<br />' . $sql; echo '<table class="selection">'; @@ -170,7 +170,7 @@ WHERE noteid=".$Id." AND typeid='".$DebtorType."'"; - $result = DB_query($sql, $db); + $result = DB_query($sql); //echo '<br />' . $sql; $myrow = DB_fetch_array($result); Modified: trunk/AgedControlledInventory.php =================================================================== --- trunk/AgedControlledInventory.php 2014-10-25 19:25:12 UTC (rev 6940) +++ trunk/AgedControlledInventory.php 2014-10-26 23:18:08 UTC (rev 6941) @@ -30,7 +30,7 @@ ORDER BY trandate"; $ErrMsg = _('The stock held could not be retrieved because'); -$LocStockResult = DB_query($sql, $db, $ErrMsg); +$LocStockResult = DB_query($sql, $ErrMsg); $NumRows = DB_num_rows($LocStockResult, $db); $j = 1; Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2014-10-25 19:25:12 UTC (rev 6940) +++ trunk/AgedDebtors.php 2014-10-26 23:18:08 UTC (rev 6941) @@ -261,7 +261,7 @@ debtortrans.ovdiscount - debtortrans.alloc)) >0.005"; } - $CustomerResult = DB_query($SQL,$db,'','',False,False); /*dont trap errors handled below*/ + $CustomerResult = DB_query($SQL,'','',False,False); /*dont trap errors handled below*/ if (DB_error_no($db) !=0) { $Title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '.... '; @@ -364,7 +364,7 @@ $sql .= " AND debtortrans.salesperson='" . $_SESSION['SalesmanLogin'] . "'"; } - $DetailResult = DB_query($sql,$db,'','',False,False); /*Dont trap errors */ + $DetailResult = DB_query($sql,'','',False,False); /*Dont trap errors */ if (DB_error_no($db) !=0) { $Title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); @@ -489,7 +489,7 @@ $sql = "SELECT salesmancode, salesmanname FROM sal... [truncated message content] |
From: <dai...@us...> - 2014-10-27 02:48:36
|
Revision: 6942 http://sourceforge.net/p/web-erp/reponame/6942 Author: daintree Date: 2014-10-27 02:48:29 +0000 (Mon, 27 Oct 2014) Log Message: ----------- continue removing $db from DB_query calls Modified Paths: -------------- trunk/BOMInquiry.php trunk/BOMs.php trunk/BankAccounts.php trunk/BankMatching.php trunk/CompanyPreferences.php trunk/ConfirmDispatch_Invoice.php trunk/ContractCosting.php trunk/Contracts.php trunk/CounterReturns.php trunk/CounterSales.php trunk/CustItem.php trunk/Customers.php trunk/Dashboard.php trunk/DeliveryDetails.php trunk/DiscountCategories.php trunk/EDIProcessOrders.php trunk/FixedAssetDepreciation.php trunk/FixedAssetItems.php trunk/GLAccountInquiry.php trunk/GLAccountReport.php trunk/GLTrialBalance.php trunk/GoodsReceived.php trunk/ImportBankTrans.php trunk/ImportBankTransAnalysis.php trunk/InternalStockRequestAuthorisation.php trunk/Labels.php trunk/Locations.php trunk/MRPCreateDemands.php trunk/NoSalesItems.php trunk/PDFPrintLabel.php trunk/PDFWOPrint.php trunk/PO_Header.php trunk/PO_Items.php trunk/Payments.php trunk/PcReportTab.php trunk/Prices.php trunk/PricesBasedOnMarkUp.php trunk/Prices_Customer.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/PurchData.php trunk/RelatedItemsUpdate.php trunk/SelectCompletedOrder.php trunk/SelectOrderItems.php trunk/SelectProduct.php trunk/SelectSalesOrder.php trunk/ShipmentCosting.php trunk/ShopParameters.php trunk/StockAdjustments.php trunk/StockClone.php trunk/StockCostUpdate.php trunk/StockCounts.php trunk/StockLocTransfer.php trunk/StockSerialItems.php trunk/StockStatus.php trunk/StockTransfers.php trunk/StockUsage.php trunk/Stocks.php trunk/SuppContractChgs.php trunk/SuppLoginSetup.php trunk/SupplierCredit.php trunk/SupplierInvoice.php trunk/SupplierTransInquiry.php trunk/TaxAuthorityRates.php trunk/TaxGroups.php trunk/WOSerialNos.php trunk/WhereUsedInquiry.php trunk/WorkOrderCosting.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/WorkOrderReceive.php trunk/WorkOrderStatus.php trunk/Z_ChangeBranchCode.php trunk/Z_ChangeSupplierCode.php trunk/Z_CreateCompanyTemplateFile.php trunk/Z_Upgrade_3.01-3.02.php trunk/api/api_debtortransactions.php trunk/api/api_login.php trunk/api/api_salesorders.php trunk/includes/ConnectDB_postgres.inc trunk/includes/DefineCartClass.php trunk/includes/DefineContractClass.php trunk/includes/DefineSuppTransClass.php trunk/includes/GetSalesTransGLCodes.inc trunk/includes/SQL_CommonFunctions.inc trunk/includes/Z_POSDataCreation.php Modified: trunk/BOMInquiry.php =================================================================== --- trunk/BOMInquiry.php 2014-10-26 23:18:08 UTC (rev 6941) +++ trunk/BOMInquiry.php 2014-10-27 02:48:29 UTC (rev 6942) @@ -157,8 +157,7 @@ labourcost, overheadcost FROM stockmaster - WHERE stockid='" . $StockID . "'", - $db); + WHERE stockid='" . $StockID . "'"); $myrow = DB_fetch_array($result); $ParentLabourCost = $myrow['labourcost']; $ParentOverheadCost = $myrow['overheadcost']; @@ -174,9 +173,9 @@ ON bom.component = stockmaster.stockid WHERE bom.parent = '" . $StockID . "' AND bom.effectiveafter < '" . Date('Y-m-d') . "' - AND (bom.effectiveto > '" . Date('Y-m-d') . "' + AND (bom.effectiveto > '" . Date('Y-m-d') . "' OR bom.effectiveto='0000-00-00')"; - + $ErrMsg = _('The bill of material could not be retrieved because'); $BOMResult = DB_query ($sql,$ErrMsg); Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2014-10-26 23:18:08 UTC (rev 6941) +++ trunk/BOMs.php 2014-10-27 02:48:29 UTC (rev 6942) @@ -17,7 +17,9 @@ // retrive all children of parent $c_result = DB_query("SELECT parent, component - FROM bom WHERE parent='" . $Parent. "' ORDER BY sequence ASC" ,$db); + FROM bom + WHERE parent='" . $Parent. "' + ORDER BY sequence ASC"); if (DB_num_rows($c_result) > 0) { while ($row = DB_fetch_array($c_result)) { @@ -465,7 +467,7 @@ echo '<table class="selection">'; echo '<tr><td><div class="centre">' . _('Manufactured parent items').' : '; while ($myrow = DB_fetch_array($result)){ - echo (($ix)?', ':'') . '<a href="'.htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Select='.$myrow['parent'].'">' . + echo (($ix)?', ':'') . '<a href="'.htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Select='.$myrow['parent'].'">' . $myrow['description'].' ('.$myrow['parent'].')</a>'; $ix++; } //end while loop @@ -489,7 +491,7 @@ echo '<tr><td><div class="centre">' . _('Assembly parent items').' : '; $ix = 0; while ($myrow = DB_fetch_array($result)){ - echo (($ix)?', ':'') . '<a href="'.htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Select='.$myrow['parent'].'">' . + echo (($ix)?', ':'') . '<a href="'.htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Select='.$myrow['parent'].'">' . $myrow['description'].' ('.$myrow['parent'].')</a>'; $ix++; } //end while loop @@ -514,7 +516,7 @@ echo '<tr><td><div class="centre">' . _('Kit sets').' : '; $ix = 0; while ($myrow = DB_fetch_array($result)){ - echo (($ix)?', ':'') . '<a href="'.htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Select='.$myrow['parent'].'">' . + echo (($ix)?', ':'') . '<a href="'.htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Select='.$myrow['parent'].'">' . $myrow['description'].' ('.$myrow['parent'].')</a>'; $ix++; } //end while loop @@ -700,18 +702,18 @@ <td>' . _('Sequence in BOM') . ':</td> <td><input type="text" class="integer" required="required" size="5" name="Sequence" value="' . $_POST['Sequence'] . '" /></td> </tr>'; - + echo '<tr> <td>' . _('Location') . ': </td> <td><select tabindex="2" name="LocCode">'; DB_free_result($result); - $sql = "SELECT locationname, - locations.loccode - FROM locations - INNER JOIN locationusers - ON locationusers.loccode=locations.loccode - AND locationusers.userid='" . $_SESSION['UserID'] . "' + $sql = "SELECT locationname, + locations.loccode + FROM locations + INNER JOIN locationusers + ON locationusers.loccode=locations.loccode + AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 WHERE locations.usedforwo = 1"; $result = DB_query($sql); Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2014-10-26 23:18:08 UTC (rev 6941) +++ trunk/BankAccounts.php 2014-10-27 02:48:29 UTC (rev 6942) @@ -380,7 +380,7 @@ } $result = DB_query("SELECT currabrev, currency - FROM currencies",$db); + FROM currencies"); while ($myrow = DB_fetch_array($result)) { if ($myrow['currabrev']==$_POST['CurrCode']) { Modified: trunk/BankMatching.php =================================================================== --- trunk/BankMatching.php 2014-10-26 23:18:08 UTC (rev 6941) +++ trunk/BankMatching.php 2014-10-27 02:48:29 UTC (rev 6942) @@ -202,8 +202,7 @@ currcode FROM bankaccounts INNER JOIN currencies ON bankaccounts.currcode=currencies.currabrev - WHERE accountcode='" . $_POST['BankAccount'] . "'", - $db); + WHERE accountcode='" . $_POST['BankAccount'] . "'"); $BankRow = DB_fetch_array($BankResult); $CurrDecimalPlaces = $BankRow['decimalplaces']; $CurrCode = $BankRow['currcode']; Modified: trunk/CompanyPreferences.php =================================================================== --- trunk/CompanyPreferences.php 2014-10-26 23:18:08 UTC (rev 6941) +++ trunk/CompanyPreferences.php 2014-10-27 02:48:29 UTC (rev 6942) @@ -255,8 +255,7 @@ FROM chartmaster INNER JOIN accountgroups ON chartmaster.group_=accountgroups.groupname WHERE accountgroups.pandl=0 - ORDER BY chartmaster.accountcode", - $db); + ORDER BY chartmaster.accountcode"); echo '<tr> <td>' . _('Debtors Control GL Account') . ':</td> @@ -351,8 +350,7 @@ FROM chartmaster INNER JOIN accountgroups ON chartmaster.group_=accountgroups.groupname WHERE accountgroups.pandl=1 - ORDER BY chartmaster.accountcode", - $db); + ORDER BY chartmaster.accountcode"); while ($myrow = DB_fetch_row($result)) { if ($_POST['FreightAct']==$myrow[0]){ Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2014-10-26 23:18:08 UTC (rev 6941) +++ trunk/ConfirmDispatch_Invoice.php 2014-10-27 02:48:29 UTC (rev 6942) @@ -948,7 +948,8 @@ need the MBFlag later too so save it to $MBFlag */ $Result = DB_query("SELECT mbflag FROM stockmaster - WHERE stockid = '" . $OrderLine->StockID . "'",$db, _('Cannot retrieve the mbflag')); + WHERE stockid = '" . $OrderLine->StockID . "'", + _('Cannot retrieve the mbflag')); $myrow = DB_fetch_row($Result); $MBFlag = $myrow[0]; @@ -1000,7 +1001,7 @@ $DbgMsg = _('The SQL that failed was'); $AssResult = DB_query($SQL,$ErrMsg,$DbgMsg,true); - while ($AssParts = DB_fetch_array($AssResult,$db)){ + while ($AssParts = DB_fetch_array($AssResult)){ $StandardCost += ($AssParts['standard'] * $AssParts['quantity']) ; /* Need to get the current location quantity Modified: trunk/ContractCosting.php =================================================================== --- trunk/ContractCosting.php 2014-10-26 23:18:08 UTC (rev 6941) +++ trunk/ContractCosting.php 2014-10-27 02:48:29 UTC (rev 6942) @@ -288,15 +288,13 @@ /*Check if the contract work order is still open */ $CheckIfWOOpenResult = DB_query("SELECT closed FROM workorders - WHERE wo='" . $_SESSION['Contract'.$identifier]->WO . "'", - $db); + WHERE wo='" . $_SESSION['Contract'.$identifier]->WO . "'"); $CheckWORow=DB_fetch_row($CheckIfWOOpenResult); if ($CheckWORow[0]==0){ //then close the work order $CloseWOResult =DB_query("UPDATE workorders SET closed=1 WHERE wo='" . $_SESSION['Contract'.$identifier]->WO . "'", - $db, _('Could not update the work order to closed because:'), _('The SQL used to close the work order was:'), true); @@ -309,8 +307,7 @@ $result =DB_query("SELECT qtyrecd FROM woitems WHERE stockid='" . $_SESSION['Contract'.$identifier]->ContractRef . "' - AND wo='" . $_SESSION['Contract'.$identifier]->WO . "'", - $db); + AND wo='" . $_SESSION['Contract'.$identifier]->WO . "'"); if (DB_num_rows($result)==1) { $myrow=DB_fetch_row($result); if ($myrow[0]==0){ //then the contract wo has not been received (it will only ever be for 1 item) @@ -428,7 +425,9 @@ SET qtyrecd=qtyrecd+1 WHERE wo='" . $_SESSION['Contract'.$identifier]->WO . "' AND stockid='" . $_SESSION['Contract'.$identifier]->ContractRef . "'", - $db,$ErrMsg,$DbgMsg,true); + $ErrMsg, + $DbgMsg, + true); }//end if the contract wo was not received - work order item received/processed above if not }//end if there was a row returned from the woitems query } //end if the work order was still open (so end of closing it and processing receipt if necessary) Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2014-10-26 23:18:08 UTC (rev 6941) +++ trunk/Contracts.php 2014-10-27 02:48:29 UTC (rev 6942) @@ -21,7 +21,7 @@ $_POST['SelectedCustomer']=$_POST['SelectedCustomer'.$Index]; $_POST['SelectedBranch']=$_POST['SelectedBranch'.$Index]; } -} +} $ViewTopic= 'Contracts'; $BookMark = 'CreateContract'; @@ -283,7 +283,7 @@ VALUES ('" . $_SESSION['Contract'.$identifier]->LocCode . "', '" . $_SESSION['Contract'.$identifier]->LocCode . "', '" . _('Default for') . ' ' . $_SESSION['Contract'.$identifier]->LocCode . "', - '1')",$db); + '1')"); $WorkCentre = $_SESSION['Contract'.$identifier]->LocCode; } /*The above is a bit of a hack to get a default workcentre for a location based on the users default location*/ Modified: trunk/CounterReturns.php =================================================================== --- trunk/CounterReturns.php 2014-10-26 23:18:08 UTC (rev 6941) +++ trunk/CounterReturns.php 2014-10-27 02:48:29 UTC (rev 6942) @@ -1495,7 +1495,7 @@ $result = DB_query("SELECT rate FROM currencies INNER JOIN bankaccounts ON currencies.currabrev=bankaccounts.currcode - WHERE bankaccounts.accountcode='" . $_POST['BankAccount'] . "'",$db); + WHERE bankaccounts.accountcode='" . $_POST['BankAccount'] . "'"); $myrow = DB_fetch_row($result); $BankAccountExRate = $myrow[0]; Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2014-10-26 23:18:08 UTC (rev 6941) +++ trunk/CounterSales.php 2014-10-27 02:48:29 UTC (rev 6942) @@ -463,7 +463,7 @@ $KitResult = DB_query($sql,$ErrMsg,$DbgMsg); $ParentQty = $NewItemQty; - while ($KitParts = DB_fetch_array($KitResult,$db)) { + while ($KitParts = DB_fetch_array($KitResult)) { $NewItem = $KitParts['component']; $NewItemQty = $KitParts['quantity'] * $ParentQty; $NewPOLine = 0; @@ -574,7 +574,7 @@ $KitResult = DB_query($sql,$ErrMsg); $ParentQty = $NewItemQty; - while ($KitParts = DB_fetch_array($KitResult,$db)){ + while ($KitParts = DB_fetch_array($KitResult)){ $NewItem = $KitParts['component']; $NewItemQty = $KitParts['quantity'] * $ParentQty; $NewPOLine = 0; @@ -624,7 +624,7 @@ $KitResult = DB_query($sql,$ErrMsg); $ParentQty = $NewItemQty; - while ($KitParts = DB_fetch_array($KitResult,$db)){ + while ($KitParts = DB_fetch_array($KitResult)){ $NewItem = $KitParts['component']; $NewItemQty = $KitParts['quantity'] * $ParentQty; $NewPOLine = 0; @@ -676,7 +676,7 @@ $KitResult = DB_query($sql,$ErrMsg); $ParentQty = $NewItemQty; - while ($KitParts = DB_fetch_array($KitResult,$db)){ + while ($KitParts = DB_fetch_array($KitResult)){ $NewItem = $KitParts['component']; $NewItemQty = $KitParts['quantity'] * $ParentQty; $NewItemDue = date($_SESSION['DefaultDateFormat']); @@ -715,7 +715,7 @@ FROM discountmatrix WHERE salestype='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "' AND discountcategory ='" . $OrderLine->DiscCat . "' - AND quantitybreak <= '" . $QuantityOfDiscCat ."'",$db); + AND quantitybreak <= '" . $QuantityOfDiscCat ."'"); $myrow = DB_fetch_row($result); if ($myrow[0]==NULL){ $DiscountMatrixRate = 0; @@ -1209,14 +1209,15 @@ '" . $_SESSION['DefaultFactoryLocation'] . "', '" . Date('Y-m-d') . "', '" . Date('Y-m-d'). "')", - $db,$ErrMsg,$DbgMsg,true); + $ErrMsg, + $DbgMsg, + true); //Need to get the latest BOM to roll up cost $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*bom.quantity) AS cost FROM stockmaster INNER JOIN bom ON stockmaster.stockid=bom.component WHERE bom.parent='" . $StockItem->StockID . "' - AND bom.loccode='" . $_SESSION['DefaultFactoryLocation'] . "'", - $db); + AND bom.loccode='" . $_SESSION['DefaultFactoryLocation'] . "'"); $CostRow = DB_fetch_row($CostResult); if (is_null($CostRow[0]) OR $CostRow[0]==0){ $Cost =0; @@ -1252,7 +1253,7 @@ $result = DB_query("SELECT serialno FROM stockserialitems WHERE serialno='" . ($StockItem->NextSerialNo + $i) . "' - AND stockid='" . $StockItem->StockID ."'",$db); + AND stockid='" . $StockItem->StockID ."'"); if (DB_num_rows($result)!=0){ $WOQuantity++; prnMsg(($StockItem->NextSerialNo + $i) . ': ' . _('This automatically generated serial number already exists - it cannot be added to the work order'),'error'); @@ -1424,7 +1425,7 @@ $DbgMsg = _('The SQL that failed was'); $AssResult = DB_query($SQL,$ErrMsg,$DbgMsg,true); - while ($AssParts = DB_fetch_array($AssResult,$db)){ + while ($AssParts = DB_fetch_array($AssResult)){ $StandardCost += ($AssParts['standard'] * $AssParts['quantity']) ; /* Need to get the current location quantity @@ -1932,7 +1933,7 @@ $result = DB_query("SELECT rate FROM currencies INNER JOIN bankaccounts ON currencies.currabrev=bankaccounts.currcode - WHERE bankaccounts.accountcode='" . $_POST['BankAccount'] . "'",$db); + WHERE bankaccounts.accountcode='" . $_POST['BankAccount'] . "'"); $myrow = DB_fetch_row($result); $BankAccountExRate = $myrow[0]; Modified: trunk/CustItem.php =================================================================== --- trunk/CustItem.php 2014-10-26 23:18:08 UTC (rev 6941) +++ trunk/CustItem.php 2014-10-27 02:48:29 UTC (rev 6942) @@ -49,7 +49,7 @@ $InputError = 1; prnMsg(_('There is no stock item set up enter the stock code or select a stock item using the search page'), 'error'); } - + if (!is_numeric(filter_number_format($_POST['ConversionFactor']))) { $InputError = 1; unset($_POST['ConversionFactor']); @@ -90,7 +90,7 @@ unset($debtorsmasterResult); unset($DebtorNo); } - + if ($InputError == 0 AND isset($_POST['AddRecord'])) { /* insert took place and need to clear the form */ unset($DebtorNo); @@ -98,7 +98,7 @@ unset($_POST['ConversionFactor']); unset($_POST['cust_description']); unset($_POST['cust_part']); - + } } @@ -118,7 +118,7 @@ $ItemResult = DB_query("SELECT description FROM stockmaster WHERE stockid='" . $StockID . "'"); $DescriptionRow = DB_fetch_array($ItemResult); echo '<p class="page_title_text"><img src="' . $RootPath . '/css/' . $Theme . '/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $Title . ' ' . _('For Stock Code') . ' - ' . $StockID . ' - ' . $DescriptionRow['description'] . '</p><br />'; - + $sql = "SELECT custitem.debtorno, debtorsmaster.name, debtorsmaster.currcode, @@ -138,7 +138,7 @@ prnMsg(_('There is no customer data set up for the part selected'), 'info'); $NoCustItemData=1; } else if ($StockID != '') { - + echo '<table cellpadding="2" class="selection">'; $TableHeader = '<tr> <th class="ascending">' . _('Customer') . '</th> @@ -185,7 +185,7 @@ if (isset($DebtorNo) AND $DebtorNo != '' AND !isset($_POST['Searchcustomer'])) { /*NOT EDITING AN EXISTING BUT customer selected OR ENTERED*/ - + $sql = "SELECT debtorsmaster.name, debtorsmaster.currcode, currencies.decimalplaces AS currdecimalplaces @@ -280,7 +280,7 @@ stockmaster.units, stockmaster.mbflag FROM stockmaster - WHERE stockmaster.stockid='".$StockID."'", $db); + WHERE stockmaster.stockid='".$StockID."'"); $myrow = DB_fetch_row($result); $StockUOM = $myrow[1]; if (DB_num_rows($result) <> 1) { @@ -357,12 +357,12 @@ ON debtorsmaster.currcode = currencies.currabrev WHERE custitem.debtorno='" . $DebtorNo . "' AND custitem.stockid='" . $StockID . "'"; - + $ErrMsg = _('The customer purchasing details for the selected customer and item could not be retrieved because'); $EditResult = DB_query($sql, $ErrMsg); $myrow = DB_fetch_array($EditResult); $name = $myrow['name']; - + $CurrCode = $myrow['currcode']; $CurrDecimalPlaces = $myrow['currdecimalplaces']; $_POST['customersUOM'] = $myrow['customersUOM']; @@ -401,7 +401,7 @@ if (!isset($CurrCode)) { $CurrCode = ''; } - + if (!isset($_POST['customersUOM'])) { $_POST['customersUOM'] = ''; } @@ -443,11 +443,11 @@ <td><input type="text" name="cust_description" maxlength="30" size="30" value="' . $_POST['cust_description'] . '" /></td> </tr>'; - + echo '</table> <br /> <div class="centre">'; - + if ($Edit == true) { echo '<input type="submit" name="UpdateRecord" value="' . _('Update') . '" />'; echo '<input type="hidden" name="Edit" value="1" />'; @@ -457,7 +457,7 @@ echo '</div> <div class="centre">'; - + if (isset($StockLocation) AND isset($StockID) AND mb_strlen($StockID) != 0) { echo '<br /><a href="' . $RootPath . '/StockStatus.php?StockID=' . $StockID . '">' . _('Show Stock Status') . '</a>'; echo '<br /><a href="' . $RootPath . '/StockMovements.php?StockID=' . $StockID . '&StockLocation=' . $StockLocation . '">' . _('Show Stock Movements') . '</a>'; Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2014-10-26 23:18:08 UTC (rev 6941) +++ trunk/Customers.php 2014-10-27 02:48:29 UTC (rev 6942) @@ -1096,8 +1096,7 @@ /*Process this first before showing remaining contacts */ $resultupcc = DB_query("DELETE FROM custcontacts WHERE debtorno='".$DebtorNo."' - AND contid='".$ID."'", - $db); + AND contid='".$ID."'"); prnMsg(_('Contact Deleted'),'success'); } Modified: trunk/Dashboard.php =================================================================== --- trunk/Dashboard.php 2014-10-26 23:18:08 UTC (rev 6941) +++ trunk/Dashboard.php 2014-10-27 02:48:29 UTC (rev 6942) @@ -545,7 +545,7 @@ $result = DB_query("SELECT pandl FROM accountgroups INNER JOIN chartmaster ON accountgroups.groupname=chartmaster.group_ - WHERE chartmaster.accountcode='" . $myrow['accountcode'] ."'",$db); + WHERE chartmaster.accountcode='" . $myrow['accountcode'] ."'"); $PandLRow = DB_fetch_row($result); if ($PandLRow[0]==1){ $PandLAccount = True; Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2014-10-26 23:18:08 UTC (rev 6941) +++ trunk/DeliveryDetails.php 2014-10-27 02:48:29 UTC (rev 6942) @@ -503,14 +503,15 @@ '" . $_SESSION['DefaultFactoryLocation'] . "', '" . Date('Y-m-d') . "', '" . Date('Y-m-d'). "')", - $db,$ErrMsg,$DbgMsg,true); + $ErrMsg, + $DbgMsg, + true); //Need to get the latest BOM to roll up cost $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*bom.quantity) AS cost FROM stockmaster INNER JOIN bom ON stockmaster.stockid=bom.component WHERE bom.parent='" . $StockItem->StockID . "' - AND bom.loccode='" . $_SESSION['DefaultFactoryLocation'] . "'", - $db); + AND bom.loccode='" . $_SESSION['DefaultFactoryLocation'] . "'"); $CostRow = DB_fetch_row($CostResult); if (is_null($CostRow[0]) OR $CostRow[0]==0){ $Cost =0; @@ -546,7 +547,7 @@ $result = DB_query("SELECT serialno FROM stockserialitems WHERE serialno='" . ($StockItem->NextSerialNo + $i) . "' - AND stockid='" . $StockItem->StockID ."'",$db); + AND stockid='" . $StockItem->StockID ."'"); if (DB_num_rows($result)!=0){ $WOQuantity++; prnMsg(($StockItem->NextSerialNo + $i) . ': ' . _('This automatically generated serial number already exists - it cannot be added to the work order'),'error'); @@ -659,7 +660,7 @@ $ContractResult = DB_query("SELECT contractref, requireddate FROM contracts WHERE orderno='" . $_SESSION['ExistingOrder'.$identifier] ."' - AND status=1",$db); + AND status=1"); if (DB_num_rows($ContractResult)==1){ //then it is a contract quotation being changed to an order $ContractRow = DB_fetch_array($ContractResult); $WONo = GetNextTransNo(40,$db); @@ -667,7 +668,10 @@ $DbgMsg = _('The SQL that failed to update the contract status was'); $UpdContractResult=DB_query("UPDATE contracts SET status=2, wo='" . $WONo . "' - WHERE orderno='" .$_SESSION['ExistingOrder'.$identifier] . "'", $db,$ErrMsg,$DbgMsg,true); + WHERE orderno='" .$_SESSION['ExistingOrder'.$identifier] . "'", + $ErrMsg, + $DbgMsg, + true); $ErrMsg = _('Could not insert the contract bill of materials'); $InsContractBOM = DB_query("INSERT INTO bom (parent, component, @@ -684,7 +688,9 @@ '2099-12-31', quantity FROM contractbom - WHERE contractref='" . $ContractRow['contractref'] . "'",$db,$ErrMsg,$DbgMsg); + WHERE contractref='" . $ContractRow['contractref'] . "'", + $ErrMsg, + $DbgMsg); $ErrMsg = _('Unable to insert a new work order for the sales order item'); $InsWOResult = DB_query("INSERT INTO workorders (wo, @@ -695,13 +701,13 @@ '" . $_SESSION['Items'.$identifier]->Location ."', '" . $ContractRow['requireddate'] . "', '" . Date('Y-m-d'). "')", - $db,$ErrMsg,$DbgMsg); + $ErrMsg, + $DbgMsg); //Need to get the latest BOM to roll up cost but also add the contract other requirements $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*contractbom.quantity) AS cost FROM stockmaster INNER JOIN contractbom ON stockmaster.stockid=contractbom.stockid - WHERE contractbom.contractref='" . $ContractRow['contractref'] . "'", - $db); + WHERE contractbom.contractref='" . $ContractRow['contractref'] . "'"); $CostRow = DB_fetch_row($CostResult); if (is_null($CostRow[0]) OR $CostRow[0]==0){ $Cost =0; @@ -711,8 +717,7 @@ } $CostResult = DB_query("SELECT SUM(costperunit*quantity) AS cost FROM contractreqts - WHERE contractreqts.contractref='" . $ContractRow['contractref'] . "'", - $db); + WHERE contractreqts.contractref='" . $ContractRow['contractref'] . "'"); $CostRow = DB_fetch_row($CostResult); //add other requirements cost to cost of contract BOM $Cost += $CostRow[0]; @@ -1009,7 +1014,9 @@ $ErrMsg = _('The stock locations could not be retrieved'); $DbgMsg = _('SQL used to retrieve the stock locations was') . ':'; $StkLocsResult = DB_query("SELECT locationname,locations.loccode - FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1",$db, $ErrMsg, $DbgMsg); + FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1", + $ErrMsg, + $DbgMsg); while ($myrow=DB_fetch_array($StkLocsResult)){ if ($_SESSION['Items'.$identifier]->Location==$myrow['loccode']){ Modified: trunk/DiscountCategories.php =================================================================== --- trunk/DiscountCategories.php 2014-10-26 23:18:08 UTC (rev 6941) +++ trunk/DiscountCategories.php 2014-10-27 02:48:29 UTC (rev 6942) @@ -33,7 +33,7 @@ FROM stockmaster WHERE mbflag <>'K' AND mbflag<>'D' - AND stockid='" . mb_strtoupper($_POST['StockID']) . "'",$db); + AND stockid='" . mb_strtoupper($_POST['StockID']) . "'"); if (DB_num_rows($result)==0){ $InputError = 1; prnMsg(_('The stock item entered must be set up as either a manufactured or purchased or assembly item'),'warn'); Modified: trunk/EDIProcessOrders.php =================================================================== --- trunk/EDIProcessOrders.php 2014-10-26 23:18:08 UTC (rev 6941) +++ trunk/EDIProcessOrders.php 2014-10-27 02:48:29 UTC (rev 6942) @@ -468,7 +468,7 @@ defaultlocation, phoneno, email - FROM custbranch INNER JOIN debtorsmaster ON custbranch.debtorno = custbranch.debtorno WHERE custbranchcode='" . $NAD_C082[0] . "' AND custbranch.debtorno='" . $Order->DebtorNo . "' AND debtorsmaster.ediorders=1",$db); + FROM custbranch INNER JOIN debtorsmaster ON custbranch.debtorno = custbranch.debtorno WHERE custbranchcode='" . $NAD_C082[0] . "' AND custbranch.debtorno='" . $Order->DebtorNo . "' AND debtorsmaster.ediorders=1"); if (DB_num_rows($BranchResult)!=1){ $EmailText .= "\n" . _('The Store number was specified as') . ' ' . $NAD_C082[0] . ' ' . _('Unfortunately there are either no branches of customer code') . ' ' . $Order->DebtorNo . ' ' ._('or several that match this store number') . '. ' . _('This order could not be processed further'); $TryNextFile = True; /* Look for other EDI msgs */ Modified: trunk/FixedAssetDepreciation.php =================================================================== --- trunk/FixedAssetDepreciation.php 2014-10-26 23:18:08 UTC (rev 6941) +++ trunk/FixedAssetDepreciation.php 2014-10-27 02:48:29 UTC (rev 6942) @@ -18,7 +18,7 @@ ON fixedassettrans.periodno=periods.periodno WHERE transtype=44 GROUP BY periods.lastdate_in_period - ORDER BY periods.lastdate_in_period DESC",$db); + ORDER BY periods.lastdate_in_period DESC"); $LastDepnRun = DB_fetch_row($result); Modified: trunk/FixedAssetItems.php =================================================================== --- trunk/FixedAssetItems.php 2014-10-26 23:18:08 UTC (rev 6941) +++ trunk/FixedAssetItems.php 2014-10-27 02:48:29 UTC (rev 6942) @@ -137,16 +137,16 @@ accumdepnact FROM fixedassets INNER JOIN fixedassetcategories ON fixedassets.assetcategoryid=fixedassetcategories.categoryid - WHERE ... [truncated message content] |
From: <dai...@us...> - 2014-10-27 07:06:55
|
Revision: 6943 http://sourceforge.net/p/web-erp/reponame/6943 Author: daintree Date: 2014-10-27 07:06:42 +0000 (Mon, 27 Oct 2014) Log Message: ----------- removed all $db from DB_error_no($db) calls Modified Paths: -------------- trunk/AgedDebtors.php trunk/AgedSuppliers.php trunk/BOMExtendedQty.php trunk/BOMIndented.php trunk/BOMIndentedReverse.php trunk/BOMListing.php trunk/CustomerBranches.php trunk/CustomerReceipt.php trunk/Dashboard.php trunk/DebtorsAtPeriodEnd.php trunk/FixedAssetItems.php trunk/GLBalanceSheet.php trunk/GLProfit_Loss.php trunk/GLTagProfit_Loss.php trunk/GLTrialBalance.php trunk/InventoryPlanning.php trunk/InventoryPlanningPrefSupplier.php trunk/InventoryQuantities.php trunk/InventoryValuation.php trunk/MRP.php trunk/MRPPlannedPurchaseOrders.php trunk/MRPPlannedWorkOrders.php trunk/MRPReport.php trunk/MRPReschedules.php trunk/MRPShortages.php trunk/MailInventoryValuation.php trunk/OutstandingGRNs.php trunk/PDFBankingSummary.php trunk/PDFChequeListing.php trunk/PDFCustTransListing.php trunk/PDFCustomerList.php trunk/PDFDIFOT.php trunk/PDFDeliveryDifferences.php trunk/PDFLowGP.php trunk/PDFOrderStatus.php trunk/PDFOrdersInvoiced.php trunk/PDFPeriodStockTransListing.php trunk/PDFPriceList.php trunk/PDFPrintLabel.php trunk/PDFRemittanceAdvice.php trunk/PDFSellThroughSupportClaim.php trunk/PDFStockCheckComparison.php trunk/PDFSuppTransListing.php trunk/PO_Items.php trunk/PcReportTab.php trunk/Prices_Customer.php trunk/PrintCustStatements.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/PurchaseByPrefSupplier.php trunk/ReorderLevel.php trunk/SalesGraph.php trunk/SelectCompletedOrder.php trunk/ShipmentCosting.php trunk/StockCheck.php trunk/StockClone.php trunk/StockDispatch.php trunk/StockUsage.php trunk/StockUsageGraph.php trunk/Stocks.php trunk/SuppPaymentRun.php trunk/SuppPriceList.php trunk/SupplierBalsAtPeriodEnd.php trunk/Tax.php trunk/UpgradeDatabase.php trunk/Z_ChangeLocationCode.php trunk/Z_ChangeStockCode.php trunk/Z_DataExport.php trunk/Z_ImportDebtors.php trunk/Z_ImportFixedAssets.php trunk/Z_ImportStocks.php trunk/Z_ImportSuppliers.php trunk/Z_Upgrade3.10.php trunk/Z_Upgrade_3.10-3.11.php trunk/Z_Upgrade_3.11-4.00.php trunk/api/api_branches.php trunk/api/api_customers.php trunk/api/api_debtortransactions.php trunk/api/api_glaccounts.php trunk/api/api_glgroups.php trunk/api/api_glsections.php trunk/api/api_locations.php trunk/api/api_purchdata.php trunk/api/api_salesareas.php trunk/api/api_salesman.php trunk/api/api_salesorders.php trunk/api/api_salestypes.php trunk/api/api_session.inc trunk/api/api_stock.php trunk/api/api_stockcategories.php trunk/api/api_suppliers.php trunk/api/api_workorders.php trunk/doc/Change.log trunk/includes/ConnectDB_mysql.inc trunk/includes/ConnectDB_mysqli.inc trunk/includes/ConnectDB_postgres.inc trunk/includes/DefineOfferClass.php trunk/includes/FreightCalculation.inc trunk/includes/GetConfig.php trunk/includes/PDFPaymentRun_PymtFooter.php trunk/includes/SQL_CommonFunctions.inc Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/AgedDebtors.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -263,7 +263,7 @@ } $CustomerResult = DB_query($SQL,'','',False,False); /*dont trap errors handled below*/ - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '.... '; include('includes/header.inc'); prnMsg(_('The customer details could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); @@ -365,7 +365,7 @@ } $DetailResult = DB_query($sql,'','',False,False); /*Dont trap errors */ - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg(_('The details of outstanding transactions for customer') . ' - ' . $AgedAnalysis['debtorno'] . ' ' . _('could not be retrieved because') . ' - ' . DB_error_msg($db),'error'); Modified: trunk/AgedSuppliers.php =================================================================== --- trunk/AgedSuppliers.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/AgedSuppliers.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -104,7 +104,7 @@ $SupplierResult = DB_query($SQL,'','',False,False); /*dont trap errors */ - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Aged Supplier Account Analysis') . ' - ' . _('Problem Report') ; include('includes/header.inc'); prnMsg(_('The Supplier details could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); @@ -191,7 +191,7 @@ AND supptrans.supplierno = '" . $AgedAnalysis["supplierid"] . "'"; $DetailResult = DB_query($sql,'','',False,False); /*dont trap errors - trapped below*/ - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Aged Supplier Account Analysis - Problem Report'); include('includes/header.inc'); prnMsg(_('The details of outstanding transactions for Supplier') . ' - ' . $AgedAnalysis['supplierid'] . ' ' . _('could not be retrieved because') . ' - ' . DB_error_msg($db),'error'); Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/BOMExtendedQty.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -150,7 +150,7 @@ } // End of while $ComponentCounter > 0 - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Quantity Extended BOM Listing') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The Quantiy Extended BOM Listing could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/BOMIndented.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -148,7 +148,7 @@ } // End of while $ComponentCounter > 0 } // End of if $_POST['Levels'] - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Indented BOM Listing') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The Indented BOM Listing could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); Modified: trunk/BOMIndentedReverse.php =================================================================== --- trunk/BOMIndentedReverse.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/BOMIndentedReverse.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -136,7 +136,7 @@ } // End of while $ComponentCounter > 0 - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Indented BOM Listing') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The Indented BOM Listing could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); Modified: trunk/BOMListing.php =================================================================== --- trunk/BOMListing.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/BOMListing.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -38,7 +38,7 @@ $BOMResult = DB_query($SQL,'','',false,false); //dont do error trapping inside DB_query - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Bill of Materials Listing') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg(_('The Bill of Material listing could not be retrieved by the SQL because'),'error'); Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/CustomerBranches.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -255,7 +255,7 @@ $result = DB_query($SQL, $ErrMsg); } - if (DB_error_no($db) ==0 AND $InputError==0) { + if (DB_error_no() ==0 AND $InputError==0) { prnMsg($msg,'success'); unset($_POST['BranchCode']); unset($_POST['BrName']); @@ -355,7 +355,7 @@ } $ErrMsg = _('The branch record could not be deleted') . ' - ' . _('the SQL server returned the following message'); $result = DB_query($SQL,$ErrMsg); - if (DB_error_no($db)==0){ + if (DB_error_no()==0){ prnMsg(_('Branch Deleted'),'success'); } } Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/CustomerReceipt.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -635,7 +635,7 @@ } $CustomerSearchResult = DB_query($SQL,'','',false,false); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { prnMsg(_('The searched customer records requested cannot be retrieved because') . ' - ' . DB_error_msg($db),'error'); if ($debug==1){ prnMsg(_('SQL used to retrieve the customer details was') . '<br />' . $sql,'error'); Modified: trunk/Dashboard.php =================================================================== --- trunk/Dashboard.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/Dashboard.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -141,7 +141,7 @@ ROUND(ABS(SUM(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc)),currencies.decimalplaces) > 0"; $CustomerResult = DB_query($SQL,'','',False,False); /*dont trap errors handled below*/ - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { prnMsg(_('The customer details could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ @@ -252,7 +252,7 @@ } $DetailResult = DB_query($sql,'','',False,False); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { prnMsg(_('The details of outstanding transactions for customer') . ' - ' . $AgedAnalysis['debtorno'] . ' ' . _('could not be retrieved because') . ' - ' . DB_error_msg($db),'error'); echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ @@ -418,7 +418,7 @@ supptrans.transno"; $TransResult = DB_query($sql,'','',false,false); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { prnMsg(_('The details of supplier invoices due could not be retrieved because') . ' - ' . DB_error_msg($db),'error'); echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ Modified: trunk/DebtorsAtPeriodEnd.php =================================================================== --- trunk/DebtorsAtPeriodEnd.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/DebtorsAtPeriodEnd.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -53,7 +53,7 @@ $CustomerResult = DB_query($SQL,'','',false,false); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Customer Balances') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg(_('The customer details could not be retrieved by the SQL because') . DB_error_msg($db),'error'); Modified: trunk/FixedAssetItems.php =================================================================== --- trunk/FixedAssetItems.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/FixedAssetItems.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -271,7 +271,7 @@ $DbgMsg = _('The SQL that was used to add the asset failed was'); $result = DB_query($sql, $ErrMsg, $DbgMsg); - if (DB_error_no($db) ==0) { + if (DB_error_no() ==0) { $NewAssetID = DB_Last_Insert_ID($db,'fixedassets', 'assetid'); prnMsg( _('The new asset has been added to the database with an asset code of:') . ' ' . $NewAssetID,'success'); unset($_POST['LongDescription']); Modified: trunk/GLBalanceSheet.php =================================================================== --- trunk/GLBalanceSheet.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/GLBalanceSheet.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -104,7 +104,7 @@ WHERE accountgroups.pandl=1"; $AccumProfitResult = DB_query($SQL); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Balance Sheet') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('The accumulated profits brought forward could not be calculated by the SQL because') . ' - ' . DB_error_msg($db) ); @@ -143,7 +143,7 @@ $AccountsResult = DB_query($SQL); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Balance Sheet') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('No general ledger accounts were returned by the SQL because') . ' - ' . DB_error_msg($db) ); Modified: trunk/GLProfit_Loss.php =================================================================== --- trunk/GLProfit_Loss.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/GLProfit_Loss.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -181,7 +181,7 @@ $AccountsResult = DB_query($SQL); - if (DB_error_no($db) != 0) { + if (DB_error_no() != 0) { $Title = _('Profit and Loss') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('No general ledger accounts were returned by the SQL because') . ' - ' . DB_error_msg($db) ); Modified: trunk/GLTagProfit_Loss.php =================================================================== --- trunk/GLTagProfit_Loss.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/GLTagProfit_Loss.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -190,7 +190,7 @@ $AccountsResult = DB_query($SQL); - if (DB_error_no($db) != 0) { + if (DB_error_no() != 0) { $Title = _('Income and Expenditure') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('No general ledger accounts were returned by the SQL because') . ' - ' . DB_error_msg($db) ); Modified: trunk/GLTrialBalance.php =================================================================== --- trunk/GLTrialBalance.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/GLTrialBalance.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -159,7 +159,7 @@ chartdetails.accountcode"; $AccountsResult = DB_query($SQL); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Trial Balance') . ' - ' . _('Problem Report') . '....'; $ViewTopic = 'GeneralLedger'; $BookMark = 'TrialBalance'; Modified: trunk/InventoryPlanning.php =================================================================== --- trunk/InventoryPlanning.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/InventoryPlanning.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -101,7 +101,7 @@ } $InventoryResult = DB_query($SQL, '', '', false, false); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg(_('The inventory quantities could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); @@ -178,7 +178,7 @@ $SalesResult = DB_query($SQL,'','', false, false); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('The sales quantities could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); @@ -215,7 +215,7 @@ $DemandResult = DB_query($SQL, '', '', false , false); $ListCount = DB_num_rows($DemandResult); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('The sales order demand quantities could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); @@ -264,7 +264,7 @@ $BOMDemandResult = DB_query($SQL,'','',false,false); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('The sales order demand quantities from parent assemblies could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); Modified: trunk/InventoryPlanningPrefSupplier.php =================================================================== --- trunk/InventoryPlanningPrefSupplier.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/InventoryPlanningPrefSupplier.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -179,7 +179,7 @@ $InventoryResult = DB_query($SQL, '', '', false, false); $ListCount = DB_num_rows($InventoryResult); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg(_('The inventory quantities could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); @@ -237,7 +237,7 @@ $SalesResult=DB_query($SQL,'','',FALSE,FALSE); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('The sales quantities could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); @@ -264,7 +264,7 @@ $DemandResult = DB_query($SQL, '', '', false, false); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('The sales order demand quantities could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); @@ -297,7 +297,7 @@ $BOMDemandResult = DB_query($SQL,'','',false,false); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('The sales order demand quantities from parent assemblies could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); Modified: trunk/InventoryQuantities.php =================================================================== --- trunk/InventoryQuantities.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/InventoryQuantities.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -80,7 +80,7 @@ $result = DB_query($sql,'','',false,true); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Inventory Quantities') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The Inventory Quantity report could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); Modified: trunk/InventoryValuation.php =================================================================== --- trunk/InventoryValuation.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/InventoryValuation.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -66,7 +66,7 @@ } $InventoryResult = DB_query($SQL,'','',false,true); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Inventory Valuation') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The inventory valuation could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); Modified: trunk/MRP.php =================================================================== --- trunk/MRP.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/MRP.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -536,7 +536,7 @@ // Display parameters from last run $sql = "SELECT * FROM mrpparameters"; $result = DB_query($sql,'','',false,false); - if (DB_error_no($db)==0){ + if (DB_error_no()==0){ $myrow = DB_fetch_array($result); Modified: trunk/MRPPlannedPurchaseOrders.php =================================================================== --- trunk/MRPPlannedPurchaseOrders.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/MRPPlannedPurchaseOrders.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -110,7 +110,7 @@ } $result = DB_query($sql,'','',false,true); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('MRP Planned Purchase Orders') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The MRP planned purchase orders could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); Modified: trunk/MRPPlannedWorkOrders.php =================================================================== --- trunk/MRPPlannedWorkOrders.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/MRPPlannedWorkOrders.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -102,7 +102,7 @@ } $result = DB_query($sql,'','',false,true); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('MRP Planned Work Orders') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The MRP planned work orders could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); Modified: trunk/MRPReport.php =================================================================== --- trunk/MRPReport.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/MRPReport.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -30,7 +30,7 @@ ORDER BY daterequired,whererequired"; $result = DB_query($sql,'','',False,False); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $errors = 1; $holddb = $db; $Title = _('Print MRP Report Error'); @@ -81,7 +81,7 @@ WHERE part = '" . $_POST['Part'] . "' ORDER BY mrpdate"; $result = DB_query($sql,'','',false,true); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $errors = 1; $holddb = $db; } @@ -115,7 +115,7 @@ TO_DAYS(duedate) - TO_DAYS(CURRENT_DATE) AS datediff FROM mrpplannedorders WHERE part = '" . $_POST['Part'] . "' ORDER BY mrpdate"; $result = DB_query($sql,'','',false,true); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $errors = 1; $holddb = $db; } Modified: trunk/MRPReschedules.php =================================================================== --- trunk/MRPReschedules.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/MRPReschedules.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -41,7 +41,7 @@ ORDER BY mrpsupplies.part"; $result = DB_query($sql,'','',false,true); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('MRP Reschedules') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The MRP reschedules could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); Modified: trunk/MRPShortages.php =================================================================== --- trunk/MRPShortages.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/MRPShortages.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -151,7 +151,7 @@ " ORDER BY '" . $_POST['Sort'] . "'"; $result = DB_query($sql,'','',false,true); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('MRP Shortages and Excesses') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The MRP shortages and excesses could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); Modified: trunk/MailInventoryValuation.php =================================================================== --- trunk/MailInventoryValuation.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/MailInventoryValuation.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -115,7 +115,7 @@ $InventoryResult = DB_query($SQL,'','',false,true); $ListCount = DB_num_rows($InventoryResult); -if (DB_error_no($db) !=0) { +if (DB_error_no() !=0) { $Title = _('Inventory Valuation') . ' - ' . _('Problem Report'); include('includes/header.inc'); echo _('The inventory valuation could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db); Modified: trunk/OutstandingGRNs.php =================================================================== --- trunk/OutstandingGRNs.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/OutstandingGRNs.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -42,7 +42,7 @@ $GRNsResult = DB_query($SQL,'','',false,false); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Outstanding GRN Valuation') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg(_('The outstanding GRNs valuation details could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); Modified: trunk/PDFBankingSummary.php =================================================================== --- trunk/PDFBankingSummary.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/PDFBankingSummary.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -103,7 +103,7 @@ AND debtortrans.type=12"; $CustRecs=DB_query($SQL,'','',false,false); - if (DB_error_no($db)!=0){ + if (DB_error_no()!=0){ $Title = _('Create PDF Print-out For A Batch Of Receipts'); include ('includes/header.inc'); prnMsg(_('An error occurred getting the customer receipts for batch number') . ' ' . $_POST['BatchNo'],'error'); @@ -122,7 +122,7 @@ AND gltrans.account !='" . $_SESSION['CompanyRecord']['debtorsact'] . "'"; $GLRecs=DB_query($SQL,'','',false,false); - if (DB_error_no($db)!=0){ + if (DB_error_no()!=0){ $Title = _('Create PDF Print-out For A Batch Of Receipts'); include ('includes/header.inc'); prnMsg(_('An error occurred getting the GL receipts for batch number') . ' ' . $_POST['BatchNo'],'error'); Modified: trunk/PDFChequeListing.php =================================================================== --- trunk/PDFChequeListing.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/PDFChequeListing.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -102,7 +102,7 @@ AND transdate <='" . FormatDateForSQL($_POST['ToDate']) . "'"; $Result=DB_query($sql,'','',false,false); -if (DB_error_no($db)!=0){ +if (DB_error_no()!=0){ $Title = _('Payment Listing'); include('includes/header.inc'); prnMsg(_('An error occurred getting the payments'),'error'); @@ -145,7 +145,7 @@ AND gltrans.type='" . $myrow['type'] . "'"; $GLTransResult = DB_query($sql,'','',false,false); - if (DB_error_no($db)!=0){ + if (DB_error_no()!=0){ $Title = _('Payment Listing'); include('includes/header.inc'); prnMsg(_('An error occurred getting the GL transactions'),'error'); Modified: trunk/PDFCustTransListing.php =================================================================== --- trunk/PDFCustTransListing.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/PDFCustTransListing.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -78,7 +78,7 @@ $result=DB_query($sql,'','',false,false); -if (DB_error_no($db)!=0){ +if (DB_error_no()!=0){ $Title = _('Payment Listing'); include('includes/header.inc'); prnMsg(_('An error occurred getting the transactions'),'error'); Modified: trunk/PDFCustomerList.php =================================================================== --- trunk/PDFCustomerList.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/PDFCustomerList.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -228,7 +228,7 @@ $CustomersResult = DB_query($SQL); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Customer List') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('The customer List could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db) ); Modified: trunk/PDFDIFOT.php =================================================================== --- trunk/PDFDIFOT.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/PDFDIFOT.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -186,7 +186,7 @@ $Result=DB_query($sql,'','',false,false); //dont error check - see below -if (DB_error_no($db)!=0){ +if (DB_error_no()!=0){ $Title = _('DIFOT Report Error'); include('includes/header.inc'); prnMsg( _('An error occurred getting the days between delivery requested and actual invoice'),'error'); Modified: trunk/PDFDeliveryDifferences.php =================================================================== --- trunk/PDFDeliveryDifferences.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/PDFDeliveryDifferences.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -187,7 +187,7 @@ $Result=DB_query($sql,'','',false,false); //dont error check - see below -if (DB_error_no($db)!=0){ +if (DB_error_no()!=0){ $Title = _('Delivery Differences Log Report Error'); include('includes/header.inc'); prnMsg( _('An error occurred getting the variances between deliveries and orders'),'error'); Modified: trunk/PDFLowGP.php =================================================================== --- trunk/PDFLowGP.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/PDFLowGP.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -52,7 +52,7 @@ $LowGPSalesResult = DB_query($SQL,'','',false,false); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { include('includes/header.inc'); prnMsg(_('The low GP items could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); Modified: trunk/PDFOrderStatus.php =================================================================== --- trunk/PDFOrderStatus.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/PDFOrderStatus.php 2014-10-27 07:06:42 UTC (rev 6943) @@ -260,7 +260,7 @@ $Result=DB_query($sql,'','',false,false); //dont trap errors here -if (DB_error_no($db)!=0){ +if (DB_error_no()!=0){ include('includes/header.inc'); echo '<br />' . _('An error occurred getting the orders details'); if ($debug==1){ Modified: trunk/PDFOrdersInvoiced.php =================================================================== --- trunk/PDFOrdersInvoiced.php 2014-10-27 02:48:29 UTC (rev 6942) +++ trunk/PDFOrdersInvoiced.php 2014-10-27 07:06:42 UTC (... [truncated message content] |
From: <dai...@us...> - 2014-10-27 07:15:47
|
Revision: 6944 http://sourceforge.net/p/web-erp/reponame/6944 Author: daintree Date: 2014-10-27 07:15:34 +0000 (Mon, 27 Oct 2014) Log Message: ----------- removed all $db from DB_error_msg($db) calls Modified Paths: -------------- trunk/AgedDebtors.php trunk/AgedSuppliers.php trunk/BOMExtendedQty.php trunk/BOMIndented.php trunk/BOMIndentedReverse.php trunk/CustomerReceipt.php trunk/CustomerTransInquiry.php trunk/DailySalesInquiry.php trunk/Dashboard.php trunk/DebtorsAtPeriodEnd.php trunk/GLBalanceSheet.php trunk/GLProfit_Loss.php trunk/GLTagProfit_Loss.php trunk/GLTrialBalance.php trunk/InventoryPlanning.php trunk/InventoryPlanningPrefSupplier.php trunk/InventoryQuantities.php trunk/InventoryValuation.php trunk/MRPPlannedPurchaseOrders.php trunk/MRPPlannedWorkOrders.php trunk/MRPReschedules.php trunk/MRPShortages.php trunk/MailInventoryValuation.php trunk/OutstandingGRNs.php trunk/PDFCustomerList.php trunk/PDFLowGP.php trunk/PDFPriceList.php trunk/PDFPrintLabel.php trunk/PDFRemittanceAdvice.php trunk/PDFSellThroughSupportClaim.php trunk/PDFStockCheckComparison.php trunk/PO_Items.php trunk/Prices_Customer.php trunk/PurchaseByPrefSupplier.php trunk/ReorderLevel.php trunk/SalesByTypePeriodInquiry.php trunk/SalesCategoryPeriodInquiry.php trunk/SalesGraph.php trunk/SalesTopCustomersInquiry.php trunk/SalesTopItemsInquiry.php trunk/SelectCompletedOrder.php trunk/ShipmentCosting.php trunk/Shipments.php trunk/Shipt_Select.php trunk/ShiptsList.php trunk/StockCheck.php trunk/StockDispatch.php trunk/StockUsage.php trunk/StockUsageGraph.php trunk/SuppPaymentRun.php trunk/SuppPriceList.php trunk/SupplierBalsAtPeriodEnd.php trunk/SupplierTransInquiry.php trunk/Tax.php trunk/UpgradeDatabase.php trunk/Z_DataExport.php trunk/api/api_session.inc trunk/doc/Change.log trunk/includes/ConnectDB_mysql.inc trunk/includes/ConnectDB_postgres.inc trunk/includes/FreightCalculation.inc trunk/includes/PDFPaymentRun_PymtFooter.php Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/AgedDebtors.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -266,7 +266,7 @@ if (DB_error_no() !=0) { $Title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '.... '; include('includes/header.inc'); - prnMsg(_('The customer details could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); + prnMsg(_('The customer details could not be retrieved by the SQL because') . ' ' . DB_error_msg(),'error'); echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $SQL; @@ -368,7 +368,7 @@ if (DB_error_no() !=0) { $Title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); - prnMsg(_('The details of outstanding transactions for customer') . ' - ' . $AgedAnalysis['debtorno'] . ' ' . _('could not be retrieved because') . ' - ' . DB_error_msg($db),'error'); + prnMsg(_('The details of outstanding transactions for customer') . ' - ' . $AgedAnalysis['debtorno'] . ' ' . _('could not be retrieved because') . ' - ' . DB_error_msg(),'error'); echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . _('The SQL that failed was') . '<br />' . $sql; Modified: trunk/AgedSuppliers.php =================================================================== --- trunk/AgedSuppliers.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/AgedSuppliers.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -107,7 +107,7 @@ if (DB_error_no() !=0) { $Title = _('Aged Supplier Account Analysis') . ' - ' . _('Problem Report') ; include('includes/header.inc'); - prnMsg(_('The Supplier details could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); + prnMsg(_('The Supplier details could not be retrieved by the SQL because') . ' ' . DB_error_msg(),'error'); echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $SQL; @@ -194,7 +194,7 @@ if (DB_error_no() !=0) { $Title = _('Aged Supplier Account Analysis - Problem Report'); include('includes/header.inc'); - prnMsg(_('The details of outstanding transactions for Supplier') . ' - ' . $AgedAnalysis['supplierid'] . ' ' . _('could not be retrieved because') . ' - ' . DB_error_msg($db),'error'); + prnMsg(_('The details of outstanding transactions for Supplier') . ' - ' . $AgedAnalysis['supplierid'] . ' ' . _('could not be retrieved because') . ' - ' . DB_error_msg(),'error'); echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . _('The SQL that failed was') . '<br />' . $sql; Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/BOMExtendedQty.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -153,7 +153,7 @@ if (DB_error_no() !=0) { $Title = _('Quantity Extended BOM Listing') . ' - ' . _('Problem Report'); include('includes/header.inc'); - prnMsg( _('The Quantiy Extended BOM Listing could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); + prnMsg( _('The Quantiy Extended BOM Listing could not be retrieved by the SQL because') . ' ' . DB_error_msg(),'error'); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $sql; Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/BOMIndented.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -151,7 +151,7 @@ if (DB_error_no() !=0) { $Title = _('Indented BOM Listing') . ' - ' . _('Problem Report'); include('includes/header.inc'); - prnMsg( _('The Indented BOM Listing could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); + prnMsg( _('The Indented BOM Listing could not be retrieved by the SQL because') . ' ' . DB_error_msg(),'error'); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $sql; Modified: trunk/BOMIndentedReverse.php =================================================================== --- trunk/BOMIndentedReverse.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/BOMIndentedReverse.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -139,7 +139,7 @@ if (DB_error_no() !=0) { $Title = _('Indented BOM Listing') . ' - ' . _('Problem Report'); include('includes/header.inc'); - prnMsg( _('The Indented BOM Listing could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); + prnMsg( _('The Indented BOM Listing could not be retrieved by the SQL because') . ' ' . DB_error_msg(),'error'); echo '<br /> <a href="' .$RootPath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/CustomerReceipt.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -636,7 +636,7 @@ $CustomerSearchResult = DB_query($SQL,'','',false,false); if (DB_error_no() !=0) { - prnMsg(_('The searched customer records requested cannot be retrieved because') . ' - ' . DB_error_msg($db),'error'); + prnMsg(_('The searched customer records requested cannot be retrieved because') . ' - ' . DB_error_msg(),'error'); if ($debug==1){ prnMsg(_('SQL used to retrieve the customer details was') . '<br />' . $sql,'error'); } Modified: trunk/CustomerTransInquiry.php =================================================================== --- trunk/CustomerTransInquiry.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/CustomerTransInquiry.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -93,7 +93,7 @@ } $sql .= " ORDER BY id"; - $ErrMsg = _('The customer transactions for the selected criteria could not be retrieved because') . ' - ' . DB_error_msg($db); + $ErrMsg = _('The customer transactions for the selected criteria could not be retrieved because') . ' - ' . DB_error_msg(); $DbgMsg = _('The SQL that failed was'); $TransResult = DB_query($sql,$ErrMsg,$DbgMsg); Modified: trunk/DailySalesInquiry.php =================================================================== --- trunk/DailySalesInquiry.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/DailySalesInquiry.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -107,7 +107,7 @@ } $sql .= " GROUP BY stockmoves.trandate ORDER BY stockmoves.trandate"; -$ErrMsg = _('The sales data could not be retrieved because') . ' - ' . DB_error_msg($db); +$ErrMsg = _('The sales data could not be retrieved because') . ' - ' . DB_error_msg(); $SalesResult = DB_query($sql,$ErrMsg); echo '<table class="selection"> Modified: trunk/Dashboard.php =================================================================== --- trunk/Dashboard.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/Dashboard.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -142,7 +142,7 @@ $CustomerResult = DB_query($SQL,'','',False,False); /*dont trap errors handled below*/ if (DB_error_no() !=0) { - prnMsg(_('The customer details could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); + prnMsg(_('The customer details could not be retrieved by the SQL because') . ' ' . DB_error_msg(),'error'); echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $SQL; @@ -253,7 +253,7 @@ $DetailResult = DB_query($sql,'','',False,False); if (DB_error_no() !=0) { - prnMsg(_('The details of outstanding transactions for customer') . ' - ' . $AgedAnalysis['debtorno'] . ' ' . _('could not be retrieved because') . ' - ' . DB_error_msg($db),'error'); + prnMsg(_('The details of outstanding transactions for customer') . ' - ' . $AgedAnalysis['debtorno'] . ' ' . _('could not be retrieved because') . ' - ' . DB_error_msg(),'error'); echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . _('The SQL that failed was') . '<br />' . $sql; @@ -419,7 +419,7 @@ $TransResult = DB_query($sql,'','',false,false); if (DB_error_no() !=0) { - prnMsg(_('The details of supplier invoices due could not be retrieved because') . ' - ' . DB_error_msg($db),'error'); + prnMsg(_('The details of supplier invoices due could not be retrieved because') . ' - ' . DB_error_msg(),'error'); echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . _('The SQL that failed was') . ' ' . $sql; Modified: trunk/DebtorsAtPeriodEnd.php =================================================================== --- trunk/DebtorsAtPeriodEnd.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/DebtorsAtPeriodEnd.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -56,7 +56,7 @@ if (DB_error_no() !=0) { $Title = _('Customer Balances') . ' - ' . _('Problem Report'); include('includes/header.inc'); - prnMsg(_('The customer details could not be retrieved by the SQL because') . DB_error_msg($db),'error'); + prnMsg(_('The customer details could not be retrieved by the SQL because') . DB_error_msg(),'error'); echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $SQL; Modified: trunk/GLBalanceSheet.php =================================================================== --- trunk/GLBalanceSheet.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/GLBalanceSheet.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -107,7 +107,7 @@ if (DB_error_no() !=0) { $Title = _('Balance Sheet') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); - prnMsg( _('The accumulated profits brought forward could not be calculated by the SQL because') . ' - ' . DB_error_msg($db) ); + prnMsg( _('The accumulated profits brought forward could not be calculated by the SQL because') . ' - ' . DB_error_msg() ); echo '<br /> <a href="' .$RootPath .'/index.php">' . _('Back to the menu'). '</a>'; if ($debug==1){ @@ -146,7 +146,7 @@ if (DB_error_no() !=0) { $Title = _('Balance Sheet') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); - prnMsg( _('No general ledger accounts were returned by the SQL because') . ' - ' . DB_error_msg($db) ); + prnMsg( _('No general ledger accounts were returned by the SQL because') . ' - ' . DB_error_msg() ); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu'). '</a>'; if ($debug==1){ echo '<br />' . $SQL; Modified: trunk/GLProfit_Loss.php =================================================================== --- trunk/GLProfit_Loss.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/GLProfit_Loss.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -184,7 +184,7 @@ if (DB_error_no() != 0) { $Title = _('Profit and Loss') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); - prnMsg( _('No general ledger accounts were returned by the SQL because') . ' - ' . DB_error_msg($db) ); + prnMsg( _('No general ledger accounts were returned by the SQL because') . ' - ' . DB_error_msg() ); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu'). '</a>'; if ($debug == 1){ echo '<br />' . $SQL; Modified: trunk/GLTagProfit_Loss.php =================================================================== --- trunk/GLTagProfit_Loss.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/GLTagProfit_Loss.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -193,7 +193,7 @@ if (DB_error_no() != 0) { $Title = _('Income and Expenditure') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); - prnMsg( _('No general ledger accounts were returned by the SQL because') . ' - ' . DB_error_msg($db) ); + prnMsg( _('No general ledger accounts were returned by the SQL because') . ' - ' . DB_error_msg() ); echo '<br /> <a href="' .$RootPath .'/index.php">' . _('Back to the menu'). '</a>'; if ($debug == 1){ Modified: trunk/GLTrialBalance.php =================================================================== --- trunk/GLTrialBalance.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/GLTrialBalance.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -164,7 +164,7 @@ $ViewTopic = 'GeneralLedger'; $BookMark = 'TrialBalance'; include('includes/header.inc'); - prnMsg( _('No general ledger accounts were returned by the SQL because') . ' - ' . DB_error_msg($db) ); + prnMsg( _('No general ledger accounts were returned by the SQL because') . ' - ' . DB_error_msg() ); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu'). '</a>'; if ($debug==1){ echo '<br />' . $SQL; Modified: trunk/InventoryPlanning.php =================================================================== --- trunk/InventoryPlanning.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/InventoryPlanning.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -104,7 +104,7 @@ if (DB_error_no() !=0) { $Title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); - prnMsg(_('The inventory quantities could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); + prnMsg(_('The inventory quantities could not be retrieved by the SQL because') . ' - ' . DB_error_msg(),'error'); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $SQL; @@ -181,7 +181,7 @@ if (DB_error_no() !=0) { $Title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); - prnMsg( _('The sales quantities could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); + prnMsg( _('The sales quantities could not be retrieved by the SQL because') . ' - ' . DB_error_msg(),'error'); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' .$SQL; @@ -218,7 +218,7 @@ if (DB_error_no() !=0) { $Title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); - prnMsg( _('The sales order demand quantities could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); + prnMsg( _('The sales order demand quantities could not be retrieved by the SQL because') . ' - ' . DB_error_msg(),'error'); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $SQL; @@ -267,7 +267,7 @@ if (DB_error_no() !=0) { $Title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); - prnMsg( _('The sales order demand quantities from parent assemblies could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); + prnMsg( _('The sales order demand quantities from parent assemblies could not be retrieved by the SQL because') . ' - ' . DB_error_msg(),'error'); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $SQL; Modified: trunk/InventoryPlanningPrefSupplier.php =================================================================== --- trunk/InventoryPlanningPrefSupplier.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/InventoryPlanningPrefSupplier.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -182,7 +182,7 @@ if (DB_error_no() !=0) { $Title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); - prnMsg(_('The inventory quantities could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); + prnMsg(_('The inventory quantities could not be retrieved by the SQL because') . ' - ' . DB_error_msg(),'error'); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $SQL; @@ -240,7 +240,7 @@ if (DB_error_no() !=0) { $Title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); - prnMsg( _('The sales quantities could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); + prnMsg( _('The sales quantities could not be retrieved by the SQL because') . ' - ' . DB_error_msg(),'error'); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $SQL; @@ -267,7 +267,7 @@ if (DB_error_no() !=0) { $Title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); - prnMsg( _('The sales order demand quantities could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); + prnMsg( _('The sales order demand quantities could not be retrieved by the SQL because') . ' - ' . DB_error_msg(),'error'); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $SQL; @@ -300,7 +300,7 @@ if (DB_error_no() !=0) { $Title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); - prnMsg( _('The sales order demand quantities from parent assemblies could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); + prnMsg( _('The sales order demand quantities from parent assemblies could not be retrieved by the SQL because') . ' - ' . DB_error_msg(),'error'); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $SQL; Modified: trunk/InventoryQuantities.php =================================================================== --- trunk/InventoryQuantities.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/InventoryQuantities.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -83,7 +83,7 @@ if (DB_error_no() !=0) { $Title = _('Inventory Quantities') . ' - ' . _('Problem Report'); include('includes/header.inc'); - prnMsg( _('The Inventory Quantity report could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); + prnMsg( _('The Inventory Quantity report could not be retrieved by the SQL because') . ' ' . DB_error_msg(),'error'); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $sql; Modified: trunk/InventoryValuation.php =================================================================== --- trunk/InventoryValuation.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/InventoryValuation.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -69,7 +69,7 @@ if (DB_error_no() !=0) { $Title = _('Inventory Valuation') . ' - ' . _('Problem Report'); include('includes/header.inc'); - prnMsg( _('The inventory valuation could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); + prnMsg( _('The inventory valuation could not be retrieved by the SQL because') . ' ' . DB_error_msg(),'error'); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $SQL; Modified: trunk/MRPPlannedPurchaseOrders.php =================================================================== --- trunk/MRPPlannedPurchaseOrders.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/MRPPlannedPurchaseOrders.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -113,7 +113,7 @@ if (DB_error_no() !=0) { $Title = _('MRP Planned Purchase Orders') . ' - ' . _('Problem Report'); include('includes/header.inc'); - prnMsg( _('The MRP planned purchase orders could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); + prnMsg( _('The MRP planned purchase orders could not be retrieved by the SQL because') . ' ' . DB_error_msg(),'error'); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $sql; Modified: trunk/MRPPlannedWorkOrders.php =================================================================== --- trunk/MRPPlannedWorkOrders.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/MRPPlannedWorkOrders.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -105,7 +105,7 @@ if (DB_error_no() !=0) { $Title = _('MRP Planned Work Orders') . ' - ' . _('Problem Report'); include('includes/header.inc'); - prnMsg( _('The MRP planned work orders could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); + prnMsg( _('The MRP planned work orders could not be retrieved by the SQL because') . ' ' . DB_error_msg(),'error'); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $sql; Modified: trunk/MRPReschedules.php =================================================================== --- trunk/MRPReschedules.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/MRPReschedules.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -44,7 +44,7 @@ if (DB_error_no() !=0) { $Title = _('MRP Reschedules') . ' - ' . _('Problem Report'); include('includes/header.inc'); - prnMsg( _('The MRP reschedules could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); + prnMsg( _('The MRP reschedules could not be retrieved by the SQL because') . ' ' . DB_error_msg(),'error'); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $sql; Modified: trunk/MRPShortages.php =================================================================== --- trunk/MRPShortages.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/MRPShortages.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -154,7 +154,7 @@ if (DB_error_no() !=0) { $Title = _('MRP Shortages and Excesses') . ' - ' . _('Problem Report'); include('includes/header.inc'); - prnMsg( _('The MRP shortages and excesses could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); + prnMsg( _('The MRP shortages and excesses could not be retrieved by the SQL because') . ' ' . DB_error_msg(),'error'); echo '<br/><a href="' .$RootPath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br/>' . $sql; Modified: trunk/MailInventoryValuation.php =================================================================== --- trunk/MailInventoryValuation.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/MailInventoryValuation.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -118,7 +118,7 @@ if (DB_error_no() !=0) { $Title = _('Inventory Valuation') . ' - ' . _('Problem Report'); include('includes/header.inc'); - echo _('The inventory valuation could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db); + echo _('The inventory valuation could not be retrieved by the SQL because') . ' - ' . DB_error_msg(); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $SQL; Modified: trunk/OutstandingGRNs.php =================================================================== --- trunk/OutstandingGRNs.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/OutstandingGRNs.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -45,7 +45,7 @@ if (DB_error_no() !=0) { $Title = _('Outstanding GRN Valuation') . ' - ' . _('Problem Report'); include('includes/header.inc'); - prnMsg(_('The outstanding GRNs valuation details could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); + prnMsg(_('The outstanding GRNs valuation details could not be retrieved by the SQL because') . ' - ' . DB_error_msg(),'error'); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu') . '</a>'; /* if ($debug==1){ Modified: trunk/PDFCustomerList.php =================================================================== --- trunk/PDFCustomerList.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/PDFCustomerList.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -231,7 +231,7 @@ if (DB_error_no() !=0) { $Title = _('Customer List') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); - prnMsg( _('The customer List could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db) ); + prnMsg( _('The customer List could not be retrieved by the SQL because') . ' - ' . DB_error_msg() ); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu'). '</a>'; if ($debug==1){ echo '<br />' . $SQL; Modified: trunk/PDFLowGP.php =================================================================== --- trunk/PDFLowGP.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/PDFLowGP.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -55,7 +55,7 @@ if (DB_error_no() !=0) { include('includes/header.inc'); - prnMsg(_('The low GP items could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); + prnMsg(_('The low GP items could not be retrieved by the SQL because') . ' - ' . DB_error_msg(),'error'); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $SQL; Modified: trunk/PDFPriceList.php =================================================================== --- trunk/PDFPriceList.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/PDFPriceList.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -150,7 +150,7 @@ if (DB_error_no() !=0) { $Title = _('Price List') . ' - ' . _('Problem Report....'); include('includes/header.inc'); - prnMsg( _('The Price List could not be retrieved by the SQL because'). ' - ' . DB_error_msg($db), 'error'); + prnMsg( _('The Price List could not be retrieved by the SQL because'). ' - ' . DB_error_msg(), 'error'); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu'). '</a>'; if ($debug==1) { prnMsg(_('For debugging purposes the SQL used was:') . $SQL,'error'); Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/PDFPrintLabel.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -41,7 +41,7 @@ $LabelsResult = DB_query($SQL,'','',false,false); if (DB_error_no() !=0) { - prnMsg( _('The Price Labels could not be retrieved by the SQL because'). ' - ' . DB_error_msg($db), 'error'); + prnMsg( _('The Price Labels could not be retrieved by the SQL because'). ' - ' . DB_error_msg(), 'error'); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu'). '</a>'; if ($debug==1){ prnMsg(_('For debugging purposes the SQL used was:') . $SQL,'error'); Modified: trunk/PDFRemittanceAdvice.php =================================================================== --- trunk/PDFRemittanceAdvice.php 2014-10-27 07:06:42 UTC (rev 6943) +++ trunk/PDFRemittanceAdvice.php 2014-10-27 07:15:34 UTC (rev 6944) @@ -79,7 +79,7 @@ if (DB_error_no() !=0) { $Title = _('Remittance Advice Problem Report'); include('includes/header.inc'); - prnMsg(_('The details of the payment to the supplier could not be retrieved because') . ' - ' . DB_error_msg($db),'error'); + prnMsg(_('The details of the payment to the supplier could not be retrieved because') . ' - ' . DB_error_msg(),'error'); echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ ... [truncated message content] |
From: <dai...@us...> - 2014-10-27 07:21:00
|
Revision: 6945 http://sourceforge.net/p/web-erp/reponame/6945 Author: daintree Date: 2014-10-27 07:20:48 +0000 (Mon, 27 Oct 2014) Log Message: ----------- removed all $db from DB_Txn_XXXXX($db) calls Modified Paths: -------------- trunk/BankReconciliation.php trunk/ConfirmDispatch_Invoice.php trunk/ContractCosting.php trunk/Contracts.php trunk/CopyBOM.php trunk/CounterReturns.php trunk/CounterSales.php trunk/Credit_Invoice.php trunk/Currencies.php trunk/CustomerAllocations.php trunk/CustomerReceipt.php trunk/DeliveryDetails.php trunk/Departments.php trunk/FixedAssetDepreciation.php trunk/FixedAssetItems.php trunk/GLJournal.php trunk/GoodsReceived.php trunk/ImportBankTrans.php trunk/InternalStockRequest.php trunk/InternalStockRequestFulfill.php trunk/PDFStockCheckComparison.php trunk/PO_Items.php trunk/Payments.php trunk/PcAuthorizeExpenses.php trunk/RecurringSalesOrders.php trunk/RecurringSalesOrdersProcess.php trunk/ReverseGRN.php trunk/SelectCreditItems.php trunk/SelectSalesOrder.php trunk/ShipmentCosting.php trunk/ShopParameters.php trunk/SpecialOrder.php trunk/StockAdjustments.php trunk/StockClone.php trunk/StockCostUpdate.php trunk/StockLocTransfer.php trunk/StockLocTransferReceive.php trunk/StockTransfers.php trunk/Stocks.php trunk/SuppPaymentRun.php trunk/SupplierAllocations.php trunk/SupplierCredit.php trunk/SupplierInvoice.php trunk/SystemParameters.php trunk/TaxCategories.php trunk/UnitsOfMeasure.php trunk/WOSerialNos.php trunk/WorkOrderCosting.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/WorkOrderReceive.php trunk/Z_BottomUpCosts.php trunk/Z_ChangeBranchCode.php trunk/Z_ChangeCustomerCode.php trunk/Z_ChangeGLAccountCode.php trunk/Z_ChangeLocationCode.php trunk/Z_ChangeStockCategory.php trunk/Z_ChangeStockCode.php trunk/Z_ChangeSupplierCode.php trunk/Z_CreateChartDetails.php trunk/Z_DeleteCreditNote.php trunk/Z_DeleteInvoice.php trunk/Z_ImportDebtors.php trunk/Z_ImportFixedAssets.php trunk/Z_ImportGLTransactions.php trunk/Z_ImportPriceList.php trunk/Z_ImportStocks.php trunk/Z_ImportSuppliers.php trunk/api/api_debtortransactions.php trunk/api/api_purchdata.php trunk/api/api_salesorders.php trunk/api/api_stock.php trunk/api/api_workorders.php trunk/includes/DefineTenderClass.php trunk/includes/GLPostings.inc trunk/includes/PDFPaymentRun_PymtFooter.php trunk/includes/SQL_CommonFunctions.inc Modified: trunk/BankReconciliation.php =================================================================== --- trunk/BankReconciliation.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/BankReconciliation.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -53,7 +53,7 @@ /*Post the exchange difference to the last day of the month prior to current date*/ $PostingDate = Date($_SESSION['DefaultDateFormat'],mktime(0,0,0, Date('m'), 0,Date('Y'))); $PeriodNo = GetPeriod($PostingDate,$db); - $result = DB_Txn_Begin($db); + $result = DB_Txn_Begin(); //yet to code the journal @@ -92,7 +92,7 @@ $result = DB_query($SQL,$ErrMsg,$DbgMsg,true); - $result = DB_Txn_Commit($db); + $result = DB_Txn_Commit(); prnMsg(_('Exchange difference of') . ' ' . locale_number_format($ExchangeDifference,$_SESSION['CompanyRecord']['decimalplaces']) . ' ' . _('has been posted'),'success'); } //end if the bank statement balance was numeric } Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/ConfirmDispatch_Invoice.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -750,7 +750,7 @@ /*Start an SQL transaction */ - DB_Txn_Begin($db); + DB_Txn_Begin(); if ($DefaultShipVia != $_SESSION['Items'.$identifier]->ShipVia){ $SQL = "UPDATE custbranch @@ -1630,7 +1630,7 @@ EnsureGLEntriesBalance(10,$InvoiceNo,$db); } /*end of if Sales and GL integrated */ - DB_Txn_Commit($db); + DB_Txn_Commit(); // ************************************************************************* // E N D O F I N V O I C E S Q L P R O C E S S I N G // ************************************************************************* Modified: trunk/ContractCosting.php =================================================================== --- trunk/ContractCosting.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/ContractCosting.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -238,7 +238,7 @@ $ContractCloseNo = GetNextTransNo( 32 ,$db); $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); - DB_Txn_Begin($db); + DB_Txn_Begin(); $SQL = "INSERT INTO gltrans (type, typeno, @@ -432,7 +432,7 @@ }//end if there was a row returned from the woitems query } //end if the work order was still open (so end of closing it and processing receipt if necessary) - DB_Txn_Commit($db); + DB_Txn_Commit(); $_SESSION['Contract'.$identifier]->Status=3; prnMsg(_('The contract has been closed. No further charges can be posted against this contract.'),'success'); Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/Contracts.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -529,7 +529,7 @@ $CustomerDetailsRow = DB_fetch_array($CustomerDetailsResult); //start a DB transaction - $Result = DB_Txn_Begin($db); + $Result = DB_Txn_Begin(); $OrderNo = GetNextTransNo(30, $db); $HeaderSQL = "INSERT INTO salesorders ( orderno, debtorno, @@ -600,7 +600,7 @@ WHERE contractref='" . DB_escape_string($_SESSION['Contract'.$identifier]->ContractRef) . "'"; $ErrMsg = _('Unable to update the contract status and order number because'); $UpdContractResult = DB_query($sql,$ErrMsg,$DbgMsg,true); - $Result = DB_Txn_Commit($db); + $Result = DB_Txn_Commit(); $_SESSION['Contract'.$identifier]->Status=1; $_SESSION['Contract'.$identifier]->OrderNo=$OrderNo; prnMsg(_('The contract has been made into quotation number') . ' ' . $OrderNo,'info'); Modified: trunk/CopyBOM.php =================================================================== --- trunk/CopyBOM.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/CopyBOM.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -30,7 +30,7 @@ $NewStockID = $_POST['ExStockID']; } if ($InputError==0){ - $result = DB_Txn_Begin($db); + $result = DB_Txn_Begin(); if($NewOrExisting == 'N') { /* duplicate rows into stockmaster */ @@ -150,7 +150,7 @@ $result = DB_query($sql); } - $result = DB_Txn_Commit($db); + $result = DB_Txn_Commit(); UpdateCost($db, $NewStockID); Modified: trunk/CounterReturns.php =================================================================== --- trunk/CounterReturns.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/CounterReturns.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -903,7 +903,7 @@ // ************************************************************************* // S T A R T O F C R E D I T N O T E S Q L P R O C E S S I N G // ************************************************************************* - $result = DB_Txn_Begin($db); + $result = DB_Txn_Begin(); /*Now Get the next invoice number - GetNextTransNo() function in SQL_CommonFunctions * GetPeriod() in includes/DateFunctions.inc */ @@ -1585,7 +1585,7 @@ $result = DB_query($SQL,$ErrMsg,$DbgMsg,true); } //end if $_POST['AmountPaid']!= 0 - DB_Txn_Commit($db); + DB_Txn_Commit(); // ************************************************************************* // E N D O F C R E D I T N O T E S Q L P R O C E S S I N G // ************************************************************************* Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/CounterSales.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -1069,7 +1069,7 @@ // ************************************************************************* // S T A R T O F I N V O I C E S Q L P R O C E S S I N G // ************************************************************************* - $result = DB_Txn_Begin($db); + $result = DB_Txn_Begin(); /*First add the order to the database - it only exists in the session currently! */ $OrderNo = GetNextTransNo(30, $db); $InvoiceNo = GetNextTransNo(10, $db); @@ -2034,7 +2034,7 @@ $result = DB_query($SQL,$ErrMsg,$DbgMsg,true); } //end if $_POST['AmountPaid']!= 0 - DB_Txn_Commit($db); + DB_Txn_Commit(); // ************************************************************************* // E N D O F I N V O I C E S Q L P R O C E S S I N G // ************************************************************************* Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/Credit_Invoice.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -538,7 +538,7 @@ /*Start an SQL transaction */ - $Result = DB_Txn_Begin($db); + $Result = DB_Txn_Begin(); $DefaultDispatchDate= FormatDateForSQL($DefaultDispatchDate); @@ -1472,7 +1472,7 @@ } /*end of if Sales and GL integrated */ - $Result = DB_Txn_Commit($db); + $Result = DB_Txn_Commit(); unset($_SESSION['CreditItems' . $identifier]->LineItems); unset($_SESSION['CreditItems' . $identifier]); Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/Currencies.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -134,7 +134,7 @@ } //run the SQL from either of the above possibilites $ExDiffTransNo = GetNextTransNo(36,$db); - $resultTx = DB_Txn_Begin($db); + $resultTx = DB_Txn_Begin(); $result = DB_query($sql); if ($InputError!=1){ @@ -219,7 +219,7 @@ } } } - $resultTx = DB_Txn_Commit($db); + $resultTx = DB_Txn_Commit(); unset($SelectedCurrency); unset($_POST['Country']); Modified: trunk/CustomerAllocations.php =================================================================== --- trunk/CustomerAllocations.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/CustomerAllocations.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -83,7 +83,7 @@ //========[ START TRANSACTION ]=========== // $Error = ''; - $Result= DB_Txn_Begin($db); + $Result= DB_Txn_Begin(); $AllAllocations = 0; foreach ($_SESSION['Alloc']->Allocs as $AllocnItem) { if ($AllocnItem->PrevAllocRecordID != 'NA') { @@ -197,9 +197,9 @@ //========[ COMMIT TRANSACTION ]=========== // if (empty($Error) ) { - $Result = DB_Txn_Commit($db); + $Result = DB_Txn_Commit(); } else { - $Result = DB_Txn_Rollback($db); + $Result = DB_Txn_Rollback(); prnMsg($Error,'error'); } unset($_SESSION['Alloc']); Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/CustomerReceipt.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -255,7 +255,7 @@ $_SESSION['ReceiptBatch']->BatchNo = GetNextTransNo(12,$db); /*Start a transaction to do the whole lot inside */ - $result = DB_Txn_Begin($db); + $result = DB_Txn_Begin(); $BatchReceiptsTotal = 0; //in functional currency $BatchDiscount = 0; //in functional currency @@ -572,7 +572,7 @@ $ErrMsg = _('Cannot commit the changes'); $DbgMsg = _('The SQL that failed was'); - $result = DB_Txn_Commit($db); + $result = DB_Txn_Commit(); echo '<br />'; prnMsg( _('Receipt batch') . ' ' . $_SESSION['ReceiptBatch']->BatchNo . ' ' . _('has been successfully entered into the database'),'success'); Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/DeliveryDetails.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -333,7 +333,7 @@ $QuotDate = FormatDateforSQL($_SESSION['Items'.$identifier]->QuoteDate); $ConfDate = FormatDateforSQL($_SESSION['Items'.$identifier]->ConfirmedDate); - $Result = DB_Txn_Begin($db); + $Result = DB_Txn_Begin(); $OrderNo = GetNextTransNo(30, $db); @@ -584,7 +584,7 @@ }//end if auto create WOs in on } /* end inserted line items into sales order details */ - $result = DB_Txn_Commit($db); + $result = DB_Txn_Commit(); echo '<br />'; if ($_SESSION['Items'.$identifier]->Quotation==1){ prnMsg(_('Quotation Number') . ' ' . $OrderNo . ' ' . _('has been entered'),'success'); @@ -653,7 +653,7 @@ $QuotDate = FormatDateforSQL($_SESSION['Items'.$identifier]->QuoteDate); $ConfDate = FormatDateforSQL($_SESSION['Items'.$identifier]->ConfirmedDate); - $Result = DB_Txn_Begin($db); + $Result = DB_Txn_Begin(); /*see if this is a contract quotation being changed to an order? */ if ($_SESSION['Items'.$identifier]->Quotation==0) { //now its being changed? to an order @@ -797,7 +797,7 @@ } /* updated line items into sales order details */ - $Result=DB_Txn_Commit($db); + $Result=DB_Txn_Commit(); $Quotation = $_SESSION['Items'.$identifier]->Quotation; unset($_SESSION['Items'.$identifier]->LineItems); unset($_SESSION['Items'.$identifier]); Modified: trunk/Departments.php =================================================================== --- trunk/Departments.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/Departments.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -92,7 +92,7 @@ if ($InputError!=1){ //run the SQL from either of the above possibilites if (is_array($sql)) { - $result = DB_Txn_Begin($db); + $result = DB_Txn_Begin(); $ErrMsg = _('The department could not be inserted'); $DbgMsg = _('The sql that failed was') . ':'; foreach ($sql as $SQLStatement ) { @@ -103,9 +103,9 @@ } } if ($InputError!=1){ - $result = DB_Txn_Commit($db); + $result = DB_Txn_Commit(); } else { - $result = DB_Txn_Rollback($db); + $result = DB_Txn_Rollback(); } } else { $result = DB_query($sql); Modified: trunk/FixedAssetDepreciation.php =================================================================== --- trunk/FixedAssetDepreciation.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/FixedAssetDepreciation.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -80,7 +80,7 @@ $InputError =true; } if (isset($_POST['CommitDepreciation']) AND $InputError==false){ - $result = DB_Txn_Begin($db); + $result = DB_Txn_Begin(); $TransNo = GetNextTransNo(44, $db); $PeriodNo = GetPeriod($_POST['ProcessDate'],$db); } @@ -266,7 +266,7 @@ <br />'; if (isset($_POST['CommitDepreciation']) AND $InputError==false){ - $result = DB_Txn_Commit($db); + $result = DB_Txn_Commit(); prnMsg(_('Depreciation') . ' ' . $TransNo . ' ' . _('has been successfully entered'),'success'); unset($_POST['ProcessDate']); echo '<br /><a href="index.php">' ._('Return to main menu') . '</a>'; Modified: trunk/FixedAssetItems.php =================================================================== --- trunk/FixedAssetItems.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/FixedAssetItems.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -127,7 +127,7 @@ if ($_POST['submit']==_('Update')) { /*so its an existing one */ /*Start a transaction to do the whole lot inside */ - $result = DB_Txn_Begin($db); + $result = DB_Txn_Begin(); /*Need to check if changing the balance sheet codes - as will need to do journals for the cost and accum depn of the asset to the new category */ $result = DB_query("SELECT assetcategoryid, @@ -279,7 +279,7 @@ unset($_POST['BarCode']); unset($_POST['SerialNo']); }//ALL WORKED SO RESET THE FORM VARIABLES - $result = DB_Txn_Commit($db); + $result = DB_Txn_Commit(); } } else { echo '<br />' . "\n"; @@ -315,7 +315,7 @@ prnMsg(_('There is a purchase order set up for this asset. The purchase order line must be deleted first'),'error'); } if ($CancelDelete==0) { - $result = DB_Txn_Begin($db); + $result = DB_Txn_Begin(); /*Need to remove cost and accumulate depreciation from cost and accumdepn accounts */ $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']),$db); @@ -366,7 +366,7 @@ $sql="DELETE FROM fixedassets WHERE assetid='" . $AssetID . "'"; $result=DB_query($sql, _('Could not delete the asset record'),'',true); - $result = DB_Txn_Commit($db); + $result = DB_Txn_Commit(); prnMsg(_('Deleted the asset record for asset number' ) . ' ' . $AssetID ); unset($_POST['LongDescription']); @@ -382,7 +382,7 @@ } //end if OK Delete Asset } /* end if delete asset */ -$result = DB_Txn_Commit($db); +$result = DB_Txn_Commit(); echo '<form id="AssetForm" enctype="multipart/form-data" method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '"> <div>'; Modified: trunk/GLJournal.php =================================================================== --- trunk/GLJournal.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/GLJournal.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -61,7 +61,7 @@ $PeriodNo = GetPeriod($_SESSION['JournalDetail']->JnlDate,$db); /*Start a transaction to do the whole lot inside */ - $result = DB_Txn_Begin($db); + $result = DB_Txn_Begin(); $TransNo = GetNextTransNo( 0, $db); @@ -114,7 +114,7 @@ $ErrMsg = _('Cannot commit the changes'); - $result= DB_Txn_Commit($db); + $result= DB_Txn_Commit(); prnMsg(_('Journal').' ' . $TransNo . ' '._('has been successfully entered'),'success'); Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/GoodsReceived.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -386,7 +386,7 @@ /* *********************** BEGIN SQL TRANSACTIONS *********************** */ - $Result = DB_Txn_Begin($db); + $Result = DB_Txn_Begin(); /*Now Get the next GRN - function in SQL_CommonFunctions*/ $GRN = GetNextTransNo(25, $db); @@ -730,7 +730,7 @@ EnsureGLEntriesBalance(25, $GRN,$db); } - $Result = DB_Txn_Commit($db); + $Result = DB_Txn_Commit(); $PONo = $_SESSION['PO'.$identifier]->OrderNo; unset($_SESSION['PO'.$identifier]->LineItems); unset($_SESSION['PO'.$identifier]); Modified: trunk/ImportBankTrans.php =================================================================== --- trunk/ImportBankTrans.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/ImportBankTrans.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -161,7 +161,7 @@ */ for($i=1;$i<=count($_SESSION['Trans']);$i++){ - DB_Txn_Begin($db); + DB_Txn_Begin(); if ($_SESSION['Trans'][$i]->DebtorNo!='' OR $_SESSION['Trans'][$i]->SupplierID!='' OR $_SESSION['Trans'][$i]->GLTotal == $_SESSION['Trans'][$i]->Amount){ @@ -452,7 +452,7 @@ _('The SQL that failed to insert the bank transaction was'), true); } - DB_Txn_Commit($db); // complete this bank transactions posting + DB_Txn_Commit(); // complete this bank transactions posting } //end loop around the transactions echo '<p />'; prnMsg(_('Completed the importing of analysed bank transactions'),'info'); Modified: trunk/InternalStockRequest.php =================================================================== --- trunk/InternalStockRequest.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/InternalStockRequest.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -60,7 +60,7 @@ } if (isset($_POST['Submit'])) { - DB_Txn_Begin($db); + DB_Txn_Begin(); $InputError=0; if ($_SESSION['Request']->Department=='') { prnMsg( _('You must select a Department for the request'), 'error'); @@ -127,7 +127,7 @@ } } - DB_Txn_Commit($db); + DB_Txn_Commit(); prnMsg( _('The internal stock request has been entered and now needs to be authorised'), 'success'); echo '<br /><div class="centre"><a href="'. htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?New=Yes">' . _('Create another request') . '</a></div>'; include('includes/footer.inc'); Modified: trunk/InternalStockRequestFulfill.php =================================================================== --- trunk/InternalStockRequestFulfill.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/InternalStockRequestFulfill.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -42,7 +42,7 @@ $PeriodNo = GetPeriod (Date($_SESSION['DefaultDateFormat']), $db); $SQLAdjustmentDate = FormatDateForSQL(Date($_SESSION['DefaultDateFormat'])); - $Result = DB_Txn_Begin($db); + $Result = DB_Txn_Begin(); // Need to get the current location quantity will need it later for the stock movement $SQL="SELECT locstock.quantity @@ -166,7 +166,7 @@ $Result = DB_query($SQL, $ErrMsg, $DbgMsg,true); } - $Result = DB_Txn_Commit($db); + $Result = DB_Txn_Commit(); $ConfirmationText = _('An internal stock request for'). ' ' . $StockID . ' ' . _('has been fulfilled from location').' ' . $Location .' '. _('for a quantity of') . ' ' . locale_number_format($Quantity, $DecimalPlaces ) ; prnMsg( $ConfirmationText,'success'); Modified: trunk/PDFStockCheckComparison.php =================================================================== --- trunk/PDFStockCheckComparison.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/PDFStockCheckComparison.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -79,7 +79,7 @@ if ($StockQtyDifference !=0){ // only adjust stock if there is an adjustment to make!! - DB_Txn_Begin($db); + DB_Txn_Begin(); // Need to get the current location quantity will need it later for the stock movement $SQL="SELECT locstock.quantity @@ -171,7 +171,7 @@ } //END INSERT GL TRANS $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Unable to COMMIT transaction while adjusting stock in StockCheckAdjustmet report'); - DB_Txn_Commit($db); + DB_Txn_Commit(); } // end if $StockQtyDifference !=0 Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/PO_Items.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -78,7 +78,7 @@ */ if ($InputError!=1){ - $result = DB_Txn_Begin($db); + $result = DB_Txn_Begin(); /*figure out what status to set the order to */ if (IsEmailAddress($_SESSION['UserEmail'])){ @@ -388,7 +388,7 @@ } /*end of if its a new order or an existing one */ - $Result = DB_Txn_Commit($db); + $Result = DB_Txn_Commit(); /* Only show the link to auto receive the order if the user has permission to receive goods and permission to authorise and has authorised the order */ if ($_SESSION['PO'.$identifier]->Status == 'Authorised' AND in_array($_SESSION['PageSecurityArray']['GoodsReceived.php'], $_SESSION['AllowedPageSecurityTokens'])){ Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/Payments.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -319,7 +319,7 @@ //Start a transaction to do the whole lot inside - $result = DB_Txn_Begin($db); + $result = DB_Txn_Begin(); if ($_SESSION['PaymentDetail' . $identifier]->SupplierID=='') { @@ -589,7 +589,7 @@ $DbgMsg = _('Cannot insert a bank transaction using the SQL'); $result = DB_query($SQL,$ErrMsg,$DbgMsg,true); - DB_Txn_Commit($db); + DB_Txn_Commit(); prnMsg(_('Payment') . ' ' . $TransNo . ' ' . _('has been successfully entered'),'success'); $LastSupplier = ($_SESSION['PaymentDetail' . $identifier]->SupplierID); Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/PcAuthorizeExpenses.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -141,7 +141,7 @@ //build narrative $Narrative= _('PettyCash') . ' - '. $myrow['tabcode'] . ' - ' . $myrow['codeexpense'] . ' - ' . DB_escape_string($myrow['notes']) . ' - ' . $myrow['receipt']; //insert to gltrans - DB_Txn_Begin($db); + DB_Txn_Begin(); $sqlFrom="INSERT INTO `gltrans` (`counterindex`, `type`, @@ -232,7 +232,7 @@ posted = 1 WHERE counterindex = '".$myrow['counterindex']."'"; $resultupdate = DB_query($sql, '', '', true); - DB_Txn_Commit($db); + DB_Txn_Commit(); } if ($k==1){ Modified: trunk/RecurringSalesOrders.php =================================================================== --- trunk/RecurringSalesOrders.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/RecurringSalesOrders.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -189,7 +189,7 @@ exit; } If (isset($_POST['Process'])) { - $Result = DB_Txn_Begin($db); + $Result = DB_Txn_Begin(); $InputErrors =0; If (!Is_Date($_POST['StartDate'])){ $InputErrors =1; @@ -290,7 +290,7 @@ } /* inserted line items into sales order details */ - $result = DB_Txn_Commit($db); + $result = DB_Txn_Commit(); prnmsg(_('The new recurring order template has been added'),'success'); } else { /* must be updating an existing recurring order */ Modified: trunk/RecurringSalesOrdersProcess.php =================================================================== --- trunk/RecurringSalesOrdersProcess.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/RecurringSalesOrdersProcess.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -89,7 +89,7 @@ $EmailText =''; echo '<br />' . _('Recurring order') . ' ' . $RecurrOrderRow['recurrorderno'] . ' ' . _('for') . ' ' . $RecurrOrderRow['debtorno'] . ' - ' . $RecurrOrderRow['branchcode'] . ' ' . _('is being processed'); - $result = DB_Txn_Begin($db); + $result = DB_Txn_Begin(); /*the last recurrence was the date of the last time the order recurred the frequency is the number of times per annum that the order should recurr @@ -197,7 +197,7 @@ $ErrMsg = _('Could not update the last recurrence of the recurring order template. The database reported the error:'); $Result = DB_query($sql,$ErrMsg,true); - $Result = DB_Txn_Commit($db); + $Result = DB_Txn_Commit(); prnMsg(_('Recurring order was created for') . ' ' . $RecurrOrderRow['name'] . ' ' . _('with order Number') . ' ' . $OrderNo, 'success'); @@ -241,7 +241,7 @@ $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); /*Start an SQL transaction */ - $result = DB_Txn_Begin($db); + $result = DB_Txn_Begin(); $TotalFXNetInvoice = 0; $TotalFXTax = 0; @@ -695,7 +695,7 @@ $DbgMsg = _('The following SQL to insert the debtor transaction taxes record was used'); $Result = DB_query($SQL,$ErrMsg,$DbgMsg,true); - $Result = DB_Txn_Commit($db); + $Result = DB_Txn_Commit(); prnMsg(_('Invoice number'). ' '. $InvoiceNo .' '. _('processed'),'success'); Modified: trunk/ReverseGRN.php =================================================================== --- trunk/ReverseGRN.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/ReverseGRN.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -115,7 +115,7 @@ /*Start an SQL transaction */ - $Result = DB_Txn_Begin($db); + $Result = DB_Txn_Begin(); $PeriodNo = GetPeriod(ConvertSQLDate($GRN['deliverydate']), $db); @@ -332,7 +332,7 @@ } /* end of if GL and stock integrated*/ - $Result = DB_Txn_Commit($db); + $Result = DB_Txn_Commit(); echo '<br />' . _('GRN number') . ' ' . $_GET['GRNNo'] . ' ' . _('for') . ' ' . $QtyToReverse . ' x ' . $GRN['itemcode'] . ' - ' . $GRN['itemdescription'] . ' ' . _('has been reversed') . '<br />'; unset($_GET['GRNNo']); // to ensure it cant be done again!! Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/SelectCreditItems.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -1125,7 +1125,7 @@ $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); /*Start an SQL transaction */ - DB_Txn_Begin($db); + DB_Txn_Begin(); /*Now insert the Credit Note into the DebtorTrans table allocations will have to be done seperately*/ @@ -1988,7 +1988,7 @@ } /*end of if Sales and GL integrated */ - DB_Txn_Commit($db); + DB_Txn_Commit(); unset($_SESSION['CreditItems'.$identifier]->LineItems); unset($_SESSION['CreditItems'.$identifier]); Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/SelectSalesOrder.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -231,11 +231,11 @@ if ($SupplierID !=''){ //then we have just added a purchase order echo '<br />'; prnMsg(_('Purchase Order') . ' ' . $PO_OrderNo . ' ' . _('on') . ' ' . $SupplierID . ' ' . _('has been created'),'success'); - DB_Txn_Commit($db); + DB_Txn_Commit(); } /*Starting a new purchase order with a different supplier */ - $result = DB_Txn_Begin($db); + $result = DB_Txn_Begin(); $PO_OrderNo = GetNextTransNo(18, $db); //get the next PO number @@ -394,7 +394,7 @@ if ($SupplierID !=''){ //then we have just added a purchase order irrespective of autoauthorise status echo '<br />'; prnMsg(_('Purchase Order') . ' ' . $PO_OrderNo . ' ' . _('on') . ' ' . $SupplierID . ' ' . _('has been created'),'success'); - DB_Txn_Commit($db); + DB_Txn_Commit(); } $result = DB_query("UPDATE salesorders SET poplaced=1 WHERE " . $OrdersToPlacePOFor); }/*There were items that had purchasing data set up to create POs for */ Modified: trunk/ShipmentCosting.php =================================================================== --- trunk/ShipmentCosting.php 2014-10-27 07:15:34 UTC (rev 6944) +++ trunk/ShipmentCosting.php 2014-10-27 07:20:48 UTC (rev 6945) @@ -136,7 +136,7 @@ if (isset($_POST['Close'])){ /*Set up a transaction to buffer all updates or none */ - $result = DB_Txn_Begin($db); + $result = ... [truncated message content] |
From: <dai...@us...> - 2014-10-27 07:30:22
|
Revision: 6946 http://sourceforge.net/p/web-erp/reponame/6946 Author: daintree Date: 2014-10-27 07:30:11 +0000 (Mon, 27 Oct 2014) Log Message: ----------- removed all $db from DB_Maintenance($db) calls Modified Paths: -------------- trunk/AccountGroups.php trunk/UpgradeDatabase.php trunk/Z_ChangeBranchCode.php trunk/Z_ChangeCustomerCode.php trunk/Z_ChangeGLAccountCode.php trunk/Z_ChangeLocationCode.php trunk/Z_ChangeStockCode.php trunk/api/api_login.php trunk/doc/Change.log trunk/includes/ConnectDB_mysql.inc trunk/includes/ConnectDB_mysqli.inc trunk/includes/ConnectDB_postgres.inc trunk/includes/UserLogin.php Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2014-10-27 07:20:48 UTC (rev 6945) +++ trunk/AccountGroups.php 2014-10-27 07:30:11 UTC (rev 6946) @@ -143,7 +143,7 @@ /*SelectedAccountGroup could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ if ($_POST['SelectedAccountGroup']!==$_POST['GroupName']) { - DB_IgnoreForeignKeys($db); + DB_IgnoreForeignKeys(); $sql = "UPDATE chartmaster SET group_='" . $_POST['GroupName'] . "' @@ -159,7 +159,7 @@ $result = DB_query($sql, $ErrMsg, $DbgMsg); - DB_ReinstateForeignKeys($db); + DB_ReinstateForeignKeys(); } $sql = "UPDATE accountgroups SET groupname='" . $_POST['GroupName'] . "', Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2014-10-27 07:20:48 UTC (rev 6945) +++ trunk/UpgradeDatabase.php 2014-10-27 07:30:11 UTC (rev 6946) @@ -191,7 +191,7 @@ prnMsg(_('Only mysql upgrades are performed seamlessly at this time. Your database will need to be manually updated'),'info'); } - $result = DB_IgnoreForeignKeys($db); + $result = DB_IgnoreForeignKeys(); foreach ($SQLScripts AS $SQLScriptFile) { @@ -269,7 +269,7 @@ } //end of for loop around the lines of the sql script echo '</table>'; } //end of loop around SQLScripts apply - $result =DB_ReinstateForeignKeys($db); + $result =DB_ReinstateForeignKeys(); /*Now get the modified VersionNumber and script pagesecurities */ $ForceConfigReload=true; include('includes/GetConfig.php'); Modified: trunk/Z_ChangeBranchCode.php =================================================================== --- trunk/Z_ChangeBranchCode.php 2014-10-27 07:20:48 UTC (rev 6945) +++ trunk/Z_ChangeBranchCode.php 2014-10-27 07:30:11 UTC (rev 6946) @@ -180,7 +180,7 @@ $result = DB_Txn_Commit(); - $result = DB_IgnoreForeignKeys($db); + $result = DB_IgnoreForeignKeys(); prnMsg(_('Deleting the old customer branch record'),'info'); $sql = "DELETE FROM custbranch WHERE debtorno='" . $_POST['DebtorNo'] . "' @@ -188,7 +188,7 @@ $ErrMsg = _('The SQL to delete the old customer branch record failed because'); $result = DB_query($sql,$ErrMsg,$DbgMsg,true,true); - $result = DB_ReinstateForeignKeys($db); + $result = DB_ReinstateForeignKeys(); } Modified: trunk/Z_ChangeCustomerCode.php =================================================================== --- trunk/Z_ChangeCustomerCode.php 2014-10-27 07:20:48 UTC (rev 6945) +++ trunk/Z_ChangeCustomerCode.php 2014-10-27 07:30:11 UTC (rev 6946) @@ -203,7 +203,7 @@ $ErrMsg = _('The SQL to update contract header records failed'); $result = DB_query($sql,$ErrMsg,$DbgMsg,true); - $result = DB_IgnoreForeignKeys($db); + $result = DB_IgnoreForeignKeys(); prnMsg(_('Deleting the old customer branch records from the CustBranch table'),'info'); $sql = "DELETE FROM custbranch WHERE debtorno='" . $_POST['OldDebtorNo'] . "'"; @@ -219,7 +219,7 @@ $result = DB_Txn_Commit(); - $result = DB_ReinstateForeignKeys($db); + $result = DB_ReinstateForeignKeys(); } Modified: trunk/Z_ChangeGLAccountCode.php =================================================================== --- trunk/Z_ChangeGLAccountCode.php 2014-10-27 07:20:48 UTC (rev 6945) +++ trunk/Z_ChangeGLAccountCode.php 2014-10-27 07:30:11 UTC (rev 6946) @@ -57,7 +57,7 @@ $result = DB_query($sql,$ErrMsg,$DbgMsg,true); echo ' ... ' . _('completed'); - DB_IgnoreForeignKeys($db); + DB_IgnoreForeignKeys(); ChangeFieldInTable("bankaccounts", "accountcode", $_POST['OldAccountCode'], $_POST['NewAccountCode'], $db); @@ -110,7 +110,7 @@ ChangeFieldInTable("workcentres", "overheadrecoveryact", $_POST['OldAccountCode'], $_POST['NewAccountCode'], $db); - DB_ReinstateForeignKeys($db); + DB_ReinstateForeignKeys(); $result = DB_Txn_Commit(); Modified: trunk/Z_ChangeLocationCode.php =================================================================== --- trunk/Z_ChangeLocationCode.php 2014-10-27 07:20:48 UTC (rev 6945) +++ trunk/Z_ChangeLocationCode.php 2014-10-27 07:30:11 UTC (rev 6946) @@ -49,7 +49,7 @@ if ($InputError ==0){ // no input errors $result = DB_Txn_Begin(); - DB_IgnoreForeignKeys($db); + DB_IgnoreForeignKeys(); echo '<br />' . _('Adding the new location record'); $sql = "INSERT INTO locations (loccode, @@ -223,7 +223,7 @@ $result = DB_query($sql,$ErrMsg,$DbgMsg,true); echo ' ... ' . _('completed'); - DB_ReinstateForeignKeys($db); + DB_ReinstateForeignKeys(); $result = DB_Txn_Commit(); Modified: trunk/Z_ChangeStockCode.php =================================================================== --- trunk/Z_ChangeStockCode.php 2014-10-27 07:20:48 UTC (rev 6945) +++ trunk/Z_ChangeStockCode.php 2014-10-27 07:30:11 UTC (rev 6946) @@ -51,7 +51,7 @@ if ($InputError ==0){ // no input errors - DB_IgnoreForeignKeys($db); + DB_IgnoreForeignKeys(); $result = DB_Txn_Begin(); echo '<br />' . _('Adding the new stock master record'); $sql = "INSERT INTO stockmaster (stockid, @@ -177,7 +177,7 @@ ChangeFieldInTable("offers", "stockid", $_POST['OldStockID'], $_POST['NewStockID'], $db); ChangeFieldInTable("tenderitems", "stockid", $_POST['OldStockID'], $_POST['NewStockID'], $db); - DB_ReinstateForeignKeys($db); + DB_ReinstateForeignKeys(); $result = DB_Txn_Commit(); Modified: trunk/api/api_login.php =================================================================== --- trunk/api/api_login.php 2014-10-27 07:20:48 UTC (rev 6945) +++ trunk/api/api_login.php 2014-10-27 07:30:11 UTC (rev 6946) @@ -114,7 +114,7 @@ ,'d') > $_SESSION['DB_Maintenance']){ /*Do the DB maintenance routing for the DB_type selected */ - DB_Maintenance($db); + DB_Maintenance(); //purge the audit trail if necessary if (isset($_SESSION['MonthsAuditTrail'])){ $sql = "DELETE FROM audittrail Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2014-10-27 07:20:48 UTC (rev 6945) +++ trunk/doc/Change.log 2014-10-27 07:30:11 UTC (rev 6946) @@ -1,5 +1,7 @@ webERP Change Log +27/10/14 Phil: Removed the $db parameter from all DB_Txn_Begin($db) DB_Txn_Commit($db) DB_Txn_Rollback($db)calls - $db is now global +27/10/14 Phil: Removed the $db parameter from all DB_Maintenance($db) calls - $db is now global 27/10/14 Phil: Removed the $db parameter from all DB_error_msg($db) calls - $db is now global 27/10/14 Phil: Removed the $db parameter from all DB_error_no($db) calls - $db is now global 27/10/14 Phil: Removed all $db in DB_query() calls as now a global Modified: trunk/includes/ConnectDB_mysql.inc =================================================================== --- trunk/includes/ConnectDB_mysql.inc 2014-10-27 07:20:48 UTC (rev 6945) +++ trunk/includes/ConnectDB_mysql.inc 2014-10-27 07:30:11 UTC (rev 6946) @@ -184,7 +184,7 @@ return "\n".'interval ' . $val . ' '. $Inter."\n"; } -function DB_Maintenance($Conn=''){ +function DB_Maintenance(){ prnMsg(_('The system has just run the regular database administration and optimisation routine.'),'info'); $TablesResult = DB_query('SHOW TABLES'); @@ -198,25 +198,25 @@ } -function DB_Txn_Begin($Conn=''){ - mysql_query("SET autocommit=0"); - mysql_query("START TRANSACTION"); +function DB_Txn_Begin(){ + mysql_query("SET autocommit=0",$db); + mysql_query("START TRANSACTION",$db); } -function DB_Txn_Commit($Conn=''){ - mysql_query("COMMIT"); - mysql_query("SET autocommit=1"); +function DB_Txn_Commit(){ + mysql_query("COMMIT",$db); + mysql_query("SET autocommit=1",$db); } -function DB_Txn_Rollback($Conn=''){ - mysql_query("ROLLBACK"); +function DB_Txn_Rollback(){ + mysql_query("ROLLBACK",$db); } -function DB_IgnoreForeignKeys($Conn=''){ - mysql_query("SET FOREIGN_KEY_CHECKS=0"); +function DB_IgnoreForeignKeys(){ + mysql_query("SET FOREIGN_KEY_CHECKS=0",$db); } -function DB_ReinstateForeignKeys($Conn=''){ - mysql_query("SET FOREIGN_KEY_CHECKS=1"); +function DB_ReinstateForeignKeys(){ + mysql_query("SET FOREIGN_KEY_CHECKS=1",$db); } -?> +?> \ No newline at end of file Modified: trunk/includes/ConnectDB_mysqli.inc =================================================================== --- trunk/includes/ConnectDB_mysqli.inc 2014-10-27 07:20:48 UTC (rev 6945) +++ trunk/includes/ConnectDB_mysqli.inc 2014-10-27 07:30:11 UTC (rev 6946) @@ -196,7 +196,7 @@ return "\n".'interval ' . $val . ' '. $Inter."\n"; } -function DB_Maintenance($Conn=''){ +function DB_Maintenance(){ prnMsg(_('The system has just run the regular database administration and optimisation routine.'),'info'); @@ -210,27 +210,27 @@ WHERE confname='DB_Maintenance_LastRun'"); } -function DB_Txn_Begin($Conn=''){ +function DB_Txn_Begin(){ global $db; mysqli_query($db,'SET autocommit=0'); mysqli_query($db,'START TRANSACTION'); } -function DB_Txn_Commit($Conn=''){ +function DB_Txn_Commit(){ global $db; mysqli_query($db,'COMMIT'); mysqli_query($db,'SET autocommit=1'); } -function DB_Txn_Rollback($Conn=''){ +function DB_Txn_Rollback(){ global $db; mysqli_query($db,'ROLLBACK'); } -function DB_IgnoreForeignKeys($Conn=''){ +function DB_IgnoreForeignKeys(){ global $db; mysqli_query($db,'SET FOREIGN_KEY_CHECKS=0'); } -function DB_ReinstateForeignKeys($Conn=''){ +function DB_ReinstateForeignKeys(){ global $db; mysqli_query($db, 'SET FOREIGN_KEY_CHECKS=1'); } Modified: trunk/includes/ConnectDB_postgres.inc =================================================================== --- trunk/includes/ConnectDB_postgres.inc 2014-10-27 07:20:48 UTC (rev 6945) +++ trunk/includes/ConnectDB_postgres.inc 2014-10-27 07:30:11 UTC (rev 6946) @@ -139,7 +139,7 @@ Return $Result; } } -function DB_Maintenance($Conn){ +function DB_Maintenance(){ prnMsg(_('The system has just run the regular database administration and optimisation routine'),'info'); Modified: trunk/includes/UserLogin.php =================================================================== --- trunk/includes/UserLogin.php 2014-10-27 07:20:48 UTC (rev 6945) +++ trunk/includes/UserLogin.php 2014-10-27 07:30:11 UTC (rev 6946) @@ -158,7 +158,7 @@ ,'d') >= $_SESSION['DB_Maintenance']){ /*Do the DB maintenance routing for the DB_type selected */ - DB_Maintenance($db); + DB_Maintenance(); $_SESSION['DB_Maintenance_LastRun'] = Date('Y-m-d'); /* Audit trail purge only runs if DB_Maintenance is enabled */ |
From: <dai...@us...> - 2014-10-29 06:29:25
|
Revision: 6951 http://sourceforge.net/p/web-erp/reponame/6951 Author: daintree Date: 2014-10-29 06:29:22 +0000 (Wed, 29 Oct 2014) Log Message: ----------- couple I missed Modified Paths: -------------- trunk/PcAuthorizeExpenses.php trunk/PcReportTab.php Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2014-10-28 11:25:32 UTC (rev 6950) +++ trunk/PcAuthorizeExpenses.php 2014-10-29 06:29:22 UTC (rev 6951) @@ -168,7 +168,7 @@ '', '" . $TagTo ."')"; - $ResultFrom = DB_Query($sqlFrom, $db, '', '', true); + $ResultFrom = DB_Query($sqlFrom,'', '', true); $sqlTo="INSERT INTO `gltrans` (`counterindex`, `type`, @@ -195,7 +195,7 @@ '', '" . $TagTo ."')"; - $ResultTo = DB_Query($sqlTo, $db, '', '', true); + $ResultTo = DB_query($sqlTo,'', '', true); if ($myrow['codeexpense'] == 'ASSIGNCASH'){ // if it's a cash assignation we need to updated banktrans table as well. Modified: trunk/PcReportTab.php =================================================================== --- trunk/PcReportTab.php 2014-10-28 11:25:32 UTC (rev 6950) +++ trunk/PcReportTab.php 2014-10-29 06:29:22 UTC (rev 6951) @@ -120,7 +120,7 @@ $SqlTabs = "SELECT * FROM pctabs WHERE tabcode='".$SelectedTabs."'"; - $TabResult = DB_query($SqlTabs, $db, _('No Petty Cash tabs were returned by the SQL because'), _('The SQL that failed was:')); + $TabResult = DB_query($SqlTabs, _('No Petty Cash tabs were returned by the SQL because'), _('The SQL that failed was:')); $Tabs=DB_fetch_array($TabResult); |
From: <te...@us...> - 2014-11-05 07:05:50
|
Revision: 6960 http://sourceforge.net/p/web-erp/reponame/6960 Author: tehonu Date: 2014-11-05 07:05:45 +0000 (Wed, 05 Nov 2014) Log Message: ----------- Fixed bugs in previous commit Modified Paths: -------------- trunk/PDFPriceList.php trunk/sql/mysql/upgrade4.11-4.12.sql Modified: trunk/PDFPriceList.php =================================================================== --- trunk/PDFPriceList.php 2014-11-05 05:10:23 UTC (rev 6959) +++ trunk/PDFPriceList.php 2014-11-05 07:05:45 UTC (rev 6960) @@ -147,10 +147,10 @@ } $PricesResult = DB_query($SQL,'','',false,false); - if (DB_error_no($db) !=0) { + if (DB_error_no() !=0) { $Title = _('Price List') . ' - ' . _('Problem Report....'); include('includes/header.inc'); - prnMsg( _('The Price List could not be retrieved by the SQL because'). ' - ' . DB_error_msg($db), 'error'); + prnMsg( _('The Price List could not be retrieved by the SQL because'). ' - ' . DB_error_msg(), 'error'); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu'). '</a>'; if ($debug==1) { prnMsg(_('For debugging purposes the SQL used was:') . $SQL,'error'); Modified: trunk/sql/mysql/upgrade4.11-4.12.sql =================================================================== --- trunk/sql/mysql/upgrade4.11-4.12.sql 2014-11-05 05:10:23 UTC (rev 6959) +++ trunk/sql/mysql/upgrade4.11-4.12.sql 2014-11-05 07:05:45 UTC (rev 6960) @@ -1,5 +1,7 @@ INSERT INTO `config` VALUES ('InvoiceQuantityDefault','1'); +ALTER TABLE `stockcategory` ADD INDEX `CategoryDescription` (`categorydescription`); + UPDATE config SET confvalue='4.12' WHERE confname='VersionNumber'; |
From: <te...@us...> - 2014-11-06 02:59:18
|
Revision: 6962 http://sourceforge.net/p/web-erp/reponame/6962 Author: tehonu Date: 2014-11-06 02:59:12 +0000 (Thu, 06 Nov 2014) Log Message: ----------- More flexible selection of inventory categories Modified Paths: -------------- trunk/InventoryPlanning.php trunk/InventoryValuation.php trunk/PDFPriceList.php trunk/StockCheck.php Modified: trunk/InventoryPlanning.php =================================================================== --- trunk/InventoryPlanning.php 2014-11-06 02:29:31 UTC (rev 6961) +++ trunk/InventoryPlanning.php 2014-11-06 02:59:12 UTC (rev 6962) @@ -9,11 +9,7 @@ include ('includes/SQL_CommonFunctions.inc'); -if (isset($_POST['PrintPDF']) - and isset($_POST['FromCriteria']) - and mb_strlen($_POST['FromCriteria'])>=1 - and isset($_POST['ToCriteria']) - and mb_strlen($_POST['ToCriteria'])>=1) { +if (isset($_POST['PrintPDF'])) { include ('includes/class.pdf.php'); @@ -69,8 +65,7 @@ AND stockmaster.discontinued = 0 AND stockmaster.categoryid=stockcategory.categoryid AND (stockmaster.mbflag='B' OR stockmaster.mbflag='M') - AND stockmaster.categoryid >= '" . $_POST['FromCriteria'] . "' - AND stockmaster.categoryid <= '" . $_POST['ToCriteria'] . "' + AND stockmaster.categoryid IN ('". implode("','",$_POST['Categories'])."') GROUP BY stockmaster.categoryid, stockmaster.description, stockcategory.categorydescription, @@ -90,9 +85,8 @@ stockcategory WHERE locstock.stockid=stockmaster.stockid AND stockmaster.discontinued = 0 - AND stockmaster.categoryid >= '" . $_POST['FromCriteria'] . "' + AND stockmaster.categoryid IN ('". implode("','",$_POST['Categories'])."') AND stockmaster.categoryid=stockcategory.categoryid - AND stockmaster.categoryid <= '" . $_POST['ToCriteria'] . "' AND (stockmaster.mbflag='B' OR stockmaster.mbflag='M') AND locstock.loccode = '" . $_POST['Location'] . "' ORDER BY stockmaster.categoryid, @@ -123,14 +117,14 @@ $Category = ''; - $CurrentPeriod = GetPeriod(Date($_SESSION['DefaultDateFormat']),$db); + $CurrentPeriod = GetPeriod(Date($_SESSION['DefaultDateFormat'])); $Period_1 = $CurrentPeriod -1; $Period_2 = $CurrentPeriod -2; $Period_3 = $CurrentPeriod -3; $Period_4 = $CurrentPeriod -4; $Period_5 = $CurrentPeriod -5; - while ($InventoryPlan = DB_fetch_array($InventoryResult,$db)){ + while ($InventoryPlan = DB_fetch_array($InventoryResult)){ if ($Category!=$InventoryPlan['categoryid']){ $FontSize=10; @@ -359,81 +353,71 @@ echo '<p class="page_title_text"> <img src="'.$RootPath.'/css/'.$Theme.'/images/inventory.png" title="' . _('Search') . '" alt="" />' . ' ' . $Title . '</p>'; - if (empty($_POST['FromCriteria']) or empty($_POST['ToCriteria'])) { - /*if $FromCriteria is not set then show a form to allow input */ - - echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">'; - echo '<div>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class="selection">'; - - echo '<tr> - <td>' . _('From Inventory Category Code') . ':</td> - <td><select name="FromCriteria">'; - - $sql="SELECT categoryid, categorydescription FROM stockcategory ORDER BY categorydescription"; - $CatResult= DB_query($sql); - while ($myrow = DB_fetch_array($CatResult)){ - echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . ' - ' . $myrow['categoryid'] . '</option>'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">'; + echo '<div>'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class="selection"> + <tr> + <td>' . _('Select Inventory Categories') . ':</td> + <td><select autofocus="autofocus" required="required" minlength="1" size="12" name="Categories[]"multiple="multiple">'; + $SQL = 'SELECT categoryid, categorydescription + FROM stockcategory + ORDER BY categorydescription'; + $CatResult = DB_query($SQL); + while ($MyRow = DB_fetch_array($CatResult)) { + if (isset($_POST['Categories']) AND in_array($MyRow['categoryid'], $_POST['Categories'])) { + echo '<option selected="selected" value="' . $MyRow['categoryid'] . '">' . $MyRow['categorydescription'] .'</option>'; + } else { + echo '<option value="' . $MyRow['categoryid'] . '">' . $MyRow['categorydescription'] . '</option>'; } - echo '</select> + } + echo '</select> </td> - </tr> - <tr> - <td>' . _('To Inventory Category Code') . ':</td> - <td><select name="ToCriteria">'; + </tr>'; + + echo '<tr> + <td>' . _('For Inventory in Location') . ':</td> + <td><select name="Location">'; - /*Set the index for the categories result set back to 0 */ - DB_data_seek($CatResult,0); + $sql = "SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1"; + $LocnResult=DB_query($sql); - while ($myrow = DB_fetch_array($CatResult)){ - echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . ' - ' . $myrow['categoryid'] . '</option>'; - } - echo '</select></td> - </tr> - <tr> - <td>' . _('For Inventory in Location') . ':</td> - <td><select name="Location">'; + echo '<option value="All">' . _('All Locations') . '</option>'; - $sql = "SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1"; - $LocnResult=DB_query($sql); + while ($myrow=DB_fetch_array($LocnResult)){ + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } + echo '</select> + </td> + </tr>'; - echo '<option value="All">' . _('All Locations') . '</option>'; + echo '<tr> + <td>' . _('Stock Planning') . ':</td> + <td><select name="NumberMonthsHolding"> + <option selected="selected" value="1">' . _('One Month MAX') . '</option> + <option value="1.5">' . _('One Month and a half MAX') . '</option> + <option value="2">' . _('Two Months MAX') . '</option> + <option value="2.5">' . _('Two Month and a half MAX') . '</option> + <option value="3">' . _('Three Months MAX') . '</option> + <option value="4">' . _('Four Months MAX') . '</option> + <option value="11">' . _('One Month AVG') . '</option> + <option value="11.5">' . _('One Month and a half AVG') . '</option> + <option value="12">' . _('Two Months AVG') . '</option> + <option value="12.5">' . _('Two Month and a half AVG') . '</option> + <option value="13">' . _('Three Months AVG') . '</option> + <option value="14">' . _('Four Months AVG') . '</option> + </select> + </td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="PrintPDF" value="' . _('Print PDF') . '" /> + </div> + </div> + </form>'; - while ($myrow=DB_fetch_array($LocnResult)){ - echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; - } - echo '</select> - </td> - </tr>'; - - echo '<tr> - <td>' . _('Stock Planning') . ':</td> - <td><select name="NumberMonthsHolding"> - <option selected="selected" value="1">' . _('One Month MAX') . '</option> - <option value="1.5">' . _('One Month and a half MAX') . '</option> - <option value="2">' . _('Two Months MAX') . '</option> - <option value="2.5">' . _('Two Month and a half MAX') . '</option> - <option value="3">' . _('Three Months MAX') . '</option> - <option value="4">' . _('Four Months MAX') . '</option> - <option value="11">' . _('One Month AVG') . '</option> - <option value="11.5">' . _('One Month and a half AVG') . '</option> - <option value="12">' . _('Two Months AVG') . '</option> - <option value="12.5">' . _('Two Month and a half AVG') . '</option> - <option value="13">' . _('Three Months AVG') . '</option> - <option value="14">' . _('Four Months AVG') . '</option> - </select> - </td> - </tr> - </table> - <br /> - <div class="centre"> - <input type="submit" name="PrintPDF" value="' . _('Print PDF') . '" /> - </div> - </div> - </form>'; - } include('includes/footer.inc'); } /*end of else not PrintPDF */ Modified: trunk/InventoryValuation.php =================================================================== --- trunk/InventoryValuation.php 2014-11-06 02:29:31 UTC (rev 6961) +++ trunk/InventoryValuation.php 2014-11-06 02:59:12 UTC (rev 6962) @@ -3,11 +3,7 @@ /* $Id$ */ include('includes/session.inc'); -if ((isset($_POST['PrintPDF']) OR isset($_POST['CSV'])) - AND isset($_POST['FromCriteria']) - AND mb_strlen($_POST['FromCriteria'])>=1 - AND isset($_POST['ToCriteria']) - AND mb_strlen($_POST['ToCriteria'])>=1){ +if (isset($_POST['PrintPDF']) OR isset($_POST['CSV'])){ /*Now figure out the inventory data to report for the category range under review */ if ($_POST['Location']=='All'){ @@ -37,8 +33,7 @@ stockmaster.stockid, stockmaster.description HAVING SUM(locstock.quantity)!=0 - AND stockcategory.categorydescription >= '" . $_POST['FromCriteria'] . "' - AND stockcategory.categorydescription <= '" . $_POST['ToCriteria'] . "' + AND stockmaster.categoryid IN ('". implode("','",$_POST['Categories'])."') ORDER BY stockcategory.categorydescription, stockmaster.stockid"; } else { @@ -58,8 +53,7 @@ WHERE stockmaster.stockid=locstock.stockid AND stockmaster.categoryid=stockcategory.categoryid AND locstock.quantity!=0 - AND stockcategory.categorydescription >= '" . $_POST['FromCriteria'] . "' - AND stockcategory.categorydescription <= '" . $_POST['ToCriteria'] . "' + AND stockmaster.categoryid IN ('". implode("','",$_POST['Categories'])."') AND locstock.loccode = '" . $_POST['Location'] . "' ORDER BY stockcategory.categorydescription, stockmaster.stockid"; @@ -79,11 +73,7 @@ } } -if (isset($_POST['PrintPDF']) - AND isset($_POST['FromCriteria']) - AND mb_strlen($_POST['FromCriteria'])>=1 - AND isset($_POST['ToCriteria']) - AND mb_strlen($_POST['ToCriteria'])>=1){ +if (isset($_POST['PrintPDF'])){ include('includes/PDFStarter.php'); @@ -111,7 +101,7 @@ $CatTot_Val=0; $CatTot_Qty=0; - while ($InventoryValn = DB_fetch_array($InventoryResult,$db)){ + while ($InventoryValn = DB_fetch_array($InventoryResult)){ if ($Category!=$InventoryValn['categoryid']){ $FontSize=10; @@ -205,7 +195,7 @@ } elseif (isset($_POST['CSV'])) { $CSVListing = _('Category ID') .','. _('Category Description') .','. _('Stock ID') .','. _('Description') .','. _('Decimal Places') .','. _('Qty On Hand') .','. _('Units') .','. _('Unit Cost') .','. _('Total') . "\n"; - while ($InventoryValn = DB_fetch_row($InventoryResult, $db)) { + while ($InventoryValn = DB_fetch_row($InventoryResult)) { $CSVListing .= '"'; $CSVListing .= implode('","', $InventoryValn) . '"' . "\n"; } @@ -223,82 +213,68 @@ $Title=_('Inventory Valuation Reporting'); include('includes/header.inc'); + echo '<p class="page_title_text"> + <img src="'.$RootPath.'/css/'.$Theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" />' . ' ' . $Title . ' + </p>'; - if (empty($_POST['FromCriteria']) OR empty($_POST['ToCriteria'])) { + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post"> + <div> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - /*if $FromCriteria is not set then show a form to allow input */ - echo '<p class="page_title_text"> - <img src="'.$RootPath.'/css/'.$Theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" />' . ' ' . $Title . ' - </p>'; - - echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post"> - <div> - <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> - <table class="selection"> + echo '<table class="selection"> <tr> - <td>' . _('From Inventory Category Code') . ':</td> - <td><select name="FromCriteria">'; - - $sql="SELECT categoryid, - categorydescription - FROM stockcategory - ORDER BY categorydescription"; - - $CatResult= DB_query($sql); - While ($myrow = DB_fetch_array($CatResult)){ - echo '<option value="' . $myrow['categorydescription'] . '">' . $myrow['categorydescription'] . ' - ' . $myrow['categoryid'] . '</option>'; + <td>' . _('Select Inventory Categories') . ':</td> + <td><select autofocus="autofocus" required="required" minlength="1" size="12" name="Categories[]"multiple="multiple">'; + $SQL = 'SELECT categoryid, categorydescription + FROM stockcategory + ORDER BY categorydescription'; + $CatResult = DB_query($SQL); + while ($MyRow = DB_fetch_array($CatResult)) { + if (isset($_POST['Categories']) AND in_array($MyRow['categoryid'], $_POST['Categories'])) { + echo '<option selected="selected" value="' . $MyRow['categoryid'] . '">' . $MyRow['categorydescription'] .'</option>'; + } else { + echo '<option value="' . $MyRow['categoryid'] . '">' . $MyRow['categorydescription'] . '</option>'; } - echo '</select></td> - </tr>'; + } + echo '</select> + </td> + </tr>'; - echo '<tr> - <td>' . _('To Inventory Category Code') . ':</td> - <td><select name="ToCriteria">'; + echo '<tr> + <td>' . _('For Inventory in Location') . ':</td> + <td><select name="Location">'; - /*Set the index for the categories result set back to 0 */ - DB_data_seek($CatResult,0); + $sql = "SELECT locations.loccode, + locationname + FROM locations + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1"; - While ($myrow = DB_fetch_array($CatResult)){ - echo '<option value="' . $myrow['categorydescription'] . '">' . $myrow['categorydescription'] . ' - ' . $myrow['categoryid'] . '</option>'; - } - echo '</select></td> - </tr>'; + $LocnResult=DB_query($sql); - echo '<tr> - <td>' . _('For Inventory in Location') . ':</td> - <td><select name="Location">'; + echo '<option value="All">' . _('All Locations') . '</option>'; - $sql = "SELECT locations.loccode, - locationname - FROM locations - INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1"; + while ($myrow=DB_fetch_array($LocnResult)){ + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } + echo '</select></td> + </tr>'; - $LocnResult=DB_query($sql); + echo '<tr> + <td>' . _('Summary or Detailed Report') . ':</td> + <td><select name="DetailedReport"> + <option selected="selected" value="No">' . _('Summary Report') . '</option> + <option value="Yes">' . _('Detailed Report') . '</option> + </select></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="PrintPDF" value="' . _('Print PDF') . '" /> + <input type="submit" name="CSV" value="' . _('Output to CSV') . '" /> + </div>'; + echo '</div> + </form>'; - echo '<option value="All">' . _('All Locations') . '</option>'; - - while ($myrow=DB_fetch_array($LocnResult)){ - echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; - } - echo '</select></td> - </tr>'; - - echo '<tr> - <td>' . _('Summary or Detailed Report') . ':</td> - <td><select name="DetailedReport"> - <option selected="selected" value="No">' . _('Summary Report') . '</option> - <option value="Yes">' . _('Detailed Report') . '</option> - </select></td> - </tr> - </table> - <br /> - <div class="centre"> - <input type="submit" name="PrintPDF" value="' . _('Print PDF') . '" /> - <input type="submit" name="CSV" value="' . _('Output to CSV') . '" /> - </div>'; - echo '</div> - </form>'; - } include('includes/footer.inc'); } /*end of else not PrintPDF */ Modified: trunk/PDFPriceList.php =================================================================== --- trunk/PDFPriceList.php 2014-11-06 02:29:31 UTC (rev 6961) +++ trunk/PDFPriceList.php 2014-11-06 02:59:12 UTC (rev 6962) @@ -284,79 +284,75 @@ echo '<p class="page_title_text"><img alt="" src="' . $RootPath . '/css/' . $Theme . '/images/customer.png" title="' . _('Price List') . '" />' . ' ' . _('Print a price list by inventory category') . '</p>'; - if (!isset($_POST['FromCriteria']) or !isset($_POST['ToCriteria'])) { - /*if $FromCriteria is not set then show a form to allow input */ + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">'; + echo '<div>'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">'; - echo '<div>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class="selection">'; + echo '<table class="selection"> + <tr> + <td>' . _('Select Inventory Categories') . ':</td> + <td><select autofocus="autofocus" required="required" minlength="1" size="12" name="Categories[]"multiple="multiple">'; + $SQL = 'SELECT categoryid, categorydescription + FROM stockcategory + ORDER BY categorydescription'; + $CatResult = DB_query($SQL); + while ($MyRow = DB_fetch_array($CatResult)) { + if (isset($_POST['Categories']) AND in_array($MyRow['categoryid'], $_POST['Categories'])) { + echo '<option selected="selected" value="' . $MyRow['categoryid'] . '">' . $MyRow['categorydescription'] .'</option>'; + } else { + echo '<option value="' . $MyRow['categoryid'] . '">' . $MyRow['categorydescription'] . '</option>'; + } + } + echo '</select> + </td> + </tr>'; - echo '<table class="selection"> - <tr> - <td>' . _('Select Inventory Categories') . ':</td> - <td><select autofocus="autofocus" required="required" minlength="1" size="12" name="Categories[]"multiple="multiple">'; - $SQL = 'SELECT categoryid, categorydescription - FROM stockcategory - ORDER BY categorydescription'; - $CatResult = DB_query($SQL); - while ($MyRow = DB_fetch_array($CatResult)) { - if (isset($_POST['Categories']) AND in_array($MyRow['categoryid'], $_POST['Categories'])) { - echo '<option selected="selected" value="' . $MyRow['categoryid'] . '">' . $MyRow['categorydescription'] .'</option>'; - } else { - echo '<option value="' . $MyRow['categoryid'] . '">' . $MyRow['categorydescription'] . '</option>'; - } - } - echo '</select> - </td> - </tr>'; + echo '<tr><td>' . _('For Sales Type/Price List').':</td> + <td><select name="SalesType">'; + $sql = "SELECT sales_type, typeabbrev FROM salestypes"; + $SalesTypesResult=DB_query($sql); - echo '<tr><td>' . _('For Sales Type/Price List').':</td> - <td><select name="SalesType">'; - $sql = "SELECT sales_type, typeabbrev FROM salestypes"; - $SalesTypesResult=DB_query($sql); + while ($myrow=DB_fetch_array($SalesTypesResult)) { + echo '<option value="' . $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; + } + echo '</select></td></tr>'; - while ($myrow=DB_fetch_array($SalesTypesResult)) { - echo '<option value="' . $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; - } - echo '</select></td></tr>'; + echo '<tr><td>' . _('For Currency').':</td> + <td><select name="Currency">'; + $sql = "SELECT currabrev, currency FROM currencies ORDER BY currency"; + $CurrencyResult=DB_query($sql); + echo '<option selected="selected" value="All">' . _('All') . '</option>'; + while ($myrow=DB_fetch_array($CurrencyResult)) { + echo '<option value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; + } + echo '</select></td></tr>'; - echo '<tr><td>' . _('For Currency').':</td> - <td><select name="Currency">'; - $sql = "SELECT currabrev, currency FROM currencies ORDER BY currency"; - $CurrencyResult=DB_query($sql); - echo '<option selected="selected" value="All">' . _('All') . '</option>'; - while ($myrow=DB_fetch_array($CurrencyResult)) { - echo '<option value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; - } - echo '</select></td></tr>'; + echo '<tr> + <td>' . _('Show Gross Profit %') . ':</td> + <td><select name="ShowGPPercentages"> + <option selected="selected" value="No">' . _('Prices Only') . '</option> + <option value="Yes">' . _('Show GP % too') . '</option> + </select></td> + </tr> + <tr> + <td>' . _('Price Listing Type'). ':</td><td><select name="CustomerSpecials"> + <option selected="selected" value="Sales Type Prices">' . _('Default Sales Type Prices') . '</option> + <option value="Customer Special Prices Only">' . _('Customer Special Prices Only') . '</option> + <option value="Full Description">' . _('Full Description') . '</option> + </select></td> + </tr> + <tr> + <td>' . _('Effective As At') . ':</td> + <td><input type="text" required="required" size="11" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveDate" value="' . Date($_SESSION['DefaultDateFormat']) . '" /></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="PrintPDF" value="'. _('Print PDF'). '" /> + </div> + </div> + </form>'; - echo '<tr> - <td>' . _('Show Gross Profit %') . ':</td> - <td><select name="ShowGPPercentages"> - <option selected="selected" value="No">' . _('Prices Only') . '</option> - <option value="Yes">' . _('Show GP % too') . '</option> - </select></td> - </tr> - <tr> - <td>' . _('Price Listing Type'). ':</td><td><select name="CustomerSpecials"> - <option selected="selected" value="Sales Type Prices">' . _('Default Sales Type Prices') . '</option> - <option value="Customer Special Prices Only">' . _('Customer Special Prices Only') . '</option> - <option value="Full Description">' . _('Full Description') . '</option> - </select></td> - </tr> - <tr> - <td>' . _('Effective As At') . ':</td> - <td><input type="text" required="required" size="11" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveDate" value="' . Date($_SESSION['DefaultDateFormat']) . '" /></td> - </tr> - </table> - <br /> - <div class="centre"> - <input type="submit" name="PrintPDF" value="'. _('Print PDF'). '" /> - </div> - </div> - </form>'; - } include('includes/footer.inc'); } /*end of else not PrintPDF */ Modified: trunk/StockCheck.php =================================================================== --- trunk/StockCheck.php 2014-11-06 02:29:31 UTC (rev 6961) +++ trunk/StockCheck.php 2014-11-06 02:59:12 UTC (rev 6962) @@ -4,11 +4,7 @@ include('includes/session.inc'); -If (isset($_POST['PrintPDF']) - AND isset($_POST['FromCriteria']) - AND mb_strlen($_POST['FromCriteria'])>=1 - AND isset($_POST['ToCriteria']) - AND mb_strlen($_POST['ToCriteria'])>=1){ +If (isset($_POST['PrintPDF'])){ include('includes/PDFStarter.php'); $pdf->addInfo('Title',_('Stock Count Sheets')); @@ -31,12 +27,12 @@ '" . Date('Y-m-d') . "' FROM locstock, stockmaster - WHERE locstock.stockid=stockmaster.stockid AND locstock.loccode='" . $_POST['Location'] . "' AND - stockmaster.categoryid>='" . $_POST['FromCriteria'] . "' AND - stockmaster.categoryid<='" . $_POST['ToCriteria'] . "' AND - stockmaster.mbflag!='A' AND - stockmaster.mbflag!='K' AND - stockmaster.mbflag!='D'"; + WHERE locstock.stockid=stockmaster.stockid + AND locstock.loccode='" . $_POST['Location'] . "' + AND stockmaster.categoryid IN ('". implode("','",$_POST['Categories'])."') + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.mbflag!='D'"; $result = DB_query($sql,'','',false,false); if (DB_error_no() !=0) { @@ -56,8 +52,7 @@ $sql = "DELETE stockcheckfreeze FROM stockcheckfreeze INNER JOIN stockmaster ON stockcheckfreeze.stockid=stockmaster.stockid - WHERE stockmaster.categoryid >='" . $_POST['FromCriteria'] . "' - AND stockmaster.categoryid<='" . $_POST['ToCriteria'] . "' + WHERE stockmaster.categoryid IN ('". implode("','",$_POST['Categories'])."') AND stockcheckfreeze.loccode='" . $_POST['Location'] . "'"; $result = DB_query($sql,'','',false,false); @@ -84,8 +79,7 @@ FROM locstock INNER JOIN stockmaster ON locstock.stockid=stockmaster.stockid WHERE locstock.loccode='" . $_POST['Location'] . "' - AND stockmaster.categoryid>='" . $_POST['FromCriteria'] . "' - AND stockmaster.categoryid<='" . $_POST['ToCriteria'] . "' + AND stockmaster.categoryid IN ('". implode("','",$_POST['Categories'])."') AND stockmaster.mbflag!='A' AND stockmaster.mbflag!='K' AND stockmaster.mbflag!='G' @@ -123,8 +117,7 @@ ON stockcheckfreeze.stockid=stockmaster.stockid INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.categoryid >= '" . $_POST['FromCriteria'] . "' - AND stockmaster.categoryid <= '" . $_POST['ToCriteria'] . "' + WHERE stockmaster.categoryid IN ('". implode("','",$_POST['Categories'])."') AND (stockmaster.mbflag='B' OR mbflag='M') AND stockcheckfreeze.loccode = '" . $_POST['Location'] . "'"; if (isset($_POST['NonZerosOnly']) and $_POST['NonZerosOnly']==true){ @@ -258,109 +251,101 @@ $Title=_('Stock Check Sheets'); include('includes/header.inc'); - if (!isset($_POST['FromCriteria']) and !isset($_POST['ToCriteria'])) { + echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/printer.png" title="' + . _('print') . '" alt="" />' . ' ' . $Title . '</p><br />'; - /*if $FromCriteria is not set then show a form to allow input */ - echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/printer.png" title="' - . _('print') . '" alt="" />' . ' ' . $Title . '</p><br />'; - - echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">'; - echo '<div>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class="selection">'; - - echo '<tr><td>' . _('From Inventory Category Code') . ':</td> - <td><select name="FromCriteria">'; - - $sql="SELECT categoryid, categorydescription FROM stockcategory ORDER BY categorydescription"; - $CatResult= DB_query($sql); - While ($myrow = DB_fetch_array($CatResult)){ - echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . ' - ' . $myrow['categoryid'] . '</option>'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">'; + echo '<div>'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class="selection"> + <tr> + <td>' . _('Select Inventory Categories') . ':</td> + <td><select autofocus="autofocus" required="required" minlength="1" size="12" name="Categories[]"multiple="multiple">'; + $SQL = 'SELECT categoryid, categorydescription + FROM stockcategory + ORDER BY categorydescription'; + $CatResult = DB_query($SQL); + while ($MyRow = DB_fetch_array($CatResult)) { + if (isset($_POST['Categories']) AND in_array($MyRow['categoryid'], $_POST['Categories'])) { + echo '<option selected="selected" value="' . $MyRow['categoryid'] . '">' . $MyRow['categorydescription'] .'</option>'; + } else { + echo '<option value="' . $MyRow['categoryid'] . '">' . $MyRow['categorydescription'] . '</option>'; } - echo '</select></td></tr>'; + } + echo '</select> + </td> + </tr>'; - echo '<tr> - <td>' . _('To Inventory Category Code') . ':</td> - <td><select name="ToCriteria">'; + echo '<tr> + <td>' . _('For Inventory in Location') . ':</td> + <td><select name="Location">'; + $sql = "SELECT locations.loccode, locationname FROM locations + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 + ORDER BY locationname"; + $LocnResult=DB_query($sql); - /*Set the index for the categories result set back to 0 */ - DB_data_seek($CatResult,0); - - While ($myrow = DB_fetch_array($CatResult)){ - echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . ' - ' . $myrow['categoryid'] . '</option>'; + while ($myrow=DB_fetch_array($LocnResult)){ + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } - echo '</select></td></tr>'; + echo '</select> + </td> + </tr>'; - echo '<tr> - <td>' . _('For Inventory in Location') . ':</td> - <td><select name="Location">'; - $sql = "SELECT locations.loccode, locationname FROM locations - INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 - ORDER BY locationname"; - $LocnResult=DB_query($sql); + echo '<tr> + <td>' . _('Action for Stock Check Freeze') . ':</td> + <td><select name="MakeStkChkData">'; - while ($myrow=DB_fetch_array($LocnResult)){ - echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; - } - echo '</select> - </td> - </tr>'; + if (!isset($_POST['MakeStkChkData'])){ + $_POST['MakeStkChkData'] = 'PrintOnly'; + } + if ($_POST['MakeStkChkData'] =='New'){ + echo '<option selected="selected" value="New">' . _('Make new stock check data file') . '</option>'; + } else { + echo '<option value="New">' . _('Make new stock check data file') . '</option>'; + } + if ($_POST['MakeStkChkData'] ==... [truncated message content] |
From: <dai...@us...> - 2014-11-06 09:15:14
|
Revision: 6966 http://sourceforge.net/p/web-erp/reponame/6966 Author: daintree Date: 2014-11-06 09:15:09 +0000 (Thu, 06 Nov 2014) Log Message: ----------- Fix login errors for automated scripts; Modified Paths: -------------- trunk/MailInventoryValuation.php trunk/includes/ConnectDB.inc trunk/includes/DateFunctions.inc trunk/includes/MiscFunctions.php trunk/includes/UserLogin.php trunk/includes/session.inc trunk/sql/mysql/upgrade4.11-4.12.sql Modified: trunk/MailInventoryValuation.php =================================================================== --- trunk/MailInventoryValuation.php 2014-11-06 08:41:58 UTC (rev 6965) +++ trunk/MailInventoryValuation.php 2014-11-06 09:15:09 UTC (rev 6966) @@ -17,6 +17,7 @@ include('includes/session.inc'); include ('includes/class.pdf.php'); $Recipients = GetMailList('InventoryValuationRecipients'); + if (sizeOf($Recipients) == 0) { $Title = _('Inventory Valuation') . ' - ' . _('Problem Report'); include('includes/header.inc'); @@ -242,7 +243,7 @@ echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; - + }else{ $Title = _('Print Inventory Valuation Error'); include('includes/header.inc'); @@ -250,8 +251,8 @@ echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; - + } - + } ?> Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2014-11-06 08:41:58 UTC (rev 6965) +++ trunk/includes/ConnectDB.inc 2014-11-06 09:15:09 UTC (rev 6966) @@ -9,7 +9,7 @@ require_once ($PathPrefix .'includes/MiscFunctions.php'); if (!isset($_SESSION['DatabaseName'])){ //need to get the database name from the file structure if (isset($_POST['CompanyNameField'])){ - if (isset($CompanyList) && is_array($CompanyList)) { + if (isset($CompanyList) AND is_array($CompanyList)) { foreach ($CompanyList as $CompanyEntryKey => $CompanyEntry){ if (is_dir('./companies/'. $CompanyEntry['database']) AND ($CompanyEntryKey == $_POST['CompanyNameField']) ) { $_SESSION['DatabaseName'] = $CompanyEntry['database']; @@ -45,15 +45,11 @@ prnMsg(_('The company name abbreviation entered at login must also have a company directory defined. See your system administrator'),'error'); } } // end provision for old setup - + include_once ($PathPrefix . 'includes/ConnectDB_' . $DBType . '.inc'); } elseif (isset($DatabaseName)) { /* Scripts that do not require a login must have the $DatabaseName variable set in hard code */ $_SESSION['DatabaseName'] = $DatabaseName; $_SESSION['CompanyName']= $DatabaseName; include_once ($PathPrefix . 'includes/ConnectDB_' . $DBType . '.inc'); } - -} else { - include_once($PathPrefix .'includes/ConnectDB_' . $DBType . '.inc'); } - -?> +?> \ No newline at end of file Modified: trunk/includes/DateFunctions.inc =================================================================== --- trunk/includes/DateFunctions.inc 2014-11-06 08:41:58 UTC (rev 6965) +++ trunk/includes/DateFunctions.inc 2014-11-06 09:15:09 UTC (rev 6966) @@ -924,7 +924,7 @@ $EarliestDispatch = time(); /* If the hour is after Dispatch Cut Off Time default dispatch date to tomorrow */ $EarliestDispatch = (Date('H')>=$_SESSION['DispatchCutOffTime'])?($EarliestDispatch+24*60*60):$EarliestDispatch; - + if ((Date('w',$EarliestDispatch)==0) AND ($_SESSION['WorkingDaysWeek'] != '7')){ /*if today is a sunday AND the company does NOT work 7 days a week, the dispatch date must be tomorrow (Monday) or after */ @@ -1081,4 +1081,4 @@ return $myrow[0]; } -?> +?> \ No newline at end of file Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2014-11-06 08:41:58 UTC (rev 6965) +++ trunk/includes/MiscFunctions.php 2014-11-06 09:15:09 UTC (rev 6966) @@ -419,10 +419,12 @@ return $result; } -function GetMailList($Recipients){ - global $db; +function GetMailList($MailGroup){ $ToList = array(); - $sql = "SELECT email,realname FROM mailgroupdetails INNER JOIN www_users ON www_users.userid=mailgroupdetails.userid WHERE mailgroupdetails.groupname='".$Recipients."'"; + $sql = "SELECT email,realname + FROM mailgroupdetails INNER JOIN www_users + ON www_users.userid=mailgroupdetails.userid + WHERE mailgroupdetails.groupname='" . $MailGroup . "'"; $ErrMsg = _('Failed to retrieve mail lists'); $result = DB_query($sql,$ErrMsg); if(DB_num_rows($result) != 0){ Modified: trunk/includes/UserLogin.php =================================================================== --- trunk/includes/UserLogin.php 2014-11-06 08:41:58 UTC (rev 6965) +++ trunk/includes/UserLogin.php 2014-11-06 09:15:09 UTC (rev 6966) @@ -42,8 +42,8 @@ } /* The SQL to get the user info must use the * syntax because the field name could change between versions if the fields are specifed directly then the sql fails and the db upgrade will fail */ $sql = "SELECT * - FROM www_users - WHERE www_users.userid='" . $Name . "'"; + FROM www_users + WHERE www_users.userid='" . $Name . "'"; $ErrMsg = _('Could not retrieve user details on login because'); $debug =1; @@ -110,6 +110,7 @@ $_SESSION['SalesmanLogin'] = $myrow['salesman']; $_SESSION['CanCreateTender'] = $myrow['cancreatetender']; $_SESSION['AllowedDepartment'] = $myrow['department']; + $_SESSION['ShowDashboard'] = $myrow['dashboard']; if (isset($myrow['pdflanguage'])) { $_SESSION['PDFLanguage'] = $myrow['pdflanguage']; Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2014-11-06 08:41:58 UTC (rev 6965) +++ trunk/includes/session.inc 2014-11-06 09:15:09 UTC (rev 6966) @@ -5,7 +5,6 @@ $PathPrefix=''; } - if (!file_exists($PathPrefix . 'config.php')){ $RootPath = dirname(htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8')); if ($RootPath == '/' OR $RootPath == "\\") { @@ -81,8 +80,16 @@ include($PathPrefix . 'includes/LanguageSetup.php'); $FirstLogin = False; -if (!isset($AllowAnyone)){ /* only do security checks if AllowAnyone is not true */ +if(basename($_SERVER['SCRIPT_NAME'])=='Logout.php'){ + header('Location: index.php'); +} elseif (isset($AllowAnyone)){ /* only do security checks if AllowAnyone is not true */ + $_SESSION['AllowedPageSecurityTokens'] = array(); + $_SESSION['DatabaseName'] = $DefaultDatabase; + $_SESSION['CompanyName'] = $DefaultDatabase; + include_once ($PathPrefix . 'includes/ConnectDB_' . $DBType . '.inc'); + include($PathPrefix . 'includes/GetConfig.php'); +} else { include $PathPrefix . 'includes/UserLogin.php'; /* Login checking and setup */ if (isset($_POST['UserNameEntryField']) AND isset($_POST['Password'])) { @@ -125,9 +132,6 @@ die(include($PathPrefix . 'includes/Login.php')); } -} /* only do security checks if AllowAnyone is not true */ - elseif(basename($_SERVER['SCRIPT_NAME'])=='Logout.php'){ - header('Location: index.php'); } /*If the Code $Version - held in ConnectDB.inc is > than the Database VersionNumber held in config table then do upgrades */ @@ -139,8 +143,11 @@ If (isset($_POST['Theme']) AND ($_SESSION['UsersRealName'] == $_POST['RealName'])) { $_SESSION['Theme'] = $_POST['Theme']; $Theme = $_POST['Theme']; +} elseif (isset($_SESSION['Theme'])) { + $Theme = $_SESSION['Theme']; } else { - $Theme = $_SESSION['Theme']; + $Theme = 'xenos'; + $_SESSION['Theme'] = 'xenos'; } @@ -212,7 +219,8 @@ } else { $debug = 0; //don't allow debug messages } -if ($FirstLogin AND !$SupplierLogin AND !$CustomerLogin) { + +if ($FirstLogin AND !$SupplierLogin AND !$CustomerLogin AND $_SESSION['ShowDashboard']==1) { header('Location: ' . $PathPrefix .'Dashboard.php'); } Modified: trunk/sql/mysql/upgrade4.11-4.12.sql =================================================================== --- trunk/sql/mysql/upgrade4.11-4.12.sql 2014-11-06 08:41:58 UTC (rev 6965) +++ trunk/sql/mysql/upgrade4.11-4.12.sql 2014-11-06 09:15:09 UTC (rev 6966) @@ -1,7 +1,5 @@ INSERT INTO `config` VALUES ('InvoiceQuantityDefault','1'); - -ALTER TABLE `stockcategory` ADD INDEX `CategoryDescription` (`categorydescription`); - +ALTER TABLE `www_users` ADD `dashboard` TINYINT NOT NULL DEFAULT '0'; UPDATE config SET confvalue='4.12' WHERE confname='VersionNumber'; |
From: <dai...@us...> - 2014-11-08 05:14:31
|
Revision: 6971 http://sourceforge.net/p/web-erp/reponame/6971 Author: daintree Date: 2014-11-08 05:14:21 +0000 (Sat, 08 Nov 2014) Log Message: ----------- login logic fixed Modified Paths: -------------- trunk/includes/ConnectDB.inc trunk/javascripts/MiscFunctions.js Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2014-11-08 00:43:17 UTC (rev 6970) +++ trunk/includes/ConnectDB.inc 2014-11-08 05:14:21 UTC (rev 6971) @@ -7,42 +7,42 @@ $Version='4.11.5'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); -if (!isset($_SESSION['DatabaseName'])){ //need to get the database name from the file structure +if (!isset($_SESSION['DatabaseName'])){ if (isset($_POST['CompanyNameField'])){ - if (isset($CompanyList) AND is_array($CompanyList)) { - foreach ($CompanyList as $CompanyEntryKey => $CompanyEntry){ - if (is_dir('./companies/'. $CompanyEntry['database']) AND ($CompanyEntryKey == $_POST['CompanyNameField']) ) { - $_SESSION['DatabaseName'] = $CompanyEntry['database']; - $_SESSION['CompanyName'] = $CompanyEntry['company']; - include_once ($PathPrefix . 'includes/ConnectDB_' . $DBType . '.inc'); - break; - } - } - if (!isset($_SESSION['DatabaseName'])) { - prnMsg(_('You do not seem to have a database configured correctly to use with webERP. Check you database exists and there is a corresponding directory in the \'companies\' directory of the same name. Contact your system administrator for assistance.'),'error'); - exit; - } + if (isset($CompanyList) AND is_array($CompanyList)) { + foreach ($CompanyList as $CompanyEntryKey => $CompanyEntry){ + if (is_dir('./companies/'. $CompanyEntry['database']) AND ($CompanyEntryKey == $_POST['CompanyNameField']) ) { + $_SESSION['DatabaseName'] = $CompanyEntry['database']; + $_SESSION['CompanyName'] = $CompanyEntry['company']; + break; + } + } + if (!isset($_SESSION['DatabaseName'])) { + prnMsg(_('You do not seem to have a database configured correctly to use with webERP. Check you database exists and there is a corresponding directory in the \'companies\' directory of the same name. Contact your system administrator for assistance.'),'error'); + exit; + } if (ContainsIllegalCharacters( $_SESSION['DatabaseName'])){ - prnMsg(_('The company database being logged into cannot contain any of the illegal characters'),'error'); - echo '<br /><a href="index.php">' . _('Back to login page') . '</a>'; - exit; + prnMsg(_('The company database being logged into cannot contain any of the illegal characters'),'error'); + echo '<br /><a href="index.php">' . _('Back to login page') . '</a>'; + exit; } } //provision for old setup - delete when we have a reliable upgrade for config.php else { if (ContainsIllegalCharacters($_POST['CompanyNameField'])){ - prnMsg(_('The company database being logged into cannot contain any of the illegal characters'),'error'); - echo '<br /><a href="index.php">' . _('Back to login page') . '</a>'; - exit; + prnMsg(_('The company database being logged into cannot contain any of the illegal characters'),'error'); + echo '<br /><a href="index.php">' . _('Back to login page') . '</a>'; + exit; } if (is_dir('companies/' . $_POST['CompanyNameField']) AND $_POST['CompanyNameField'] != '..'){ - $_SESSION['DatabaseName'] = $_POST['CompanyNameField']; - $_SESSION['CompanyName'] = $_POST['CompanyNameField']; - include_once ($PathPrefix . 'includes/ConnectDB_' . $DBType . '.inc'); + $_SESSION['DatabaseName'] = $_POST['CompanyNameField']; + $_SESSION['CompanyName'] = $_POST['CompanyNameField']; } else { - prnMsg(_('The company name entered' . ' (' . $_POST['CompanyNameField'] . ') ' . 'is not configured for use with this installation of webERP. Check that a directory named ' . $_POST['CompanyNameField'] . ' is set up under the companies sub-directory.'),'error'); - prnMsg(_('Check the company name entered' . ' (' . $_POST['CompanyNameField'] . ') ' . 'is the same as the database name.'),'error'); - prnMsg(_('The company name abbreviation entered at login must also have a company directory defined. See your system administrator'),'error'); + prnMsg(_('The company name entered' . ' (' . $_POST['CompanyNameField'] . ') ' . 'is not configured for use with this installation of webERP. Check that a directory named ' . $_POST['CompanyNameField'] . ' is set up under the companies sub-directory.'),'error'); + prnMsg(_('Check the company name entered' . ' (' . $_POST['CompanyNameField'] . ') ' . 'is the same as the database name.'),'error'); + prnMsg(_('The company name abbreviation entered at login must also have a company directory defined. See your system administrator'),'error'); + echo '<br /><a href="index.php">' . _('Back to login page') . '</a>'; + exit; } } // end provision for old setup include_once ($PathPrefix . 'includes/ConnectDB_' . $DBType . '.inc'); @@ -51,5 +51,7 @@ $_SESSION['CompanyName']= $DatabaseName; include_once ($PathPrefix . 'includes/ConnectDB_' . $DBType . '.inc'); } +} else { + include_once ($PathPrefix . 'includes/ConnectDB_' . $DBType . '.inc'); } ?> \ No newline at end of file Modified: trunk/javascripts/MiscFunctions.js =================================================================== --- trunk/javascripts/MiscFunctions.js 2014-11-08 00:43:17 UTC (rev 6970) +++ trunk/javascripts/MiscFunctions.js 2014-11-08 05:14:21 UTC (rev 6971) @@ -44,13 +44,13 @@ break; default: alert('something is wrong with your language setting'); - + } if(patt.test(this.value)){ this.setCustomValidity(''); return true; - + }else{ this.setCustomValidity('The number format is wrong'); return false; @@ -98,7 +98,7 @@ m=mA[3]; y=mA[1]; } - + if (m<1 || m>12){ alert("Month must be between 1 and 12"); return false; @@ -289,7 +289,7 @@ function(a,b) { if (direction=="a") { if (columnClass=="number") { - return parseFloat(a[columnNumber])-parseFloat(b[columnNumber]); + return parseFloat(e[columnNumber].replace(/[,.]/g, '')) - parseFloat(t[columnNumber].replace(/[,.]/g, '') } else if (columnClass=="date") { da=new Date(a[columnNumber]); db=new Date(b[columnNumber]); @@ -299,7 +299,7 @@ } } else { if (columnClass=="number") { - return parseFloat(b[columnNumber])-parseFloat(a[columnNumber]); + return parseFloat(e[columnNumber].replace(/[,.]/g, '')) - parseFloat(t[columnNumber].replace(/[,.]/g, '') } else if (columnClass=="date") { da=new Date(a[columnNumber]); db=new Date(b[columnNumber]); @@ -341,7 +341,7 @@ if (ds[i].className=="number") ds[i].onkeypress=rTN; if (ds[i].className=="integer") ds[i].onkeypress=rTI; if (ds[i].className=="number"){ - + ds[i].origonchange=ds[i].onchange; ds[i].newonchange=rLocaleNumber; ds[i].onchange=function(){ @@ -349,7 +349,7 @@ this.origonchange(); this.newonchange(); }; - + } } var ds=document.getElementsByTagName("th"); |
From: <dai...@us...> - 2014-11-08 23:48:45
|
Revision: 6972 http://sourceforge.net/p/web-erp/reponame/6972 Author: daintree Date: 2014-11-08 23:48:35 +0000 (Sat, 08 Nov 2014) Log Message: ----------- Phil: Applied Tims fix to the javascript number sorting problem - thanks Tim Modified Paths: -------------- trunk/doc/Change.log trunk/javascripts/MiscFunctions.js Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2014-11-08 05:14:21 UTC (rev 6971) +++ trunk/doc/Change.log 2014-11-08 23:48:35 UTC (rev 6972) @@ -1,5 +1,6 @@ webERP Change Log +9/11/14: Tim: fix to javascript function to sort numbers including formatted numbers with commas. 8/11/14: Alessandro Saporetti: Fixed the bug that the wrong invoiced quantity result in Z_DeleteInvoice.php. 7/11/14 Exson: Remove date range from sql when users input the PO number in PO_SelectOSPurchOrder.php. 06/11/14 Exson: Add code change for table custitem and pricematrix in Z_ChangeStockCode.php. Modified: trunk/javascripts/MiscFunctions.js =================================================================== --- trunk/javascripts/MiscFunctions.js 2014-11-08 05:14:21 UTC (rev 6971) +++ trunk/javascripts/MiscFunctions.js 2014-11-08 23:48:35 UTC (rev 6972) @@ -289,7 +289,7 @@ function(a,b) { if (direction=="a") { if (columnClass=="number") { - return parseFloat(e[columnNumber].replace(/[,.]/g, '')) - parseFloat(t[columnNumber].replace(/[,.]/g, '') + return parseFloat(a[columnNumber].replace(/[,.]/g, '')) - parseFloat(b[columnNumber].replace(/[,.]/g, '')); } else if (columnClass=="date") { da=new Date(a[columnNumber]); db=new Date(b[columnNumber]); @@ -299,7 +299,7 @@ } } else { if (columnClass=="number") { - return parseFloat(e[columnNumber].replace(/[,.]/g, '')) - parseFloat(t[columnNumber].replace(/[,.]/g, '') + return parseFloat(b[columnNumber].replace(/[,.]/g, '')) - parseFloat(a[columnNumber].replace(/[,.]/g, '')); } else if (columnClass=="date") { da=new Date(a[columnNumber]); db=new Date(b[columnNumber]); @@ -341,15 +341,13 @@ if (ds[i].className=="number") ds[i].onkeypress=rTN; if (ds[i].className=="integer") ds[i].onkeypress=rTI; if (ds[i].className=="number"){ - - ds[i].origonchange=ds[i].onchange; - ds[i].newonchange=rLocaleNumber; - ds[i].onchange=function(){ - if(this.origonchange) - this.origonchange(); - this.newonchange(); - }; - + ds[i].origonchange=ds[i].onchange; + ds[i].newonchange=rLocaleNumber; + ds[i].onchange=function(){ + if(this.origonchange) + this.origonchange(); + this.newonchange(); + }; } } var ds=document.getElementsByTagName("th"); @@ -357,4 +355,4 @@ if (ds[i].className=="ascending") ds[i].onclick=SortSelect; } } -window.onload=initial; +window.onload=initial; \ No newline at end of file |
From: <te...@us...> - 2014-11-14 09:10:25
|
Revision: 6979 http://sourceforge.net/p/web-erp/reponame/6979 Author: tehonu Date: 2014-11-14 09:10:13 +0000 (Fri, 14 Nov 2014) Log Message: ----------- Fixed bug that set StartDate = 0000-00-00 when WorkOrderEntry.php script was called from MRPPlannedWorkOrders.php Modified Paths: -------------- trunk/MRPPlannedWorkOrders.php trunk/WorkOrderEntry.php Modified: trunk/MRPPlannedWorkOrders.php =================================================================== --- trunk/MRPPlannedWorkOrders.php 2014-11-14 02:57:33 UTC (rev 6978) +++ trunk/MRPPlannedWorkOrders.php 2014-11-14 09:10:13 UTC (rev 6979) @@ -280,7 +280,7 @@ $k++; } - echo '<td><a href="' . $RootPath . '/WorkOrderEntry.php?NewItem=' . $myrow['part'] . '&ReqQty=' . $myrow['supplyquantity'] . '&ReqDate=' . $myrow['duedate'] . '">' . _('Convert') . '</a></td> + echo '<td><a href="' . $RootPath . '/WorkOrderEntry.php?NewItem=' . $myrow['part'] . '&ReqQty=' . $myrow['supplyquantity'] . '&ReqDate=' . $myrow['duedate'] . '&StartDate=' . $myrow['mrpdate'] . '">' . _('Convert') . '</a></td> <td>' . '<a href="' . $RootPath . '/SelectProduct.php?StockID=' . $myrow['part'] . '">' . $myrow['part'] . '</a>' . '<input type="hidden" name="' . $j . '_part" value="' . $myrow['part']. '" /></td> <td>' . $myrow['description'] . '</td> <td>' . ConvertSQLDate($myrow['mrpdate']) . '</td> Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2014-11-14 02:57:33 UTC (rev 6978) +++ trunk/WorkOrderEntry.php 2014-11-14 09:10:13 UTC (rev 6979) @@ -26,7 +26,7 @@ } if (isset($_GET['StartDate'])){ - $StartDate = ConvertSQLDate($_GET['StartDate']); + $StartDate = $_GET['StartDate']; } else { $StartDate=Date($_SESSION['DefaultDateFormat']); } |
From: <te...@us...> - 2014-11-18 02:23:27
|
Revision: 6992 http://sourceforge.net/p/web-erp/reponame/6992 Author: tehonu Date: 2014-11-18 02:23:21 +0000 (Tue, 18 Nov 2014) Log Message: ----------- Added script UserLocations.php. Does the same thing as LocationUsers.php but the other way around. Selecting an user, can maintain the locations she is authorized to. Modified Paths: -------------- trunk/includes/MainMenuLinksArray.php trunk/sql/mysql/upgrade4.11-4.12.sql Added Paths: ----------- trunk/UserLocations.php Added: trunk/UserLocations.php =================================================================== --- trunk/UserLocations.php (rev 0) +++ trunk/UserLocations.php 2014-11-18 02:23:21 UTC (rev 6992) @@ -0,0 +1,264 @@ +<?php +/* $Id: LocationUsers.php 6806 2013-09-28 05:10:46Z daintree $*/ + +include('includes/session.inc'); +$Title = _('User Authorised Inventory Locations Maintenance'); +$ViewTopic = 'Inventory';// Filename in ManualContents.php's TOC. +$BookMark = 'LocationUsers';// Anchor's id in the manual's html document. +include('includes/header.inc'); + +echo '<p class="page_title_text"><img src="' . $RootPath . '/css/' . $Theme . '/images/money_add.png" title="' . _('User Authorised Locations') . '" alt="" />' . ' ' . $Title . '</p>'; + +if (isset($_POST['SelectedLocation'])) { + $SelectedLocation = mb_strtoupper($_POST['SelectedLocation']); +} elseif (isset($_GET['SelectedLocation'])) { + $SelectedLocation = mb_strtoupper($_GET['SelectedLocation']); +} else { + $SelectedLocation = ''; +} + +if (isset($_POST['SelectedUser'])) { + $SelectedUser = mb_strtoupper($_POST['SelectedUser']); +} elseif (isset($_GET['SelectedUser'])) { + $SelectedUser = mb_strtoupper($_GET['SelectedUser']); +} + +if (isset($_POST['Cancel'])) { + unset($SelectedUser); + unset($SelectedLocation); +} + +if (isset($_POST['Process'])) { + if ($_POST['SelectedUser'] == '') { + prnMsg(_('You have not selected any User'), 'error'); + echo '<br />'; + unset($SelectedUser); + unset($_POST['SelectedUser']); + } +} + +if (isset($_POST['submit'])) { + + $InputError = 0; + + if ($_POST['SelectedLocation'] == '') { + $InputError = 1; + prnMsg(_('You have not selected an inventory location to be authorised for this user'), 'error'); + echo '<br />'; + unset($SelectedUser); + } + + if ($InputError != 1) { + + // First check the user is not being duplicated + + $CheckSql = "SELECT count(*) + FROM locationusers + WHERE loccode= '" . $_POST['SelectedLocation'] . "' + AND userid = '" . $_POST['SelectedUser'] . "'"; + + $CheckResult = DB_query($CheckSql); + $CheckRow = DB_fetch_row($CheckResult); + + if ($CheckRow[0] > 0) { + $InputError = 1; + prnMsg(_('The location') . ' ' . $_POST['SelectedLocation'] . ' ' . _('is already authorised for this user'), 'error'); + } else { + // Add new record on submit + $SQL = "INSERT INTO locationusers (loccode, + userid, + canview, + canupd) + VALUES ('" . $_POST['SelectedLocation'] . "', + '" . $_POST['SelectedUser'] . "', + '1', + '1')"; + + $msg = _('User') . ': ' . $_POST['SelectedUser'] . ' ' . _('authority to use the') . ' ' . $_POST['SelectedLocation'] . ' ' . _('location has been changed'); + $Result = DB_query($SQL); + prnMsg($msg, 'success'); + unset($_POST['SelectedLocation']); + } + } +} elseif (isset($_GET['delete'])) { + $SQL = "DELETE FROM locationusers + WHERE loccode='" . $SelectedLocation . "' + AND userid='" . $SelectedUser . "'"; + + $ErrMsg = _('The Location user record could not be deleted because'); + $Result = DB_query($SQL, $ErrMsg); + prnMsg(_('User') . ' ' . $SelectedUser . ' ' . _('has had their authority to use the') . ' ' . $SelectedLocation . ' ' . _('location removed'), 'success'); + unset($_GET['delete']); +} elseif (isset($_GET['ToggleUpdate'])) { + $SQL = "UPDATE locationusers + SET canupd='" . $_GET['ToggleUpdate'] . "' + WHERE loccode='" . $SelectedLocation . "' + AND userid='" . $SelectedUser . "'"; + + $ErrMsg = _('The Location user record could not be deleted because'); + $Result = DB_query($SQL, $ErrMsg); + prnMsg(_('User') . ' ' . $SelectedUser . ' ' . _('has had their authority to update') . ' ' . $SelectedLocation . ' ' . _('location removed'), 'success'); + unset($_GET['ToggleUpdate']); +} + +if (!isset($SelectedUser)) { + + /* It could still be the second time the page has been run and a record has been selected for modification - SelectedLocation will exist because it was sent with the new call. If its the first time the page has been displayed with no parameters + then none of the above are true. These will call the same page again and allow update/input or deletion of the records*/ + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <table class="selection"> + <tr> + <td>' . _('Select User') . ':</td> + <td><select name="SelectedUser">'; + + $Result = DB_query("SELECT userid, + realname + FROM www_users + ORDER BY userid"); + + echo '<option value="">' . _('Not Yet Selected') . '</option>'; + while ($MyRow = DB_fetch_array($Result)) { + if (isset($SelectedUser) and $MyRow['userid'] == $SelectedUser) { + echo '<option selected="selected" value="'; + } else { + echo '<option value="'; + } + echo $MyRow['userid'] . '">' . $MyRow['userid'] . ' - ' . $MyRow['realname'] . '</option>'; + + } //end while loop + + echo '</select></td></tr>'; + + echo '</table>'; // close main table + DB_free_result($Result); + + echo '<div class="centre"> + <input type="submit" name="Process" value="' . _('Accept') . '" /> + <input type="submit" name="Cancel" value="' . _('Cancel') . '" /> + </div>'; + + echo '</form>'; + +} + +//end of ifs and buts! +if (isset($_POST['process']) or isset($SelectedUser)) { + $SQLName = "SELECT realname + FROM www_users + WHERE userid='" . $SelectedUser . "'"; + $Result = DB_query($SQLName); + $MyRow = DB_fetch_array($Result); + $SelectedUserName = $MyRow['realname']; + + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Authorised inventory locations for') . ' ' . $SelectedUserName . '</a></div> + <form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '"> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <input type="hidden" name="SelectedUser" value="' . $SelectedUser . '" />'; + + $SQL = "SELECT locationusers.loccode, + canview, + canupd, + locations.locationname + FROM locationusers INNER JOIN locations + ON locationusers.loccode=locations.loccode + WHERE locationusers.userid='" . $SelectedUser . "' + ORDER BY locations.locationname ASC"; + + $Result = DB_query($SQL); + + echo '<table class="selection">'; + echo '<tr> + <th colspan="6"><h3>' . _('Authorised Inventory Locations for User') . ': ' . $SelectedUserName . '</h3></th> + </tr>'; + echo '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Name') . '</th> + <th>' . _('View') . '</th> + <th>' . _('Update') . '</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; + } + + if ($MyRow['canupd'] == 1) { + $ToggleText = '<td><a href="%s?SelectedLocation=%s&ToggleUpdate=0&SelectedUser=' . $SelectedUser . '" onclick="return confirm(\'' . _('Are you sure you wish to remove Update for this location?') . '\');">' . _('Remove Update') . '</a></td>'; + } else { + $ToggleText = '<td><a href="%s?SelectedLocation=%s&ToggleUpdate=1&SelectedUser=' . $SelectedUser . '" onclick="return confirm(\'' . _('Are you sure you wish to add Update for this location?') . '\');">' . _('Add Update') . '</a></td>'; + } + + printf('<td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td>' . + $ToggleText . ' + <td><a href="%s?SelectedLocation=%s&delete=yes&SelectedUser=' . $SelectedUser . '" onclick="return confirm(\'' . _('Are you sure you wish to un-authorise this location?') . '\');">' . _('Un-authorise') . '</a></td> + </tr>', + $MyRow['loccode'], + $MyRow['locationname'], + $MyRow['canview'], + $MyRow['canupd'], + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), + $MyRow['loccode'], + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), + $MyRow['loccode']); + } + //END WHILE LIST LOOP + echo '</table>'; + + if (!isset($_GET['delete'])) { + + + echo '<table class="selection">'; //Main table + + echo '<tr> + <td>' . _('Select Location') . ':</td> + <td><select name="SelectedLocation">'; + + $Result = DB_query("SELECT loccode, + locationname + FROM locations + WHERE NOT EXISTS (SELECT locationusers.loccode + FROM locationusers + WHERE locationusers.userid='" . $SelectedUser . "' + AND locationusers.loccode=locations.loccode) + ORDER BY locationname"); + + if (!isset($_POST['SelectedLocation'])) { + echo '<option selected="selected" value="">' . _('Not Yet Selected') . '</option>'; + } + while ($MyRow = DB_fetch_array($Result)) { + if (isset($_POST['SelectedLocation']) and $MyRow['loccode'] == $_POST['SelectedLocation']) { + echo '<option selected="selected" value="'; + } else { + echo '<option value="'; + } + echo $MyRow['loccode'] . '">' . $MyRow['locationname'] . '</option>'; + + } //end while loop + + echo '</select> + </td> + </tr> + </table>'; // close main table + DB_free_result($Result); + + echo '<div class="centre"> + <input type="submit" name="submit" value="' . _('Accept') . '" /> + <input type="submit" name="Cancel" value="' . _('Cancel') . '" /> + </div> + </form>'; + + } // end if user wish to delete +} + +include('includes/footer.inc'); +?> Modified: trunk/includes/MainMenuLinksArray.php =================================================================== --- trunk/includes/MainMenuLinksArray.php 2014-11-17 06:45:51 UTC (rev 6991) +++ trunk/includes/MainMenuLinksArray.php 2014-11-18 02:23:21 UTC (rev 6992) @@ -507,6 +507,7 @@ $MenuItems['system']['Maintenance']['Caption'] = array( _('Inventory Categories Maintenance'), _('Inventory Locations Maintenance'), _('Inventory Location Authorised Users Maintenance'), + _('User Authorised Inventory Locations Maintenance'), _('Discount Category Maintenance'), _('Units of Measure'), _('MRP Available Production Days'), @@ -518,6 +519,7 @@ $MenuItems['system']['Maintenance']['URL'] = array( '/StockCategories.php', '/Locations.php', '/LocationUsers.php', + '/UserLocations.php', '/DiscountCategories.php', '/UnitsOfMeasure.php', '/MRPCalendar.php', Modified: trunk/sql/mysql/upgrade4.11-4.12.sql =================================================================== --- trunk/sql/mysql/upgrade4.11-4.12.sql 2014-11-17 06:45:51 UTC (rev 6991) +++ trunk/sql/mysql/upgrade4.11-4.12.sql 2014-11-18 02:23:21 UTC (rev 6992) @@ -1,6 +1,6 @@ INSERT INTO `config` VALUES ('InvoiceQuantityDefault','1'); ALTER TABLE `www_users` ADD `dashboard` TINYINT NOT NULL DEFAULT '0'; -UPDATE config SET confvalue='4.12' WHERE confname='VersionNumber'; +INSERT INTO `scripts` VALUES ('UserLocations.php', '15', 'Location User Maintenance'); - +UPDATE config SET confvalue='4.12' WHERE confname='VersionNumber'; \ No newline at end of file |
From: <dai...@us...> - 2014-11-22 02:28:59
|
Revision: 6998 http://sourceforge.net/p/web-erp/reponame/6998 Author: daintree Date: 2014-11-22 02:28:56 +0000 (Sat, 22 Nov 2014) Log Message: ----------- Couple of new scripts/fixes Modified Paths: -------------- trunk/SalesTypes.php trunk/Z_DeleteOldPrices.php trunk/doc/Change.log trunk/includes/MainMenuLinksArray.php trunk/sql/mysql/upgrade4.11-4.12.sql Added Paths: ----------- trunk/CustomerBalancesMovement.php trunk/Z_AutoCustomerAllocations.php trunk/Z_RebuildSalesAnalysis.php trunk/Z_UpdateItemCosts.php Added: trunk/CustomerBalancesMovement.php =================================================================== --- trunk/CustomerBalancesMovement.php (rev 0) +++ trunk/CustomerBalancesMovement.php 2014-11-22 02:28:56 UTC (rev 6998) @@ -0,0 +1,179 @@ +<?php +/* $Id: Z_CustomerBalancesMovements.php 6941 2014-10-26 23:18:08Z daintree $*/ +$PageSecurity = 1; +include('includes/session.inc'); +$Title=_('Customer Balances Movements'); +include('includes/header.inc'); + +echo '<p class="page_title_text"> + <img src="'.$RootPath.'/css/'.$Theme.'/images/transactions.png" title="' . _('Customer Balances Movements') . '" alt="" />' . ' ' . _('Customer Balances Movements') . ' + </p>'; + +if (!isset($_POST['RunReport'])){ + + $SalesAreasResult = DB_query("SELECT areacode, areadescription FROM areas"); + $CustomersResult = DB_query("SELECT debtorno, name FROM debtorsmaster ORDER BY name"); + + echo '<form id="Form1" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post"> + + <div> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + + <table cellpadding="2" class="selection"> + <tr> + <td>' . _('Customer') . '</td> + <td><select name="Customer"> + <option selected="selected" value="">' . _('All') . '</option>'; + while ($CustomerRow = DB_fetch_array($CustomersResult)) { + echo '<option value="' . $CustomerRow['debtorno'] . '">' . $CustomerRow['name'] . '</option>'; + } + echo '</select> + </td> + </tr> + <tr> + <td>' . _('Sales Area') . '</td> + <td><select name="SalesArea"> + <option selected="selected" value="">' . _('All') . '</option>'; + while ($AreaRow = DB_fetch_array($SalesAreasResult)) { + echo '<option value="' . $AreaRow['areacode'] . '">' . $AreaRow['areadescription'] . '</option>'; + } + echo '</select> + </td> + </tr> + <tr> + <td>' . _('Date From') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" maxlength="10" size="11" value="' . Date($_SESSION['DefaultDateFormat'], Mktime(0, 0, 0, Date('m') - $_SESSION['NumberOfMonthMustBeShown'], Date('d'), Date('Y'))) . '" /></td> + </tr> + <tr> + <td>' . _('Date To') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" maxlength="10" size="11" value="' . Date($_SESSION['DefaultDateFormat']) . '" /></td> + </tr> + + </table> + <br /> + <div class="centre"> + <input tabindex="4" type="submit" name="RunReport" value="' . _('Show Customer Balance Movements') . '" /> + </div> + </div> + </form> + <br />'; + include('includes/footer.inc'); + exit; +} + +if ($_POST['Customer']!='') { + $WhereClause = "debtorsmaster.debtorno='" . $_POST['Customer'] . "'"; +} elseif ($_POST['SalesArea']!='') { + $WhereClause = "custbranch.area='" . $_POST['SalesArea'] . "'"; +} else { + $WhereClause =''; +} + +$sql = "SELECT SUM(ovamount+ovgst+ovdiscount+ovfreight-alloc) AS currencybalance, + debtorsmaster.debtorno, + debtorsmaster.name, + decimalplaces AS currdecimalplaces, + SUM((ovamount+ovgst+ovdiscount+ovfreight-alloc)/debtortrans.rate) AS localbalance + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + INNER JOIN custbranch + ON debtorsmaster.debtorno=custbranch.debtorno"; + +if (mb_strlen($WhereClause)>0){ + $sql .= " WHERE " . $WhereClause . " "; +} +$sql .= " GROUP BY debtorsmaster.debtorno"; + +$result = DB_query($sql); + +$LocalTotal =0; + +echo '<table> + <tr> + <th class="ascending">' . _('Customer') . ' </th> + <th class="ascending">' . _('Opening Balance') . '</th> + <th class="ascending">' . _('Debits') . '</th> + <th class="ascending">' . _('Credits') . '</th> + <th class="ascending">' . _('Balance') . '</th> + </tr>'; + + +$OpeningBalances =0; +$Debits =0; +$Credits =0; +$ClosingBalances =0; + +while ($myrow=DB_fetch_array($result)){ + +/*Get the sum of all transactions after the ending date - + * we need to take off the sum of all movements after the ending date from the current balance calculated above + * to get the balance as at the end of the period + */ + $sql = "SELECT SUM(ovamount+ovgst+ovdiscount+ovfreight) AS currencytotalpost, + debtorsmaster.debtorno, + SUM((ovamount+ovgst+ovdiscount+ovfreight)/debtortrans.rate) AS localtotalpost + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + WHERE trandate > '" . FormatDateForSQL($_POST['ToDate']) . "' + AND debtorsmaster.debtorno = '" . $myrow['debtorno'] . "' + GROUP BY debtorsmaster.debtorno"; + + $TransPostResult = DB_query($sql); + $TransPostRow = DB_fetch_array($TransPostResult); +/* Now we need to get the debits and credits during the period under review + */ + $sql = "SELECT SUM(CASE WHEN debtortrans.type=10 THEN ovamount+ovgst+ovdiscount+ovfreight ELSE 0 END) AS currencydebits, + SUM(CASE WHEN debtortrans.type<>10 THEN ovamount+ovgst+ovdiscount+ovfreight ELSE 0 END) AS currencycredits, + debtorsmaster.debtorno, + SUM(CASE WHEN debtortrans.type=10 THEN (ovamount+ovgst+ovdiscount+ovfreight-alloc)/debtortrans.rate ELSE 0 END) AS localdebits, + SUM(CASE WHEN debtortrans.type<>10 THEN (ovamount+ovgst+ovdiscount+ovfreight-alloc)/debtortrans.rate ELSE 0 END) AS localcredits + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + WHERE trandate>='" . FormatDateForSQL($_POST['FromDate']) . "' AND trandate <= '" . FormatDateForSQL($_POST['ToDate']) . "' + AND debtorsmaster.debtorno = '" . $myrow['debtorno'] . "' + GROUP BY debtorsmaster.debtorno"; + + $TransResult = DB_query($sql); + $TransRow = DB_fetch_array($TransResult); + + $OpeningBal = $myrow['localbalance']-$TransPostRow['localtotalpost']-$TransRow['localdebits']+$TransRow['localcredits']; + $ClosingBal = $myrow['localbalance']-$TransPostRow['localtotalpost']; + + echo '<tr> + <td>' . $myrow['name'] . ' </td> + <td class="number">' . locale_number_format($OpeningBal,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($TransRow['localdebits'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($TransRow['localcredits'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($ClosingBal,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; + $OpeningBalances += $OpeningBal; + $Debits += $TransRow['localdebits']; + $Credits += $TransRow['localcredits']; + $ClosingBalances += $ClosingBal; +} + +echo '</table>'; + +if ($_POST['Customer']==''){ //if there could be several customers being reported + echo '<table> + <tr> + <th></th> + <th>' . _('Opening Balance') . '</th> + <th>' . _('Debits') . '</th> + <th>' . _('Credits') . '</th> + <th>' . _('Balance') . '</th> + </tr> + <tr> + <td>' . _('TOTALS') . '</td> + <td class="number">' . locale_number_format($OpeningBalances,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($Debits,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($Credits,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($ClosingBalances,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr> + </table>'; +} + +include('includes/footer.inc'); +?> \ No newline at end of file Modified: trunk/SalesTypes.php =================================================================== --- trunk/SalesTypes.php 2014-11-20 12:37:23 UTC (rev 6997) +++ trunk/SalesTypes.php 2014-11-22 02:28:56 UTC (rev 6998) @@ -184,10 +184,10 @@ $sql = "SELECT typeabbrev,sales_type FROM salestypes ORDER BY typeabbrev"; $result = DB_query($sql); - echo '<table class="selection">'; - echo '<tr> - <th class="ascending">' . _('Type Code') . '</th> - <th class="ascending">' . _('Type Name') . '</th> + echo '<table class="selection"> + <tr> + <th class="ascending">' . _('Type Code') . '</th> + <th class="ascending">' . _('Type Name') . '</th> </tr>'; $k=0; //row colour counter @@ -218,19 +218,21 @@ //end of ifs and buts! if (isset($SelectedType)) { - echo '<br /><div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') .'">' . _('Show All Sales Types Defined') . '</a></div>'; + echo '<br /> + <div class="centre"> + <a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') .'">' . _('Show All Sales Types Defined') . '</a> + </div>'; } if (! isset($_GET['delete'])) { - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" >'; - echo '<div>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<br />'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" > + <div> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <br />'; // The user wish to EDIT an existing type - if ( isset($SelectedType) AND $SelectedType!='' ) - { + if ( isset($SelectedType) AND $SelectedType!='' ) { $sql = "SELECT typeabbrev, sales_type @@ -243,40 +245,45 @@ $_POST['TypeAbbrev'] = $myrow['typeabbrev']; $_POST['Sales_Type'] = $myrow['sales_type']; - echo '<input type="hidden" name="SelectedType" value="' . $SelectedType . '" />'; - echo '<input type="hidden" name="TypeAbbrev" value="' . $_POST['TypeAbbrev'] . '" />'; - echo '<table class="selection">'; - echo '<tr><th colspan="4"><b>' . _('Sales Type/Price List Setup') . '</b></th></tr>'; - echo '<tr><td>' . _('Type Code') . ':</td><td>'; + echo '<input type="hidden" name="SelectedType" value="' . $SelectedType . '" /> + <input type="hidden" name="TypeAbbrev" value="' . $_POST['TypeAbbrev'] . '" /> + <table class="selection"> + <tr> + <th colspan="4"><b>' . _('Sales Type/Price List Setup') . '</b></th> + </tr> + <tr> + <td>' . _('Type Code') . ':</td> + <td>' . $_POST['TypeAbbrev'] . '</td> + </tr>'; - // We dont allow the user to change an existing type code - - echo $_POST['TypeAbbrev'] . '</td></tr>'; - } else { // This is a new type so the user may volunteer a type code - echo '<table class="selection">'; - echo '<tr><th colspan="4"><b>' . _('Sales Type/Price List Setup') . '</b></th></tr>'; - echo '<tr><td>' . _('Type Code') . ':</td> - <td><input type="text" ' . (in_array('SalesType',$Errors) ? 'class="inputerror"' : '' ) .' size="3" maxlength="2" name="TypeAbbrev" /></td></tr>'; + echo '<table class="selection"> + <tr> + <th colspan="4"><b>' . _('Sales Type/Price List Setup') . '</b></th> + </tr> + <tr> + <td>' . _('Type Code') . ':</td> + <td><input type="text" ' . (in_array('SalesType',$Errors) ? 'class="inputerror"' : '' ) .' size="3" maxlength="2" name="TypeAbbrev" /></td> + </tr>'; } if (!isset($_POST['Sales_Type'])) { $_POST['Sales_Type']=''; } - echo '<tr><td>' . _('Sales Type Name') . ':</td> - <td><input type="text" name="Sales_Type" value="' . $_POST['Sales_Type'] . '" /></td></tr>'; + echo '<tr> + <td>' . _('Sales Type Name') . ':</td> + <td><input type="text" name="Sales_Type" value="' . $_POST['Sales_Type'] . '" /></td> + </tr> + </table>'; // close main table - echo '</table>'; // close main table - - echo '<br /><div class="centre"><input type="submit" name="submit" value="' . _('Accept') . '" /><input type="submit" name="Cancel" value="' . _('Cancel') . '" /></div>'; - - echo '</div> + echo '<br /><div class="centre"><input type="submit" name="submit" value="' . _('Accept') . '" /><input type="submit" name="Cancel" value="' . _('Cancel') . '" /></div> + </div> </form>'; } // end if user wish to delete include('includes/footer.inc'); -?> +?> \ No newline at end of file Added: trunk/Z_AutoCustomerAllocations.php =================================================================== --- trunk/Z_AutoCustomerAllocations.php (rev 0) +++ trunk/Z_AutoCustomerAllocations.php 2014-11-22 02:28:56 UTC (rev 6998) @@ -0,0 +1,251 @@ +<?php + +/* $Id: CustomerAllocations.php 6596 2014-03-03 02:32:31Z exsonqu $*/ + +/* +Call this page with: + 1. A DebtorNo to show all outstanding receipts or credits yet to be allocated. +*/ + +include('includes/DefineCustAllocsClass.php'); +include('includes/session.inc'); +$Title = _('Automatic Customer Receipt') . '/' . _('Credit Note Allocations'); + +$ViewTopic= 'ARTransactions'; +$BookMark = 'CustomerAllocations'; + +include('includes/header.inc'); +include('includes/SQL_CommonFunctions.inc'); + +if (isset($_GET['DebtorNo'])) { + // Page called with customer code + + $SQL = "SELECT debtortrans.id, + debtortrans.transno, + systypes.typename, + debtortrans.type, + debtortrans.debtorno, + debtorsmaster.name, + debtortrans.trandate, + debtortrans.reference, + debtortrans.rate, + debtortrans.ovamount+debtortrans.ovgst+debtortrans.ovdiscount+debtortrans.ovfreight as total, + debtortrans.alloc, + currencies.decimalplaces AS currdecimalplaces, + debtorsmaster.currcode + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN systypes + ON debtortrans.type=systypes.typeid + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + WHERE debtortrans.debtorno='" . $_GET['DebtorNo'] . "' + AND ( (debtortrans.type=12 AND debtortrans.ovamount<0) OR debtortrans.type=11) + AND debtortrans.settled=0 + ORDER BY debtortrans.id"; + + $result = DB_query($SQL); + + if (DB_num_rows($result)==0) { + prnMsg(_('No outstanding receipts or credits to be allocated for this customer'),'info'); + include('includes/footer.inc'); + exit; + } + echo '<table class="selection">'; + echo $TableHeader; + + while ($myrow = DB_fetch_array($result)) { + unset($_SESSION['Alloc']->Allocs); + unset($_SESSION['Alloc']); + $_SESSION['Alloc'] = new Allocation; + $_SESSION['Alloc']->AllocTrans = $myrow['id']; + $_SESSION['Alloc']->DebtorNo = $myrow['debtorno']; + $_SESSION['Alloc']->CustomerName = $myrow['name']; + $_SESSION['Alloc']->TransType = $myrow['type']; + $_SESSION['Alloc']->TransTypeName = $myrow['typename']; + $_SESSION['Alloc']->TransNo = $myrow['transno']; + $_SESSION['Alloc']->TransExRate = $myrow['rate']; + $_SESSION['Alloc']->TransAmt = $myrow['total']; + $_SESSION['Alloc']->PrevDiffOnExch = $myrow['diffonexch']; + $_SESSION['Alloc']->TransDate = ConvertSQLDate($myrow['trandate']); + $_SESSION['Alloc']->CurrDecimalPlaces = $myrow['decimalplaces']; + + // Now get invoices or neg receipts that have outstanding balances + $SQL = "SELECT debtortrans.id, + typename, + transno, + trandate, + rate, + ovamount+ovgst+ovfreight+ovdiscount as total, + diffonexch, + alloc + FROM debtortrans INNER JOIN systypes + ON debtortrans.type = systypes.typeid + WHERE debtortrans.settled=0 + AND (systypes.typeid=10 OR (systypes.typeid=12 AND ovamount>0) + AND debtorno='" . $_SESSION['Alloc']->DebtorNo . "' + ORDER BY debtortransid DESC"; + $TransResult = DB_query($SQL); + $BalToAllocate = $_SESSION['Alloc']->TransAmt - $myrow['alloc']; + while ($myalloc=DB_fetch_array($TransResult) AND $BalToAllocate > 0) { + if ($myalloc['total']-$myalloc['alloc']< $BalToAllocate) { + $ThisAllocation = $myalloc['total']-$myalloc['alloc']; + } else { + $ThisAllocation = $BalToAllocate; + } + $_SESSION['Alloc']->add_to_AllocsAllocn ($myalloc['id'], + $myalloc['typename'], + $myalloc['transno'], + ConvertSQLDate($myalloc['trandate']), + $ThisAllocation, + $myalloc['total'], + $myalloc['rate'], + $myalloc['diffonexch'], + $myalloc['diffonexch'], + $myalloc['alloc'], + 'NA'); + $BalToAllocate -= $ThisAllocation; + } + DB_free_result($TransResult); + ProcessAllocation(); + } + echo '</table>'; +} + +include('includes/footer.inc'); + +function ProcessAllocation() { + global $db; + if ($InputError==0) { + // + //========[ START TRANSACTION ]=========== + // + $Error = ''; + $Result= DB_Txn_Begin(); + $AllAllocations = 0; + foreach ($_SESSION['Alloc']->Allocs as $AllocnItem) { + + if ($AllocnItem->AllocAmt > 0) { + $SQL = "INSERT INTO + custallocns ( + datealloc, + amt, + transid_allocfrom, + transid_allocto + ) VALUES ( + '" . date('Y-m-d') . "', + '" . $AllocnItem->AllocAmt . "', + '" . $_SESSION['Alloc']->AllocTrans . "', + '" . $AllocnItem->ID . "' + )"; + if( !$Result = DB_query($SQL) ) { + $Error = _('Could not insert allocation record'); + } + } + $NewAllocTotal = $AllocnItem->PrevAlloc + $AllocnItem->AllocAmt; + $AllAllocations = $AllAllocations + $AllocnItem->AllocAmt; + $Settled = (abs($NewAllocTotal-$AllocnItem->TransAmount) < 0.005) ? 1 : 0; + + $SQL = "UPDATE debtortrans + SET diffonexch='" . $AllocnItem->DiffOnExch . "', + alloc = '" . $NewAllocTotal . "', + settled = '" . $Settled . "' + WHERE id = '" . $AllocnItem->ID."'"; + if( !$Result = DB_query($SQL) ) { + $Error = _('Could not update difference on exchange'); + } + } + if (abs($TotalAllocated + $_SESSION['Alloc']->TransAmt) < 0.01) { + $Settled = 1; + } else { + $Settled = 0; + } + // Update the receipt or credit note + $SQL = "UPDATE debtortrans + SET alloc = '" . -$AllAllocations . "', + diffonexch = '" . -$TotalDiffOnExch . "', + settled='" . $Settled . "' + WHERE id = '" . $_SESSION['Alloc']->AllocTrans . "'"; + + if( !$Result = DB_query($SQL) ) { + $Error = _('Could not update receipt or credit note'); + } + + // If GLLink to debtors active post diff on exchange to GL + $MovtInDiffOnExch = -$_SESSION['Alloc']->PrevDiffOnExch - $TotalDiffOnExch; + + if ($MovtInDiffOnExch !=0) { + if ($_SESSION['CompanyRecord']['gllink_debtors'] == 1) { + $PeriodNo = GetPeriod($_SESSION['Alloc']->TransDate,); + $_SESSION['Alloc']->TransDate = FormatDateForSQL($_SESSION['Alloc']->TransDate); + + $SQL = "INSERT INTO gltrans ( + type, + typeno, + trandate, + periodno, + account, + narrative, + amount + ) VALUES ( + '" . $_SESSION['Alloc']->TransType . "', + '" . $_SESSION['Alloc']->TransNo . "', + '" . $_SESSION['Alloc']->TransDate . "', + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['exchangediffact'] . "', + '', + '" . $MovtInDiffOnExch . "' + )"; + if( !$Result = DB_query($SQL) ) { + $Error = _('Could not update exchange difference in General Ledger'); + } + + $SQL = "INSERT INTO gltrans ( + type, + typeno, + trandate, + periodno, + account, + narrative, + amount + ) VALUES ('" . $_SESSION['Alloc']->TransType . "', + '" . $_SESSION['Alloc']->TransNo . "', + '" . $_SESSION['Alloc']->TransDate . "', + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['debtorsact'] . "', + '', + '" . -$MovtInDiffOnExch . "')"; + + if( !$Result = DB_query($SQL) ) { + $Error = _('Could not update debtors control in General Ledger'); + } + } + + } + + // + //========[ COMMIT TRANSACTION ]=========== + // + if (empty($Error) ) { + $Result = DB_Txn_Commit(); + } else { + $Result = DB_Txn_Rollback(); + prnMsg($Error,'error'); + } + unset($_SESSION['Alloc']); + unset($_POST['AllocTrans']); + } +} + +?> +ocTrans']); + } +} + +?> + +} + +?> + +?> Property changes on: trunk/Z_AutoCustomerAllocations.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Modified: trunk/Z_DeleteOldPrices.php =================================================================== --- trunk/Z_DeleteOldPrices.php 2014-11-20 12:37:23 UTC (rev 6997) +++ trunk/Z_DeleteOldPrices.php 2014-11-22 02:28:56 UTC (rev 6998) @@ -6,18 +6,42 @@ include('includes/header.inc'); if (isset($_POST['DeleteOldPrices'])){ - $result=DB_query("DELETE FROM prices WHERE enddate<'" . Date('Y-m-d') . "' AND enddate <>'0000-00-00'"); + DB_Txn_Begin(); + $result=DB_query("DELETE FROM prices WHERE enddate<'" . Date('Y-m-d') . "' AND enddate <>'0000-00-00'",'','',true); + $result=DB_query("SELECT stockid, + typeabbrev, + currabrev, + debtorno, + branchcode, + MAX(startdate) as lateststart + FROM prices + WHERE startdate<='" . Date('Y-m-d') . "' + AND enddate ='0000-00-00' + GROUP BY stockid, + typeabbrev, + currabrev, + debtorno, + branchcode"); + + while ($myrow = DB_fetch_array($result)){ + $DelResult = DB_query("DELETE FROM prices WHERE stockid='" . $myrow['stockid'] . "' + AND debtorno='" . $myrow['debtorno'] . "' + AND branchcode='" . $myrow['branchcode'] . "' + AND currabrev='" . $myrow['currabrev'] . "' + AND typeabbrev='" . $myrow['typeabbrev'] . "' + AND enddate='0000-00-00' + AND startdate<'" . $myrow['lateststart'] . "'",'','',true); + } prnMsg(_('All old prices have been deleted'),'success'); + DB_Txn_Commit(); } -echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">'; -echo '<div class="centre">'; -echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - -echo '<br /> - <input type="submit" name="DeleteOldPrices" value="' . _('Purge Old Prices') . '" onclick="return confirm(\'' . _('Are You Sure you wish to delete all old prices?') . '\');" />'; - -echo '</div> +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post"> + <div class="centre"> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <br /> + <input type="submit" name="DeleteOldPrices" value="' . _('Purge Old Prices') . '" onclick="return confirm(\'' . _('Are You Sure you wish to delete all old prices?') . '\');" /> + </div> </form>'; include('includes/footer.inc'); Added: trunk/Z_RebuildSalesAnalysis.php =================================================================== --- trunk/Z_RebuildSalesAnalysis.php (rev 0) +++ trunk/Z_RebuildSalesAnalysis.php 2014-11-22 02:28:56 UTC (rev 6998) @@ -0,0 +1,69 @@ +<?php +/* $Id: Z_RebuildSalesAnalysis.php 5784 2012-12-29 04:00:43Z daintree $*/ +/* Script to rebuild sales analysis records from stock movements*/ +$PageSecurity = 15; +include ('includes/session.inc'); +$Title = _('Rebuild sales analysis Records'); +include('includes/header.inc'); + +echo '<br /><br />' . _('This script rebuilds sales analysis records. NB: all sales budget figures will be lost!'); + +$result = DB_query("TRUNCATE TABLE salesanalysis"); + +$sql = "INSERT INTO salesanalysis (typeabbrev, + periodno, + amt, + cost, + cust, + custbranch, + qty, + disc, + stockid, + area, + budgetoractual, + salesperson, + stkcategory) + SELECT salestype, + (SELECT periodno FROM periods WHERE MONTH(lastdate_in_period)=MONTH(trandate) AND YEAR(lastdate_in_period)=YEAR(trandate)) as prd, + SUM(price*-qty) as salesvalue, + SUM(standardcost*-qty) as cost, + stockmoves.debtorno, + stockmoves.branchcode, + SUM(-qty), + SUM(-qty*price*discountpercent) AS discountvalue, + stockmoves.stockid, + custbranch.area, + 1, + custbranch.salesman, + stockmaster.categoryid + FROM stockmoves + INNER JOIN debtorsmaster + ON stockmoves.debtorno=debtorsmaster.debtorno + INNER JOIN custbranch + ON stockmoves.debtorno=custbranch.debtorno + AND stockmoves.branchcode=custbranch.branchcode + INNER JOIN stockmaster + ON stockmoves.stockid=stockmaster.stockid + WHERE show_on_inv_crds=1 + GROUP BY salestype, + debtorno, + prd, + branchcode, + stockid, + area, + salesman, + categoryid + ORDER BY prd"; + +$ErrMsg = _('The sales analysis data could not be recreated because'); +$Result = DB_query($sql,$ErrMsg); + +echo '<p />'; +prnMsg(_('The sales analsysis data has been recreated based on current stock master and customer master information'),'info'); + +include('includes/footer.inc'); +?> + +?> +?> + Property changes on: trunk/Z_RebuildSalesAnalysis.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: trunk/Z_UpdateItemCosts.php =================================================================== --- trunk/Z_UpdateItemCosts.php (rev 0) +++ trunk/Z_UpdateItemCosts.php 2014-11-22 02:28:56 UTC (rev 6998) @@ -0,0 +1,124 @@ +<?php +include('includes/session.inc'); +$Title = _('Update Item Costs From CSV'); +include('includes/header.inc'); +include('includes/SQL_CommonFunctions.inc'); +echo '<p class="page_title_text"><img alt="" src="' . $RootPath . '/css/' . $Theme . + '/images/maintenance.png" title="' . + _('Update Item Costs from CSV file') . '" />' . ' ' . + _('Update Item Costs from CSV file') . '</p>'; + +$FieldHeadings = array('StockID', + 'Material Cost', + 'Labour Cost', + 'Overhead Cost'); + +if (isset($_FILES['CostUpdateFile']) and $_FILES['CostUpdateFile']['name']) { //start file processing + //check file info + $FileName = $_FILES['CostUpdateFile']['name']; + $TempName = $_FILES['CostUpdateFile']['tmp_name']; + $FileSize = $_FILES['CostUpdateFile']['size']; + $InputError = 0; + + //get file handle + $FileHandle = fopen($TempName, 'r'); + + //get the header row + $HeadRow = fgetcsv($FileHandle, 10000, ','); + + //check for correct number of fields + if ( count($HeadRow) != count($FieldHeadings) ) { + prnMsg (_('File contains') . ' '. count($HeadRow). ' ' . _('columns, expected') . ' '. count($FieldHeadings) ,'error'); + fclose($FileHandle); + include('includes/footer.inc'); + exit; + } + + //test header row field name and sequence + $HeadingColumnNumber = 0; + foreach ($HeadRow as $HeadField) { + if ( trim(mb_strtoupper($HeadField)) != trim(mb_strtoupper($FieldHeadings[$HeadingColumnNumber]))) { + prnMsg (_('The file to import the item cost updates from contains incorrect column headings') . ' '. mb_strtoupper($HeadField). ' != '. mb_strtoupper($FieldHeadings[$HeadingColumnNumber]). '<br />' . _('The column headings must be') . ' StockID, Material Cost, Labour Cost, Overhead Cost','error'); + fclose($FileHandle); + include('includes/footer.inc'); + exit; + } + $HeadingColumnNumber++; + } + //start database transaction + DB_Txn_Begin(); + + //loop through file rows + $LineNumber = 1; + while ( ($myrow = fgetcsv($FileHandle, 10000, ',')) !== FALSE ) { + + $StockID = mb_strtoupper($myrow[0]); + + $NewCost = (double)$myrow[1]+(double)$myrow[2]+(double)$myrow[3]; + + $sql = "SELECT mbflag, + materialcost, + labourcost, + overheadcost, + sum(quantity) as totalqoh + FROM stockmaster INNER JOIN locstock + ON stockmaster.stockid=locstock.stockid + WHERE stockmaster.stockid='" . $StockID . "' + GROUP BY materialcost, + labourcost, + overheadcost"; + + $ErrMsg = _('The selected item code does not exist'); + $OldResult = DB_query($sql,$ErrMsg); + $OldRow = DB_fetch_array($OldResult); + $QOH = $OldRow['totalqoh']; + + $OldCost = $OldRow['materialcost'] + $OldRow['labourcost'] + $OldRow['overheadcost']; + //dont update costs for assembly or kit-sets or ghost items!! + if ($OldCost != $NewCost AND $OldRow['mbflag']!='K' AND $OldRow['mbflag']!='A' AND $OldRow['mbflag']!='G'){ + + ItemCostUpdateGL($db, $StockID, $NewCost, $OldCost, $QOH); + + $SQL = "UPDATE stockmaster SET materialcost='" . (double) $myrow[1] . "', + labourcost='" . (double) $myrow[2] . "', + overheadcost='" . (double) $myrow[3] . "', + lastcost='" . $OldCost . "', + lastcostupdate ='" . Date('Y-m-d')."' + WHERE stockid='" . $StockID . "'"; + + $ErrMsg = _('The cost details for the stock item could not be updated because'); + $DbgMsg = _('The SQL that failed was'); + $Result = DB_query($SQL,$ErrMsg,$DbgMsg,true); + + UpdateCost($db, $StockID); //Update any affected BOMs + + } + + $LineNumber++; + } + + DB_Txn_Commit(); + prnMsg( _('Batch Update of costs') .' ' . $FileName . ' '. _('has been completed. All transactions committed to the database.'),'success'); + + fclose($FileHandle); + +} else { //show file upload form + + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post" enctype="multipart/form-data">'; + echo '<div class="centre">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<div class="page_help_text">' . + _('This function updates the costs of all items from a comma separated variable (csv) file.') . '<br />' . + _('The file must contain two columns, and the first row should be the following headers:') . '<br /><i>StockID, Material Cost, Labour Cost, Overhead Cost</i><br />' . + _('followed by rows containing these four fields for each cost to be updated.') . '<br />' . + _('The StockID field must have a correspond... [truncated message content] |
From: <dai...@us...> - 2014-11-22 02:39:24
|
Revision: 6999 http://sourceforge.net/p/web-erp/reponame/6999 Author: daintree Date: 2014-11-22 02:39:16 +0000 (Sat, 22 Nov 2014) Log Message: ----------- script to export sales analysis automatically to an ftp server intended to be run from cron Modified Paths: -------------- trunk/Z_AutoCustomerAllocations.php Added Paths: ----------- trunk/Z_ExportSalesAnalysis.php Modified: trunk/Z_AutoCustomerAllocations.php =================================================================== --- trunk/Z_AutoCustomerAllocations.php 2014-11-22 02:28:56 UTC (rev 6998) +++ trunk/Z_AutoCustomerAllocations.php 2014-11-22 02:39:16 UTC (rev 6999) @@ -19,7 +19,7 @@ if (isset($_GET['DebtorNo'])) { // Page called with customer code - + $SQL = "SELECT debtortrans.id, debtortrans.transno, systypes.typename, @@ -53,7 +53,7 @@ } echo '<table class="selection">'; echo $TableHeader; - + while ($myrow = DB_fetch_array($result)) { unset($_SESSION['Alloc']->Allocs); unset($_SESSION['Alloc']); @@ -215,7 +215,7 @@ '" . $_SESSION['CompanyRecord']['debtorsact'] . "', '', '" . -$MovtInDiffOnExch . "')"; - + if( !$Result = DB_query($SQL) ) { $Error = _('Could not update debtors control in General Ledger'); } @@ -237,15 +237,4 @@ } } -?> -ocTrans']); - } -} - -?> - -} - -?> - -?> +?> \ No newline at end of file Added: trunk/Z_ExportSalesAnalysis.php =================================================================== --- trunk/Z_ExportSalesAnalysis.php (rev 0) +++ trunk/Z_ExportSalesAnalysis.php 2014-11-22 02:39:16 UTC (rev 6999) @@ -0,0 +1,165 @@ +<?php +/* $Id: Z_ExportSalesAnalysis.php 5785 2012-12-29 04:47:42Z daintree $*/ + +/* Creates the csv files necessary for Phocas sales analysis and sends to an ftp server*/ + +/*Config */ + +$FTP_Server = 'someftpserver.com'; +$FTP_User = 'someuser'; +$FTP_Password = ''; + +$AllowAnyone=true; +$PageSecurity=15; +$_POST['CompanyNameField']= 'yourdatabase'; + +include ('includes/session.inc'); +$Title = _('Create and send sales analysis files'); +include ('includes/header.inc'); + +echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/inventory.png" title="' . _('Export Sales Analysis Files') .'" alt="" /><b>' . $Title. '</b></p>'; + +function stripcomma($str) { //because we're using comma as a delimiter + return str_replace(',', '', $str); +} + +echo '<div class="centre">' . _('Making a comma separated values file of the stock items') . '</div>'; + +$ErrMsg = _('The SQL to get the stock items failed with the message'); + +$sql = "SELECT stockid, categoryid, description FROM stockmaster"; +$result = DB_query($sql, $ErrMsg); + +if (!file_exists($_SESSION['reports_dir'])){ + $Result = mkdir('./' . $_SESSION['reports_dir']); +} + +$ItemsFileName = $_SESSION['reports_dir'] . '/StockItems.csv'; + +unlink($ItemsFileName); + +$fp = fopen($ItemsFileName,'w'); + +if ($fp==FALSE){ + + prnMsg(_('Could not open or create the file under') . ' ' . $ItemsFileName,'error'); + include('includes/footer.inc'); + exit; +} +fputs($fp, '"Item Code", "Category ID", "Item Description"' . "\n"); +While ($myrow = DB_fetch_row($result)){ + $line = stripcomma($myrow[0]) . ', ' . stripcomma($myrow[1]) . ', ' . stripcomma($myrow[2]); + //fputs($fp,"\xEF\xBB\xBF" . $line . "\n"); + fputs($fp, $line . "\n"); +} + +fclose($fp); +//Now the customers + +echo '<div class="centre">' . _('Making a comma separated values file of the customers') . '</div>'; + +$ErrMsg = _('The SQL to get the customers failed with the message'); + +$sql = "SELECT debtorsmaster.debtorno, debtorsmaster.name, custbranch.branchcode, brname, salestype, area, salesman FROM debtorsmaster INNER JOIN custbranch ON debtorsmaster.debtorno=custbranch.debtorno"; +$result = DB_query($sql, $ErrMsg); + +$CustomersFileName = $_SESSION['reports_dir'] . '/Customers.csv'; + +unlink($CustomersFileName); + +$fp = fopen($CustomersFileName,'w'); + +if ($fp==FALSE){ + + prnMsg(_('Could not open or create the file under') . ' ' . $CustomersFileName,'error'); + include('includes/footer.inc'); + exit; +} +fputs($fp, '"Customer Code", "Customer Name", "Branch Code", "Branch Name", "Price List", "Sales Area", "Salesman"' . "\n"); +While ($myrow = DB_fetch_row($result)){ + $line = stripcomma($myrow[0]) . ', ' . stripcomma($myrow[1]). ', ' . stripcomma($myrow[2]) . ', ' . stripcomma($myrow[3]) . ', ' . stripcomma($myrow[4]) . ', ' . stripcomma($myrow[5]) . ', ' . stripcomma($myrow[6]); + //fputs($fp,"\xEF\xBB\xBF" . $line . "\n"); + fputs($fp, $line . "\n"); +} + +fclose($fp); + +//Now the sales analysis invoice & credit note lines + +echo '<div class="centre">' . _('Making a comma separated values file of the sales lines') . '</div>'; + +$ErrMsg = _('The SQL to get the sales data failed with the message'); + +$sql = "SELECT stockmoves.debtorno, + stockmoves.branchcode, + stockid, + trandate, + -qty, + -price*(1-discountpercent)*qty, + -standardcost*qty, + transno + FROM stockmoves + INNER JOIN custbranch + ON stockmoves.debtorno=custbranch.debtorno + AND stockmoves.branchcode=custbranch.branchcode + WHERE (stockmoves.type=10 OR stockmoves.type=11) + AND show_on_inv_crds=1"; + +$result = DB_query($sql, $ErrMsg); + +$SalesFileName = $_SESSION['reports_dir'] . '/SalesAnalysis.csv'; + +unlink($SalesFileName); + +$fp = fopen($SalesFileName,'w'); + +if ($fp==FALSE){ + + prnMsg(_('Could not open or create the file under') . ' ' . $SalesFileName,'error'); + include('includes/footer.inc'); + exit; +} +fputs($fp,'"Customer Code", "Branch Code", "Item Code", "Date", "Quantity", "Line Value", "Line Cost", "Inv/Credit Number"' . "\n"); +While ($myrow = DB_fetch_row($result)){ + $line = stripcomma($myrow[0]) . ', ' . stripcomma($myrow[1]) . ', ' . stripcomma($myrow[2]) . ', ' . stripcomma($myrow[3]) . ', ' . stripcomma($myrow[4]) . ', ' . stripcomma($myrow[5]) . ', ' . stripcomma($myrow[6]) . ', ' . stripcomma($myrow[7]); + //fputs($fp,"\xEF\xBB\xBF" . $line . "\n"); + fputs($fp, $line . "\n"); +} + +fclose($fp); + +// set up basic ftp connection +$conn_id = ftp_connect($FTP_Server); + +// login with username and password +$login_result = ftp_login($conn_id, $FTP_User, $FTP_Password); + +// check connection +if ((!$conn_id) || (!$login_result)) { + echo "FTP connection has failed!"; + echo "Attempted to connect to $FTP_Server with user $FTP_User"; + exit; +} else { + echo "Connected to ftp_server"; +} + +// upload the files +$upload = ftp_put($conn_id, '/' . Date('Y-m-d') .'_Sales.csv', $SalesFileName, FTP_BINARY); +$upload = ftp_put($conn_id, '/' . Date('Y-m-d') .'_Items.csv', $ItemsFileName, FTP_BINARY); +$upload = ftp_put($conn_id, '/' . Date('Y-m-d') .'_Customers.csv', $CustomersFileName, FTP_BINARY); + +// check upload status +if (!$upload) { + echo "FTP upload has failed!"; +} else { + echo "Uploaded $source_file to $ftp_server as $destination_file"; +} + +// close the FTP stream +ftp_close($conn_id); + +include('includes/footer.inc'); + +?>oter.inc'); + +?> \ No newline at end of file Property changes on: trunk/Z_ExportSalesAnalysis.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property |
From: <rc...@us...> - 2014-11-24 15:56:28
|
Revision: 7004 http://sourceforge.net/p/web-erp/reponame/7004 Author: rchacon Date: 2014-11-24 15:56:19 +0000 (Mon, 24 Nov 2014) Log Message: ----------- Spanish translation improvements. Merging "View GL Entries" and "View the GL Entries". Modified Paths: -------------- trunk/CustomerInquiry.php trunk/doc/Change.log Modified: trunk/CustomerInquiry.php =================================================================== --- trunk/CustomerInquiry.php 2014-11-24 02:12:27 UTC (rev 7003) +++ trunk/CustomerInquiry.php 2014-11-24 15:56:19 UTC (rev 7004) @@ -45,7 +45,6 @@ } } - if (isset($_GET['Status'])) { if (is_numeric($_GET['Status'])) { @@ -323,7 +322,7 @@ </td> <td> <a href="', $RootPath, '/GLTransInquiry.php?TypeID=', $MyRow['type'], '&TransNo=', $MyRow['transno'], '">', _('View GL Entries'), ' - <img src="', $RootPath, '/css/', $Theme, '/images/gl.png" title="', _('View the GL Entries'), '" alt="" /> + <img src="', $RootPath, '/css/', $Theme, '/images/gl.png" title="', _('View GL Entries'), '" alt="" /> </a> </td> </tr>'; @@ -441,7 +440,7 @@ </td> <td> <a href="', $RootPath, '/GLTransInquiry.php?TypeID=', $MyRow['type'], '&TransNo=', $MyRow['transno'], '">' . _('View GL Entries') . ' - <img src="', $RootPath, '/css/', $Theme, '/images/gl.png" title="', _('View the GL Entries'), '" alt="" /> + <img src="', $RootPath, '/css/', $Theme, '/images/gl.png" title="', _('View GL Entries'), '" alt="" /> </a> </td> </tr>'; @@ -511,7 +510,7 @@ <td></td> <td> <a href="', $RootPath, '/GLTransInquiry.php?TypeID=', $MyRow['type'], '&TransNo=', $MyRow['transno'], '">', _('View GL Entries'), ' - <img src="', $RootPath, '/css/', $Theme, '/images/gl.png" title="', _('View the GL Entries'), '" alt="" /> + <img src="', $RootPath, '/css/', $Theme, '/images/gl.png" title="', _('View GL Entries'), '" alt="" /> </a> </td> </tr>'; @@ -565,7 +564,7 @@ <td></td> <td> <a href="', $RootPath, '/GLTransInquiry.php?TypeID=', $MyRow['type'], '&TransNo=', $MyRow['transno'], '">' . _('View GL Entries') . ' - <img src="', $RootPath, '/css/', $Theme, '/images/gl.png" title="', _('View the GL Entries'), '" alt="" /> + <img src="', $RootPath, '/css/', $Theme, '/images/gl.png" title="', _('View GL Entries'), '" alt="" /> </a> </td> </tr>'; @@ -614,7 +613,7 @@ <td></td> <td> <a href="', $RootPath, '/GLTransInquiry.php?TypeID=', $MyRow['type'], '&TransNo=', $MyRow['transno'], '">', _('View GL Entries'), ' - <img src="', $RootPath, '/css/', $Theme, '/images/gl.png" title="', _('View the GL Entries'), '" alt="" /> + <img src="', $RootPath, '/css/', $Theme, '/images/gl.png" title="', _('View GL Entries'), '" alt="" /> </a> </td> </tr>'; @@ -648,4 +647,4 @@ echo '</table>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2014-11-24 02:12:27 UTC (rev 7003) +++ trunk/doc/Change.log 2014-11-24 15:56:19 UTC (rev 7004) @@ -1,5 +1,6 @@ webERP Change Log +22/11/14 RChacon: Spanish translation improvements. Merging "View GL Entries" and "View the GL Entries". 22/11/14 Exson: Fix the qualitytext does not have default value for strict sql mode in Credit_Invoice.php. 22/11/14 Phil: Z_DeleteOldPrices.php now removes all old prices where there is a later start for a price with no end date 22/11/14 Phil: Added new script CustomerBalancesMovement.php to show customer activity debits and credits and the movement of their balances over a specified date range |
From: <rc...@us...> - 2014-11-24 16:25:39
|
Revision: 7005 http://sourceforge.net/p/web-erp/reponame/7005 Author: rchacon Date: 2014-11-24 16:25:25 +0000 (Mon, 24 Nov 2014) Log Message: ----------- Spanish files... Modified Paths: -------------- trunk/doc/Change.log trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2014-11-24 15:56:19 UTC (rev 7004) +++ trunk/doc/Change.log 2014-11-24 16:25:25 UTC (rev 7005) @@ -1,6 +1,6 @@ webERP Change Log -22/11/14 RChacon: Spanish translation improvements. Merging "View GL Entries" and "View the GL Entries". +24/11/14 RChacon: Spanish translation improvements. Merging "View GL Entries" and "View the GL Entries". 22/11/14 Exson: Fix the qualitytext does not have default value for strict sql mode in Credit_Invoice.php. 22/11/14 Phil: Z_DeleteOldPrices.php now removes all old prices where there is a later start for a price with no end date 22/11/14 Phil: Added new script CustomerBalancesMovement.php to show customer activity debits and credits and the movement of their balances over a specified date range Modified: trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po 2014-11-24 15:56:19 UTC (rev 7004) +++ trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po 2014-11-24 16:25:25 UTC (rev 7005) @@ -7,8 +7,8 @@ msgstr "" "Project-Id-Version: webERP 4.11.3\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-10-13 21:09+1300\n" -"PO-Revision-Date: 2014-09-11 10:07-0600\n" +"POT-Creation-Date: 2014-11-24 08:05-0600\n" +"PO-Revision-Date: 2014-11-24 10:23-0600\n" "Last-Translator: Rafael Chacon <raf...@gm...>\n" "Language-Team: TecnoSoluciones.com <web...@te...>\n" "Language: es_ES\n" @@ -19,7 +19,7 @@ "X-Launchpad-Export-Date: 2011-05-24 09:54+0000\n" "X-Poedit-SourceCharset: UTF-8\n" -#: AccountGroups.php:5 includes/MainMenuLinksArray.php:374 +#: AccountGroups.php:6 includes/MainMenuLinksArray.php:376 msgid "Account Groups" msgstr "Grupos contables" @@ -175,23 +175,23 @@ #: Areas.php:115 Areas.php:124 BankAccounts.php:163 CreditStatus.php:125 #: Currencies.php:244 Currencies.php:252 Currencies.php:260 #: CustomerBranches.php:301 CustomerBranches.php:311 CustomerBranches.php:321 -#: CustomerBranches.php:331 CustomerBranches.php:341 Customers.php:296 -#: Customers.php:305 Customers.php:313 Customers.php:324 Customers.php:334 -#: CustomerTypes.php:146 CustomerTypes.php:156 Departments.php:141 -#: Factors.php:134 FixedAssetCategories.php:137 GLAccounts.php:79 -#: GLAccounts.php:95 Locations.php:265 Locations.php:273 Locations.php:284 -#: Locations.php:293 Locations.php:302 Locations.php:311 Locations.php:320 -#: Locations.php:329 Locations.php:337 Manufacturers.php:154 -#: MRPDemandTypes.php:87 PaymentMethods.php:143 PaymentTerms.php:146 -#: PaymentTerms.php:153 PcExpenses.php:161 SalesCategories.php:128 -#: SalesCategories.php:135 SalesPeople.php:150 SalesPeople.php:157 -#: SalesPeople.php:163 SalesTypes.php:140 SalesTypes.php:150 Shippers.php:81 -#: Shippers.php:93 StockCategories.php:209 Stocks.php:738 Stocks.php:747 -#: Stocks.php:755 Stocks.php:763 Stocks.php:771 Stocks.php:779 Stocks.php:787 -#: Stocks.php:795 Suppliers.php:646 Suppliers.php:655 Suppliers.php:663 -#: SupplierTypes.php:126 TaxCategories.php:132 TaxGroups.php:134 -#: TaxGroups.php:142 TaxProvinces.php:129 UnitsOfMeasure.php:135 -#: WorkCentres.php:89 WorkCentres.php:95 WWW_Access.php:86 +#: CustomerBranches.php:331 CustomerBranches.php:341 CustomerTypes.php:146 +#: CustomerTypes.php:156 Customers.php:296 Customers.php:305 Customers.php:313 +#: Customers.php:324 Customers.php:334 Departments.php:141 Factors.php:134 +#: FixedAssetCategories.php:137 GLAccounts.php:79 GLAccounts.php:95 +#: Locations.php:265 Locations.php:273 Locations.php:284 Locations.php:293 +#: Locations.php:302 Locations.php:311 Locations.php:320 Locations.php:329 +#: Locations.php:337 MRPDemandTypes.php:87 Manufacturers.php:154 +#: PaymentMethods.php:143 PaymentTerms.php:146 PaymentTerms.php:153 +#: PcExpenses.php:161 SalesCategories.php:128 SalesCategories.php:135 +#: SalesPeople.php:150 SalesPeople.php:157 SalesPeople.php:163 +#: SalesTypes.php:140 SalesTypes.php:150 Shippers.php:81 Shippers.php:93 +#: StockCategories.php:209 Stocks.php:734 Stocks.php:743 Stocks.php:751 +#: Stocks.php:759 Stocks.php:767 Stocks.php:775 Stocks.php:783 Stocks.php:791 +#: SupplierTypes.php:126 Suppliers.php:646 Suppliers.php:655 Suppliers.php:663 +#: TaxCategories.php:132 TaxGroups.php:134 TaxGroups.php:142 +#: TaxProvinces.php:129 UnitsOfMeasure.php:135 WWW_Access.php:86 +#: WorkCentres.php:89 WorkCentres.php:95 msgid "There are" msgstr "Existen" @@ -246,50 +246,50 @@ #: AccountGroups.php:285 AccountSections.php:169 AddCustomerContacts.php:25 #: AddCustomerContacts.php:27 AddCustomerNotes.php:101 #: AddCustomerTypeNotes.php:94 AgedDebtors.php:454 AgedSuppliers.php:276 -#: Areas.php:144 AuditTrail.php:11 BankReconciliation.php:17 -#: BOMExtendedQty.php:256 BOMIndented.php:248 BOMIndentedReverse.php:236 -#: BOMInquiry.php:188 BOMListing.php:110 BOMs.php:237 BOMs.php:888 -#: COGSGLPostings.php:19 CompanyPreferences.php:102 CounterReturns.php:1623 -#: CounterSales.php:2090 CounterSales.php:2186 Credit_Invoice.php:276 -#: CreditStatus.php:21 Currencies.php:30 CustEDISetup.php:17 CustItem.php:120 -#: CustItem.php:210 CustItem.php:238 DailyBankTransactions.php:11 -#: DebtorsAtPeriodEnd.php:129 DiscountCategories.php:12 -#: DiscountCategories.php:149 DiscountMatrix.php:16 EDIMessageFormat.php:105 -#: FixedAssetLocations.php:13 FixedAssetRegister.php:16 -#: FixedAssetRegister.php:256 FixedAssetTransfer.php:14 FormDesigner.php:185 -#: GLBalanceSheet.php:387 GLBudgets.php:32 GLJournalInquiry.php:11 -#: GLJournal.php:250 InternalStockRequest.php:311 InventoryPlanning.php:360 -#: InventoryPlanningPrefSupplier.php:386 MaintenanceTasks.php:14 -#: MaintenanceUserSchedule.php:16 MRPReport.php:516 NoSalesItems.php:91 -#: PcAssignCashToTab.php:59 PcAssignCashToTab.php:133 -#: PcAssignCashToTab.php:149 PcAssignCashToTab.php:193 PDFPickingList.php:29 -#: PDFStockLocTransfer.php:16 PO_AuthorisationLevels.php:10 POReport.php:60 -#: POReport.php:64 POReport.php:68 PO_SelectOSPurchOrder.php:148 -#: PriceMatrix.php:16 PricesBasedOnMarkUp.php:8 Prices_Customer.php:35 -#: Prices.php:11 PurchaseByPrefSupplier.php:305 PurchData.php:241 -#: PurchData.php:373 PurchData.php:401 RecurringSalesOrders.php:320 -#: RelatedItemsUpdate.php:24 SalesAnalReptCols.php:51 SalesAnalRepts.php:14 -#: SalesCategories.php:11 SalesGLPostings.php:19 SalesGraph.php:40 -#: SalesPeople.php:20 SalesTypes.php:20 SelectAsset.php:48 -#: SelectCompletedOrder.php:11 SelectContract.php:69 SelectCreditItems.php:220 -#: SelectCreditItems.php:291 SelectCustomer.php:265 SelectGLAccount.php:65 -#: SelectOrderItems.php:559 SelectOrderItems.php:1444 -#: SelectOrderItems.php:1544 SelectProduct.php:512 SelectSalesOrder.php:508 -#: SelectSupplier.php:14 SelectSupplier.php:220 SelectWorkOrder.php:9 -#: SelectWorkOrder.php:174 SellThroughSupport.php:229 ShipmentCosting.php:11 -#: Shipments.php:17 Shippers.php:123 Shippers.php:160 Shipt_Select.php:8 -#: StockLocMovements.php:14 StockLocStatus.php:29 +#: Areas.php:144 AuditTrail.php:11 BOMExtendedQty.php:256 BOMIndented.php:248 +#: BOMIndentedReverse.php:236 BOMInquiry.php:187 BOMListing.php:110 +#: BOMs.php:239 BOMs.php:890 BankReconciliation.php:17 COGSGLPostings.php:19 +#: CompanyPreferences.php:102 CounterReturns.php:1623 CounterSales.php:2091 +#: CounterSales.php:2187 CreditStatus.php:21 Credit_Invoice.php:276 +#: Currencies.php:30 CustEDISetup.php:17 CustItem.php:120 CustItem.php:210 +#: CustItem.php:238 DailyBankTransactions.php:11 DebtorsAtPeriodEnd.php:129 +#: DiscountCategories.php:12 DiscountCategories.php:149 DiscountMatrix.php:16 +#: EDIMessageFormat.php:105 FixedAssetLocations.php:13 +#: FixedAssetRegister.php:16 FixedAssetRegister.php:256 +#: FixedAssetTransfer.php:14 FormDesigner.php:185 GLBalanceSheet.php:387 +#: GLBudgets.php:32 GLJournal.php:250 GLJournalInquiry.php:11 +#: InternalStockRequest.php:311 InventoryPlanning.php:354 +#: InventoryPlanningPrefSupplier.php:386 MRPReport.php:516 +#: MaintenanceTasks.php:14 MaintenanceUserSchedule.php:16 NoSalesItems.php:91 +#: PDFPickingList.php:29 PDFStockLocTransfer.php:16 POReport.php:60 +#: POReport.php:64 POReport.php:68 PO_AuthorisationLevels.php:10 +#: PO_SelectOSPurchOrder.php:148 PcAssignCashToTab.php:59 +#: PcAssignCashToTab.php:133 PcAssignCashToTab.php:149 +#: PcAssignCashToTab.php:193 PriceMatrix.php:16 Prices.php:11 +#: PricesBasedOnMarkUp.php:8 Prices_Customer.php:35 PurchData.php:241 +#: PurchData.php:373 PurchData.php:401 PurchaseByPrefSupplier.php:305 +#: RecurringSalesOrders.php:320 RelatedItemsUpdate.php:24 +#: SalesAnalReptCols.php:51 SalesAnalRepts.php:14 SalesCategories.php:11 +#: SalesGLPostings.php:19 SalesGraph.php:40 SalesPeople.php:20 +#: SalesTypes.php:20 SelectAsset.php:48 SelectCompletedOrder.php:11 +#: SelectContract.php:69 SelectCreditItems.php:220 SelectCreditItems.php:291 +#: SelectCustomer.php:265 SelectGLAccount.php:65 SelectOrderItems.php:559 +#: SelectOrderItems.php:1442 SelectOrderItems.php:1542 SelectProduct.php:511 +#: SelectSalesOrder.php:512 SelectSupplier.php:14 SelectSupplier.php:220 +#: SelectWorkOrder.php:9 SelectWorkOrder.php:174 SellThroughSupport.php:229 +#: ShipmentCosting.php:11 Shipments.php:17 Shippers.php:123 Shippers.php:160 +#: Shipt_Select.php:8 StockLocMovements.php:14 StockLocStatus.php:29 #: StockSerialItemResearch.php:30 SupplierPriceList.php:14 #: SupplierPriceList.php:224 SupplierPriceList.php:394 #: SupplierPriceList.php:398 SupplierPriceList.php:449 -#: SupplierPriceList.php:499 Suppliers.php:304 SupplierTenderCreate.php:556 +#: SupplierPriceList.php:499 SupplierTenderCreate.php:556 #: SupplierTenderCreate.php:664 SupplierTenders.php:322 -#: SupplierTenders.php:388 SupplierTransInquiry.php:10 TopItems.php:117 -#: UnitsOfMeasure.php:10 WhereUsedInquiry.php:18 WorkCentres.php:111 -#: WorkCentres.php:163 WorkOrderCosting.php:22 WorkOrderEntry.php:11 -#: WorkOrderIssue.php:22 WorkOrderReceive.php:31 WorkOrderStatus.php:59 -#: WWW_Access.php:11 WWW_Users.php:36 Z_BottomUpCosts.php:57 -#: ../webSHOP/includes/header.php:216 +#: SupplierTenders.php:388 SupplierTransInquiry.php:10 Suppliers.php:304 +#: TopItems.php:118 UnitsOfMeasure.php:10 WWW_Access.php:11 WWW_Users.php:36 +#: WhereUsedInquiry.php:18 WorkCentres.php:111 WorkCentres.php:163 +#: WorkOrderCosting.php:22 WorkOrderEntry.php:11 WorkOrderIssue.php:22 +#: WorkOrderReceive.php:31 WorkOrderStatus.php:58 Z_BottomUpCosts.php:57 +#: ../webSHOP/includes/header.php:251 msgid "Search" msgstr "Buscar" @@ -309,132 +309,136 @@ #: GLProfit_Loss.php:133 GLProfit_Loss.php:134 GLProfit_Loss.php:185 #: SelectGLAccount.php:23 SelectGLAccount.php:37 SelectGLAccount.php:51 msgid "Profit and Loss" -msgstr "Ganancias y Pérdidas" +msgstr "Ganancias y pérdidas" #: AccountGroups.php:310 AccountGroups.php:313 AccountGroups.php:448 -#: AccountGroups.php:450 BOMs.php:126 BOMs.php:800 BOMs.php:802 -#: CompanyPreferences.php:427 CompanyPreferences.php:429 -#: CompanyPreferences.php:442 CompanyPreferences.php:444 -#: CompanyPreferences.php:457 CompanyPreferences.php:459 +#: AccountGroups.php:450 BOMs.php:128 BOMs.php:802 BOMs.php:804 +#: CompanyPreferences.php:425 CompanyPreferences.php:427 +#: CompanyPreferences.php:440 CompanyPreferences.php:442 +#: CompanyPreferences.php:455 CompanyPreferences.php:457 #: ContractCosting.php:202 Currencies.php:330 Currencies.php:508 #: Currencies.php:510 CustomerBranches.php:451 Customers.php:659 #: Customers.php:1049 Customers.php:1055 Customers.php:1058 -#: DailyBankTransactions.php:145 DeliveryDetails.php:1148 -#: DeliveryDetails.php:1191 DeliveryDetails.php:1194 FormDesigner.php:101 -#: GLTransInquiry.php:74 Labels.php:603 Labels.php:605 Labels.php:630 +#: DailyBankTransactions.php:145 DeliveryDetails.php:1155 +#: DeliveryDetails.php:1198 DeliveryDetails.php:1201 FormDesigner.php:101 +#: GLTransInquiry.php:74 Labels.php:601 Labels.php:603 Labels.php:628 #: Locations.php:646 Locations.php:648 Locations.php:661 Locations.php:663 -#: MRPCalendar.php:224 MRP.php:546 MRP.php:550 MRP.php:554 MRP.php:558 -#: MRP.php:562 PaymentMethods.php:206 PaymentMethods.php:207 -#: PaymentMethods.php:208 PaymentMethods.php:209 PaymentMethods.php:275 -#: PaymentMethods.php:282 PaymentMethods.php:289 PaymentMethods.php:296 -#: PcAuthorizeExpenses.php:248 PDFChequeListing.php:65 -#: PDFDeliveryDifferences.php:76 PDFDIFOT.php:80 PDFWOPrint.php:601 -#: PDFWOPrint.php:605 PO_AuthorisationLevels.php:134 -#: PO_AuthorisationLevels.php:139 PO_Header.php:807 PO_PDFPurchOrder.php:413 -#: PO_PDFPurchOrder.php:416 PurchData.php:296 PurchData.php:667 -#: PurchData.php:670 RecurringSalesOrders.php:493 RecurringSalesOrders.php:496 +#: MRP.php:554 MRP.php:558 MRP.php:562 MRP.php:566 MRP.php:570 +#: MRPCalendar.php:224 PDFChequeListing.php:65 PDFDIFOT.php:80 +#: PDFDeliveryDifferences.php:76 PDFWOPrint.php:600 PDFWOPrint.php:604 +#: PO_AuthorisationLevels.php:134 PO_AuthorisationLevels.php:139 +#: PO_Header.php:807 PO_PDFPurchOrder.php:413 PO_PDFPurchOrder.php:416 +#: PaymentMethods.php:206 PaymentMethods.php:207 PaymentMethods.php:208 +#: PaymentMethods.php:209 PaymentMethods.php:275 PaymentMethods.php:282 +#: PaymentMethods.php:289 PaymentMethods.php:296 PcAuthorizeExpenses.php:248 +#: PurchData.php:296 PurchData.php:667 PurchData.php:670 +#: RecurringSalesOrders.php:493 RecurringSalesOrders.php:496 #: SalesAnalReptCols.php:284 SalesAnalReptCols.php:419 #: SalesAnalReptCols.php:422 SalesAnalRepts.php:420 SalesAnalRepts.php:423 #: SalesAnalRepts.php:448 SalesAnalRepts.php:451 SalesAnalRepts.php:476 #: SalesAnalRepts.php:479 SalesCategories.php:264 SalesCategories.php:351 #: SalesCategories.php:355 SalesPeople.php:219 SalesPeople.php:359 -#: SalesPeople.php:361 SelectProduct.php:239 SelectProduct.php:364 +#: SalesPeople.php:361 SelectProduct.php:238 SelectProduct.php:363 #: ShipmentCosting.php:667 ShopParameters.php:289 ShopParameters.php:293 #: ShopParameters.php:337 ShopParameters.php:341 ShopParameters.php:391 #: ShopParameters.php:395 ShopParameters.php:413 ShopParameters.php:417 -#: ShopParameters.php:495 ShopParameters.php:499 StockClone.php:907 -#: StockClone.php:909 StockClone.php:932 StockClone.php:934 Stocks.php:1216 -#: Stocks.php:1218 Stocks.php:1241 Stocks.php:1243 SuppContractChgs.php:90 -#: SystemParameters.php:410 SystemParameters.php:433 SystemParameters.php:468 -#: SystemParameters.php:540 SystemParameters.php:548 SystemParameters.php:588 -#: SystemParameters.php:679 SystemParameters.php:688 SystemParameters.php:696 -#: SystemParameters.php:714 SystemParameters.php:721 SystemParameters.php:765 -#: SystemParameters.php:861 SystemParameters.php:1004 -#: SystemParameters.php:1006 SystemParameters.php:1016 -#: SystemParameters.php:1018 SystemParameters.php:1072 -#: SystemParameters.php:1084 SystemParameters.php:1086 -#: SystemParameters.php:1124 SystemParameters.php:1126 TaxGroups.php:310 -#: TaxGroups.php:313 TaxGroups.php:364 WWW_Users.php:505 WWW_Users.php:507 -#: WWW_Users.php:678 WWW_Users.php:680 +#: ShopParameters.php:495 ShopParameters.php:499 StockClone.php:909 +#: StockClone.php:911 StockClone.php:934 StockClone.php:936 Stocks.php:1212 +#: Stocks.php:1214 Stocks.php:1237 Stocks.php:1239 SuppContractChgs.php:90 +#: SystemParameters.php:413 SystemParameters.php:436 SystemParameters.php:471 +#: SystemParameters.php:552 SystemParameters.php:560 SystemParameters.php:600 +#: SystemParameters.php:691 SystemParameters.php:700 SystemParameters.php:708 +#: SystemParameters.php:726 SystemParameters.php:733 SystemParameters.php:777 +#: SystemParameters.php:873 SystemParameters.php:1016 +#: SystemParameters.php:1018 SystemParameters.php:1028 +#: SystemParameters.php:1030 SystemParameters.php:1084 +#: SystemParameters.php:1096 SystemParameters.php:1098 +#: SystemParameters.php:1136 SystemParameters.php:1138 TaxGroups.php:310 +#: TaxGroups.php:313 TaxGroups.php:364 WWW_Users.php:508 WWW_Users.php:510 +#: WWW_Users.php:681 WWW_Users.php:683 +#: reportwriter/languages/en_US/reports.php:114 msgid "Yes" msgstr "Sí" #: AccountGroups.php:316 AccountGroups.php:453 AccountGroups.php:455 -#: BankAccounts.php:216 BankAccounts.php:410 BankAccounts.php:412 -#: BankAccounts.php:416 BankAccounts.php:424 BOMs.php:128 BOMs.php:799 -#: BOMs.php:803 CompanyPreferences.php:426 CompanyPreferences.php:430 -#: CompanyPreferences.php:441 CompanyPreferences.php:445 -#: CompanyPreferences.php:456 CompanyPreferences.php:460 +#: BOMs.php:130 BOMs.php:801 BOMs.php:805 BankAccounts.php:216 +#: BankAccounts.php:410 BankAccounts.php:412 BankAccounts.php:416 +#: BankAccounts.php:424 CompanyPreferences.php:424 CompanyPreferences.php:428 +#: CompanyPreferences.php:439 CompanyPreferences.php:443 +#: CompanyPreferences.php:454 CompanyPreferences.php:458 #: ContractCosting.php:200 Currencies.php:332 Currencies.php:513 #: Currencies.php:515 CustomerBranches.php:451 Customers.php:658 #: Customers.php:1047 Customers.php:1054 Customers.php:1057 -#: DailyBankTransactions.php:147 DeliveryDetails.php:1149 -#: DeliveryDetails.php:1192 DeliveryDetails.php:1195 FormDesigner.php:99 -#: GLTransInquiry.php:93 Labels.php:602 Labels.php:606 Labels.php:631 +#: DailyBankTransactions.php:147 DeliveryDetails.php:1156 +#: DeliveryDetails.php:1199 DeliveryDetails.php:1202 FormDesigner.php:99 +#: GLTransInquiry.php:93 Labels.php:600 Labels.php:604 Labels.php:629 #: Locations.php:651 Locations.php:653 Locations.php:666 Locations.php:668 -#: MRPCalendar.php:226 MRP.php:544 MRP.php:548 MRP.php:552 MRP.php:556 -#: MRP.php:560 NoSalesItems.php:191 PaymentMethods.php:206 -#: PaymentMethods.php:207 PaymentMethods.php:208 PaymentMethods.php:209 -#: PaymentMethods.php:276 PaymentMethods.php:283 PaymentMethods.php:290 -#: PaymentMethods.php:297 PcAuthorizeExpenses.php:246 PDFChequeListing.php:64 -#: PDFDeliveryDifferences.php:75 PDFDIFOT.php:79 PDFWOPrint.php:602 -#: PDFWOPrint.php:606 PO_AuthorisationLevels.php:136 +#: MRP.php:552 MRP.php:556 MRP.php:560 MRP.php:564 MRP.php:568 +#: MRPCalendar.php:226 NoSalesItems.php:191 PDFChequeListing.php:64 +#: PDFDIFOT.php:79 PDFDeliveryDifferences.php:75 PDFWOPrint.php:601 +#: PDFWOPrint.php:605 PO_AuthorisationLevels.php:136 #: PO_AuthorisationLevels.php:141 PO_Header.php:806 PO_PDFPurchOrder.php:414 -#: PO_PDFPurchOrder.php:417 PurchData.php:299 PurchData.php:668 +#: PO_PDFPurchOrder.php:417 PaymentMethods.php:206 PaymentMethods.php:207 +#: PaymentMethods.php:208 PaymentMethods.php:209 PaymentMethods.php:276 +#: PaymentMethods.php:283 PaymentMethods.php:290 PaymentMethods.php:297 +#: PcAuthorizeExpenses.php:246 PurchData.php:299 PurchData.php:668 #: PurchData.php:671 RecurringSalesOrders.php:492 RecurringSalesOrders.php:495 #: SalesAnalReptCols.php:282 SalesAnalReptCols.php:420 #: SalesAnalReptCols.php:423 SalesAnalRepts.php:419 SalesAnalRepts.php:422 #: SalesAnalRepts.php:447 SalesAnalRepts.php:450 SalesAnalRepts.php:475 #: SalesAnalRepts.php:478 SalesCategories.php:266 SalesCategories.php:352 #: SalesCategories.php:354 SalesPeople.php:221 SalesPeople.php:364 -#: SalesPeople.php:366 SelectProduct.php:241 SelectProduct.php:366 +#: SalesPeople.php:366 SelectProduct.php:240 SelectProduct.php:365 #: ShipmentCosting.php:668 ShopParameters.php:290 ShopParameters.php:292 #: ShopParameters.php:338 ShopParameters.php:340 ShopParameters.php:392 #: ShopParameters.php:394 ShopParameters.php:414 ShopParameters.php:416 -#: ShopParameters.php:496 ShopParameters.php:498 StockClone.php:902 -#: StockClone.php:904 StockClone.php:927 StockClone.php:929 Stocks.php:1211 -#: Stocks.php:1213 Stocks.php:1236 Stocks.php:1238 SuppContractChgs.php:92 -#: SystemParameters.php:411 SystemParameters.php:434 SystemParameters.php:469 -#: SystemParameters.php:541 SystemParameters.php:549 SystemParameters.php:589 -#: SystemParameters.php:680 SystemParameters.php:689 SystemParameters.php:697 -#: SystemParameters.php:715 SystemParameters.php:722 SystemParameters.php:766 -#: SystemParameters.php:862 SystemParameters.php:1003 -#: SystemParameters.php:1007 SystemParameters.php:1015 -#: SystemParameters.php:1019 SystemParameters.php:1073 -#: SystemParameters.php:1083 SystemParameters.php:1087 -#: SystemParameters.php:1123 SystemParameters.php:1127 TaxGroups.php:311 -#: TaxGroups.php:314 TaxGroups.php:366 WWW_Users.php:504 WWW_Users.php:508 -#: WWW_Users.php:677 WWW_Users.php:681 includes/PDFLowGPPageHeader.inc:44 +#: ShopParameters.php:496 ShopParameters.php:498 StockClone.php:904 +#: StockClone.php:906 StockClone.php:929 StockClone.php:931 Stocks.php:1207 +#: Stocks.php:1209 Stocks.php:1232 Stocks.php:1234 SuppContractChgs.php:92 +#: SystemParameters.php:414 SystemParameters.php:437 SystemParameters.php:472 +#: SystemParameters.php:553 SystemParameters.php:561 SystemParameters.php:601 +#: SystemParameters.php:692 SystemParameters.php:701 SystemParameters.php:709 +#: SystemParameters.php:727 SystemParameters.php:734 SystemParameters.php:778 +#: SystemParameters.php:874 SystemParameters.php:1015 +#: SystemParameters.php:1019 SystemParameters.php:1027 +#: SystemParameters.php:1031 SystemParameters.php:1085 +#: SystemParameters.php:1095 SystemParameters.php:1099 +#: SystemParameters.php:1135 SystemParameters.php:1139 TaxGroups.php:311 +#: TaxGroups.php:314 TaxGroups.php:366 WWW_Users.php:507 WWW_Users.php:511 +#: WWW_Users.php:680 WWW_Users.php:684 includes/PDFLowGPPageHeader.inc:44 +#: reportwriter/languages/en_US/reports.php:82 msgid "No" msgstr "No" #: AccountGroups.php:325 AccountSections.php:191 AddCustomerContacts.php:148 #: AddCustomerNotes.php:137 AddCustomerTypeNotes.php:131 Areas.php:164 -#: BankAccounts.php:241 BOMs.php:155 COGSGLPostings.php:112 +#: BOMs.php:157 BankAccounts.php:241 COGSGLPostings.php:112 #: COGSGLPostings.php:216 CreditStatus.php:175 Currencies.php:362 #: Currencies.php:379 CustItem.php:166 CustomerBranches.php:455 -#: Customers.php:1132 Customers.php:1166 CustomerTypes.php:205 +#: CustomerTypes.php:205 Customers.php:1131 Customers.php:1165 #: Departments.php:186 EDIMessageFormat.php:150 Factors.php:334 #: FixedAssetCategories.php:190 FixedAssetLocations.php:111 -#: FreightCosts.php:253 GeocodeSetup.php:173 GLAccounts.php:317 GLTags.php:96 -#: ImportBankTransAnalysis.php:223 InternalStockRequest.php:293 Labels.php:335 -#: Labels.php:360 Locations.php:420 MailingGroupMaintenance.php:178 -#: MaintenanceTasks.php:118 Manufacturers.php:217 MRPDemands.php:309 -#: MRPDemandTypes.php:120 PaymentMethods.php:210 PaymentTerms.php:205 -#: PcAssignCashToTab.php:277 PcClaimExpensesFromTab.php:276 PcExpenses.php:226 -#: PcTabs.php:236 PcTypeTabs.php:180 PO_AuthorisationLevels.php:151 -#: PriceMatrix.php:287 Prices_Customer.php:286 Prices.php:253 -#: PurchData.php:312 SalesCategories.php:272 SalesGLPostings.php:137 -#: SalesGLPostings.php:253 SalesPeople.php:232 SalesTypes.php:206 -#: SecurityTokens.php:130 SelectCustomer.php:614 SelectCustomer.php:633 -#: SelectCustomer.php:663 SelectCustomer.php:681 SelectCustomer.php:705 -#: SelectCustomer.php:722 SelectGLAccount.php:117 SelectGLAccount.php:132 -#: SellThroughSupport.php:298 Shippers.php:144 StockCategories.php:289 +#: FreightCosts.php:253 GLAccounts.php:317 GLTags.php:96 GeocodeSetup.php:173 +#: ImportBankTransAnalysis.php:223 InternalStockRequest.php:293 Labels.php:333 +#: Labels.php:358 Locations.php:420 MRPDemandTypes.php:120 MRPDemands.php:309 +#: MailingGroupMaintenance.php:178 MaintenanceTasks.php:118 +#: Manufacturers.php:217 PO_AuthorisationLevels.php:151 PaymentMethods.php:210 +#: PaymentTerms.php:205 PcAssignCashToTab.php:277 +#: PcClaimExpensesFromTab.php:276 PcExpenses.php:226 PcTabs.php:236 +#: PcTypeTabs.php:180 PriceMatrix.php:287 Prices.php:253 +#: Prices_Customer.php:286 PurchData.php:312 SalesCategories.php:272 +#: SalesGLPostings.php:137 SalesGLPostings.php:253 SalesPeople.php:232 +#: SalesTypes.php:206 SecurityTokens.php:130 SelectCustomer.php:614 +#: SelectCustomer.php:633 SelectCustomer.php:663 SelectCustomer.php:681 +#: SelectCustomer.php:705 SelectCustomer.php:722 SelectGLAccount.php:117 +#: SelectGLAccount.php:132 SellThroughSupport.php:298 Shippers.php:144 +#: StockCategories.php:289 SuppTransGLAnalysis.php:125 #: SupplierContacts.php:165 SupplierTenderCreate.php:157 SupplierTypes.php:170 -#: SuppTransGLAnalysis.php:125 TaxAuthorities.php:172 TaxCategories.php:184 -#: TaxGroups.php:190 TaxProvinces.php:179 UnitsOfMeasure.php:185 -#: WorkCentres.php:142 WWW_Access.php:126 WWW_Users.php:341 -#: includes/InputSerialItems.php:110 includes/OutputSerialItems.php:20 +#: TaxAuthorities.php:172 TaxCategories.php:184 TaxGroups.php:190 +#: TaxProvinces.php:179 UnitsOfMeasure.php:185 WWW_Access.php:126 +#: WWW_Users.php:344 WorkCentres.php:142 includes/InputSerialItems.php:110 +#: includes/OutputSerialItems.php:20 +#: reportwriter/languages/en_US/reports.php:143 #, php-format msgid "Edit" msgstr "Editar" @@ -445,40 +449,41 @@ #: AccountGroups.php:326 AccountSections.php:195 AddCustomerContacts.php:149 #: AddCustomerNotes.php:138 AddCustomerTypeNotes.php:132 Areas.php:165 -#: BankAccounts.php:242 BOMs.php:157 COGSGLPostings.php:113 +#: BOMs.php:159 BankAccounts.php:242 COGSGLPostings.php:113 #: COGSGLPostings.php:217 ContractBOM.php:272 ContractOtherReqts.php:124 -#: CounterReturns.php:740 CounterSales.php:836 Credit_Invoice.php:404 -#: CreditStatus.php:176 Currencies.php:365 CustItem.php:167 -#: CustomerReceipt.php:989 Customers.php:1167 CustomerTypes.php:206 +#: CounterReturns.php:740 CounterSales.php:836 CreditStatus.php:176 +#: Credit_Invoice.php:404 Currencies.php:365 CustItem.php:167 +#: CustomerReceipt.php:989 CustomerTypes.php:206 Customers.php:1166 #: Departments.php:187 DiscountCategories.php:238 DiscountMatrix.php:183 #: EDIMessageFormat.php:151 FixedAssetCategories.php:191 FreightCosts.php:254 -#: GeocodeSetup.php:174 GLAccounts.php:318 GLJournal.php:430 GLTags.php:97 +#: GLAccounts.php:318 GLJournal.php:430 GLTags.php:97 GeocodeSetup.php:174 #: ImportBankTransAnalysis.php:224 InternalStockCategoriesByRole.php:184 -#: InternalStockRequest.php:294 Labels.php:336 Labels.php:361 Labels.php:609 -#: Locations.php:421 MailingGroupMaintenance.php:179 MaintenanceTasks.php:119 -#: Manufacturers.php:218 MRPDemands.php:310 MRPDemandTypes.php:121 -#: PaymentMethods.php:211 Payments.php:1104 PaymentTerms.php:206 +#: InternalStockRequest.php:294 Labels.php:334 Labels.php:359 Labels.php:607 +#: Locations.php:421 MRPDemandTypes.php:121 MRPDemands.php:310 +#: MailingGroupMaintenance.php:179 MaintenanceTasks.php:119 +#: Manufacturers.php:218 PO_AuthorisationLevels.php:153 PO_Items.php:768 +#: PaymentMethods.php:211 PaymentTerms.php:206 Payments.php:1103 #: PcAssignCashToTab.php:281 PcClaimExpensesFromTab.php:277 PcExpenses.php:227 #: PcExpensesTypeTab.php:187 PcTabs.php:237 PcTypeTabs.php:181 -#: PO_AuthorisationLevels.php:153 PO_Items.php:768 PriceMatrix.php:286 -#: Prices_Customer.php:287 Prices.php:254 PurchData.php:314 PurchData.php:721 -#: RelatedItemsUpdate.php:155 RelatedItemsUpdate.php:170 -#: SalesAnalReptCols.php:299 SalesAnalRepts.php:307 SalesCategories.php:273 -#: SalesGLPostings.php:138 SalesGLPostings.php:254 SalesPeople.php:233 -#: SalesTypes.php:207 SecurityTokens.php:131 SelectCreditItems.php:778 -#: SelectCustomer.php:615 SelectCustomer.php:634 SelectCustomer.php:664 -#: SelectCustomer.php:682 SelectCustomer.php:706 SelectCustomer.php:723 -#: SelectOrderItems.php:1359 SellThroughSupport.php:299 Shipments.php:440 -#: Shippers.php:145 SpecialOrder.php:668 StockCategories.php:290 -#: StockCategories.php:619 StockLocTransfer.php:327 SuppContractChgs.php:99 -#: SuppCreditGRNs.php:117 SuppFixedAssetChgs.php:90 SuppInvGRNs.php:147 +#: PriceMatrix.php:286 Prices.php:254 Prices_Customer.php:287 +#: PurchData.php:314 PurchData.php:721 RelatedItemsUpdate.php:155 +#: RelatedItemsUpdate.php:170 SalesAnalReptCols.php:299 SalesAnalRepts.php:307 +#: SalesCategories.php:273 SalesGLPostings.php:138 SalesGLPostings.php:254 +#: SalesPeople.php:233 SalesTypes.php:207 SecurityTokens.php:131 +#: SelectCreditItems.php:778 SelectCustomer.php:615 SelectCustomer.php:634 +#: SelectCustomer.php:664 SelectCustomer.php:682 SelectCustomer.php:706 +#: SelectCustomer.php:723 SelectOrderItems.php:1357 SellThroughSupport.php:299 +#: Shipments.php:440 Shippers.php:145 SpecialOrder.php:668 +#: StockCategories.php:290 StockCategories.php:619 StockLocTransfer.php:325 +#: SuppContractChgs.php:99 SuppCreditGRNs.php:117 SuppFixedAssetChgs.php:90 +#: SuppInvGRNs.php:147 SuppShiptChgs.php:90 SuppTransGLAnalysis.php:126 #: SupplierContacts.php:166 SupplierTenderCreate.php:422 -#: SupplierTenderCreate.php:452 SupplierTypes.php:172 SuppShiptChgs.php:90 -#: SuppTransGLAnalysis.php:126 TaxAuthorities.php:173 TaxCategories.php:186 -#: TaxGroups.php:191 TaxProvinces.php:180 UnitsOfMeasure.php:186 -#: WorkCentres.php:143 WOSerialNos.php:327 WWW_Access.php:127 -#: WWW_Users.php:342 includes/InputSerialItemsKeyed.php:60 +#: SupplierTenderCreate.php:452 SupplierTypes.php:172 TaxAuthorities.php:173 +#: TaxCategories.php:186 TaxGroups.php:191 TaxProvinces.php:180 +#: UnitsOfMeasure.php:186 WOSerialNos.php:335 WWW_Access.php:127 +#: WWW_Users.php:345 WorkCentres.php:143 includes/InputSerialItemsKeyed.php:60 #: includes/OutputSerialItems.php:99 +#: reportwriter/languages/en_US/reports.php:141 #, php-format msgid "Delete" msgstr "Eliminar" @@ -519,10 +524,13 @@ "long and less than 30 characters long. Only alpha numeric characters can be " "used." msgstr "" +"Se debe ingresar un nombre único para el grupo de cuentas -de al menos 3 " +"caracteres y menos de 30 caracteres. Sólo se pueden usar caracteres " +"alfanuméricos." #: AccountGroups.php:413 AccountGroups.php:415 msgid "Top Level Group" -msgstr "Grupo de Nivel Superior" +msgstr "Grupo de nivel superior" #: Accoun... [truncated message content] |
From: <rc...@us...> - 2014-11-24 17:41:03
|
Revision: 7006 http://sourceforge.net/p/web-erp/reponame/7006 Author: rchacon Date: 2014-11-24 17:40:55 +0000 (Mon, 24 Nov 2014) Log Message: ----------- In PrintCustStatements.php, make translatable the currency name and the transaction type. Modified Paths: -------------- trunk/PrintCustStatements.php trunk/doc/Change.log trunk/includes/PDFStatementPageHeader.inc Modified: trunk/PrintCustStatements.php =================================================================== --- trunk/PrintCustStatements.php 2014-11-24 16:25:25 UTC (rev 7005) +++ trunk/PrintCustStatements.php 2014-11-24 17:40:55 UTC (rev 7006) @@ -49,7 +49,7 @@ $FirstStatement = True; - + // check if the user has set a default bank account for invoices, if not leave it blank $sql = "SELECT bankaccounts.invoice, bankaccounts.bankaccountnumber, @@ -124,7 +124,7 @@ ON debtortrans.type=systypes.typeid WHERE debtortrans.debtorno='" . $StmtHeader['debtorno'] . "' AND debtortrans.settled=0"; - + if ($_SESSION['SalesmanLogin'] != '') { $sql .= " AND debtortrans.salesperson='" . $_SESSION['SalesmanLogin'] . "'"; } @@ -198,7 +198,7 @@ $FontSize=9; - $LeftOvers = $pdf->addTextWrap($Left_Margin+1,$YPos,60,$FontSize,$myrow['typename'], 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+1,$YPos,60,$FontSize, _($myrow['typename']), 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+110,$YPos,50,$FontSize,$myrow['transno'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+211,$YPos,50,$FontSize,ConvertSQLDate($myrow['trandate']), 'left'); @@ -248,7 +248,7 @@ $DisplayOutstanding = locale_number_format($myrow['ostdg'],$StmtHeader['currdecimalplaces']); $FontSize=9; - $LeftOvers = $pdf->addTextWrap($Left_Margin+1,$YPos,60,$FontSize,$myrow['typename'], 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+1,$YPos,60,$FontSize, _($myrow['typename']), 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+110,$YPos,50,$FontSize,$myrow['transno'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+211,$YPos,50,$FontSize,ConvertSQLDate($myrow['trandate']), 'left'); @@ -266,7 +266,7 @@ /*Now show also in the remittance advice sectin */ $FontSize=8; - $LeftOvers = $pdf->addTextWrap($Perforation+10,$YPos,30,$FontSize,$myrow['typename'], 'left'); + $LeftOvers = $pdf->addTextWrap($Perforation+10,$YPos,30,$FontSize, _($myrow['typename']), 'left'); $LeftOvers = $pdf->addTextWrap($Perforation+75,$YPos,30,$FontSize,$myrow['transno'], 'left'); $LeftOvers = $pdf->addTextWrap($Perforation+90,$YPos,60,$FontSize,$DisplayOutstanding, 'right'); @@ -420,7 +420,7 @@ /* Show the bank account details */ $pdf->addText($Perforation-250, $Bottom_Margin+32, $FontSize, _('Please make payments to our account:') . ' ' . $DefaultBankAccountNumber); $pdf->addText($Perforation-250, $Bottom_Margin+32-$line_height, $FontSize, _('Quoting your account reference') . ' ' . $StmtHeader['debtorno'] ); - + /*also show the total due in the remittance section */ if ($AgedAnalysis['balance']>0){ /*No point showing a negative balance for payment! */ $FontSize=8; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2014-11-24 16:25:25 UTC (rev 7005) +++ trunk/doc/Change.log 2014-11-24 17:40:55 UTC (rev 7006) @@ -1,5 +1,6 @@ webERP Change Log +24/11/14 RChacon: In PrintCustStatements.php, make translatable the currency name and the transaction type. 24/11/14 RChacon: Spanish translation improvements. Merging "View GL Entries" and "View the GL Entries". 22/11/14 Exson: Fix the qualitytext does not have default value for strict sql mode in Credit_Invoice.php. 22/11/14 Phil: Z_DeleteOldPrices.php now removes all old prices where there is a later start for a price with no end date Modified: trunk/includes/PDFStatementPageHeader.inc =================================================================== --- trunk/includes/PDFStatementPageHeader.inc 2014-11-24 16:25:25 UTC (rev 7005) +++ trunk/includes/PDFStatementPageHeader.inc 2014-11-24 17:40:55 UTC (rev 7006) @@ -113,7 +113,7 @@ $FontSize=8; $XPos = $Page_Width/2 - 60; -$pdf->addText($XPos, $YPos,$FontSize, _('All amounts stated in') . ' - ' . $StmtHeader['currency']); +$pdf->addText($XPos, $YPos,$FontSize, _('All amounts stated in') . ': ' . _($StmtHeader['currency'])); $YPos -= $line_height; $pdf->addText($XPos, $YPos,$FontSize, $StmtHeader['terms']); |
From: <rc...@us...> - 2014-11-29 17:45:55
|
Revision: 7010 http://sourceforge.net/p/web-erp/reponame/7010 Author: rchacon Date: 2014-11-29 17:45:46 +0000 (Sat, 29 Nov 2014) Log Message: ----------- Add label and mouse-over help for Pan size input field. Modified Paths: -------------- trunk/Stocks.php trunk/doc/Manual/ManualInventory.html Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2014-11-29 16:25:11 UTC (rev 7009) +++ trunk/Stocks.php 2014-11-29 17:45:46 UTC (rev 7010) @@ -1287,8 +1287,8 @@ </tr>'; echo '<tr> - <td>' . _('Pan Size') . ':</td> - <td><input type="text" class="number" name="Pansize" size="6" maxlength="6" value="' . locale_number_format($_POST['Pansize'],0) . '" /></td> + <td><label for="Pansize">' . _('Pan Size') . ':</label></td> + <td><input class="number" id="Pansize" maxlength="6" name="Pansize" size="6" title="' . _('Order multiple. It is the minimum packing quantity.') . '" type="text" value="' . locale_number_format($_POST['Pansize'],0) . '" /></td> </tr> <tr> <td>' . _('Shrinkage Factor') . ':</td> Modified: trunk/doc/Manual/ManualInventory.html =================================================================== --- trunk/doc/Manual/ManualInventory.html 2014-11-29 16:25:11 UTC (rev 7009) +++ trunk/doc/Manual/ManualInventory.html 2014-11-29 17:45:46 UTC (rev 7010) @@ -138,12 +138,15 @@ <p>The description translations can be maintained within the same parameters above. The translations that can be maintained are set in the system configuration screen. Any number of translations can be maintained. These translations are used to print on customer invoices if the customer is set up to use one of the languages for which translations are maintained. If not translation is available then the fall back is to the default description.</p> - <!--h3>Image File</h3> + <h3>Image File</h3> - <p>...</p--><!--Restrictions (.jpg)--> + <!--Restrictions (.jpg)--> <!--Suggested content: Where is it used? (e.g. scripts, formulas, etc.)--> + <p>Picture files of items can be uploaded to the server. The system will check that files uploaded are less than defined maxum size (in KB) before they will be allowed to be uploaded. Large pictures will make the system slow and will be difficult to view in the stock maintenance screen.</p> + <p>Maximum Size in KB of uploaded images are defined by system administrators in <i><u>Main Menu</u></i> > <i><u>Setup</u></i> > <i>General Setup Options</i> > <i><u>System Parameters</u></i> > <i>General Settings</i>.</p> + <h3>Category</h3> <p>These categories need to be set up first - from the System Setup tab of the menu. In selecting the stock category, be aware that the system uses the category information for analysis and summary reporting as well as identifying accounts for standard cost general ledger integration, if this option is enabled. There is a link to create new stock categories from the stock item entry page.</p> @@ -280,7 +283,7 @@ <h3>Pan Size</h3> - <p>This modifier is sometimes called the order multiple. It is minimum packing quantity. It allows you to create planned orders in even multiples. This is especially useful if you are required by your suppliers to place orders in specific lot sizes. It is also a useful modifier is you have established your own production run sizes. This modifier causes MRP to inflate the required order quantity to an even increment of the pansize value. As with all modifiers you do need to be careful with this modifier as its use could lead to excess inventories.</p> + <p>This modifier is sometimes called the order multiple. It is the minimum packing quantity. It allows you to create planned orders in even multiples. This is especially useful if you are required by your suppliers to place orders in specific lot sizes. It is also a useful modifier is you have established your own production run sizes. This modifier causes MRP to inflate the required order quantity to an even increment of the pansize value. As with all modifiers you do need to be careful with this modifier as its use could lead to excess inventories.</p> <p>In other words if it is most efficient to manufacture an item in batches of 10 then the pan size would be 10, and MRP would calculate demand in batches of 10, so would inflate a demand of 17 to 20. For instance, we purchase some chemical materials which is 25 kg/pack. The pansize means you have to purchase at least one pack each time.</p> |
From: <dai...@us...> - 2014-12-01 07:08:58
|
Revision: 7011 http://sourceforge.net/p/web-erp/reponame/7011 Author: daintree Date: 2014-12-01 07:08:55 +0000 (Mon, 01 Dec 2014) Log Message: ----------- bug fixes Modified Paths: -------------- trunk/CustomerBalancesMovement.php trunk/config.distrib.php trunk/includes/Login.php Modified: trunk/CustomerBalancesMovement.php =================================================================== --- trunk/CustomerBalancesMovement.php 2014-11-29 17:45:46 UTC (rev 7010) +++ trunk/CustomerBalancesMovement.php 2014-12-01 07:08:55 UTC (rev 7011) @@ -3,11 +3,14 @@ $PageSecurity = 1; include('includes/session.inc'); $Title=_('Customer Balances Movements'); -include('includes/header.inc'); -echo '<p class="page_title_text"> +if (!isset($_POST['CreateCSV'])){ + include('includes/header.inc'); + + echo '<p class="page_title_text"> <img src="'.$RootPath.'/css/'.$Theme.'/images/transactions.png" title="' . _('Customer Balances Movements') . '" alt="" />' . ' ' . _('Customer Balances Movements') . ' </p>'; +} if (!isset($_POST['RunReport'])){ @@ -48,6 +51,10 @@ <td>' . _('Date To') . ':</td> <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" maxlength="10" size="11" value="' . Date($_SESSION['DefaultDateFormat']) . '" /></td> </tr> + <tr> + <td>' . _('Create CSV') . ':</td> + <td><input type="checkbox" name="CreateCSV" value=""></td> + </tr> </table> <br /> @@ -90,15 +97,19 @@ $LocalTotal =0; -echo '<table> - <tr> - <th class="ascending">' . _('Customer') . ' </th> - <th class="ascending">' . _('Opening Balance') . '</th> - <th class="ascending">' . _('Debits') . '</th> - <th class="ascending">' . _('Credits') . '</th> - <th class="ascending">' . _('Balance') . '</th> - </tr>'; +if (!isset($_POST['CreateCSV'])){ + echo '<table> + <tr> + <th class="ascending">' . _('Customer') . ' </th> + <th class="ascending">' . _('Opening Balance') . '</th> + <th class="ascending">' . _('Debits') . '</th> + <th class="ascending">' . _('Credits') . '</th> + <th class="ascending">' . _('Balance') . '</th> + </tr>'; +} else { + $CSVFile = '"' . _('Customer') . '","' . _('Opening Balance') . '","' . _('Debits') . '", "' . _('Credits') . '","' . _('Balance') . '"' . "\n"; +} $OpeningBalances =0; $Debits =0; @@ -127,8 +138,8 @@ $sql = "SELECT SUM(CASE WHEN debtortrans.type=10 THEN ovamount+ovgst+ovdiscount+ovfreight ELSE 0 END) AS currencydebits, SUM(CASE WHEN debtortrans.type<>10 THEN ovamount+ovgst+ovdiscount+ovfreight ELSE 0 END) AS currencycredits, debtorsmaster.debtorno, - SUM(CASE WHEN debtortrans.type=10 THEN (ovamount+ovgst+ovdiscount+ovfreight-alloc)/debtortrans.rate ELSE 0 END) AS localdebits, - SUM(CASE WHEN debtortrans.type<>10 THEN (ovamount+ovgst+ovdiscount+ovfreight-alloc)/debtortrans.rate ELSE 0 END) AS localcredits + SUM(CASE WHEN debtortrans.type=10 THEN (ovamount+ovgst+ovdiscount+ovfreight)/debtortrans.rate ELSE 0 END) AS localdebits, + SUM(CASE WHEN debtortrans.type<>10 THEN (ovamount+ovgst+ovdiscount+ovfreight)/debtortrans.rate ELSE 0 END) AS localcredits FROM debtortrans INNER JOIN debtorsmaster ON debtortrans.debtorno=debtorsmaster.debtorno WHERE trandate>='" . FormatDateForSQL($_POST['FromDate']) . "' AND trandate <= '" . FormatDateForSQL($_POST['ToDate']) . "' @@ -138,42 +149,71 @@ $TransResult = DB_query($sql); $TransRow = DB_fetch_array($TransResult); - $OpeningBal = $myrow['localbalance']-$TransPostRow['localtotalpost']-$TransRow['localdebits']+$TransRow['localcredits']; + $OpeningBal = $myrow['localbalance']-$TransPostRow['localtotalpost']-$TransRow['localdebits']-$TransRow['localcredits']; $ClosingBal = $myrow['localbalance']-$TransPostRow['localtotalpost']; + if($OpeningBal !=0 OR $ClosingBal!=0 OR $TransRow['localdebits']!=0 OR $TransRow['localcredits']!=0) { - echo '<tr> - <td>' . $myrow['name'] . ' </td> - <td class="number">' . locale_number_format($OpeningBal,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . locale_number_format($TransRow['localdebits'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . locale_number_format($TransRow['localcredits'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . locale_number_format($ClosingBal,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - </tr>'; + if (!isset($_POST['CreateCSV'])){ + echo '<tr> + <td>' . $myrow['name'] . ' </td> + <td class="number">' . locale_number_format($OpeningBal,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($TransRow['localdebits'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($TransRow['localcredits'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($ClosingBal,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; + } else { //send the line to CSV file + $CSVFile .= '"' . stripcomma($myrow['name']) . '","' . stripcomma($OpeningBal) . '","' . stripcomma($TransRow['localdebits']) . '","' . stripcomma($TransRow['localcredits']) . '","' . stripcomma($ClosingBal) . '"' . "\n"; + + } + } + $OpeningBalances += $OpeningBal; $Debits += $TransRow['localdebits']; $Credits += $TransRow['localcredits']; $ClosingBalances += $ClosingBal; } -echo '</table>'; - +if (!isset($_POST['CreateCSV'])){ + echo '</table>'; +} if ($_POST['Customer']==''){ //if there could be several customers being reported - echo '<table> - <tr> - <th></th> - <th>' . _('Opening Balance') . '</th> - <th>' . _('Debits') . '</th> - <th>' . _('Credits') . '</th> - <th>' . _('Balance') . '</th> - </tr> - <tr> - <td>' . _('TOTALS') . '</td> - <td class="number">' . locale_number_format($OpeningBalances,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . locale_number_format($Debits,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . locale_number_format($Credits,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . locale_number_format($ClosingBalances,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - </tr> - </table>'; + if (!isset($_POST['CreateCSV'])){ + echo '<table> + <tr> + <th></th> + <th>' . _('Opening Balance') . '</th> + <th>' . _('Debits') . '</th> + <th>' . _('Credits') . '</th> + <th>' . _('Balance') . '</th> + </tr> + <tr> + <td>' . _('TOTALS') . '</td> + <td class="number">' . locale_number_format($OpeningBalances,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($Debits,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($Credits,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($ClosingBalances,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr> + </table>'; + } else { + $CSVFile .= '"' . _('TOTALS') . '","' . stripcomma($OpeningBalances) . '","' . stripcomma($Debits) . '","' . stripcomma($Credits) . '","' . stripcomma($ClosingBalances) . '"' . "\n"; + } } +if (isset($_POST['CreateCSV'])){ + + header('Content-Encoding: UTF-8'); + header('Content-type: text/csv; charset=UTF-8'); + header("Content-disposition: attachment; filename=CustomerBalancesMovement_" . FormatDateForSQL($_POST['FromDate']) . '-' . FormatDateForSQL($_POST['ToDate']) .'.csv'); + header("Pragma: public"); + header("Expires: 0"); + echo "\xEF\xBB\xBF"; // UTF-8 BOM + echo $CSVFile; + exit; +} + include('includes/footer.inc'); + +function stripcomma($str) { //because we're using comma as a delimiter + return str_replace(',', '', $str); +} ?> \ No newline at end of file Modified: trunk/config.distrib.php =================================================================== --- trunk/config.distrib.php 2014-11-29 17:45:46 UTC (rev 7010) +++ trunk/config.distrib.php 2014-12-01 07:08:55 UTC (rev 7011) @@ -51,7 +51,7 @@ // 'ShowInputBox' // 'Hide' - +//$AllowCompanySelectionBox = 'Hide'; //$AllowCompanySelectionBox = 'ShowInputBox'; $AllowCompanySelectionBox = 'ShowSelectionBox'; Modified: trunk/includes/Login.php =================================================================== --- trunk/includes/Login.php 2014-11-29 17:45:46 UTC (rev 7010) +++ trunk/includes/Login.php 2014-12-01 07:08:55 UTC (rev 7011) @@ -37,7 +37,7 @@ <input type="hidden" name="FormID" value="<?php echo $_SESSION['FormID']; ?>" /> <span> <?php - if (isset($CompanyList) && is_array($CompanyList)) { + if (isset($CompanyList) AND is_array($CompanyList)) { foreach ($CompanyList as $key => $CompanyEntry){ if ($DefaultDatabase == $CompanyEntry['database']) { $CompanyNameField = "$key"; |
From: <rc...@us...> - 2014-12-05 14:15:03
|
Revision: 7015 http://sourceforge.net/p/web-erp/reponame/7015 Author: rchacon Date: 2014-12-05 14:14:54 +0000 (Fri, 05 Dec 2014) Log Message: ----------- Update "Pan size" translation (thanks to Klaus for German translation). Modified Paths: -------------- trunk/doc/Manual/ManualInventory.html trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po Modified: trunk/doc/Manual/ManualInventory.html =================================================================== --- trunk/doc/Manual/ManualInventory.html 2014-12-05 04:04:44 UTC (rev 7014) +++ trunk/doc/Manual/ManualInventory.html 2014-12-05 14:14:54 UTC (rev 7015) @@ -159,11 +159,11 @@ <h3>Packaged Volume</h3> - <p>This field is required for freight calculations. It records the volume of the one of the item as packaged for dispatch. The freight calculation takes the higher of the freight costs based on the total weight of the order and the total volume of the order. Most freight companies use a conversion and charge the higher of the two. See the section on freight calculations.</p><!--Suggestion: add a link to the freight calculations section.--> + <p>Also called the gross volume. This field is required for freight calculations. It records the volume of the one of the item as packaged for dispatch. The freight calculation takes the higher of the freight costs based on the total weight of the order and the total volume of the order. Most freight companies use a conversion and charge the higher of the two. See the section on freight calculations.</p><!--Suggestion: add a link to the freight calculations section.--> - <h3>Packaged Gross Weight</h3><!--Suggestion: standardise from "Packaged Gross Weight" to "Packaged Weight"--> + <h3>Packaged Weight</h3><!--Suggestion: standardise from "Packaged Gross Weight" to "Packaged Weight"--> - <p>This field is required for freight calculations. It records the weight of the one of the item as packaged for dispatch. The freight calculation takes the higher of the freight costs based on the total weight of the order and the total volume of the order. Most freight companies use a conversion and charge the higher of the two. See the section on freight calculations.</p><!--Suggestion: add a link to the freight calculations section.--> + <p>Also called the gross weight. This field is required for freight calculations. It records the weight of the one of the item as packaged for dispatch. The freight calculation takes the higher of the freight costs based on the total weight of the order and the total volume of the order. Most freight companies use a conversion and charge the higher of the two. See the section on freight calculations.</p><!--Suggestion: add a link to the freight calculations section.--> <h3>Net Weight</h3><!--Question: Is it "net content"? (e.g. net kilograms, net litres, etc.)--> Modified: trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po 2014-12-05 04:04:44 UTC (rev 7014) +++ trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po 2014-12-05 14:14:54 UTC (rev 7015) @@ -9,7 +9,7 @@ "Project-Id-Version: webERP 4.11.3\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-12-02 13:21-0600\n" -"PO-Revision-Date: 2014-08-14 18:50-0600\n" +"PO-Revision-Date: 2014-12-05 07:08-0600\n" "Last-Translator: Rafael Chacon <raf...@gm...>\n" "Language-Team: Deutsch <web...@li...>\n" "Language: de_DE\n" @@ -16927,7 +16927,7 @@ #: MRP.php:600 msgid "Use Pan Size" -msgstr "Rundungsfaktoren verwenden" +msgstr "Verpackungseinheit verwenden" #: MRP.php:604 msgid "Use Shrinkage" @@ -16951,7 +16951,7 @@ #: MRP.php:650 msgid "Use Pan Size?" -msgstr "Rundungsfaktoren verwenden?" +msgstr "Verpackungseinheit verwenden?" #: MRP.php:654 msgid "Use Shrinkage?" @@ -17479,7 +17479,7 @@ #: MRPReport.php:188 msgid "Pan Size:" -msgstr "Rund.-Fakt.:" +msgstr "Verpackungseinheit:" #: MRPReport.php:190 msgid "On Order:" @@ -30141,7 +30141,7 @@ #: StockClone.php:250 Stocks.php:239 msgid "Pansize quantity must be numeric" -msgstr "Die Rundungsmenge muss numerisch sein" +msgstr "Die Verpackungseinheit muss numerisch sein" #: StockClone.php:256 Stocks.php:245 msgid "Shrinkage factor quantity must be numeric" @@ -30316,7 +30316,7 @@ #: StockClone.php:987 Stocks.php:1290 msgid "Pan Size" -msgstr "Rundungsmenge" +msgstr "Verpackungseinheit" #: StockClone.php:991 Stocks.php:1294 msgid "Shrinkage Factor" Modified: trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po 2014-12-05 04:04:44 UTC (rev 7014) +++ trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po 2014-12-05 14:14:54 UTC (rev 7015) @@ -8,7 +8,7 @@ "Project-Id-Version: webERP 4.11.3\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-12-02 13:21-0600\n" -"PO-Revision-Date: 2014-11-24 10:23-0600\n" +"PO-Revision-Date: 2014-12-05 07:13-0600\n" "Last-Translator: Rafael Chacon <raf...@gm...>\n" "Language-Team: TecnoSoluciones.com <web...@te...>\n" "Language: es_ES\n" @@ -16862,7 +16862,7 @@ #: MRP.php:600 msgid "Use Pan Size" -msgstr "Usar Tamaño Panorámico" +msgstr "Usar tamaño de lote" #: MRP.php:604 msgid "Use Shrinkage" @@ -16886,7 +16886,7 @@ #: MRP.php:650 msgid "Use Pan Size?" -msgstr "Usar Tamaño Pan?" +msgstr "¿Usar tamaño de lote?" #: MRP.php:654 msgid "Use Shrinkage?" @@ -17417,7 +17417,7 @@ #: MRPReport.php:188 msgid "Pan Size:" -msgstr "Tamaño Panorámico:" +msgstr "Tamaño de lote:" #: MRPReport.php:190 msgid "On Order:" @@ -29937,7 +29937,7 @@ #: StockClone.php:185 Stocks.php:174 Z_ImportStocks.php:149 msgid "The weight of the packaged item must be a positive number" -msgstr "El peso del artículo empaquetado debe ser un número positivo" +msgstr "El peso del artículo empacado debe ser un número positivo" #: StockClone.php:191 Stocks.php:180 msgid "The net weight of the item in Net Weight must be numeric" @@ -29945,7 +29945,7 @@ #: StockClone.php:197 Stocks.php:186 msgid "The net weight of the item must be a positive number" -msgstr "" +msgstr "El peso neto del artículo debe ser un número positivo" #: StockClone.php:203 Stocks.php:192 Z_ImportStocks.php:153 msgid "The economic order quantity must be numeric" @@ -30028,7 +30028,7 @@ #: StockClone.php:250 Stocks.php:239 msgid "Pansize quantity must be numeric" -msgstr "Las cantidad Pansize debe ser numérica" +msgstr "El tamaño de lote debe ser numérico" #: StockClone.php:256 Stocks.php:245 msgid "Shrinkage factor quantity must be numeric" @@ -30071,7 +30071,7 @@ #: StockClone.php:502 msgid "New cloned Item" -msgstr "" +msgstr "Nuevo artículo clonado" #: StockClone.php:503 msgid "We also attempted to setup item purchase data and pricing." @@ -30084,7 +30084,7 @@ #: StockClone.php:510 msgid "Review Item Prices" -msgstr "" +msgstr "Revisar precios del artículo" #: StockClone.php:514 msgid "" @@ -30102,7 +30102,7 @@ #: StockClone.php:518 msgid "Review Item Cost" -msgstr "" +msgstr "Revisar costo del artículo" #: StockClone.php:576 msgid "Cloned Item Code" @@ -30201,7 +30201,7 @@ #: StockClone.php:987 Stocks.php:1290 msgid "Pan Size" -msgstr "Tamaño Panorámico" +msgstr "Tamaño de lote" #: StockClone.php:991 Stocks.php:1294 msgid "Shrinkage Factor" @@ -31801,7 +31801,7 @@ #: Stocks.php:1291 msgid "Order multiple. It is the minimum packing quantity." -msgstr "" +msgstr "Múltiplo de pedido. Es la cantidad mínima de embalaje." #: Stocks.php:1401 msgid "" Modified: trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po 2014-12-05 04:04:44 UTC (rev 7014) +++ trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po 2014-12-05 14:14:54 UTC (rev 7015) @@ -9,7 +9,7 @@ "Project-Id-Version: webERP 4.11.3\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-12-02 13:21-0600\n" -"PO-Revision-Date: 2014-08-30 18:36-0600\n" +"PO-Revision-Date: 2014-12-05 08:09-0600\n" "Last-Translator: Rafael Chacon <raf...@gm...>\n" "Language-Team: French <none>\n" "Language: fr_FR\n" @@ -16974,7 +16974,7 @@ #: MRP.php:600 msgid "Use Pan Size" -msgstr "" +msgstr "Taille du lot" #: MRP.php:604 msgid "Use Shrinkage" @@ -16998,7 +16998,7 @@ #: MRP.php:650 msgid "Use Pan Size?" -msgstr "" +msgstr "Utiliser taille du lot?" #: MRP.php:654 msgid "Use Shrinkage?" @@ -17547,7 +17547,7 @@ #: MRPReport.php:188 msgid "Pan Size:" -msgstr "" +msgstr "Taille du lot:" #: MRPReport.php:190 msgid "On Order:" @@ -30383,7 +30383,7 @@ #: StockClone.php:250 Stocks.php:239 msgid "Pansize quantity must be numeric" -msgstr "La quantité pansize doit être numérique" +msgstr "La taille du lot doit être numérique" #: StockClone.php:256 Stocks.php:245 msgid "Shrinkage factor quantity must be numeric" @@ -30553,7 +30553,7 @@ #: StockClone.php:987 Stocks.php:1290 msgid "Pan Size" -msgstr "Taille du plateau" +msgstr "Taille du lot" #: StockClone.php:991 Stocks.php:1294 msgid "Shrinkage Factor" @@ -32152,7 +32152,7 @@ #: Stocks.php:1291 msgid "Order multiple. It is the minimum packing quantity." -msgstr "" +msgstr "Multiple de commande. C'est la quantité minimale d'emballage." #: Stocks.php:1401 msgid "" @@ -51320,65 +51320,3 @@ #~ msgstr "" #~ "Impossible d'afficher la valeur de configuration " #~ "\"NumberOfMonthMustBeShown\"" - -# JDN -#~ msgid "" -#~ "The selected period range is more than 12 months - only graphs for a " -#~ "period less than 12 months can be created" -#~ msgstr "" -#~ "La période choisie est supérieure à 12 mois - Seuls des graphiques de " -#~ "période de moins de 12 mois peuvent être créés" - -#~ msgid "" -#~ "The quantity on work orders for this product cannot be retrieved because" -#~ msgstr "" -#~ "La quantité des commandes de travail pour ce produit ne peut pas être " -#~ "trouvé en raison" - -#~ msgid "The quantity on order for this product to be received into" -#~ msgstr "La quantité à la commande de ce produit pour être reçu dans" - -#~ msgid "The quantity on work orders for this product to be received into" -#~ msgstr "" -#~ "La quantité des commandes de travail pour ce produit d'être reçu dans" - -#~ msgid "HTML" -#~ msgstr "HTML" - -#~ msgid "PDF" -#~ msgstr "PDF" - -#~ msgid "Rates" -#~ msgstr "Taux" - -#~ msgid "Tax Groupings" -#~ msgstr "Groupes de taxes" - -#~ msgid "Tax Provinces" -#~ msgstr "Région(s)" - -#~ msgid "Edit/Review Tax Authorities" -#~ msgstr "Modifier / Afficher les autorités fiscales" - -#~ msgid "Edit/Review Tax Groupings" -#~ msgstr "Modifier / Examiner Groupements d'impôt" - -#~ msgid "Edit/Review Tax Categories" -#~ msgstr "Modifier / Examiner les catégories d'impôt" - -#~ msgid "Tax Authority To Report On:" -#~ msgstr "Administration fiscale à formuler sur:" - -#~ msgid "" -#~ "Adjustments for Tax paid to Customs, FBT, entertainments etc must also be " -#~ "entered" -#~ msgstr "" -#~ "Ajustements de la taxe payée à la douane, FBT, etc divertissements " -#~ "doivent aussi être indiqués" - -#~ msgid "" -#~ "This information excludes Tax on journal entries/payments/receipts all " -#~ "Tax should be entered through AR/AP" -#~ msgstr "" -#~ "Cette information ne comprend pas la taxe sur les entrées du journal / " -#~ "paiements / recettes fiscales devraient tous être entré par AR / AP" |
From: <rc...@us...> - 2014-12-06 02:40:57
|
Revision: 7016 http://sourceforge.net/p/web-erp/reponame/7016 Author: rchacon Date: 2014-12-06 02:40:48 +0000 (Sat, 06 Dec 2014) Log Message: ----------- Minor adjustements (Spanish translation and text fixes). Modified Paths: -------------- trunk/PDFRemittanceAdvice.php trunk/PDFWOPrint.php trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po Modified: trunk/PDFRemittanceAdvice.php =================================================================== --- trunk/PDFRemittanceAdvice.php 2014-12-05 14:14:54 UTC (rev 7015) +++ trunk/PDFRemittanceAdvice.php 2014-12-06 02:40:48 UTC (rev 7016) @@ -44,7 +44,7 @@ /*then print the report */ include('includes/PDFStarter.php'); - $pdf->addInfo('Title',_('Remmitance Advice')); + $pdf->addInfo('Title',_('Remittance Advice')); $pdf->addInfo('Subject',_('Remittance Advice') . ' - ' . _('suppliers from') . ' ' . $_POST['FromCriteria'] . ' ' . _('to') . ' ' . $_POST['ToCriteria'] . ' ' . _('and Paid On') . ' ' . $_POST['PaymentDate']); $line_height=12; Modified: trunk/PDFWOPrint.php =================================================================== --- trunk/PDFWOPrint.php 2014-12-05 14:14:54 UTC (rev 7015) +++ trunk/PDFWOPrint.php 2014-12-06 02:40:48 UTC (rev 7016) @@ -445,8 +445,8 @@ } //end if need a new page headed up } /*end if there are order details to show on the order - or its a preview*/ if($FooterPrintedInPage == 0){ - $LeftOvers = $pdf->addText($FormDesign->SignedDate->x,$Page_Height-$FormDesign->SignedDate->y,$FormDesign->SignedDate->FontSize, _('Date : ') . '______________'); - $LeftOvers = $pdf->addText($FormDesign->SignedBy->x,$Page_Height-$FormDesign->SignedBy->y,$FormDesign->SignedBy->FontSize, _('Signed for: ').'____________________________________'); + $LeftOvers = $pdf->addText($FormDesign->SignedDate->x,$Page_Height-$FormDesign->SignedDate->y,$FormDesign->SignedDate->FontSize, _('Date') . ' : ______________'); + $LeftOvers = $pdf->addText($FormDesign->SignedBy->x,$Page_Height-$FormDesign->SignedBy->y,$FormDesign->SignedBy->FontSize, _('Signed for: ') . '____________________________________'); $FooterPrintedInPage= 1; } Modified: trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po 2014-12-05 14:14:54 UTC (rev 7015) +++ trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po 2014-12-06 02:40:48 UTC (rev 7016) @@ -8,7 +8,7 @@ "Project-Id-Version: webERP 4.11.3\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-12-02 13:21-0600\n" -"PO-Revision-Date: 2014-12-05 07:13-0600\n" +"PO-Revision-Date: 2014-12-05 20:28-0600\n" "Last-Translator: Rafael Chacon <raf...@gm...>\n" "Language-Team: TecnoSoluciones.com <web...@te...>\n" "Language: es_ES\n" @@ -3873,7 +3873,7 @@ #: ConfirmDispatch_Invoice.php:250 msgid "Dispathed Quantity should not be more than order balanced quantity" -msgstr "" +msgstr "Cantidad despachada no debe ser más que el saldo del pedido" #: ConfirmDispatch_Invoice.php:250 msgid "To dispatch quantity is" @@ -18842,7 +18842,7 @@ #: PDFGrn.php:20 msgid "Goods Received Note" -msgstr "Nota de Bienes Recibidos" +msgstr "Nota de bienes recibidos" #: PDFGrn.php:75 PDFQALabel.php:53 msgid "Could not get the supplier of the selected GRN" @@ -19079,7 +19079,7 @@ #: PDFPeriodStockTransListing.php:169 SelectProduct.php:406 msgid "Location Transfers" -msgstr "Transferencias de Localidad" +msgstr "Transferencias de localidad" #: PDFPeriodStockTransListing.php:172 StockAdjustments.php:8 msgid "Stock Adjustments" @@ -19113,7 +19113,7 @@ #: PDFPickingList.php:22 msgid "Select Picking Lists" -msgstr "Seleccionar Listas de Recolección" +msgstr "Seleccionar listas de recolección" #: PDFPickingList.php:35 msgid "Create picking lists for all deliveries to be made on" @@ -19121,11 +19121,11 @@ #: PDFPickingList.php:39 msgid "From Warehouse" -msgstr "Del Almacén" +msgstr "Del almacén" #: PDFPickingList.php:49 includes/MainMenuLinksArray.php:37 msgid "Print Picking Lists" -msgstr "Imprimir Listas de Recolección" +msgstr "Imprimir listas de recolección" #: PDFPickingList.php:58 msgid "" @@ -19240,7 +19240,7 @@ #: PDFPriceList.php:320 PDFPrintLabel.php:328 msgid "For Currency" -msgstr "para la Moneda" +msgstr "para la moneda" #: PDFPriceList.php:331 msgid "Show Gross Profit %" @@ -19327,7 +19327,7 @@ #: PDFPrintLabel.php:350 msgid "Show Labels" -msgstr "Mostrar Etiquetas" +msgstr "Mostrar etiquetas" #: PDFQALabel.php:20 msgid "QA Label" @@ -19451,11 +19451,11 @@ #: PrintCheque.php:92 Suppliers.php:832 Suppliers.php:1078 #: includes/PDFStatementPageHeader.inc:27 msgid "Remittance Advice" -msgstr "Aviso para Envío de Remesa" +msgstr "Aviso de remesa" #: PDFRemittanceAdvice.php:48 SuppPaymentRun.php:31 msgid "suppliers from" -msgstr "Proveedor desde" +msgstr "proveedores desde" #: PDFRemittanceAdvice.php:48 msgid "and Paid On" @@ -19480,7 +19480,7 @@ #: PDFRemittanceAdvice.php:130 includes/MainMenuLinksArray.php:147 msgid "Remittance Advices" -msgstr "Avisos Remesa" +msgstr "Avisos de remesa" #: PDFRemittanceAdvice.php:168 msgid "Date Of Payment" @@ -19492,7 +19492,7 @@ #: PDFRemittanceAdvice.php:269 msgid "Our Code:" -msgstr "Nuestro Código:" +msgstr "Nuestro código:" #: PDFRemittanceAdvice.php:311 msgid "This Payment" @@ -19804,7 +19804,7 @@ #: PDFWOPrint.php:448 msgid "Date : " -msgstr "" +msgstr "Fecha :" #: PDFWOPrint.php:449 msgid "Signed for: " |