|
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;
+}
+
+fun...
[truncated message content] |
|
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;
+}
+
+fun...
[truncated message content] |
|
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++; /...
[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++; /...
[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...
[truncated message content] |