From: <dai...@us...> - 2011-09-23 09:13:35
|
Revision: 4703 http://web-erp.svn.sourceforge.net/web-erp/?rev=4703&view=rev Author: daintree Date: 2011-09-23 09:13:29 +0000 (Fri, 23 Sep 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/includes/LanguageSetup.php trunk/includes/LanguagesArray.php Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-09-22 10:09:20 UTC (rev 4702) +++ trunk/includes/LanguageSetup.php 2011-09-23 09:13:29 UTC (rev 4703) @@ -74,15 +74,19 @@ //$LocaleSet = setlocale (LC_NUMERIC, 'fr_FR.utf8','fr_FR'); $LocaleInfo = localeconv(); -//echo '<br/>Thousands separator = ' . strlen($LocaleInfo['thousands_sep']); -//echo '<br/>Mon Thousands separator = ' . strlen($LocaleInfo['mon_thousands_sep']); -if ($LocaleInfo['mon_decimal_point']==''){ - $LocaleInfo['mon_decimal_point']= $LocaleInfo['decimal_point']; +if ($LocaleInfo['decimal_point']==''){ + $LocaleInfo['decimal_point'] = $LanguagesArray[$_SESSION['Language']]['Decimal_Point']; } if ($LocaleInfo['mon_thousands_sep']==''){ - $LocaleInfo['mon_thousands_sep']= $LocaleInfo['thousands_sep']; + $LocaleInfo['mon_thousands_sep'] = $LanguagesArray[$_SESSION['Language']]['Thousands_Separator']; } +if ($LocaleInfo['mon_thousands_sep']==''){ + $LocaleInfo['mon_thousands_sep'] = $LanguagesArray[$_SESSION['Language']]['Thousands_Separator']; +} +if ($LocaleInfo['mon_decimal_point']==''){ + $LocaleInfo['mon_decimal_point'] = $LanguagesArray[$_SESSION['Language']]['Decimal_Point']; +} //Turkish seems to be a special case if ($_SESSION['Language']=='tr_TR.utf8') { Modified: trunk/includes/LanguagesArray.php =================================================================== --- trunk/includes/LanguagesArray.php 2011-09-22 10:09:20 UTC (rev 4702) +++ trunk/includes/LanguagesArray.php 2011-09-23 09:13:29 UTC (rev 4703) @@ -1,60 +1,145 @@ <?php $LanguagesArray = array(); + $LanguagesArray['en_US.utf8']['LanguageName'] = _('English US'); $LanguagesArray['en_US.utf8']['WindowsLocale'] = 'english-us'; +$LanguagesArray['en_US.utf8']['Decimal_Point'] = '.'; +$LanguagesArray['en_US.utf8']['Thousands_Separator'] = ','; + $LanguagesArray['en_GB.utf8']['LanguageName'] = _('English British'); $LanguagesArray['en_GB.utf8']['WindowsLocale'] = 'english-uk'; +$LanguagesArray['en_GB.utf8']['Decimal_Point'] = '.'; +$LanguagesArray['en_GB.utf8']['Thousands_Separator'] = ','; + $LanguagesArray['cz_CZ.utf8']['LanguageName'] = _('Czech'); $LanguagesArray['cz_CZ.utf8']['WindowsLocale'] = 'czech'; +$LanguagesArray['cz_CZ.utf8']['Decimal_Point'] = ','; +$LanguagesArray['cz_CZ.utf8']['Thousands_Separator'] = '.'; + $LanguagesArray['de_DE.utf8']['LanguageName'] = _('German'); $LanguagesArray['de_DE.utf8']['WindowsLocale'] = 'german'; +$LanguagesArray['de_DE.utf8']['Decimal_Point'] = ','; +$LanguagesArray['de_DE.utf8']['Thousands_Separator'] = '.'; + $LanguagesArray['el_GR.utf8']['LanguageName'] = _('Greek'); $LanguagesArray['el_GR.utf8']['WindowsLocale'] = 'greek'; +$LanguagesArray['el_GR.utf8']['Decimal_Point'] = ','; +$LanguagesArray['el_GR.utf8']['Thousands_Separator'] = '.'; + $LanguagesArray['es_ES.utf8']['LanguageName'] = _('Spanish'); $LanguagesArray['es_ES.utf8']['WindowsLocale'] = 'spanish'; +$LanguagesArray['es_ES.utf8']['Decimal_Point'] = ','; +$LanguagesArray['es_ES.utf8']['Thousands_Separator'] = '.'; + $LanguagesArray['et_EE.utf8']['LanguageName'] = _('Estonian'); $LanguagesArray['et_EE.utf8']['WindowsLocale'] = 'estonian'; +$LanguagesArray['et_EE.utf8']['Decimal_Point'] = ','; +$LanguagesArray['et_EE.utf8']['Thousands_Separator'] = '.'; + $LanguagesArray['fa_IR.utf8']['LanguageName'] = _('Arabic'); $LanguagesArray['fa_IR.utf8']['WindowsLocale'] = 'arabic'; +$LanguagesArray['fa_IR.utf8']['Decimal_Point'] = ','; +$LanguagesArray['fa_IR.utf8']['Thousands_Separator'] = '.'; + $LanguagesArray['fr_FR.utf8']['LanguageName'] = _('French'); $LanguagesArray['fr_FR.utf8']['WindowsLocale'] = 'french'; +$LanguagesArray['fr_FR.utf8']['Decimal_Point'] = ','; +$LanguagesArray['fr_FR.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['hi_IN.utf8']['LanguageName'] = _('Hindi'); $LanguagesArray['hi_IN.utf8']['WindowsLocale'] = 'hindi'; +$LanguagesArray['hi_IN.utf8']['Decimal_Point'] = ','; +$LanguagesArray['hi_IN.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['hr_HR.utf8']['LanguageName'] = _('Hungarian'); $LanguagesArray['hr_HR.utf8']['WindowsLocale'] = 'hungarian'; +$LanguagesArray['hr_HR.utf8']['Decimal_Point'] = ','; +$LanguagesArray['hr_HR.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['id_ID.utf8']['LanguageName'] = _('Indonisian'); $LanguagesArray['id_ID.utf8']['WindowsLocale'] = 'indonesian'; +$LanguagesArray['id_ID.utf8']['Decimal_Point'] = ','; +$LanguagesArray['id_ID.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['it_IT.utf8']['LanguageName'] = _('Italian'); $LanguagesArray['it_IT.utf8']['WindowsLocale'] = 'italian'; +$LanguagesArray['it_IT.utf8']['Decimal_Point'] = ','; +$LanguagesArray['it_IT.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['ja_JP.utf8']['LanguageName'] = _('Japanese'); $LanguagesArray['ja_JP.utf8']['WindowsLocale'] = 'japanese'; +$LanguagesArray['ja_JP.utf8']['Decimal_Point'] = ','; +$LanguagesArray['ja_JP.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['lv_LV.utf8']['LanguageName'] = _('Latvian'); $LanguagesArray['lv_LV.utf8']['WindowsLocale'] = 'latvian'; +$LanguagesArray['lv_LV.utf8']['Decimal_Point'] = ','; +$LanguagesArray['lv_LV.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['nl_NL.utf8']['LanguageName'] = _('Dutch'); $LanguagesArray['nl_NL.utf8']['WindowsLocale'] = 'dutch'; +$LanguagesArray['nl_NL.utf8']['Decimal_Point'] = ','; +$LanguagesArray['nl_NL.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['pl_PL.utf8']['LanguageName'] = _('Polish'); $LanguagesArray['pl_PL.utf8']['WindowsLocale'] = 'polish'; +$LanguagesArray['pl_PL.utf8']['Decimal_Point'] = ','; +$LanguagesArray['pl_PL.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['pt_BR.utf8']['LanguageName'] = _('Brazilian Portuguese'); $LanguagesArray['pt_BR.utf8']['WindowsLocale'] = 'portuguese-brazil'; +$LanguagesArray['pt_BR.utf8']['Decimal_Point'] = ','; +$LanguagesArray['pt_BR.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['pt_PT.utf8']['LanguageName'] = _('Portuguese'); $LanguagesArray['pt_PT.utf8']['WindowsLocale'] = 'portuguese'; +$LanguagesArray['pt_PT.utf8']['Decimal_Point'] = ','; +$LanguagesArray['pt_PT.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['ro_RO.utf8']['LanguageName'] = _('Romanian'); $LanguagesArray['ro_RO.utf8']['WindowsLocale'] = 'romanian'; +$LanguagesArray['ro_RO.utf8']['Decimal_Point'] = ','; +$LanguagesArray['ro_RO.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['ru_RU.utf8']['LanguageName'] = _('Russian'); $LanguagesArray['ru_RU.utf8']['WindowsLocale'] = 'russian'; +$LanguagesArray['ru_RU.utf8']['Decimal_Point'] = ','; +$LanguagesArray['ru_RU.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['sq_AL.utf8']['LanguageName'] = _('Albanian'); $LanguagesArray['sq_AL.utf8']['WindowsLocale'] = 'english-us'; +$LanguagesArray['sq_AL.utf8']['Decimal_Point'] = ','; +$LanguagesArray['sq_AL.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['sv_SE.utf8']['LanguageName'] = _('Swedish'); $LanguagesArray['sv_SE.utf8']['WindowsLocale'] = 'swedish'; +$LanguagesArray['sv_SE.utf8']['Decimal_Point'] = ','; +$LanguagesArray['sv_SE.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['sw_KE.utf8']['LanguageName'] = _('Kiswahili'); $LanguagesArray['sw_KE.utf8']['WindowsLocale'] = 'english-us'; +$LanguagesArray['sw_KE.utf8']['Decimal_Point'] = ','; +$LanguagesArray['sw_KE.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['tr_TR.utf8']['LanguageName'] = _('Turkish'); $LanguagesArray['tr_TR.utf8']['WindowsLocale'] = 'turkish'; +$LanguagesArray['tr_TR.utf8']['Decimal_Point'] = ','; +$LanguagesArray['tr_TR.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['vi_VN.utf8']['LanguageName'] = _('Vietnamese'); $LanguagesArray['vi_VN.utf8']['WindowsLocale'] = 'vietnamese'; +$LanguagesArray['vi_VN.utf8']['Decimal_Point'] = ','; +$LanguagesArray['vi_VN.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['zh_CN.utf8']['LanguageName'] = _('Chinese - Simplified'); $LanguagesArray['zh_CN.utf8']['WindowsLocale'] = 'chinese-simplified'; +$LanguagesArray['zh_CN.utf8']['Decimal_Point'] = ','; +$LanguagesArray['zh_CN.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['zh_HK.utf8']['LanguageName'] = _('Chinese - Traditional'); $LanguagesArray['zh_HK.utf8']['WindowsLocale'] = 'chinese-traditional'; +$LanguagesArray['zh_HK.utf8']['Decimal_Point'] = ','; +$LanguagesArray['zh_HK.utf8']['Thousands_Separator'] = ' '; + asort($LanguagesArray); ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-09-23 09:13:35
|
Revision: 4703 http://web-erp.svn.sourceforge.net/web-erp/?rev=4703&view=rev Author: daintree Date: 2011-09-23 09:13:29 +0000 (Fri, 23 Sep 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/includes/LanguageSetup.php trunk/includes/LanguagesArray.php Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-09-22 10:09:20 UTC (rev 4702) +++ trunk/includes/LanguageSetup.php 2011-09-23 09:13:29 UTC (rev 4703) @@ -74,15 +74,19 @@ //$LocaleSet = setlocale (LC_NUMERIC, 'fr_FR.utf8','fr_FR'); $LocaleInfo = localeconv(); -//echo '<br/>Thousands separator = ' . strlen($LocaleInfo['thousands_sep']); -//echo '<br/>Mon Thousands separator = ' . strlen($LocaleInfo['mon_thousands_sep']); -if ($LocaleInfo['mon_decimal_point']==''){ - $LocaleInfo['mon_decimal_point']= $LocaleInfo['decimal_point']; +if ($LocaleInfo['decimal_point']==''){ + $LocaleInfo['decimal_point'] = $LanguagesArray[$_SESSION['Language']]['Decimal_Point']; } if ($LocaleInfo['mon_thousands_sep']==''){ - $LocaleInfo['mon_thousands_sep']= $LocaleInfo['thousands_sep']; + $LocaleInfo['mon_thousands_sep'] = $LanguagesArray[$_SESSION['Language']]['Thousands_Separator']; } +if ($LocaleInfo['mon_thousands_sep']==''){ + $LocaleInfo['mon_thousands_sep'] = $LanguagesArray[$_SESSION['Language']]['Thousands_Separator']; +} +if ($LocaleInfo['mon_decimal_point']==''){ + $LocaleInfo['mon_decimal_point'] = $LanguagesArray[$_SESSION['Language']]['Decimal_Point']; +} //Turkish seems to be a special case if ($_SESSION['Language']=='tr_TR.utf8') { Modified: trunk/includes/LanguagesArray.php =================================================================== --- trunk/includes/LanguagesArray.php 2011-09-22 10:09:20 UTC (rev 4702) +++ trunk/includes/LanguagesArray.php 2011-09-23 09:13:29 UTC (rev 4703) @@ -1,60 +1,145 @@ <?php $LanguagesArray = array(); + $LanguagesArray['en_US.utf8']['LanguageName'] = _('English US'); $LanguagesArray['en_US.utf8']['WindowsLocale'] = 'english-us'; +$LanguagesArray['en_US.utf8']['Decimal_Point'] = '.'; +$LanguagesArray['en_US.utf8']['Thousands_Separator'] = ','; + $LanguagesArray['en_GB.utf8']['LanguageName'] = _('English British'); $LanguagesArray['en_GB.utf8']['WindowsLocale'] = 'english-uk'; +$LanguagesArray['en_GB.utf8']['Decimal_Point'] = '.'; +$LanguagesArray['en_GB.utf8']['Thousands_Separator'] = ','; + $LanguagesArray['cz_CZ.utf8']['LanguageName'] = _('Czech'); $LanguagesArray['cz_CZ.utf8']['WindowsLocale'] = 'czech'; +$LanguagesArray['cz_CZ.utf8']['Decimal_Point'] = ','; +$LanguagesArray['cz_CZ.utf8']['Thousands_Separator'] = '.'; + $LanguagesArray['de_DE.utf8']['LanguageName'] = _('German'); $LanguagesArray['de_DE.utf8']['WindowsLocale'] = 'german'; +$LanguagesArray['de_DE.utf8']['Decimal_Point'] = ','; +$LanguagesArray['de_DE.utf8']['Thousands_Separator'] = '.'; + $LanguagesArray['el_GR.utf8']['LanguageName'] = _('Greek'); $LanguagesArray['el_GR.utf8']['WindowsLocale'] = 'greek'; +$LanguagesArray['el_GR.utf8']['Decimal_Point'] = ','; +$LanguagesArray['el_GR.utf8']['Thousands_Separator'] = '.'; + $LanguagesArray['es_ES.utf8']['LanguageName'] = _('Spanish'); $LanguagesArray['es_ES.utf8']['WindowsLocale'] = 'spanish'; +$LanguagesArray['es_ES.utf8']['Decimal_Point'] = ','; +$LanguagesArray['es_ES.utf8']['Thousands_Separator'] = '.'; + $LanguagesArray['et_EE.utf8']['LanguageName'] = _('Estonian'); $LanguagesArray['et_EE.utf8']['WindowsLocale'] = 'estonian'; +$LanguagesArray['et_EE.utf8']['Decimal_Point'] = ','; +$LanguagesArray['et_EE.utf8']['Thousands_Separator'] = '.'; + $LanguagesArray['fa_IR.utf8']['LanguageName'] = _('Arabic'); $LanguagesArray['fa_IR.utf8']['WindowsLocale'] = 'arabic'; +$LanguagesArray['fa_IR.utf8']['Decimal_Point'] = ','; +$LanguagesArray['fa_IR.utf8']['Thousands_Separator'] = '.'; + $LanguagesArray['fr_FR.utf8']['LanguageName'] = _('French'); $LanguagesArray['fr_FR.utf8']['WindowsLocale'] = 'french'; +$LanguagesArray['fr_FR.utf8']['Decimal_Point'] = ','; +$LanguagesArray['fr_FR.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['hi_IN.utf8']['LanguageName'] = _('Hindi'); $LanguagesArray['hi_IN.utf8']['WindowsLocale'] = 'hindi'; +$LanguagesArray['hi_IN.utf8']['Decimal_Point'] = ','; +$LanguagesArray['hi_IN.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['hr_HR.utf8']['LanguageName'] = _('Hungarian'); $LanguagesArray['hr_HR.utf8']['WindowsLocale'] = 'hungarian'; +$LanguagesArray['hr_HR.utf8']['Decimal_Point'] = ','; +$LanguagesArray['hr_HR.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['id_ID.utf8']['LanguageName'] = _('Indonisian'); $LanguagesArray['id_ID.utf8']['WindowsLocale'] = 'indonesian'; +$LanguagesArray['id_ID.utf8']['Decimal_Point'] = ','; +$LanguagesArray['id_ID.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['it_IT.utf8']['LanguageName'] = _('Italian'); $LanguagesArray['it_IT.utf8']['WindowsLocale'] = 'italian'; +$LanguagesArray['it_IT.utf8']['Decimal_Point'] = ','; +$LanguagesArray['it_IT.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['ja_JP.utf8']['LanguageName'] = _('Japanese'); $LanguagesArray['ja_JP.utf8']['WindowsLocale'] = 'japanese'; +$LanguagesArray['ja_JP.utf8']['Decimal_Point'] = ','; +$LanguagesArray['ja_JP.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['lv_LV.utf8']['LanguageName'] = _('Latvian'); $LanguagesArray['lv_LV.utf8']['WindowsLocale'] = 'latvian'; +$LanguagesArray['lv_LV.utf8']['Decimal_Point'] = ','; +$LanguagesArray['lv_LV.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['nl_NL.utf8']['LanguageName'] = _('Dutch'); $LanguagesArray['nl_NL.utf8']['WindowsLocale'] = 'dutch'; +$LanguagesArray['nl_NL.utf8']['Decimal_Point'] = ','; +$LanguagesArray['nl_NL.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['pl_PL.utf8']['LanguageName'] = _('Polish'); $LanguagesArray['pl_PL.utf8']['WindowsLocale'] = 'polish'; +$LanguagesArray['pl_PL.utf8']['Decimal_Point'] = ','; +$LanguagesArray['pl_PL.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['pt_BR.utf8']['LanguageName'] = _('Brazilian Portuguese'); $LanguagesArray['pt_BR.utf8']['WindowsLocale'] = 'portuguese-brazil'; +$LanguagesArray['pt_BR.utf8']['Decimal_Point'] = ','; +$LanguagesArray['pt_BR.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['pt_PT.utf8']['LanguageName'] = _('Portuguese'); $LanguagesArray['pt_PT.utf8']['WindowsLocale'] = 'portuguese'; +$LanguagesArray['pt_PT.utf8']['Decimal_Point'] = ','; +$LanguagesArray['pt_PT.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['ro_RO.utf8']['LanguageName'] = _('Romanian'); $LanguagesArray['ro_RO.utf8']['WindowsLocale'] = 'romanian'; +$LanguagesArray['ro_RO.utf8']['Decimal_Point'] = ','; +$LanguagesArray['ro_RO.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['ru_RU.utf8']['LanguageName'] = _('Russian'); $LanguagesArray['ru_RU.utf8']['WindowsLocale'] = 'russian'; +$LanguagesArray['ru_RU.utf8']['Decimal_Point'] = ','; +$LanguagesArray['ru_RU.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['sq_AL.utf8']['LanguageName'] = _('Albanian'); $LanguagesArray['sq_AL.utf8']['WindowsLocale'] = 'english-us'; +$LanguagesArray['sq_AL.utf8']['Decimal_Point'] = ','; +$LanguagesArray['sq_AL.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['sv_SE.utf8']['LanguageName'] = _('Swedish'); $LanguagesArray['sv_SE.utf8']['WindowsLocale'] = 'swedish'; +$LanguagesArray['sv_SE.utf8']['Decimal_Point'] = ','; +$LanguagesArray['sv_SE.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['sw_KE.utf8']['LanguageName'] = _('Kiswahili'); $LanguagesArray['sw_KE.utf8']['WindowsLocale'] = 'english-us'; +$LanguagesArray['sw_KE.utf8']['Decimal_Point'] = ','; +$LanguagesArray['sw_KE.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['tr_TR.utf8']['LanguageName'] = _('Turkish'); $LanguagesArray['tr_TR.utf8']['WindowsLocale'] = 'turkish'; +$LanguagesArray['tr_TR.utf8']['Decimal_Point'] = ','; +$LanguagesArray['tr_TR.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['vi_VN.utf8']['LanguageName'] = _('Vietnamese'); $LanguagesArray['vi_VN.utf8']['WindowsLocale'] = 'vietnamese'; +$LanguagesArray['vi_VN.utf8']['Decimal_Point'] = ','; +$LanguagesArray['vi_VN.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['zh_CN.utf8']['LanguageName'] = _('Chinese - Simplified'); $LanguagesArray['zh_CN.utf8']['WindowsLocale'] = 'chinese-simplified'; +$LanguagesArray['zh_CN.utf8']['Decimal_Point'] = ','; +$LanguagesArray['zh_CN.utf8']['Thousands_Separator'] = ' '; + $LanguagesArray['zh_HK.utf8']['LanguageName'] = _('Chinese - Traditional'); $LanguagesArray['zh_HK.utf8']['WindowsLocale'] = 'chinese-traditional'; +$LanguagesArray['zh_HK.utf8']['Decimal_Point'] = ','; +$LanguagesArray['zh_HK.utf8']['Thousands_Separator'] = ' '; + asort($LanguagesArray); ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-10-02 09:46:02
|
Revision: 4709 http://web-erp.svn.sourceforge.net/web-erp/?rev=4709&view=rev Author: daintree Date: 2011-10-02 09:45:55 +0000 (Sun, 02 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/includes/Add_SerialItems.php trunk/includes/Add_SerialItemsOut.php trunk/includes/InputSerialItemsFile.php trunk/includes/InputSerialItemsKeyed.php trunk/includes/InputSerialItemsSequential.php trunk/includes/OutputSerialItems.php Modified: trunk/includes/Add_SerialItems.php =================================================================== --- trunk/includes/Add_SerialItems.php 2011-10-02 09:16:51 UTC (rev 4708) +++ trunk/includes/Add_SerialItems.php 2011-10-02 09:45:55 UTC (rev 4709) @@ -16,7 +16,7 @@ $AddThisBundle = true; /*If the user enters a duplicate serial number the later one over-writes the first entered one - no warning given though ? */ - if ($_POST['Qty' . $i] > $ExistingBundleQty){ + if (filter_number_format($_POST['Qty' . $i]) > $ExistingBundleQty){ if ($LineItem->Serialised ==1){ echo '<br />'; prnMsg ( $_POST['SerialNo' . $i] . ' ' . @@ -38,7 +38,7 @@ } } if ($AddThisBundle==true){ - $LineItem->SerialItems[$_POST['SerialNo' . $i]] = new SerialItem ($_POST['SerialNo' . $i], ($InOutModifier>0?1:-1) * $_POST['Qty' . $i]); + $LineItem->SerialItems[$_POST['SerialNo' . $i]] = new SerialItem ($_POST['SerialNo' . $i], ($InOutModifier>0?1:-1) * filter_number_format($_POST['Qty' . $i])); } } /*end if ExistingBundleQty >0 */ else { @@ -51,7 +51,7 @@ //Serialised items can not exist w/ Qty > 0 if we have an $NewQty of 1 //Serialised items must exist w/ Qty = 1 if we have $NewQty of -1 $SerialError = false; - $NewQty = ($InOutModifier>0?1:-1) * $_POST['Qty' . $i]; + $NewQty = ($InOutModifier>0?1:-1) * filter_number_format($_POST['Qty' . $i]); $NewSerialNo = $_POST['SerialNo' . $i]; if ($LineItem->Serialised){ @@ -124,7 +124,9 @@ Validate an uploaded FILE and save entries ********************************************/ $valid = true; -if (isset($_POST['EntryType']) and $_POST['EntryType']=='FILE' and isset($_POST['ValidateFile'])){ +if (isset($_POST['EntryType']) + AND $_POST['EntryType']=='FILE' + AND isset($_POST['ValidateFile'])){ $filename = $_SESSION['CurImportFile']['tmp_name']; @@ -134,7 +136,7 @@ while (!feof($handle)) { $contents = trim(fgets($handle, 4096)); //$valid = $LineItem->SerialItems[$i]->importFileLineItem($contents); - $pieces = explode(",",$contents); + $pieces = explode(',',$contents); if ($LineItem->Serialised == 1){ //for Serialised items, we are expecting the line to contain either just the serial no //OR a comma delimited file w/ the serial no FIRST @@ -155,12 +157,12 @@ } } else { //for controlled only items, we must receive: BatchID, Qty in a comma delimited file - if($pieces[0] != "" AND $pieces[1] != "" AND is_numeric($pieces[1]) AND $pieces[1] > 0 ){ + if($pieces[0] != '' AND $pieces[1] != '' AND is_numeric(filter_number_format($pieces[1])) AND filter_number_format($pieces[1]) > 0 ){ /*If the user enters a duplicate batch number the later one over-writes the first entered one - no warning given though ? */ //$LineItem->SerialItems[$pieces[0]] = new SerialItem ($pieces[0], $pieces[1] ); $NewSerialNo = $pieces[0]; - $NewQty = ($InOutModifier>0?1:-1) * $pieces[1]; + $NewQty = ($InOutModifier>0?1:-1) * filter_number_format($pieces[1]); } else { $valid = false; } @@ -203,10 +205,10 @@ if ($LineItem->Serialised){ $ExistingQty = ValidBundleRef($StockID, $LocationOut, $NewSerialNo); if ($NewQty == 1 AND $ExistingQty != 0){ - prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a>: '. _("The Serial Number being added exists with a Quantity that is not Zero (0)!"), 'error' ); + prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a>: '. _('The Serial Number being added exists with a Quantity that is not Zero (0)!'), 'error' ); $SerialError = true; } elseif ($NewQty == -1 AND $ExistingQty != 1){ - prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> : '. _("The Serial Number being removed exists with a Quantity that is not One (1)!"), 'error'); + prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> : '. _('The Serial Number being removed exists with a Quantity that is not One (1)!'), 'error'); $SerialError = true; } } @@ -269,19 +271,19 @@ $AddThisBundle = true; /*If the user enters a duplicate serial number the later one over-writes the first entered one - no warning given though ? */ if ($NewQty > $ExistingBundleQty){ - if ($LineItem->Serialised ==1){ - echo '<br />' . '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> '. _('has already been sold'). '.'; - $AddThisBundle = false; - } elseif ($ExistingBundleQty==0) { /* and its a batch */ - echo '<br />' . _('There is none of'). ' <a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> '. _('remaining') .'.'; - $AddThisBundle = false; - } else { - echo '<br />'. _('There is only') . ' ' . $ExistingBundleQty . ' '. _('of') . ' ' . - '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> ' . _('remaining') . '. '. - _('The entered quantity will be reduced to the remaining amount left of this batch/bundle/roll'); - $NewQty = $ExistingBundleQty; - $AddThisBundle = true; - } + if ($LineItem->Serialised ==1){ + echo '<br />' . '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> '. _('has already been sold'). '.'; + $AddThisBundle = false; + } elseif ($ExistingBundleQty==0) { /* and its a batch */ + echo '<br />' . _('There is none of'). ' <a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> '. _('remaining') .'.'; + $AddThisBundle = false; + } else { + echo '<br />'. _('There is only') . ' ' . $ExistingBundleQty . ' '. _('of') . ' ' . + '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> ' . _('remaining') . '. '. + _('The entered quantity will be reduced to the remaining amount left of this batch/bundle/roll'); + $NewQty = $ExistingBundleQty; + $AddThisBundle = true; + } } if ($AddThisBundle==true){ $LineItem->SerialItems[$NewSerialNo] = new SerialItem ($NewSerialNo, $NewQty); @@ -343,4 +345,4 @@ if (isset($_GET['Delete'])){ unset($LineItem->SerialItems[$_GET['Delete']]); } -?> +?> \ No newline at end of file Modified: trunk/includes/Add_SerialItemsOut.php =================================================================== --- trunk/includes/Add_SerialItemsOut.php 2011-10-02 09:16:51 UTC (rev 4708) +++ trunk/includes/Add_SerialItemsOut.php 2011-10-02 09:45:55 UTC (rev 4709) @@ -12,22 +12,25 @@ $AddThisBundle = true; /*If the user enters a duplicate serial number the later one over-writes the first entered one - no warning given though ? */ - if ($_POST['Qty' . $i] > $ExistingBundleQty){ + if (filter_number_format($_POST['Qty' . $i]) > $ExistingBundleQty){ if ($LineItem->Serialised ==1){ - echo "<br />" . $_POST['SerialNo' . $i] . " " . _('has already been sold'); + echo '<br />' . $_POST['SerialNo' . $i] . " " . _('has already been sold'); $AddThisBundle = false; } elseif ($ExistingBundleQty==0) { /* and its a batch */ - echo "<br />There is none of " . $_POST['SerialNo' . $i] . " left."; + echo '<br />' . _('There is none of') . ' ' . $_POST['SerialNo' . $i] . ' ' . _('left'); $AddThisBundle = false; } else { - echo '<br />' . _('There is only') . ' ' . $ExistingBundleQty . ' ' . _('of') . ' ' . $_POST['SerialNo' . $i] . - ' ' . _('remaining') . '. ' . _('The entered quantity will be reduced to the remaining amount left of this batch/bundle/roll'); + echo '<br />' . _('There is only') . ' ' . $ExistingBundleQty . ' ' . _('of') . ' ' . $_POST['SerialNo' . $i] . ' ' . _('remaining') . '. ' . _('The entered quantity will be reduced to the remaining amount left of this batch/bundle/roll'); $_POST['Qty' . $i] = $ExistingBundleQty; $AddThisBundle = true; } } - if ($AddThisBundle==true and $_POST['Qty' . $i]>0){ - $LineItem->SerialItems[$_POST['SerialNo' . $i]] = new SerialItem ($_POST['SerialNo' . $i], $_POST['Qty' . $i], $_POST['ExpiryDate' . $i]); + if ($AddThisBundle==true + AND filter_number_format($_POST['Qty' . $i])>0){ + + $LineItem->SerialItems[$_POST['SerialNo' . $i]] = new SerialItem ($_POST['SerialNo' . $i], + filter_number_format($_POST['Qty' . $i]), + $_POST['ExpiryDate' . $i]); } } /*end if ExistingBundleQty >0 */ } /* end if posted Serialno . i is not blank */ @@ -51,4 +54,4 @@ $LineItem->SerialItems=array(); } -?> +?> \ No newline at end of file Modified: trunk/includes/InputSerialItemsFile.php =================================================================== --- trunk/includes/InputSerialItemsFile.php 2011-10-02 09:16:51 UTC (rev 4708) +++ trunk/includes/InputSerialItemsFile.php 2011-10-02 09:45:55 UTC (rev 4709) @@ -71,7 +71,7 @@ $_SESSION['CurImportFile'] = ''; $LineItem->SerialItemsValid=false; } -if ($_FILES['ImportFile']['name'] == '' && $_SESSION['CurImportFile'] == ''){ +if ($_FILES['ImportFile']['name'] == '' AND $_SESSION['CurImportFile'] == ''){ $msg = _('Please Choose a file and then click Set Entry Type to upload a file for import'); prnMsg($msg); $LineItem->SerialItemsValid=false; @@ -125,14 +125,12 @@ <tr><td>'. _('Size') .':</td><td>' . locale_number_format($_SESSION['CurImportFile']['size']/1024,4) . 'kb</td></tr> <tr><td>'. _('Type') .':</td><td>' . $_SESSION['CurImportFile']['type'] . '</td></tr> <tr><td>'. _('TempName') .':</td><td>' . $_SESSION['CurImportFile']['tmp_name'] . '</td></tr> - <tr><td>'. _('Status') .':</td><td>' . - ($LineItem->SerialItemsValid?getMsg(_('Valid'),'success'):getMsg(_('Invalid'),'error')) . '</td></tr> - </table>'. - $invalid_imports.' '. _('out of') .' '.$TotalLines.' '. _('records are invalid').'<br />'; + <tr><td>'. _('Status') .':</td><td>' . ($LineItem->SerialItemsValid?getMsg(_('Valid'),'success'):getMsg(_('Invalid'),'error')) . '</td></tr> + </table>'. $invalid_imports.' '. _('out of') .' '.$TotalLines.' '. _('records are invalid').'<br />'; $filename = $_SESSION['CurImportFile']['tmp_name']; } -if (!$LineItem->SerialItemsValid && !$_SESSION['CurImportFile']['Processed']){ +if (!$LineItem->SerialItemsValid AND !$_SESSION['CurImportFile']['Processed']){ // If all items are not valid, show the raw first 10 lines of the file. maybe it will help. $filename = $_SESSION['CurImportFile']['tmp_name']; $handle = fopen($filename, 'r'); @@ -168,7 +166,7 @@ $i++; if ($i == 100) { break; - } + } } } Modified: trunk/includes/InputSerialItemsKeyed.php =================================================================== --- trunk/includes/InputSerialItemsKeyed.php 2011-10-02 09:16:51 UTC (rev 4708) +++ trunk/includes/InputSerialItemsKeyed.php 2011-10-02 09:45:55 UTC (rev 4709) @@ -22,7 +22,7 @@ /*Display the batches already entered with quantities if not serialised */ echo '<table class="selection"> - <tr><td valign=top> + <tr><td valign="top"> <table class="selection">'; echo $tableheader; @@ -64,9 +64,12 @@ /*Display the totals and rule off before allowing new entries */ if ($LineItem->Serialised==1){ - echo '<tr><td class="number"><B>'. _('Total Quantity'). ': ' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; + echo '<tr><td class="number"><b>'. _('Total Quantity'). ': ' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; } else { - echo '<tr><td class="number"><B>'. _('Total Quantity'). ':</b></td><td class="number"><b>' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; + echo '<tr> + <td class="number"><b>'. _('Total Quantity'). ':</b></td> + <td class="number"><b>' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td> + </tr>'; } /*Close off old table */ @@ -98,8 +101,7 @@ if ($EditControlled){ foreach ($LineItem->SerialItems as $Bundle){ - echo '<tr><td valign=top><input type="text" name="SerialNo'. $StartAddingAt .'" - value="'.$Bundle->BundleRef.'" size=21 maxlength=20></td>'; + echo '<tr><td valign=top><input type="text" name="SerialNo'. $StartAddingAt .'" value="' .$Bundle->BundleRef.'" size="21" maxlength="20" /></td>'; /*if the item is controlled not serialised - batch quantity required so just enter bundle refs into the form for entry of quantities manually */ @@ -120,25 +122,25 @@ for ($i=0;$i < 10;$i++){ - echo '<tr><td valign=top><input type="text" name="SerialNo'. ($StartAddingAt+$i) .'" size=21 maxlength=20></td>'; + echo '<tr><td valign=top><input type="text" name="SerialNo'. ($StartAddingAt+$i) .'" size="21" maxlength="20" /></td>'; /*if the item is controlled not serialised - batch quantity required so just enter bundle refs into the form for entry of quantities manually */ if ($LineItem->Serialised==1){ - echo '<input type=hidden name="Qty' . ($StartAddingAt+$i) .'" Value=1></tr>'; + echo '<input type=hidden name="Qty' . ($StartAddingAt+$i) .'" value=1></td></tr>'; } else if ($LineItem->Serialised==0 and $Perishable==1) { - echo '<td><input type="text" class="number" name="Qty' . ($StartAddingAt+$i) .'" size=11 maxlength=10></td>'; + echo '<td><input type="text" class="number" name="Qty' . ($StartAddingAt+$i) .'" size=11 maxlength="10" /></td>'; echo '<td><input type="text" class="date" name="ExpiryDate' . ($StartAddingAt+$i) .'" size=11 - value="" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength=10></td></tr>'; + value="" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength="10" /></td></tr>'; } else { - echo '<td><input type="text" class="number" name="Qty' . ($StartAddingAt+$i) .'" size=11 maxlength=10></tr>'; + echo '<td><input type="text" class="number" name="Qty' . ($StartAddingAt+$i) .'" size=11 maxlength="10"></td></tr>'; } } echo '</table>'; -echo '<br /><div class=centre><input type=submit name="AddBatches" value="'. _('Enter'). '"></div>'; -echo '</form></td><td valign=top>'; +echo '<br /><div class=centre><input type="submit" name="AddBatches" value="'. _('Enter'). '"></div>'; +echo '</form></td><td valign="top">'; if ($ShowExisting){ include('includes/InputSerialItemsExisting.php'); } Modified: trunk/includes/InputSerialItemsSequential.php =================================================================== --- trunk/includes/InputSerialItemsSequential.php 2011-10-02 09:16:51 UTC (rev 4708) +++ trunk/includes/InputSerialItemsSequential.php 2011-10-02 09:45:55 UTC (rev 4709) @@ -30,7 +30,7 @@ echo $tableheader; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?=' . $SID . '" method="post"> +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"> <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> <input type="hidden" name="LineNo" value="' . $LineNo . '"> <input type="hidden" name="StockID" value="' . $StockID . '"> @@ -40,12 +40,17 @@ } elseif ( isset($_POST['EditControlled']) ){ $EditControlled = isset($_POST['EditControlled'])?$_POST['EditControlled']:false; } -echo '<tr><td valign="top">'. _('Begin:') . '</td><td> <input type="text" name="BeginNo" size="21" maxlength="20" value="'. $_POST['BeginNo']. '"></td></tr>'; -echo '<tr><td valign="top">'. _('End:') . '</td><td> <input type="text" name="EndNo" size="21" maxlength="20" value="'. $_POST['EndNo']. '"></td></tr>'; +echo '<tr> + <td valign="top">'. _('Begin:') . '</td> + <td> <input type="text" name="BeginNo" size="21" maxlength="20" value="'. $_POST['BeginNo']. '" /></td> + </tr>'; +echo '<tr> + <td valign="top">'. _('End:') . '</td> + <td> <input type="text" name="EndNo" size="21" maxlength="20" value="'. $_POST['EndNo']. '" /></td> + </tr>'; - echo '</table>'; echo '<br /><center><input type="submit" name="AddSequence" value="'. _('Enter'). '"></center><br />'; echo '</form></td><td valign="top">'; //echo '</td></tr></table>'; /*end of nested table */ -?> +?> \ No newline at end of file Modified: trunk/includes/OutputSerialItems.php =================================================================== --- trunk/includes/OutputSerialItems.php 2011-10-02 09:16:51 UTC (rev 4708) +++ trunk/includes/OutputSerialItems.php 2011-10-02 09:45:55 UTC (rev 4709) @@ -29,21 +29,21 @@ $Perishable=$myrow['perishable']; if ($LineItem->Serialised==1){ $tableheader .= '<tr> - <th>'. _('Serial No').'</th> - </tr>'; + <th>'. _('Serial No').'</th> + </tr>'; $listtableheader=$tableheader; } else if ($LineItem->Serialised==0 and $Perishable==1){ $tableheader = '<tr> - <th>'. _('Batch/Roll/Bundle'). ' #</th> - <th>'. _('Available'). '</th> - <th>'. _('Quantity'). '</th> - <th>'. _('Expiry Date'). '</th> - </tr>'; + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Available'). '</th> + <th>'. _('Quantity'). '</th> + <th>'. _('Expiry Date'). '</th> + </tr>'; $listtableheader = '<tr> - <th>'. _('Batch/Roll/Bundle'). ' #</th> - <th>'. _('Quantity'). '</th> - <th>'. _('Expiry Date'). '</th> - </tr>'; + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Quantity'). '</th> + <th>'. _('Expiry Date'). '</th> + </tr>'; } else { $tableheader = '<tr> <th>'. _('Batch/Roll/Bundle'). ' #</th> @@ -62,7 +62,9 @@ /*Display the batches already entered with quantities if not serialised */ -echo '<table class=selection><tr><td valign=top><table class=selection>'; +echo '<table class="selection"> + <tr> + <td valign="top"><table class="selection">'; echo $listtableheader; $TotalQuantity = 0; /*Variable to accumulate total quantity received */ @@ -89,10 +91,10 @@ echo '<td>' . $Bundle->BundleRef . '</td>'; if ($LineItem->Serialised==0 and $Perishable==0){ - echo '<td class=number>' . locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; + echo '<td class="number">' . locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; } else if ($LineItem->Serialised==0 and $Perishable==1){ - echo '<td class=number>' . locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; - echo '<td class=number>' . $Bundle->ExpiryDate . '</td>'; + echo '<td class="number">' . locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; + echo '<td class="number">' . $Bundle->ExpiryDate . '</td>'; } echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; @@ -103,27 +105,30 @@ /*Display the totals and rule off before allowing new entries */ if ($LineItem->Serialised==1){ - echo '<tr><td class=number><B>'. _('Total Quantity'). ': ' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; + echo '<tr><td class="number"><b>'. _('Total Quantity'). ': ' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; } else { - echo '<tr><td class=number><B>'. _('Total Quantity'). ':</b></td><td class=number><b>' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; + echo '<tr> + <td class="number"><b>'. _('Total Quantity'). ':</b></td> + <td class="number"><b>' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td> + </tr>'; } /*Close off old table */ -echo '</table></td><td valign=top>'; +echo '</table></td><td valign="top">'; /*Start a new table for the Serial/Batch ref input in one column (as a sub table then the multi select box for selection of existing bundle/serial nos for dispatch if applicable*/ //echo '<TABLE><TR><TD valign=TOP>'; $TransferQuantity=$TotalQuantity; /*in the first column add a table for the input of newies */ -echo '<table class=selection>'; +echo '<table class="selection">'; echo $tableheader; echo '<form action="' . $_SERVER['PHP_SELF'] . '" name="Ga6uF5Wa" method="post"> - <input type=hidden name=LineNo value="' . $LineNo . '"> - <input type=hidden name=StockID value="' . $StockID . '"> - <input type=hidden name=EntryType value="KEYED">'; + <input type=hidden name="LineNo" value="' . $LineNo . '" /> + <input type=hidden name="StockID" value="' . $StockID . '" /> + <input type=hidden name="EntryType" value="KEYED" />'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if ( isset($_GET['EditControlled']) ) { $EditControlled = isset($_GET['EditControlled'])?$_GET['EditControlled']:false; @@ -141,20 +146,20 @@ if ($EditControlled){ foreach ($LineItem->SerialItems as $Bundle){ - echo '<tr><td valign=top><input type="text" name="SerialNo'. $StartAddingAt .'" - value="'.$Bundle->BundleRef.'" size=21 maxlength=20></td>'; + echo '<tr> + <td valign="top"><input type="text" name="SerialNo'. $StartAddingAt .'" value="'.$Bundle->BundleRef.'" size="21" maxlength="20" /></td>'; /*if the item is controlled not serialised - batch quantity required so just enter bundle refs into the form for entry of quantities manually */ if ($LineItem->Serialised==1){ - echo '<input type=hidden name="Qty' . $StartAddingAt .'" Value=1></TR>'; + echo '<input type=hidden name="Qty' . $StartAddingAt .'" value=1></tr>'; } else if ($LineItem->Serialised==0 and $Perishable==1) { echo '<td><input type="text" class="number" name="Qty' . $StartAddingAt .'" size=11 - value="'. locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces). '" maxlength=10></tr>'; + value="'. locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces). '" maxlength=10></td></tr>'; } else { echo '<td><input type="text" class="number" name="Qty' . $StartAddingAt .'" size=11 - value="'. locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces). '" maxlength=10></tr>'; + value="'. locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces). '" maxlength=10></td></tr>'; } $StartAddingAt++; @@ -184,25 +189,24 @@ into the form for entry of quantities manually */ if ($LineItem->Serialised==1){ - echo '<input type=hidden name="Qty' . ($StartAddingAt+$RowNumber) .'" Value=1></tr>'; + echo '<input type=hidden name="Qty' . ($StartAddingAt+$RowNumber) .'" value=1></tr>'; } else if ($LineItem->Serialised==0 and $Perishable==1) { if (isset($LineItem->SerialItems[$myrow['serialno']])) { - echo '<td class=number>'.locale_number_format($myrow['quantity']-$LineItem->SerialItems[$myrow['serialno']]->BundleQty,$LineItem->DecimalPlaces).'</td>'; + echo '<td class="number">'.locale_number_format($myrow['quantity']-$LineItem->SerialItems[$myrow['serialno']]->BundleQty,$LineItem->DecimalPlaces).'</td>'; } else { - echo '<td class=number>'.locale_number_format($myrow['quantity'],$LineItem->DecimalPlaces).'</td>'; + echo '<td class="number">'.locale_number_format($myrow['quantity'],$LineItem->DecimalPlaces).'</td>'; } - echo '<td><input type="text" class="number" name="Qty' . ($StartAddingAt+$RowNumber) .'" size=11 value="0" maxlength=10></td>'; - echo '<td><input type=hidden class="date" name="ExpiryDate' . ($StartAddingAt+$RowNumber) .'" size=11 - value="'.ConvertSQLDate($myrow['expirationdate']).'" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength=10>'.ConvertSQLDate($myrow['expirationdate']).'</td></tr>'; + echo '<td><input type="text" class="number" name="Qty' . ($StartAddingAt+$RowNumber) .'" size=11 value="0" maxlength="10" /></td>'; + echo '<td><input type="hidden" class="date" name="ExpiryDate' . ($StartAddingAt+$RowNumber) .'" size="11" value="'.ConvertSQLDate($myrow['expirationdate']).'" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength="10" />'.ConvertSQLDate($myrow['expirationdate']).'</td></tr>'; } else { - echo '<td><input type="text" class="number" name="Qty' . ($StartAddingAt+$RowNumber) .'" size=11 value="'.$myrow['quantity'].'" maxlength=10></tr>'; + echo '<td><input type="text" class="number" name="Qty' . ($StartAddingAt+$RowNumber) .'" size=11 value="'. locale_number_format($myrow['quantity'],$LineItem->DecimalPlaces).'" maxlength="10" /></td></tr>'; } $RowNumber++; } echo '</table>'; echo '<br /><div class=centre><input type=submit name="AddBatches" value="'. _('Enter'). '"></div>'; -echo '</form></td><td valign=top>'; +echo '</form></td><td valign="top">'; $ShowExisting=True; $_POST['EntryType']='Sequential'; if ($ShowExisting){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-10-02 09:46:02
|
Revision: 4709 http://web-erp.svn.sourceforge.net/web-erp/?rev=4709&view=rev Author: daintree Date: 2011-10-02 09:45:55 +0000 (Sun, 02 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/includes/Add_SerialItems.php trunk/includes/Add_SerialItemsOut.php trunk/includes/InputSerialItemsFile.php trunk/includes/InputSerialItemsKeyed.php trunk/includes/InputSerialItemsSequential.php trunk/includes/OutputSerialItems.php Modified: trunk/includes/Add_SerialItems.php =================================================================== --- trunk/includes/Add_SerialItems.php 2011-10-02 09:16:51 UTC (rev 4708) +++ trunk/includes/Add_SerialItems.php 2011-10-02 09:45:55 UTC (rev 4709) @@ -16,7 +16,7 @@ $AddThisBundle = true; /*If the user enters a duplicate serial number the later one over-writes the first entered one - no warning given though ? */ - if ($_POST['Qty' . $i] > $ExistingBundleQty){ + if (filter_number_format($_POST['Qty' . $i]) > $ExistingBundleQty){ if ($LineItem->Serialised ==1){ echo '<br />'; prnMsg ( $_POST['SerialNo' . $i] . ' ' . @@ -38,7 +38,7 @@ } } if ($AddThisBundle==true){ - $LineItem->SerialItems[$_POST['SerialNo' . $i]] = new SerialItem ($_POST['SerialNo' . $i], ($InOutModifier>0?1:-1) * $_POST['Qty' . $i]); + $LineItem->SerialItems[$_POST['SerialNo' . $i]] = new SerialItem ($_POST['SerialNo' . $i], ($InOutModifier>0?1:-1) * filter_number_format($_POST['Qty' . $i])); } } /*end if ExistingBundleQty >0 */ else { @@ -51,7 +51,7 @@ //Serialised items can not exist w/ Qty > 0 if we have an $NewQty of 1 //Serialised items must exist w/ Qty = 1 if we have $NewQty of -1 $SerialError = false; - $NewQty = ($InOutModifier>0?1:-1) * $_POST['Qty' . $i]; + $NewQty = ($InOutModifier>0?1:-1) * filter_number_format($_POST['Qty' . $i]); $NewSerialNo = $_POST['SerialNo' . $i]; if ($LineItem->Serialised){ @@ -124,7 +124,9 @@ Validate an uploaded FILE and save entries ********************************************/ $valid = true; -if (isset($_POST['EntryType']) and $_POST['EntryType']=='FILE' and isset($_POST['ValidateFile'])){ +if (isset($_POST['EntryType']) + AND $_POST['EntryType']=='FILE' + AND isset($_POST['ValidateFile'])){ $filename = $_SESSION['CurImportFile']['tmp_name']; @@ -134,7 +136,7 @@ while (!feof($handle)) { $contents = trim(fgets($handle, 4096)); //$valid = $LineItem->SerialItems[$i]->importFileLineItem($contents); - $pieces = explode(",",$contents); + $pieces = explode(',',$contents); if ($LineItem->Serialised == 1){ //for Serialised items, we are expecting the line to contain either just the serial no //OR a comma delimited file w/ the serial no FIRST @@ -155,12 +157,12 @@ } } else { //for controlled only items, we must receive: BatchID, Qty in a comma delimited file - if($pieces[0] != "" AND $pieces[1] != "" AND is_numeric($pieces[1]) AND $pieces[1] > 0 ){ + if($pieces[0] != '' AND $pieces[1] != '' AND is_numeric(filter_number_format($pieces[1])) AND filter_number_format($pieces[1]) > 0 ){ /*If the user enters a duplicate batch number the later one over-writes the first entered one - no warning given though ? */ //$LineItem->SerialItems[$pieces[0]] = new SerialItem ($pieces[0], $pieces[1] ); $NewSerialNo = $pieces[0]; - $NewQty = ($InOutModifier>0?1:-1) * $pieces[1]; + $NewQty = ($InOutModifier>0?1:-1) * filter_number_format($pieces[1]); } else { $valid = false; } @@ -203,10 +205,10 @@ if ($LineItem->Serialised){ $ExistingQty = ValidBundleRef($StockID, $LocationOut, $NewSerialNo); if ($NewQty == 1 AND $ExistingQty != 0){ - prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a>: '. _("The Serial Number being added exists with a Quantity that is not Zero (0)!"), 'error' ); + prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a>: '. _('The Serial Number being added exists with a Quantity that is not Zero (0)!'), 'error' ); $SerialError = true; } elseif ($NewQty == -1 AND $ExistingQty != 1){ - prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> : '. _("The Serial Number being removed exists with a Quantity that is not One (1)!"), 'error'); + prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> : '. _('The Serial Number being removed exists with a Quantity that is not One (1)!'), 'error'); $SerialError = true; } } @@ -269,19 +271,19 @@ $AddThisBundle = true; /*If the user enters a duplicate serial number the later one over-writes the first entered one - no warning given though ? */ if ($NewQty > $ExistingBundleQty){ - if ($LineItem->Serialised ==1){ - echo '<br />' . '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> '. _('has already been sold'). '.'; - $AddThisBundle = false; - } elseif ($ExistingBundleQty==0) { /* and its a batch */ - echo '<br />' . _('There is none of'). ' <a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> '. _('remaining') .'.'; - $AddThisBundle = false; - } else { - echo '<br />'. _('There is only') . ' ' . $ExistingBundleQty . ' '. _('of') . ' ' . - '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> ' . _('remaining') . '. '. - _('The entered quantity will be reduced to the remaining amount left of this batch/bundle/roll'); - $NewQty = $ExistingBundleQty; - $AddThisBundle = true; - } + if ($LineItem->Serialised ==1){ + echo '<br />' . '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> '. _('has already been sold'). '.'; + $AddThisBundle = false; + } elseif ($ExistingBundleQty==0) { /* and its a batch */ + echo '<br />' . _('There is none of'). ' <a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> '. _('remaining') .'.'; + $AddThisBundle = false; + } else { + echo '<br />'. _('There is only') . ' ' . $ExistingBundleQty . ' '. _('of') . ' ' . + '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> ' . _('remaining') . '. '. + _('The entered quantity will be reduced to the remaining amount left of this batch/bundle/roll'); + $NewQty = $ExistingBundleQty; + $AddThisBundle = true; + } } if ($AddThisBundle==true){ $LineItem->SerialItems[$NewSerialNo] = new SerialItem ($NewSerialNo, $NewQty); @@ -343,4 +345,4 @@ if (isset($_GET['Delete'])){ unset($LineItem->SerialItems[$_GET['Delete']]); } -?> +?> \ No newline at end of file Modified: trunk/includes/Add_SerialItemsOut.php =================================================================== --- trunk/includes/Add_SerialItemsOut.php 2011-10-02 09:16:51 UTC (rev 4708) +++ trunk/includes/Add_SerialItemsOut.php 2011-10-02 09:45:55 UTC (rev 4709) @@ -12,22 +12,25 @@ $AddThisBundle = true; /*If the user enters a duplicate serial number the later one over-writes the first entered one - no warning given though ? */ - if ($_POST['Qty' . $i] > $ExistingBundleQty){ + if (filter_number_format($_POST['Qty' . $i]) > $ExistingBundleQty){ if ($LineItem->Serialised ==1){ - echo "<br />" . $_POST['SerialNo' . $i] . " " . _('has already been sold'); + echo '<br />' . $_POST['SerialNo' . $i] . " " . _('has already been sold'); $AddThisBundle = false; } elseif ($ExistingBundleQty==0) { /* and its a batch */ - echo "<br />There is none of " . $_POST['SerialNo' . $i] . " left."; + echo '<br />' . _('There is none of') . ' ' . $_POST['SerialNo' . $i] . ' ' . _('left'); $AddThisBundle = false; } else { - echo '<br />' . _('There is only') . ' ' . $ExistingBundleQty . ' ' . _('of') . ' ' . $_POST['SerialNo' . $i] . - ' ' . _('remaining') . '. ' . _('The entered quantity will be reduced to the remaining amount left of this batch/bundle/roll'); + echo '<br />' . _('There is only') . ' ' . $ExistingBundleQty . ' ' . _('of') . ' ' . $_POST['SerialNo' . $i] . ' ' . _('remaining') . '. ' . _('The entered quantity will be reduced to the remaining amount left of this batch/bundle/roll'); $_POST['Qty' . $i] = $ExistingBundleQty; $AddThisBundle = true; } } - if ($AddThisBundle==true and $_POST['Qty' . $i]>0){ - $LineItem->SerialItems[$_POST['SerialNo' . $i]] = new SerialItem ($_POST['SerialNo' . $i], $_POST['Qty' . $i], $_POST['ExpiryDate' . $i]); + if ($AddThisBundle==true + AND filter_number_format($_POST['Qty' . $i])>0){ + + $LineItem->SerialItems[$_POST['SerialNo' . $i]] = new SerialItem ($_POST['SerialNo' . $i], + filter_number_format($_POST['Qty' . $i]), + $_POST['ExpiryDate' . $i]); } } /*end if ExistingBundleQty >0 */ } /* end if posted Serialno . i is not blank */ @@ -51,4 +54,4 @@ $LineItem->SerialItems=array(); } -?> +?> \ No newline at end of file Modified: trunk/includes/InputSerialItemsFile.php =================================================================== --- trunk/includes/InputSerialItemsFile.php 2011-10-02 09:16:51 UTC (rev 4708) +++ trunk/includes/InputSerialItemsFile.php 2011-10-02 09:45:55 UTC (rev 4709) @@ -71,7 +71,7 @@ $_SESSION['CurImportFile'] = ''; $LineItem->SerialItemsValid=false; } -if ($_FILES['ImportFile']['name'] == '' && $_SESSION['CurImportFile'] == ''){ +if ($_FILES['ImportFile']['name'] == '' AND $_SESSION['CurImportFile'] == ''){ $msg = _('Please Choose a file and then click Set Entry Type to upload a file for import'); prnMsg($msg); $LineItem->SerialItemsValid=false; @@ -125,14 +125,12 @@ <tr><td>'. _('Size') .':</td><td>' . locale_number_format($_SESSION['CurImportFile']['size']/1024,4) . 'kb</td></tr> <tr><td>'. _('Type') .':</td><td>' . $_SESSION['CurImportFile']['type'] . '</td></tr> <tr><td>'. _('TempName') .':</td><td>' . $_SESSION['CurImportFile']['tmp_name'] . '</td></tr> - <tr><td>'. _('Status') .':</td><td>' . - ($LineItem->SerialItemsValid?getMsg(_('Valid'),'success'):getMsg(_('Invalid'),'error')) . '</td></tr> - </table>'. - $invalid_imports.' '. _('out of') .' '.$TotalLines.' '. _('records are invalid').'<br />'; + <tr><td>'. _('Status') .':</td><td>' . ($LineItem->SerialItemsValid?getMsg(_('Valid'),'success'):getMsg(_('Invalid'),'error')) . '</td></tr> + </table>'. $invalid_imports.' '. _('out of') .' '.$TotalLines.' '. _('records are invalid').'<br />'; $filename = $_SESSION['CurImportFile']['tmp_name']; } -if (!$LineItem->SerialItemsValid && !$_SESSION['CurImportFile']['Processed']){ +if (!$LineItem->SerialItemsValid AND !$_SESSION['CurImportFile']['Processed']){ // If all items are not valid, show the raw first 10 lines of the file. maybe it will help. $filename = $_SESSION['CurImportFile']['tmp_name']; $handle = fopen($filename, 'r'); @@ -168,7 +166,7 @@ $i++; if ($i == 100) { break; - } + } } } Modified: trunk/includes/InputSerialItemsKeyed.php =================================================================== --- trunk/includes/InputSerialItemsKeyed.php 2011-10-02 09:16:51 UTC (rev 4708) +++ trunk/includes/InputSerialItemsKeyed.php 2011-10-02 09:45:55 UTC (rev 4709) @@ -22,7 +22,7 @@ /*Display the batches already entered with quantities if not serialised */ echo '<table class="selection"> - <tr><td valign=top> + <tr><td valign="top"> <table class="selection">'; echo $tableheader; @@ -64,9 +64,12 @@ /*Display the totals and rule off before allowing new entries */ if ($LineItem->Serialised==1){ - echo '<tr><td class="number"><B>'. _('Total Quantity'). ': ' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; + echo '<tr><td class="number"><b>'. _('Total Quantity'). ': ' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; } else { - echo '<tr><td class="number"><B>'. _('Total Quantity'). ':</b></td><td class="number"><b>' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; + echo '<tr> + <td class="number"><b>'. _('Total Quantity'). ':</b></td> + <td class="number"><b>' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td> + </tr>'; } /*Close off old table */ @@ -98,8 +101,7 @@ if ($EditControlled){ foreach ($LineItem->SerialItems as $Bundle){ - echo '<tr><td valign=top><input type="text" name="SerialNo'. $StartAddingAt .'" - value="'.$Bundle->BundleRef.'" size=21 maxlength=20></td>'; + echo '<tr><td valign=top><input type="text" name="SerialNo'. $StartAddingAt .'" value="' .$Bundle->BundleRef.'" size="21" maxlength="20" /></td>'; /*if the item is controlled not serialised - batch quantity required so just enter bundle refs into the form for entry of quantities manually */ @@ -120,25 +122,25 @@ for ($i=0;$i < 10;$i++){ - echo '<tr><td valign=top><input type="text" name="SerialNo'. ($StartAddingAt+$i) .'" size=21 maxlength=20></td>'; + echo '<tr><td valign=top><input type="text" name="SerialNo'. ($StartAddingAt+$i) .'" size="21" maxlength="20" /></td>'; /*if the item is controlled not serialised - batch quantity required so just enter bundle refs into the form for entry of quantities manually */ if ($LineItem->Serialised==1){ - echo '<input type=hidden name="Qty' . ($StartAddingAt+$i) .'" Value=1></tr>'; + echo '<input type=hidden name="Qty' . ($StartAddingAt+$i) .'" value=1></td></tr>'; } else if ($LineItem->Serialised==0 and $Perishable==1) { - echo '<td><input type="text" class="number" name="Qty' . ($StartAddingAt+$i) .'" size=11 maxlength=10></td>'; + echo '<td><input type="text" class="number" name="Qty' . ($StartAddingAt+$i) .'" size=11 maxlength="10" /></td>'; echo '<td><input type="text" class="date" name="ExpiryDate' . ($StartAddingAt+$i) .'" size=11 - value="" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength=10></td></tr>'; + value="" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength="10" /></td></tr>'; } else { - echo '<td><input type="text" class="number" name="Qty' . ($StartAddingAt+$i) .'" size=11 maxlength=10></tr>'; + echo '<td><input type="text" class="number" name="Qty' . ($StartAddingAt+$i) .'" size=11 maxlength="10"></td></tr>'; } } echo '</table>'; -echo '<br /><div class=centre><input type=submit name="AddBatches" value="'. _('Enter'). '"></div>'; -echo '</form></td><td valign=top>'; +echo '<br /><div class=centre><input type="submit" name="AddBatches" value="'. _('Enter'). '"></div>'; +echo '</form></td><td valign="top">'; if ($ShowExisting){ include('includes/InputSerialItemsExisting.php'); } Modified: trunk/includes/InputSerialItemsSequential.php =================================================================== --- trunk/includes/InputSerialItemsSequential.php 2011-10-02 09:16:51 UTC (rev 4708) +++ trunk/includes/InputSerialItemsSequential.php 2011-10-02 09:45:55 UTC (rev 4709) @@ -30,7 +30,7 @@ echo $tableheader; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?=' . $SID . '" method="post"> +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"> <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> <input type="hidden" name="LineNo" value="' . $LineNo . '"> <input type="hidden" name="StockID" value="' . $StockID . '"> @@ -40,12 +40,17 @@ } elseif ( isset($_POST['EditControlled']) ){ $EditControlled = isset($_POST['EditControlled'])?$_POST['EditControlled']:false; } -echo '<tr><td valign="top">'. _('Begin:') . '</td><td> <input type="text" name="BeginNo" size="21" maxlength="20" value="'. $_POST['BeginNo']. '"></td></tr>'; -echo '<tr><td valign="top">'. _('End:') . '</td><td> <input type="text" name="EndNo" size="21" maxlength="20" value="'. $_POST['EndNo']. '"></td></tr>'; +echo '<tr> + <td valign="top">'. _('Begin:') . '</td> + <td> <input type="text" name="BeginNo" size="21" maxlength="20" value="'. $_POST['BeginNo']. '" /></td> + </tr>'; +echo '<tr> + <td valign="top">'. _('End:') . '</td> + <td> <input type="text" name="EndNo" size="21" maxlength="20" value="'. $_POST['EndNo']. '" /></td> + </tr>'; - echo '</table>'; echo '<br /><center><input type="submit" name="AddSequence" value="'. _('Enter'). '"></center><br />'; echo '</form></td><td valign="top">'; //echo '</td></tr></table>'; /*end of nested table */ -?> +?> \ No newline at end of file Modified: trunk/includes/OutputSerialItems.php =================================================================== --- trunk/includes/OutputSerialItems.php 2011-10-02 09:16:51 UTC (rev 4708) +++ trunk/includes/OutputSerialItems.php 2011-10-02 09:45:55 UTC (rev 4709) @@ -29,21 +29,21 @@ $Perishable=$myrow['perishable']; if ($LineItem->Serialised==1){ $tableheader .= '<tr> - <th>'. _('Serial No').'</th> - </tr>'; + <th>'. _('Serial No').'</th> + </tr>'; $listtableheader=$tableheader; } else if ($LineItem->Serialised==0 and $Perishable==1){ $tableheader = '<tr> - <th>'. _('Batch/Roll/Bundle'). ' #</th> - <th>'. _('Available'). '</th> - <th>'. _('Quantity'). '</th> - <th>'. _('Expiry Date'). '</th> - </tr>'; + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Available'). '</th> + <th>'. _('Quantity'). '</th> + <th>'. _('Expiry Date'). '</th> + </tr>'; $listtableheader = '<tr> - <th>'. _('Batch/Roll/Bundle'). ' #</th> - <th>'. _('Quantity'). '</th> - <th>'. _('Expiry Date'). '</th> - </tr>'; + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Quantity'). '</th> + <th>'. _('Expiry Date'). '</th> + </tr>'; } else { $tableheader = '<tr> <th>'. _('Batch/Roll/Bundle'). ' #</th> @@ -62,7 +62,9 @@ /*Display the batches already entered with quantities if not serialised */ -echo '<table class=selection><tr><td valign=top><table class=selection>'; +echo '<table class="selection"> + <tr> + <td valign="top"><table class="selection">'; echo $listtableheader; $TotalQuantity = 0; /*Variable to accumulate total quantity received */ @@ -89,10 +91,10 @@ echo '<td>' . $Bundle->BundleRef . '</td>'; if ($LineItem->Serialised==0 and $Perishable==0){ - echo '<td class=number>' . locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; + echo '<td class="number">' . locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; } else if ($LineItem->Serialised==0 and $Perishable==1){ - echo '<td class=number>' . locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; - echo '<td class=number>' . $Bundle->ExpiryDate . '</td>'; + echo '<td class="number">' . locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; + echo '<td class="number">' . $Bundle->ExpiryDate . '</td>'; } echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; @@ -103,27 +105,30 @@ /*Display the totals and rule off before allowing new entries */ if ($LineItem->Serialised==1){ - echo '<tr><td class=number><B>'. _('Total Quantity'). ': ' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; + echo '<tr><td class="number"><b>'. _('Total Quantity'). ': ' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; } else { - echo '<tr><td class=number><B>'. _('Total Quantity'). ':</b></td><td class=number><b>' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; + echo '<tr> + <td class="number"><b>'. _('Total Quantity'). ':</b></td> + <td class="number"><b>' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td> + </tr>'; } /*Close off old table */ -echo '</table></td><td valign=top>'; +echo '</table></td><td valign="top">'; /*Start a new table for the Serial/Batch ref input in one column (as a sub table then the multi select box for selection of existing bundle/serial nos for dispatch if applicable*/ //echo '<TABLE><TR><TD valign=TOP>'; $TransferQuantity=$TotalQuantity; /*in the first column add a table for the input of newies */ -echo '<table class=selection>'; +echo '<table class="selection">'; echo $tableheader; echo '<form action="' . $_SERVER['PHP_SELF'] . '" name="Ga6uF5Wa" method="post"> - <input type=hidden name=LineNo value="' . $LineNo . '"> - <input type=hidden name=StockID value="' . $StockID . '"> - <input type=hidden name=EntryType value="KEYED">'; + <input type=hidden name="LineNo" value="' . $LineNo . '" /> + <input type=hidden name="StockID" value="' . $StockID . '" /> + <input type=hidden name="EntryType" value="KEYED" />'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if ( isset($_GET['EditControlled']) ) { $EditControlled = isset($_GET['EditControlled'])?$_GET['EditControlled']:false; @@ -141,20 +146,20 @@ if ($EditControlled){ foreach ($LineItem->SerialItems as $Bundle){ - echo '<tr><td valign=top><input type="text" name="SerialNo'. $StartAddingAt .'" - value="'.$Bundle->BundleRef.'" size=21 maxlength=20></td>'; + echo '<tr> + <td valign="top"><input type="text" name="SerialNo'. $StartAddingAt .'" value="'.$Bundle->BundleRef.'" size="21" maxlength="20" /></td>'; /*if the item is controlled not serialised - batch quantity required so just enter bundle refs into the form for entry of quantities manually */ if ($LineItem->Serialised==1){ - echo '<input type=hidden name="Qty' . $StartAddingAt .'" Value=1></TR>'; + echo '<input type=hidden name="Qty' . $StartAddingAt .'" value=1></tr>'; } else if ($LineItem->Serialised==0 and $Perishable==1) { echo '<td><input type="text" class="number" name="Qty' . $StartAddingAt .'" size=11 - value="'. locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces). '" maxlength=10></tr>'; + value="'. locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces). '" maxlength=10></td></tr>'; } else { echo '<td><input type="text" class="number" name="Qty' . $StartAddingAt .'" size=11 - value="'. locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces). '" maxlength=10></tr>'; + value="'. locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces). '" maxlength=10></td></tr>'; } $StartAddingAt++; @@ -184,25 +189,24 @@ into the form for entry of quantities manually */ if ($LineItem->Serialised==1){ - echo '<input type=hidden name="Qty' . ($StartAddingAt+$RowNumber) .'" Value=1></tr>'; + echo '<input type=hidden name="Qty' . ($StartAddingAt+$RowNumber) .'" value=1></tr>'; } else if ($LineItem->Serialised==0 and $Perishable==1) { if (isset($LineItem->SerialItems[$myrow['serialno']])) { - echo '<td class=number>'.locale_number_format($myrow['quantity']-$LineItem->SerialItems[$myrow['serialno']]->BundleQty,$LineItem->DecimalPlaces).'</td>'; + echo '<td class="number">'.locale_number_format($myrow['quantity']-$LineItem->SerialItems[$myrow['serialno']]->BundleQty,$LineItem->DecimalPlaces).'</td>'; } else { - echo '<td class=number>'.locale_number_format($myrow['quantity'],$LineItem->DecimalPlaces).'</td>'; + echo '<td class="number">'.locale_number_format($myrow['quantity'],$LineItem->DecimalPlaces).'</td>'; } - echo '<td><input type="text" class="number" name="Qty' . ($StartAddingAt+$RowNumber) .'" size=11 value="0" maxlength=10></td>'; - echo '<td><input type=hidden class="date" name="ExpiryDate' . ($StartAddingAt+$RowNumber) .'" size=11 - value="'.ConvertSQLDate($myrow['expirationdate']).'" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength=10>'.ConvertSQLDate($myrow['expirationdate']).'</td></tr>'; + echo '<td><input type="text" class="number" name="Qty' . ($StartAddingAt+$RowNumber) .'" size=11 value="0" maxlength="10" /></td>'; + echo '<td><input type="hidden" class="date" name="ExpiryDate' . ($StartAddingAt+$RowNumber) .'" size="11" value="'.ConvertSQLDate($myrow['expirationdate']).'" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength="10" />'.ConvertSQLDate($myrow['expirationdate']).'</td></tr>'; } else { - echo '<td><input type="text" class="number" name="Qty' . ($StartAddingAt+$RowNumber) .'" size=11 value="'.$myrow['quantity'].'" maxlength=10></tr>'; + echo '<td><input type="text" class="number" name="Qty' . ($StartAddingAt+$RowNumber) .'" size=11 value="'. locale_number_format($myrow['quantity'],$LineItem->DecimalPlaces).'" maxlength="10" /></td></tr>'; } $RowNumber++; } echo '</table>'; echo '<br /><div class=centre><input type=submit name="AddBatches" value="'. _('Enter'). '"></div>'; -echo '</form></td><td valign=top>'; +echo '</form></td><td valign="top">'; $ShowExisting=True; $_POST['EntryType']='Sequential'; if ($ShowExisting){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-03-30 14:22:08
|
Revision: 5171 http://web-erp.svn.sourceforge.net/web-erp/?rev=5171&view=rev Author: ExsonQu Date: 2012-03-30 14:22:02 +0000 (Fri, 30 Mar 2012) Log Message: ----------- 31/3/2012 Dafydd Crosby: Revise scripts Add_SerialItemsOut.php and OutputSerialItems.php fixes a problem that occurs when receiving a bulk inventory transfer. There was a hard-coded loop that prevented adding bundles that were greater than 10. Modified Paths: -------------- trunk/includes/Add_SerialItemsOut.php trunk/includes/OutputSerialItems.php Modified: trunk/includes/Add_SerialItemsOut.php =================================================================== --- trunk/includes/Add_SerialItemsOut.php 2012-03-30 14:19:40 UTC (rev 5170) +++ trunk/includes/Add_SerialItemsOut.php 2012-03-30 14:22:02 UTC (rev 5171) @@ -5,8 +5,13 @@ if (isset($_POST['AddBatches'])){ - for ($i=0;$i < 10;$i++){ - if(isset($_POST['SerialNo' . $i]) and mb_strlen($_POST['SerialNo' . $i])>0){ + if (isset($_POST['TotalBundles'])){ + $loop_max = $_POST['TotalBundles']; + } else { + $loop_max = 10; + } + for ($i=0;$i < $loop_max;$i++){ + if(isset($_POST['SerialNo' . $i]) and mb_strlen($_POST['SerialNo' . $i])>0){ $ExistingBundleQty = ValidBundleRef($StockID, $LocationOut, $_POST['SerialNo' . $i]); if ($ExistingBundleQty >0){ $AddThisBundle = true; @@ -54,4 +59,4 @@ $LineItem->SerialItems=array(); } -?> \ No newline at end of file +?> Modified: trunk/includes/OutputSerialItems.php =================================================================== --- trunk/includes/OutputSerialItems.php 2012-03-30 14:19:40 UTC (rev 5170) +++ trunk/includes/OutputSerialItems.php 2012-03-30 14:22:02 UTC (rev 5171) @@ -202,7 +202,7 @@ } $RowNumber++; } - +echo '<input type="hidden" name="TotalBundles" value="'.($RowNumber).'">'; echo '</table>'; echo '<br /><div class="centre"><input type="submit" name="AddBatches" value="'. _('Enter'). '" /></div>'; echo '</form> @@ -220,4 +220,4 @@ document.Ga6uF5Wa.SerialNo0.focus(); //]]> </script>'; /*end of nested table */ -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-03-30 14:22:13
|
Revision: 5171 http://web-erp.svn.sourceforge.net/web-erp/?rev=5171&view=rev Author: ExsonQu Date: 2012-03-30 14:22:02 +0000 (Fri, 30 Mar 2012) Log Message: ----------- 31/3/2012 Dafydd Crosby: Revise scripts Add_SerialItemsOut.php and OutputSerialItems.php fixes a problem that occurs when receiving a bulk inventory transfer. There was a hard-coded loop that prevented adding bundles that were greater than 10. Modified Paths: -------------- trunk/includes/Add_SerialItemsOut.php trunk/includes/OutputSerialItems.php Modified: trunk/includes/Add_SerialItemsOut.php =================================================================== --- trunk/includes/Add_SerialItemsOut.php 2012-03-30 14:19:40 UTC (rev 5170) +++ trunk/includes/Add_SerialItemsOut.php 2012-03-30 14:22:02 UTC (rev 5171) @@ -5,8 +5,13 @@ if (isset($_POST['AddBatches'])){ - for ($i=0;$i < 10;$i++){ - if(isset($_POST['SerialNo' . $i]) and mb_strlen($_POST['SerialNo' . $i])>0){ + if (isset($_POST['TotalBundles'])){ + $loop_max = $_POST['TotalBundles']; + } else { + $loop_max = 10; + } + for ($i=0;$i < $loop_max;$i++){ + if(isset($_POST['SerialNo' . $i]) and mb_strlen($_POST['SerialNo' . $i])>0){ $ExistingBundleQty = ValidBundleRef($StockID, $LocationOut, $_POST['SerialNo' . $i]); if ($ExistingBundleQty >0){ $AddThisBundle = true; @@ -54,4 +59,4 @@ $LineItem->SerialItems=array(); } -?> \ No newline at end of file +?> Modified: trunk/includes/OutputSerialItems.php =================================================================== --- trunk/includes/OutputSerialItems.php 2012-03-30 14:19:40 UTC (rev 5170) +++ trunk/includes/OutputSerialItems.php 2012-03-30 14:22:02 UTC (rev 5171) @@ -202,7 +202,7 @@ } $RowNumber++; } - +echo '<input type="hidden" name="TotalBundles" value="'.($RowNumber).'">'; echo '</table>'; echo '<br /><div class="centre"><input type="submit" name="AddBatches" value="'. _('Enter'). '" /></div>'; echo '</form> @@ -220,4 +220,4 @@ document.Ga6uF5Wa.SerialNo0.focus(); //]]> </script>'; /*end of nested table */ -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-08-26 11:49:01
|
Revision: 5609 http://web-erp.svn.sourceforge.net/web-erp/?rev=5609&view=rev Author: tim_schofield Date: 2012-08-26 11:48:53 +0000 (Sun, 26 Aug 2012) Log Message: ----------- Thomas Timothy Lie: Fix errors in gettext strings Modified Paths: -------------- trunk/includes/ConnectDB_mysql.inc trunk/includes/ConnectDB_mysqli.inc Modified: trunk/includes/ConnectDB_mysql.inc =================================================================== --- trunk/includes/ConnectDB_mysql.inc 2012-08-25 19:35:32 UTC (rev 5608) +++ trunk/includes/ConnectDB_mysql.inc 2012-08-26 11:48:53 UTC (rev 5609) @@ -22,24 +22,23 @@ echo '<br />' . _('The configuration in the file config.php for the database user name and password do not provide the information required to connect to the database server'); session_unset(); session_destroy(); - echo '<p>' . _('Click') . '<a href="index.php">' . _('here') . '</a>' ._('to try logging in -again') . '</p>'; + echo '<p>' . _('Click') . ' ' . '<a href="index.php">' . _('here') . '</a>' , ' ' ._('to try logging in again') . '</p>'; exit; } /* Update to allow RecurringSalesOrdersProcess.php to run via cron */ if (isset($DatabaseName)) { - + if (! mysql_select_db($_SESSION['DatabaseName'],$db)) { - echo '<br />' . _('The company name entered does not correspond to a database on the database server specified in the config.php configuration file. Try logging in with a different company name'); + echo '<br />' . _('The company name entered does not correspond to a database on the database server specified in the config.php configuration file. Try logging in with a different company name'); echo '<br /><a href="index.php">' . _('Back to login page') . '</A>'; unset ($_SESSION['DatabaseName']); exit; } } else { if (! mysql_select_db($_SESSION['DatabaseName'],$db)) { - echo '<br />' . _('The company name entered does not correspond to a database on the database server specified in the config.php configuration file. Try logging in with a different company name'); + echo '<br />' . _('The company name entered does not correspond to a database on the database server specified in the config.php configuration file. Try logging in with a different company name'); echo '<br /><a href="index.php">' . _('Back to login page') . '</A>'; unset ($_SESSION['DatabaseName']); exit; @@ -59,7 +58,7 @@ global $debug; global $PathPrefix; - + $result=mysql_query($SQL,$Conn); $_SESSION['LastInsertId'] = mysql_insert_id($Conn); Modified: trunk/includes/ConnectDB_mysqli.inc =================================================================== --- trunk/includes/ConnectDB_mysqli.inc 2012-08-25 19:35:32 UTC (rev 5608) +++ trunk/includes/ConnectDB_mysqli.inc 2012-08-26 11:48:53 UTC (rev 5609) @@ -27,8 +27,7 @@ printf("Connect failed: %s\n", mysqli_connect_error()); session_unset(); session_destroy(); - echo '<p>' . _('Click') . '<a href="index.php">' . _('here') . '</a>' ._('to try logging in -again') . '</p>'; + echo '<p>' . _('Click') . ' ' . '<a href="index.php">' . _('here') . '</a>' , ' ' ._('to try logging in again') . '</p>'; exit(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-08-26 11:49:01
|
Revision: 5609 http://web-erp.svn.sourceforge.net/web-erp/?rev=5609&view=rev Author: tim_schofield Date: 2012-08-26 11:48:53 +0000 (Sun, 26 Aug 2012) Log Message: ----------- Thomas Timothy Lie: Fix errors in gettext strings Modified Paths: -------------- trunk/includes/ConnectDB_mysql.inc trunk/includes/ConnectDB_mysqli.inc Modified: trunk/includes/ConnectDB_mysql.inc =================================================================== --- trunk/includes/ConnectDB_mysql.inc 2012-08-25 19:35:32 UTC (rev 5608) +++ trunk/includes/ConnectDB_mysql.inc 2012-08-26 11:48:53 UTC (rev 5609) @@ -22,24 +22,23 @@ echo '<br />' . _('The configuration in the file config.php for the database user name and password do not provide the information required to connect to the database server'); session_unset(); session_destroy(); - echo '<p>' . _('Click') . '<a href="index.php">' . _('here') . '</a>' ._('to try logging in -again') . '</p>'; + echo '<p>' . _('Click') . ' ' . '<a href="index.php">' . _('here') . '</a>' , ' ' ._('to try logging in again') . '</p>'; exit; } /* Update to allow RecurringSalesOrdersProcess.php to run via cron */ if (isset($DatabaseName)) { - + if (! mysql_select_db($_SESSION['DatabaseName'],$db)) { - echo '<br />' . _('The company name entered does not correspond to a database on the database server specified in the config.php configuration file. Try logging in with a different company name'); + echo '<br />' . _('The company name entered does not correspond to a database on the database server specified in the config.php configuration file. Try logging in with a different company name'); echo '<br /><a href="index.php">' . _('Back to login page') . '</A>'; unset ($_SESSION['DatabaseName']); exit; } } else { if (! mysql_select_db($_SESSION['DatabaseName'],$db)) { - echo '<br />' . _('The company name entered does not correspond to a database on the database server specified in the config.php configuration file. Try logging in with a different company name'); + echo '<br />' . _('The company name entered does not correspond to a database on the database server specified in the config.php configuration file. Try logging in with a different company name'); echo '<br /><a href="index.php">' . _('Back to login page') . '</A>'; unset ($_SESSION['DatabaseName']); exit; @@ -59,7 +58,7 @@ global $debug; global $PathPrefix; - + $result=mysql_query($SQL,$Conn); $_SESSION['LastInsertId'] = mysql_insert_id($Conn); Modified: trunk/includes/ConnectDB_mysqli.inc =================================================================== --- trunk/includes/ConnectDB_mysqli.inc 2012-08-25 19:35:32 UTC (rev 5608) +++ trunk/includes/ConnectDB_mysqli.inc 2012-08-26 11:48:53 UTC (rev 5609) @@ -27,8 +27,7 @@ printf("Connect failed: %s\n", mysqli_connect_error()); session_unset(); session_destroy(); - echo '<p>' . _('Click') . '<a href="index.php">' . _('here') . '</a>' ._('to try logging in -again') . '</p>'; + echo '<p>' . _('Click') . ' ' . '<a href="index.php">' . _('here') . '</a>' , ' ' ._('to try logging in again') . '</p>'; exit(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-08-26 11:50:55
|
Revision: 5610 http://web-erp.svn.sourceforge.net/web-erp/?rev=5610&view=rev Author: tim_schofield Date: 2012-08-26 11:50:48 +0000 (Sun, 26 Aug 2012) Log Message: ----------- Fix typo Modified Paths: -------------- trunk/includes/ConnectDB_mysql.inc trunk/includes/ConnectDB_mysqli.inc Modified: trunk/includes/ConnectDB_mysql.inc =================================================================== --- trunk/includes/ConnectDB_mysql.inc 2012-08-26 11:48:53 UTC (rev 5609) +++ trunk/includes/ConnectDB_mysql.inc 2012-08-26 11:50:48 UTC (rev 5610) @@ -22,7 +22,7 @@ echo '<br />' . _('The configuration in the file config.php for the database user name and password do not provide the information required to connect to the database server'); session_unset(); session_destroy(); - echo '<p>' . _('Click') . ' ' . '<a href="index.php">' . _('here') . '</a>' , ' ' ._('to try logging in again') . '</p>'; + echo '<p>' . _('Click') . ' ' . '<a href="index.php">' . _('here') . '</a>' . ' ' ._('to try logging in again') . '</p>'; exit; } Modified: trunk/includes/ConnectDB_mysqli.inc =================================================================== --- trunk/includes/ConnectDB_mysqli.inc 2012-08-26 11:48:53 UTC (rev 5609) +++ trunk/includes/ConnectDB_mysqli.inc 2012-08-26 11:50:48 UTC (rev 5610) @@ -27,7 +27,7 @@ printf("Connect failed: %s\n", mysqli_connect_error()); session_unset(); session_destroy(); - echo '<p>' . _('Click') . ' ' . '<a href="index.php">' . _('here') . '</a>' , ' ' ._('to try logging in again') . '</p>'; + echo '<p>' . _('Click') . ' ' . '<a href="index.php">' . _('here') . '</a>' . ' ' ._('to try logging in again') . '</p>'; exit(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-08-26 11:50:55
|
Revision: 5610 http://web-erp.svn.sourceforge.net/web-erp/?rev=5610&view=rev Author: tim_schofield Date: 2012-08-26 11:50:48 +0000 (Sun, 26 Aug 2012) Log Message: ----------- Fix typo Modified Paths: -------------- trunk/includes/ConnectDB_mysql.inc trunk/includes/ConnectDB_mysqli.inc Modified: trunk/includes/ConnectDB_mysql.inc =================================================================== --- trunk/includes/ConnectDB_mysql.inc 2012-08-26 11:48:53 UTC (rev 5609) +++ trunk/includes/ConnectDB_mysql.inc 2012-08-26 11:50:48 UTC (rev 5610) @@ -22,7 +22,7 @@ echo '<br />' . _('The configuration in the file config.php for the database user name and password do not provide the information required to connect to the database server'); session_unset(); session_destroy(); - echo '<p>' . _('Click') . ' ' . '<a href="index.php">' . _('here') . '</a>' , ' ' ._('to try logging in again') . '</p>'; + echo '<p>' . _('Click') . ' ' . '<a href="index.php">' . _('here') . '</a>' . ' ' ._('to try logging in again') . '</p>'; exit; } Modified: trunk/includes/ConnectDB_mysqli.inc =================================================================== --- trunk/includes/ConnectDB_mysqli.inc 2012-08-26 11:48:53 UTC (rev 5609) +++ trunk/includes/ConnectDB_mysqli.inc 2012-08-26 11:50:48 UTC (rev 5610) @@ -27,7 +27,7 @@ printf("Connect failed: %s\n", mysqli_connect_error()); session_unset(); session_destroy(); - echo '<p>' . _('Click') . ' ' . '<a href="index.php">' . _('here') . '</a>' , ' ' ._('to try logging in again') . '</p>'; + echo '<p>' . _('Click') . ' ' . '<a href="index.php">' . _('here') . '</a>' . ' ' ._('to try logging in again') . '</p>'; exit(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2013-05-17 23:39:11
|
Revision: 5974 http://sourceforge.net/p/web-erp/reponame/5974 Author: tehonu Date: 2013-05-17 23:39:08 +0000 (Fri, 17 May 2013) Log Message: ----------- Pak Ricard: Improve error reporting Modified Paths: -------------- trunk/includes/ConnectDB_mysqli.inc trunk/includes/MiscFunctions.php Modified: trunk/includes/ConnectDB_mysqli.inc =================================================================== --- trunk/includes/ConnectDB_mysqli.inc 2013-05-17 23:15:37 UTC (rev 5973) +++ trunk/includes/ConnectDB_mysqli.inc 2013-05-17 23:39:08 UTC (rev 5974) @@ -80,7 +80,7 @@ if ($TrapErrors){ require_once($PathPrefix . 'includes/header.inc'); } - prnMsg($ErrorMessage.'<br />' . DB_error_msg($Conn),'error', _('Database Error')); + prnMsg($ErrorMessage.'<br />' . DB_error_msg($Conn),'error', _('Database Error'). ' ' .DB_error_no($Conn)); if ($debug==1){ prnMsg($DebugMessage. '<br />' . $SQL . '<br />','error',_('Database SQL Failure')); } @@ -88,7 +88,9 @@ $SQL = 'rollback'; $Result = DB_query($SQL,$Conn); if (DB_error_no($Conn) !=0){ - prnMsg(_('Error Rolling Back Transaction'), '', _('Database Rollback Error') ); + prnMsg(_('Error Rolling Back Transaction'), 'error', _('Database Rollback Error'). ' ' .DB_error_no($Conn) ); + }else{ + prnMsg(_('Rolling Back Transaction OK'), 'error', _('Database Rollback Due to Error Above')); } } if ($TrapErrors){ Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2013-05-17 23:15:37 UTC (rev 5973) +++ trunk/includes/MiscFunctions.php 2013-05-17 23:39:08 UTC (rev 5974) @@ -28,21 +28,21 @@ $Class = 'error'; $Prefix = $Prefix ? $Prefix : _('ERROR') . ' ' ._('Message Report'); if (isset($_SESSION['LogSeverity']) and $_SESSION['LogSeverity']>0) { - fwrite($LogFile, date('Y-m-d H:i:s').','.$Type.','.$_SESSION['UserID'].','.trim($Msg,',')."\n"); + fwrite($LogFile, date('Y-m-d H:i:s').','.$Type.','.$_SESSION['UserID'].','.trim(str_replace("<br />", " ", $Msg),',')."\n"); } break; case 'warn': $Class = 'warn'; $Prefix = $Prefix ? $Prefix : _('WARNING') . ' ' . _('Message Report'); if (isset($_SESSION['LogSeverity']) and $_SESSION['LogSeverity']>1) { - fwrite($LogFile, date('Y-m-d H:i:s').','.$Type.','.$_SESSION['UserID'].','.trim($Msg,',')."\n"); + fwrite($LogFile, date('Y-m-d H:i:s').','.$Type.','.$_SESSION['UserID'].','.trim(str_replace("<br />", " ", $Msg),',')."\n"); } break; case 'success': $Class = 'success'; $Prefix = $Prefix ? $Prefix : _('SUCCESS') . ' ' . _('Report'); if (isset($_SESSION['LogSeverity']) and $_SESSION['LogSeverity']>3) { - fwrite($LogFile, date('Y-m-d H:i:s').','.$Type.','.$_SESSION['UserID'].','.trim($Msg,',')."\n"); + fwrite($LogFile, date('Y-m-d H:i:s').','.$Type.','.$_SESSION['UserID'].','.trim(str_replace("<br />", " ", $Msg),',')."\n"); } break; case 'info': @@ -50,7 +50,7 @@ $Prefix = $Prefix ? $Prefix : _('INFORMATION') . ' ' ._('Message'); $Class = 'info'; if (isset($_SESSION['LogSeverity']) and $_SESSION['LogSeverity']>2) { - fwrite($LogFile, date('Y-m-d H:i:s').','.$Type.','.$_SESSION['UserID'].','.trim($Msg,',')."\n"); + fwrite($LogFile, date('Y-m-d H:i:s').','.$Type.','.$_SESSION['UserID'].','.trim(str_replace("<br />", " ", $Msg),',')."\n"); } } return '<div class="'.$Class.'"><b>' . $Prefix . '</b> : ' .$Msg . '</div>'; |
From: <rc...@us...> - 2013-07-22 14:17:00
|
Revision: 6136 http://sourceforge.net/p/web-erp/reponame/6136 Author: rchacon Date: 2013-07-22 14:16:56 +0000 (Mon, 22 Jul 2013) Log Message: ----------- Adds currency name. Modified Paths: -------------- trunk/includes/PDFTransPageHeader.inc trunk/includes/PDFTransPageHeaderPortrait.inc Modified: trunk/includes/PDFTransPageHeader.inc =================================================================== --- trunk/includes/PDFTransPageHeader.inc 2013-07-22 14:03:03 UTC (rev 6135) +++ trunk/includes/PDFTransPageHeader.inc 2013-07-22 14:16:56 UTC (rev 6136) @@ -155,7 +155,8 @@ $XPos = $Left_Margin; $YPos -= ($line_height*2); -$pdf->addText($Left_Margin, $YPos-8, $FontSize, _('All amounts stated in') . ' - ' . $myrow['currcode']); +include($PathPrefix . 'includes/CurrenciesArray.php'); // To get the currency name +$pdf->addText($Left_Margin, $YPos-8, $FontSize, _('All amounts stated in') . ': ' . $myrow['currcode'] . ' ' . $CurrenciesArray[$myrow['currcode']]['Currency']); /*draw a box with nice round corner for entering line items */ /*90 degree arc at top right of box 0 degrees starts a bottom */ Modified: trunk/includes/PDFTransPageHeaderPortrait.inc =================================================================== --- trunk/includes/PDFTransPageHeaderPortrait.inc 2013-07-22 14:03:03 UTC (rev 6135) +++ trunk/includes/PDFTransPageHeaderPortrait.inc 2013-07-22 14:16:56 UTC (rev 6136) @@ -207,7 +207,7 @@ $FontSize = 8; include($PathPrefix . 'includes/CurrenciesArray.php'); // To get the currency name -$pdf->addText($XPos, $YPos-8, $FontSize, _('All amounts stated in') . ': ' . $myrow['currcode'] . ' ' . $CurrenciesArray[$myrow['currcode']]['Currency']); +$pdf->addText($Left_Margin, $YPos-8, $FontSize, _('All amounts stated in') . ': ' . $myrow['currcode'] . ' ' . $CurrenciesArray[$myrow['currcode']]['Currency']); $BoxHeight = $Page_Height-282; |
From: <rc...@us...> - 2013-07-22 17:47:02
|
Revision: 6138 http://sourceforge.net/p/web-erp/reponame/6138 Author: rchacon Date: 2013-07-22 17:46:59 +0000 (Mon, 22 Jul 2013) Log Message: ----------- Relative alignment of the upper-right-corner data (quotation number, quotation date, quotation page and customer reference). Modified Paths: -------------- trunk/includes/PDFQuotationPageHeader.inc trunk/includes/PDFQuotationPortraitPageHeader.inc Modified: trunk/includes/PDFQuotationPageHeader.inc =================================================================== --- trunk/includes/PDFQuotationPageHeader.inc 2013-07-22 16:45:04 UTC (rev 6137) +++ trunk/includes/PDFQuotationPageHeader.inc 2013-07-22 17:46:59 UTC (rev 6138) @@ -84,18 +84,14 @@ /*Finally join up to the top right corner where started */ $pdf->line($XPos+235, $YPos,$XPos+235, $YPos+60); +$pdf->addTextWrap($Page_Width-$Right_Margin-200, $Page_Height-$Top_Margin-$FontSize*1, 200, $FontSize, _('Number'). ': '.$_GET['QuotationNo'], 'right'); +$pdf->addTextWrap($Page_Width-$Right_Margin-200, $Page_Height-$Top_Margin-$FontSize*2, 200, $FontSize, _('Your Ref'). ': '.$myrow['customerref'], 'right'); +$pdf->addTextWrap($Page_Width-$Right_Margin-200, $Page_Height-$Top_Margin-$FontSize*3, 200, $FontSize, _('Date'). ': '.ConvertSQLDate($myrow['orddate']), 'right'); +$pdf->addTextWrap($Page_Width-$Right_Margin-200, $Page_Height-$Top_Margin-$FontSize*4, 200, $FontSize, _('Page').': '.$PageNumber, 'right'); + include($PathPrefix . 'includes/CurrenciesArray.php'); /* To get the currency name */ $pdf->addText($Page_Width/2-60, $YPos-5, $FontSize, _('All amounts stated in') . ' - ' . $myrow['currcode'] . ' ' . $CurrenciesArray[$myrow['currcode']]['Currency']); -$pdf->addText(620, 560,$FontSize, _('Number'). ':'); -$pdf->addText(700, 560,$FontSize, $_GET['QuotationNo']); -$pdf->addText(620, 560-15,$FontSize, _('Your Ref'). ':'); -$pdf->addText(700, 560-15,$FontSize, $myrow['customerref']); -$pdf->addText(620, 560-30,$FontSize, _('Date'). ':'); -$pdf->addText(700, 560-30,$FontSize, ConvertSQLDate($myrow['orddate'])); -$pdf->addText(620, 560-45,$FontSize, _('Page'). ':'); -$pdf->addText(700, 560-45,$FontSize, $PageNumber); - $YPos -= 37; $XPos = 40; Modified: trunk/includes/PDFQuotationPortraitPageHeader.inc =================================================================== --- trunk/includes/PDFQuotationPortraitPageHeader.inc 2013-07-22 16:45:04 UTC (rev 6137) +++ trunk/includes/PDFQuotationPortraitPageHeader.inc 2013-07-22 17:46:59 UTC (rev 6138) @@ -83,15 +83,19 @@ /*Finally join up to the top right corner where started */ $pdf->line($XPos+210, $YPos,$XPos+210, $YPos+60); +$pdf->addTextWrap($Page_Width-$Right_Margin-200, $Page_Height-$Top_Margin-$FontSize*1, 200, $FontSize, _('Number'). ': '.$_GET['QuotationNo'], 'right'); +$pdf->addTextWrap($Page_Width-$Right_Margin-200, $Page_Height-$Top_Margin-$FontSize*2, 200, $FontSize, _('Your Ref'). ': '.$myrow['customerref'], 'right'); +$pdf->addTextWrap($Page_Width-$Right_Margin-200, $Page_Height-$Top_Margin-$FontSize*3, 200, $FontSize, _('Date'). ': '.ConvertSQLDate($myrow['orddate']), 'right'); +$pdf->addTextWrap($Page_Width-$Right_Margin-200, $Page_Height-$Top_Margin-$FontSize*4, 200, $FontSize, _('Page').': '.$PageNumber, 'right'); -$pdf->addText(490, 790,$FontSize, _('Number'). ':'); +/*$pdf->addText(490, 790,$FontSize, _('Number'). ':'); $pdf->addText(535, 790,$FontSize, $_GET['QuotationNo']); $pdf->addText(490, 790-15,$FontSize, _('Your Ref'). ':'); $pdf->addText(520, 790-15,$FontSize, $myrow['customerref']); $pdf->addText(490, 790-30,$FontSize, _('Date'). ':'); $pdf->addText(520, 790-30,$FontSize, ConvertSQLDate($myrow['orddate'])); $pdf->addText(490, 790-45,$FontSize, _('Page'). ':'); -$pdf->addText(520, 790-45,$FontSize, $PageNumber); +$pdf->addText(520, 790-45,$FontSize, $PageNumber);*/ $pdf->addText($Page_Width/2-10, $YPos+15, $FontSize, _('All amounts stated in') . ' - ' . $myrow['currcode']); |
From: <ice...@us...> - 2013-08-06 07:08:52
|
Revision: 6185 http://sourceforge.net/p/web-erp/reponame/6185 Author: icedlava Date: 2013-08-06 07:08:49 +0000 (Tue, 06 Aug 2013) Log Message: ----------- Cleanup login and db connect for new configuration settings and highlight backward compat code that can be removed at later point. Modified Paths: -------------- trunk/includes/ConnectDB.inc trunk/includes/Login.php Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2013-08-06 07:06:19 UTC (rev 6184) +++ trunk/includes/ConnectDB.inc 2013-08-06 07:08:49 UTC (rev 6185) @@ -11,7 +11,7 @@ if (isset($_POST['CompanyNameField'])){ if (isset($CompanyList) && is_array($CompanyList)) { foreach ($CompanyList as $key => $CompanyEntry){ - if (is_dir('./companies/'.strtolower($CompanyEntry['database']).'') && ($key == $_POST['CompanyNameField']) ){ + if (is_dir('./companies/'.strtolower($CompanyEntry['database']).'') && ($key == $_POST['CompanyNameField']) && ($DefaultDatabase == $CompanyEntry['database'])) { $_SESSION['DatabaseName'] = $CompanyEntry['database']; $_SESSION['CompanyName'] = $CompanyEntry['company']; include_once ($PathPrefix . 'includes/ConnectDB_' . $DBType . '.inc'); @@ -27,7 +27,9 @@ echo '<br /><a href="index.php">' . _('Back to login page') . '</a>'; exit; } - } else { //provision for old setup + } + //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>'; @@ -42,15 +44,16 @@ 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'); } - } + } // end provision for old setup } 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/Login.php =================================================================== --- trunk/includes/Login.php 2013-08-06 07:06:19 UTC (rev 6184) +++ trunk/includes/Login.php 2013-08-06 07:08:49 UTC (rev 6185) @@ -11,7 +11,6 @@ echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'; ?> - <html> <head> <title>webERP Login screen</title> @@ -38,17 +37,24 @@ <input type="hidden" name="FormID" value="<?php echo $_SESSION['FormID']; ?>" /> <span> <?php - if ($AllowCompanySelectionBox === 'Hide'){ - // do not show input or selection box - echo '<input type="hidden" name="CompanyNameField" value="' . $DefaultCompany . '" />'; - } else if ($AllowCompanySelectionBox === 'ShowInputBox'){ - // show input box - echo _('Company') . '<input type="text" name="CompanyNameField" autofocus="autofocus" required="required" value="' . $DefaultCompany . '" />'; - } else { - // Show selection box ($AllowCompanySelectionBox == 'ShowSelectionBox') - echo _('Company:').'<br />'; - echo '<select name="CompanyNameField">'; - if (isset($CompanyList) && is_array($CompanyList)) { + if (isset($CompanyList) && is_array($CompanyList)) { + foreach ($CompanyList as $key => $CompanyEntry){ + if ($DefaultDatabase == $CompanyEntry['database']) { + $CompanyNameField = "$key"; + $DefaultCompany = $CompanyEntry['company']; + } + } + if ($AllowCompanySelectionBox === 'Hide'){ + // do not show input or selection box + echo '<input type="hidden" name="CompanyNameField" value="' . $CompanyNameField . '" />'; + } elseif ($AllowCompanySelectionBox === 'ShowInputBox'){ + // show input box + echo _('Company') .': <br />'. '<input type="text" name="DefaultCompany" autofocus="autofocus" required="required" value="' . htmlspecialchars($DefaultCompany ,ENT_QUOTES,'UTF-8') . '" disabled="disabled"/>';//use disabled input for display consistency + echo '<input type="hidden" name="CompanyNameField" value="' . $CompanyNameField . '" />'; + } else { + // Show selection box ($AllowCompanySelectionBox == 'ShowSelectionBox') + echo _('Company:').'<br />'; + echo '<select name="CompanyNameField">'; foreach ($CompanyList as $key => $CompanyEntry){ if (is_dir('companies/' . $CompanyEntry['database']) ){ if ($CompanyEntry['database'] == $DefaultDatabase) { @@ -58,20 +64,33 @@ } } } - } else { //provision for backward compat - $Companies = scandir('companies/', 0); + echo '</select>'; + } + } + else { //provision for backward compat - remove when we have a reliable upgrade for config.php + if ($AllowCompanySelectionBox === 'Hide'){ + // do not show input or selection box + echo '<input type="hidden" name="CompanyNameField" value="' . $DefaultCompany . '" />'; + } else if ($AllowCompanySelectionBox === 'ShowInputBox'){ + // show input box + echo _('Company') . '<input type="text" name="CompanyNameField" autofocus="autofocus" required="required" value="' . $DefaultCompany . '" />'; + } else { + // Show selection box ($AllowCompanySelectionBox == 'ShowSelectionBox') + echo _('Company:').'<br />'; + echo '<select name="CompanyNameField">'; + $Companies = scandir('companies/', 0); foreach ($Companies as $CompanyEntry){ - if (is_dir('companies/' . $CompanyEntry) AND $CompanyEntry != '..' AND $CompanyEntry != '' AND $CompanyEntry!='.svn' AND $CompanyEntry!='.'){ - if ($CompanyEntry==$DefaultDatabase) { - echo '<option selected="selected" label="'.$CompanyEntry.'" value="'.$CompanyEntry.'">'.$CompanyEntry.'</option>'; - } else { - echo '<option label="'.$CompanyEntry.'" value="'.$CompanyEntry.'">'.$CompanyEntry.'</option>'; - } - } - } + if (is_dir('companies/' . $CompanyEntry) AND $CompanyEntry != '..' AND $CompanyEntry != '' AND $CompanyEntry!='.svn' AND $CompanyEntry!='.'){ + if ($CompanyEntry==$DefaultDatabase) { + echo '<option selected="selected" label="'.$CompanyEntry.'" value="'.$CompanyEntry.'">'.$CompanyEntry.'</option>'; + } else { + echo '<option label="'.$CompanyEntry.'" value="'.$CompanyEntry.'">'.$CompanyEntry.'</option>'; + } + } + } + echo '</select>'; } - echo '</select>'; - } + } //end provision for backward compat ?> </span> <br /> @@ -94,4 +113,4 @@ <div style="text-align:center"><a href="https://sourceforge.net/projects/web-erp"><img src="https://sflogo.sourceforge.net/sflogo.php?group_id=70949&type=8" width="80" height="15" alt="Get webERP Accounting & Business Management at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a></div> </div> </body> -</html> \ No newline at end of file +</html> |
From: <ex...@us...> - 2013-12-23 06:46:50
|
Revision: 6512 http://sourceforge.net/p/web-erp/reponame/6512 Author: exsonqu Date: 2013-12-23 06:46:46 +0000 (Mon, 23 Dec 2013) Log Message: ----------- 23/12/13 Exson: Fixed the controlled items cannot be removed due to the negative operator is modified and balance of a serial no is wrong due negative operator is missing during credit controlled items by KEYED method. Other input method has not be inspected. Modified Paths: -------------- trunk/includes/Add_SerialItems.php trunk/includes/InputSerialItemsExisting.php Modified: trunk/includes/Add_SerialItems.php =================================================================== --- trunk/includes/Add_SerialItems.php 2013-12-23 02:11:30 UTC (rev 6511) +++ trunk/includes/Add_SerialItems.php 2013-12-23 06:46:46 UTC (rev 6512) @@ -37,8 +37,8 @@ $AddThisBundle = true; } } - if ($AddThisBundle==true){ - $LineItem->SerialItems[$_POST['SerialNo' . $i]] = new SerialItem ($_POST['SerialNo' . $i], ($InOutModifier>0?1:-1) * filter_number_format($_POST['Qty' . $i])); + if ($AddThisBundle==true){//the $InOutModifier should not appeared here. Otherwise, the users cannot remove the quantity but add it. + $LineItem->SerialItems[$_POST['SerialNo' . $i]] = new SerialItem ($_POST['SerialNo' . $i], ($InOutModifier>0?1:1) * filter_number_format($_POST['Qty' . $i])); } } /*end if ExistingBundleQty >0 */ else { @@ -345,4 +345,4 @@ if (isset($_GET['Delete'])){ unset($LineItem->SerialItems[$_GET['Delete']]); } -?> \ No newline at end of file +?> Modified: trunk/includes/InputSerialItemsExisting.php =================================================================== --- trunk/includes/InputSerialItemsExisting.php 2013-12-23 02:11:30 UTC (rev 6511) +++ trunk/includes/InputSerialItemsExisting.php 2013-12-23 06:46:46 UTC (rev 6512) @@ -45,10 +45,11 @@ $ItemsAvailable++; } } else { + if ( !array_key_exists($myrow['serialno'], $AllSerials) OR ($myrow['quantity'] - $AllSerials[$myrow['serialno']] >= 0) ) { - - $RecvQty = $myrow['quantity'] - $AllSerials[$myrow['serialno']]; + //Use the $InOutModifier to ajust the negative or postive direction of the quantity. Otherwise the calculated quantity is wrong. + $RecvQty = $myrow['quantity'] - $InOutModifier*$AllSerials[$myrow['serialno']]; echo '<option value="' . $myrow['serialno'] . '/|/'. $RecvQty .'">' . $myrow['serialno'].' - ' . _('Qty left'). ': ' . $RecvQty . '</option>'; $ItemsAvailable += $RecvQty; } @@ -65,4 +66,4 @@ echo '<td>' . prnMsg( _('There does not appear to be any of') . ' ' . $StockID . ' ' . _('left in'). ' '. $LocationOut , 'warn') . '</td>'; } echo '</tr></table>'; -} \ No newline at end of file +} |
From: <ex...@us...> - 2014-03-28 11:26:44
|
Revision: 6647 http://sourceforge.net/p/web-erp/reponame/6647 Author: exsonqu Date: 2014-03-28 11:26:41 +0000 (Fri, 28 Mar 2014) Log Message: ----------- 28/03/14 Exson: Fixed the Expiry Date not handled right during stocks adjustments by manual key in or bar code scan in Add_SerialItems.php, DefineSerialItems.php,InputSerialItems.php and InputSerialItemsKeyed.php. Modified Paths: -------------- trunk/includes/Add_SerialItems.php trunk/includes/DefineSerialItems.php trunk/includes/InputSerialItems.php trunk/includes/InputSerialItemsKeyed.php Modified: trunk/includes/Add_SerialItems.php =================================================================== --- trunk/includes/Add_SerialItems.php 2014-03-28 10:34:13 UTC (rev 6646) +++ trunk/includes/Add_SerialItems.php 2014-03-28 11:26:41 UTC (rev 6647) @@ -38,7 +38,13 @@ } } if ($AddThisBundle==true){//the $InOutModifier should not appeared here. Otherwise, the users cannot remove the quantity but add it. - $LineItem->SerialItems[$_POST['SerialNo' . $i]] = new SerialItem ($_POST['SerialNo' . $i], ($InOutModifier>0?1:1) * filter_number_format($_POST['Qty' . $i])); + if ($Perishable != 1){ + $LineItem->SerialItems[$_POST['SerialNo' . $i]] = new SerialItem ($_POST['SerialNo' . $i], ($InOutModifier>0?1:1) * filter_number_format($_POST['Qty' . $i])); + } else { + + $ExpiryDate = GetExpiryDate($StockID,$LocationOut, $_POST['SerialNo' . $i]); + $LineItem->SerialItems[$_POST['SerialNo' . $i]] = new SerialItem ($_POST['SerialNo' . $i], filter_number_format($_POST['Qty'.$i]),$ExpiryDate); + } } } /*end if ExistingBundleQty >0 */ else { @@ -73,7 +79,9 @@ $LineItem->SerialItems[$NewSerialNo] = new SerialItem ($_POST['SerialNo' . $i], $NewQty, $ExpiryDate); } } + } /* end if posted Serialno . i is not blank */ + } /* end of the loop aroung the form input fields */ if (!isset($_POST['Bundles'])) { @@ -81,13 +89,31 @@ } //echo count($_POST['Bundles']); for ($i=0;$i < count($_POST['Bundles']) AND $_POST['Bundles']!=0;$i++){ /*there is an entry in the multi select list box */ + if ($LineItem->Serialised==1){ /*only if the item is serialised */ - $LineItem->SerialItems[$_POST['Bundles'][$i]] = new SerialItem ($_POST['Bundles'][$i], ($InOutModifier>0 ? 1:-1) ); + if ($Perishable != 1){ + + $LineItem->SerialItems[$_POST['Bundles'][$i]] = new SerialItem ($_POST['Bundles'][$i], ($InOutModifier>0 ? 1:-1) ); + } else { + + $ExpiryDate = GetExpiryDate($StockID,$LocationOut,$_POST['Bundles'][$i]); + $LineItem->SerialItems[$_POST['Bundles'][$i]] = new SerialItem ($_POST['Bundles'][$i], ($InOutModifier>0 ? 1:-1),$ExpiryDate ); + } + } else { list($SerialNo, $Qty) = explode ('/|/', $_POST['Bundles'][$i]); if ($Qty != 0) { + if ($Perishable != 1){ + $LineItem->SerialItems[$SerialNo] = new SerialItem ($SerialNo, $Qty*($InOutModifier>0?1:-1) ); + } else { + + $ExpiryDate = GetExpiryDate($StockID,$LocationOut,$SerialNo); + + $LineItem->SerialItems[$SerialNo] = new SerialItem ($SerialNo, $Qty*($InOutModifier>0 ? 1:-1),$ExpiryDate ); + } + } } } Modified: trunk/includes/DefineSerialItems.php =================================================================== --- trunk/includes/DefineSerialItems.php 2014-03-28 10:34:13 UTC (rev 6646) +++ trunk/includes/DefineSerialItems.php 2014-03-28 11:26:41 UTC (rev 6647) @@ -17,7 +17,22 @@ return $myrow[0]; /*The quantity in the bundle */ } } +function GetExpiryDate ($StockID, $LocCode, $BundleRef){ + global $db; + $SQL = "SELECT expirationdate + FROM stockserialitems + WHERE stockid = '" . $StockID . "' + AND loccode = '" . $LocCode . "' + AND serialno = '" . $BundleRef . "'"; + $Result = DB_query($SQL,$db); + if (DB_num_rows($Result)==0){ + return '0000-00-00'; + } else { + $myrow = DB_fetch_row($Result); + return ConvertSQLDate($myrow[0]); + } +} class SerialItem { var $BundleRef; Modified: trunk/includes/InputSerialItems.php =================================================================== --- trunk/includes/InputSerialItems.php 2014-03-28 10:34:13 UTC (rev 6646) +++ trunk/includes/InputSerialItems.php 2014-03-28 11:26:41 UTC (rev 6647) @@ -8,7 +8,13 @@ - StockTransfers.php - CreditItemsControlled.php */ - +//bring up perishable variable here otherwise we cannot get it in Add_SerialItems.php +$sql="SELECT perishable + FROM stockmaster + WHERE stockid='".$StockID."'"; +$result=DB_query($sql, $db); +$myrow=DB_fetch_array($result); +$Perishable=$myrow['perishable']; include ('includes/Add_SerialItems.php'); /*Setup the Data Entry Types */ @@ -105,12 +111,7 @@ <br /> </div>'; -$sql="SELECT perishable - FROM stockmaster - WHERE stockid='".$StockID."'"; -$result=DB_query($sql, $db); -$myrow=DB_fetch_array($result); -$Perishable=$myrow['perishable']; + if ($LineItem->Serialised==1){ if ($Perishable==0) { $TableHeader .= '<tr> Modified: trunk/includes/InputSerialItemsKeyed.php =================================================================== --- trunk/includes/InputSerialItemsKeyed.php 2014-03-28 10:34:13 UTC (rev 6646) +++ trunk/includes/InputSerialItemsKeyed.php 2014-03-28 11:26:41 UTC (rev 6647) @@ -116,7 +116,7 @@ if ($LineItem->Serialised==1){ echo '<input type="hidden" name="Qty' . $StartAddingAt .'" value="1" /></TR>'; } else if ($LineItem->Serialised==0 and $Perishable==1) { - echo '<td><input type="text" class="number" name="Qty' . $StartAddingAt .'" size="11" value="'. locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces). '" maxlength="10" /></tr>'; + echo '<td><input type="text" class="number" name="Qty' . $StartAddingAt .'" size="11" value="'. locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces). '" maxlength="10" /></td><td><input type="text" name="ExpiryDate' . $StartAddingAt . '" size="11" value="' . $Bundle->ExpiryDate . '" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength="10" /></td></tr>'; } else { echo '<td><input type="text" class="number" name="Qty' . $StartAddingAt .'" size="11" value="'. locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces). '" maxlength="10" /></tr>'; } @@ -172,4 +172,4 @@ document.Ga6uF5Wa.SerialNo0.focus(); //]]> </script>'; /*end of nested table */ -?> +?> \ No newline at end of file |
From: <rc...@us...> - 2014-08-16 05:13:44
|
Revision: 6824 http://sourceforge.net/p/web-erp/reponame/6824 Author: rchacon Date: 2014-08-16 05:13:40 +0000 (Sat, 16 Aug 2014) Log Message: ----------- Changes to uniform code between PDFQuotation.php and PDFQuotationPortrait.php. Modified Paths: -------------- trunk/includes/PDFQuotationPageHeader.inc trunk/includes/PDFQuotationPortraitPageHeader.inc Modified: trunk/includes/PDFQuotationPageHeader.inc =================================================================== --- trunk/includes/PDFQuotationPageHeader.inc 2014-08-16 02:26:37 UTC (rev 6823) +++ trunk/includes/PDFQuotationPageHeader.inc 2014-08-16 05:13:40 UTC (rev 6824) @@ -11,31 +11,36 @@ $pdf->newPage(); } -// Print 'Quotation' title -$pdf->addText(361, 500, 18, _('Quotation')); +// Prints company logo: +$pdf->addJpegFromFile($_SESSION['LogoFile'], 301, 520, 0, 60); -// Print 'Quotation' info +// Prints 'Quotation' title: +$pdf->addTextWrap(0, $Page_Height-$Top_Margin-18, $Page_Width, 18, _('Quotation'), 'center'); + +// Prints quotation info: $pdf->addTextWrap($Page_Width-$Right_Margin-200, $Page_Height-$Top_Margin-$FontSize*1, 200, $FontSize, _('Number'). ': '.$_GET['QuotationNo'], 'right'); $pdf->addTextWrap($Page_Width-$Right_Margin-200, $Page_Height-$Top_Margin-$FontSize*2, 200, $FontSize, _('Your Ref'). ': '.$myrow['customerref'], 'right'); $pdf->addTextWrap($Page_Width-$Right_Margin-200, $Page_Height-$Top_Margin-$FontSize*3, 200, $FontSize, _('Date'). ': '.ConvertSQLDate($myrow['quotedate']), 'right'); $pdf->addTextWrap($Page_Width-$Right_Margin-200, $Page_Height-$Top_Margin-$FontSize*4, 200, $FontSize, _('Page').': '.$PageNumber, 'right'); -// Print company logo -$pdf->addJpegFromFile($_SESSION['LogoFile'], 301, 520, 0, 60); - -// Print company info -$XPos = 361; -$YPos = 482; -$FontSize=14; +// Prints company info: +$XPos = $Page_Width/2+$Left_Margin; +$YPos = 512; +$FontSize = 14; $pdf->addText($XPos, $YPos, $FontSize, $_SESSION['CompanyRecord']['coyname']); -$FontSize =10; -$pdf->addText($XPos, $YPos-12, $FontSize, $_SESSION['CompanyRecord']['regoffice1']); -$pdf->addText($XPos, $YPos-21, $FontSize, $_SESSION['CompanyRecord']['regoffice2']); -$pdf->addText($XPos, $YPos-30, $FontSize, $_SESSION['CompanyRecord']['regoffice3'] . ' ' . $_SESSION['CompanyRecord']['regoffice4'] . ' ' . $_SESSION['CompanyRecord']['regoffice5']); -$pdf->addText($XPos, $YPos-39, $FontSize, _('Ph') . ': ' . $_SESSION['CompanyRecord']['telephone'] . ' ' . _('Fax'). ': ' . $_SESSION['CompanyRecord']['fax']); -$pdf->addText($XPos, $YPos-48, $FontSize, $_SESSION['CompanyRecord']['email']); +$YPos -= $FontSize; +$FontSize = 10; +$pdf->addText($XPos, $YPos, $FontSize, $_SESSION['CompanyRecord']['regoffice1']); +$pdf->addText($XPos, $YPos-$FontSize*1, $FontSize, $_SESSION['CompanyRecord']['regoffice2']); +$pdf->addText($XPos, $YPos-$FontSize*2, $FontSize, $_SESSION['CompanyRecord']['regoffice3']); +$pdf->addText($XPos, $YPos-$FontSize*3, $FontSize, $_SESSION['CompanyRecord']['regoffice4']); +$pdf->addText($XPos, $YPos-$FontSize*4, $FontSize, $_SESSION['CompanyRecord']['regoffice5'] . + ' ' . $_SESSION['CompanyRecord']['regoffice6']); +$pdf->addText($XPos, $YPos-$FontSize*5, $FontSize, _('Ph') . ': ' . $_SESSION['CompanyRecord']['telephone'] . + ' ' . _('Fax'). ': ' . $_SESSION['CompanyRecord']['fax']); +$pdf->addText($XPos, $YPos-$FontSize*6, $FontSize, $_SESSION['CompanyRecord']['email']); -// Print 'Delivery To' info +// Prints 'Delivery To' info: $XPos = 46; $YPos = 566; $FontSize=14; @@ -46,7 +51,7 @@ $pdf->addText($XPos, $YPos-45, $FontSize, $myrow['deladd2']); $pdf->addText($XPos, $YPos-60, $FontSize, $myrow['deladd3'] . ' ' . $myrow['deladd4'] . ' ' . $myrow['deladd5']); -// Print 'Quotation For' info +// Prints 'Quotation For' info: $YPos -= 80; $pdf->addText($XPos, $YPos, $FontSize, _('Quotation For').':'); $pdf->addText($XPos, $YPos-15, $FontSize, $myrow['name']); @@ -54,30 +59,42 @@ $pdf->addText($XPos, $YPos-45, $FontSize, $myrow['address2']); $pdf->addText($XPos, $YPos-60, $FontSize, $myrow['address3'] . ' ' . $myrow['address4'] . ' ' . $myrow['address5']); -// Draw a rectangle with rounded corners around 'Delivery To' info +// Draws a box with round corners around 'Delivery To' info: $XPos= 50; $YPos += 12; -$pdf->RoundRectangle($XPos-10, $YPos+60+10, 225+10+10, 60+10+10, 10, 10);// Function RoundRectangle from includes/class.pdf.php +$pdf->RoundRectangle( + $XPos-10,// RoundRectangle $XPos. + $YPos+70,// RoundRectangle $YPos. + 245,// RoundRectangle $Width.225+10+10 + 80,// RoundRectangle $Height.60+10+10 + 10,// RoundRectangle $RadiusX. + 10);// RoundRectangle $RadiusY. -// Draw a rectangle with rounded corners around 'Quotation For' info +// Draws a box with round corners around around 'Quotation For' info: $YPos -= 82; -$pdf->RoundRectangle($XPos-10, $YPos+60+10, 225+10+10, 60+10+10, 10, 10);// Function RoundRectangle from includes/class.pdf.php +$pdf->RoundRectangle( + $XPos-10,// RoundRectangle $XPos. + $YPos+70,// RoundRectangle $YPos. + 245,// RoundRectangle $Width.225+10+10 + 80,// RoundRectangle $Height.60+10+10 + 10,// RoundRectangle $RadiusX. + 10);// RoundRectangle $RadiusY. $FontSize=10; // Prints the currency name: require_once('includes/CurrenciesArray.php');// To get the currency name from the currency code. -$pdf->addText($Page_Width/2-60, $YPos-5, $FontSize, +$pdf->addText($Page_Width/2+$Left_Margin, $YPos-5, $FontSize, _('All amounts stated in') . ' ' . $myrow['currcode'] . ' - ' . $CurrencyName[$myrow['currcode']]); // Prints table header: $XPos = 40; $YPos -= 37; -$LeftOvers = $pdf->addTextWrap( 42, $YPos,103, $FontSize, _('Item Code'),'left'); +$LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos,103, $FontSize, _('Item Code')); if (strlen($LeftOvers) > 0) { // If translated text is greater than 103, prints remainder - $LeftOvers = $pdf->addTextWrap(585,$YPos-$FontSize,65, $FontSize, $LeftOvers,'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos-$FontSize, 65, $FontSize, $LeftOvers); } -$LeftOvers = $pdf->addTextWrap(145, $YPos,250, $FontSize, _('Item Description'),'left'); +$LeftOvers = $pdf->addTextWrap(145, $YPos,250, $FontSize, _('Item Description')); $LeftOvers = $pdf->addTextWrap(420, $YPos, 85, $FontSize, _('Quantity'),'right'); $LeftOvers = $pdf->addTextWrap(485, $YPos, 85, $FontSize, _('Price'),'right'); $LeftOvers = $pdf->addTextWrap(535, $YPos, 85, $FontSize, _('Discount'),'right'); Modified: trunk/includes/PDFQuotationPortraitPageHeader.inc =================================================================== --- trunk/includes/PDFQuotationPortraitPageHeader.inc 2014-08-16 02:26:37 UTC (rev 6823) +++ trunk/includes/PDFQuotationPortraitPageHeader.inc 2014-08-16 05:13:40 UTC (rev 6824) @@ -1,5 +1,5 @@ <?php -/* $Id: PDFQuotationPortraitPageHeader.inc 4491 2011-02-15 06:31:08Z daintree $ */ +/* $Id: PDFQuotationPortraitPageHeader.inc 6822 2014-08-15 20:24:57Z rchacon $*/ /* Please note that addTextWrap prints a font-size-height further down than addText and other functions.*/ @@ -10,27 +10,33 @@ $pdf->newPage(); } +// Prints company logo: $XPos = $Page_Width/2 - 140; $pdf->addJpegFromFile($_SESSION['LogoFile'],$XPos+90,720,0,60); -$XPos = $XPos + 130; +// Prints 'Quotation' title: +$pdf->addTextWrap(0, $Page_Height-$Top_Margin-18, $Page_Width, 18, _('Quotation'), 'center'); -$FontSize=18; -$pdf->addText($XPos,820,$FontSize, _('Quotation')); -$FontSize=12; +// Prints company info: +$XPos = $Page_Width/2+$Left_Margin; $YPos = 720; -$pdf->addText($XPos, $YPos,$FontSize, $_SESSION['CompanyRecord']['coyname']); -$FontSize =10; -$pdf->addText($XPos, $YPos-12,$FontSize, $_SESSION['CompanyRecord']['regoffice1']); -$pdf->addText($XPos, $YPos-21,$FontSize, $_SESSION['CompanyRecord']['regoffice2']); -$pdf->addText($XPos, $YPos-30,$FontSize, $_SESSION['CompanyRecord']['regoffice3'] . ' ' . $_SESSION['CompanyRecord']['regoffice4'] . ' ' . $_SESSION['CompanyRecord']['regoffice5']); -$pdf->addText($XPos, $YPos-39,$FontSize, _('Ph') . ': ' . $_SESSION['CompanyRecord']['telephone'] . ' ' . _('Fax'). ': ' . $_SESSION['CompanyRecord']['fax']); -$pdf->addText($XPos, $YPos-48,$FontSize, $_SESSION['CompanyRecord']['email']); +$FontSize = 12; +$pdf->addText($XPos, $YPos, $FontSize, $_SESSION['CompanyRecord']['coyname']); +$YPos -= $FontSize; +$FontSize = 10; +$pdf->addText($XPos, $YPos, $FontSize, $_SESSION['CompanyRecord']['regoffice1']); +$pdf->addText($XPos, $YPos-$FontSize*1, $FontSize, $_SESSION['CompanyRecord']['regoffice2']); +$pdf->addText($XPos, $YPos-$FontSize*2, $FontSize, $_SESSION['CompanyRecord']['regoffice3']); +$pdf->addText($XPos, $YPos-$FontSize*3, $FontSize, $_SESSION['CompanyRecord']['regoffice4']); +$pdf->addText($XPos, $YPos-$FontSize*4, $FontSize, $_SESSION['CompanyRecord']['regoffice5'] . + ' ' . $_SESSION['CompanyRecord']['regoffice6']); +$pdf->addText($XPos, $YPos-$FontSize*5, $FontSize, _('Ph') . ': ' . $_SESSION['CompanyRecord']['telephone'] . + ' ' . _('Fax'). ': ' . $_SESSION['CompanyRecord']['fax']); +$pdf->addText($XPos, $YPos-$FontSize*6, $FontSize, $_SESSION['CompanyRecord']['email']); - +// Prints 'Delivery To' info: $XPos = 46; $YPos = 770; - $FontSize=12; $myrow = array_map(html_entity_decode, $myrow); $pdf->addText($XPos, $YPos+10,$FontSize, _('Delivery To').':' ); @@ -39,55 +45,36 @@ $pdf->addText($XPos, $YPos-30,$FontSize, $myrow['deladd2']); $pdf->addText($XPos, $YPos-45,$FontSize, $myrow['deladd3'] . ' ' . $myrow['deladd4'] . ' ' . $myrow['deladd5']); +// Prints 'Quotation For' info: $YPos -= 80; - $pdf->addText($XPos, $YPos,$FontSize, _('Quotation For').':'); $pdf->addText($XPos, $YPos-15,$FontSize, $myrow['name']); $pdf->addText($XPos, $YPos-30,$FontSize, $myrow['address1']); $pdf->addText($XPos, $YPos-45,$FontSize, $myrow['address2']); $pdf->addText($XPos, $YPos-60,$FontSize, $myrow['address3'] . ' ' . $myrow['address4'] . ' ' . $myrow['address5']); - -$XPos= 50; +// Draws a box with round corners around 'Delivery To' info: +$XPos = 50; $YPos += 25; -/*draw a nice curved corner box around the delivery details */ -/*from the top right */ -$pdf->partEllipse($XPos+200,$YPos+60,0,90,10,10); -/*line to the top left */ -$pdf->line($XPos+200, $YPos+70,$XPos, $YPos+70); -/*Dow top left corner */ -$pdf->partEllipse($XPos, $YPos+60,90,180,10,10); -/*Do a line to the bottom left corner */ -$pdf->line($XPos-10, $YPos+60,$XPos-10, $YPos); -/*Now do the bottom left corner 180 - 270 coming back west*/ -$pdf->partEllipse($XPos, $YPos,180,270,10,10); -/*Now a line to the bottom right */ -$pdf->line($XPos, $YPos-10,$XPos+200, $YPos-10); -/*Now do the bottom right corner */ -$pdf->partEllipse($XPos+200, $YPos,270,360,10,10); -/*Finally join up to the top right corner where started */ -$pdf->line($XPos+210, $YPos,$XPos+210, $YPos+60); +$pdf->RoundRectangle( + $XPos-10,// RoundRectangle $XPos. + $YPos+60+10,// RoundRectangle $YPos. + 200+10+10,// RoundRectangle $Width. + 60+10+10,// RoundRectangle $Height. + 10,// RoundRectangle $RadiusX. + 10);// RoundRectangle $RadiusY. - +// Draws a box with round corners around around 'Quotation For' info: $YPos -= 90; -/*draw a nice curved corner box around the billing details */ -/*from the top right */ -$pdf->partEllipse($XPos+200,$YPos+60,0,90,10,10); -/*line to the top left */ -$pdf->line($XPos+200, $YPos+70,$XPos, $YPos+70); -/*Dow top left corner */ -$pdf->partEllipse($XPos, $YPos+60,90,180,10,10); -/*Do a line to the bottom left corner */ -$pdf->line($XPos-10, $YPos+60,$XPos-10, $YPos); -/*Now do the bottom left corner 180 - 270 coming back west*/ -$pdf->partEllipse($XPos, $YPos,180,270,10,10); -/*Now a line to the bottom right */ -$pdf->line($XPos, $YPos-10,$XPos+200, $YPos-10); -/*Now do the bottom right corner */ -$pdf->partEllipse($XPos+200, $YPos,270,360,10,10); -/*Finally join up to the top right corner where started */ -$pdf->line($XPos+210, $YPos,$XPos+210, $YPos+60); +$pdf->RoundRectangle( + $XPos-10,// RoundRectangle $XPos. + $YPos+60+10,// RoundRectangle $YPos. + 200+10+10,// RoundRectangle $Width. + 60+10+10,// RoundRectangle $Height. + 10,// RoundRectangle $RadiusX. + 10);// RoundRectangle $RadiusY. +// Prints quotation info: $pdf->addTextWrap($Page_Width-$Right_Margin-200, $Page_Height-$Top_Margin-$FontSize*1, 200, $FontSize, _('Number'). ': '.$_GET['QuotationNo'], 'right'); $pdf->addTextWrap($Page_Width-$Right_Margin-200, $Page_Height-$Top_Margin-$FontSize*2, 200, $FontSize, _('Your Ref'). ': '.$myrow['customerref'], 'right'); $pdf->addTextWrap($Page_Width-$Right_Margin-200, $Page_Height-$Top_Margin-$FontSize*3, 200, $FontSize, _('Date'). ': '.ConvertSQLDate($myrow['quotedate']), 'right'); @@ -97,14 +84,14 @@ // Prints the currency name: require_once('includes/CurrenciesArray.php');// To get the currency name from the currency code. -$pdf->addText($Page_Width/2-10, $YPos+5, $FontSize, +$pdf->addText($Page_Width/2+$Left_Margin, $YPos+5, $FontSize, _('All amounts stated in') . ' ' . $myrow['currcode'] . ' - ' . $CurrencyName[$myrow['currcode']]); // Prints table header: $YPos -= 45; $XPos = 40; -$LeftOvers = $pdf->addTextWrap($XPos+2,$YPos,100,$FontSize, _('Item Code'),'left'); -$LeftOvers = $pdf->addTextWrap(120,$YPos,235,$FontSize, _('Item Description'),'left'); +$LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,100,$FontSize, _('Item Code')); +$LeftOvers = $pdf->addTextWrap(120,$YPos,235,$FontSize, _('Item Description')); $LeftOvers = $pdf->addTextWrap(180,$YPos,85,$FontSize, _('Quantity'),'right'); $LeftOvers = $pdf->addTextWrap(230,$YPos,85,$FontSize,_('Price'),'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,85,$FontSize, _('Discount'),'right'); |
From: <rc...@us...> - 2014-08-17 21:53:22
|
Revision: 6826 http://sourceforge.net/p/web-erp/reponame/6826 Author: rchacon Date: 2014-08-17 21:53:13 +0000 (Sun, 17 Aug 2014) Log Message: ----------- Sorry, uploading now the tested versions. Modified Paths: -------------- trunk/includes/PDFTransPageHeader.inc trunk/includes/PDFTransPageHeaderPortrait.inc Modified: trunk/includes/PDFTransPageHeader.inc =================================================================== --- trunk/includes/PDFTransPageHeader.inc 2014-08-17 20:51:57 UTC (rev 6825) +++ trunk/includes/PDFTransPageHeader.inc 2014-08-17 21:53:13 UTC (rev 6826) @@ -2,17 +2,13 @@ /* $Id$ */ /* Please note that addTextWrap() prints a font-size-height further down than - addText() and other functions. Use addText() instead of addTextWrap() to + addText() and other functions. Use addText() instead of addTextWrap() to print left aligned elements.*/ -// $PageNumber is initialised in 0 by includes/PDFStarter.php. -$PageNumber ++;// Increments $PageNumber before printing. -// Only initiate a new page if its not the first: -if ($FirstPage) { - $FirstPage = False; -} else { +if (!$FirstPage){ /* only initiate a new page if its not the first */ $pdf->newPage(); } + $YPos = $Page_Height-$Top_Margin; $pdf->addJpegFromFile($_SESSION['LogoFile'],$Page_Width/2 -120,$YPos-40,0,60); @@ -43,14 +39,6 @@ $pdf->partEllipse($XPos+225, $YPos+5,270,360,10,10); /*Finally join up to the top right corner where started */ $pdf->line($XPos+235, $YPos+5,$XPos+235, $YPos+100); -/*// Draws a nice curved corner box around the billing details: -$pdf->RoundRectangle( - $Left_Margin,// RoundRectangle $XPos. - $YPos+$FontSize+5,// RoundRectangle $YPos. - $Page_Width-$Left_Margin-$Right_Margin,// RoundRectangle $Width. - $YPos+$FontSize-$Bottom_Margin+5,// RoundRectangle $Height. - 10,// RoundRectangle $RadiusX. - 10);// RoundRectangle $RadiusY.*/ $YPos = $Page_Height - $Top_Margin - 10; Modified: trunk/includes/PDFTransPageHeaderPortrait.inc =================================================================== --- trunk/includes/PDFTransPageHeaderPortrait.inc 2014-08-17 20:51:57 UTC (rev 6825) +++ trunk/includes/PDFTransPageHeaderPortrait.inc 2014-08-17 21:53:13 UTC (rev 6826) @@ -2,20 +2,13 @@ /* $Id$ */ /* Please note that addTextWrap() prints a font-size-height further down than - addText() and other functions. Use addText() instead of addTextWrap() to + addText() and other functions. Use addText() instead of addTextWrap() to print left aligned elements.*/ -// $PageNumber is initialised in 0 by includes/PDFStarter.php. -$PageNumber ++;// Increments $PageNumber before printing. -if ($PageNumber>1) {// Inserts a page break if it is not the first page. +if (!$FirstPage){ /* only initiate a new page if its not the first */ $pdf->newPage(); } -/*// Only initiate a new page if its not the first: -if ($FirstPage) { - $FirstPage = False; -} else { - $pdf->newPage();*/ -} + $YPos = $Page_Height-$Top_Margin; // Company Logo @@ -23,6 +16,7 @@ $FontSize =15; if ($InvOrCredit=='Invoice') { + $pdf->addText($Page_Width/2 - 60, $YPos, $FontSize, _('TAX INVOICE') . ' '); } else { $pdf->addText($Page_Width/2 - 60, $YPos, $FontSize, _('TAX CREDIT NOTE') . ' '); @@ -31,53 +25,59 @@ // Prints page number: $FontSize = 10; $YPos -= $FontSize; //Downs one line height mesure (addText position is from left-bottom). -$pdf->addTextWrap($Page_Width-$Right_Margin-100, $YPos, 100, $FontSize, - _('Page') . ' ' . $PageNumber, 'right'); +$pdf->addTextWrap($Page_Width-$Left_Margin-72, $YPos, 72, $FontSize, + _('Page').' '.$PageNumber, 'right'); $XPos = $Page_Width - 265; $YPos -= 85; // Draws a nice curved corner box around the billing details: -$pdf->RoundRectangle($XPos-10, $Page_Height-$Top_Margin-15, 245, 101, 10, 10); -/*// Draws a nice curved corner box around the billing details: -$pdf->RoundRectangle( - $Left_Margin,// RoundRectangle $XPos. - $YPos+$FontSize+5,// RoundRectangle $YPos. - $Page_Width-$Left_Margin-$Right_Margin,// RoundRectangle $Width. - $YPos+$FontSize-$Bottom_Margin+5,// RoundRectangle $Height. - 10,// RoundRectangle $RadiusX. - 10);// RoundRectangle $RadiusY.*/ +/*from the top right */ +$pdf->partEllipse($XPos+225,$YPos+67,0,90,10,10); +/*line to the top left */ +$pdf->line($XPos+225, $YPos+77,$XPos, $YPos+77); +/*Do top left corner */ +$pdf->partEllipse($XPos, $YPos+67,90,180,10,10); +/*Do a line to the bottom left corner */ +$pdf->line($XPos-10, $YPos+67,$XPos-10, $YPos-10); +/*Now do the bottom left corner 180 - 270 coming back west*/ +$pdf->partEllipse($XPos, $YPos-10,180,270,10,10); +/*Now a line to the bottom right */ +$pdf->line($XPos, $YPos-20,$XPos+225, $YPos-20); +/*Now do the bottom right corner */ +$pdf->partEllipse($XPos+225, $YPos-10,270,360,10,10); +/*Finally join up to the top right corner where started */ +$pdf->line($XPos+235, $YPos-10,$XPos+235, $YPos+67); +$YPos = $Page_Height - $Top_Margin - 10; -$XPos = $Page_Width-268; -$YPos = $Page_Height - $Top_Margin - 10; $FontSize = 10; $LineHeight = 13; +$LineCount = 1; +$pdf->addText($Page_Width-268, $YPos-$LineCount*$LineHeight, $FontSize, _('Number')); +$pdf->addText($Page_Width-180, $YPos-$LineCount*$LineHeight, $FontSize, $FromTransNo); +$LineCount += 1; +$pdf->addText($Page_Width-268, $YPos-$LineCount*$LineHeight, $FontSize, _('Customer Code')); +$pdf->addText($Page_Width-180, $YPos-$LineCount*$LineHeight, $FontSize, $myrow['debtorno'] . ' ' . _('Branch') . ' ' . $myrow['branchcode']); +$LineCount += 1; +$pdf->addText($Page_Width-268, $YPos-$LineCount*$LineHeight, $FontSize, _('Date')); +$pdf->addText($Page_Width-180, $YPos-$LineCount*$LineHeight, $FontSize, ConvertSQLDate($myrow['trandate'])); -$YPos -= $LineHeight; -$pdf->addText($XPos, $YPos, $FontSize, _('Number')); -$pdf->addText($XPos+88, $YPos, $FontSize, $FromTransNo); -$YPos -= $LineHeight; -$pdf->addText($XPos, $YPos, $FontSize, _('Customer Code')); -$pdf->addText($XPos+88, $YPos, $FontSize, $myrow['debtorno'] . ' ' . _('Branch') . ' ' . $myrow['branchcode']); -$YPos -= $LineHeight; -$pdf->addText($XPos, $YPos, $FontSize, _('Date')); -$pdf->addText($XPos+88, $YPos, $FontSize, ConvertSQLDate($myrow['trandate'])); - if ($InvOrCredit=='Invoice') { - $YPos -= $LineHeight; - $pdf->addText($XPos, $YPos, $FontSize, _('Order No')); - $pdf->addText($XPos+88, $YPos, $FontSize, $myrow['orderno']); - $YPos -= $LineHeight; - $pdf->addText($XPos, $YPos, $FontSize, _('Order Date')); - $pdf->addText($XPos+88, $YPos, $FontSize, ConvertSQLDate($myrow['orddate'])); - $YPos -= $LineHeight; - $pdf->addText($XPos, $YPos, $FontSize, _('Dispatch Detail')); - $pdf->addText($XPos+88, $YPos, $FontSize, $myrow['shippername'] . '-' . $myrow['consignment']); - $YPos -= $LineHeight; - $pdf->addText($XPos, $YPos, $FontSize, _('Dispatched From')); - $pdf->addText($XPos+88, $YPos, $FontSize, $myrow['locationname']); + $LineCount += 1; + $pdf->addText($Page_Width-268, $YPos-$LineCount*$LineHeight, $FontSize, _('Order No')); + $pdf->addText($Page_Width-180, $YPos-$LineCount*$LineHeight, $FontSize, $myrow['orderno']); + $LineCount += 1; + $pdf->addText($Page_Width-268, $YPos-$LineCount*$LineHeight, $FontSize, _('Order Date')); + $pdf->addText($Page_Width-180, $YPos-$LineCount*$LineHeight, $FontSize, ConvertSQLDate($myrow['orddate'])); + $LineCount += 1; + $pdf->addText($Page_Width-268, $YPos-$LineCount*$LineHeight, $FontSize, _('Dispatch Detail')); + $pdf->addText($Page_Width-180, $YPos-$LineCount*$LineHeight, $FontSize, $myrow['shippername'] . '-' . $myrow['consignment']); + $LineCount += 1; + $pdf->addText($Page_Width-268, $YPos-$LineCount*$LineHeight, $FontSize, _('Dispatched From')); + $pdf->addText($Page_Width-180, $YPos-$LineCount*$LineHeight, $FontSize, $myrow['locationname']); } + /*End of the text in the right side box */ /*Now print out company info at the top left */ @@ -161,7 +161,7 @@ $pdf->addText($XPos, $YPos-$LineCount*$LineHeight, $FontSize, _('Delivered To (check Dispatch Detail)') . ':'); $FontSize = 10; $LineHeight = 13; - $XPos +=20; + $XPos += 20; $LineCount += 1; // Before trying to call htmlspecialchars_decode, check that its supported, if not substitute a compatible version if (!function_exists('htmlspecialchars_decode')) { @@ -205,42 +205,58 @@ } $XPos = $Left_Margin; + $YPos = $Page_Height - $Top_Margin - 190; -/*$XPos = $Left_Margin;*/ +$XPos = $Left_Margin; $FontSize = 8; include($PathPrefix . 'includes/CurrenciesArray.php'); // To get the currency name from the currency code. -$pdf->addText($Left_Margin, $YPos-8, $FontSize, _('All amounts stated in') . ': ' . $myrow['currcode'] . ' - ' . $CurrencyName[$myrow['currcode']]); +$pdf->addText($Left_Margin, $YPos-8, $FontSize, _('All amounts stated in') . ': ' . $myrow['currcode'] . ' ' . $CurrencyName[$myrow['currcode']]); +$BoxHeight = $Page_Height-282; - -$BoxHeight = $Page_Height-282; // Draws a box with nice round corner for entering line items: -$pdf->RoundRectangle($Left_Margin, $Bottom_Margin+$BoxHeight+10, $Page_Width-$Right_Margin-$Left_Margin, $BoxHeight+10, 10, 10); +/*90 degree arc at top right of box 0 degrees starts a bottom */ +$pdf->partEllipse($Page_Width-$Right_Margin-10, $Bottom_Margin+$BoxHeight,0,90,10,10); +/*line to the top left */ +$pdf->line($Page_Width-$Right_Margin-10, $Bottom_Margin+$BoxHeight+10,$Left_Margin+10, $Bottom_Margin+$BoxHeight+10); +/*Dow top left corner */ +$pdf->partEllipse($Left_Margin+10, $Bottom_Margin+$BoxHeight,90,180,10,10); +/*Do a line to the bottom left corner */ +$pdf->line($Left_Margin, $Bottom_Margin+$BoxHeight,$Left_Margin, $Bottom_Margin+10); +/*Now do the bottom left corner 180 - 270 coming back west*/ +$pdf->partEllipse($Left_Margin+10, $Bottom_Margin+10,180,270,10,10); +/*Now a line to the bottom right */ +$pdf->line($Left_Margin+10, $Bottom_Margin,$Page_Width-$Right_Margin-10, $Bottom_Margin); +/*Now do the bottom right corner */ +$pdf->partEllipse($Page_Width-$Right_Margin-10, $Bottom_Margin+10,270,360,10,10); +/*Finally join up to the top right corner where started */ +$pdf->line($Page_Width-$Right_Margin, $Bottom_Margin+10,$Page_Width-$Right_Margin, $Bottom_Margin+$BoxHeight); + +$YPos -= 35; /*Set up headings */ -$YPos -= 11; -$FontSize = 10; +$FontSize=10; $LineHeight = 12; +$LineCount = 0; -$YPos -= $LineHeight; -$pdf->addText($Left_Margin+2, $YPos, $FontSize, _('Cust. Tax Ref') . ':'); +$pdf->addText($Left_Margin+2, ($YPos+$LineHeight)-$LineCount*$LineHeight, $FontSize, _('Cust. Tax Ref') . ':'); /*Print a vertical line */ -$pdf->line($Left_Margin+178, $YPos,$Left_Margin+178, $YPos-$LineHeight*3+4); -$pdf->addText($Left_Margin+180, $YPos, $FontSize, _('Cust. Reference No.') . ':'); +$pdf->line($Left_Margin+178, $YPos+$LineHeight,$Left_Margin+178, $YPos-$LineHeight*2+4); +$pdf->addText($Left_Margin+180, ($YPos+$LineHeight)-$LineCount*$LineHeight, $FontSize, _('Cust. Reference No.') . ':'); /*Print a vertical line */ -$pdf->line($Left_Margin+358, $YPos,$Left_Margin+358, $YPos-$LineHeight*3+4); -$pdf->addText($Left_Margin+360, $YPos, $FontSize, _('Sales Person') . ':'); - -$YPos -= $LineHeight; -$pdf->addText($Left_Margin+12, $YPos, $FontSize, $myrow['taxref']); -if ($InvOrCredit=='Invoice') { - $pdf->addText($Left_Margin+190, $YPos, $FontSize, $myrow['customerref']); +$pdf->line($Left_Margin+358, $YPos+$LineHeight,$Left_Margin+358, $YPos-$LineHeight*2+4); +$pdf->addText($Left_Margin+360, ($YPos+$LineHeight)-$LineCount*$LineHeight, $FontSize, _('Sales Person') . ':'); +$LineCount += 1; +$pdf->addText($Left_Margin+12, ($YPos+$LineHeight)-$LineCount*$LineHeight, $FontSize, $myrow['taxref']); +if ($InvOrCredit=='Invoice'){ + $pdf->addText($Left_Margin+190, ($YPos+$LineHeight)-$LineCount*$LineHeight, $FontSize, $myrow['customerref']); } -$pdf->addText($Left_Margin+370, $YPos, $FontSize, $myrow['salesmanname']); +$pdf->addText($Left_Margin+370, ($YPos+$LineHeight)-$LineCount*$LineHeight, $FontSize, $myrow['salesmanname']); +$YPos -= 20; + /*draw a line */ -$YPos -= 20; $pdf->line($XPos, $YPos,$Page_Width-$Right_Margin, $YPos); $YPos -= 12; @@ -255,8 +271,9 @@ $pdf->addText($Left_Margin+420, $YPos+12, $FontSize, _('Disc.')); $pdf->addTextWrap($Page_Width-$Left_Margin-72, $YPos, 72, $FontSize, _('Price'), 'right'); +$YPos-=0; + /*draw a line */ -$YPos-=0; $pdf->line($XPos, $YPos,$Page_Width-$Right_Margin, $YPos); $YPos -= ($line_height); |
From: <dai...@us...> - 2014-08-20 06:04:49
|
Revision: 6843 http://sourceforge.net/p/web-erp/reponame/6843 Author: daintree Date: 2014-08-20 06:04:47 +0000 (Wed, 20 Aug 2014) Log Message: ----------- code review Modified Paths: -------------- trunk/includes/UserLogin.php trunk/includes/session.inc Modified: trunk/includes/UserLogin.php =================================================================== --- trunk/includes/UserLogin.php 2014-08-20 05:58:04 UTC (rev 6842) +++ trunk/includes/UserLogin.php 2014-08-20 06:04:47 UTC (rev 6843) @@ -43,52 +43,52 @@ $sql = "SELECT * FROM www_users WHERE www_users.userid='" . $Name . "'"; - + $ErrMsg = _('Could not retrieve user details on login because'); $debug =1; - $continue = false; + $PasswordVerified = false; $Auth_Result = DB_query($sql, $db,$ErrMsg); - - if (DB_num_rows($Auth_Result) > 0) { - $myrow = DB_fetch_array($Auth_Result); - if (VerifyPass($Password,$myrow['password'])) { - $continue = true; - } elseif (isset($GLOBALS['CryptFunction'])) { - /*if the password stored in the DB was compiled the old way, - * the previous comparison will fail, - * try again with the old hashing algorithm, - * then re-hash the password using the new algorithm. - * The next version should not have $CryptFunction any more for new installs. - */ - switch ($GLOBALS['CryptFunction']) { - case 'sha1': - if ($myrow['password'] == sha1($Password)) { - $continue = true; - } - break; - case 'md5': - if ($myrow['password'] == md5($Password)) { - $continue = true; - } - break; - default: - if ($myrow['password'] == $Password) { - $continue = true; - } - } - if ($continue) { - $sql = "UPDATE www_users SET password = '".CryptPass($Password)."'" - . " WHERE userid = '".$Name."';"; - DB_query($sql,$db); - } - } - } - - + if (DB_num_rows($Auth_Result) > 0) { + $myrow = DB_fetch_array($Auth_Result); + if (VerifyPass($Password,$myrow['password'])) { + $PasswordVerified = true; + } elseif (isset($GLOBALS['CryptFunction'])) { + /*if the password stored in the DB was compiled the old way, + * the previous comparison will fail, + * try again with the old hashing algorithm, + * then re-hash the password using the new algorithm. + * The next version should not have $CryptFunction any more for new installs. + */ + switch ($GLOBALS['CryptFunction']) { + case 'sha1': + if ($myrow['password'] == sha1($Password)) { + $PasswordVerified = true; + } + break; + case 'md5': + if ($myrow['password'] == md5($Password)) { + $PasswordVerified = true; + } + break; + default: + if ($myrow['password'] == $Password) { + $PasswordVerified = true; + } + } + if ($PasswordVerified) { + $sql = "UPDATE www_users SET password = '" . CryptPass($Password) . "'" + . " WHERE userid = '" . $Name . "';"; + DB_query($sql,$db); + } + + } + } + + // Populate session variables with data base results - if ($continue) { - + if ($PasswordVerified) { + if ($myrow['blocked']==1){ //the account is blocked return UL_BLOCKED; Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2014-08-20 05:58:04 UTC (rev 6842) +++ trunk/includes/session.inc 2014-08-20 06:04:47 UTC (rev 6843) @@ -295,15 +295,15 @@ } function CryptPass( $Password ) { if (PHP_VERSION_ID < 50500) { - $salt = base64_encode(mcrypt_create_iv(22, MCRYPT_DEV_URANDOM)); - $salt = str_replace('+', '.', $salt); - $hash = crypt($Password, '$2y$10$'.$salt.'$'); + $Salt = base64_encode(mcrypt_create_iv(22, MCRYPT_DEV_URANDOM)); + $Salt = str_replace('+', '.', $Salt); + $Hash = crypt($Password, '$2y$10$' . $Salt . '$'); } else { - $hash = password_hash($Password,PASSWORD_DEFAULT); + $Hash = password_hash($Password,PASSWORD_DEFAULT); } - return $hash; + return $Hash; } - + function VerifyPass($Password,$Hash) { if(PHP_VERSION_ID < 50500) { return (crypt($Password,$Hash)==$Hash); |
From: <rc...@us...> - 2016-06-06 15:28:33
|
Revision: 7551 http://sourceforge.net/p/web-erp/reponame/7551 Author: rchacon Date: 2016-06-06 15:28:31 +0000 (Mon, 06 Jun 2016) Log Message: ----------- Replace addJpegFromFile() with Public function Image() in ~/includes/tcpdf/tcpdf.php, and code improvement. Modified Paths: -------------- trunk/includes/PDFQuotationPageHeader.inc trunk/includes/PDFTransPageHeaderPortrait.inc Modified: trunk/includes/PDFQuotationPageHeader.inc =================================================================== --- trunk/includes/PDFQuotationPageHeader.inc 2016-06-05 19:20:36 UTC (rev 7550) +++ trunk/includes/PDFQuotationPageHeader.inc 2016-06-06 15:28:31 UTC (rev 7551) @@ -7,12 +7,20 @@ // $PageNumber is initialised in 0 by includes/PDFStarter.php. $PageNumber ++;// Increments $PageNumber before printing. -if ($PageNumber>1) {// Inserts a page break if it is not the first page. +if($PageNumber>1) {// Inserts a page break if it is not the first page. $pdf->newPage(); } // Prints company logo: -$pdf->addJpegFromFile($_SESSION['LogoFile'], 301, 520, 0, 60); +/*$pdf->addJpegFromFile($_SESSION['LogoFile'], 301, 520, 0, 60);// Old function. See ~/includes/class.pdf.php.*/ +$pdf->Image( + $_SESSION['LogoFile'],// Name of the file containing the image. + 301,// Abscissa from left border to the upper-left corner (LTR). + $Page_Height -(520) -(60),// Ordinate from top border to the upper-left corner (LTR). + 0,// Width of the image in the page. If not specified or equal to zero, it is automatically calculated. + 60,// Height of the image in the page. If not specified or equal to zero, it is automatically calculated. + ''// Image format. If not specified, the type is inferred from the file extension. +);// Public function Image() in ~/includes/tcpdf/tcpdf.php. // Prints 'Quotation' title: $pdf->addTextWrap(0, $Page_Height-$Top_Margin-18, $Page_Width, 18, _('Quotation'), 'center'); @@ -45,19 +53,21 @@ $YPos = 566; $FontSize=14; $myrow = array_map(html_entity_decode, $myrow); +$line_height = 15; $pdf->addText($XPos, $YPos, $FontSize, _('Delivery To').':' ); -$pdf->addText($XPos, $YPos-15, $FontSize, $myrow['deliverto']); -$pdf->addText($XPos, $YPos-30, $FontSize, $myrow['deladd1']); -$pdf->addText($XPos, $YPos-45, $FontSize, $myrow['deladd2']); -$pdf->addText($XPos, $YPos-60, $FontSize, $myrow['deladd3'] . ' ' . $myrow['deladd4'] . ' ' . $myrow['deladd5']); +$pdf->addText($XPos, $YPos-$line_height*1, $FontSize, $myrow['deliverto']); +$pdf->addText($XPos, $YPos-$line_height*2, $FontSize, $myrow['deladd1']); +$pdf->addText($XPos, $YPos-$line_height*3, $FontSize, $myrow['deladd2']); +$pdf->addText($XPos, $YPos-$line_height*4, $FontSize, $myrow['deladd3'] . ' ' . $myrow['deladd4'] . ' ' . $myrow['deladd5']); // Prints 'Quotation For' info: $YPos -= 80; +$line_height = 15; $pdf->addText($XPos, $YPos, $FontSize, _('Quotation For').':'); -$pdf->addText($XPos, $YPos-15, $FontSize, $myrow['name']); -$pdf->addText($XPos, $YPos-30, $FontSize, $myrow['address1']); -$pdf->addText($XPos, $YPos-45, $FontSize, $myrow['address2']); -$pdf->addText($XPos, $YPos-60, $FontSize, $myrow['address3'] . ' ' . $myrow['address4'] . ' ' . $myrow['address5']); +$pdf->addText($XPos, $YPos-$line_height*1, $FontSize, $myrow['name']); +$pdf->addText($XPos, $YPos-$line_height*2, $FontSize, $myrow['address1']); +$pdf->addText($XPos, $YPos-$line_height*3, $FontSize, $myrow['address2']); +$pdf->addText($XPos, $YPos-$line_height*4, $FontSize, $myrow['address3'] . ' ' . $myrow['address4'] . ' ' . $myrow['address5']); // Draws a box with round corners around 'Delivery To' info: $XPos= 50; @@ -65,8 +75,8 @@ $pdf->RoundRectangle( $XPos-10,// RoundRectangle $XPos. $YPos+70,// RoundRectangle $YPos. - 245,// RoundRectangle $Width.225+10+10 - 80,// RoundRectangle $Height.60+10+10 + 245,// RoundRectangle $Width. + 80,// RoundRectangle $Height. 10,// RoundRectangle $RadiusX. 10);// RoundRectangle $RadiusY. @@ -75,8 +85,8 @@ $pdf->RoundRectangle( $XPos-10,// RoundRectangle $XPos. $YPos+70,// RoundRectangle $YPos. - 245,// RoundRectangle $Width.225+10+10 - 80,// RoundRectangle $Height.60+10+10 + 245,// RoundRectangle $Width. + 80,// RoundRectangle $Height. 10,// RoundRectangle $RadiusX. 10);// RoundRectangle $RadiusY. @@ -91,7 +101,7 @@ $XPos = 40; $YPos -= 37; $LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos,103, $FontSize, _('Item Code')); - if (strlen($LeftOvers) > 0) { // If translated text is greater than 103, prints remainder + if(strlen($LeftOvers) > 0) { // If translated text is greater than 103, prints remainder $LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos-$FontSize, 65, $FontSize, $LeftOvers); } $LeftOvers = $pdf->addTextWrap(145, $YPos,250, $FontSize, _('Item Description')); @@ -99,11 +109,11 @@ $LeftOvers = $pdf->addTextWrap(485, $YPos, 85, $FontSize, _('Price'),'right'); $LeftOvers = $pdf->addTextWrap(535, $YPos, 85, $FontSize, _('Discount'),'right'); $LeftOvers = $pdf->addTextWrap(615, $YPos, 55, $FontSize, _('Tax Class'),'right'); - if (strlen($LeftOvers) > 0) { // If translated text is greater than 55, prints remainder + if(strlen($LeftOvers) > 0) { // If translated text is greater than 55, prints remainder $LeftOvers = $pdf->addTextWrap(615,$YPos-$FontSize,55, $FontSize, $LeftOvers,'right'); } $LeftOvers = $pdf->addTextWrap(665, $YPos, 70, $FontSize, _('Tax Amount'),'right'); - if (strlen($LeftOvers) > 0) { // If translated text is greater than 70, prints remainder + if(strlen($LeftOvers) > 0) { // If translated text is greater than 70, prints remainder $LeftOvers = $pdf->addTextWrap(665, $YPos-$FontSize, 70, $FontSize, $LeftOvers,'right'); } $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-90, $YPos, 90, $FontSize, _('Total'),'right'); Modified: trunk/includes/PDFTransPageHeaderPortrait.inc =================================================================== --- trunk/includes/PDFTransPageHeaderPortrait.inc 2016-06-05 19:20:36 UTC (rev 7550) +++ trunk/includes/PDFTransPageHeaderPortrait.inc 2016-06-06 15:28:31 UTC (rev 7551) @@ -209,8 +209,8 @@ $XPos = $Left_Margin; $FontSize = 8; -include($PathPrefix . 'includes/CurrenciesArray.php'); // To get the currency name from the currency code. -$pdf->addText($Left_Margin, $YPos-8, $FontSize, _('All amounts stated in') . ': ' . $myrow['currcode'] . ' ' . $CurrencyName[$myrow['currcode']]); +require_once('includes/CurrenciesArray.php');// To get the currency name from the currency code. +$pdf->addText($Left_Margin, $YPos-8, $FontSize, _('All amounts stated in') . ': ' . $myrow['currcode'] . ' - ' . $CurrencyName[$myrow['currcode']]); $BoxHeight = $Page_Height-282; |
From: <ex...@us...> - 2017-06-19 04:21:30
|
Revision: 7783 http://sourceforge.net/p/web-erp/reponame/7783 Author: exsonqu Date: 2017-06-19 04:21:27 +0000 (Mon, 19 Jun 2017) Log Message: ----------- 19/06/17 Exson: Make these classes defined php 7 compliant and keep php4 backwards compatibility. Modified Paths: -------------- trunk/includes/DefineCartClass.php trunk/includes/DefineContractClass.php trunk/includes/DefineCustAllocsClass.php trunk/includes/DefineImportBankTransClass.php trunk/includes/DefineJournalClass.php trunk/includes/DefineOfferClass.php trunk/includes/DefinePOClass.php trunk/includes/DefinePaymentClass.php trunk/includes/DefineReceiptClass.php trunk/includes/DefineSerialItems.php trunk/includes/DefineShiptClass.php trunk/includes/DefineSpecialOrderClass.php trunk/includes/DefineStockAdjustment.php trunk/includes/DefineStockRequestClass.php trunk/includes/DefineStockTransfers.php trunk/includes/DefineSuppAllocsClass.php trunk/includes/DefineSuppTransClass.php trunk/includes/DefineTenderClass.php Modified: trunk/includes/DefineCartClass.php =================================================================== --- trunk/includes/DefineCartClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineCartClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -62,7 +62,7 @@ var $BuyerName; var $SpecialInstructions; - function Cart(){ + function __construct(){ /*Constructor function initialises a new shopping cart */ $this->LineItems = array(); $this->total=0; @@ -74,6 +74,10 @@ $this->CurrDecimalPlaces=2; //default } + function cart() { + self::__construct(); + } + function add_to_cart($StockID, $Qty, $Descr, @@ -445,7 +449,7 @@ Var $NextSerialNo; Var $GPPercent; - function LineDetails ($LineNumber, + function __construct ($LineNumber, $StockItem, $Descr, $LongDescr, @@ -518,6 +522,60 @@ } } //end constructor function for LineDetails + function LineDetails($LineNumber, + $StockItem, + $Descr, + $LongDescr, + $Qty, + $Prc, + $DiscPercent, + $UOM, + $Volume, + $Weight, + $QOHatLoc, + $MBflag, + $ActDispatchDate, + $QtyInvoiced, + $DiscCat, + $Controlled, + $Serialised, + $DecimalPlaces, + $Narrative, + $TaxCategory, + $ItemDue, + $POLine, + $StandardCost, + $EOQ, + $NextSerialNo, + $ExRate ) { + self::__construct($LineNumber, + $StockItem, + $Descr, + $LongDescr, + $Qty, + $Prc, + $DiscPercent, + $UOM, + $Volume, + $Weight, + $QOHatLoc, + $MBflag, + $ActDispatchDate, + $QtyInvoiced, + $DiscCat, + $Controlled, + $Serialised, + $DecimalPlaces, + $Narrative, + $TaxCategory, + $ItemDue, + $POLine, + $StandardCost, + $EOQ, + $NextSerialNo, + $ExRate ); + } + } Class Tax { @@ -528,7 +586,7 @@ Var $TaxOnTax; var $TaxGLCode; - function Tax ($TaxCalculationOrder, + function __construct ($TaxCalculationOrder, $TaxAuthID, $TaxAuthDescription, $TaxRate, @@ -542,6 +600,20 @@ $this->TaxOnTax = $TaxOnTax; $this->TaxGLCode = $TaxGLCode; } + function Tax ($TaxCalculationOrder, + $TaxAuthID, + $TaxAuthDescription, + $TaxRate, + $TaxOnTax, + $TaxGLCode) { + + self::__construct($TaxCalculationOrder, + $TaxAuthID, + $TaxAuthDescription, + $TaxRate, + $TaxOnTax, + $TaxGLCode); + } } -?> \ No newline at end of file +?> Modified: trunk/includes/DefineContractClass.php =================================================================== --- trunk/includes/DefineContractClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineContractClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -28,7 +28,7 @@ var $ContractBOM; /*array of stockid components required for the contract */ var $ContractReqts; /*array of other items required for the contract */ - function Contract(){ + function __construct(){ /*Constructor function initialises a new Payment batch */ $this->ContractBOM = array(); $this->ContractReqts = array(); @@ -36,6 +36,10 @@ $this->RequirementsCounter=0; $this->Status = 0; } + + function Contract() { + self::__construct; + } function Add_To_ContractBOM($StockID, $ItemDescription, @@ -102,7 +106,7 @@ var $UOM; var $DecimalPlaces; - function ContractComponent ($ComponentID, + function __construct ($ComponentID, $StockID, $ItemDescription, $WorkCentre, @@ -121,6 +125,24 @@ $this->UOM = $UOM; $this->DecimalPlaces = $DecimalPlaces; } + function ContractComponent($ComponentID, + $StockID, + $ItemDescription, + $WorkCentre, + $Quantity, + $ItemCost, + $UOM, + $DecimalPlaces=0){ + + self::__construct($ComponentID, + $StockID, + $ItemDescription, + $WorkCentre, + $Quantity, + $ItemCost, + $UOM, + $DecimalPlaces=0); + } } Class ContractRequirement { @@ -130,7 +152,7 @@ var $Quantity; var $CostPerUnit; - function ContractRequirement ($Requirement, + function __construct ($Requirement, $Quantity, $CostPerUnit, $ContractReqID=0){ @@ -141,5 +163,14 @@ $this->CostPerUnit = $CostPerUnit; $this->ContractReqID = $ContractReqID; } + function ContractRequirement ($Requirement, + $Quantity, + $CostPerUnit, + $ContractReqID=0){ + self::__construct ($Requirement, + $Quantity, + $CostPerUnit, + $ContractReqID=0); + } } -?> \ No newline at end of file +?> Modified: trunk/includes/DefineCustAllocsClass.php =================================================================== --- trunk/includes/DefineCustAllocsClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineCustAllocsClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -17,11 +17,15 @@ var $PrevDiffOnExch; /*The difference on exchange before this allocation */ var $CurrDecimalPlaces; - function Allocation(){ + function __construct(){ /*Constructor function initialises a new debtor allocation*/ $this->Allocs = array(); } + function Allocation(){ + self::__construct; + } + function add_to_AllocsAllocn ($ID, $TransType, $TypeNo, $TransDate, $AllocAmt, $TransAmount, $ExRate, $DiffOnExch, $PrevDiffOnExch, $PrevAlloc, $PrevAllocRecordID){ // if ($AllocAmt <= ($TransAmount - $PrevAlloc)){ @@ -56,7 +60,7 @@ THERE CAN BE ONLY ONE ... allocation record for each receipt/inovice combination */ - function Allocn ($ID, $TransType, $TypeNo, $TransDate, $AllocAmt, $TransAmount, $ExRate, $DiffOnExch, $PrevDiffOnExch, $PrevAlloc, $PrevAllocRecordID){ + function __construct ($ID, $TransType, $TypeNo, $TransDate, $AllocAmt, $TransAmount, $ExRate, $DiffOnExch, $PrevDiffOnExch, $PrevAlloc, $PrevAllocRecordID){ /* Constructor function to add a new Allocn object with passed params */ $this->ID =$ID; @@ -72,6 +76,10 @@ $this->PrevAlloc = $PrevAlloc; $this->PrevAllocRecordID= $PrevAllocRecordID; } + function Allocn($ID, $TransType, $TypeNo, $TransDate, $AllocAmt, $TransAmount, $ExRate, $DiffOnExch, $PrevDiffOnExch, $PrevAlloc, $PrevAllocRecordID){ + self::__construct($ID, $TransType, $TypeNo, $TransDate, $AllocAmt, $TransAmount, $ExRate, $DiffOnExch, $PrevDiffOnExch, $PrevAlloc, $PrevAllocRecordID); + } + } ?> Modified: trunk/includes/DefineImportBankTransClass.php =================================================================== --- trunk/includes/DefineImportBankTransClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineImportBankTransClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -18,7 +18,7 @@ var $ExchangeRate; var $Trans; - function BankStatement () { + function __construct () { $this->ReportCreated = ''; $this->AccountNumber = ''; $this->AccountName = ''; @@ -32,6 +32,9 @@ $this->CurrDecimalPlaces = 2; $this->ExchangeRate = 1; } + function BankStatement() { + self::__construct(); + } } class BankTrans { @@ -46,7 +49,7 @@ var $GLItemID; var $GLTotal; - function BankTrans ($ValueDate, $Amount) { + function __construct ($ValueDate, $Amount) { $this->ValueDate = $ValueDate; $this->Amount = $Amount; $this->GLEntries = array(); @@ -56,6 +59,9 @@ $this->GLTotal = 0; $this->BankTransID = 0; } + function BankTrans($ValueDate, $Amount) { + self::__construct(($ValueDate, $Amount); + } function Add_To_GLAnalysis($Amount, $Narrative, $GLCode, $GLAccountName, $Tag){ if (isset($GLCode) AND $Amount!=0){ @@ -85,7 +91,7 @@ Var $ID; var $Tag; - function GLAnalysis ($Amount, $Narrative, $ID, $GLCode, $GLAccountName, $Tag){ + function __construct ($Amount, $Narrative, $ID, $GLCode, $GLAccountName, $Tag){ /* Constructor function to add a new JournalGLAnalysis object with passed params */ $this->Amount =$Amount; @@ -95,6 +101,9 @@ $this->ID = $ID; $this->Tag = $Tag; } + function GLAnalysis($Amount, $Narrative, $ID, $GLCode, $GLAccountName, $Tag){ + self::__construct($Amount, $Narrative, $ID, $GLCode, $GLAccountName, $Tag); + } } ?> Modified: trunk/includes/DefineJournalClass.php =================================================================== --- trunk/includes/DefineJournalClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineJournalClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -13,7 +13,7 @@ var $BankAccounts; /*Array of bank account GLCodes that must be posted to by a bank payment or receipt to ensure integrity for matching off vs bank stmts */ - function Journal(){ + function __construct(){ /*Constructor function initialises a new journal */ $this->GLEntries = array(); $this->GLItemCounter=0; @@ -21,6 +21,9 @@ $this->GLItemID=0; $this->BankAccounts = array(); } + function Journal() { + self::__construct(); + } function Add_To_GLAnalysis($Amount, $Narrative, $GLCode, $GLActName, $tag, $assetid=1){ if (isset($GLCode) AND $Amount!=0){ @@ -52,7 +55,7 @@ var $tag; var $assetid; - function JournalGLAnalysis ($Amt, $Narr, $id, $GLCode, $GLActName, $tag, $assetid){ + function __construct ($Amt, $Narr, $id, $GLCode, $GLActName, $tag, $assetid){ /* Constructor function to add a new JournalGLAnalysis object with passed params */ $this->Amount =$Amt; @@ -63,6 +66,10 @@ $this->tag = $tag; $this->assetid = $assetid; } + function JournalGLAnalysis($Amt, $Narr, $id, $GLCode, $GLActName, $tag, $assetid){ + self::__construct($Amt, $Narr, $id, $GLCode, $GLActName, $tag, $assetid); + + } } ?> Modified: trunk/includes/DefineOfferClass.php =================================================================== --- trunk/includes/DefineOfferClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineOfferClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -17,7 +17,7 @@ var $version; var $OfferMailText; - function Offer($Supplier){ + function __construct($Supplier){ /*Constructor function initialises a new purchase offer object */ global $db; $this->LineItems = array(); @@ -35,6 +35,9 @@ $this->EmailAddress = $myrow['email']; $this->CurrCode = $myrow['currcode']; } + function Offer ($Supplier) { + self::__construct($Supplier); + } function add_to_offer( $LineNo, $StockID, @@ -198,7 +201,7 @@ var $Deleted; var $ExpiryDate; - function LineDetails ($LineNo, + function __construct ($LineNo, $StockItem, $Qty, $ItemDescr, @@ -218,6 +221,23 @@ $this->ExpiryDate = $ExpiryDate; $this->Deleted = False; } + function LineDetails($LineNo, + $StockItem, + $Qty, + $ItemDescr, + $Price, + $UOM, + $DecimalPlaces, + $ExpiryDate) { + self::__construct($LineNo, + $StockItem, + $Qty, + $ItemDescr, + $Price, + $UOM, + $DecimalPlaces, + $ExpiryDate); + } } ?> Modified: trunk/includes/DefinePOClass.php =================================================================== --- trunk/includes/DefinePOClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefinePOClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -50,7 +50,7 @@ var $Contact; var $Port; - function PurchOrder(){ + function __construct(){ /*Constructor function initialises a new purchase order object */ $this->LineItems = array(); $this->total=0; @@ -57,6 +57,10 @@ $this->LinesOnOrder=0; } + function PurchOrder() { + self::__construct(); + } + function add_to_order($LineNo, $StockID, $Serialised, @@ -234,7 +238,7 @@ Var $SerialItems; /*An array holding the batch/serial numbers and quantities in each batch*/ Var $AssetID; - function LineDetails ( $LineNo, + function __construct ( $LineNo, $StockItem, $Serialised, $Controlled, @@ -291,5 +295,50 @@ $this->AssetID = $AssetID; } + function LineDetails($LineNo, + $StockItem, + $Serialised, + $Controlled, + $Qty, + $ItemDescr, + $Price, + $UOM, + $GLCode, + $ReqDelDate, + $ShiptRef =0, + $Completed, + $JobRef, + $QtyInv, + $QtyRecd, + $GLActName, + $DecimalPlaces, + $SuppliersUnit, + $ConversionFactor, + $LeadTime, + $Suppliers_PartNo, + $AssetID) { + self::__construct($LineNo, + $StockItem, + $Serialised, + $Controlled, + $Qty, + $ItemDescr, + $Price, + $UOM, + $GLCode, + $ReqDelDate, + $ShiptRef =0, + $Completed, + $JobRef, + $QtyInv, + $QtyRecd, + $GLActName, + $DecimalPlaces, + $SuppliersUnit, + $ConversionFactor, + $LeadTime, + $Suppliers_PartNo, + $AssetID); + } } -?> \ No newline at end of file +?> Modified: trunk/includes/DefinePaymentClass.php =================================================================== --- trunk/includes/DefinePaymentClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefinePaymentClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -26,7 +26,7 @@ var $Narrative; var $GLItemCounter; /*Counter for the number of GL accounts being posted to by the Payment */ - function Payment(){ + function __construct(){ /*Constructor function initialises a new Payment batch */ $this->GLItems = array(); $this->GLItemCounter=0; @@ -41,6 +41,10 @@ } + function Payment() { + self::__construct; + } + function Add_To_GLAnalysis($Amount, $Narrative, $GLCode, @@ -79,7 +83,7 @@ var $Tag; var $Cheque; - function PaymentGLAnalysis ($Amt, + function __construct ($Amt, $Narr, $id, $GLCode, @@ -96,6 +100,21 @@ $this->Tag = $Tag; $this->Cheque = $Cheque; } + function PaymentGLAnalysis($Amt, + $Narr, + $id, + $GLCode, + $GLActName, + $Tag, + $Cheque){ + self::__construct($Amt, + $Narr, + $id, + $GLCode, + $GLActName, + $Tag, + $Cheque); + } } -?> \ No newline at end of file +?> Modified: trunk/includes/DefineReceiptClass.php =================================================================== --- trunk/includes/DefineReceiptClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineReceiptClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -20,7 +20,7 @@ var $total; /*Total of the batch of receipts in the currency of the company*/ var $ItemCounter; /*Counter for the number of customer receipts in the batch */ - function Receipt_Batch(){ + function __construct(){ /*Constructor function initialises a new receipt batch */ $this->Items = array(); $this->ItemCounter=0; @@ -27,6 +27,10 @@ $this->total=0; } + function Receipt_Batch() { + self::__construct(); + } + function add_to_batch($Amount, $Customer, $Discount, $Narrative, $GLCode, $PayeeBankDetail, $CustomerName, $tag){ if ((isset($Customer) OR isset($GLCode)) AND ($Amount + $Discount) !=0){ $this->Items[$this->ItemCounter] = new Receipt($Amount, $Customer, $Discount, $Narrative, $this->ItemCounter, $GLCode, $PayeeBankDetail, $CustomerName, $tag); @@ -58,7 +62,7 @@ var $tag; var $TagName; - function Receipt ($Amt, $Cust, $Disc, $Narr, $id, $GLCode, $PayeeBankDetail, $CustomerName, $Tag){ + function __construct ($Amt, $Cust, $Disc, $Narr, $id, $GLCode, $PayeeBankDetail, $CustomerName, $Tag){ global $db; /* Constructor function to add a new Receipt object with passed params */ $this->Amount =$Amt; @@ -76,6 +80,9 @@ $this->TagName = $TagRow['tagdescription']; } } + function Receipt($Amt, $Cust, $Disc, $Narr, $id, $GLCode, $PayeeBankDetail, $CustomerName, $Tag){ + self::__construct($Amt, $Cust, $Disc, $Narr, $id, $GLCode, $PayeeBankDetail, $CustomerName, $Tag); + } } ?> Modified: trunk/includes/DefineSerialItems.php =================================================================== --- trunk/includes/DefineSerialItems.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineSerialItems.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -40,11 +40,17 @@ var $ExpiryDate; //Constructor - function SerialItem($BundleRef, $BundleQty, $ExpiryDate='0000-00-00'){ + function __construct($BundleRef, $BundleQty, $ExpiryDate='0000-00-00'){ $this->BundleRef = $BundleRef; $this->BundleQty = $BundleQty; $this->ExpiryDate = $ExpiryDate; } + + function SerialItem($BundleRef, $BundleQty, $ExpiryDate='0000-00-00'){ + self::__construct($BundleRef, $BundleQty, $ExpiryDate='0000-00-00'); + } + + }//class SerialItem -?> \ No newline at end of file +?> Modified: trunk/includes/DefineShiptClass.php =================================================================== --- trunk/includes/DefineShiptClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineShiptClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -16,7 +16,7 @@ var $Closed; var $CurrDecimalPlaces; - function Shipment(){ + function __construct(){ /*Constructor function initialises a new Shipment object */ $this->LineItems = array(); $this->AccumValue =0; @@ -23,6 +23,10 @@ $this->Closed =0; } + function Shipment() { + self::__construct(); + } + function Add_To_Shipment($PODetailItem, $OrderNo, $StockID, @@ -89,7 +93,7 @@ var $DecimalPlaces; - function LineDetails ($PODetailItem, + function __construct ($PODetailItem, $OrderNo, $StockID, $ItemDescr, @@ -116,6 +120,32 @@ $this->StdCostUnit = $StdCostUnit; $this->DecimalPlaces = $DecimalPlaces; } + + function LineDetails($PODetailItem, + $OrderNo, + $StockID, + $ItemDescr, + $QtyInvoiced, + $UnitPrice, + $UOM, + $DelDate, + $QuantityOrd, + $QuantityRecd, + $StdCostUnit, + $DecimalPlaces=2) { + self::__construct($PODetailItem, + $OrderNo, + $StockID, + $ItemDescr, + $QtyInvoiced, + $UnitPrice, + $UOM, + $DelDate, + $QuantityOrd, + $QuantityRecd, + $StdCostUnit, + $DecimalPlaces=2); + } } -?> \ No newline at end of file +?> Modified: trunk/includes/DefineSpecialOrderClass.php =================================================================== --- trunk/includes/DefineSpecialOrderClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineSpecialOrderClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -28,7 +28,7 @@ var $Status; var $AllowPrintPO; - function SpecialOrder(){ + function __construct(){ /*Constructor function initialises a new special order object */ $this->LineItems = array(); $this->total=0; @@ -36,6 +36,10 @@ $this->AllowPrintPO=0; } + function SpecialOrder() { + self::__construct(); + } + function add_to_order($LineNo, $Qty, $ItemDescr, $Price, $Cost, $StkCat, $ReqDelDate){ if ($Qty!=0 AND isset($Qty)){ $this->LineItems[$LineNo] = new LineDetails($LineNo, $Qty, $ItemDescr, $Price, $Cost, $StkCat, $ReqDelDate); @@ -71,7 +75,7 @@ var $ReqDelDate; var $PartCode; - function LineDetails ($LineNo, $Qty, $ItemDescr, $Price, $Cost, $StkCat, $ReqDelDate){ + function __construct ($LineNo, $Qty, $ItemDescr, $Price, $Cost, $StkCat, $ReqDelDate){ /* Constructor function to add a new LineDetail object with passed params */ $this->LineNo = $LineNo; @@ -82,6 +86,11 @@ $this->Cost = $Cost; $this->StkCat = $StkCat; } + + function LineDetails ($LineNo, $Qty, $ItemDescr, $Price, $Cost, $StkCat, $ReqDelDate){ + self::__construct($LineNo, $Qty, $ItemDescr, $Price, $Cost, $StkCat, $ReqDelDate); + } + } ?> Modified: trunk/includes/DefineStockAdjustment.php =================================================================== --- trunk/includes/DefineStockAdjustment.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineStockAdjustment.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -15,7 +15,7 @@ var $SerialItems; /*array to hold controlled items*/ //Constructor - function StockAdjustment(){ + function __construct(){ $this->StockID = ''; $this->StockLocation = ''; $this->Controlled = ''; @@ -28,5 +28,9 @@ $this->Quantity = 0; $this->tag=0; } + + function StockAdjustment() { + self::__construct(); + } } -?> \ No newline at end of file +?> Modified: trunk/includes/DefineStockRequestClass.php =================================================================== --- trunk/includes/DefineStockRequestClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineStockRequestClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -9,12 +9,16 @@ var $Narrative; var $LineCounter=0; - function StockRequest(){ + function __construct(){ /*Constructor function initialises a new shopping cart */ $this->DispatchDate = date($_SESSION['DefaultDateFormat']); $this->LineItems=array(); } + function StockRequest(){ + self::__construct(); + } + function AddLine($StockID, $ItemDescription, $Quantity, @@ -42,7 +46,7 @@ var $UOM; var $LineNumber; - function LineDetails($StockID, + function __construct($StockID, $ItemDescription, $Quantity, $UOM, @@ -57,6 +61,20 @@ $this->UOM=$UOM; } + function LineDetails($StockID, + $ItemDescription, + $Quantity, + $UOM, + $DecimalPlaces, + $LineNumber) { + self::__construct($StockID, + $ItemDescription, + $Quantity, + $UOM, + $DecimalPlaces, + $LineNumber); + } + } -?> \ No newline at end of file +?> Modified: trunk/includes/DefineStockTransfers.php =================================================================== --- trunk/includes/DefineStockTransfers.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineStockTransfers.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -15,7 +15,7 @@ Var $TranDate; Var $TransferItem; /*Array of LineItems */ - function StockTransfer($TrfID, + function __construct($TrfID, $StockLocationFrom, $StockLocationFromName, $StockLocationFromAccount, @@ -34,6 +34,23 @@ $this->TranDate = $TranDate; $this->TransferItem=array(); /*Array of LineItem s */ } + function StockTransfer($TrfID, + $StockLocationFrom, + $StockLocationFromName, + $StockLocationFromAccount, + $StockLocationTo, + $StockLocationToName, + $StockLocationToAccount, + $TranDate ) { + self::__construct($TrfID, + $StockLocationFrom, + $StockLocationFromName, + $StockLocationFromAccount, + $StockLocationTo, + $StockLocationToName, + $StockLocationToAccount, + $TranDate ); + } } class LineItem { @@ -49,7 +66,7 @@ var $Perishable; var $SerialItems; /*array to hold controlled items*/ //Constructor - function LineItem($StockID, + function __construct($StockID, $ItemDescription, $Quantity, $PartUnit, @@ -73,5 +90,23 @@ } $this->SerialItems = array(); } + + function LineItem($StockID, + $ItemDescription, + $Quantity, + $PartUnit, + $Controlled, + $Serialised, + $Perishable, + $DecimalPlaces) { + self::__construct($StockID, + $ItemDescription, + $Quantity, + $PartUnit, + $Controlled, + $Serialised, + $Perishable, + $DecimalPlaces); + } } ?> Modified: trunk/includes/DefineSuppAllocsClass.php =================================================================== --- trunk/includes/DefineSuppAllocsClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineSuppAllocsClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -18,11 +18,15 @@ var $PrevDiffOnExch; /*The difference on exchange before this allocation */ var $CurrDecimalPlaces; /*The number of decimal places to display for the currency being allocated */ - function Allocation(){ + function __construct(){ /*Constructor function initialises a new supplier allocation*/ $this->Allocs = array(); } + function Allocation(){ + self::__construct(); + } + function add_to_AllocsAllocn ($ID, $TransType, $TypeNo, $TransDate, $SuppRef, $AllocAmt, $TransAmount, $ExRate, $DiffOnExch, $PrevDiffOnExch, $PrevAlloc, $PrevAllocRecordID){ if ($TransAmount >0){ @@ -59,7 +63,7 @@ THERE CAN BE ONLY ONE ... allocation record for each payment/inovice combination */ - function Allocn ($ID, $TransType, $TypeNo, $TransDate, $SuppRef, $AllocAmt, $TransAmount, $ExRate, $DiffOnExch, $PrevDiffOnExch, $PrevAlloc, $PrevAllocRecordID){ + function __construct ($ID, $TransType, $TypeNo, $TransDate, $SuppRef, $AllocAmt, $TransAmount, $ExRate, $DiffOnExch, $PrevDiffOnExch, $PrevAlloc, $PrevAllocRecordID){ /* Constructor function to add a new Allocn object with passed params */ $this->ID = $ID; @@ -76,6 +80,12 @@ $this->PrevAlloc = $PrevAlloc; $this->PrevAllocRecordID= $PrevAllocRecordID; } + + function Allocn($ID, $TransType, $TypeNo, $TransDate, $SuppRef, $AllocAmt, $TransAmount, $ExRate, $DiffOnExch, $PrevDiffOnExch, $PrevAlloc, $PrevAllocRecordID){ + + self::__construct($ID, $TransType, $TypeNo, $TransDate, $SuppRef, $AllocAmt, $TransAmount, $ExRate, $DiffOnExch, $PrevDiffOnExch, $PrevAlloc, $PrevAllocRecordID); + + } } ?> Modified: trunk/includes/DefineSuppTransClass.php =================================================================== --- trunk/includes/DefineSuppTransClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineSuppTransClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -38,7 +38,7 @@ var $Hold; var $SupplierRef=''; - function SuppTrans(){ + function __construct(){ /*Constructor function initialises a new Supplier Transaction object */ $this->GRNs = array(); $this->GLCodes = array(); @@ -48,6 +48,10 @@ $this->Taxes = array(); } + function SuppTrans() { + self::__construct(); + } + function GetTaxes () { global $db; @@ -333,7 +337,7 @@ var $GRNBatchNo; var $SupplierRef; - function GRNs ($GRNNo, + function __construct ($GRNNo, $PODetailItem, $ItemCode, $ItemDescription, @@ -379,6 +383,48 @@ $this->SupplierRef = $SupplierRef; } + function GRNs($GRNNo, + $PODetailItem, + $ItemCode, + $ItemDescription, + $QtyRecd, + $Prev_QuantityInv, + $This_QuantityInv, + $OrderPrice, + $ChgPrice, + $Complete, + $StdCostUnit=0, + $ShiptRef, + $JobRef, + $GLCode, + $PONo, + $AssetID, + $Hold=0, + $DecimalPlaces=2, + $GRNBatchNo, + $SupplierRef=''){ + self::__construct($GRNNo, + $PODetailItem, + $ItemCode, + $ItemDescription, + $QtyRecd, + $Prev_QuantityInv, + $This_QuantityInv, + $OrderPrice, + $ChgPrice, + $Complete, + $StdCostUnit=0, + $ShiptRef, + $JobRef, + $GLCode, + $PONo, + $AssetID, + $Hold=0, + $DecimalPlaces=2, + $GRNBatchNo, + $SupplierRef=''); + } + function Modify ($PODetailItem, $ItemCode, $ItemDescription, @@ -424,7 +470,7 @@ Var $Tag; Var $TagName; - function GLCodes ($Counter, $GLCode, $GLActName, $Amount, $Narrative, $Tag=0, $TagName=''){ + function __construct($Counter, $GLCode, $GLActName, $Amount, $Narrative, $Tag=0, $TagName=''){ global $db; /* Constructor function to add a new GLCodes object with passed params */ @@ -443,6 +489,12 @@ $this->TagName=$TagMyrow['tagdescription']; } } + + function GLCodes($Counter, $GLCode, $GLActName, $Amount, $Narrative, $Tag=0, $TagName=''){ + self::__construct($Counter, $GLCode, $GLActName, $Amount, $Narrative, $Tag=0, $TagName=''); + } + + } Class Shipment { @@ -450,12 +502,16 @@ Var $Counter; Var $ShiptRef; Var $Amount; - - function Shipment ($Counter, $ShiptRef, $Amount){ + + function __construct($Counter, $ShiptRef, $Amount){ $this->Counter = $Counter; $this->ShiptRef = $ShiptRef; $this->Amount = $Amount; } + + function Shipment ($Counter, $ShiptRef, $Amount){ + self::__construct($Counter, $ShiptRef, $Amount); + } } Class Asset { @@ -466,7 +522,7 @@ Var $CostAct; Var $Amount; - function Asset ($Counter, $AssetID, $Amount){ + function __construct($Counter, $AssetID, $Amount){ global $db; $this->Counter = $Counter; $this->AssetID = $AssetID; @@ -481,6 +537,10 @@ $this->Description = $AssetRow['description']; $this->CostAct = $AssetRow['costact']; } + + function Asset ($Counter, $AssetID, $Amount){ + self::__construct($Counter, $AssetID, $Amount); + } } Class Contract { @@ -491,7 +551,7 @@ Var $Narrative; Var $AniticipatedCost; - function Contract ($Counter, $ContractRef, $Amount,$Narrative,$AnticipatedCost){ + function __construct($Counter, $ContractRef, $Amount,$Narrative,$AnticipatedCost){ $this->Counter = $Counter; $this->ContractRef = $ContractRef; $this->Amount = $Amount; @@ -498,6 +558,10 @@ $this->Narrative = $Narrative; $this->AnticipatedCost = $AnticipatedCost; } + + function Contract ($Counter, $ContractRef, $Amount,$Narrative,$AnticipatedCost){ + self::__construct($Counter, $AssetID, $Amount,$Narrative,$AnticipatedCost); + } } @@ -510,7 +574,7 @@ Var $TaxGLCode; Var $TaxOvAmount; - function Tax ($TaxCalculationOrder, + function __construct ($TaxCalculationOrder, $TaxAuthID, $TaxAuthDescription, $TaxRate, @@ -524,5 +588,20 @@ $this->TaxOnTax = $TaxOnTax; $this->TaxGLCode = $TaxGLCode; } + + function Tax ($TaxCalculationOrder, + $TaxAuthID, + $TaxAuthDescription, + $TaxRate, + $TaxOnTax, + $TaxGLCode){ + self::__construct($TaxCalculationOrder, + $TaxAuthID, + $TaxAuthDescription, + $TaxRate, + $TaxOnTax, + $TaxGLCode); + } + } ?> Modified: trunk/includes/DefineTenderClass.php =================================================================== --- trunk/includes/DefineTenderClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineTenderClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -30,7 +30,7 @@ var $contact; var $Suppliers; - function tender(){ + function __construct(){ /*Constructor function initialises a new purchase tender object */ $this->LineItems = array(); $this->Suppliers = array(); @@ -38,6 +38,10 @@ $this->SuppliersOnTender=0; } + function Tender(){ + self::__construct(); + } + function EmailSuppliers() { $EmailText= _('This email has been automatically generated by webERP') . "\n"; $EmailText.= _('You are invited to Tender for the following products to be delivered to') . ' ' . $_SESSION['CompanyRecord']['coyname'] . "\n"; @@ -235,7 +239,7 @@ var $Deleted; var $ExpiryDate; - function LineDetails ($LineNo, + function __construct ($LineNo, $StockItem, $Qty, $ItemDescr, @@ -253,6 +257,23 @@ $this->ExpiryDate = $ExpiryDate; $this->Deleted = False; } + + function LineDetails($LineNo, + $StockItem, + $Qty, + $ItemDescr, + $UOM, + $DecimalPlaces, + $ExpiryDate) { + self::__construct($LineNo, + $StockItem, + $Qty, + $ItemDescr, + $UOM, + $DecimalPlaces, + $ExpiryDate); + } + } Class Supplier { @@ -262,7 +283,7 @@ var $EmailAddress; var $Responded; - function Supplier ($SupplierCode, + function __construct ($SupplierCode, $SupplierName, $EmailAddress) { $this->SupplierCode = $SupplierCode; @@ -270,6 +291,16 @@ $this->EmailAddress = $EmailAddress; $this->Responded = 0; } + + function Supplier ($SupplierCode, + $SupplierName, + $EmailAddress) { + self::__construct($SupplierCode, + $SupplierName, + $EmailAddress); + } + + } ?> |
From: <ex...@us...> - 2017-06-21 04:02:06
|
Revision: 7792 http://sourceforge.net/p/web-erp/reponame/7792 Author: exsonqu Date: 2017-06-21 04:02:03 +0000 (Wed, 21 Jun 2017) Log Message: ----------- 21/06/17 Exson: Fixed bug of Add menu features. Modified Paths: -------------- trunk/includes/GetConfig.php trunk/includes/header.php trunk/includes/session.php Modified: trunk/includes/GetConfig.php =================================================================== --- trunk/includes/GetConfig.php 2017-06-20 11:03:31 UTC (rev 7791) +++ trunk/includes/GetConfig.php 2017-06-21 04:02:03 UTC (rev 7792) @@ -115,6 +115,15 @@ $_SESSION['SMTPSettings']['timeout']=$myrow['timeout']; $_SESSION['SMTPSettings']['auth']=$myrow['auth']; } + //Add favorite scripts + $sql = "SELECT href, caption FROM favourites WHERE userid='" . $_SESSION['UserID'] . "'"; + $result = DB_query($sql); + if (DB_num_rows($result)>0) { + while ($myrow = DB_fetch_array($result)) { + $_SESSION['Favourites'][$myrow['href']] = $myrow['caption']; + } + } + } //end if force reload or not set already @@ -138,4 +147,4 @@ $RadioBeaconFTP_user_name = RadioBeacon ftp server user name $RadionBeaconFTP_user_pass = Radio Beacon remote ftp server password */ -?> \ No newline at end of file +?> Modified: trunk/includes/header.php =================================================================== --- trunk/includes/header.php 2017-06-20 11:03:31 UTC (rev 7791) +++ trunk/includes/header.php 2017-06-21 04:02:03 UTC (rev 7792) @@ -77,8 +77,8 @@ } if (isset($_POST['DelFromMenu'])) { unset($_SESSION['Favourites'][$_POST['ScriptName']]); - } - if (isset($_SESSION['Favourites']) AND count($_SESSION['Favourites'])>0) { + } + if (isset($_SESSION['Favourites']) AND count($_SESSION['Favourites'])>0) { echo '<ul>'; foreach ($_SESSION['Favourites'] as $url=>$ttl) { echo '<li><a href="' . $url . '">' . _($ttl) . '<a></li>'; @@ -85,7 +85,7 @@ } echo '</ul>'; - } + } echo '</li>'; //take off inline formatting, use CSS instead ===HJ=== if (count($_SESSION['AllowedPageSecurityTokens'])>1){ Modified: trunk/includes/session.php =================================================================== --- trunk/includes/session.php 2017-06-20 11:03:31 UTC (rev 7791) +++ trunk/includes/session.php 2017-06-21 04:02:03 UTC (rev 7792) @@ -88,9 +88,10 @@ $ErrMsg = _('Failed to retrieve favorites'); $result = DB_query($sql,$ErrMsg); if (DB_num_rows($result)>0) { + $sql = array(); while ($myrow = DB_fetch_array($result)) { if (!isset($_SESSION['Favourites'][$myrow['href']])) {//The script is removed; - $sql[] = "DELECT FROM favourites WHERE href='" . $myrow['href'] . "' AND userid='" . $_SESSION['UserID'] . "'"; + $sql[] = "DELETE FROM favourites WHERE href='" . $myrow['href'] . "' AND userid='" . $_SESSION['UserID'] . "'"; } else { unset($_SESSION['Favourites'][$myrow['href']]); @@ -110,7 +111,9 @@ foreach ($sql as $sq) { $result = DB_query($sq); } - $result = DB_query($sqli); + if (isset($sqli)) { + $result = DB_query($sqli); + } } else { $sqli = "INSERT INTO favourites(href,caption,userid) VALUES "; @@ -122,7 +125,9 @@ $sqli .= "('" . $url . "', '" . $ttl . "','" . $_SESSION['UserID'] . "')"; $k++; } - $result = DB_query($sqli); + if ($k) { + $result = DB_query($sqli); + } } } |