From: <dai...@us...> - 2012-05-05 05:04:12
|
Revision: 5316 http://web-erp.svn.sourceforge.net/web-erp/?rev=5316&view=rev Author: daintree Date: 2012-05-05 05:04:04 +0000 (Sat, 05 May 2012) Log Message: ----------- factor in Ricards review to label code Modified Paths: -------------- trunk/CustomerTypes.php trunk/InventoryPlanning.php trunk/Labels.php trunk/PDFPrintLabel.php trunk/SelectOrderItems.php trunk/doc/Change.log trunk/includes/DateFunctions.inc trunk/includes/PDFStarter.php trunk/includes/footer.inc trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/upgrade4.07-4.08.sql Modified: trunk/CustomerTypes.php =================================================================== --- trunk/CustomerTypes.php 2012-05-04 21:55:53 UTC (rev 5315) +++ trunk/CustomerTypes.php 2012-05-05 05:04:04 UTC (rev 5316) @@ -156,13 +156,17 @@ if ($myrow[0]>0) { prnMsg (_('Cannot delete this type because customers are currently set up to use this type') . '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('customers with this type code')); } else { - - $sql="DELETE FROM debtortype WHERE typeid='".$SelectedType."'"; - $ErrMsg = _('The Type record could not be deleted because'); - $result = DB_query($sql,$db,$ErrMsg); - echo '<br />'; - prnMsg(_('Customer type') . $SelectedType . ' ' . _('has been deleted') ,'success'); - + $result = DB_query("SELECT typename FROM debtortype WHERE typeid='".$SelectedType."'",$db); + if (DB_Num_Rows($result)>0){ + $TypeRow = DB_fetch_array($result); + $TypeName = $TypeRow['typename']; + + $sql="DELETE FROM debtortype WHERE typeid='".$SelectedType."'"; + $ErrMsg = _('The Type record could not be deleted because'); + $result = DB_query($sql,$db,$ErrMsg); + echo '<br />'; + prnMsg(_('Customer type') . ' ' . $TypeName . ' ' . _('has been deleted') ,'success'); + } unset ($SelectedType); unset($_GET['delete']); Modified: trunk/InventoryPlanning.php =================================================================== --- trunk/InventoryPlanning.php 2012-05-04 21:55:53 UTC (rev 5315) +++ trunk/InventoryPlanning.php 2012-05-05 05:04:04 UTC (rev 5316) @@ -105,12 +105,12 @@ include('includes/footer.inc'); exit; } - $Period_0_Name = strftime('%b',mktime(0,0,0,Date('m'),Date('d'),Date('Y'))); - $Period_1_Name = strftime('%b',mktime(0,0,0,Date('m')-1,Date('d'),Date('Y'))); - $Period_2_Name = strftime('%b',mktime(0,0,0,Date('m')-2,Date('d'),Date('Y'))); - $Period_3_Name = strftime('%b',mktime(0,0,0,Date('m')-3,Date('d'),Date('Y'))); - $Period_4_Name = strftime('%b',mktime(0,0,0,Date('m')-4,Date('d'),Date('Y'))); - $Period_5_Name = strftime('%b',mktime(0,0,0,Date('m')-5,Date('d'),Date('Y'))); + $Period_0_Name = GetMonthText(mktime(0,0,0,Date('m'),Date('d'),Date('Y'))); + $Period_1_Name = GetMonthText(mktime(0,0,0,Date('m')-1,Date('d'),Date('Y'))); + $Period_2_Name = GetMonthText(mktime(0,0,0,Date('m')-2,Date('d'),Date('Y'))); + $Period_3_Name = GetMonthText(mktime(0,0,0,Date('m')-3,Date('d'),Date('Y'))); + $Period_4_Name = GetMonthText(mktime(0,0,0,Date('m')-4,Date('d'),Date('Y'))); + $Period_5_Name = GetMonthText(mktime(0,0,0,Date('m')-5,Date('d'),Date('Y'))); include ('includes/PDFInventoryPlanPageHeader.inc'); Modified: trunk/Labels.php =================================================================== --- trunk/Labels.php 2012-05-04 21:55:53 UTC (rev 5315) +++ trunk/Labels.php 2012-05-05 05:04:04 UTC (rev 5316) @@ -7,19 +7,20 @@ include('includes/header.inc'); //define PaperSize array sizes in pdf points -$PaperSize = array('A4', - 'A4_Landscape', - 'A5', - 'A5_Landscape', - 'A3', - 'A3_Landscape', - 'Letter', - 'Letter_Landscape', - 'Legal', - 'Legal_Landscape', - '28mm_x_45mm_label'); +$PaperSize = array(); +$PaperSize['A4']['PageHeight'] = 297; +$PaperSize['A4']['PageWidth'] = 210; +$PaperSize['A5']['PageHeight'] = 210; +$PaperSize['A5']['PageWidth'] = 148; +$PaperSize['A3']['PageHeight'] = 420; +$PaperSize['A3']['PageWidth'] = 297; +$PaperSize['Letter']['PageHeight'] = 279.4; +$PaperSize['Letter']['PageWidth'] = 215.9; +$PaperSize['Legal']['PageHeight'] = 355.6; +$PaperSize['Legal']['PageWidth'] = 215.9; + echo '<p class="page_title_text"> <img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Label Template Maintenance') . '" alt="" />' . $title. ' @@ -39,11 +40,11 @@ vpos='" . $_POST['VPos' . $i] . "', hpos='" . $_POST['HPos' . $i] . "', fontsize='" . $_POST['FontSize' . $i] . "', - barcode='" . $_POST['Barcode' . $i] . "' + barcode='" . $_POST['Barcode' . $i] . "' WHERE labelfieldid='" . $_POST['LabelFieldID' . $i] . "'", $db); } else { - prnMsg (_('Entries for Vertical Position Horizonal Position and Font Size must be integers.'),'error'); + prnMsg (_('Entries for Vertical Position, Horizonal Position and Font Size must be integers.'),'error'); } } } @@ -79,20 +80,30 @@ prnMsg( _('The label description may not be empty'), 'error'); } $Message = ''; + + if (isset($_POST['PaperSize']) AND $_POST['PaperSize']!='custom'){ + $_POST['PageWidth'] = $PaperSize[$_POST['PaperSize']]['PageWidth']; + $_POST['PageHeight'] = $PaperSize[$_POST['PaperSize']]['PageHeight']; + } elseif ($_POST['PaperSize']=='custom' AND !isset($_POST['PageWidth'])){ + $_POST['PageWidth'] = 0; + $_POST['PageHeight'] = 0; + } + if (isset($SelectedLabelID)) { /*SelectedLabelID could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ - $sql = "UPDATE labels SET papersize ='" . $_POST['PaperSize'] . "', - description = '" . $_POST['Description'] . "', + $sql = "UPDATE labels SET description = '" . $_POST['Description'] . "', height = '" . $_POST['Height'] . "', topmargin = '". $_POST['TopMargin'] . "', width = '". $_POST['Width'] . "', leftmargin = '". $_POST['LeftMargin'] . "', rowheight = '". $_POST['RowHeight'] . "', - columnwidth = '". $_POST['ColumnWidth'] . "' + columnwidth = '". $_POST['ColumnWidth'] . "', + pagewidth = '" . $_POST['PageWidth'] . "', + pageheight = '" . $_POST['PageHeight'] . "' WHERE labelid = '" . $SelectedLabelID . "'"; $ErrMsg = _('The update of this label template failed because'); @@ -104,22 +115,24 @@ /*Selected label is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new label form */ - $sql = "INSERT INTO labels (papersize, - description, + $sql = "INSERT INTO labels (description, height, topmargin, width, leftmargin, rowheight, - columnwidth) - VALUES ('" . $_POST['PaperSize'] . "', - '" . $_POST['Description'] . "', + columnwidth, + pagewidth, + pageheight) + VALUES ('" . $_POST['Description'] . "', '" . $_POST['Height'] . "', '" . $_POST['TopMargin'] . "', '" . $_POST['Width'] . "', '" . $_POST['LeftMargin'] . "', '" . $_POST['RowHeight'] . "', - '" . $_POST['ColumnWidth'] . "')"; + '" . $_POST['ColumnWidth'] . "', + '" . $_POST['PageWidth'] . "', + '" . $_POST['PageHeight'] . "')"; $ErrMsg = _('The addition of this label failed because'); $result = DB_query($sql,$db,$ErrMsg); @@ -135,7 +148,8 @@ unset( $_POST['LeftMargin']); unset( $_POST['ColumnWidth']); unset( $_POST['RowHeight']); - + unset($_POST['PageWidth']); + unset($_POST['PageHeight']); } prnMsg($Message); @@ -156,7 +170,8 @@ $sql = "SELECT labelid, description, - papersize, + pagewidth, + pageheight, height, width, topmargin, @@ -173,7 +188,9 @@ echo '<table class="selection"> <tr> <th>' . _('Description') . '</th> - <th>' . _('Page Size') . '</th> + <th>' . _('Rows x Cols') . '</th> + <th>' . _('Page Width') . '</th> + <th>' . _('Page Height') . '</th> <th>' . _('Height') . '</th> <th>' . _('Width') . '</th> <th>' . _('Row Height') . '</th> @@ -189,29 +206,65 @@ echo '<tr class="OddTableRows">'; $k++; } - - printf('<td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href="%sSelectedLabelID=%s">' . _('Edit') . '</a></td> - <td><a href="%sSelectedLabelID=%s&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this label?') . '\');">' . _('Delete') . '</a></td> - </tr>', - $myrow['description'], - $myrow['papersize'], - $myrow['height'], - $myrow['width'], - $myrow['rowheight'], - $myrow['columnwidth'], - htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?', - $myrow['labelid'], - htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?', - $myrow['labelid'], - $rootpath . '/LabelFields.php?', - $myrow['labelid']); - + $NoOfRows = floor(($myrow['pageheight']-$myrow['topmargin'])/$myrow['rowheight']); + $NoOfCols = floor(($myrow['pagewidth']-$myrow['leftmargin'])/$myrow['columnwidth']); + + foreach ($PaperSize as $PaperName=>$PaperType) { + if ($PaperType['PageWidth'] == $myrow['pagewidth'] AND $PaperType['PageHeight'] == $myrow['pageheight']) { + $Paper = $PaperName; + } + } + if (isset($Paper)){ + printf('<td>%s</td> + <td>%s</td> + <td colspan="2">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td><a href="%sSelectedLabelID=%s">' . _('Edit') . '</a></td> + <td><a href="%sSelectedLabelID=%s&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this label?') . '\');">' . _('Delete') . '</a></td> + </tr>', + $myrow['description'], + $NoOfRows . ' x ' . $NoOfCols, + $Paper, + $myrow['height'], + $myrow['width'], + $myrow['rowheight'], + $myrow['columnwidth'], + htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?', + $myrow['labelid'], + htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?', + $myrow['labelid'], + $rootpath . '/LabelFields.php?', + $myrow['labelid']); + } else { + printf('<td>%s</td> + <td>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td><a href="%sSelectedLabelID=%s">' . _('Edit') . '</a></td> + <td><a href="%sSelectedLabelID=%s&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this label?') . '\');">' . _('Delete') . '</a></td> + </tr>', + $myrow['description'], + $NoOfRows . ' x ' . $NoOfCols, + $myrow['pagewidth'], + $myrow['pageheight'], + $myrow['height'], + $myrow['width'], + $myrow['rowheight'], + $myrow['columnwidth'], + htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?', + $myrow['labelid'], + htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?', + $myrow['labelid'], + $rootpath . '/LabelFields.php?', + $myrow['labelid']); + } } //END WHILE LIST LOOP @@ -233,7 +286,8 @@ if (isset($SelectedLabelID)) { //editing an existing label - $sql = "SELECT papersize, + $sql = "SELECT pagewidth, + pageheight, description, height, width, @@ -247,7 +301,8 @@ $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); - $_POST['PaperSize'] = $myrow['papersize']; + $_POST['PageWidth'] = $myrow['pagewidth']; + $_POST['PageHeight'] = $myrow['pageheight']; $_POST['Description'] = $myrow['description']; $_POST['Height'] = $myrow['height']; $_POST['TopMargin'] = $myrow['topmargin']; @@ -255,6 +310,12 @@ $_POST['LeftMargin'] = $myrow['leftmargin']; $_POST['RowHeight'] = $myrow['rowheight']; $_POST['ColumnWidth'] = $myrow['columnwidth']; + + foreach ($PaperSize as $PaperName=>$PaperType) { + if ($PaperType['PageWidth'] == $myrow['pagewidth'] AND $PaperType['PageHeight'] == $myrow['pageheight']) { + $_POST['PaperSize'] = $PaperName; + } + } echo '<input type="hidden" name="SelectedLabelID" value="' . $SelectedLabelID . '" />'; @@ -274,9 +335,14 @@ </tr> <tr> <td>' . _('Label Paper Size') . ':</td> - <td><select name="PaperSize">'; + <td><select name="PaperSize" onchange="ReloadForm(submit)" >'; -foreach($PaperSize as $PaperType) { +if (!isset($_POST['PaperSize'])){ + echo '<option selected="selected" value="custom">' . _('Custom Size') . '</option>'; +} else { + echo '<option value="custom">' . _('Custom Size') . '</option>'; +} +foreach($PaperSize as $PaperType=>$PaperSizeElement) { if (isset($_POST['PaperSize']) AND $PaperType==$_POST['PaperSize']) { echo '<option selected="selected" value="'; } else { @@ -289,6 +355,13 @@ echo '</select></td> </tr>'; + +if (!isset($_POST['PageHeight'])) { + $_POST['PageHeight']=0; +} +if (!isset($_POST['PageWidth'])) { + $_POST['PageWidth']=0; +} if (!isset($_POST['Height'])) { $_POST['Height']=0; } @@ -308,6 +381,21 @@ if (!isset($_POST['ColumnWidth'])) { $_POST['ColumnWidth']=0; } + +if (!isset($_POST['PaperSize']) OR $_POST['PaperSize'] == 'Custom') { + if (!isset($_POST['PageWidth'])){ + $_POST['PageWidth'] = 0; + $_POST['PageHeight'] = 0; + } + echo '<tr> + <td>' . _('Page Width') . '</td> + <td><input type="text" size="4" maxlength="4" name="PageWidth" value="' . $_POST['PageWidth'] . '" /></td> + </tr> + <tr> + <td>' . _('Page Height') . '</td> + <td><input type="text" size="4" maxlength="4" name="PageHeight" value="' . $_POST['PageHeight'] . '" /></td> + </tr>'; +} echo '<tr> <td>' . _('Label Height') . ' - (He):</td> <td><input type="text" name="Height" size="4" maxlength="4" value="' . $_POST['Height'] . '" /></td> @@ -375,7 +463,7 @@ } echo '<input type="hidden" name="LabelFieldID' . $i . '" value="' . $myrow['labelfieldid'] . '" /> - <td><select name="FieldName' . $i . '">'; + <td><select name="FieldName' . $i . '" onchange="ReloadForm(submit)">'; if ($myrow['fieldvalue']=='itemcode'){ echo '<option selected="selected" value="itemcode">' . _('Item Code') . '</option>'; } else { @@ -400,7 +488,7 @@ <td><input type="text" name="VPos' . $i . '" size="4" maxlength="4" value="' . $myrow['vpos'] . '" /></td> <td><input type="text" name="HPos' . $i . '" size="4" maxlength="4" value="' . $myrow['hpos'] . '" /></td> <td><input type="text" name="FontSize' . $i . '" size="4" maxlength="4" value="' . $myrow['fontsize'] . '" /></td> - <td><select name="Barcode' . $i . '">'; + <td><select name="Barcode' . $i . '" onchange="ReloadForm(submit)">'; if ($myrow['barcode']==0){ echo '<option selected="selected" value="0">' . _('No') . '</option> <option value="1">' . _('Yes') . '</option>'; @@ -445,6 +533,10 @@ <div class="centre"> <input type="submit" name="submit" value="' . _('Enter Information') . '" /> </div> + <br /> + <div class="centre"> + <a href="' . $rootpath . '/PDFPrintLabel.php">' . _('Print Labels') . '</a> + </div> </form>'; include('includes/footer.inc'); Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2012-05-04 21:55:53 UTC (rev 5315) +++ trunk/PDFPrintLabel.php 2012-05-05 05:04:04 UTC (rev 5316) @@ -6,7 +6,7 @@ $PtsPerMM = 2.83465; //pdf points per mm -if (isset($_POST['ShowLabels']) +if ((isset($_POST['ShowLabels']) OR isset($_POST['SelectAll'])) AND isset($_POST['FromCriteria']) AND mb_strlen($_POST['FromCriteria'])>=1 AND isset($_POST['ToCriteria']) @@ -65,14 +65,27 @@ <th>' . _('Item Description') . '</th> <th>' . _('Price') . '</th> <th>' . _('Print') . ' ?</th> - </tr>'; + </tr> + <tr><th colspan="4"><input type="submit" name="SelectAll" value="' . _('Select All Labels') . '" /><input type="checkbox" name="CheckAll" '; + if (isset($_POST['CheckAll'])){ + echo 'checked="checked" '; + } + echo 'onchange="ReloadForm(SelectAll)" /></td> + </tr>'; + $i=0; while ($LabelRow = DB_fetch_array($LabelsResult)){ echo '<tr> <td>' . $LabelRow['stockid'] . '</td> <td>' . $LabelRow['description'] . '</td> <td class="number">' . locale_number_format($LabelRow['price'],$LabelRow['decimalplaces']) . '</td> - <td><input type="checkbox" checked="checked" name="PrintLabel' . $i .'" /></td> + <td>'; + if (isset($_POST['SelectAll']) AND isset($_POST['CheckAll'])) { + echo '<input type="checkbox" checked="checked" name="PrintLabel' . $i .'" />'; + } else { + echo '<input type="checkbox" name="PrintLabel' . $i .'" />'; + } + echo '</td> </tr>'; echo '<input type="hidden" name="StockID' . $i . '" value="' . $LabelRow['stockid'] . '" /> <input type="hidden" name="Description' . $i . '" value="' . $LabelRow['description'] . '" /> @@ -84,18 +97,41 @@ echo '</table> <input type="hidden" name="NoOfLabels" value="' . $i . '" /> <input type="hidden" name="LabelID" value="' . $_POST['LabelID'] . '" /> + <input type="hidden" name="FromCriteria" value="' . $_POST['FromCriteria'] . '" /> + <input type="hidden" name="ToCriteria" value="' . $_POST['ToCriteria'] . '" /> + <input type="hidden" name="SalesType" value="' . $_POST['SalesType'] . '" /> + <input type="hidden" name="Currency" value="' . $_POST['Currency'] . '" /> + <input type="hidden" name="EffectiveDate" value="' . $_POST['EffectiveDate'] . '" /> <br /> <div class="centre"> + <input type="submit" name="PrintLabels" value="'. _('Print Labels'). '" /> </div> + <br /> + <div class="centre"> + <a href="'. $rootpath . '/Labels.php">' . _('Label Template Maintenance'). '</a> + </div> </form>'; exit; } if (isset($_POST['PrintLabels']) - AND isset($_POST['NoOfLabels'])) { - - $result = DB_query("SELECT papersize, - description, + AND isset($_POST['NoOfLabels']) + AND $_POST['NoOfLabels']>0){ + $NoOfLabels = 0; + for ($i=0;$i < $_POST['NoOfLabels'];$i++){ + if (isset($_POST['PrintLabel'.$i])){ + $NoOfLabels++; + } + } + if ($NoOfLabels ==0){ + prnMsg(_('There are no labels selected to print'),'info'); + } +} +if (isset($_POST['PrintLabels']) AND $NoOfLabels>0) { + + $result = DB_query("SELECT description, + pagewidth*" . $PtsPerMM . " as page_width, + pageheight*" . $PtsPerMM . " as page_height, width*" . $PtsPerMM . " as label_width, height*" . $PtsPerMM . " as label_height, rowheight*" . $PtsPerMM . " as label_rowheight, @@ -106,14 +142,7 @@ WHERE labelid='" . $_POST['LabelID'] . "'", $db); $LabelDimensions = DB_fetch_array($result); - $PaperSize = $LabelDimensions['papersize']; - include('includes/PDFStarter.php'); - $Top_Margin = $LabelDimensions['label_topmargin']; - $Left_Margin = $LabelDimensions['label_leftmargin']; - - $pdf->addInfo('Title', $LabelDimensions['description'] . ' ' . _('Price Labels') ); - $pdf->addInfo('Subject', $LabelDimensions['description'] . ' ' . _('Price Labels') ); - + $result = DB_query("SELECT fieldvalue, vpos, hpos, @@ -139,6 +168,19 @@ $i++; } + $PaperSize = 'Custom'; // so PDF starter wont default the DocumentPaper + $DocumentPaper = array($LabelDimensions['page_width'],$LabelDimensions['page_height']); + include('includes/PDFStarter.php'); + $Top_Margin = $LabelDimensions['label_topmargin']; + $Left_Margin = $LabelDimensions['label_leftmargin']; + $Page_Height = $LabelDimensions['page_height']; + $Page_Width = $LabelDimensions['page_width']; + $Right_Margin =0; + $Bottom_Margin =0; + + $pdf->addInfo('Title', $LabelDimensions['description'] . ' ' . _('Price Labels') ); + $pdf->addInfo('Subject', $LabelDimensions['description'] . ' ' . _('Price Labels') ); + $style = array( 'position' => '', 'align' => 'C', @@ -160,9 +202,9 @@ $YPos = $Page_Height - $Top_Margin; //top of current label $XPos = $Left_Margin; // left of current label - for ($i=0;$i <= $_POST['NoOfLabels'];$i++){ + for ($i=0;$i < $_POST['NoOfLabels'];$i++){ if ($_POST['PrintLabel'.$i]=='on'){ - + $NoOfLabels--; foreach ($LabelFields as $Field){ //print_r($Field); @@ -183,34 +225,36 @@ * Note that the YPos for this function is based on the opposite origin for the Y axis i.e from the bottom not from the top! */ - $pdf->write1DBarcode(str_replace('_','',$Value), 'C128',$XPos+$Field['HPos'],$Page_Height - $YPos+$LabelDimensions['label_height']-$Field['VPos']-$Field['FontSize'],$LabelDimensions['label_width']-$Field['HPos'], $Field['FontSize'], 0.4, $style, 'N'); + $pdf->write1DBarcode(str_replace('_','',$Value), 'C39',$XPos+$Field['HPos'],$Page_Height - $YPos+$LabelDimensions['label_height']-$Field['VPos']-$Field['FontSize'],$LabelDimensions['label_width']-$Field['HPos'], $Field['FontSize'], 0.4, $style, 'N'); } else { $LeftOvers = $pdf->addTextWrap($XPos+$Field['HPos'],$YPos-$LabelDimensions['label_height']+$Field['VPos'],$LabelDimensions['label_width']-$Field['HPos']-20,$Field['FontSize'],$Value); } } // end loop through label fields - //setup $YPos and $XPos for the next label - if (($YPos - $LabelDimensions['label_rowheight']) < $LabelDimensions['label_height']){ - /* not enough space below the above label to print a new label - * so the above was the last label in the column - * need to start either a new column or new page - */ - if (($Page_Width - $XPos - $LabelDimensions['label_columnwidth']) < $LabelDimensions['label_width']) { - /* Not enough space to start a new column so we are into a new page + if ($NoOfLabels>0) { + //setup $YPos and $XPos for the next label + if (($YPos - $LabelDimensions['label_rowheight']) < $LabelDimensions['label_height']){ + /* not enough space below the above label to print a new label + * so the above was the last label in the column + * need to start either a new column or new page */ - $pdf->newPage(); - $PageNumber++; - $YPos = $Page_Height - $Top_Margin; //top of next label - $XPos = $Left_Margin; // left of next label + if (($Page_Width - $XPos - $LabelDimensions['label_columnwidth']) < $LabelDimensions['label_width']) { + /* Not enough space to start a new column so we are into a new page + */ + $pdf->newPage(); + $PageNumber++; + $YPos = $Page_Height - $Top_Margin; //top of next label + $XPos = $Left_Margin; // left of next label + } else { + /* There is enough space for another column */ + $YPos = $Page_Height - $Top_Margin; //back to the top of next label column + $XPos += $LabelDimensions['label_columnwidth']; // left of next label + } } else { - /* There is enough space for another column */ - $YPos = $Page_Height - $Top_Margin; //back to the top of next label column - $XPos += $LabelDimensions['label_columnwidth']; // left of next label + /* There is space below to print a label + */ + $YPos -= $LabelDimensions['label_rowheight']; //Top of next label } - } else { - /* There is space below to print a label - */ - $YPos -= $LabelDimensions['label_rowheight']; //Top of next label - } + }//end if there is another label to print } //this label is set to print } //loop through labels selected to print @@ -303,6 +347,10 @@ <div class="centre"> <input type="submit" name="ShowLabels" value="'. _('Show Labels'). '" /> </div> + <br /> + <div class="centre"> + <a href="'. $rootpath . '/Labels.php">' . _('Label Template Maintenance'). '</a> + </div> </form>'; } Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2012-05-04 21:55:53 UTC (rev 5315) +++ trunk/SelectOrderItems.php 2012-05-05 05:04:04 UTC (rev 5316) @@ -750,7 +750,7 @@ stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' stockcategory.stocktype='L') AND stockmaster.mbflag <>'G' AND stockmaster.description " . LIKE . " '" . $SearchString . "' AND stockmaster.discontinued=0 @@ -761,7 +761,7 @@ stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L') AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 AND stockmaster.description " . LIKE . " '" . $SearchString . "' @@ -780,7 +780,7 @@ stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L') AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 @@ -791,7 +791,7 @@ stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L') AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 @@ -806,7 +806,7 @@ stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L') AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 ORDER BY stockmaster.stockid"; @@ -816,7 +816,7 @@ stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L') AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 AND stockmaster.categoryid='" . $_POST['StockCat'] . "' Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-05-04 21:55:53 UTC (rev 5315) +++ trunk/doc/Change.log 2012-05-05 05:04:04 UTC (rev 5316) @@ -1,5 +1,10 @@ webERP Change Log +4/5/12 Phil: Labels.php PDFPrintLabel.php fine tuning of new labels code +4/5/12 Phil: Fixed customer type name displayed when it is successfully deleted as reported by James Dupin +4/5/12 Phil: Attempt to create simple work around for the limitations of strftime function and resulting character encoding issues - added new functions to get multi-lingual months GetMonthText() and week day names GetWeekDayText(). Not sure if there is any international consensus on the best format here - but can use the DefaultDateFormat or $_SESSION['Language'] if others want it a different way +4/5/12 Phil: Allow SelectOrderItems.php to select labour type items +4/5/12 Phil: updated tcpdf to 5.9.160 4/5/12 Phil: Default lastcostupdate to 0000-00-00 to avoid issues inserting new items. 1/5/12 MTPubRadio: Measurement unit in FormDesigner.php should be points instead of millimeters. 1/5/12 MTPubRadio: Fixed Purch Order PDF file text of Order Total- Excl tax does not align with amount horizontally. Modified: trunk/includes/DateFunctions.inc =================================================================== --- trunk/includes/DateFunctions.inc 2012-05-04 21:55:53 UTC (rev 5315) +++ trunk/includes/DateFunctions.inc 2012-05-05 05:04:04 UTC (rev 5316) @@ -78,8 +78,6 @@ } //end of Is_Date function -//_______________________________________________________________ - function MonthAndYearFromSQLDate($DateEntry) { @@ -94,20 +92,85 @@ if (mb_strlen($Date_Array[2])>4) { $Date_Array[2]= mb_substr($Date_Array[2],0,2); } - $str = strftime('%B %Y', mktime(0,0,0, (int)$Date_Array[1],(int)$Date_Array[2],(int)$Date_Array[0])); - //This code to handle characters in windows system which not encoded in UTF-8. Those non-utf8 code leads to display garbage - $encode = mb_detect_encoding($str,'GB2312,BIG5,UTF-8'); - - if($encode=='EUC-CN'){ - return iconv('GB2312','UTF-8',$str); - }elseif($encode=='EUC-TW' or $encode=='BIG-5'){ - return iconv('BIG5','UTF-8', $str); - }else{ - return ucfirst($str); - } - + + $MonthName = GetMonthText(date('n', mktime(0,0,0, (int)$Date_Array[1],(int)$Date_Array[2],(int)$Date_Array[0]))); + return $MonthName . ' ' . date('Y', mktime(0,0,0, (int)$Date_Array[1],(int)$Date_Array[2],(int)$Date_Array[0])); + } +function GetMonthText($MonthNumber){ + switch ($MonthNumber) { + case 1: + $Month = _('January'); + break; + case 2: + $Month = _('February'); + break; + case 3: + $Month = _('March'); + break; + case 4: + $Month = _('April'); + break; + case 5: + $Month = _('May'); + break; + case 6: + $Month = _('June'); + break; + case 7: + $Month = _('July'); + break; + case 8: + $Month = _('August'); + break; + case 9: + $Month = _('September'); + break; + case 10: + $Month = _('October'); + break; + case 11: + $Month = _('November'); + break; + case 12: + $Month = _('December'); + break; + } + return $Month; +} + +function GetWeekDayText ($WeekDayNumber){ + switch ($WeekDayNumber) { + case 0: + $Day = _('Sunday'); + break; + case 1: + $Day = _('Monday'); + break; + case 2: + $Day = _('Tuesday'); + break; + case 3: + $Day = _('Wednesday'); + break; + case 4: + $Day = _('Thursday'); + break; + case 5: + $Day = _('Friday'); + break; + case 6: + $Day = _('Saturday'); + break; + } + return $Day; +} + +function DisplayDateTime () { + return GetWeekDayText(date('w')) . ' ' . date('j') . ' ' . GetMonthText(date('n')) . ' ' . date('G:i') ; +} + function DayOfWeekFromSQLDate($DateEntry) { if (mb_strpos($DateEntry,'/')) { @@ -126,6 +189,7 @@ } + function DayOfMonthFromSQLDate($DateEntry) { if (mb_strpos($DateEntry,'/')) { Modified: trunk/includes/PDFStarter.php =================================================================== --- trunk/includes/PDFStarter.php 2012-05-04 21:55:53 UTC (rev 5315) +++ trunk/includes/PDFStarter.php 2012-05-05 05:04:04 UTC (rev 5316) @@ -22,148 +22,144 @@ } /* Javier: TCPDF supports 45 standard ISO (DIN) paper formats and 4 american common formats and does this cordinates calculation. - However, reports use this units */ +However, reports use this units */ switch ($PaperSize) { case 'A4': - // Javier: Now I use the native TCPDF constructor to which I send these values in each case, // this should have been done whith FPDF which use the same values in its constructor. + $DocumentPaper = 'A4'; + $DocumentOrientation ='P'; + + // Javier: DIN-A4 is 210 mm width, i.e., 595'2756 points (inches * 72 ppi) + $Page_Width=595; + $Page_Height=842; + $Top_Margin=30; + $Bottom_Margin=30; + $Left_Margin=40; + $Right_Margin=30; + break; - $DocumentPaper = 'A4'; $DocumentOrientation ='P'; - -// Javier: DIN-A4 is 210 mm width, i.e., 595'2756 points (inches * 72 ppi) - $Page_Width=595; - $Page_Height=842; - $Top_Margin=30; - $Bottom_Margin=30; - $Left_Margin=40; - $Right_Margin=30; - break; - case 'A4_Landscape': + + $DocumentPaper = 'A4'; + $DocumentOrientation ='L'; + + $Page_Width=842; + $Page_Height=595; + $Top_Margin=30; + $Bottom_Margin=30; + $Left_Margin=40; + $Right_Margin=30; + break; - $DocumentPaper = 'A4'; $DocumentOrientation ='L'; - - $Page_Width=842; - $Page_Height=595; - $Top_Margin=30; - $Bottom_Margin=30; - $Left_Margin=40; - $Right_Margin=30; - break; - case 'A5': - $DocumentPaper = 'A5'; $DocumentOrientation ='P'; + $DocumentPaper = 'A5'; + $DocumentOrientation ='P'; + + $Page_Width=421; + $Page_Height=595; + $Top_Margin=30; + $Bottom_Margin=30; + $Left_Margin=40; + $Right_Margin=30; + break; - $Page_Width=421; - $Page_Height=595; - $Top_Margin=30; - $Bottom_Margin=30; - $Left_Margin=40; - $Right_Margin=30; - break; - case 'A5_Landscape': + + $DocumentPaper = 'A5'; + $DocumentOrientation ='L'; + + $Page_Width=595; + $Page_Height=421; + $Top_Margin=30; + $Bottom_Margin=30; + $Left_Margin=40; + $Right_Margin=30; + break; - $DocumentPaper = 'A5'; $DocumentOrientation ='L'; - - $Page_Width=595; - $Page_Height=421; - $Top_Margin=30; - $Bottom_Margin=30; - $Left_Margin=40; - $Right_Margin=30; - break; - case 'A3': - $DocumentPaper = 'A3'; $DocumentOrientation ='P'; + $DocumentPaper = 'A3'; + $DocumentOrientation ='P'; + + $Page_Width=842; + $Page_Height=1190; + $Top_Margin=50; + $Bottom_Margin=50; + $Left_Margin=50; + $Right_Margin=40; + break; - $Page_Width=842; - $Page_Height=1190; - $Top_Margin=50; - $Bottom_Margin=50; - $Left_Margin=50; - $Right_Margin=40; - break; - case 'A3_landscape': - $DocumentPaper = 'A3'; $DocumentOrientation ='L'; + $DocumentPaper = 'A3'; + $DocumentOrientation ='L'; + + $Page_Width=1190; + $Page_Height=842; + $Top_Margin=50; + $Bottom_Margin=50; + $Left_Margin=50; + $Right_Margin=40; + break; - $Page_Width=1190; - $Page_Height=842; - $Top_Margin=50; - $Bottom_Margin=50; - $Left_Margin=50; - $Right_Margin=40; - break; - case 'letter': + + $DocumentPaper = 'LETTER'; + $DocumentOrientation ='P'; + + $Page_Width=612; + $Page_Height=792; + $Top_Margin=30; + $Bottom_Margin=30; + $Left_Margin=30; + $Right_Margin=25; + break; - $DocumentPaper = 'LETTER'; $DocumentOrientation ='P'; - - $Page_Width=612; - $Page_Height=792; - $Top_Margin=30; - $Bottom_Margin=30; - $Left_Margin=30; - $Right_Margin=25; - break; - case 'letter_landscape': - $DocumentPaper = 'LETTER'; $DocumentOrientation ='L'; - - $Page_Width=792; - $Page_Height=612; - $Top_Margin=30; - $Bottom_Margin=30; - $Left_Margin=30; - $Right_Margin=25; - break; - + $DocumentPaper = 'LETTER'; + $DocumentOrientation ='L'; + + $Page_Width=792; + $Page_Height=612; + $Top_Margin=30; + $Bottom_Margin=30; + $Left_Margin=30; + $Right_Margin=25; + break; + case 'legal': - $DocumentPaper = 'LEGAL'; - $DocumentOrientation ='P'; + $DocumentPaper = 'LEGAL'; + $DocumentOrientation ='P'; + + $Page_Width=612; + $Page_Height=1008; + $Top_Margin=50; + $Bottom_Margin=40; + $Left_Margin=30; + $Right_Margin=25; + break; - $Page_Width=612; - $Page_Height=1008; - $Top_Margin=50; - $Bottom_Margin=40; - $Left_Margin=30; - $Right_Margin=25; - break; - case 'legal_landscape': - $DocumentPaper = 'LEGAL'; - $DocumentOrientation ='L'; - - $Page_Width=1008; - $Page_Height=612; - $Top_Margin=50; - $Bottom_Margin=40; - $Left_Margin=30; - $Right_Margin=25; - break; - - case '28mm_x_45mm_label': - //$DocumentPaper can be an array or width/height of paper size - //as an alternative to the string ISO paper size required by tcpdf - $DocumentPaper = array(127.6,79.4); - $DocumentOrientation='L'; - $Page_Width=127.6; - $Page_Height=79.4; - $Top_Margin=0; - $Bottom_Margin=0; - $Left_Margin=0; - $Right_Margin=0; - break; + $DocumentPaper = 'LEGAL'; + $DocumentOrientation ='L'; + + $Page_Width=1008; + $Page_Height=612; + $Top_Margin=50; + $Bottom_Margin=40; + $Left_Margin=30; + $Right_Margin=25; + break; + default: + $DocumentOrientation = 'L'; + break; } // Javier: I correct the call to the constructor to match TCPDF (and FPDF ;-) Modified: trunk/includes/footer.inc =================================================================== --- trunk/includes/footer.inc 2012-05-04 21:55:53 UTC (rev 5315) +++ trunk/includes/footer.inc 2012-05-05 05:04:04 UTC (rev 5316) @@ -7,7 +7,7 @@ echo '<tr>'; echo '<td style="width:33%"></td><td class="footer">'; echo '<img src="'. $rootpath . '/' . $_SESSION['LogoFile'] . '" width="120" alt="webERP" title="webERP ' . _('Copyright') . ' © weberp.org - ' . date('Y') . '" /></td>'; -echo '<td class="footer" style="text-align: right;width:33%">'.strftimeToUTF8((strftime('%A'))).', '.(date($_SESSION['DefaultDateFormat']).' | '.(strftimeToUTF8(strftime(($DefaultClock==12) ? '%I:%M %p' : '%H:%M')))).'</td>'; +echo '<td class="footer" style="text-align: right;width:33%">'. DisplayDateTime() .'</td>'; echo '</tr>'; echo '<tr><td colspan="3" class="footer">webERP ' ._('version') .' ' . $_SESSION['VersionNumber'] . '</td></tr>'; @@ -21,22 +21,5 @@ echo '</div>'; echo '</body>'; echo '</html>'; - function strftimeToUTF8 ($str) { - - $encoding = mb_detect_encoding($str,"GB2312,BIG5,UTF-8"); - switch($encoding){ - case 'EUC-CN': - return iconv('GB2312','UTF-8',$str); - break; - case 'EUC-TW': - return iconv('BIG5','UTF-8',$str); - break; - case 'BIG-5': - return iconv('BIG5','UTF-8',$str); - break; - default: - return $str; - } - } ?> Modified: trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po 2012-05-04 21:55:53 UTC (rev 5315) +++ trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po 2012-05-05 05:04:04 UTC (rev 5316) @@ -13189,7 +13189,7 @@ #: index.php:511 #, fuzzy msgid "Create a New Tender" -msgstr "Planungskalender anlegen" +msgstr "Ausschreibung erstellen" #: index.php:516 #, fuzzy Modified: trunk/sql/mysql/upgrade4.07-4.08.sql =================================================================== --- trunk/sql/mysql/upgrade4.07-4.08.sql 2012-05-04 21:55:53 UTC (rev 5315) +++ trunk/sql/mysql/upgrade4.07-4.08.sql 2012-05-05 05:04:04 UTC (rev 5316) @@ -76,7 +76,16 @@ ALTER TABLE `locations` ADD UNIQUE `locationname` (`locationname`); -ALTER TABLE `stockmaster` CHANGE `lastcostupdate` `lastcostupdate` DATE NOT NULL DEFAULT '0000-00-00' +ALTER TABLE `stockmaster` CHANGE `lastcostupdate` `lastcostupdate` DATE NOT NULL DEFAULT '0000-00-00'; +ALTER TABLE `labels` CHANGE `papersize` `pagewidth` FLOAT NOT NULL DEFAULT '0'; +ALTER TABLE `labels` ADD `pageheight` FLOAT NOT NULL DEFAULT '0' AFTER `pagewidth`; +ALTER TABLE `labels` CHANGE `height` `height` FLOAT NOT NULL DEFAULT '0'; +ALTER TABLE `labels` CHANGE `width` `width` FLOAT NOT NULL DEFAULT '0'; +ALTER TABLE `labels` CHANGE `topmargin` `topmargin` FLOAT NOT NULL DEFAULT '0'; +ALTER TABLE `labels` CHANGE `leftmargin` `leftmargin` FLOAT NOT NULL DEFAULT '0'; +ALTER TABLE `labels` CHANGE `rowheight` `rowheight` FLOAT NOT NULL DEFAULT '0'; +ALTER TABLE `labels` CHANGE `columnwidth` `columnwidth` FLOAT NOT NULL DEFAULT '0'; + UPDATE config SET confvalue='4.08' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-05-05 05:04:12
|
Revision: 5316 http://web-erp.svn.sourceforge.net/web-erp/?rev=5316&view=rev Author: daintree Date: 2012-05-05 05:04:04 +0000 (Sat, 05 May 2012) Log Message: ----------- factor in Ricards review to label code Modified Paths: -------------- trunk/CustomerTypes.php trunk/InventoryPlanning.php trunk/Labels.php trunk/PDFPrintLabel.php trunk/SelectOrderItems.php trunk/doc/Change.log trunk/includes/DateFunctions.inc trunk/includes/PDFStarter.php trunk/includes/footer.inc trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/upgrade4.07-4.08.sql Modified: trunk/CustomerTypes.php =================================================================== --- trunk/CustomerTypes.php 2012-05-04 21:55:53 UTC (rev 5315) +++ trunk/CustomerTypes.php 2012-05-05 05:04:04 UTC (rev 5316) @@ -156,13 +156,17 @@ if ($myrow[0]>0) { prnMsg (_('Cannot delete this type because customers are currently set up to use this type') . '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('customers with this type code')); } else { - - $sql="DELETE FROM debtortype WHERE typeid='".$SelectedType."'"; - $ErrMsg = _('The Type record could not be deleted because'); - $result = DB_query($sql,$db,$ErrMsg); - echo '<br />'; - prnMsg(_('Customer type') . $SelectedType . ' ' . _('has been deleted') ,'success'); - + $result = DB_query("SELECT typename FROM debtortype WHERE typeid='".$SelectedType."'",$db); + if (DB_Num_Rows($result)>0){ + $TypeRow = DB_fetch_array($result); + $TypeName = $TypeRow['typename']; + + $sql="DELETE FROM debtortype WHERE typeid='".$SelectedType."'"; + $ErrMsg = _('The Type record could not be deleted because'); + $result = DB_query($sql,$db,$ErrMsg); + echo '<br />'; + prnMsg(_('Customer type') . ' ' . $TypeName . ' ' . _('has been deleted') ,'success'); + } unset ($SelectedType); unset($_GET['delete']); Modified: trunk/InventoryPlanning.php =================================================================== --- trunk/InventoryPlanning.php 2012-05-04 21:55:53 UTC (rev 5315) +++ trunk/InventoryPlanning.php 2012-05-05 05:04:04 UTC (rev 5316) @@ -105,12 +105,12 @@ include('includes/footer.inc'); exit; } - $Period_0_Name = strftime('%b',mktime(0,0,0,Date('m'),Date('d'),Date('Y'))); - $Period_1_Name = strftime('%b',mktime(0,0,0,Date('m')-1,Date('d'),Date('Y'))); - $Period_2_Name = strftime('%b',mktime(0,0,0,Date('m')-2,Date('d'),Date('Y'))); - $Period_3_Name = strftime('%b',mktime(0,0,0,Date('m')-3,Date('d'),Date('Y'))); - $Period_4_Name = strftime('%b',mktime(0,0,0,Date('m')-4,Date('d'),Date('Y'))); - $Period_5_Name = strftime('%b',mktime(0,0,0,Date('m')-5,Date('d'),Date('Y'))); + $Period_0_Name = GetMonthText(mktime(0,0,0,Date('m'),Date('d'),Date('Y'))); + $Period_1_Name = GetMonthText(mktime(0,0,0,Date('m')-1,Date('d'),Date('Y'))); + $Period_2_Name = GetMonthText(mktime(0,0,0,Date('m')-2,Date('d'),Date('Y'))); + $Period_3_Name = GetMonthText(mktime(0,0,0,Date('m')-3,Date('d'),Date('Y'))); + $Period_4_Name = GetMonthText(mktime(0,0,0,Date('m')-4,Date('d'),Date('Y'))); + $Period_5_Name = GetMonthText(mktime(0,0,0,Date('m')-5,Date('d'),Date('Y'))); include ('includes/PDFInventoryPlanPageHeader.inc'); Modified: trunk/Labels.php =================================================================== --- trunk/Labels.php 2012-05-04 21:55:53 UTC (rev 5315) +++ trunk/Labels.php 2012-05-05 05:04:04 UTC (rev 5316) @@ -7,19 +7,20 @@ include('includes/header.inc'); //define PaperSize array sizes in pdf points -$PaperSize = array('A4', - 'A4_Landscape', - 'A5', - 'A5_Landscape', - 'A3', - 'A3_Landscape', - 'Letter', - 'Letter_Landscape', - 'Legal', - 'Legal_Landscape', - '28mm_x_45mm_label'); +$PaperSize = array(); +$PaperSize['A4']['PageHeight'] = 297; +$PaperSize['A4']['PageWidth'] = 210; +$PaperSize['A5']['PageHeight'] = 210; +$PaperSize['A5']['PageWidth'] = 148; +$PaperSize['A3']['PageHeight'] = 420; +$PaperSize['A3']['PageWidth'] = 297; +$PaperSize['Letter']['PageHeight'] = 279.4; +$PaperSize['Letter']['PageWidth'] = 215.9; +$PaperSize['Legal']['PageHeight'] = 355.6; +$PaperSize['Legal']['PageWidth'] = 215.9; + echo '<p class="page_title_text"> <img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Label Template Maintenance') . '" alt="" />' . $title. ' @@ -39,11 +40,11 @@ vpos='" . $_POST['VPos' . $i] . "', hpos='" . $_POST['HPos' . $i] . "', fontsize='" . $_POST['FontSize' . $i] . "', - barcode='" . $_POST['Barcode' . $i] . "' + barcode='" . $_POST['Barcode' . $i] . "' WHERE labelfieldid='" . $_POST['LabelFieldID' . $i] . "'", $db); } else { - prnMsg (_('Entries for Vertical Position Horizonal Position and Font Size must be integers.'),'error'); + prnMsg (_('Entries for Vertical Position, Horizonal Position and Font Size must be integers.'),'error'); } } } @@ -79,20 +80,30 @@ prnMsg( _('The label description may not be empty'), 'error'); } $Message = ''; + + if (isset($_POST['PaperSize']) AND $_POST['PaperSize']!='custom'){ + $_POST['PageWidth'] = $PaperSize[$_POST['PaperSize']]['PageWidth']; + $_POST['PageHeight'] = $PaperSize[$_POST['PaperSize']]['PageHeight']; + } elseif ($_POST['PaperSize']=='custom' AND !isset($_POST['PageWidth'])){ + $_POST['PageWidth'] = 0; + $_POST['PageHeight'] = 0; + } + if (isset($SelectedLabelID)) { /*SelectedLabelID could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ - $sql = "UPDATE labels SET papersize ='" . $_POST['PaperSize'] . "', - description = '" . $_POST['Description'] . "', + $sql = "UPDATE labels SET description = '" . $_POST['Description'] . "', height = '" . $_POST['Height'] . "', topmargin = '". $_POST['TopMargin'] . "', width = '". $_POST['Width'] . "', leftmargin = '". $_POST['LeftMargin'] . "', rowheight = '". $_POST['RowHeight'] . "', - columnwidth = '". $_POST['ColumnWidth'] . "' + columnwidth = '". $_POST['ColumnWidth'] . "', + pagewidth = '" . $_POST['PageWidth'] . "', + pageheight = '" . $_POST['PageHeight'] . "' WHERE labelid = '" . $SelectedLabelID . "'"; $ErrMsg = _('The update of this label template failed because'); @@ -104,22 +115,24 @@ /*Selected label is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new label form */ - $sql = "INSERT INTO labels (papersize, - description, + $sql = "INSERT INTO labels (description, height, topmargin, width, leftmargin, rowheight, - columnwidth) - VALUES ('" . $_POST['PaperSize'] . "', - '" . $_POST['Description'] . "', + columnwidth, + pagewidth, + pageheight) + VALUES ('" . $_POST['Description'] . "', '" . $_POST['Height'] . "', '" . $_POST['TopMargin'] . "', '" . $_POST['Width'] . "', '" . $_POST['LeftMargin'] . "', '" . $_POST['RowHeight'] . "', - '" . $_POST['ColumnWidth'] . "')"; + '" . $_POST['ColumnWidth'] . "', + '" . $_POST['PageWidth'] . "', + '" . $_POST['PageHeight'] . "')"; $ErrMsg = _('The addition of this label failed because'); $result = DB_query($sql,$db,$ErrMsg); @@ -135,7 +148,8 @@ unset( $_POST['LeftMargin']); unset( $_POST['ColumnWidth']); unset( $_POST['RowHeight']); - + unset($_POST['PageWidth']); + unset($_POST['PageHeight']); } prnMsg($Message); @@ -156,7 +170,8 @@ $sql = "SELECT labelid, description, - papersize, + pagewidth, + pageheight, height, width, topmargin, @@ -173,7 +188,9 @@ echo '<table class="selection"> <tr> <th>' . _('Description') . '</th> - <th>' . _('Page Size') . '</th> + <th>' . _('Rows x Cols') . '</th> + <th>' . _('Page Width') . '</th> + <th>' . _('Page Height') . '</th> <th>' . _('Height') . '</th> <th>' . _('Width') . '</th> <th>' . _('Row Height') . '</th> @@ -189,29 +206,65 @@ echo '<tr class="OddTableRows">'; $k++; } - - printf('<td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href="%sSelectedLabelID=%s">' . _('Edit') . '</a></td> - <td><a href="%sSelectedLabelID=%s&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this label?') . '\');">' . _('Delete') . '</a></td> - </tr>', - $myrow['description'], - $myrow['papersize'], - $myrow['height'], - $myrow['width'], - $myrow['rowheight'], - $myrow['columnwidth'], - htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?', - $myrow['labelid'], - htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?', - $myrow['labelid'], - $rootpath . '/LabelFields.php?', - $myrow['labelid']); - + $NoOfRows = floor(($myrow['pageheight']-$myrow['topmargin'])/$myrow['rowheight']); + $NoOfCols = floor(($myrow['pagewidth']-$myrow['leftmargin'])/$myrow['columnwidth']); + + foreach ($PaperSize as $PaperName=>$PaperType) { + if ($PaperType['PageWidth'] == $myrow['pagewidth'] AND $PaperType['PageHeight'] == $myrow['pageheight']) { + $Paper = $PaperName; + } + } + if (isset($Paper)){ + printf('<td>%s</td> + <td>%s</td> + <td colspan="2">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td><a href="%sSelectedLabelID=%s">' . _('Edit') . '</a></td> + <td><a href="%sSelectedLabelID=%s&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this label?') . '\');">' . _('Delete') . '</a></td> + </tr>', + $myrow['description'], + $NoOfRows . ' x ' . $NoOfCols, + $Paper, + $myrow['height'], + $myrow['width'], + $myrow['rowheight'], + $myrow['columnwidth'], + htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?', + $myrow['labelid'], + htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?', + $myrow['labelid'], + $rootpath . '/LabelFields.php?', + $myrow['labelid']); + } else { + printf('<td>%s</td> + <td>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td><a href="%sSelectedLabelID=%s">' . _('Edit') . '</a></td> + <td><a href="%sSelectedLabelID=%s&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this label?') . '\');">' . _('Delete') . '</a></td> + </tr>', + $myrow['description'], + $NoOfRows . ' x ' . $NoOfCols, + $myrow['pagewidth'], + $myrow['pageheight'], + $myrow['height'], + $myrow['width'], + $myrow['rowheight'], + $myrow['columnwidth'], + htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?', + $myrow['labelid'], + htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?', + $myrow['labelid'], + $rootpath . '/LabelFields.php?', + $myrow['labelid']); + } } //END WHILE LIST LOOP @@ -233,7 +286,8 @@ if (isset($SelectedLabelID)) { //editing an existing label - $sql = "SELECT papersize, + $sql = "SELECT pagewidth, + pageheight, description, height, width, @@ -247,7 +301,8 @@ $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); - $_POST['PaperSize'] = $myrow['papersize']; + $_POST['PageWidth'] = $myrow['pagewidth']; + $_POST['PageHeight'] = $myrow['pageheight']; $_POST['Description'] = $myrow['description']; $_POST['Height'] = $myrow['height']; $_POST['TopMargin'] = $myrow['topmargin']; @@ -255,6 +310,12 @@ $_POST['LeftMargin'] = $myrow['leftmargin']; $_POST['RowHeight'] = $myrow['rowheight']; $_POST['ColumnWidth'] = $myrow['columnwidth']; + + foreach ($PaperSize as $PaperName=>$PaperType) { + if ($PaperType['PageWidth'] == $myrow['pagewidth'] AND $PaperType['PageHeight'] == $myrow['pageheight']) { + $_POST['PaperSize'] = $PaperName; + } + } echo '<input type="hidden" name="SelectedLabelID" value="' . $SelectedLabelID . '" />'; @@ -274,9 +335,14 @@ </tr> <tr> <td>' . _('Label Paper Size') . ':</td> - <td><select name="PaperSize">'; + <td><select name="PaperSize" onchange="ReloadForm(submit)" >'; -foreach($PaperSize as $PaperType) { +if (!isset($_POST['PaperSize'])){ + echo '<option selected="selected" value="custom">' . _('Custom Size') . '</option>'; +} else { + echo '<option value="custom">' . _('Custom Size') . '</option>'; +} +foreach($PaperSize as $PaperType=>$PaperSizeElement) { if (isset($_POST['PaperSize']) AND $PaperType==$_POST['PaperSize']) { echo '<option selected="selected" value="'; } else { @@ -289,6 +355,13 @@ echo '</select></td> </tr>'; + +if (!isset($_POST['PageHeight'])) { + $_POST['PageHeight']=0; +} +if (!isset($_POST['PageWidth'])) { + $_POST['PageWidth']=0; +} if (!isset($_POST['Height'])) { $_POST['Height']=0; } @@ -308,6 +381,21 @@ if (!isset($_POST['ColumnWidth'])) { $_POST['ColumnWidth']=0; } + +if (!isset($_POST['PaperSize']) OR $_POST['PaperSize'] == 'Custom') { + if (!isset($_POST['PageWidth'])){ + $_POST['PageWidth'] = 0; + $_POST['PageHeight'] = 0; + } + echo '<tr> + <td>' . _('Page Width') . '</td> + <td><input type="text" size="4" maxlength="4" name="PageWidth" value="' . $_POST['PageWidth'] . '" /></td> + </tr> + <tr> + <td>' . _('Page Height') . '</td> + <td><input type="text" size="4" maxlength="4" name="PageHeight" value="' . $_POST['PageHeight'] . '" /></td> + </tr>'; +} echo '<tr> <td>' . _('Label Height') . ' - (He):</td> <td><input type="text" name="Height" size="4" maxlength="4" value="' . $_POST['Height'] . '" /></td> @@ -375,7 +463,7 @@ } echo '<input type="hidden" name="LabelFieldID' . $i . '" value="' . $myrow['labelfieldid'] . '" /> - <td><select name="FieldName' . $i . '">'; + <td><select name="FieldName' . $i . '" onchange="ReloadForm(submit)">'; if ($myrow['fieldvalue']=='itemcode'){ echo '<option selected="selected" value="itemcode">' . _('Item Code') . '</option>'; } else { @@ -400,7 +488,7 @@ <td><input type="text" name="VPos' . $i . '" size="4" maxlength="4" value="' . $myrow['vpos'] . '" /></td> <td><input type="text" name="HPos' . $i . '" size="4" maxlength="4" value="' . $myrow['hpos'] . '" /></td> <td><input type="text" name="FontSize' . $i . '" size="4" maxlength="4" value="' . $myrow['fontsize'] . '" /></td> - <td><select name="Barcode' . $i . '">'; + <td><select name="Barcode' . $i . '" onchange="ReloadForm(submit)">'; if ($myrow['barcode']==0){ echo '<option selected="selected" value="0">' . _('No') . '</option> <option value="1">' . _('Yes') . '</option>'; @@ -445,6 +533,10 @@ <div class="centre"> <input type="submit" name="submit" value="' . _('Enter Information') . '" /> </div> + <br /> + <div class="centre"> + <a href="' . $rootpath . '/PDFPrintLabel.php">' . _('Print Labels') . '</a> + </div> </form>'; include('includes/footer.inc'); Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2012-05-04 21:55:53 UTC (rev 5315) +++ trunk/PDFPrintLabel.php 2012-05-05 05:04:04 UTC (rev 5316) @@ -6,7 +6,7 @@ $PtsPerMM = 2.83465; //pdf points per mm -if (isset($_POST['ShowLabels']) +if ((isset($_POST['ShowLabels']) OR isset($_POST['SelectAll'])) AND isset($_POST['FromCriteria']) AND mb_strlen($_POST['FromCriteria'])>=1 AND isset($_POST['ToCriteria']) @@ -65,14 +65,27 @@ <th>' . _('Item Description') . '</th> <th>' . _('Price') . '</th> <th>' . _('Print') . ' ?</th> - </tr>'; + </tr> + <tr><th colspan="4"><input type="submit" name="SelectAll" value="' . _('Select All Labels') . '" /><input type="checkbox" name="CheckAll" '; + if (isset($_POST['CheckAll'])){ + echo 'checked="checked" '; + } + echo 'onchange="ReloadForm(SelectAll)" /></td> + </tr>'; + $i=0; while ($LabelRow = DB_fetch_array($LabelsResult)){ echo '<tr> <td>' . $LabelRow['stockid'] . '</td> <td>' . $LabelRow['description'] . '</td> <td class="number">' . locale_number_format($LabelRow['price'],$LabelRow['decimalplaces']) . '</td> - <td><input type="checkbox" checked="checked" name="PrintLabel' . $i .'" /></td> + <td>'; + if (isset($_POST['SelectAll']) AND isset($_POST['CheckAll'])) { + echo '<input type="checkbox" checked="checked" name="PrintLabel' . $i .'" />'; + } else { + echo '<input type="checkbox" name="PrintLabel' . $i .'" />'; + } + echo '</td> </tr>'; echo '<input type="hidden" name="StockID' . $i . '" value="' . $LabelRow['stockid'] . '" /> <input type="hidden" name="Description' . $i . '" value="' . $LabelRow['description'] . '" /> @@ -84,18 +97,41 @@ echo '</table> <input type="hidden" name="NoOfLabels" value="' . $i . '" /> <input type="hidden" name="LabelID" value="' . $_POST['LabelID'] . '" /> + <input type="hidden" name="FromCriteria" value="' . $_POST['FromCriteria'] . '" /> + <input type="hidden" name="ToCriteria" value="' . $_POST['ToCriteria'] . '" /> + <input type="hidden" name="SalesType" value="' . $_POST['SalesType'] . '" /> + <input type="hidden" name="Currency" value="' . $_POST['Currency'] . '" /> + <input type="hidden" name="EffectiveDate" value="' . $_POST['EffectiveDate'] . '" /> <br /> <div class="centre"> + <input type="submit" name="PrintLabels" value="'. _('Print Labels'). '" /> </div> + <br /> + <div class="centre"> + <a href="'. $rootpath . '/Labels.php">' . _('Label Template Maintenance'). '</a> + </div> </form>'; exit; } if (isset($_POST['PrintLabels']) - AND isset($_POST['NoOfLabels'])) { - - $result = DB_query("SELECT papersize, - description, + AND isset($_POST['NoOfLabels']) + AND $_POST['NoOfLabels']>0){ + $NoOfLabels = 0; + for ($i=0;$i < $_POST['NoOfLabels'];$i++){ + if (isset($_POST['PrintLabel'.$i])){ + $NoOfLabels++; + } + } + if ($NoOfLabels ==0){ + prnMsg(_('There are no labels selected to print'),'info'); + } +} +if (isset($_POST['PrintLabels']) AND $NoOfLabels>0) { + + $result = DB_query("SELECT description, + pagewidth*" . $PtsPerMM . " as page_width, + pageheight*" . $PtsPerMM . " as page_height, width*" . $PtsPerMM . " as label_width, height*" . $PtsPerMM . " as label_height, rowheight*" . $PtsPerMM . " as label_rowheight, @@ -106,14 +142,7 @@ WHERE labelid='" . $_POST['LabelID'] . "'", $db); $LabelDimensions = DB_fetch_array($result); - $PaperSize = $LabelDimensions['papersize']; - include('includes/PDFStarter.php'); - $Top_Margin = $LabelDimensions['label_topmargin']; - $Left_Margin = $LabelDimensions['label_leftmargin']; - - $pdf->addInfo('Title', $LabelDimensions['description'] . ' ' . _('Price Labels') ); - $pdf->addInfo('Subject', $LabelDimensions['description'] . ' ' . _('Price Labels') ); - + $result = DB_query("SELECT fieldvalue, vpos, hpos, @@ -139,6 +168,19 @@ $i++; } + $PaperSize = 'Custom'; // so PDF starter wont default the DocumentPaper + $DocumentPaper = array($LabelDimensions['page_width'],$LabelDimensions['page_height']); + include('includes/PDFStarter.php'); + $Top_Margin = $LabelDimensions['label_topmargin']; + $Left_Margin = $LabelDimensions['label_leftmargin']; + $Page_Height = $LabelDimensions['page_height']; + $Page_Width = $LabelDimensions['page_width']; + $Right_Margin =0; + $Bottom_Margin =0; + + $pdf->addInfo('Title', $LabelDimensions['description'] . ' ' . _('Price Labels') ); + $pdf->addInfo('Subject', $LabelDimensions['description'] . ' ' . _('Price Labels') ); + $style = array( 'position' => '', 'align' => 'C', @@ -160,9 +202,9 @@ $YPos = $Page_Height - $Top_Margin; //top of current label $XPos = $Left_Margin; // left of current label - for ($i=0;$i <= $_POST['NoOfLabels'];$i++){ + for ($i=0;$i < $_POST['NoOfLabels'];$i++){ if ($_POST['PrintLabel'.$i]=='on'){ - + $NoOfLabels--; foreach ($LabelFields as $Field){ //print_r($Field); @@ -183,34 +225,36 @@ * Note that the YPos for this function is based on the opposite origin for the Y axis i.e from the bottom not from the top! */ - $pdf->write1DBarcode(str_replace('_','',$Value), 'C128',$XPos+$Field['HPos'],$Page_Height - $YPos+$LabelDimensions['label_height']-$Field['VPos']-$Field['FontSize'],$LabelDimensions['label_width']-$Field['HPos'], $Field['FontSize'], 0.4, $style, 'N'); + $pdf->write1DBarcode(str_replace('_','',$Value), 'C39',$XPos+$Field['HPos'],$Page_Height - $YPos+$LabelDimensions['label_height']-$Field['VPos']-$Field['FontSize'],$LabelDimensions['label_width']-$Field['HPos'], $Field['FontSize'], 0.4, $style, 'N'); } else { $LeftOvers = $pdf->addTextWrap($XPos+$Field['HPos'],$YPos-$LabelDimensions['label_height']+$Field['VPos'],$LabelDimensions['label_width']-$Field['HPos']-20,$Field['FontSize'],$Value); } } // end loop through label fields - //setup $YPos and $XPos for the next label - if (($YPos - $LabelDimensions['label_rowheight']) < $LabelDimensions['label_height']){ - /* not enough space below the above label to print a new label - * so the above was the last label in the column - * need to start either a new column or new page - */ - if (($Page_Width - $XPos - $LabelDimensions['label_columnwidth']) < $LabelDimensions['label_width']) { - /* Not enough space to start a new column so we are into a new page + if ($NoOfLabels>0) { + //setup $YPos and $XPos for the next label + if (($YPos - $LabelDimensions['label_rowheight']) < $LabelDimensions['label_height']){ + /* not enough space below the above label to print a new label + * so the above was the last label in the column + * need to start either a new column or new page */ - $pdf->newPage(); - $PageNumber++; - $YPos = $Page_Height - $Top_Margin; //top of next label - $XPos = $Left_Margin; // left of next label + if (($Page_Width - $XPos - $LabelDimensions['label_columnwidth']) < $LabelDimensions['label_width']) { + /* Not enough space to start a new column so we are into a new page + */ + $pdf->newPage(); + $PageNumber++; + $YPos = $Page_Height - $Top_Margin; //top of next label + $XPos = $Left_Margin; // left of next label + } else { + /* There is enough space for another column */ + $YPos = $Page_Height - $Top_Margin; //back to the top of next label column + $XPos += $LabelDimensions['label_columnwidth']; // left of next label + } } else { - /* There is enough space for another column */ - $YPos = $Page_Height - $Top_Margin; //back to the top of next label column - $XPos += $LabelDimensions['label_columnwidth']; // left of next label + /* There is space below to print a label + */ + $YPos -= $LabelDimensions['label_rowheight']; //Top of next label } - } else { - /* There is space below to print a label - */ - $YPos -= $LabelDimensions['label_rowheight']; //Top of next label - } + }//end if there is another label to print } //this label is set to print } //loop through labels selected to print @@ -303,6 +347,10 @@ <div class="centre"> <input type="submit" name="ShowLabels" value="'. _('Show Labels'). '" /> </div> + <br /> + <div class="centre"> + <a href="'. $rootpath . '/Labels.php">' . _('Label Template Maintenance'). '</a> + </div> </form>'; } Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2012-05-04 21:55:53 UTC (rev 5315) +++ trunk/SelectOrderItems.php 2012-05-05 05:04:04 UTC (rev 5316) @@ -750,7 +750,7 @@ stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' stockcategory.stocktype='L') AND stockmaster.mbflag <>'G' AND stockmaster.description " . LIKE . " '" . $SearchString . "' AND stockmaster.discontinued=0 @@ -761,7 +761,7 @@ stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L') AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 AND stockmaster.description " . LIKE . " '" . $SearchString . "' @@ -780,7 +780,7 @@ stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L') AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 @@ -791,7 +791,7 @@ stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L') AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 @@ -806,7 +806,7 @@ stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L') AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 ORDER BY stockmaster.stockid"; @@ -816,7 +816,7 @@ stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L') AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 AND stockmaster.categoryid='" . $_POST['StockCat'] . "' Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-05-04 21:55:53 UTC (rev 5315) +++ trunk/doc/Change.log 2012-05-05 05:04:04 UTC (rev 5316) @@ -1,5 +1,10 @@ webERP Change Log +4/5/12 Phil: Labels.php PDFPrintLabel.php fine tuning of new labels code +4/5/12 Phil: Fixed customer type name displayed when it is successfully deleted as reported by James Dupin +4/5/12 Phil: Attempt to create simple work around for the limitations of strftime function and resulting character encoding issues - added new functions to get multi-lingual months GetMonthText() and week day names GetWeekDayText(). Not sure if there is any international consensus on the best format here - but can use the DefaultDateFormat or $_SESSION['Language'] if others want it a different way +4/5/12 Phil: Allow SelectOrderItems.php to select labour type items +4/5/12 Phil: updated tcpdf to 5.9.160 4/5/12 Phil: Default lastcostupdate to 0000-00-00 to avoid issues inserting new items. 1/5/12 MTPubRadio: Measurement unit in FormDesigner.php should be points instead of millimeters. 1/5/12 MTPubRadio: Fixed Purch Order PDF file text of Order Total- Excl tax does not align with amount horizontally. Modified: trunk/includes/DateFunctions.inc =================================================================== --- trunk/includes/DateFunctions.inc 2012-05-04 21:55:53 UTC (rev 5315) +++ trunk/includes/DateFunctions.inc 2012-05-05 05:04:04 UTC (rev 5316) @@ -78,8 +78,6 @@ } //end of Is_Date function -//_______________________________________________________________ - function MonthAndYearFromSQLDate($DateEntry) { @@ -94,20 +92,85 @@ if (mb_strlen($Date_Array[2])>4) { $Date_Array[2]= mb_substr($Date_Array[2],0,2); } - $str = strftime('%B %Y', mktime(0,0,0, (int)$Date_Array[1],(int)$Date_Array[2],(int)$Date_Array[0])); - //This code to handle characters in windows system which not encoded in UTF-8. Those non-utf8 code leads to display garbage - $encode = mb_detect_encoding($str,'GB2312,BIG5,UTF-8'); - - if($encode=='EUC-CN'){ - return iconv('GB2312','UTF-8',$str); - }elseif($encode=='EUC-TW' or $encode=='BIG-5'){ - return iconv('BIG5','UTF-8', $str); - }else{ - return ucfirst($str); - } - + + $MonthName = GetMonthText(date('n', mktime(0,0,0, (int)$Date_Array[1],(int)$Date_Array[2],(int)$Date_Array[0]))); + return $MonthName . ' ' . date('Y', mktime(0,0,0, (int)$Date_Array[1],(int)$Date_Array[2],(int)$Date_Array[0])); + } +function GetMonthText($MonthNumber){ + switch ($MonthNumber) { + case 1: + $Month = _('January'); + break; + case 2: + $Month = _('February'); + break; + case 3: + $Month = _('March'); + break; + case 4: + $Month = _('April'); + break; + case 5: + $Month = _('May'); + break; + case 6: + $Month = _('June'); + break; + case 7: + $Month = _('July'); + break; + case 8: + $Month = _('August'); + break; + case 9: + $Month = _('September'); + break; + case 10: + $Month = _('October'); + break; + case 11: + $Month = _('November'); + break; + case 12: + $Month = _('December'); + break; + } + return $Month; +} + +function GetWeekDayText ($WeekDayNumber){ + switch ($WeekDayNumber) { + case 0: + $Day = _('Sunday'); + break; + case 1: + $Day = _('Monday'); + break; + case 2: + $Day = _('Tuesday'); + break; + case 3: + $Day = _('Wednesday'); + break; + case 4: + $Day = _('Thursday'); + break; + case 5: + $Day = _('Friday'); + break; + case 6: + $Day = _('Saturday'); + break; + } + return $Day; +} + +function DisplayDateTime () { + return GetWeekDayText(date('w')) . ' ' . date('j') . ' ' . GetMonthText(date('n')) . ' ' . date('G:i') ; +} + function DayOfWeekFromSQLDate($DateEntry) { if (mb_strpos($DateEntry,'/')) { @@ -126,6 +189,7 @@ } + function DayOfMonthFromSQLDate($DateEntry) { if (mb_strpos($DateEntry,'/')) { Modified: trunk/includes/PDFStarter.php =================================================================== --- trunk/includes/PDFStarter.php 2012-05-04 21:55:53 UTC (rev 5315) +++ trunk/includes/PDFStarter.php 2012-05-05 05:04:04 UTC (rev 5316) @@ -22,148 +22,144 @@ } /* Javier: TCPDF supports 45 standard ISO (DIN) paper formats and 4 american common formats and does this cordinates calculation. - However, reports use this units */ +However, reports use this units */ switch ($PaperSize) { case 'A4': - // Javier: Now I use the native TCPDF constructor to which I send these values in each case, // this should have been done whith FPDF which use the same values in its constructor. + $DocumentPaper = 'A4'; + $DocumentOrientation ='P'; + + // Javier: DIN-A4 is 210 mm width, i.e., 595'2756 points (inches * 72 ppi) + $Page_Width=595; + $Page_Height=842; + $Top_Margin=30; + $Bottom_Margin=30; + $Left_Margin=40; + $Right_Margin=30; + break; - $DocumentPaper = 'A4'; $DocumentOrientation ='P'; - -// Javier: DIN-A4 is 210 mm width, i.e., 595'2756 points (inches * 72 ppi) - $Page_Width=595; - $Page_Height=842; - $Top_Margin=30; - $Bottom_Margin=30; - $Left_Margin=40; - $Right_Margin=30; - break; - case 'A4_Landscape': + + $DocumentPaper = 'A4'; + $DocumentOrientation ='L'; + + $Page_Width=842; + $Page_Height=595; + $Top_Margin=30; + $Bottom_Margin=30; + $Left_Margin=40; + $Right_Margin=30; + break; - $DocumentPaper = 'A4'; $DocumentOrientation ='L'; - - $Page_Width=842; - $Page_Height=595; - $Top_Margin=30; - $Bottom_Margin=30; - $Left_Margin=40; - $Right_Margin=30; - break; - case 'A5': - $DocumentPaper = 'A5'; $DocumentOrientation ='P'; + $DocumentPaper = 'A5'; + $DocumentOrientation ='P'; + + $Page_Width=421; + $Page_Height=595; + $Top_Margin=30; + $Bottom_Margin=30; + $Left_Margin=40; + $Right_Margin=30; + break; - $Page_Width=421; - $Page_Height=595; - $Top_Margin=30; - $Bottom_Margin=30; - $Left_Margin=40; - $Right_Margin=30; - break; - case 'A5_Landscape': + + $DocumentPaper = 'A5'; + $DocumentOrientation ='L'; + + $Page_Width=595; + $Page_Height=421; + $Top_Margin=30; + $Bottom_Margin=30; + $Left_Margin=40; + $Right_Margin=30; + break; - $DocumentPaper = 'A5'; $DocumentOrientation ='L'; - - $Page_Width=595; - $Page_Height=421; - $Top_Margin=30; - $Bottom_Margin=30; - $Left_Margin=40; - $Right_Margin=30; - break; - case 'A3': - $DocumentPaper = 'A3'; $DocumentOrientation ='P'; + $DocumentPaper = 'A3'; + $DocumentOrientation ='P'; + + $Page_Width=842; + $Page_Height=1190; + $Top_Margin=50; + $Bottom_Margin=50; + $Left_Margin=50; + $Right_Margin=40; + break; - $Page_Width=842; - $Page_Height=1190; - $Top_Margin=50; - $Bottom_Margin=50; - $Left_Margin=50; - $Right_Margin=40; - break; - case 'A3_landscape': - $DocumentPaper = 'A3'; $DocumentOrientation ='L'; + $DocumentPaper = 'A3'; + $DocumentOrientation ='L'; + + $Page_Width=1190; + $Page_Height=842; + $Top_Margin=50; + $Bottom_Margin=50; + $Left_Margin=50; + $Right_Margin=40; + break; - $Page_Width=1190; - $Page_Height=842; - $Top_Margin=50; - $Bottom_Margin=50; - $Left_Margin=50; - $Right_Margin=40; - break; - case 'letter': + + $DocumentPaper = 'LETTER'; + $DocumentOrientation ='P'; + + $Page_Width=612; + $Page_Height=792; + $Top_Margin=30; + $Bottom_Margin=30; + $Left_Margin=30; + $Right_Margin=25; + break; - $DocumentPaper = 'LETTER'; $DocumentOrientation ='P'; - - $Page_Width=612; - $Page_Height=792; - $Top_Margin=30; - $Bottom_Margin=30; - $Left_Margin=30; - $Right_Margin=25; - break; - case 'letter_landscape': - $DocumentPaper = 'LETTER'; $DocumentOrientation ='L'; - - $Page_Width=792; - $Page_Height=612; - $Top_Margin=30; - $Bottom_Margin=30; - $Left_Margin=30; - $Right_Margin=25; - break; - + $DocumentPaper = 'LETTER'; + $DocumentOrientation ='L'; + + $Page_Width=792; + $Page_Height=612; + $Top_Margin=30; + $Bottom_Margin=30; + $Left_Margin=30; + $Right_Margin=25; + break; + case 'legal': - $DocumentPaper = 'LEGAL'; - $DocumentOrientation ='P'; + $DocumentPaper = 'LEGAL'; + $DocumentOrientation ='P'; + + $Page_Width=612; + $Page_Height=1008; + $Top_Margin=50; + $Bottom_Margin=40; + $Left_Margin=30; + $Right_Margin=25; + break; - $Page_Width=612; - $Page_Height=1008; - $Top_Margin=50; - $Bottom_Margin=40; - $Left_Margin=30; - $Right_Margin=25; - break; - case 'legal_landscape': - $DocumentPaper = 'LEGAL'; - $DocumentOrientation ='L'; - - $Page_Width=1008; - $Page_Height=612; - $Top_Margin=50; - $Bottom_Margin=40; - $Left_Margin=30; - $Right_Margin=25; - break; - - case '28mm_x_45mm_label': - //$DocumentPaper can be an array or width/height of paper size - //as an alternative to the string ISO paper size required by tcpdf - $DocumentPaper = array(127.6,79.4); - $DocumentOrientation='L'; - $Page_Width=127.6; - $Page_Height=79.4; - $Top_Margin=0; - $Bottom_Margin=0; - $Left_Margin=0; - $Right_Margin=0; - break; + $DocumentPaper = 'LEGAL'; + $DocumentOrientation ='L'; + + $Page_Width=1008; + $Page_Height=612; + $Top_Margin=50; + $Bottom_Margin=40; + $Left_Margin=30; + $Right_Margin=25; + break; + default: + $DocumentOrientation = 'L'; + break; } // Javier: I correct the call to the constructor to match TCPDF (and FPDF ;-) Modified: trunk/includes/footer.inc =================================================================== --- trunk/includes/footer.inc 2012-05-04 21:55:53 UTC (rev 5315) +++ trunk/includes/footer.inc 2012-05-05 05:04:04 UTC (rev 5316) @@ -7,7 +7,7 @@ echo '<tr>'; echo '<td style="width:33%"></td><td class="footer">'; echo '<img src="'. $rootpath . '/' . $_SESSION['LogoFile'] . '" width="120" alt="webERP" title="webERP ' . _('Copyright') . ' © weberp.org - ' . date('Y') . '" /></td>'; -echo '<td class="footer" style="text-align: right;width:33%">'.strftimeToUTF8((strftime('%A'))).', '.(date($_SESSION['DefaultDateFormat']).' | '.(strftimeToUTF8(strftime(($DefaultClock==12) ? '%I:%M %p' : '%H:%M')))).'</td>'; +echo '<td class="footer" style="text-align: right;width:33%">'. DisplayDateTime() .'</td>'; echo '</tr>'; echo '<tr><td colspan="3" class="footer">webERP ' ._('version') .' ' . $_SESSION['VersionNumber'] . '</td></tr>'; @@ -21,22 +21,5 @@ echo '</div>'; echo '</body>'; echo '</html>'; - function strftimeToUTF8 ($str) { - - $encoding = mb_detect_encoding($str,"GB2312,BIG5,UTF-8"); - switch($encoding){ - case 'EUC-CN': - return iconv('GB2312','UTF-8',$str); - break; - case 'EUC-TW': - return iconv('BIG5','UTF-8',$str); - break; - case 'BIG-5': - return iconv('BIG5','UTF-8',$str); - break; - default: - return $str; - } - } ?> Modified: trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po 2012-05-04 21:55:53 UTC (rev 5315) +++ trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po 2012-05-05 05:04:04 UTC (rev 5316) @@ -13189,7 +13189,7 @@ #: index.php:511 #, fuzzy msgid "Create a New Tender" -msgstr "Planungskalender anlegen" +msgstr "Ausschreibung erstellen" #: index.php:516 #, fuzzy Modified: trunk/sql/mysql/upgrade4.07-4.08.sql =================================================================== --- trunk/sql/mysql/upgrade4.07-4.08.sql 2012-05-04 21:55:53 UTC (rev 5315) +++ trunk/sql/mysql/upgrade4.07-4.08.sql 2012-05-05 05:04:04 UTC (rev 5316) @@ -76,7 +76,16 @@ ALTER TABLE `locations` ADD UNIQUE `locationname` (`locationname`); -ALTER TABLE `stockmaster` CHANGE `lastcostupdate` `lastcostupdate` DATE NOT NULL DEFAULT '0000-00-00' +ALTER TABLE `stockmaster` CHANGE `lastcostupdate` `lastcostupdate` DATE NOT NULL DEFAULT '0000-00-00'; +ALTER TABLE `labels` CHANGE `papersize` `pagewidth` FLOAT NOT NULL DEFAULT '0'; +ALTER TABLE `labels` ADD `pageheight` FLOAT NOT NULL DEFAULT '0' AFTER `pagewidth`; +ALTER TABLE `labels` CHANGE `height` `height` FLOAT NOT NULL DEFAULT '0'; +ALTER TABLE `labels` CHANGE `width` `width` FLOAT NOT NULL DEFAULT '0'; +ALTER TABLE `labels` CHANGE `topmargin` `topmargin` FLOAT NOT NULL DEFAULT '0'; +ALTER TABLE `labels` CHANGE `leftmargin` `leftmargin` FLOAT NOT NULL DEFAULT '0'; +ALTER TABLE `labels` CHANGE `rowheight` `rowheight` FLOAT NOT NULL DEFAULT '0'; +ALTER TABLE `labels` CHANGE `columnwidth` `columnwidth` FLOAT NOT NULL DEFAULT '0'; + UPDATE config SET confvalue='4.08' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-05-07 09:35:26
|
Revision: 5318 http://web-erp.svn.sourceforge.net/web-erp/?rev=5318&view=rev Author: daintree Date: 2012-05-07 09:35:20 +0000 (Mon, 07 May 2012) Log Message: ----------- Modified Paths: -------------- trunk/PaymentMethods.php trunk/doc/Change.log Modified: trunk/PaymentMethods.php =================================================================== --- trunk/PaymentMethods.php 2012-05-05 08:46:26 UTC (rev 5317) +++ trunk/PaymentMethods.php 2012-05-07 09:35:20 UTC (rev 5318) @@ -71,7 +71,8 @@ SET paymentname='" . $_POST['MethodName'] . "', paymenttype = '" . $_POST['ForPayment'] . "', receipttype = '" . $_POST['ForReceipt'] . "', - usepreprintedstationery = '" . $_POST['UsePrePrintedStationery']. "' + usepreprintedstationery = '" . $_POST['UsePrePrintedStationery']. "', + opencashdrawer = '" . $_POST['OpenCashDrawer'] . "' WHERE paymentname " . LIKE . " '".$OldName."'"; } else { @@ -91,17 +92,19 @@ $InputError = 1; prnMsg( _('The payment method can not be created because another with the same name already exists.'),'error'); } else { - $sql = "INSERT INTO paymentmethods ( paymentname, + $sql = "INSERT INTO paymentmethods (paymentname, paymenttype, receipttype, - usepreprintedstationery) + usepreprintedstationery, + opencashdrawer) VALUES ('" . $_POST['MethodName'] ."', '" . $_POST['ForPayment'] ."', '" . $_POST['ForReceipt'] ."', - '" . $_POST['UsePrePrintedStationery'] ."')"; + '" . $_POST['UsePrePrintedStationery'] ."', + '" . $_POST['OpenCashDrawer'] . "')"; } - $msg = _('Record inserted'); - $ErrMsg = _('Could not insert payment method'); + $msg = _('New payment method added'); + $ErrMsg = _('Could not insert the new payment method'); } if ($InputError!=1){ @@ -114,6 +117,7 @@ unset ($_POST['MethodName']); unset ($_POST['ForPayment']); unset ($_POST['ForReceipt']); + unset ($_POST['OpenCashDrawer']); unset ($_POST['UsePrePrintedStationery']); } elseif (isset($_GET['delete'])) { @@ -151,6 +155,7 @@ unset ($_POST['MethodName']); unset ($_POST['ForPayment']); unset ($_POST['ForReceipt']); + unset ($_POST['OpenCashDrawer']); } if (!isset($SelectedPaymentID)) { @@ -167,7 +172,8 @@ paymentname, paymenttype, receipttype, - usepreprintedstationery + usepreprintedstationery, + opencashdrawer FROM paymentmethods ORDER BY paymentid"; @@ -180,6 +186,7 @@ <th>' . _('For Payments') . '</th> <th>' . _('For Receipts') . '</th> <th>' . _('Use Pre-printed') .'<br />' . _('Stationery') . '</th> + <th>' . _('Open Cash Drawer') . '</th> </tr>'; $k=0; //row colour counter @@ -197,6 +204,7 @@ <td>' . ($myrow['paymenttype'] ? _('Yes') : _('No')) . '</td> <td>' . ($myrow['receipttype'] ? _('Yes') : _('No')) . '</td> <td>' . ($myrow['usepreprintedstationery'] ? _('Yes') : _('No')) . '</td> + <td>' . ($myrow['opencashdrawer'] ? _('Yes') : _('No')) . '</td> <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?SelectedPaymentID=' . $myrow['paymentid'] . '">' . _('Edit') . '</a></td> <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?SelectedPaymentID=' . $myrow['paymentid'] . '&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this payment method?') . '\');">' . _('Delete') .'</a></td> </tr>'; @@ -241,6 +249,7 @@ $_POST['ForPayment'] = $myrow['paymenttype']; $_POST['ForReceipt'] = $myrow['receipttype']; $_POST['UsePrePrintedStationery'] = $myrow['usepreprintedstationery']; + $_POST['OpenCashDrawer'] = $myrow['opencashdrawer']; echo '<input type="hidden" name="SelectedPaymentID" value="' . $_POST['MethodID'] . '" />'; echo '<table class="selection">'; @@ -251,6 +260,7 @@ $_POST['ForPayment'] = 1; // Default is use for payment $_POST['ForReceipt'] = 1; // Default is use for receipts $_POST['UsePrePrintedStationery'] = 0; // Default is use for receipts + $_POST['OpenCashDrawer'] = 0; //Default is not to open cash drawer echo '<table class="selection">'; } echo '<tr> @@ -278,7 +288,13 @@ <option' . ($_POST['UsePrePrintedStationery']==1 ? '' : ' selected="selected"' ) .' value="0">' . _('No') . '</option> </select></td> </tr>'; - + echo '<tr> + <td>' . _('Open POS Cash Drawer for Sale') . ':' . '</td> + <td><select name="OpenCashDrawer"> + <option' . ($_POST['OpenCashDrawer'] ? ' selected="selected"' : '') .' value="1">' . _('Yes') . '</option> + <option' . ($_POST['OpenCashDrawer'] ? '' : ' selected="selected"') .' value="0">' . _('No') . '</option> + </select></td> + </tr>'; echo '</table>'; echo '<br /><div class="centre"><input type="submit" name="submit" value="' . _('Enter Information') . '" /></div>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-05-05 08:46:26 UTC (rev 5317) +++ trunk/doc/Change.log 2012-05-07 09:35:20 UTC (rev 5318) @@ -1,5 +1,6 @@ webERP Change Log +6/5/12 Phil: PaymentMethods.php added open cash drawer field for my POS. 4/5/12 Phil: Labels.php PDFPrintLabel.php fine tuning of new labels code 4/5/12 Phil: Fixed customer type name displayed when it is successfully deleted as reported by James Dupin 4/5/12 Phil: Attempt to create simple work around for the limitations of strftime function and resulting character encoding issues - added new functions to get multi-lingual months GetMonthText() and week day names GetWeekDayText(). Not sure if there is any international consensus on the best format here - but can use the DefaultDateFormat or $_SESSION['Language'] if others want it a different way This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-05-07 09:35:26
|
Revision: 5318 http://web-erp.svn.sourceforge.net/web-erp/?rev=5318&view=rev Author: daintree Date: 2012-05-07 09:35:20 +0000 (Mon, 07 May 2012) Log Message: ----------- Modified Paths: -------------- trunk/PaymentMethods.php trunk/doc/Change.log Modified: trunk/PaymentMethods.php =================================================================== --- trunk/PaymentMethods.php 2012-05-05 08:46:26 UTC (rev 5317) +++ trunk/PaymentMethods.php 2012-05-07 09:35:20 UTC (rev 5318) @@ -71,7 +71,8 @@ SET paymentname='" . $_POST['MethodName'] . "', paymenttype = '" . $_POST['ForPayment'] . "', receipttype = '" . $_POST['ForReceipt'] . "', - usepreprintedstationery = '" . $_POST['UsePrePrintedStationery']. "' + usepreprintedstationery = '" . $_POST['UsePrePrintedStationery']. "', + opencashdrawer = '" . $_POST['OpenCashDrawer'] . "' WHERE paymentname " . LIKE . " '".$OldName."'"; } else { @@ -91,17 +92,19 @@ $InputError = 1; prnMsg( _('The payment method can not be created because another with the same name already exists.'),'error'); } else { - $sql = "INSERT INTO paymentmethods ( paymentname, + $sql = "INSERT INTO paymentmethods (paymentname, paymenttype, receipttype, - usepreprintedstationery) + usepreprintedstationery, + opencashdrawer) VALUES ('" . $_POST['MethodName'] ."', '" . $_POST['ForPayment'] ."', '" . $_POST['ForReceipt'] ."', - '" . $_POST['UsePrePrintedStationery'] ."')"; + '" . $_POST['UsePrePrintedStationery'] ."', + '" . $_POST['OpenCashDrawer'] . "')"; } - $msg = _('Record inserted'); - $ErrMsg = _('Could not insert payment method'); + $msg = _('New payment method added'); + $ErrMsg = _('Could not insert the new payment method'); } if ($InputError!=1){ @@ -114,6 +117,7 @@ unset ($_POST['MethodName']); unset ($_POST['ForPayment']); unset ($_POST['ForReceipt']); + unset ($_POST['OpenCashDrawer']); unset ($_POST['UsePrePrintedStationery']); } elseif (isset($_GET['delete'])) { @@ -151,6 +155,7 @@ unset ($_POST['MethodName']); unset ($_POST['ForPayment']); unset ($_POST['ForReceipt']); + unset ($_POST['OpenCashDrawer']); } if (!isset($SelectedPaymentID)) { @@ -167,7 +172,8 @@ paymentname, paymenttype, receipttype, - usepreprintedstationery + usepreprintedstationery, + opencashdrawer FROM paymentmethods ORDER BY paymentid"; @@ -180,6 +186,7 @@ <th>' . _('For Payments') . '</th> <th>' . _('For Receipts') . '</th> <th>' . _('Use Pre-printed') .'<br />' . _('Stationery') . '</th> + <th>' . _('Open Cash Drawer') . '</th> </tr>'; $k=0; //row colour counter @@ -197,6 +204,7 @@ <td>' . ($myrow['paymenttype'] ? _('Yes') : _('No')) . '</td> <td>' . ($myrow['receipttype'] ? _('Yes') : _('No')) . '</td> <td>' . ($myrow['usepreprintedstationery'] ? _('Yes') : _('No')) . '</td> + <td>' . ($myrow['opencashdrawer'] ? _('Yes') : _('No')) . '</td> <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?SelectedPaymentID=' . $myrow['paymentid'] . '">' . _('Edit') . '</a></td> <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?SelectedPaymentID=' . $myrow['paymentid'] . '&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this payment method?') . '\');">' . _('Delete') .'</a></td> </tr>'; @@ -241,6 +249,7 @@ $_POST['ForPayment'] = $myrow['paymenttype']; $_POST['ForReceipt'] = $myrow['receipttype']; $_POST['UsePrePrintedStationery'] = $myrow['usepreprintedstationery']; + $_POST['OpenCashDrawer'] = $myrow['opencashdrawer']; echo '<input type="hidden" name="SelectedPaymentID" value="' . $_POST['MethodID'] . '" />'; echo '<table class="selection">'; @@ -251,6 +260,7 @@ $_POST['ForPayment'] = 1; // Default is use for payment $_POST['ForReceipt'] = 1; // Default is use for receipts $_POST['UsePrePrintedStationery'] = 0; // Default is use for receipts + $_POST['OpenCashDrawer'] = 0; //Default is not to open cash drawer echo '<table class="selection">'; } echo '<tr> @@ -278,7 +288,13 @@ <option' . ($_POST['UsePrePrintedStationery']==1 ? '' : ' selected="selected"' ) .' value="0">' . _('No') . '</option> </select></td> </tr>'; - + echo '<tr> + <td>' . _('Open POS Cash Drawer for Sale') . ':' . '</td> + <td><select name="OpenCashDrawer"> + <option' . ($_POST['OpenCashDrawer'] ? ' selected="selected"' : '') .' value="1">' . _('Yes') . '</option> + <option' . ($_POST['OpenCashDrawer'] ? '' : ' selected="selected"') .' value="0">' . _('No') . '</option> + </select></td> + </tr>'; echo '</table>'; echo '<br /><div class="centre"><input type="submit" name="submit" value="' . _('Enter Information') . '" /></div>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-05-05 08:46:26 UTC (rev 5317) +++ trunk/doc/Change.log 2012-05-07 09:35:20 UTC (rev 5318) @@ -1,5 +1,6 @@ webERP Change Log +6/5/12 Phil: PaymentMethods.php added open cash drawer field for my POS. 4/5/12 Phil: Labels.php PDFPrintLabel.php fine tuning of new labels code 4/5/12 Phil: Fixed customer type name displayed when it is successfully deleted as reported by James Dupin 4/5/12 Phil: Attempt to create simple work around for the limitations of strftime function and resulting character encoding issues - added new functions to get multi-lingual months GetMonthText() and week day names GetWeekDayText(). Not sure if there is any international consensus on the best format here - but can use the DefaultDateFormat or $_SESSION['Language'] if others want it a different way This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-05-19 23:55:21
|
Revision: 5374 http://web-erp.svn.sourceforge.net/web-erp/?rev=5374&view=rev Author: daintree Date: 2012-05-19 23:55:14 +0000 (Sat, 19 May 2012) Log Message: ----------- Klaus fix to MRP lead times Modified Paths: -------------- trunk/MRP.php trunk/doc/Change.log trunk/includes/session.inc Modified: trunk/MRP.php =================================================================== --- trunk/MRP.php 2012-05-19 02:23:59 UTC (rev 5373) +++ trunk/MRP.php 2012-05-19 23:55:14 UTC (rev 5374) @@ -467,7 +467,7 @@ flush(); $result = DB_query($sql,$db); while ($myrow=DB_fetch_array($result)) { - LevelNetting($db,$myrow['part'],$myrow['eoq'],$myrow['pansize'],$myrow['shrinkfactor']); + LevelNetting($db,$myrow['part'],$myrow['eoq'],$myrow['pansize'],$myrow['shrinkfactor'], $myrow['leadtime']); } //end of while loop } // end of for echo '<br />' . _('End time') . ': ' . date('h:i:s') . '<br />'; @@ -629,13 +629,13 @@ -function LevelNetting(&$db,$part,$eoq,$PanSize,$ShrinkFactor) { -// Create an array of mrprequirements and an array of mrpsupplies, then read through -// them seeing if all requirements are covered by supplies. Create a planned order -// for any unmet requirements. Change dates if necessary for the supplies. - //echo '<br />Part is ' . "$part" . '<br />'; +function LevelNetting(&$db,$part,$eoq,$PanSize,$ShrinkFactor, $LeadTime) { + // Create an array of mrprequirements and an array of mrpsupplies, then read through + // them seeing if all requirements are covered by supplies. Create a planned order + // for any unmet requirements. Change dates if necessary for the supplies. + //echo '<br />Part is ' . "$part" . '<br />'; - // Get decimal places from stockmaster for rounding of shrinkage factor + // Get decimal places from stockmaster for rounding of shrinkage factor $sql = "SELECT decimalplaces FROM stockmaster WHERE stockid = '" . $part . "'"; $result = DB_query($sql,$db); $myrow=DB_fetch_row($result); @@ -751,22 +751,48 @@ if ($_POST['pansizeflag'] == 'y' AND $PanSize != 0 AND $PlannedQty != 0) { $PlannedQty = ceil($PlannedQty / $PanSize) * $PanSize; } - $sql = "INSERT INTO mrpplannedorders (id, - part, - duedate, - supplyquantity, - ordertype, - orderno, - mrpdate, - updateflag) - VALUES (NULL, - '" . $Requirement['part'] . "', - '" . $Requirement['daterequired'] . "', - '" . $PlannedQty . "', - '" . $Requirement['mrpdemandtype'] . "', - '" . $Requirement['orderno'] . "', - '" . $Requirement['daterequired'] . "', - '0')"; + + // Calculate required date by subtracting leadtime from top part's required date + $PartRequiredDate=$Requirement['daterequired']; + if ((int)$LeadTime>0) { + + $CalendarSQL = "SELECT COUNT(*),cal2.calendardate + FROM mrpcalendar + LEFT JOIN mrpcalendar as cal2 + ON (mrpcalendar.daynumber - '".$LeadTime."') = cal2.daynumber + WHERE mrpcalendar.calendardate = '".$PartRequiredDate."' + AND cal2.manufacturingflag='1' + GROUP BY cal2.calendardate"; + $ResultDate = DB_query($CalendarSQL,$db); + $myrowdate=DB_fetch_array($ResultDate); + $NewDate = $myrowdate[1]; + // If can't find date based on manufacturing calendar, use $PartRequiredDate + } else { + // Convert $PartRequiredDate from mysql format to system date format, use that to subtract leadtime + // from it using DateAdd, convert that date back to mysql format + $ConvertDate = ConvertSQLDate($PartRequiredDate); + $DateAdd = DateAdd($ConvertDate,'d',($LeadTime * -1)); + $NewDate = FormatDateForSQL($DateAdd); + } + + $sql = "INSERT INTO mrpplannedorders (id, + part, + duedate, + supplyquantity, + ordertype, + orderno, + mrpdate, + updateflag) + VALUES (NULL, + '" . $Requirement['part'] . "', + '" . $NewDate . "', + '" . $PlannedQty . "', + '" . $Requirement['mrpdemandtype'] . "', + '" . $Requirement['orderno'] . "', + '" . $NewDate . "', + '0')"; + + $result = DB_query($sql,$db); // If part has lower level components, create requirements for them $sql = "SELECT COUNT(*) FROM bom @@ -799,7 +825,7 @@ function CreateLowerLevelRequirement(&$db, $TopPart, $TopDate, - $topquantity, + $TopQuantity, $TopMRPDemandType, $TopOrderNo, $WhereRequired) { @@ -818,47 +844,22 @@ while ($myrow=DB_fetch_array($ResultBOM)) { // Calculate required date by subtracting leadtime from top part's required date $LeadTime = $myrow['leadtime']; - - // Following sql finds daynumber for the top part's required date, subtracts leadtime, and finds - // a valid manufacturing date for the daynumber. There is only one valid manufacturing date - // for each daynumber, but there could be several non-manufacturing dates for the - // same daynumber. MRPCalendar.php maintains the manufacturing calendar. - $CalendarSQL = "SELECT COUNT(*),cal2.calendardate - FROM mrpcalendar - LEFT JOIN mrpcalendar as cal2 - ON (mrpcalendar.daynumber - '".$LeadTime."') = cal2.daynumber - WHERE mrpcalendar.calendardate = '".$TopDate."' - AND cal2.manufacturingflag='1' - GROUP BY cal2.calendardate"; - $ResultDate = DB_query($CalendarSQL,$db); - $myrowdate=DB_fetch_array($ResultDate); - $NewDate = $myrowdate[1]; - // If can't find date based on manufacturing calendar, use $TopDate - if ($myrowdate[0] == 0){ - // Convert $TopDate from mysql format to system date format, use that to subtract leadtime - // from it using DateAdd, convert that date back to mysql format - $ConvertDate = ConvertSQLDate($TopDate); - $DateAdd = DateAdd($ConvertDate,'d',($LeadTime * -1)); - $NewDate = FormatDateForSQL($DateAdd); - } - $Component = $myrow['component']; - $ExtendedQuantity = $myrow['quantity'] * $topquantity; + $ExtendedQuantity = $myrow['quantity'] * $TopQuantity; // Commented out the following lines 8/15/09 because the eoq should be considered in the // LevelNetting() function where $ExcessQty is calculated // if ($myrow['eoq'] > $ExtendedQuantity) { // $ExtendedQuantity = $myrow['eoq']; // } - $sql = "INSERT INTO mrprequirements - (part, - daterequired, - quantity, - mrpdemandtype, - orderno, - directdemand, - whererequired) + $sql = "INSERT INTO mrprequirements (part, + daterequired, + quantity, + mrpdemandtype, + orderno, + directdemand, + whererequired) VALUES ('".$Component."', - '".$NewDate."', + '".$TopDate."', '".$ExtendedQuantity."', '".$TopMRPDemandType."', '".$TopOrderNo."', Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-05-19 02:23:59 UTC (rev 5373) +++ trunk/doc/Change.log 2012-05-19 23:55:14 UTC (rev 5374) @@ -1,4 +1,6 @@ webERP Change Log + +20/5/2012 Klaus Beucher (Opto): move leadtime calculation into levelnetting function and resolve bug which does not use leadtime for highest level items of a BOM see also http://www.weberp.org/forum/showthread.php?tid=203 18/5/2012 Ahmed: Fixed bugs that the offer cannot store more than one item and remove function does not work in SupplierTenders.php and DefineOfferClass.php 18/5/2012 Ahmed.Fawzy: Fixed Branch code validation rule to rule out '-' in CustomerBranches.php. 14/5/2012 Exson: Fixed bug that when users input a Exchang Rate manually, when ones changed minds and select another currency, it'll not show the suggested rate correctly in Payments.php. Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2012-05-19 02:23:59 UTC (rev 5373) +++ trunk/includes/session.inc 2012-05-19 23:55:14 UTC (rev 5374) @@ -19,7 +19,7 @@ session_save_path($SessionSavePath); } -ini_set('session.gc_Maxlifetime',$SessionLifeTime); +ini_set('session.gc_maxlifetime',$SessionLifeTime); if( !ini_get('safe_mode') ){ set_time_limit($MaximumExecutionTime); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-05-19 23:55:21
|
Revision: 5374 http://web-erp.svn.sourceforge.net/web-erp/?rev=5374&view=rev Author: daintree Date: 2012-05-19 23:55:14 +0000 (Sat, 19 May 2012) Log Message: ----------- Klaus fix to MRP lead times Modified Paths: -------------- trunk/MRP.php trunk/doc/Change.log trunk/includes/session.inc Modified: trunk/MRP.php =================================================================== --- trunk/MRP.php 2012-05-19 02:23:59 UTC (rev 5373) +++ trunk/MRP.php 2012-05-19 23:55:14 UTC (rev 5374) @@ -467,7 +467,7 @@ flush(); $result = DB_query($sql,$db); while ($myrow=DB_fetch_array($result)) { - LevelNetting($db,$myrow['part'],$myrow['eoq'],$myrow['pansize'],$myrow['shrinkfactor']); + LevelNetting($db,$myrow['part'],$myrow['eoq'],$myrow['pansize'],$myrow['shrinkfactor'], $myrow['leadtime']); } //end of while loop } // end of for echo '<br />' . _('End time') . ': ' . date('h:i:s') . '<br />'; @@ -629,13 +629,13 @@ -function LevelNetting(&$db,$part,$eoq,$PanSize,$ShrinkFactor) { -// Create an array of mrprequirements and an array of mrpsupplies, then read through -// them seeing if all requirements are covered by supplies. Create a planned order -// for any unmet requirements. Change dates if necessary for the supplies. - //echo '<br />Part is ' . "$part" . '<br />'; +function LevelNetting(&$db,$part,$eoq,$PanSize,$ShrinkFactor, $LeadTime) { + // Create an array of mrprequirements and an array of mrpsupplies, then read through + // them seeing if all requirements are covered by supplies. Create a planned order + // for any unmet requirements. Change dates if necessary for the supplies. + //echo '<br />Part is ' . "$part" . '<br />'; - // Get decimal places from stockmaster for rounding of shrinkage factor + // Get decimal places from stockmaster for rounding of shrinkage factor $sql = "SELECT decimalplaces FROM stockmaster WHERE stockid = '" . $part . "'"; $result = DB_query($sql,$db); $myrow=DB_fetch_row($result); @@ -751,22 +751,48 @@ if ($_POST['pansizeflag'] == 'y' AND $PanSize != 0 AND $PlannedQty != 0) { $PlannedQty = ceil($PlannedQty / $PanSize) * $PanSize; } - $sql = "INSERT INTO mrpplannedorders (id, - part, - duedate, - supplyquantity, - ordertype, - orderno, - mrpdate, - updateflag) - VALUES (NULL, - '" . $Requirement['part'] . "', - '" . $Requirement['daterequired'] . "', - '" . $PlannedQty . "', - '" . $Requirement['mrpdemandtype'] . "', - '" . $Requirement['orderno'] . "', - '" . $Requirement['daterequired'] . "', - '0')"; + + // Calculate required date by subtracting leadtime from top part's required date + $PartRequiredDate=$Requirement['daterequired']; + if ((int)$LeadTime>0) { + + $CalendarSQL = "SELECT COUNT(*),cal2.calendardate + FROM mrpcalendar + LEFT JOIN mrpcalendar as cal2 + ON (mrpcalendar.daynumber - '".$LeadTime."') = cal2.daynumber + WHERE mrpcalendar.calendardate = '".$PartRequiredDate."' + AND cal2.manufacturingflag='1' + GROUP BY cal2.calendardate"; + $ResultDate = DB_query($CalendarSQL,$db); + $myrowdate=DB_fetch_array($ResultDate); + $NewDate = $myrowdate[1]; + // If can't find date based on manufacturing calendar, use $PartRequiredDate + } else { + // Convert $PartRequiredDate from mysql format to system date format, use that to subtract leadtime + // from it using DateAdd, convert that date back to mysql format + $ConvertDate = ConvertSQLDate($PartRequiredDate); + $DateAdd = DateAdd($ConvertDate,'d',($LeadTime * -1)); + $NewDate = FormatDateForSQL($DateAdd); + } + + $sql = "INSERT INTO mrpplannedorders (id, + part, + duedate, + supplyquantity, + ordertype, + orderno, + mrpdate, + updateflag) + VALUES (NULL, + '" . $Requirement['part'] . "', + '" . $NewDate . "', + '" . $PlannedQty . "', + '" . $Requirement['mrpdemandtype'] . "', + '" . $Requirement['orderno'] . "', + '" . $NewDate . "', + '0')"; + + $result = DB_query($sql,$db); // If part has lower level components, create requirements for them $sql = "SELECT COUNT(*) FROM bom @@ -799,7 +825,7 @@ function CreateLowerLevelRequirement(&$db, $TopPart, $TopDate, - $topquantity, + $TopQuantity, $TopMRPDemandType, $TopOrderNo, $WhereRequired) { @@ -818,47 +844,22 @@ while ($myrow=DB_fetch_array($ResultBOM)) { // Calculate required date by subtracting leadtime from top part's required date $LeadTime = $myrow['leadtime']; - - // Following sql finds daynumber for the top part's required date, subtracts leadtime, and finds - // a valid manufacturing date for the daynumber. There is only one valid manufacturing date - // for each daynumber, but there could be several non-manufacturing dates for the - // same daynumber. MRPCalendar.php maintains the manufacturing calendar. - $CalendarSQL = "SELECT COUNT(*),cal2.calendardate - FROM mrpcalendar - LEFT JOIN mrpcalendar as cal2 - ON (mrpcalendar.daynumber - '".$LeadTime."') = cal2.daynumber - WHERE mrpcalendar.calendardate = '".$TopDate."' - AND cal2.manufacturingflag='1' - GROUP BY cal2.calendardate"; - $ResultDate = DB_query($CalendarSQL,$db); - $myrowdate=DB_fetch_array($ResultDate); - $NewDate = $myrowdate[1]; - // If can't find date based on manufacturing calendar, use $TopDate - if ($myrowdate[0] == 0){ - // Convert $TopDate from mysql format to system date format, use that to subtract leadtime - // from it using DateAdd, convert that date back to mysql format - $ConvertDate = ConvertSQLDate($TopDate); - $DateAdd = DateAdd($ConvertDate,'d',($LeadTime * -1)); - $NewDate = FormatDateForSQL($DateAdd); - } - $Component = $myrow['component']; - $ExtendedQuantity = $myrow['quantity'] * $topquantity; + $ExtendedQuantity = $myrow['quantity'] * $TopQuantity; // Commented out the following lines 8/15/09 because the eoq should be considered in the // LevelNetting() function where $ExcessQty is calculated // if ($myrow['eoq'] > $ExtendedQuantity) { // $ExtendedQuantity = $myrow['eoq']; // } - $sql = "INSERT INTO mrprequirements - (part, - daterequired, - quantity, - mrpdemandtype, - orderno, - directdemand, - whererequired) + $sql = "INSERT INTO mrprequirements (part, + daterequired, + quantity, + mrpdemandtype, + orderno, + directdemand, + whererequired) VALUES ('".$Component."', - '".$NewDate."', + '".$TopDate."', '".$ExtendedQuantity."', '".$TopMRPDemandType."', '".$TopOrderNo."', Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-05-19 02:23:59 UTC (rev 5373) +++ trunk/doc/Change.log 2012-05-19 23:55:14 UTC (rev 5374) @@ -1,4 +1,6 @@ webERP Change Log + +20/5/2012 Klaus Beucher (Opto): move leadtime calculation into levelnetting function and resolve bug which does not use leadtime for highest level items of a BOM see also http://www.weberp.org/forum/showthread.php?tid=203 18/5/2012 Ahmed: Fixed bugs that the offer cannot store more than one item and remove function does not work in SupplierTenders.php and DefineOfferClass.php 18/5/2012 Ahmed.Fawzy: Fixed Branch code validation rule to rule out '-' in CustomerBranches.php. 14/5/2012 Exson: Fixed bug that when users input a Exchang Rate manually, when ones changed minds and select another currency, it'll not show the suggested rate correctly in Payments.php. Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2012-05-19 02:23:59 UTC (rev 5373) +++ trunk/includes/session.inc 2012-05-19 23:55:14 UTC (rev 5374) @@ -19,7 +19,7 @@ session_save_path($SessionSavePath); } -ini_set('session.gc_Maxlifetime',$SessionLifeTime); +ini_set('session.gc_maxlifetime',$SessionLifeTime); if( !ini_get('safe_mode') ){ set_time_limit($MaximumExecutionTime); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-05-22 08:22:56
|
Revision: 5385 http://web-erp.svn.sourceforge.net/web-erp/?rev=5385&view=rev Author: daintree Date: 2012-05-22 08:22:49 +0000 (Tue, 22 May 2012) Log Message: ----------- fix labels on WO Status Modified Paths: -------------- trunk/PDFPrintLabel.php trunk/WorkOrderEntry.php trunk/WorkOrderStatus.php trunk/doc/Change.log trunk/includes/session.inc trunk/includes/tcpdf/CHANGELOG.TXT trunk/includes/tcpdf/README.TXT trunk/includes/tcpdf/tcpdf.php trunk/index.php trunk/sql/mysql/upgrade4.07-4.08.sql Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2012-05-22 08:12:20 UTC (rev 5384) +++ trunk/PDFPrintLabel.php 2012-05-22 08:22:49 UTC (rev 5385) @@ -180,6 +180,10 @@ $pdf->addInfo('Title', $LabelDimensions['description'] . ' ' . _('Price Labels') ); $pdf->addInfo('Subject', $LabelDimensions['description'] . ' ' . _('Price Labels') ); + $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); + $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); + $pdf->setPrintHeader(false); + $pdf->setPrintFooter(false); $style = array( 'position' => '', @@ -187,7 +191,7 @@ 'stretch' => false, 'fitwidth' => true, 'cellfitalign' => '', - 'border' => false, + 'border' => true, 'hpadding' => 'auto', 'vpadding' => 'auto', 'fgcolor' => array(0,0,0), @@ -203,7 +207,7 @@ $XPos = $Left_Margin; // left of current label for ($i=0;$i < $_POST['NoOfLabels'];$i++){ - if ($_POST['PrintLabel'.$i]=='on'){ + if (isset($_POST['PrintLabel'.$i])){ $NoOfLabels--; foreach ($LabelFields as $Field){ //print_r($Field); @@ -224,8 +228,12 @@ /* write1DBarcode($code, $type, $x='', $y='', $w='', $h='', $xres='', $style='', $align='') * Note that the YPos for this function is based on the opposite origin for the Y axis i.e from the bottom not from the top! */ - - $pdf->write1DBarcode(str_replace('_','',$Value), 'C39',$XPos+$Field['HPos'],$Page_Height - $YPos+$LabelDimensions['label_height']-$Field['VPos']-$Field['FontSize'],$LabelDimensions['label_width']-$Field['HPos'], $Field['FontSize'], 0.4, $style, 'N'); + //$BarcodeFileName = $_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['reports_dir'] .'/barcode_' . $i . '.jpg'; + //Barcode39(str_replace('_', $Value),$BarcodeFileName, $LabelDimensions['label_width']-$Field['HPos']-$Left_Margin,$Field['FontSize']); + //$pdf->addJpegFromFile($BarcodeFileName, $XPos+$Field['HPos'],$YPos-$LabelDimensions['label_height']+$Field['VPos']); + //$pdf->Image('@' . , $XPos+$Field['HPos'], $Page_Height-($YPos+$LabelDimensions['label_height']-$Field['VPos']), $LabelDimensions['label_width']-$Field['HPos']-$Left_Margin, $Field['FontSize']); + + $pdf->write1DBarcode(str_replace('_','',$Value), 'C39E',$XPos+$Field['HPos'],$Page_Height - $YPos+$LabelDimensions['label_height']-$Field['VPos']-$Field['FontSize'],$LabelDimensions['label_width']-$Field['HPos'], 40, 1, $style, 'N'); } else { $LeftOvers = $pdf->addTextWrap($XPos+$Field['HPos'],$YPos-$LabelDimensions['label_height']+$Field['VPos'],$LabelDimensions['label_width']-$Field['HPos']-20,$Field['FontSize'],$Value); } @@ -261,7 +269,7 @@ $FileName=$_SESSION['DatabaseName']. '_' . _('Price_Labels') . '_' . date('Y-m-d').'.pdf'; ob_clean(); - $pdf->OutputD($FileName); + $pdf->OutputI($FileName); $pdf->__destruct(); } else { /*The option to print PDF was not hit */ @@ -358,4 +366,179 @@ } /*end of else not PrintPDF */ +function Barcode39 ($barcode, $FileName='',$width=160, $height=80, $text='') { + + /* Generate a Code 3 of 9 barcode */ + + $im = ImageCreate ($width, $height) + or die ("Cannot Initialize new GD image stream"); + $White = ImageColorAllocate ($im, 255, 255, 255); + $Black = ImageColorAllocate ($im, 0, 0, 0); + //ImageColorTransparent ($im, $White); + ImageInterLace ($im, 1); + + $NarrowRatio = 20; + $WideRatio = 55; + $QuietRatio = 35; + + $nChars = (strlen($barcode)+2) * ((6 * $NarrowRatio) + (3 * $WideRatio) + ($QuietRatio)); + $Pixels = $width / $nChars; + $NarrowBar = (int)(20 * $Pixels); + $WideBar = (int)(55 * $Pixels); + $QuietBar = (int)(35 * $Pixels); + + $ActualWidth = (($NarrowBar * 6) + ($WideBar*3) + $QuietBar) * (strlen ($barcode)+2); + + if (($NarrowBar == 0) || ($NarrowBar == $WideBar) || ($NarrowBar == $QuietBar) || ($WideBar == 0) || ($WideBar == $QuietBar) || ($QuietBar == 0)) { + ImageString ($im, 1, 0, 0, "Image is too small!", $Black); + ImageJPEG ($im, $FileName, 100); + exit; + } + + $CurrentBarX = (int)(($width - $ActualWidth) / 2); + $Color = $White; + $BarcodeFull = "*".strtoupper ($barcode)."*"; + settype ($BarcodeFull, "string"); + + $FontNum = 3; + $FontHeight = ImageFontHeight ($FontNum); + $FontWidth = ImageFontWidth ($FontNum); + if ($text != 0) { + $CenterLoc = (int)(($width-1) / 2) - (int)(($FontWidth * strlen($BarcodeFull)) / 2); + ImageString ($im, $FontNum, $CenterLoc, $height-$FontHeight, "$BarcodeFull", $Black); + } else { + $FontHeight=-2; + } + + + for ($i=0; $i<strlen($BarcodeFull); $i++) { + $StripeCode = Code39 ($BarcodeFull[$i]); + + for ($n=0; $n < 9; $n++) { + if ($Color == $White){ + $Color = $Black; + } else { + $Color = $White; + } + + switch ($StripeCode[$n]) { + case '0': + ImageFilledRectangle ($im, $CurrentBarX, 0, $CurrentBarX+$NarrowBar, $height-1-$FontHeight-2, $Color); + $CurrentBarX += $NarrowBar; + break; + + case '1': + ImageFilledRectangle ($im, $CurrentBarX, 0, $CurrentBarX+$WideBar, $height-1-$FontHeight-2, $Color); + $CurrentBarX += $WideBar; + break; + } + } + + $Color = $White; + ImageFilledRectangle ($im, $CurrentBarX, 0, $CurrentBarX+$QuietBar, $height-1-$FontHeight-2, $Color); + $CurrentBarX += $QuietBar; + } //end loop around each character in barcode string + + imagejpeg ($im, $FileName, 100); +}//end Barcode39 + +//----------------------------------------------------------------------------- +// Returns the Code 3 of 9 value for a given ASCII character +//----------------------------------------------------------------------------- +function Code39 ($Asc) { + switch ($Asc) { + case ' ': + return "011000100"; + case '$': + return "010101000"; + case '%': + return "000101010"; + case '*': + return "010010100"; // * Start/Stop + case '+': + return "010001010"; + case '|': + return "010000101"; + case '.': + return "110000100"; + case '/': + return "010100010"; + case '-': + return "010000101"; + case '0': + return "000110100"; + case '1': + return "100100001"; + case '2': + return "001100001"; + case '3': + return "101100000"; + case '4': + return "000110001"; + case '5': + return "100110000"; + case '6': + return "001110000"; + case '7': + return "000100101"; + case '8': + return "100100100"; + case '9': + return "001100100"; + case 'A': + return "100001001"; + case 'B': + return "001001001"; + case 'C': + return "101001000"; + case 'D': + return "000011001"; + case 'E': + return "100011000"; + case 'F': + return "001011000"; + case 'G': + return "000001101"; + case 'H': + return "100001100"; + case 'I': + return "001001100"; + case 'J': + return "000011100"; + case 'K': + return "100000011"; + case 'L': + return "001000011"; + case 'M': + return "101000010"; + case 'N': + return "000010011"; + case 'O': + return "100010010"; + case 'P': + return "001010010"; + case 'Q': + return "000000111"; + case 'R': + return "100000110"; + case 'S': + return "001000110"; + case 'T': + return "000010110"; + case 'U': + return "110000001"; + case 'V': + return "011000001"; + case 'W': + return "111000000"; + case 'X': + return "010010001"; + case 'Y': + return "110010000"; + case 'Z': + return "011010000"; + default: + return "011000100"; + } +} ?> \ No newline at end of file Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2012-05-22 08:12:20 UTC (rev 5384) +++ trunk/WorkOrderEntry.php 2012-05-22 08:22:49 UTC (rev 5385) @@ -30,13 +30,13 @@ } foreach ($_POST as $key=>$value) { - if (substr($key, 0, 9)=='OutputQty' or substr($key, 0, 7)=='RecdQty') { + if (substr($key, 0, 9)=='OutputQty' OR substr($key, 0, 7)=='RecdQty') { $_POST[$key] = filter_number_format($value); } } // check for new or modify condition -if (isset($_REQUEST['WO']) and $_REQUEST['WO']!=''){ +if (isset($_REQUEST['WO']) AND$_REQUEST['WO']!=''){ // modify $_POST['WO'] = $_REQUEST['WO']; $EditingExisting = true; @@ -269,7 +269,7 @@ } //adding a new item to the work order -if (isset($_POST['submit']) or isset($_POST['Search'])) { //The update button has been clicked +if (isset($_POST['submit']) OR isset($_POST['Search'])) { //The update button has been clicked echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') .'">' . _('Enter a new work order') . '</a>'; echo '<br /><a href="' . $rootpath . '/SelectWorkOrder.php">' . _('Select an existing work order') . '</a>'; @@ -316,10 +316,10 @@ if (!isset($_POST['NextLotSNRef'.$i])) { $_POST['NextLotSNRef'.$i]=''; } - if (isset($_POST['QtyRecd'.$i]) and $_POST['QtyRecd'.$i]>$_POST['OutputQty'.$i]){ + if (isset($_POST['QtyRecd'.$i]) AND $_POST['QtyRecd'.$i]>$_POST['OutputQty'.$i]){ $_POST['OutputQty'.$i]=$_POST['QtyRecd'.$i]; //OutputQty must be >= Qty already reced } - if ($_POST['RecdQty'.$i]==0 AND (!isset($_POST['HasWOSerialNos'.$i]) or $_POST['HasWOSerialNos'.$i]==false)){ + if ($_POST['RecdQty'.$i]==0 AND (!isset($_POST['HasWOSerialNos'.$i]) OR $_POST['HasWOSerialNos'.$i]==false)){ /* can only change location cost if QtyRecd=0 */ $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*bom.quantity) AS cost FROM stockmaster @@ -340,7 +340,7 @@ stdcost ='" . $Cost . "' WHERE wo='" . $_POST['WO'] . "' AND stockid='" . $_POST['OutputItem'.$i] . "'"; - } elseif (isset($_POST['HasWOSerialNos'.$i]) and $_POST['HasWOSerialNos'.$i]==false) { + } elseif (isset($_POST['HasWOSerialNos'.$i]) AND $_POST['HasWOSerialNos'.$i]==false) { $sql[] = "UPDATE woitems SET qtyreqd = '". $_POST['OutputQty' . $i] . "', nextlotsnref = '". $_POST['NextLotSNRef'.$i] ."' WHERE wo='" . $_POST['WO'] . "' @@ -689,7 +689,7 @@ }#end if SearchResults to show -if (!isset($_GET['NewItem']) or $_GET['NewItem']=='') { +if (!isset($_GET['NewItem']) OR $_GET['NewItem']=='') { echo '<script>defaultControl(document.forms[0].StockCode);</script>'; } else { echo '<script>defaultControl(document.forms[0].OutputQty"'.$_GET['Line'].'");</script>'; Modified: trunk/WorkOrderStatus.php =================================================================== --- trunk/WorkOrderStatus.php 2012-05-22 08:12:20 UTC (rev 5384) +++ trunk/WorkOrderStatus.php 2012-05-22 08:22:49 UTC (rev 5385) @@ -65,27 +65,9 @@ <td class="number">' . locale_number_format($WORow['qtyrecd'],$WORow['decimalplaces']) . '</td> <td colspan="2">' . $WORow['units'] . '</td> </tr> - <tr> - <td class="label">' . _('Date Material Issued') . ':</td> - <td>' . Date($_SESSION['DefaultDateFormat']) . '</td> - <td class="label">' . _('Issued From') . ':</td> - <td>'; + </table> + <br />'; - if (!isset($_POST['FromLocation'])){ - $_POST['FromLocation']=$WORow['loccode']; - } - $LocResult = DB_query("SELECT loccode, locationname - FROM locations - WHERE loccode='" . $_POST['FromLocation'] . "'", - $db); - $LocRow = DB_fetch_array($LocResult); - echo $LocRow['locationname']; - - echo '</td> - </tr> - </table> - <br />'; - //set up options for selection of the item to be issued to the WO echo '<table class="selection"> <tr> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-05-22 08:12:20 UTC (rev 5384) +++ trunk/doc/Change.log 2012-05-22 08:22:49 UTC (rev 5385) @@ -1,5 +1,6 @@ webERP Change Log +22/5/2012 Phil Klaus's spot - removed issue location (must always be the same as the manufacture location) and the issued date from WorkOrderStatus.php form - as materials could be issued on many different dates and incorrect to say they are always issued on the current date 20/5/2012 Klaus Beucher (Opto): move leadtime calculation into levelnetting function and resolve bug which does not use leadtime for highest level items of a BOM see also http://www.weberp.org/forum/showthread.php?tid=203 18/5/2012 Ahmed: Fixed bugs that the offer cannot store more than one item and remove function does not work in SupplierTenders.php and DefineOfferClass.php 18/5/2012 Ahmed.Fawzy: Fixed Branch code validation rule to rule out '-' in CustomerBranches.php. Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2012-05-22 08:12:20 UTC (rev 5384) +++ trunk/includes/session.inc 2012-05-22 08:22:49 UTC (rev 5385) @@ -78,7 +78,7 @@ include $PathPrefix . 'includes/UserLogin.php'; /* Login checking and setup */ - if (isset($_POST['UserNameEntryField']) and isset($_POST['Password'])) { + if (isset($_POST['UserNameEntryField']) AND isset($_POST['Password'])) { $rc = userLogin($_POST['UserNameEntryField'], $_POST['Password'], $db); } elseif (empty($_SESSION['DatabaseName'])) { $rc = UL_SHOWLOGIN; Modified: trunk/includes/tcpdf/CHANGELOG.TXT =================================================================== --- trunk/includes/tcpdf/CHANGELOG.TXT 2012-05-22 08:12:20 UTC (rev 5384) +++ trunk/includes/tcpdf/CHANGELOG.TXT 2012-05-22 08:22:49 UTC (rev 5385) @@ -1,3 +1,8 @@ +5.9.161 (2012-05-09) + - A bug on XREF table was fixed (Bug ID: 3525051). + - Deprecated Imagick:clone was replaced. + - Method objclone() was fixed for PHP4. + 5.9.160 (2012-05-03) - A bug on tcpdf_parser.php was fixed. Modified: trunk/includes/tcpdf/README.TXT =================================================================== --- trunk/includes/tcpdf/README.TXT 2012-05-22 08:12:20 UTC (rev 5384) +++ trunk/includes/tcpdf/README.TXT 2012-05-22 08:22:49 UTC (rev 5385) @@ -8,8 +8,8 @@ ------------------------------------------------------------ Name: TCPDF -Version: 5.9.160 -Release date: 2012-05-03 +Version: 5.9.161 +Release date: 2012-05-09 Author: Nicola Asuni Copyright (c) 2002-2012: Modified: trunk/includes/tcpdf/tcpdf.php =================================================================== --- trunk/includes/tcpdf/tcpdf.php 2012-05-22 08:12:20 UTC (rev 5384) +++ trunk/includes/tcpdf/tcpdf.php 2012-05-22 08:22:49 UTC (rev 5385) @@ -1,9 +1,9 @@ <?php //============================================================+ // File name : tcpdf.php -// Version : 5.9.160 +// Version : 5.9.161 // Begin : 2002-08-03 -// Last Update : 2012-05-03 +// Last Update : 2012-05-09 // Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - in...@te... // License : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3 // ------------------------------------------------------------------- @@ -137,7 +137,7 @@ * Tools to encode your unicode fonts are on fonts/utils directory.</p> * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 5.9.160 + * @version 5.9.161 */ // Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file. @@ -149,7 +149,7 @@ * TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.<br> * @package com.tecnick.tcpdf * @brief PHP class for generating PDF documents without requiring external extensions. - * @version 5.9.160 + * @version 5.9.161 * @author Nicola Asuni - in...@te... */ class TCPDF { @@ -160,7 +160,7 @@ * Current TCPDF version. * @private */ - private $tcpdf_version = '5.9.160'; + private $tcpdf_version = '5.9.161'; // Protected properties @@ -180,9 +180,15 @@ * Array of object offsets. * @protected */ - protected $offsets; + protected $offsets = array(); /** + * Array of object IDs for each page. + * @protected + */ + protected $pageobjects = array(); + + /** * Buffer holding in-memory PDF. * @protected */ @@ -8407,7 +8413,7 @@ $img = new Imagick(); $img->readImage($file); // clone image object - $imga = $img->clone(); + $imga = $this->objclone($img); // extract alpha channel $img->separateImageChannel(8); // 8 = (imagick::CHANNEL_ALPHA | imagick::CHANNEL_OPACITY | imagick::CHANNEL_MATTE); $img->negateImage(true); @@ -9509,9 +9515,11 @@ $annots .= ' /A <</S /URI /URI '.$this->_datastring($this->unhtmlentities($pl['txt']), $annot_obj_id).'>>'; } else { // internal link - $l = $this->links[$pl['txt']]; - if (isset($this->page_obj_id[($l[0])])) { - $annots .= sprintf(' /Dest [%u 0 R /XYZ 0 %F null]', $this->page_obj_id[($l[0])], ($this->pagedim[$l[0]]['h'] - ($l[1] * $this->k))); + if (isset($this->links[$pl['txt']])) { + $l = $this->links[$pl['txt']]; + if (isset($this->page_obj_id[($l[0])])) { + $annots .= sprintf(' /Dest [%u 0 R /XYZ 0 %F null]', $this->page_obj_id[($l[0])], ($this->pagedim[$l[0]]['h'] - ($l[1] * $this->k))); + } } } $hmodes = array('N', 'I', 'O', 'P'); @@ -12855,11 +12863,14 @@ $this->_out('xref'); $this->_out('0 '.($this->n + 1)); $this->_out('0000000000 65535 f '); + $freegen = ($this->n + 2); for ($i=1; $i <= $this->n; ++$i) { if (!isset($this->offsets[$i]) AND ($i > 1)) { - $this->offsets[$i] = $this->offsets[($i - 1)]; + $this->_out(sprintf('0000000000 %05d f ', $freegen)); + ++$freegen; + } else { + $this->_out(sprintf('%010d 00000 n ', $this->offsets[$i])); } - $this->_out(sprintf('%010d 00000 n ', $this->offsets[$i])); } // TRAILER $out = 'trailer'."\n"; @@ -12899,6 +12910,7 @@ */ protected function _beginpage($orientation='', $format='') { ++$this->page; + $this->pageobjects[$this->page] = array(); $this->setPageBuffer($this->page, ''); // initialize array for graphics tranformation positions inside a page buffer $this->transfmrk[$this->page] = array(); @@ -12967,6 +12979,7 @@ $objid = $this->n; } $this->offsets[$objid] = $this->bufferlen; + $this->pageobjects[$this->page][] = $objid; return $objid.' 0 obj'; } @@ -25651,6 +25664,7 @@ $tmpintmrk = $this->intmrk[$frompage]; $tmpbordermrk = $this->bordermrk[$frompage]; $tmpcntmrk = $this->cntmrk[$frompage]; + $tmppageobjects = $this->pageobjects[$frompage]; if (isset($this->footerpos[$frompage])) { $tmpfooterpos = $this->footerpos[$frompage]; } @@ -25686,6 +25700,7 @@ $this->intmrk[$i] = $this->intmrk[$j]; $this->bordermrk[$i] = $this->bordermrk[$j]; $this->cntmrk[$i] = $this->cntmrk[$j]; + $this->pageobjects[$i] = $this->pageobjects[$j]; if (isset($this->footerpos[$j])) { $this->footerpos[$i] = $this->footerpos[$j]; } elseif (isset($this->footerpos[$i])) { @@ -25720,6 +25735,7 @@ $this->intmrk[$topage] = $tmpintmrk; $this->bordermrk[$topage] = $tmpbordermrk; $this->cntmrk[$topage] = $tmpcntmrk; + $this->pageobjects[$topage] = $tmppageobjects; if (isset($tmpfooterpos)) { $this->footerpos[$topage] = $tmpfooterpos; } elseif (isset($this->footerpos[$topage])) { @@ -25807,6 +25823,12 @@ unset($this->intmrk[$page]); unset($this->bordermrk[$page]); unset($this->cntmrk[$page]); + foreach ($this->pageobjects[$page] as $oid) { + if (isset($this->offsets[$oid])){ + unset($this->offsets[$oid]); + } + } + unset($this->pageobjects[$page]); if (isset($this->footerpos[$page])) { unset($this->footerpos[$page]); } @@ -25841,6 +25863,7 @@ $this->intmrk[$i] = $this->intmrk[$j]; $this->bordermrk[$i] = $this->bordermrk[$j]; $this->cntmrk[$i] = $this->cntmrk[$j]; + $this->pageobjects[$i] = $this->pageobjects[$j]; if (isset($this->footerpos[$j])) { $this->footerpos[$i] = $this->footerpos[$j]; } elseif (isset($this->footerpos[$i])) { @@ -25881,6 +25904,12 @@ unset($this->intmrk[$this->numpages]); unset($this->bordermrk[$this->numpages]); unset($this->cntmrk[$this->numpages]); + foreach ($this->pageobjects[$this->numpages] as $oid) { + if (isset($this->offsets[$oid])){ + unset($this->offsets[$oid]); + } + } + unset($this->pageobjects[$this->numpages]); if (isset($this->footerpos[$this->numpages])) { unset($this->footerpos[$this->numpages]); } @@ -25982,6 +26011,7 @@ $this->intmrk[$this->page] = $this->intmrk[$page]; $this->bordermrk[$this->page] = $this->bordermrk[$page]; $this->cntmrk[$this->page] = $this->cntmrk[$page]; + $this->pageobjects[$this->page] = $this->pageobjects[$page]; $this->pageopen[$this->page] = false; if (isset($this->footerpos[$page])) { $this->footerpos[$this->page] = $this->footerpos[$page]; @@ -26438,7 +26468,8 @@ * @since 4.5.029 (2009-03-19) */ public function objclone($object) { - return @clone($object); + // clone is defined only in PHP 5 + return (version_compare(phpversion(), '5.0') < 0) ? $object : clone($object); } /** Modified: trunk/index.php =================================================================== --- trunk/index.php 2012-05-22 08:12:20 UTC (rev 5384) +++ trunk/index.php 2012-05-22 08:22:49 UTC (rev 5385) @@ -59,7 +59,7 @@ <td style="width:10%" valign="top">'; echo '<table class="main_menu" width="100%" cellspacing="0" cellpadding="0" border="0">'; - $i=0; +$i=0; while ($i < count($ModuleLink)){ Modified: trunk/sql/mysql/upgrade4.07-4.08.sql =================================================================== --- trunk/sql/mysql/upgrade4.07-4.08.sql 2012-05-22 08:12:20 UTC (rev 5384) +++ trunk/sql/mysql/upgrade4.07-4.08.sql 2012-05-22 08:22:49 UTC (rev 5385) @@ -77,15 +77,19 @@ ALTER TABLE `locations` ADD UNIQUE `locationname` (`locationname`); ALTER TABLE `stockmaster` CHANGE `lastcostupdate` `lastcostupdate` DATE NOT NULL DEFAULT '0000-00-00'; -ALTER TABLE `labels` CHANGE `papersize` `pagewidth` FLOAT NOT NULL DEFAULT '0'; -ALTER TABLE `labels` ADD `pageheight` FLOAT NOT NULL DEFAULT '0' AFTER `pagewidth`; -ALTER TABLE `labels` CHANGE `height` `height` FLOAT NOT NULL DEFAULT '0'; -ALTER TABLE `labels` CHANGE `width` `width` FLOAT NOT NULL DEFAULT '0'; -ALTER TABLE `labels` CHANGE `topmargin` `topmargin` FLOAT NOT NULL DEFAULT '0'; -ALTER TABLE `labels` CHANGE `leftmargin` `leftmargin` FLOAT NOT NULL DEFAULT '0'; -ALTER TABLE `labels` CHANGE `rowheight` `rowheight` FLOAT NOT NULL DEFAULT '0'; -ALTER TABLE `labels` CHANGE `columnwidth` `columnwidth` FLOAT NOT NULL DEFAULT '0'; +ALTER TABLE `labels` CHANGE `papersize` `pagewidth` DOUBLE NOT NULL DEFAULT '0'; +ALTER TABLE `labels` ADD `pageheight` DOUBLE NOT NULL DEFAULT '0' AFTER `pagewidth`; +ALTER TABLE `labels` CHANGE `height` `height` DOUBLE NOT NULL DEFAULT '0'; +ALTER TABLE `labels` CHANGE `width` `width` DOUBLE NOT NULL DEFAULT '0'; +ALTER TABLE `labels` CHANGE `topmargin` `topmargin` DOUBLE NOT NULL DEFAULT '0'; +ALTER TABLE `labels` CHANGE `leftmargin` `leftmargin` DOUBLE NOT NULL DEFAULT '0'; +ALTER TABLE `labels` CHANGE `rowheight` `rowheight` DOUBLE NOT NULL DEFAULT '0'; +ALTER TABLE `labels` CHANGE `columnwidth` `columnwidth` DOUBLE NOT NULL DEFAULT '0'; + +ALTER TABLE `labelfields` CHANGE `vpos` `vpos` DOUBLE NOT NULL DEFAULT '0'; +ALTER TABLE `labelfields` CHANGE `hpos` `hpos` DOUBLE NOT NULL DEFAULT '0'; + ALTER TABLE paymentmethods ADD opencashdrawer tinyint NOT NULL default '0'; UPDATE config SET confvalue='4.08' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-05-22 08:22:57
|
Revision: 5385 http://web-erp.svn.sourceforge.net/web-erp/?rev=5385&view=rev Author: daintree Date: 2012-05-22 08:22:49 +0000 (Tue, 22 May 2012) Log Message: ----------- fix labels on WO Status Modified Paths: -------------- trunk/PDFPrintLabel.php trunk/WorkOrderEntry.php trunk/WorkOrderStatus.php trunk/doc/Change.log trunk/includes/session.inc trunk/includes/tcpdf/CHANGELOG.TXT trunk/includes/tcpdf/README.TXT trunk/includes/tcpdf/tcpdf.php trunk/index.php trunk/sql/mysql/upgrade4.07-4.08.sql Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2012-05-22 08:12:20 UTC (rev 5384) +++ trunk/PDFPrintLabel.php 2012-05-22 08:22:49 UTC (rev 5385) @@ -180,6 +180,10 @@ $pdf->addInfo('Title', $LabelDimensions['description'] . ' ' . _('Price Labels') ); $pdf->addInfo('Subject', $LabelDimensions['description'] . ' ' . _('Price Labels') ); + $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); + $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); + $pdf->setPrintHeader(false); + $pdf->setPrintFooter(false); $style = array( 'position' => '', @@ -187,7 +191,7 @@ 'stretch' => false, 'fitwidth' => true, 'cellfitalign' => '', - 'border' => false, + 'border' => true, 'hpadding' => 'auto', 'vpadding' => 'auto', 'fgcolor' => array(0,0,0), @@ -203,7 +207,7 @@ $XPos = $Left_Margin; // left of current label for ($i=0;$i < $_POST['NoOfLabels'];$i++){ - if ($_POST['PrintLabel'.$i]=='on'){ + if (isset($_POST['PrintLabel'.$i])){ $NoOfLabels--; foreach ($LabelFields as $Field){ //print_r($Field); @@ -224,8 +228,12 @@ /* write1DBarcode($code, $type, $x='', $y='', $w='', $h='', $xres='', $style='', $align='') * Note that the YPos for this function is based on the opposite origin for the Y axis i.e from the bottom not from the top! */ - - $pdf->write1DBarcode(str_replace('_','',$Value), 'C39',$XPos+$Field['HPos'],$Page_Height - $YPos+$LabelDimensions['label_height']-$Field['VPos']-$Field['FontSize'],$LabelDimensions['label_width']-$Field['HPos'], $Field['FontSize'], 0.4, $style, 'N'); + //$BarcodeFileName = $_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['reports_dir'] .'/barcode_' . $i . '.jpg'; + //Barcode39(str_replace('_', $Value),$BarcodeFileName, $LabelDimensions['label_width']-$Field['HPos']-$Left_Margin,$Field['FontSize']); + //$pdf->addJpegFromFile($BarcodeFileName, $XPos+$Field['HPos'],$YPos-$LabelDimensions['label_height']+$Field['VPos']); + //$pdf->Image('@' . , $XPos+$Field['HPos'], $Page_Height-($YPos+$LabelDimensions['label_height']-$Field['VPos']), $LabelDimensions['label_width']-$Field['HPos']-$Left_Margin, $Field['FontSize']); + + $pdf->write1DBarcode(str_replace('_','',$Value), 'C39E',$XPos+$Field['HPos'],$Page_Height - $YPos+$LabelDimensions['label_height']-$Field['VPos']-$Field['FontSize'],$LabelDimensions['label_width']-$Field['HPos'], 40, 1, $style, 'N'); } else { $LeftOvers = $pdf->addTextWrap($XPos+$Field['HPos'],$YPos-$LabelDimensions['label_height']+$Field['VPos'],$LabelDimensions['label_width']-$Field['HPos']-20,$Field['FontSize'],$Value); } @@ -261,7 +269,7 @@ $FileName=$_SESSION['DatabaseName']. '_' . _('Price_Labels') . '_' . date('Y-m-d').'.pdf'; ob_clean(); - $pdf->OutputD($FileName); + $pdf->OutputI($FileName); $pdf->__destruct(); } else { /*The option to print PDF was not hit */ @@ -358,4 +366,179 @@ } /*end of else not PrintPDF */ +function Barcode39 ($barcode, $FileName='',$width=160, $height=80, $text='') { + + /* Generate a Code 3 of 9 barcode */ + + $im = ImageCreate ($width, $height) + or die ("Cannot Initialize new GD image stream"); + $White = ImageColorAllocate ($im, 255, 255, 255); + $Black = ImageColorAllocate ($im, 0, 0, 0); + //ImageColorTransparent ($im, $White); + ImageInterLace ($im, 1); + + $NarrowRatio = 20; + $WideRatio = 55; + $QuietRatio = 35; + + $nChars = (strlen($barcode)+2) * ((6 * $NarrowRatio) + (3 * $WideRatio) + ($QuietRatio)); + $Pixels = $width / $nChars; + $NarrowBar = (int)(20 * $Pixels); + $WideBar = (int)(55 * $Pixels); + $QuietBar = (int)(35 * $Pixels); + + $ActualWidth = (($NarrowBar * 6) + ($WideBar*3) + $QuietBar) * (strlen ($barcode)+2); + + if (($NarrowBar == 0) || ($NarrowBar == $WideBar) || ($NarrowBar == $QuietBar) || ($WideBar == 0) || ($WideBar == $QuietBar) || ($QuietBar == 0)) { + ImageString ($im, 1, 0, 0, "Image is too small!", $Black); + ImageJPEG ($im, $FileName, 100); + exit; + } + + $CurrentBarX = (int)(($width - $ActualWidth) / 2); + $Color = $White; + $BarcodeFull = "*".strtoupper ($barcode)."*"; + settype ($BarcodeFull, "string"); + + $FontNum = 3; + $FontHeight = ImageFontHeight ($FontNum); + $FontWidth = ImageFontWidth ($FontNum); + if ($text != 0) { + $CenterLoc = (int)(($width-1) / 2) - (int)(($FontWidth * strlen($BarcodeFull)) / 2); + ImageString ($im, $FontNum, $CenterLoc, $height-$FontHeight, "$BarcodeFull", $Black); + } else { + $FontHeight=-2; + } + + + for ($i=0; $i<strlen($BarcodeFull); $i++) { + $StripeCode = Code39 ($BarcodeFull[$i]); + + for ($n=0; $n < 9; $n++) { + if ($Color == $White){ + $Color = $Black; + } else { + $Color = $White; + } + + switch ($StripeCode[$n]) { + case '0': + ImageFilledRectangle ($im, $CurrentBarX, 0, $CurrentBarX+$NarrowBar, $height-1-$FontHeight-2, $Color); + $CurrentBarX += $NarrowBar; + break; + + case '1': + ImageFilledRectangle ($im, $CurrentBarX, 0, $CurrentBarX+$WideBar, $height-1-$FontHeight-2, $Color); + $CurrentBarX += $WideBar; + break; + } + } + + $Color = $White; + ImageFilledRectangle ($im, $CurrentBarX, 0, $CurrentBarX+$QuietBar, $height-1-$FontHeight-2, $Color); + $CurrentBarX += $QuietBar; + } //end loop around each character in barcode string + + imagejpeg ($im, $FileName, 100); +}//end Barcode39 + +//----------------------------------------------------------------------------- +// Returns the Code 3 of 9 value for a given ASCII character +//----------------------------------------------------------------------------- +function Code39 ($Asc) { + switch ($Asc) { + case ' ': + return "011000100"; + case '$': + return "010101000"; + case '%': + return "000101010"; + case '*': + return "010010100"; // * Start/Stop + case '+': + return "010001010"; + case '|': + return "010000101"; + case '.': + return "110000100"; + case '/': + return "010100010"; + case '-': + return "010000101"; + case '0': + return "000110100"; + case '1': + return "100100001"; + case '2': + return "001100001"; + case '3': + return "101100000"; + case '4': + return "000110001"; + case '5': + return "100110000"; + case '6': + return "001110000"; + case '7': + return "000100101"; + case '8': + return "100100100"; + case '9': + return "001100100"; + case 'A': + return "100001001"; + case 'B': + return "001001001"; + case 'C': + return "101001000"; + case 'D': + return "000011001"; + case 'E': + return "100011000"; + case 'F': + return "001011000"; + case 'G': + return "000001101"; + case 'H': + return "100001100"; + case 'I': + return "001001100"; + case 'J': + return "000011100"; + case 'K': + return "100000011"; + case 'L': + return "001000011"; + case 'M': + return "101000010"; + case 'N': + return "000010011"; + case 'O': + return "100010010"; + case 'P': + return "001010010"; + case 'Q': + return "000000111"; + case 'R': + return "100000110"; + case 'S': + return "001000110"; + case 'T': + return "000010110"; + case 'U': + return "110000001"; + case 'V': + return "011000001"; + case 'W': + return "111000000"; + case 'X': + return "010010001"; + case 'Y': + return "110010000"; + case 'Z': + return "011010000"; + default: + return "011000100"; + } +} ?> \ No newline at end of file Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2012-05-22 08:12:20 UTC (rev 5384) +++ trunk/WorkOrderEntry.php 2012-05-22 08:22:49 UTC (rev 5385) @@ -30,13 +30,13 @@ } foreach ($_POST as $key=>$value) { - if (substr($key, 0, 9)=='OutputQty' or substr($key, 0, 7)=='RecdQty') { + if (substr($key, 0, 9)=='OutputQty' OR substr($key, 0, 7)=='RecdQty') { $_POST[$key] = filter_number_format($value); } } // check for new or modify condition -if (isset($_REQUEST['WO']) and $_REQUEST['WO']!=''){ +if (isset($_REQUEST['WO']) AND$_REQUEST['WO']!=''){ // modify $_POST['WO'] = $_REQUEST['WO']; $EditingExisting = true; @@ -269,7 +269,7 @@ } //adding a new item to the work order -if (isset($_POST['submit']) or isset($_POST['Search'])) { //The update button has been clicked +if (isset($_POST['submit']) OR isset($_POST['Search'])) { //The update button has been clicked echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') .'">' . _('Enter a new work order') . '</a>'; echo '<br /><a href="' . $rootpath . '/SelectWorkOrder.php">' . _('Select an existing work order') . '</a>'; @@ -316,10 +316,10 @@ if (!isset($_POST['NextLotSNRef'.$i])) { $_POST['NextLotSNRef'.$i]=''; } - if (isset($_POST['QtyRecd'.$i]) and $_POST['QtyRecd'.$i]>$_POST['OutputQty'.$i]){ + if (isset($_POST['QtyRecd'.$i]) AND $_POST['QtyRecd'.$i]>$_POST['OutputQty'.$i]){ $_POST['OutputQty'.$i]=$_POST['QtyRecd'.$i]; //OutputQty must be >= Qty already reced } - if ($_POST['RecdQty'.$i]==0 AND (!isset($_POST['HasWOSerialNos'.$i]) or $_POST['HasWOSerialNos'.$i]==false)){ + if ($_POST['RecdQty'.$i]==0 AND (!isset($_POST['HasWOSerialNos'.$i]) OR $_POST['HasWOSerialNos'.$i]==false)){ /* can only change location cost if QtyRecd=0 */ $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*bom.quantity) AS cost FROM stockmaster @@ -340,7 +340,7 @@ stdcost ='" . $Cost . "' WHERE wo='" . $_POST['WO'] . "' AND stockid='" . $_POST['OutputItem'.$i] . "'"; - } elseif (isset($_POST['HasWOSerialNos'.$i]) and $_POST['HasWOSerialNos'.$i]==false) { + } elseif (isset($_POST['HasWOSerialNos'.$i]) AND $_POST['HasWOSerialNos'.$i]==false) { $sql[] = "UPDATE woitems SET qtyreqd = '". $_POST['OutputQty' . $i] . "', nextlotsnref = '". $_POST['NextLotSNRef'.$i] ."' WHERE wo='" . $_POST['WO'] . "' @@ -689,7 +689,7 @@ }#end if SearchResults to show -if (!isset($_GET['NewItem']) or $_GET['NewItem']=='') { +if (!isset($_GET['NewItem']) OR $_GET['NewItem']=='') { echo '<script>defaultControl(document.forms[0].StockCode);</script>'; } else { echo '<script>defaultControl(document.forms[0].OutputQty"'.$_GET['Line'].'");</script>'; Modified: trunk/WorkOrderStatus.php =================================================================== --- trunk/WorkOrderStatus.php 2012-05-22 08:12:20 UTC (rev 5384) +++ trunk/WorkOrderStatus.php 2012-05-22 08:22:49 UTC (rev 5385) @@ -65,27 +65,9 @@ <td class="number">' . locale_number_format($WORow['qtyrecd'],$WORow['decimalplaces']) . '</td> <td colspan="2">' . $WORow['units'] . '</td> </tr> - <tr> - <td class="label">' . _('Date Material Issued') . ':</td> - <td>' . Date($_SESSION['DefaultDateFormat']) . '</td> - <td class="label">' . _('Issued From') . ':</td> - <td>'; + </table> + <br />'; - if (!isset($_POST['FromLocation'])){ - $_POST['FromLocation']=$WORow['loccode']; - } - $LocResult = DB_query("SELECT loccode, locationname - FROM locations - WHERE loccode='" . $_POST['FromLocation'] . "'", - $db); - $LocRow = DB_fetch_array($LocResult); - echo $LocRow['locationname']; - - echo '</td> - </tr> - </table> - <br />'; - //set up options for selection of the item to be issued to the WO echo '<table class="selection"> <tr> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-05-22 08:12:20 UTC (rev 5384) +++ trunk/doc/Change.log 2012-05-22 08:22:49 UTC (rev 5385) @@ -1,5 +1,6 @@ webERP Change Log +22/5/2012 Phil Klaus's spot - removed issue location (must always be the same as the manufacture location) and the issued date from WorkOrderStatus.php form - as materials could be issued on many different dates and incorrect to say they are always issued on the current date 20/5/2012 Klaus Beucher (Opto): move leadtime calculation into levelnetting function and resolve bug which does not use leadtime for highest level items of a BOM see also http://www.weberp.org/forum/showthread.php?tid=203 18/5/2012 Ahmed: Fixed bugs that the offer cannot store more than one item and remove function does not work in SupplierTenders.php and DefineOfferClass.php 18/5/2012 Ahmed.Fawzy: Fixed Branch code validation rule to rule out '-' in CustomerBranches.php. Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2012-05-22 08:12:20 UTC (rev 5384) +++ trunk/includes/session.inc 2012-05-22 08:22:49 UTC (rev 5385) @@ -78,7 +78,7 @@ include $PathPrefix . 'includes/UserLogin.php'; /* Login checking and setup */ - if (isset($_POST['UserNameEntryField']) and isset($_POST['Password'])) { + if (isset($_POST['UserNameEntryField']) AND isset($_POST['Password'])) { $rc = userLogin($_POST['UserNameEntryField'], $_POST['Password'], $db); } elseif (empty($_SESSION['DatabaseName'])) { $rc = UL_SHOWLOGIN; Modified: trunk/includes/tcpdf/CHANGELOG.TXT =================================================================== --- trunk/includes/tcpdf/CHANGELOG.TXT 2012-05-22 08:12:20 UTC (rev 5384) +++ trunk/includes/tcpdf/CHANGELOG.TXT 2012-05-22 08:22:49 UTC (rev 5385) @@ -1,3 +1,8 @@ +5.9.161 (2012-05-09) + - A bug on XREF table was fixed (Bug ID: 3525051). + - Deprecated Imagick:clone was replaced. + - Method objclone() was fixed for PHP4. + 5.9.160 (2012-05-03) - A bug on tcpdf_parser.php was fixed. Modified: trunk/includes/tcpdf/README.TXT =================================================================== --- trunk/includes/tcpdf/README.TXT 2012-05-22 08:12:20 UTC (rev 5384) +++ trunk/includes/tcpdf/README.TXT 2012-05-22 08:22:49 UTC (rev 5385) @@ -8,8 +8,8 @@ ------------------------------------------------------------ Name: TCPDF -Version: 5.9.160 -Release date: 2012-05-03 +Version: 5.9.161 +Release date: 2012-05-09 Author: Nicola Asuni Copyright (c) 2002-2012: Modified: trunk/includes/tcpdf/tcpdf.php =================================================================== --- trunk/includes/tcpdf/tcpdf.php 2012-05-22 08:12:20 UTC (rev 5384) +++ trunk/includes/tcpdf/tcpdf.php 2012-05-22 08:22:49 UTC (rev 5385) @@ -1,9 +1,9 @@ <?php //============================================================+ // File name : tcpdf.php -// Version : 5.9.160 +// Version : 5.9.161 // Begin : 2002-08-03 -// Last Update : 2012-05-03 +// Last Update : 2012-05-09 // Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - in...@te... // License : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3 // ------------------------------------------------------------------- @@ -137,7 +137,7 @@ * Tools to encode your unicode fonts are on fonts/utils directory.</p> * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 5.9.160 + * @version 5.9.161 */ // Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file. @@ -149,7 +149,7 @@ * TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.<br> * @package com.tecnick.tcpdf * @brief PHP class for generating PDF documents without requiring external extensions. - * @version 5.9.160 + * @version 5.9.161 * @author Nicola Asuni - in...@te... */ class TCPDF { @@ -160,7 +160,7 @@ * Current TCPDF version. * @private */ - private $tcpdf_version = '5.9.160'; + private $tcpdf_version = '5.9.161'; // Protected properties @@ -180,9 +180,15 @@ * Array of object offsets. * @protected */ - protected $offsets; + protected $offsets = array(); /** + * Array of object IDs for each page. + * @protected + */ + protected $pageobjects = array(); + + /** * Buffer holding in-memory PDF. * @protected */ @@ -8407,7 +8413,7 @@ $img = new Imagick(); $img->readImage($file); // clone image object - $imga = $img->clone(); + $imga = $this->objclone($img); // extract alpha channel $img->separateImageChannel(8); // 8 = (imagick::CHANNEL_ALPHA | imagick::CHANNEL_OPACITY | imagick::CHANNEL_MATTE); $img->negateImage(true); @@ -9509,9 +9515,11 @@ $annots .= ' /A <</S /URI /URI '.$this->_datastring($this->unhtmlentities($pl['txt']), $annot_obj_id).'>>'; } else { // internal link - $l = $this->links[$pl['txt']]; - if (isset($this->page_obj_id[($l[0])])) { - $annots .= sprintf(' /Dest [%u 0 R /XYZ 0 %F null]', $this->page_obj_id[($l[0])], ($this->pagedim[$l[0]]['h'] - ($l[1] * $this->k))); + if (isset($this->links[$pl['txt']])) { + $l = $this->links[$pl['txt']]; + if (isset($this->page_obj_id[($l[0])])) { + $annots .= sprintf(' /Dest [%u 0 R /XYZ 0 %F null]', $this->page_obj_id[($l[0])], ($this->pagedim[$l[0]]['h'] - ($l[1] * $this->k))); + } } } $hmodes = array('N', 'I', 'O', 'P'); @@ -12855,11 +12863,14 @@ $this->_out('xref'); $this->_out('0 '.($this->n + 1)); $this->_out('0000000000 65535 f '); + $freegen = ($this->n + 2); for ($i=1; $i <= $this->n; ++$i) { if (!isset($this->offsets[$i]) AND ($i > 1)) { - $this->offsets[$i] = $this->offsets[($i - 1)]; + $this->_out(sprintf('0000000000 %05d f ', $freegen)); + ++$freegen; + } else { + $this->_out(sprintf('%010d 00000 n ', $this->offsets[$i])); } - $this->_out(sprintf('%010d 00000 n ', $this->offsets[$i])); } // TRAILER $out = 'trailer'."\n"; @@ -12899,6 +12910,7 @@ */ protected function _beginpage($orientation='', $format='') { ++$this->page; + $this->pageobjects[$this->page] = array(); $this->setPageBuffer($this->page, ''); // initialize array for graphics tranformation positions inside a page buffer $this->transfmrk[$this->page] = array(); @@ -12967,6 +12979,7 @@ $objid = $this->n; } $this->offsets[$objid] = $this->bufferlen; + $this->pageobjects[$this->page][] = $objid; return $objid.' 0 obj'; } @@ -25651,6 +25664,7 @@ $tmpintmrk = $this->intmrk[$frompage]; $tmpbordermrk = $this->bordermrk[$frompage]; $tmpcntmrk = $this->cntmrk[$frompage]; + $tmppageobjects = $this->pageobjects[$frompage]; if (isset($this->footerpos[$frompage])) { $tmpfooterpos = $this->footerpos[$frompage]; } @@ -25686,6 +25700,7 @@ $this->intmrk[$i] = $this->intmrk[$j]; $this->bordermrk[$i] = $this->bordermrk[$j]; $this->cntmrk[$i] = $this->cntmrk[$j]; + $this->pageobjects[$i] = $this->pageobjects[$j]; if (isset($this->footerpos[$j])) { $this->footerpos[$i] = $this->footerpos[$j]; } elseif (isset($this->footerpos[$i])) { @@ -25720,6 +25735,7 @@ $this->intmrk[$topage] = $tmpintmrk; $this->bordermrk[$topage] = $tmpbordermrk; $this->cntmrk[$topage] = $tmpcntmrk; + $this->pageobjects[$topage] = $tmppageobjects; if (isset($tmpfooterpos)) { $this->footerpos[$topage] = $tmpfooterpos; } elseif (isset($this->footerpos[$topage])) { @@ -25807,6 +25823,12 @@ unset($this->intmrk[$page]); unset($this->bordermrk[$page]); unset($this->cntmrk[$page]); + foreach ($this->pageobjects[$page] as $oid) { + if (isset($this->offsets[$oid])){ + unset($this->offsets[$oid]); + } + } + unset($this->pageobjects[$page]); if (isset($this->footerpos[$page])) { unset($this->footerpos[$page]); } @@ -25841,6 +25863,7 @@ $this->intmrk[$i] = $this->intmrk[$j]; $this->bordermrk[$i] = $this->bordermrk[$j]; $this->cntmrk[$i] = $this->cntmrk[$j]; + $this->pageobjects[$i] = $this->pageobjects[$j]; if (isset($this->footerpos[$j])) { $this->footerpos[$i] = $this->footerpos[$j]; } elseif (isset($this->footerpos[$i])) { @@ -25881,6 +25904,12 @@ unset($this->intmrk[$this->numpages]); unset($this->bordermrk[$this->numpages]); unset($this->cntmrk[$this->numpages]); + foreach ($this->pageobjects[$this->numpages] as $oid) { + if (isset($this->offsets[$oid])){ + unset($this->offsets[$oid]); + } + } + unset($this->pageobjects[$this->numpages]); if (isset($this->footerpos[$this->numpages])) { unset($this->footerpos[$this->numpages]); } @@ -25982,6 +26011,7 @@ $this->intmrk[$this->page] = $this->intmrk[$page]; $this->bordermrk[$this->page] = $this->bordermrk[$page]; $this->cntmrk[$this->page] = $this->cntmrk[$page]; + $this->pageobjects[$this->page] = $this->pageobjects[$page]; $this->pageopen[$this->page] = false; if (isset($this->footerpos[$page])) { $this->footerpos[$this->page] = $this->footerpos[$page]; @@ -26438,7 +26468,8 @@ * @since 4.5.029 (2009-03-19) */ public function objclone($object) { - return @clone($object); + // clone is defined only in PHP 5 + return (version_compare(phpversion(), '5.0') < 0) ? $object : clone($object); } /** Modified: trunk/index.php =================================================================== --- trunk/index.php 2012-05-22 08:12:20 UTC (rev 5384) +++ trunk/index.php 2012-05-22 08:22:49 UTC (rev 5385) @@ -59,7 +59,7 @@ <td style="width:10%" valign="top">'; echo '<table class="main_menu" width="100%" cellspacing="0" cellpadding="0" border="0">'; - $i=0; +$i=0; while ($i < count($ModuleLink)){ Modified: trunk/sql/mysql/upgrade4.07-4.08.sql =================================================================== --- trunk/sql/mysql/upgrade4.07-4.08.sql 2012-05-22 08:12:20 UTC (rev 5384) +++ trunk/sql/mysql/upgrade4.07-4.08.sql 2012-05-22 08:22:49 UTC (rev 5385) @@ -77,15 +77,19 @@ ALTER TABLE `locations` ADD UNIQUE `locationname` (`locationname`); ALTER TABLE `stockmaster` CHANGE `lastcostupdate` `lastcostupdate` DATE NOT NULL DEFAULT '0000-00-00'; -ALTER TABLE `labels` CHANGE `papersize` `pagewidth` FLOAT NOT NULL DEFAULT '0'; -ALTER TABLE `labels` ADD `pageheight` FLOAT NOT NULL DEFAULT '0' AFTER `pagewidth`; -ALTER TABLE `labels` CHANGE `height` `height` FLOAT NOT NULL DEFAULT '0'; -ALTER TABLE `labels` CHANGE `width` `width` FLOAT NOT NULL DEFAULT '0'; -ALTER TABLE `labels` CHANGE `topmargin` `topmargin` FLOAT NOT NULL DEFAULT '0'; -ALTER TABLE `labels` CHANGE `leftmargin` `leftmargin` FLOAT NOT NULL DEFAULT '0'; -ALTER TABLE `labels` CHANGE `rowheight` `rowheight` FLOAT NOT NULL DEFAULT '0'; -ALTER TABLE `labels` CHANGE `columnwidth` `columnwidth` FLOAT NOT NULL DEFAULT '0'; +ALTER TABLE `labels` CHANGE `papersize` `pagewidth` DOUBLE NOT NULL DEFAULT '0'; +ALTER TABLE `labels` ADD `pageheight` DOUBLE NOT NULL DEFAULT '0' AFTER `pagewidth`; +ALTER TABLE `labels` CHANGE `height` `height` DOUBLE NOT NULL DEFAULT '0'; +ALTER TABLE `labels` CHANGE `width` `width` DOUBLE NOT NULL DEFAULT '0'; +ALTER TABLE `labels` CHANGE `topmargin` `topmargin` DOUBLE NOT NULL DEFAULT '0'; +ALTER TABLE `labels` CHANGE `leftmargin` `leftmargin` DOUBLE NOT NULL DEFAULT '0'; +ALTER TABLE `labels` CHANGE `rowheight` `rowheight` DOUBLE NOT NULL DEFAULT '0'; +ALTER TABLE `labels` CHANGE `columnwidth` `columnwidth` DOUBLE NOT NULL DEFAULT '0'; + +ALTER TABLE `labelfields` CHANGE `vpos` `vpos` DOUBLE NOT NULL DEFAULT '0'; +ALTER TABLE `labelfields` CHANGE `hpos` `hpos` DOUBLE NOT NULL DEFAULT '0'; + ALTER TABLE paymentmethods ADD opencashdrawer tinyint NOT NULL default '0'; UPDATE config SET confvalue='4.08' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-05-23 09:30:57
|
Revision: 5396 http://web-erp.svn.sourceforge.net/web-erp/?rev=5396&view=rev Author: daintree Date: 2012-05-23 09:30:51 +0000 (Wed, 23 May 2012) Log Message: ----------- show supplier item code on po rather than our code Modified Paths: -------------- trunk/PO_PDFPurchOrder.php trunk/doc/Change.log Modified: trunk/PO_PDFPurchOrder.php =================================================================== --- trunk/PO_PDFPurchOrder.php 2012-05-23 03:28:56 UTC (rev 5395) +++ trunk/PO_PDFPurchOrder.php 2012-05-23 09:30:51 UTC (rev 5396) @@ -255,7 +255,14 @@ $Desc=$POLine['itemdescription']; $OrderTotal += ($POLine['unitprice']*$POLine['quantityord']); - $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column1->x,$YPos,$FormDesign->Data->Column1->Length,$FormDesign->Data->Column1->FontSize,$POLine['itemcode'], 'left'); + + //use suppliers itemcode if available i.e. stringlength >0 + if (strlen($POLine['suppliers_partno']>0)) { + $Itemcode=$POLine['suppliers_partno']; + } else { + $Itemcode=$POLine['itemcode']; + } + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column1->x,$YPos,$FormDesign->Data->Column1->Length,$FormDesign->Data->Column1->FontSize,$Itemcode, 'left'); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column2->x,$YPos,$FormDesign->Data->Column2->Length,$FormDesign->Data->Column2->FontSize,$Desc, 'left'); while (mb_strlen($LeftOvers) > 1){ $YPos-=$line_height; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-05-23 03:28:56 UTC (rev 5395) +++ trunk/doc/Change.log 2012-05-23 09:30:51 UTC (rev 5396) @@ -1,4 +1,6 @@ webERP Change Log + +23/5/2012 Klaus: PO_PDFPurchOrders.php print purchase orders with supplier's code where it is available in the purchasing data 23/5/2012 Exson: Revise GLAccounts.php to make more than 10 digits account code is allowed. 2012/05/22 Exson: Modify accountcode to varchar(20) to meet some countries accounting regulation for more digits account code. 22/5/2012 Phil Klaus's spot - removed issue location (must always be the same as the manufacture location) and the issued date from WorkOrderStatus.php form - as materials could be issued on many different dates and incorrect to say they are always issued on the current date This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-05-23 09:31:00
|
Revision: 5396 http://web-erp.svn.sourceforge.net/web-erp/?rev=5396&view=rev Author: daintree Date: 2012-05-23 09:30:51 +0000 (Wed, 23 May 2012) Log Message: ----------- show supplier item code on po rather than our code Modified Paths: -------------- trunk/PO_PDFPurchOrder.php trunk/doc/Change.log Modified: trunk/PO_PDFPurchOrder.php =================================================================== --- trunk/PO_PDFPurchOrder.php 2012-05-23 03:28:56 UTC (rev 5395) +++ trunk/PO_PDFPurchOrder.php 2012-05-23 09:30:51 UTC (rev 5396) @@ -255,7 +255,14 @@ $Desc=$POLine['itemdescription']; $OrderTotal += ($POLine['unitprice']*$POLine['quantityord']); - $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column1->x,$YPos,$FormDesign->Data->Column1->Length,$FormDesign->Data->Column1->FontSize,$POLine['itemcode'], 'left'); + + //use suppliers itemcode if available i.e. stringlength >0 + if (strlen($POLine['suppliers_partno']>0)) { + $Itemcode=$POLine['suppliers_partno']; + } else { + $Itemcode=$POLine['itemcode']; + } + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column1->x,$YPos,$FormDesign->Data->Column1->Length,$FormDesign->Data->Column1->FontSize,$Itemcode, 'left'); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column2->x,$YPos,$FormDesign->Data->Column2->Length,$FormDesign->Data->Column2->FontSize,$Desc, 'left'); while (mb_strlen($LeftOvers) > 1){ $YPos-=$line_height; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-05-23 03:28:56 UTC (rev 5395) +++ trunk/doc/Change.log 2012-05-23 09:30:51 UTC (rev 5396) @@ -1,4 +1,6 @@ webERP Change Log + +23/5/2012 Klaus: PO_PDFPurchOrders.php print purchase orders with supplier's code where it is available in the purchasing data 23/5/2012 Exson: Revise GLAccounts.php to make more than 10 digits account code is allowed. 2012/05/22 Exson: Modify accountcode to varchar(20) to meet some countries accounting regulation for more digits account code. 22/5/2012 Phil Klaus's spot - removed issue location (must always be the same as the manufacture location) and the issued date from WorkOrderStatus.php form - as materials could be issued on many different dates and incorrect to say they are always issued on the current date This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2012-05-24 06:36:49
|
Revision: 5397 http://web-erp.svn.sourceforge.net/web-erp/?rev=5397&view=rev Author: tehonu Date: 2012-05-24 06:36:42 +0000 (Thu, 24 May 2012) Log Message: ----------- NoSalesItems.php New script to show the items available for sale but no sale in X days Modified Paths: -------------- trunk/includes/MainMenuLinksArray.php trunk/sql/mysql/upgrade4.07-4.08.sql Added Paths: ----------- trunk/NoSalesItems.php Added: trunk/NoSalesItems.php =================================================================== --- trunk/NoSalesItems.php (rev 0) +++ trunk/NoSalesItems.php 2012-05-24 06:36:42 UTC (rev 5397) @@ -0,0 +1,202 @@ +<?php + +/* $Id: NoSalesItems.php 2012-05-12 Kapal Laut $*/ + +/* Session started in session.inc for password checking and authorisation level check +config.php is in turn included in session.inc*/ +include ('includes/session.inc'); +$title = _('No Sales Items Searching'); +include ('includes/header.inc'); +if (!(isset($_POST['Search']))) { +echo '<div class="centre"><p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('No Sales Items') . '" alt="" />' . ' ' . _('No Sales Items') . '</p></div>'; + echo '<div class="page_help_text">' + . _('List of items with stock available during the last X days at the selected locations but did not sell any quantity during these X days.'). '<br />'. _( 'This list gets the no selling items, items at the location just wasting space, or need a price reduction, etc.') . '<br />'. _('Stock available during the last X days means there was a stock movement that produced that item into that location before that day, and no other positive stock movement has been created afterwards. No sell any quantity means, there is no sales order for that item from that location.') . '</div>'; +//check if input already + + echo '<br />'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?name="SelectCustomer" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class="selection">'; + + //to view store location + echo '<tr> + <td>'._('Select Location') . '</td> + <td>:</td> + <td><select name="Location[]" multiple="multiple"> + <option value="All" selected="selected">' . _('All') . '</option>';; + $sql = "SELECT loccode,locationname + FROM locations ORDER BY locationname"; + $locationresult = DB_query($sql, $db); + $i=0; + while ($myrow = DB_fetch_array($locationresult)) { + if(isset($_POST['Location'][$i]) AND $myrow['loccode'] == $_POST['Location'][$i]){ + echo '<option selected="selected" value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + $i++; + } else { + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } + } + echo '</select></td> + </tr>'; + + //to view list of customer + echo '<tr> + <td width="150">' . _('Select Customer Type') . '</td> + <td>:</td> + <td><select name="Customers">'; + + $sql = "SELECT typename, + typeid + FROM debtortype"; + $result = DB_query($sql, $db); + echo '<option value="All">' . _('All') . '</option>'; + while ($myrow = DB_fetch_array($result)) { + echo '<option value="' . $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; + } + echo '</select></td> + </tr>'; + + // stock category selection + $SQL="SELECT categoryid,categorydescription + FROM stockcategory + ORDER BY categorydescription"; + $result1 = DB_query($SQL,$db); + echo '<tr> + <td width="150">' . _('In Stock Category') . ' </td> + <td>:</td> + <td><select name="StockCat">'; + if (!isset($_POST['StockCat'])){ + $_POST['StockCat']='All'; + } + if ($_POST['StockCat']=='All'){ + echo '<option selected="selected" value="All">' . _('All') . '</option>'; + } else { + echo '<option value="All">' . _('All') . '</option>'; + } + while ($myrow1 = DB_fetch_array($result1)) { + if ($myrow1['categoryid']==$_POST['StockCat']){ + echo '<option selected="selected" value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; + } else { + echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; + } + } + + //View number of days + echo '<tr> + <td>' . _('Number Of Days') . ' </td> + <td>:</td> + <td><input class="number" tabindex="3" type="text" name="NumberOfDays" size="8" maxlength="8" value="30" /></td> + </tr> + </table> + <br /> + <div class="centre"> + <input tabindex="5" type="submit" name="Search" value="' . _('Search') . '" /> + </div> + </form>'; +} else { + + // everything below here to view NumberOfNoSalesItems on selected location + $FromDate = FormatDateForSQL(DateAdd(Date($_SESSION['DefaultDateFormat']),'d', -filter_number_format($_POST['NumberOfDays']))); + $SQL = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units, + locstock.quantity, + locations.locationname + FROM stockmaster,locstock,locations + WHERE stockmaster.stockid = locstock.stockid + AND (locstock.loccode = locations.loccode)"; + if ($_POST['Location'][0] == 'All') { + $WhereLocation = ' '; + } elseif (sizeof($_POST['Location']) == 1) { + $WhereLocation = " AND locstock.loccode ='" . $_POST['Location'][0] . "' "; + } else { + $WhereLocation = " AND locstock.loccode IN("; + $commactr = 0; + foreach ($_POST['Location'] as $key => $value) { + $WhereLocation .= "'" . $value . "'"; + $commactr++; + if ($commactr < sizeof($_POST['Location'])) { + $WhereLocation .= ","; + } // End of if + } // End of foreach + $WhereLocation .= ')'; + } + $SQL = $SQL . $WhereLocation. " AND (locstock.quantity > 0) + AND NOT EXISTS ( + SELECT * + FROM salesorderdetails, salesorders + WHERE stockmaster.stockid = salesorderdetails.stkcode + AND (salesorders.fromstkloc = locstock.loccode) + AND (salesorderdetails.orderno = salesorders.orderno) + AND salesorderdetails.actualdispatchdate > '" . $FromDate . "') + AND NOT EXISTS ( + SELECT * + FROM stockmoves + WHERE stockmoves.loccode = locstock.loccode + AND stockmoves.stockid = stockmaster.stockid + AND stockmoves.trandate >= '" . $FromDate . "' + ) + AND EXISTS ( + SELECT * + FROM stockmoves + WHERE stockmoves.loccode = locstock.loccode + AND stockmoves.stockid = stockmaster.stockid + AND stockmoves.trandate < '" . $FromDate . "' + AND stockmoves.qty >0) "; + $SQL = $SQL. "ORDER BY stockmaster.stockid"; + $result = DB_query($SQL, $db); + echo '<p class="page_title_text" align="center"><strong>' . _('No Sales Items') . '</strong></p>'; + echo '<form action="PDFNoSalesItems2.php" method="GET"> + <table class="selection">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + $TableHeader = '<tr> + <th>' . _('No') . '</th> + <th>' . _('Location') . '</th> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('On Hand') . '</th> + <th>' . _('Units') . '</th> + </tr>'; + echo $TableHeader; + echo '<input type="hidden" value="' . $_POST['Location'] . '" name="Location" /> + <input type="hidden" value="' . filter_number_format($_POST['NumberOfDays']) . '" name="NumberOfDays" /> + <input type="hidden" value="' . $_POST['Customers'] . '" name="Customers" />'; + $k = 0; //row colour counter + $i = 1; + while ($myrow = DB_fetch_array($result)) { + //find the quantity onhand item + $sqloh = "SELECT sum(quantity) AS qty + FROM locstock + WHERE stockid='" . $myrow['stkcode'] . "'"; + $oh = DB_query($sqloh, $db); + $ohRow = DB_fetch_row($oh); + if ($k == 1) { + echo '<tr class="EvenTableRows">'; + $k = 0; + } else { + echo '<tr class="OddTableRows">'; + $k = 1; + } + printf('<td class="number">%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + </tr>', + $i, + $myrow['locationname'], + $myrow['0'], + $myrow['description'], + $myrow['quantity'], //onhand + $myrow['units'] //unit + ); + $i++; + } + echo '</table>'; + echo '<br /> + + </form>'; +} +include ('includes/footer.inc'); +?> \ No newline at end of file Modified: trunk/includes/MainMenuLinksArray.php =================================================================== --- trunk/includes/MainMenuLinksArray.php 2012-05-23 09:30:51 UTC (rev 5396) +++ trunk/includes/MainMenuLinksArray.php 2012-05-24 06:36:42 UTC (rev 5397) @@ -54,6 +54,7 @@ _('Delivery In Full On Time (DIFOT) Report'), _('Sales Order Detail Or Summary Inquiries'), _('Top Sales Items Report'), + _('Worst Sales Items Report'), _('Sales With Low Gross Profit Report') ); @@ -69,6 +70,7 @@ '/PDFDIFOT.php', '/SalesInquiry.php', '/TopItems.php', + '/NoSalesItems.php', '/PDFLowGP.php' ); Modified: trunk/sql/mysql/upgrade4.07-4.08.sql =================================================================== --- trunk/sql/mysql/upgrade4.07-4.08.sql 2012-05-23 09:30:51 UTC (rev 5396) +++ trunk/sql/mysql/upgrade4.07-4.08.sql 2012-05-24 06:36:42 UTC (rev 5397) @@ -119,5 +119,8 @@ ALTER TABLE pctabs MODIFY column glaccountpcash varchar(20) NOT NULL DEFAULT '0'; ALTER TABLE taxauthorities ADD CONSTRAINT taxauthorities_ibfk_1 FOREIGN KEY (taxglcode) REFERENCES chartmaster(accountcode); ALTER TABLE taxauthorities ADD CONSTRAINT taxauthorities_ibfk_2 FOREIGN KEY (purchtaxglaccount) REFERENCES chartmaster(accountcode); + +INSERT INTO scripts (script, pagesecurity, description) VALUES ('NoSalesItems.php', '2', 'Shows the No Selling (worst) items'); + UPDATE config SET confvalue='4.08' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2012-05-24 06:36:51
|
Revision: 5397 http://web-erp.svn.sourceforge.net/web-erp/?rev=5397&view=rev Author: tehonu Date: 2012-05-24 06:36:42 +0000 (Thu, 24 May 2012) Log Message: ----------- NoSalesItems.php New script to show the items available for sale but no sale in X days Modified Paths: -------------- trunk/includes/MainMenuLinksArray.php trunk/sql/mysql/upgrade4.07-4.08.sql Added Paths: ----------- trunk/NoSalesItems.php Added: trunk/NoSalesItems.php =================================================================== --- trunk/NoSalesItems.php (rev 0) +++ trunk/NoSalesItems.php 2012-05-24 06:36:42 UTC (rev 5397) @@ -0,0 +1,202 @@ +<?php + +/* $Id: NoSalesItems.php 2012-05-12 Kapal Laut $*/ + +/* Session started in session.inc for password checking and authorisation level check +config.php is in turn included in session.inc*/ +include ('includes/session.inc'); +$title = _('No Sales Items Searching'); +include ('includes/header.inc'); +if (!(isset($_POST['Search']))) { +echo '<div class="centre"><p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('No Sales Items') . '" alt="" />' . ' ' . _('No Sales Items') . '</p></div>'; + echo '<div class="page_help_text">' + . _('List of items with stock available during the last X days at the selected locations but did not sell any quantity during these X days.'). '<br />'. _( 'This list gets the no selling items, items at the location just wasting space, or need a price reduction, etc.') . '<br />'. _('Stock available during the last X days means there was a stock movement that produced that item into that location before that day, and no other positive stock movement has been created afterwards. No sell any quantity means, there is no sales order for that item from that location.') . '</div>'; +//check if input already + + echo '<br />'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?name="SelectCustomer" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class="selection">'; + + //to view store location + echo '<tr> + <td>'._('Select Location') . '</td> + <td>:</td> + <td><select name="Location[]" multiple="multiple"> + <option value="All" selected="selected">' . _('All') . '</option>';; + $sql = "SELECT loccode,locationname + FROM locations ORDER BY locationname"; + $locationresult = DB_query($sql, $db); + $i=0; + while ($myrow = DB_fetch_array($locationresult)) { + if(isset($_POST['Location'][$i]) AND $myrow['loccode'] == $_POST['Location'][$i]){ + echo '<option selected="selected" value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + $i++; + } else { + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } + } + echo '</select></td> + </tr>'; + + //to view list of customer + echo '<tr> + <td width="150">' . _('Select Customer Type') . '</td> + <td>:</td> + <td><select name="Customers">'; + + $sql = "SELECT typename, + typeid + FROM debtortype"; + $result = DB_query($sql, $db); + echo '<option value="All">' . _('All') . '</option>'; + while ($myrow = DB_fetch_array($result)) { + echo '<option value="' . $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; + } + echo '</select></td> + </tr>'; + + // stock category selection + $SQL="SELECT categoryid,categorydescription + FROM stockcategory + ORDER BY categorydescription"; + $result1 = DB_query($SQL,$db); + echo '<tr> + <td width="150">' . _('In Stock Category') . ' </td> + <td>:</td> + <td><select name="StockCat">'; + if (!isset($_POST['StockCat'])){ + $_POST['StockCat']='All'; + } + if ($_POST['StockCat']=='All'){ + echo '<option selected="selected" value="All">' . _('All') . '</option>'; + } else { + echo '<option value="All">' . _('All') . '</option>'; + } + while ($myrow1 = DB_fetch_array($result1)) { + if ($myrow1['categoryid']==$_POST['StockCat']){ + echo '<option selected="selected" value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; + } else { + echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; + } + } + + //View number of days + echo '<tr> + <td>' . _('Number Of Days') . ' </td> + <td>:</td> + <td><input class="number" tabindex="3" type="text" name="NumberOfDays" size="8" maxlength="8" value="30" /></td> + </tr> + </table> + <br /> + <div class="centre"> + <input tabindex="5" type="submit" name="Search" value="' . _('Search') . '" /> + </div> + </form>'; +} else { + + // everything below here to view NumberOfNoSalesItems on selected location + $FromDate = FormatDateForSQL(DateAdd(Date($_SESSION['DefaultDateFormat']),'d', -filter_number_format($_POST['NumberOfDays']))); + $SQL = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units, + locstock.quantity, + locations.locationname + FROM stockmaster,locstock,locations + WHERE stockmaster.stockid = locstock.stockid + AND (locstock.loccode = locations.loccode)"; + if ($_POST['Location'][0] == 'All') { + $WhereLocation = ' '; + } elseif (sizeof($_POST['Location']) == 1) { + $WhereLocation = " AND locstock.loccode ='" . $_POST['Location'][0] . "' "; + } else { + $WhereLocation = " AND locstock.loccode IN("; + $commactr = 0; + foreach ($_POST['Location'] as $key => $value) { + $WhereLocation .= "'" . $value . "'"; + $commactr++; + if ($commactr < sizeof($_POST['Location'])) { + $WhereLocation .= ","; + } // End of if + } // End of foreach + $WhereLocation .= ')'; + } + $SQL = $SQL . $WhereLocation. " AND (locstock.quantity > 0) + AND NOT EXISTS ( + SELECT * + FROM salesorderdetails, salesorders + WHERE stockmaster.stockid = salesorderdetails.stkcode + AND (salesorders.fromstkloc = locstock.loccode) + AND (salesorderdetails.orderno = salesorders.orderno) + AND salesorderdetails.actualdispatchdate > '" . $FromDate . "') + AND NOT EXISTS ( + SELECT * + FROM stockmoves + WHERE stockmoves.loccode = locstock.loccode + AND stockmoves.stockid = stockmaster.stockid + AND stockmoves.trandate >= '" . $FromDate . "' + ) + AND EXISTS ( + SELECT * + FROM stockmoves + WHERE stockmoves.loccode = locstock.loccode + AND stockmoves.stockid = stockmaster.stockid + AND stockmoves.trandate < '" . $FromDate . "' + AND stockmoves.qty >0) "; + $SQL = $SQL. "ORDER BY stockmaster.stockid"; + $result = DB_query($SQL, $db); + echo '<p class="page_title_text" align="center"><strong>' . _('No Sales Items') . '</strong></p>'; + echo '<form action="PDFNoSalesItems2.php" method="GET"> + <table class="selection">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + $TableHeader = '<tr> + <th>' . _('No') . '</th> + <th>' . _('Location') . '</th> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('On Hand') . '</th> + <th>' . _('Units') . '</th> + </tr>'; + echo $TableHeader; + echo '<input type="hidden" value="' . $_POST['Location'] . '" name="Location" /> + <input type="hidden" value="' . filter_number_format($_POST['NumberOfDays']) . '" name="NumberOfDays" /> + <input type="hidden" value="' . $_POST['Customers'] . '" name="Customers" />'; + $k = 0; //row colour counter + $i = 1; + while ($myrow = DB_fetch_array($result)) { + //find the quantity onhand item + $sqloh = "SELECT sum(quantity) AS qty + FROM locstock + WHERE stockid='" . $myrow['stkcode'] . "'"; + $oh = DB_query($sqloh, $db); + $ohRow = DB_fetch_row($oh); + if ($k == 1) { + echo '<tr class="EvenTableRows">'; + $k = 0; + } else { + echo '<tr class="OddTableRows">'; + $k = 1; + } + printf('<td class="number">%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + </tr>', + $i, + $myrow['locationname'], + $myrow['0'], + $myrow['description'], + $myrow['quantity'], //onhand + $myrow['units'] //unit + ); + $i++; + } + echo '</table>'; + echo '<br /> + + </form>'; +} +include ('includes/footer.inc'); +?> \ No newline at end of file Modified: trunk/includes/MainMenuLinksArray.php =================================================================== --- trunk/includes/MainMenuLinksArray.php 2012-05-23 09:30:51 UTC (rev 5396) +++ trunk/includes/MainMenuLinksArray.php 2012-05-24 06:36:42 UTC (rev 5397) @@ -54,6 +54,7 @@ _('Delivery In Full On Time (DIFOT) Report'), _('Sales Order Detail Or Summary Inquiries'), _('Top Sales Items Report'), + _('Worst Sales Items Report'), _('Sales With Low Gross Profit Report') ); @@ -69,6 +70,7 @@ '/PDFDIFOT.php', '/SalesInquiry.php', '/TopItems.php', + '/NoSalesItems.php', '/PDFLowGP.php' ); Modified: trunk/sql/mysql/upgrade4.07-4.08.sql =================================================================== --- trunk/sql/mysql/upgrade4.07-4.08.sql 2012-05-23 09:30:51 UTC (rev 5396) +++ trunk/sql/mysql/upgrade4.07-4.08.sql 2012-05-24 06:36:42 UTC (rev 5397) @@ -119,5 +119,8 @@ ALTER TABLE pctabs MODIFY column glaccountpcash varchar(20) NOT NULL DEFAULT '0'; ALTER TABLE taxauthorities ADD CONSTRAINT taxauthorities_ibfk_1 FOREIGN KEY (taxglcode) REFERENCES chartmaster(accountcode); ALTER TABLE taxauthorities ADD CONSTRAINT taxauthorities_ibfk_2 FOREIGN KEY (purchtaxglaccount) REFERENCES chartmaster(accountcode); + +INSERT INTO scripts (script, pagesecurity, description) VALUES ('NoSalesItems.php', '2', 'Shows the No Selling (worst) items'); + UPDATE config SET confvalue='4.08' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-05-26 10:46:14
|
Revision: 5399 http://web-erp.svn.sourceforge.net/web-erp/?rev=5399&view=rev Author: daintree Date: 2012-05-26 10:46:05 +0000 (Sat, 26 May 2012) Log Message: ----------- fix barcode printing in PDFPrintLabel.php Modified Paths: -------------- trunk/PDFPrintLabel.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/doc/Change.log trunk/includes/class.pdf.php Added Paths: ----------- trunk/includes/barcodepack/ trunk/includes/barcodepack/class.barcode.php trunk/includes/barcodepack/class.code128.php trunk/includes/barcodepack/class.ean13.php trunk/includes/barcodepack/class.i2of5.php trunk/includes/barcodepack/class.linearBarcode.php trunk/includes/barcodepack/class.qrCode.php trunk/includes/barcodepack/class.s2of5.php trunk/includes/barcodepack/class.upc.php trunk/includes/tcpdf/cache/ Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2012-05-25 06:22:39 UTC (rev 5398) +++ trunk/PDFPrintLabel.php 2012-05-26 10:46:05 UTC (rev 5399) @@ -2,6 +2,7 @@ /* $Id: PDFPriceLabels.php 5228 2012-04-06 02:48:00Z vvs2012 $*/ include('includes/session.inc'); +include('includes/barcodepack/class.code128.php'); $PtsPerMM = 2.83465; //pdf points per mm @@ -180,27 +181,15 @@ $pdf->addInfo('Title', $LabelDimensions['description'] . ' ' . _('Price Labels') ); $pdf->addInfo('Subject', $LabelDimensions['description'] . ' ' . _('Price Labels') ); + $pdf->setPrintHeader(false); + $pdf->setPrintFooter(false); + + $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); - $style = array( - 'position' => '', - 'align' => 'C', - 'stretch' => false, - 'fitwidth' => true, - 'cellfitalign' => '', - 'border' => true, - 'hpadding' => 'auto', - 'vpadding' => 'auto', - 'fgcolor' => array(0,0,0), - 'bgcolor' => false, //array(255,255,255), - 'text' => false, - 'font' => 'helvetica', - 'fontsize' => 8, - 'stretchtext' => 4 ); - $PageNumber=1; //go down first then accross $YPos = $Page_Height - $Top_Margin; //top of current label @@ -225,15 +214,15 @@ $LeftOvers = $pdf->addTextWrap($XPos+$Field['HPos'],$YPos-$LabelDimensions['label_height']+$Field['VPos'],$LabelDimensions['label_width']-$Field['HPos'],$Field['FontSize'],$_POST['Price' . $i],'center'); } elseif($Field['Barcode']==1) { - /* write1DBarcode($code, $type, $x='', $y='', $w='', $h='', $xres='', $style='', $align='') - * Note that the YPos for this function is based on the opposite origin for the Y axis i.e from the bottom not from the top! - */ - //$BarcodeFileName = $_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['reports_dir'] .'/barcode_' . $i . '.jpg'; - //Barcode39(str_replace('_', $Value),$BarcodeFileName, $LabelDimensions['label_width']-$Field['HPos']-$Left_Margin,$Field['FontSize']); - //$pdf->addJpegFromFile($BarcodeFileName, $XPos+$Field['HPos'],$YPos-$LabelDimensions['label_height']+$Field['VPos']); - //$pdf->Image('@' . , $XPos+$Field['HPos'], $Page_Height-($YPos+$LabelDimensions['label_height']-$Field['VPos']), $LabelDimensions['label_width']-$Field['HPos']-$Left_Margin, $Field['FontSize']); + $BarcodeImage = new code128(str_replace('_','',$Value)); - $pdf->write1DBarcode(str_replace('_','',$Value), 'C39E',$XPos+$Field['HPos'],$Page_Height - $YPos+$LabelDimensions['label_height']-$Field['VPos']-$Field['FontSize'],$LabelDimensions['label_width']-$Field['HPos'], 40, 1, $style, 'N'); + ob_start(); + imagepng(imagepng($BarcodeImage->draw())); + $Image_String = ob_get_contents(); + ob_end_clean(); + + $pdf->addJpegFromFile('@' . $Image_String,$XPos+$Field['HPos'],$Field['VPos'],'', $Field['FontSize']); + } else { $LeftOvers = $pdf->addTextWrap($XPos+$Field['HPos'],$YPos-$LabelDimensions['label_height']+$Field['VPos'],$LabelDimensions['label_width']-$Field['HPos']-20,$Field['FontSize'],$Value); } @@ -366,179 +355,4 @@ } /*end of else not PrintPDF */ -function Barcode39 ($barcode, $FileName='',$width=160, $height=80, $text='') { - - /* Generate a Code 3 of 9 barcode */ - - $im = ImageCreate ($width, $height) - or die ("Cannot Initialize new GD image stream"); - $White = ImageColorAllocate ($im, 255, 255, 255); - $Black = ImageColorAllocate ($im, 0, 0, 0); - //ImageColorTransparent ($im, $White); - ImageInterLace ($im, 1); - - $NarrowRatio = 20; - $WideRatio = 55; - $QuietRatio = 35; - - $nChars = (strlen($barcode)+2) * ((6 * $NarrowRatio) + (3 * $WideRatio) + ($QuietRatio)); - $Pixels = $width / $nChars; - $NarrowBar = (int)(20 * $Pixels); - $WideBar = (int)(55 * $Pixels); - $QuietBar = (int)(35 * $Pixels); - - $ActualWidth = (($NarrowBar * 6) + ($WideBar*3) + $QuietBar) * (strlen ($barcode)+2); - - if (($NarrowBar == 0) || ($NarrowBar == $WideBar) || ($NarrowBar == $QuietBar) || ($WideBar == 0) || ($WideBar == $QuietBar) || ($QuietBar == 0)) { - ImageString ($im, 1, 0, 0, "Image is too small!", $Black); - ImageJPEG ($im, $FileName, 100); - exit; - } - - $CurrentBarX = (int)(($width - $ActualWidth) / 2); - $Color = $White; - $BarcodeFull = "*".strtoupper ($barcode)."*"; - settype ($BarcodeFull, "string"); - - $FontNum = 3; - $FontHeight = ImageFontHeight ($FontNum); - $FontWidth = ImageFontWidth ($FontNum); - if ($text != 0) { - $CenterLoc = (int)(($width-1) / 2) - (int)(($FontWidth * strlen($BarcodeFull)) / 2); - ImageString ($im, $FontNum, $CenterLoc, $height-$FontHeight, "$BarcodeFull", $Black); - } else { - $FontHeight=-2; - } - - - for ($i=0; $i<strlen($BarcodeFull); $i++) { - $StripeCode = Code39 ($BarcodeFull[$i]); - - for ($n=0; $n < 9; $n++) { - if ($Color == $White){ - $Color = $Black; - } else { - $Color = $White; - } - - switch ($StripeCode[$n]) { - case '0': - ImageFilledRectangle ($im, $CurrentBarX, 0, $CurrentBarX+$NarrowBar, $height-1-$FontHeight-2, $Color); - $CurrentBarX += $NarrowBar; - break; - - case '1': - ImageFilledRectangle ($im, $CurrentBarX, 0, $CurrentBarX+$WideBar, $height-1-$FontHeight-2, $Color); - $CurrentBarX += $WideBar; - break; - } - } - - $Color = $White; - ImageFilledRectangle ($im, $CurrentBarX, 0, $CurrentBarX+$QuietBar, $height-1-$FontHeight-2, $Color); - $CurrentBarX += $QuietBar; - } //end loop around each character in barcode string - - imagejpeg ($im, $FileName, 100); -}//end Barcode39 - -//----------------------------------------------------------------------------- -// Returns the Code 3 of 9 value for a given ASCII character -//----------------------------------------------------------------------------- -function Code39 ($Asc) { - switch ($Asc) { - case ' ': - return "011000100"; - case '$': - return "010101000"; - case '%': - return "000101010"; - case '*': - return "010010100"; // * Start/Stop - case '+': - return "010001010"; - case '|': - return "010000101"; - case '.': - return "110000100"; - case '/': - return "010100010"; - case '-': - return "010000101"; - case '0': - return "000110100"; - case '1': - return "100100001"; - case '2': - return "001100001"; - case '3': - return "101100000"; - case '4': - return "000110001"; - case '5': - return "100110000"; - case '6': - return "001110000"; - case '7': - return "000100101"; - case '8': - return "100100100"; - case '9': - return "001100100"; - case 'A': - return "100001001"; - case 'B': - return "001001001"; - case 'C': - return "101001000"; - case 'D': - return "000011001"; - case 'E': - return "100011000"; - case 'F': - return "001011000"; - case 'G': - return "000001101"; - case 'H': - return "100001100"; - case 'I': - return "001001100"; - case 'J': - return "000011100"; - case 'K': - return "100000011"; - case 'L': - return "001000011"; - case 'M': - return "101000010"; - case 'N': - return "000010011"; - case 'O': - return "100010010"; - case 'P': - return "001010010"; - case 'Q': - return "000000111"; - case 'R': - return "100000110"; - case 'S': - return "001000110"; - case 'T': - return "000010110"; - case 'U': - return "110000001"; - case 'V': - return "011000001"; - case 'W': - return "111000000"; - case 'X': - return "010010001"; - case 'Y': - return "110010000"; - case 'Z': - return "011010000"; - default: - return "011000100"; - } -} ?> \ No newline at end of file Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2012-05-25 06:22:39 UTC (rev 5398) +++ trunk/PrintCustTrans.php 2012-05-26 10:46:05 UTC (rev 5399) @@ -65,6 +65,7 @@ $pdf->setAutoPageBreak(0); $pdf->setPrintHeader(false); + $pdf->setPrintFooter(false); $pdf->AddPage(); $pdf->cMargin = 0; /* END Brought from class.pdf.php constructor */ Modified: trunk/PrintCustTransPortrait.php =================================================================== --- trunk/PrintCustTransPortrait.php 2012-05-25 06:22:39 UTC (rev 5398) +++ trunk/PrintCustTransPortrait.php 2012-05-26 10:46:05 UTC (rev 5399) @@ -63,6 +63,7 @@ $pdf->setAutoPageBreak(0); $pdf->setPrintHeader(false); + $pdf->setPrintFooter(false); $pdf->AddPage(); $pdf->cMargin = 0; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-05-25 06:22:39 UTC (rev 5398) +++ trunk/doc/Change.log 2012-05-26 10:46:05 UTC (rev 5399) @@ -1,5 +1,6 @@ webERP Change Log +26/5/2012 Phil: Fix barcode printing on PDFPrintLabel.php - barcode functionality is unreliable so used (http://www.barcodepack.com) by Tomáš Horáček very simple and clean 23/5/2012 Klaus: PO_PDFPurchOrders.php print purchase orders with supplier's code where it is available in the purchasing data 23/5/2012 Exson: Revise GLAccounts.php to make more than 10 digits account code is allowed. 2012/05/22 Exson: Modify accountcode to varchar(20) to meet some countries accounting regulation for more digits account code. Added: trunk/includes/barcodepack/class.barcode.php =================================================================== --- trunk/includes/barcodepack/class.barcode.php (rev 0) +++ trunk/includes/barcodepack/class.barcode.php 2012-05-26 10:46:05 UTC (rev 5399) @@ -0,0 +1,76 @@ +<?php + +/** + * This file is part of the BarcodePack - PHP Barcode Library. + * Copyright (c) 2011 Tomáš Horáček (http://www.barcodepack.com) + * BarcodePack by Tomáš Horáček is licensed under + * a Creative Commons Attribution-NoDerivs 3.0 Unported License. + */ + + + +// Error codes + +define('E_EMPTY_TEXT', 100); +define('E_MODULE_SIZE', 101); + + +/** + * barcode + * + * Main class of BarcodePack Library + * + * @author Tomáš Horáček <in...@we...> + * @package BarcodePack + */ +class barcode { + + // Minimal module size + const MIN_MODULE_SIZE = 1; + + // Maximal module size + const MAX_MODULE_SIZE = 10; + + // Default module size + const MODULE_SIZE = 2; + + /** + * Text to be encoded + * @var string + */ + protected $text = ''; + + /** + * Module size in pixels + * @var int + */ + protected $moduleSize = null; + + + /** + * Constructor + * + * @param string $text + * @param int $moduleSize + */ + public function __construct($text, $moduleSize=self::MODULE_SIZE) + { + + // input text check + if(!empty ($text)) { + $this->text = $text; + } else { + throw new Exception('Input text can not be empty.', E_EMPTY_TEXT); + } + + // Module size check + $moduleSize = (int) $moduleSize; + if($moduleSize >= self::MIN_MODULE_SIZE && $moduleSize <= self::MAX_MODULE_SIZE) { + $this->moduleSize = $moduleSize; + } else { + throw new Exception('Module size have to be in range '.self::MIN_MODULE_SIZE.' - '.self::MAX_MODULE_SIZE.'.', E_MODULE_SIZE); + } + + } + +} Property changes on: trunk/includes/barcodepack/class.barcode.php ___________________________________________________________________ Added: svn:executable + * Added: trunk/includes/barcodepack/class.code128.php =================================================================== --- trunk/includes/barcodepack/class.code128.php (rev 0) +++ trunk/includes/barcodepack/class.code128.php 2012-05-26 10:46:05 UTC (rev 5399) @@ -0,0 +1,338 @@ +<?php + +/** + * This file is part of the BarcodePack - PHP Barcode Library. + * Copyright (c) 2011 Tomáš Horáček (http://www.barcodepack.com) + * BarcodePack by Tomáš Horáček is licensed under + * a Creative Commons Attribution-NoDerivs 3.0 Unported License. + */ + + + +require_once 'class.linearBarcode.php'; + +/** + * Code 128 + * Class implements Code 128 barcode + * + * @author Tomáš Horáček <in...@we...> + * @package BarcodePack + */ +class code128 extends linearBarcode { + + // Code sets + const CHARSET_A = 'A'; + const CHARSET_B = 'B'; + const CHARSET_C = 'C'; + + const START_A = 103; + const START_B = 104; + const START_C = 105; + const STOP = 106; + const TERMINATION = 107; + + // Code sets switchers + const CODE_A = 101; + const CODE_B = 100; + const CODE_C = 99; + + + private $setA = array(); + private $setB = array(); + private $setC = array(); + + private $charsA = ''; + private $charsB = ''; + private $charsC = ''; + + /** + * Zero represents white line + * One represents black line + * + * After each character except STOP I will add one white line + * (separating line) + * + * ASCII (dec) => bitecode + * + * @var array + */ + private $codeTable = array( + '11011001100', // 01 + '11001101100', // 02 + '11001100110', // 03 + '10010011000', // 04 + '10010001100', // ... + '10001001100', + '10011001000', + '10011000100', + '10001100100', + '11001001000', + '11001000100', + '11000100100', + '10110011100', + '10011011100', + '10011001110', + '10111001100', + '10011101100', + '10011100110', + '11001110010', + '11001011100', + '11001001110', + '11011100100', + '11001110100', + '11101101110', + '11101001100', + '11100101100', + '11100100110', + '11101100100', + '11100110100', + '11100110010', + '11011011000', + '11011000110', + '11000110110', + '10100011000', + '10001011000', + '10001000110', + '10110001000', + '10001101000', + '10001100010', + '11010001000', + '11000101000', + '11000100010', + '10110111000', + '10110001110', + '10001101110', + '10111011000', + '10111000110', + '10001110110', + '11101110110', + '11010001110', + '11000101110', + '11011101000', + '11011100010', + '11011101110', + '11101011000', + '11101000110', + '11100010110', + '11101101000', + '11101100010', + '11100011010', + '11101111010', + '11001000010', + '11110001010', + '10100110000', + '10100001100', + '10010110000', + '10010000110', + '10000101100', + '10000100110', + '10110010000', + '10110000100', + '10011010000', + '10011000010', + '10000110100', + '10000110010', + '11000010010', + '11001010000', + '11110111010', + '11000010100', + '10001111010', + '10100111100', + '10010111100', + '10010011110', + '10111100100', + '10011110100', + '10011110010', + '11110100100', + '11110010100', + '11110010010', + '11011011110', + '11011110110', + '11110110110', + '10101111000', + '10100011110', + '10001011110', + '10111101000', + '10111100010', + '11110101000', + '11110100010', + '10111011110', + '10111101110', + '11101011110', + '11110101110', + '11010000100', // 103 START A + '11010010000', // 104 START B + '11010011100', // 105 START C + '11000111010', // 106 STOP + '11' // 107 Termination bar + ); + + + /** + * Constructor + * + * @param string $text + * @param int $moduleSize + */ + public function __construct($text, $moduleSize=2) + { + try { + // Fill set A + for($i=32; $i<=95; $i++) { + // chars SPACE - UNDERSPACE + $this->setA[$i] = $i - 32; + $this->charsA .= chr($i); + $allowedChars[] = chr($i); + } + for($i=0; $i<=31; $i++) { + // chars NUL - US (Unit seperator) + $this->setA[$i] = $i + 64; + $this->charsA .= chr($i); + $allowedChars[] = chr($i); + } + + /* Fill set B + * chars SPACE " " - "DEL" + */ + for($i=32; $i<=127; $i++) { + $this->setB[$i] = $i - 32; + $this->charsB .= chr($i); + $allowedChars[] = chr($i); + } + + + parent::__construct($text, $moduleSize, $allowedChars); + + + $this->biteCode = $this->createBiteCode(); + + } catch (Exception $e) { + throw $e; + } + + } + + + /** + * Create Bite Code + * + * + * @return string + */ + private function createBiteCode() + { + $biteCode = array(); + + $characterSet = self::CHARSET_B; // Default code set + + $weightedSum = 0; + $checksumCounter = 1; + + $biteCode['DATA'] = ''; + // Find start character + if(strlen($this->text)>=2 && is_numeric($this->text{0}) && is_numeric($this->text{1})) { + // If the first and second characters are numeric use character set C + // and insert START_C char + $biteCode['DATA'] .= $this->codeTable[self::START_C]; + $characterSet = self::CHARSET_C; + $weightedSum += self::START_C; + } else if (strpos ($this->charsB, $this->text{0})) { + // Character set B + $biteCode['DATA'] .= $this->codeTable[self::START_B]; + $characterSet = self::CHARSET_B; + $weightedSum += self::START_B; + } else if (strpos ($this->charsA, $this->text{0})) { + // Character set A + $biteCode['DATA'] .= $this->codeTable[self::START_A]; + $characterSet = self::CHARSET_A; + $weightedSum += self::START_A; + } else { + throw new Exception(); + } + + + for($i=0;$i<strlen($this->text);$i++) { + switch ($characterSet) { + case 'B': + // Character set B is default, so it is first + $characterValue = $this->setB[ord($this->text{$i})]; + $biteCode['DATA'] .= $this->codeTable[$characterValue]; + break; + + case 'A': + $characterValue = $this->setA[ord($this->text{$i})]; + $biteCode['DATA'] .= $this->codeTable[$characterValue]; + break; + + case 'C': + $characterValue = intval($this->text{$i}.$this->text{$i+1}); + $biteCode['DATA'] .= $this->codeTable[$characterValue]; + $i++; + break; + + default: + break; + } + + $weightedSum += $characterValue*$checksumCounter; + $checksumCounter++; + + // find next char set. + if(strlen($this->text) > ($i+2) && is_numeric($this->text{$i+1}) && is_numeric($this->text{$i+2})) { + if($characterSet!=self::CHARSET_C) { + $characterValue = 99; + $biteCode['DATA'] .= $this->codeTable[$characterValue]; + $weightedSum += $characterValue*$checksumCounter; + $checksumCounter++; + } + $characterSet = 'C'; + } else if(isset($this->text{$i+1})) { + $newCharacterSet = $this->findCharacterSet($this->text{$i+1}); + if($characterSet==self::CHARSET_C) { + if($newCharacterSet==self::CHARSET_A) { + $characterValue = 101; + } + else { + $characterValue = 100; + } + $weightedSum += $characterValue*$checksumCounter; + $checksumCounter++; + $biteCode['DATA'] .= $this->codeTable[$characterValue]; + } + $characterSet = $newCharacterSet; + } + } + + // Count the checksum + $checkSum = (int) $weightedSum%103; + + // Add the checksum + $biteCode['DATA'] .= $this->codeTable[$checkSum]; + + // Add the stop character + $biteCode['DATA'] .= $this->codeTable[self::STOP]; + + // Add the termination bar + $biteCode['DATA'] .= $this->codeTable[self::TERMINATION]; + + return $biteCode; + } + + + /** + * Find Character Set + * Find correct character set depends on imput char + * + * @param char $char + * @return char + */ + private function findCharacterSet($char) { + if(strpos($this->charsB, $char)!==false) { + return self::CHARSET_B; + } + if(strpos($this->charsA, $char)!==false) { + return self::CHARSET_A; + } + } + +} Property changes on: trunk/includes/barcodepack/class.code128.php ___________________________________________________________________ Added: svn:executable + * Added: trunk/includes/barcodepack/class.ean13.php =================================================================== --- trunk/includes/barcodepack/class.ean13.php (rev 0) +++ trunk/includes/barcodepack/class.ean13.php 2012-05-26 10:46:05 UTC (rev 5399) @@ -0,0 +1,209 @@ +<?php + +require_once 'class.linearBarcode.php'; + +// Error Codes +define('E_BAD_EAN_LENGTH', 600); + + + +/** + * EAN 13 + * + * @author Tomáš Horáček <in...@we...> + * @package BarcodePack + */ +class ean13 extends linearBarcode { + + /** @var array */ + private $allowedChars = array( + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + ); + + /** @var array */ + private $parity = array( + '0' => 'LLLLLLRRRRRR', + '1' => 'LLGLGGRRRRRR', + '2' => 'LLGGLGRRRRRR', + '3' => 'LLGGGLRRRRRR', + '4' => 'LGLLGGRRRRRR', + '5' => 'LGGLLGRRRRRR', + '6' => 'LGGGLLRRRRRR', + '7' => 'LGLGLGRRRRRR', + '8' => 'LGLGGLRRRRRR', + '9' => 'LGGLGLRRRRRR', + ); + + + /** + * Zero represents white line + * One represents black line + * + * After each character except STOP I will add one white line + * (separating line) + * + * @var array + */ + private $codeTable = array( + '0' => array('L'=>'0001101', 'G'=>'0100111', 'R'=>'1110010',), + '1' => array('L'=>'0011001', 'G'=>'0110011', 'R'=>'1100110',), + '2' => array('L'=>'0010011', 'G'=>'0011011', 'R'=>'1101100',), + '3' => array('L'=>'0111101', 'G'=>'0100001', 'R'=>'1000010',), + '4' => array('L'=>'0100011', 'G'=>'0011101', 'R'=>'1011100',), + '5' => array('L'=>'0110001', 'G'=>'0111001', 'R'=>'1001110',), + '6' => array('L'=>'0101111', 'G'=>'0000101', 'R'=>'1010000',), + '7' => array('L'=>'0111011', 'G'=>'0010001', 'R'=>'1000100',), + '8' => array('L'=>'0110111', 'G'=>'0001001', 'R'=>'1001000',), + '9' => array('L'=>'0001011', 'G'=>'0010111', 'R'=>'1110100',), + 'START' => '101', + 'SEPARATOR' => '01010', + 'STOP' => '101', + ); + + + /** + * Constructor + * + * @param string $text + * @param int $modulesize + */ + public function __construct($text, $moduleSize) + { + try { + parent::__construct($text, $moduleSize, $this->allowedChars); + + if(strlen($this->text)!=12) { + throw new Exception('Text length must be 12 characters.', E_BAD_EAN_LENGTH); + } + + $this->biteCode = $this->createBiteCode(); + } + catch(Exception $e) { + throw $e; + } + + } + + + /** + * Create Bite Code + * Create bitecode where 1 represents dark module and 0 white module. + * + * @return string + */ + private function createBiteCode() + { + $biteCode = array(); + + $saveTo = 'DATA'; + + // Parity determine + $parity = $this->parity[$this->text{0}]; + + $biteCode['START'] = $this->codeTable['START']; + + for($i=1;$i<strlen($this->text);$i++) { + $biteCode[$saveTo] .= $this->codeTable[$this->text{$i}][$parity{$i-1}]; + if($i==6) { + $biteCode['SEPARATOR'] = $this->codeTable['SEPARATOR']; + $saveTo = 'DATA2'; + } + + } + + $checksum = (string) $this->checksum($this->text); + + $this->text .= $checksum; + + $biteCode[$saveTo] .= $this->codeTable[$checksum]['R']; + + $biteCode['STOP'] = $this->codeTable['STOP']; + + return $biteCode; + } + + + /** + * Checksum + * Count checksum + * + * @param string $text + * @return int + */ + private function checksum($text) { + + $evensum = 0; + $oddsum = 0; + + for($i=1;$i<=strlen($text);$i++) { + if($i%2==0) { + $evensum += (int) $text{$i-1}; + } else { + $oddsum += (int) $text{$i-1}; + } + } + + $sum = $evensum*3 + $oddsum; + + return ceil($sum/10)*10 - $sum; + } + + + /** + * Draw + * Add text into barcode + * + * @param bool $showText + * @return image resource + */ + public function draw($showText = true) { + $im = parent::draw(false); + + $margin = $this->margin*$this->moduleSize; + + + $white = Imagecolorallocate ($im,255,255,255); + $black = Imagecolorallocate ($im,0,0,0); + + + if($showText) { + + // Increase space between symbol 2x + $im2 = ImageCreate($this->getBarcodeLen()*$this->moduleSize+(2*$margin)+$margin, + $this->height+$this->fontSize+(2*$margin)); + + imagecopy($im2, $im, $margin, 0, 0, 0, $this->getBarcodeLen()*$this->moduleSize+(2*$margin), $this->height+$this->fontSize+(2*$margin)); + + // Divide text into three parts and each insert to the diffrerent place + $charsA = $this->text{0}; // first char + for($i=1;$i<=strlen($this->text);$i++) { + if($i<=6) { + $charsB .= $this->text{$i}; + } else { + $charsC .= $this->text{$i}; + } + } + + // Insert A + $textWidth = ImageFontWidth($this->fontSize)*strlen($charsA); + imagestring ($im2, $this->fontSize, + $margin, + $this->height-$this->fontSize/2+$margin, $charsA, $black); + + // Insert B + $textWidth = ImageFontWidth($this->fontSize)*strlen($charsB); + imagestring ($im2, $this->fontSize, + $this->getBarcodeLen()*$this->moduleSize/4-$textWidth/2+2*$margin, + $this->height-$this->fontSize/2+$margin, $charsB, $black); + + // Insert C + $textWidth = ImageFontWidth($this->fontSize)*strlen($charsC); + imagestring ($im2, $this->fontSize, + $this->getBarcodeLen()*$this->moduleSize-$this->getBarcodeLen()*$this->moduleSize/4-$textWidth/2+2*$margin, + $this->height-$this->fontSize/2+$margin, $charsC, $black); + } + + return $im2; + } + +} Property changes on: trunk/includes/barcodepack/class.ean13.php ___________________________________________________________________ Added: svn:executable + * Added: trunk/includes/barcodepack/class.i2of5.php =================================================================== --- trunk/includes/barcodepack/class.i2of5.php (rev 0) +++ trunk/includes/barcodepack/class.i2of5.php 2012-05-26 10:46:05 UTC (rev 5399) @@ -0,0 +1,135 @@ +<?php + +/** + * This file is part of the BarcodePack - PHP Barcode Library. + * Copyright (c) 2011 Tomáš Horáček (http://www.barcodepack.com) + * BarcodePack by Tomáš Horáček is licensed under + * a Creative Commons Attribution-NoDerivs 3.0 Unported License. + */ + + + +require_once 'class.linearBarcode.php'; + + +// Error codes +define('E_ODD_LENGTH', 500); + + +/** + * i2of5 + * + * Interleaved 2/5 + * + * @author Tomáš Horáček <in...@we...> + * @package BarcodePack + */ +class i2of5 extends linearBarcode { + + /** @var array */ + private $allowedChars = array( + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + ); + + /** + * Coding table + * + * @var array + */ + private $codeTable = array( + '0' => '1010111011101', + '1' => '1110101010111', + '2' => '1011101010111', + '3' => '1110111010101', + '4' => '1010111010111', + '5' => '1110101110101', + '6' => '1011101110101', + '7' => '1010101110111', + '8' => '1110101011101', + '9' => '1011101011101', + 'START' => '1010', + 'STOP' => '11101', + ); + + + /** + * Constructor + * + * @param string $text + * @param int $modulesize + */ + public function __construct($text, $moduleSize) + { + try { + parent::__construct($text, $moduleSize, $this->allowedChars); + + if((strlen($this->text)%2)!=0) { + throw new Exception('The number of characters must be even', E_ODD_LENGTH); + } + + $this->biteCode = $this->createBiteCode(); + } + catch(Exception $e) { + throw $e; + } + + } + + + /** + * Create Bite Code + * + * @return string + */ + private function createBiteCode() + { + $biteCode = array(); + + // START character + $biteCode['START'] = $this->codeTable['START']; + + $biteCode['DATA'] = ''; + + + for($i=0;$i<strlen($this->text);$i++) { + $firstCounter = 0; // Num of line module + $secondCounter = 0; // Num of space module + + // Each char is encoded to 5 lines or spaces + for($j=0; $j<5; $j++) { + + // Encode first char into lines + $bars = true; + while($bars && $firstCounter<13) { + if($this->codeTable[$this->text{$i}]{$firstCounter}=="1") { + $biteCode['DATA'] .= '1'; // line + } else { + $bars = false; + } + $firstCounter++; // jump to next line + } + + // Second char is encoded to spaces + $spaces = true; + while($spaces && $secondCounter<13) { + if($this->codeTable[$this->text{$i+1}]{$secondCounter}=='1') { + $biteCode['DATA'] .= '0'; // space + $secondCounter++; + } else { + $spaces = false; + $secondCounter++; // jump to next space + } + } + } + + $i++; // jump to next char + } + + // Insert STOP character + $biteCode['STOP'] = $this->codeTable['STOP']; + + return $biteCode; + } + + +} Property changes on: trunk/includes/barcodepack/class.i2of5.php ___________________________________________________________________ Added: svn:executable + * Added: trunk/includes/barcodepack/class.linearBarcode.php =================================================================== --- trunk/includes/barcodepack/class.linearBarcode.php (rev 0) +++ trunk/includes/barcodepack/class.linearBarcode.php 2012-05-26 10:46:05 UTC (rev 5399) @@ -0,0 +1,175 @@ +<?php + +/** + * This file is part of the BarcodePack - PHP Barcode Library. + * Copyright (c) 2011 Tomáš Horáček (http://www.barcodepack.com) + * BarcodePack by Tomáš Horáček is licensed under + * a Creative Commons Attribution-NoDerivs 3.0 Unported License. + */ + + + +require_once 'class.barcode.php'; + +// Error codes +define('E_BAD_CHARS', 200); + + +/** + * Linear Barcode + * Parent class for all linear barcode types + * + * @author Tomáš Horáček <in...@we...> + * @package BarcodePack + */ +class linearBarcode extends barcode { + + /** @var array */ + protected $biteCode = array(); + + /** @var int */ + protected $height = 100; + + /** @var int */ + protected $fontSize = 10; + + /** + * Quiet zone + * Multiple of module size + * @var int */ + protected $margin = 5; + + /** + * Constructor + * + * @param string $text + * @param int $modulesize + */ + public function __construct($text, $moduleSize=2, $allowedChars=null) + { + try { + parent::__construct($text, $moduleSize); + + if($allowedChars) { + $this->checkAllowedChars($text, $allowedChars); + } + + } catch (Exception $e) { + throw $e; + } + } + + + /** + * Check Allowed Chars + * + * @param string $text + * @param array $alloweChars + * @return bool + */ + protected function checkAllowedChars($text, $allowedChars) + { + for($i=0; $i<strlen($text); $i++) { + if(!in_array($text{$i}, $allowedChars)) { + throw new Exception('Input text contains nonallowed characters.', E_BAD_CHARS); + return false; + } + } + return true; + } + + + + /** + * Get Barcode Length + * @return int + */ + protected function getBarcodeLen() { + $len = 0; + foreach ($this->biteCode as $value) { + $len += strlen($value); + } + return $len; + } + + + /** + * Draw + * Create image with barcode + * + * @param bool $showText + * @return image resource + */ + public function draw($showText=true) + { + // Image create + $margin = $this->margin*$this->moduleSize; + $im = ImageCreate($this->getBarcodeLen()*$this->moduleSize+(2*$margin), + $this->height+$this->fontSize+(2*$margin)); + + // Color set + $white = Imagecolorallocate ($im,255,255,255); + $black = Imagecolorallocate ($im,0,0,0); + + + // Draw lines + $pos = 0; + foreach ($this->biteCode as $type => $values) { + switch($type) { + case 'DATA': + case 'DATA2': + // Data + for($i=0;$i<strlen($values);$i++) { + $color = (($values{$i})=='1') ? $black : $white; + imagefilledrectangle($im, $pos*$this->moduleSize+$margin, $margin, + ($pos+1)*$this->moduleSize+$margin, + $this->height-5*$this->moduleSize+$margin, $color); + $pos++; + } + break; + default: + // Special chars + // will be longer + for($i=0;$i<strlen($values);$i++) { + + $color = (($values{$i})=='1') ? $black : $white; + imagefilledrectangle($im, $pos*$this->moduleSize+$margin, $margin, + ($pos+1)*$this->moduleSize+$margin, $this->height+$margin, + $color); + $pos++; + } + + break; + } + } + + // Text + if($showText) { + $textWidth = ImageFontWidth($this->fontSize)*strlen($this->text); + imagestring ($im, $this->fontSize, + $this->getBarcodeLen()*$this->moduleSize/2-$textWidth/2+$margin, + $this->height-$this->fontSize/2+$margin, $this->text, $black); + } + + return $im; + } + + + /** + * Raw Data + * Returns data in text representation + * Black module is represented as 1 and white module as 0 + * + * @return string $output + */ + public function rawData() + { + $ret = ''; + foreach ($this->biteCode as $value) { + $ret .= $value; + } + return $ret; + } + + +} Added: trunk/includes/barcodepack/class.qrCode.php =================================================================== --- trunk/includes/barcodepack/class.qrCode.php (rev 0) +++ trunk/includes/barcodepack/class.qrCode.php 2012-05-26 10:46:05 UTC (rev 5399) @@ -0,0 +1,1266 @@ +<?php + +/** + * This file is part of the BarcodePack - PHP Barcode Library. + * Copyright (c) 2011 Tomáš Horáček (http://www.barcodepack.com) + * BarcodePack by Tomáš Horáček is licensed under + * a Creative Commons Attribution-NoDerivs 3.0 Unported License. + */ + + + +require_once 'class.barcode.php'; + +// Erroe codes +define('E_BAD_QR_LENGTH', 800); +define('E_BAD_VERSION', 801); +define('E_BAD_MASK', 802); + + + +/** + * qrCode + * Class for QR Code generation + * + * @author Tomáš Horáček <in...@we...> + * @package BarcodePack + */ +class qrCode extends barcode { + + // Error correction levels + const ECL_L_CODE = 'L'; + const ECL_M_CODE = 'M'; + const ECL_Q_CODE = 'Q'; + const ECL_H_CODE = 'H'; + + const DEFAULT_ECL = 'M'; + + // Error correction levels numbers + const ECL_L = 1; + const ECL_M = 0; + const ECL_Q = 3; + const ECL_H = 2; + + + // Mode indicators + const MODE_ECI = 7; + const MODE_NUMERIC = 1; + const MODE_ALPHANUMERIC = 2; + const MODE_8BITBYTE = 4; + const MODE_KANJI = 8; + const MODE_STRUCTURED_APPEND = 3; + const MODE_FNC1_FP = 5; // First position + const MODE_FNC1_SP = 9; // Second position + const MODE_TERMINATOR = 0; + + // Quiet zone size + const QUIET_ZONE = 4; + + // Directions + const DIRECTION_UP = 'UP'; + const DIRECTION_DOWN = 'DOWN'; + + /** + * Error correction level + * @var char + */ + private $ecl = self::ECL_L; + + /** + * Version (1-40) + * @var int + */ + private $version = 1; + + /** + * Matrix size (QR code size without quiet zone) + * @var int + */ + private $matrixSize = 0; + + /** + * Symbol size with quiet zone + * @var int + */ + private $symbolSize = 0; + + /** + * Number of imput characters + * @var int + */ + private $charsNum = 0; + + /** + * Mode indicator + * @var int + */ + private $mode; + + /** + * QR code matrix + * @var array + */ + private $matrix; + + /** + * Masked matrix + * @var array + */ + private $maskedMatrix; + + /** + * Coordinates of modules in matrix + * @var array + */ + private $bitsCoordinates; + + /** + * Mask reference (0-7) + * @var int + */ + private $maskReference; + + /** + * ECL conversion table + * @var array + */ + private $eclConvertTable = array( + self::ECL_L_CODE => self::ECL_L, + self::ECL_M_CODE => self::ECL_M, + self::ECL_Q_CODE => self::ECL_Q, + self::ECL_H_CODE => self::ECL_H, + ); + + /** + * Number of bits the num chars indicator is saved + * @var array + */ + private $characterCountIndicatorBits = array( + self::MODE_NUMERIC => array(1=> 10, 10, 10, 10, 10, 10, 10, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,), + self::MODE_ALPHANUMERIC => array(1=> 9, 9, 9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,), + self::MODE_8BITBYTE => array(1=> 8, 8, 8, 8, 8, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,), + self::MODE_KANJI => array(1=> 8, 8, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,), + ); + + /** + * Code capacity + * Include mode indicator and num chars indicator without ECL + * @var array + */ + private $numberDataBits = array( + self::ECL_L => array(1 => 152, 272, 440, 640, 864, 1088, 1248, 1552, 1856, 2192, 2592, 2960, 3424, 3688, 4184, 4712, 5176, 5768, 6360, 6888, 7456, 8048, 8752, 9392, 10208, 10960, 11744, 12248, 13048, 13880, 14744, 15640, 16568, 17528, 18448, 19472, 20528, 21616, 22496, 23648,), + self::ECL_M => array(1 => 128, 224, 352, 512, 688, 864, 992, 1232, 1456, 1728, 2032, 2320, 2672, 2920, 3320, 3624, 4056, 4504, 5016, 5352, 5712, 6256, 6880, 7312, 8000, 8496, 9024, 9544, 10136, 10984, 11640, 12328, 13048, 13800, 14496, 15312, 15936, 16816, 17728, 18672,), + self::ECL_Q => array(1 => 104, 176, 272, 384, 496, 608, 704, 880, 1056, 1232, 1440, 1648, 1952, 2088, 2360, 2600, 2936, 3176, 3560, 3880, 4096, 4544, 4912, 5312, 5744, 6032, 6464, 6968, 7288, 7880, 8264, 8920, 9368, 9848, 10288, 10832, 11408, 12016, 12656, 13328,), + self::ECL_H => array(1 => 72, 128, 208, 288, 368, 480, 528, 688, 800, 976, 1120, 1264, 1440, 1576, 1784, 2024, 2264, 2504, 2728, 3080, 3248, 3536, 3712, 4112, 4304, 4768, 5024, 5288, 5608, 5960, 6344, 6760, 7208, 7688, 7888, 8432, 8768, 9136, 9776, 10208,), + ); + + /** + * Code capacity in codewords + * @var array + */ + private $codewordsCapacity=array(1 => 26,44,70,100,134,172,196,242, + 292,346,404,466,532,581,655,733,815,901,991,1085,1156, + 1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465, + 2611,2761,2876,3034,3196,3362,3532,3706); + + /** + * Capacity in characters + * @var array + */ + private $dataCapacity = array( + self::ECL_L => array( + self::MODE_NUMERIC => array(1 => 41, 77, 127, 187, 255, 322, 370, 461, 552, 652, 772, 883, 1022, 1101, 1250, 1408, 1548, 1725, 1903, 2061, 2232, 2409, 2620, 2812, 3057, 3283, 3517, 3669, 3909, 4158, 4417, 4686, 4965, 5253, 5529, 5836, 6153, 6479, 6743, 7089,), + self::MODE_ALPHANUMERIC => array(1 => 25, 47, 77, 114, 154, 195, 224, 279, 335, 395, 468, 535, 619, 667, 758, 854, 938, 1046, 1153, 1249, 1352, 1460, 1588, 1704, 1853, 1990, 2132, 2223, 2369, 2520, 2677, 2840, 3009, 3183, 3351, 3537, 3729, 3927, 4087, 4296,), + self::MODE_8BITBYTE => array(1 => 17, 32, 53, 78, 106, 134, 154, 192, 230, 271, 321, 367, 425, 458, 520, 586, 644, 718, 792, 858, 929, 1003, 1091, 1171, 1273, 1367, 1465, 1528, 1628, 1732, 1840, 1952, 2068, 2188, 2303, 2431, 2563, 2699, 2809, 2953,), + self::MODE_KANJI => array(1 => 10, 20, 32, 48, 65, 82, 95, 118, 141, 167, 198, 226, 262, 282, 320, 361, 397, 442, 488, 528, 572, 618, 672, 721, 784, 842, 902, 940, 1002, 1066, 1132, 1201, 1273, 1347, 1417, 1496, 1577, 1661, 1729, 1817,), + ), + self::ECL_M => array( + self::MODE_NUMERIC => array(1 => 34, 63, 101, 149, 202, 255, 293, 365, 432, 513, 604, 691, 796, 871, 991, 1082, 1212, 1346, 1500, 1600, 1708, 1872, 2059, 2188, 2395, 2544, 2701, 2857, 3035, 3289, 3486, 3693, 3909, 4134, 4343, 4588, 4775, 5039, 5313, 5596,), + self::MODE_ALPHANUMERIC => array(1 => 20, 38, 61, 90, 122, 154, 178, 221, 262, 311, 366, 419, 483, 528, 600, 656, 734, 816, 909, 970, 1035, 1134, 1248, 1326, 1451, 1542, 1637, 1732, 1839, 1994, 2113, 2238, 2369, 2506, 2632, 2780, 2894, 3054, 3220, 3391,), + self::MODE_8BITBYTE => array(1 => 14, 26, 42, 62, 84, 106, 122, 152, 180, 213, 251, 287, 331, 362, 412, 450, 504, 560, 624, 666, 711, 779, 857, 911, 997, 1059, 1125, 1190, 1264, 1370, 1452, 1538, 1628, 1722, 1809, 1911, 1989, 2099, 2213, 2331,), + self::MODE_KANJI => array(1 => 8, 16, 26, 38, 52, 65, 75, 93, 111, 131, 155, 177, 204, 223, 254, 277, 310, 345, 384, 410, 438, 480, 528, 561, 614, 652, 692, 732, 778, 843, 894, 947, 1002, 1060, 1113, 1176, 1224, 1292, 1362, 1435,), + ), + self::ECL_Q => array( + self::MODE_NUMERIC => array(1 => 27, 48, 77, 111, 144, 178, 207, 259, 312, 364, 427, 489, 580, 621, 703, 775, 876, 948, 1063, 1159, 1224, 1358, 1468, 1588, 1718, 1804, 1933, 2085, 2181, 2358, 2473, 2670, 2805, 2949, 3081, 3244, 3417, 3599, 3791, 3993,), + self::MODE_ALPHANUMERIC => array(1 => 16, 29, 47, 67, 87, 108, 125, 157, 189, 221, 259, 296, 352, 376, 426, 470, 531, 574, 644, 702, 742, 823, 890, 963, 1041, 1094, 1172, 1263, 1322, 1429, 1499, 1618, 1700, 1787, 1867, 1966, 2071, 2181, 2298, 2420,), + self::MODE_8BITBYTE => array(1 => 11, 20, 32, 46, 60, 74, 86, 108, 130, 151, 177, 203, 241, 258, 292, 322, 364, 394, 442, 482, 509, 565, 611, 661, 715, 751, 805, 868, 908, 982, 1030, 1112, 1168, 1228, 1283, 1351, 1423, 1499, 1579, 1663,), + self::MODE_KANJI => array(1 => 7, 12, 20, 28, 37, 45, 53, 66, 80, 93, 109, 125, 149, 159, 180, 198, 224, 243, 272, 297, 314, 348, 376, 407, 440, 462, 496, 534, 559, 604, 634, 684, 719, 756, 790, 832, 876, 923, 972, 1024,), + ), + self::ECL_H => array( + self::MODE_NUMERIC => array(1 => 17, 34, 58, 82, 106, 139, 154, 202, 235, 288, 331, 374, 427, 468, 530, 602, 674, 746, 813, 919, 969, 1056, 1108, 1228, 1286, 1425, 1501, 1581, 1677, 1782, 1897, 2022, 2157, 2301, 2361, 2524, 2625, 2735, 2927, 3057,), + self::MODE_ALPHANUMERIC => array(1 => 10, 20, 35, 50, 64, 84, 93, 122, 143, 174, 200, 227, 259, 283, 321, 365, 408, 452, 493, 557, 587, 640, 672, 744, 779, 864, 910, 958, 1016, 1080, 1150, 1226, 1307, 1394, 1431, 1530, 1591, 1658, 1774, 1852,), + self::MODE_8BITBYTE => array(1 => 7, 14, 24, 34, 44, 58, 64, 84, 98, 119, 137, 155, 177, 194, 220, 250, 280, 310, 338, 382, 403, 439, 461, 511, 535, 593, 625, 658, 698, 742, 790, 842, 898, 958, 983, 1051, 1093, 1139, 1219, 1273,), + self::MODE_KANJI => array(1 => 4, 8, 15, 21, 27, 36, 39, 52, 60, 74, 85, 96, 109, 120, 136, 154, 173, 191, 208, 235, 248, 270, 284, 315, 330, 365, 385, 405, 430, 457, 486, 518, 553, 590, 605, 647, 673, 701, 750, 784,), + ), + ); + + /** + * Position detection pattern + * @var array + */ + private $positionPattern = array( + 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, + ); + + /** + * Alignment pattern + * @var array + */ + private $alignmentPattern = array( + 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, + ); + + /** + * Coordinates of alignment patterns + * @var array + */ + private $alignmentPatternCoordinate = array( + 1 => array(), + array(6, 18), + array(6, 22), + array(6, 26), + array(6, 30), + array(6, 34), + array(6, 22, 38), + array(6, 24, 42), + array(6, 26, 46), + array(6, 28, 50), + array(6, 30, 54), + array(6, 32, 58), + array(6, 34, 62), + array(6, 26, 46, 66,), + array(6, 26, 48, 70,), + array(6, 26, 50, 74,), + array(6, 30, 54, 78,), + array(6, 30, 56, 82,), + array(6, 30, 58, 86,), + array(6, 34, 62, 90,), + array(6, 28, 50, 72, 94), + array(6, 26, 50, 74, 98,), + array(6, 30, 54, 78, 102,), + array(6, 28, 54, 80, 106), + array(6, 32, 58, 84, 110,), + array(6, 30, 58, 86, 114,), + array(6, 34, 62, 90, 118,), + array(6, 26, 50, 74, 98, 122,), + array(6, 30, 54, 78, 102, 126,), + array(6, 26, 52, 78, 104, 130,), + array(6, 30, 56, 82, 108, 134,), + array(6, 34, 60, 86, 112, 138,), + array(6, 30, 58, 86, 114, 142,), + array(6, 34, 62, 90, 118, 146,), + array(6, 30, 54, 78, 102, 126, 150,), + array(6, 24, 50, 76, 102, 128, 154,), + array(6, 28, 54, 80, 106, 132, 158,), + array(6, 32, 58, 84, 110, 136, 162,), + array(6, 26, 54, 82, 110, 138, 166,), + array(6, 30, 58, 86, 114, 142, 170), + ); + + + /** + * Block specification + * @var array + */ + private $blocksSpec = array( + 1 => + array(self::ECL_L => array( 1, 0), self::ECL_M => array( 1, 0), self::ECL_Q => array( 1, 0), self::ECL_H => array( 1, 0)), // 1 + array(self::ECL_L => array( 1, 0), self::ECL_M => array( 1, 0), self::ECL_Q => array( 1, 0), self::ECL_H => array( 1, 0)), + array(self::ECL_L => array( 1, 0), self::ECL_M => array( 1, 0), self::ECL_Q => array( 2, 0), self::ECL_H => array( 2, 0)), + array(self::ECL_L => array( 1, 0), self::ECL_M => array( 2, 0), self::ECL_Q => array( 2, 0), self::ECL_H => array( 4, 0)), + array(self::ECL_L => array( 1, 0), self::ECL_M => array( 2, 0), self::ECL_Q => array( 2, 2), self::ECL_H => array( 2, 2)), // 5 + array(self::ECL_L => array( 2, 0), self::ECL_M => array( 4, 0), self::ECL_Q => array( 4, 0), self::ECL_H => array( 4, 0)), + array(self::ECL_L => array( 2, 0), self::ECL_M => array( 4, 0), self::ECL_Q => array( 2, 4), self::ECL_H => array( 4, 1)), + array(self::ECL_L => array( 2, 0), self::ECL_M => array( 2, 2), self::ECL_Q => array( 4, 2), self::ECL_H => array( 4, 2)), + array(self::ECL_L => array( 2, 0), self::ECL_M => array( 3, 2), self::ECL_Q => array( 4, 4), self::ECL_H => array( 4, 4)), + array(self::ECL_L => array( 2, 2), self::ECL_M => array( 4, 1), self::ECL_Q => array( 6, 2), self::ECL_H => array( 6, 2)), //10 + array(self::ECL_L => array( 4, 0), self::ECL_M => array( 1, 4), self::ECL_Q => array( 4, 4), self::ECL_H => array( 3, 8)), + array(self::ECL_L => array( 2, 2), self::ECL_M => array( 6, 2), self::ECL_Q => array( 4, 6), self::ECL_H => array( 7, 4)), + array(self::ECL_L => array( 4, 0), self::ECL_M => array( 8, 1), self::ECL_Q => array( 8, 4), self::ECL_H => array(12, 4)), + array(self::ECL_L => array( 3, 1), self::ECL_M => array( 4, 5), self::ECL_Q => array(11, 5), self::ECL_H => array(11, 5)), + array(self::ECL_L => array( 5, 1), self::ECL_M => array( 5, 5), self::ECL_Q => array( 5, 7), self::ECL_H => array(11, 7)), //15 + array(self::ECL_L => array( 5, 1), self::ECL_M => array( 7, 3), self::ECL_Q => array(15, 2), self::ECL_H => array( 3, 13)), + array(self::ECL_L => array( 1, 5), self::ECL_M => array(10, 1), self::ECL_Q => array( 1, 15), self::ECL_H => array( 2, 17)), + array(self::ECL_L => array( 5, 1), self::ECL_M => array( 9, 4), self::ECL_Q => array(17, 1), self::ECL_H => array( 2, 19)), + array(self::ECL_L => array( 3, 4), self::ECL_M => array( 3, 11), self::ECL_Q => array(17, 4), self::ECL_H => array( 9, 16)), + array(self::ECL_L => array( 3, 5), self::ECL_M => array( 3, 13), self::ECL_Q => array(15, 5), self::ECL_H => array(15, 10)), //20 + array(self::ECL_L => array( 4, 4), self::ECL_M => array(17, 0), self::ECL_Q => array(17, 6), self::ECL_H => array(19, 6)), + array(self::ECL_L => array( 2, 7), self::ECL_M => array(17, 0), self::ECL_Q => array( 7, 16), self::ECL_H => array(34, 0)), + array(self::ECL_L => array( 4, 5), self::ECL_M => array( 4, 14), self::ECL_Q => array(11, 14), self::ECL_H => array(16, 14)), + array(self::ECL_L => array( 6, 4), self::ECL_M => array( 6, 14), self::ECL_Q => array(11, 16), self::ECL_H => array(30, 2)), + array(self::ECL_L => array( 8, 4), self::ECL_M => array( 8, 13), self::ECL_Q => array( 7, 22), self::ECL_H => array(22, 13)), //25 + array(self::ECL_L => array(10, 2), self::ECL_M => array(19, 4), self::ECL_Q => array(28, 6), self::ECL_H => array(33, 4)), + array(self::ECL_L => array( 8, 4), self::ECL_M => array(22, 3), self::ECL_Q => array( 8, 26), self::ECL_H => array(12, 28)), + array(self::ECL_L => array( 3, 10), self::ECL_M => array( 3, 23), self::ECL_Q => array( 4, 31), self::ECL_H => array(11, 31)), + array(self::ECL_L => array( 7, 7), self::ECL_M => array(21, 7), self::ECL_Q => array( 1, 37), self::ECL_H => array(19, 26)), + array(self::ECL_L => array( 5, 10), self::ECL_M => array(19, 10), self::ECL_Q => array(15, 25), self::ECL_H => array(23, 25)), //30 + array(self::ECL_L => array(13, 3), self::ECL_M => array( 2, 29), self::ECL_Q => array(42, 1), self::ECL_H => array(23, 28)), + array(self::ECL_L => array(17, 0), self::ECL_M => array(10, 23), self::ECL_Q => array(10, 35), self::ECL_H => array(19, 35)), + array(self::ECL_L => array(17, 1), self::ECL_M => array(14, 21), self::ECL_Q => array(29, 19), self::ECL_H => array(11, 46)), + array(self::ECL_L => array(13, 6), self::ECL_M => array(14, 23), self::ECL_Q => array(44, 7), self::ECL_H => array(59, 1)), + array(self::ECL_L => array(12, 7), self::ECL_M => array(12, 26), self::ECL_Q => array(39, 14), self::ECL_H => array(22, 41)), //35 + array(self::ECL_L => array( 6, 14), self::ECL_M => array( 6, 34), self::ECL_Q => array(46, 10), self::ECL_H => array( 2, 64)), + array(self::ECL_L => array(17, 4), self::ECL_M => array(29, 14), self::ECL_Q => array(49, 10), self::ECL_H => array(24, 46)), + array(self::ECL_L => array( 4, 18), self::ECL_M => array(13, 32), self::ECL_Q => array(48, 14), self::ECL_H => array(42, 32)), + array(self::ECL_L => array(20, 4), self::ECL_M => array(40, 7), self::ECL_Q => array(43, 22), self::ECL_H => array(10, 67)), + array(self::ECL_L => array(19, 6), self::ECL_M => array(18, 31), self::ECL_Q => array(34, 34), self::ECL_H => array(20, 61)),//40 + ); + + /** + * Alphanumeric code coding table + * @var array + */ + private $alphanumCodingTable = array( + '0' => 0, '1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, + '6' => 6, '7' => 7, '8' => 8, '9' => 9, 'A' => 10, 'B' => 11, + 'C' => 12, 'D' => 13, 'E' => 14, 'F' => 15, 'G' => 16, 'H' => 17, + 'I' => 18, 'J' => 19, 'K' => 20, 'L' => 21, 'M' => 22, 'N' => 23, + 'O' => 24, 'P' => 25, 'Q' => 26, 'R' => 27, 'S' => 28, 'T' => 29, + 'U' => 30, 'V' => 31, 'W' => 32, 'X' => 33, 'Y' => 34, 'Z' => 35, + ' ' => 36, '$' => 37, '%' => 38, '*' => 39, '+' => 40, '-' => 41, + '.' => 42, '/' => 43, ':' => 44, + ); + + /** + * Version information + * From ISO/IEC 18004:2000, page 78-79 + * @var array + */ + private $versionInformationStream = array( + 7 => 0x07c94, 0x085bc, 0x09a99, 0x0a4d3, 0x0bbf6, 0x0c762, 0x0d847, + 0x0e60d, 0x0f928, 0x10b78, 0x1145d, 0x12a17, 0x13532, 0x149a6, 0x15683, + 0x168c9, 0x177ec, 0x18ec4, 0x191e1, 0x1afab, 0x1b08e, 0x1cc1a, 0x1d33f, + 0x1ed75, 0x1f250, 0x209d5, 0x216f0, 0x228ba, 0x2379f, 0x24b0b, 0x2542e, + 0x26a64, 0x27541, 0x28c69, + ); + + /** + * Galois field + * @var array + */ + private $galoisField; + + /** + * Galois field with changed index and value + * @var array + */ + private $indexGaloisField; + + + /** + * Constructor + * + * @param string $text + * @param int $moduleSize + * @param char $ecl + */ + public function __construct($text, $moduleSize=parent::MODULE_SIZE, $ecl=self::ECL_L_CODE, $version=null) + { + try { + parent::__construct($text, $moduleSize); + + // Convert input text to UTF-8 + $current_encoding = mb_detect_encoding($this->text, 'auto'); + $this->text = iconv($current_encoding, 'UTF-8', $this->text); + + $this->ecl = $this->eclConvertTable[$ecl]; + + // Num of input chars + $this->charsNum = strlen($text); + + $this->mode = $this->getMode($text); + + // Mask reference + $this->maskReference = rand(0,7); + + + // Version + $this->version = $this->getVersion($this->charsNum, $this->ecl, $this->mode, $version); + + // Code size + $this->matrixSize = $this->getMatrixSize($this->version); + + $this->symbolSize = $this->matrixSize + 2 * self::QUIET_ZONE; + + + $this->countGaloisField(); + + // Init matrixes + $this->init(); + + $this->bitsCoordinates = $this->getBitsCoordinates($this->maskedMatrix); + + $this->convertData(); + + // Format info + $formatInformation = $this->formatInformation($this->ecl,$this->maskReference); + $this->matrix = $this->addFormatInformation($this->matrix, $formatInformation); + + // Version info + if($this->version>=7 && $this->version<=40) { + $versionInformation = $this->versionInformation($this->version); + $this->matrix = $this->addVersionInformation($this->matrix, $versionInformation); + } + + + } catch (Exception $e) { + throw $e; + } + } + + + /** + * Get Mode + * Returns mode indicator + * + * @param string $text + * @return int + */ + private function getMode($text) + { + if (preg_match('/[^0-9]/', $text)==0) { + return self::MODE_NUMERIC; + } else if(preg_match('/[^0-9A-Z \$\*\%\+\.\/\:\-]/', $text)==0) { + return self::MODE_ALPHANUMERIC; + } else { + return self::MODE_8BITBYTE; + } + } + + + /** + * Get Version + * + * @param int $charsNum + * @param int $ecl + * @param int $mode + * @return int + */ + private function getVersion($charsNum, $ecl, $mode, $version) + { + $findversion = 1; + while ($findversion<=40) { + if ($this->dataCapacity[$ecl][$mode][$findversion] >= $charsNum) { + break; + } + $findversion++; + } + + if($findversion==41) { + throw new Exception('Input text is too long.', E_BAD_QR_LENGTH); + } + + + if($version) { + if($findversion<=$version && $version <= 40) { + return $version; + } else { + throw new Exception('Selected version can not be choosen.', E_BAD_VERSION); + } + } + + return $findversion; + } + + + /** + * Get Matrix Size + * + * Use bit shift + * x << y = x*(2^y) + * + * @param int $version + * @return int + */ + private function getMatrixSize($version) + { + return 17 + ($version << 2); + } + + + /** + * Init + * + * Matrix init + * prepare matrixes and bits + * + * @return void + */ + private function init() { + for ($y = 0; $y < $this->matrixSize; $y++) { + for ($x = 0; $x < $this->matrixSize; $x++) { + $matrix[$y][$x] = 0; // White as default + + // Vertical synch. + if ($y == 6 && $x % 2 == 0) { + $matrix[$y][$x] = 1; + } + // Hor. synch + if ($x == 6 && $y % 2 == 0) { + $matrix[$y][$x] = 1; + } + + // Mask synch. patterns + if ($y == 6 || $x == 6) { + $maskedMatrix[$y][$x] = 1; + } + + + // Format and version mask + // all versions + if($x==8 && ($y<=8 || $y>=($this->matrixSize-8))) { + $maskedMatrix[$y][$x] = 1; + } + if($y==8 && ($x<=8 || $x>=($this->matrixSize-8))) { + $maskedMatrix[$y][$x] = 1; + } + // Version >= 7 + if($this->version >= 7) { + if($y<=5 && $x>=$this->matrixSize-11 && $x<=$this->matrixSize-9) { + $maskedMatrix[$y][$x] = 1; + } + if($x<=5 && $y>=$this->matrixSize-11 && $y<=$this->matrixSize-9) { + $maskedMatrix[$y][$x] = 1; + } + } + + + // left top position pattern + if ($y <= 6 && $x <= 6) { + $shift = $y * 7 + $x; + $matrix[$y][$x] = $this->positionPattern[$shift]; + + $maskedMatrix[$y][$x] = 1; + $maskedMatrix[$y+1][$x+1] = 1; // mask. separatoru + } + // left bottom position pattern + if ($y < 7 && $x < $this->matrixSize && $x > ($this->matrixSize - 8)) { + $shift = $y * 7 + ($this->matrixSize - $x - 1); + $matrix[$y][$x] = $this->positionPattern[$shift]; + + $maskedMatrix[$y][$x] = 1; + $maskedMatrix[$y+1][$x-1] = 1; + } + // right top position pattern + if ($x < 7 && $y < $this->matrixSize && $y > ($this->matrixSize - 8)) { + $shift = $x + ($this->matrixSize - $y - 1) * 7; + $matrix[$y][$x] = $this->positionPattern[$shift]; + + $maskedMatrix[$y][$x] = 1; + $maskedMatrix[$y-1][$x+1] = 1; + } + } + } + + // Alignment patterns + if (count($this->alignmentPatternCoordinate[$this->version]) > 0) { + foreach ($this->alignmentPatternCoordinate[$this->version] as $y) { + foreach ($this->alignmentPatternCoordinate[$this->version] as $x) { + if (!(($x < 7 && $y < 7) || ($y > ($this->matrixSize - 8) && $x < 7) || ($x > ($this->matrixSize - 8) && $y < 7))) { + for ($i = 0; $i < 5; $i++) { + for ($j = 0; $j < 5; $j++) { + $xCoor = $x - $i + 2; + $yCoor = $y - $j + 2; + $matrix[$xCoor][$yCoor] = $this->alignmentPattern[$i * 5 + $j]; + $maskedMatrix[$xCoor][$yCoor] = 1; // Mask alignment patterns + } + } + } + } + } + } + + // Module around detection patterns + $maskedMatrix[0][7] = 1; + $maskedMatrix[0][$this->matrixSize-8] = 1; + $maskedMatrix[7][0] = 1; + $maskedMatrix[7][$this->matrixSize-1] = 1; + $maskedMatrix[$this->matrixSize-8][0] = 1; + $maskedMatrix[$this->matrixSize-1][7] = 1; + + + $this->matrix = $matrix; + $this->maskedMatrix = $maskedMatrix; + } + + + /** + * Get Bits Coordinates + * + * @param array $maskedMatrix + * @return array + */ + private function getBitsCoordinates($maskedMatrix) { + + + // start at right bottom corner + $y = $this->matrixSize-1; + $x = $this->matrixSize-1; + + // top + $direction = self::DIRECTION_UP; + + // and go left + $goLeft = 1; + + $biteCounter = 0; + while($biteCounter < $this->codewordsCapacity[$this->version]*8) { + + // jump over timing pattern + if($x==6) { + $x=5; + } + + switch($direction) { + case self::DIRECTION_UP: + if(!$this->maskedMatrix[$y][$x]) { + $bitesCoordinates[$biteCounter] = array($y,$x); + $biteCounter++; + } + + // next coordinate + if($goLeft==1) { + // Jdi doleva + $x = $x-1; + $y = $y; + $goLeft = 0; + } else { + // top right + $x = $x+1; + $y = $y-1; + + if($y<0) { + // direction change + $direction = self::DIRECTION_DOWN; + $y = 0; + $x = $x-2; + } + + $goLeft = 1; + } + + + break; + case self::DIRECTION_DOWN: + if(!$this->maskedMatrix[$y][$x]) { + $bitesCoordinates[$biteCounter] = array($y,$x); + $biteCounter++; + } + + // next coordinate + if($goLeft==1) { + // Doleva + $x = $x-1; + $y = $y; + $goLeft = 0; + } else { + // down and right + $x = $x+1; + $y = $y+1; + + if($y>=$this->matrixSize) { + // direction change + $direction = self::DIRECTION_UP; + $y = $y-1; + $x = $x-2; + } + + $goLeft = 1; + } + + break; + } + } + + return $bitesCoordinates; + } + + + + /** + * Convert Data + * + * @return void + */ + private function convertData() + { + $text = $this->text; + + + /* DATA CODING ********************************************************/ + + $dataCounter = 0; + // Mode indicator 4b + $data[$dataCounter] = array( + 4, + $this->mode, + ); + $totalDataBits = 4; + $dataCounter++; + + // Num chars indicator + $data[$dataCounter] = array( + // length indicator in bits + $this->characterCountIndicatorBits[$this->mode][$this->version], + $this->charsNum, + ); + $totalDataBits += $this->characterCountIndicatorBits[$this->mode][$this->version]; + $dataCounter++; + + switch($this->mode) { + case self::MODE_NUMERIC: + + // divide ... [truncated message content] |
From: <dai...@us...> - 2012-05-26 10:46:16
|
Revision: 5399 http://web-erp.svn.sourceforge.net/web-erp/?rev=5399&view=rev Author: daintree Date: 2012-05-26 10:46:05 +0000 (Sat, 26 May 2012) Log Message: ----------- fix barcode printing in PDFPrintLabel.php Modified Paths: -------------- trunk/PDFPrintLabel.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/doc/Change.log trunk/includes/class.pdf.php Added Paths: ----------- trunk/includes/barcodepack/ trunk/includes/barcodepack/class.barcode.php trunk/includes/barcodepack/class.code128.php trunk/includes/barcodepack/class.ean13.php trunk/includes/barcodepack/class.i2of5.php trunk/includes/barcodepack/class.linearBarcode.php trunk/includes/barcodepack/class.qrCode.php trunk/includes/barcodepack/class.s2of5.php trunk/includes/barcodepack/class.upc.php trunk/includes/tcpdf/cache/ Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2012-05-25 06:22:39 UTC (rev 5398) +++ trunk/PDFPrintLabel.php 2012-05-26 10:46:05 UTC (rev 5399) @@ -2,6 +2,7 @@ /* $Id: PDFPriceLabels.php 5228 2012-04-06 02:48:00Z vvs2012 $*/ include('includes/session.inc'); +include('includes/barcodepack/class.code128.php'); $PtsPerMM = 2.83465; //pdf points per mm @@ -180,27 +181,15 @@ $pdf->addInfo('Title', $LabelDimensions['description'] . ' ' . _('Price Labels') ); $pdf->addInfo('Subject', $LabelDimensions['description'] . ' ' . _('Price Labels') ); + $pdf->setPrintHeader(false); + $pdf->setPrintFooter(false); + + $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); - $style = array( - 'position' => '', - 'align' => 'C', - 'stretch' => false, - 'fitwidth' => true, - 'cellfitalign' => '', - 'border' => true, - 'hpadding' => 'auto', - 'vpadding' => 'auto', - 'fgcolor' => array(0,0,0), - 'bgcolor' => false, //array(255,255,255), - 'text' => false, - 'font' => 'helvetica', - 'fontsize' => 8, - 'stretchtext' => 4 ); - $PageNumber=1; //go down first then accross $YPos = $Page_Height - $Top_Margin; //top of current label @@ -225,15 +214,15 @@ $LeftOvers = $pdf->addTextWrap($XPos+$Field['HPos'],$YPos-$LabelDimensions['label_height']+$Field['VPos'],$LabelDimensions['label_width']-$Field['HPos'],$Field['FontSize'],$_POST['Price' . $i],'center'); } elseif($Field['Barcode']==1) { - /* write1DBarcode($code, $type, $x='', $y='', $w='', $h='', $xres='', $style='', $align='') - * Note that the YPos for this function is based on the opposite origin for the Y axis i.e from the bottom not from the top! - */ - //$BarcodeFileName = $_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['reports_dir'] .'/barcode_' . $i . '.jpg'; - //Barcode39(str_replace('_', $Value),$BarcodeFileName, $LabelDimensions['label_width']-$Field['HPos']-$Left_Margin,$Field['FontSize']); - //$pdf->addJpegFromFile($BarcodeFileName, $XPos+$Field['HPos'],$YPos-$LabelDimensions['label_height']+$Field['VPos']); - //$pdf->Image('@' . , $XPos+$Field['HPos'], $Page_Height-($YPos+$LabelDimensions['label_height']-$Field['VPos']), $LabelDimensions['label_width']-$Field['HPos']-$Left_Margin, $Field['FontSize']); + $BarcodeImage = new code128(str_replace('_','',$Value)); - $pdf->write1DBarcode(str_replace('_','',$Value), 'C39E',$XPos+$Field['HPos'],$Page_Height - $YPos+$LabelDimensions['label_height']-$Field['VPos']-$Field['FontSize'],$LabelDimensions['label_width']-$Field['HPos'], 40, 1, $style, 'N'); + ob_start(); + imagepng(imagepng($BarcodeImage->draw())); + $Image_String = ob_get_contents(); + ob_end_clean(); + + $pdf->addJpegFromFile('@' . $Image_String,$XPos+$Field['HPos'],$Field['VPos'],'', $Field['FontSize']); + } else { $LeftOvers = $pdf->addTextWrap($XPos+$Field['HPos'],$YPos-$LabelDimensions['label_height']+$Field['VPos'],$LabelDimensions['label_width']-$Field['HPos']-20,$Field['FontSize'],$Value); } @@ -366,179 +355,4 @@ } /*end of else not PrintPDF */ -function Barcode39 ($barcode, $FileName='',$width=160, $height=80, $text='') { - - /* Generate a Code 3 of 9 barcode */ - - $im = ImageCreate ($width, $height) - or die ("Cannot Initialize new GD image stream"); - $White = ImageColorAllocate ($im, 255, 255, 255); - $Black = ImageColorAllocate ($im, 0, 0, 0); - //ImageColorTransparent ($im, $White); - ImageInterLace ($im, 1); - - $NarrowRatio = 20; - $WideRatio = 55; - $QuietRatio = 35; - - $nChars = (strlen($barcode)+2) * ((6 * $NarrowRatio) + (3 * $WideRatio) + ($QuietRatio)); - $Pixels = $width / $nChars; - $NarrowBar = (int)(20 * $Pixels); - $WideBar = (int)(55 * $Pixels); - $QuietBar = (int)(35 * $Pixels); - - $ActualWidth = (($NarrowBar * 6) + ($WideBar*3) + $QuietBar) * (strlen ($barcode)+2); - - if (($NarrowBar == 0) || ($NarrowBar == $WideBar) || ($NarrowBar == $QuietBar) || ($WideBar == 0) || ($WideBar == $QuietBar) || ($QuietBar == 0)) { - ImageString ($im, 1, 0, 0, "Image is too small!", $Black); - ImageJPEG ($im, $FileName, 100); - exit; - } - - $CurrentBarX = (int)(($width - $ActualWidth) / 2); - $Color = $White; - $BarcodeFull = "*".strtoupper ($barcode)."*"; - settype ($BarcodeFull, "string"); - - $FontNum = 3; - $FontHeight = ImageFontHeight ($FontNum); - $FontWidth = ImageFontWidth ($FontNum); - if ($text != 0) { - $CenterLoc = (int)(($width-1) / 2) - (int)(($FontWidth * strlen($BarcodeFull)) / 2); - ImageString ($im, $FontNum, $CenterLoc, $height-$FontHeight, "$BarcodeFull", $Black); - } else { - $FontHeight=-2; - } - - - for ($i=0; $i<strlen($BarcodeFull); $i++) { - $StripeCode = Code39 ($BarcodeFull[$i]); - - for ($n=0; $n < 9; $n++) { - if ($Color == $White){ - $Color = $Black; - } else { - $Color = $White; - } - - switch ($StripeCode[$n]) { - case '0': - ImageFilledRectangle ($im, $CurrentBarX, 0, $CurrentBarX+$NarrowBar, $height-1-$FontHeight-2, $Color); - $CurrentBarX += $NarrowBar; - break; - - case '1': - ImageFilledRectangle ($im, $CurrentBarX, 0, $CurrentBarX+$WideBar, $height-1-$FontHeight-2, $Color); - $CurrentBarX += $WideBar; - break; - } - } - - $Color = $White; - ImageFilledRectangle ($im, $CurrentBarX, 0, $CurrentBarX+$QuietBar, $height-1-$FontHeight-2, $Color); - $CurrentBarX += $QuietBar; - } //end loop around each character in barcode string - - imagejpeg ($im, $FileName, 100); -}//end Barcode39 - -//----------------------------------------------------------------------------- -// Returns the Code 3 of 9 value for a given ASCII character -//----------------------------------------------------------------------------- -function Code39 ($Asc) { - switch ($Asc) { - case ' ': - return "011000100"; - case '$': - return "010101000"; - case '%': - return "000101010"; - case '*': - return "010010100"; // * Start/Stop - case '+': - return "010001010"; - case '|': - return "010000101"; - case '.': - return "110000100"; - case '/': - return "010100010"; - case '-': - return "010000101"; - case '0': - return "000110100"; - case '1': - return "100100001"; - case '2': - return "001100001"; - case '3': - return "101100000"; - case '4': - return "000110001"; - case '5': - return "100110000"; - case '6': - return "001110000"; - case '7': - return "000100101"; - case '8': - return "100100100"; - case '9': - return "001100100"; - case 'A': - return "100001001"; - case 'B': - return "001001001"; - case 'C': - return "101001000"; - case 'D': - return "000011001"; - case 'E': - return "100011000"; - case 'F': - return "001011000"; - case 'G': - return "000001101"; - case 'H': - return "100001100"; - case 'I': - return "001001100"; - case 'J': - return "000011100"; - case 'K': - return "100000011"; - case 'L': - return "001000011"; - case 'M': - return "101000010"; - case 'N': - return "000010011"; - case 'O': - return "100010010"; - case 'P': - return "001010010"; - case 'Q': - return "000000111"; - case 'R': - return "100000110"; - case 'S': - return "001000110"; - case 'T': - return "000010110"; - case 'U': - return "110000001"; - case 'V': - return "011000001"; - case 'W': - return "111000000"; - case 'X': - return "010010001"; - case 'Y': - return "110010000"; - case 'Z': - return "011010000"; - default: - return "011000100"; - } -} ?> \ No newline at end of file Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2012-05-25 06:22:39 UTC (rev 5398) +++ trunk/PrintCustTrans.php 2012-05-26 10:46:05 UTC (rev 5399) @@ -65,6 +65,7 @@ $pdf->setAutoPageBreak(0); $pdf->setPrintHeader(false); + $pdf->setPrintFooter(false); $pdf->AddPage(); $pdf->cMargin = 0; /* END Brought from class.pdf.php constructor */ Modified: trunk/PrintCustTransPortrait.php =================================================================== --- trunk/PrintCustTransPortrait.php 2012-05-25 06:22:39 UTC (rev 5398) +++ trunk/PrintCustTransPortrait.php 2012-05-26 10:46:05 UTC (rev 5399) @@ -63,6 +63,7 @@ $pdf->setAutoPageBreak(0); $pdf->setPrintHeader(false); + $pdf->setPrintFooter(false); $pdf->AddPage(); $pdf->cMargin = 0; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-05-25 06:22:39 UTC (rev 5398) +++ trunk/doc/Change.log 2012-05-26 10:46:05 UTC (rev 5399) @@ -1,5 +1,6 @@ webERP Change Log +26/5/2012 Phil: Fix barcode printing on PDFPrintLabel.php - barcode functionality is unreliable so used (http://www.barcodepack.com) by Tomáš Horáček very simple and clean 23/5/2012 Klaus: PO_PDFPurchOrders.php print purchase orders with supplier's code where it is available in the purchasing data 23/5/2012 Exson: Revise GLAccounts.php to make more than 10 digits account code is allowed. 2012/05/22 Exson: Modify accountcode to varchar(20) to meet some countries accounting regulation for more digits account code. Added: trunk/includes/barcodepack/class.barcode.php =================================================================== --- trunk/includes/barcodepack/class.barcode.php (rev 0) +++ trunk/includes/barcodepack/class.barcode.php 2012-05-26 10:46:05 UTC (rev 5399) @@ -0,0 +1,76 @@ +<?php + +/** + * This file is part of the BarcodePack - PHP Barcode Library. + * Copyright (c) 2011 Tomáš Horáček (http://www.barcodepack.com) + * BarcodePack by Tomáš Horáček is licensed under + * a Creative Commons Attribution-NoDerivs 3.0 Unported License. + */ + + + +// Error codes + +define('E_EMPTY_TEXT', 100); +define('E_MODULE_SIZE', 101); + + +/** + * barcode + * + * Main class of BarcodePack Library + * + * @author Tomáš Horáček <in...@we...> + * @package BarcodePack + */ +class barcode { + + // Minimal module size + const MIN_MODULE_SIZE = 1; + + // Maximal module size + const MAX_MODULE_SIZE = 10; + + // Default module size + const MODULE_SIZE = 2; + + /** + * Text to be encoded + * @var string + */ + protected $text = ''; + + /** + * Module size in pixels + * @var int + */ + protected $moduleSize = null; + + + /** + * Constructor + * + * @param string $text + * @param int $moduleSize + */ + public function __construct($text, $moduleSize=self::MODULE_SIZE) + { + + // input text check + if(!empty ($text)) { + $this->text = $text; + } else { + throw new Exception('Input text can not be empty.', E_EMPTY_TEXT); + } + + // Module size check + $moduleSize = (int) $moduleSize; + if($moduleSize >= self::MIN_MODULE_SIZE && $moduleSize <= self::MAX_MODULE_SIZE) { + $this->moduleSize = $moduleSize; + } else { + throw new Exception('Module size have to be in range '.self::MIN_MODULE_SIZE.' - '.self::MAX_MODULE_SIZE.'.', E_MODULE_SIZE); + } + + } + +} Property changes on: trunk/includes/barcodepack/class.barcode.php ___________________________________________________________________ Added: svn:executable + * Added: trunk/includes/barcodepack/class.code128.php =================================================================== --- trunk/includes/barcodepack/class.code128.php (rev 0) +++ trunk/includes/barcodepack/class.code128.php 2012-05-26 10:46:05 UTC (rev 5399) @@ -0,0 +1,338 @@ +<?php + +/** + * This file is part of the BarcodePack - PHP Barcode Library. + * Copyright (c) 2011 Tomáš Horáček (http://www.barcodepack.com) + * BarcodePack by Tomáš Horáček is licensed under + * a Creative Commons Attribution-NoDerivs 3.0 Unported License. + */ + + + +require_once 'class.linearBarcode.php'; + +/** + * Code 128 + * Class implements Code 128 barcode + * + * @author Tomáš Horáček <in...@we...> + * @package BarcodePack + */ +class code128 extends linearBarcode { + + // Code sets + const CHARSET_A = 'A'; + const CHARSET_B = 'B'; + const CHARSET_C = 'C'; + + const START_A = 103; + const START_B = 104; + const START_C = 105; + const STOP = 106; + const TERMINATION = 107; + + // Code sets switchers + const CODE_A = 101; + const CODE_B = 100; + const CODE_C = 99; + + + private $setA = array(); + private $setB = array(); + private $setC = array(); + + private $charsA = ''; + private $charsB = ''; + private $charsC = ''; + + /** + * Zero represents white line + * One represents black line + * + * After each character except STOP I will add one white line + * (separating line) + * + * ASCII (dec) => bitecode + * + * @var array + */ + private $codeTable = array( + '11011001100', // 01 + '11001101100', // 02 + '11001100110', // 03 + '10010011000', // 04 + '10010001100', // ... + '10001001100', + '10011001000', + '10011000100', + '10001100100', + '11001001000', + '11001000100', + '11000100100', + '10110011100', + '10011011100', + '10011001110', + '10111001100', + '10011101100', + '10011100110', + '11001110010', + '11001011100', + '11001001110', + '11011100100', + '11001110100', + '11101101110', + '11101001100', + '11100101100', + '11100100110', + '11101100100', + '11100110100', + '11100110010', + '11011011000', + '11011000110', + '11000110110', + '10100011000', + '10001011000', + '10001000110', + '10110001000', + '10001101000', + '10001100010', + '11010001000', + '11000101000', + '11000100010', + '10110111000', + '10110001110', + '10001101110', + '10111011000', + '10111000110', + '10001110110', + '11101110110', + '11010001110', + '11000101110', + '11011101000', + '11011100010', + '11011101110', + '11101011000', + '11101000110', + '11100010110', + '11101101000', + '11101100010', + '11100011010', + '11101111010', + '11001000010', + '11110001010', + '10100110000', + '10100001100', + '10010110000', + '10010000110', + '10000101100', + '10000100110', + '10110010000', + '10110000100', + '10011010000', + '10011000010', + '10000110100', + '10000110010', + '11000010010', + '11001010000', + '11110111010', + '11000010100', + '10001111010', + '10100111100', + '10010111100', + '10010011110', + '10111100100', + '10011110100', + '10011110010', + '11110100100', + '11110010100', + '11110010010', + '11011011110', + '11011110110', + '11110110110', + '10101111000', + '10100011110', + '10001011110', + '10111101000', + '10111100010', + '11110101000', + '11110100010', + '10111011110', + '10111101110', + '11101011110', + '11110101110', + '11010000100', // 103 START A + '11010010000', // 104 START B + '11010011100', // 105 START C + '11000111010', // 106 STOP + '11' // 107 Termination bar + ); + + + /** + * Constructor + * + * @param string $text + * @param int $moduleSize + */ + public function __construct($text, $moduleSize=2) + { + try { + // Fill set A + for($i=32; $i<=95; $i++) { + // chars SPACE - UNDERSPACE + $this->setA[$i] = $i - 32; + $this->charsA .= chr($i); + $allowedChars[] = chr($i); + } + for($i=0; $i<=31; $i++) { + // chars NUL - US (Unit seperator) + $this->setA[$i] = $i + 64; + $this->charsA .= chr($i); + $allowedChars[] = chr($i); + } + + /* Fill set B + * chars SPACE " " - "DEL" + */ + for($i=32; $i<=127; $i++) { + $this->setB[$i] = $i - 32; + $this->charsB .= chr($i); + $allowedChars[] = chr($i); + } + + + parent::__construct($text, $moduleSize, $allowedChars); + + + $this->biteCode = $this->createBiteCode(); + + } catch (Exception $e) { + throw $e; + } + + } + + + /** + * Create Bite Code + * + * + * @return string + */ + private function createBiteCode() + { + $biteCode = array(); + + $characterSet = self::CHARSET_B; // Default code set + + $weightedSum = 0; + $checksumCounter = 1; + + $biteCode['DATA'] = ''; + // Find start character + if(strlen($this->text)>=2 && is_numeric($this->text{0}) && is_numeric($this->text{1})) { + // If the first and second characters are numeric use character set C + // and insert START_C char + $biteCode['DATA'] .= $this->codeTable[self::START_C]; + $characterSet = self::CHARSET_C; + $weightedSum += self::START_C; + } else if (strpos ($this->charsB, $this->text{0})) { + // Character set B + $biteCode['DATA'] .= $this->codeTable[self::START_B]; + $characterSet = self::CHARSET_B; + $weightedSum += self::START_B; + } else if (strpos ($this->charsA, $this->text{0})) { + // Character set A + $biteCode['DATA'] .= $this->codeTable[self::START_A]; + $characterSet = self::CHARSET_A; + $weightedSum += self::START_A; + } else { + throw new Exception(); + } + + + for($i=0;$i<strlen($this->text);$i++) { + switch ($characterSet) { + case 'B': + // Character set B is default, so it is first + $characterValue = $this->setB[ord($this->text{$i})]; + $biteCode['DATA'] .= $this->codeTable[$characterValue]; + break; + + case 'A': + $characterValue = $this->setA[ord($this->text{$i})]; + $biteCode['DATA'] .= $this->codeTable[$characterValue]; + break; + + case 'C': + $characterValue = intval($this->text{$i}.$this->text{$i+1}); + $biteCode['DATA'] .= $this->codeTable[$characterValue]; + $i++; + break; + + default: + break; + } + + $weightedSum += $characterValue*$checksumCounter; + $checksumCounter++; + + // find next char set. + if(strlen($this->text) > ($i+2) && is_numeric($this->text{$i+1}) && is_numeric($this->text{$i+2})) { + if($characterSet!=self::CHARSET_C) { + $characterValue = 99; + $biteCode['DATA'] .= $this->codeTable[$characterValue]; + $weightedSum += $characterValue*$checksumCounter; + $checksumCounter++; + } + $characterSet = 'C'; + } else if(isset($this->text{$i+1})) { + $newCharacterSet = $this->findCharacterSet($this->text{$i+1}); + if($characterSet==self::CHARSET_C) { + if($newCharacterSet==self::CHARSET_A) { + $characterValue = 101; + } + else { + $characterValue = 100; + } + $weightedSum += $characterValue*$checksumCounter; + $checksumCounter++; + $biteCode['DATA'] .= $this->codeTable[$characterValue]; + } + $characterSet = $newCharacterSet; + } + } + + // Count the checksum + $checkSum = (int) $weightedSum%103; + + // Add the checksum + $biteCode['DATA'] .= $this->codeTable[$checkSum]; + + // Add the stop character + $biteCode['DATA'] .= $this->codeTable[self::STOP]; + + // Add the termination bar + $biteCode['DATA'] .= $this->codeTable[self::TERMINATION]; + + return $biteCode; + } + + + /** + * Find Character Set + * Find correct character set depends on imput char + * + * @param char $char + * @return char + */ + private function findCharacterSet($char) { + if(strpos($this->charsB, $char)!==false) { + return self::CHARSET_B; + } + if(strpos($this->charsA, $char)!==false) { + return self::CHARSET_A; + } + } + +} Property changes on: trunk/includes/barcodepack/class.code128.php ___________________________________________________________________ Added: svn:executable + * Added: trunk/includes/barcodepack/class.ean13.php =================================================================== --- trunk/includes/barcodepack/class.ean13.php (rev 0) +++ trunk/includes/barcodepack/class.ean13.php 2012-05-26 10:46:05 UTC (rev 5399) @@ -0,0 +1,209 @@ +<?php + +require_once 'class.linearBarcode.php'; + +// Error Codes +define('E_BAD_EAN_LENGTH', 600); + + + +/** + * EAN 13 + * + * @author Tomáš Horáček <in...@we...> + * @package BarcodePack + */ +class ean13 extends linearBarcode { + + /** @var array */ + private $allowedChars = array( + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + ); + + /** @var array */ + private $parity = array( + '0' => 'LLLLLLRRRRRR', + '1' => 'LLGLGGRRRRRR', + '2' => 'LLGGLGRRRRRR', + '3' => 'LLGGGLRRRRRR', + '4' => 'LGLLGGRRRRRR', + '5' => 'LGGLLGRRRRRR', + '6' => 'LGGGLLRRRRRR', + '7' => 'LGLGLGRRRRRR', + '8' => 'LGLGGLRRRRRR', + '9' => 'LGGLGLRRRRRR', + ); + + + /** + * Zero represents white line + * One represents black line + * + * After each character except STOP I will add one white line + * (separating line) + * + * @var array + */ + private $codeTable = array( + '0' => array('L'=>'0001101', 'G'=>'0100111', 'R'=>'1110010',), + '1' => array('L'=>'0011001', 'G'=>'0110011', 'R'=>'1100110',), + '2' => array('L'=>'0010011', 'G'=>'0011011', 'R'=>'1101100',), + '3' => array('L'=>'0111101', 'G'=>'0100001', 'R'=>'1000010',), + '4' => array('L'=>'0100011', 'G'=>'0011101', 'R'=>'1011100',), + '5' => array('L'=>'0110001', 'G'=>'0111001', 'R'=>'1001110',), + '6' => array('L'=>'0101111', 'G'=>'0000101', 'R'=>'1010000',), + '7' => array('L'=>'0111011', 'G'=>'0010001', 'R'=>'1000100',), + '8' => array('L'=>'0110111', 'G'=>'0001001', 'R'=>'1001000',), + '9' => array('L'=>'0001011', 'G'=>'0010111', 'R'=>'1110100',), + 'START' => '101', + 'SEPARATOR' => '01010', + 'STOP' => '101', + ); + + + /** + * Constructor + * + * @param string $text + * @param int $modulesize + */ + public function __construct($text, $moduleSize) + { + try { + parent::__construct($text, $moduleSize, $this->allowedChars); + + if(strlen($this->text)!=12) { + throw new Exception('Text length must be 12 characters.', E_BAD_EAN_LENGTH); + } + + $this->biteCode = $this->createBiteCode(); + } + catch(Exception $e) { + throw $e; + } + + } + + + /** + * Create Bite Code + * Create bitecode where 1 represents dark module and 0 white module. + * + * @return string + */ + private function createBiteCode() + { + $biteCode = array(); + + $saveTo = 'DATA'; + + // Parity determine + $parity = $this->parity[$this->text{0}]; + + $biteCode['START'] = $this->codeTable['START']; + + for($i=1;$i<strlen($this->text);$i++) { + $biteCode[$saveTo] .= $this->codeTable[$this->text{$i}][$parity{$i-1}]; + if($i==6) { + $biteCode['SEPARATOR'] = $this->codeTable['SEPARATOR']; + $saveTo = 'DATA2'; + } + + } + + $checksum = (string) $this->checksum($this->text); + + $this->text .= $checksum; + + $biteCode[$saveTo] .= $this->codeTable[$checksum]['R']; + + $biteCode['STOP'] = $this->codeTable['STOP']; + + return $biteCode; + } + + + /** + * Checksum + * Count checksum + * + * @param string $text + * @return int + */ + private function checksum($text) { + + $evensum = 0; + $oddsum = 0; + + for($i=1;$i<=strlen($text);$i++) { + if($i%2==0) { + $evensum += (int) $text{$i-1}; + } else { + $oddsum += (int) $text{$i-1}; + } + } + + $sum = $evensum*3 + $oddsum; + + return ceil($sum/10)*10 - $sum; + } + + + /** + * Draw + * Add text into barcode + * + * @param bool $showText + * @return image resource + */ + public function draw($showText = true) { + $im = parent::draw(false); + + $margin = $this->margin*$this->moduleSize; + + + $white = Imagecolorallocate ($im,255,255,255); + $black = Imagecolorallocate ($im,0,0,0); + + + if($showText) { + + // Increase space between symbol 2x + $im2 = ImageCreate($this->getBarcodeLen()*$this->moduleSize+(2*$margin)+$margin, + $this->height+$this->fontSize+(2*$margin)); + + imagecopy($im2, $im, $margin, 0, 0, 0, $this->getBarcodeLen()*$this->moduleSize+(2*$margin), $this->height+$this->fontSize+(2*$margin)); + + // Divide text into three parts and each insert to the diffrerent place + $charsA = $this->text{0}; // first char + for($i=1;$i<=strlen($this->text);$i++) { + if($i<=6) { + $charsB .= $this->text{$i}; + } else { + $charsC .= $this->text{$i}; + } + } + + // Insert A + $textWidth = ImageFontWidth($this->fontSize)*strlen($charsA); + imagestring ($im2, $this->fontSize, + $margin, + $this->height-$this->fontSize/2+$margin, $charsA, $black); + + // Insert B + $textWidth = ImageFontWidth($this->fontSize)*strlen($charsB); + imagestring ($im2, $this->fontSize, + $this->getBarcodeLen()*$this->moduleSize/4-$textWidth/2+2*$margin, + $this->height-$this->fontSize/2+$margin, $charsB, $black); + + // Insert C + $textWidth = ImageFontWidth($this->fontSize)*strlen($charsC); + imagestring ($im2, $this->fontSize, + $this->getBarcodeLen()*$this->moduleSize-$this->getBarcodeLen()*$this->moduleSize/4-$textWidth/2+2*$margin, + $this->height-$this->fontSize/2+$margin, $charsC, $black); + } + + return $im2; + } + +} Property changes on: trunk/includes/barcodepack/class.ean13.php ___________________________________________________________________ Added: svn:executable + * Added: trunk/includes/barcodepack/class.i2of5.php =================================================================== --- trunk/includes/barcodepack/class.i2of5.php (rev 0) +++ trunk/includes/barcodepack/class.i2of5.php 2012-05-26 10:46:05 UTC (rev 5399) @@ -0,0 +1,135 @@ +<?php + +/** + * This file is part of the BarcodePack - PHP Barcode Library. + * Copyright (c) 2011 Tomáš Horáček (http://www.barcodepack.com) + * BarcodePack by Tomáš Horáček is licensed under + * a Creative Commons Attribution-NoDerivs 3.0 Unported License. + */ + + + +require_once 'class.linearBarcode.php'; + + +// Error codes +define('E_ODD_LENGTH', 500); + + +/** + * i2of5 + * + * Interleaved 2/5 + * + * @author Tomáš Horáček <in...@we...> + * @package BarcodePack + */ +class i2of5 extends linearBarcode { + + /** @var array */ + private $allowedChars = array( + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + ); + + /** + * Coding table + * + * @var array + */ + private $codeTable = array( + '0' => '1010111011101', + '1' => '1110101010111', + '2' => '1011101010111', + '3' => '1110111010101', + '4' => '1010111010111', + '5' => '1110101110101', + '6' => '1011101110101', + '7' => '1010101110111', + '8' => '1110101011101', + '9' => '1011101011101', + 'START' => '1010', + 'STOP' => '11101', + ); + + + /** + * Constructor + * + * @param string $text + * @param int $modulesize + */ + public function __construct($text, $moduleSize) + { + try { + parent::__construct($text, $moduleSize, $this->allowedChars); + + if((strlen($this->text)%2)!=0) { + throw new Exception('The number of characters must be even', E_ODD_LENGTH); + } + + $this->biteCode = $this->createBiteCode(); + } + catch(Exception $e) { + throw $e; + } + + } + + + /** + * Create Bite Code + * + * @return string + */ + private function createBiteCode() + { + $biteCode = array(); + + // START character + $biteCode['START'] = $this->codeTable['START']; + + $biteCode['DATA'] = ''; + + + for($i=0;$i<strlen($this->text);$i++) { + $firstCounter = 0; // Num of line module + $secondCounter = 0; // Num of space module + + // Each char is encoded to 5 lines or spaces + for($j=0; $j<5; $j++) { + + // Encode first char into lines + $bars = true; + while($bars && $firstCounter<13) { + if($this->codeTable[$this->text{$i}]{$firstCounter}=="1") { + $biteCode['DATA'] .= '1'; // line + } else { + $bars = false; + } + $firstCounter++; // jump to next line + } + + // Second char is encoded to spaces + $spaces = true; + while($spaces && $secondCounter<13) { + if($this->codeTable[$this->text{$i+1}]{$secondCounter}=='1') { + $biteCode['DATA'] .= '0'; // space + $secondCounter++; + } else { + $spaces = false; + $secondCounter++; // jump to next space + } + } + } + + $i++; // jump to next char + } + + // Insert STOP character + $biteCode['STOP'] = $this->codeTable['STOP']; + + return $biteCode; + } + + +} Property changes on: trunk/includes/barcodepack/class.i2of5.php ___________________________________________________________________ Added: svn:executable + * Added: trunk/includes/barcodepack/class.linearBarcode.php =================================================================== --- trunk/includes/barcodepack/class.linearBarcode.php (rev 0) +++ trunk/includes/barcodepack/class.linearBarcode.php 2012-05-26 10:46:05 UTC (rev 5399) @@ -0,0 +1,175 @@ +<?php + +/** + * This file is part of the BarcodePack - PHP Barcode Library. + * Copyright (c) 2011 Tomáš Horáček (http://www.barcodepack.com) + * BarcodePack by Tomáš Horáček is licensed under + * a Creative Commons Attribution-NoDerivs 3.0 Unported License. + */ + + + +require_once 'class.barcode.php'; + +// Error codes +define('E_BAD_CHARS', 200); + + +/** + * Linear Barcode + * Parent class for all linear barcode types + * + * @author Tomáš Horáček <in...@we...> + * @package BarcodePack + */ +class linearBarcode extends barcode { + + /** @var array */ + protected $biteCode = array(); + + /** @var int */ + protected $height = 100; + + /** @var int */ + protected $fontSize = 10; + + /** + * Quiet zone + * Multiple of module size + * @var int */ + protected $margin = 5; + + /** + * Constructor + * + * @param string $text + * @param int $modulesize + */ + public function __construct($text, $moduleSize=2, $allowedChars=null) + { + try { + parent::__construct($text, $moduleSize); + + if($allowedChars) { + $this->checkAllowedChars($text, $allowedChars); + } + + } catch (Exception $e) { + throw $e; + } + } + + + /** + * Check Allowed Chars + * + * @param string $text + * @param array $alloweChars + * @return bool + */ + protected function checkAllowedChars($text, $allowedChars) + { + for($i=0; $i<strlen($text); $i++) { + if(!in_array($text{$i}, $allowedChars)) { + throw new Exception('Input text contains nonallowed characters.', E_BAD_CHARS); + return false; + } + } + return true; + } + + + + /** + * Get Barcode Length + * @return int + */ + protected function getBarcodeLen() { + $len = 0; + foreach ($this->biteCode as $value) { + $len += strlen($value); + } + return $len; + } + + + /** + * Draw + * Create image with barcode + * + * @param bool $showText + * @return image resource + */ + public function draw($showText=true) + { + // Image create + $margin = $this->margin*$this->moduleSize; + $im = ImageCreate($this->getBarcodeLen()*$this->moduleSize+(2*$margin), + $this->height+$this->fontSize+(2*$margin)); + + // Color set + $white = Imagecolorallocate ($im,255,255,255); + $black = Imagecolorallocate ($im,0,0,0); + + + // Draw lines + $pos = 0; + foreach ($this->biteCode as $type => $values) { + switch($type) { + case 'DATA': + case 'DATA2': + // Data + for($i=0;$i<strlen($values);$i++) { + $color = (($values{$i})=='1') ? $black : $white; + imagefilledrectangle($im, $pos*$this->moduleSize+$margin, $margin, + ($pos+1)*$this->moduleSize+$margin, + $this->height-5*$this->moduleSize+$margin, $color); + $pos++; + } + break; + default: + // Special chars + // will be longer + for($i=0;$i<strlen($values);$i++) { + + $color = (($values{$i})=='1') ? $black : $white; + imagefilledrectangle($im, $pos*$this->moduleSize+$margin, $margin, + ($pos+1)*$this->moduleSize+$margin, $this->height+$margin, + $color); + $pos++; + } + + break; + } + } + + // Text + if($showText) { + $textWidth = ImageFontWidth($this->fontSize)*strlen($this->text); + imagestring ($im, $this->fontSize, + $this->getBarcodeLen()*$this->moduleSize/2-$textWidth/2+$margin, + $this->height-$this->fontSize/2+$margin, $this->text, $black); + } + + return $im; + } + + + /** + * Raw Data + * Returns data in text representation + * Black module is represented as 1 and white module as 0 + * + * @return string $output + */ + public function rawData() + { + $ret = ''; + foreach ($this->biteCode as $value) { + $ret .= $value; + } + return $ret; + } + + +} Added: trunk/includes/barcodepack/class.qrCode.php =================================================================== --- trunk/includes/barcodepack/class.qrCode.php (rev 0) +++ trunk/includes/barcodepack/class.qrCode.php 2012-05-26 10:46:05 UTC (rev 5399) @@ -0,0 +1,1266 @@ +<?php + +/** + * This file is part of the BarcodePack - PHP Barcode Library. + * Copyright (c) 2011 Tomáš Horáček (http://www.barcodepack.com) + * BarcodePack by Tomáš Horáček is licensed under + * a Creative Commons Attribution-NoDerivs 3.0 Unported License. + */ + + + +require_once 'class.barcode.php'; + +// Erroe codes +define('E_BAD_QR_LENGTH', 800); +define('E_BAD_VERSION', 801); +define('E_BAD_MASK', 802); + + + +/** + * qrCode + * Class for QR Code generation + * + * @author Tomáš Horáček <in...@we...> + * @package BarcodePack + */ +class qrCode extends barcode { + + // Error correction levels + const ECL_L_CODE = 'L'; + const ECL_M_CODE = 'M'; + const ECL_Q_CODE = 'Q'; + const ECL_H_CODE = 'H'; + + const DEFAULT_ECL = 'M'; + + // Error correction levels numbers + const ECL_L = 1; + const ECL_M = 0; + const ECL_Q = 3; + const ECL_H = 2; + + + // Mode indicators + const MODE_ECI = 7; + const MODE_NUMERIC = 1; + const MODE_ALPHANUMERIC = 2; + const MODE_8BITBYTE = 4; + const MODE_KANJI = 8; + const MODE_STRUCTURED_APPEND = 3; + const MODE_FNC1_FP = 5; // First position + const MODE_FNC1_SP = 9; // Second position + const MODE_TERMINATOR = 0; + + // Quiet zone size + const QUIET_ZONE = 4; + + // Directions + const DIRECTION_UP = 'UP'; + const DIRECTION_DOWN = 'DOWN'; + + /** + * Error correction level + * @var char + */ + private $ecl = self::ECL_L; + + /** + * Version (1-40) + * @var int + */ + private $version = 1; + + /** + * Matrix size (QR code size without quiet zone) + * @var int + */ + private $matrixSize = 0; + + /** + * Symbol size with quiet zone + * @var int + */ + private $symbolSize = 0; + + /** + * Number of imput characters + * @var int + */ + private $charsNum = 0; + + /** + * Mode indicator + * @var int + */ + private $mode; + + /** + * QR code matrix + * @var array + */ + private $matrix; + + /** + * Masked matrix + * @var array + */ + private $maskedMatrix; + + /** + * Coordinates of modules in matrix + * @var array + */ + private $bitsCoordinates; + + /** + * Mask reference (0-7) + * @var int + */ + private $maskReference; + + /** + * ECL conversion table + * @var array + */ + private $eclConvertTable = array( + self::ECL_L_CODE => self::ECL_L, + self::ECL_M_CODE => self::ECL_M, + self::ECL_Q_CODE => self::ECL_Q, + self::ECL_H_CODE => self::ECL_H, + ); + + /** + * Number of bits the num chars indicator is saved + * @var array + */ + private $characterCountIndicatorBits = array( + self::MODE_NUMERIC => array(1=> 10, 10, 10, 10, 10, 10, 10, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,), + self::MODE_ALPHANUMERIC => array(1=> 9, 9, 9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,), + self::MODE_8BITBYTE => array(1=> 8, 8, 8, 8, 8, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,), + self::MODE_KANJI => array(1=> 8, 8, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,), + ); + + /** + * Code capacity + * Include mode indicator and num chars indicator without ECL + * @var array + */ + private $numberDataBits = array( + self::ECL_L => array(1 => 152, 272, 440, 640, 864, 1088, 1248, 1552, 1856, 2192, 2592, 2960, 3424, 3688, 4184, 4712, 5176, 5768, 6360, 6888, 7456, 8048, 8752, 9392, 10208, 10960, 11744, 12248, 13048, 13880, 14744, 15640, 16568, 17528, 18448, 19472, 20528, 21616, 22496, 23648,), + self::ECL_M => array(1 => 128, 224, 352, 512, 688, 864, 992, 1232, 1456, 1728, 2032, 2320, 2672, 2920, 3320, 3624, 4056, 4504, 5016, 5352, 5712, 6256, 6880, 7312, 8000, 8496, 9024, 9544, 10136, 10984, 11640, 12328, 13048, 13800, 14496, 15312, 15936, 16816, 17728, 18672,), + self::ECL_Q => array(1 => 104, 176, 272, 384, 496, 608, 704, 880, 1056, 1232, 1440, 1648, 1952, 2088, 2360, 2600, 2936, 3176, 3560, 3880, 4096, 4544, 4912, 5312, 5744, 6032, 6464, 6968, 7288, 7880, 8264, 8920, 9368, 9848, 10288, 10832, 11408, 12016, 12656, 13328,), + self::ECL_H => array(1 => 72, 128, 208, 288, 368, 480, 528, 688, 800, 976, 1120, 1264, 1440, 1576, 1784, 2024, 2264, 2504, 2728, 3080, 3248, 3536, 3712, 4112, 4304, 4768, 5024, 5288, 5608, 5960, 6344, 6760, 7208, 7688, 7888, 8432, 8768, 9136, 9776, 10208,), + ); + + /** + * Code capacity in codewords + * @var array + */ + private $codewordsCapacity=array(1 => 26,44,70,100,134,172,196,242, + 292,346,404,466,532,581,655,733,815,901,991,1085,1156, + 1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465, + 2611,2761,2876,3034,3196,3362,3532,3706); + + /** + * Capacity in characters + * @var array + */ + private $dataCapacity = array( + self::ECL_L => array( + self::MODE_NUMERIC => array(1 => 41, 77, 127, 187, 255, 322, 370, 461, 552, 652, 772, 883, 1022, 1101, 1250, 1408, 1548, 1725, 1903, 2061, 2232, 2409, 2620, 2812, 3057, 3283, 3517, 3669, 3909, 4158, 4417, 4686, 4965, 5253, 5529, 5836, 6153, 6479, 6743, 7089,), + self::MODE_ALPHANUMERIC => array(1 => 25, 47, 77, 114, 154, 195, 224, 279, 335, 395, 468, 535, 619, 667, 758, 854, 938, 1046, 1153, 1249, 1352, 1460, 1588, 1704, 1853, 1990, 2132, 2223, 2369, 2520, 2677, 2840, 3009, 3183, 3351, 3537, 3729, 3927, 4087, 4296,), + self::MODE_8BITBYTE => array(1 => 17, 32, 53, 78, 106, 134, 154, 192, 230, 271, 321, 367, 425, 458, 520, 586, 644, 718, 792, 858, 929, 1003, 1091, 1171, 1273, 1367, 1465, 1528, 1628, 1732, 1840, 1952, 2068, 2188, 2303, 2431, 2563, 2699, 2809, 2953,), + self::MODE_KANJI => array(1 => 10, 20, 32, 48, 65, 82, 95, 118, 141, 167, 198, 226, 262, 282, 320, 361, 397, 442, 488, 528, 572, 618, 672, 721, 784, 842, 902, 940, 1002, 1066, 1132, 1201, 1273, 1347, 1417, 1496, 1577, 1661, 1729, 1817,), + ), + self::ECL_M => array( + self::MODE_NUMERIC => array(1 => 34, 63, 101, 149, 202, 255, 293, 365, 432, 513, 604, 691, 796, 871, 991, 1082, 1212, 1346, 1500, 1600, 1708, 1872, 2059, 2188, 2395, 2544, 2701, 2857, 3035, 3289, 3486, 3693, 3909, 4134, 4343, 4588, 4775, 5039, 5313, 5596,), + self::MODE_ALPHANUMERIC => array(1 => 20, 38, 61, 90, 122, 154, 178, 221, 262, 311, 366, 419, 483, 528, 600, 656, 734, 816, 909, 970, 1035, 1134, 1248, 1326, 1451, 1542, 1637, 1732, 1839, 1994, 2113, 2238, 2369, 2506, 2632, 2780, 2894, 3054, 3220, 3391,), + self::MODE_8BITBYTE => array(1 => 14, 26, 42, 62, 84, 106, 122, 152, 180, 213, 251, 287, 331, 362, 412, 450, 504, 560, 624, 666, 711, 779, 857, 911, 997, 1059, 1125, 1190, 1264, 1370, 1452, 1538, 1628, 1722, 1809, 1911, 1989, 2099, 2213, 2331,), + self::MODE_KANJI => array(1 => 8, 16, 26, 38, 52, 65, 75, 93, 111, 131, 155, 177, 204, 223, 254, 277, 310, 345, 384, 410, 438, 480, 528, 561, 614, 652, 692, 732, 778, 843, 894, 947, 1002, 1060, 1113, 1176, 1224, 1292, 1362, 1435,), + ), + self::ECL_Q => array( + self::MODE_NUMERIC => array(1 => 27, 48, 77, 111, 144, 178, 207, 259, 312, 364, 427, 489, 580, 621, 703, 775, 876, 948, 1063, 1159, 1224, 1358, 1468, 1588, 1718, 1804, 1933, 2085, 2181, 2358, 2473, 2670, 2805, 2949, 3081, 3244, 3417, 3599, 3791, 3993,), + self::MODE_ALPHANUMERIC => array(1 => 16, 29, 47, 67, 87, 108, 125, 157, 189, 221, 259, 296, 352, 376, 426, 470, 531, 574, 644, 702, 742, 823, 890, 963, 1041, 1094, 1172, 1263, 1322, 1429, 1499, 1618, 1700, 1787, 1867, 1966, 2071, 2181, 2298, 2420,), + self::MODE_8BITBYTE => array(1 => 11, 20, 32, 46, 60, 74, 86, 108, 130, 151, 177, 203, 241, 258, 292, 322, 364, 394, 442, 482, 509, 565, 611, 661, 715, 751, 805, 868, 908, 982, 1030, 1112, 1168, 1228, 1283, 1351, 1423, 1499, 1579, 1663,), + self::MODE_KANJI => array(1 => 7, 12, 20, 28, 37, 45, 53, 66, 80, 93, 109, 125, 149, 159, 180, 198, 224, 243, 272, 297, 314, 348, 376, 407, 440, 462, 496, 534, 559, 604, 634, 684, 719, 756, 790, 832, 876, 923, 972, 1024,), + ), + self::ECL_H => array( + self::MODE_NUMERIC => array(1 => 17, 34, 58, 82, 106, 139, 154, 202, 235, 288, 331, 374, 427, 468, 530, 602, 674, 746, 813, 919, 969, 1056, 1108, 1228, 1286, 1425, 1501, 1581, 1677, 1782, 1897, 2022, 2157, 2301, 2361, 2524, 2625, 2735, 2927, 3057,), + self::MODE_ALPHANUMERIC => array(1 => 10, 20, 35, 50, 64, 84, 93, 122, 143, 174, 200, 227, 259, 283, 321, 365, 408, 452, 493, 557, 587, 640, 672, 744, 779, 864, 910, 958, 1016, 1080, 1150, 1226, 1307, 1394, 1431, 1530, 1591, 1658, 1774, 1852,), + self::MODE_8BITBYTE => array(1 => 7, 14, 24, 34, 44, 58, 64, 84, 98, 119, 137, 155, 177, 194, 220, 250, 280, 310, 338, 382, 403, 439, 461, 511, 535, 593, 625, 658, 698, 742, 790, 842, 898, 958, 983, 1051, 1093, 1139, 1219, 1273,), + self::MODE_KANJI => array(1 => 4, 8, 15, 21, 27, 36, 39, 52, 60, 74, 85, 96, 109, 120, 136, 154, 173, 191, 208, 235, 248, 270, 284, 315, 330, 365, 385, 405, 430, 457, 486, 518, 553, 590, 605, 647, 673, 701, 750, 784,), + ), + ); + + /** + * Position detection pattern + * @var array + */ + private $positionPattern = array( + 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, + ); + + /** + * Alignment pattern + * @var array + */ + private $alignmentPattern = array( + 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, + ); + + /** + * Coordinates of alignment patterns + * @var array + */ + private $alignmentPatternCoordinate = array( + 1 => array(), + array(6, 18), + array(6, 22), + array(6, 26), + array(6, 30), + array(6, 34), + array(6, 22, 38), + array(6, 24, 42), + array(6, 26, 46), + array(6, 28, 50), + array(6, 30, 54), + array(6, 32, 58), + array(6, 34, 62), + array(6, 26, 46, 66,), + array(6, 26, 48, 70,), + array(6, 26, 50, 74,), + array(6, 30, 54, 78,), + array(6, 30, 56, 82,), + array(6, 30, 58, 86,), + array(6, 34, 62, 90,), + array(6, 28, 50, 72, 94), + array(6, 26, 50, 74, 98,), + array(6, 30, 54, 78, 102,), + array(6, 28, 54, 80, 106), + array(6, 32, 58, 84, 110,), + array(6, 30, 58, 86, 114,), + array(6, 34, 62, 90, 118,), + array(6, 26, 50, 74, 98, 122,), + array(6, 30, 54, 78, 102, 126,), + array(6, 26, 52, 78, 104, 130,), + array(6, 30, 56, 82, 108, 134,), + array(6, 34, 60, 86, 112, 138,), + array(6, 30, 58, 86, 114, 142,), + array(6, 34, 62, 90, 118, 146,), + array(6, 30, 54, 78, 102, 126, 150,), + array(6, 24, 50, 76, 102, 128, 154,), + array(6, 28, 54, 80, 106, 132, 158,), + array(6, 32, 58, 84, 110, 136, 162,), + array(6, 26, 54, 82, 110, 138, 166,), + array(6, 30, 58, 86, 114, 142, 170), + ); + + + /** + * Block specification + * @var array + */ + private $blocksSpec = array( + 1 => + array(self::ECL_L => array( 1, 0), self::ECL_M => array( 1, 0), self::ECL_Q => array( 1, 0), self::ECL_H => array( 1, 0)), // 1 + array(self::ECL_L => array( 1, 0), self::ECL_M => array( 1, 0), self::ECL_Q => array( 1, 0), self::ECL_H => array( 1, 0)), + array(self::ECL_L => array( 1, 0), self::ECL_M => array( 1, 0), self::ECL_Q => array( 2, 0), self::ECL_H => array( 2, 0)), + array(self::ECL_L => array( 1, 0), self::ECL_M => array( 2, 0), self::ECL_Q => array( 2, 0), self::ECL_H => array( 4, 0)), + array(self::ECL_L => array( 1, 0), self::ECL_M => array( 2, 0), self::ECL_Q => array( 2, 2), self::ECL_H => array( 2, 2)), // 5 + array(self::ECL_L => array( 2, 0), self::ECL_M => array( 4, 0), self::ECL_Q => array( 4, 0), self::ECL_H => array( 4, 0)), + array(self::ECL_L => array( 2, 0), self::ECL_M => array( 4, 0), self::ECL_Q => array( 2, 4), self::ECL_H => array( 4, 1)), + array(self::ECL_L => array( 2, 0), self::ECL_M => array( 2, 2), self::ECL_Q => array( 4, 2), self::ECL_H => array( 4, 2)), + array(self::ECL_L => array( 2, 0), self::ECL_M => array( 3, 2), self::ECL_Q => array( 4, 4), self::ECL_H => array( 4, 4)), + array(self::ECL_L => array( 2, 2), self::ECL_M => array( 4, 1), self::ECL_Q => array( 6, 2), self::ECL_H => array( 6, 2)), //10 + array(self::ECL_L => array( 4, 0), self::ECL_M => array( 1, 4), self::ECL_Q => array( 4, 4), self::ECL_H => array( 3, 8)), + array(self::ECL_L => array( 2, 2), self::ECL_M => array( 6, 2), self::ECL_Q => array( 4, 6), self::ECL_H => array( 7, 4)), + array(self::ECL_L => array( 4, 0), self::ECL_M => array( 8, 1), self::ECL_Q => array( 8, 4), self::ECL_H => array(12, 4)), + array(self::ECL_L => array( 3, 1), self::ECL_M => array( 4, 5), self::ECL_Q => array(11, 5), self::ECL_H => array(11, 5)), + array(self::ECL_L => array( 5, 1), self::ECL_M => array( 5, 5), self::ECL_Q => array( 5, 7), self::ECL_H => array(11, 7)), //15 + array(self::ECL_L => array( 5, 1), self::ECL_M => array( 7, 3), self::ECL_Q => array(15, 2), self::ECL_H => array( 3, 13)), + array(self::ECL_L => array( 1, 5), self::ECL_M => array(10, 1), self::ECL_Q => array( 1, 15), self::ECL_H => array( 2, 17)), + array(self::ECL_L => array( 5, 1), self::ECL_M => array( 9, 4), self::ECL_Q => array(17, 1), self::ECL_H => array( 2, 19)), + array(self::ECL_L => array( 3, 4), self::ECL_M => array( 3, 11), self::ECL_Q => array(17, 4), self::ECL_H => array( 9, 16)), + array(self::ECL_L => array( 3, 5), self::ECL_M => array( 3, 13), self::ECL_Q => array(15, 5), self::ECL_H => array(15, 10)), //20 + array(self::ECL_L => array( 4, 4), self::ECL_M => array(17, 0), self::ECL_Q => array(17, 6), self::ECL_H => array(19, 6)), + array(self::ECL_L => array( 2, 7), self::ECL_M => array(17, 0), self::ECL_Q => array( 7, 16), self::ECL_H => array(34, 0)), + array(self::ECL_L => array( 4, 5), self::ECL_M => array( 4, 14), self::ECL_Q => array(11, 14), self::ECL_H => array(16, 14)), + array(self::ECL_L => array( 6, 4), self::ECL_M => array( 6, 14), self::ECL_Q => array(11, 16), self::ECL_H => array(30, 2)), + array(self::ECL_L => array( 8, 4), self::ECL_M => array( 8, 13), self::ECL_Q => array( 7, 22), self::ECL_H => array(22, 13)), //25 + array(self::ECL_L => array(10, 2), self::ECL_M => array(19, 4), self::ECL_Q => array(28, 6), self::ECL_H => array(33, 4)), + array(self::ECL_L => array( 8, 4), self::ECL_M => array(22, 3), self::ECL_Q => array( 8, 26), self::ECL_H => array(12, 28)), + array(self::ECL_L => array( 3, 10), self::ECL_M => array( 3, 23), self::ECL_Q => array( 4, 31), self::ECL_H => array(11, 31)), + array(self::ECL_L => array( 7, 7), self::ECL_M => array(21, 7), self::ECL_Q => array( 1, 37), self::ECL_H => array(19, 26)), + array(self::ECL_L => array( 5, 10), self::ECL_M => array(19, 10), self::ECL_Q => array(15, 25), self::ECL_H => array(23, 25)), //30 + array(self::ECL_L => array(13, 3), self::ECL_M => array( 2, 29), self::ECL_Q => array(42, 1), self::ECL_H => array(23, 28)), + array(self::ECL_L => array(17, 0), self::ECL_M => array(10, 23), self::ECL_Q => array(10, 35), self::ECL_H => array(19, 35)), + array(self::ECL_L => array(17, 1), self::ECL_M => array(14, 21), self::ECL_Q => array(29, 19), self::ECL_H => array(11, 46)), + array(self::ECL_L => array(13, 6), self::ECL_M => array(14, 23), self::ECL_Q => array(44, 7), self::ECL_H => array(59, 1)), + array(self::ECL_L => array(12, 7), self::ECL_M => array(12, 26), self::ECL_Q => array(39, 14), self::ECL_H => array(22, 41)), //35 + array(self::ECL_L => array( 6, 14), self::ECL_M => array( 6, 34), self::ECL_Q => array(46, 10), self::ECL_H => array( 2, 64)), + array(self::ECL_L => array(17, 4), self::ECL_M => array(29, 14), self::ECL_Q => array(49, 10), self::ECL_H => array(24, 46)), + array(self::ECL_L => array( 4, 18), self::ECL_M => array(13, 32), self::ECL_Q => array(48, 14), self::ECL_H => array(42, 32)), + array(self::ECL_L => array(20, 4), self::ECL_M => array(40, 7), self::ECL_Q => array(43, 22), self::ECL_H => array(10, 67)), + array(self::ECL_L => array(19, 6), self::ECL_M => array(18, 31), self::ECL_Q => array(34, 34), self::ECL_H => array(20, 61)),//40 + ); + + /** + * Alphanumeric code coding table + * @var array + */ + private $alphanumCodingTable = array( + '0' => 0, '1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, + '6' => 6, '7' => 7, '8' => 8, '9' => 9, 'A' => 10, 'B' => 11, + 'C' => 12, 'D' => 13, 'E' => 14, 'F' => 15, 'G' => 16, 'H' => 17, + 'I' => 18, 'J' => 19, 'K' => 20, 'L' => 21, 'M' => 22, 'N' => 23, + 'O' => 24, 'P' => 25, 'Q' => 26, 'R' => 27, 'S' => 28, 'T' => 29, + 'U' => 30, 'V' => 31, 'W' => 32, 'X' => 33, 'Y' => 34, 'Z' => 35, + ' ' => 36, '$' => 37, '%' => 38, '*' => 39, '+' => 40, '-' => 41, + '.' => 42, '/' => 43, ':' => 44, + ); + + /** + * Version information + * From ISO/IEC 18004:2000, page 78-79 + * @var array + */ + private $versionInformationStream = array( + 7 => 0x07c94, 0x085bc, 0x09a99, 0x0a4d3, 0x0bbf6, 0x0c762, 0x0d847, + 0x0e60d, 0x0f928, 0x10b78, 0x1145d, 0x12a17, 0x13532, 0x149a6, 0x15683, + 0x168c9, 0x177ec, 0x18ec4, 0x191e1, 0x1afab, 0x1b08e, 0x1cc1a, 0x1d33f, + 0x1ed75, 0x1f250, 0x209d5, 0x216f0, 0x228ba, 0x2379f, 0x24b0b, 0x2542e, + 0x26a64, 0x27541, 0x28c69, + ); + + /** + * Galois field + * @var array + */ + private $galoisField; + + /** + * Galois field with changed index and value + * @var array + */ + private $indexGaloisField; + + + /** + * Constructor + * + * @param string $text + * @param int $moduleSize + * @param char $ecl + */ + public function __construct($text, $moduleSize=parent::MODULE_SIZE, $ecl=self::ECL_L_CODE, $version=null) + { + try { + parent::__construct($text, $moduleSize); + + // Convert input text to UTF-8 + $current_encoding = mb_detect_encoding($this->text, 'auto'); + $this->text = iconv($current_encoding, 'UTF-8', $this->text); + + $this->ecl = $this->eclConvertTable[$ecl]; + + // Num of input chars + $this->charsNum = strlen($text); + + $this->mode = $this->getMode($text); + + // Mask reference + $this->maskReference = rand(0,7); + + + // Version + $this->version = $this->getVersion($this->charsNum, $this->ecl, $this->mode, $version); + + // Code size + $this->matrixSize = $this->getMatrixSize($this->version); + + $this->symbolSize = $this->matrixSize + 2 * self::QUIET_ZONE; + + + $this->countGaloisField(); + + // Init matrixes + $this->init(); + + $this->bitsCoordinates = $this->getBitsCoordinates($this->maskedMatrix); + + $this->convertData(); + + // Format info + $formatInformation = $this->formatInformation($this->ecl,$this->maskReference); + $this->matrix = $this->addFormatInformation($this->matrix, $formatInformation); + + // Version info + if($this->version>=7 && $this->version<=40) { + $versionInformation = $this->versionInformation($this->version); + $this->matrix = $this->addVersionInformation($this->matrix, $versionInformation); + } + + + } catch (Exception $e) { + throw $e; + } + } + + + /** + * Get Mode + * Returns mode indicator + * + * @param string $text + * @return int + */ + private function getMode($text) + { + if (preg_match('/[^0-9]/', $text)==0) { + return self::MODE_NUMERIC; + } else if(preg_match('/[^0-9A-Z \$\*\%\+\.\/\:\-]/', $text)==0) { + return self::MODE_ALPHANUMERIC; + } else { + return self::MODE_8BITBYTE; + } + } + + + /** + * Get Version + * + * @param int $charsNum + * @param int $ecl + * @param int $mode + * @return int + */ + private function getVersion($charsNum, $ecl, $mode, $version) + { + $findversion = 1; + while ($findversion<=40) { + if ($this->dataCapacity[$ecl][$mode][$findversion] >= $charsNum) { + break; + } + $findversion++; + } + + if($findversion==41) { + throw new Exception('Input text is too long.', E_BAD_QR_LENGTH); + } + + + if($version) { + if($findversion<=$version && $version <= 40) { + return $version; + } else { + throw new Exception('Selected version can not be choosen.', E_BAD_VERSION); + } + } + + return $findversion; + } + + + /** + * Get Matrix Size + * + * Use bit shift + * x << y = x*(2^y) + * + * @param int $version + * @return int + */ + private function getMatrixSize($version) + { + return 17 + ($version << 2); + } + + + /** + * Init + * + * Matrix init + * prepare matrixes and bits + * + * @return void + */ + private function init() { + for ($y = 0; $y < $this->matrixSize; $y++) { + for ($x = 0; $x < $this->matrixSize; $x++) { + $matrix[$y][$x] = 0; // White as default + + // Vertical synch. + if ($y == 6 && $x % 2 == 0) { + $matrix[$y][$x] = 1; + } + // Hor. synch + if ($x == 6 && $y % 2 == 0) { + $matrix[$y][$x] = 1; + } + + // Mask synch. patterns + if ($y == 6 || $x == 6) { + $maskedMatrix[$y][$x] = 1; + } + + + // Format and version mask + // all versions + if($x==8 && ($y<=8 || $y>=($this->matrixSize-8))) { + $maskedMatrix[$y][$x] = 1; + } + if($y==8 && ($x<=8 || $x>=($this->matrixSize-8))) { + $maskedMatrix[$y][$x] = 1; + } + // Version >= 7 + if($this->version >= 7) { + if($y<=5 && $x>=$this->matrixSize-11 && $x<=$this->matrixSize-9) { + $maskedMatrix[$y][$x] = 1; + } + if($x<=5 && $y>=$this->matrixSize-11 && $y<=$this->matrixSize-9) { + $maskedMatrix[$y][$x] = 1; + } + } + + + // left top position pattern + if ($y <= 6 && $x <= 6) { + $shift = $y * 7 + $x; + $matrix[$y][$x] = $this->positionPattern[$shift]; + + $maskedMatrix[$y][$x] = 1; + $maskedMatrix[$y+1][$x+1] = 1; // mask. separatoru + } + // left bottom position pattern + if ($y < 7 && $x < $this->matrixSize && $x > ($this->matrixSize - 8)) { + $shift = $y * 7 + ($this->matrixSize - $x - 1); + $matrix[$y][$x] = $this->positionPattern[$shift]; + + $maskedMatrix[$y][$x] = 1; + $maskedMatrix[$y+1][$x-1] = 1; + } + // right top position pattern + if ($x < 7 && $y < $this->matrixSize && $y > ($this->matrixSize - 8)) { + $shift = $x + ($this->matrixSize - $y - 1) * 7; + $matrix[$y][$x] = $this->positionPattern[$shift]; + + $maskedMatrix[$y][$x] = 1; + $maskedMatrix[$y-1][$x+1] = 1; + } + } + } + + // Alignment patterns + if (count($this->alignmentPatternCoordinate[$this->version]) > 0) { + foreach ($this->alignmentPatternCoordinate[$this->version] as $y) { + foreach ($this->alignmentPatternCoordinate[$this->version] as $x) { + if (!(($x < 7 && $y < 7) || ($y > ($this->matrixSize - 8) && $x < 7) || ($x > ($this->matrixSize - 8) && $y < 7))) { + for ($i = 0; $i < 5; $i++) { + for ($j = 0; $j < 5; $j++) { + $xCoor = $x - $i + 2; + $yCoor = $y - $j + 2; + $matrix[$xCoor][$yCoor] = $this->alignmentPattern[$i * 5 + $j]; + $maskedMatrix[$xCoor][$yCoor] = 1; // Mask alignment patterns + } + } + } + } + } + } + + // Module around detection patterns + $maskedMatrix[0][7] = 1; + $maskedMatrix[0][$this->matrixSize-8] = 1; + $maskedMatrix[7][0] = 1; + $maskedMatrix[7][$this->matrixSize-1] = 1; + $maskedMatrix[$this->matrixSize-8][0] = 1; + $maskedMatrix[$this->matrixSize-1][7] = 1; + + + $this->matrix = $matrix; + $this->maskedMatrix = $maskedMatrix; + } + + + /** + * Get Bits Coordinates + * + * @param array $maskedMatrix + * @return array + */ + private function getBitsCoordinates($maskedMatrix) { + + + // start at right bottom corner + $y = $this->matrixSize-1; + $x = $this->matrixSize-1; + + // top + $direction = self::DIRECTION_UP; + + // and go left + $goLeft = 1; + + $biteCounter = 0; + while($biteCounter < $this->codewordsCapacity[$this->version]*8) { + + // jump over timing pattern + if($x==6) { + $x=5; + } + + switch($direction) { + case self::DIRECTION_UP: + if(!$this->maskedMatrix[$y][$x]) { + $bitesCoordinates[$biteCounter] = array($y,$x); + $biteCounter++; + } + + // next coordinate + if($goLeft==1) { + // Jdi doleva + $x = $x-1; + $y = $y; + $goLeft = 0; + } else { + // top right + $x = $x+1; + $y = $y-1; + + if($y<0) { + // direction change + $direction = self::DIRECTION_DOWN; + $y = 0; + $x = $x-2; + } + + $goLeft = 1; + } + + + break; + case self::DIRECTION_DOWN: + if(!$this->maskedMatrix[$y][$x]) { + $bitesCoordinates[$biteCounter] = array($y,$x); + $biteCounter++; + } + + // next coordinate + if($goLeft==1) { + // Doleva + $x = $x-1; + $y = $y; + $goLeft = 0; + } else { + // down and right + $x = $x+1; + $y = $y+1; + + if($y>=$this->matrixSize) { + // direction change + $direction = self::DIRECTION_UP; + $y = $y-1; + $x = $x-2; + } + + $goLeft = 1; + } + + break; + } + } + + return $bitesCoordinates; + } + + + + /** + * Convert Data + * + * @return void + */ + private function convertData() + { + $text = $this->text; + + + /* DATA CODING ********************************************************/ + + $dataCounter = 0; + // Mode indicator 4b + $data[$dataCounter] = array( + 4, + $this->mode, + ); + $totalDataBits = 4; + $dataCounter++; + + // Num chars indicator + $data[$dataCounter] = array( + // length indicator in bits + $this->characterCountIndicatorBits[$this->mode][$this->version], + $this->charsNum, + ); + $totalDataBits += $this->characterCountIndicatorBits[$this->mode][$this->version]; + $dataCounter++; + + switch($this->mode) { + case self::MODE_NUMERIC: + + // divide ... [truncated message content] |
From: <dai...@us...> - 2012-05-29 08:23:57
|
Revision: 5404 http://web-erp.svn.sourceforge.net/web-erp/?rev=5404&view=rev Author: daintree Date: 2012-05-29 08:23:46 +0000 (Tue, 29 May 2012) Log Message: ----------- fix label script - also utf-8 xml-rpc Modified Paths: -------------- trunk/PDFPrintLabel.php trunk/api/api_xml-rpc.php trunk/doc/Change.log Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2012-05-28 02:09:06 UTC (rev 5403) +++ trunk/PDFPrintLabel.php 2012-05-29 08:23:46 UTC (rev 5404) @@ -223,7 +223,7 @@ $Image_String = ob_get_contents(); ob_end_clean(); - $pdf->addJpegFromFile('@' . $Image_String,$XPos+$Field['HPos'],$Field['VPos'],'', $Field['FontSize']); + $pdf->addJpegFromFile('@' . $Image_String,$XPos+$Field['HPos'],$YPos-$LabelDimensions['label_height']+$Field['VPos'],'', $Field['FontSize']); } else { $LeftOvers = $pdf->addTextWrap($XPos+$Field['HPos'],$YPos-$LabelDimensions['label_height']+$Field['VPos'],$LabelDimensions['label_width']-$Field['HPos']-20,$Field['FontSize'],$Value); Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2012-05-28 02:09:06 UTC (rev 5403) +++ trunk/api/api_xml-rpc.php 2012-05-29 08:23:46 UTC (rev 5404) @@ -8,7 +8,7 @@ include 'api_php.php'; include '../xmlrpc/lib/xmlrpc.inc'; - + $xmlrpc_internalencoding='UTF-8'; include '../xmlrpc/lib/xmlrpcs.inc'; $Description = _('This function is used to login into the API methods for the specified the database.') Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-05-28 02:09:06 UTC (rev 5403) +++ trunk/doc/Change.log 2012-05-29 08:23:46 UTC (rev 5404) @@ -1,5 +1,6 @@ webERP Change Log +28/5/2012 Phil: Configure xmlrpc api to work correctly with utf-8 character encoding. 26/5/2012 Phil: Fix barcode printing on PDFPrintLabel.php - barcode functionality is unreliable so used (http://www.barcodepack.com) by Tomáš Horáček very simple and clean 23/5/2012 Klaus: PO_PDFPurchOrders.php print purchase orders with supplier's code where it is available in the purchasing data 23/5/2012 Exson: Revise GLAccounts.php to make more than 10 digits account code is allowed. @@ -11,7 +12,6 @@ 14/5/2012 Exson: Fixed bug that when users input a Exchang Rate manually, when ones changed minds and select another currency, it'll not show the suggested rate correctly in Payments.php. 14/5/2012 Exson: Fixed when user change the currency, the suggested rate can not changed accordingly in CustomerReceipt.php. Reported by Ahmed.Fawzy. 14/5/2012 Ahmed.Fawzy: Fixed bugs that ExchangRateText be applied with locale_number_format() function in CustomerReceipt.php - 10/5/2012 Exson: Fixed bug that Date selection does not work in ReverseGRN.php. Add GRN batch column. 9/5/2012 Ahmed.Fawzy: Fixed bugs in Stocks.php that the properties for new items cannot be saved. Checked status is not kept and numeric values between max and min are not validated. 8/5/2012 Exson: Fixed typo in SalesCategories.php which leads to the jpg pictures do not appear. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-05-29 08:23:57
|
Revision: 5404 http://web-erp.svn.sourceforge.net/web-erp/?rev=5404&view=rev Author: daintree Date: 2012-05-29 08:23:46 +0000 (Tue, 29 May 2012) Log Message: ----------- fix label script - also utf-8 xml-rpc Modified Paths: -------------- trunk/PDFPrintLabel.php trunk/api/api_xml-rpc.php trunk/doc/Change.log Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2012-05-28 02:09:06 UTC (rev 5403) +++ trunk/PDFPrintLabel.php 2012-05-29 08:23:46 UTC (rev 5404) @@ -223,7 +223,7 @@ $Image_String = ob_get_contents(); ob_end_clean(); - $pdf->addJpegFromFile('@' . $Image_String,$XPos+$Field['HPos'],$Field['VPos'],'', $Field['FontSize']); + $pdf->addJpegFromFile('@' . $Image_String,$XPos+$Field['HPos'],$YPos-$LabelDimensions['label_height']+$Field['VPos'],'', $Field['FontSize']); } else { $LeftOvers = $pdf->addTextWrap($XPos+$Field['HPos'],$YPos-$LabelDimensions['label_height']+$Field['VPos'],$LabelDimensions['label_width']-$Field['HPos']-20,$Field['FontSize'],$Value); Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2012-05-28 02:09:06 UTC (rev 5403) +++ trunk/api/api_xml-rpc.php 2012-05-29 08:23:46 UTC (rev 5404) @@ -8,7 +8,7 @@ include 'api_php.php'; include '../xmlrpc/lib/xmlrpc.inc'; - + $xmlrpc_internalencoding='UTF-8'; include '../xmlrpc/lib/xmlrpcs.inc'; $Description = _('This function is used to login into the API methods for the specified the database.') Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-05-28 02:09:06 UTC (rev 5403) +++ trunk/doc/Change.log 2012-05-29 08:23:46 UTC (rev 5404) @@ -1,5 +1,6 @@ webERP Change Log +28/5/2012 Phil: Configure xmlrpc api to work correctly with utf-8 character encoding. 26/5/2012 Phil: Fix barcode printing on PDFPrintLabel.php - barcode functionality is unreliable so used (http://www.barcodepack.com) by Tomáš Horáček very simple and clean 23/5/2012 Klaus: PO_PDFPurchOrders.php print purchase orders with supplier's code where it is available in the purchasing data 23/5/2012 Exson: Revise GLAccounts.php to make more than 10 digits account code is allowed. @@ -11,7 +12,6 @@ 14/5/2012 Exson: Fixed bug that when users input a Exchang Rate manually, when ones changed minds and select another currency, it'll not show the suggested rate correctly in Payments.php. 14/5/2012 Exson: Fixed when user change the currency, the suggested rate can not changed accordingly in CustomerReceipt.php. Reported by Ahmed.Fawzy. 14/5/2012 Ahmed.Fawzy: Fixed bugs that ExchangRateText be applied with locale_number_format() function in CustomerReceipt.php - 10/5/2012 Exson: Fixed bug that Date selection does not work in ReverseGRN.php. Add GRN batch column. 9/5/2012 Ahmed.Fawzy: Fixed bugs in Stocks.php that the properties for new items cannot be saved. Checked status is not kept and numeric values between max and min are not validated. 8/5/2012 Exson: Fixed typo in SalesCategories.php which leads to the jpg pictures do not appear. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-06-02 06:08:57
|
Revision: 5408 http://web-erp.svn.sourceforge.net/web-erp/?rev=5408&view=rev Author: daintree Date: 2012-06-02 06:08:51 +0000 (Sat, 02 Jun 2012) Log Message: ----------- Modified Paths: -------------- trunk/CounterSales.php trunk/Z_ImportStocks.php Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2012-05-30 09:03:21 UTC (rev 5407) +++ trunk/CounterSales.php 2012-06-02 06:08:51 UTC (rev 5408) @@ -1278,7 +1278,8 @@ rate, invtext, shipvia, - alloc ) + alloc, + settled ) VALUES ( '". $InvoiceNo . "', 10, @@ -1295,7 +1296,8 @@ '" . $ExRate . "', '" . $_SESSION['Items'.$identifier]->Comments . "', '" . $_SESSION['Items'.$identifier]->ShipVia . "', - '" . ($_SESSION['Items'.$identifier]->total + filter_number_format($_POST['TaxTotal'])) . "')"; + '" . ($_SESSION['Items'.$identifier]->total + filter_number_format($_POST['TaxTotal'])) . "', + '1')"; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The debtor transaction record could not be inserted because'); $DbgMsg = _('The following SQL to insert the debtor transaction record was used'); @@ -1934,7 +1936,8 @@ rate, ovamount, alloc, - invtext) + invtext, + settled) VALUES ('" . $ReceiptNumber . "', 12, '" . $_SESSION['Items'.$identifier]->DebtorNo . "', @@ -1945,7 +1948,8 @@ '" . $ExRate . "', '" . -filter_number_format($_POST['AmountPaid']) . "', '" . -filter_number_format($_POST['AmountPaid']) . "', - '" . $_SESSION['Items'.$identifier]->LocationName . ' ' . _('Counter Sale') ."')"; + '" . $_SESSION['Items'.$identifier]->LocationName . ' ' . _('Counter Sale') ."', + '1')"; $DbgMsg = _('The SQL that failed to insert the customer receipt transaction was'); $ErrMsg = _('Cannot insert a receipt transaction against the customer because') ; Modified: trunk/Z_ImportStocks.php =================================================================== --- trunk/Z_ImportStocks.php 2012-05-30 09:03:21 UTC (rev 5407) +++ trunk/Z_ImportStocks.php 2012-06-02 06:08:51 UTC (rev 5408) @@ -33,17 +33,17 @@ if ($_FILES['userfile']['name']) { //start file processing //initialize - $allowType='text/csv'; + $AllowType='text/csv'; $fieldTarget = 18; $InputError = 0; //check file info - $fileName = $_FILES['userfile']['name']; + $FileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userfile']['tmp_name']; $fileSize = $_FILES['userfile']['size']; $fileType = $_FILES['userfile']['type']; - if ($fileType != $allowType) { - prnMsg (_('File has type '. $fileType. ', but only '. $allowType. ' is allowed.'),'error'); + if ($fileType != $AllowType) { + prnMsg (_('File has type '. $fileType. ', but only '. $AllowType. ' is allowed.'),'error'); include('includes/footer.inc'); exit; } @@ -273,7 +273,7 @@ DB_Txn_Rollback($db); } else { //all good so commit data transaction DB_Txn_Commit($db); - prnMsg( _('Batch Import of') .' ' . $fileName . ' '. _('has been completed. All transactions committed to the database.'),'success'); + prnMsg( _('Batch Import of') .' ' . $FileName . ' '. _('has been completed. All transactions committed to the database.'),'success'); } fclose($handle); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-06-02 06:08:57
|
Revision: 5408 http://web-erp.svn.sourceforge.net/web-erp/?rev=5408&view=rev Author: daintree Date: 2012-06-02 06:08:51 +0000 (Sat, 02 Jun 2012) Log Message: ----------- Modified Paths: -------------- trunk/CounterSales.php trunk/Z_ImportStocks.php Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2012-05-30 09:03:21 UTC (rev 5407) +++ trunk/CounterSales.php 2012-06-02 06:08:51 UTC (rev 5408) @@ -1278,7 +1278,8 @@ rate, invtext, shipvia, - alloc ) + alloc, + settled ) VALUES ( '". $InvoiceNo . "', 10, @@ -1295,7 +1296,8 @@ '" . $ExRate . "', '" . $_SESSION['Items'.$identifier]->Comments . "', '" . $_SESSION['Items'.$identifier]->ShipVia . "', - '" . ($_SESSION['Items'.$identifier]->total + filter_number_format($_POST['TaxTotal'])) . "')"; + '" . ($_SESSION['Items'.$identifier]->total + filter_number_format($_POST['TaxTotal'])) . "', + '1')"; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The debtor transaction record could not be inserted because'); $DbgMsg = _('The following SQL to insert the debtor transaction record was used'); @@ -1934,7 +1936,8 @@ rate, ovamount, alloc, - invtext) + invtext, + settled) VALUES ('" . $ReceiptNumber . "', 12, '" . $_SESSION['Items'.$identifier]->DebtorNo . "', @@ -1945,7 +1948,8 @@ '" . $ExRate . "', '" . -filter_number_format($_POST['AmountPaid']) . "', '" . -filter_number_format($_POST['AmountPaid']) . "', - '" . $_SESSION['Items'.$identifier]->LocationName . ' ' . _('Counter Sale') ."')"; + '" . $_SESSION['Items'.$identifier]->LocationName . ' ' . _('Counter Sale') ."', + '1')"; $DbgMsg = _('The SQL that failed to insert the customer receipt transaction was'); $ErrMsg = _('Cannot insert a receipt transaction against the customer because') ; Modified: trunk/Z_ImportStocks.php =================================================================== --- trunk/Z_ImportStocks.php 2012-05-30 09:03:21 UTC (rev 5407) +++ trunk/Z_ImportStocks.php 2012-06-02 06:08:51 UTC (rev 5408) @@ -33,17 +33,17 @@ if ($_FILES['userfile']['name']) { //start file processing //initialize - $allowType='text/csv'; + $AllowType='text/csv'; $fieldTarget = 18; $InputError = 0; //check file info - $fileName = $_FILES['userfile']['name']; + $FileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userfile']['tmp_name']; $fileSize = $_FILES['userfile']['size']; $fileType = $_FILES['userfile']['type']; - if ($fileType != $allowType) { - prnMsg (_('File has type '. $fileType. ', but only '. $allowType. ' is allowed.'),'error'); + if ($fileType != $AllowType) { + prnMsg (_('File has type '. $fileType. ', but only '. $AllowType. ' is allowed.'),'error'); include('includes/footer.inc'); exit; } @@ -273,7 +273,7 @@ DB_Txn_Rollback($db); } else { //all good so commit data transaction DB_Txn_Commit($db); - prnMsg( _('Batch Import of') .' ' . $fileName . ' '. _('has been completed. All transactions committed to the database.'),'success'); + prnMsg( _('Batch Import of') .' ' . $FileName . ' '. _('has been completed. All transactions committed to the database.'),'success'); } fclose($handle); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2012-06-07 08:04:15
|
Revision: 5430 http://web-erp.svn.sourceforge.net/web-erp/?rev=5430&view=rev Author: tehonu Date: 2012-06-07 08:04:05 +0000 (Thu, 07 Jun 2012) Log Message: ----------- Correct rounding for different currency decimalpalces Modified Paths: -------------- trunk/AgedDebtors.php trunk/AgedSuppliers.php Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2012-06-07 00:49:31 UTC (rev 5429) +++ trunk/AgedDebtors.php 2012-06-07 08:04:05 UTC (rev 5430) @@ -91,7 +91,7 @@ holdreasons.dissallowinvoices, holdreasons.reasondescription HAVING - ABS(SUM(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc)) >0.005"; + ROUND(ABS(SUM(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc)),currencies.decimalplaces) > 0"; } elseif ($_POST['All_Or_Overdues']=='OverduesOnly') { Modified: trunk/AgedSuppliers.php =================================================================== --- trunk/AgedSuppliers.php 2012-06-07 00:49:31 UTC (rev 5429) +++ trunk/AgedSuppliers.php 2012-06-07 08:04:05 UTC (rev 5430) @@ -56,7 +56,7 @@ paymentterms.terms, paymentterms.daysbeforedue, paymentterms.dayinfollowingmonth - HAVING SUM(supptrans.ovamount + supptrans.ovgst - supptrans.alloc) <>0"; + HAVING ROUND(ABS(SUM(supptrans.ovamount + supptrans.ovgst - supptrans.alloc)), currencies.decimalplaces) > 0"; } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2012-06-07 08:04:15
|
Revision: 5430 http://web-erp.svn.sourceforge.net/web-erp/?rev=5430&view=rev Author: tehonu Date: 2012-06-07 08:04:05 +0000 (Thu, 07 Jun 2012) Log Message: ----------- Correct rounding for different currency decimalpalces Modified Paths: -------------- trunk/AgedDebtors.php trunk/AgedSuppliers.php Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2012-06-07 00:49:31 UTC (rev 5429) +++ trunk/AgedDebtors.php 2012-06-07 08:04:05 UTC (rev 5430) @@ -91,7 +91,7 @@ holdreasons.dissallowinvoices, holdreasons.reasondescription HAVING - ABS(SUM(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc)) >0.005"; + ROUND(ABS(SUM(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc)),currencies.decimalplaces) > 0"; } elseif ($_POST['All_Or_Overdues']=='OverduesOnly') { Modified: trunk/AgedSuppliers.php =================================================================== --- trunk/AgedSuppliers.php 2012-06-07 00:49:31 UTC (rev 5429) +++ trunk/AgedSuppliers.php 2012-06-07 08:04:05 UTC (rev 5430) @@ -56,7 +56,7 @@ paymentterms.terms, paymentterms.daysbeforedue, paymentterms.dayinfollowingmonth - HAVING SUM(supptrans.ovamount + supptrans.ovgst - supptrans.alloc) <>0"; + HAVING ROUND(ABS(SUM(supptrans.ovamount + supptrans.ovgst - supptrans.alloc)), currencies.decimalplaces) > 0"; } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2012-06-09 03:18:42
|
Revision: 5432 http://web-erp.svn.sourceforge.net/web-erp/?rev=5432&view=rev Author: tehonu Date: 2012-06-09 03:18:36 +0000 (Sat, 09 Jun 2012) Log Message: ----------- Added lastcategoryupdate field to stockmaster table Modified Paths: -------------- trunk/Stocks.php trunk/sql/mysql/upgrade4.07-4.08.sql Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2012-06-09 02:51:01 UTC (rev 5431) +++ trunk/Stocks.php 2012-06-09 03:18:36 UTC (rev 5432) @@ -1,6 +1,6 @@ <?php -/* $Id$ */ +//* $Id$ */ include('includes/session.inc'); $title = _('Item Maintenance'); @@ -225,7 +225,8 @@ serialised, materialcost+labourcost+overheadcost AS itemcost, stockcategory.stockact, - stockcategory.wipact + stockcategory.wipact, + stockmaster.categoryid FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid @@ -238,6 +239,7 @@ $UnitCost = $myrow[3]; $OldStockAccount = $myrow[4]; $OldWIPAccount = $myrow[5]; + $OldCategoryId = $myrow[6]; $sql = "SELECT SUM(locstock.quantity) @@ -364,8 +366,11 @@ controlled='" . $_POST['Controlled'] . "', serialised='" . $_POST['Serialised']."', perishable='" . $_POST['Perishable']."', - categoryid='" . $_POST['CategoryID'] . "', - units='" . $_POST['Units'] . "', + categoryid='" . $_POST['CategoryID'] . "', "; + if ($OldCategoryId != $_POST['CategoryID']){ + $sql = $sql . "lastcategoryupdate='" . date('Y-m-d') . "', "; + } + $sql = $sql . "units='" . $_POST['Units'] . "', mbflag='" . $_POST['MBFlag'] . "', eoq='" . filter_number_format($_POST['EOQ']) . "', volume='" . filter_number_format($_POST['Volume']) . "', @@ -507,8 +512,9 @@ DB_Txn_Commit($db); prnMsg( _('Stock Item') . ' ' . $StockID . ' ' . _('has been updated'), 'success'); echo '<br />'; - } + } + } else { //it is a NEW part //but lets be really sure here $result = DB_query("SELECT stockid @@ -522,6 +528,7 @@ description, longdescription, categoryid, + lastcategoryupdate, units, mbflag, eoq, @@ -541,6 +548,7 @@ '" . $_POST['Description'] . "', '" . $_POST['LongDescription'] . "', '" . $_POST['CategoryID'] . "', + '" . date('Y-m-d') . "', '" . $_POST['Units'] . "', '" . $_POST['MBFlag'] . "', '" . filter_number_format($_POST['EOQ']) . "', Modified: trunk/sql/mysql/upgrade4.07-4.08.sql =================================================================== --- trunk/sql/mysql/upgrade4.07-4.08.sql 2012-06-09 02:51:01 UTC (rev 5431) +++ trunk/sql/mysql/upgrade4.07-4.08.sql 2012-06-09 03:18:36 UTC (rev 5432) @@ -122,5 +122,7 @@ INSERT INTO scripts (script, pagesecurity, description) VALUES ('NoSalesItems.php', '2', 'Shows the No Selling (worst) items'); +ALTER TABLE stockmaster ADD lastcategoryupdate DATE NOT NULL DEFAULT '0000-00-00' AFTER categoryid; + UPDATE config SET confvalue='4.08' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2012-06-09 03:18:42
|
Revision: 5432 http://web-erp.svn.sourceforge.net/web-erp/?rev=5432&view=rev Author: tehonu Date: 2012-06-09 03:18:36 +0000 (Sat, 09 Jun 2012) Log Message: ----------- Added lastcategoryupdate field to stockmaster table Modified Paths: -------------- trunk/Stocks.php trunk/sql/mysql/upgrade4.07-4.08.sql Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2012-06-09 02:51:01 UTC (rev 5431) +++ trunk/Stocks.php 2012-06-09 03:18:36 UTC (rev 5432) @@ -1,6 +1,6 @@ <?php -/* $Id$ */ +//* $Id$ */ include('includes/session.inc'); $title = _('Item Maintenance'); @@ -225,7 +225,8 @@ serialised, materialcost+labourcost+overheadcost AS itemcost, stockcategory.stockact, - stockcategory.wipact + stockcategory.wipact, + stockmaster.categoryid FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid @@ -238,6 +239,7 @@ $UnitCost = $myrow[3]; $OldStockAccount = $myrow[4]; $OldWIPAccount = $myrow[5]; + $OldCategoryId = $myrow[6]; $sql = "SELECT SUM(locstock.quantity) @@ -364,8 +366,11 @@ controlled='" . $_POST['Controlled'] . "', serialised='" . $_POST['Serialised']."', perishable='" . $_POST['Perishable']."', - categoryid='" . $_POST['CategoryID'] . "', - units='" . $_POST['Units'] . "', + categoryid='" . $_POST['CategoryID'] . "', "; + if ($OldCategoryId != $_POST['CategoryID']){ + $sql = $sql . "lastcategoryupdate='" . date('Y-m-d') . "', "; + } + $sql = $sql . "units='" . $_POST['Units'] . "', mbflag='" . $_POST['MBFlag'] . "', eoq='" . filter_number_format($_POST['EOQ']) . "', volume='" . filter_number_format($_POST['Volume']) . "', @@ -507,8 +512,9 @@ DB_Txn_Commit($db); prnMsg( _('Stock Item') . ' ' . $StockID . ' ' . _('has been updated'), 'success'); echo '<br />'; - } + } + } else { //it is a NEW part //but lets be really sure here $result = DB_query("SELECT stockid @@ -522,6 +528,7 @@ description, longdescription, categoryid, + lastcategoryupdate, units, mbflag, eoq, @@ -541,6 +548,7 @@ '" . $_POST['Description'] . "', '" . $_POST['LongDescription'] . "', '" . $_POST['CategoryID'] . "', + '" . date('Y-m-d') . "', '" . $_POST['Units'] . "', '" . $_POST['MBFlag'] . "', '" . filter_number_format($_POST['EOQ']) . "', Modified: trunk/sql/mysql/upgrade4.07-4.08.sql =================================================================== --- trunk/sql/mysql/upgrade4.07-4.08.sql 2012-06-09 02:51:01 UTC (rev 5431) +++ trunk/sql/mysql/upgrade4.07-4.08.sql 2012-06-09 03:18:36 UTC (rev 5432) @@ -122,5 +122,7 @@ INSERT INTO scripts (script, pagesecurity, description) VALUES ('NoSalesItems.php', '2', 'Shows the No Selling (worst) items'); +ALTER TABLE stockmaster ADD lastcategoryupdate DATE NOT NULL DEFAULT '0000-00-00' AFTER categoryid; + UPDATE config SET confvalue='4.08' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-06-10 03:40:06
|
Revision: 5434 http://web-erp.svn.sourceforge.net/web-erp/?rev=5434&view=rev Author: daintree Date: 2012-06-10 03:40:00 +0000 (Sun, 10 Jun 2012) Log Message: ----------- reverse category change field changes Modified Paths: -------------- trunk/Stocks.php trunk/sql/mysql/upgrade4.07-4.08.sql Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2012-06-10 01:08:21 UTC (rev 5433) +++ trunk/Stocks.php 2012-06-10 03:40:00 UTC (rev 5434) @@ -1,6 +1,6 @@ <?php -//* $Id$ */ +/* $Id$ */ include('includes/session.inc'); $title = _('Item Maintenance'); @@ -225,8 +225,7 @@ serialised, materialcost+labourcost+overheadcost AS itemcost, stockcategory.stockact, - stockcategory.wipact, - stockmaster.categoryid + stockcategory.wipact FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid @@ -239,7 +238,6 @@ $UnitCost = $myrow[3]; $OldStockAccount = $myrow[4]; $OldWIPAccount = $myrow[5]; - $OldCategoryId = $myrow[6]; $sql = "SELECT SUM(locstock.quantity) @@ -366,11 +364,8 @@ controlled='" . $_POST['Controlled'] . "', serialised='" . $_POST['Serialised']."', perishable='" . $_POST['Perishable']."', - categoryid='" . $_POST['CategoryID'] . "', "; - if ($OldCategoryId != $_POST['CategoryID']){ - $sql = $sql . "lastcategoryupdate='" . date('Y-m-d') . "', "; - } - $sql = $sql . "units='" . $_POST['Units'] . "', + categoryid='" . $_POST['CategoryID'] . "', + units='" . $_POST['Units'] . "', mbflag='" . $_POST['MBFlag'] . "', eoq='" . filter_number_format($_POST['EOQ']) . "', volume='" . filter_number_format($_POST['Volume']) . "', @@ -512,9 +507,8 @@ DB_Txn_Commit($db); prnMsg( _('Stock Item') . ' ' . $StockID . ' ' . _('has been updated'), 'success'); echo '<br />'; - } + } - } else { //it is a NEW part //but lets be really sure here $result = DB_query("SELECT stockid @@ -528,7 +522,6 @@ description, longdescription, categoryid, - lastcategoryupdate, units, mbflag, eoq, @@ -548,7 +541,6 @@ '" . $_POST['Description'] . "', '" . $_POST['LongDescription'] . "', '" . $_POST['CategoryID'] . "', - '" . date('Y-m-d') . "', '" . $_POST['Units'] . "', '" . $_POST['MBFlag'] . "', '" . filter_number_format($_POST['EOQ']) . "', Modified: trunk/sql/mysql/upgrade4.07-4.08.sql =================================================================== --- trunk/sql/mysql/upgrade4.07-4.08.sql 2012-06-10 01:08:21 UTC (rev 5433) +++ trunk/sql/mysql/upgrade4.07-4.08.sql 2012-06-10 03:40:00 UTC (rev 5434) @@ -122,7 +122,5 @@ INSERT INTO scripts (script, pagesecurity, description) VALUES ('NoSalesItems.php', '2', 'Shows the No Selling (worst) items'); -ALTER TABLE stockmaster ADD lastcategoryupdate DATE NOT NULL DEFAULT '0000-00-00' AFTER categoryid; - UPDATE config SET confvalue='4.08' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-06-10 03:40:06
|
Revision: 5434 http://web-erp.svn.sourceforge.net/web-erp/?rev=5434&view=rev Author: daintree Date: 2012-06-10 03:40:00 +0000 (Sun, 10 Jun 2012) Log Message: ----------- reverse category change field changes Modified Paths: -------------- trunk/Stocks.php trunk/sql/mysql/upgrade4.07-4.08.sql Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2012-06-10 01:08:21 UTC (rev 5433) +++ trunk/Stocks.php 2012-06-10 03:40:00 UTC (rev 5434) @@ -1,6 +1,6 @@ <?php -//* $Id$ */ +/* $Id$ */ include('includes/session.inc'); $title = _('Item Maintenance'); @@ -225,8 +225,7 @@ serialised, materialcost+labourcost+overheadcost AS itemcost, stockcategory.stockact, - stockcategory.wipact, - stockmaster.categoryid + stockcategory.wipact FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid @@ -239,7 +238,6 @@ $UnitCost = $myrow[3]; $OldStockAccount = $myrow[4]; $OldWIPAccount = $myrow[5]; - $OldCategoryId = $myrow[6]; $sql = "SELECT SUM(locstock.quantity) @@ -366,11 +364,8 @@ controlled='" . $_POST['Controlled'] . "', serialised='" . $_POST['Serialised']."', perishable='" . $_POST['Perishable']."', - categoryid='" . $_POST['CategoryID'] . "', "; - if ($OldCategoryId != $_POST['CategoryID']){ - $sql = $sql . "lastcategoryupdate='" . date('Y-m-d') . "', "; - } - $sql = $sql . "units='" . $_POST['Units'] . "', + categoryid='" . $_POST['CategoryID'] . "', + units='" . $_POST['Units'] . "', mbflag='" . $_POST['MBFlag'] . "', eoq='" . filter_number_format($_POST['EOQ']) . "', volume='" . filter_number_format($_POST['Volume']) . "', @@ -512,9 +507,8 @@ DB_Txn_Commit($db); prnMsg( _('Stock Item') . ' ' . $StockID . ' ' . _('has been updated'), 'success'); echo '<br />'; - } + } - } else { //it is a NEW part //but lets be really sure here $result = DB_query("SELECT stockid @@ -528,7 +522,6 @@ description, longdescription, categoryid, - lastcategoryupdate, units, mbflag, eoq, @@ -548,7 +541,6 @@ '" . $_POST['Description'] . "', '" . $_POST['LongDescription'] . "', '" . $_POST['CategoryID'] . "', - '" . date('Y-m-d') . "', '" . $_POST['Units'] . "', '" . $_POST['MBFlag'] . "', '" . filter_number_format($_POST['EOQ']) . "', Modified: trunk/sql/mysql/upgrade4.07-4.08.sql =================================================================== --- trunk/sql/mysql/upgrade4.07-4.08.sql 2012-06-10 01:08:21 UTC (rev 5433) +++ trunk/sql/mysql/upgrade4.07-4.08.sql 2012-06-10 03:40:00 UTC (rev 5434) @@ -122,7 +122,5 @@ INSERT INTO scripts (script, pagesecurity, description) VALUES ('NoSalesItems.php', '2', 'Shows the No Selling (worst) items'); -ALTER TABLE stockmaster ADD lastcategoryupdate DATE NOT NULL DEFAULT '0000-00-00' AFTER categoryid; - UPDATE config SET confvalue='4.08' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-06-16 21:56:46
|
Revision: 5438 http://web-erp.svn.sourceforge.net/web-erp/?rev=5438&view=rev Author: daintree Date: 2012-06-16 21:56:35 +0000 (Sat, 16 Jun 2012) Log Message: ----------- pre 4.08 Modified Paths: -------------- trunk/api/api_xml-rpc.php trunk/build/make_release.sh trunk/doc/Change.log trunk/locale/ar_EG.utf8/LC_MESSAGES/messages.mo trunk/locale/ar_EG.utf8/LC_MESSAGES/messages.po trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/el_GR.utf8/LC_MESSAGES/messages.mo trunk/locale/el_GR.utf8/LC_MESSAGES/messages.po trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/locale/en_US.utf8/LC_MESSAGES/messages.mo trunk/locale/en_US.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/et_EE.utf8/LC_MESSAGES/messages.mo trunk/locale/et_EE.utf8/LC_MESSAGES/messages.po trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.mo trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.po trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.mo trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.mo trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.mo trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.po trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.mo trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.po trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.mo trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.mo trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.po trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.mo trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.po trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.mo trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.po trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.mo trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.mo trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.po trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.mo trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.mo trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2012-06-14 08:05:15 UTC (rev 5437) +++ trunk/api/api_xml-rpc.php 2012-06-16 21:56:35 UTC (rev 5438) @@ -115,8 +115,7 @@ function xmlrpc_InsertBranch($xmlrpcmsg){ ob_start('ob_file_callback'); -/*x*/ if ($xmlrpcmsg->getNumParams() == 3) -/*x*/ { +/*x*/ if ($xmlrpcmsg->getNumParams() == 3) { /*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(InsertBranch(php_xmlrpc_decode($xmlrpcmsg->getParam( 0 )), /*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ), /*x*/ $xmlrpcmsg->getParam( 2 )->scalarval( ))) ); @@ -152,13 +151,12 @@ function xmlrpc_ModifyCustomer($xmlrpcmsg){ ob_start('ob_file_callback'); -/*x*/ if ($xmlrpcmsg->getNumParams() == 3) -/*x*/ { -/*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(ModifyCustomer(php_xmlrpc_decode($xmlrpcmsg->getParam( 0 )), -/*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ), +/*x*/ if ($xmlrpcmsg->getNumParams() == 3) { +/*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(ModifyCustomer(php_xmlrpc_decode($xmlrpcmsg->getParam( 0 )), +/*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ), /*x*/ $xmlrpcmsg->getParam( 2 )->scalarval( ))) ); /*x*/ } else { -/*e*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(ModifyCustomer(php_xmlrpc_decode($xmlrpcmsg->getParam( 0 )), '', ''))); +/*e*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(ModifyCustomer(php_xmlrpc_decode($xmlrpcmsg->getParam( 0 )), '', ''))); /*x*/ } ob_end_flush(); return $rtn; @@ -183,19 +181,18 @@ ._('If the first element is zero then the function was successful. ') ._('Otherwise an array of error codes is returned and no insertion takes place. '); -/*E*/ $ModifyBranch_sig = array(array($xmlrpcStruct,$xmlrpcStruct), +/*E*/$ModifyBranch_sig = array(array($xmlrpcStruct,$xmlrpcStruct), /*x*/ array($xmlrpcStruct,$xmlrpcStruct,$xmlrpcString,$xmlrpcString)); $ModifyBranch_doc = apiBuildDocHTML( $Description,$Parameter,$ReturnValue ); function xmlrpc_ModifyBranch($xmlrpcmsg){ ob_start('ob_file_callback'); -/*x*/ if ($xmlrpcmsg->getNumParams() == 3) -/*x*/ { -/*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(ModifyBranch(php_xmlrpc_decode($xmlrpcmsg->getParam( 0 )), +/*x*/ if ($xmlrpcmsg->getNumParams() == 3) { +/*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(ModifyBranch(php_xmlrpc_decode($xmlrpcmsg->getParam( 0 )), /*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ), /*x*/ $xmlrpcmsg->getParam( 2 )->scalarval( ))) ); /*x*/ } else { -/*e*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(ModifyBranch(php_xmlrpc_decode($xmlrpcmsg->getParam( 0 )), '', ''))); +/*e*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(ModifyBranch(php_xmlrpc_decode($xmlrpcmsg->getParam( 0 )), '', ''))); /*x*/ } ob_end_flush(); return $rtn; @@ -367,7 +364,7 @@ /*x*/ if ($xmlrpcmsg->getNumParams() == 2) { /*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(GetCurrencyList($xmlrpcmsg->getParam( 0 )->scalarval( ), $xmlrpcmsg->getParam( 1 )->scalarval( ))) ); /*x*/ } else { -/*e*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(GetCurrencyList( '', ''))); +/*e*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(GetCurrencyList('',''))); /*x*/ } ob_end_flush(); return $rtn; Modified: trunk/build/make_release.sh =================================================================== --- trunk/build/make_release.sh 2012-06-14 08:05:15 UTC (rev 5437) +++ trunk/build/make_release.sh 2012-06-16 21:56:35 UTC (rev 5438) @@ -37,6 +37,7 @@ msgmerge -U --backup=off locale/tr_TR.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot msgmerge -U --backup=off locale/zh_CN.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot msgmerge -U --backup=off locale/zh_HK.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot +msgmerge -U --backup=off locale/zh_TW.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot msgmerge -U --backup=off locale/vi_VN.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot msgfmt -o locale/ar_EG.utf8/LC_MESSAGES/messages.mo locale/ar_EG.utf8/LC_MESSAGES/messages.po @@ -67,6 +68,7 @@ msgfmt -o locale/tr_TR.utf8/LC_MESSAGES/messages.mo locale/tr_TR.utf8/LC_MESSAGES/messages.po msgfmt -o locale/zh_CN.utf8/LC_MESSAGES/messages.mo locale/zh_CN.utf8/LC_MESSAGES/messages.po msgfmt -o locale/zh_HK.utf8/LC_MESSAGES/messages.mo locale/zh_HK.utf8/LC_MESSAGES/messages.po +msgfmt -o locale/zh_TW.utf8/LC_MESSAGES/messages.mo locale/zh_TW.utf8/LC_MESSAGES/messages.po msgfmt -o locale/vi_VN.utf8/LC_MESSAGES/messages.mo locale/vi_VN.utf8/LC_MESSAGES/messages.po mysql -u$MYSQL_USER -p$MYSQL_PWD < $BASE_DIR/build/TruncateAuditTrail.sql Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-06-14 08:05:15 UTC (rev 5437) +++ trunk/doc/Change.log 2012-06-16 21:56:35 UTC (rev 5438) @@ -1,4 +1,7 @@ webERP Change Log + +15/6/12 Release 4.08 + 02/06/2012 Exson: Fixed the order cancel function failure in SelectOrderItems.php. Reported by Pak Richard. 2/6/12 Phil: Settle counter sales and receipts should be set - now fixed. 28/5/2012 Phil: Configure xmlrpc api to work correctly with utf-8 character encoding. @@ -105,7 +108,6 @@ 7/2/12 Phil: Reworked ReorderLevelLocation.php 7/2/12 Phil: StockTransfers.php if SESSION['Transfer'][0] not set then now initiate a new transfer 7/2/12 Exson: Sent NewTransfer with call from SelectProduct.php to ensure new transfer initiated -6/2/12 Tim: Removed FUD as new API functions seem consistent with the rest of the API</p> 6/2/12 Phil: Added new API function InsertDebtorReceipt in api_debtortransactions.php 4/2/12 Vitaly: Fixed addTextWrap() in class.pdf.php. The length of the string was not calculated properly, causing long strings to print beyond the cell boundaries. 4/2/12 Phil: Added new API function CreateCreditNote in api_debtortransactions.php Modified: trunk/locale/ar_EG.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/ar_EG.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/ar_EG.utf8/LC_MESSAGES/messages.po 2012-06-14 08:05:15 UTC (rev 5437) +++ trunk/locale/ar_EG.utf8/LC_MESSAGES/messages.po 2012-06-16 21:56:35 UTC (rev 5438) @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: web-erp\n" -"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" -"POT-Creation-Date: 2011-01-04 22:15+1200\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-06-16 16:39+1200\n" "PO-Revision-Date: 2012-01-26 10:26+0000\n" "Last-Translator: JC_Chuck <Unknown>\n" "Language-Team: Arabic <ar...@li...>\n" @@ -17,11 +17,11 @@ "X-Launchpad-Export-Date: 2012-03-07 23:01+0000\n" "X-Generator: Launchpad (build 14907)\n" -#: AccountGroups.php:9 index.php:1273 +#: AccountGroups.php:7 includes/MainMenuLinksArray.php:375 msgid "Account Groups" msgstr "مجموعات العضوية" -#: AccountGroups.php:19 +#: AccountGroups.php:17 msgid "" "An error occurred in retrieving the account groups of the parent account " "group during the check for recursion" @@ -29,616 +29,689 @@ "لقد حدث خطأ فى استرجاع بيانات مجموعات العضو الخاصة باعضوية الأب اثناء " "االتحقق من وجود استدعاء ذاتي" -#: AccountGroups.php:20 +#: AccountGroups.php:18 msgid "" "The SQL that was used to retrieve the account groups of the parent account " "group and that failed in the process was" msgstr "" -#: AccountGroups.php:57 AccountGroups.php:94 AccountGroups.php:177 -#: AccountGroups.php:187 +#: AccountGroups.php:58 AccountGroups.php:95 AccountGroups.php:176 +#: AccountGroups.php:186 msgid "The SQL that was used to retrieve the information was" msgstr "الطلب المستخدم لإسترجاع المعلومات كان" -#: AccountGroups.php:58 +#: AccountGroups.php:59 msgid "Could not check whether the group exists because" msgstr "لم يتم التحقق من وجود المجموعة بسبب" -#: AccountGroups.php:65 +#: AccountGroups.php:66 msgid "The account group name already exists in the database" msgstr "اسم المجموعة موجود مسبقاً" -#: AccountGroups.php:71 +#: AccountGroups.php:72 msgid "The account group name cannot contain the character" msgstr "لا يمكن وضع هذا الحرف في اسم المجموعة" -#: AccountGroups.php:71 AccountSections.php:75 PaymentMethods.php:41 -#: TaxCategories.php:33 TaxProvinces.php:32 UnitsOfMeasure.php:32 +#: AccountGroups.php:72 Departments.php:30 TaxCategories.php:31 msgid "or the character" msgstr "او الحرف" -#: AccountGroups.php:77 +#: AccountGroups.php:78 msgid "The account group name must be at least one character long" msgstr "اسم المجموعة يجب ان يحتوي علي الأقل علي حرف واحد" -#: AccountGroups.php:84 +#: AccountGroups.php:85 msgid "" "The parent account group selected appears to result in a recursive account " "structure - select an alternative parent account group or make this group a " "top level account group" msgstr "" -#: AccountGroups.php:95 +#: AccountGroups.php:96 msgid "Could not check whether the group is recursive because" msgstr "لم أستطيع التخقق اذا كانت المجموعة ذاتيى الأسترجاع لأن" -#: AccountGroups.php:107 +#: AccountGroups.php:104 +msgid "" +"Since this account group is a child group, the sequence in the trial " +"balance, the section in the accounts and whether or not the account group " +"appears in the balance sheet or profit and loss account are all properties " +"inherited from the parent account group. Any changes made to these fields " +"will have no effect." +msgstr "" + +#: AccountGroups.php:109 msgid "The section in accounts must be an integer" msgstr "يجب ان يكون القسم فى الحساب عدد صحيح" -#: AccountGroups.php:113 +#: AccountGroups.php:115 msgid "The sequence in the trial balance must be an integer" msgstr "التسلسل فى الحساب التجريبى يجب ان يكون عدد صحيح" -#: AccountGroups.php:119 +#: AccountGroups.php:121 msgid "The sequence in the TB must be numeric and less than" msgstr "" -#: AccountGroups.php:136 +#: AccountGroups.php:137 msgid "An error occurred in updating the account group" msgstr "حدث خطأ اثناء تحديث مجموعة العضو" -#: AccountGroups.php:137 +#: AccountGroups.php:138 msgid "The SQL that was used to update the account group was" msgstr "" -#: AccountGroups.php:139 AccountSections.php:106 PaymentMethods.php:91 +#: AccountGroups.php:140 AccountSections.php:98 PaymentMethods.php:83 msgid "Record Updated" msgstr "تم التحديث" -#: AccountGroups.php:157 +#: AccountGroups.php:156 msgid "An error occurred in inserting the account group" msgstr "حدث خطأ ما اثناء اضافة المجموعة" -#: AccountGroups.php:158 +#: AccountGroups.php:157 msgid "The SQL that was used to insert the account group was" msgstr "الطلب المستخدم لإضافة مجموعة الحسابات هي" -#: AccountGroups.php:159 AccountSections.php:118 PaymentMethods.php:113 +#: AccountGroups.php:158 AccountSections.php:108 msgid "Record inserted" msgstr "تمت الإضافة بنجاح" -#: AccountGroups.php:176 -msgid "" -"An error occurred in retrieving the group information from chartmaster" +#: AccountGroups.php:175 +msgid "An error occurred in retrieving the group information from chartmaster" msgstr "" -#: AccountGroups.php:181 +#: AccountGroups.php:180 msgid "" "Cannot delete this account group because general ledger accounts have been " "created using this group" msgstr "" -#: AccountGroups.php:182 AccountGroups.php:192 AccountSections.php:139 -#: Areas.php:117 Areas.php:126 BankAccounts.php:163 CreditStatus.php:126 -#: Currencies.php:144 Currencies.php:152 Currencies.php:159 -#: CustomerBranches.php:296 CustomerBranches.php:306 CustomerBranches.php:316 -#: CustomerBranches.php:326 Customers.php:317 Customers.php:326 -#: Customers.php:334 Customers.php:342 CustomerTypes.php:149 -#: CustomerTypes.php:159 Factors.php:136 FixedAssetCategories.php:132 -#: GLAccounts.php:95 GLAccounts.php:109 Locations.php:247 Locations.php:255 -#: Locations.php:264 Locations.php:272 Locations.php:280 Locations.php:288 -#: Locations.php:296 Locations.php:304 MRPDemandTypes.php:89 -#: PaymentMethods.php:146 PaymentTerms.php:147 PaymentTerms.php:154 -#: PcExpenses.php:119 SalesCategories.php:127 SalesCategories.php:135 -#: SalesPeople.php:144 SalesPeople.php:151 SalesTypes.php:147 -#: SalesTypes.php:157 Shippers.php:82 Shippers.php:94 StockCategories.php:182 -#: Stocks.php:471 Stocks.php:480 Stocks.php:488 Stocks.php:496 Stocks.php:504 -#: Stocks.php:512 Suppliers.php:613 Suppliers.php:622 Suppliers.php:630 -#: SupplierTypes.php:147 TaxCategories.php:133 TaxGroups.php:128 -#: TaxGroups.php:135 TaxProvinces.php:127 UnitsOfMeasure.php:142 -#: UnitsOfMeasure.php:149 WorkCentres.php:90 WorkCentres.php:96 -#: WWW_Access.php:87 +#: AccountGroups.php:181 AccountGroups.php:191 AccountSections.php:130 +#: Areas.php:114 Areas.php:123 BankAccounts.php:158 CreditStatus.php:125 +#: Currencies.php:166 Currencies.php:174 Currencies.php:182 +#: CustomerBranches.php:286 CustomerBranches.php:296 CustomerBranches.php:306 +#: CustomerBranches.php:316 Customers.php:289 Customers.php:298 +#: Customers.php:306 Customers.php:314 CustomerTypes.php:147 +#: CustomerTypes.php:157 Departments.php:141 Factors.php:134 +#: FixedAssetCategories.php:134 GLAccounts.php:80 GLAccounts.php:96 +#: Locations.php:237 Locations.php:245 Locations.php:256 Locations.php:265 +#: Locations.php:274 Locations.php:283 Locations.php:292 Locations.php:301 +#: Locations.php:309 MRPDemandTypes.php:87 PaymentMethods.php:142 +#: PaymentTerms.php:146 PaymentTerms.php:153 PcExpenses.php:158 +#: SalesCategories.php:125 SalesCategories.php:132 SalesPeople.php:150 +#: SalesPeople.php:157 SalesPeople.php:163 SalesTypes.php:140 +#: SalesTypes.php:150 Shippers.php:81 Shippers.php:93 StockCategories.php:187 +#: Stocks.php:653 Stocks.php:662 Stocks.php:670 Stocks.php:678 Stocks.php:686 +#: Stocks.php:694 Suppliers.php:612 Suppliers.php:621 Suppliers.php:629 +#: SupplierTypes.php:145 TaxCategories.php:131 TaxGroups.php:132 +#: TaxGroups.php:140 TaxProvinces.php:129 UnitsOfMeasure.php:135 +#: WorkCentres.php:89 WorkCentres.php:95 WWW_Access.php:83 msgid "There are" msgstr "يوجد" -#: AccountGroups.php:182 +#: AccountGroups.php:181 msgid "general ledger accounts that refer to this account group" msgstr "" -#: AccountGroups.php:186 +#: AccountGroups.php:185 msgid "An error occurred in retrieving the parent group information" msgstr "" -#: AccountGroups.php:191 +#: AccountGroups.php:190 msgid "" "Cannot delete this account group because it is a parent account group of " "other account group(s)" msgstr "" -#: AccountGroups.php:192 +#: AccountGroups.php:191 msgid "account groups that have this group as its/there parent account group" msgstr "" -#: AccountGroups.php:195 +#: AccountGroups.php:194 msgid "An error occurred in deleting the account group" msgstr "حدث خطأ ما اثناء حذف مجموعة الحسابات" -#: AccountGroups.php:196 +#: AccountGroups.php:195 msgid "The SQL that was used to delete the account group was" msgstr "" -#: AccountGroups.php:198 +#: AccountGroups.php:197 msgid "group has been deleted" msgstr "تم حذف المجموعة" -#: AccountGroups.php:223 +#: AccountGroups.php:222 msgid "The sql that was used to retrieve the account group information was " msgstr "" -#: AccountGroups.php:224 +#: AccountGroups.php:223 msgid "Could not get account groups because" msgstr "لم يتمكن الحصول على مجموات العضو لان" -#: AccountGroups.php:226 AccountSections.php:177 AddCustomerContacts.php:25 -#: AddCustomerContacts.php:28 AddCustomerNotes.php:97 -#: AddCustomerTypeNotes.php:94 AgedDebtors.php:468 AgedSuppliers.php:277 -#: Areas.php:145 AuditTrail.php:13 BOMExtendedQty.php:286 BOMIndented.php:262 -#: BOMIndentedReverse.php:257 BOMInquiry.php:165 BOMListing.php:128 -#: BOMs.php:214 BOMs.php:793 COGSGLPostings.php:20 CompanyPreferences.php:158 -#: CounterSales.php:1940 CounterSales.php:2062 Credit_Invoice.php:257 -#: CreditStatus.php:21 Currencies.php:29 CustEDISetup.php:19 -#: DailyBankTransactions.php:9 DebtorsAtPeriodEnd.php:138 -#: DiscountCategories.php:12 DiscountCategories.php:122 DiscountMatrix.php:18 -#: EDIMessageFormat.php:106 FixedAssetList.php:8 FixedAssetLocations.php:9 -#: FixedAssetRegister.php:13 FixedAssetRegister.php:232 -#: FixedAssetTransfer.php:31 FormDesigner.php:132 GLBalanceSheet.php:351 -#: GLBudgets.php:30 GLJournal.php:243 InventoryPlanning.php:369 -#: InventoryPlanningPrefSupplier.php:474 Labels.php:117 Labels.php:273 -#: MRPReport.php:536 OutstandingGRNs.php:174 PcAssignCashToTab.php:39 -#: PcAssignCashToTab.php:113 PcAssignCashToTab.php:129 -#: PcAssignCashToTab.php:165 PDFPickingList.php:30 PDFPrintLabel.php:132 -#: PDFStockLocTransfer.php:21 PO_AuthorisationLevels.php:12 POReport.php:61 -#: POReport.php:65 POReport.php:69 PO_SelectOSPurchOrder.php:136 -#: PricesBasedOnMarkUp.php:11 Prices_Customer.php:45 Prices.php:32 -#: PurchData.php:141 PurchData.php:231 PurchData.php:250 -#: RecurringSalesOrders.php:307 SalesAnalReptCols.php:51 SalesAnalRepts.php:13 -#: SalesCategories.php:13 SalesGLPostings.php:18 SalesGraph.php:34 -#: SalesPeople.php:22 SalesTypes.php:22 SelectAsset.php:44 -#: SelectCompletedOrder.php:13 SelectContract.php:81 SelectCreditItems.php:204 -#: SelectCreditItems.php:272 SelectCustomer.php:315 SelectGLAccount.php:19 -#: SelectGLAccount.php:79 SelectOrderItems.php:605 SelectOrderItems.php:1436 -#: SelectOrderItems.php:1556 SelectProduct.php:456 SelectSalesOrder.php:155 -#: SelectSupplier.php:9 SelectSupplier.php:198 SelectWorkOrder.php:11 -#: SelectWorkOrder.php:147 ShipmentCosting.php:13 Shipments.php:18 -#: Shippers.php:123 Shippers.php:159 Shipt_Select.php:10 -#: StockLocMovements.php:15 StockLocStatus.php:27 Suppliers.php:306 -#: SupplierTenders.php:261 SupplierTenders.php:318 SupplierTransInquiry.php:11 -#: TaxGroups.php:16 TaxProvinces.php:12 TopItems.php:60 -#: WhereUsedInquiry.php:18 WorkCentres.php:111 WorkCentres.php:158 -#: WorkOrderCosting.php:14 WorkOrderEntry.php:12 WorkOrderIssue.php:22 -#: WorkOrderReceive.php:15 WorkOrderStatus.php:43 WWW_Access.php:13 -#: WWW_Users.php:38 Z_BottomUpCosts.php:51 +#: AccountGroups.php:225 AccountSections.php:169 AddCustomerContacts.php:25 +#: AddCustomerContacts.php:27 AddCustomerNotes.php:101 +#: AddCustomerTypeNotes.php:94 AgedDebtors.php:444 AgedSuppliers.php:276 +#: Areas.php:143 AuditTrail.php:11 BankReconciliation.php:14 +#: BOMExtendedQty.php:250 BOMIndented.php:246 BOMIndentedReverse.php:235 +#: BOMInquiry.php:187 BOMListing.php:109 BOMs.php:231 BOMs.php:858 +#: COGSGLPostings.php:18 CompanyPreferences.php:153 CounterSales.php:2037 +#: CounterSales.php:2163 Credit_Invoice.php:255 CreditStatus.php:21 +#: Currencies.php:28 CustEDISetup.php:17 DailyBankTransactions.php:11 +#: DebtorsAtPeriodEnd.php:125 DiscountCategories.php:10 +#: DiscountCategories.php:134 DiscountMatrix.php:16 EDIMessageFormat.php:105 +#: FixedAssetLocations.php:9 FixedAssetRegister.php:13 +#: FixedAssetRegister.php:249 FixedAssetTransfer.php:32 FormDesigner.php:129 +#: GLBalanceSheet.php:378 GLBudgets.php:29 GLJournal.php:247 +#: InternalStockRequest.php:281 InventoryPlanning.php:374 +#: InventoryPlanningPrefSupplier.php:467 MRPReport.php:516 NoSalesItems.php:93 +#: OutstandingGRNs.php:163 PcAssignCashToTab.php:56 PcAssignCashToTab.php:130 +#: PcAssignCashToTab.php:146 PcAssignCashToTab.php:190 PDFPickingList.php:28 +#: PDFStockLocTransfer.php:16 PO_AuthorisationLevels.php:10 POReport.php:60 +#: POReport.php:64 POReport.php:68 PO_SelectOSPurchOrder.php:140 +#: PricesBasedOnMarkUp.php:8 Prices_Customer.php:35 Prices.php:30 +#: PurchData.php:152 PurchData.php:286 PurchData.php:312 +#: RecurringSalesOrders.php:309 SalesAnalReptCols.php:51 SalesAnalRepts.php:11 +#: SalesCategories.php:11 SalesGLPostings.php:17 SalesGraph.php:35 +#: SalesPeople.php:20 SalesTypes.php:20 SelectAsset.php:46 +#: SelectCompletedOrder.php:11 SelectContract.php:65 SelectCreditItems.php:216 +#: SelectCreditItems.php:287 SelectCustomer.php:263 SelectGLAccount.php:17 +#: SelectGLAccount.php:87 SelectOrderItems.php:586 SelectOrderItems.php:1498 +#: SelectOrderItems.php:1620 SelectProduct.php:505 SelectSalesOrder.php:534 +#: SelectSupplier.php:9 SelectSupplier.php:199 SelectWorkOrder.php:9 +#: SelectWorkOrder.php:152 ShipmentCosting.php:11 Shipments.php:17 +#: Shippers.php:123 Shippers.php:160 Shipt_Select.php:8 +#: StockLocMovements.php:14 StockLocStatus.php:28 +#: StockSerialItemResearch.php:30 SupplierPriceList.php:15 +#: SupplierPriceList.php:214 SupplierPriceList.php:384 +#: SupplierPriceList.php:388 SupplierPriceList.php:439 +#: SupplierPriceList.php:489 Suppliers.php:302 SupplierTenderCreate.php:522 +#: SupplierTenderCreate.php:628 SupplierTenders.php:322 +#: SupplierTenders.php:388 SupplierTransInquiry.php:10 TaxGroups.php:15 +#: TaxProvinces.php:11 TopItems.php:114 WhereUsedInquiry.php:18 +#: WorkCentres.php:111 WorkCentres.php:162 WorkOrderCosting.php:13 +#: WorkOrderEntry.php:11 WorkOrderIssue.php:22 WorkOrderReceive.php:17 +#: WorkOrderStatus.php:42 WWW_Access.php:11 WWW_Users.php:33 +#: Z_BottomUpCosts.php:57 msgid "Search" msgstr "إبحث" -#: AccountGroups.php:230 +#: AccountGroups.php:229 msgid "Group Name" msgstr "إسم المجموعة" -#: AccountGroups.php:231 EDIMessageFormat.php:131 +#: AccountGroups.php:230 EDIMessageFormat.php:129 EDIMessageFormat.php:208 msgid "Section" msgstr "قسم" -#: AccountGroups.php:232 AccountGroups.php:396 +#: AccountGroups.php:231 AccountGroups.php:410 msgid "Sequence In TB" msgstr "" -#: AccountGroups.php:233 AccountGroups.php:380 GLProfit_Loss.php:8 -#: GLProfit_Loss.php:105 GLProfit_Loss.php:106 GLProfit_Loss.php:157 -#: SelectGLAccount.php:45 SelectGLAccount.php:59 +#: AccountGroups.php:232 AccountGroups.php:393 GLProfit_Loss.php:6 +#: GLProfit_Loss.php:126 GLProfit_Loss.php:127 GLProfit_Loss.php:178 +#: SelectGLAccount.php:40 SelectGLAccount.php:54 SelectGLAccount.php:68 msgid "Profit and Loss" msgstr "" -#: AccountGroups.php:234 AccountGroups.php:341 +#: AccountGroups.php:233 AccountGroups.php:354 msgid "Parent Group" msgstr "" -#: AccountGroups.php:250 AccountGroups.php:253 AccountGroups.php:384 -#: AccountGroups.php:386 BankAccounts.php:217 BankAccounts.php:361 -#: BankAccounts.php:363 BankAccounts.php:367 BOMs.php:128 BOMs.php:713 -#: BOMs.php:715 CompanyPreferences.php:439 CompanyPreferences.php:441 -#: CompanyPreferences.php:451 CompanyPreferences.php:453 -#: CompanyPreferences.php:463 CompanyPreferences.php:465 -#: ContractCosting.php:174 CustLoginSetup.php:590 CustLoginSetup.php:592 -#: CustomerBranches.php:420 Customers.php:600 Customers.php:857 -#: Customers.php:864 Customers.php:867 DeliveryDetails.php:1034 -#: DeliveryDetails.php:1074 DeliveryDetails.php:1077 GLTransInquiry.php:73 -#: Locations.php:373 MRPCalendar.php:222 MRP.php:530 MRP.php:534 MRP.php:538 -#: MRP.php:542 PaymentMethods.php:203 PaymentMethods.php:204 -#: PaymentMethods.php:264 PaymentMethods.php:270 PDFChequeListing.php:63 -#: PDFDeliveryDifferences.php:64 PDFDIFOT.php:67 -#: PO_AuthorisationLevels.php:132 PO_AuthorisationLevels.php:137 -#: PO_Header.php:758 PO_PDFPurchOrder.php:367 PO_PDFPurchOrder.php:370 -#: PurchData.php:189 PurchData.php:469 PurchData.php:472 -#: RecurringSalesOrders.php:479 RecurringSalesOrders.php:482 -#: SalesAnalReptCols.php:279 SalesAnalReptCols.php:401 -#: SalesAnalReptCols.php:404 SalesAnalRepts.php:406 SalesAnalRepts.php:409 -#: SalesAnalRepts.php:432 SalesAnalRepts.php:435 SalesAnalRepts.php:458 -#: SalesAnalRepts.php:461 SelectProduct.php:351 ShipmentCosting.php:622 -#: Stocks.php:867 Stocks.php:869 Stocks.php:887 Stocks.php:889 -#: SuppContractChgs.php:83 SuppLoginSetup.php:511 SuppLoginSetup.php:513 -#: SystemParameters.php:373 SystemParameters.php:405 SystemParameters.php:450 -#: SystemParameters.php:468 SystemParameters.php:476 SystemParameters.php:516 -#: SystemParameters.php:589 SystemParameters.php:597 SystemParameters.php:615 -#: SystemParameters.php:622 SystemParameters.php:746 SystemParameters.php:877 -#: SystemParameters.php:879 SystemParameters.php:889 SystemParameters.php:891 -#: SystemParameters.php:945 SystemParameters.php:957 SystemParameters.php:959 -#: TaxGroups.php:292 TaxGroups.php:295 TaxGroups.php:344 WWW_Users.php:610 -#: WWW_Users.php:612 +#: AccountGroups.php:249 AccountGroups.php:252 AccountGroups.php:397 +#: AccountGroups.php:399 BOMs.php:124 BOMs.php:772 BOMs.php:774 +#: CompanyPreferences.php:477 CompanyPreferences.php:479 +#: CompanyPreferences.php:492 CompanyPreferences.php:494 +#: CompanyPreferences.php:507 CompanyPreferences.php:509 +#: ContractCosting.php:198 CustomerBranches.php:411 Customers.php:594 +#: Customers.php:947 Customers.php:956 Customers.php:959 +#: DeliveryDetails.php:1082 DeliveryDetails.php:1125 DeliveryDetails.php:1128 +#: GLTransInquiry.php:69 Labels.php:491 Labels.php:493 Labels.php:518 +#: MRPCalendar.php:224 MRP.php:529 MRP.php:533 MRP.php:537 MRP.php:541 +#: PaymentMethods.php:204 PaymentMethods.php:205 PaymentMethods.php:206 +#: PaymentMethods.php:207 PaymentMethods.php:273 PaymentMethods.php:280 +#: PaymentMethods.php:287 PaymentMethods.php:294 PcAuthorizeExpenses.php:243 +#: PDFChequeListing.php:63 PDFDeliveryDifferences.php:76 PDFDIFOT.php:76 +#: PO_AuthorisationLevels.php:134 PO_AuthorisationLevels.php:139 +#: PO_Header.php:792 PO_PDFPurchOrder.php:392 PO_PDFPurchOrder.php:395 +#: PurchData.php:212 PurchData.php:554 PurchData.php:557 +#: RecurringSalesOrders.php:482 RecurringSalesOrders.php:485 +#: SalesAnalReptCols.php:284 SalesAnalReptCols.php:419 +#: SalesAnalReptCols.php:422 SalesAnalRepts.php:417 SalesAnalRepts.php:420 +#: SalesAnalRepts.php:445 SalesAnalRepts.php:448 SalesAnalRepts.php:473 +#: SalesAnalRepts.php:476 SalesPeople.php:219 SalesPeople.php:356 +#: SalesPeople.php:358 SelectProduct.php:385 ShipmentCosting.php:667 +#: Stocks.php:1051 Stocks.php:1053 Stocks.php:1076 Stocks.php:1078 +#: SuppContractChgs.php:90 SystemParameters.php:401 SystemParameters.php:424 +#: SystemParameters.php:440 SystemParameters.php:503 SystemParameters.php:511 +#: SystemParameters.php:551 SystemParameters.php:631 SystemParameters.php:640 +#: SystemParameters.php:648 SystemParameters.php:666 SystemParameters.php:673 +#: SystemParameters.php:717 SystemParameters.php:813 SystemParameters.php:948 +#: SystemParameters.php:950 SystemParameters.php:960 SystemParameters.php:962 +#: SystemParameters.php:1016 SystemParameters.php:1028 +#: SystemParameters.php:1030 TaxGroups.php:311 TaxGroups.php:314 +#: TaxGroups.php:371 WWW_Users.php:484 WWW_Users.php:486 WWW_Users.php:657 +#: WWW_Users.php:659 msgid "Yes" msgstr "موافق" -#: AccountGroups.php:256 AccountGroups.php:389 AccountGroups.php:391 -#: BankAccounts.php:215 BankAccounts.php:361 BankAccounts.php:363 -#: BankAccounts.php:367 BOMs.php:130 BOMs.php:712 BOMs.php:716 -#: CompanyPreferences.php:438 CompanyPreferences.php:442 -#: CompanyPreferences.php:450 CompanyPreferences.php:454 -#: CompanyPreferences.php:462 CompanyPreferences.php:466 -#: ContractCosting.php:172 CustLoginSetup.php:589 CustLoginSetup.php:593 -#: CustomerBranches.php:420 Customers.php:599 Customers.php:855 -#: Customers.php:863 Customers.php:866 DeliveryDetails.php:1035 -#: DeliveryDetails.php:1075 DeliveryDetails.php:1078 GLTransInquiry.php:127 -#: Locations.php:375 MRPCalendar.php:224 MRP.php:528 MRP.php:532 MRP.php:536 -#: MRP.php:540 PaymentMethods.php:203 PaymentMethods.php:204 -#: PaymentMethods.php:265 PaymentMethods.php:271 PDFChequeListing.php:62 -#: PDFDeliveryDifferences.php:63 PDFDIFOT.php:66 -#: PO_AuthorisationLevels.php:134 PO_AuthorisationLevels.php:139 -#: PO_Header.php:757 PO_PDFPurchOrder.php:368 PO_PDFPurchOrder.php:371 -#: PurchData.php:192 PurchData.php:470 PurchData.php:473 -#: RecurringSalesOrders.php:478 RecurringSalesOrders.php:481 -#: SalesAnalReptCols.php:277 SalesAnalReptCols.php:402 -#: SalesAnalReptCols.php:405 SalesAnalRepts.php:405 SalesAnalRepts.php:408 -#: SalesAnalRepts.php:431 SalesAnalRepts.php:434 SalesAnalRepts.php:457 -#: SalesAnalRepts.php:460 SelectProduct.php:353 ShipmentCosting.php:623 -#: Stocks.php:862 Stocks.php:864 Stocks.php:882 Stocks.php:884 -#: SuppContractChgs.php:85 SuppLoginSetup.php:510 SuppLoginSetup.php:514 -#: SystemParameters.php:374 SystemParameters.php:406 SystemParameters.php:451 -#: SystemParameters.php:469 SystemParameters.php:477 SystemParameters.php:517 -#: SystemParameters.php:590 SystemParameters.php:598 SystemParameters.php:616 -#: SystemParameters.php:623 SystemParameters.php:747 SystemParameters.php:876 -#: SystemParameters.php:880 SystemParameters.php:888 SystemParameters.php:892 -#: SystemParameters.php:946 SystemParameters.php:956 SystemParameters.php:960 -#: TaxGroups.php:293 TaxGroups.php:296 TaxGroups.php:346 WWW_Users.php:609 -#: WWW_Users.php:613 includes/PDFLowGPPageHeader.inc:44 +#: AccountGroups.php:255 AccountGroups.php:402 AccountGroups.php:404 +#: BankAccounts.php:209 BankAccounts.php:378 BankAccounts.php:380 +#: BankAccounts.php:384 BankAccounts.php:392 BOMs.php:126 BOMs.php:771 +#: BOMs.php:775 CompanyPreferences.php:476 CompanyPreferences.php:480 +#: CompanyPreferences.php:491 CompanyPreferences.php:495 +#: CompanyPreferences.php:506 CompanyPreferences.php:510 +#: ContractCosting.php:196 CustomerBranches.php:411 Customers.php:593 +#: Customers.php:942 Customers.php:955 Customers.php:958 +#: DeliveryDetails.php:1083 DeliveryDetails.php:1126 DeliveryDetails.php:1129 +#: GLTransInquiry.php:86 Labels.php:490 Labels.php:494 Labels.php:519 +#: MRPCalendar.php:226 MRP.php:527 MRP.php:531 MRP.php:535 MRP.php:539 +#: NoSalesItems.php:153 PaymentMethods.php:204 PaymentMethods.php:205 +#: PaymentMethods.php:206 PaymentMethods.php:207 PaymentMethods.php:274 +#: PaymentMethods.php:281 PaymentMethods.php:288 PaymentMethods.php:295 +#: PcAuthorizeExpenses.php:241 PDFChequeListing.php:62 +#: PDFDeliveryDifferences.php:75 PDFDIFOT.php:75 +#: PO_AuthorisationLevels.php:136 PO_AuthorisationLevels.php:141 +#: PO_Header.php:791 PO_PDFPurchOrder.php:393 PO_PDFPurchOrder.php:396 +#: PurchData.php:215 PurchData.php:555 PurchData.php:558 +#: RecurringSalesOrders.php:481 RecurringSalesOrders.php:484 +#: SalesAnalReptCols.php:282 SalesAnalReptCols.php:420 +#: SalesAnalReptCols.php:423 SalesAnalRepts.php:416 SalesAnalRepts.php:419 +#: SalesAnalRepts.php:444 SalesAnalRepts.php:447 SalesAnalRepts.php:472 +#: SalesAnalRepts.php:475 SalesPeople.php:221 SalesPeople.php:361 +#: SalesPeople.php:363 SelectProduct.php:387 ShipmentCosting.php:668 +#: Stocks.php:1046 Stocks.php:1048 Stocks.php:1071 Stocks.php:1073 +#: SuppContractChgs.php:92 SystemParameters.php:402 SystemParameters.php:425 +#: SystemParameters.php:441 SystemParameters.php:504 SystemParameters.php:512 +#: SystemParameters.php:552 SystemParameters.php:632 SystemParameters.php:641 +#: SystemParameters.php:649 SystemParameters.php:667 SystemParameters.php:674 +#: SystemParameters.php:718 SystemParameters.php:814 SystemParameters.php:947 +#: SystemParameters.php:951 SystemParameters.php:959 SystemParameters.php:963 +#: SystemParameters.php:1017 SystemParameters.php:1027 +#: SystemParameters.php:1031 TaxGroups.php:312 TaxGroups.php:315 +#: TaxGroups.php:373 WWW_Users.php:483 WWW_Users.php:487 WWW_Users.php:656 +#: WWW_Users.php:660 includes/PDFLowGPPageHeader.inc:44 #: includes/PDFTaxPageHeader.inc:35 msgid "No" msgstr "ﻻ" -#: AccountGroups.php:265 AccountSections.php:197 AddCustomerContacts.php:131 -#: AddCustomerNotes.php:125 AddCustomerTypeNotes.php:123 Areas.php:165 -#: BankAccounts.php:226 BOMs.php:150 COGSGLPostings.php:113 -#: COGSGLPostings.php:218 CreditStatus.php:175 Currencies.php:239 -#: CustLoginSetup.php:312 CustomerBranches.php:424 Customers.php:909 -#: Customers.php:941 CustomerTypes.php:205 EDIMessageFormat.php:152 -#: Factors.php:208 FixedAssetCategories.php:182 FixedAssetLocations.php:102 -#: FreightCosts.php:243 GeocodeSetup.php:169 GLAccounts.php:319 GLTags.php:62 -#: Labels.php:414 Locations.php:382 MRPDemands.php:304 MRPDemandTypes.php:122 -#: PaymentMethods.php:205 PaymentTerms.php:203 PcAssignCashToTab.php:251 -#: PcClaimExpensesFromTab.php:229 PcExpenses.php:176 PcTabs.php:188 -#: PcTypeTabs.php:171 PO_AuthorisationLevels.php:148 Prices_Customer.php:283 -#: Prices.php:227 PurchData.php:202 SalesCategories.php:263 -#: SalesGLPostings.php:135 SalesGLPostings.php:247 SalesPeople.php:210 -#: SalesTypes.php:206 SelectCustomer.php:607 SelectCustomer.php:623 -#: SelectCustomer.php:645 SelectCustomer.php:661 SelectCustomer.php:683 -#: SelectCustomer.php:699 Shippers.php:144 StockCategories.php:244 -#: SupplierContacts.php:156 SupplierTypes.php:192 SuppLoginSetup.php:274 -#: TaxAuthorities.php:173 TaxCategories.php:184 TaxGroups.php:179 -#: TaxProvinces.php:178 UnitsOfMeasure.php:201 WorkCentres.php:138 -#: WWW_Access.php:127 WWW_Users.php:312 includes/InputSerialItems.php:88 +#: AccountGroups.php:264 AccountSections.php:189 AddCustomerContacts.php:148 +#: AddCustomerNotes.php:137 AddCustomerTypeNotes.php:131 Areas.php:163 +#: BankAccounts.php:222 BOMs.php:151 COGSGLPostings.php:108 +#: COGSGLPostings.php:206 CreditStatus.php:175 Currencies.php:272 +#: CustomerBranches.php:415 Customers.php:1033 Customers.php:1067 +#: CustomerTypes.php:206 Departments.php:186 EDIMessageFormat.php:150 +#: Factors.php:334 FixedAssetCategories.php:187 FixedAssetLocations.php:107 +#: FreightCosts.php:242 GeocodeSetup.php:173 GLAccounts.php:312 GLTags.php:93 +#: InternalStockRequest.php:263 Labels.php:223 Labels.php:248 +#: Locations.php:391 MRPDemands.php:309 MRPDemandTypes.php:120 +#: PaymentMethods.php:208 PaymentTerms.php:205 PcAssignCashToTab.php:273 +#: PcClaimExpensesFromTab.php:265 PcExpenses.php:223 PcTabs.php:233 +#: PcTypeTabs.php:174 PO_AuthorisationLevels.php:151 Prices_Customer.php:278 +#: Prices.php:249 PurchData.php:227 SalesCategories.php:256 +#: SalesGLPostings.php:132 SalesGLPostings.php:245 SalesPeople.php:232 +#: SalesTypes.php:206 SecurityTokens.php:130 SelectCustomer.php:615 +#: SelectCustomer.php:633 SelectCustomer.php:656 SelectCustomer.php:673 +#: SelectCustomer.php:696 SelectCustomer.php:713 Shippers.php:144 +#: StockCategories.php:263 SupplierContacts.php:163 +#: SupplierTenderCreate.php:145 SupplierTypes.php:189 +#: SuppTransGLAnalysis.php:120 TaxAuthorities.php:174 TaxCategories.php:182 +#: TaxGroups.php:188 TaxProvinces.php:180 UnitsOfMeasure.php:185 +#: WorkCentres.php:141 WWW_Access.php:123 WWW_Users.php:325 +#: includes/InputSerialItems.php:90 includes/OutputSerialItems.php:20 #, php-format msgid "Edit" msgstr "تحرير" -#: AccountGroups.php:266 AccountSections.php:201 AddCustomerContacts.php:132 -#: AddCustomerNotes.php:126 AddCustomerTypeNotes.php:124 Areas.php:166 -#: BankAccounts.php:227 BOMs.php:152 COGSGLPostings.php:114 -#: COGSGLPostings.php:219 ContractBOM.php:272 ContractOtherReqts.php:121 -#: CounterSales.php:741 Credit_Invoice.php:386 CreditStatus.php:176 -#: Currencies.php:242 CustLoginSetup.php:313 CustomerReceipt.php:866 -#: Customers.php:942 CustomerTypes.php:206 DiscountCategories.php:204 -#: DiscountMatrix.php:178 EDIMessageFormat.php:153 -#: FixedAssetCategories.php:183 FreightCosts.php:244 GeocodeSetup.php:170 -#: GLAccounts.php:320 GLJournal.php:403 Labels.php:414 Locations.php:383 -#: MRPDemands.php:305 MRPDemandTypes.php:123 PaymentMethods.php:206 -#: Payments.php:961 PaymentTerms.php:204 PcAssignCashToTab.php:255 -#: PcClaimExpensesFromTab.php:230 PcExpenses.php:177 PcExpensesTypeTab.php:161 -#: PcTabs.php:189 PcTypeTabs.php:172 PO_AuthorisationLevels.php:150 -#: PO_Items.php:976 Prices_Customer.php:284 Prices.php:228 PurchData.php:203 -#: SalesAnalReptCols.php:294 SalesAnalRepts.php:305 SalesCategories.php:264 -#: SalesGLPostings.php:136 SalesGLPostings.php:248 SalesPeople.php:211 -#: SalesTypes.php:207 SelectCreditItems.php:747 SelectCustomer.php:608 -#: SelectCustomer.php:624 SelectCustomer.php:646 SelectCustomer.php:662 -#: SelectCustomer.php:684 SelectCustomer.php:700 SelectOrderItems.php:1363 -#: Shipments.php:424 Shippers.php:145 SpecialOrder.php:590 -#: StockCategories.php:245 StockCategories.php:539 SuppContractChgs.php:91 -#: SuppCreditGRNs.php:93 SuppFixedAssetChgs.php:87 SuppInvGRNs.php:135 -#: SupplierContacts.php:157 SupplierTypes.php:194 SuppLoginSetup.php:275 -#: SuppShiptChgs.php:86 SuppTransGLAnalysis.php:111 TaxAuthorities.php:174 -#: TaxCategories.php:185 TaxGroups.php:180 TaxProvinces.php:179 -#: UnitsOfMeasure.php:202 WorkCentres.php:139 WOSerialNos.php:300 -#: WWW_Access.php:128 WWW_Users.php:313 includes/InputSerialItemsKeyed.php:54 +#: AccountGroups.php:265 +#, fuzzy +msgid "Are you sure you wish to delete this account group?" +msgstr "حدث خطأ ما اثناء حذف مجموعة الحسابات" + +#: AccountGroups.php:265 AccountSections.php:193 AddCustomerContacts.php:149 +#: AddCustomerNotes.php:138 AddCustomerTypeNotes.php:132 Areas.php:164 +#: BankAccounts.php:223 BOMs.php:153 COGSGLPostings.php:109 +#: COGSGLPostings.php:207 ContractBOM.php:267 ContractOtherReqts.php:120 +#: CounterSales.php:830 Credit_Invoice.php:401 CreditStatus.php:176 +#: Currencies.php:275 CustomerReceipt.php:925 Customers.php:1068 +#: CustomerTypes.php:207 Departments.php:187 DiscountCategories.php:223 +#: DiscountMatrix.php:183 EDIMessageFormat.php:151 +#: FixedAssetCategories.php:188 FreightCosts.php:243 GeocodeSetup.php:174 +#: GLAccounts.php:313 GLJournal.php:426 GLTags.php:94 +#: InternalStockRequest.php:264 Labels.php:224 Labels.php:249 Labels.php:497 +#: Locations.php:392 MRPDemands.php:310 MRPDemandTypes.php:121 +#: PaymentMethods.php:209 Payments.php:1083 PaymentTerms.php:206 +#: PcAssignCashToTab.php:277 PcClaimExpensesFromTab.php:266 PcExpenses.php:224 +#: PcExpensesTypeTab.php:187 PcTabs.php:234 PcTypeTabs.php:175 +#: PO_AuthorisationLevels.php:153 PO_Items.php:712 Prices_Customer.php:279 +#: Prices.php:250 PurchData.php:229 SalesAnalReptCols.php:299 +#: SalesAnalRepts.php:304 SalesCategories.php:257 SalesGLPostings.php:133 +#: SalesGLPostings.php:246 SalesPeople.php:233 SalesTypes.php:207 +#: SecurityTokens.php:131 SelectCreditItems.php:767 SelectCustomer.php:616 +#: SelectCustomer.php:634 SelectCustomer.php:657 SelectCustomer.php:674 +#: SelectCustomer.php:697 SelectCustomer.php:714 SelectOrderItems.php:1417 +#: Shipments.php:440 Shippers.php:145 SpecialOrder.php:667 +#: StockCategories.php:264 StockCategories.php:586 StockLocTransfer.php:332 +#: SuppContractChgs.php:99 SuppCreditGRNs.php:112 SuppFixedAssetChgs.php:87 +#: SuppInvGRNs.php:147 SupplierContacts.php:164 SupplierTenderCreate.php:401 +#: SupplierTenderCreate.php:429 SupplierTypes.php:191 SuppShiptChgs.php:90 +#: SuppTransGLAnalysis.php:121 TaxAuthorities.php:175 TaxCategories.php:183 +#: TaxGroups.php:189 TaxProvinces.php:181 UnitsOfMeasure.php:186 +#: WorkCentres.php:142 WOSerialNos.php:321 WWW_Access.php:124 +#: WWW_Users.php:326 includes/InputSerialItemsKeyed.php:58 +#: includes/OutputSerialItems.php:99 #, php-format msgid "Delete" msgstr "حذف" -#: AccountGroups.php:274 +#: AccountGroups.php:273 msgid "Review Account Groups" msgstr "" -#: AccountGroups.php:294 +#: AccountGroups.php:293 msgid "An error occurred in retrieving the account group information" msgstr "" -#: AccountGroups.php:295 +#: AccountGroups.php:294 msgid "" "The SQL that was used to retrieve the account group and that failed in the " "process was" msgstr "" -#: AccountGroups.php:298 +#: AccountGroups.php:297 msgid "The account group name does not exist in the database" msgstr "" -#: AccountGroups.php:314 GLAccounts.php:250 GLAccounts.php:299 -#: Z_ImportGLAccountGroups.php:28 +#: AccountGroups.php:311 +#, fuzzy +msgid "Edit Account Group Details" +msgstr "مجموعات العضوية" + +#: AccountGroups.php:319 GLAccounts.php:244 GLAccounts.php:292 +#: Z_ImportGLAccountGroups.php:26 msgid "Account Group" msgstr "" -#: AccountGroups.php:338 +#: AccountGroups.php:343 +#, fuzzy +msgid "New Account Group Details" +msgstr "مجموعات العضوية" + +#: AccountGroups.php:349 msgid "Account Group Name" msgstr "" -#: AccountGroups.php:348 AccountGroups.php:350 +#: AccountGroups.php:360 AccountGroups.php:362 msgid "Top Level Group" msgstr "" -#: AccountGroups.php:364 +#: AccountGroups.php:377 msgid "Section In Accounts" msgstr "" -#: AccountGroups.php:401 AccountSections.php:262 AddCustomerContacts.php:208 -#: AddCustomerNotes.php:201 AddCustomerTypeNotes.php:192 Areas.php:222 -#: BankAccounts.php:373 BOMs.php:725 COGSGLPostings.php:347 -#: CreditStatus.php:247 Currencies.php:339 CustLoginSetup.php:611 -#: DiscountMatrix.php:141 EDIMessageFormat.php:249 -#: FixedAssetCategories.php:328 FixedAssetLocations.php:148 -#: FreightCosts.php:342 GeocodeSetup.php:266 GLAccounts.php:269 -#: Locations.php:553 MRPDemands.php:402 MRPDemandTypes.php:182 -#: OffersReceived.php:52 OffersReceived.php:128 PaymentMethods.php:276 -#: PaymentTerms.php:282 PO_AuthorisationLevels.php:217 Prices_Customer.php:372 -#: SalesAnalReptCols.php:510 SalesAnalRepts.php:496 SalesGLPostings.php:415 -#: SalesPeople.php:302 Shippers.php:196 StockCategories.php:561 -#: SupplierContacts.php:251 SuppLoginSetup.php:532 TaxAuthorities.php:313 -#: TaxCategories.php:235 TaxProvinces.php:229 UnitsOfMeasure.php:253 -#: WorkCentres.php:261 WWW_Users.php:643 +#: AccountGroups.php:415 AccountSections.php:258 AddCustomerContacts.php:260 +#: AddCustomerNotes.php:242 AddCustomerTypeNotes.php:221 Areas.php:228 +#: BankAccounts.php:398 BOMs.php:785 COGSGLPostings.php:355 +#: CreditStatus.php:259 Currencies.php:402 CustLoginSetup.php:273 +#: Departments.php:255 DiscountMatrix.php:142 EDIMessageFormat.php:248 +#: FixedAssetCategories.php:347 FixedAssetLocations.php:157 +#: FreightCosts.php:342 GeocodeSetup.php:271 GLAccounts.php:262 Labels.php:531 +#: Locations.php:607 MRPDemands.php:424 MRPDemandTypes.php:188 +#: OffersReceived.php:57 OffersReceived.php:146 PaymentMethods.php:300 +#: PaymentTerms.php:310 PO_AuthorisationLevels.php:262 Prices_Customer.php:361 +#: SalesAnalReptCols.php:552 SalesAnalRepts.php:516 SalesGLPostings.php:417 +#: SalesPeople.php:370 Shippers.php:203 StockCategories.php:613 +#: SupplierContacts.php:282 SuppLoginSetup.php:295 TaxAuthorities.php:329 +#: TaxCategories.php:238 TaxProvinces.php:235 UnitsOfMeasure.php:241 +#: WorkCentres.php:280 WWW_Users.php:699 msgid "Enter Information" msgstr "أدخل المعلومات" -#: AccountSections.php:9 index.php:1278 +#: AccountSections.php:7 includes/MainMenuLinksArray.php:376 msgid "Account Sections" msgstr "أعدادات العضو" -#: AccountSections.php:68 +#: AccountSections.php:61 msgid "The account section already exists in the database" msgstr "قسم العضو موجود مسبقا فى قاعدة البيانات" -#: AccountSections.php:75 -msgid "The account section name cannot contain the character" +#: AccountSections.php:68 +#, fuzzy +msgid "The account section name cannot contain any illegal characters" msgstr "لا يمكن ان يحتوى اسم العضوية على الحرف" -#: AccountSections.php:81 +#: AccountSections.php:74 msgid "The account section name must contain at least one character" msgstr "يجب ان يحتوى اسم العضو على الاقل حرف واحد" -#: AccountSections.php:87 AccountSections.php:93 +#: AccountSections.php:80 AccountSections.php:86 msgid "The section number must be an integer" msgstr "قسم الرقم يجب ان يكون عدد صحيح" -#: AccountSections.php:138 +#: AccountSections.php:128 msgid "" "Cannot delete this account section because general ledger accounts groups " "have been created using this section" msgstr "" -#: AccountSections.php:139 +#: AccountSections.php:130 msgid "general ledger accounts groups that refer to this account section" msgstr "" -#: AccountSections.php:150 +#: AccountSections.php:142 msgid "section has been deleted" msgstr "" -#: AccountSections.php:175 +#: AccountSections.php:167 msgid "Could not get account group sections because" msgstr "" -#: AccountSections.php:181 AccountSections.php:238 AccountSections.php:255 +#: AccountSections.php:173 AccountSections.php:232 AccountSections.php:250 msgid "Section Number" msgstr "رقم القطاع" -#: AccountSections.php:182 AccountSections.php:258 +#: AccountSections.php:174 AccountSections.php:254 msgid "Section Description" msgstr "وصف القطاع" -#: AccountSections.php:199 +#: AccountSections.php:191 msgid "Restricted" msgstr "محظور" -#: AccountSections.php:210 +#: AccountSections.php:202 msgid "Review Account Sections" msgstr "راجع أعدادات العضوية" -#: AccountSections.php:228 +#: AccountSections.php:221 msgid "Could not retrieve the requested section please try again." msgstr "لم أستطيع استرجاع القطاع المطلوب حاول مجددا" -#: AddCustomerContacts.php:6 AddCustomerContacts.php:59 SelectCustomer.php:601 -#: SelectCustomer.php:630 +#: AddCustomerContacts.php:6 AddCustomerContacts.php:59 SelectCustomer.php:607 +#: SelectCustomer.php:640 msgid "Customer Contacts" msgstr "" -#: AddCustomerContacts.php:20 CustEDISetup.php:11 CustLoginSetup.php:24 -#: Z_CheckDebtorsControl.php:21 +#: AddCustomerContacts.php:20 CustEDISetup.php:9 CustLoginSetup.php:21 +#: Z_CheckDebtorsControl.php:14 msgid "Back to Customers" msgstr "العودة الى العملاء" -#: AddCustomerContacts.php:26 -msgid "Contacts for Customer: <b>" -msgstr "" +#: AddCustomerContacts.php:25 +#, fuzzy +msgid "Contacts for Customer" +msgstr "العودة الى العملاء" -#: AddCustomerContacts.php:29 -msgid "Edit contact for <b>" +#: AddCustomerContacts.php:27 +msgid "Edit contact for" msgstr "" -#: AddCustomerContacts.php:41 -msgid "The Contact must be an integer." -msgstr "" +#: AddCustomerContacts.php:39 +#, fuzzy +msgid "The Contact ID must be an integer." +msgstr "يجب ان يكون القسم فى الحساب عدد صحيح" -#: AddCustomerContacts.php:44 -msgid "The contact's name must be forty characters or less long" +#: AddCustomerContacts.php:42 +#, fuzzy +msgid "The contact name must be forty characters or less long" +msgstr "اسم المجموعة يجب ان يحتوي علي الأقل علي حرف واحد" + +#: AddCustomerContacts.php:45 +msgid "The contact name may not be empty" msgstr "" -#: AddCustomerContacts.php:47 -msgid "The contact's name may not be empty" +#: AddCustomerContacts.php:48 +msgid "The contact email address is not a valid email address" msgstr "" -#: AddCustomerContacts.php:59 AddCustomerNotes.php:49 -#: AddCustomerTypeNotes.php:49 Areas.php:74 CustomerTypes.php:71 -#: DeliveryDetails.php:748 Factors.php:117 FixedAssetItems.php:230 -#: PcAssignCashToTab.php:73 PcClaimExpensesFromTab.php:61 PcExpenses.php:60 -#: PcTabs.php:60 PcTypeTabs.php:59 PO_Items.php:381 SalesAnalReptCols.php:129 -#: SalesPeople.php:94 SalesTypes.php:63 Stocks.php:355 Suppliers.php:514 -#: SupplierTypes.php:69 +#: AddCustomerContacts.php:59 AddCustomerNotes.php:51 +#: AddCustomerTypeNotes.php:48 Areas.php:71 CustomerTypes.php:69 +#: DeliveryDetails.php:773 DeliveryDetails.php:784 Factors.php:105 +#: FixedAssetItems.php:246 MRPCalendar.php:176 PcAssignCashToTab.php:88 +#: PcClaimExpensesFromTab.php:79 PcExpenses.php:95 PcTabs.php:101 +#: PcTypeTabs.php:60 PO_Items.php:370 SalesAnalReptCols.php:129 +#: SalesPeople.php:97 SalesTypes.php:66 Stocks.php:508 Suppliers.php:513 +#: SupplierTypes.php:67 msgid "has been updated" msgstr "" -#: AddCustomerContacts.php:70 +#: AddCustomerContacts.php:74 msgid "The contact record has been added" msgstr "" -#: AddCustomerContacts.php:98 +#: AddCustomerContacts.php:103 msgid "The contact record has been deleted" msgstr "" -#: AddCustomerContacts.php:112 CompanyPreferences.php:229 -#: CustomerBranches.php:377 Customers.php:899 Customers.php:905 -#: Customers.php:971 SalesPeople.php:185 SelectCustomer.php:603 -#: StockDispatch.php:186 StockDispatch.php:198 SupplierContacts.php:144 -#: SupplierCredit.php:433 SupplierInvoice.php:407 SuppTransGLAnalysis.php:96 -#: includes/InputSerialItemsFile.php:84 includes/InputSerialItemsFile.php:124 -#: includes/PDFTaxPageHeader.inc:37 +#: AddCustomerContacts.php:126 CompanyPreferences.php:224 +#: CustomerBranches.php:368 Customers.php:1020 Customers.php:1028 +#: SalesPeople.php:200 SelectCustomer.php:610 StockDispatch.php:243 +#: StockDispatch.php:254 StockDispatch.php:265 SupplierContacts.php:150 +#: SuppTransGLAnalysis.php:105 includes/InputSerialItemsFile.php:92 +#: includes/InputSerialItemsFile.php:144 includes/PDFTaxPageHeader.inc:37 msgid "Name" msgstr "" -#: AddCustomerContacts.php:113 AddCustomerContacts.php:190 Customers.php:900 -#: Customers.php:906 Customers.php:972 SelectCustomer.php:604 -#: WWW_Access.php:111 WWW_Access.php:172 +#: AddCustomerContacts.php:127 AddCustomerContacts.php:223 Customers.php:1021 +#: Customers.php:1029 SelectCustomer.php:611 WWW_Access.php:107 +#: WWW_Access.php:170 msgid "Role" msgstr "" -#: AddCustomerContacts.php:114 Customers.php:973 +#: AddCustomerContacts.php:128 msgid "Phone no" msgstr "" -#: AddCustomerContacts.php:115 AddCustomerContacts.php:202 Customers.php:902 -#: Customers.php:908 Customers.php:974 PcAssignCashToTab.php:216 -#: PcAssignCashToTab.php:341 PcAuthorizeExpenses.php:85 -#: PcClaimExpensesFromTab.php:195 PcClaimExpensesFromTab.php:348 -#: PcReportTab.php:348 SelectCustomer.php:606 SystemParameters.php:313 -#: WOSerialNos.php:277 WOSerialNos.php:279 +#: AddCustomerContacts.php:129 AddCustomerContacts.php:241 +#: CustomerBranches.php:374 CustomerBranches.php:783 CustomerInquiry.php:257 +#: Customers.php:1023 Customers.php:1031 EmailCustTrans.php:15 +#: EmailCustTrans.php:64 Factors.php:246 Factors.php:297 Locations.php:573 +#: OrderDetails.php:109 PDFRemittanceAdvice.php:251 PO_PDFPurchOrder.php:379 +#: PO_PDFPurchOrder.php:382 PrintCustTrans.php:718 PrintCustTrans.php:949 +#: PrintCustTrans.php:998 PrintCustTransPortrait.php:756 +#: PrintCustTransPortrait.php:1002 PrintCustTransPortrait.php:1058 +#: SelectCustomer.php:422 SelectCustomer.php:613 SupplierContacts.php:154 +#: SupplierContacts.php:275 UserSettings.php:185 WWW_Users.php:281 +#: includes/PDFPickingListHeader.inc:25 includes/PDFStatementPageHeader.inc:67 +#: includes/PDFTransPageHeader.inc:82 +#: includes/PDFTransPageHeaderPortrait.inc:109 +#: includes/PO_PDFOrderPageHeader.inc:29 +msgid "Email" +msgstr "" + +#: AddCustomerContacts.php:130 AddCustomerContacts.php:250 Customers.php:1024 +#: Customers.php:1032 PcAssignCashToTab.php:238 PcAssignCashToTab.php:369 +#: PcAuthorizeExpenses.php:92 PcClaimExpensesFromTab.php:227 +#: PcClaimExpensesFromTab.php:386 PcReportTab.php:331 SelectCustomer.php:614 +#: SystemParameters.php:339 WOSerialNos.php:292 WOSerialNos.php:298 msgid "Notes" msgstr "" -#: AddCustomerContacts.php:149 +#: AddCustomerContacts.php:149 SupplierContacts.php:164 +#, php-format +msgid "Are you sure you wish to delete this contact?" +msgstr "" + +#: AddCustomerContacts.php:168 msgid "Review all contacts for this Customer" msgstr "" -#: AddCustomerContacts.php:179 +#: AddCustomerContacts.php:206 msgid "Contact Code" msgstr "" -#: AddCustomerContacts.php:184 Factors.php:279 SupplierContacts.php:219 +#: AddCustomerContacts.php:214 Factors.php:234 SupplierContacts.php:237 msgid "Contact Name" msgstr "" -#: AddCustomerContacts.php:196 Contracts.php:766 PDFRemittanceAdvice.php:247 -#: PO_Header.php:958 PO_Header.php:1028 SelectCreditItems.php:225 -#: SelectCustomer.php:461 SelectOrderItems.php:638 -#: includes/PDFStatementPageHeader.inc:63 includes/PDFTransPageHeader.inc:113 +#: AddCustomerContacts.php:232 Contracts.php:775 PDFRemittanceAdvice.php:247 +#: PO_Header.php:1000 PO_Header.php:1080 SelectCreditItems.php:241 +#: SelectCustomer.php:420 SelectOrderItems.php:621 +#: SupplierTenderCreate.php:374 includes/PDFStatementPageHeader.inc:63 +#: includes/PDFTransPageHeader.inc:81 #: includes/PDFTransPageHeaderPortrait.inc:105 msgid "Phone" msgstr "" -#: AddCustomerNotes.php:6 AddCustomerNotes.php:49 SelectCustomer.php:638 -#: SelectCustomer.php:668 +#: AddCustomerNotes.php:6 AddCustomerNotes.php:51 SelectCustomer.php:649 +#: SelectCustomer.php:680 msgid "Customer Notes" msgstr "" -#: AddCustomerNotes.php:20 AddCustomerTypeNotes.php:20 +#: AddCustomerNotes.php:21 AddCustomerTypeNotes.php:19 msgid "Back to Select Customer" msgstr "" -#: AddCustomerNotes.php:31 +#: AddCustomerNotes.php:34 msgid "The contact priority must be an integer." msgstr "" -#: AddCustomerNotes.php:34 AddCustomerTypeNotes.php:34 +#: AddCustomerNotes.php:37 msgid "The contact's notes must be two hundred characters or less long" msgstr "" -#: AddCustomerNotes.php:37 AddCustomerTypeNotes.php:37 +#: AddCustomerNotes.php:40 msgid "The contact's notes may not be empty" msgstr "" -#: AddCustomerNotes.php:60 +#: AddCustomerNotes.php:64 msgid "The contact notes record has been added" msgstr "" -#: AddCustomerNotes.php:87 +#: AddCustomerNotes.php:91 msgid "The contact note record has been deleted" msgstr "" -#: AddCustomerNotes.php:98 +#: AddCustomerNotes.php:101 msgid "Notes for Customer" msgstr "" -#: AddCustomerNotes.php:106 AddCustomerNotes.php:189 -#: AddCustomerTypeNotes.php:104 AddCustomerTypeNotes.php:186 -#: BankMatching.php:223 BankReconciliation.php:184 BankReconciliation.php:256 -#: ContractCosting.php:149 CustomerAllocations.php:332 -#: CustomerAllocations.php:358 CustomerInquiry.php:191 -#: CustomerTransInquiry.php:87 GLAccountInquiry.php:154 -#: GLAccountReport.php:369 GLTransInquiry.php:45 MRPCalendar.php:217 -#: PaymentAllocations.php:77 PcAssignCashToTab.php:212 -#: PcAuthorizeExpenses.php:81 PDFRemittanceAdvice.php:308 -#: PrintCustTrans.php:678 PrintCustTransPortrait.php:860 ReverseGRN.php:378 -#: ShipmentCosting.php:503 ShipmentCosting.php:574 Shipments.php:467 -#: StockDispatch.php:188 StockDispatch.php:200 StockLocMovements.php:85 -#: StockMovements.php:98 StockSerialItemResearch.php:79 -#: SupplierAllocations.php:464 SupplierAllocations.php:576 -#: SupplierAllocations.php:646 SupplierInquiry.php:195 -#: SupplierTransInquiry.php:89 includes/PDFQuotationPageHeader.inc:91 +#: AddCustomerNotes.php:117 AddCustomerNotes.php:222 +#: AddCustomerTypeNotes.php:111 AddCustomerTypeNotes.php:211 +#: BankMatching.php:272 BankReconciliation.php:209 BankReconciliation.php:286 +#: ContractCosting.php:173 CustomerAllocations.php:330 +#: CustomerAllocations.php:364 CustomerInquiry.php:200 +#: CustomerTransInquiry.php:102 GLAccountInquiry.php:155 +#: GLAccountReport.php:340 GLTransInquiry.php:42 MRPCalendar.php:219 +#: PaymentAllocations.php:66 PcAssignCashToTab.php:234 +#: PcAuthorizeExpenses.php:88 PDFRemittanceAdvice.php:308 +#: PrintCustTrans.php:826 PrintCustTransPortrait.php:870 ReverseGRN.php:392 +#: ShipmentCosting.php:538 ShipmentCosting.php:615 Shipments.php:491 +#: StockDispatch.php:245 StockDispatch.php:256 StockDispatch.php:267 +#: StockLocMovements.php:91 StockMovements.php:95 +#: StockSerialItemResearch.php:81 SupplierAllocations.php:456 +#: SupplierAllocations.php:569 SupplierAllocations.php:644 +#: SupplierInquiry.php:211 SupplierTransInquiry.php:105 +#: includes/PDFQuotationPageHeader.inc:93 +#: includes/PDFQuotationPortraitPageHeader.inc:91 #: includes/PDFStatementPageHeader.inc:169 includes/PDFTaxPageHeader.inc:36 -#: includes/PDFTransPageHeader.inc:80 +#: includes/PDFTransPageHeader.inc:48 #: includes/PDFTransPageHeaderPortrait.inc:58 msgid "Date" msgstr "" -#: AddCustomerNotes.php:107 AddCustomerTypeNotes.php:105 PcReportTab.php:176 -#: Stocks.php:871 UpgradeDatabase.php:145 UpgradeDatabase.php:148 -#: UpgradeDatabase.php:151 UpgradeDatabase.php:154 UpgradeDatabase.php:157 -#: UpgradeDatabase.php:160 UpgradeDatabase.php:163 Z_Upgrade_3.10-3.11.php:62 +#: AddCustomerNotes.php:118 AddCustomerTypeNotes.php:112 PcReportTab.php:176 +#: Stocks.php:1055 UpgradeDatabase.php:197 UpgradeDatabase.php:200 +#: UpgradeDatabase.php:203 UpgradeDatabase.php:206 UpgradeDatabase.php:209 +#: UpgradeDatabase.php:212 UpgradeDatabase.php:215 UpgradeDatabase.php:218 +#: UpgradeDatabase.php:221 Z_Upgrade_3.10-3.11.php:62 #: Z_Upgrade_3.10-3.11.php:66 Z_Upgrade_3.10-3.11.php:70 #: Z_Upgrade_3.10-3.11.php:74 Z_Upgrade_3.10-3.11.php:78 #: Z_Upgrade_3.11-4.00.php:62 Z_Upgrade_3.11-4.00.php:66 @@ -647,28 +720,33 @@ msgid "Note" msgstr "" -#: AddCustomerNotes.php:108 AddCustomerNotes.php:183 +#: AddCustomerNotes.php:119 AddCustomerNotes.php:213 msgid "WWW" msgstr "" -#: AddCustomerNotes.php:109 AddCustomerNotes.php:195 -#: AddCustomerTypeNotes.php:107 AddCustomerTypeNotes.php:189 +#: AddCustomerNotes.php:120 AddCustomerNotes.php:231 +#: AddCustomerTypeNotes.php:114 AddCustomerTypeNotes.php:215 msgid "Priority" msgstr "" -#: AddCustomerNotes.php:143 +#: AddCustomerNotes.php:138 +#, php-format +msgid "Are you sure you wish to delete this customer note?" +msgstr "" + +#: AddCustomerNotes.php:157 msgid "Review all notes for this Customer" msgstr "" -#: AddCustomerNotes.php:172 AddCustomerTypeNotes.php:171 +#: AddCustomerNotes.php:196 AddCustomerTypeNotes.php:189 msgid "Note ID" msgstr "" -#: AddCustomerNotes.php:177 +#: AddCustomerNotes.php:204 msgid "Contact Note" msgstr "" -#: AddCustomerTypeNotes.php:6 SelectCustomer.php:676 +#: AddCustomerTypeNotes.php:5 SelectCustomer.php:689 msgid "Customer Type (Group) Notes" msgstr "" @@ -676,11 +754,20 @@ msgid "The Contact priority must be an integer." msgstr "" -#: AddCustomerTypeNotes.php:49 SelectCustomer.php:706 +#: AddCustomerTypeNotes.php:34 +#, fuzzy +msgid "The contacts notes must be two hundred characters or les... [truncated message content] |