This list is closed, nobody may subscribe to it.
2011 |
Jan
(14) |
Feb
(42) |
Mar
(56) |
Apr
(60) |
May
(54) |
Jun
(48) |
Jul
(74) |
Aug
(52) |
Sep
(68) |
Oct
(64) |
Nov
(42) |
Dec
(62) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
(142) |
Feb
(270) |
Mar
(374) |
Apr
(230) |
May
(214) |
Jun
(116) |
Jul
(234) |
Aug
(66) |
Sep
(120) |
Oct
(16) |
Nov
(17) |
Dec
(41) |
2013 |
Jan
(19) |
Feb
(18) |
Mar
(8) |
Apr
(40) |
May
(121) |
Jun
(42) |
Jul
(127) |
Aug
(145) |
Sep
(27) |
Oct
(38) |
Nov
(83) |
Dec
(61) |
2014 |
Jan
(33) |
Feb
(35) |
Mar
(59) |
Apr
(41) |
May
(38) |
Jun
(45) |
Jul
(17) |
Aug
(58) |
Sep
(46) |
Oct
(51) |
Nov
(55) |
Dec
(36) |
2015 |
Jan
(57) |
Feb
(67) |
Mar
(70) |
Apr
(34) |
May
(32) |
Jun
(11) |
Jul
(3) |
Aug
(17) |
Sep
(16) |
Oct
(13) |
Nov
(30) |
Dec
(30) |
2016 |
Jan
(17) |
Feb
(12) |
Mar
(17) |
Apr
(20) |
May
(47) |
Jun
(15) |
Jul
(13) |
Aug
(30) |
Sep
(32) |
Oct
(20) |
Nov
(32) |
Dec
(24) |
2017 |
Jan
(16) |
Feb
|
Mar
(11) |
Apr
(11) |
May
(5) |
Jun
(42) |
Jul
(9) |
Aug
(10) |
Sep
(14) |
Oct
(15) |
Nov
(2) |
Dec
(29) |
2018 |
Jan
(28) |
Feb
(49) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <dai...@us...> - 2011-05-07 00:24:46
|
Revision: 4562 http://web-erp.svn.sourceforge.net/web-erp/?rev=4562&view=rev Author: daintree Date: 2011-05-07 00:24:37 +0000 (Sat, 07 May 2011) Log Message: ----------- various Modified Paths: -------------- trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/Shipt_Select.php trunk/Stocks.php trunk/UpgradeDatabase.php trunk/doc/Change.log trunk/includes/PDFTransPageHeader.inc trunk/includes/session.inc Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2011-05-03 10:05:05 UTC (rev 4561) +++ trunk/PrintCustTrans.php 2011-05-07 00:24:37 UTC (rev 4562) @@ -1,7 +1,9 @@ <?php + /* $Id$ */ -include ('includes/session.inc'); +include('includes/session.inc'); + if (isset($_GET['FromTransNo'])) { $FromTransNo = trim($_GET['FromTransNo']); } elseif (isset($_POST['FromTransNo'])) { @@ -9,43 +11,74 @@ } else { $FromTransNo = ''; } + if (isset($_GET['InvOrCredit'])) { $InvOrCredit = $_GET['InvOrCredit']; } elseif (isset($_POST['InvOrCredit'])) { $InvOrCredit = $_POST['InvOrCredit']; } + if (isset($_GET['PrintPDF'])) { $PrintPDF = TRUE; } elseif (isset($_POST['PrintPDF'])) { $PrintPDF = TRUE; } -if (!isset($_POST['ToTransNo']) or trim($_POST['ToTransNo']) == '' or $_POST['ToTransNo'] < $FromTransNo) { + +if (!isset($_POST['ToTransNo']) + or trim($_POST['ToTransNo'])=='' + or $_POST['ToTransNo'] < $FromTransNo) { + $_POST['ToTransNo'] = $FromTransNo; } + $FirstTrans = $FromTransNo; /* Need to start a new page only on subsequent transactions */ -if ($FromTransNo=='Preview') { - $FormDesign = simplexml_load_file(sys_get_temp_dir().'/SalesInvoice.xml'); -} else { - $FormDesign = simplexml_load_file($PathPrefix.'companies/'.$_SESSION['DatabaseName'].'/FormDesigns/SalesInvoice.xml'); -} -if (isset($PrintPDF) or isset($_GET['PrintPDF']) and $PrintPDF and isset($FromTransNo) and isset($InvOrCredit) and $FromTransNo != '') { - $PaperSize = $FormDesign->PaperSize; - include ('includes/PDFStarter.php'); - if ($InvOrCredit == 'Invoice') { - $pdf->addInfo('Title', _('Sales Invoice') . ' ' . $FromTransNo . ' to ' . $_POST['ToTransNo']); - $pdf->addInfo('Subject', _('Invoices from') . ' ' . $FromTransNo . ' ' . _('to') . ' ' . $_POST['ToTransNo']); + +if (isset($PrintPDF) OR isset($_GET['PrintPDF']) + AND $PrintPDF + AND isset($FromTransNo) + AND isset($InvOrCredit) + AND $FromTransNo!=''){ + + include ('includes/class.pdf.php'); + + /* This invoice is hard coded for A4 Landscape invoices or credit notes so can't use PDFStarter.inc */ + + $Page_Width=842; + $Page_Height=595; + $Top_Margin=30; + $Bottom_Margin=30; + $Left_Margin=40; + $Right_Margin=30; + + + $pdf = new Cpdf('L', 'pt', 'A4'); + $pdf->addInfo('Creator', 'webERP http://www.weberp.org'); + $pdf->addInfo('Author', 'webERP ' . $Version); + + if ($InvOrCredit=='Invoice') { + $pdf->addInfo('Title',_('Sales Invoice') . ' ' . $FromTransNo . ' to ' . $_POST['ToTransNo']); + $pdf->addInfo('Subject',_('Invoices from') . ' ' . $FromTransNo . ' ' . _('to') . ' ' . $_POST['ToTransNo']); } else { - $pdf->addInfo('Title', _('Sales Credit Note')); - $pdf->addInfo('Subject', _('Credit Notes from') . ' ' . $FromTransNo . ' ' . _('to') . ' ' . $_POST['ToTransNo']); + $pdf->addInfo('Title',_('Sales Credit Note') ); + $pdf->addInfo('Subject',_('Credit Notes from') . ' ' . $FromTransNo . ' ' . _('to') . ' ' . $_POST['ToTransNo']); } + $pdf->setAutoPageBreak(0); + $pdf->setPrintHeader(false); + $pdf->AddPage(); + $pdf->cMargin = 0; +/* END Brought from class.pdf.php constructor */ + $FirstPage = true; - $line_height = $FormDesign->LineHeight; - while ($FromTransNo <= $_POST['ToTransNo']) { - /* retrieve the invoice details from the database to print - notice that salesorder record must be present to print the invoice purging of sales orders will - nobble the invoice reprints */ - if ($InvOrCredit == 'Invoice') { + $line_height=16; + + while ($FromTransNo <= $_POST['ToTransNo']){ + + /* retrieve the invoice details from the database to print + notice that salesorder record must be present to print the invoice purging of sales orders will + nobble the invoice reprints */ + + if ($InvOrCredit=='Invoice') { $sql = "SELECT debtortrans.trandate, debtortrans.ovamount, debtortrans.ovdiscount, @@ -111,7 +144,8 @@ AND debtortrans.branchcode=custbranch.branchcode AND custbranch.salesman=salesman.salesmancode AND salesorders.fromstkloc=locations.loccode"; - if (isset($_POST['PrintEDI']) and $_POST['PrintEDI'] == 'No') { + + if (isset($_POST['PrintEDI']) and $_POST['PrintEDI']=='No') { $sql = $sql . " AND debtorsmaster.ediinvoices=0"; } } else { @@ -161,31 +195,29 @@ AND debtortrans.debtorno=custbranch.debtorno AND debtortrans.branchcode=custbranch.branchcode AND custbranch.salesman=salesman.salesmancode"; - if ($_POST['PrintEDI'] == 'No') { + + if ($_POST['PrintEDI']=='No') { $sql = $sql . " AND debtorsmaster.ediinvoices=0"; } } // end else - if ($FromTransNo!='Preview') { - $result = DB_query($sql, $db, '', '', false, false); - if (DB_error_no($db) != 0) { - $title = _('Transaction Print Error Report'); - include ('includes/header.inc'); - prnMsg(_('There was a problem retrieving the invoice or credit note details for note number') . ' ' . $InvoiceToPrint . ' ' . _('from the database') . '. ' . _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available'), 'error'); - if ($debug == 1) { - prnMsg(_('The SQL used to get this information that failed was') . '<br />' . $sql, 'error'); - } - include ('includes/footer.inc'); - exit; + + $result=DB_query($sql, $db, '', '',false, false); + + if (DB_error_no($db)!=0) { + $title = _('Transaction Print Error Report'); + include ('includes/header.inc'); + prnMsg( _('There was a problem retrieving the invoice or credit note details for note number') . ' ' . $InvoiceToPrint . ' ' . _('from the database') . '. ' . _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available'),'error'); + if ($debug==1) { + prnMsg (_('The SQL used to get this information that failed was') . '<br />' . $sql,'error'); } + include ('includes/footer.inc'); + exit; } - if ($FromTransNo=='Preview' or DB_num_rows($result) == 1) { - if ($FromTransNo!='Preview') { - $myrow = DB_fetch_array($result); - $ExchRate = $myrow['rate']; - } else { - $ExchRate = 'X'; - } - if ($InvOrCredit == 'Invoice') { + if (DB_num_rows($result)==1) { + $myrow = DB_fetch_array($result); + $ExchRate = $myrow['rate']; + if ($InvOrCredit=='Invoice') { + $sql = "SELECT stockmoves.stockid, stockmaster.description, -stockmoves.qty as quantity, @@ -193,16 +225,15 @@ ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . "* -stockmoves.qty) AS fxnet, (stockmoves.price * " . $ExchRate . ") AS fxprice, stockmoves.narrative, - stockmaster.units, - stockmaster.decimalplaces + stockmaster.units FROM stockmoves, stockmaster WHERE stockmoves.stockid = stockmaster.stockid AND stockmoves.type=10 - AND stockmoves.transno='" . $FromTransNo . "' + AND stockmoves.transno=" . $FromTransNo . " AND stockmoves.show_on_inv_crds=1"; } else { - /* only credit notes to be retrieved */ + /* only credit notes to be retrieved */ $sql = "SELECT stockmoves.stockid, stockmaster.description, stockmoves.qty as quantity, @@ -210,224 +241,294 @@ ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . " * stockmoves.qty) AS fxnet, (stockmoves.price * " . $ExchRate . ") AS fxprice, stockmoves.narrative, - stockmaster.units, - stockmaster.decimalplaces + stockmaster.units FROM stockmoves, stockmaster WHERE stockmoves.stockid = stockmaster.stockid AND stockmoves.type=11 - AND stockmoves.transno='" . $FromTransNo . "' + AND stockmoves.transno=" . $FromTransNo . " AND stockmoves.show_on_inv_crds=1"; } // end else - if ($FromTransNo!='Preview') { - $result = DB_query($sql, $db); - } - if (DB_error_no($db) != 0) { + + $result=DB_query($sql,$db); + if (DB_error_no($db)!=0) { $title = _('Transaction Print Error Report'); include ('includes/header.inc'); echo '<br />' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database'); - if ($debug == 1) { - echo '<br />' . _('The SQL used to get this information that failed was') . '<br />' . $sql; + if ($debug==1) { + echo '<br />' . _('The SQL used to get this information that failed was') . '<br>' . $sql; } - include ('includes/footer.inc'); + include('includes/footer.inc'); exit; } - if ($FromTransNo=='Preview' or DB_num_rows($result) > 0) { + + if (DB_num_rows($result)>0) { + + $FontSize = 10; $PageNumber = 1; - include ('includes/PDFTransPageHeader.inc'); + + include('includes/PDFTransPageHeader.inc'); $FirstPage = False; - $YPos = $Page_Height - $FormDesign->Data->y; - $Line=1; - while (($FromTransNo=='Preview' and $Line==1) or (isset($result) and $myrow2 = DB_fetch_array($result))) { - if ($myrow2['discountpercent'] == 0) { - $DisplayDiscount = ''; + while ($myrow2=DB_fetch_array($result)) { + + if ($myrow2['discountpercent']==0) { + $DisplayDiscount =''; } else { - $DisplayDiscount = number_format($myrow2['discountpercent'] * 100, 2) . '%'; - $DiscountPrice = $myrow2['fxprice'] * (1 - $myrow2['discountpercent']); + $DisplayDiscount = number_format($myrow2['discountpercent']*100,2) . '%'; + $DiscountPrice=$myrow2['fxprice']*(1-$myrow2['discountpercent']); } - $DisplayNet = number_format($myrow2['fxnet'], 2); - $DisplayPrice = $myrow2['fxprice']; - $DisplayQty = $myrow2['quantity']; - $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column1->x, $YPos,$FormDesign->Data->Column1->Length, $FormDesign->Data->Column1->FontSize, $myrow2['stockid']); - $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column2->x, $YPos,$FormDesign->Data->Column2->Length, $FormDesign->Data->Column2->FontSize, $myrow2['description']); - $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column3->x, $YPos,$FormDesign->Data->Column3->Length, $FormDesign->Data->Column3->FontSize, number_format($DisplayPrice,4), 'right'); - $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column4->x, $YPos,$FormDesign->Data->Column4->Length, $FormDesign->Data->Column4->FontSize, number_format($DisplayQty,$myrow2['decimalplaces']), 'right'); - $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column5->x, $YPos,$FormDesign->Data->Column5->Length, $FormDesign->Data->Column5->FontSize, $myrow2['units'], 'centre'); - $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column6->x, $YPos,$FormDesign->Data->Column6->Length, $FormDesign->Data->Column6->FontSize, $DisplayDiscount, 'right'); - $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column7->x, $YPos,$FormDesign->Data->Column7->Length, $FormDesign->Data->Column7->FontSize, $DisplayNet, 'right'); - $YPos-= ($line_height); - $lines = explode('\r\n', htmlspecialchars_decode($myrow2['narrative'])); - for ($i = 0;$i < sizeOf($lines);$i++) { - while (strlen($lines[$i]) > 1) { - if ($YPos - $line_height <= $Bottom_Margin) { + $DisplayNet=number_format($myrow2['fxnet'],2); + $DisplayPrice=number_format($myrow2['fxprice'],3); + $DisplayQty=$myrow2['quantity']; + + $LeftOvers = $pdf->addTextWrap($Left_Margin+3,$YPos,95,$FontSize,$myrow2['stockid']); + $LeftOvers = $pdf->addTextWrap($Left_Margin+100,$YPos,123,$FontSize,$myrow2['description']); + $LeftOvers = $pdf->addTextWrap($Left_Margin+353,$YPos,96,$FontSize,$DisplayPrice,'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+453,$YPos,95,$FontSize,$DisplayQty,'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+553,$YPos,35,$FontSize,$myrow2['units'],'centre'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+590,$YPos,50,$FontSize,$DisplayDiscount,'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+642,$YPos,120,$FontSize,$DisplayNet,'right'); + + $YPos -= ($line_height); + + $lines=explode('\r\n',htmlspecialchars_decode($myrow2['narrative'])); + for ($i=0;$i<sizeOf($lines);$i++) { + while (strlen($lines[$i])>1) { + if ($YPos-$line_height <= $Bottom_Margin) { /* head up a new invoice/credit note page */ /* draw the vertical column lines right to the bottom */ - PrintLinesToBottom($pdf, $Page_Height, $PageNumber, $FormDesign); - include ('includes/PDFTransPageHeaderPortrait.inc'); - } //end if need a new page headed up - /* increment a line down for the next line item */ - if (strlen($lines[$i]) > 1) { - $lines[$i] = $pdf->addTextWrap($Left_Margin + 100, $YPos, 245, $FontSize, stripslashes($lines[$i])); + PrintLinesToBottom (); + include ('includes/PDFTransPageHeaderPortrait.inc'); + } //end if need a new page headed up + + /* increment a line down for the next line item */ + if (strlen($lines[$i])>1){ + $lines[$i] = $pdf->addTextWrap($Left_Margin+100,$YPos,245,$FontSize,stripslashes($lines[$i])); } - $YPos-= ($line_height); - } - } + $YPos -= ($line_height); + } + } //end for loop around lines of narrative to display if ($YPos <= $Bottom_Margin) { + /* head up a new invoice/credit note page */ /*draw the vertical column lines right to the bottom */ - PrintLinesToBottom($pdf, $Page_Height, $PageNumber, $FormDesign); + PrintLinesToBottom (); include ('includes/PDFTransPageHeader.inc'); } //end if need a new page headed up - $Line++; - } //end while there are line items to print out + } //end while there invoice are line items to print out + } /*end if there are stock movements to show on the invoice or credit note*/ - } /*end if there are stock movements to show on the invoice or credit note*/ - $YPos-= $line_height; + $YPos -= $line_height; + /* check to see enough space left to print the 4 lines for the totals/footer */ - if (($YPos - $Bottom_Margin) < (2 * $line_height)) { - PrintLinesToBottom($pdf, $Page_Height, $PageNumber, $FormDesign); + if (($YPos-$Bottom_Margin)<(2*$line_height)) { + PrintLinesToBottom (); include ('includes/PDFTransPageHeader.inc'); } /* Print a column vertical line with enough space for the footer */ /* draw the vertical column lines to 4 lines shy of the bottom to leave space for invoice footer info ie totals etc */ - $pdf->line($FormDesign->DataLines->Line1->startx, $Page_Height - $FormDesign->DataLines->Line1->starty, $FormDesign->DataLines->Line1->endx, $Page_Height - $FormDesign->DataLines->Line1->endy); + $pdf->line($Left_Margin+97, $TopOfColHeadings+12,$Left_Margin+97,$Bottom_Margin+(4*$line_height)); + /* Print a column vertical line */ - $pdf->line($FormDesign->DataLines->Line2->startx, $Page_Height - $FormDesign->DataLines->Line2->starty, $FormDesign->DataLines->Line2->endx, $Page_Height - $FormDesign->DataLines->Line2->endy); + $pdf->line($Left_Margin+350, $TopOfColHeadings+12,$Left_Margin+350,$Bottom_Margin+(4*$line_height)); + /* Print a column vertical line */ - $pdf->line($FormDesign->DataLines->Line3->startx, $Page_Height - $FormDesign->DataLines->Line3->starty, $FormDesign->DataLines->Line3->endx, $Page_Height - $FormDesign->DataLines->Line3->endy); + $pdf->line($Left_Margin+450, $TopOfColHeadings+12,$Left_Margin+450,$Bottom_Margin+(4*$line_height)); + /* Print a column vertical line */ - $pdf->line($FormDesign->DataLines->Line4->startx, $Page_Height - $FormDesign->DataLines->Line4->starty, $FormDesign->DataLines->Line4->endx, $Page_Height - $FormDesign->DataLines->Line4->endy); + $pdf->line($Left_Margin+550, $TopOfColHeadings+12,$Left_Margin+550,$Bottom_Margin+(4*$line_height)); + /* Print a column vertical line */ - $pdf->line($FormDesign->DataLines->Line5->startx, $Page_Height - $FormDesign->DataLines->Line5->starty, $FormDesign->DataLines->Line5->endx, $Page_Height - $FormDesign->DataLines->Line5->endy); - $pdf->line($FormDesign->DataLines->Line6->startx, $Page_Height - $FormDesign->DataLines->Line6->starty, $FormDesign->DataLines->Line6->endx, $Page_Height - $FormDesign->DataLines->Line6->endy); + $pdf->line($Left_Margin+587, $TopOfColHeadings+12,$Left_Margin+587,$Bottom_Margin+(4*$line_height)); + + $pdf->line($Left_Margin+640, $TopOfColHeadings+12,$Left_Margin+640,$Bottom_Margin+(4*$line_height)); + /* Rule off at bottom of the vertical lines */ - $pdf->line($FormDesign->LineAboveFooter->startx, $Page_Height - $FormDesign->LineAboveFooter->starty, $FormDesign->LineAboveFooter->endx, $Page_Height - $FormDesign->LineAboveFooter->endy); + $pdf->line($Left_Margin, $Bottom_Margin+(4*$line_height),$Page_Width-$Right_Margin,$Bottom_Margin+(4*$line_height)); + /* Now print out the footer and totals */ - if ($InvOrCredit == 'Invoice') { - $DisplaySubTot = number_format($myrow['ovamount'], 2); - $DisplayFreight = number_format($myrow['ovfreight'], 2); - $DisplayTax = number_format($myrow['ovgst'], 2); - $DisplayTotal = number_format($myrow['ovfreight'] + $myrow['ovgst'] + $myrow['ovamount'], 2); + + if ($InvOrCredit=='Invoice') { + + $DisplaySubTot = number_format($myrow['ovamount'],2); + $DisplayFreight = number_format($myrow['ovfreight'],2); + $DisplayTax = number_format($myrow['ovgst'],2); + $DisplayTotal = number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],2); + } else { - $DisplaySubTot = number_format(-$myrow['ovamount'], 2); - $DisplayFreight = number_format(-$myrow['ovfreight'], 2); - $DisplayTax = number_format(-$myrow['ovgst'], 2); - $DisplayTotal = number_format(-$myrow['ovfreight'] - $myrow['ovgst'] - $myrow['ovamount'], 2); + + $DisplaySubTot = number_format(-$myrow['ovamount'],2); + $DisplayFreight = number_format(-$myrow['ovfreight'],2); + $DisplayTax = number_format(-$myrow['ovgst'],2); + $DisplayTotal = number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],2); } + /* Print out the invoice text entered */ + $YPos = $Bottom_Margin+(3*$line_height); + /* Print out the payment terms */ - $pdf->addTextWrap($FormDesign->PaymentTerms->x, $Page_Height - $FormDesign->PaymentTerms->y, $FormDesign->PaymentTerms->Length, $FormDesign->PaymentTerms->FontSize, _('Payment Terms') . ': ' . $myrow['terms']); - // $pdf->addText($Page_Width-$Right_Margin-392, $YPos - ($line_height*3)+22,$FontSize, _('Bank Code:***** Bank Account:*****')); - // $FontSize=10; - $LeftOvers=explode('\r\n',DB_escape_string($myrow['invtext'])); - for ($i=0;$i<sizeOf($LeftOvers);$i++) { - $pdf->addText($FormDesign->InvoiceText->x, $Page_Height - $FormDesign->InvoiceText->y-($i*10), $FormDesign->InvoiceText->FontSize, $LeftOvers[$i]); + $pdf->addTextWrap($Left_Margin+5,$YPos+3,280,$FontSize,_('Payment Terms') . ': ' . $myrow['terms']); + // $pdf->addText($Page_Width-$Right_Margin-392, $YPos - ($line_height*3)+22,$FontSize, _('Bank Code:***** Bank Account:*****')); + // $FontSize=10; + + $FontSize =8; + $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos-12,280,$FontSize,$myrow['invtext']); + if (strlen($LeftOvers)>0) { + $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos-24,280,$FontSize,$LeftOvers); + if (strlen($LeftOvers)>0) { + $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos-36,280,$FontSize,$LeftOvers); + /*If there is some of the InvText leftover after 3 lines 200 wide then it is not printed :( */ + } } - $pdf->addText($FormDesign->SubTotalCaption->x, $Page_Height - $FormDesign->SubTotalCaption->y, $FormDesign->SubTotalCaption->FontSize, _('Sub Total')); - $LeftOvers = $pdf->addTextWrap($FormDesign->SubTotal->x, $Page_Height - $FormDesign->SubTotal->y, $FormDesign->SubTotal->Length, $FormDesign->SubTotal->FontSize, $DisplaySubTot, 'right'); - $pdf->addText($FormDesign->FreightCaption->x, $Page_Height - $FormDesign->FreightCaption->y, $FormDesign->FreightCaption->FontSize, _('Freight')); - $LeftOvers = $pdf->addTextWrap($FormDesign->Freight->x, $Page_Height - $FormDesign->Freight->y, $FormDesign->Freight->Length, $FormDesign->Freight->FontSize, $DisplayFreight, 'right'); - $pdf->addText($FormDesign->TaxCaption->x, $Page_Height - $FormDesign->TaxCaption->y, $FormDesign->TaxCaption->FontSize, _('Tax')); - $LeftOvers = $pdf->addTextWrap($FormDesign->Tax->x, $Page_Height - $FormDesign->Tax->y, $FormDesign->Tax->Length, $FormDesign->Tax->FontSize, $DisplayTax, 'right'); + $FontSize = 10; + + $pdf->addText($Page_Width-$Right_Margin-220, $YPos+15,$FontSize, _('Sub Total')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+642,$YPos+5,120,$FontSize,$DisplaySubTot, 'right'); + + $pdf->addText($Page_Width-$Right_Margin-220, $YPos+2,$FontSize, _('Freight')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+642,$YPos-6,120,$FontSize,$DisplayFreight, 'right'); + + $pdf->addText($Page_Width-$Right_Margin-220, $YPos-10,$FontSize, _('Tax')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+642,$YPos-($line_height)-5,120, $FontSize,$DisplayTax, 'right'); + /*rule off for total */ - $pdf->line($FormDesign->TotalLine->startx, $Page_Height - $FormDesign->TotalLine->starty, $FormDesign->TotalLine->endx, $Page_Height - $FormDesign->TotalLine->endy); + $pdf->line($Page_Width-$Right_Margin-222, $YPos-(2*$line_height),$Page_Width-$Right_Margin,$YPos-(2*$line_height)); + /*vertical to separate totals from comments and ROMALPA */ - $pdf->line($FormDesign->RomalpaLine->startx, $Page_Height - $FormDesign->RomalpaLine->starty, $FormDesign->RomalpaLine->endx, $Page_Height - $FormDesign->RomalpaLine->endy); - if ($InvOrCredit == 'Invoice') { - $pdf->addText($FormDesign->TotalCaption->x, $Page_Height - $FormDesign->TotalCaption->y, $FormDesign->TotalCaption->FontSize, _('TOTAL INVOICE')); - $YPos=$FormDesign->Romalpa->y; - $LeftOvers = $pdf->addTextWrap($FormDesign->Romalpa->x, $Page_Height - $YPos, $FormDesign->Romalpa->Length, $FormDesign->Romalpa->FontSize, $_SESSION['RomalpaClause']); - while (strlen($LeftOvers) > 0 AND ($Page_Height - $YPos) > $Bottom_Margin) { - $YPos+= $FormDesign->Romalpa->FontSize+1; - $LeftOvers = $pdf->addTextWrap($FormDesign->Romalpa->x, $Page_Height - $YPos, $FormDesign->Romalpa->Length, $FormDesign->Romalpa->FontSize, $LeftOvers); + $pdf->line($Page_Width-$Right_Margin-222, $YPos+$line_height,$Page_Width-$Right_Margin-222,$Bottom_Margin); + + $YPos+=10; + if ($InvOrCredit=='Invoice') { + $pdf->addText($Page_Width-$Right_Margin-220, $YPos - ($line_height*2)-10,$FontSize, _('TOTAL INVOICE')); + $FontSize=9; + $YPos-=4; + $LeftOvers = $pdf->addTextWrap($Left_Margin+280,$YPos,220,$FontSize,$_SESSION['RomalpaClause']); + while (strlen($LeftOvers)>0 AND $YPos > $Bottom_Margin) { + $YPos-=12; + $LeftOvers = $pdf->addTextWrap($Left_Margin+280,$YPos,220,$FontSize,$LeftOvers); } /* Add Images for Visa / Mastercard / Paypal */ if (file_exists('companies/' . $_SESSION['DatabaseName'] . '/payment.jpg')) { - $pdf->addJpegFromFile('companies/' . $_SESSION['DatabaseName'] . '/payment.jpg', $FormDesign->CreditCardLogo->x,$Page_Height -$FormDesign->CreditCardLogo->y,$FormDesign->CreditCardLogo->width,$FormDesign->CreditCardLogo->height); + $pdf->addJpegFromFile('companies/' . $_SESSION['DatabaseName'] . '/payment.jpg',$Page_Width/2 -280,$YPos-20,0,40); } -// $pdf->addText($Page_Width - $Right_Margin - 472, $YPos - ($line_height * 3) + 32, $FontSize, ''); + $pdf->addText($Page_Width-$Right_Margin-472, $YPos - ($line_height*3)+32,$FontSize, ''); + $FontSize=10; } else { - $pdf->addText($FormDesign->TotalCaption->x, $Page_Height - $FormDesign->TotalCaption->y, $FormDesign->TotalCaption->FontSize, _('TOTAL CREDIT')); - } - $LeftOvers = $pdf->addTextWrap($FormDesign->Total->x, $Page_Height - $FormDesign->Total->y, $FormDesign->Total->Length, $FormDesign->Total->FontSize, $DisplayTotal, 'right'); + $pdf->addText($Page_Width-$Right_Margin-220, $YPos-($line_height*2)-10,$FontSize, _('TOTAL CREDIT')); + } + $LeftOvers = $pdf->addTextWrap($Left_Margin+642,35,120, $FontSize,$DisplayTotal, 'right'); } /* end of check to see that there was an invoice record to print */ + $FromTransNo++; + } /* end loop to print invoices */ + + // Have to get the TransNo again, GET[FromTransNo] is updated on each pass of loop + if (isset($_GET['FromTransNo'])) { + $FromTransNo = trim($_GET['FromTransNo']); + } elseif (isset($_POST['FromTransNo'])) { + $FromTransNo = trim($_POST['FromTransNo']); } -} /* end loop to print invoices */ + + + if (isset($_GET['Email'])){ //email the invoice to address supplied + include('includes/header.inc'); -if (($InvOrCredit == 'Invoice' or $InvOrCredit == 'Credit') and isset($PrintPDF)) { - - if (isset($_GET['Email'])) { //email the invoice to address supplied - include ('includes/header.inc'); include ('includes/htmlMimeMail.php'); + $FileName = $_SESSION['reports_dir'] . '/' . $_SESSION['DatabaseName'] . '_' . $InvOrCredit . '_' . $_GET['FromTransNo'] . '.pdf'; + $pdf->Output($FileName,'F'); $mail = new htmlMimeMail(); - $FileName = $_SESSION['reports_dir'] . '/' . $_SESSION['DatabaseName'] . '_' . $InvOrCredit . '_' . $_GET['FromTransNo'] . '.pdf'; - $pdf->Output($FileName, 'F'); + $Attachment = $mail->getFile($FileName); - $mail->setText(_('Please find attached') . ' ' . $InvOrCredit . ' ' . $_GET['FromTransNo']); + $mail->setText(_('Please find attached') . ' ' . $InvOrCredit . ' ' . $_GET['FromTransNo'] ); $mail->SetSubject($InvOrCredit . ' ' . $_GET['FromTransNo']); $mail->addAttachment($Attachment, $FileName, 'application/pdf'); $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . ' <' . $_SESSION['CompanyRecord']['email'] . '>'); $result = $mail->send(array($_GET['Email'])); + unlink($FileName); //delete the temporary file - $title = _('Emailing') . ' ' . $InvOrCredit . ' ' . _('Number') . ' ' . $FromTransNo; - include ('includes/header.inc'); - echo '<p>' . $InvOrCredit . ' ' . _('number') . ' ' . $_GET['FromTransNo'] . ' ' . _('has been emailed to') . ' ' . $_GET['Email']; - include ('includes/footer.inc'); + + $title = _('Emailing') . ' ' .$InvOrCredit . ' ' . _('Number') . ' ' . $FromTransNo; + include('includes/header.inc'); + echo '<p>' . $InvOrCredit . ' ' . _('number') . ' ' . $FromTransNo . ' ' . _('has been emailed to') . ' ' . $_GET['Email']; + include('includes/footer.inc'); exit; - } else { - $pdf->OutputD( $_SESSION['DatabaseName'] . '_' . $InvOrCredit . '_' . $_GET['FromTransNo'] . '.pdf'); + + } else { //its not an email just print the invoice to PDF + $pdf->OutputD($_SESSION['DatabaseName'] . '_' . $InvOrCredit . '_' . $FromTransNo . '.pdf'); + } $pdf->__destruct(); + } else { /*The option to print PDF was not hit */ - $title = _('Select Invoices/Credit Notes To Print'); - include ('includes/header.inc'); - if (!isset($FromTransNo) OR $FromTransNo == '') { + + $title=_('Select Invoices/Credit Notes To Print'); + include('includes/header.inc'); + + if (!isset($FromTransNo) OR $FromTransNo=='') { + /* if FromTransNo is not set then show a form to allow input of either a single invoice number or a range of invoices to be printed. Also get the last invoice number created to show the user where the current range is up to */ - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="POST"> - <table class="selection">'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . _('Print Invoices or Credit Notes (Landscape Mode)') . '</p>'; - echo '<tr><td>' . _('Print Invoices or Credit Notes') . '</td><td><select name=InvOrCredit>'; - if ($InvOrCredit == 'Invoice' OR !isset($InvOrCredit)) { + + echo '<div class="centre"><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="">' . ' ' . _('Print Invoices or Credit Notes (Landscape Mode)') . '</div>'; + echo '<table class="table1"> + <tr><td>' . _('Print Invoices or Credit Notes') . '</td><td><select name=InvOrCredit>'; + if ($InvOrCredit=='Invoice' OR !isset($InvOrCredit)) { + echo '<option selected value="Invoice">' . _('Invoices') . '</option>'; - echo '<option value="Credit">' . _('Credit Notes'). '</option>'; + echo '<option value="Credit">' . _('Credit Notes') . '</option>'; } else { echo '<option selected value="Credit">' . _('Credit Notes') . '</option>'; echo '<option value="Invoice">' . _('Invoices') . '</option>'; } + echo '</select></td></tr>'; echo '<tr><td>' . _('Print EDI Transactions') . '</td><td><select name=PrintEDI>'; - if ($InvOrCredit == 'Invoice' OR !isset($InvOrCredit)) { + + if ($InvOrCredit=='Invoice' OR !isset($InvOrCredit)) { + echo '<option selected value="No">' . _('Do not Print PDF EDI Transactions') . '</option>'; echo '<option value="Yes">' . _('Print PDF EDI Transactions Too') . '</option>'; + } else { + echo '<option value="No">' . _('Do not Print PDF EDI Transactions') . '</option>'; echo '<option selected value="Yes">' . _('Print PDF EDI Transactions Too') . '</option>'; } + echo '</select></td></tr>'; echo '<tr><td>' . _('Start invoice/credit note number to print') . '</td> - <td><input type="text" class="number" max=6 size=7 name=FromTransNo></td></tr>'; + <td><input Type=text class=number max=6 size=7 name=FromTransNo></td></tr>'; echo '<tr><td>' . _('End invoice/credit note number to print') . '</td> - <td><input Type="text" class="number" max=6 size=7 name="ToTransNo"></td> - </tr></table>'; - echo '<br /><div class="centre"><input type="submit" name="Print" value="' . _('Print') . '"><p />'; + <td><input Type=text class=number max=6 size=7 name="ToTransNo"></td></tr> + </table>'; + echo '<div class="centre"><input type="submit" name="Print" value="' . _('Print') . '"><p>'; echo '<input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>'; + $sql = "SELECT typeno FROM systypes WHERE typeid=10"; - $result = DB_query($sql, $db); + + $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); - echo '<div class="page_help_text"><b>' . _('The last invoice created was number') . ' ' . $myrow[0] . '</b><br />' . _('If only a single invoice is required') . ', ' . _('enter the invoice number to print in the Start transaction number to print field and leave the End transaction number to print field blank') . '. ' . _('Only use the end invoice to print field if you wish to print a sequential range of invoices') . ''; + + echo '<div class="page_help_text"><b>' . _('The last invoice created was number') . ' ' . $myrow[0] . '</b><br>' . _('If only a single invoice is required') . ', ' . _('enter the invoice number to print in the Start transaction number to print field and leave the End transaction number to print field blank') . '. ' . _('Only use the end invoice to print field if you wish to print a sequential range of invoices') . ''; + $sql = "SELECT typeno FROM systypes WHERE typeid=11"; - $result = DB_query($sql, $db); + + $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); - echo '<br /><b>' . _('The last credit note created was number') . ' ' . $myrow[0] . '</b><br />' . - _('A sequential range can be printed using the same method as for invoices above') . '. ' . _('A single credit note can be printed by only entering a start transaction number') . '</div>'; + + echo '<br /><b>' . _('The last credit note created was number') . ' ' . $myrow[0] . '</b><br />' . _('A sequential range can be printed using the same method as for invoices above') . '. ' . _('A single credit note can be printed by only entering a start transaction number') . '</DIV'; + } else { + while ($FromTransNo <= $_POST['ToTransNo']) { + /*retrieve the invoice details from the database to print notice that salesorder record must be present to print the invoice purging of sales orders will nobble the invoice reprints */ - if ($InvOrCredit == 'Invoice') { + + if ($InvOrCredit=='Invoice') { + $sql = "SELECT debtortrans.trandate, debtortrans.ovamount, @@ -480,6 +581,7 @@ AND debtortrans.branchcode=custbranch.branchcode AND custbranch.salesman=salesman.salesmancode"; } else { + $sql = "SELECT debtortrans.trandate, debtortrans.ovamount, debtortrans.ovdiscount, @@ -515,63 +617,99 @@ AND debtortrans.branchcode=custbranch.branchcode AND custbranch.salesman=salesman.salesmancode"; } - $result = DB_query($sql, $db); - if (DB_num_rows($result) == 0 OR DB_error_no($db) != 0) { - echo '<div class="page_help_text">' . _('There was a problem retrieving the invoice or credit note details for note number') . ' ' . $FromTransNo . ' ' . _('from the database') . '. ' . _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available').'</div>'; - if ($debug == 1) { - echo _('The SQL used to get this information that failed was') . "<br />$sql"; + + $result=DB_query($sql,$db); + if (DB_num_rows($result)==0 OR DB_error_no($db)!=0) { + echo '<p>' . _('There was a problem retrieving the invoice or credit note details for note number') . ' ' . $InvoiceToPrint . ' ' . _('from the database') . '. ' . _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available'); + if ($debug==1) { + echo _('The SQL used to get this information that failed was') . '<br>' . $sql; } break; - include ('includes/footer.inc'); + include('includes/footer.inc'); exit; - } elseif (DB_num_rows($result) == 1) { + } elseif (DB_num_rows($result)==1) { + $myrow = DB_fetch_array($result); /* Then there's an invoice (or credit note) to print. So print out the invoice header and GST Number from the company record */ - if (count($_SESSION['AllowedPageSecurityTokens']) == 1 AND in_array(1, $_SESSION['AllowedPageSecurityTokens']) AND $myrow['debtorno'] != $_SESSION['CustomerID']) { + if (count($_SESSION['AllowedPageSecurityTokens'])==1 AND in_array(1, $_SESSION['AllowedPageSecurityTokens']) AND $myrow['debtorno'] != $_SESSION['CustomerID']){ echo '<p><font color=RED size=4>' . _('This transaction is addressed to another customer and cannot be displayed for privacy reasons') . '. ' . _('Please select only transactions relevant to your company'); exit; } + $ExchRate = $myrow['rate']; $PageNumber = 1; - echo '<table class="table1"><tr><td VALIGN=TOP WIDTH=10%><img src="' . $_SESSION['LogoFile'] . '"></td><td bgcolor="#BBBBBB"><b>'; - if ($InvOrCredit == 'Invoice') { - echo '<font size=4>' . _('TAX INVOICE') . ' '; + + echo '<table class="table1"> + <tr><td VALIGN=TOP WIDTH=10%><img src="' . $_SESSION['LogoFile'] . '"></td> + <td bgcolor="#BBBBBB"><b>'; + + if ($InvOrCredit=='Invoice') { + echo '<font size=4>' . _('TAX INVOICE') . ' '; } else { - echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; + echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; } - echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; + echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br><font size=1>' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; + /* Now print out the logo and company name and address */ - echo '<table class="table1"><tr><td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br />'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; + echo '<table class="table1"> + <tr><td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br>'; + echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; + echo $_SESSION['CompanyRecord']['regoffice2'] . '<br>'; + echo $_SESSION['CompanyRecord']['regoffice3'] . '<br>'; + echo $_SESSION['CompanyRecord']['regoffice4'] . '<br>'; + echo $_SESSION['CompanyRecord']['regoffice5'] . '<br>'; + echo $_SESSION['CompanyRecord']['regoffice6'] . '<br>'; + echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br>'; + echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br>'; + echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br>'; + echo '</td><td WIDTH=50% class=number>'; + /* Now the customer charged to details in a sub table within a cell of the main table*/ - echo '<table class="table1"><tr><td align=left bgcolor="#BBBBBB"><b>' . _('Charge To') . ':</b></td></tr><tr><td bgcolor="#EEEEEE">'; - echo $myrow['name'] . '<br />' . $myrow['address1'] . '<br />' . $myrow['address2'] . '<br />' . $myrow['address3'] . '<br />' . $myrow['address4'] . '<br />' . $myrow['address5'] . '<br />' . $myrow['address6']; + + echo '<table class="table1"> + <tr><td align=left bgcolor="#BBBBBB"><b>' . _('Charge To') . ':</b></td> + </tr><tr><td bgcolor="#EEEEEE">'; + echo $myrow['name'] . + '<br>' . $myrow['address1'] . + '<br>' . $myrow['address2'] . + '<br>' . $myrow['address3'] . + '<br>' . $myrow['address4'] . + '<br>' . $myrow['address5'] . + '<br>' . $myrow['address6']; echo '</td></tr></table>'; /*end of the small table showing charge to account details */ echo _('Page') . ': ' . $PageNumber; echo '</td></tr></table>'; /*end of the main table showing the company name and charge to details */ - if ($InvOrCredit == 'Invoice') { - echo '<table class="table1"> + + if ($InvOrCredit=='Invoice') { + + echo '<table class="table1"> <tr> <td align=left bgcolor="#BBBBBB"><b>' . _('Charge Branch') . ':</b></td> <td align=left bgcolor="#BBBBBB"><b>' . _('Delivered To') . ':</b></td> </tr>'; - echo '<tr> - <td bgcolor="#EEEEEE">' . $myrow['brname'] . '<br />' . $myrow['braddress1'] . '<br />' . $myrow['braddress2'] . '<br />' . $myrow['braddress3'] . '<br />' . $myrow['braddress4'] . '<br />' . $myrow['braddress5'] . '<br />' . $myrow['braddress6'] . '</td>'; - echo '<td bgcolor="#EEEEEE">' . $myrow['deliverto'] . '<br />' . $myrow['deladd1'] . '<br />' . $myrow['deladd2'] . '<br />' . $myrow['deladd3'] . '<br />' . $myrow['deladd4'] . '<br />' . $myrow['deladd5'] . '<br />' . $myrow['deladd6'] . '</td>'; - echo '</tr> - </table><hr>'; - echo '<table class="table1"> + echo '<tr> + <td bgcolor="#EEEEEE">' .$myrow['brname'] . + '<br>' . $myrow['braddress1'] . + '<br>' . $myrow['braddress2'] . + '<br>' . $myrow['braddress3'] . + '<br>' . $myrow['braddress4'] . + '<br>' . $myrow['braddress5'] . + '<br>' . $myrow['braddress6'] . '</td>'; + + echo '<td bgcolor="#EEEEEE">' . $myrow['deliverto'] . + '<br>' . $myrow['deladd1'] . + '<br>' . $myrow['deladd2'] . + '<br>' . $myrow['deladd3'] . + '<br>' . $myrow['deladd4'] . + '<br>' . $myrow['deladd5'] . + '<br>' . $myrow['deladd6'] . '</td> + </tr> + </table><hr>'; + + echo '<table class="table1"> <tr> <td align=left bgcolor="#BBBBBB"><b>' . _('Your Order Ref') . '</b></td> <td align=left bgcolor="#BBBBBB"><b>' . _('Our Order No') . '</b></td> @@ -581,9 +719,9 @@ <td align=left bgcolor="#BBBBBB"><b>' . _('Shipper') . '</b></td> <td align=left bgcolor="#BBBBBB"><b>' . _('Consignment Ref') . '</b></td> </tr>'; - echo '<tr> + echo '<tr> <td bgcolor="#EEEEEE">' . $myrow['customerref'] . '</td> - <td bgcolor="#EEEEEE">' . $myrow['orderno'] . '</td> + <td bgcolor="#EEEEEE">' .$myrow['orderno'] . '</td> <td bgcolor="#EEEEEE">' . ConvertSQLDate($myrow['orddate']) . '</td> <td bgcolor="#EEEEEE">' . ConvertSQLDate($myrow['trandate']) . '</td> <td bgcolor="#EEEEEE">' . $myrow['salesmanname'] . '</td> @@ -591,7 +729,8 @@ <td bgcolor="#EEEEEE">' . $myrow['consignment'] . '</td> </tr> </table>'; - $sql = "SELECT stockmoves.stockid, + + $sql ="SELECT stockmoves.stockid, stockmaster.description, -stockmoves.qty as quantity, stockmoves.discountpercent, @@ -605,26 +744,35 @@ AND stockmoves.type=10 AND stockmoves.transno='" . $FromTransNo . "' AND stockmoves.show_on_inv_crds=1"; + } else { /* then its a credit note */ - echo '<table width=50%><tr> + + echo '<table width="50%"><tr> <td align=left bgcolor="#BBBBBB"><b>' . _('Branch') . ':</b></td> </tr>'; - echo '<tr> - <td bgcolor="#EEEEEE">' . $myrow['brname'] . '<br />' . $myrow['braddress1'] . '<br />' . $myrow['braddress2'] . '<br />' . $myrow['braddress3'] . '<br />' . $myrow['braddress4'] . '<br />' . $myrow['braddress5'] . '<br />' . $myrow['braddress6'] . '</td> + echo '<tr> + <td bgcolor="#EEEEEE">' .$myrow['brname'] . + '<br>' . $myrow['braddress1'] . + '<br>' . $myrow['braddress2'] . + '<br>' . $myrow['braddress3'] . + '<br>' . $myrow['braddress4'] . + '<br>' . $myrow['braddress5'] . + '<br>' . $myrow['braddress6'] . '</td> </tr></table>'; - echo '<hr><table class="table1"><tr> + echo '<hr><table class="table1"><tr> <td align=left bgcolor="#BBBBBB"><b>' . _('Date') . '</b></td> <td align=left bgcolor="#BBBBBB"><b>' . _('Sales Person') . '</font></b></td> </tr>'; - echo '<tr> + echo '<tr> <td bgcolor="#EEEEEE">' . ConvertSQLDate($myrow['trandate']) . '</td> <td bgcolor="#EEEEEE">' . $myrow['salesmanname'] . '</td> </tr></table>'; - $sql = "SELECT stockmoves.stockid, + + $sql ="SELECT stockmoves.stockid, stockmaster.description, stockmoves.qty as quantity, - stockmoves.discountpercent, ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . " * stockmoves.qty) AS fxnet, - (stockmoves.price * " . $ExchRate . ") AS fxprice, + stockmoves.discountpercent, ((1 - stockmoves.discountpercent) * stockmoves.price * ' . $ExchRate . ' * stockmoves.qty) AS fxnet, + (stockmoves.price * ' . $ExchRate . ') AS fxprice, stockmaster.units FROM stockmoves, stockmaster @@ -633,81 +781,109 @@ AND stockmoves.transno='" . $FromTransNo . "' AND stockmoves.show_on_inv_crds=1"; } + echo '<hr>'; echo '<div class="centre"><font size=2>' . _('All amounts stated in') . ' ' . $myrow['currcode'] . '</font></div>'; - $result = DB_query($sql, $db); - if (DB_error_no($db) != 0) { - echo '<div class="page_help_text">' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database').'</div>'; - if ($debug == 1) { - echo '<br />' . _('The SQL used to get this information that failed was') . '<br />'.$sql; + + $result=DB_query($sql,$db); + if (DB_error_no($db)!=0) { + echo '<br>' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database'); + if ($debug==1){ + echo '<br>' . _('The SQL used to get this information that failed was') . '<br>' .$sql; } exit; } - if (DB_num_rows($result) > 0) { + + if (DB_num_rows($result)>0){ echo '<table class="table1"> <tr><th>' . _('Item Code') . '</th> - <th>' . _('Item Description') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Unit') . '</th> - <th>' . _('Price') . '</th> - <th>' . _('Discount') . '</th> - <th>' . _('Net') . '</th></tr>'; - $LineCounter = 17; - $k = 0; //row colour counter - while ($myrow2 = DB_fetch_array($result)) { - if ($k == 1) { - $RowStarter = '<tr class="EvenTableRows">'; - $k = 0; - } else { - $RowStarter = '<tr class="OddTableRows">'; - $k = 1; - } - echo $RowStarter; - $DisplayPrice = number_format($myrow2['fxprice'], 2); - $DisplayQty = number_format($myrow2['quantity'], 2); - $DisplayNet = number_format($myrow2['fxnet'], 2); - if ($myrow2['discountpercent'] == 0) { - $DisplayDiscount = ''; - } else { - $DisplayDiscount = number_format($myrow2['discountpercent'] * 100, 2) . '%'; - } - printf('<td>%s</td> + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('Net') . '</th> + </tr>'; + + $LineCounter =17; + $k=0; //row colour counter + + while ($myrow2=DB_fetch_array($result)){ + + if ($k==1){ + $RowStarter = '<tr class="EvenTableRows">'; + $k=0; + } else { + $RowStarter = '<tr class="OddTableRows">'; + $k=1; + } + + echo $RowStarter; + + $DisplayPrice = number_format($myrow2['fxprice'],2); + $DisplayQty = number_format($myrow2['quantity'],2); + $DisplayNet = number_format($myrow2['fxnet'],2); + + if ($myrow2['discountpercent']==0){ + $DisplayDiscount =''; + } else { + $DisplayDiscount = number_format($myrow2['discountpercent']*100,2) . '%'; + } + + 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> - </tr>', $myrow2['stockid'], $myrow2['description'], $DisplayQty, $myrow2['units'], $DisplayPrice, $DisplayDiscount, $DisplayNet); - if (strlen($myrow2['narrative']) > 1) { - echo $RowStarter . '<td></td><td colspan=6>' . $myrow2['narrative'] . '</td></tr>'; + </tr>', + $myrow2['stockid'], + $myrow2['description'], + $DisplayQty, + $myrow2['units'], + $DisplayPrice, + $DisplayDiscount, + $DisplayNet); + + if (strlen($myrow2['narrative'])>1){ + echo $RowStarter . '<td></td><td colspan=6>' . $myrow2['narrative'] . '</td></tr>'; $LineCounter++; - } - $LineCounter++; - if ($LineCounter == ($_SESSION['PageLength'] - 2)) { - /* head up a new invoice/credit note page */ - $PageNumber++; - echo '</table><table class="table1"><tr><td VALIGN=TOp><img src="' . $_SESSION['LogoFile'] . '"></td><td bgcolor="#BBBBBB"><b>'; - if ($InvOrCredit == 'Invoice') { - echo '<font size=4>' . _('TAX INVOICE') . ' '; - } else { - echo '<font color=red size=4>' . _('TAX CREDIT NOTE') . ' '; - } - echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; - /*Now print out company name and address */ - echo '<table class="table1"><tr> - <td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br />'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; - echo '</td><td class=number>' . _('Page') . ': '.$PageNumber.'</td></tr></table>'; - echo '<table class="table1"><tr> + } + + $LineCounter++; + + if ($LineCounter == ($_SESSION['PageLength'] - 2)){ + + /* head up a new invoice/credit note page */ + + $PageNumber++; + echo '</table> + <table class="table1"> + <tr><td valign=top><img src="' . $_SESSION['LogoFile'] . '"></td> + <td bgcolor="#BBBBBB"><b>'; + + if ($InvOrCredit=='Invoice') { + echo '<font size=4>' . _('TAX INVOICE') . ' '; + } else { + echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; + } + echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; + + /*Now print out company name and address */ + echo '<table class="table1"><tr> + <td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br>'; + echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; + echo $_SESSION['CompanyRecord']['regoffice2'] . '<br>'; + echo $_SESSION['CompanyRecord']['regoffice3'] . '<br>'; + echo $_SESSION['CompanyRecord']['regoffice4'] . '<br>'; + echo $_SESSION['CompanyRecord']['regoffice5'] . '<br>'; + echo $_SESSION['CompanyRecord']['regoffice6'] . '<br>'; + echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br>'; + echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br>'; + echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br>'; + echo '</td><td class=number>' . _('Page') . ': ' . $PageNumber . '</td></tr></table>'; + echo '<table class="table1"><tr> <th>' . _('Item Code') . '</th> <th>' . _('Item Description') . '</th> <th>' . _('Quantity') . '</th> @@ -715,36 +891,45 @@ <th>' . _('Price') . '</th> <th>' . _('Discount') . '</th> <th>' . _('Net') . '</th></tr>'; - $LineCounter = 10; - } //end if need a new page headed up + $LineCounter = 10; + + } //end if need a new page headed up } //end while there are line items to print out echo '</table>'; } /*end if there are stock movements to show on the invoice or credit note*/ + /* check to see enough space left to print the totals/footer */ - $LinesRequiredForText = floor(strlen($myrow['invtext']) / 140); - if ($LineCounter >= ($_SESSION['PageLength'] - 8 - $LinesRequiredForText)) { + $LinesRequiredForText = floor(strlen($myrow['invtext'])/140); + + if ($LineCounter >= ($_SESSION['PageLength'] - 8 - $LinesRequiredForText)){ + /* head up a new invoice/credit note page */ $PageNumber++; - echo '<table class="table1"><tr><td VALIGN=TOp><img src="' . $_SESSION['LogoFile'] . '"></td><td bgcolor="#BBBBBB"><b>'; - if ($InvOrCredit == 'Invoice') { - echo '<font size=4>' . _('TAX INVOICE') . ' '; + echo '<table class="table1"> + <tr><td valign=top><img src="' . $_SESSION['LogoFile'] . '"></td> + <td bgcolor="#BBBBBB"><b>'; + + if ($InvOrCredit=='Invoice') { + echo '<font size=4>' . _('TAX INVOICE') .' '; } else { - echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; + echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; } - echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr><table>'; + echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr><table>'; + /* Print out the logo and company name and address */ - echo '<table class="table1"><tr><td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br />'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; - echo '</td><td class=number>' . _('Page') . ': '.$PageNumber.'</td></tr></table>'; + echo '<table class="table1"> + <tr><td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br>'; + echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; + echo $_SESSION['CompanyRecord']['regoffice2'] . '<br>'; + echo $_SESSION['CompanyRecord']['regoffice3'] . '<br>'; + echo $_SESSION['CompanyRecord']['regoffice4'] . '<br>'; + echo $_SESSION['CompanyRecord']['regoffice5'] . '<br>'; + echo $_SESSION['CompanyRecord']['regoffice6'] . '<br>'; + echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br>'; + echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br>'; + echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br>'; + echo '</td><td class=number>' . _('Page') . ': ' . $PageNumber . '</td></tr></table>'; echo '<table class="table1"><tr> <th>' . _('Item Code') . '</th> <th>' . _('Item Description') . '</th> @@ -753,62 +938,87 @@ <th>' . _('Price') . '</th> <th>' . _('Discount') . '</th> <th>' . _('Net') . '</th></tr>'; + $LineCounter = 10; } + /* Space out the footer to the bottom of the page */ - echo '<br /><br />' . $myrow['invtext']; - $LineCounter = $LineCounter + 2 + $LinesRequiredForText; - while ($LineCounter < ($_SESSION['PageLength'] - 6)) { - echo '<br />'; + + echo '<br><br>' . $myrow['invtext']; + + $LineCounter=$LineCounter+2+$LinesRequiredForText; + while ($LineCounter < ($_SESSION['PageLength'] -6)){ + echo '<br>'; $LineCounter++; } + /* Now print out the footer and totals */ - if ($InvOrCredit == 'Invoice') { - $DisplaySubTot = number_format($myrow['ovamount'], 2); - $DisplayFreight = number_format($myrow['ovfreight'], 2); - $DisplayTax = number_format($myrow['ovgst'], 2); - $DisplayTotal = number_format($myrow['ovfreight'] + $myrow['ovgst'] + $myrow['ovamount'], 2); + + if ($InvOrCredit=='Invoice') { + + $DisplaySubTot = number_format($myrow['ovamount'],2); + $DisplayFreight = number_format($myrow['ovfreight'],2); + $DisplayTax = number_format($myrow['ovgst'],2); + $DisplayTotal = number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],2); } else { - $DisplaySubTot = number_format(-$myrow['ovamount'], 2); - $DisplayFreight = number_format(-$myrow['ovfreight'], 2); - $DisplayTax = number_format(-$myrow['ovgst'], 2); - $DisplayTotal = number_format(-$myrow['ovfreight'] - $myrow['ovgst'] - $myrow['ovamount'], 2); + $DisplaySubTot = number_format(-$myrow['ovamount'],2); + $DisplayFreight = number_format(-$myrow['ovfreight'],2); + $DisplayTax = number_format(-$myrow['ovgst'],2); + $DisplayTotal = number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],2); } + /*Print out the invoice text entered */ echo '<table class=table1><tr> <td class=number>' . _('Sub Total') . '</td> - <td class=number bgcolor="#EEEEEE" width=15%>'.$DisplaySubTot.'</td></tr>'; + <td class=number bgcolor="#EEEEEE" width=15%>' . $DisplaySubTot . '</td></tr>'; echo '<tr><td class=number>' . _('Freight') . '</td> - <td class=number bgcolor="#EEEEEE">'.$DisplayFreight.'</td></tr>'; + <td class=number bgcolor="#EEEEEE">' . $DisplayFreight . '</td></tr>'; echo '<tr><td class=number>' . _('Tax') . '</td> - <td class=number bgcolor="#EEEEEE">'.$DisplayTax.'</td></tr>'; - if ($InvOrCredit == 'Invoice') { - echo '<tr><td class=number><b>' . _('TOTAL INVOICE') . '</b></td> - <td class=number bgcolor="#EEEEEE"><U><b>'.$DisplayTotal.'</b></U></td></tr>'; + <td class=number bgcolor="#EEEEEE">' . $DisplayTax . '</td></tr>'; + if ($InvOrCredit=='Invoice'){ + echo '<tr><td class=number><b>' . _('TOTAL INVOICE') . '</b></td> + <td class=number bgcolor="#EEEEEE"><U><b>' . $DisplayTotal . '</b></U></td></tr>'; } else { - echo '<tr><td class=number><font color=RED><b>' . _('TOTAL CREDIT') . '</b></font></td> - <td class=number bgcolor="#EEEEEE"><font color=RED><U><b>'.$DisplayTotal.'</b></U></font></td></tr>'; + echo '<tr><td class=number><font color=RED><b>' . _('TOTAL CREDIT') . '</b></font></td> + <td class=number bgcolor="#EEEEEE"><font color="red"><U><b>' . $DisplayTotal . '</b></U></font></td></tr>'; } echo '</table>'; } /* end of check to see that there was an invoice record to print */ $FromTransNo++; } /* end loop to print invoices */ } /*end of if FromTransNo exists */ - include ('includes/footer.inc'); + include('includes/footer.inc'); } /*end of else not PrintPDF */ -function PrintLinesToBottom($pdf, $Page_Height, $PageNumber, $FormDesign) { + + +function PrintLinesToBottom () { + + global $pdf; + global $PageNumber; + global $TopOfColHeadings; + global $Left_Margin; + global $Bottom_Margin; + global $line_height; + /* draw the vertical column lines right to the bottom */ - $pdf->line($FormDesign->DataLines->Line1->startx, $Page_Height - $FormDesign->DataLines->Line1->starty, $FormDesign->DataLines->Line1->endx, $Page_Height - $FormDesign->DataLines->Line1->endy); + $pdf->line($Left_Margin+97, $TopOfColHeadings+12,$Left_Margin+97,$Bottom_Margin); + /* Print a column vertical line */ - $pdf->line($FormDesign->DataLines->Line2->startx, $Page_Height - $FormDesign->DataLines->Line2->starty, $FormDesign->DataLines->Line2->endx, $Page_Height - $FormDesign->DataLines->Line2->endy); + $pdf->line($Left_Margin+350, $TopOfColHeadings+12,$Left_Margin+350,$Bottom_Margin); + /* Print a column vertical line */ - $pdf->line($FormDesign->DataLines->Line3->startx, $Page_Height - $FormDe... [truncated message content] |
From: <dai...@us...> - 2011-05-03 10:05:14
|
Revision: 4561 http://web-erp.svn.sourceforge.net/web-erp/?rev=4561&view=rev Author: daintree Date: 2011-05-03 10:05:05 +0000 (Tue, 03 May 2011) Log Message: ----------- quoting and locations fix Modified Paths: -------------- trunk/Credit_Invoice.php trunk/Currencies.php trunk/Locations.php Added Paths: ----------- trunk/doc/Change.log Removed Paths: ------------- trunk/doc/Change.log.html Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-05-02 10:33:55 UTC (rev 4560) +++ trunk/Credit_Invoice.php 2011-05-03 10:05:05 UTC (rev 4561) @@ -47,7 +47,8 @@ custbranch.defaultlocation, custbranch.taxgroupid, stockmoves.loccode, - locations.taxprovinceid + locations.taxprovinceid, + currencies.decimalplaces FROM debtortrans INNER JOIN debtorsmaster ON debtortrans.debtorno = debtorsmaster.debtorno INNER JOIN custbranch ON @@ -59,6 +60,8 @@ stockmoves.transno=debtortrans.transno INNER JOIN locations ON stockmoves.loccode = locations.loccode + INNER JOIN currencies ON + debtorsmaster.currcode=currencies.currabrev WHERE debtortrans.transno = '" . $_GET['InvoiceNumber'] . "' AND debtortrans.type=10 AND stockmoves.type=10"; @@ -89,12 +92,12 @@ $_SESSION['CreditItems']->FreightCost = $myrow['ovfreight']; $_SESSION['CreditItems']->DispatchTaxProvince = $myrow['taxprovinceid']; $_SESSION['CreditItems']->GetFreightTaxes(); + $_SESSION['CreditItems']->CurrDecimalPlaces = $myrow['decimalplaces']; DB_free_result($GetInvHdrResult); /*now populate the line items array with the stock movement records for the invoice*/ - $LineItemsSQL = "SELECT stockmoves.stkmoveno, stockmoves.stockid, stockmaster.description, @@ -187,7 +190,7 @@ } //end of checks on returned data set DB_free_result($LineItemsResult); } else { - prnMsg( _('This invoice can not be credited using the automatic facility') . '<br>' . _('CRITICAL ERROR') . ': ' . _('Please report that a duplicate DebtorTrans header record was found for invoice') . ' ' . $SESSION['ProcessingCredit'],'warn'); + prnMsg( _('This invoice can not be credited using the automatic facility') . '<br />' . _('CRITICAL ERROR') . ': ' . _('Please report that a duplicate DebtorTrans header record was found for invoice') . ' ' . $SESSION['ProcessingCredit'],'warn'); include('includes/footer.inc'); exit; } //valid invoice record returned from the entered invoice number @@ -314,20 +317,20 @@ if ($LnItm->Controlled==1){ - echo "<td><input type=hidden name='Quantity_" . $LnItm->LineNumber ."' value=" . $LnItm->QtyDispatched . "><a href='$rootpath/CreditItemsControlled.php?" . SID . "&LineNo=" . $LnItm->LineNumber . "&CreditInvoice=Yes'>" . $LnItm->QtyDispatched . "</a></td>"; + echo '<td><input type=hidden name="Quantity_' . $LnItm->LineNumber .'" value=' . $LnItm->QtyDispatched . '><a href="' . $rootpath . '/CreditItemsControlled.php?LineNo=' . $LnItm->LineNumber . '&CreditInvoice=Yes">' . $LnItm->QtyDispatched . '</a></td>'; } else { - echo "<td><input tabindex=".$j." type=text class=number name='Quantity_" . $LnItm->LineNumber ."' maxlength=6 size=6 value=" . $LnItm->QtyDispatched . "></td>"; + echo '<td><input tabindex=' . $j . ' type="text" class="number" name="Quantity_' . $LnItm->LineNumber .'" maxlength=6 size=6 value=' . $LnItm->QtyDispatched . '></td>'; } - $DisplayLineTotal = number_format($LineTotal,2); + $DisplayLineTotal = number_format($LineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); $j++; - echo "<td><input tabindex=".$j." type=text class=number name='Price_" . $LnItm->LineNumber . "' maxlength=12 size=6 VALUE=" . $LnItm->Price . "></td> - <td><input tabindex=".$j." type=text class=number name='Discount_" . $LnItm->LineNumber . "' maxlength=3 size=3 VALUE=" . ($LnItm->DiscountPercent * 100) . "></td> - <td class=number>$DisplayLineTotal</td>"; + echo '<td><input tabindex=' . $j . ' type=text class=number name="Price_' . $LnItm->LineNumber . '" maxlength=12 size=6 value=' . $LnItm->Price . '></td> + <td><input tabindex=' . $j . ' type=text class="number" name="Discount_' . $LnItm->LineNumber . '" maxlength=3 size=3 value=' . ($LnItm->DiscountPercent * 100) . '></td> + <td class=number>' . $DisplayLineTotal . '</td>'; /*Need to list the taxes applicable to this line */ echo '<td>'; @@ -335,14 +338,14 @@ if (is_array($_SESSION['CreditItems']->LineItems[$LnItm->LineNumber]->Taxes) ){ foreach ($_SESSION['CreditItems']->LineItems[$LnItm->LineNumber]->Taxes AS $Tax) { if ($i>0){ - echo '<br>'; + echo '<br />'; } echo $Tax->TaxAuthDescription; $i++; } } echo '</td>'; - echo '<td class=number>'; + echo '<td class="number">'; } $i=0; // initialise the number of taxes iterated through @@ -353,10 +356,10 @@ } foreach ($LnItm->Taxes as $Tax) { if ($i>0){ - echo '<br>'; + echo '<br />'; } if (!isset($_POST['ProcessCredit'])) { - echo '<input type=text class=number name="' . $LnItm->LineNumber . $Tax->TaxCalculationOrder . + echo '<input type=text class="number" name="' . $LnItm->LineNumber . $Tax->TaxCalculationOrder . '_TaxRate" maxlength=4 size=4 value="' . $Tax->TaxRate*100 . '">'; } $i++; @@ -372,17 +375,17 @@ } $TaxTotal += $TaxLineTotal; - $DisplayTaxAmount = number_format($TaxLineTotal ,2); - $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,2); + $DisplayTaxAmount = number_format($TaxLineTotal ,$_SESSION['CreditItems']->CurrDecimalPlaces); + $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); if (!isset($_POST['ProcessCredit'])) { echo '</td>'; echo '<td class=number>' . $DisplayTaxAmount . '</td> - <td class=number>' . $DisplayGrossLineTotal . "</td> - <td><a href='". $_SERVER['PHP_SELF'] . "?" . SID . "&Delete=" . $LnItm->LineNumber . "'>" . _('Delete') . '</a></td></tr>'; + <td class=number>' . $DisplayGrossLineTotal . '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $LnItm->LineNumber . '">' . _('Delete') . '</a></td></tr>'; - echo '<tr'.$RowStarter . "><td colspan=12><TEXTAREA tabindex=".$j." name='Narrative_" . $LnItm->LineNumber . "' cols=100% rows=1>" . $LnItm->Narrative . "</TEXTAREa><br><hr></td></tr>"; + echo '<tr' . $RowStarter . '><td colspan=12><textarea tabindex=' . $j .' name="Narrative_' . $LnItm->LineNumber . '" cols=100% rows=1>' . $LnItm->Narrative . '</textarea><br /><hr></td></tr>'; $j++; } } /*end foreach loop displaying the invoice lines to credit */ @@ -405,7 +408,7 @@ $i=0; // initialise the number of taxes iterated through foreach ($_SESSION['CreditItems']->FreightTaxes as $FreightTaxLine) { if ($i>0){ - echo '<br>'; + echo '<br />'; } echo $FreightTaxLine->TaxAuthDescription; $i++; @@ -416,7 +419,7 @@ $i=0; foreach ($_SESSION['CreditItems']->FreightTaxes as $FreightTaxLine) { if ($i>0){ - echo '<br>'; + echo '<br />'; } if (!isset($_POST['ProcessCredit'])) { @@ -435,13 +438,13 @@ if (!isset($_POST['ProcessCredit'])) { echo '</td>'; - echo '<td class="number">' . number_format($FreightTaxTotal,2) . '</td> - <td class="number">' . number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,2) . '</td> + echo '<td class="number">' . number_format($FreightTaxTotal,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> + <td class="number">' . number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> </tr>'; } $TaxTotal += $FreightTaxTotal; -$DisplayTotal = number_format($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost,2); +$DisplayTotal = number_format($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost,$_SESSION['CreditItems']->CurrDecimalPlaces); if (!isset($_POST['ProcessCredit'])) { echo '<tr> @@ -449,7 +452,7 @@ <td class=number><hr><b>' . $DisplayTotal . '</b><hr></td> <td colspan=2></td> <td class=number><hr><b>' . number_format($TaxTotal,2) . '<hr></td> - <td class=number><hr><b>' . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),2) . '</b><hr></td> + <td class=number><hr><b>' . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),$_SESSION['CreditItems']->CurrDecimalPlaces) . '</b><hr></td> </tr></table>'; } $DefaultDispatchDate = Date($_SESSION['DefaultDateFormat']); @@ -504,7 +507,6 @@ $Result = DB_query($SQL,$db); $myrow = DB_fetch_row($Result); - /*Do some rounding */ $_SESSION['CreditItems']->total = round($_SESSION['CreditItems']->total,2); @@ -1442,9 +1444,9 @@ echo '<div class="centre">'._('Credit Note number') . ' ' . $CreditNo . ' ' . _('has been processed'); if ($_SESSION['InvoicePortraitFormat']==0){ - echo "<br /><a href='". $rootpath . "/PrintCustTrans.php?" . SID . "&FromTransNo=" . $CreditNo . "&InvOrCredit=Credit&PrintPDF=True'>" . _('Print this credit note') . '</a>'; + echo '<br /><a href="' . $rootpath . '/PrintCustTrans.php?FromTransNo=' . $CreditNo . '&InvOrCredit=Credit&PrintPDF=True">' . _('Print this credit note') . '</a>'; } else { - echo "<br /><a href='". $rootpath . "/PrintCustTransPortrait.php?" . SID . "&FromTransNo=" . $CreditNo . "&InvOrCredit=Credit&PrintPDF=True'>" . _('Print this credit note') . '</a>'; + echo '<br /><a href="' . $rootpath . '/PrintCustTransPortrait.php?FromTransNo=' . $CreditNo . '&InvOrCredit=Credit&PrintPDF=True">' . _('Print this credit note') . '</a>'; } echo '</div>'; /*end of process credit note */ @@ -1452,21 +1454,22 @@ } else { /*Process Credit NOT set so allow inputs to set up the credit note */ - echo "<br><table class=selection>"; + echo '<br /><table class=selection>'; - echo '<tr><td>' . _('Credit Note Type') . "</td><td><select tabindex=".$j." name=CreditType>"; + echo '<tr><td>' . _('Credit Note Type') . '</td> + <td><select tabindex=' . $j .' name="CreditType">'; - if (!isset($_POST['CreditType']) OR $_POST['CreditType']=="Return"){ + if (!isset($_POST['CreditType']) OR $_POST['CreditType']=='Return'){ echo '<option selected value="Return">' . _('Goods returned to store') . '</option>'; - echo '<option VALUE="WriteOff">' . _('Goods written off') . '</option>'; - echo '<option VALUE="ReverseOverCharge">' . _('Reverse overcharge') . '</option>'; + echo '<option value="WriteOff">' . _('Goods written off') . '</option>'; + echo '<option value="ReverseOverCharge">' . _('Reverse overcharge') . '</option>'; } elseif($_POST['CreditType']=='WriteOff') { echo '<option selected value="WriteOff">' . _('Goods written off') . '</option>'; - echo '<option VALUE="Return">' . _('Goods returned to store') . '</option>'; - echo '<option VALUE="ReverseOverCharge">' . _('Reverse overcharge') . '</option>'; + echo '<option value="Return">' . _('Goods returned to store') . '</option>'; + echo '<option value="ReverseOverCharge">' . _('Reverse overcharge') . '</option>'; } else { - echo '<option VALUE="WriteOff">' . _('Goods written off') . '</option>'; - echo '<option VALUE="Return">' . _('Goods returned to store') . '</option>'; + echo '<option value="WriteOff">' . _('Goods written off') . '</option>'; + echo '<option value="Return">' . _('Goods returned to store') . '</option>'; echo '<option selected value="ReverseOverCharge">' . _('Reverse overcharge') . '</option>'; } echo '</select></td></tr>'; @@ -1478,7 +1481,7 @@ echo '<tr><td>' . _('Goods returned to location') . '</td><td><select tabindex='.$j.' name=Location>'; - $SQL='SELECT loccode, locationname FROM locations'; + $SQL="SELECT loccode, locationname FROM locations"; $Result = DB_query($SQL,$db); if (!isset($_POST['Location'])){ @@ -1487,24 +1490,24 @@ while ($myrow = DB_fetch_array($Result)) { if ($_POST['Location']==$myrow['loccode']){ - echo "<option selected VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } - echo "</select></td></tr>"; + echo '</select></td></tr>'; $j++; } elseif($_POST['CreditType']=='WriteOff') { /* the goods are to be written off to somewhere */ - echo '<tr><td>' . _('Write off the cost of the goods to') . '</td><td><select TABINDEX='.$j.' name="WriteOffGLCode">'; + echo '<tr><td>' . _('Write off the cost of the goods to') . '</td><td><select tabindex=' . $j .' name="WriteOffGLCode">'; - $SQL='SELECT accountcode, + $SQL="SELECT accountcode, accountname - FROM chartmaster, accountgroups - WHERE chartmaster.group_=accountgroups.groupname - AND ccountgroups.pandl=1 ORDER BY chartmaster.accountcode'; - + FROM chartmaster, accountgroups + WHERE chartmaster.group_=accountgroups.groupname + AND ccountgroups.pandl=1 ORDER BY chartmaster.accountcode"; + $Result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($Result)) { @@ -1521,8 +1524,8 @@ $_POST['CreditText'] = ''; } $j++; - echo '<tr><td>' . _('Credit note text') . '</td><td><textarea tabindex='.$j.' name=CreditText cols=31 rows=5>' . $_POST['CreditText'] . '</textarea></td></tr>'; - echo '</table><br><div class="centre"><input TABINDEX='.$j.' type=submit name=Update Value=' . _('Update') . '><p>'; + echo '<tr><td>' . _('Credit note text') . '</td><td><textarea tabindex=' . $j . ' name=CreditText cols=31 rows=5>' . $_POST['CreditText'] . '</textarea></td></tr>'; + echo '</table><br /><div class="centre"><input tabindex=' . $j . ' type=submit name=Update Value=' . _('Update') . '><p>'; $j++; echo '<input type="submit" tabindex='.$j++.' name="ProcessCredit" Value="' . _('Process Credit') .'"></div>'; } Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2011-05-02 10:33:55 UTC (rev 4560) +++ trunk/Currencies.php 2011-05-03 10:05:05 UTC (rev 4561) @@ -1,7 +1,6 @@ <?php -/* $Revision: 1.20 $ */ + /* $Id$*/ -//$PageSecurity = 9; include('includes/session.inc'); $title = _('Currencies Maintenance'); @@ -141,7 +140,7 @@ if ($myrow[0] > 0) { prnMsg(_('Cannot delete this currency because customer accounts have been created referring to this currency') . - '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('customer accounts that refer to this currency'),'warn'); + '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('customer accounts that refer to this currency'),'warn'); } else { $sql= "SELECT COUNT(*) FROM suppliers WHERE suppliers.currcode = '".$SelectedCurrency."'"; $result = DB_query($sql,$db); @@ -149,14 +148,14 @@ if ($myrow[0] > 0) { prnMsg(_('Cannot delete this currency because supplier accounts have been created referring to this currency') - . '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('supplier accounts that refer to this currency'),'warn'); + . '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('supplier accounts that refer to this currency'),'warn'); } else { $sql= "SELECT COUNT(*) FROM banktrans WHERE banktrans.currcode = '" . $SelectedCurrency . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0] > 0){ prnMsg(_('Cannot delete this currency because there are bank transactions that use this currency') . - '<br>' . ' ' . _('There are') . ' ' . $myrow[0] . ' ' . _('bank transactions that refer to this currency'),'warn'); + '<br />' . ' ' . _('There are') . ' ' . $myrow[0] . ' ' . _('bank transactions that refer to this currency'),'warn'); } elseif ($FunctionalCurrency==$SelectedCurrency){ prnMsg(_('Cannot delete this currency because it is the functional currency of the company'),'warn'); } else { @@ -216,17 +215,17 @@ } if ($myrow[1]!=$FunctionalCurrency){ - printf("<td><img src=\"%s\"></td> + printf('<td><img src="%s"></td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td class=number>%s</td> <td class=number>%s</td> - <td><a href=\"%s&SelectedCurrency=%s\">%s</a></td> - <td><a href=\"%s&SelectedCurrency=%s&delete=1\">%s</a></td> - <td><a href=\"%s/ExchangeRateTrend.php?%s\">" . _('Graph') . "</a></td> - </tr>", + <td><a href="%s&SelectedCurrency=%s">%s</a></td> + <td><a href="%s&SelectedCurrency=%s&delete=1">%s</a></td> + <td><a href="%s/ExchangeRateTrend.php?%s">' . _('Graph') . '</a></td> + </tr>', $ImageFile, $myrow[1], $myrow[0], @@ -234,23 +233,23 @@ $myrow[3], number_format($myrow[4],5), number_format(GetCurrencyRate($myrow[1],$CurrencyRatesArray),5), - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[1], _('Edit'), - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[1], _('Delete'), $rootpath, - SID . '&CurrencyToShow=' . $myrow[1]); + '&CurrencyToShow=' . $myrow[1]); } else { - printf("<td><img src=\"%s\"></td> + printf('<td><img src="%s"></td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td class=number>%s</td> <td colspan=4>%s</td> - </tr>", + </tr>', $ImageFile, $myrow[1], $myrow[0], @@ -261,19 +260,19 @@ } } //END WHILE LIST LOOP - echo '</table><br>'; + echo '</table><br />'; } //end of ifs and buts! if (isset($SelectedCurrency)) { - echo '<div class="centre"><a href=' .$_SERVER['PHP_SELF'] . '?' . SID. '>'._('Show all currency definitions').'</a></div>'; + echo '<div class="centre"><a href="' .$_SERVER['PHP_SELF'] . '">'._('Show all currency definitions').'</a></div>'; } -echo '<br>'; +echo '<br />'; if (!isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedCurrency) AND $SelectedCurrency!='') { @@ -300,12 +299,11 @@ - echo '<input type="hidden" name="SelectedCurrency" VALUE="' . $SelectedCurrency . '">'; - echo '<input type="hidden" name="Abbreviation" VALUE="' . $_POST['Abbreviation'] . '">'; + echo '<input type="hidden" name="SelectedCurrency" value="' . $SelectedCurrency . '">'; + echo '<input type="hidden" name="Abbreviation" value="' . $_POST['Abbreviation'] . '">'; echo '<table class=selection><tr> <td>' . _('ISO 4217 Currency Code').':</td> - <td>'; - echo $_POST['Abbreviation'] . '</td></tr>'; + <td>' . $_POST['Abbreviation'] . '</td></tr>'; } else { //end of if $SelectedCurrency only do the else when a new record is being entered if (!isset($_POST['Abbreviation'])) {$_POST['Abbreviation']='';} @@ -316,27 +314,35 @@ echo '<tr><td>'._('Currency Name').':</td>'; echo '<td>'; - if (!isset($_POST['CurrencyName'])) {$_POST['CurrencyName']='';} + if (!isset($_POST['CurrencyName'])) { + $_POST['CurrencyName']=''; + } echo '<input ' . (in_array('CurrencyName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="CurrencyName" size=20 maxlength=20 VALUE="' . $_POST['CurrencyName'] . '">'; echo '</td></tr>'; echo '<tr><td>'._('Country').':</td>'; echo '<td>'; - if (!isset($_POST['Country'])) {$_POST['Country']='';} + if (!isset($_POST['Country'])) { + $_POST['Country']=''; + } echo '<input ' . (in_array('Country',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Country" size=30 maxlength=50 VALUE="' . $_POST['Country'] . '">'; echo '</td></tr>'; echo '<tr><td>'._('Hundredths Name').':</td>'; echo '<td>'; - if (!isset($_POST['HundredsName'])) {$_POST['HundredsName']='';} - echo '<input ' . (in_array('HundredsName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="HundredsName" size=10 maxlength=15 VALUE="'. $_POST['HundredsName'].'">'; + if (!isset($_POST['HundredsName'])) { + $_POST['HundredsName']=''; + } + echo '<input ' . (in_array('HundredsName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="HundredsName" size=10 maxlength=15 value="'. $_POST['HundredsName'].'">'; echo '</td></tr>'; echo '<tr><td>'._('Exchange Rate').':</td>'; echo '<td>'; - if (!isset($_POST['ExchangeRate'])) {$_POST['ExchangeRate']='';} - echo '<input ' . (in_array('ExchangeRate',$Errors) ? 'class="inputerror"' : '' ) .' type="text" class=number name="ExchangeRate" size=10 maxlength=9 VALUE='. $_POST['ExchangeRate'].'>'; + if (!isset($_POST['ExchangeRate'])) { + $_POST['ExchangeRate']=''; + } + echo '<input ' . (in_array('ExchangeRate',$Errors) ? 'class="inputerror"' : '' ) .' type="text" class=number name="ExchangeRate" size=10 maxlength=9 value='. $_POST['ExchangeRate'].'>'; echo '</td></tr>'; echo '</table>'; - echo '<br><div class="centre"><input type="Submit" name="submit" value='._('Enter Information').'></div>'; + echo '<br /><div class="centre"><input type="Submit" name="submit" value='._('Enter Information').'></div>'; echo '</form>'; Modified: trunk/Locations.php =================================================================== --- trunk/Locations.php 2011-05-02 10:33:55 UTC (rev 4560) +++ trunk/Locations.php 2011-05-03 10:05:05 UTC (rev 4561) @@ -374,7 +374,6 @@ printf('<td>%s</td> <td>%s</td> <td>%s</td> - <td>%s</td> <td><a href="%sSelectedLocation=%s">' . _('Edit') . '</td> <td><a href="%sSelectedLocation=%s&delete=1">' . _('Delete') . '</td> </tr>', @@ -449,8 +448,8 @@ $_POST['Managed'] = $myrow['managed']; - echo '<input type="hidden" name="SelectedLocation" value="' . $SelectedLocation . '>'; - echo '<input type="hidden" name="LocCode" value="' . $_POST['LocCode'] . '>'; + echo '<input type="hidden" name="SelectedLocation" value="' . $SelectedLocation . '">'; + echo '<input type="hidden" name="LocCode" value="' . $_POST['LocCode'] . '">'; echo '<table class="selection">'; echo '<tr><th colspan=2><font size=3 color=blue>'._('Amend Location details').'</font></th></tr>'; echo '<tr><td>' . _('Location Code') . ':</td><td>'; Added: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log (rev 0) +++ trunk/doc/Change.log 2011-05-03 10:05:05 UTC (rev 4561) @@ -0,0 +1,3271 @@ +webERP Change Log + +3/5/11 Locations.php fix table hidden POST variable quotes mismatch - also mismatch between number of parameters in printf output +2/5/11 Make order entry show the currency decimal places for amounts and totals also in invoicing SelectOrderItems.php and ConfirmDispatch_Invoice.php +2/5/11 Fix PO_PDFPurchOrder.php to allow emailing but email option not to appear on printed/emailed orders +1/5/11 Tim PageSecurity.php fix bug that prevented updates to Security Token for a particular script. +1/5/11 Many scripts quoting changes single quotes for strings double quotes for xhtml variables +1/5/11 SecuirtyTokens allow deletion of tokens if no scripts using it +28/4/11 Tim - add facility to select an account group to limit GL acccounts returned as options to post payments to +28/4/11 Tim - new SecurityTokens script +28/4/11 Fix Secunia reported vulnerability by checking for dodgy characters in CompanyNameField - then matched to a real directory on the web-server + +18/4/11 - Version 4.03.8 Release + +18/4/11 Phil: Update zh_HK.utf8, pt_BR.utf8, fa_IR.utf8 from launchpad translations +18/4/11 Phil: Changed PurchData.php back to now have free form text entry of unit of measure - as suggested by Brian May - think it works better this way +18/4/11 Phil: Removed redundant fields that are not used anywhere from DefinePOClass and the various function to add lines to purchase orders and to update purhcase order lines - netweight, cuft, kgs, itemno, total_quantity etc. all this data can be retrieved without duplication in purchorderdetails +16/4/11 Phil: Tim's changes in launchpad fork to 4663 - xhtml syntax fixes +15/4/11 Phil: Copy Exson's traditional Chinese back to zh_HK.utf8 +11/4/11 Ricard: new pcAuthorizeExpenses.php that shows the current balance of the tab to the authorizer. Before the authorizer did not see this information. +11/4/11 Tim: StockLocTransfer.php added $_POST['LinesCounter'] -= 10; +11/4/11 Tim/Phil: Use PHP 5 specific scandir to sort languages into alphabetic order for UserSettings and WWW_Users language selection +10/4/11 Tim: AddCustomerContacts.php use single field rather than * in SQL> +10/4/11 Tim: GLAccountInquiry.php show None if no tag selected +10/4/11 Tim : PDFPrintLabel.php javascript fix +10/4/11 Tim: Add perishable to StockTransfer.php and PDFStockTransfer +10/4/11 Tim: PDFPeriodStockTransListing - new report to print off stock transactions of a specified type for a selected period>/p> +10/4/11 Tim: PDFStockTransListing.php option to print off transactions by inventory location +10/4/11 Tim: Stocks.php - more logical use of $New and $_POST['New'] +10/4/11 Tim: Payments.php PaymentMethods.php Add new field userpreprintedstationery to payment methods to determine whether to print cheques +5/4/11 Tim: includes/LanguageSetup.php - discovered solution to Turkish character set problem!! +5/4/11 Phil: couple of is_date functions left over from experiment to see if changing fixed Turkish - now removed from SupplierInvoice.php and PDFOrdersInvoiced.php +5/4/11 Phil: SuppCreditGRNs was not showing old GRNs and no way to input an older date +31/3/11 Phil:Fix link to create purchase order from purchasing data link on SelectProduct.php - thanks Brian May for pointing out the bug +31/3/11 Phil: Updated all tranlations from the launchpad site +31/3/11 Tim: Fix to make languages display immediately on change - session.inc moved includes/LanguageSetup.php down +30/3/11 Tim: New ReprintGRN.php script takes a purchase order and allows any line received to have GRN(s) reprinted +29/3/11 Phil: checking for unquoted SQL and for SQL where literals quoted with double quotes rather than single - double quotes are not ANSI compatible - so making the SQL more ANSI compatible by doing this as suggested by Tim. Many many scripts involved will take a week or so +<p /> +27/3/11 - Version 4.03.5 Release + +27/3/11: Phil fixed SQL upgrade script to add the Z_ChangeSupplierCode.php script is added to the scripts table +27/3/11: Phil fixed some SQL for ansi compatibility I had changed in error - would affect users running strict mode ansi +27/3/11: Phil at Brian May's suggestion added conversion factor to item look up in PO_Items.php - also ensured quantity entry no longer trapped for commas and commas removed from numbers before committing. Also trapped for committing purchase orders with no lines + +26/3/11 - Version 4.03 Release + +26/3/11: Phil added some error trapping to codes of pcTabTypes +24/3/11: Phil rework PDFStockTransfer.php remove a few round trips to DB and added facility to be able to select a transfer number to reprint - added to main menu +24/3/11: James wer...@ya... Added snall image in middle of SelectProduct.php +19/3/11: Phil added country to packing slips +18/3/11: Marcos Garcia Trejo Added Z_ChangeSupplierCode.php +18/3/11: Ricard add orderby transdate to DailyBankTransactions.php +18/3/11: Phil check for Customers.php CustomerBranches.php and Stocks.php now traps codes containing spaces - as well as other illegal characters +15/3/11: Phil PricesByCost.php - made it update prices where there is already a price starting on today's date +15/3/11: Phil SelectOrderItems.php customer selection now done using a hidden $_POST rather than parsing debtorno hyphen branchcode. +15/3/11: Phil Locations.php new field for CounterSales branch code - instead of parsing it from a single field with a hyphen in it. CounterSales.php now uses the new field for customer branch +14/3/11: Phil SelectSalesOrder.php now lists with sales order value denominated in functional currency with total of listed outstadning sales orders (or quotations) shown at the bottom of the listing +12/3/11: Tim Now allow space in codes +12/3/11: SelectSalesOrder.php now allows any number of sales orders to be selected and purchase orders placed for the aggregate of items on the selected sales orders +12/3/11: SuppPriceList.php removed a round trip to DB to get currency - fixed function to get pdf to new TCPDF Output +12/3/11: Exson fix all htmlentities to use ENTQUOTES, 'UTF-8' option so other character sets work with it +10/3/11: Phil fix pagination of PrintCustOrder_generic.php - second copy was not restarting page numbers +10/3/11: Tims launchpad fixes brought in MRP.php fix for table charset utf8 so joins work correctly; typeo in PO_Header preventing purchasing data being retrieved ($result not $Result); correct sql on searching for customer in SelectCreditItems.php; StockStatus.php pricing history bug resolved (4450); StockQuantityByDate.php now allowed to show for all categories - enclosed 'All' in gettext +8/3/11: Tim/Phil PO_Items.php in committing an order detail the assetid of 'Not an Asset' was being inserted to an integer field. Modified $_POST['AssetID'] to = 0 if it was 'Not an Asset' as advised by Tim +8/3/11: Phil fix SalesAnalysis reports for TCPDF as reported by Joe Zhou +5/3/11: Kovács Attila fix to Stocks.php to use ANSI GROUP BY for aggregate functions SQL +5/3/11: Kovács Attila fix to LanguageSetup.php to use utf-8 not ISO-8859-1. Phil hardcoded UTF-8 now as no dynamic changing of character set required all translations are utf-8 +3/3/11: Exson/Baran/Phil fix to customer login to ensure that other customers orders are not displayed when searching by customer ref or order no +3/3/11: Tim launchpad mods to revision 4441 including change to allow supplier currency to be changed if there are no transactions already against the supplier. Ensure credit note session variable is unset before attempting to create a new credit note from the supplier form. Tim's work to add perisable expiry dates to the serial items logic - affects quite a few scripts. Headings to stock check script even if no quantity is shown. Portrait quotations. Not included change to default delivery date to the date the customer requested - left to be the current day's date. Not included Tim's unit pricing work .. yet launchpad revisions 4442-4447 inclusive +27/2/11: Phil/Tim/Peter launchpad added category option for MRPShortages.php links with matching quotes in WorkOrderEntry +27/2/11: Phil StockUsage.php now totals usage each month even in months where there was none - average now includes months with no usage +27/2/11: Phil fix units deletion issue reported by Exson in UnitsOfMeasure.php script - checked for none existant units field in contracts table - removed the check +22/2/11: Phil fix PDFTopItems.php for changed variable names - now using CamelCase tried to rework to conform +22/2/11: Phil remove options for PDFLanguage that are not unique in WWW_Users.php - make it default to the users settings in the SESSION for UserSettings.php +18/2/11: Phil/Don Change PageSecurity array variable name to PageSecurityArray - caused problems with conflict with PageSecurity variable where register_globals = on; +18/2/11: PO_Items.php make number_format variables turn back into numbers for > 1000 +16/2/11: FixedAssetItems.php now checks for location before allowing additions +16/2/11: Company preferences - changed wording of stock integration at cost removed the word standard as suggested by Exson +16/2/11: SelectCreditItems.php formating/conventions lower case html and CreditInvoice.php +15/2/11: Phil Make invoicing warn the user when no taxes are defined for a tax group - i.e. there is a configuration error with taxes +<p /> +15/2/11 Release 4.03RC2 +<p /> +15/2/11: Phil UpgradeDatabase.php fix to upgrade from 4.01RC1 !! +15/2/11: Phil PrintCustTrans.php and PrintCustTransPortrait.php htmlspecialchars_decode($narrative) - conversion at the time of committing to DB needs to be unconverted. Also in ConfirmDispatch_Invoice.php +15/2/11: Phil SelectCustomer.php removed showing blank message when $msg was empty +<p /> +13/2/11 Release 4.03RC1 +<p /> +13/2/11:Phil GoodsReceivedControlled InputSerialItems and friends - now uses session identifier to ensure uniqueness is several people entering stock receipts +13/2/11:Phil Contracts.php SelectOrderItems.php customer selection mechanism reworked - was causing issues in Contracts as noted by DK Shukla +8/2/11: Tim Rework CounterSales.php so that it is now possible to sell items that have sales/purchasing tax +8/2/11: Phil Fix InventoryPlanning and InventoryPlanningPrefSupplier to only show sales order demand - excluding quotations. Also fixed for conversionfactor as now all purchase order quantities are in our normal stock units +8/2/11: Phil Fix incorrect layout of narrative on multiple lines of PDFQuotation.php as reported by Ricard Andreu +8/2/11: Tim/Ricard StockLocTransfer.php can now transfer the same amount as on hand in the location - previously checked to see that the transfer was less than the quantity on hand (when checking for negative stock) +8/2/11: Tim Payments.php and javascripts/MiscFunctions.js corrections to javascript +8/2/11: Phil PDFGrn.php turns out preview is used from the form modification script doh! Over simplificaton reversed to reinstate preview mode +6/2/11: Otandeka Removed debug prnMsg in FixedAssetDepreciation +5/2/11: Phil SystemParameters.php new option to AutoAuthorisePO when the user has authority to do so +5/2/11: Phil PO_Items.php fixed non-existant variables on Enter nominal line. Added option to automatically authorise when user is an authoriser as well as a creator +5/2/11: Phil PDFGrn.php rewrote - preview never used - simplified +4/2/11: Tim CostUpdate.php allow cost update with appropriate permissions token 10 hard coded +4/2/11: Phil SelectCustomer.php rejig selection options in more logical way. Used non-specific SQL to search by any part of the address +2/2/11: Phil PDFTopItems.php and TopItems.php removed mysql specific SQL +30/1/11: Phil GoodsReceived.php rework for supplier units and conversion factor etc now in PO class +30/1/11: Phil PDFGrn.php rework for supplier units and conversion factor etc now in PO class +30/1/11:Exson changed PDFLowGP report remove % from gettext string +29/1/11:Tim fix reportwriter with tcpdf using parent::__construct rather than $this->Cpdf( +24/1/11:Phil Depreciation fixes - SelectAsset by description fix +23/1/11:Peter Otandeka: PDFTopItems.php SQL quoting fixes +23/1/11: Phil Fix Depreciation posting and dates of end of periods +23/1/11:Phil changed back references throughout several MRP scripts from is_date to Is_Date - as Is_Date is used throughout the code and much bigger job to change all references to is_date +20/1/11: Tim changed back addinfo calls to addInfo on PDF reports - Zhigio originally thought to be an issue with Turkish utf-8 pdfs but turned out to be a red herring. class.pdf call changed back to addInfo too - most of calls had not been changed to lower case info +20/1/11: Tim changed PricesBasedOnMarkUp to have end date day before new prices effective from +20/1/11: Phil FixedAssetRegister.php FixedAssetDepreciation.php fixes +19/1/11: Phil modified GLBudgets.php to allow entry of last years budget too +17/1/11: Phil More purchasing work removing redundant queries rationalising code - new layout with supplier units +15/1/11: Tim removed MX record check from IsEmail function in includes/MiscFunctions.php +15/1/11: Tim/Peter Otandeka SQL quoting a whole bunch of scripts - changing single quotes to doubles - didn't apply ones where no variables required quoting +14/1/11: Phil install scripts modified to copy over FormDesigns under the new company directory created +14/1/11: Phil Updates to manual for security and supplier invoice entry +13/1/11:Phil PO_Items.php remove redundant code, setup entry of lines in supplier units +13/1/11:Tim Z_ChangeCustomerCode.php now has foreign key checks defeated when deleting the old customer record and custbranch record +13/1/11:Phil SupplierInvoice.php and SupplierCredit.php now check to ensure the total of contracts fixed asset charges goods received charges, shipment charges and GL charges are at least equal to the amount of the invoice or credit. It was possible when GL interface turned off to get strange results +12/1/11:Phil DailyBankTransactions.php made it so a range of dates can be selected but defaults to just today +11/1/11:Phil Fix choice of portrait or landscape invoices - fix landscape default form layout. Fix portrait invoice logo position +11/1/11:Phil Fix customer transaction inquiries to show correct links where user is not authorised for credit notes or GL inquiries +11/1/11:Phil SupplierCredit.php and SupplierInvoice.php recalculate price variance to post differences on fixed asset additions correctly +11/1/11:Phil PO_PDFPurchOrder.php - fixed for coding conventions removed uneccessary sql calls +11/1/11: Murray Collingwood: Emailing invoices was writing the pdf file twice - once with fwrite and once with the TCPDF output function with the option 'F' +8/1/11 Ricard Andreu: Z_ChangeCustomerCode.php added typeid field that made change customer code fail. Also corrected typo for foreign key checking side stepping for Z_ChangeBranchCode.php +5/1/11 Phil: Bug fixes AssetLocationTransfer and Supplier Contacts +4/1/11 Paul T: Bug# 3151192 - insert underscore for superglobal. +5/1/11 Phil: Bug fixes AssetLocationTransfer and Supplier Contacts +4/1/11 Phil: Start rework of purchase order scripts ... again. +4/1/11 Phil: Select Purchase orders now defaults to just pending and authorised/printed - other statii are options +1/1/11 Phil: Upgrade script make capable of upgrades from any earlier version - and email a backup to the user. Deleted DBUpgradeNumber config variable now use the VersionNumber already there +31/12/10 Tim: Tidy up of CounterSales.php - CamelCasing, quoting SQL, closing slashes in xhtml tags +29/12/10 Phil: Reverted to single SQL upgrade file per release - but retaining Tim's upgrade mechanism if the DBUpgradeNumber is out of date. Removed pseudo SQL language required for upgrade script and the 52 update files - just applies plain vanilla SQL from the scripts required +29/12/10 Tim: DB upgrade mechanism with separate pseudo SQL for each database change in a separate file + 52 files of updates since 3.11.4 +21/12/10 Phil : Reworked PDFPrintLabels.php to conform to standards and corrected SQL for prices +21/12/10 Ricard Andreu: PDFPrintLabels.php was not checking for end date of prices - fixed +19/12/10 Phil: SelectOrderItems.php ConfirmDispatch_Invoice.php add code to handle asset disposals. +14/12/10 Phil: modify purchasing scripts for coding conventions/readability +11/12/10 Phil: Have populated the new field stockcheckdate in stockcheckfreeze and modified PDFStockCheckComparison to use this field when posting the GL - stockmoves need to be on the current day otherwise historical balances will all need to be updated. But narrative shows the date of the stock check for which the adjustment is being made +9/12/10 James Murray: highlighted a bug in SupplierInvoice.php (and also in SupplierCredit.php) where the due date of the invoice/credit was not calculated correctly based on the terms - it was picking up the current date rather than the invoice/credit date. Now fixed +8/12/10 James Murray: fixed bug in SuppPaymentRun.php - was not showing anything as the test to see if there was anything to see was using a non-existant result set! +3/12/10 Matt Elbrecht : Estonian translation +30/11/10 Phil: Changed table structure of new fixedassettrans and modified upgrade script - those who already ran that bit will need to change the table again. Modified fixed asset scripts again. New fixed assets manual +28/11/10 Exson: CreditStatus.php - Fix bug in sql statement +28/11/10 Tim: OutstandingGRNs.php - Only show when the invoiced qty is less than the GRN qty +28/11/10 Phil: All fixed asset scripts SupplierInvoice.php SupplierCredit.php SuppFixedAssetChgs.php - adding fixed assets directly from invoice charges - and reversing additions with credit notes. Also FixedAssetRegister.php report to print PDF or export CSV of fixed assets now includes date range depreciation and b/fwd cost b/fwd accum depn and c/fwd cost and accum depn - and NBV +28/11/10 James Murray: unset session in ConnectDB_mysqli.inc and ConnectDB_mysql.inc when the login fails +27/11/10 Phil: install/index.php check for critical requirements before allowing install to proceed +27/11/10 Phil: includes/DefinePOClass.php change variable to camel case also PO_Header.php PO_Items.php PO_ReadInOrder.inc GoodsReceived.php - scope for error needs lots of testing please +27/11/10 Phil: PurchData - fix MinOrderQty error trapping with appropriate text and default to 1 +27/11/10 Phil: SupplierInvoice.php removed check on weighted average costing to reverse GRN suspense posting and set cost to zero - this was defeating the price variance calculation and the proper valuation of stock. Also took out of the calculations the conversionfactor - will need to alter goods received code to ensure only our units recorded in quantity received. +26/11/10 Tim: upgrade3.11.1-4.00.sql - Add default date for stockcheckdate field in stockcheckfreeze table +26/11/10 Otandeka: CounterSales.php - Fix bug in counter sales script. +24/11/10 Phil: GoodsReceived.php - modified to insert fixedassettrans and to post nominal POs to fixed asset cost account from fixedassetcategories.costact +23/11/10 Pak Ricard: MRP.php and MRPShortages.php fixed temporary tables to use utf-8 - code failed without probably depends on mysql server settings +21/11/10 Phil:Rewritten FixedAssetJournal.php - renamed FixedAssetDepreciation.php +20/11/10 Phil: Rewritten FixedAssetItems.php FixedAssetCategories.php and modified FixedAssetLocations.php to use the new structure +18/11/10 Tim: upgrade3.11.1-4.00.sql - Fix sql syntax errors brought in on recent changes. +14/11/10 Phil: SelectAsset.php script reworked SelectAssetType.php script now deleted +08/11/10 Exson: Z_ImportStocks.php - Bug fixes. +06/11/10 Phil: ShiptChgs.php - made a check to ensure a shipment reference entered manully actually exists before it is added - otherwise a nasty error occurs on commital of the invoice +06/11/10 Paul T: InputSerialItemsSequential.php - Bug# 3080130 - Add new FormID to form. (and minor cleanup) +06/11/10 Tim: ReorderLevelLocation.php - Remove fixed assets from selections +06/11/10 Tim: ReorderLevel.php - Remove fixed assets from selections +06/11/10 Tim: InventoryQuantities.php - Remove fixed assets from selections +06/11/10 Tim: Selectproduct.php - Remove fixed assets from selections +06/11/10 Tim: InventoryValuation.php - Ensure fixed assets dont get shown in valuation report +06/11/10 Tim: FixedAssetItems.php - Fixed typo preventing Item code being shown +06/11/10 Phil: StockCategory.php FixedAssetCategory.php attempt to add validation to depreciation rates by extending the stock category property logic with new fields for numericvalue, minimumvalue and maximumvalue. Then adding the depreciation rate percentage property to expect numeric values with a minimum of 0 and maximum of 100. +05/11/10 Tim: PurchData.php. Converted field name to lower case for consistency +05/11/10 Tim: SelectProduct.php. Change the standard order quantities to agree with Minimum order qty +05/11/10 Tim: PurchData.php. Make the Minimum order quantity field numeric only +05/11/10 Poul Bjerre-Jensen: SelectProduct.php,PurchData.php. Add in Minimum order quantity to Purchasing data +02/11/10 Tim: SelectCustomer.php. Correction to work with debtors that have a - in the code +31/10/10 Tim: SuppTransGLAnalysis.php. Minor bug fixes +31/10/10 Tim: SuppTransGLAnalysis.php. Force the user to select a GL account code instaed of defaulting to first on the list +31/10/10 Tim: CustomerReceipt.php. Force the user to select a GL account code and a Bank Account instaed of defaulting to first on the list +29/10/10 Tim: index.php. If CustomerReceipt selected from the GL menu then go to GL receipts else customer receipts +29/10/10 Tim: Payments.php. Force the user to select a GL account code and a Bank Account instaed of defaulting to first on the list +29/10/10 Tim: GLJournal.php. Force the user to select a GL account code instaed of defaulting to first on the list +28/10/10 Tim: Fix bug # 3017709. When bulk transfers are received for controlled items serial numbers are required +28/10/10 Tim: PcExpensesTypeTab.php - SQL quoting corrections and layout changes and improvements +28/10/10 Tim: PcTabs.php - SQL quoting corrections and layout changes and improvements +28/10/10 Tim: PcTypeTabs.php - SQL quoting corrections and layout changes and improvements +27/10/10 Tim: PcReportTab.php - SQL quoting corrections and layout changes and improvements +27/10/10 Tim: PcClaimExpensesFromTab.php - SQL quoting corrections and layout changes and improvements +27/10/10 Tim: class.pdf.php - Fix bug in html_entity_decode() function call +27/10/10 d.k shukla: ManualPurchaseOrdering.html - Improvements to purchase ordering manual +27/10/10 Tim: WorkOrderEntry.php - When the quantities are changed, then the correct quantities are updated, and the date picker chooses the correct date. +27/10/10 Tim: header.inc - Correct for non ascii characters +27/10/10 Tim: Corrections to display multi line invoice narratives correctly +26/10/10 Tim: Discountmatrix.php - Fix discount category bug +26/10/10 Tim: Discountmatrix.php - Increase the number of decimal places that can be entered +26/10/10 Tim: StockLocTransfer.php - Check there is sufficient stock for the transfer +25/10/10 Marcos Garcia Trejo: New labelprinting functionality +25/10/10 ChenJohn: class.pdf.php - correctly display some html encoded special characters, to make them human readeable in pdf file. +23/10/10 Phil: PurchData.php - search by name failed concatenation of SQL stuffed now repaired. + +Version 4.0RC1 +22 October 2010 + +20/10/10 Paul: MiscFunctions.js - Bug #3060329. Correct condition check. [allows the calendar to start with the textbox's date] +18/10/10 Paul: WorkOrderReceive.php - Bug #3023776. Applied anonymous contribution. +16/10/10 Phil: SupplierInvocie.php fixed for mix up with commits - now shipment charges added correctly and contract charges also +14/10/10 Tim: MiscFunctions.php - Fix bug preventing download of ECB rates +13/10/10 Tim: WWW_Users.php - Show the last visit date correctly. Fixes bug 3085860 +09/10/10 Phil: Added xmlrpc_GetStockCategoryList api method +04/10/10 Matt Taylor: upgrade3.11.1-3.12.sql - Update tables to utf8 +03/10/10 Gabriel Olowo: ManualPurchaseOrdering.php - Manual for purchase ordering system +02/10/10 Tim: AuditTrail.php - Bug fixes and layout changes +02/10/10 Tim: DailySalesInquiry.php - Bug fixes and layout changes +02/10/10 Tim: session.inc - Corrections to sql quoting. Resolves bug 3023782 +02/10/10 Tim: ppdf_tpl.php - Make php 5.3 compatible +02/10/10 Tim: GLJournal.php - Fix to create a reversing journal even when non english language is used. +02/10/10 Tim: PDFGrnHeader.php - Show correct column headings. Fixes bug 3072507 +30/09/10 Tim: Add form verification to prevent form spoofing +30/09/10 Tim: WWW_Users.php - SQL quoting corrections and layout changes and improvements +30/09/10 Tim: WWW_Access.php - SQL quoting corrections and layout changes and improvements +29/09/10 Tim: WOSerialNos.php - SQL quoting corrections +29/09/10 Tim: WorkOrderStatus.php - SQL quoting corrections and layout changes and improvements +29/09/10 Tim: WorkOrderReceive.php - SQL quoting corrections and layout changes and improvements +29/09/10 Tim: WorkOrderIssue.php - SQL quoting corrections and layout changes and improvements +29/09/10 Tim: WorkOrderEntry.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: WorkOrderCosting.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: WorkCentres.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: WhereUsedInquiry.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: UserSettings.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: UnitsOfMeasure.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: TopItems.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: TaxProvinces.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: TaxGroups.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: TaxCategories.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: TaxAuthorityRates.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: TaxAuthorities.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: Tax.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: SystemParameters.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: SuppTransGLAnalysis.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: SuppShiptCharges.php - Layout changes and improvements +28/09/10 Tim: SuppPriceList.php - Layout changes and improvements +27/09/10 Paul Thursby: Various default.css files -- Minor CSS corrections. +27/09/10 Tim: SuppPaymentRun.php - SQL quoting corrections and layout changes and improvements +27/09/10 Tim: SuppLoginSetup.php - SQL quoting corrections and layout changes and improvements +27/09/10 Tim: SupplierTypes.php - SQL quoting corrections and layout changes and improvements +27/09/10 Tim: SupplierTransInquiry.php - New script to show detail supplier transactions +27/09/10 Tim: SupplierTenders.php - SQL quoting corrections +27/09/10 Tim: Suppliers.php - SQL quoting corrections +27/09/10 Tim: SupplierInvoice.php - SQL quoting corrections and layout changes and improvements +27/09/10 Tim: SupplierInquiry.php - SQL quoting corrections and layout changes and improvements +27/09/10 Tim: SupplierCredit.php - SQL quoting corrections and layout changes and improvements +27/09/10 Tim: SupplierContacts.php - SQL quoting corrections and layout changes and improvements +27/09/10 Tim: SupplierBalsAtPeriodEnd.php - Layout changes and improvements +27/09/10 Tim: SupplierAllocations.php - SQL quoting corrections and layout changes and improvements +27/09/10 Tim: SuppInvGRNs.php - SQL quoting corrections and layout changes and improvements +27/09/10 Tim: SuppCreditGRNs.php - SQL quoting corrections and layout changes and improvements +27/09/10 Tim: StockUsage.php - Layout changes and improvements +26/09/10 Tim: StockTransfers.php - Layout changes and improvements +26/09/10 Tim: StockSerialItemResearch.php - Layout changes and improvements +26/09/10 Tim: StockReorderLevel.php - SQL quoting corrections and layout changes and improvements +26/09/10 Tim: StockQuantityByDate.php - SQL quoting corrections and layout changes and improvements +26/09/10 Tim: StockQties_csv.php - Layout changes and improvements +26/09/10 Tim: StockMovements.php - Layout changes and improvements +26/09/10 Tim: StockLocStatus.php - SQL quoting corrections and layout changes and improvements and bug fixes +26/09/10 Tim: StockDispatch.php - SQL quoting corrections and layout changes and improvements and bug fixes +26/09/10 Tim: StockCounts.php - SQL quoting corrections and layout changes and improvements and bug fixes +26/09/10 Tim: StockCostUpdate.php - SQL quoting corrections and layout changes and improvements and bug fixes +26/09/10 Tim: StockCategories.php - SQL quoting corrections and layout changes and improvements and bug fixes +26/09/10 Tim: SpecialOrder.php - SQL quoting corrections +25/09/10 Tim: SMTPServer.php - SQL quoting corrections +25/09/10 Tim: ShiptsList.php - Add script to show list of open shipments for selected supplier +25/09/10 Tim: Shipt_Select.php - SQL quoting corrections and layout changes and improvements and bug fixes +25/09/10 Tim: Shippers.php - SQL quoting corrections and layout changes and improvements and bug fixes +25/09/10 Tim: Shipments.php - SQL quoting corrections and layout changes and improvements and bug fixes +25/09/10 Tim: ShipmentCosting.php - SQL quoting corrections and layout changes and improvements and bug fixes +25/09/10 Tim: SelectWorkOrder.php - SQL quoting corrections and layout changes and improvements and bug fixes +24/09/10 Tim: SelectSalesOrder.php - Layout changes and improvements and bug fixes +24/09/10 Tim: SelectRecurringSalesOrder.php - Layout changes and improvements and bug fixes +24/09/10 Tim: SelectProduct.php - SQL quoting corrections +24/09/10 Tim: SelectOrderItems.php - SQL quoting corrections +24/09/10 Tim: SelectGLAccount.php - SQL quoting corrections and layout changes and improvements and bug fixes +24/09/10 Tim: SelectCustomer.php - Layout changes and improvements and bug fixes +24/09/10 Tim: SelectCreditItems.php - SQL quoting corrections and layout changes and improvements and bug fixes +23/09/10 Tim: SelectAssetType.php - SQL quoting corrections and layout changes and improvements +23/09/10 Tim: SalesTypes.php - SQL quoting corrections and layout changes and improvements +23/09/10 Tim: SalesPeople.php - SQL quoting corrections and layout changes and improvements +23/09/10 Tim: SalesGraph.php - Fix deprecated use of assigning by reference +23/09/10 Tim: SalesGLPostings.php - SQL quoting corrections and layout changes and improvements +23/09/10 Tim: SalesCategories.php - SQL quoting corrections and layout changes and improvements +23/09/10 Tim: SalesAnalRepts.php - SQL quoting corrections and layout changes and improvements +23/09/10 Tim: SalesAnalReptCols.php - SQL quoting corrections and layout changes and improvements +23/09/10 Tim: ReverseGRN.php - SQL quoting corrections and layout changes and improvements +23/09/10 Tim: ReorderLevelLocation.php - SQL quoting corrections and layout changes and improvements +23/09/10 Tim: ReorderLevel.php - SQL quoting corrections and layout changes and improvements +23/09/10 Tim: RecurringSalesOrdersProcess.php - SQL quoting corrections +23/09/10 Tim: RecurringSalesOrders.php - SQL quoting corrections and layout changes and improvements +23/09/10 Tim: DateFunctions.inc - mktime() function without paramaeters is now deprecated, replaced with time() +20/09/10 Pak Ricard: PricesByCost.php - Restrict price changes to those stock items not discontinued +14/09/10 Tim: PurchData.php - SQL quoting corrections and layout changes and improvements +14/09/10 Tim: PrintSalesOrder_generic.php - SQL quoting corrections +14/09/10 Tim: PrintCustTransPortrait.php - SQL quoting corrections and layout changes and improvements +13/09/10 Tim: PrintCustTrans.php - SQL quoting corrections and layout changes and improvements +13/09/10 Tim: PrintStatements.php - Small bug fixes +13/09/10 Tim: PrintCustOrder_Generic.php - Correct the sql quoting +13/09/10 Tim: PrintCustOrder.php - Correct the sql quoting +13/09/10 Tim: PricesBasedOnMarkup.php - Correct the sql quoting, and various layout improvements and bug fixes +13/09/10 Tim: Prices_Customer.php - Correct the sql quoting, and various layout improvements and bug fixes +13/09/10 Tim: Prices.php - Correct the sql quoting, and various layout improvements and bug fixes +13/09/10 Tim: POReport.php - Format correctly for screen and add in option to export as a csv file +11/09/10 Tim: PO_SelectPurchOrder.php - Correct the sql quoting, and various layout improvements +11/09/10 Tim: PO_SelectOSPurchOrder.php - Correct the sql quoting +11/09/10 Tim: PO_PDFPurchOrder.php - Correct the sql quoting +11/09/10 Otandeka: PDFPriceList.php - Corrected undefined offset error +11/09/10 Phil: Manual changes - for utf-8 - language and PDFlanguage selection, also the installer and the new CounterSales.php script +10/09/10 Tim: PO_OrderDetails.php - Layout improvements, links to SelectSuppliers.php and sql quoting corrections +10/09/10 Tim: PO_Items.php - Layout improvements, and sql quoting corrections +10/09/10 Tim: PO_Header.php - Layout improvements, and sql quoting corrections +10/09/10 Tim: PO_AuthoriseMyOrders.php - Layout improvements, and sql quoting corrections +10/09/10 Tim: PO_AuthorisationLevels.php - Layout improvements, and sql quoting corrections +10/09/10 Tim: PeriodsInquiry.php - Layout improvements +10/09/10 ChenJohn: ConnectDB_mysql.inc ConnectDB_mysqli.inc fix utf-8 data being encoded/stored incorrectly in db server +08/09/10 Tim: PDFTopItems.php - Correct the sql quoting +08/09/10 Tim: PDFSuppTransListing.php - Screen layout improvements. Correct the sql quoting +08/09/10 Tim: PDFStockTransfer.php - Correct the sql quoting +08/09/10 Tim: PDFStockNegatives.php - Fix missing sql error message and correct the default date format in the heading +08/09/10 Tim: PDFStockCheckComparison.php - Screen layout improvements. Correct the sql quoting +07/09/10 Tim: PDFRemittanceAdvice.php - Correct the sql quoting +07/09/10 Tim: PDFReceipt.php - Correct the sql quoting +07/09/10 Tim: PDFQuotation.php - Correct the sql quoting +07/09/10 Tim: PDFPickingList.php - Correct the sql quoting +07/09/10 Tim: PDFOrderStatus.php - Improve report layout for readability +07/09/10 Tim: PDFOrderInvoiced.php - Improve report layout for readability +06/09/10 Tim: PO_Header.php - Move dummy status array from DefinePOClass.php +06/09/10 Tim: upgrade3.11.1-3.12.sql - Change syntax to work in both windows and linux +06/09/10 Tim: SupplierInvoice.php - Correct the roundings so that the double entry balances +05/09/10 Tim: PO_AuthoriseMyOrders.php - Update correct status when language not English +05/09/10 Tim: PcAssignCashToTab.php - Show authorised, notes, and receipt fields correctly. Changed to use DB_fetch_array() rather than DB_fetch_row(). +05/09/10 Tim: PDFStockTransListing.php - List stock transactions by transaction type. +05/09/10 Ricard: upgrade3.11.1-3.12.sql - Database changes required for changes to report writer. +31/08/10 Tim: StockLocTransfer.php - Change quantity input field to have more than 5 digits +28/08/10 Marcos Garcia Trejo: Fix ConfirmDispatchInvoice.php assembly components new qty on hand +27/08/10 Tim: Add in requisition number into purchase order prints. +21/08/10 Phil: Fix bugs introduced by Paul's patch prnMsg= should be prnMsg() BOMs.php also did in Contracts.php +21/08/10 Phil: Contract closing changes all the contracts scripts +20/08/10 Paul Thursby: More $msg cleanup. Unused eliminated; Others replaced with prnMsg(). +15/08/10 Phil: Decided to have contracts as part of orders module since not really enough links to warrant a new module changes to index.php WWW_Users.php and sql upgrade. +15/08/10 Phil: New script for ContractCosting.php comparison of contract costs budgeted vs incurred. Lot of work on contracts +13/08/10 Phil: DefineSuppTransClass.php SupplierInvoice.php and SupplierCredit.php now allow entry of contract charges. New script for SuppContractChgs.php +13/08/10 Phil: Fixes to show creditors transactions correctly in GLTransInquiry.php signs mixed up and period not shown previously +10/08/10 Russell (Regal Prods): Fix SelectOrderItems.php width of narrative box was making screen unusable!! +18/08/10 Pak Ricard: Revised report writer with the ability for more fields +07/08/10 Paul Thursby: PO_Items.php - Eliminate query; Moves the ONE field into a query above this point. +07/08/10 Paul Thursby: SelectProduct.php - Variable $msg will never print. Elimnate to use function prnMsg() instead. +08/08/10 Phil: Contracts.php SelectContracts.php DeliveryDetails.php - more work to convert Contracts to quotations and on conversion of contract quotations to orders to create contract work order to issue materials to +07/08/10 Tim: PDFLowGP.php - Sql quoting correction, layout changes, and assorted minor bug corrections +07/08/10 Tim: PO_Items.php - Sql quoting correction, layout changes, and assorted minor bug corrections +07/08/10 Tim: SelectCustomer.php - Unset $result variable once used as it was ca... [truncated message content] |
From: <dai...@us...> - 2011-05-03 10:05:13
|
Revision: 4561 http://web-erp.svn.sourceforge.net/web-erp/?rev=4561&view=rev Author: daintree Date: 2011-05-03 10:05:05 +0000 (Tue, 03 May 2011) Log Message: ----------- quoting and locations fix Modified Paths: -------------- trunk/Credit_Invoice.php trunk/Currencies.php trunk/Locations.php Added Paths: ----------- trunk/doc/Change.log Removed Paths: ------------- trunk/doc/Change.log.html Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-05-02 10:33:55 UTC (rev 4560) +++ trunk/Credit_Invoice.php 2011-05-03 10:05:05 UTC (rev 4561) @@ -47,7 +47,8 @@ custbranch.defaultlocation, custbranch.taxgroupid, stockmoves.loccode, - locations.taxprovinceid + locations.taxprovinceid, + currencies.decimalplaces FROM debtortrans INNER JOIN debtorsmaster ON debtortrans.debtorno = debtorsmaster.debtorno INNER JOIN custbranch ON @@ -59,6 +60,8 @@ stockmoves.transno=debtortrans.transno INNER JOIN locations ON stockmoves.loccode = locations.loccode + INNER JOIN currencies ON + debtorsmaster.currcode=currencies.currabrev WHERE debtortrans.transno = '" . $_GET['InvoiceNumber'] . "' AND debtortrans.type=10 AND stockmoves.type=10"; @@ -89,12 +92,12 @@ $_SESSION['CreditItems']->FreightCost = $myrow['ovfreight']; $_SESSION['CreditItems']->DispatchTaxProvince = $myrow['taxprovinceid']; $_SESSION['CreditItems']->GetFreightTaxes(); + $_SESSION['CreditItems']->CurrDecimalPlaces = $myrow['decimalplaces']; DB_free_result($GetInvHdrResult); /*now populate the line items array with the stock movement records for the invoice*/ - $LineItemsSQL = "SELECT stockmoves.stkmoveno, stockmoves.stockid, stockmaster.description, @@ -187,7 +190,7 @@ } //end of checks on returned data set DB_free_result($LineItemsResult); } else { - prnMsg( _('This invoice can not be credited using the automatic facility') . '<br>' . _('CRITICAL ERROR') . ': ' . _('Please report that a duplicate DebtorTrans header record was found for invoice') . ' ' . $SESSION['ProcessingCredit'],'warn'); + prnMsg( _('This invoice can not be credited using the automatic facility') . '<br />' . _('CRITICAL ERROR') . ': ' . _('Please report that a duplicate DebtorTrans header record was found for invoice') . ' ' . $SESSION['ProcessingCredit'],'warn'); include('includes/footer.inc'); exit; } //valid invoice record returned from the entered invoice number @@ -314,20 +317,20 @@ if ($LnItm->Controlled==1){ - echo "<td><input type=hidden name='Quantity_" . $LnItm->LineNumber ."' value=" . $LnItm->QtyDispatched . "><a href='$rootpath/CreditItemsControlled.php?" . SID . "&LineNo=" . $LnItm->LineNumber . "&CreditInvoice=Yes'>" . $LnItm->QtyDispatched . "</a></td>"; + echo '<td><input type=hidden name="Quantity_' . $LnItm->LineNumber .'" value=' . $LnItm->QtyDispatched . '><a href="' . $rootpath . '/CreditItemsControlled.php?LineNo=' . $LnItm->LineNumber . '&CreditInvoice=Yes">' . $LnItm->QtyDispatched . '</a></td>'; } else { - echo "<td><input tabindex=".$j." type=text class=number name='Quantity_" . $LnItm->LineNumber ."' maxlength=6 size=6 value=" . $LnItm->QtyDispatched . "></td>"; + echo '<td><input tabindex=' . $j . ' type="text" class="number" name="Quantity_' . $LnItm->LineNumber .'" maxlength=6 size=6 value=' . $LnItm->QtyDispatched . '></td>'; } - $DisplayLineTotal = number_format($LineTotal,2); + $DisplayLineTotal = number_format($LineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); $j++; - echo "<td><input tabindex=".$j." type=text class=number name='Price_" . $LnItm->LineNumber . "' maxlength=12 size=6 VALUE=" . $LnItm->Price . "></td> - <td><input tabindex=".$j." type=text class=number name='Discount_" . $LnItm->LineNumber . "' maxlength=3 size=3 VALUE=" . ($LnItm->DiscountPercent * 100) . "></td> - <td class=number>$DisplayLineTotal</td>"; + echo '<td><input tabindex=' . $j . ' type=text class=number name="Price_' . $LnItm->LineNumber . '" maxlength=12 size=6 value=' . $LnItm->Price . '></td> + <td><input tabindex=' . $j . ' type=text class="number" name="Discount_' . $LnItm->LineNumber . '" maxlength=3 size=3 value=' . ($LnItm->DiscountPercent * 100) . '></td> + <td class=number>' . $DisplayLineTotal . '</td>'; /*Need to list the taxes applicable to this line */ echo '<td>'; @@ -335,14 +338,14 @@ if (is_array($_SESSION['CreditItems']->LineItems[$LnItm->LineNumber]->Taxes) ){ foreach ($_SESSION['CreditItems']->LineItems[$LnItm->LineNumber]->Taxes AS $Tax) { if ($i>0){ - echo '<br>'; + echo '<br />'; } echo $Tax->TaxAuthDescription; $i++; } } echo '</td>'; - echo '<td class=number>'; + echo '<td class="number">'; } $i=0; // initialise the number of taxes iterated through @@ -353,10 +356,10 @@ } foreach ($LnItm->Taxes as $Tax) { if ($i>0){ - echo '<br>'; + echo '<br />'; } if (!isset($_POST['ProcessCredit'])) { - echo '<input type=text class=number name="' . $LnItm->LineNumber . $Tax->TaxCalculationOrder . + echo '<input type=text class="number" name="' . $LnItm->LineNumber . $Tax->TaxCalculationOrder . '_TaxRate" maxlength=4 size=4 value="' . $Tax->TaxRate*100 . '">'; } $i++; @@ -372,17 +375,17 @@ } $TaxTotal += $TaxLineTotal; - $DisplayTaxAmount = number_format($TaxLineTotal ,2); - $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,2); + $DisplayTaxAmount = number_format($TaxLineTotal ,$_SESSION['CreditItems']->CurrDecimalPlaces); + $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); if (!isset($_POST['ProcessCredit'])) { echo '</td>'; echo '<td class=number>' . $DisplayTaxAmount . '</td> - <td class=number>' . $DisplayGrossLineTotal . "</td> - <td><a href='". $_SERVER['PHP_SELF'] . "?" . SID . "&Delete=" . $LnItm->LineNumber . "'>" . _('Delete') . '</a></td></tr>'; + <td class=number>' . $DisplayGrossLineTotal . '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $LnItm->LineNumber . '">' . _('Delete') . '</a></td></tr>'; - echo '<tr'.$RowStarter . "><td colspan=12><TEXTAREA tabindex=".$j." name='Narrative_" . $LnItm->LineNumber . "' cols=100% rows=1>" . $LnItm->Narrative . "</TEXTAREa><br><hr></td></tr>"; + echo '<tr' . $RowStarter . '><td colspan=12><textarea tabindex=' . $j .' name="Narrative_' . $LnItm->LineNumber . '" cols=100% rows=1>' . $LnItm->Narrative . '</textarea><br /><hr></td></tr>'; $j++; } } /*end foreach loop displaying the invoice lines to credit */ @@ -405,7 +408,7 @@ $i=0; // initialise the number of taxes iterated through foreach ($_SESSION['CreditItems']->FreightTaxes as $FreightTaxLine) { if ($i>0){ - echo '<br>'; + echo '<br />'; } echo $FreightTaxLine->TaxAuthDescription; $i++; @@ -416,7 +419,7 @@ $i=0; foreach ($_SESSION['CreditItems']->FreightTaxes as $FreightTaxLine) { if ($i>0){ - echo '<br>'; + echo '<br />'; } if (!isset($_POST['ProcessCredit'])) { @@ -435,13 +438,13 @@ if (!isset($_POST['ProcessCredit'])) { echo '</td>'; - echo '<td class="number">' . number_format($FreightTaxTotal,2) . '</td> - <td class="number">' . number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,2) . '</td> + echo '<td class="number">' . number_format($FreightTaxTotal,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> + <td class="number">' . number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> </tr>'; } $TaxTotal += $FreightTaxTotal; -$DisplayTotal = number_format($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost,2); +$DisplayTotal = number_format($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost,$_SESSION['CreditItems']->CurrDecimalPlaces); if (!isset($_POST['ProcessCredit'])) { echo '<tr> @@ -449,7 +452,7 @@ <td class=number><hr><b>' . $DisplayTotal . '</b><hr></td> <td colspan=2></td> <td class=number><hr><b>' . number_format($TaxTotal,2) . '<hr></td> - <td class=number><hr><b>' . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),2) . '</b><hr></td> + <td class=number><hr><b>' . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),$_SESSION['CreditItems']->CurrDecimalPlaces) . '</b><hr></td> </tr></table>'; } $DefaultDispatchDate = Date($_SESSION['DefaultDateFormat']); @@ -504,7 +507,6 @@ $Result = DB_query($SQL,$db); $myrow = DB_fetch_row($Result); - /*Do some rounding */ $_SESSION['CreditItems']->total = round($_SESSION['CreditItems']->total,2); @@ -1442,9 +1444,9 @@ echo '<div class="centre">'._('Credit Note number') . ' ' . $CreditNo . ' ' . _('has been processed'); if ($_SESSION['InvoicePortraitFormat']==0){ - echo "<br /><a href='". $rootpath . "/PrintCustTrans.php?" . SID . "&FromTransNo=" . $CreditNo . "&InvOrCredit=Credit&PrintPDF=True'>" . _('Print this credit note') . '</a>'; + echo '<br /><a href="' . $rootpath . '/PrintCustTrans.php?FromTransNo=' . $CreditNo . '&InvOrCredit=Credit&PrintPDF=True">' . _('Print this credit note') . '</a>'; } else { - echo "<br /><a href='". $rootpath . "/PrintCustTransPortrait.php?" . SID . "&FromTransNo=" . $CreditNo . "&InvOrCredit=Credit&PrintPDF=True'>" . _('Print this credit note') . '</a>'; + echo '<br /><a href="' . $rootpath . '/PrintCustTransPortrait.php?FromTransNo=' . $CreditNo . '&InvOrCredit=Credit&PrintPDF=True">' . _('Print this credit note') . '</a>'; } echo '</div>'; /*end of process credit note */ @@ -1452,21 +1454,22 @@ } else { /*Process Credit NOT set so allow inputs to set up the credit note */ - echo "<br><table class=selection>"; + echo '<br /><table class=selection>'; - echo '<tr><td>' . _('Credit Note Type') . "</td><td><select tabindex=".$j." name=CreditType>"; + echo '<tr><td>' . _('Credit Note Type') . '</td> + <td><select tabindex=' . $j .' name="CreditType">'; - if (!isset($_POST['CreditType']) OR $_POST['CreditType']=="Return"){ + if (!isset($_POST['CreditType']) OR $_POST['CreditType']=='Return'){ echo '<option selected value="Return">' . _('Goods returned to store') . '</option>'; - echo '<option VALUE="WriteOff">' . _('Goods written off') . '</option>'; - echo '<option VALUE="ReverseOverCharge">' . _('Reverse overcharge') . '</option>'; + echo '<option value="WriteOff">' . _('Goods written off') . '</option>'; + echo '<option value="ReverseOverCharge">' . _('Reverse overcharge') . '</option>'; } elseif($_POST['CreditType']=='WriteOff') { echo '<option selected value="WriteOff">' . _('Goods written off') . '</option>'; - echo '<option VALUE="Return">' . _('Goods returned to store') . '</option>'; - echo '<option VALUE="ReverseOverCharge">' . _('Reverse overcharge') . '</option>'; + echo '<option value="Return">' . _('Goods returned to store') . '</option>'; + echo '<option value="ReverseOverCharge">' . _('Reverse overcharge') . '</option>'; } else { - echo '<option VALUE="WriteOff">' . _('Goods written off') . '</option>'; - echo '<option VALUE="Return">' . _('Goods returned to store') . '</option>'; + echo '<option value="WriteOff">' . _('Goods written off') . '</option>'; + echo '<option value="Return">' . _('Goods returned to store') . '</option>'; echo '<option selected value="ReverseOverCharge">' . _('Reverse overcharge') . '</option>'; } echo '</select></td></tr>'; @@ -1478,7 +1481,7 @@ echo '<tr><td>' . _('Goods returned to location') . '</td><td><select tabindex='.$j.' name=Location>'; - $SQL='SELECT loccode, locationname FROM locations'; + $SQL="SELECT loccode, locationname FROM locations"; $Result = DB_query($SQL,$db); if (!isset($_POST['Location'])){ @@ -1487,24 +1490,24 @@ while ($myrow = DB_fetch_array($Result)) { if ($_POST['Location']==$myrow['loccode']){ - echo "<option selected VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } - echo "</select></td></tr>"; + echo '</select></td></tr>'; $j++; } elseif($_POST['CreditType']=='WriteOff') { /* the goods are to be written off to somewhere */ - echo '<tr><td>' . _('Write off the cost of the goods to') . '</td><td><select TABINDEX='.$j.' name="WriteOffGLCode">'; + echo '<tr><td>' . _('Write off the cost of the goods to') . '</td><td><select tabindex=' . $j .' name="WriteOffGLCode">'; - $SQL='SELECT accountcode, + $SQL="SELECT accountcode, accountname - FROM chartmaster, accountgroups - WHERE chartmaster.group_=accountgroups.groupname - AND ccountgroups.pandl=1 ORDER BY chartmaster.accountcode'; - + FROM chartmaster, accountgroups + WHERE chartmaster.group_=accountgroups.groupname + AND ccountgroups.pandl=1 ORDER BY chartmaster.accountcode"; + $Result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($Result)) { @@ -1521,8 +1524,8 @@ $_POST['CreditText'] = ''; } $j++; - echo '<tr><td>' . _('Credit note text') . '</td><td><textarea tabindex='.$j.' name=CreditText cols=31 rows=5>' . $_POST['CreditText'] . '</textarea></td></tr>'; - echo '</table><br><div class="centre"><input TABINDEX='.$j.' type=submit name=Update Value=' . _('Update') . '><p>'; + echo '<tr><td>' . _('Credit note text') . '</td><td><textarea tabindex=' . $j . ' name=CreditText cols=31 rows=5>' . $_POST['CreditText'] . '</textarea></td></tr>'; + echo '</table><br /><div class="centre"><input tabindex=' . $j . ' type=submit name=Update Value=' . _('Update') . '><p>'; $j++; echo '<input type="submit" tabindex='.$j++.' name="ProcessCredit" Value="' . _('Process Credit') .'"></div>'; } Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2011-05-02 10:33:55 UTC (rev 4560) +++ trunk/Currencies.php 2011-05-03 10:05:05 UTC (rev 4561) @@ -1,7 +1,6 @@ <?php -/* $Revision: 1.20 $ */ + /* $Id$*/ -//$PageSecurity = 9; include('includes/session.inc'); $title = _('Currencies Maintenance'); @@ -141,7 +140,7 @@ if ($myrow[0] > 0) { prnMsg(_('Cannot delete this currency because customer accounts have been created referring to this currency') . - '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('customer accounts that refer to this currency'),'warn'); + '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('customer accounts that refer to this currency'),'warn'); } else { $sql= "SELECT COUNT(*) FROM suppliers WHERE suppliers.currcode = '".$SelectedCurrency."'"; $result = DB_query($sql,$db); @@ -149,14 +148,14 @@ if ($myrow[0] > 0) { prnMsg(_('Cannot delete this currency because supplier accounts have been created referring to this currency') - . '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('supplier accounts that refer to this currency'),'warn'); + . '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('supplier accounts that refer to this currency'),'warn'); } else { $sql= "SELECT COUNT(*) FROM banktrans WHERE banktrans.currcode = '" . $SelectedCurrency . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0] > 0){ prnMsg(_('Cannot delete this currency because there are bank transactions that use this currency') . - '<br>' . ' ' . _('There are') . ' ' . $myrow[0] . ' ' . _('bank transactions that refer to this currency'),'warn'); + '<br />' . ' ' . _('There are') . ' ' . $myrow[0] . ' ' . _('bank transactions that refer to this currency'),'warn'); } elseif ($FunctionalCurrency==$SelectedCurrency){ prnMsg(_('Cannot delete this currency because it is the functional currency of the company'),'warn'); } else { @@ -216,17 +215,17 @@ } if ($myrow[1]!=$FunctionalCurrency){ - printf("<td><img src=\"%s\"></td> + printf('<td><img src="%s"></td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td class=number>%s</td> <td class=number>%s</td> - <td><a href=\"%s&SelectedCurrency=%s\">%s</a></td> - <td><a href=\"%s&SelectedCurrency=%s&delete=1\">%s</a></td> - <td><a href=\"%s/ExchangeRateTrend.php?%s\">" . _('Graph') . "</a></td> - </tr>", + <td><a href="%s&SelectedCurrency=%s">%s</a></td> + <td><a href="%s&SelectedCurrency=%s&delete=1">%s</a></td> + <td><a href="%s/ExchangeRateTrend.php?%s">' . _('Graph') . '</a></td> + </tr>', $ImageFile, $myrow[1], $myrow[0], @@ -234,23 +233,23 @@ $myrow[3], number_format($myrow[4],5), number_format(GetCurrencyRate($myrow[1],$CurrencyRatesArray),5), - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[1], _('Edit'), - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[1], _('Delete'), $rootpath, - SID . '&CurrencyToShow=' . $myrow[1]); + '&CurrencyToShow=' . $myrow[1]); } else { - printf("<td><img src=\"%s\"></td> + printf('<td><img src="%s"></td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td class=number>%s</td> <td colspan=4>%s</td> - </tr>", + </tr>', $ImageFile, $myrow[1], $myrow[0], @@ -261,19 +260,19 @@ } } //END WHILE LIST LOOP - echo '</table><br>'; + echo '</table><br />'; } //end of ifs and buts! if (isset($SelectedCurrency)) { - echo '<div class="centre"><a href=' .$_SERVER['PHP_SELF'] . '?' . SID. '>'._('Show all currency definitions').'</a></div>'; + echo '<div class="centre"><a href="' .$_SERVER['PHP_SELF'] . '">'._('Show all currency definitions').'</a></div>'; } -echo '<br>'; +echo '<br />'; if (!isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedCurrency) AND $SelectedCurrency!='') { @@ -300,12 +299,11 @@ - echo '<input type="hidden" name="SelectedCurrency" VALUE="' . $SelectedCurrency . '">'; - echo '<input type="hidden" name="Abbreviation" VALUE="' . $_POST['Abbreviation'] . '">'; + echo '<input type="hidden" name="SelectedCurrency" value="' . $SelectedCurrency . '">'; + echo '<input type="hidden" name="Abbreviation" value="' . $_POST['Abbreviation'] . '">'; echo '<table class=selection><tr> <td>' . _('ISO 4217 Currency Code').':</td> - <td>'; - echo $_POST['Abbreviation'] . '</td></tr>'; + <td>' . $_POST['Abbreviation'] . '</td></tr>'; } else { //end of if $SelectedCurrency only do the else when a new record is being entered if (!isset($_POST['Abbreviation'])) {$_POST['Abbreviation']='';} @@ -316,27 +314,35 @@ echo '<tr><td>'._('Currency Name').':</td>'; echo '<td>'; - if (!isset($_POST['CurrencyName'])) {$_POST['CurrencyName']='';} + if (!isset($_POST['CurrencyName'])) { + $_POST['CurrencyName']=''; + } echo '<input ' . (in_array('CurrencyName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="CurrencyName" size=20 maxlength=20 VALUE="' . $_POST['CurrencyName'] . '">'; echo '</td></tr>'; echo '<tr><td>'._('Country').':</td>'; echo '<td>'; - if (!isset($_POST['Country'])) {$_POST['Country']='';} + if (!isset($_POST['Country'])) { + $_POST['Country']=''; + } echo '<input ' . (in_array('Country',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Country" size=30 maxlength=50 VALUE="' . $_POST['Country'] . '">'; echo '</td></tr>'; echo '<tr><td>'._('Hundredths Name').':</td>'; echo '<td>'; - if (!isset($_POST['HundredsName'])) {$_POST['HundredsName']='';} - echo '<input ' . (in_array('HundredsName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="HundredsName" size=10 maxlength=15 VALUE="'. $_POST['HundredsName'].'">'; + if (!isset($_POST['HundredsName'])) { + $_POST['HundredsName']=''; + } + echo '<input ' . (in_array('HundredsName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="HundredsName" size=10 maxlength=15 value="'. $_POST['HundredsName'].'">'; echo '</td></tr>'; echo '<tr><td>'._('Exchange Rate').':</td>'; echo '<td>'; - if (!isset($_POST['ExchangeRate'])) {$_POST['ExchangeRate']='';} - echo '<input ' . (in_array('ExchangeRate',$Errors) ? 'class="inputerror"' : '' ) .' type="text" class=number name="ExchangeRate" size=10 maxlength=9 VALUE='. $_POST['ExchangeRate'].'>'; + if (!isset($_POST['ExchangeRate'])) { + $_POST['ExchangeRate']=''; + } + echo '<input ' . (in_array('ExchangeRate',$Errors) ? 'class="inputerror"' : '' ) .' type="text" class=number name="ExchangeRate" size=10 maxlength=9 value='. $_POST['ExchangeRate'].'>'; echo '</td></tr>'; echo '</table>'; - echo '<br><div class="centre"><input type="Submit" name="submit" value='._('Enter Information').'></div>'; + echo '<br /><div class="centre"><input type="Submit" name="submit" value='._('Enter Information').'></div>'; echo '</form>'; Modified: trunk/Locations.php =================================================================== --- trunk/Locations.php 2011-05-02 10:33:55 UTC (rev 4560) +++ trunk/Locations.php 2011-05-03 10:05:05 UTC (rev 4561) @@ -374,7 +374,6 @@ printf('<td>%s</td> <td>%s</td> <td>%s</td> - <td>%s</td> <td><a href="%sSelectedLocation=%s">' . _('Edit') . '</td> <td><a href="%sSelectedLocation=%s&delete=1">' . _('Delete') . '</td> </tr>', @@ -449,8 +448,8 @@ $_POST['Managed'] = $myrow['managed']; - echo '<input type="hidden" name="SelectedLocation" value="' . $SelectedLocation . '>'; - echo '<input type="hidden" name="LocCode" value="' . $_POST['LocCode'] . '>'; + echo '<input type="hidden" name="SelectedLocation" value="' . $SelectedLocation . '">'; + echo '<input type="hidden" name="LocCode" value="' . $_POST['LocCode'] . '">'; echo '<table class="selection">'; echo '<tr><th colspan=2><font size=3 color=blue>'._('Amend Location details').'</font></th></tr>'; echo '<tr><td>' . _('Location Code') . ':</td><td>'; Added: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log (rev 0) +++ trunk/doc/Change.log 2011-05-03 10:05:05 UTC (rev 4561) @@ -0,0 +1,3271 @@ +webERP Change Log + +3/5/11 Locations.php fix table hidden POST variable quotes mismatch - also mismatch between number of parameters in printf output +2/5/11 Make order entry show the currency decimal places for amounts and totals also in invoicing SelectOrderItems.php and ConfirmDispatch_Invoice.php +2/5/11 Fix PO_PDFPurchOrder.php to allow emailing but email option not to appear on printed/emailed orders +1/5/11 Tim PageSecurity.php fix bug that prevented updates to Security Token for a particular script. +1/5/11 Many scripts quoting changes single quotes for strings double quotes for xhtml variables +1/5/11 SecuirtyTokens allow deletion of tokens if no scripts using it +28/4/11 Tim - add facility to select an account group to limit GL acccounts returned as options to post payments to +28/4/11 Tim - new SecurityTokens script +28/4/11 Fix Secunia reported vulnerability by checking for dodgy characters in CompanyNameField - then matched to a real directory on the web-server + +18/4/11 - Version 4.03.8 Release + +18/4/11 Phil: Update zh_HK.utf8, pt_BR.utf8, fa_IR.utf8 from launchpad translations +18/4/11 Phil: Changed PurchData.php back to now have free form text entry of unit of measure - as suggested by Brian May - think it works better this way +18/4/11 Phil: Removed redundant fields that are not used anywhere from DefinePOClass and the various function to add lines to purchase orders and to update purhcase order lines - netweight, cuft, kgs, itemno, total_quantity etc. all this data can be retrieved without duplication in purchorderdetails +16/4/11 Phil: Tim's changes in launchpad fork to 4663 - xhtml syntax fixes +15/4/11 Phil: Copy Exson's traditional Chinese back to zh_HK.utf8 +11/4/11 Ricard: new pcAuthorizeExpenses.php that shows the current balance of the tab to the authorizer. Before the authorizer did not see this information. +11/4/11 Tim: StockLocTransfer.php added $_POST['LinesCounter'] -= 10; +11/4/11 Tim/Phil: Use PHP 5 specific scandir to sort languages into alphabetic order for UserSettings and WWW_Users language selection +10/4/11 Tim: AddCustomerContacts.php use single field rather than * in SQL> +10/4/11 Tim: GLAccountInquiry.php show None if no tag selected +10/4/11 Tim : PDFPrintLabel.php javascript fix +10/4/11 Tim: Add perishable to StockTransfer.php and PDFStockTransfer +10/4/11 Tim: PDFPeriodStockTransListing - new report to print off stock transactions of a specified type for a selected period>/p> +10/4/11 Tim: PDFStockTransListing.php option to print off transactions by inventory location +10/4/11 Tim: Stocks.php - more logical use of $New and $_POST['New'] +10/4/11 Tim: Payments.php PaymentMethods.php Add new field userpreprintedstationery to payment methods to determine whether to print cheques +5/4/11 Tim: includes/LanguageSetup.php - discovered solution to Turkish character set problem!! +5/4/11 Phil: couple of is_date functions left over from experiment to see if changing fixed Turkish - now removed from SupplierInvoice.php and PDFOrdersInvoiced.php +5/4/11 Phil: SuppCreditGRNs was not showing old GRNs and no way to input an older date +31/3/11 Phil:Fix link to create purchase order from purchasing data link on SelectProduct.php - thanks Brian May for pointing out the bug +31/3/11 Phil: Updated all tranlations from the launchpad site +31/3/11 Tim: Fix to make languages display immediately on change - session.inc moved includes/LanguageSetup.php down +30/3/11 Tim: New ReprintGRN.php script takes a purchase order and allows any line received to have GRN(s) reprinted +29/3/11 Phil: checking for unquoted SQL and for SQL where literals quoted with double quotes rather than single - double quotes are not ANSI compatible - so making the SQL more ANSI compatible by doing this as suggested by Tim. Many many scripts involved will take a week or so +<p /> +27/3/11 - Version 4.03.5 Release + +27/3/11: Phil fixed SQL upgrade script to add the Z_ChangeSupplierCode.php script is added to the scripts table +27/3/11: Phil fixed some SQL for ansi compatibility I had changed in error - would affect users running strict mode ansi +27/3/11: Phil at Brian May's suggestion added conversion factor to item look up in PO_Items.php - also ensured quantity entry no longer trapped for commas and commas removed from numbers before committing. Also trapped for committing purchase orders with no lines + +26/3/11 - Version 4.03 Release + +26/3/11: Phil added some error trapping to codes of pcTabTypes +24/3/11: Phil rework PDFStockTransfer.php remove a few round trips to DB and added facility to be able to select a transfer number to reprint - added to main menu +24/3/11: James wer...@ya... Added snall image in middle of SelectProduct.php +19/3/11: Phil added country to packing slips +18/3/11: Marcos Garcia Trejo Added Z_ChangeSupplierCode.php +18/3/11: Ricard add orderby transdate to DailyBankTransactions.php +18/3/11: Phil check for Customers.php CustomerBranches.php and Stocks.php now traps codes containing spaces - as well as other illegal characters +15/3/11: Phil PricesByCost.php - made it update prices where there is already a price starting on today's date +15/3/11: Phil SelectOrderItems.php customer selection now done using a hidden $_POST rather than parsing debtorno hyphen branchcode. +15/3/11: Phil Locations.php new field for CounterSales branch code - instead of parsing it from a single field with a hyphen in it. CounterSales.php now uses the new field for customer branch +14/3/11: Phil SelectSalesOrder.php now lists with sales order value denominated in functional currency with total of listed outstadning sales orders (or quotations) shown at the bottom of the listing +12/3/11: Tim Now allow space in codes +12/3/11: SelectSalesOrder.php now allows any number of sales orders to be selected and purchase orders placed for the aggregate of items on the selected sales orders +12/3/11: SuppPriceList.php removed a round trip to DB to get currency - fixed function to get pdf to new TCPDF Output +12/3/11: Exson fix all htmlentities to use ENTQUOTES, 'UTF-8' option so other character sets work with it +10/3/11: Phil fix pagination of PrintCustOrder_generic.php - second copy was not restarting page numbers +10/3/11: Tims launchpad fixes brought in MRP.php fix for table charset utf8 so joins work correctly; typeo in PO_Header preventing purchasing data being retrieved ($result not $Result); correct sql on searching for customer in SelectCreditItems.php; StockStatus.php pricing history bug resolved (4450); StockQuantityByDate.php now allowed to show for all categories - enclosed 'All' in gettext +8/3/11: Tim/Phil PO_Items.php in committing an order detail the assetid of 'Not an Asset' was being inserted to an integer field. Modified $_POST['AssetID'] to = 0 if it was 'Not an Asset' as advised by Tim +8/3/11: Phil fix SalesAnalysis reports for TCPDF as reported by Joe Zhou +5/3/11: Kovács Attila fix to Stocks.php to use ANSI GROUP BY for aggregate functions SQL +5/3/11: Kovács Attila fix to LanguageSetup.php to use utf-8 not ISO-8859-1. Phil hardcoded UTF-8 now as no dynamic changing of character set required all translations are utf-8 +3/3/11: Exson/Baran/Phil fix to customer login to ensure that other customers orders are not displayed when searching by customer ref or order no +3/3/11: Tim launchpad mods to revision 4441 including change to allow supplier currency to be changed if there are no transactions already against the supplier. Ensure credit note session variable is unset before attempting to create a new credit note from the supplier form. Tim's work to add perisable expiry dates to the serial items logic - affects quite a few scripts. Headings to stock check script even if no quantity is shown. Portrait quotations. Not included change to default delivery date to the date the customer requested - left to be the current day's date. Not included Tim's unit pricing work .. yet launchpad revisions 4442-4447 inclusive +27/2/11: Phil/Tim/Peter launchpad added category option for MRPShortages.php links with matching quotes in WorkOrderEntry +27/2/11: Phil StockUsage.php now totals usage each month even in months where there was none - average now includes months with no usage +27/2/11: Phil fix units deletion issue reported by Exson in UnitsOfMeasure.php script - checked for none existant units field in contracts table - removed the check +22/2/11: Phil fix PDFTopItems.php for changed variable names - now using CamelCase tried to rework to conform +22/2/11: Phil remove options for PDFLanguage that are not unique in WWW_Users.php - make it default to the users settings in the SESSION for UserSettings.php +18/2/11: Phil/Don Change PageSecurity array variable name to PageSecurityArray - caused problems with conflict with PageSecurity variable where register_globals = on; +18/2/11: PO_Items.php make number_format variables turn back into numbers for > 1000 +16/2/11: FixedAssetItems.php now checks for location before allowing additions +16/2/11: Company preferences - changed wording of stock integration at cost removed the word standard as suggested by Exson +16/2/11: SelectCreditItems.php formating/conventions lower case html and CreditInvoice.php +15/2/11: Phil Make invoicing warn the user when no taxes are defined for a tax group - i.e. there is a configuration error with taxes +<p /> +15/2/11 Release 4.03RC2 +<p /> +15/2/11: Phil UpgradeDatabase.php fix to upgrade from 4.01RC1 !! +15/2/11: Phil PrintCustTrans.php and PrintCustTransPortrait.php htmlspecialchars_decode($narrative) - conversion at the time of committing to DB needs to be unconverted. Also in ConfirmDispatch_Invoice.php +15/2/11: Phil SelectCustomer.php removed showing blank message when $msg was empty +<p /> +13/2/11 Release 4.03RC1 +<p /> +13/2/11:Phil GoodsReceivedControlled InputSerialItems and friends - now uses session identifier to ensure uniqueness is several people entering stock receipts +13/2/11:Phil Contracts.php SelectOrderItems.php customer selection mechanism reworked - was causing issues in Contracts as noted by DK Shukla +8/2/11: Tim Rework CounterSales.php so that it is now possible to sell items that have sales/purchasing tax +8/2/11: Phil Fix InventoryPlanning and InventoryPlanningPrefSupplier to only show sales order demand - excluding quotations. Also fixed for conversionfactor as now all purchase order quantities are in our normal stock units +8/2/11: Phil Fix incorrect layout of narrative on multiple lines of PDFQuotation.php as reported by Ricard Andreu +8/2/11: Tim/Ricard StockLocTransfer.php can now transfer the same amount as on hand in the location - previously checked to see that the transfer was less than the quantity on hand (when checking for negative stock) +8/2/11: Tim Payments.php and javascripts/MiscFunctions.js corrections to javascript +8/2/11: Phil PDFGrn.php turns out preview is used from the form modification script doh! Over simplificaton reversed to reinstate preview mode +6/2/11: Otandeka Removed debug prnMsg in FixedAssetDepreciation +5/2/11: Phil SystemParameters.php new option to AutoAuthorisePO when the user has authority to do so +5/2/11: Phil PO_Items.php fixed non-existant variables on Enter nominal line. Added option to automatically authorise when user is an authoriser as well as a creator +5/2/11: Phil PDFGrn.php rewrote - preview never used - simplified +4/2/11: Tim CostUpdate.php allow cost update with appropriate permissions token 10 hard coded +4/2/11: Phil SelectCustomer.php rejig selection options in more logical way. Used non-specific SQL to search by any part of the address +2/2/11: Phil PDFTopItems.php and TopItems.php removed mysql specific SQL +30/1/11: Phil GoodsReceived.php rework for supplier units and conversion factor etc now in PO class +30/1/11: Phil PDFGrn.php rework for supplier units and conversion factor etc now in PO class +30/1/11:Exson changed PDFLowGP report remove % from gettext string +29/1/11:Tim fix reportwriter with tcpdf using parent::__construct rather than $this->Cpdf( +24/1/11:Phil Depreciation fixes - SelectAsset by description fix +23/1/11:Peter Otandeka: PDFTopItems.php SQL quoting fixes +23/1/11: Phil Fix Depreciation posting and dates of end of periods +23/1/11:Phil changed back references throughout several MRP scripts from is_date to Is_Date - as Is_Date is used throughout the code and much bigger job to change all references to is_date +20/1/11: Tim changed back addinfo calls to addInfo on PDF reports - Zhigio originally thought to be an issue with Turkish utf-8 pdfs but turned out to be a red herring. class.pdf call changed back to addInfo too - most of calls had not been changed to lower case info +20/1/11: Tim changed PricesBasedOnMarkUp to have end date day before new prices effective from +20/1/11: Phil FixedAssetRegister.php FixedAssetDepreciation.php fixes +19/1/11: Phil modified GLBudgets.php to allow entry of last years budget too +17/1/11: Phil More purchasing work removing redundant queries rationalising code - new layout with supplier units +15/1/11: Tim removed MX record check from IsEmail function in includes/MiscFunctions.php +15/1/11: Tim/Peter Otandeka SQL quoting a whole bunch of scripts - changing single quotes to doubles - didn't apply ones where no variables required quoting +14/1/11: Phil install scripts modified to copy over FormDesigns under the new company directory created +14/1/11: Phil Updates to manual for security and supplier invoice entry +13/1/11:Phil PO_Items.php remove redundant code, setup entry of lines in supplier units +13/1/11:Tim Z_ChangeCustomerCode.php now has foreign key checks defeated when deleting the old customer record and custbranch record +13/1/11:Phil SupplierInvoice.php and SupplierCredit.php now check to ensure the total of contracts fixed asset charges goods received charges, shipment charges and GL charges are at least equal to the amount of the invoice or credit. It was possible when GL interface turned off to get strange results +12/1/11:Phil DailyBankTransactions.php made it so a range of dates can be selected but defaults to just today +11/1/11:Phil Fix choice of portrait or landscape invoices - fix landscape default form layout. Fix portrait invoice logo position +11/1/11:Phil Fix customer transaction inquiries to show correct links where user is not authorised for credit notes or GL inquiries +11/1/11:Phil SupplierCredit.php and SupplierInvoice.php recalculate price variance to post differences on fixed asset additions correctly +11/1/11:Phil PO_PDFPurchOrder.php - fixed for coding conventions removed uneccessary sql calls +11/1/11: Murray Collingwood: Emailing invoices was writing the pdf file twice - once with fwrite and once with the TCPDF output function with the option 'F' +8/1/11 Ricard Andreu: Z_ChangeCustomerCode.php added typeid field that made change customer code fail. Also corrected typo for foreign key checking side stepping for Z_ChangeBranchCode.php +5/1/11 Phil: Bug fixes AssetLocationTransfer and Supplier Contacts +4/1/11 Paul T: Bug# 3151192 - insert underscore for superglobal. +5/1/11 Phil: Bug fixes AssetLocationTransfer and Supplier Contacts +4/1/11 Phil: Start rework of purchase order scripts ... again. +4/1/11 Phil: Select Purchase orders now defaults to just pending and authorised/printed - other statii are options +1/1/11 Phil: Upgrade script make capable of upgrades from any earlier version - and email a backup to the user. Deleted DBUpgradeNumber config variable now use the VersionNumber already there +31/12/10 Tim: Tidy up of CounterSales.php - CamelCasing, quoting SQL, closing slashes in xhtml tags +29/12/10 Phil: Reverted to single SQL upgrade file per release - but retaining Tim's upgrade mechanism if the DBUpgradeNumber is out of date. Removed pseudo SQL language required for upgrade script and the 52 update files - just applies plain vanilla SQL from the scripts required +29/12/10 Tim: DB upgrade mechanism with separate pseudo SQL for each database change in a separate file + 52 files of updates since 3.11.4 +21/12/10 Phil : Reworked PDFPrintLabels.php to conform to standards and corrected SQL for prices +21/12/10 Ricard Andreu: PDFPrintLabels.php was not checking for end date of prices - fixed +19/12/10 Phil: SelectOrderItems.php ConfirmDispatch_Invoice.php add code to handle asset disposals. +14/12/10 Phil: modify purchasing scripts for coding conventions/readability +11/12/10 Phil: Have populated the new field stockcheckdate in stockcheckfreeze and modified PDFStockCheckComparison to use this field when posting the GL - stockmoves need to be on the current day otherwise historical balances will all need to be updated. But narrative shows the date of the stock check for which the adjustment is being made +9/12/10 James Murray: highlighted a bug in SupplierInvoice.php (and also in SupplierCredit.php) where the due date of the invoice/credit was not calculated correctly based on the terms - it was picking up the current date rather than the invoice/credit date. Now fixed +8/12/10 James Murray: fixed bug in SuppPaymentRun.php - was not showing anything as the test to see if there was anything to see was using a non-existant result set! +3/12/10 Matt Elbrecht : Estonian translation +30/11/10 Phil: Changed table structure of new fixedassettrans and modified upgrade script - those who already ran that bit will need to change the table again. Modified fixed asset scripts again. New fixed assets manual +28/11/10 Exson: CreditStatus.php - Fix bug in sql statement +28/11/10 Tim: OutstandingGRNs.php - Only show when the invoiced qty is less than the GRN qty +28/11/10 Phil: All fixed asset scripts SupplierInvoice.php SupplierCredit.php SuppFixedAssetChgs.php - adding fixed assets directly from invoice charges - and reversing additions with credit notes. Also FixedAssetRegister.php report to print PDF or export CSV of fixed assets now includes date range depreciation and b/fwd cost b/fwd accum depn and c/fwd cost and accum depn - and NBV +28/11/10 James Murray: unset session in ConnectDB_mysqli.inc and ConnectDB_mysql.inc when the login fails +27/11/10 Phil: install/index.php check for critical requirements before allowing install to proceed +27/11/10 Phil: includes/DefinePOClass.php change variable to camel case also PO_Header.php PO_Items.php PO_ReadInOrder.inc GoodsReceived.php - scope for error needs lots of testing please +27/11/10 Phil: PurchData - fix MinOrderQty error trapping with appropriate text and default to 1 +27/11/10 Phil: SupplierInvoice.php removed check on weighted average costing to reverse GRN suspense posting and set cost to zero - this was defeating the price variance calculation and the proper valuation of stock. Also took out of the calculations the conversionfactor - will need to alter goods received code to ensure only our units recorded in quantity received. +26/11/10 Tim: upgrade3.11.1-4.00.sql - Add default date for stockcheckdate field in stockcheckfreeze table +26/11/10 Otandeka: CounterSales.php - Fix bug in counter sales script. +24/11/10 Phil: GoodsReceived.php - modified to insert fixedassettrans and to post nominal POs to fixed asset cost account from fixedassetcategories.costact +23/11/10 Pak Ricard: MRP.php and MRPShortages.php fixed temporary tables to use utf-8 - code failed without probably depends on mysql server settings +21/11/10 Phil:Rewritten FixedAssetJournal.php - renamed FixedAssetDepreciation.php +20/11/10 Phil: Rewritten FixedAssetItems.php FixedAssetCategories.php and modified FixedAssetLocations.php to use the new structure +18/11/10 Tim: upgrade3.11.1-4.00.sql - Fix sql syntax errors brought in on recent changes. +14/11/10 Phil: SelectAsset.php script reworked SelectAssetType.php script now deleted +08/11/10 Exson: Z_ImportStocks.php - Bug fixes. +06/11/10 Phil: ShiptChgs.php - made a check to ensure a shipment reference entered manully actually exists before it is added - otherwise a nasty error occurs on commital of the invoice +06/11/10 Paul T: InputSerialItemsSequential.php - Bug# 3080130 - Add new FormID to form. (and minor cleanup) +06/11/10 Tim: ReorderLevelLocation.php - Remove fixed assets from selections +06/11/10 Tim: ReorderLevel.php - Remove fixed assets from selections +06/11/10 Tim: InventoryQuantities.php - Remove fixed assets from selections +06/11/10 Tim: Selectproduct.php - Remove fixed assets from selections +06/11/10 Tim: InventoryValuation.php - Ensure fixed assets dont get shown in valuation report +06/11/10 Tim: FixedAssetItems.php - Fixed typo preventing Item code being shown +06/11/10 Phil: StockCategory.php FixedAssetCategory.php attempt to add validation to depreciation rates by extending the stock category property logic with new fields for numericvalue, minimumvalue and maximumvalue. Then adding the depreciation rate percentage property to expect numeric values with a minimum of 0 and maximum of 100. +05/11/10 Tim: PurchData.php. Converted field name to lower case for consistency +05/11/10 Tim: SelectProduct.php. Change the standard order quantities to agree with Minimum order qty +05/11/10 Tim: PurchData.php. Make the Minimum order quantity field numeric only +05/11/10 Poul Bjerre-Jensen: SelectProduct.php,PurchData.php. Add in Minimum order quantity to Purchasing data +02/11/10 Tim: SelectCustomer.php. Correction to work with debtors that have a - in the code +31/10/10 Tim: SuppTransGLAnalysis.php. Minor bug fixes +31/10/10 Tim: SuppTransGLAnalysis.php. Force the user to select a GL account code instaed of defaulting to first on the list +31/10/10 Tim: CustomerReceipt.php. Force the user to select a GL account code and a Bank Account instaed of defaulting to first on the list +29/10/10 Tim: index.php. If CustomerReceipt selected from the GL menu then go to GL receipts else customer receipts +29/10/10 Tim: Payments.php. Force the user to select a GL account code and a Bank Account instaed of defaulting to first on the list +29/10/10 Tim: GLJournal.php. Force the user to select a GL account code instaed of defaulting to first on the list +28/10/10 Tim: Fix bug # 3017709. When bulk transfers are received for controlled items serial numbers are required +28/10/10 Tim: PcExpensesTypeTab.php - SQL quoting corrections and layout changes and improvements +28/10/10 Tim: PcTabs.php - SQL quoting corrections and layout changes and improvements +28/10/10 Tim: PcTypeTabs.php - SQL quoting corrections and layout changes and improvements +27/10/10 Tim: PcReportTab.php - SQL quoting corrections and layout changes and improvements +27/10/10 Tim: PcClaimExpensesFromTab.php - SQL quoting corrections and layout changes and improvements +27/10/10 Tim: class.pdf.php - Fix bug in html_entity_decode() function call +27/10/10 d.k shukla: ManualPurchaseOrdering.html - Improvements to purchase ordering manual +27/10/10 Tim: WorkOrderEntry.php - When the quantities are changed, then the correct quantities are updated, and the date picker chooses the correct date. +27/10/10 Tim: header.inc - Correct for non ascii characters +27/10/10 Tim: Corrections to display multi line invoice narratives correctly +26/10/10 Tim: Discountmatrix.php - Fix discount category bug +26/10/10 Tim: Discountmatrix.php - Increase the number of decimal places that can be entered +26/10/10 Tim: StockLocTransfer.php - Check there is sufficient stock for the transfer +25/10/10 Marcos Garcia Trejo: New labelprinting functionality +25/10/10 ChenJohn: class.pdf.php - correctly display some html encoded special characters, to make them human readeable in pdf file. +23/10/10 Phil: PurchData.php - search by name failed concatenation of SQL stuffed now repaired. + +Version 4.0RC1 +22 October 2010 + +20/10/10 Paul: MiscFunctions.js - Bug #3060329. Correct condition check. [allows the calendar to start with the textbox's date] +18/10/10 Paul: WorkOrderReceive.php - Bug #3023776. Applied anonymous contribution. +16/10/10 Phil: SupplierInvocie.php fixed for mix up with commits - now shipment charges added correctly and contract charges also +14/10/10 Tim: MiscFunctions.php - Fix bug preventing download of ECB rates +13/10/10 Tim: WWW_Users.php - Show the last visit date correctly. Fixes bug 3085860 +09/10/10 Phil: Added xmlrpc_GetStockCategoryList api method +04/10/10 Matt Taylor: upgrade3.11.1-3.12.sql - Update tables to utf8 +03/10/10 Gabriel Olowo: ManualPurchaseOrdering.php - Manual for purchase ordering system +02/10/10 Tim: AuditTrail.php - Bug fixes and layout changes +02/10/10 Tim: DailySalesInquiry.php - Bug fixes and layout changes +02/10/10 Tim: session.inc - Corrections to sql quoting. Resolves bug 3023782 +02/10/10 Tim: ppdf_tpl.php - Make php 5.3 compatible +02/10/10 Tim: GLJournal.php - Fix to create a reversing journal even when non english language is used. +02/10/10 Tim: PDFGrnHeader.php - Show correct column headings. Fixes bug 3072507 +30/09/10 Tim: Add form verification to prevent form spoofing +30/09/10 Tim: WWW_Users.php - SQL quoting corrections and layout changes and improvements +30/09/10 Tim: WWW_Access.php - SQL quoting corrections and layout changes and improvements +29/09/10 Tim: WOSerialNos.php - SQL quoting corrections +29/09/10 Tim: WorkOrderStatus.php - SQL quoting corrections and layout changes and improvements +29/09/10 Tim: WorkOrderReceive.php - SQL quoting corrections and layout changes and improvements +29/09/10 Tim: WorkOrderIssue.php - SQL quoting corrections and layout changes and improvements +29/09/10 Tim: WorkOrderEntry.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: WorkOrderCosting.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: WorkCentres.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: WhereUsedInquiry.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: UserSettings.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: UnitsOfMeasure.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: TopItems.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: TaxProvinces.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: TaxGroups.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: TaxCategories.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: TaxAuthorityRates.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: TaxAuthorities.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: Tax.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: SystemParameters.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: SuppTransGLAnalysis.php - SQL quoting corrections and layout changes and improvements +28/09/10 Tim: SuppShiptCharges.php - Layout changes and improvements +28/09/10 Tim: SuppPriceList.php - Layout changes and improvements +27/09/10 Paul Thursby: Various default.css files -- Minor CSS corrections. +27/09/10 Tim: SuppPaymentRun.php - SQL quoting corrections and layout changes and improvements +27/09/10 Tim: SuppLoginSetup.php - SQL quoting corrections and layout changes and improvements +27/09/10 Tim: SupplierTypes.php - SQL quoting corrections and layout changes and improvements +27/09/10 Tim: SupplierTransInquiry.php - New script to show detail supplier transactions +27/09/10 Tim: SupplierTenders.php - SQL quoting corrections +27/09/10 Tim: Suppliers.php - SQL quoting corrections +27/09/10 Tim: SupplierInvoice.php - SQL quoting corrections and layout changes and improvements +27/09/10 Tim: SupplierInquiry.php - SQL quoting corrections and layout changes and improvements +27/09/10 Tim: SupplierCredit.php - SQL quoting corrections and layout changes and improvements +27/09/10 Tim: SupplierContacts.php - SQL quoting corrections and layout changes and improvements +27/09/10 Tim: SupplierBalsAtPeriodEnd.php - Layout changes and improvements +27/09/10 Tim: SupplierAllocations.php - SQL quoting corrections and layout changes and improvements +27/09/10 Tim: SuppInvGRNs.php - SQL quoting corrections and layout changes and improvements +27/09/10 Tim: SuppCreditGRNs.php - SQL quoting corrections and layout changes and improvements +27/09/10 Tim: StockUsage.php - Layout changes and improvements +26/09/10 Tim: StockTransfers.php - Layout changes and improvements +26/09/10 Tim: StockSerialItemResearch.php - Layout changes and improvements +26/09/10 Tim: StockReorderLevel.php - SQL quoting corrections and layout changes and improvements +26/09/10 Tim: StockQuantityByDate.php - SQL quoting corrections and layout changes and improvements +26/09/10 Tim: StockQties_csv.php - Layout changes and improvements +26/09/10 Tim: StockMovements.php - Layout changes and improvements +26/09/10 Tim: StockLocStatus.php - SQL quoting corrections and layout changes and improvements and bug fixes +26/09/10 Tim: StockDispatch.php - SQL quoting corrections and layout changes and improvements and bug fixes +26/09/10 Tim: StockCounts.php - SQL quoting corrections and layout changes and improvements and bug fixes +26/09/10 Tim: StockCostUpdate.php - SQL quoting corrections and layout changes and improvements and bug fixes +26/09/10 Tim: StockCategories.php - SQL quoting corrections and layout changes and improvements and bug fixes +26/09/10 Tim: SpecialOrder.php - SQL quoting corrections +25/09/10 Tim: SMTPServer.php - SQL quoting corrections +25/09/10 Tim: ShiptsList.php - Add script to show list of open shipments for selected supplier +25/09/10 Tim: Shipt_Select.php - SQL quoting corrections and layout changes and improvements and bug fixes +25/09/10 Tim: Shippers.php - SQL quoting corrections and layout changes and improvements and bug fixes +25/09/10 Tim: Shipments.php - SQL quoting corrections and layout changes and improvements and bug fixes +25/09/10 Tim: ShipmentCosting.php - SQL quoting corrections and layout changes and improvements and bug fixes +25/09/10 Tim: SelectWorkOrder.php - SQL quoting corrections and layout changes and improvements and bug fixes +24/09/10 Tim: SelectSalesOrder.php - Layout changes and improvements and bug fixes +24/09/10 Tim: SelectRecurringSalesOrder.php - Layout changes and improvements and bug fixes +24/09/10 Tim: SelectProduct.php - SQL quoting corrections +24/09/10 Tim: SelectOrderItems.php - SQL quoting corrections +24/09/10 Tim: SelectGLAccount.php - SQL quoting corrections and layout changes and improvements and bug fixes +24/09/10 Tim: SelectCustomer.php - Layout changes and improvements and bug fixes +24/09/10 Tim: SelectCreditItems.php - SQL quoting corrections and layout changes and improvements and bug fixes +23/09/10 Tim: SelectAssetType.php - SQL quoting corrections and layout changes and improvements +23/09/10 Tim: SalesTypes.php - SQL quoting corrections and layout changes and improvements +23/09/10 Tim: SalesPeople.php - SQL quoting corrections and layout changes and improvements +23/09/10 Tim: SalesGraph.php - Fix deprecated use of assigning by reference +23/09/10 Tim: SalesGLPostings.php - SQL quoting corrections and layout changes and improvements +23/09/10 Tim: SalesCategories.php - SQL quoting corrections and layout changes and improvements +23/09/10 Tim: SalesAnalRepts.php - SQL quoting corrections and layout changes and improvements +23/09/10 Tim: SalesAnalReptCols.php - SQL quoting corrections and layout changes and improvements +23/09/10 Tim: ReverseGRN.php - SQL quoting corrections and layout changes and improvements +23/09/10 Tim: ReorderLevelLocation.php - SQL quoting corrections and layout changes and improvements +23/09/10 Tim: ReorderLevel.php - SQL quoting corrections and layout changes and improvements +23/09/10 Tim: RecurringSalesOrdersProcess.php - SQL quoting corrections +23/09/10 Tim: RecurringSalesOrders.php - SQL quoting corrections and layout changes and improvements +23/09/10 Tim: DateFunctions.inc - mktime() function without paramaeters is now deprecated, replaced with time() +20/09/10 Pak Ricard: PricesByCost.php - Restrict price changes to those stock items not discontinued +14/09/10 Tim: PurchData.php - SQL quoting corrections and layout changes and improvements +14/09/10 Tim: PrintSalesOrder_generic.php - SQL quoting corrections +14/09/10 Tim: PrintCustTransPortrait.php - SQL quoting corrections and layout changes and improvements +13/09/10 Tim: PrintCustTrans.php - SQL quoting corrections and layout changes and improvements +13/09/10 Tim: PrintStatements.php - Small bug fixes +13/09/10 Tim: PrintCustOrder_Generic.php - Correct the sql quoting +13/09/10 Tim: PrintCustOrder.php - Correct the sql quoting +13/09/10 Tim: PricesBasedOnMarkup.php - Correct the sql quoting, and various layout improvements and bug fixes +13/09/10 Tim: Prices_Customer.php - Correct the sql quoting, and various layout improvements and bug fixes +13/09/10 Tim: Prices.php - Correct the sql quoting, and various layout improvements and bug fixes +13/09/10 Tim: POReport.php - Format correctly for screen and add in option to export as a csv file +11/09/10 Tim: PO_SelectPurchOrder.php - Correct the sql quoting, and various layout improvements +11/09/10 Tim: PO_SelectOSPurchOrder.php - Correct the sql quoting +11/09/10 Tim: PO_PDFPurchOrder.php - Correct the sql quoting +11/09/10 Otandeka: PDFPriceList.php - Corrected undefined offset error +11/09/10 Phil: Manual changes - for utf-8 - language and PDFlanguage selection, also the installer and the new CounterSales.php script +10/09/10 Tim: PO_OrderDetails.php - Layout improvements, links to SelectSuppliers.php and sql quoting corrections +10/09/10 Tim: PO_Items.php - Layout improvements, and sql quoting corrections +10/09/10 Tim: PO_Header.php - Layout improvements, and sql quoting corrections +10/09/10 Tim: PO_AuthoriseMyOrders.php - Layout improvements, and sql quoting corrections +10/09/10 Tim: PO_AuthorisationLevels.php - Layout improvements, and sql quoting corrections +10/09/10 Tim: PeriodsInquiry.php - Layout improvements +10/09/10 ChenJohn: ConnectDB_mysql.inc ConnectDB_mysqli.inc fix utf-8 data being encoded/stored incorrectly in db server +08/09/10 Tim: PDFTopItems.php - Correct the sql quoting +08/09/10 Tim: PDFSuppTransListing.php - Screen layout improvements. Correct the sql quoting +08/09/10 Tim: PDFStockTransfer.php - Correct the sql quoting +08/09/10 Tim: PDFStockNegatives.php - Fix missing sql error message and correct the default date format in the heading +08/09/10 Tim: PDFStockCheckComparison.php - Screen layout improvements. Correct the sql quoting +07/09/10 Tim: PDFRemittanceAdvice.php - Correct the sql quoting +07/09/10 Tim: PDFReceipt.php - Correct the sql quoting +07/09/10 Tim: PDFQuotation.php - Correct the sql quoting +07/09/10 Tim: PDFPickingList.php - Correct the sql quoting +07/09/10 Tim: PDFOrderStatus.php - Improve report layout for readability +07/09/10 Tim: PDFOrderInvoiced.php - Improve report layout for readability +06/09/10 Tim: PO_Header.php - Move dummy status array from DefinePOClass.php +06/09/10 Tim: upgrade3.11.1-3.12.sql - Change syntax to work in both windows and linux +06/09/10 Tim: SupplierInvoice.php - Correct the roundings so that the double entry balances +05/09/10 Tim: PO_AuthoriseMyOrders.php - Update correct status when language not English +05/09/10 Tim: PcAssignCashToTab.php - Show authorised, notes, and receipt fields correctly. Changed to use DB_fetch_array() rather than DB_fetch_row(). +05/09/10 Tim: PDFStockTransListing.php - List stock transactions by transaction type. +05/09/10 Ricard: upgrade3.11.1-3.12.sql - Database changes required for changes to report writer. +31/08/10 Tim: StockLocTransfer.php - Change quantity input field to have more than 5 digits +28/08/10 Marcos Garcia Trejo: Fix ConfirmDispatchInvoice.php assembly components new qty on hand +27/08/10 Tim: Add in requisition number into purchase order prints. +21/08/10 Phil: Fix bugs introduced by Paul's patch prnMsg= should be prnMsg() BOMs.php also did in Contracts.php +21/08/10 Phil: Contract closing changes all the contracts scripts +20/08/10 Paul Thursby: More $msg cleanup. Unused eliminated; Others replaced with prnMsg(). +15/08/10 Phil: Decided to have contracts as part of orders module since not really enough links to warrant a new module changes to index.php WWW_Users.php and sql upgrade. +15/08/10 Phil: New script for ContractCosting.php comparison of contract costs budgeted vs incurred. Lot of work on contracts +13/08/10 Phil: DefineSuppTransClass.php SupplierInvoice.php and SupplierCredit.php now allow entry of contract charges. New script for SuppContractChgs.php +13/08/10 Phil: Fixes to show creditors transactions correctly in GLTransInquiry.php signs mixed up and period not shown previously +10/08/10 Russell (Regal Prods): Fix SelectOrderItems.php width of narrative box was making screen unusable!! +18/08/10 Pak Ricard: Revised report writer with the ability for more fields +07/08/10 Paul Thursby: PO_Items.php - Eliminate query; Moves the ONE field into a query above this point. +07/08/10 Paul Thursby: SelectProduct.php - Variable $msg will never print. Elimnate to use function prnMsg() instead. +08/08/10 Phil: Contracts.php SelectContracts.php DeliveryDetails.php - more work to convert Contracts to quotations and on conversion of contract quotations to orders to create contract work order to issue materials to +07/08/10 Tim: PDFLowGP.php - Sql quoting correction, layout changes, and assorted minor bug corrections +07/08/10 Tim: PO_Items.php - Sql quoting correction, layout changes, and assorted minor bug corrections +07/08/10 Tim: SelectCustomer.php - Unset $result variable once used as it was ca... [truncated message content] |
From: <dai...@us...> - 2011-05-02 10:34:04
|
Revision: 4560 http://web-erp.svn.sourceforge.net/web-erp/?rev=4560&view=rev Author: daintree Date: 2011-05-02 10:33:55 +0000 (Mon, 02 May 2011) Log Message: ----------- quoting and currency decimal places on order entry Modified Paths: -------------- trunk/COGSGLPostings.php trunk/ConfirmDispatch_Invoice.php trunk/ContractBOM.php trunk/OffersReceived.php trunk/PO_PDFPurchOrder.php trunk/SelectOrderItems.php trunk/doc/Change.log.html trunk/includes/DefineCartClass.php Modified: trunk/COGSGLPostings.php =================================================================== --- trunk/COGSGLPostings.php 2011-05-01 09:45:18 UTC (rev 4559) +++ trunk/COGSGLPostings.php 2011-05-02 10:33:55 UTC (rev 4560) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.15 $ */ + /* $Id$*/ -//$PageSecurity = 10; - include('includes/session.inc'); $title = _('Cost Of Sales GL Postings Set Up'); @@ -58,7 +56,6 @@ $result = DB_query($sql,$db); prnMsg ($msg,'info'); - echo '<br />'; unset ($SelectedCOGSPostingID); } elseif (isset($_GET['delete'])) { @@ -67,23 +64,21 @@ $sql="DELETE FROM cogsglpostings WHERE id='".$SelectedCOGSPostingID."'"; $result = DB_query($sql,$db); prnMsg( _('The cost of sales posting code record has been deleted'),'info'); - echo '<br />'; unset ($SelectedCOGSPostingID); - } if (!isset($SelectedCOGSPostingID)) { $ShowLivePostingRecords = true; - $sql = 'SELECT cogsglpostings.id, - cogsglpostings.area, - cogsglpostings.stkcat, - cogsglpostings.salestype, - chartmaster.accountname - FROM cogsglpostings LEFT JOIN chartmaster + $sql = "SELECT cogsglpostings.id, + cogsglpostings.area, + cogsglpostings.stkcat, + cogsglpostings.salestype, + chartmaster.accountname + FROM cogsglpostings LEFT JOIN chartmaster ON cogsglpostings.glcode = chartmaster.accountcode - WHERE chartmaster.accountcode IS NULL'; + WHERE chartmaster.accountcode IS NULL"; $result = DB_query($sql,$db); if (DB_num_rows($result)>0){ @@ -106,12 +101,12 @@ $k=1; } - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> - <td><a href=\"%sSelectedCOGSPostingID=%s\">" . _('Edit') . "</td> - <td><a href=\"%sSelectedCOGSPostingID=%s&delete=yes\">". _('Delete') . "</td></tr>", + <td><a href="%sSelectedCOGSPostingID=%s">' . _('Edit') . '</td> + <td><a href="%sSelectedCOGSPostingID=%s&delete=yes">'. _('Delete') . '</td></tr>', $myrow[1], $myrow[2], $myrow[3], @@ -124,11 +119,11 @@ echo '</table>'; } - $sql = 'SELECT cogsglpostings.id, + $sql = "SELECT cogsglpostings.id, cogsglpostings.area, cogsglpostings.stkcat, cogsglpostings.salestype - FROM cogsglpostings'; + FROM cogsglpostings"; $result = DB_query($sql,$db); @@ -182,14 +177,14 @@ } if ($ShowLivePostingRecords){ - $sql = 'SELECT cogsglpostings.id, - cogsglpostings.area, - cogsglpostings.stkcat, - cogsglpostings.salestype, - chartmaster.accountname - FROM cogsglpostings, - chartmaster - WHERE cogsglpostings.glcode = chartmaster.accountcode'; + $sql = "SELECT cogsglpostings.id, + cogsglpostings.area, + cogsglpostings.stkcat, + cogsglpostings.salestype, + chartmaster.accountname + FROM cogsglpostings, + chartmaster + WHERE cogsglpostings.glcode = chartmaster.accountcode"; $result = DB_query($sql,$db); @@ -197,7 +192,8 @@ echo '<tr><th>' . _('Area') . '</th> <th>' . _('Stock Category') . '</th> <th>' . _('Sales Type') . '</th> - <th>' . _('GL Account') . '</th></tr>'; + <th>' . _('GL Account') . '</th> + </tr>'; $k = 0; while ($myrow = DB_fetch_row($result)) { if ($k==1){ @@ -208,13 +204,13 @@ $k++; } - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> - <td><a href=\"%sSelectedCOGSPostingID=%s\">" . _('Edit') . "</td> - <td><a href=\"%sSelectedCOGSPostingID=%s&delete=yes\">" . _('Delete') . "</td> - </tr>", + <td><a href="%sSelectedCOGSPostingID=%s">' . _('Edit') . '</td> + <td><a href="%sSelectedCOGSPostingID=%s&delete=yes">' . _('Delete') . '</td> + </tr>', $myrow[1], $myrow[2], $myrow[3], @@ -257,14 +253,14 @@ $_POST['StkCat'] = $myrow['stkcat']; $_POST['SalesType'] = $myrow['salestype']; - echo '<input type=hidden name="SelectedCOGSPostingID" VALUE="' . $SelectedCOGSPostingID . '">'; + echo '<input type=hidden name="SelectedCOGSPostingID" value="' . $SelectedCOGSPostingID . '">'; } //end of if $SelectedCOGSPostingID only do the else when a new record is being entered -$sql = 'SELECT areacode, +$sql = "SELECT areacode, areadescription - FROM areas'; + FROM areas"; $result = DB_query($sql,$db); echo '<table class=selection> @@ -274,16 +270,16 @@ while ($myrow = DB_fetch_array($result)) { if (isset($_POST['Area']) and $myrow['areacode']==$_POST['Area']) { - echo '<option selected VALUE="'; + echo '<option selected value="'; } else { - echo '<option VALUE="'; + echo '<option value="'; } echo $myrow['areacode'] . '">' . $myrow['areadescription'] . '</option>'; } //end while loop DB_free_result($result); -$sql = 'SELECT categoryid, categorydescription FROM stockcategory'; +$sql = "SELECT categoryid, categorydescription FROM stockcategory"; $result = DB_query($sql,$db); echo '</select></td></tr> @@ -292,10 +288,10 @@ <option VALUE="ANY">' . _('Any Other') . '</option>'; while ($myrow = DB_fetch_array($result)) { - if (isset($_POST['StkCat']) and $myrow["categoryid"]==$_POST['StkCat']) { - echo '<option selected VALUE="'; + if (isset($_POST['StkCat']) and $myrow['categoryid']==$_POST['StkCat']) { + echo '<option selected value="'; } else { - echo '<option VALUE="'; + echo '<option value="'; } echo $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; @@ -303,7 +299,7 @@ DB_free_result($result); -$sql = 'SELECT typeabbrev, sales_type FROM salestypes'; +$sql = "SELECT typeabbrev, sales_type FROM salestypes"; $result = DB_query($sql,$db); echo '</select></td></tr> @@ -313,9 +309,9 @@ while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SalesType']) and $myrow['typeabbrev']==$_POST['SalesType']) { - echo '<option selected VALUE="'; + echo '<option selected value="'; } else { - echo '<option VALUE="'; + echo '<option value="'; } echo $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; @@ -326,22 +322,22 @@ <td><select tabindex="4" name="GLCode">'; DB_free_result($result); -$sql = 'SELECT chartmaster.accountcode, - chartmaster.accountname - FROM chartmaster, - accountgroups - WHERE chartmaster.group_=accountgroups.groupname - AND accountgroups.pandl=1 - ORDER BY accountgroups.sequenceintb, - chartmaster.accountcode, - chartmaster.accountname'; +$sql = "SELECT chartmaster.accountcode, + chartmaster.accountname + FROM chartmaster, + accountgroups + WHERE chartmaster.group_=accountgroups.groupname + AND accountgroups.pandl=1 + ORDER BY accountgroups.sequenceintb, + chartmaster.accountcode, + chartmaster.accountname"; $result = DB_query($sql,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['GLCode']) and $myrow['accountcode']==$_POST['GLCode']) { - echo '<option selected VALUE="'; + echo '<option selected value="'; } else { - echo '<option VALUE="'; + echo '<option value="'; } echo $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-05-01 09:45:18 UTC (rev 4559) +++ trunk/ConfirmDispatch_Invoice.php 2011-05-02 10:33:55 UTC (rev 4560) @@ -1,12 +1,10 @@ <?php -/* $Revision: 1.67 $ */ /* $Id$*/ /* Session started in session.inc for password checking and authorisation level check */ include('includes/DefineCartClass.php'); include('includes/DefineSerialItems.php'); -//$PageSecurity = 2; include('includes/session.inc'); $title = _('Confirm Dispatches and Invoice An Order'); @@ -15,10 +13,10 @@ include('includes/FreightCalculation.inc'); include('includes/GetSalesTransGLCodes.inc'); -if (!isset($_GET['OrderNumber']) && !isset($_SESSION['ProcessingOrder'])) { +if (!isset($_GET['OrderNumber']) AND !isset($_SESSION['ProcessingOrder'])) { /* This page can only be called with an order number for invoicing*/ - echo '<div class="centre"><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '">' . _('Select a sales order to invoice'). '</a></div>'; - echo '<br><br>'; + echo '<div class="centre"><a href="' . $rootpath . '/SelectSalesOrder.php">' . _('Select a sales order to invoice'). '</a></div>'; + echo '<br /><br />'; prnMsg( _('This page can only be opened if an order has been selected Please select an order first from the delivery details screen click on Confirm for invoicing'), 'error' ); include ('includes/footer.inc'); exit; @@ -34,43 +32,44 @@ /*read in all the guff from the selected order into the Items cart */ $OrderHeaderSQL = "SELECT salesorders.orderno, - salesorders.debtorno, - debtorsmaster.name, - salesorders.branchcode, - salesorders.customerref, - salesorders.comments, - salesorders.orddate, - salesorders.ordertype, - salesorders.shipvia, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - salesorders.contactphone, - salesorders.contactemail, - salesorders.freightcost, - salesorders.deliverydate, - debtorsmaster.currcode, - salesorders.fromstkloc, - locations.taxprovinceid, - custbranch.taxgroupid, - currencies.rate as currency_rate, - custbranch.defaultshipvia, - custbranch.specialinstructions - FROM salesorders, - debtorsmaster, - custbranch, - currencies, - locations - WHERE salesorders.debtorno = debtorsmaster.debtorno - AND salesorders.branchcode = custbranch.branchcode - AND salesorders.debtorno = custbranch.debtorno - AND locations.loccode=salesorders.fromstkloc - AND debtorsmaster.currcode = currencies.currabrev - AND salesorders.orderno = '" . $_GET['OrderNumber']."'"; + salesorders.debtorno, + debtorsmaster.name, + salesorders.branchcode, + salesorders.customerref, + salesorders.comments, + salesorders.orddate, + salesorders.ordertype, + salesorders.shipvia, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + salesorders.contactphone, + salesorders.contactemail, + salesorders.freightcost, + salesorders.deliverydate, + debtorsmaster.currcode, + salesorders.fromstkloc, + locations.taxprovinceid, + custbranch.taxgroupid, + currencies.rate as currency_rate, + currencies.decimalplaces, + custbranch.defaultshipvia, + custbranch.specialinstructions + FROM salesorders, + debtorsmaster, + custbranch, + currencies, + locations + WHERE salesorders.debtorno = debtorsmaster.debtorno + AND salesorders.branchcode = custbranch.branchcode + AND salesorders.debtorno = custbranch.debtorno + AND locations.loccode=salesorders.fromstkloc + AND debtorsmaster.currcode = currencies.currabrev + AND salesorders.orderno = '" . $_GET['OrderNumber']."'"; $ErrMsg = _('The order cannot be retrieved because'); $DbgMsg = _('The SQL to get the order header was'); @@ -88,6 +87,7 @@ $_SESSION['Items']->Comments = $myrow['comments']; $_SESSION['Items']->DefaultSalesType =$myrow['ordertype']; $_SESSION['Items']->DefaultCurrency = $myrow['currcode']; + $_SESSION['Items']->CurrDecimalPlaces = $myrow['decimalplaces']; $BestShipper = $myrow['shipvia']; $_SESSION['Items']->ShipVia = $myrow['shipvia']; @@ -120,33 +120,33 @@ /*now populate the line items array with the sales order details records */ $LineItemsSQL = "SELECT stkcode, - stockmaster.description, - stockmaster.controlled, - stockmaster.serialised, - stockmaster.volume, - stockmaster.kgs, - stockmaster.units, - stockmaster.decimalplaces, - stockmaster.mbflag, - stockmaster.taxcatid, - stockmaster.discountcategory, - salesorderdetails.unitprice, - salesorderdetails.quantity, - salesorderdetails.discountpercent, - salesorderdetails.actualdispatchdate, - salesorderdetails.qtyinvoiced, - salesorderdetails.narrative, - salesorderdetails.orderlineno, - salesorderdetails.poline, - salesorderdetails.itemdue, - stockmaster.materialcost + - stockmaster.labourcost + - stockmaster.overheadcost AS standardcost - FROM salesorderdetails INNER JOIN stockmaster - ON salesorderdetails.stkcode = stockmaster.stockid - WHERE salesorderdetails.orderno ='" . $_GET['OrderNumber'] . "' - AND salesorderdetails.quantity - salesorderdetails.qtyinvoiced >0 - ORDER BY salesorderdetails.orderlineno"; + stockmaster.description, + stockmaster.controlled, + stockmaster.serialised, + stockmaster.volume, + stockmaster.kgs, + stockmaster.units, + stockmaster.decimalplaces, + stockmaster.mbflag, + stockmaster.taxcatid, + stockmaster.discountcategory, + salesorderdetails.unitprice, + salesorderdetails.quantity, + salesorderdetails.discountpercent, + salesorderdetails.actualdispatchdate, + salesorderdetails.qtyinvoiced, + salesorderdetails.narrative, + salesorderdetails.orderlineno, + salesorderdetails.poline, + salesorderdetails.itemdue, + stockmaster.materialcost + + stockmaster.labourcost + + stockmaster.overheadcost AS standardcost + FROM salesorderdetails INNER JOIN stockmaster + ON salesorderdetails.stkcode = stockmaster.stockid + WHERE salesorderdetails.orderno ='" . $_GET['OrderNumber'] . "' + AND salesorderdetails.quantity - salesorderdetails.qtyinvoiced >0 + ORDER BY salesorderdetails.orderlineno"; $ErrMsg = _('The line items of the order cannot be retrieved because'); $DbgMsg = _('The SQL that failed was'); @@ -157,29 +157,29 @@ while ($myrow=db_fetch_array($LineItemsResult)) { $_SESSION['Items']->add_to_cart($myrow['stkcode'], - $myrow['quantity'], - $myrow['description'], - $myrow['unitprice'], - $myrow['discountpercent'], - $myrow['units'], - $myrow['volume'], - $myrow['kgs'], - 0, - $myrow['mbflag'], - $myrow['actualdispatchdate'], - $myrow['qtyinvoiced'], - $myrow['discountcategory'], - $myrow['controlled'], - $myrow['serialised'], - $myrow['decimalplaces'], - htmlspecialchars_decode($myrow['narrative']), - 'No', - $myrow['orderlineno'], - $myrow['taxcatid'], - '', - $myrow['itemdue'], - $myrow['poline'], - $myrow['standardcost']); /*NB NO Updates to DB */ + $myrow['quantity'], + $myrow['description'], + $myrow['unitprice'], + $myrow['discountpercent'], + $myrow['units'], + $myrow['volume'], + $myrow['kgs'], + 0, + $myrow['mbflag'], + $myrow['actualdispatchdate'], + $myrow['qtyinvoiced'], + $myrow['discountcategory'], + $myrow['controlled'], + $myrow['serialised'], + $myrow['decimalplaces'], + htmlspecialchars_decode($myrow['narrative']), + 'No', + $myrow['orderlineno'], + $myrow['taxcatid'], + '', + $myrow['itemdue'], + $myrow['poline'], + $myrow['standardcost']); /*NB NO Updates to DB */ /*Calculate the taxes applicable to this line item from the customer branch Tax Group and Item Tax Category */ @@ -187,7 +187,7 @@ } /* line items from sales order details */ } else { /* there are no line items that have a quantity to deliver */ - echo '<br>'; + echo '<br />'; prnMsg( _('There are no ordered items with a quantity left to deliver. There is nothing left to invoice')); include('includes/footer.inc'); exit; @@ -197,7 +197,7 @@ } else { /*end if the order was returned sucessfully */ - echo '<br>'. + echo '<br />'. prnMsg( _('This order item could not be retrieved. Please select another order'), 'warn'); include ('includes/footer.inc'); exit; @@ -227,9 +227,6 @@ } else if (is_numeric($_POST[$Itm->LineNumber . '_QtyDispatched' ])AND $_POST[$Itm->LineNumber . '_QtyDispatched'] <= ($_SESSION['Items']->LineItems[$Itm->LineNumber]->Quantity - $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyInv)){ $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyDispatched = $_POST[$Itm->LineNumber . '_QtyDispatched']; } - - - foreach ($Itm->Taxes as $TaxLine) { if (isset($_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])){ $_SESSION['Items']->LineItems[$Itm->LineNumber]->Taxes[$TaxLine->TaxCalculationOrder]->TaxRate = $_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate']/100; @@ -257,7 +254,7 @@ </table> <br />'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '?" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; /*************************************************************** @@ -269,15 +266,15 @@ <th>' . _('Item Description' ) . '</th> <th>' . _('Ordered') . '</th> <th>' . _('Units') . '</th> - <th>' . _('Already') . '<br>' . _('Sent') . '</th> + <th>' . _('Already') . '<br />' . _('Sent') . '</th> <th>' . _('This Dispatch') . '</th> <th>' . _('Price') . '</th> <th>' . _('Discount') . '</th> - <th>' . _('Total') . '<br>' . _('Excl Tax') . '</th> + <th>' . _('Total') . '<br />' . _('Excl Tax') . '</th> <th>' . _('Tax Authority') . '</th> <th>' . _('Tax %') . '</th> - <th>' . _('Tax') . '<br>' . _('Amount') . '</th> - <th>' . _('Total') . '<br>' . _('Incl Tax') . '</th> + <th>' . _('Tax') . '<br />' . _('Amount') . '</th> + <th>' . _('Total') . '<br />' . _('Incl Tax') . '</th> </tr>'; $_SESSION['Items']->total = 0; @@ -331,8 +328,8 @@ } } $DisplayDiscountPercent = number_format($LnItm->DiscountPercent*100,2) . '%'; - $DisplayLineNetTotal = number_format($LineTotal,2); - $DisplayPrice = number_format($LnItm->Price,2); + $DisplayLineNetTotal = number_format($LineTotal,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayPrice = number_format($LnItm->Price,$_SESSION['Items']->CurrDecimalPlaces); echo '<td class="number">'.$DisplayPrice.'</td> <td class="number">'.$DisplayDiscountPercent.'</td> <td class="number">'.$DisplayLineNetTotal.'</td>'; @@ -381,15 +378,15 @@ $TaxTotal += $TaxLineTotal; - $DisplayTaxAmount = number_format($TaxLineTotal ,2); + $DisplayTaxAmount = number_format($TaxLineTotal ,$_SESSION['Items']->CurrDecimalPlaces); - $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,2); + $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,$_SESSION['Items']->CurrDecimalPlaces); echo '<td class="number">'.$DisplayTaxAmount.'</td><td class="number">'.$DisplayGrossLineTotal.'</td>'; if ($LnItm->Controlled==1){ if (!isset($_POST['ProcessInvoice'])) { - echo '<td><a href="' . $rootpath . '/ConfirmDispatchControlled_Invoice.php?' . SID . '&LineNo='. $LnItm->LineNumber.'">'; + echo '<td><a href="' . $rootpath . '/ConfirmDispatchControlled_Invoice.php?LineNo='. $LnItm->LineNumber.'">'; if ($LnItm->Serialised==1){ echo _('Enter Serial Numbers'); } else { /*Just batch/roll/lot control */ @@ -400,7 +397,7 @@ } echo '</tr>'; if (strlen($LnItm->Narrative)>1){ - $narrative=str_replace('\r\n','<br>', $LnItm->Narrative); + $narrative=str_replace('\r\n','<br />', $LnItm->Narrative); echo $RowStarter . '<td colspan=12>' . stripslashes($narrative) . '</td></tr>'; } }//end foreach ($line) @@ -413,12 +410,12 @@ if(!isset($_SESSION['Items']->FreightCost)) { if ($_SESSION['DoFreightCalc']==True){ list ($FreightCost, $BestShipper) = CalcFreightCost($_SESSION['Items']->total, - $_SESSION['Items']->BrAdd2, - $_SESSION['Items']->BrAdd3, - $_SESSION['Items']->totalVolume, - $_SESSION['Items']->totalWeight, - $_SESSION['Items']->Location, - $db); + $_SESSION['Items']->BrAdd2, + $_SESSION['Items']->BrAdd3, + $_SESSION['Items']->totalVolume, + $_SESSION['Items']->totalWeight, + $_SESSION['Items']->Location, + $db); $_SESSION['Items']->ShipVia = $BestShipper; } if (is_numeric($FreightCost)){ @@ -433,7 +430,7 @@ if (DB_num_rows($TestShipperExists)==1){ $BestShipper = $_SESSION['Default_Shipper']; } else { - $SQL = 'SELECT shipper_id FROM shippers'; + $SQL = "SELECT shipper_id FROM shippers"; $ErrMsg = _('There was a problem testing for a default shipper'); $TestShipperExists = DB_query($SQL,$db, $ErrMsg); if (DB_num_rows($TestShipperExists)>=1){ @@ -487,7 +484,7 @@ $i=0; // initialise the number of taxes iterated through foreach ($_SESSION['Items']->FreightTaxes as $FreightTaxLine) { if ($i>0){ - echo '<br>'; + echo '<br />'; } echo $FreightTaxLine->TaxAuthDescription; $i++; @@ -498,14 +495,14 @@ $i=0; foreach ($_SESSION['Items']->FreightTaxes as $FreightTaxLine) { if ($i>0){ - echo '<br>'; + echo '<br />'; } if (isset($_POST['ProcessInvoice'])) { echo $FreightTaxLine->TaxRate * 100 ; } else { echo '<input type="text" class="number" name="FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . - '" maxlength="4" size="4" VALUE="' . $FreightTaxLine->TaxRate * 100 . '">'; + '" maxlength="4" size="4" value="' . $FreightTaxLine->TaxRate * 100 . '">'; } if ($FreightTaxLine->TaxOnTax ==1){ @@ -520,26 +517,26 @@ } echo '</td>'; -echo '<td class="number">' . number_format($FreightTaxTotal,2) . '</td> - <td class="number">' . number_format($FreightTaxTotal+ $_POST['ChargeFreightCost'],2) . '</td> +echo '<td class="number">' . number_format($FreightTaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</td> + <td class="number">' . number_format($FreightTaxTotal+ $_POST['ChargeFreightCost'],$_SESSION['Items']->CurrDecimalPlaces) . '</td> </tr>'; $TaxTotal += $FreightTaxTotal; -$DisplaySubTotal = number_format(($_SESSION['Items']->total + $_POST['ChargeFreightCost']),2); +$DisplaySubTotal = number_format(($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces); /* round the totals to avoid silly entries */ $TaxTotal = round($TaxTotal,2); -$_SESSION['Items']->total = round($_SESSION['Items']->total,2); -$_POST['ChargeFreightCost'] = round($_POST['ChargeFreightCost'],2); +$_SESSION['Items']->total = round($_SESSION['Items']->total,$_SESSION['Items']->CurrDecimalPlaces); +$_POST['ChargeFreightCost'] = round($_POST['ChargeFreightCost'],$_SESSION['Items']->CurrDecimalPlaces); echo '<tr> <td colspan="10" class="number">' . _('Invoice Totals'). '</td> <td class="number:><hr><b>'.$DisplaySubTotal.'</b><hr></td> <td colspan="2"></td> - <td class="number"><hr><b>' . number_format($TaxTotal,2) . '</b><hr></td> - <td class="number"><hr><b>' . number_format($TaxTotal+($_SESSION['Items']->total + $_POST['ChargeFreightCost']),2) . '</b><hr></td> + <td class="number"><hr><b>' . number_format($TaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> + <td class="number"><hr><b>' . number_format($TaxTotal+($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> </tr>'; if (! isset($_POST['DispatchDate']) OR ! Is_Date($_POST['DispatchDate'])){ @@ -548,12 +545,10 @@ $DefaultDispatchDate = $_POST['DispatchDate']; } -echo '</table><br>'; +echo '</table><br />'; +if (isset($_POST['ProcessInvoice']) AND $_POST['ProcessInvoice'] != ''){ - -if (isset($_POST['ProcessInvoice']) && $_POST['ProcessInvoice'] != ""){ - /* SQL to process the postings for sales invoices... /*First check there are lines on the dipatch with quantities to invoice @@ -634,10 +629,10 @@ /* Now Get the area where the sale is to from the branches table */ $SQL = "SELECT area, - defaultshipvia - FROM custbranch - WHERE custbranch.debtorno ='". $_SESSION['Items']->DebtorNo . "' - AND custbranch.branchcode = '" . $_SESSION['Items']->Branch . "'"; + defaultshipvia + FROM custbranch + WHERE custbranch.debtorno ='". $_SESSION['Items']->DebtorNo . "' + AND custbranch.branchcode = '" . $_SESSION['Items']->Branch . "'"; $ErrMsg = _('We were unable to load Area where the Sale is to from the BRANCHES table') . '. ' . _('Please remedy this'); $Result = DB_query($SQL,$db, $ErrMsg); @@ -658,13 +653,13 @@ /*Now need to check that the order details are the same as they were when they were read into the Items array. If they've changed then someone else may have invoiced them */ $SQL = "SELECT stkcode, - quantity, - qtyinvoiced, - orderlineno - FROM salesorderdetails - WHERE completed=0 - AND orderno = '" . $_SESSION['ProcessingOrder']."'"; - + quantity, + qtyinvoiced, + orderlineno + FROM salesorderdetails + WHERE completed=0 + AND orderno = '" . $_SESSION['ProcessingOrder']."'"; + $Result = DB_query($SQL,$db); if (DB_num_rows($Result) != count($_SESSION['Items']->LineItems)){ @@ -672,12 +667,12 @@ /*there should be the same number of items returned from this query as there are lines on the invoice - if not then someone has already invoiced or credited some lines */ if ($debug==1){ - echo '<br>'.$SQL; - echo '<br>' . _('Number of rows returned by SQL') . ':' . DB_num_rows($Result); - echo '<br>' . _('Count of items in the session') . ' ' . count($_SESSION['Items']->LineItems); + echo '<br />'.$SQL; + echo '<br />' . _('Number of rows returned by SQL') . ':' . DB_num_rows($Result); + echo '<br />' . _('Count of items in the session') . ' ' . count($_SESSION['Items']->LineItems); } - echo '<br>'; + echo '<br />'; prnMsg( _('This order has been changed or invoiced since this delivery was started to be confirmed') . '. ' . _('Processing halted') . '. ' . _('To enter and confirm this dispatch') . '/' . _('invoice the order must be re-selected and re-read again to update the changes made by the other user'), 'error'); unset($_SESSION['Items']->LineItems); @@ -692,15 +687,15 @@ if ($_SESSION['Items']->LineItems[$myrow['orderlineno']]->Quantity != $myrow['quantity'] OR $_SESSION['Items']->LineItems[$myrow['orderlineno']]->QtyInv != $myrow['qtyinvoiced']) { - echo '<br>'. _('Orig order for'). ' ' . $myrow['orderlineno'] . ' '. _('has a quantity of'). ' ' . + echo '<br />'. _('Orig order for'). ' ' . $myrow['orderlineno'] . ' '. _('has a quantity of'). ' ' . $myrow['quantity'] . ' '. _('and an invoiced qty of'). ' ' . $myrow['qtyinvoiced'] . ' '. _('the session shows quantity of'). ' ' . $_SESSION['Items']->LineItems[$myrow['orderlineno']]->Quantity . ' ' . _('and quantity invoice of'). ' ' . $_SESSION['Items']->LineItems[$myrow['orderlineno']]->QtyInv; prnMsg( _('This order has been changed or invoiced since this delivery was started to be confirmed') . ' ' . _('Processing halted.') . ' ' . _('To enter and confirm this dispatch, it must be re-selected and re-read again to update the changes made by the other user'), 'error'); - echo '<br>'; + echo '<br />'; - echo '<div class="centre"><a href="'. $rootpath . '/SelectSalesOrder.php?' . SID . '">'. _('Select a sales order for confirming deliveries and invoicing'). '</a></div>'; + echo '<div class="centre"><a href="'. $rootpath . '/SelectSalesOrder.php">'. _('Select a sales order for confirming deliveries and invoicing'). '</a></div>'; unset($_SESSION['Items']->LineItems); unset($_SESSION['Items']); @@ -739,8 +734,8 @@ /*Update order header for invoice charged on */ $SQL = "UPDATE salesorders - SET comments = CONCAT(comments,' Inv ','" . $InvoiceNo . "') - WHERE orderno= '" . $_SESSION['ProcessingOrder']."'"; + SET comments = CONCAT(comments,' Inv ','" . $InvoiceNo . "') + WHERE orderno= '" . $_SESSION['ProcessingOrder']."'"; $ErrMsg = _('CRITICAL ERROR') . ' ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales order header could not be updated with the invoice number'); $DbgMsg = _('The following SQL to update the sales order was used'); @@ -749,40 +744,40 @@ /*Now insert the DebtorTrans */ $SQL = "INSERT INTO debtortrans ( transno, - type, - debtorno, - branchcode, - trandate, - inputdate, - prd, - reference, - tpe, - order_, - ovamount, - ovgst, - ovfreight, - rate, - invtext, - shipvia, - consignment ) - VALUES ( - '". $InvoiceNo . "', - 10, - '" . $_SESSION['Items']->DebtorNo . "', - '" . $_SESSION['Items']->Branch . "', - '" . $DefaultDispatchDate . "', - '" . date('Y-m-d H-i-s') . "', - '" . $PeriodNo . "', - '', - '" . $_SESSION['Items']->DefaultSalesType . "', - '" . $_SESSION['ProcessingOrder'] . "', - '" . $_SESSION['Items']->total . "', - '" . $TaxTotal . "', - '" . $_POST['ChargeFreightCost'] . "', - '" . $_SESSION['CurrencyRate'] . "', - '" . $_POST['InvoiceText'] . "', - '" . $_SESSION['Items']->ShipVia . "', - '" . $_POST['Consignment'] . "' )"; + type, + debtorno, + branchcode, + trandate, + inputdate, + prd, + reference, + tpe, + order_, + ovamount, + ovgst, + ovfreight, + rate, + invtext, + shipvia, + consignment ) + VALUES ( + '". $InvoiceNo . "', + 10, + '" . $_SESSION['Items']->DebtorNo . "', + '" . $_SESSION['Items']->Branch . "', + '" . $DefaultDispatchDate . "', + '" . date('Y-m-d H-i-s') . "', + '" . $PeriodNo . "', + '', + '" . $_SESSION['Items']->DefaultSalesType . "', + '" . $_SESSION['ProcessingOrder'] . "', + '" . $_SESSION['Items']->total . "', + '" . $TaxTotal . "', + '" . $_POST['ChargeFreightCost'] . "', + '" . $_SESSION['CurrencyRate'] . "', + '" . $_POST['InvoiceText'] . "', + '" . $_SESSION['Items']->ShipVia . "', + '" . $_POST['Consignment'] . "' )"; $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'); @@ -794,11 +789,11 @@ foreach ($TaxTotals AS $TaxAuthID => $TaxAmount) { $SQL = "INSERT INTO debtortranstaxes (debtortransid, - taxauthid, - taxamount) - VALUES ('" . $DebtorTransID . "', - '" . $TaxAuthID . "', - '" . $TaxAmount/$_SESSION['CurrencyRate'] . "')"; + taxauthid, + taxamount) + VALUES ('" . $DebtorTransID . "', + '" . $TaxAuthID . "', + '" . $TaxAmount/$_SESSION['CurrencyRate'] . "')"; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The debtor transaction taxes records could not be inserted because'); $DbgMsg = _('The following SQL to insert the debtor transaction taxes record was used'); @@ -812,26 +807,25 @@ /*Test to see if the item being sold is an asset */ if (substr($OrderLine->StockID,0,6)=='ASSET-'){ - $IsAsset = true; - $HyphenOccursAt = strpos($OrderLine->StockID,'-',6); - if ($HyphenOccursAt == false){ - $AssetNumber = intval(substr($OrderLine->StockID,6)); - } else { - $AssetNumber = intval(substr($OrderLine->StockID,6,strlen($OrderLine->StockID)-$HyphenOccursAt-1)); - } - prnMsg (_('The asset number beind disposed of is:') . ' ' . $AssetNumber, 'info'); + $IsAsset = true; + $HyphenOccursAt = strpos($OrderLine->StockID,'-',6); + if ($HyphenOccursAt == false){ + $AssetNumber = intval(substr($OrderLine->StockID,6)); } else { - $IsAsset = false; - $AssetNumber = 0; + $AssetNumber = intval(substr($OrderLine->StockID,6,strlen($OrderLine->StockID)-$HyphenOccursAt-1)); } + prnMsg (_('The asset number beind disposed of is:') . ' ' . $AssetNumber, 'info'); + } else { + $IsAsset = false; + $AssetNumber = 0; + } - if ($_POST['BOPolicy']=='CAN'){ $SQL = "UPDATE salesorderdetails - SET quantity = quantity - " . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . " - WHERE orderno = '" . $_SESSION['ProcessingOrder'] . " ' - AND stkcode = '" . $OrderLine->StockID . "'"; + SET quantity = quantity - " . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . " + WHERE orderno = '" . $_SESSION['ProcessingOrder'] . " ' + AND stkcode = '" . $OrderLine->StockID . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales order detail record could not be updated because'); $DbgMsg = _('The following SQL to update the sales order detail record was used'); @@ -841,20 +835,20 @@ if (($OrderLine->Quantity - $OrderLine->QtyDispatched)>0){ $SQL = "INSERT INTO orderdeliverydifferenceslog ( orderno, - invoiceno, - stockid, - quantitydiff, - debtorno, - branch, - can_or_bo ) - VALUES ( - '" . $_SESSION['ProcessingOrder'] . "', - '" . $InvoiceNo . "', - '" . $OrderLine->StockID . "', - '" . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . "', - '" . $_SESSION['Items']->DebtorNo . "', - '" . $_SESSION['Items']->Branch . "', - 'CAN')"; + invoiceno, + stockid, + quantitydiff, + debtorno, + branch, + can_or_bo ) + VALUES ( + '" . $_SESSION['ProcessingOrder'] . "', + '" . $InvoiceNo . "', + '" . $OrderLine->StockID . "', + '" . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . "', + '" . $_SESSION['Items']->DebtorNo . "', + '" . $_SESSION['Items']->Branch . "', + 'CAN')"; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The order delivery differences log record could not be inserted because'); $DbgMsg = _('The following SQL to insert the order delivery differences record was used'); @@ -868,44 +862,46 @@ /*The order is being short delivered after the due date - need to insert a delivery differnce log */ $SQL = "INSERT INTO orderdeliverydifferenceslog ( orderno, - invoiceno, - stockid, - quantitydiff, - debtorno, - branch, - can_or_bo - ) - VALUES ( - '" . $_SESSION['ProcessingOrder'] . "', - '" . $InvoiceNo . "', - '" . $OrderLine->StockID . "', - '" . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . "', - '" . $_SESSION['Items']->DebtorNo . "', - '" . $_SESSION['Items']->Branch . "', - 'BO' - )"; + invoiceno, + stockid, + quantitydiff, + debtorno, + branch, + can_or_bo + ) + VALUES ( + '" . $_SESSION['ProcessingOrder'] . "', + '" . $InvoiceNo . "', + '" . $OrderLine->StockID . "', + '" . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . "', + '" . $_SESSION['Items']->DebtorNo . "', + '" . $_SESSION['Items']->Branch . "', + 'BO' + )"; - $ErrMsg = '<br>' . _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The order delivery differences log record could not be inserted because'); + $ErrMsg = '<br />' . _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The order delivery differences log record could not be inserted because'); $DbgMsg = _('The following SQL to insert the order delivery differences record was used'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); } /*end of order delivery differences log entries */ /*Now update SalesOrderDetails for the quantity invoiced and the actual dispatch dates. */ - if ($OrderLine->QtyDispatched !=0 AND $OrderLine->QtyDispatched!="" AND $OrderLine->QtyDispatched) { + if ($OrderLine->QtyDispatched !=0 AND $OrderLine->QtyDispatched!='' AND $OrderLine->QtyDispatched) { // Test above to see if the line is completed or not - if ($OrderLine->QtyDispatched>=($OrderLine->Quantity - $OrderLine->QtyInv) OR $_POST['BOPolicy']=="CAN"){ - $SQL = "UPDATE salesorderdetails SET qtyinvoiced = qtyinvoiced + " . $OrderLine->QtyDispatched . ", - actualdispatchdate = '" . $DefaultDispatchDate . "', - completed=1 - WHERE orderno = '" . $_SESSION['ProcessingOrder'] . "' - AND orderlineno = '" . $OrderLine->LineNumber . "'"; + if ($OrderLine->QtyDispatched>=($OrderLine->Quantity - $OrderLine->QtyInv) OR $_POST['BOPolicy']=='CAN'){ + $SQL = "UPDATE salesorderdetails + SET qtyinvoiced = qtyinvoiced + " . $OrderLine->QtyDispatched . ", + actualdispatchdate = '" . $DefaultDispatchDate . "', + completed=1 + WHERE orderno = '" . $_SESSION['ProcessingOrder'] . "' + AND orderlineno = '" . $OrderLine->LineNumber . "'"; } else { - $SQL = "UPDATE salesorderdetails SET qtyinvoiced = qtyinvoiced + " . $OrderLine->QtyDispatched . ", - actualdispatchdate = '" . $DefaultDispatchDate . "' - WHERE orderno = '" . $_SESSION['ProcessingOrder'] . "' - AND orderlineno = '" . $OrderLine->LineNumber . "'"; + $SQL = "UPDATE salesorderdetails + SET qtyinvoiced = qtyinvoiced + " . $OrderLine->QtyDispatched . ", + actualdispatchdate = '" . $DefaultDispatchDate . "' + WHERE orderno = '" . $_SESSION['ProcessingOrder'] . "' + AND orderlineno = '" . $OrderLine->LineNumber . "'"; } @@ -916,8 +912,8 @@ /* Update location stock records if not a dummy stock item need the MBFlag later too so save it to $MBFlag */ $Result = DB_query("SELECT mbflag - FROM stockmaster - WHERE stockid = '" . $OrderLine->StockID . "'",$db, _('Cannot retrieve the mbflag')); + FROM stockmaster + WHERE stockid = '" . $OrderLine->StockID . "'",$db, _('Cannot retrieve the mbflag')); $myrow = DB_fetch_row($Result); $MBFlag = $myrow[0]; @@ -928,9 +924,9 @@ /* Need to get the current location quantity will need it later for the stock movement */ $SQL="SELECT locstock.quantity - FROM locstock - WHERE locstock.stockid='" . $OrderLine->StockID . "' - AND loccode= '" . $_SESSION['Items']->Location . "'"; + FROM locstock + WHERE locstock.stockid='" . $OrderLine->StockID . "' + AND loccode= '" . $_SESSION['Items']->Location . "'"; $ErrMsg = _('WARNING') . ': ' . _('Could not retrieve current location stock'); $Result = DB_query($SQL, $db, $ErrMsg); @@ -943,9 +939,9 @@ } $SQL = "UPDATE locstock SET quantity = locstock.quantity - " . $OrderLine->QtyDispatched . " - WHERE locstock.stockid = '" . $OrderLine->StockID . "' - AND loccode = '" . $_SESSION['Items']->Location . "'"; - + WHERE locstock.stockid = '" . $OrderLine->StockID . "' + AND loccode = '" . $_SESSION['Items']->Location . "'"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Location stock record could not be updated because'); $DbgMsg = _('The following SQL to update the location stock record was used'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); @@ -956,15 +952,15 @@ $Assembly=True; $StandardCost =0; /*To start with - accumulate the cost of the comoponents for use in journals later on */ $SQL = "SELECT bom.component, - bom.quantity, - stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS standard - FROM bom, - stockmaster - WHERE bom.component=stockmaster.stockid - AND bom.parent='" . $OrderLine->StockID . "' - AND bom.effectiveto > '" . Date("Y-m-d") . "' - AND bom.effectiveafter < '" . Date("Y-m-d") . "'"; - + bom.quantity, + stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS standard + FROM bom, + stockmaster + WHERE bom.component=stockmaster.stockid + AND bom.parent='" . $OrderLine->StockID . "' + AND bom.effectiveto >= '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Could not retrieve assembly components from the database for'). ' '. $OrderLine->StockID . _('because').' '; $DbgMsg = _('The SQL that failed was'); $AssResult = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); @@ -975,9 +971,9 @@ /* Need to get the current location quantity will need it later for the stock movement */ $SQL="SELECT locstock.quantity - FROM locstock - WHERE locstock.stockid='" . $AssParts['component'] . "' - AND loccode= '" . $_SESSION['Items']->Location . "'"; + FROM locstock + WHERE locstock.stockid='" . $AssParts['component'] . "' + AND loccode= '" . $_SESSION['Items']->Location . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Can not retrieve assembly components location stock quantities because '); $DbgMsg = _('The SQL that failed was'); @@ -992,35 +988,32 @@ if (empty($AssParts['standard'])) { $AssParts['standard']=0; } - $SQL = "INSERT INTO stockmoves ( - stockid, - type, - transno, - loccode, - trandate, - debtorno, - branchcode, - prd, - reference, - qty, - standardcost, - show_on_inv_crds, - newqoh - ) VALUES ( - '" . $AssParts['component'] . "', - 10, - '" . $InvoiceNo . "', - '" . $_SESSION['Items']->Location . "', - '" . $DefaultDispatchDate . "', - '" . $_SESSION['Items']->DebtorNo . "', - '" . $_SESSION['Items']->Branch . "', - '" . $PeriodNo . "', - '" . _('Assembly') . ': ' . $OrderLine->StockID . ' ' . _('Order') . ': ' . $_SESSION['ProcessingOrder'] . "', - '" . -$AssParts['quantity'] * $OrderLine->QtyDispatched . "', - '" . $AssParts['standard'] . "', - 0, - '" . ($QtyOnHandPrior - $AssParts['quantity'] * $OrderLine->QtyDispatched) . "' - )"; + $SQL = "INSERT INTO stockmoves ( stockid, + type, + transno, + loccode, + trandate, + debtorno, + branchcode, + prd, + reference, + qty, + standardcost, + show_on_inv_crds, + newqoh) + VALUES ('" . $AssParts['component'] . "', + 10, + '" . $InvoiceNo . "', + '" . $_SESSION['Items']->Location . "', + '" . $DefaultDispatchDate . "', + '" . $_SESSION['Items']->DebtorNo . "', + '" . $_SESSION['Items']->Branch . "', + '" . $PeriodNo . "', + '" . _('Assembly') . ': ' . $OrderLine->StockID . ' ' . _('Order') . ': ' . $_SESSION['ProcessingOrder'] . "', + '" . -$AssParts['quantity'] * $OrderLine->QtyDispatched . "', + '" . $AssParts['standard'] . "', + 0, + '" . ($QtyOnHandPrior - $AssParts['quantity'] * $OrderLine->QtyDispatched) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records for the assembly components of'). ' '. $OrderLine->StockID . ' ' . _('could not be inserted because'); $DbgMsg = _('The following SQL to insert the assembly components stock movement records was used'); @@ -1028,9 +1021,9 @@ $SQL = "UPDATE locstock - SET quantity = locstock.quantity - " . $AssParts['quantity'] * $OrderLine->QtyDispatched . " - WHERE locstock.stockid = '" . $AssParts['component'] . "' - AND loccode = '" . $_SESSION['Items']->Location . "'"; + SET quantity = locstock.quantity - " . $AssParts['quantity'] * $OrderLine->QtyDispatched . " + WHERE locstock.stockid = '" . $AssParts['component'] . "' + AND loccode = '" . $_SESSION['Items']->Location . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Location stock record could not be updated for an assembly component because'); $DbgMsg = _('The following SQL to update the locations stock record for the component was used'); @@ -1050,68 +1043,68 @@ } if ($MBFlag=='B' OR $MBFlag=='M'){ $SQL = "INSERT INTO stockmoves ( stockid, - type, - transno, - loccode, - trandate, - debtorno, - branchcode, - price, - prd, - reference, - qty, - discountpercent, - standardcost, - newqoh, - narrative ) - VALUES ('" . $OrderLine->StockID . "', - 10, - '" . $InvoiceNo . "', - '" . $_SESSION['Items']->Location . "', - '" . $DefaultDispatchDate . "', - '" . $_SESSION['Items']->DebtorNo . "', - '" . $_SESSION['Items']->Branch . "', - '" . $LocalCurrencyPrice . "', - '" . $PeriodNo . "', - '" . $_SESSION['ProcessingOrder'] . "', - '" . -$OrderLine->QtyDispatched . "', - '" . $OrderLine->DiscountPercent . "', - '" . $OrderLine->StandardCost . "', - '" . ($QtyOnHandPrior - $OrderLine->QtyDispatched) . "', - '" . DB_escape_string($OrderLine->Narrative) . "' )"; + type, + transno, + loccode, + trandate, + debtorno, + branchcode, + price, + prd, + reference, + qty, + discountpercent, + standardcost, + newqoh, + narrative ) + VALUES ('" . $OrderLine->StockID . "', + 10, + '" . $InvoiceNo . "', + '" . $_SESSION['Items']->Location . "', + '" . $DefaultDispatchDate . "', + '" . $_SESSION['Items']->DebtorNo . "', + '" . $_SESSION['Items']->Branch . "', + '" . $LocalCurrencyPrice . "', + '" . $PeriodNo . "', + '" . $_SESSION['ProcessingOrder'] . "', + '" . -$OrderLine->QtyDispatched . "', + '" . $OrderLine->DiscountPercent . "', + '" . $OrderLine->StandardCost . "', + '" . ($QtyOnHandPrior - $OrderLine->QtyDispatched) . "', + '" . DB_escape_string($OrderLine->Narrative) . "' )"; } else { // its an assembly or dummy and assemblies/dummies always have nil stock (by definition they are made up at the time of dispatch so new qty on hand will be nil if (empty($OrderLine->StandardCost)) { $OrderLine->StandardCost=0; } $SQL = "INSERT INTO stockmoves ( stockid, - type, - transno, - loccode, - trandate, - debtorno, - branchcode, - price, - prd, - reference, - qty, - discountpercent, - standardcost, - narrative ) - VALUES ('" . $OrderLine->StockID . "', - 10, - '" . $InvoiceNo . "', - '" . $_SESSION['Items']->Location . "', - '" . $DefaultDispatchDate . "', - '" . $_SESSION['Items']->DebtorNo . "', - '" . $_SESSION['Items']->Branch . "', - '" . $LocalCurrencyPrice . "', - '" . $PeriodNo . "', - '" . $_SESSION['ProcessingOrder'] . "', - '" . -$OrderLine->QtyDispatched . "', - '" . $OrderLine->DiscountPercent . "', - '" . $OrderLine->StandardCost . "', - '" . DB_escape_string($OrderLine->Narrative) . "')"; + type, + transno, + loccode, + trandate, + debtorno, + branchcode, + price, + prd, + reference, + qty, + discountpercent, + standardcost, + narrative ) + VALUES ('" . $OrderLine->StockID . "', + 10, + '" . $InvoiceNo . "', + '" . $_SESSION['Items']->Location . "', + '" . $DefaultDispatchDate . "', + '" . $_SESSION['Items']->DebtorNo . "', + '" . $_SESSION['Items']->Branch . "', + '" . $LocalCurrencyPrice . "', + '" . $PeriodNo . "', + '" . $_SESSION['ProcessingOrder'] . "', + '" . -$OrderLine->QtyDispatched . "', + '" . $OrderLine->DiscountPercent . "', + '" . $OrderLine->StandardCost . "', + '" . DB_escape_string($OrderLine->Narrative) . "')"; } @@ -1126,15 +1119,15 @@ foreach ($OrderLine->Taxes as $Tax) { $SQL = "INSERT INTO stockmovestaxes (stkmoveno, - taxauthid, - taxrate, - taxcalculationorder, - taxontax) - VALUES ('" . $StkMoveNo . "', - '" . $Tax->TaxAuthID . "', - '" . $Tax->TaxRate . "', - '" . $Tax->TaxCalculationOrder . "', - '" . $Tax->TaxOnTax . "')"; + taxauthid, + taxrate, + taxcalculationorder, + taxontax) + VALUES ('" . $StkMoveNo . "', + '" . $Tax->TaxAuthID . "', + '" . $Tax->TaxRate . "', + '" . $Tax->TaxCalculationOrder . "', + '" . $Tax->TaxOnTax . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Taxes and rates applicable to this invoice line item could not be inserted because'); $DbgMsg = _('The following SQL to insert the stock movement tax detail records was used'); @@ -1150,9 +1143,9 @@ The StockSerialMoves as well */ $SQL = "UPDATE stockserialitems SET quantity= quantity - " . $Item->BundleQty . " - WHERE stockid='" . $OrderLine->StockID . "' - AND loccode='" . $_SESSION['Items']->Location . "' - AND serialno='" . $Item->BundleRef . "'"; + WHERE stockid='" . $OrderLine->StockID . "' + AND loccode='" . $_SESSION['Items']->Location . "' + AND serialno='" . $Item->BundleRef . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be updated because'); $DbgMsg = _('The following SQL to update the serial stock item record was used'); @@ -1161,13 +1154,13 @@ /* now insert the serial stock movement */ $SQL = "INSERT INTO stockserialmoves (stockmoveno, - stockid, - serialno, - moveqty) - VALUES ('" . $StkMoveNo . "', - '" . $OrderLine->StockID . "', - '" . $Item->BundleRef . "', - '" . -$Item->BundleQty . "')"; + stockid, + serialno, + moveqty) + VALUES ('" . $StkMoveNo . "', + '" . $OrderLine->StockID . "', + '" . $Item->BundleRef . "', + '" . -$Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); $DbgMsg = _('The following SQL to insert the serial stock movement records was used'); @@ -1178,14 +1171,14 @@ /*Insert Sales Analysis records */ $SQL="SELECT COUNT(*), - salesanalysis.stockid, - salesanalysis.stkcategory, - salesanalysis.cust, - salesanalysis.custbranch, - salesanalysis.area, - salesanalysis.periodno, - salesanalysis.typeabbrev, - salesanalysis.salesperson + salesanalysis.stockid, + salesanalysis.stkcategory, + salesanalysis.cust, + salesanalysis.custbranch, + salesanalysis.area, + salesanalysis.periodno, + salesanalysis.typeabbrev, + salesanalysis.salesperson FROM salesanalysis, custbranch, stockmaster @@ -1211,7 +1204,7 @@ salesanalysis.salesperson"; $ErrMsg = _('The count of existing Sales analysis records could not run because'); - $DbgMsg = '<br>'. _('SQL to count the no of sales analysis records'); + $DbgMsg = '<br />'. _('SQL to count the no of sales analysis records'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); $myrow = DB_fetch_row($Result); @@ -1219,9 +1212,9 @@ if ($myrow[0]>0){ /*Update the existing record that already exists */ $SQL = "UPDATE salesanalysis SET amt=amt+" . ($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . ", - cost=cost+" . ($OrderLine->StandardCost * $OrderLine->QtyDispatched) . ", - qty=qty +" . $OrderLine->QtyDispatched . ", - disc=disc+" . ($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . " + cost=cost+" . ($OrderLine->StandardCost * $OrderLine->QtyDispatched) . ", + qty=qty +" . $OrderLine->QtyDispatched . ", + disc=disc+" . ($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . " WHERE salesanalysis.area='" . $myrow[5] . "' AND salesanalysis.salesperson='" . $myrow[8] . "' AND typeabbrev ='" . $_SESSION['Items']->DefaultSalesType . "' @@ -1235,31 +1228,31 @@ } else { /* insert a new sales analysis record */ $SQL = "INSERT INTO salesanalysis (typeabbrev, - periodno, - amt, - cost, - cust, - custbranch, - qty, - disc, - stockid, - area, - budgetoractual, - salesperson, - stkcategory ) + periodno, + amt, + cost, + cust, + custbranch, + qty, + disc, + stockid, + area, + budgetoractual, + salesperson, + stkcategory ) SELECT '" . $_SESSION['Items']->DefaultSalesType . "', - '" . $PeriodNo . "', - '" . ($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', - '" . ($OrderLine->StandardCost * $OrderLine->QtyDispatched) . "', - '" . $_SESSION['Items']->DebtorNo . "', - '" . $_SESSION['Items']->Branch . "', - '" . $OrderLine->QtyDispatched . "', - '" . ($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', - '" . $OrderLine->StockID . "', - custbranch.area, - 1, - custbranch.salesman, - stockmaster.categoryid + '" . $PeriodNo . "', + '" . ($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', + '" . ($OrderLine->StandardCost * $OrderLine->QtyDispatched) . "', + '" . $_SESSION['Items']->DebtorNo . "', + '" . $_SESSION['Items']->Branch . "', + '" . $OrderLine->QtyDispatched . "', + '" . ($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', + '" . $OrderLine->StockID . "', + custbranch.area, + 1, + custbranch.salesman, + stockmaster.categoryid FROM stockmaster, custbranch WHERE stockmaster.stockid = '" . $OrderLine->StockID . "' @@ -1278,20 +1271,20 @@ /*first the cost of sales entry - GL accounts are retrieved using the function GetCOGSGLAccount from includes/GetSalesTransGLCodes.inc */ $SQL = "INSERT INTO gltrans ( type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES ( - 10, - '" . $InvoiceNo . "', - '" . $DefaultDispatchDate . "', - '" . $PeriodNo . "', - '" . GetCOGSGLAccount($Area, $OrderLine->StockID, $_SESSION['Items']->DefaultSalesType, $db) . "', - '" . $_SESSION['Items']->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->StandardCost . "', - ... [truncated message content] |
From: <dai...@us...> - 2011-05-02 10:34:04
|
Revision: 4560 http://web-erp.svn.sourceforge.net/web-erp/?rev=4560&view=rev Author: daintree Date: 2011-05-02 10:33:55 +0000 (Mon, 02 May 2011) Log Message: ----------- quoting and currency decimal places on order entry Modified Paths: -------------- trunk/COGSGLPostings.php trunk/ConfirmDispatch_Invoice.php trunk/ContractBOM.php trunk/OffersReceived.php trunk/PO_PDFPurchOrder.php trunk/SelectOrderItems.php trunk/doc/Change.log.html trunk/includes/DefineCartClass.php Modified: trunk/COGSGLPostings.php =================================================================== --- trunk/COGSGLPostings.php 2011-05-01 09:45:18 UTC (rev 4559) +++ trunk/COGSGLPostings.php 2011-05-02 10:33:55 UTC (rev 4560) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.15 $ */ + /* $Id$*/ -//$PageSecurity = 10; - include('includes/session.inc'); $title = _('Cost Of Sales GL Postings Set Up'); @@ -58,7 +56,6 @@ $result = DB_query($sql,$db); prnMsg ($msg,'info'); - echo '<br />'; unset ($SelectedCOGSPostingID); } elseif (isset($_GET['delete'])) { @@ -67,23 +64,21 @@ $sql="DELETE FROM cogsglpostings WHERE id='".$SelectedCOGSPostingID."'"; $result = DB_query($sql,$db); prnMsg( _('The cost of sales posting code record has been deleted'),'info'); - echo '<br />'; unset ($SelectedCOGSPostingID); - } if (!isset($SelectedCOGSPostingID)) { $ShowLivePostingRecords = true; - $sql = 'SELECT cogsglpostings.id, - cogsglpostings.area, - cogsglpostings.stkcat, - cogsglpostings.salestype, - chartmaster.accountname - FROM cogsglpostings LEFT JOIN chartmaster + $sql = "SELECT cogsglpostings.id, + cogsglpostings.area, + cogsglpostings.stkcat, + cogsglpostings.salestype, + chartmaster.accountname + FROM cogsglpostings LEFT JOIN chartmaster ON cogsglpostings.glcode = chartmaster.accountcode - WHERE chartmaster.accountcode IS NULL'; + WHERE chartmaster.accountcode IS NULL"; $result = DB_query($sql,$db); if (DB_num_rows($result)>0){ @@ -106,12 +101,12 @@ $k=1; } - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> - <td><a href=\"%sSelectedCOGSPostingID=%s\">" . _('Edit') . "</td> - <td><a href=\"%sSelectedCOGSPostingID=%s&delete=yes\">". _('Delete') . "</td></tr>", + <td><a href="%sSelectedCOGSPostingID=%s">' . _('Edit') . '</td> + <td><a href="%sSelectedCOGSPostingID=%s&delete=yes">'. _('Delete') . '</td></tr>', $myrow[1], $myrow[2], $myrow[3], @@ -124,11 +119,11 @@ echo '</table>'; } - $sql = 'SELECT cogsglpostings.id, + $sql = "SELECT cogsglpostings.id, cogsglpostings.area, cogsglpostings.stkcat, cogsglpostings.salestype - FROM cogsglpostings'; + FROM cogsglpostings"; $result = DB_query($sql,$db); @@ -182,14 +177,14 @@ } if ($ShowLivePostingRecords){ - $sql = 'SELECT cogsglpostings.id, - cogsglpostings.area, - cogsglpostings.stkcat, - cogsglpostings.salestype, - chartmaster.accountname - FROM cogsglpostings, - chartmaster - WHERE cogsglpostings.glcode = chartmaster.accountcode'; + $sql = "SELECT cogsglpostings.id, + cogsglpostings.area, + cogsglpostings.stkcat, + cogsglpostings.salestype, + chartmaster.accountname + FROM cogsglpostings, + chartmaster + WHERE cogsglpostings.glcode = chartmaster.accountcode"; $result = DB_query($sql,$db); @@ -197,7 +192,8 @@ echo '<tr><th>' . _('Area') . '</th> <th>' . _('Stock Category') . '</th> <th>' . _('Sales Type') . '</th> - <th>' . _('GL Account') . '</th></tr>'; + <th>' . _('GL Account') . '</th> + </tr>'; $k = 0; while ($myrow = DB_fetch_row($result)) { if ($k==1){ @@ -208,13 +204,13 @@ $k++; } - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> - <td><a href=\"%sSelectedCOGSPostingID=%s\">" . _('Edit') . "</td> - <td><a href=\"%sSelectedCOGSPostingID=%s&delete=yes\">" . _('Delete') . "</td> - </tr>", + <td><a href="%sSelectedCOGSPostingID=%s">' . _('Edit') . '</td> + <td><a href="%sSelectedCOGSPostingID=%s&delete=yes">' . _('Delete') . '</td> + </tr>', $myrow[1], $myrow[2], $myrow[3], @@ -257,14 +253,14 @@ $_POST['StkCat'] = $myrow['stkcat']; $_POST['SalesType'] = $myrow['salestype']; - echo '<input type=hidden name="SelectedCOGSPostingID" VALUE="' . $SelectedCOGSPostingID . '">'; + echo '<input type=hidden name="SelectedCOGSPostingID" value="' . $SelectedCOGSPostingID . '">'; } //end of if $SelectedCOGSPostingID only do the else when a new record is being entered -$sql = 'SELECT areacode, +$sql = "SELECT areacode, areadescription - FROM areas'; + FROM areas"; $result = DB_query($sql,$db); echo '<table class=selection> @@ -274,16 +270,16 @@ while ($myrow = DB_fetch_array($result)) { if (isset($_POST['Area']) and $myrow['areacode']==$_POST['Area']) { - echo '<option selected VALUE="'; + echo '<option selected value="'; } else { - echo '<option VALUE="'; + echo '<option value="'; } echo $myrow['areacode'] . '">' . $myrow['areadescription'] . '</option>'; } //end while loop DB_free_result($result); -$sql = 'SELECT categoryid, categorydescription FROM stockcategory'; +$sql = "SELECT categoryid, categorydescription FROM stockcategory"; $result = DB_query($sql,$db); echo '</select></td></tr> @@ -292,10 +288,10 @@ <option VALUE="ANY">' . _('Any Other') . '</option>'; while ($myrow = DB_fetch_array($result)) { - if (isset($_POST['StkCat']) and $myrow["categoryid"]==$_POST['StkCat']) { - echo '<option selected VALUE="'; + if (isset($_POST['StkCat']) and $myrow['categoryid']==$_POST['StkCat']) { + echo '<option selected value="'; } else { - echo '<option VALUE="'; + echo '<option value="'; } echo $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; @@ -303,7 +299,7 @@ DB_free_result($result); -$sql = 'SELECT typeabbrev, sales_type FROM salestypes'; +$sql = "SELECT typeabbrev, sales_type FROM salestypes"; $result = DB_query($sql,$db); echo '</select></td></tr> @@ -313,9 +309,9 @@ while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SalesType']) and $myrow['typeabbrev']==$_POST['SalesType']) { - echo '<option selected VALUE="'; + echo '<option selected value="'; } else { - echo '<option VALUE="'; + echo '<option value="'; } echo $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; @@ -326,22 +322,22 @@ <td><select tabindex="4" name="GLCode">'; DB_free_result($result); -$sql = 'SELECT chartmaster.accountcode, - chartmaster.accountname - FROM chartmaster, - accountgroups - WHERE chartmaster.group_=accountgroups.groupname - AND accountgroups.pandl=1 - ORDER BY accountgroups.sequenceintb, - chartmaster.accountcode, - chartmaster.accountname'; +$sql = "SELECT chartmaster.accountcode, + chartmaster.accountname + FROM chartmaster, + accountgroups + WHERE chartmaster.group_=accountgroups.groupname + AND accountgroups.pandl=1 + ORDER BY accountgroups.sequenceintb, + chartmaster.accountcode, + chartmaster.accountname"; $result = DB_query($sql,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['GLCode']) and $myrow['accountcode']==$_POST['GLCode']) { - echo '<option selected VALUE="'; + echo '<option selected value="'; } else { - echo '<option VALUE="'; + echo '<option value="'; } echo $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-05-01 09:45:18 UTC (rev 4559) +++ trunk/ConfirmDispatch_Invoice.php 2011-05-02 10:33:55 UTC (rev 4560) @@ -1,12 +1,10 @@ <?php -/* $Revision: 1.67 $ */ /* $Id$*/ /* Session started in session.inc for password checking and authorisation level check */ include('includes/DefineCartClass.php'); include('includes/DefineSerialItems.php'); -//$PageSecurity = 2; include('includes/session.inc'); $title = _('Confirm Dispatches and Invoice An Order'); @@ -15,10 +13,10 @@ include('includes/FreightCalculation.inc'); include('includes/GetSalesTransGLCodes.inc'); -if (!isset($_GET['OrderNumber']) && !isset($_SESSION['ProcessingOrder'])) { +if (!isset($_GET['OrderNumber']) AND !isset($_SESSION['ProcessingOrder'])) { /* This page can only be called with an order number for invoicing*/ - echo '<div class="centre"><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '">' . _('Select a sales order to invoice'). '</a></div>'; - echo '<br><br>'; + echo '<div class="centre"><a href="' . $rootpath . '/SelectSalesOrder.php">' . _('Select a sales order to invoice'). '</a></div>'; + echo '<br /><br />'; prnMsg( _('This page can only be opened if an order has been selected Please select an order first from the delivery details screen click on Confirm for invoicing'), 'error' ); include ('includes/footer.inc'); exit; @@ -34,43 +32,44 @@ /*read in all the guff from the selected order into the Items cart */ $OrderHeaderSQL = "SELECT salesorders.orderno, - salesorders.debtorno, - debtorsmaster.name, - salesorders.branchcode, - salesorders.customerref, - salesorders.comments, - salesorders.orddate, - salesorders.ordertype, - salesorders.shipvia, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - salesorders.contactphone, - salesorders.contactemail, - salesorders.freightcost, - salesorders.deliverydate, - debtorsmaster.currcode, - salesorders.fromstkloc, - locations.taxprovinceid, - custbranch.taxgroupid, - currencies.rate as currency_rate, - custbranch.defaultshipvia, - custbranch.specialinstructions - FROM salesorders, - debtorsmaster, - custbranch, - currencies, - locations - WHERE salesorders.debtorno = debtorsmaster.debtorno - AND salesorders.branchcode = custbranch.branchcode - AND salesorders.debtorno = custbranch.debtorno - AND locations.loccode=salesorders.fromstkloc - AND debtorsmaster.currcode = currencies.currabrev - AND salesorders.orderno = '" . $_GET['OrderNumber']."'"; + salesorders.debtorno, + debtorsmaster.name, + salesorders.branchcode, + salesorders.customerref, + salesorders.comments, + salesorders.orddate, + salesorders.ordertype, + salesorders.shipvia, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + salesorders.contactphone, + salesorders.contactemail, + salesorders.freightcost, + salesorders.deliverydate, + debtorsmaster.currcode, + salesorders.fromstkloc, + locations.taxprovinceid, + custbranch.taxgroupid, + currencies.rate as currency_rate, + currencies.decimalplaces, + custbranch.defaultshipvia, + custbranch.specialinstructions + FROM salesorders, + debtorsmaster, + custbranch, + currencies, + locations + WHERE salesorders.debtorno = debtorsmaster.debtorno + AND salesorders.branchcode = custbranch.branchcode + AND salesorders.debtorno = custbranch.debtorno + AND locations.loccode=salesorders.fromstkloc + AND debtorsmaster.currcode = currencies.currabrev + AND salesorders.orderno = '" . $_GET['OrderNumber']."'"; $ErrMsg = _('The order cannot be retrieved because'); $DbgMsg = _('The SQL to get the order header was'); @@ -88,6 +87,7 @@ $_SESSION['Items']->Comments = $myrow['comments']; $_SESSION['Items']->DefaultSalesType =$myrow['ordertype']; $_SESSION['Items']->DefaultCurrency = $myrow['currcode']; + $_SESSION['Items']->CurrDecimalPlaces = $myrow['decimalplaces']; $BestShipper = $myrow['shipvia']; $_SESSION['Items']->ShipVia = $myrow['shipvia']; @@ -120,33 +120,33 @@ /*now populate the line items array with the sales order details records */ $LineItemsSQL = "SELECT stkcode, - stockmaster.description, - stockmaster.controlled, - stockmaster.serialised, - stockmaster.volume, - stockmaster.kgs, - stockmaster.units, - stockmaster.decimalplaces, - stockmaster.mbflag, - stockmaster.taxcatid, - stockmaster.discountcategory, - salesorderdetails.unitprice, - salesorderdetails.quantity, - salesorderdetails.discountpercent, - salesorderdetails.actualdispatchdate, - salesorderdetails.qtyinvoiced, - salesorderdetails.narrative, - salesorderdetails.orderlineno, - salesorderdetails.poline, - salesorderdetails.itemdue, - stockmaster.materialcost + - stockmaster.labourcost + - stockmaster.overheadcost AS standardcost - FROM salesorderdetails INNER JOIN stockmaster - ON salesorderdetails.stkcode = stockmaster.stockid - WHERE salesorderdetails.orderno ='" . $_GET['OrderNumber'] . "' - AND salesorderdetails.quantity - salesorderdetails.qtyinvoiced >0 - ORDER BY salesorderdetails.orderlineno"; + stockmaster.description, + stockmaster.controlled, + stockmaster.serialised, + stockmaster.volume, + stockmaster.kgs, + stockmaster.units, + stockmaster.decimalplaces, + stockmaster.mbflag, + stockmaster.taxcatid, + stockmaster.discountcategory, + salesorderdetails.unitprice, + salesorderdetails.quantity, + salesorderdetails.discountpercent, + salesorderdetails.actualdispatchdate, + salesorderdetails.qtyinvoiced, + salesorderdetails.narrative, + salesorderdetails.orderlineno, + salesorderdetails.poline, + salesorderdetails.itemdue, + stockmaster.materialcost + + stockmaster.labourcost + + stockmaster.overheadcost AS standardcost + FROM salesorderdetails INNER JOIN stockmaster + ON salesorderdetails.stkcode = stockmaster.stockid + WHERE salesorderdetails.orderno ='" . $_GET['OrderNumber'] . "' + AND salesorderdetails.quantity - salesorderdetails.qtyinvoiced >0 + ORDER BY salesorderdetails.orderlineno"; $ErrMsg = _('The line items of the order cannot be retrieved because'); $DbgMsg = _('The SQL that failed was'); @@ -157,29 +157,29 @@ while ($myrow=db_fetch_array($LineItemsResult)) { $_SESSION['Items']->add_to_cart($myrow['stkcode'], - $myrow['quantity'], - $myrow['description'], - $myrow['unitprice'], - $myrow['discountpercent'], - $myrow['units'], - $myrow['volume'], - $myrow['kgs'], - 0, - $myrow['mbflag'], - $myrow['actualdispatchdate'], - $myrow['qtyinvoiced'], - $myrow['discountcategory'], - $myrow['controlled'], - $myrow['serialised'], - $myrow['decimalplaces'], - htmlspecialchars_decode($myrow['narrative']), - 'No', - $myrow['orderlineno'], - $myrow['taxcatid'], - '', - $myrow['itemdue'], - $myrow['poline'], - $myrow['standardcost']); /*NB NO Updates to DB */ + $myrow['quantity'], + $myrow['description'], + $myrow['unitprice'], + $myrow['discountpercent'], + $myrow['units'], + $myrow['volume'], + $myrow['kgs'], + 0, + $myrow['mbflag'], + $myrow['actualdispatchdate'], + $myrow['qtyinvoiced'], + $myrow['discountcategory'], + $myrow['controlled'], + $myrow['serialised'], + $myrow['decimalplaces'], + htmlspecialchars_decode($myrow['narrative']), + 'No', + $myrow['orderlineno'], + $myrow['taxcatid'], + '', + $myrow['itemdue'], + $myrow['poline'], + $myrow['standardcost']); /*NB NO Updates to DB */ /*Calculate the taxes applicable to this line item from the customer branch Tax Group and Item Tax Category */ @@ -187,7 +187,7 @@ } /* line items from sales order details */ } else { /* there are no line items that have a quantity to deliver */ - echo '<br>'; + echo '<br />'; prnMsg( _('There are no ordered items with a quantity left to deliver. There is nothing left to invoice')); include('includes/footer.inc'); exit; @@ -197,7 +197,7 @@ } else { /*end if the order was returned sucessfully */ - echo '<br>'. + echo '<br />'. prnMsg( _('This order item could not be retrieved. Please select another order'), 'warn'); include ('includes/footer.inc'); exit; @@ -227,9 +227,6 @@ } else if (is_numeric($_POST[$Itm->LineNumber . '_QtyDispatched' ])AND $_POST[$Itm->LineNumber . '_QtyDispatched'] <= ($_SESSION['Items']->LineItems[$Itm->LineNumber]->Quantity - $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyInv)){ $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyDispatched = $_POST[$Itm->LineNumber . '_QtyDispatched']; } - - - foreach ($Itm->Taxes as $TaxLine) { if (isset($_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])){ $_SESSION['Items']->LineItems[$Itm->LineNumber]->Taxes[$TaxLine->TaxCalculationOrder]->TaxRate = $_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate']/100; @@ -257,7 +254,7 @@ </table> <br />'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '?" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; /*************************************************************** @@ -269,15 +266,15 @@ <th>' . _('Item Description' ) . '</th> <th>' . _('Ordered') . '</th> <th>' . _('Units') . '</th> - <th>' . _('Already') . '<br>' . _('Sent') . '</th> + <th>' . _('Already') . '<br />' . _('Sent') . '</th> <th>' . _('This Dispatch') . '</th> <th>' . _('Price') . '</th> <th>' . _('Discount') . '</th> - <th>' . _('Total') . '<br>' . _('Excl Tax') . '</th> + <th>' . _('Total') . '<br />' . _('Excl Tax') . '</th> <th>' . _('Tax Authority') . '</th> <th>' . _('Tax %') . '</th> - <th>' . _('Tax') . '<br>' . _('Amount') . '</th> - <th>' . _('Total') . '<br>' . _('Incl Tax') . '</th> + <th>' . _('Tax') . '<br />' . _('Amount') . '</th> + <th>' . _('Total') . '<br />' . _('Incl Tax') . '</th> </tr>'; $_SESSION['Items']->total = 0; @@ -331,8 +328,8 @@ } } $DisplayDiscountPercent = number_format($LnItm->DiscountPercent*100,2) . '%'; - $DisplayLineNetTotal = number_format($LineTotal,2); - $DisplayPrice = number_format($LnItm->Price,2); + $DisplayLineNetTotal = number_format($LineTotal,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayPrice = number_format($LnItm->Price,$_SESSION['Items']->CurrDecimalPlaces); echo '<td class="number">'.$DisplayPrice.'</td> <td class="number">'.$DisplayDiscountPercent.'</td> <td class="number">'.$DisplayLineNetTotal.'</td>'; @@ -381,15 +378,15 @@ $TaxTotal += $TaxLineTotal; - $DisplayTaxAmount = number_format($TaxLineTotal ,2); + $DisplayTaxAmount = number_format($TaxLineTotal ,$_SESSION['Items']->CurrDecimalPlaces); - $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,2); + $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,$_SESSION['Items']->CurrDecimalPlaces); echo '<td class="number">'.$DisplayTaxAmount.'</td><td class="number">'.$DisplayGrossLineTotal.'</td>'; if ($LnItm->Controlled==1){ if (!isset($_POST['ProcessInvoice'])) { - echo '<td><a href="' . $rootpath . '/ConfirmDispatchControlled_Invoice.php?' . SID . '&LineNo='. $LnItm->LineNumber.'">'; + echo '<td><a href="' . $rootpath . '/ConfirmDispatchControlled_Invoice.php?LineNo='. $LnItm->LineNumber.'">'; if ($LnItm->Serialised==1){ echo _('Enter Serial Numbers'); } else { /*Just batch/roll/lot control */ @@ -400,7 +397,7 @@ } echo '</tr>'; if (strlen($LnItm->Narrative)>1){ - $narrative=str_replace('\r\n','<br>', $LnItm->Narrative); + $narrative=str_replace('\r\n','<br />', $LnItm->Narrative); echo $RowStarter . '<td colspan=12>' . stripslashes($narrative) . '</td></tr>'; } }//end foreach ($line) @@ -413,12 +410,12 @@ if(!isset($_SESSION['Items']->FreightCost)) { if ($_SESSION['DoFreightCalc']==True){ list ($FreightCost, $BestShipper) = CalcFreightCost($_SESSION['Items']->total, - $_SESSION['Items']->BrAdd2, - $_SESSION['Items']->BrAdd3, - $_SESSION['Items']->totalVolume, - $_SESSION['Items']->totalWeight, - $_SESSION['Items']->Location, - $db); + $_SESSION['Items']->BrAdd2, + $_SESSION['Items']->BrAdd3, + $_SESSION['Items']->totalVolume, + $_SESSION['Items']->totalWeight, + $_SESSION['Items']->Location, + $db); $_SESSION['Items']->ShipVia = $BestShipper; } if (is_numeric($FreightCost)){ @@ -433,7 +430,7 @@ if (DB_num_rows($TestShipperExists)==1){ $BestShipper = $_SESSION['Default_Shipper']; } else { - $SQL = 'SELECT shipper_id FROM shippers'; + $SQL = "SELECT shipper_id FROM shippers"; $ErrMsg = _('There was a problem testing for a default shipper'); $TestShipperExists = DB_query($SQL,$db, $ErrMsg); if (DB_num_rows($TestShipperExists)>=1){ @@ -487,7 +484,7 @@ $i=0; // initialise the number of taxes iterated through foreach ($_SESSION['Items']->FreightTaxes as $FreightTaxLine) { if ($i>0){ - echo '<br>'; + echo '<br />'; } echo $FreightTaxLine->TaxAuthDescription; $i++; @@ -498,14 +495,14 @@ $i=0; foreach ($_SESSION['Items']->FreightTaxes as $FreightTaxLine) { if ($i>0){ - echo '<br>'; + echo '<br />'; } if (isset($_POST['ProcessInvoice'])) { echo $FreightTaxLine->TaxRate * 100 ; } else { echo '<input type="text" class="number" name="FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . - '" maxlength="4" size="4" VALUE="' . $FreightTaxLine->TaxRate * 100 . '">'; + '" maxlength="4" size="4" value="' . $FreightTaxLine->TaxRate * 100 . '">'; } if ($FreightTaxLine->TaxOnTax ==1){ @@ -520,26 +517,26 @@ } echo '</td>'; -echo '<td class="number">' . number_format($FreightTaxTotal,2) . '</td> - <td class="number">' . number_format($FreightTaxTotal+ $_POST['ChargeFreightCost'],2) . '</td> +echo '<td class="number">' . number_format($FreightTaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</td> + <td class="number">' . number_format($FreightTaxTotal+ $_POST['ChargeFreightCost'],$_SESSION['Items']->CurrDecimalPlaces) . '</td> </tr>'; $TaxTotal += $FreightTaxTotal; -$DisplaySubTotal = number_format(($_SESSION['Items']->total + $_POST['ChargeFreightCost']),2); +$DisplaySubTotal = number_format(($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces); /* round the totals to avoid silly entries */ $TaxTotal = round($TaxTotal,2); -$_SESSION['Items']->total = round($_SESSION['Items']->total,2); -$_POST['ChargeFreightCost'] = round($_POST['ChargeFreightCost'],2); +$_SESSION['Items']->total = round($_SESSION['Items']->total,$_SESSION['Items']->CurrDecimalPlaces); +$_POST['ChargeFreightCost'] = round($_POST['ChargeFreightCost'],$_SESSION['Items']->CurrDecimalPlaces); echo '<tr> <td colspan="10" class="number">' . _('Invoice Totals'). '</td> <td class="number:><hr><b>'.$DisplaySubTotal.'</b><hr></td> <td colspan="2"></td> - <td class="number"><hr><b>' . number_format($TaxTotal,2) . '</b><hr></td> - <td class="number"><hr><b>' . number_format($TaxTotal+($_SESSION['Items']->total + $_POST['ChargeFreightCost']),2) . '</b><hr></td> + <td class="number"><hr><b>' . number_format($TaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> + <td class="number"><hr><b>' . number_format($TaxTotal+($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> </tr>'; if (! isset($_POST['DispatchDate']) OR ! Is_Date($_POST['DispatchDate'])){ @@ -548,12 +545,10 @@ $DefaultDispatchDate = $_POST['DispatchDate']; } -echo '</table><br>'; +echo '</table><br />'; +if (isset($_POST['ProcessInvoice']) AND $_POST['ProcessInvoice'] != ''){ - -if (isset($_POST['ProcessInvoice']) && $_POST['ProcessInvoice'] != ""){ - /* SQL to process the postings for sales invoices... /*First check there are lines on the dipatch with quantities to invoice @@ -634,10 +629,10 @@ /* Now Get the area where the sale is to from the branches table */ $SQL = "SELECT area, - defaultshipvia - FROM custbranch - WHERE custbranch.debtorno ='". $_SESSION['Items']->DebtorNo . "' - AND custbranch.branchcode = '" . $_SESSION['Items']->Branch . "'"; + defaultshipvia + FROM custbranch + WHERE custbranch.debtorno ='". $_SESSION['Items']->DebtorNo . "' + AND custbranch.branchcode = '" . $_SESSION['Items']->Branch . "'"; $ErrMsg = _('We were unable to load Area where the Sale is to from the BRANCHES table') . '. ' . _('Please remedy this'); $Result = DB_query($SQL,$db, $ErrMsg); @@ -658,13 +653,13 @@ /*Now need to check that the order details are the same as they were when they were read into the Items array. If they've changed then someone else may have invoiced them */ $SQL = "SELECT stkcode, - quantity, - qtyinvoiced, - orderlineno - FROM salesorderdetails - WHERE completed=0 - AND orderno = '" . $_SESSION['ProcessingOrder']."'"; - + quantity, + qtyinvoiced, + orderlineno + FROM salesorderdetails + WHERE completed=0 + AND orderno = '" . $_SESSION['ProcessingOrder']."'"; + $Result = DB_query($SQL,$db); if (DB_num_rows($Result) != count($_SESSION['Items']->LineItems)){ @@ -672,12 +667,12 @@ /*there should be the same number of items returned from this query as there are lines on the invoice - if not then someone has already invoiced or credited some lines */ if ($debug==1){ - echo '<br>'.$SQL; - echo '<br>' . _('Number of rows returned by SQL') . ':' . DB_num_rows($Result); - echo '<br>' . _('Count of items in the session') . ' ' . count($_SESSION['Items']->LineItems); + echo '<br />'.$SQL; + echo '<br />' . _('Number of rows returned by SQL') . ':' . DB_num_rows($Result); + echo '<br />' . _('Count of items in the session') . ' ' . count($_SESSION['Items']->LineItems); } - echo '<br>'; + echo '<br />'; prnMsg( _('This order has been changed or invoiced since this delivery was started to be confirmed') . '. ' . _('Processing halted') . '. ' . _('To enter and confirm this dispatch') . '/' . _('invoice the order must be re-selected and re-read again to update the changes made by the other user'), 'error'); unset($_SESSION['Items']->LineItems); @@ -692,15 +687,15 @@ if ($_SESSION['Items']->LineItems[$myrow['orderlineno']]->Quantity != $myrow['quantity'] OR $_SESSION['Items']->LineItems[$myrow['orderlineno']]->QtyInv != $myrow['qtyinvoiced']) { - echo '<br>'. _('Orig order for'). ' ' . $myrow['orderlineno'] . ' '. _('has a quantity of'). ' ' . + echo '<br />'. _('Orig order for'). ' ' . $myrow['orderlineno'] . ' '. _('has a quantity of'). ' ' . $myrow['quantity'] . ' '. _('and an invoiced qty of'). ' ' . $myrow['qtyinvoiced'] . ' '. _('the session shows quantity of'). ' ' . $_SESSION['Items']->LineItems[$myrow['orderlineno']]->Quantity . ' ' . _('and quantity invoice of'). ' ' . $_SESSION['Items']->LineItems[$myrow['orderlineno']]->QtyInv; prnMsg( _('This order has been changed or invoiced since this delivery was started to be confirmed') . ' ' . _('Processing halted.') . ' ' . _('To enter and confirm this dispatch, it must be re-selected and re-read again to update the changes made by the other user'), 'error'); - echo '<br>'; + echo '<br />'; - echo '<div class="centre"><a href="'. $rootpath . '/SelectSalesOrder.php?' . SID . '">'. _('Select a sales order for confirming deliveries and invoicing'). '</a></div>'; + echo '<div class="centre"><a href="'. $rootpath . '/SelectSalesOrder.php">'. _('Select a sales order for confirming deliveries and invoicing'). '</a></div>'; unset($_SESSION['Items']->LineItems); unset($_SESSION['Items']); @@ -739,8 +734,8 @@ /*Update order header for invoice charged on */ $SQL = "UPDATE salesorders - SET comments = CONCAT(comments,' Inv ','" . $InvoiceNo . "') - WHERE orderno= '" . $_SESSION['ProcessingOrder']."'"; + SET comments = CONCAT(comments,' Inv ','" . $InvoiceNo . "') + WHERE orderno= '" . $_SESSION['ProcessingOrder']."'"; $ErrMsg = _('CRITICAL ERROR') . ' ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales order header could not be updated with the invoice number'); $DbgMsg = _('The following SQL to update the sales order was used'); @@ -749,40 +744,40 @@ /*Now insert the DebtorTrans */ $SQL = "INSERT INTO debtortrans ( transno, - type, - debtorno, - branchcode, - trandate, - inputdate, - prd, - reference, - tpe, - order_, - ovamount, - ovgst, - ovfreight, - rate, - invtext, - shipvia, - consignment ) - VALUES ( - '". $InvoiceNo . "', - 10, - '" . $_SESSION['Items']->DebtorNo . "', - '" . $_SESSION['Items']->Branch . "', - '" . $DefaultDispatchDate . "', - '" . date('Y-m-d H-i-s') . "', - '" . $PeriodNo . "', - '', - '" . $_SESSION['Items']->DefaultSalesType . "', - '" . $_SESSION['ProcessingOrder'] . "', - '" . $_SESSION['Items']->total . "', - '" . $TaxTotal . "', - '" . $_POST['ChargeFreightCost'] . "', - '" . $_SESSION['CurrencyRate'] . "', - '" . $_POST['InvoiceText'] . "', - '" . $_SESSION['Items']->ShipVia . "', - '" . $_POST['Consignment'] . "' )"; + type, + debtorno, + branchcode, + trandate, + inputdate, + prd, + reference, + tpe, + order_, + ovamount, + ovgst, + ovfreight, + rate, + invtext, + shipvia, + consignment ) + VALUES ( + '". $InvoiceNo . "', + 10, + '" . $_SESSION['Items']->DebtorNo . "', + '" . $_SESSION['Items']->Branch . "', + '" . $DefaultDispatchDate . "', + '" . date('Y-m-d H-i-s') . "', + '" . $PeriodNo . "', + '', + '" . $_SESSION['Items']->DefaultSalesType . "', + '" . $_SESSION['ProcessingOrder'] . "', + '" . $_SESSION['Items']->total . "', + '" . $TaxTotal . "', + '" . $_POST['ChargeFreightCost'] . "', + '" . $_SESSION['CurrencyRate'] . "', + '" . $_POST['InvoiceText'] . "', + '" . $_SESSION['Items']->ShipVia . "', + '" . $_POST['Consignment'] . "' )"; $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'); @@ -794,11 +789,11 @@ foreach ($TaxTotals AS $TaxAuthID => $TaxAmount) { $SQL = "INSERT INTO debtortranstaxes (debtortransid, - taxauthid, - taxamount) - VALUES ('" . $DebtorTransID . "', - '" . $TaxAuthID . "', - '" . $TaxAmount/$_SESSION['CurrencyRate'] . "')"; + taxauthid, + taxamount) + VALUES ('" . $DebtorTransID . "', + '" . $TaxAuthID . "', + '" . $TaxAmount/$_SESSION['CurrencyRate'] . "')"; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The debtor transaction taxes records could not be inserted because'); $DbgMsg = _('The following SQL to insert the debtor transaction taxes record was used'); @@ -812,26 +807,25 @@ /*Test to see if the item being sold is an asset */ if (substr($OrderLine->StockID,0,6)=='ASSET-'){ - $IsAsset = true; - $HyphenOccursAt = strpos($OrderLine->StockID,'-',6); - if ($HyphenOccursAt == false){ - $AssetNumber = intval(substr($OrderLine->StockID,6)); - } else { - $AssetNumber = intval(substr($OrderLine->StockID,6,strlen($OrderLine->StockID)-$HyphenOccursAt-1)); - } - prnMsg (_('The asset number beind disposed of is:') . ' ' . $AssetNumber, 'info'); + $IsAsset = true; + $HyphenOccursAt = strpos($OrderLine->StockID,'-',6); + if ($HyphenOccursAt == false){ + $AssetNumber = intval(substr($OrderLine->StockID,6)); } else { - $IsAsset = false; - $AssetNumber = 0; + $AssetNumber = intval(substr($OrderLine->StockID,6,strlen($OrderLine->StockID)-$HyphenOccursAt-1)); } + prnMsg (_('The asset number beind disposed of is:') . ' ' . $AssetNumber, 'info'); + } else { + $IsAsset = false; + $AssetNumber = 0; + } - if ($_POST['BOPolicy']=='CAN'){ $SQL = "UPDATE salesorderdetails - SET quantity = quantity - " . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . " - WHERE orderno = '" . $_SESSION['ProcessingOrder'] . " ' - AND stkcode = '" . $OrderLine->StockID . "'"; + SET quantity = quantity - " . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . " + WHERE orderno = '" . $_SESSION['ProcessingOrder'] . " ' + AND stkcode = '" . $OrderLine->StockID . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales order detail record could not be updated because'); $DbgMsg = _('The following SQL to update the sales order detail record was used'); @@ -841,20 +835,20 @@ if (($OrderLine->Quantity - $OrderLine->QtyDispatched)>0){ $SQL = "INSERT INTO orderdeliverydifferenceslog ( orderno, - invoiceno, - stockid, - quantitydiff, - debtorno, - branch, - can_or_bo ) - VALUES ( - '" . $_SESSION['ProcessingOrder'] . "', - '" . $InvoiceNo . "', - '" . $OrderLine->StockID . "', - '" . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . "', - '" . $_SESSION['Items']->DebtorNo . "', - '" . $_SESSION['Items']->Branch . "', - 'CAN')"; + invoiceno, + stockid, + quantitydiff, + debtorno, + branch, + can_or_bo ) + VALUES ( + '" . $_SESSION['ProcessingOrder'] . "', + '" . $InvoiceNo . "', + '" . $OrderLine->StockID . "', + '" . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . "', + '" . $_SESSION['Items']->DebtorNo . "', + '" . $_SESSION['Items']->Branch . "', + 'CAN')"; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The order delivery differences log record could not be inserted because'); $DbgMsg = _('The following SQL to insert the order delivery differences record was used'); @@ -868,44 +862,46 @@ /*The order is being short delivered after the due date - need to insert a delivery differnce log */ $SQL = "INSERT INTO orderdeliverydifferenceslog ( orderno, - invoiceno, - stockid, - quantitydiff, - debtorno, - branch, - can_or_bo - ) - VALUES ( - '" . $_SESSION['ProcessingOrder'] . "', - '" . $InvoiceNo . "', - '" . $OrderLine->StockID . "', - '" . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . "', - '" . $_SESSION['Items']->DebtorNo . "', - '" . $_SESSION['Items']->Branch . "', - 'BO' - )"; + invoiceno, + stockid, + quantitydiff, + debtorno, + branch, + can_or_bo + ) + VALUES ( + '" . $_SESSION['ProcessingOrder'] . "', + '" . $InvoiceNo . "', + '" . $OrderLine->StockID . "', + '" . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . "', + '" . $_SESSION['Items']->DebtorNo . "', + '" . $_SESSION['Items']->Branch . "', + 'BO' + )"; - $ErrMsg = '<br>' . _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The order delivery differences log record could not be inserted because'); + $ErrMsg = '<br />' . _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The order delivery differences log record could not be inserted because'); $DbgMsg = _('The following SQL to insert the order delivery differences record was used'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); } /*end of order delivery differences log entries */ /*Now update SalesOrderDetails for the quantity invoiced and the actual dispatch dates. */ - if ($OrderLine->QtyDispatched !=0 AND $OrderLine->QtyDispatched!="" AND $OrderLine->QtyDispatched) { + if ($OrderLine->QtyDispatched !=0 AND $OrderLine->QtyDispatched!='' AND $OrderLine->QtyDispatched) { // Test above to see if the line is completed or not - if ($OrderLine->QtyDispatched>=($OrderLine->Quantity - $OrderLine->QtyInv) OR $_POST['BOPolicy']=="CAN"){ - $SQL = "UPDATE salesorderdetails SET qtyinvoiced = qtyinvoiced + " . $OrderLine->QtyDispatched . ", - actualdispatchdate = '" . $DefaultDispatchDate . "', - completed=1 - WHERE orderno = '" . $_SESSION['ProcessingOrder'] . "' - AND orderlineno = '" . $OrderLine->LineNumber . "'"; + if ($OrderLine->QtyDispatched>=($OrderLine->Quantity - $OrderLine->QtyInv) OR $_POST['BOPolicy']=='CAN'){ + $SQL = "UPDATE salesorderdetails + SET qtyinvoiced = qtyinvoiced + " . $OrderLine->QtyDispatched . ", + actualdispatchdate = '" . $DefaultDispatchDate . "', + completed=1 + WHERE orderno = '" . $_SESSION['ProcessingOrder'] . "' + AND orderlineno = '" . $OrderLine->LineNumber . "'"; } else { - $SQL = "UPDATE salesorderdetails SET qtyinvoiced = qtyinvoiced + " . $OrderLine->QtyDispatched . ", - actualdispatchdate = '" . $DefaultDispatchDate . "' - WHERE orderno = '" . $_SESSION['ProcessingOrder'] . "' - AND orderlineno = '" . $OrderLine->LineNumber . "'"; + $SQL = "UPDATE salesorderdetails + SET qtyinvoiced = qtyinvoiced + " . $OrderLine->QtyDispatched . ", + actualdispatchdate = '" . $DefaultDispatchDate . "' + WHERE orderno = '" . $_SESSION['ProcessingOrder'] . "' + AND orderlineno = '" . $OrderLine->LineNumber . "'"; } @@ -916,8 +912,8 @@ /* Update location stock records if not a dummy stock item need the MBFlag later too so save it to $MBFlag */ $Result = DB_query("SELECT mbflag - FROM stockmaster - WHERE stockid = '" . $OrderLine->StockID . "'",$db, _('Cannot retrieve the mbflag')); + FROM stockmaster + WHERE stockid = '" . $OrderLine->StockID . "'",$db, _('Cannot retrieve the mbflag')); $myrow = DB_fetch_row($Result); $MBFlag = $myrow[0]; @@ -928,9 +924,9 @@ /* Need to get the current location quantity will need it later for the stock movement */ $SQL="SELECT locstock.quantity - FROM locstock - WHERE locstock.stockid='" . $OrderLine->StockID . "' - AND loccode= '" . $_SESSION['Items']->Location . "'"; + FROM locstock + WHERE locstock.stockid='" . $OrderLine->StockID . "' + AND loccode= '" . $_SESSION['Items']->Location . "'"; $ErrMsg = _('WARNING') . ': ' . _('Could not retrieve current location stock'); $Result = DB_query($SQL, $db, $ErrMsg); @@ -943,9 +939,9 @@ } $SQL = "UPDATE locstock SET quantity = locstock.quantity - " . $OrderLine->QtyDispatched . " - WHERE locstock.stockid = '" . $OrderLine->StockID . "' - AND loccode = '" . $_SESSION['Items']->Location . "'"; - + WHERE locstock.stockid = '" . $OrderLine->StockID . "' + AND loccode = '" . $_SESSION['Items']->Location . "'"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Location stock record could not be updated because'); $DbgMsg = _('The following SQL to update the location stock record was used'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); @@ -956,15 +952,15 @@ $Assembly=True; $StandardCost =0; /*To start with - accumulate the cost of the comoponents for use in journals later on */ $SQL = "SELECT bom.component, - bom.quantity, - stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS standard - FROM bom, - stockmaster - WHERE bom.component=stockmaster.stockid - AND bom.parent='" . $OrderLine->StockID . "' - AND bom.effectiveto > '" . Date("Y-m-d") . "' - AND bom.effectiveafter < '" . Date("Y-m-d") . "'"; - + bom.quantity, + stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS standard + FROM bom, + stockmaster + WHERE bom.component=stockmaster.stockid + AND bom.parent='" . $OrderLine->StockID . "' + AND bom.effectiveto >= '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Could not retrieve assembly components from the database for'). ' '. $OrderLine->StockID . _('because').' '; $DbgMsg = _('The SQL that failed was'); $AssResult = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); @@ -975,9 +971,9 @@ /* Need to get the current location quantity will need it later for the stock movement */ $SQL="SELECT locstock.quantity - FROM locstock - WHERE locstock.stockid='" . $AssParts['component'] . "' - AND loccode= '" . $_SESSION['Items']->Location . "'"; + FROM locstock + WHERE locstock.stockid='" . $AssParts['component'] . "' + AND loccode= '" . $_SESSION['Items']->Location . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Can not retrieve assembly components location stock quantities because '); $DbgMsg = _('The SQL that failed was'); @@ -992,35 +988,32 @@ if (empty($AssParts['standard'])) { $AssParts['standard']=0; } - $SQL = "INSERT INTO stockmoves ( - stockid, - type, - transno, - loccode, - trandate, - debtorno, - branchcode, - prd, - reference, - qty, - standardcost, - show_on_inv_crds, - newqoh - ) VALUES ( - '" . $AssParts['component'] . "', - 10, - '" . $InvoiceNo . "', - '" . $_SESSION['Items']->Location . "', - '" . $DefaultDispatchDate . "', - '" . $_SESSION['Items']->DebtorNo . "', - '" . $_SESSION['Items']->Branch . "', - '" . $PeriodNo . "', - '" . _('Assembly') . ': ' . $OrderLine->StockID . ' ' . _('Order') . ': ' . $_SESSION['ProcessingOrder'] . "', - '" . -$AssParts['quantity'] * $OrderLine->QtyDispatched . "', - '" . $AssParts['standard'] . "', - 0, - '" . ($QtyOnHandPrior - $AssParts['quantity'] * $OrderLine->QtyDispatched) . "' - )"; + $SQL = "INSERT INTO stockmoves ( stockid, + type, + transno, + loccode, + trandate, + debtorno, + branchcode, + prd, + reference, + qty, + standardcost, + show_on_inv_crds, + newqoh) + VALUES ('" . $AssParts['component'] . "', + 10, + '" . $InvoiceNo . "', + '" . $_SESSION['Items']->Location . "', + '" . $DefaultDispatchDate . "', + '" . $_SESSION['Items']->DebtorNo . "', + '" . $_SESSION['Items']->Branch . "', + '" . $PeriodNo . "', + '" . _('Assembly') . ': ' . $OrderLine->StockID . ' ' . _('Order') . ': ' . $_SESSION['ProcessingOrder'] . "', + '" . -$AssParts['quantity'] * $OrderLine->QtyDispatched . "', + '" . $AssParts['standard'] . "', + 0, + '" . ($QtyOnHandPrior - $AssParts['quantity'] * $OrderLine->QtyDispatched) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records for the assembly components of'). ' '. $OrderLine->StockID . ' ' . _('could not be inserted because'); $DbgMsg = _('The following SQL to insert the assembly components stock movement records was used'); @@ -1028,9 +1021,9 @@ $SQL = "UPDATE locstock - SET quantity = locstock.quantity - " . $AssParts['quantity'] * $OrderLine->QtyDispatched . " - WHERE locstock.stockid = '" . $AssParts['component'] . "' - AND loccode = '" . $_SESSION['Items']->Location . "'"; + SET quantity = locstock.quantity - " . $AssParts['quantity'] * $OrderLine->QtyDispatched . " + WHERE locstock.stockid = '" . $AssParts['component'] . "' + AND loccode = '" . $_SESSION['Items']->Location . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Location stock record could not be updated for an assembly component because'); $DbgMsg = _('The following SQL to update the locations stock record for the component was used'); @@ -1050,68 +1043,68 @@ } if ($MBFlag=='B' OR $MBFlag=='M'){ $SQL = "INSERT INTO stockmoves ( stockid, - type, - transno, - loccode, - trandate, - debtorno, - branchcode, - price, - prd, - reference, - qty, - discountpercent, - standardcost, - newqoh, - narrative ) - VALUES ('" . $OrderLine->StockID . "', - 10, - '" . $InvoiceNo . "', - '" . $_SESSION['Items']->Location . "', - '" . $DefaultDispatchDate . "', - '" . $_SESSION['Items']->DebtorNo . "', - '" . $_SESSION['Items']->Branch . "', - '" . $LocalCurrencyPrice . "', - '" . $PeriodNo . "', - '" . $_SESSION['ProcessingOrder'] . "', - '" . -$OrderLine->QtyDispatched . "', - '" . $OrderLine->DiscountPercent . "', - '" . $OrderLine->StandardCost . "', - '" . ($QtyOnHandPrior - $OrderLine->QtyDispatched) . "', - '" . DB_escape_string($OrderLine->Narrative) . "' )"; + type, + transno, + loccode, + trandate, + debtorno, + branchcode, + price, + prd, + reference, + qty, + discountpercent, + standardcost, + newqoh, + narrative ) + VALUES ('" . $OrderLine->StockID . "', + 10, + '" . $InvoiceNo . "', + '" . $_SESSION['Items']->Location . "', + '" . $DefaultDispatchDate . "', + '" . $_SESSION['Items']->DebtorNo . "', + '" . $_SESSION['Items']->Branch . "', + '" . $LocalCurrencyPrice . "', + '" . $PeriodNo . "', + '" . $_SESSION['ProcessingOrder'] . "', + '" . -$OrderLine->QtyDispatched . "', + '" . $OrderLine->DiscountPercent . "', + '" . $OrderLine->StandardCost . "', + '" . ($QtyOnHandPrior - $OrderLine->QtyDispatched) . "', + '" . DB_escape_string($OrderLine->Narrative) . "' )"; } else { // its an assembly or dummy and assemblies/dummies always have nil stock (by definition they are made up at the time of dispatch so new qty on hand will be nil if (empty($OrderLine->StandardCost)) { $OrderLine->StandardCost=0; } $SQL = "INSERT INTO stockmoves ( stockid, - type, - transno, - loccode, - trandate, - debtorno, - branchcode, - price, - prd, - reference, - qty, - discountpercent, - standardcost, - narrative ) - VALUES ('" . $OrderLine->StockID . "', - 10, - '" . $InvoiceNo . "', - '" . $_SESSION['Items']->Location . "', - '" . $DefaultDispatchDate . "', - '" . $_SESSION['Items']->DebtorNo . "', - '" . $_SESSION['Items']->Branch . "', - '" . $LocalCurrencyPrice . "', - '" . $PeriodNo . "', - '" . $_SESSION['ProcessingOrder'] . "', - '" . -$OrderLine->QtyDispatched . "', - '" . $OrderLine->DiscountPercent . "', - '" . $OrderLine->StandardCost . "', - '" . DB_escape_string($OrderLine->Narrative) . "')"; + type, + transno, + loccode, + trandate, + debtorno, + branchcode, + price, + prd, + reference, + qty, + discountpercent, + standardcost, + narrative ) + VALUES ('" . $OrderLine->StockID . "', + 10, + '" . $InvoiceNo . "', + '" . $_SESSION['Items']->Location . "', + '" . $DefaultDispatchDate . "', + '" . $_SESSION['Items']->DebtorNo . "', + '" . $_SESSION['Items']->Branch . "', + '" . $LocalCurrencyPrice . "', + '" . $PeriodNo . "', + '" . $_SESSION['ProcessingOrder'] . "', + '" . -$OrderLine->QtyDispatched . "', + '" . $OrderLine->DiscountPercent . "', + '" . $OrderLine->StandardCost . "', + '" . DB_escape_string($OrderLine->Narrative) . "')"; } @@ -1126,15 +1119,15 @@ foreach ($OrderLine->Taxes as $Tax) { $SQL = "INSERT INTO stockmovestaxes (stkmoveno, - taxauthid, - taxrate, - taxcalculationorder, - taxontax) - VALUES ('" . $StkMoveNo . "', - '" . $Tax->TaxAuthID . "', - '" . $Tax->TaxRate . "', - '" . $Tax->TaxCalculationOrder . "', - '" . $Tax->TaxOnTax . "')"; + taxauthid, + taxrate, + taxcalculationorder, + taxontax) + VALUES ('" . $StkMoveNo . "', + '" . $Tax->TaxAuthID . "', + '" . $Tax->TaxRate . "', + '" . $Tax->TaxCalculationOrder . "', + '" . $Tax->TaxOnTax . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Taxes and rates applicable to this invoice line item could not be inserted because'); $DbgMsg = _('The following SQL to insert the stock movement tax detail records was used'); @@ -1150,9 +1143,9 @@ The StockSerialMoves as well */ $SQL = "UPDATE stockserialitems SET quantity= quantity - " . $Item->BundleQty . " - WHERE stockid='" . $OrderLine->StockID . "' - AND loccode='" . $_SESSION['Items']->Location . "' - AND serialno='" . $Item->BundleRef . "'"; + WHERE stockid='" . $OrderLine->StockID . "' + AND loccode='" . $_SESSION['Items']->Location . "' + AND serialno='" . $Item->BundleRef . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be updated because'); $DbgMsg = _('The following SQL to update the serial stock item record was used'); @@ -1161,13 +1154,13 @@ /* now insert the serial stock movement */ $SQL = "INSERT INTO stockserialmoves (stockmoveno, - stockid, - serialno, - moveqty) - VALUES ('" . $StkMoveNo . "', - '" . $OrderLine->StockID . "', - '" . $Item->BundleRef . "', - '" . -$Item->BundleQty . "')"; + stockid, + serialno, + moveqty) + VALUES ('" . $StkMoveNo . "', + '" . $OrderLine->StockID . "', + '" . $Item->BundleRef . "', + '" . -$Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); $DbgMsg = _('The following SQL to insert the serial stock movement records was used'); @@ -1178,14 +1171,14 @@ /*Insert Sales Analysis records */ $SQL="SELECT COUNT(*), - salesanalysis.stockid, - salesanalysis.stkcategory, - salesanalysis.cust, - salesanalysis.custbranch, - salesanalysis.area, - salesanalysis.periodno, - salesanalysis.typeabbrev, - salesanalysis.salesperson + salesanalysis.stockid, + salesanalysis.stkcategory, + salesanalysis.cust, + salesanalysis.custbranch, + salesanalysis.area, + salesanalysis.periodno, + salesanalysis.typeabbrev, + salesanalysis.salesperson FROM salesanalysis, custbranch, stockmaster @@ -1211,7 +1204,7 @@ salesanalysis.salesperson"; $ErrMsg = _('The count of existing Sales analysis records could not run because'); - $DbgMsg = '<br>'. _('SQL to count the no of sales analysis records'); + $DbgMsg = '<br />'. _('SQL to count the no of sales analysis records'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); $myrow = DB_fetch_row($Result); @@ -1219,9 +1212,9 @@ if ($myrow[0]>0){ /*Update the existing record that already exists */ $SQL = "UPDATE salesanalysis SET amt=amt+" . ($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . ", - cost=cost+" . ($OrderLine->StandardCost * $OrderLine->QtyDispatched) . ", - qty=qty +" . $OrderLine->QtyDispatched . ", - disc=disc+" . ($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . " + cost=cost+" . ($OrderLine->StandardCost * $OrderLine->QtyDispatched) . ", + qty=qty +" . $OrderLine->QtyDispatched . ", + disc=disc+" . ($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . " WHERE salesanalysis.area='" . $myrow[5] . "' AND salesanalysis.salesperson='" . $myrow[8] . "' AND typeabbrev ='" . $_SESSION['Items']->DefaultSalesType . "' @@ -1235,31 +1228,31 @@ } else { /* insert a new sales analysis record */ $SQL = "INSERT INTO salesanalysis (typeabbrev, - periodno, - amt, - cost, - cust, - custbranch, - qty, - disc, - stockid, - area, - budgetoractual, - salesperson, - stkcategory ) + periodno, + amt, + cost, + cust, + custbranch, + qty, + disc, + stockid, + area, + budgetoractual, + salesperson, + stkcategory ) SELECT '" . $_SESSION['Items']->DefaultSalesType . "', - '" . $PeriodNo . "', - '" . ($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', - '" . ($OrderLine->StandardCost * $OrderLine->QtyDispatched) . "', - '" . $_SESSION['Items']->DebtorNo . "', - '" . $_SESSION['Items']->Branch . "', - '" . $OrderLine->QtyDispatched . "', - '" . ($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', - '" . $OrderLine->StockID . "', - custbranch.area, - 1, - custbranch.salesman, - stockmaster.categoryid + '" . $PeriodNo . "', + '" . ($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', + '" . ($OrderLine->StandardCost * $OrderLine->QtyDispatched) . "', + '" . $_SESSION['Items']->DebtorNo . "', + '" . $_SESSION['Items']->Branch . "', + '" . $OrderLine->QtyDispatched . "', + '" . ($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', + '" . $OrderLine->StockID . "', + custbranch.area, + 1, + custbranch.salesman, + stockmaster.categoryid FROM stockmaster, custbranch WHERE stockmaster.stockid = '" . $OrderLine->StockID . "' @@ -1278,20 +1271,20 @@ /*first the cost of sales entry - GL accounts are retrieved using the function GetCOGSGLAccount from includes/GetSalesTransGLCodes.inc */ $SQL = "INSERT INTO gltrans ( type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES ( - 10, - '" . $InvoiceNo . "', - '" . $DefaultDispatchDate . "', - '" . $PeriodNo . "', - '" . GetCOGSGLAccount($Area, $OrderLine->StockID, $_SESSION['Items']->DefaultSalesType, $db) . "', - '" . $_SESSION['Items']->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->StandardCost . "', - ... [truncated message content] |
From: <dai...@us...> - 2011-05-01 09:45:27
|
Revision: 4559 http://web-erp.svn.sourceforge.net/web-erp/?rev=4559&view=rev Author: daintree Date: 2011-05-01 09:45:18 +0000 (Sun, 01 May 2011) Log Message: ----------- quoting Modified Paths: -------------- trunk/AccountSections.php trunk/AgedDebtors.php trunk/AuditTrail.php trunk/BOMIndented.php trunk/BOMListing.php trunk/BOMs.php trunk/BankAccounts.php trunk/Logout.php trunk/PageSecurity.php trunk/SecurityTokens.php trunk/StockTransferControlled.php trunk/StockUsage.php trunk/SuppTransGLAnalysis.php trunk/SupplierContacts.php trunk/SupplierInquiry.php trunk/SupplierTypes.php trunk/TaxGroups.php trunk/WorkOrderCosting.php trunk/Z_CheckDebtorsControl.php trunk/css/default/login.css trunk/css/fresh/login.css trunk/css/gel/login.css trunk/css/jelly/login.css trunk/css/professional/login.css trunk/css/professional-rtl/login.css trunk/css/silverwolf/login.css trunk/doc/Change.log.html trunk/includes/Login.php trunk/index.php Modified: trunk/AccountSections.php =================================================================== --- trunk/AccountSections.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/AccountSections.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.7 $ */ + /* $Id$*/ -//$PageSecurity = 10; - include('includes/session.inc'); $title = _('Account Sections'); @@ -136,7 +134,7 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg( _('Cannot delete this account section because general ledger accounts groups have been created using this section'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('general ledger accounts groups that refer to this account section') . '</font>'; + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('general ledger accounts groups that refer to this account section') . '</font>'; } else { //Fetch section name @@ -176,11 +174,11 @@ $result = DB_query($sql,$db,$ErrMsg); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo "<table name='SectionList' class='selection'> + echo '<table name="SectionList" class="selection"> <tr> - <th>" . _('Section Number') . "</th> - <th>" . _('Section Description') . "</th> - </tr>"; + <th>' . _('Section Number') . '</th> + <th>' . _('Section Description') . '</th> + </tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_row($result)) { @@ -194,11 +192,11 @@ } echo '<td>' . $myrow[0] . '</td><td>' . $myrow[1] . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedSectionID=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedSectionID=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; if ( $myrow[0] == '1' || $myrow[0] == '2' ) { echo '<td><b>'._('Restricted').'</b></td>'; } else { - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedSectionID=' . $myrow[0] . '&delete=1">' . _('Delete') .'</a></td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedSectionID=' . $myrow[0] . '&delete=1">' . _('Delete') .'</a></td>'; } echo '</tr>'; } //END WHILE LIST LOOP @@ -207,12 +205,12 @@ if (isset($_POST['SelectedSectionID']) or isset($_GET['SelectedSectionID'])) { - echo '<div class="centre"><a href=' . $_SERVER['PHP_SELF'] . '?' . SID .'>' . _('Review Account Sections') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Account Sections') . '</a></div>'; } if (! isset($_GET['delete'])) { - echo "<form method='post' name='AccountSections' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; + echo '<form method="post" name="AccountSections" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($_GET['SelectedSectionID'])) { @@ -233,10 +231,12 @@ $_POST['SectionID'] = $myrow['sectionid']; $_POST['SectionName'] = $myrow['sectionname']; - echo "<input type=hidden name='SelectedSectionID' value='" . $_POST['SectionID'] . "'>"; - echo "<table class=selection> - <td>" . _('Section Number') . ':' . "</td> - <td>" . $_POST['SectionID'] . "</td>"; + echo '<input type=hidden name="SelectedSectionID" value="' . $_POST['SectionID'] . '" />'; + echo '<table class="selection"> + <tr> + <td>' . _('Section Number') . ':' . '</td> + <td>' . $_POST['SectionID'] . '</td> + </tr>'; } } else { @@ -250,22 +250,23 @@ if (!isset($_POST['SectionName'])) { $_POST['SectionName']=''; } - echo "<table class='selection'> + echo '<table class="selection"> <tr> - <td>" . _('Section Number') . ':' . '</td> - <td><input tabindex="1" ' . (in_array('SectionID',$Errors) ? 'class="inputerror"' : '' ) ." type='text' name='SectionID' class='number' size='4' maxlength='4' value='" . $_POST['SectionID'] . "' /></td></tr>"; + <td>' . _('Section Number') . ':' . '</td> + <td><input tabindex="1" ' . (in_array('SectionID',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="SectionID" class="number" size="4" maxlength="4" value="' . $_POST['SectionID'] . '" /></td> + </tr>'; } - echo "<tr><td>" . _('Section Description') . ':' . '</td> - <td><input tabindex="2" ' . (in_array('SectionName',$Errors) ? 'class="inputerror"' : '' ) ." type='text' name='SectionName' size='30' maxlength='30' value='" . $_POST['SectionName'] . "' /></td> - </tr>"; + echo '<tr><td>' . _('Section Description') . ':' . '</td> + <td><input tabindex="2" ' . (in_array('SectionName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="SectionName" size="30" maxlength="30" value="' . $_POST['SectionName'] . '" /></td> + </tr>'; echo '<tr><td colspan="2"><div class="centre"><input tabindex="3" type="submit" name="submit" value="' . _('Enter Information') . '" /></div></td></tr>'; echo '</table><br />'; if (!isset($_GET['SelectedSectionID']) or $_GET['SelectedSectionID']=='') { - echo "<script>defaultControl(document.AccountSections.SectionID);</script>"; + echo '<script>defaultControl(document.AccountSections.SectionID);</script>'; } else { - echo "<script>defaultControl(document.AccountSections.SectionName);</script>"; + echo '<script>defaultControl(document.AccountSections.SectionName);</script>'; } echo '</form>'; Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/AgedDebtors.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -2,9 +2,6 @@ /* $Id$ */ -/* $Revision: 1.20 $ */ - -//$PageSecurity = 2; include('includes/session.inc'); if (isset($_POST['PrintPDF']) @@ -22,7 +19,7 @@ /*Now figure out the aged analysis for the customer range under review */ if (trim($_POST['Salesman'])!=''){ - $SalesLimit = " and debtorsmaster.debtorno in (SELECT DISTINCT debtorno FROM custbranch where salesman = '".$_POST['Salesman']."') "; + $SalesLimit = " AND debtorsmaster.debtorno IN (SELECT DISTINCT debtorno FROM custbranch where salesman = '".$_POST['Salesman']."') "; } else { $SalesLimit = ""; } @@ -30,6 +27,7 @@ $SQL = "SELECT debtorsmaster.debtorno, debtorsmaster.name, currencies.currency, + currencies.decimalplaces, paymentterms.terms, debtorsmaster.creditlimit, holdreasons.dissallowinvoices, @@ -86,6 +84,7 @@ GROUP BY debtorsmaster.debtorno, debtorsmaster.name, currencies.currency, + currencies.decimalplaces, paymentterms.terms, paymentterms.daysbeforedue, paymentterms.dayinfollowingmonth, @@ -100,6 +99,7 @@ $SQL = "SELECT debtorsmaster.debtorno, debtorsmaster.name, currencies.currency, + currencies.decimalplaces, paymentterms.terms, debtorsmaster.creditlimit, holdreasons.dissallowinvoices, @@ -158,6 +158,7 @@ GROUP BY debtorsmaster.debtorno, debtorsmaster.name, currencies.currency, + currencies.decimalplaces, paymentterms.terms, paymentterms.daysbeforedue, paymentterms.dayinfollowingmonth, @@ -182,6 +183,7 @@ $SQL = "SELECT debtorsmaster.debtorno, debtorsmaster.name, currencies.currency, + currencies.decimalplaces, paymentterms.terms, debtorsmaster.creditlimit, holdreasons.dissallowinvoices, @@ -245,6 +247,7 @@ GROUP BY debtorsmaster.debtorno, debtorsmaster.name, currencies.currency, + currencies.decimalplaces, paymentterms.terms, paymentterms.daysbeforedue, paymentterms.dayinfollowingmonth, @@ -267,9 +270,9 @@ $title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '.... '; include('includes/header.inc'); echo '<p>' . _('The customer details could not be retrieved by the SQL because') . ' ' . DB_error_msg($db); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$SQL"; + echo '<br />' . $SQL; } include('includes/footer.inc'); exit; @@ -283,16 +286,17 @@ $TotOD1=0; $TotOD2=0; - $ListCount = DB_num_rows($CustomerResult); //UldisN - + $ListCount = DB_num_rows($CustomerResult); + $DecimalPlaces =2; //by default + while ($AgedAnalysis = DB_fetch_array($CustomerResult,$db)){ + $DecimalPlaces = $AgedAnalysis['decimalplaces']; + $DisplayDue = number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$DecimalPlaces); + $DisplayCurrent = number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$DecimalPlaces); + $DisplayBalance = number_format($AgedAnalysis['balance'],$DecimalPlaces); + $DisplayOverdue1 = number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$DecimalPlaces); + $DisplayOverdue2 = number_format($AgedAnalysis['overdue2'],$DecimalPlaces); - $DisplayDue = number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],2); - $DisplayCurrent = number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],2); - $DisplayBalance = number_format($AgedAnalysis['balance'],2); - $DisplayOverdue1 = number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],2); - $DisplayOverdue2 = number_format($AgedAnalysis['overdue2'],2); - $TotBal += $AgedAnalysis['balance']; $TotDue += ($AgedAnalysis['due']-$AgedAnalysis['overdue1']); $TotCurr += ($AgedAnalysis['balance']-$AgedAnalysis['due']); @@ -364,10 +368,10 @@ if (DB_error_no($db) !=0) { $title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); - echo '<br><br>' . _('The details of outstanding transactions for customer') . ' - ' . $AgedAnalysis['debtorno'] . ' ' . _('could not be retrieved because') . ' - ' . DB_error_msg($db); - echo "<br><a href='$rootpath/index.php'>" . _('Back to the menu') . '</a>'; + echo '<br /><br />' . _('The details of outstanding transactions for customer') . ' - ' . $AgedAnalysis['debtorno'] . ' ' . _('could not be retrieved because') . ' - ' . DB_error_msg($db); + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo '<br>' . _('The SQL that failed was') . '<p>' . $sql; + echo '<br />' . _('The SQL that failed was') . '<p>' . $sql; } include('includes/footer.inc'); exit; @@ -380,11 +384,11 @@ $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); $LeftOvers = $pdf->addTextWrap($Left_Margin+125,$YPos,75,$FontSize,$DisplayTranDate,'left'); - $DisplayDue = number_format($DetailTrans['due']-$DetailTrans['overdue1'],2); - $DisplayCurrent = number_format($DetailTrans['balance']-$DetailTrans['due'],2); - $DisplayBalance = number_format($DetailTrans['balance'],2); - $DisplayOverdue1 = number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],2); - $DisplayOverdue2 = number_format($DetailTrans['overdue2'],2); + $DisplayDue = number_format($DetailTrans['due']-$DetailTrans['overdue1'],$DecimalPlaces); + $DisplayCurrent = number_format($DetailTrans['balance']-$DetailTrans['due'],$DecimalPlaces); + $DisplayBalance = number_format($DetailTrans['balance'],$DecimalPlaces); + $DisplayOverdue1 = number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$DecimalPlaces); + $DisplayOverdue2 = number_format($DetailTrans['overdue2'],$DecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); @@ -414,11 +418,11 @@ $pdf->line($Page_Width-$Right_Margin, $YPos+10 ,220, $YPos+10); } - $DisplayTotBalance = number_format($TotBal,2); - $DisplayTotDue = number_format($TotDue,2); - $DisplayTotCurrent = number_format($TotCurr,2); - $DisplayTotOverdue1 = number_format($TotOD1,2); - $DisplayTotOverdue2 = number_format($TotOD2,2); + $DisplayTotBalance = number_format($TotBal,$DecimalPlaces); + $DisplayTotDue = number_format($TotDue,$DecimalPlaces); + $DisplayTotCurrent = number_format($TotCurr,$DecimalPlaces); + $DisplayTotOverdue1 = number_format($TotOD1,$DecimalPlaces); + $DisplayTotOverdue2 = number_format($TotOD2,$DecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayTotCurrent,'right'); @@ -426,12 +430,6 @@ $LeftOvers = $pdf->addTextWrap(400,$YPos,60,$FontSize,$DisplayTotOverdue1,'right'); $LeftOvers = $pdf->addTextWrap(460,$YPos,60,$FontSize,$DisplayTotOverdue2,'right'); -/* Javier: This actually would produce the output - $buf = $pdf->output(); - $len = strlen($buf); -*/ - -// if ($len < 1000) { if ($ListCount == 0) { $title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); @@ -439,26 +437,14 @@ if ($debug==1){ prnMsg($SQL,'info'); } - echo "<br><a href='$rootpath/index.php'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; + } else { + $pdf->OutputD($_SESSION['DatabaseName'] . '_' . 'AgedDebtors_' . date('Y-m-d') . '.pdf'); + $pdf-> __destruct(); } -/* Javier: TCPDF sends its own http header, would be an error to send it twice. - header('Content-type: application/pdf'); - header("Content-Length: $len"); - header('Content-Disposition: inline; filename=AgedDebtors.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - $pdf->stream(); */ - -// This else was missed - else { - $pdf->OutputD($_SESSION['DatabaseName'] . '_' . 'AgedDebtors_' . date('Y-m-d') . '.pdf'); - $pdf-> __destruct(); - } - } else { /*The option to print PDF was not hit */ $title=_('Aged Debtor Analysis'); @@ -471,56 +457,64 @@ /*if $FromCriteria is not set then show a form to allow input */ - echo '<form action=' . $_SERVER['PHP_SELF'] . " method='post'><table>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + <table>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('From Customer Code') . ':' . "</font></td><td><input tabindex='1' Type=text maxlength=6 size=7 name=FromCriteria value='0'></td></tr>"; - echo '<tr><td>' . _('To Customer Code') . ':' . "</td><td><input tabindex='2' Type=text maxlength=6 size=7 name=ToCriteria value='zzzzzz'></td></tr>"; + echo '<tr><td>' . _('From Customer Code') . ':' . '</font></td> + <td><input tabindex="1" type="text" maxlength="6" size="7" name="FromCriteria" value="0"></td> + </tr>'; + echo '<tr><td>' . _('To Customer Code') . ':' . '</td> + <td><input tabindex="2" type="text" maxlength="6" size="7" name="ToCriteria" value="zzzzzz" /></td> + </tr>'; - echo '<tr><td>' . _('All balances or overdues only') . ':' . "</td><td><select tabindex='3' name='All_Or_Overdues'>"; - echo "<option selected Value='All'>" . _('All customers with balances'); - echo "<option Value='OverduesOnly'>" . _('Overdue accounts only'); - echo "<option Value='HeldOnly'>" . _('Held accounts only'); - echo '</select></td></tr>'; + echo '<tr><td>' . _('All balances or overdues only') . ':' . '</td> + <td><select tabindex="3" name="All_Or_Overdues"> + <option selected value="All">' . _('All customers with balances') . '</option> + <option value="OverduesOnly">' . _('Overdue accounts only') . '</option> + <option value="HeldOnly">' . _('Held accounts only') . '</option> + </select> + </td> + </tr>'; - echo '<tr><td>' . _('Only Show Customers Of') . ':' . "</td><td><select tabindex='4' name='Salesman'>"; + echo '<tr><td>' . _('Only Show Customers Of') . ':' . '</td> + <td><select tabindex="4" name="Salesman">'; - $sql = 'SELECT salesmancode, salesmanname FROM salesman'; + $sql = "SELECT salesmancode, salesmanname FROM salesman"; $result=DB_query($sql,$db); - echo "<option value=''></option>"; + echo '<option value=""></option>'; while ($myrow=DB_fetch_array($result)){ - echo "<option value='" . $myrow['salesmancode'] . "'>" . $myrow['salesmanname']; + echo '<option value="' . $myrow['salesmancode'] . '">' . $myrow['salesmanname'] . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('Only show customers trading in') . ':' . "</td><td><select tabindex='5' name='Currency'>"; + echo '<tr><td>' . _('Only show customers trading in') . ':' . '</td> + <td><select tabindex="5" name="Currency">'; - $sql = 'SELECT currency, currabrev FROM currencies'; + $sql = "SELECT currency, currabrev FROM currencies"; $result=DB_query($sql,$db); - - while ($myrow=DB_fetch_array($result)){ if ($myrow['currabrev'] == $_SESSION['CompanyRecord']['currencydefault']){ - echo "<option selected value='" . $myrow['currabrev'] . "'>" . $myrow['currency']; + echo '<option selected value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; } else { - echo "<option value='" . $myrow['currabrev'] . "'>" . $myrow['currency']; + echo '<option value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; } } echo '</select></td></tr>'; - echo '<tr><td>' . _('Summary or detailed report') . ':' . "</td> - <td><select tabindex='6' name='DetailedReport'>"; - echo "<option selected value='No'>" . _('Summary Report'); - echo "<option value='Yes'>" . _('Detailed Report'); - echo '</select></td></tr>'; + echo '<tr><td>' . _('Summary or detailed report') . ':' . '</td> + <td><select tabindex="6" name="DetailedReport"> + <option selected value="No">' . _('Summary Report') . '</option> + <option value="Yes">' . _('Detailed Report') . '</option> + </select> + </td> + </tr>'; - echo '</table><br><div class="centre"><input tabindex="7" type=submit name="PrintPDF" value="' . _('Print PDF') , '"></div>'; + echo '</table><br /><div class="centre"><input tabindex="7" type=submit name="PrintPDF" value="' . _('Print PDF') , '"></div>'; } include('includes/footer.inc'); - } /*end of else not PrintPDF */ - -?> +?> \ No newline at end of file Modified: trunk/AuditTrail.php =================================================================== --- trunk/AuditTrail.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/AuditTrail.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -40,18 +40,19 @@ // Show user selections echo '<tr><td>'. _('User ID'). '</td> <td><select tabindex="3" name="SelectedUser">'; -echo '<option value=ALL>ALL'; +echo '<option value="ALL">' . _('ALL') . '</option>'; while ($users = DB_fetch_row($UserResult)) { if (isset($_POST['SelectedUser']) and $users[0]==$_POST['SelectedUser']) { - echo '<option selected value=' . $users[0] . '>' . $users[0] . '</option>'; + echo '<option selected value="' . $users[0] . '">' . $users[0] . '</option>'; } else { - echo '<option value=' . $users[0] . '>' . $users[0] . '</option>'; + echo '<option value="' . $users[0] . '">' . $users[0] . '</option>'; } } echo '</select></td></tr>'; // Show table selections -echo '<tr><td>'. _('Table '). '</td><td><select tabindex="4" name="SelectedTable">'; +echo '<tr><td>'. _('Table '). '</td> + <td><select tabindex="4" name="SelectedTable">'; echo '<option value="ALL">' . _('ALL') . '</option>'; while ($tables = DB_fetch_row($TableResult)) { if (isset($_POST['SelectedTable']) and $tables[0]==$_POST['SelectedTable']) { Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/BOMIndented.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -15,19 +15,19 @@ $PageNumber=1; $line_height=12; - $sql = 'DROP TABLE IF EXISTS tempbom'; + $sql = "DROP TABLE IF EXISTS tempbom"; $result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS passbom'; + $sql = "DROP TABLE IF EXISTS passbom"; $result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS passbom2'; + $sql = "DROP TABLE IF EXISTS passbom2"; $result = DB_query($sql,$db); - $sql = 'CREATE TEMPORARY TABLE passbom ( + $sql = "CREATE TEMPORARY TABLE passbom ( part char(20), - sortpart text) DEFAULT CHARSET=utf8'; + sortpart text) DEFAULT CHARSET=utf8"; $ErrMsg = _('The SQL to create passbom failed with the message'); $result = DB_query($sql,$db,$ErrMsg); - $sql = 'CREATE TEMPORARY TABLE tempbom ( + $sql = "CREATE TEMPORARY TABLE tempbom ( parent char(20), component char(20), sortpart text, @@ -36,7 +36,7 @@ loccode char(5), effectiveafter date, effectiveto date, - quantity double) DEFAULT CHARSET=utf8'; + quantity double) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db,_('Create of tempbom failed because')); // First, find first level of components below requested assembly // Put those first level parts in passbom, use COMPONENT in passbom @@ -112,32 +112,32 @@ AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS passbom2'; + $sql = "DROP TABLE IF EXISTS passbom2"; $result = DB_query($sql,$db); - $sql = 'ALTER TABLE passbom RENAME AS passbom2'; + $sql = "ALTER TABLE passbom RENAME AS passbom2"; $result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS passbom'; + $sql = "DROP TABLE IF EXISTS passbom"; $result = DB_query($sql,$db); - $sql = 'CREATE TEMPORARY TABLE passbom ( - part char(20), - sortpart text) DEFAULT CHARSET=utf8'; + $sql = "CREATE TEMPORARY TABLE passbom ( + part char(20), + sortpart text) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db); - $sql = 'INSERT INTO passbom (part, sortpart) + $sql = "INSERT INTO passbom (part, sortpart) SELECT bom.component AS part, CONCAT(passbom2.sortpart,bom.component) AS sortpart FROM bom,passbom2 WHERE bom.parent = passbom2.part AND bom.effectiveto >= NOW() - AND bom.effectiveafter <= NOW()'; + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); - $sql = 'SELECT COUNT(*) FROM bom,passbom WHERE bom.parent = passbom.part'; + $sql = "SELECT COUNT(*) FROM bom,passbom WHERE bom.parent = passbom.part"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -150,9 +150,9 @@ $title = _('Indented BOM Listing') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The Indented BOM Listing could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); - echo "<br><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$sql"; + echo '<br />' . $sql; } include('includes/footer.inc'); exit; @@ -172,12 +172,12 @@ $Right_Margin,$assemblydesc); $Tot_Val=0; - $sql = 'SELECT tempbom.*, - stockmaster.description, - stockmaster.mbflag - FROM tempbom,stockmaster - WHERE tempbom.component = stockmaster.stockid - ORDER BY sortpart'; + $sql = "SELECT tempbom.*, + stockmaster.description, + stockmaster.mbflag + FROM tempbom,stockmaster + WHERE tempbom.component = stockmaster.stockid + ORDER BY sortpart"; $result = DB_query($sql,$db); // $fill is used to alternate between lines with transparent and painted background @@ -226,21 +226,16 @@ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, $Right_Margin,$assemblydesc); } - /* UldisN - $pdfcode = $pdf->output(); - $len = strlen($pdfcode); - if ($len<=20){ - */ if ($ListCount == 0) { $title = _('Print Indented BOM Listing Error'); include('includes/header.inc'); prnMsg(_('There were no items for the selected assembly'),'error'); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; } else { - $pdf->OutputD($_SESSION['DatabaseName'] . '_Customer_trans_' . date('Y-m-d').'.pdf');//UldisN + $pdf->OutputD($_SESSION['DatabaseName'] . '_Customer_trans_' . date('Y-m-d').'.pdf'); $pdf->__destruct(); } @@ -251,22 +246,30 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table class=selection>"; + echo '</br></br><form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + <table class=selection>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('Part') . ":</td>"; - echo "<td><input type ='text' name='Part' size='20'>"; + echo '<tr><td>' . _('Part') . ':</td> + <td><input type ="text" name="Part" size="20" /> + </tr> + <tr><td>' . _('Levels') . ':</td> + <td><select name="Levels"> + <option selected value="All">' . _('All Levels') . '</option> + <option value="One">' . _('One Level') . '</option> + </select> + </td> + </tr>'; - echo '<tr><td>' . _('Levels') . ":</td><td><select name='Levels'>"; - echo "<option selected value='All'>" . _('All Levels'); - echo "<option value='One'>" . _('One Level'); - echo '</select></td></tr>'; + echo '<tr><td>' . _('Print Option') . ':</td> + <td><select name="Fill"> + <option selected value="yes">' . _('Print With Alternating Highlighted Lines') . '</option> + <option value="no">' . _('Plain Print') . '</option> + </select> + </td> + </tr>'; + echo '</table> + <p><div class="centre"><input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>'; - echo '<tr><td>' . _('Print Option') . ":</td><td><select name='Fill'>"; - echo "<option selected value='yes'>" . _('Print With Alternating Highlighted Lines'); - echo "<option value='no'>" . _('Plain Print'); - echo '</select></td></tr>'; - echo "</table><p><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; - include('includes/footer.inc'); } /*end of else not PrintPDF */ @@ -275,7 +278,6 @@ function PrintHeader(&$pdf,&$YPos,&$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, $Page_Width,$Right_Margin,$assemblydesc) { - $line_height=12; /*PDF page header for Indented BOM Listing report */ if ($PageNumber>1){ Modified: trunk/BOMListing.php =================================================================== --- trunk/BOMListing.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/BOMListing.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -2,12 +2,8 @@ /* $Id$*/ -/* $Revision: 1.14 $ */ - -//$PageSecurity = 2; include('includes/session.inc'); - If (isset($_POST['PrintPDF']) AND isset($_POST['FromCriteria']) AND strlen($_POST['FromCriteria'])>=1 @@ -48,9 +44,9 @@ $title = _('Bill of Materials Listing') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg(_('The Bill of Material listing could not be retrieved by the SQL because'),'error'); - echo "<br><a href='" .$rootpath ."/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$SQL"; + echo '<br />' . $SQL; } include('includes/footer.inc'); exit; @@ -105,22 +101,10 @@ $YPos -=$line_height; $pdf->line($Page_Width-$Right_Margin, $YPos,$Left_Margin, $YPos); - /* - $buf = $pdf->output(); - $len = strlen($buf); + + $pdf->OutputD($_SESSION['DatabaseName'] . '_BOMListing_' . date('Y-m-d').'.pdf'); + $pdf->__destruct(); - header('Content-type: application/pdf'); - header('Content-Length: '.$len); - header('Content-Disposition: inline; filename=BOMListing.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->stream(); - */ - $pdf->OutputD($_SESSION['DatabaseName'] . '_BOMListing_' . date('Y-m-d').'.pdf');//UldisN - $pdf->__destruct(); //UldisN - } else { /*The option to print PDF was not hit */ $title=_('Bill Of Material Listing'); @@ -131,19 +115,25 @@ /*if $FromCriteria is not set then show a form to allow input */ - echo '<form action=' . $_SERVER['PHP_SELF'] . " method='POST'><table class=selection>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="POST"> + <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('From Inventory Part Code') . ':' . "</font></td><td><input tabindex='1' type=text name=FromCriteria size=20 maxlength=20 VALUE='1'></td></tr>"; + echo '<tr><td>' . _('From Inventory Part Code') . ':' . '</font></td> + <td><input tabindex="1" type="text" name="FromCriteria" size="20" maxlength="20" value="1"></td> + </tr>'; - echo '<tr><td>' . _('To Inventory Part Code') . ':' . "</td><td><input tabindex='2' type=text name=ToCriteria size=20 maxlength=20 VALUE='zzzzzzz'></td></tr>"; + echo '<tr><td>' . _('To Inventory Part Code') . ':' . '</td> + <td><input tabindex="2" type="text" name="ToCriteria" size="20" maxlength="20" value="zzzzzzz" /></td> + </tr>'; - echo "</table><br><div class='centre'><input tabindex='3' type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'></div>"; - echo "<script>defaultControl(document.forms[0].FromCriteria);</script>"; + echo '</table> + <br /><div class="centre"><input tabindex="3" type="submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>'; + echo '<script>defaultControl(document.forms[0].FromCriteria);</script>'; } include('includes/footer.inc');; } /*end of else not PrintPDF */ -?> +?> \ No newline at end of file Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/BOMs.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.37 $ */ + /* $Id$*/ -//$PageSecurity = 9; - include('includes/session.inc'); $title = _('Multi-Level Bill Of Materials Maintenance'); @@ -11,8 +9,6 @@ include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); - -// *** POPAD&T - ... Phil modified to english variables function display_children($parent, $level, &$BOMTree) { global $db; @@ -20,15 +16,13 @@ // retrive all children of parent $c_result = DB_query("SELECT parent, - component - FROM bom WHERE parent='" . $parent. "'" + component + FROM bom WHERE parent='" . $parent. "'" ,$db); if (DB_num_rows($c_result) > 0) { - //echo ("<UL>\n"); - - + while ($row = DB_fetch_array($c_result)) { - //echo '<br>Parent: ' . $parent . ' Level: ' . $level . ' row[component]: ' . $row['component'] .'<br>'; + //echo '<br />Parent: ' . $parent . ' Level: ' . $level . ' row[component]: ' . $row['component'] .'<br />'; if ($parent != $row['component']) { // indent and display the title of this child $BOMTree[$i]['Level'] = $level; // Level @@ -119,7 +113,7 @@ $DrillID=''; } else { $DrillText = '<a href="%s&Select=%s">' . _('Drill Down'); - $DrillLink = $_SERVER['PHP_SELF'] . '?' . SID; + $DrillLink = $_SERVER['PHP_SELF'] . '?'; $DrillID=$myrow[0]; } if ($ParentMBflag!='M' AND $ParentMBflag!='G'){ @@ -161,12 +155,12 @@ ConvertSQLDate($myrow[6]), $AutoIssue, $QuantityOnHand, - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $Parent, $myrow[0], $DrillLink, $DrillID, - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $Parent, $myrow[0], $UltimateParent); @@ -246,7 +240,7 @@ } if(!Date1GreaterThanDate2($_POST['EffectiveTo'], $_POST['EffectiveAfter'])){ $InputError = 1; - prnMsg(_('The effective to date must be a date after the effective after date') . '<br>' . _('The effective to date is') . ' ' . DateDiff($_POST['EffectiveTo'], $_POST['EffectiveAfter'], 'd') . ' ' . _('days before the effective after date') . '! ' . _('No updates have been performed') . '.<br>' . _('Effective after was') . ': ' . $_POST['EffectiveAfter'] . ' ' . _('and effective to was') . ': ' . $_POST['EffectiveTo'],'error'); + prnMsg(_('The effective to date must be a date after the effective after date') . '<br />' . _('The effective to date is') . ' ' . DateDiff($_POST['EffectiveTo'], $_POST['EffectiveAfter'], 'd') . ' ' . _('days before the effective after date') . '! ' . _('No updates have been performed') . '.<br />' . _('Effective after was') . ': ' . $_POST['EffectiveAfter'] . ' ' . _('and effective to was') . ': ' . $_POST['EffectiveTo'],'error'); $Errors[$i] = 'EffectiveAfter'; $i++; $Errors[$i] = 'EffectiveTo'; @@ -341,7 +335,7 @@ /*The component must already be on the BOM */ - prnMsg( _('The component') . ' ' . $_POST['Component'] . ' ' . _('is already recorded as a component of') . ' ' . $SelectedParent . '.' . '<br>' . _('Whilst the quantity of the component required can be modified it is inappropriate for a component to appear more than once in a bill of material'),'error'); + prnMsg( _('The component') . ' ' . $_POST['Component'] . ' ' . _('is already recorded as a component of') . ' ' . $SelectedParent . '.' . '<br />' . _('Whilst the quantity of the component required can be modified it is inappropriate for a component to appear more than once in a bill of material'),'error'); $Errors[$i]='ComponentCode'; } @@ -416,8 +410,8 @@ break; } - echo '<br><div class=centre><a href=' . $_SERVER['PHP_SELF'] . '?' . SID . '>' . _('Select a Different BOM') . '</a></div><br>'; - echo '<table class=selection>'; + echo '<br /><div class=centre><a href=' . $_SERVER['PHP_SELF'] . '?' . SID . '>' . _('Select a Different BOM') . '</a></div><br />'; + echo '<table class="selection">'; // Display Manufatured Parent Items $sql = "SELECT bom.parent, stockmaster.description, @@ -453,7 +447,7 @@ $DbgMsg = _('The SQL used to retrieve description of the parent part was'); $result=DB_query($sql,$db,$ErrMsg,$DbgMsg); if( DB_num_rows($result) > 0 ) { - echo (($reqnl)?'<br>':'').'<tr><td><div class="centre">'._('Assembly parent items').' : '; + echo (($reqnl)?'<br />':'').'<tr><td><div class="centre">'._('Assembly parent items').' : '; $ix = 0; while ($myrow = DB_fetch_array($result)){ echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?' . SID . 'Select='.$myrow['parent'].'">'. @@ -473,7 +467,7 @@ $DbgMsg = _('The SQL used to retrieve description of the parent part was'); $result=DB_query($sql,$db,$ErrMsg,$DbgMsg); if( DB_num_rows($result) > 0 ) { - echo (($reqnl)?'<br>':'').'<tr><td><div class="centre">'._('Kit sets').' : '; + echo (($reqnl)?'<br />':'').'<tr><td><div class="centre">'._('Kit sets').' : '; $ix = 0; while ($myrow = DB_fetch_array($result)){ echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?' . SID . 'Select='.$myrow['parent'].'">'. @@ -493,7 +487,7 @@ $DbgMsg = _('The SQL used to retrieve description of the parent part was'); $result=DB_query($sql,$db,$ErrMsg,$DbgMsg); if( DB_num_rows($result) > 0 ) { - echo (($reqnl)?'<br>':'').'<tr><td><div class="centre">'._('Phantom').' : '; + echo (($reqnl)?'<br />':'').'<tr><td><div class="centre">'._('Phantom').' : '; $ix = 0; while ($myrow = DB_fetch_array($result)){ echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?' . SID . 'Select='.$myrow['parent'].'">'. @@ -502,10 +496,11 @@ } //end while loop echo '</div></td></tr>'; } - echo "</table><br><table class=selection>"; - echo "<tr><th colspan=13><div class='centre'><font color=blue size=3><b>".$SelectedParent ." - " . $myrow[0] . ' ('. $MBdesc. ') </font></b></th></tr>'; + echo '</table> + <br /> + <table class="selection">'; + echo '<tr><th colspan=13><div class="centre"><font color=blue size=3><b>' . $SelectedParent .' - ' . $myrow[0] . ' ('. $MBdesc. ') </font></b></th></tr>'; - // *** POPAD&T $BOMTree = array(); //BOMTree is a 2 dimensional array with three elements for each item in the array - Level, Parent, Component //display children populates the BOM_Tree from the selected parent @@ -513,17 +508,17 @@ display_children($SelectedParent, 1, $BOMTree); $TableHeader = '<tr> - <th>' . _('Level') . '</th> - <th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Location') . '</th> - <th>' . _('Work Centre') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Effective After') . '</th> - <th>' . _('Effective To') . '</th> - <th>' . _('Auto Issue') . '</th> - <th>' . _('Qty On Hand') . '</th> - </tr>'; + <th>' . _('Level') . '</th> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Location') . '</th> + <th>' . _('Work Centre') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Effective After') . '</th> + <th>' . _('Effective To') . '</th> + <th>' . _('Auto Issue') . '</th> + <th>' . _('Qty On Hand') . '</th> + </tr>'; echo $TableHeader; if(count($BOMTree) == 0) { echo '<tr class="OddTableRows"><td colspan="8">'._('No materials found.').'</td></tr>'; @@ -546,12 +541,11 @@ DisplayBOMItems($UltimateParent, $Parent, $Component, $Level, $db); } } - // *** end POPAD&T - echo "</table><br>"; + echo '</table><br />'; if (! isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '&Select=' . $SelectedParent .'">'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?Select=' . $SelectedParent .'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($_GET['SelectedComponent']) and $InputError !=1) { @@ -577,24 +571,24 @@ $_POST['Quantity'] = $myrow['quantity']; $_POST['AutoIssue'] = $myrow['autoissue']; - prnMsg(_('Edit the details of the selected component in the fields below') . '. <br>' . _('Click on the Enter Information button to update the component details'),'info'); - echo "<br><input type=hidden name='SelectedParent' VALUE='$SelectedParent'>"; - echo "<input type=hidden name='SelectedComponent' VALUE='$SelectedComponent'>"; + prnMsg(_('Edit the details of the selected component in the fields below') . '. <br />' . _('Click on the Enter Information button to update the component details'),'info'); + echo '<br /> + <input type="hidden" name="SelectedParent" value="' . $SelectedParent . '" />'; + echo '<input type="hidden" name="SelectedComponent" value="' . $SelectedComponent . '" />'; echo '<table class=selection>'; - echo "<tr><th colspan=13><div class='centre'><font color=blue size=3><b>". ('Edit Component Details') .'</font></b></th></tr>'; + echo '<tr><th colspan=13><div class="centre"><font color=blue size=3><b>'. ('Edit Component Details') .'</font></b></th></tr>'; echo '<tr><td>' . _('Component') . ':</td><td><b>' . $SelectedComponent . '</b></td></tr>'; } else { //end of if $SelectedComponent - echo "<input type=hidden name='SelectedParent' VALUE='$SelectedParent'>"; - /* echo "Enter the details of a new component in the fields below. <br>Click on 'Enter Information' to add the new component, once all fields are completed."; + echo '<input type=hidden name="SelectedParent" value="' . $SelectedParent . '" />'; + /* echo "Enter the details of a new component in the fields below. <br />Click on 'Enter Information' to add the new component, once all fields are completed."; */ echo '<table class=selection>'; - echo "<tr><th colspan=13><div class='centre'><font color=blue size=3><b>". ('New Component Details') .'</font></b></th></tr>'; + echo '<tr><th colspan=13><div class="centre"><font color=blue size=3><b>' . ('New Component Details') .'</font></b></th></tr>'; echo '<tr><td>' . _('Component code') . ':</td><td>'; - echo "<select " . (in_array('ComponentCode',$Errors) ? 'class="selecterror"' : '' ) ." tabindex='1' name='Component'>"; + echo '<select ' . (in_array('ComponentCode',$Errors) ? 'class="selecterror"' : '' ) .' tabindex="1" name="Component">'; - if ($ParentMBflag=='A'){ /*Its an assembly */ $sql = "SELECT stockmaster.stockid, stockmaster.description @@ -627,64 +621,68 @@ while ($myrow = DB_fetch_array($result)) { - echo "<option VALUE=".$myrow['stockid'].'>' . str_pad($myrow['stockid'],21, '_', STR_PAD_RIGHT) . $myrow['description']; + echo '<option value="' .$myrow['stockid'].'">' . str_pad($myrow['stockid'],21, '_', STR_PAD_RIGHT) . $myrow['description'] . '</option>'; } //end while loop echo '</select></td></tr>'; } - echo "<tr><td>" . _('Location') . ": </td><td><select tabindex='2' name='LocCode'>"; + echo '<tr><td>' . _('Location') . ': </td> + <td><select tabindex="2" name="LocCode">'; DB_free_result($result); - $sql = 'SELECT locationname, loccode FROM locations'; + $sql = "SELECT locationname, loccode FROM locations"; $result = DB_query($sql,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['LocCode']) and $myrow['loccode']==$_POST['LocCode']) { - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option value="'; } - echo $myrow['loccode'] . "'>" . $myrow['locationname']; + echo $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } //end while loop DB_free_result($result); - echo "</select></td></tr><tr><td>" . _('Work Centre Added') . ": </td><td>"; - echo "<select tabindex='3' name='WorkCentreAdded'>"; + echo '</select></td> + </tr> + <tr><td>' . _('Work Centre Added') . ': </td> + <td><select tabindex="3" name="WorkCentreAdded">'; - $sql = 'SELECT code, description FROM workcentres'; + $sql = "SELECT code, description FROM workcentres"; $result = DB_query($sql,$db); if (DB_num_rows($result)==0){ prnMsg( _('There are no work centres set up yet') . '. ' . _('Please use the link below to set up work centres'),'warn'); - echo "<br><a href='$rootpath/WorkCentres.php?" . SID . "'>" . _('Work Centre Maintenance') . '</a>'; + echo '<br /><a href="' . $rootpath . '/WorkCentres.php">' . _('Work Centre Maintenance') . '</a>'; include('includes/footer.inc'); exit; } while ($myrow = DB_fetch_array($result)) { if (isset($_POST['WorkCentreAdded']) and $myrow['code']==$_POST['WorkCentreAdded']) { - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option value="'; } - echo $myrow['code'] . "'>" . $myrow['description']; + echo $myrow['code'] . '">' . $myrow['description'] . '</option>'; } //end while loop DB_free_result($result); - echo "</select></td></tr><tr><td>" . _('Quantity') . ": </td><td> - <input " . (in_array('Quantity',$Errors) ? 'class="inputerror"' : '' ) ." - tabindex='4' type='Text' class=number name='Quantity' class=number size=10 maxlength=8 value="; + echo '</select></td> + </tr> + <tr><td>' . _('Quantity') . ': </td> + <td><input ' . (in_array('Quantity',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="4" type="text" class="number" name="Quantity" class="number" size="10" maxlength="8" value="'; if (isset($_POST['Quantity'])){ echo $_POST['Quantity']; } else { echo 1; } - echo "></td></tr>"; + echo '"></td></tr>'; if (!isset($_POST['EffectiveTo']) OR $_POST['EffectiveTo']=='') { $_POST['EffectiveTo'] = Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,Date('m'),Date('d'),(Date('y')+20))); @@ -693,12 +691,10 @@ $_POST['EffectiveAfter'] = Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))); } - echo "<tr><td>" . _('Effective After') . " (" . $_SESSION['DefaultDateFormat'] . "):</td> - <td><input " . (in_array('EffectiveAfter',$Errors) ? 'class="inputerror"' : '' ) . - " tabindex='5' type='Text' name='EffectiveAfter' class=date alt='".$_SESSION['DefaultDateFormat']."' size=11 maxlength=10 VALUE=" . $_POST['EffectiveAfter'] ."> - </td></tr><tr><td>" . _('Effective To') . " (" . $_SESSION['DefaultDateFormat'] . "):</td><td> - <input " . (in_array('EffectiveTo',$Errors) ? 'class="inputerror"' : '' ) . - " tabindex='6' type='Text' name='EffectiveTo' class=date alt='".$_SESSION['DefaultDateFormat']."' size=11 maxlength=10 VALUE=" . $_POST['EffectiveTo'] ."></td></tr>"; + echo '<tr><td>' . _('Effective After') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> + <td><input ' . (in_array('EffectiveAfter',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="5" type="text" name="EffectiveAfter" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" size="11" maxlength="10" value="' . $_POST['EffectiveAfter'] .'"></td></tr> + <tr><td>' . _('Effective To') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> + <td><input ' . (in_array('EffectiveTo',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="6" type="text" name="EffectiveTo" class="date" alt="' .$_SESSION['DefaultDateFormat'] . '" size="11" maxlength="10" value="' . $_POST['EffectiveTo'] .'"></td></tr>'; if ($ParentMBflag=='M' OR $ParentMBflag=='G'){ echo '<tr><td>' . _('Auto Issue this Component to Work Orders') . ':</td> @@ -709,20 +705,21 @@ $_POST['AutoIssue'] = $_SESSION['AutoIssue']; } if ($_POST['AutoIssue']==0) { - echo '<option selected VALUE=0>' . _('No'); - echo '<option VALUE=1>' . _('Yes'); + echo '<option selected value="0">' . _('No') . '</option>'; + echo '<option value="1">' . _('Yes') . '</option>'; } else { - echo '<option selected VALUE=1>' . _('Yes'); - echo '<option VALUE=0>' . _('No'); + echo '<option selected value="1">' . _('Yes') . '</option>'; + echo '<option value="0">' . _('No') . '</option>'; } echo '</select></td></tr>'; } else { - echo '<input type=hidden name="AutoIssue" VALUE=0>'; + echo '<input type=hidden name="AutoIssue" value="0">'; } - echo "</table><br><div class='centre'><input tabindex='8' type='Submit' name='Submit' value='" . _('Enter Information') . "'></form></div>"; + echo '</table> + <br /><div class="centre"><input tabindex="8" type="submit" name="Submit" value="' . _('Enter Information') . '"></form></div>'; } //end if record deleted no point displaying form to add record @@ -791,26 +788,32 @@ if (!isset($SelectedParent)) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="">' . ' ' . $title; - echo "<form action=" . $_SERVER['PHP_SELF'] . "?" . SID ." method=post>" . + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . '<div class="page_help_text">'. _('Select a manufactured part') . " (" . _('or Assembly or Kit part') . ") " . - _('to maintain the bill of material for using the options below') . "." . "<br><font size=1>" . - _('Parts must be defined in the stock item entry') . "/" . _('modification screen as manufactured') . - ", " . _('kits or assemblies to be available for construction of a bill of material') .'</div>'. - "</font><br><table class=selection cellpadding=3 colspan=4><tr><td><font size=1>" . _('Enter text extracts in the') . - " <b>" . _('description') . "</b>:</font></td><td><input tabindex='1' type='Text' name='Keywords' size=20 maxlength=25></td> - <td><font size=3><b>" . _('OR') . "</b></font></td><td><font size=1>" . _('Enter extract of the') . - " <b>" . _('Stock Code') . "</b>:</font></td><td><input tabindex='2' type='Text' name='StockCode' size=15 maxlength=18></td> - </tr></table><br><div class='centre'><input tabindex='3' type=submit name='Search' VALUE=" . _('Search Now') . "></div>"; + _('to maintain the bill of material for using the options below') . '<br /><font size=1>' . + _('Parts must be defined in the stock item entry') . '/' . _('modification screen as manufactured') . + ', ' . _('kits or assemblies to be available for construction of a bill of material') .'</div>'. + '</font> + <br /> + <table class="selection" cellpadding="3" colspan="4"> + <tr><td><font size=1>' . _('Enter text extracts in the') . ' <b>' . _('description') . '</b>:</font></td> + <td><input tabindex="1" type="text" name="Keywords" size="20" maxlength="25"></td> + <td><font size=3><b>' . _('OR') . '</b></font></td> + <td><font size=1>' . _('Enter extract of the') . ' <b>' . _('Stock Code') . '</b>:</font></td> + <td><input tabindex="2" type="text" name="StockCode" size="15" maxlength="18"></td> + </tr> + </table> + <br /><div class="centre"><input tabindex="3" type="submit" name="Search" value="' . _('Search Now') . '"></div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($_POST['Search']) and isset($result) AND !isset($SelectedParent)) { - echo '<br><table cellpadding=2 colspan=7 class=selection>'; + echo '<br /><table cellpadding=2 colspan=7 class=selection>'; $TableHeader = '<tr><th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('On Hand') . '</th> - <th>' . _('Units') . '</th> - </tr>'; + <th>' . _('Description') . '</th> + <th>' . _('On Hand') . '</th> + <th>' . _('Units') . '</th> + </tr>'; echo $TableHeader; @@ -830,15 +833,14 @@ $StockOnHand = number_format($myrow['totalonhand'],2); } $tab = $j+3; - printf("<td><input tabindex='".$tab."' type=submit name='Select' VALUE='%s'</td> + printf('<td><input tabindex="' . $tab . '" type="submit" name="Select" value="%s"</td> <td>%s</td> <td class=number>%s</td> - <td>%s</td></tr>", + <td>%s</td></tr>', $myrow['stockid'], $myrow['description'], $StockOnHand, - $myrow['units'] - ); + $myrow['units']); $j++; //end of page full new headings if @@ -851,12 +853,12 @@ //end if results to show if (!isset($SelectedParent) or $SelectedParent=='') { - echo "<script>defaultControl(document.forms[0].StockCode);</script>"; + echo '<script>defaultControl(document.forms[0].StockCode);</script>'; } else { - echo "<script>defaultControl(document.form.JournalProcessDate);</script>"; + echo '<script>defaultControl(document.form.JournalProcessDate);</script>'; } -echo "</form>"; +echo '</form>'; } //end StockID already selected Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/BankAccounts.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.21 $ */ + /* $Id$*/ -//$PageSecurity = 10; - include('includes/session.inc'); $title = _('Bank Accounts Maintenance'); @@ -11,7 +9,7 @@ include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Bank') . '" alt="" />' . ' ' . $title . '</p>'; - echo '<div class="page_help_text">' . _('Update Bank Account details. Account Code is for SWIFT or BSB type Bank Codes. Set Default for Invoices to "yes" to print Account details on Invoices (only one account can be set to "yes").') . '.</div><br>'; +echo '<div class="page_help_text">' . _('Update Bank Account details. Account Code is for SWIFT or BSB type Bank Codes. Set Default for Invoices to "yes" to print Account details on Invoices (only one account can be set to "yes").') . '.</div><br />'; if (isset($_GET['SelectedBankAccount'])) { $SelectedBankAccount=$_GET['SelectedBankAccount']; @@ -85,23 +83,21 @@ $sql = "SELECT * FROM banktrans WHERE bankact='" . $SelectedBankAccount . "'"; $BankTransResult = DB_query($sql,$db); if (DB_num_rows($BankTransResult)>0) { - $sql = "UPDATE bankaccounts - SET bankaccountname='" . $_POST['BankAccountName'] . "', - bankaccountcode='" . $_POST['BankAccountCode'] . "', - bankaccountnumber='" . $_POST['BankAccountNumber'] . "', - bankaddress='" . $_POST['BankAddress'] . "', - invoice ='" . $_POST['DefAccount'] . "' - WHERE accountcode = '" . $SelectedBankAccount . "'"; + $sql = "UPDATE bankaccounts SET bankaccountname='" . $_POST['BankAccountName'] . "', + bankaccountcode='" . $_POST['BankAccountCode'] . "', + bankaccountnumber='" . $_POST['BankAccountNumber'] . "', + bankaddress='" . $_POST['BankAddress'] . "', + invoice ='" . $_POST['DefAccount'] . "' + WHERE accountcode = '" . $SelectedBankAccount . "'"; prnMsg(_('Note that it is not possible to change the currency of the account once there are transactions against it'),'warn'); - echo '<br>'; + echo '<br />'; } else { - $sql = "UPDATE bankaccounts - SET bankaccountname='" . $_POST['BankAccountName'] . "', - bankaccountcode='" . $_POST['BankAccountCode'] . "', - bankaccountnumber='" . $_POST['BankAccountNumber'] . "', - bankaddress='" . $_POST['BankAddress'] . "', - currcode ='" . $_POST['CurrCode'] . "', - invoice ='" . $_POST['DefAccount'] . "' + $sql = "UPDATE bankaccounts SET bankaccountname='" . $_POST['BankAccountName'] . "', + bankaccountcode='" . $_POST['BankAccountCode'] . "', + bankaccountnumber='" . $_POST['BankAccountNumber'] . "', + bankaddress='" . $_POST['BankAddress'] . "', + currcode ='" . $_POST['CurrCode'] . "', + invoice ='" . $_POST['DefAccount'] . "' WHERE accountcode = '" . $SelectedBankAccount . "'"; } @@ -110,22 +106,20 @@ /*Selectedbank account is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new bank account form */ - $sql = "INSERT INTO bankaccounts ( - accountcode, - bankaccountname, - bankaccountcode, - bankaccountnumber, - bankaddress, - currcode, - invoice) - VALUES ('" . $_POST['AccountCode'] . "', - '" . $_POST['BankAccountName'] . "', - '" . $_POST['BankAccountCode'] . "', - '" . $_POST['BankAccountNumber'] . "', - '" . $_POST['BankAddress'] . "', - '" . $_POST['CurrCode'] . "', - '" . $_POST['DefAccount'] . "' - )"; + $sql = "INSERT INTO bankaccounts (accountcode, + bankaccountname, + bankaccountcode, + bankaccountnumber, + bankaddress, + currcode, + invoice) + VALUES ('" . $_POST['AccountCode'] . "', + '" . $_POST['BankAccountName'] . "', + '" . $_POST['BankAccountCode'] . "', + '" . $_POST['BankAccountNumber'] . "', + '" . $_POST['BankAddress'] . "', + '" . $_POST['CurrCode'] . "', + '" . $_POST['DefAccount'] . "' )"; $msg = _('The new bank account has been entered'); } @@ -136,7 +130,7 @@ $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); prnMsg($msg,'success'); - echo '<br>'; + echo '<br />'; unset($_POST['AccountCode']); unset($_POST['BankAccountName']); unset($_POST['BankAccountNumber']); @@ -160,7 +154,7 @@ if ($myrow[0]>0) { $CancelDelete = 1; prnMsg(_('Cannot delete this bank account because transactions have been created using this account'),'warn'); - echo '<br> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions with this bank account code'); + echo '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions with this bank account code'); } if (!$CancelDelete) { @@ -188,19 +182,20 @@ WHERE bankaccounts.accountcode = chartmaster.accountcode"; $ErrMsg = _('The bank accounts set up could not be retrieved because'); - $DbgMsg = _('The SQL used to retrieve the bank account details was') . '<br>' . $sql; + $DbgMsg = _('The SQL used to retrieve the bank account details was') . '<br />' . $sql; $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); echo '<table class="selection">'; - echo "<tr><th>" . _('GL Account Code') . "</th> - <th>" . _('Bank Account Name') . "</th> - <th>" . _('Bank Account Code') . "</th> - <th>" . _('Bank Account Number') . "</th> - <th>" . _('Bank Address') . "</th> - <th>" . _('Currency') . "</th> - <th>" . _('Default for Invoices') . "</th> - </tr>"; + echo '<tr> + <th>' . _('GL Account Code') . '</th> + <th>' . _('Bank Account Name') . '</th> + <th>' . _('Bank Account Code') . '</th> + <th>' . _('Bank Account Number') . '</th> + <th>' . _('Bank Address') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Default for Invoices') . '</th> + </tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_row($result)) { @@ -216,16 +211,16 @@ } else { $defacc=_('Yes'); } - printf("<td>%s<br><font size=2>%s</font></td> + printf('<td>%s<br /><font size=2>%s</font></td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> - <td><a href=\"%s?SelectedBankAccount=%s\">" . _('Edit') . "</td> - <td><a href=\"%s?SelectedBankAccount=%s&delete=1\">" . _('Delete') . "</td> - </tr>", + <td><a href="%s?SelectedBankAccount=%s">' . _('Edit') . '</td> + <td><a href="%s?SelectedBankAccount=%s&delete=1">' . _('Delete') . '</td> + </tr>', $myrow[0], $myrow[2], $myrow[3], @@ -364,12 +359,13 @@ } }//end while loop } else { - echo '<option VALUE=1>'._('Yes').'</option><option value=0>'._('No').'</option>'; + echo '<option value="1">'._('Yes').'</option> + <option value="0">'._('No').'</option>'; } echo '</select></td>'; -echo '</tr></table><br> +echo '</tr></table><br /> <div class="centre"><input tabindex="7" type="Submit" name="submit" value="'. _('Enter Information') .'"></div>'; echo '</form>'; Modified: trunk/Logout.php =================================================================== --- trunk/Logout.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/Logout.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -23,7 +23,7 @@ <?php echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; ?> - <label><?php echo _('Thank you for using webERP'); ?></label> + <span><?php echo _('Thank you for using webERP'); ?></span> <br /> <input class="button" type="submit" value="<?php echo _('Login'); ?>" name="SubmitUser" /> </form> Modified: trunk/PageSecurity.php =================================================================== --- trunk/PageSecurity.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/PageSecurity.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -13,17 +13,17 @@ if (isset($_POST['Update'])) { foreach ($_POST as $ScriptName => $PageSecurityValue) { if ($ScriptName!='Update' and $ScriptName!='FormID') { - //$key=substr($key, 0, strlen($key)-4).'.php'; + $ScriptName=substr($ScriptName, 0, strlen($Sc... [truncated message content] |
From: <dai...@us...> - 2011-05-01 09:45:27
|
Revision: 4559 http://web-erp.svn.sourceforge.net/web-erp/?rev=4559&view=rev Author: daintree Date: 2011-05-01 09:45:18 +0000 (Sun, 01 May 2011) Log Message: ----------- quoting Modified Paths: -------------- trunk/AccountSections.php trunk/AgedDebtors.php trunk/AuditTrail.php trunk/BOMIndented.php trunk/BOMListing.php trunk/BOMs.php trunk/BankAccounts.php trunk/Logout.php trunk/PageSecurity.php trunk/SecurityTokens.php trunk/StockTransferControlled.php trunk/StockUsage.php trunk/SuppTransGLAnalysis.php trunk/SupplierContacts.php trunk/SupplierInquiry.php trunk/SupplierTypes.php trunk/TaxGroups.php trunk/WorkOrderCosting.php trunk/Z_CheckDebtorsControl.php trunk/css/default/login.css trunk/css/fresh/login.css trunk/css/gel/login.css trunk/css/jelly/login.css trunk/css/professional/login.css trunk/css/professional-rtl/login.css trunk/css/silverwolf/login.css trunk/doc/Change.log.html trunk/includes/Login.php trunk/index.php Modified: trunk/AccountSections.php =================================================================== --- trunk/AccountSections.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/AccountSections.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.7 $ */ + /* $Id$*/ -//$PageSecurity = 10; - include('includes/session.inc'); $title = _('Account Sections'); @@ -136,7 +134,7 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg( _('Cannot delete this account section because general ledger accounts groups have been created using this section'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('general ledger accounts groups that refer to this account section') . '</font>'; + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('general ledger accounts groups that refer to this account section') . '</font>'; } else { //Fetch section name @@ -176,11 +174,11 @@ $result = DB_query($sql,$db,$ErrMsg); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo "<table name='SectionList' class='selection'> + echo '<table name="SectionList" class="selection"> <tr> - <th>" . _('Section Number') . "</th> - <th>" . _('Section Description') . "</th> - </tr>"; + <th>' . _('Section Number') . '</th> + <th>' . _('Section Description') . '</th> + </tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_row($result)) { @@ -194,11 +192,11 @@ } echo '<td>' . $myrow[0] . '</td><td>' . $myrow[1] . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedSectionID=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedSectionID=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; if ( $myrow[0] == '1' || $myrow[0] == '2' ) { echo '<td><b>'._('Restricted').'</b></td>'; } else { - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedSectionID=' . $myrow[0] . '&delete=1">' . _('Delete') .'</a></td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedSectionID=' . $myrow[0] . '&delete=1">' . _('Delete') .'</a></td>'; } echo '</tr>'; } //END WHILE LIST LOOP @@ -207,12 +205,12 @@ if (isset($_POST['SelectedSectionID']) or isset($_GET['SelectedSectionID'])) { - echo '<div class="centre"><a href=' . $_SERVER['PHP_SELF'] . '?' . SID .'>' . _('Review Account Sections') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Account Sections') . '</a></div>'; } if (! isset($_GET['delete'])) { - echo "<form method='post' name='AccountSections' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; + echo '<form method="post" name="AccountSections" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($_GET['SelectedSectionID'])) { @@ -233,10 +231,12 @@ $_POST['SectionID'] = $myrow['sectionid']; $_POST['SectionName'] = $myrow['sectionname']; - echo "<input type=hidden name='SelectedSectionID' value='" . $_POST['SectionID'] . "'>"; - echo "<table class=selection> - <td>" . _('Section Number') . ':' . "</td> - <td>" . $_POST['SectionID'] . "</td>"; + echo '<input type=hidden name="SelectedSectionID" value="' . $_POST['SectionID'] . '" />'; + echo '<table class="selection"> + <tr> + <td>' . _('Section Number') . ':' . '</td> + <td>' . $_POST['SectionID'] . '</td> + </tr>'; } } else { @@ -250,22 +250,23 @@ if (!isset($_POST['SectionName'])) { $_POST['SectionName']=''; } - echo "<table class='selection'> + echo '<table class="selection"> <tr> - <td>" . _('Section Number') . ':' . '</td> - <td><input tabindex="1" ' . (in_array('SectionID',$Errors) ? 'class="inputerror"' : '' ) ." type='text' name='SectionID' class='number' size='4' maxlength='4' value='" . $_POST['SectionID'] . "' /></td></tr>"; + <td>' . _('Section Number') . ':' . '</td> + <td><input tabindex="1" ' . (in_array('SectionID',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="SectionID" class="number" size="4" maxlength="4" value="' . $_POST['SectionID'] . '" /></td> + </tr>'; } - echo "<tr><td>" . _('Section Description') . ':' . '</td> - <td><input tabindex="2" ' . (in_array('SectionName',$Errors) ? 'class="inputerror"' : '' ) ." type='text' name='SectionName' size='30' maxlength='30' value='" . $_POST['SectionName'] . "' /></td> - </tr>"; + echo '<tr><td>' . _('Section Description') . ':' . '</td> + <td><input tabindex="2" ' . (in_array('SectionName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="SectionName" size="30" maxlength="30" value="' . $_POST['SectionName'] . '" /></td> + </tr>'; echo '<tr><td colspan="2"><div class="centre"><input tabindex="3" type="submit" name="submit" value="' . _('Enter Information') . '" /></div></td></tr>'; echo '</table><br />'; if (!isset($_GET['SelectedSectionID']) or $_GET['SelectedSectionID']=='') { - echo "<script>defaultControl(document.AccountSections.SectionID);</script>"; + echo '<script>defaultControl(document.AccountSections.SectionID);</script>'; } else { - echo "<script>defaultControl(document.AccountSections.SectionName);</script>"; + echo '<script>defaultControl(document.AccountSections.SectionName);</script>'; } echo '</form>'; Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/AgedDebtors.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -2,9 +2,6 @@ /* $Id$ */ -/* $Revision: 1.20 $ */ - -//$PageSecurity = 2; include('includes/session.inc'); if (isset($_POST['PrintPDF']) @@ -22,7 +19,7 @@ /*Now figure out the aged analysis for the customer range under review */ if (trim($_POST['Salesman'])!=''){ - $SalesLimit = " and debtorsmaster.debtorno in (SELECT DISTINCT debtorno FROM custbranch where salesman = '".$_POST['Salesman']."') "; + $SalesLimit = " AND debtorsmaster.debtorno IN (SELECT DISTINCT debtorno FROM custbranch where salesman = '".$_POST['Salesman']."') "; } else { $SalesLimit = ""; } @@ -30,6 +27,7 @@ $SQL = "SELECT debtorsmaster.debtorno, debtorsmaster.name, currencies.currency, + currencies.decimalplaces, paymentterms.terms, debtorsmaster.creditlimit, holdreasons.dissallowinvoices, @@ -86,6 +84,7 @@ GROUP BY debtorsmaster.debtorno, debtorsmaster.name, currencies.currency, + currencies.decimalplaces, paymentterms.terms, paymentterms.daysbeforedue, paymentterms.dayinfollowingmonth, @@ -100,6 +99,7 @@ $SQL = "SELECT debtorsmaster.debtorno, debtorsmaster.name, currencies.currency, + currencies.decimalplaces, paymentterms.terms, debtorsmaster.creditlimit, holdreasons.dissallowinvoices, @@ -158,6 +158,7 @@ GROUP BY debtorsmaster.debtorno, debtorsmaster.name, currencies.currency, + currencies.decimalplaces, paymentterms.terms, paymentterms.daysbeforedue, paymentterms.dayinfollowingmonth, @@ -182,6 +183,7 @@ $SQL = "SELECT debtorsmaster.debtorno, debtorsmaster.name, currencies.currency, + currencies.decimalplaces, paymentterms.terms, debtorsmaster.creditlimit, holdreasons.dissallowinvoices, @@ -245,6 +247,7 @@ GROUP BY debtorsmaster.debtorno, debtorsmaster.name, currencies.currency, + currencies.decimalplaces, paymentterms.terms, paymentterms.daysbeforedue, paymentterms.dayinfollowingmonth, @@ -267,9 +270,9 @@ $title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '.... '; include('includes/header.inc'); echo '<p>' . _('The customer details could not be retrieved by the SQL because') . ' ' . DB_error_msg($db); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$SQL"; + echo '<br />' . $SQL; } include('includes/footer.inc'); exit; @@ -283,16 +286,17 @@ $TotOD1=0; $TotOD2=0; - $ListCount = DB_num_rows($CustomerResult); //UldisN - + $ListCount = DB_num_rows($CustomerResult); + $DecimalPlaces =2; //by default + while ($AgedAnalysis = DB_fetch_array($CustomerResult,$db)){ + $DecimalPlaces = $AgedAnalysis['decimalplaces']; + $DisplayDue = number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$DecimalPlaces); + $DisplayCurrent = number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$DecimalPlaces); + $DisplayBalance = number_format($AgedAnalysis['balance'],$DecimalPlaces); + $DisplayOverdue1 = number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$DecimalPlaces); + $DisplayOverdue2 = number_format($AgedAnalysis['overdue2'],$DecimalPlaces); - $DisplayDue = number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],2); - $DisplayCurrent = number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],2); - $DisplayBalance = number_format($AgedAnalysis['balance'],2); - $DisplayOverdue1 = number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],2); - $DisplayOverdue2 = number_format($AgedAnalysis['overdue2'],2); - $TotBal += $AgedAnalysis['balance']; $TotDue += ($AgedAnalysis['due']-$AgedAnalysis['overdue1']); $TotCurr += ($AgedAnalysis['balance']-$AgedAnalysis['due']); @@ -364,10 +368,10 @@ if (DB_error_no($db) !=0) { $title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); - echo '<br><br>' . _('The details of outstanding transactions for customer') . ' - ' . $AgedAnalysis['debtorno'] . ' ' . _('could not be retrieved because') . ' - ' . DB_error_msg($db); - echo "<br><a href='$rootpath/index.php'>" . _('Back to the menu') . '</a>'; + echo '<br /><br />' . _('The details of outstanding transactions for customer') . ' - ' . $AgedAnalysis['debtorno'] . ' ' . _('could not be retrieved because') . ' - ' . DB_error_msg($db); + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo '<br>' . _('The SQL that failed was') . '<p>' . $sql; + echo '<br />' . _('The SQL that failed was') . '<p>' . $sql; } include('includes/footer.inc'); exit; @@ -380,11 +384,11 @@ $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); $LeftOvers = $pdf->addTextWrap($Left_Margin+125,$YPos,75,$FontSize,$DisplayTranDate,'left'); - $DisplayDue = number_format($DetailTrans['due']-$DetailTrans['overdue1'],2); - $DisplayCurrent = number_format($DetailTrans['balance']-$DetailTrans['due'],2); - $DisplayBalance = number_format($DetailTrans['balance'],2); - $DisplayOverdue1 = number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],2); - $DisplayOverdue2 = number_format($DetailTrans['overdue2'],2); + $DisplayDue = number_format($DetailTrans['due']-$DetailTrans['overdue1'],$DecimalPlaces); + $DisplayCurrent = number_format($DetailTrans['balance']-$DetailTrans['due'],$DecimalPlaces); + $DisplayBalance = number_format($DetailTrans['balance'],$DecimalPlaces); + $DisplayOverdue1 = number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$DecimalPlaces); + $DisplayOverdue2 = number_format($DetailTrans['overdue2'],$DecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); @@ -414,11 +418,11 @@ $pdf->line($Page_Width-$Right_Margin, $YPos+10 ,220, $YPos+10); } - $DisplayTotBalance = number_format($TotBal,2); - $DisplayTotDue = number_format($TotDue,2); - $DisplayTotCurrent = number_format($TotCurr,2); - $DisplayTotOverdue1 = number_format($TotOD1,2); - $DisplayTotOverdue2 = number_format($TotOD2,2); + $DisplayTotBalance = number_format($TotBal,$DecimalPlaces); + $DisplayTotDue = number_format($TotDue,$DecimalPlaces); + $DisplayTotCurrent = number_format($TotCurr,$DecimalPlaces); + $DisplayTotOverdue1 = number_format($TotOD1,$DecimalPlaces); + $DisplayTotOverdue2 = number_format($TotOD2,$DecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayTotCurrent,'right'); @@ -426,12 +430,6 @@ $LeftOvers = $pdf->addTextWrap(400,$YPos,60,$FontSize,$DisplayTotOverdue1,'right'); $LeftOvers = $pdf->addTextWrap(460,$YPos,60,$FontSize,$DisplayTotOverdue2,'right'); -/* Javier: This actually would produce the output - $buf = $pdf->output(); - $len = strlen($buf); -*/ - -// if ($len < 1000) { if ($ListCount == 0) { $title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); @@ -439,26 +437,14 @@ if ($debug==1){ prnMsg($SQL,'info'); } - echo "<br><a href='$rootpath/index.php'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; + } else { + $pdf->OutputD($_SESSION['DatabaseName'] . '_' . 'AgedDebtors_' . date('Y-m-d') . '.pdf'); + $pdf-> __destruct(); } -/* Javier: TCPDF sends its own http header, would be an error to send it twice. - header('Content-type: application/pdf'); - header("Content-Length: $len"); - header('Content-Disposition: inline; filename=AgedDebtors.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - $pdf->stream(); */ - -// This else was missed - else { - $pdf->OutputD($_SESSION['DatabaseName'] . '_' . 'AgedDebtors_' . date('Y-m-d') . '.pdf'); - $pdf-> __destruct(); - } - } else { /*The option to print PDF was not hit */ $title=_('Aged Debtor Analysis'); @@ -471,56 +457,64 @@ /*if $FromCriteria is not set then show a form to allow input */ - echo '<form action=' . $_SERVER['PHP_SELF'] . " method='post'><table>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + <table>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('From Customer Code') . ':' . "</font></td><td><input tabindex='1' Type=text maxlength=6 size=7 name=FromCriteria value='0'></td></tr>"; - echo '<tr><td>' . _('To Customer Code') . ':' . "</td><td><input tabindex='2' Type=text maxlength=6 size=7 name=ToCriteria value='zzzzzz'></td></tr>"; + echo '<tr><td>' . _('From Customer Code') . ':' . '</font></td> + <td><input tabindex="1" type="text" maxlength="6" size="7" name="FromCriteria" value="0"></td> + </tr>'; + echo '<tr><td>' . _('To Customer Code') . ':' . '</td> + <td><input tabindex="2" type="text" maxlength="6" size="7" name="ToCriteria" value="zzzzzz" /></td> + </tr>'; - echo '<tr><td>' . _('All balances or overdues only') . ':' . "</td><td><select tabindex='3' name='All_Or_Overdues'>"; - echo "<option selected Value='All'>" . _('All customers with balances'); - echo "<option Value='OverduesOnly'>" . _('Overdue accounts only'); - echo "<option Value='HeldOnly'>" . _('Held accounts only'); - echo '</select></td></tr>'; + echo '<tr><td>' . _('All balances or overdues only') . ':' . '</td> + <td><select tabindex="3" name="All_Or_Overdues"> + <option selected value="All">' . _('All customers with balances') . '</option> + <option value="OverduesOnly">' . _('Overdue accounts only') . '</option> + <option value="HeldOnly">' . _('Held accounts only') . '</option> + </select> + </td> + </tr>'; - echo '<tr><td>' . _('Only Show Customers Of') . ':' . "</td><td><select tabindex='4' name='Salesman'>"; + echo '<tr><td>' . _('Only Show Customers Of') . ':' . '</td> + <td><select tabindex="4" name="Salesman">'; - $sql = 'SELECT salesmancode, salesmanname FROM salesman'; + $sql = "SELECT salesmancode, salesmanname FROM salesman"; $result=DB_query($sql,$db); - echo "<option value=''></option>"; + echo '<option value=""></option>'; while ($myrow=DB_fetch_array($result)){ - echo "<option value='" . $myrow['salesmancode'] . "'>" . $myrow['salesmanname']; + echo '<option value="' . $myrow['salesmancode'] . '">' . $myrow['salesmanname'] . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('Only show customers trading in') . ':' . "</td><td><select tabindex='5' name='Currency'>"; + echo '<tr><td>' . _('Only show customers trading in') . ':' . '</td> + <td><select tabindex="5" name="Currency">'; - $sql = 'SELECT currency, currabrev FROM currencies'; + $sql = "SELECT currency, currabrev FROM currencies"; $result=DB_query($sql,$db); - - while ($myrow=DB_fetch_array($result)){ if ($myrow['currabrev'] == $_SESSION['CompanyRecord']['currencydefault']){ - echo "<option selected value='" . $myrow['currabrev'] . "'>" . $myrow['currency']; + echo '<option selected value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; } else { - echo "<option value='" . $myrow['currabrev'] . "'>" . $myrow['currency']; + echo '<option value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; } } echo '</select></td></tr>'; - echo '<tr><td>' . _('Summary or detailed report') . ':' . "</td> - <td><select tabindex='6' name='DetailedReport'>"; - echo "<option selected value='No'>" . _('Summary Report'); - echo "<option value='Yes'>" . _('Detailed Report'); - echo '</select></td></tr>'; + echo '<tr><td>' . _('Summary or detailed report') . ':' . '</td> + <td><select tabindex="6" name="DetailedReport"> + <option selected value="No">' . _('Summary Report') . '</option> + <option value="Yes">' . _('Detailed Report') . '</option> + </select> + </td> + </tr>'; - echo '</table><br><div class="centre"><input tabindex="7" type=submit name="PrintPDF" value="' . _('Print PDF') , '"></div>'; + echo '</table><br /><div class="centre"><input tabindex="7" type=submit name="PrintPDF" value="' . _('Print PDF') , '"></div>'; } include('includes/footer.inc'); - } /*end of else not PrintPDF */ - -?> +?> \ No newline at end of file Modified: trunk/AuditTrail.php =================================================================== --- trunk/AuditTrail.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/AuditTrail.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -40,18 +40,19 @@ // Show user selections echo '<tr><td>'. _('User ID'). '</td> <td><select tabindex="3" name="SelectedUser">'; -echo '<option value=ALL>ALL'; +echo '<option value="ALL">' . _('ALL') . '</option>'; while ($users = DB_fetch_row($UserResult)) { if (isset($_POST['SelectedUser']) and $users[0]==$_POST['SelectedUser']) { - echo '<option selected value=' . $users[0] . '>' . $users[0] . '</option>'; + echo '<option selected value="' . $users[0] . '">' . $users[0] . '</option>'; } else { - echo '<option value=' . $users[0] . '>' . $users[0] . '</option>'; + echo '<option value="' . $users[0] . '">' . $users[0] . '</option>'; } } echo '</select></td></tr>'; // Show table selections -echo '<tr><td>'. _('Table '). '</td><td><select tabindex="4" name="SelectedTable">'; +echo '<tr><td>'. _('Table '). '</td> + <td><select tabindex="4" name="SelectedTable">'; echo '<option value="ALL">' . _('ALL') . '</option>'; while ($tables = DB_fetch_row($TableResult)) { if (isset($_POST['SelectedTable']) and $tables[0]==$_POST['SelectedTable']) { Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/BOMIndented.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -15,19 +15,19 @@ $PageNumber=1; $line_height=12; - $sql = 'DROP TABLE IF EXISTS tempbom'; + $sql = "DROP TABLE IF EXISTS tempbom"; $result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS passbom'; + $sql = "DROP TABLE IF EXISTS passbom"; $result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS passbom2'; + $sql = "DROP TABLE IF EXISTS passbom2"; $result = DB_query($sql,$db); - $sql = 'CREATE TEMPORARY TABLE passbom ( + $sql = "CREATE TEMPORARY TABLE passbom ( part char(20), - sortpart text) DEFAULT CHARSET=utf8'; + sortpart text) DEFAULT CHARSET=utf8"; $ErrMsg = _('The SQL to create passbom failed with the message'); $result = DB_query($sql,$db,$ErrMsg); - $sql = 'CREATE TEMPORARY TABLE tempbom ( + $sql = "CREATE TEMPORARY TABLE tempbom ( parent char(20), component char(20), sortpart text, @@ -36,7 +36,7 @@ loccode char(5), effectiveafter date, effectiveto date, - quantity double) DEFAULT CHARSET=utf8'; + quantity double) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db,_('Create of tempbom failed because')); // First, find first level of components below requested assembly // Put those first level parts in passbom, use COMPONENT in passbom @@ -112,32 +112,32 @@ AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS passbom2'; + $sql = "DROP TABLE IF EXISTS passbom2"; $result = DB_query($sql,$db); - $sql = 'ALTER TABLE passbom RENAME AS passbom2'; + $sql = "ALTER TABLE passbom RENAME AS passbom2"; $result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS passbom'; + $sql = "DROP TABLE IF EXISTS passbom"; $result = DB_query($sql,$db); - $sql = 'CREATE TEMPORARY TABLE passbom ( - part char(20), - sortpart text) DEFAULT CHARSET=utf8'; + $sql = "CREATE TEMPORARY TABLE passbom ( + part char(20), + sortpart text) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db); - $sql = 'INSERT INTO passbom (part, sortpart) + $sql = "INSERT INTO passbom (part, sortpart) SELECT bom.component AS part, CONCAT(passbom2.sortpart,bom.component) AS sortpart FROM bom,passbom2 WHERE bom.parent = passbom2.part AND bom.effectiveto >= NOW() - AND bom.effectiveafter <= NOW()'; + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); - $sql = 'SELECT COUNT(*) FROM bom,passbom WHERE bom.parent = passbom.part'; + $sql = "SELECT COUNT(*) FROM bom,passbom WHERE bom.parent = passbom.part"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -150,9 +150,9 @@ $title = _('Indented BOM Listing') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The Indented BOM Listing could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); - echo "<br><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$sql"; + echo '<br />' . $sql; } include('includes/footer.inc'); exit; @@ -172,12 +172,12 @@ $Right_Margin,$assemblydesc); $Tot_Val=0; - $sql = 'SELECT tempbom.*, - stockmaster.description, - stockmaster.mbflag - FROM tempbom,stockmaster - WHERE tempbom.component = stockmaster.stockid - ORDER BY sortpart'; + $sql = "SELECT tempbom.*, + stockmaster.description, + stockmaster.mbflag + FROM tempbom,stockmaster + WHERE tempbom.component = stockmaster.stockid + ORDER BY sortpart"; $result = DB_query($sql,$db); // $fill is used to alternate between lines with transparent and painted background @@ -226,21 +226,16 @@ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, $Right_Margin,$assemblydesc); } - /* UldisN - $pdfcode = $pdf->output(); - $len = strlen($pdfcode); - if ($len<=20){ - */ if ($ListCount == 0) { $title = _('Print Indented BOM Listing Error'); include('includes/header.inc'); prnMsg(_('There were no items for the selected assembly'),'error'); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; } else { - $pdf->OutputD($_SESSION['DatabaseName'] . '_Customer_trans_' . date('Y-m-d').'.pdf');//UldisN + $pdf->OutputD($_SESSION['DatabaseName'] . '_Customer_trans_' . date('Y-m-d').'.pdf'); $pdf->__destruct(); } @@ -251,22 +246,30 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table class=selection>"; + echo '</br></br><form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + <table class=selection>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('Part') . ":</td>"; - echo "<td><input type ='text' name='Part' size='20'>"; + echo '<tr><td>' . _('Part') . ':</td> + <td><input type ="text" name="Part" size="20" /> + </tr> + <tr><td>' . _('Levels') . ':</td> + <td><select name="Levels"> + <option selected value="All">' . _('All Levels') . '</option> + <option value="One">' . _('One Level') . '</option> + </select> + </td> + </tr>'; - echo '<tr><td>' . _('Levels') . ":</td><td><select name='Levels'>"; - echo "<option selected value='All'>" . _('All Levels'); - echo "<option value='One'>" . _('One Level'); - echo '</select></td></tr>'; + echo '<tr><td>' . _('Print Option') . ':</td> + <td><select name="Fill"> + <option selected value="yes">' . _('Print With Alternating Highlighted Lines') . '</option> + <option value="no">' . _('Plain Print') . '</option> + </select> + </td> + </tr>'; + echo '</table> + <p><div class="centre"><input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>'; - echo '<tr><td>' . _('Print Option') . ":</td><td><select name='Fill'>"; - echo "<option selected value='yes'>" . _('Print With Alternating Highlighted Lines'); - echo "<option value='no'>" . _('Plain Print'); - echo '</select></td></tr>'; - echo "</table><p><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; - include('includes/footer.inc'); } /*end of else not PrintPDF */ @@ -275,7 +278,6 @@ function PrintHeader(&$pdf,&$YPos,&$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, $Page_Width,$Right_Margin,$assemblydesc) { - $line_height=12; /*PDF page header for Indented BOM Listing report */ if ($PageNumber>1){ Modified: trunk/BOMListing.php =================================================================== --- trunk/BOMListing.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/BOMListing.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -2,12 +2,8 @@ /* $Id$*/ -/* $Revision: 1.14 $ */ - -//$PageSecurity = 2; include('includes/session.inc'); - If (isset($_POST['PrintPDF']) AND isset($_POST['FromCriteria']) AND strlen($_POST['FromCriteria'])>=1 @@ -48,9 +44,9 @@ $title = _('Bill of Materials Listing') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg(_('The Bill of Material listing could not be retrieved by the SQL because'),'error'); - echo "<br><a href='" .$rootpath ."/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$SQL"; + echo '<br />' . $SQL; } include('includes/footer.inc'); exit; @@ -105,22 +101,10 @@ $YPos -=$line_height; $pdf->line($Page_Width-$Right_Margin, $YPos,$Left_Margin, $YPos); - /* - $buf = $pdf->output(); - $len = strlen($buf); + + $pdf->OutputD($_SESSION['DatabaseName'] . '_BOMListing_' . date('Y-m-d').'.pdf'); + $pdf->__destruct(); - header('Content-type: application/pdf'); - header('Content-Length: '.$len); - header('Content-Disposition: inline; filename=BOMListing.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->stream(); - */ - $pdf->OutputD($_SESSION['DatabaseName'] . '_BOMListing_' . date('Y-m-d').'.pdf');//UldisN - $pdf->__destruct(); //UldisN - } else { /*The option to print PDF was not hit */ $title=_('Bill Of Material Listing'); @@ -131,19 +115,25 @@ /*if $FromCriteria is not set then show a form to allow input */ - echo '<form action=' . $_SERVER['PHP_SELF'] . " method='POST'><table class=selection>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="POST"> + <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('From Inventory Part Code') . ':' . "</font></td><td><input tabindex='1' type=text name=FromCriteria size=20 maxlength=20 VALUE='1'></td></tr>"; + echo '<tr><td>' . _('From Inventory Part Code') . ':' . '</font></td> + <td><input tabindex="1" type="text" name="FromCriteria" size="20" maxlength="20" value="1"></td> + </tr>'; - echo '<tr><td>' . _('To Inventory Part Code') . ':' . "</td><td><input tabindex='2' type=text name=ToCriteria size=20 maxlength=20 VALUE='zzzzzzz'></td></tr>"; + echo '<tr><td>' . _('To Inventory Part Code') . ':' . '</td> + <td><input tabindex="2" type="text" name="ToCriteria" size="20" maxlength="20" value="zzzzzzz" /></td> + </tr>'; - echo "</table><br><div class='centre'><input tabindex='3' type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'></div>"; - echo "<script>defaultControl(document.forms[0].FromCriteria);</script>"; + echo '</table> + <br /><div class="centre"><input tabindex="3" type="submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>'; + echo '<script>defaultControl(document.forms[0].FromCriteria);</script>'; } include('includes/footer.inc');; } /*end of else not PrintPDF */ -?> +?> \ No newline at end of file Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/BOMs.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.37 $ */ + /* $Id$*/ -//$PageSecurity = 9; - include('includes/session.inc'); $title = _('Multi-Level Bill Of Materials Maintenance'); @@ -11,8 +9,6 @@ include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); - -// *** POPAD&T - ... Phil modified to english variables function display_children($parent, $level, &$BOMTree) { global $db; @@ -20,15 +16,13 @@ // retrive all children of parent $c_result = DB_query("SELECT parent, - component - FROM bom WHERE parent='" . $parent. "'" + component + FROM bom WHERE parent='" . $parent. "'" ,$db); if (DB_num_rows($c_result) > 0) { - //echo ("<UL>\n"); - - + while ($row = DB_fetch_array($c_result)) { - //echo '<br>Parent: ' . $parent . ' Level: ' . $level . ' row[component]: ' . $row['component'] .'<br>'; + //echo '<br />Parent: ' . $parent . ' Level: ' . $level . ' row[component]: ' . $row['component'] .'<br />'; if ($parent != $row['component']) { // indent and display the title of this child $BOMTree[$i]['Level'] = $level; // Level @@ -119,7 +113,7 @@ $DrillID=''; } else { $DrillText = '<a href="%s&Select=%s">' . _('Drill Down'); - $DrillLink = $_SERVER['PHP_SELF'] . '?' . SID; + $DrillLink = $_SERVER['PHP_SELF'] . '?'; $DrillID=$myrow[0]; } if ($ParentMBflag!='M' AND $ParentMBflag!='G'){ @@ -161,12 +155,12 @@ ConvertSQLDate($myrow[6]), $AutoIssue, $QuantityOnHand, - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $Parent, $myrow[0], $DrillLink, $DrillID, - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $Parent, $myrow[0], $UltimateParent); @@ -246,7 +240,7 @@ } if(!Date1GreaterThanDate2($_POST['EffectiveTo'], $_POST['EffectiveAfter'])){ $InputError = 1; - prnMsg(_('The effective to date must be a date after the effective after date') . '<br>' . _('The effective to date is') . ' ' . DateDiff($_POST['EffectiveTo'], $_POST['EffectiveAfter'], 'd') . ' ' . _('days before the effective after date') . '! ' . _('No updates have been performed') . '.<br>' . _('Effective after was') . ': ' . $_POST['EffectiveAfter'] . ' ' . _('and effective to was') . ': ' . $_POST['EffectiveTo'],'error'); + prnMsg(_('The effective to date must be a date after the effective after date') . '<br />' . _('The effective to date is') . ' ' . DateDiff($_POST['EffectiveTo'], $_POST['EffectiveAfter'], 'd') . ' ' . _('days before the effective after date') . '! ' . _('No updates have been performed') . '.<br />' . _('Effective after was') . ': ' . $_POST['EffectiveAfter'] . ' ' . _('and effective to was') . ': ' . $_POST['EffectiveTo'],'error'); $Errors[$i] = 'EffectiveAfter'; $i++; $Errors[$i] = 'EffectiveTo'; @@ -341,7 +335,7 @@ /*The component must already be on the BOM */ - prnMsg( _('The component') . ' ' . $_POST['Component'] . ' ' . _('is already recorded as a component of') . ' ' . $SelectedParent . '.' . '<br>' . _('Whilst the quantity of the component required can be modified it is inappropriate for a component to appear more than once in a bill of material'),'error'); + prnMsg( _('The component') . ' ' . $_POST['Component'] . ' ' . _('is already recorded as a component of') . ' ' . $SelectedParent . '.' . '<br />' . _('Whilst the quantity of the component required can be modified it is inappropriate for a component to appear more than once in a bill of material'),'error'); $Errors[$i]='ComponentCode'; } @@ -416,8 +410,8 @@ break; } - echo '<br><div class=centre><a href=' . $_SERVER['PHP_SELF'] . '?' . SID . '>' . _('Select a Different BOM') . '</a></div><br>'; - echo '<table class=selection>'; + echo '<br /><div class=centre><a href=' . $_SERVER['PHP_SELF'] . '?' . SID . '>' . _('Select a Different BOM') . '</a></div><br />'; + echo '<table class="selection">'; // Display Manufatured Parent Items $sql = "SELECT bom.parent, stockmaster.description, @@ -453,7 +447,7 @@ $DbgMsg = _('The SQL used to retrieve description of the parent part was'); $result=DB_query($sql,$db,$ErrMsg,$DbgMsg); if( DB_num_rows($result) > 0 ) { - echo (($reqnl)?'<br>':'').'<tr><td><div class="centre">'._('Assembly parent items').' : '; + echo (($reqnl)?'<br />':'').'<tr><td><div class="centre">'._('Assembly parent items').' : '; $ix = 0; while ($myrow = DB_fetch_array($result)){ echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?' . SID . 'Select='.$myrow['parent'].'">'. @@ -473,7 +467,7 @@ $DbgMsg = _('The SQL used to retrieve description of the parent part was'); $result=DB_query($sql,$db,$ErrMsg,$DbgMsg); if( DB_num_rows($result) > 0 ) { - echo (($reqnl)?'<br>':'').'<tr><td><div class="centre">'._('Kit sets').' : '; + echo (($reqnl)?'<br />':'').'<tr><td><div class="centre">'._('Kit sets').' : '; $ix = 0; while ($myrow = DB_fetch_array($result)){ echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?' . SID . 'Select='.$myrow['parent'].'">'. @@ -493,7 +487,7 @@ $DbgMsg = _('The SQL used to retrieve description of the parent part was'); $result=DB_query($sql,$db,$ErrMsg,$DbgMsg); if( DB_num_rows($result) > 0 ) { - echo (($reqnl)?'<br>':'').'<tr><td><div class="centre">'._('Phantom').' : '; + echo (($reqnl)?'<br />':'').'<tr><td><div class="centre">'._('Phantom').' : '; $ix = 0; while ($myrow = DB_fetch_array($result)){ echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?' . SID . 'Select='.$myrow['parent'].'">'. @@ -502,10 +496,11 @@ } //end while loop echo '</div></td></tr>'; } - echo "</table><br><table class=selection>"; - echo "<tr><th colspan=13><div class='centre'><font color=blue size=3><b>".$SelectedParent ." - " . $myrow[0] . ' ('. $MBdesc. ') </font></b></th></tr>'; + echo '</table> + <br /> + <table class="selection">'; + echo '<tr><th colspan=13><div class="centre"><font color=blue size=3><b>' . $SelectedParent .' - ' . $myrow[0] . ' ('. $MBdesc. ') </font></b></th></tr>'; - // *** POPAD&T $BOMTree = array(); //BOMTree is a 2 dimensional array with three elements for each item in the array - Level, Parent, Component //display children populates the BOM_Tree from the selected parent @@ -513,17 +508,17 @@ display_children($SelectedParent, 1, $BOMTree); $TableHeader = '<tr> - <th>' . _('Level') . '</th> - <th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Location') . '</th> - <th>' . _('Work Centre') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Effective After') . '</th> - <th>' . _('Effective To') . '</th> - <th>' . _('Auto Issue') . '</th> - <th>' . _('Qty On Hand') . '</th> - </tr>'; + <th>' . _('Level') . '</th> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Location') . '</th> + <th>' . _('Work Centre') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Effective After') . '</th> + <th>' . _('Effective To') . '</th> + <th>' . _('Auto Issue') . '</th> + <th>' . _('Qty On Hand') . '</th> + </tr>'; echo $TableHeader; if(count($BOMTree) == 0) { echo '<tr class="OddTableRows"><td colspan="8">'._('No materials found.').'</td></tr>'; @@ -546,12 +541,11 @@ DisplayBOMItems($UltimateParent, $Parent, $Component, $Level, $db); } } - // *** end POPAD&T - echo "</table><br>"; + echo '</table><br />'; if (! isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '&Select=' . $SelectedParent .'">'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?Select=' . $SelectedParent .'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($_GET['SelectedComponent']) and $InputError !=1) { @@ -577,24 +571,24 @@ $_POST['Quantity'] = $myrow['quantity']; $_POST['AutoIssue'] = $myrow['autoissue']; - prnMsg(_('Edit the details of the selected component in the fields below') . '. <br>' . _('Click on the Enter Information button to update the component details'),'info'); - echo "<br><input type=hidden name='SelectedParent' VALUE='$SelectedParent'>"; - echo "<input type=hidden name='SelectedComponent' VALUE='$SelectedComponent'>"; + prnMsg(_('Edit the details of the selected component in the fields below') . '. <br />' . _('Click on the Enter Information button to update the component details'),'info'); + echo '<br /> + <input type="hidden" name="SelectedParent" value="' . $SelectedParent . '" />'; + echo '<input type="hidden" name="SelectedComponent" value="' . $SelectedComponent . '" />'; echo '<table class=selection>'; - echo "<tr><th colspan=13><div class='centre'><font color=blue size=3><b>". ('Edit Component Details') .'</font></b></th></tr>'; + echo '<tr><th colspan=13><div class="centre"><font color=blue size=3><b>'. ('Edit Component Details') .'</font></b></th></tr>'; echo '<tr><td>' . _('Component') . ':</td><td><b>' . $SelectedComponent . '</b></td></tr>'; } else { //end of if $SelectedComponent - echo "<input type=hidden name='SelectedParent' VALUE='$SelectedParent'>"; - /* echo "Enter the details of a new component in the fields below. <br>Click on 'Enter Information' to add the new component, once all fields are completed."; + echo '<input type=hidden name="SelectedParent" value="' . $SelectedParent . '" />'; + /* echo "Enter the details of a new component in the fields below. <br />Click on 'Enter Information' to add the new component, once all fields are completed."; */ echo '<table class=selection>'; - echo "<tr><th colspan=13><div class='centre'><font color=blue size=3><b>". ('New Component Details') .'</font></b></th></tr>'; + echo '<tr><th colspan=13><div class="centre"><font color=blue size=3><b>' . ('New Component Details') .'</font></b></th></tr>'; echo '<tr><td>' . _('Component code') . ':</td><td>'; - echo "<select " . (in_array('ComponentCode',$Errors) ? 'class="selecterror"' : '' ) ." tabindex='1' name='Component'>"; + echo '<select ' . (in_array('ComponentCode',$Errors) ? 'class="selecterror"' : '' ) .' tabindex="1" name="Component">'; - if ($ParentMBflag=='A'){ /*Its an assembly */ $sql = "SELECT stockmaster.stockid, stockmaster.description @@ -627,64 +621,68 @@ while ($myrow = DB_fetch_array($result)) { - echo "<option VALUE=".$myrow['stockid'].'>' . str_pad($myrow['stockid'],21, '_', STR_PAD_RIGHT) . $myrow['description']; + echo '<option value="' .$myrow['stockid'].'">' . str_pad($myrow['stockid'],21, '_', STR_PAD_RIGHT) . $myrow['description'] . '</option>'; } //end while loop echo '</select></td></tr>'; } - echo "<tr><td>" . _('Location') . ": </td><td><select tabindex='2' name='LocCode'>"; + echo '<tr><td>' . _('Location') . ': </td> + <td><select tabindex="2" name="LocCode">'; DB_free_result($result); - $sql = 'SELECT locationname, loccode FROM locations'; + $sql = "SELECT locationname, loccode FROM locations"; $result = DB_query($sql,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['LocCode']) and $myrow['loccode']==$_POST['LocCode']) { - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option value="'; } - echo $myrow['loccode'] . "'>" . $myrow['locationname']; + echo $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } //end while loop DB_free_result($result); - echo "</select></td></tr><tr><td>" . _('Work Centre Added') . ": </td><td>"; - echo "<select tabindex='3' name='WorkCentreAdded'>"; + echo '</select></td> + </tr> + <tr><td>' . _('Work Centre Added') . ': </td> + <td><select tabindex="3" name="WorkCentreAdded">'; - $sql = 'SELECT code, description FROM workcentres'; + $sql = "SELECT code, description FROM workcentres"; $result = DB_query($sql,$db); if (DB_num_rows($result)==0){ prnMsg( _('There are no work centres set up yet') . '. ' . _('Please use the link below to set up work centres'),'warn'); - echo "<br><a href='$rootpath/WorkCentres.php?" . SID . "'>" . _('Work Centre Maintenance') . '</a>'; + echo '<br /><a href="' . $rootpath . '/WorkCentres.php">' . _('Work Centre Maintenance') . '</a>'; include('includes/footer.inc'); exit; } while ($myrow = DB_fetch_array($result)) { if (isset($_POST['WorkCentreAdded']) and $myrow['code']==$_POST['WorkCentreAdded']) { - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option value="'; } - echo $myrow['code'] . "'>" . $myrow['description']; + echo $myrow['code'] . '">' . $myrow['description'] . '</option>'; } //end while loop DB_free_result($result); - echo "</select></td></tr><tr><td>" . _('Quantity') . ": </td><td> - <input " . (in_array('Quantity',$Errors) ? 'class="inputerror"' : '' ) ." - tabindex='4' type='Text' class=number name='Quantity' class=number size=10 maxlength=8 value="; + echo '</select></td> + </tr> + <tr><td>' . _('Quantity') . ': </td> + <td><input ' . (in_array('Quantity',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="4" type="text" class="number" name="Quantity" class="number" size="10" maxlength="8" value="'; if (isset($_POST['Quantity'])){ echo $_POST['Quantity']; } else { echo 1; } - echo "></td></tr>"; + echo '"></td></tr>'; if (!isset($_POST['EffectiveTo']) OR $_POST['EffectiveTo']=='') { $_POST['EffectiveTo'] = Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,Date('m'),Date('d'),(Date('y')+20))); @@ -693,12 +691,10 @@ $_POST['EffectiveAfter'] = Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))); } - echo "<tr><td>" . _('Effective After') . " (" . $_SESSION['DefaultDateFormat'] . "):</td> - <td><input " . (in_array('EffectiveAfter',$Errors) ? 'class="inputerror"' : '' ) . - " tabindex='5' type='Text' name='EffectiveAfter' class=date alt='".$_SESSION['DefaultDateFormat']."' size=11 maxlength=10 VALUE=" . $_POST['EffectiveAfter'] ."> - </td></tr><tr><td>" . _('Effective To') . " (" . $_SESSION['DefaultDateFormat'] . "):</td><td> - <input " . (in_array('EffectiveTo',$Errors) ? 'class="inputerror"' : '' ) . - " tabindex='6' type='Text' name='EffectiveTo' class=date alt='".$_SESSION['DefaultDateFormat']."' size=11 maxlength=10 VALUE=" . $_POST['EffectiveTo'] ."></td></tr>"; + echo '<tr><td>' . _('Effective After') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> + <td><input ' . (in_array('EffectiveAfter',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="5" type="text" name="EffectiveAfter" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" size="11" maxlength="10" value="' . $_POST['EffectiveAfter'] .'"></td></tr> + <tr><td>' . _('Effective To') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> + <td><input ' . (in_array('EffectiveTo',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="6" type="text" name="EffectiveTo" class="date" alt="' .$_SESSION['DefaultDateFormat'] . '" size="11" maxlength="10" value="' . $_POST['EffectiveTo'] .'"></td></tr>'; if ($ParentMBflag=='M' OR $ParentMBflag=='G'){ echo '<tr><td>' . _('Auto Issue this Component to Work Orders') . ':</td> @@ -709,20 +705,21 @@ $_POST['AutoIssue'] = $_SESSION['AutoIssue']; } if ($_POST['AutoIssue']==0) { - echo '<option selected VALUE=0>' . _('No'); - echo '<option VALUE=1>' . _('Yes'); + echo '<option selected value="0">' . _('No') . '</option>'; + echo '<option value="1">' . _('Yes') . '</option>'; } else { - echo '<option selected VALUE=1>' . _('Yes'); - echo '<option VALUE=0>' . _('No'); + echo '<option selected value="1">' . _('Yes') . '</option>'; + echo '<option value="0">' . _('No') . '</option>'; } echo '</select></td></tr>'; } else { - echo '<input type=hidden name="AutoIssue" VALUE=0>'; + echo '<input type=hidden name="AutoIssue" value="0">'; } - echo "</table><br><div class='centre'><input tabindex='8' type='Submit' name='Submit' value='" . _('Enter Information') . "'></form></div>"; + echo '</table> + <br /><div class="centre"><input tabindex="8" type="submit" name="Submit" value="' . _('Enter Information') . '"></form></div>'; } //end if record deleted no point displaying form to add record @@ -791,26 +788,32 @@ if (!isset($SelectedParent)) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="">' . ' ' . $title; - echo "<form action=" . $_SERVER['PHP_SELF'] . "?" . SID ." method=post>" . + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . '<div class="page_help_text">'. _('Select a manufactured part') . " (" . _('or Assembly or Kit part') . ") " . - _('to maintain the bill of material for using the options below') . "." . "<br><font size=1>" . - _('Parts must be defined in the stock item entry') . "/" . _('modification screen as manufactured') . - ", " . _('kits or assemblies to be available for construction of a bill of material') .'</div>'. - "</font><br><table class=selection cellpadding=3 colspan=4><tr><td><font size=1>" . _('Enter text extracts in the') . - " <b>" . _('description') . "</b>:</font></td><td><input tabindex='1' type='Text' name='Keywords' size=20 maxlength=25></td> - <td><font size=3><b>" . _('OR') . "</b></font></td><td><font size=1>" . _('Enter extract of the') . - " <b>" . _('Stock Code') . "</b>:</font></td><td><input tabindex='2' type='Text' name='StockCode' size=15 maxlength=18></td> - </tr></table><br><div class='centre'><input tabindex='3' type=submit name='Search' VALUE=" . _('Search Now') . "></div>"; + _('to maintain the bill of material for using the options below') . '<br /><font size=1>' . + _('Parts must be defined in the stock item entry') . '/' . _('modification screen as manufactured') . + ', ' . _('kits or assemblies to be available for construction of a bill of material') .'</div>'. + '</font> + <br /> + <table class="selection" cellpadding="3" colspan="4"> + <tr><td><font size=1>' . _('Enter text extracts in the') . ' <b>' . _('description') . '</b>:</font></td> + <td><input tabindex="1" type="text" name="Keywords" size="20" maxlength="25"></td> + <td><font size=3><b>' . _('OR') . '</b></font></td> + <td><font size=1>' . _('Enter extract of the') . ' <b>' . _('Stock Code') . '</b>:</font></td> + <td><input tabindex="2" type="text" name="StockCode" size="15" maxlength="18"></td> + </tr> + </table> + <br /><div class="centre"><input tabindex="3" type="submit" name="Search" value="' . _('Search Now') . '"></div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($_POST['Search']) and isset($result) AND !isset($SelectedParent)) { - echo '<br><table cellpadding=2 colspan=7 class=selection>'; + echo '<br /><table cellpadding=2 colspan=7 class=selection>'; $TableHeader = '<tr><th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('On Hand') . '</th> - <th>' . _('Units') . '</th> - </tr>'; + <th>' . _('Description') . '</th> + <th>' . _('On Hand') . '</th> + <th>' . _('Units') . '</th> + </tr>'; echo $TableHeader; @@ -830,15 +833,14 @@ $StockOnHand = number_format($myrow['totalonhand'],2); } $tab = $j+3; - printf("<td><input tabindex='".$tab."' type=submit name='Select' VALUE='%s'</td> + printf('<td><input tabindex="' . $tab . '" type="submit" name="Select" value="%s"</td> <td>%s</td> <td class=number>%s</td> - <td>%s</td></tr>", + <td>%s</td></tr>', $myrow['stockid'], $myrow['description'], $StockOnHand, - $myrow['units'] - ); + $myrow['units']); $j++; //end of page full new headings if @@ -851,12 +853,12 @@ //end if results to show if (!isset($SelectedParent) or $SelectedParent=='') { - echo "<script>defaultControl(document.forms[0].StockCode);</script>"; + echo '<script>defaultControl(document.forms[0].StockCode);</script>'; } else { - echo "<script>defaultControl(document.form.JournalProcessDate);</script>"; + echo '<script>defaultControl(document.form.JournalProcessDate);</script>'; } -echo "</form>"; +echo '</form>'; } //end StockID already selected Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/BankAccounts.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.21 $ */ + /* $Id$*/ -//$PageSecurity = 10; - include('includes/session.inc'); $title = _('Bank Accounts Maintenance'); @@ -11,7 +9,7 @@ include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Bank') . '" alt="" />' . ' ' . $title . '</p>'; - echo '<div class="page_help_text">' . _('Update Bank Account details. Account Code is for SWIFT or BSB type Bank Codes. Set Default for Invoices to "yes" to print Account details on Invoices (only one account can be set to "yes").') . '.</div><br>'; +echo '<div class="page_help_text">' . _('Update Bank Account details. Account Code is for SWIFT or BSB type Bank Codes. Set Default for Invoices to "yes" to print Account details on Invoices (only one account can be set to "yes").') . '.</div><br />'; if (isset($_GET['SelectedBankAccount'])) { $SelectedBankAccount=$_GET['SelectedBankAccount']; @@ -85,23 +83,21 @@ $sql = "SELECT * FROM banktrans WHERE bankact='" . $SelectedBankAccount . "'"; $BankTransResult = DB_query($sql,$db); if (DB_num_rows($BankTransResult)>0) { - $sql = "UPDATE bankaccounts - SET bankaccountname='" . $_POST['BankAccountName'] . "', - bankaccountcode='" . $_POST['BankAccountCode'] . "', - bankaccountnumber='" . $_POST['BankAccountNumber'] . "', - bankaddress='" . $_POST['BankAddress'] . "', - invoice ='" . $_POST['DefAccount'] . "' - WHERE accountcode = '" . $SelectedBankAccount . "'"; + $sql = "UPDATE bankaccounts SET bankaccountname='" . $_POST['BankAccountName'] . "', + bankaccountcode='" . $_POST['BankAccountCode'] . "', + bankaccountnumber='" . $_POST['BankAccountNumber'] . "', + bankaddress='" . $_POST['BankAddress'] . "', + invoice ='" . $_POST['DefAccount'] . "' + WHERE accountcode = '" . $SelectedBankAccount . "'"; prnMsg(_('Note that it is not possible to change the currency of the account once there are transactions against it'),'warn'); - echo '<br>'; + echo '<br />'; } else { - $sql = "UPDATE bankaccounts - SET bankaccountname='" . $_POST['BankAccountName'] . "', - bankaccountcode='" . $_POST['BankAccountCode'] . "', - bankaccountnumber='" . $_POST['BankAccountNumber'] . "', - bankaddress='" . $_POST['BankAddress'] . "', - currcode ='" . $_POST['CurrCode'] . "', - invoice ='" . $_POST['DefAccount'] . "' + $sql = "UPDATE bankaccounts SET bankaccountname='" . $_POST['BankAccountName'] . "', + bankaccountcode='" . $_POST['BankAccountCode'] . "', + bankaccountnumber='" . $_POST['BankAccountNumber'] . "', + bankaddress='" . $_POST['BankAddress'] . "', + currcode ='" . $_POST['CurrCode'] . "', + invoice ='" . $_POST['DefAccount'] . "' WHERE accountcode = '" . $SelectedBankAccount . "'"; } @@ -110,22 +106,20 @@ /*Selectedbank account is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new bank account form */ - $sql = "INSERT INTO bankaccounts ( - accountcode, - bankaccountname, - bankaccountcode, - bankaccountnumber, - bankaddress, - currcode, - invoice) - VALUES ('" . $_POST['AccountCode'] . "', - '" . $_POST['BankAccountName'] . "', - '" . $_POST['BankAccountCode'] . "', - '" . $_POST['BankAccountNumber'] . "', - '" . $_POST['BankAddress'] . "', - '" . $_POST['CurrCode'] . "', - '" . $_POST['DefAccount'] . "' - )"; + $sql = "INSERT INTO bankaccounts (accountcode, + bankaccountname, + bankaccountcode, + bankaccountnumber, + bankaddress, + currcode, + invoice) + VALUES ('" . $_POST['AccountCode'] . "', + '" . $_POST['BankAccountName'] . "', + '" . $_POST['BankAccountCode'] . "', + '" . $_POST['BankAccountNumber'] . "', + '" . $_POST['BankAddress'] . "', + '" . $_POST['CurrCode'] . "', + '" . $_POST['DefAccount'] . "' )"; $msg = _('The new bank account has been entered'); } @@ -136,7 +130,7 @@ $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); prnMsg($msg,'success'); - echo '<br>'; + echo '<br />'; unset($_POST['AccountCode']); unset($_POST['BankAccountName']); unset($_POST['BankAccountNumber']); @@ -160,7 +154,7 @@ if ($myrow[0]>0) { $CancelDelete = 1; prnMsg(_('Cannot delete this bank account because transactions have been created using this account'),'warn'); - echo '<br> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions with this bank account code'); + echo '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions with this bank account code'); } if (!$CancelDelete) { @@ -188,19 +182,20 @@ WHERE bankaccounts.accountcode = chartmaster.accountcode"; $ErrMsg = _('The bank accounts set up could not be retrieved because'); - $DbgMsg = _('The SQL used to retrieve the bank account details was') . '<br>' . $sql; + $DbgMsg = _('The SQL used to retrieve the bank account details was') . '<br />' . $sql; $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); echo '<table class="selection">'; - echo "<tr><th>" . _('GL Account Code') . "</th> - <th>" . _('Bank Account Name') . "</th> - <th>" . _('Bank Account Code') . "</th> - <th>" . _('Bank Account Number') . "</th> - <th>" . _('Bank Address') . "</th> - <th>" . _('Currency') . "</th> - <th>" . _('Default for Invoices') . "</th> - </tr>"; + echo '<tr> + <th>' . _('GL Account Code') . '</th> + <th>' . _('Bank Account Name') . '</th> + <th>' . _('Bank Account Code') . '</th> + <th>' . _('Bank Account Number') . '</th> + <th>' . _('Bank Address') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Default for Invoices') . '</th> + </tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_row($result)) { @@ -216,16 +211,16 @@ } else { $defacc=_('Yes'); } - printf("<td>%s<br><font size=2>%s</font></td> + printf('<td>%s<br /><font size=2>%s</font></td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> - <td><a href=\"%s?SelectedBankAccount=%s\">" . _('Edit') . "</td> - <td><a href=\"%s?SelectedBankAccount=%s&delete=1\">" . _('Delete') . "</td> - </tr>", + <td><a href="%s?SelectedBankAccount=%s">' . _('Edit') . '</td> + <td><a href="%s?SelectedBankAccount=%s&delete=1">' . _('Delete') . '</td> + </tr>', $myrow[0], $myrow[2], $myrow[3], @@ -364,12 +359,13 @@ } }//end while loop } else { - echo '<option VALUE=1>'._('Yes').'</option><option value=0>'._('No').'</option>'; + echo '<option value="1">'._('Yes').'</option> + <option value="0">'._('No').'</option>'; } echo '</select></td>'; -echo '</tr></table><br> +echo '</tr></table><br /> <div class="centre"><input tabindex="7" type="Submit" name="submit" value="'. _('Enter Information') .'"></div>'; echo '</form>'; Modified: trunk/Logout.php =================================================================== --- trunk/Logout.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/Logout.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -23,7 +23,7 @@ <?php echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; ?> - <label><?php echo _('Thank you for using webERP'); ?></label> + <span><?php echo _('Thank you for using webERP'); ?></span> <br /> <input class="button" type="submit" value="<?php echo _('Login'); ?>" name="SubmitUser" /> </form> Modified: trunk/PageSecurity.php =================================================================== --- trunk/PageSecurity.php 2011-04-29 12:43:19 UTC (rev 4558) +++ trunk/PageSecurity.php 2011-05-01 09:45:18 UTC (rev 4559) @@ -13,17 +13,17 @@ if (isset($_POST['Update'])) { foreach ($_POST as $ScriptName => $PageSecurityValue) { if ($ScriptName!='Update' and $ScriptName!='FormID') { - //$key=substr($key, 0, strlen($key)-4).'.php'; + $ScriptName=substr($ScriptName, 0, strlen($Sc... [truncated message content] |
From: <dai...@us...> - 2011-04-29 12:43:29
|
Revision: 4558 http://web-erp.svn.sourceforge.net/web-erp/?rev=4558&view=rev Author: daintree Date: 2011-04-29 12:43:19 +0000 (Fri, 29 Apr 2011) Log Message: ----------- quoting Modified Paths: -------------- trunk/PO_Header.php trunk/SpecialOrder.php trunk/StockCostUpdate.php trunk/StockLocMovements.php trunk/StockLocStatus.php trunk/StockMovements.php trunk/StockQuantityByDate.php trunk/includes/GetConfig.php 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/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.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/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-04-28 10:39:25 UTC (rev 4557) +++ trunk/PO_Header.php 2011-04-29 12:43:19 UTC (rev 4558) @@ -805,7 +805,7 @@ echo '</select></td></tr>'; echo '<tr><td>' . _('Status Comment') . ':</td> - <td><input type=text name="StatusComments" size=50></td></tr> + <td><input type=text name="StatusComments" size=50></td></tr> <tr><td colspan=2><b>' . $_SESSION['PO'.$identifier]->StatusComments .'</b></td></tr>'; //need to use single quotes as double quotes inside the string of StatusComments echo '<input type="hidden" name="StatusCommentsComplete" value="' . $_SESSION['PO'.$identifier]->StatusComments .'">'; Modified: trunk/SpecialOrder.php =================================================================== --- trunk/SpecialOrder.php 2011-04-28 10:39:25 UTC (rev 4557) +++ trunk/SpecialOrder.php 2011-04-29 12:43:19 UTC (rev 4558) @@ -2,8 +2,6 @@ /* $Id$ */ -//$PageSecurity = 4; - include('includes/DefineSpecialOrderClass.php'); /* Session started in header.inc for password checking and authorisation level check */ include('includes/session.inc'); @@ -13,7 +11,7 @@ include('includes/header.inc'); -echo "<form action='" . $_SERVER['PHP_SELF'] . "?" . SID . "' method=post>"; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -22,15 +20,15 @@ } if (!isset($_SESSION['SupplierID'])){ - echo '<br><br>'; + echo '<br /><br />'; prnMsg(_('To set up a special') . ', ' . _('the supplier must first be selected from the Select Supplier page'),'info'); - echo "<br><a href='$rootpath/SelectSupplier.php?" . SID . "'>" . _('Select the supplier now') . "</a>"; + echo '<br /><a href="' . $rootpath . '/SelectSupplier.php">' . _('Select the supplier now') . '</a>'; include('includes/footer.inc'); exit; } if (!isset($_SESSION['CustomerID']) OR $_SESSION['CustomerID']==""){ - echo "<br><br>" . _('To set up a special') . ', ' . _('the customer must first be selected from the Select Customer page') . "<br><a href='$rootpath/SelectCustomer.php?" . SID . "'>" . _('Select the customer now') . "</a>"; + echo '<br /><br />' . _('To set up a special') . ', ' . _('the customer must first be selected from the Select Customer page') . '<br /><a href="' . $rootpath . '/SelectCustomer.php">' . _('Select the customer now') . '</a>'; include('includes/footer.inc'); exit; } @@ -110,9 +108,9 @@ } echo '<div class="centre">'; if (!isset($_SESSION['SPL']->BranchCode)){ - echo "<br><font size=4 color=BLUE>" . _('Purchase from') . " " . $_SESSION['SPL']->SupplierName . " " . _('in') . " " . $_SESSION['SPL']->SuppCurrCode . " " . _('for') . " " . $_SESSION['SPL']->CustomerName . " (" . $_SESSION['SPL']->CustCurrCode . ")"; + echo '<br /><font size=4 color=blue>' . _('Purchase from') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('in') . ' ' . $_SESSION['SPL']->SuppCurrCode . ' ' . _('for') . ' ' . $_SESSION['SPL']->CustomerName . ' (' . $_SESSION['SPL']->CustCurrCode . ')'; } else { - echo '<br><font size=4 color=BLUE>' . _('Purchase from') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('in') . ' ' . $_SESSION['SPL']->SuppCurrCode . ' ' . _('for') . ' ' . $_SESSION['SPL']->CustomerName . ' (' . $_SESSION['SPL']->CustCurrCode . ') - ' . _('delivered to') . ' ' . $_SESSION['SPL']->BranchName . ' ' . _('branch'); + echo '<br /><font size=4 color=BLUE>' . _('Purchase from') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('in') . ' ' . $_SESSION['SPL']->SuppCurrCode . ' ' . _('for') . ' ' . $_SESSION['SPL']->CustomerName . ' (' . $_SESSION['SPL']->CustCurrCode . ') - ' . _('delivered to') . ' ' . $_SESSION['SPL']->BranchName . ' ' . _('branch'); } echo '</div></font>'; /*if the branch details and delivery details have not been entered then select them from the list */ @@ -127,12 +125,13 @@ If (DB_num_rows($BranchResult)>0) { echo '<div class="centre">'; - echo '<br><br>' . _('Select the customer branch to deliver the special to from the list below'); + echo '<br /><br />' . _('Select the customer branch to deliver the special to from the list below'); - echo '</div><br><table cellpadding=3 colspan=2 BORDER=1>'; + echo '</div><br /><table cellpadding=3 colspan=2 BORDER=1>'; - $tableheader = "<tr><th>" ._('Code') . "</th> - <th>" . _('Branch Name') . "</th></tr>"; + $tableheader = '<tr><th>' ._('Code') . '</th> + <th>' . _('Branch Name') . '</th> + </tr>'; echo $tableheader; $j = 1; @@ -148,7 +147,11 @@ $k++; } - printf("<td><input type=submit name='SelectBranch' VALUE='%s'</td><td>%s</td></tr>", $myrow['branchcode'], $myrow['brname']); + printf('<td><input type="submit" name="SelectBranch" value="%s"</td> + <td>%s</td> + </tr>', + $myrow['branchcode'], + $myrow['brname']); //end of page full new headings if } @@ -189,32 +192,32 @@ if (!is_numeric($_POST['Qty'])){ $AllowAdd = False; - prnMsg( _('Cannot Enter this order line') . '<br>' . _('The quantity of the order item must be numeric'),'warn'); + prnMsg( _('Cannot Enter this order line') . '<br />' . _('The quantity of the order item must be numeric'),'warn'); } if ($_POST['Qty']<0){ $AllowAdd = False; - prnMsg( _('Cannot Enter this order line') . '<br>' . _('The quantity of the ordered item entered must be a positive amount'),'warn'); + prnMsg( _('Cannot Enter this order line') . '<br />' . _('The quantity of the ordered item entered must be a positive amount'),'warn'); } if (!is_numeric($_POST['Price'])){ $AllowAdd = False; - prnMsg( _('Cannot Enter this order line') . '<br>' . _('The price entered must be numeric'),'warn'); + prnMsg( _('Cannot Enter this order line') . '<br />' . _('The price entered must be numeric'),'warn'); } if (!is_numeric($_POST['Cost'])){ $AllowAdd = False; - prnMsg( _('Cannot Enter this order line') . '<br>' . _('The cost entered must be numeric'),'warn'); + prnMsg( _('Cannot Enter this order line') . '<br />' . _('The cost entered must be numeric'),'warn'); } if ((($_POST['Price']/$_SESSION['SPL']->CustCurrExRate)-($_POST['Cost']/$_SESSION['SPL']->SuppCurrExRate))<0){ $AllowAdd = False; - prnMsg( _('Cannot Enter this order line') . '<br>' . _('The sale is at a lower price than the cost'),'warn'); + prnMsg( _('Cannot Enter this order line') . '<br />' . _('The sale is at a lower price than the cost'),'warn'); } if (!Is_Date($_POST['ReqDelDate'])){ $AllowAdd = False; - prnMsg( _('Cannot Enter this order line') . '<br>' . _('The date entered must be in the format') . ' ' . $_SESSION['DefaultDateFormat'],'warn'); + prnMsg( _('Cannot Enter this order line') . '<br />' . _('The date entered must be in the format') . ' ' . $_SESSION['DefaultDateFormat'],'warn'); } If ($AllowAdd == True){ @@ -292,7 +295,7 @@ $sql = $sql . "'" . $_SESSION['SPL']->SupplierID . "', '" . $_SESSION['SPL']->Comments . "', - '" . Date("Y-m-d") . "', + '" . Date('Y-m-d') . "', '" . $_SESSION['SPL']->SuppCurrExRate . "', '" . $_SESSION['SPL']->Initiator . "', '" . $_SESSION['SPL']->QuotationRef . "', @@ -307,11 +310,9 @@ $ErrMsg = _('The purchase order header record could not be inserted into the database because'); - $DbgMsg = _('The SQL statement used to insert the purchase order header record and failed was') . "<br>$sql"; + $DbgMsg = _('The SQL statement used to insert the purchase order header record and failed was') . '<br />' . $sql; $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); - /*Get the auto increment value of the order number created from the SQL above */ -// $_SESSION['SPL']->PurchOrderNo = DB_Last_Insert_ID($db,'purchorders','orderno'); $_SESSION['SPL']->PurchOrderNo = GetNextTransNo(18, $db); @@ -355,7 +356,7 @@ $ErrMsg = _('The item record for line') . " " . $SPLLine->LineNo . " " . _('could not be create because'); - $DbgMsg = _('The SQL statement used to insert the item and failed was') . "<br>$sql"; + $DbgMsg = _('The SQL statement used to insert the item and failed was') . "<br />$sql"; $result =DB_query($sql,$db,$ErrMsg,$DbgMsg,true); @@ -397,8 +398,8 @@ } /* end of the loop round the detail line items on the order */ - echo '<br><br>' . _('Purchase Order') . ' ' . $_SESSION['SPL']->PurchOrderNo . ' ' . _('on') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('has been created'); - echo "<br><a href='$rootpath/PO_PDFPurchOrder.php?" . SID . '&OrderNo=' . $_SESSION['SPL']->PurchOrderNo . "'>" . _('Print Purchase Order') . '</a>'; + echo '<br /><br />' . _('Purchase Order') . ' ' . $_SESSION['SPL']->PurchOrderNo . ' ' . _('on') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('has been created'); + echo '<br /><a href="' . $rootpath . '/PO_PDFPurchOrder.php?OrderNo=' . $_SESSION['SPL']->PurchOrderNo . '">' . _('Print Purchase Order') . '</a>'; /*Now insert the sales order too */ @@ -448,7 +449,7 @@ '" . $_SESSION['SPL']->CustomerID . "', '" . $_SESSION['SPL']->BranchCode . "', '" . $_SESSION['SPL']->CustRef ."', - '" . Date("Y-m-d") . "', + '" . Date('Y-m-d') . "', '" . $BranchDetails['salestype'] . "', '" . $BranchDetails['defaultshipvia'] ."', '" . $BranchDetails['brname'] . "', @@ -466,9 +467,6 @@ $ErrMsg = _('The sales order cannot be added because'); $InsertQryResult = DB_query($HeaderSQL,$db,$ErrMsg, $DbMsg); -// $SalesOrderNo = DB_Last_Insert_ID($db,'salesorders','orderno'); -// $SalesOrderNo = GetNextTransNo(30, $db); - $StartOf_LineItemsSQL = "INSERT INTO salesorderdetails (orderno, stkcode, unitprice, @@ -486,20 +484,20 @@ } /* inserted line items into sales order details */ unset ($_SESSION['SPL']); - prnMsg(_('Sales Order Number') . ' ' . $SalesOrderNo . ' ' . _('has been entered') . '. <p>' . _('Orders created on a cash sales account may need the delivery details for the order to be modified') . '. <br><br>' . _('A freight charge may also be applicable'),'success'); + prnMsg(_('Sales Order Number') . ' ' . $SalesOrderNo . ' ' . _('has been entered') . '. <p>' . _('Orders created on a cash sales account may need the delivery details for the order to be modified') . '. <br /><br />' . _('A freight charge may also be applicable'),'success'); if (count($_SESSION['AllowedPageSecurityTokens'])>1){ /* Only allow print of packing slip for internal staff - customer logon's cannot go here */ - echo "<p><a href='$rootpath/PrintCustOrder.php?" . SID . "&TransNo=" . $SalesOrderNo . "'>" . _('Print packing slip') . ' (' . _('Preprinted stationery') . ')</a>'; - echo "<p><a href='$rootpath/PrintCustOrder_generic.php?" . SID . '&TransNo=' . $SalesOrderNo . "'>" . _('Print packing slip') . ' (' . _('Laser') . ')</a>'; + echo '<p><a href="' . $rootpath . '/PrintCustOrder.php?TransNo=' . $SalesOrderNo . '">' . _('Print packing slip') . ' (' . _('Preprinted stationery') . ')</a>'; + echo '<p><a href="' . $rootpath . '/PrintCustOrder_generic.php?TransNo=' . $SalesOrderNo . '">' . _('Print packing slip') . ' (' . _('Laser') . ')</a>'; } $Result = DB_Txn_Commit($db); unset($_SESSION['SPL']); /*Clear the PO data to allow a newy to be input*/ - echo "<br><br><a href='$rootpath/SpecialOrder.php?" . SID . "'>" . _('Enter A New Special Order') . "</a>"; + echo '<br /><br /><a href="' . $rootpath . '/SpecialOrder.php">' . _('Enter A New Special Order') . '</a>'; exit; } /*end if there were no input errors trapped */ } /* end of the code to do transfer the SPL object to the database - user hit the place Order*/ @@ -507,56 +505,49 @@ /*Show the header information for modification */ -echo "<table><tr><td>" . _('Receive Purchase Into and Sell From') . ": <select name='StkLocation'>"; +echo '<table><tr><td>' . _('Receive Purchase Into and Sell From') . ': <select name="StkLocation">'; $sql = "SELECT loccode, locationname FROM locations"; $LocnResult = DB_query($sql,$db); -if (!isset($_SESSION['SPL']->StkLocation) OR $_SESSION['SPL']->StkLocation==""){ /*If this is the first time the form loaded set up defaults */ +if (!isset($_SESSION['SPL']->StkLocation) OR $_SESSION['SPL']->StkLocation==''){ /*If this is the first time the form loaded set up defaults */ $_SESSION['SPL']->StkLocation = $_SESSION['UserStockLocation']; } while ($LocnRow=DB_fetch_array($LocnResult)){ if ($_SESSION['SPL']->StkLocation == $LocnRow['loccode']){ - echo "<option selected Value='" . $LocnRow['loccode'] . "'>" . $LocnRow['locationname']; + echo '<option selected value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; } else { - echo "<option Value='" . $LocnRow['loccode'] . "'>" . $LocnRow['locationname']; + echo '<option Value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; } } -echo "</select></td>"; +echo '</select></td>'; -echo "<td>" . _('Initiated By') . ": <input type=TEXT name='Initiator' size=11 maxlength=10 VALUE=" . $_SESSION['SPL']->Initiator . "></td>"; -echo "<td>" . _('Special Ref') . ": <input type=TEXT name='QuotationRef' size=16 maxlength=15 VALUE=" . $_SESSION['SPL']->QuotationRef . "></td>"; -echo "<td>" . _('Customer Ref') . ": <input type=TEXT name='CustRef' size=11 maxlength=10 VALUE=" . $_SESSION['SPL']->CustRef . "></td></tr>"; +echo '<td>' . _('Initiated By') . ': <input type="text" name="Initiator" size=11 maxlength=10 value="' . $_SESSION['SPL']->Initiator . '"></td> + <td>' . _('Special Ref') . ': <input type="text" name="QuotationRef" size=16 maxlength=15 value="' . $_SESSION['SPL']->QuotationRef . '"></td> + <td>' . _('Customer Ref') . ': <input type="text" name="CustRef" size=11 maxlength=10 value="' . $_SESSION['SPL']->CustRef . '"></td></tr> + <tr><td valign=top colspan=2>' . _('Comments') . ': <textarea name="Comments" cols=70 rows=2>' . $_SESSION['SPL']->Comments . '</textarea></td></tr> +</table> +<hr>'; /* Rule off the header */ -echo "<tr><td VALIGN=TOP colspan=2>" . _('Comments') . ":"; -echo "<textarea name='Comments' cols=70 rows=2>" . $_SESSION['SPL']->Comments . "</textarea></td></tr></table>"; - -echo "<hr>"; /* Rule off the header */ - /*Now show the order so far */ if (count($_SESSION['SPL']->LineItems)>0){ - echo "<div class='centre'>><b>" . _('Special Order Summary') . "</b></div>"; - echo "<table cellpadding=2 colspan=7 border=1>"; + echo '<div class="centre">><b>' . _('Special Order Summary') . '</b></div>'; + echo '<table cellpadding=2 colspan=7 border=1>'; - $sql = 'select currencydefault from companies'; - $result = DB_query($sql, $db); - $myrow = DB_fetch_row($result); - $DefaultCurrency = $myrow[0]; + echo '<tr> + <th>' . _('Item Description') . '</th> + <th>' . _('Delivery') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Purchase Cost') . '<br />' . $_SESSION['SPL']->SuppCurrCode . '</th> + <th>' . _('Sell Price') . '<br />' . $_SESSION['SPL']->CustCurrCode . '</th> + <th>' . _('Total Cost') . '<br />' . $_SESSION['SPL']->SuppCurrCode . '</th> + <th>' . _('Total Price') . '<br />' . $_SESSION['SPL']->CustCurrCode . '</th> + <th>' . _('Total Cost') . '<br />' . $_SESSION['CompanyRecord']['currencydefault'] . '</th> + <th>' . _('Total Price') . '<br />' . $_SESSION['CompanyRecord']['currencydefault'] . '</th> + </tr>'; - echo "<tr> - <th>" . _('Item Description') . "</th> - <th>" . _('Delivery') . "</th> - <th>" . _('Quantity') . "</th> - <th>" . _('Purchase Cost') . '<br>' . $_SESSION['SPL']->SuppCurrCode . "</th> - <th>" . _('Sell Price') . '<br>' . $_SESSION['SPL']->CustCurrCode . "</th> - <th>" . _('Total Cost') . '<br>' . $_SESSION['SPL']->SuppCurrCode . "</th> - <th>" . _('Total Price') . '<br>' . $_SESSION['SPL']->CustCurrCode . "</th> - <th>" . _('Total Cost') . '<br>' . $DefaultCurrency . "</th> - <th>" . _('Total Price') . '<br>' . $DefaultCurrency . "</th> - </tr>"; - $_SESSION['SPL']->total = 0; $k = 0; //row colour counter foreach ($_SESSION['SPL']->LineItems as $SPLLine) { @@ -579,38 +570,41 @@ $k=1; } echo '<td>' . $SPLLine->ItemDescription . '</td> - <td>' . $SPLLine->ReqDelDate . "</td> - <td class=number>$DisplayQuantity</td> - <td class=number>$DisplayCost</td> - <td class=number>$DisplayPrice</td> - <td class=number>$DisplayLineCostTotal</td> - <td class=number>$DisplayLineTotal</td> - <td class=number>$DisplayLineCostTotalCurr</td> - <td class=number>$DisplayLineTotalCurr</td> - <td><a href='" . $_SERVER['PHP_SELF'] . "?" . SID .'&Delete=' . $SPLLine->LineNo . "'>" . _('Delete') . '</a></td></tr>'; + <td>' . $SPLLine->ReqDelDate . '</td> + <td class=number>' . $DisplayQuantity . '</td> + <td class=number>' . $DisplayCost . '</td> + <td class=number>' . $DisplayPrice . '</td> + <td class=number>' . $DisplayLineCostTotal . '</td> + <td class=number>' . $DisplayLineTotal . '</td> + <td class=number>' . $DisplayLineCostTotalCurr . '</td> + <td class=number>' . $DisplayLineTotalCurr . '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $SPLLine->LineNo . '">' . _('Delete') . '</a></td></tr>'; $_SESSION['SPL']->total = $_SESSION['SPL']->total + $DisplayLineTotalCurr; } $DisplayTotal = number_format($_SESSION['SPL']->total,2); echo '<tr> - <td colspan=8 class=number>' . _('TOTAL Excl Tax') . "</td> - <td class=number><b>$DisplayTotal</b></td> - </tr></table>"; + <td colspan=8 class=number>' . _('TOTAL Excl Tax') . '</td> + <td class=number><b>' . $DisplayTotal . '</b></td> + </tr> + </table>'; } /*Set up the form to enter new special items into */ -echo "<table>"; +echo '<table>'; -echo "<input type='hidden' name='LineNo' value=" . ($_SESSION['SPL']->LinesOnOrder + 1) .">"; +echo '<input type="hidden" name="LineNo" value="' . ($_SESSION['SPL']->LinesOnOrder + 1) .'" />'; if (!isset($_POST['ItemDescription'])) {$_POST['ItemDescription']='';} -echo '<tr><td>' . _('Ordered item Description') . ":</td><td><input type=TEXT name='ItemDescription' size=40 maxlength=40 VALUE='" . $_POST['ItemDescription'] . "'></td></tr>"; +echo '<tr><td>' . _('Ordered item Description') . ':</td> + <td><input type="text" name="ItemDescription" size=40 maxlength=40 value="' . $_POST['ItemDescription'] . '"></td></tr>'; -echo '<tr><td>' . _('Category') . ':</td><td><select name=StkCat>'; +echo '<tr><td>' . _('Category') . ':</td> + <td><select name=StkCat>'; $sql = "SELECT categoryid, categorydescription FROM stockcategory"; $ErrMsg = _('The stock categories could not be retrieved because'); @@ -619,9 +613,9 @@ while ($myrow=DB_fetch_array($result)){ if (isset($_POST['StkCat']) and $myrow['categoryid']==$_POST['StkCat']){ - echo "<option selected VALUE='". $myrow['categoryid'] . "'>" . $myrow['categorydescription']; + echo '<option selected value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } else { - echo "<option VALUE='". $myrow['categoryid'] . "'>" . $myrow['categorydescription']; + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } } echo '</select></td></tr>'; @@ -630,30 +624,31 @@ /*default the order quantity to 1 unit */ $_POST['Qty'] = 1; -echo '<tr><td>' . _('Order Quantity') . ":</td> - <td><input type='Text' class='number' size=7 maxlength=6 name='Qty' value=" . $_POST['Qty'] . "></td></tr>"; +echo '<tr><td>' . _('Order Quantity') . ':</td> + <td><input type="text" class="number" size=7 maxlength=6 name="Qty" value="' . $_POST['Qty'] . '"></td> + </tr>'; if (!isset($_POST['Cost'])) {$_POST['Cost']='';} -echo '<tr><td>' . _('Unit Cost') . ":</td> - <td><input type='Text' class='number' size=15 maxlength=14 name='Cost' value=" . $_POST['Cost'] . "></td></tr>"; +echo '<tr><td>' . _('Unit Cost') . ':</td> + <td><input type="text" class="number" size=15 maxlength=14 name="Cost" value="' . $_POST['Cost'] . '"></td></tr>'; if (!isset($_POST['Price'])) { $_POST['Price']='';} -echo '<tr><td>' . _('Unit Price') . ":</td> - <td><input type='Text' class='number' size=15 maxlength=14 name='Price' value=" . $_POST['Price'] . "></td></tr>"; +echo '<tr><td>' . _('Unit Price') . ':</td> + <td><input type="text" class="number" size=15 maxlength=14 name="Price" value="' . $_POST['Price'] . '"></td></tr>'; /*Default the required delivery date to tomorrow as a starting point */ $_POST['ReqDelDate'] = Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,Date('m'),Date('d')+1,Date('y'))); -echo '<tr><td>' . _('Required Delivery Date') . ":</td> - <td><input type='Text' class='date' alt='".$_SESSION['DefaultDateFormat']."' size=12 maxlength=11 name='ReqDelDate' value=" . $_POST['ReqDelDate'] . "></td></tr>"; +echo '<tr><td>' . _('Required Delivery Date') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" size=12 maxlength=11 name="ReqDelDate" value="' . $_POST['ReqDelDate'] . '"></td></tr>'; echo '</table>'; /* end of main table */ -echo "<div class='centre'><input type=submit Name='EnterLine' VALUE='" . _('Add Item to Order') . "'>"; +echo '<div class="centre"><input type="submit" name="EnterLine" value="' . _('Add Item to Order') . '">'; -echo "<br><br><input type=submit Name='Cancel' VALUE='" . _('Start Again') . "'>"; -echo "<br><br><input type=submit Name='Commit' VALUE='" . _('Process This Order') . "'>"; +echo '<br /><br /><input type="submit" name="Cancel" value="' . _('Start Again') . '">'; +echo '<br /><br /><input type="submit" name="Commit" value="' . _('Process This Order') . '">'; echo '</div></form>'; include('includes/footer.inc'); Modified: trunk/StockCostUpdate.php =================================================================== --- trunk/StockCostUpdate.php 2011-04-28 10:39:25 UTC (rev 4557) +++ trunk/StockCostUpdate.php 2011-04-29 12:43:19 UTC (rev 4558) @@ -15,7 +15,7 @@ $StockID =trim(strtoupper($_POST['StockID'])); } -echo '<a href="' . $rootpath . '/SelectProduct.php?' . SID . '">' . _('Back to Items') . '</a><br>'; +echo '<a href="' . $rootpath . '/SelectProduct.php">' . _('Back to Items') . '</a><br>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Inventory Adjustment') . '" alt="" />' . ' ' . $title . '</p>'; @@ -23,21 +23,21 @@ if (isset($_POST['UpdateData'])){ $sql = "SELECT materialcost, - labourcost, - overheadcost, - mbflag, - sum(quantity) as totalqoh - FROM stockmaster INNER JOIN locstock - ON stockmaster.stockid=locstock.stockid - WHERE stockmaster.stockid='".$StockID."' - GROUP BY description, - units, - lastcost, - actualcost, - materialcost, - labourcost, - overheadcost, - mbflag"; + labourcost, + overheadcost, + mbflag, + sum(quantity) as totalqoh + FROM stockmaster INNER JOIN locstock + ON stockmaster.stockid=locstock.stockid + WHERE stockmaster.stockid='".$StockID."' + GROUP BY description, + units, + lastcost, + actualcost, + materialcost, + labourcost, + overheadcost, + mbflag"; $ErrMsg = _('The entered item code does not exist'); $OldResult = DB_query($sql,$db,$ErrMsg); $OldRow = DB_fetch_array($OldResult); @@ -66,12 +66,11 @@ $Result = DB_Txn_Begin($db); ItemCostUpdateGL($db, $StockID, $NewCost, $OldCost, $_POST['QOH']); - $SQL = "UPDATE stockmaster SET - materialcost='" . $_POST['MaterialCost'] . "', - labourcost='" . $_POST['LabourCost'] . "', - overheadcost='" . $_POST['OverheadCost'] . "', - lastcost='" . $OldCost . "' - WHERE stockid='" . $StockID . "'"; + $SQL = "UPDATE stockmaster SET materialcost='" . $_POST['MaterialCost'] . "', + labourcost='" . $_POST['LabourCost'] . "', + overheadcost='" . $_POST['OverheadCost'] . "', + lastcost='" . $OldCost . "' + WHERE stockid='" . $StockID . "'"; $ErrMsg = _('The cost details for the stock item could not be updated because'); $DbgMsg = _('The SQL that failed was'); @@ -87,30 +86,30 @@ $DbgMsg = _('The SQL that failed was'); $result = DB_query("SELECT description, - units, - lastcost, - actualcost, - materialcost, - labourcost, - overheadcost, - mbflag, - stocktype, - sum(quantity) as totalqoh - FROM stockmaster INNER JOIN locstock - ON stockmaster.stockid=locstock.stockid - INNER JOIN stockcategory - ON stockmaster.categoryid = stockcategory.categoryid - WHERE stockmaster.stockid='" . $StockID . "' - GROUP BY description, - units, - lastcost, - actualcost, - materialcost, - labourcost, - overheadcost, - mbflag, - stocktype", - $db,$ErrMsg,$DbgMsg); + units, + lastcost, + actualcost, + materialcost, + labourcost, + overheadcost, + mbflag, + stocktype, + sum(quantity) as totalqoh + FROM stockmaster INNER JOIN locstock + ON stockmaster.stockid=locstock.stockid + INNER JOIN stockcategory + ON stockmaster.categoryid = stockcategory.categoryid + WHERE stockmaster.stockid='" . $StockID . "' + GROUP BY description, + units, + lastcost, + actualcost, + materialcost, + labourcost, + overheadcost, + mbflag, + stocktype", + $db,$ErrMsg,$DbgMsg); $myrow = DB_fetch_array($result); @@ -125,8 +124,8 @@ echo '<tr><th colspan=2><font color=navy size=2>'. _('Total Quantity On Hand') . ': ' . $myrow['totalqoh'] . ' ' . $myrow['units'] .'</font></th></tr>'; if (($myrow['mbflag']=='D' AND $myrow['stocktype'] != 'L') - OR $myrow['mbflag']=='A' - OR $myrow['mbflag']=='K'){ + OR $myrow['mbflag']=='A' + OR $myrow['mbflag']=='K'){ echo '</form>'; // Close the form if ($myrow['mbflag']=='D'){ echo '<br>' . $StockID .' ' . _('is a service item'); @@ -164,11 +163,11 @@ echo '</table><br /><div class="centre"><input type="submit" name="UpdateData" VALUE="' . _('Update') . '"><br /><br />'; } if ($myrow['mbflag']!='D'){ - echo '<div class="centre"><a href="' . $rootpath . '/StockStatus.php?' . SID . '&StockID=' . $StockID . '>' . _('Show Stock Status') . '</a>'; - echo '<br><a href="' . $rootpath . '/StockMovements.php?' . SID . '&StockID=' . $StockID . '">' . _('Show Stock Movements') . '</a>'; - echo '<br><a href="' . $rootpath . '/StockUsage.php?' . SID . '&StockID=' . $StockID . '">' . _('Show Stock Usage') .'</a>'; - echo '<br><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '&SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Sales Orders') . '</a>'; - echo '<br><a href="' . $rootpath . '/SelectCompletedOrder.php?' . SID . '&SelectedStockItem=' . $StockID . '">' . _('Search Completed Sales Orders') . '</a></div>'; + echo '<div class="centre"><a href="' . $rootpath . '/StockStatus.php?StockID=' . $StockID . '>' . _('Show Stock Status') . '</a>'; + echo '<br><a href="' . $rootpath . '/StockMovements.php?StockID=' . $StockID . '">' . _('Show Stock Movements') . '</a>'; + echo '<br><a href="' . $rootpath . '/StockUsage.php?StockID=' . $StockID . '">' . _('Show Stock Usage') .'</a>'; + echo '<br><a href="' . $rootpath . '/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Sales Orders') . '</a>'; + echo '<br><a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Completed Sales Orders') . '</a></div>'; } echo '</form></div>'; include('includes/footer.inc'); Modified: trunk/StockLocMovements.php =================================================================== --- trunk/StockLocMovements.php 2011-04-28 10:39:25 UTC (rev 4557) +++ trunk/StockLocMovements.php 2011-04-29 12:43:19 UTC (rev 4558) @@ -1,15 +1,13 @@ <?php /* $Id$*/ -//$PageSecurity = 2; - include('includes/session.inc'); $title = _('All Stock Movements By Location'); include('includes/header.inc'); -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . @@ -18,20 +16,20 @@ echo '<table class=selection><tr><td>'; echo ' ' . _('From Stock Location') . ':<select name="StockLocation"> '; -$sql = 'SELECT loccode, locationname FROM locations'; +$sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ if ($myrow['loccode'] == $_POST['StockLocation']){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; $_POST['StockLocation']=$myrow['loccode']; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } @@ -43,7 +41,7 @@ if (!isset($_POST['AfterDate']) OR !Is_Date($_POST['AfterDate'])){ $_POST['AfterDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-1,Date('d'),Date('y'))); } -echo ' ' . _('Show Movements before') . ': <input type=TEXT name="BeforeDate" size=12 maxlength=12 Value="' . $_POST['BeforeDate'] . '">'; +echo ' ' . _('Show Movements before') . ': <input type="text" name="BeforeDate" size=12 maxlength=12 Value="' . $_POST['BeforeDate'] . '">'; echo ' ' . _('But after') . ': <input type=TEXT name="AfterDate" size=12 maxlength=12 Value="' . $_POST['AfterDate'] . '">'; echo '</td></tr></table><br>'; echo '<div class=centre><input type=submit name="ShowMoves" VALUE="' . _('Show Stock Movements') . '"></div><br>'; @@ -77,7 +75,7 @@ $ErrMsg = _('The stock movements for the selected criteria could not be retrieved because'); $MovtsResult = DB_query($sql, $db,$ErrMsg); -echo '<table cellpadding=5 CELLSPACING=4 class=selection>'; +echo '<table cellpadding=5 cellspacing="4 "class="selection">'; $tableheader = '<tr> <th>' . _('Item Code') . '</th> <th>' . _('Type') . '</th> @@ -108,29 +106,29 @@ $DisplayTranDate = ConvertSQLDate($myrow['trandate']); - printf("<td><a target='_blank' href='StockStatus.php?" . SID . "&StockID=%s'>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - </tr>", - strtoupper($myrow['stockid']), - strtoupper($myrow['stockid']), - $myrow['typename'], - $myrow['transno'], - $DisplayTranDate, - $myrow['debtorno'], - number_format($myrow['qty'], - $myrow['decimalplaces']), - $myrow['reference'], - number_format($myrow['price'],2), - number_format($myrow['discountpercent']*100,2), - number_format($myrow['newqoh'],$myrow['decimalplaces'])); + printf('<td><a target="_blank" href="' . $rootpath . '/StockStatus.php?StockID=%s">%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td class=number>%s</td> + <td class=number>%s</td> + </tr>', + strtoupper($myrow['stockid']), + strtoupper($myrow['stockid']), + $myrow['typename'], + $myrow['transno'], + $DisplayTranDate, + $myrow['debtorno'], + number_format($myrow['qty'], + $myrow['decimalplaces']), + $myrow['reference'], + number_format($myrow['price'],$_SESSION['CompanyRecord']['decimalplaces']), + number_format($myrow['discountpercent']*100,2), + number_format($myrow['newqoh'],$myrow['decimalplaces'])); $j++; If ($j == 16){ $j=1; Modified: trunk/StockLocStatus.php =================================================================== --- trunk/StockLocStatus.php 2011-04-28 10:39:25 UTC (rev 4557) +++ trunk/StockLocStatus.php 2011-04-29 12:43:19 UTC (rev 4558) @@ -1,8 +1,7 @@ <?php + /* $Id$*/ -//$PageSecurity = 2; - include('includes/session.inc'); $title = _('All Stock Status By Location/Category'); @@ -16,7 +15,7 @@ } -echo '<form action="' . $_SERVER['PHP_SELF'] . '?'. SID . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $sql = "SELECT loccode, @@ -27,7 +26,9 @@ echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; -echo '<table class=selection><tr><td>' . _('From Stock Location') . ':</td><td><select name="StockLocation"> '; +echo '<table class=selection> + <tr><td>' . _('From Stock Location') . ':</td> + <td><select name="StockLocation"> '; while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ if ($myrow['loccode'] == $_POST['StockLocation']){ @@ -44,17 +45,21 @@ } echo '</select></td></tr>'; -$SQL='SELECT categoryid, categorydescription FROM stockcategory ORDER BY categorydescription'; +$SQL="SELECT categoryid, + categorydescription + FROM stockcategory + ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); if (DB_num_rows($result1)==0){ echo '</table><p>'; prnMsg(_('There are no stock categories currently defined please use the link below to set them up'),'warn'); - echo '<br><a href="' . $rootpath . '/StockCategories.php?' . SID .'">' . _('Define Stock Categories') . '</a>'; + echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a>'; include ('includes/footer.inc'); exit; } -echo '<tr><td>' . _('In Stock Category') . ':</td><td><select name="StockCat">'; +echo '<tr><td>' . _('In Stock Category') . ':</td> + <td><select name="StockCat">'; if (!isset($_POST['StockCat'])){ $_POST['StockCat']='All'; } @@ -73,8 +78,8 @@ echo '</select></td></tr>'; - -echo '<tr><td>' . _('Shown Only Items Where') . ':</td><td><select name="BelowReorderQuantity">'; +echo '<tr><td>' . _('Shown Only Items Where') . ':</td> + <td><select name="BelowReorderQuantity">'; if (!isset($_POST['BelowReorderQuantity'])){ $_POST['BelowReorderQuantity']='All'; } @@ -94,7 +99,7 @@ echo '</td></tr></table>'; -echo '<br><div class="centre"><input type=submit name="ShowStatus" value="' . _('Show Stock Status') . '"></div>'; +echo '<br /><div class="centre"><input type=submit name="ShowStatus" value="' . _('Show Stock Status') . '"></div>'; if (isset($_POST['ShowStatus'])){ @@ -142,7 +147,7 @@ $DbgMsg = _('The SQL that failed was'); $LocStockResult = DB_query($sql, $db, $ErrMsg, $DbgMsg); - echo '<br><table cellpadding=5 cellspacing=4 class=selection>'; + echo '<br /><table cellpadding=5 cellspacing=4 class="selection">'; $tableheader = '<tr> <th>' . _('StockID') . '</th> @@ -161,7 +166,7 @@ $StockID = $myrow['stockid']; - $sql = "SELECT Sum(salesorderdetails.quantity-salesorderdetails.qtyinvoiced) AS dem + $sql = "SELECT SUM(salesorderdetails.quantity-salesorderdetails.qtyinvoiced) AS dem FROM salesorderdetails, salesorders WHERE salesorders.orderno = salesorderdetails.orderno @@ -181,17 +186,17 @@ //Also need to add in the demand as a component of an assembly items if this items has any assembly parents. $sql = "SELECT Sum((salesorderdetails.quantity-salesorderdetails.qtyinvoiced)*bom.quantity) AS dem - FROM salesorderdetails, - salesorders, - bom, - stockmaster - WHERE salesorderdetails.stkcode=bom.parent - AND salesorders.orderno = salesorderdetails.orderno - AND salesorders.fromstkloc='" . $myrow['loccode'] . "' - AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 - AND bom.component='" . $StockID . "' - AND stockmaster.stockid=bom.parent - AND stockmaster.mbflag='A'"; + FROM salesorderdetails, + salesorders, + bom, + stockmaster + WHERE salesorderdetails.stkcode=bom.parent + AND salesorders.orderno = salesorderdetails.orderno + AND salesorders.fromstkloc='" . $myrow['loccode'] . "' + AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 + AND bom.component='" . $StockID . "' + AND stockmaster.stockid=bom.parent + AND stockmaster.mbflag='A'"; $ErrMsg = _('The demand for this product from') . ' ' . $myrow['loccode'] . ' ' . _('cannot be retrieved because'); $DemandResult = DB_query($sql,$db, $ErrMsg); @@ -201,12 +206,12 @@ $DemandQty += $DemandRow[0]; } $sql = "SELECT SUM((woitems.qtyreqd-woitems.qtyrecd)*bom.quantity) AS dem - FROM workorders, woitems, bom - WHERE woitems.wo = workorders.wo - AND woitems.stockid = bom.parent - AND workorders.closed=0 - AND bom.component = '". $StockID . "' - AND workorders.loccode='". $myrow['loccode'] ."'"; + FROM workorders, woitems, bom + WHERE woitems.wo = workorders.wo + AND woitems.stockid = bom.parent + AND workorders.closed=0 + AND bom.component = '". $StockID . "' + AND workorders.loccode='". $myrow['loccode'] ."'"; $DemandResult = DB_query($sql,$db, $ErrMsg); if (DB_num_rows($DemandResult)==1){ @@ -215,19 +220,15 @@ } - $sql = "SELECT SUM(purchorderdetails.quantityord*(CASE WHEN purchdata.conversionfactor IS NULL THEN 1 ELSE purchdata.conversionfactor END) - - purchorderdetails.quantityrecd*(CASE WHEN purchdata.conversionfactor IS NULL THEN 1 ELSE purchdata.conversionfactor END)) AS qoo - FROM purchorderdetails - INNER JOIN purchorders - ON purchorderdetails.orderno=purchorders.orderno - LEFT JOIN purchdata - ON purchorders.supplierno=purchdata.supplierno - AND purchorderdetails.itemcode=purchdata.stockid - WHERE purchorders.intostocklocation='" . $myrow['loccode'] . "' - AND purchorderdetails.itemcode='" . $StockID . "' - AND purchorders.status <> 'Cancelled' - AND purchorders.status <> 'Rejected' - AND purchorders.status <> 'Pending'"; + $sql = "SELECT SUM(purchorderdetails.quantityord - purchorderdetails.quantityrecd) AS qoo + FROM purchorderdetails + INNER JOIN purchorders + ON purchorderdetails.orderno=purchorders.orderno + WHERE purchorders.intostocklocation='" . $myrow['loccode'] . "' + AND purchorderdetails.itemcode='" . $StockID . "' + AND purchorders.status <> 'Cancelled' + AND purchorders.status <> 'Rejected' + AND purchorders.status <> 'Pending'"; $ErrMsg = _('The quantity on order for this product to be received into') . ' ' . $myrow['loccode'] . ' ' . _('cannot be retrieved because'); $QOOResult = DB_query($sql,$db,$ErrMsg); @@ -251,27 +252,29 @@ echo '<tr class="EvenTableRows">'; $k=1; } - printf("<td><a target='_blank' href='StockStatus.php?StockID=%s'>%s</a></td> + printf('<td><a target="_blank" href="' . $rootpath . '/StockStatus.php?StockID=%s">%s</a></td> <td>%s</td> <td class=number>%s</td> <td class=number>%s</td> <td class=number>%s</td> - <td class=number><a target='_blank' href='SelectProduct.php?StockID=%s'>%s</a></td> - <td class=number>%s</td></tr>", + <td class=number><a target="_blank" href="' . $rootpath . 'SelectProduct.php?StockID=%s">%s</a></td> + <td class=number>%s</td> + </tr>', strtoupper($myrow['stockid']), strtoupper($myrow['stockid']), $myrow['description'], number_format($myrow['quantity'],$myrow['decimalplaces']), number_format($myrow['reorderlevel'],$myrow['decimalplaces']), number_format($DemandQty,$myrow['decimalplaces']), - strtoupper($myrow['stockid']), + strtoupper($myrow['stockid']), number_format($myrow['quantity'] - $DemandQty,$myrow['decimalplaces']), number_format($QOO,$myrow['decimalplaces'])); + if ($myrow['serialised'] ==1){ /*The line is a serialised item*/ - echo '<td><a target="_blank" href="' . $rootpath . '/StockSerialItems.php?' . SID . '&Serialised=Yes&Location=' . $myrow['loccode'] . '&StockID=' . $StockID . '">' . _('Serial Numbers') . '</a></td></tr>'; + echo '<td><a target="_blank" href="' . $rootpath . '/StockSerialItems.php?Serialised=Yes&Location=' . $myrow['loccode'] . '&StockID=' . $StockID . '">' . _('Serial Numbers') . '</a></td></tr>'; } elseif ($myrow['controlled']==1){ - echo '<td><a target="_blank" href="' . $rootpath . '/StockSerialItems.php?' . SID . '&Location=' . $myrow['loccode'] . '&StockID=' . $StockID . '">' . _('Batches') . '</a></td></tr>'; + echo '<td><a target="_blank" href="' . $rootpath . '/StockSerialItems.php?Location=' . $myrow['loccode'] . '&StockID=' . $StockID . '">' . _('Batches') . '</a></td></tr>'; } } else if ($_POST['BelowReorderQuantity']!='NotZero') { if ($k==1){ @@ -281,13 +284,13 @@ echo '<tr class="EvenTableRows">'; $k=1; } - printf("<td><a target='_blank' href='StockStatus.php?StockID=%s'>%s</a></td> + printf('<td><a target="_blank" href="' . $rootpath . '/StockStatus.php?StockID=%s">%s</a></td> <td>%s</td> <td class=number>%s</td> <td class=number>%s</td> <td class=number>%s</td> - <td class=number><a target='_blank' href='SelectProduct.php?StockID=%s'>%s</a></td> - <td class=number>%s</td>", + <td class=number><a target="_blank" href="' . $rootpath . 'SelectProduct.php?StockID=%s">%s</a></td> + <td class=number>%s</td>', strtoupper($myrow['stockid']), strtoupper($myrow['stockid']), $myrow['description'], Modified: trunk/StockMovements.php =================================================================== --- trunk/StockMovements.php 2011-04-28 10:39:25 UTC (rev 4557) +++ trunk/StockMovements.php 2011-04-29 12:43:19 UTC (rev 4558) @@ -2,13 +2,10 @@ /* $Id$*/ -//$PageSecurity = 2; - include('includes/session.inc'); $title = _('Stock Movements'); include('includes/header.inc'); - if (isset($_GET['StockID'])){ $StockID = trim(strtoupper($_GET['StockID'])); } elseif (isset($_POST['StockID'])){ @@ -17,50 +14,46 @@ $StockID = ''; } - -// This is already linked from this page -//echo "<a href='" . $rootpath . '/SelectProduct.php?' . SID . "'>" . _('Back to Items') . '</a><br>'; - $result = DB_query("SELECT description, units FROM stockmaster WHERE stockid='".$StockID."'",$db); $myrow = DB_fetch_row($result); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" /><b>' . ' ' . $StockID . ' - ' . $myrow['0'] . ' : ' . _('in units of') . ' : ' . $myrow[1] . '</b></p>'; -echo "<form action='". $_SERVER['PHP_SELF'] . "?" . SID . "' method=post>"; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($_POST['BeforeDate']) OR !Is_Date($_POST['BeforeDate'])){ $_POST['BeforeDate'] = Date($_SESSION['DefaultDateFormat']); } if (!isset($_POST['AfterDate']) OR !Is_Date($_POST['AfterDate'])){ - $_POST['AfterDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date("m")-3,Date("d"),Date("y"))); + $_POST['AfterDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-3,Date('d'),Date('y'))); } echo '<br /><table cellpadding=2 class=selection>'; -echo '<tr><th colspan=10>' . _('Stock Code') . ":<input type=TEXT name='StockID' size=21 VALUE='$StockID' maxlength=20>"; +echo '<tr><th colspan=10>' . _('Stock Code') . ':<input type="text" name="StockID" size=21 value="' . $StockID . '" maxlength=20>'; -echo ' ' . _('From Stock Location') . ":<select name='StockLocation'> "; +echo ' ' . _('From Stock Location') . ':<select name="StockLocation"> '; -$sql = 'SELECT loccode, locationname FROM locations'; +$sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ if ($myrow['loccode'] == $_POST['StockLocation']){ - echo "<option selected VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo "<option selected VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; $_POST['StockLocation']=$myrow['loccode']; } else { - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } echo '</select></th></tr>'; echo '<tr><th colspan=10>' . _('Show Movements before') . ': <input type=text name="BeforeDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" VALUE="' . $_POST['BeforeDate'] . '">'; echo ' ' . _('But after') . ': <input type=TEXT name="AfterDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" VALUE="' . $_POST['AfterDate'] . '">'; -echo " <input type=submit name='ShowMoves' VALUE='" . _('Show Stock Movements') . "'></th></tr>"; +echo ' <input type="submit" name="ShowMoves" value="' . _('Show Stock Movements') . '"></th></tr>'; $SQLBeforeDate = FormatDateForSQL($_POST['BeforeDate']); $SQLAfterDate = FormatDateForSQL($_POST['AfterDate']); @@ -93,14 +86,19 @@ $MovtsResult = DB_query($sql, $db, $ErrMsg, $DbgMsg); -$tableheader = "<tr> - <th>" . _('Type') . "</th><th>" . _('Number') . "</th> - <th>" . _('Date') . "</th><th>" . _('Customer') . "</th> - <th>" . _('Branch') . "</th><th>" . _('Quantity') . "</th> - <th>" . _('Reference') . "</th><th>" . _('Price') . "</th> - <th>" . _('Discount') . "</th><th>" . _('New Qty') . "</th> - </tr>"; - +$tableheader = '<tr> + <th>' . _('Type') . '</th> + <th>' . _('Number') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Branch') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Reference') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('New Qty') . '</th> + </tr>'; + echo $tableheader; $j = 1; @@ -120,61 +118,59 @@ if ($myrow['type']==10){ /*its a sales invoice allow link to show invoice it was sold on*/ - printf("<td><a TARGET='_blank' href='%s/PrintCustTrans.php?%s&FromTransNo=%s&InvOrCredit=Invoice'>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s%%</td> - <td class=number>%s</td> - </tr>", - $rootpath, - SID, - $myrow['transno'], - $myrow['typename'], - $myrow['transno'], - $DisplayTranDate, - $myrow['debtorno'], - $myrow['branchcode'], - number_format($myrow['qty'], - $myrow['decimalplaces']), - $myrow['reference'], - number_format($myrow['price'],2), - number_format($myrow['discountpercent']*100,2), - number_format($myrow['newqoh'],$myrow['decimalplaces'])); + printf('<td><a target="_blank" href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice">%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td class=number>%s%%</td> + <td class=number>%s</td> + </tr>', + $rootpath, + $myrow['transno'], + $myrow['typename'], + $myrow['transno'], + $DisplayTranDate, + $myrow['debtorno'], + $myrow['branchcode'], + number_format($myrow['qty'], + $myrow['decimalplaces']), + $myrow['reference'], + number_format($myrow['price'],2), + number_format($myrow['discountpercent']*100,2), + number_format($myrow['newqoh'],$myrow['decimalplaces'])); } elseif ($myrow['type']==11){ - printf("<td><a TARGET='_blank' href='%s/PrintCustTrans.php?%s&FromTransNo=%s&InvOrCredit=Credit'>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s%%</td> - <td class=number>%s</td> - </tr>", - $rootpath, - SID, - $myrow['transno'], - $myrow['typename'], - $myrow['transno'], - $DisplayTranDate, - $myrow['debtorno'], - $myrow['branchcode'], - number_format($myrow['qty'],$myrow['decimalplaces']), - $myrow['reference'], - number_format($myrow['price'],2), - number_format($myrow['discountpercent']*100,2), - number_format($myrow['newqoh'],$myrow['decimalplaces'])); + printf('<td><a target="_blank" href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Credit">%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td class=number>%s%%</td> + <td class=number>%s</td> + </tr>', + $rootpath, + $myrow['transno'], + $myrow['typename'], + $myrow['transno'], + $DisplayTranDate, + $myrow['debtorno'], + $myrow['branchcode'], + number_format($myrow['qty'],$myrow['decimalplaces']), + $myrow['reference'], + number_format($myrow['price'],$_SESSION['CompanyRecord']['decimalplaces']), + number_format($myrow['discountpercent']*100,2), + number_format($myrow['newqoh'],$myrow['decimalplaces'])); } else { - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> @@ -184,7 +180,7 @@ <td class=number>%s</td> <td class=number>%s%%</td> <td class=number>%s</td> - </tr>", + </tr>', $myrow['typename'], $myrow['transno'], $DisplayTranDate, @@ -192,7 +188,7 @@ $myrow['branchcode'], number_format($myrow['qty'],$myrow['decimalplaces']), $myrow['reference'], - number_format($myrow['price'],2), + number_format($myrow['price'],$_SESSION['CompanyRecord']['decimalplaces']), number_format($myrow['discountpercent']*100,2), number_format($myrow['newqoh'],$myrow['decimalplaces'])); } @@ -201,10 +197,10 @@ //end of while loop echo '</table>'; -echo "<div class=centre><br /><a href='$rootpath/StockStatus.php?" . SID . "&StockID=$StockID'>" . _('Show Stock Status') . '</a>'; -echo "<br><a href='$rootpath/StockUsage.php?" . SID . "&StockID=$StockID&StockLocation=" . $_POST['StockLocation'] . "'>" . _('Show Stock Usage') . '</a>'; -echo "<br><a href='$rootpath/SelectSalesOrder.php?" . SID . "&SelectedStockItem=$StockID&StockLocation=" . $_POST['StockLocation'] . "'>" . _('Search Outstanding Sales Orders') . '</a>'; -echo "<br><a href='$rootpath/SelectCompletedOrder.php?" . SID . "&SelectedStockItem=$StockID'>" . _('Search Completed Sales Orders') . '</a>'; +echo '<div class="centre"><br /><a href="' . $rootpath . '/StockStatus.php?StockID=' . $StockID . '">' . _('Show Stock Status') . '</a>'; +echo '<br /><a href="' . $rootpath . '/StockUsage.php?StockID=' . $StockID . '&StockLocation=' . $_POST['StockLocation'] . '">' . _('Show Stock Usage') . '</a>'; +echo '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '&StockLocation=' . $_POST['StockLocation'] . '">' . _('Search Outstanding Sales Orders') . '</a>'; +echo '<br /><a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Completed Sales Orders') . '</a>'; echo '</form></div>'; Modified: trunk/StockQuantityByDate.php =================================================================== --- trunk/StockQuantityByDate.php 2011-04-28 10:39:25 UTC (rev 4557) +++ trunk/StockQuantityByDate.php 2011-04-29 12:43:19 UTC (rev 4558) @@ -1,11 +1,7 @@ <?php /* $Id$ */ -/* Contributed by Chris Bice - gettext by Kitch*/ - -//$PageSecurity = 2; - include('includes/session.inc'); $title = _('Stock On Hand By Date'); include('includes/header.inc'); @@ -13,65 +9,65 @@ echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" /><b>' . $title. '</b></p>'; -echo "<form action='" . $_SERVER['PHP_SELF'] . "?". SID . "' method=post>"; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -$sql = 'SELECT categoryid, categorydescription FROM stockcategory'; +$sql = "SELECT categoryid, categorydescription FROM stockcategory"; $resultStkLocs = DB_query($sql, $db); echo '<table class=selection><tr>'; -echo '<td>' . _('For Stock Category') . ":</td> - <td><select name='StockCategory'> "; +echo '<td>' . _('For Stock Category') . ':</td> + <td><select name="StockCategory"> '; echo '<option value="All">' . _('All') . '</option>'; while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockCategory']) AND $_POST['StockCategory']!='All'){ if ($myrow['categoryid'] == $_POST['StockCategory']){ - echo "<option selected VALUE='" . $myrow['categoryid'] . "'>" . $myrow['categorydescription'] . '</option>'; + echo '<option selected value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } else { - echo "<option VALUE='" . $myrow['categoryid'] . "'>" . $myrow['categorydescription'] . '</option>'; + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } }else { - echo "<option VALUE='" . $myrow['categoryid'] . "'>" . $myrow['categorydescription'] . '</option>'; + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } } echo '</select></td>'; -$sql = 'SELECT loccode, locationname FROM locations'; +$sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql, $db); -echo '<td>' . _('For Stock Location') . ":</td> - <td><select name='StockLocation'> "; +echo '<td>' . _('For Stock Location') . ':</td> + <td><select name="StockLocation"> '; while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ if ($myrow['loccode'] == $_POST['StockLocation']){ - echo "<option selected VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo "<option selected VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; $_POST['StockLocation']=$myrow['loccode']; } else { - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } echo '</select></td>'; if (!isset($_POST['OnHandDate'])){ - $_POST['OnHandDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date("m"),0,Date("y"))); + $_POST['OnHandDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),0,Date('y'))); } -echo '<td>' . _("On-Hand On Date") . ":</td> - <td><input type=TEXT class='date' alt='".$_SESSION['DefaultDateFormat']."' name='OnHandDate' size=12 maxlength=12 VALUE='" . $_POST['OnHandDate'] . "'></td></tr>"; -echo "<tr><td colspan=6><div class='centre'><input type=submit n... [truncated message content] |
From: <dai...@us...> - 2011-04-29 12:43:29
|
Revision: 4558 http://web-erp.svn.sourceforge.net/web-erp/?rev=4558&view=rev Author: daintree Date: 2011-04-29 12:43:19 +0000 (Fri, 29 Apr 2011) Log Message: ----------- quoting Modified Paths: -------------- trunk/PO_Header.php trunk/SpecialOrder.php trunk/StockCostUpdate.php trunk/StockLocMovements.php trunk/StockLocStatus.php trunk/StockMovements.php trunk/StockQuantityByDate.php trunk/includes/GetConfig.php 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/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.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/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-04-28 10:39:25 UTC (rev 4557) +++ trunk/PO_Header.php 2011-04-29 12:43:19 UTC (rev 4558) @@ -805,7 +805,7 @@ echo '</select></td></tr>'; echo '<tr><td>' . _('Status Comment') . ':</td> - <td><input type=text name="StatusComments" size=50></td></tr> + <td><input type=text name="StatusComments" size=50></td></tr> <tr><td colspan=2><b>' . $_SESSION['PO'.$identifier]->StatusComments .'</b></td></tr>'; //need to use single quotes as double quotes inside the string of StatusComments echo '<input type="hidden" name="StatusCommentsComplete" value="' . $_SESSION['PO'.$identifier]->StatusComments .'">'; Modified: trunk/SpecialOrder.php =================================================================== --- trunk/SpecialOrder.php 2011-04-28 10:39:25 UTC (rev 4557) +++ trunk/SpecialOrder.php 2011-04-29 12:43:19 UTC (rev 4558) @@ -2,8 +2,6 @@ /* $Id$ */ -//$PageSecurity = 4; - include('includes/DefineSpecialOrderClass.php'); /* Session started in header.inc for password checking and authorisation level check */ include('includes/session.inc'); @@ -13,7 +11,7 @@ include('includes/header.inc'); -echo "<form action='" . $_SERVER['PHP_SELF'] . "?" . SID . "' method=post>"; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -22,15 +20,15 @@ } if (!isset($_SESSION['SupplierID'])){ - echo '<br><br>'; + echo '<br /><br />'; prnMsg(_('To set up a special') . ', ' . _('the supplier must first be selected from the Select Supplier page'),'info'); - echo "<br><a href='$rootpath/SelectSupplier.php?" . SID . "'>" . _('Select the supplier now') . "</a>"; + echo '<br /><a href="' . $rootpath . '/SelectSupplier.php">' . _('Select the supplier now') . '</a>'; include('includes/footer.inc'); exit; } if (!isset($_SESSION['CustomerID']) OR $_SESSION['CustomerID']==""){ - echo "<br><br>" . _('To set up a special') . ', ' . _('the customer must first be selected from the Select Customer page') . "<br><a href='$rootpath/SelectCustomer.php?" . SID . "'>" . _('Select the customer now') . "</a>"; + echo '<br /><br />' . _('To set up a special') . ', ' . _('the customer must first be selected from the Select Customer page') . '<br /><a href="' . $rootpath . '/SelectCustomer.php">' . _('Select the customer now') . '</a>'; include('includes/footer.inc'); exit; } @@ -110,9 +108,9 @@ } echo '<div class="centre">'; if (!isset($_SESSION['SPL']->BranchCode)){ - echo "<br><font size=4 color=BLUE>" . _('Purchase from') . " " . $_SESSION['SPL']->SupplierName . " " . _('in') . " " . $_SESSION['SPL']->SuppCurrCode . " " . _('for') . " " . $_SESSION['SPL']->CustomerName . " (" . $_SESSION['SPL']->CustCurrCode . ")"; + echo '<br /><font size=4 color=blue>' . _('Purchase from') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('in') . ' ' . $_SESSION['SPL']->SuppCurrCode . ' ' . _('for') . ' ' . $_SESSION['SPL']->CustomerName . ' (' . $_SESSION['SPL']->CustCurrCode . ')'; } else { - echo '<br><font size=4 color=BLUE>' . _('Purchase from') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('in') . ' ' . $_SESSION['SPL']->SuppCurrCode . ' ' . _('for') . ' ' . $_SESSION['SPL']->CustomerName . ' (' . $_SESSION['SPL']->CustCurrCode . ') - ' . _('delivered to') . ' ' . $_SESSION['SPL']->BranchName . ' ' . _('branch'); + echo '<br /><font size=4 color=BLUE>' . _('Purchase from') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('in') . ' ' . $_SESSION['SPL']->SuppCurrCode . ' ' . _('for') . ' ' . $_SESSION['SPL']->CustomerName . ' (' . $_SESSION['SPL']->CustCurrCode . ') - ' . _('delivered to') . ' ' . $_SESSION['SPL']->BranchName . ' ' . _('branch'); } echo '</div></font>'; /*if the branch details and delivery details have not been entered then select them from the list */ @@ -127,12 +125,13 @@ If (DB_num_rows($BranchResult)>0) { echo '<div class="centre">'; - echo '<br><br>' . _('Select the customer branch to deliver the special to from the list below'); + echo '<br /><br />' . _('Select the customer branch to deliver the special to from the list below'); - echo '</div><br><table cellpadding=3 colspan=2 BORDER=1>'; + echo '</div><br /><table cellpadding=3 colspan=2 BORDER=1>'; - $tableheader = "<tr><th>" ._('Code') . "</th> - <th>" . _('Branch Name') . "</th></tr>"; + $tableheader = '<tr><th>' ._('Code') . '</th> + <th>' . _('Branch Name') . '</th> + </tr>'; echo $tableheader; $j = 1; @@ -148,7 +147,11 @@ $k++; } - printf("<td><input type=submit name='SelectBranch' VALUE='%s'</td><td>%s</td></tr>", $myrow['branchcode'], $myrow['brname']); + printf('<td><input type="submit" name="SelectBranch" value="%s"</td> + <td>%s</td> + </tr>', + $myrow['branchcode'], + $myrow['brname']); //end of page full new headings if } @@ -189,32 +192,32 @@ if (!is_numeric($_POST['Qty'])){ $AllowAdd = False; - prnMsg( _('Cannot Enter this order line') . '<br>' . _('The quantity of the order item must be numeric'),'warn'); + prnMsg( _('Cannot Enter this order line') . '<br />' . _('The quantity of the order item must be numeric'),'warn'); } if ($_POST['Qty']<0){ $AllowAdd = False; - prnMsg( _('Cannot Enter this order line') . '<br>' . _('The quantity of the ordered item entered must be a positive amount'),'warn'); + prnMsg( _('Cannot Enter this order line') . '<br />' . _('The quantity of the ordered item entered must be a positive amount'),'warn'); } if (!is_numeric($_POST['Price'])){ $AllowAdd = False; - prnMsg( _('Cannot Enter this order line') . '<br>' . _('The price entered must be numeric'),'warn'); + prnMsg( _('Cannot Enter this order line') . '<br />' . _('The price entered must be numeric'),'warn'); } if (!is_numeric($_POST['Cost'])){ $AllowAdd = False; - prnMsg( _('Cannot Enter this order line') . '<br>' . _('The cost entered must be numeric'),'warn'); + prnMsg( _('Cannot Enter this order line') . '<br />' . _('The cost entered must be numeric'),'warn'); } if ((($_POST['Price']/$_SESSION['SPL']->CustCurrExRate)-($_POST['Cost']/$_SESSION['SPL']->SuppCurrExRate))<0){ $AllowAdd = False; - prnMsg( _('Cannot Enter this order line') . '<br>' . _('The sale is at a lower price than the cost'),'warn'); + prnMsg( _('Cannot Enter this order line') . '<br />' . _('The sale is at a lower price than the cost'),'warn'); } if (!Is_Date($_POST['ReqDelDate'])){ $AllowAdd = False; - prnMsg( _('Cannot Enter this order line') . '<br>' . _('The date entered must be in the format') . ' ' . $_SESSION['DefaultDateFormat'],'warn'); + prnMsg( _('Cannot Enter this order line') . '<br />' . _('The date entered must be in the format') . ' ' . $_SESSION['DefaultDateFormat'],'warn'); } If ($AllowAdd == True){ @@ -292,7 +295,7 @@ $sql = $sql . "'" . $_SESSION['SPL']->SupplierID . "', '" . $_SESSION['SPL']->Comments . "', - '" . Date("Y-m-d") . "', + '" . Date('Y-m-d') . "', '" . $_SESSION['SPL']->SuppCurrExRate . "', '" . $_SESSION['SPL']->Initiator . "', '" . $_SESSION['SPL']->QuotationRef . "', @@ -307,11 +310,9 @@ $ErrMsg = _('The purchase order header record could not be inserted into the database because'); - $DbgMsg = _('The SQL statement used to insert the purchase order header record and failed was') . "<br>$sql"; + $DbgMsg = _('The SQL statement used to insert the purchase order header record and failed was') . '<br />' . $sql; $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); - /*Get the auto increment value of the order number created from the SQL above */ -// $_SESSION['SPL']->PurchOrderNo = DB_Last_Insert_ID($db,'purchorders','orderno'); $_SESSION['SPL']->PurchOrderNo = GetNextTransNo(18, $db); @@ -355,7 +356,7 @@ $ErrMsg = _('The item record for line') . " " . $SPLLine->LineNo . " " . _('could not be create because'); - $DbgMsg = _('The SQL statement used to insert the item and failed was') . "<br>$sql"; + $DbgMsg = _('The SQL statement used to insert the item and failed was') . "<br />$sql"; $result =DB_query($sql,$db,$ErrMsg,$DbgMsg,true); @@ -397,8 +398,8 @@ } /* end of the loop round the detail line items on the order */ - echo '<br><br>' . _('Purchase Order') . ' ' . $_SESSION['SPL']->PurchOrderNo . ' ' . _('on') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('has been created'); - echo "<br><a href='$rootpath/PO_PDFPurchOrder.php?" . SID . '&OrderNo=' . $_SESSION['SPL']->PurchOrderNo . "'>" . _('Print Purchase Order') . '</a>'; + echo '<br /><br />' . _('Purchase Order') . ' ' . $_SESSION['SPL']->PurchOrderNo . ' ' . _('on') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('has been created'); + echo '<br /><a href="' . $rootpath . '/PO_PDFPurchOrder.php?OrderNo=' . $_SESSION['SPL']->PurchOrderNo . '">' . _('Print Purchase Order') . '</a>'; /*Now insert the sales order too */ @@ -448,7 +449,7 @@ '" . $_SESSION['SPL']->CustomerID . "', '" . $_SESSION['SPL']->BranchCode . "', '" . $_SESSION['SPL']->CustRef ."', - '" . Date("Y-m-d") . "', + '" . Date('Y-m-d') . "', '" . $BranchDetails['salestype'] . "', '" . $BranchDetails['defaultshipvia'] ."', '" . $BranchDetails['brname'] . "', @@ -466,9 +467,6 @@ $ErrMsg = _('The sales order cannot be added because'); $InsertQryResult = DB_query($HeaderSQL,$db,$ErrMsg, $DbMsg); -// $SalesOrderNo = DB_Last_Insert_ID($db,'salesorders','orderno'); -// $SalesOrderNo = GetNextTransNo(30, $db); - $StartOf_LineItemsSQL = "INSERT INTO salesorderdetails (orderno, stkcode, unitprice, @@ -486,20 +484,20 @@ } /* inserted line items into sales order details */ unset ($_SESSION['SPL']); - prnMsg(_('Sales Order Number') . ' ' . $SalesOrderNo . ' ' . _('has been entered') . '. <p>' . _('Orders created on a cash sales account may need the delivery details for the order to be modified') . '. <br><br>' . _('A freight charge may also be applicable'),'success'); + prnMsg(_('Sales Order Number') . ' ' . $SalesOrderNo . ' ' . _('has been entered') . '. <p>' . _('Orders created on a cash sales account may need the delivery details for the order to be modified') . '. <br /><br />' . _('A freight charge may also be applicable'),'success'); if (count($_SESSION['AllowedPageSecurityTokens'])>1){ /* Only allow print of packing slip for internal staff - customer logon's cannot go here */ - echo "<p><a href='$rootpath/PrintCustOrder.php?" . SID . "&TransNo=" . $SalesOrderNo . "'>" . _('Print packing slip') . ' (' . _('Preprinted stationery') . ')</a>'; - echo "<p><a href='$rootpath/PrintCustOrder_generic.php?" . SID . '&TransNo=' . $SalesOrderNo . "'>" . _('Print packing slip') . ' (' . _('Laser') . ')</a>'; + echo '<p><a href="' . $rootpath . '/PrintCustOrder.php?TransNo=' . $SalesOrderNo . '">' . _('Print packing slip') . ' (' . _('Preprinted stationery') . ')</a>'; + echo '<p><a href="' . $rootpath . '/PrintCustOrder_generic.php?TransNo=' . $SalesOrderNo . '">' . _('Print packing slip') . ' (' . _('Laser') . ')</a>'; } $Result = DB_Txn_Commit($db); unset($_SESSION['SPL']); /*Clear the PO data to allow a newy to be input*/ - echo "<br><br><a href='$rootpath/SpecialOrder.php?" . SID . "'>" . _('Enter A New Special Order') . "</a>"; + echo '<br /><br /><a href="' . $rootpath . '/SpecialOrder.php">' . _('Enter A New Special Order') . '</a>'; exit; } /*end if there were no input errors trapped */ } /* end of the code to do transfer the SPL object to the database - user hit the place Order*/ @@ -507,56 +505,49 @@ /*Show the header information for modification */ -echo "<table><tr><td>" . _('Receive Purchase Into and Sell From') . ": <select name='StkLocation'>"; +echo '<table><tr><td>' . _('Receive Purchase Into and Sell From') . ': <select name="StkLocation">'; $sql = "SELECT loccode, locationname FROM locations"; $LocnResult = DB_query($sql,$db); -if (!isset($_SESSION['SPL']->StkLocation) OR $_SESSION['SPL']->StkLocation==""){ /*If this is the first time the form loaded set up defaults */ +if (!isset($_SESSION['SPL']->StkLocation) OR $_SESSION['SPL']->StkLocation==''){ /*If this is the first time the form loaded set up defaults */ $_SESSION['SPL']->StkLocation = $_SESSION['UserStockLocation']; } while ($LocnRow=DB_fetch_array($LocnResult)){ if ($_SESSION['SPL']->StkLocation == $LocnRow['loccode']){ - echo "<option selected Value='" . $LocnRow['loccode'] . "'>" . $LocnRow['locationname']; + echo '<option selected value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; } else { - echo "<option Value='" . $LocnRow['loccode'] . "'>" . $LocnRow['locationname']; + echo '<option Value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; } } -echo "</select></td>"; +echo '</select></td>'; -echo "<td>" . _('Initiated By') . ": <input type=TEXT name='Initiator' size=11 maxlength=10 VALUE=" . $_SESSION['SPL']->Initiator . "></td>"; -echo "<td>" . _('Special Ref') . ": <input type=TEXT name='QuotationRef' size=16 maxlength=15 VALUE=" . $_SESSION['SPL']->QuotationRef . "></td>"; -echo "<td>" . _('Customer Ref') . ": <input type=TEXT name='CustRef' size=11 maxlength=10 VALUE=" . $_SESSION['SPL']->CustRef . "></td></tr>"; +echo '<td>' . _('Initiated By') . ': <input type="text" name="Initiator" size=11 maxlength=10 value="' . $_SESSION['SPL']->Initiator . '"></td> + <td>' . _('Special Ref') . ': <input type="text" name="QuotationRef" size=16 maxlength=15 value="' . $_SESSION['SPL']->QuotationRef . '"></td> + <td>' . _('Customer Ref') . ': <input type="text" name="CustRef" size=11 maxlength=10 value="' . $_SESSION['SPL']->CustRef . '"></td></tr> + <tr><td valign=top colspan=2>' . _('Comments') . ': <textarea name="Comments" cols=70 rows=2>' . $_SESSION['SPL']->Comments . '</textarea></td></tr> +</table> +<hr>'; /* Rule off the header */ -echo "<tr><td VALIGN=TOP colspan=2>" . _('Comments') . ":"; -echo "<textarea name='Comments' cols=70 rows=2>" . $_SESSION['SPL']->Comments . "</textarea></td></tr></table>"; - -echo "<hr>"; /* Rule off the header */ - /*Now show the order so far */ if (count($_SESSION['SPL']->LineItems)>0){ - echo "<div class='centre'>><b>" . _('Special Order Summary') . "</b></div>"; - echo "<table cellpadding=2 colspan=7 border=1>"; + echo '<div class="centre">><b>' . _('Special Order Summary') . '</b></div>'; + echo '<table cellpadding=2 colspan=7 border=1>'; - $sql = 'select currencydefault from companies'; - $result = DB_query($sql, $db); - $myrow = DB_fetch_row($result); - $DefaultCurrency = $myrow[0]; + echo '<tr> + <th>' . _('Item Description') . '</th> + <th>' . _('Delivery') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Purchase Cost') . '<br />' . $_SESSION['SPL']->SuppCurrCode . '</th> + <th>' . _('Sell Price') . '<br />' . $_SESSION['SPL']->CustCurrCode . '</th> + <th>' . _('Total Cost') . '<br />' . $_SESSION['SPL']->SuppCurrCode . '</th> + <th>' . _('Total Price') . '<br />' . $_SESSION['SPL']->CustCurrCode . '</th> + <th>' . _('Total Cost') . '<br />' . $_SESSION['CompanyRecord']['currencydefault'] . '</th> + <th>' . _('Total Price') . '<br />' . $_SESSION['CompanyRecord']['currencydefault'] . '</th> + </tr>'; - echo "<tr> - <th>" . _('Item Description') . "</th> - <th>" . _('Delivery') . "</th> - <th>" . _('Quantity') . "</th> - <th>" . _('Purchase Cost') . '<br>' . $_SESSION['SPL']->SuppCurrCode . "</th> - <th>" . _('Sell Price') . '<br>' . $_SESSION['SPL']->CustCurrCode . "</th> - <th>" . _('Total Cost') . '<br>' . $_SESSION['SPL']->SuppCurrCode . "</th> - <th>" . _('Total Price') . '<br>' . $_SESSION['SPL']->CustCurrCode . "</th> - <th>" . _('Total Cost') . '<br>' . $DefaultCurrency . "</th> - <th>" . _('Total Price') . '<br>' . $DefaultCurrency . "</th> - </tr>"; - $_SESSION['SPL']->total = 0; $k = 0; //row colour counter foreach ($_SESSION['SPL']->LineItems as $SPLLine) { @@ -579,38 +570,41 @@ $k=1; } echo '<td>' . $SPLLine->ItemDescription . '</td> - <td>' . $SPLLine->ReqDelDate . "</td> - <td class=number>$DisplayQuantity</td> - <td class=number>$DisplayCost</td> - <td class=number>$DisplayPrice</td> - <td class=number>$DisplayLineCostTotal</td> - <td class=number>$DisplayLineTotal</td> - <td class=number>$DisplayLineCostTotalCurr</td> - <td class=number>$DisplayLineTotalCurr</td> - <td><a href='" . $_SERVER['PHP_SELF'] . "?" . SID .'&Delete=' . $SPLLine->LineNo . "'>" . _('Delete') . '</a></td></tr>'; + <td>' . $SPLLine->ReqDelDate . '</td> + <td class=number>' . $DisplayQuantity . '</td> + <td class=number>' . $DisplayCost . '</td> + <td class=number>' . $DisplayPrice . '</td> + <td class=number>' . $DisplayLineCostTotal . '</td> + <td class=number>' . $DisplayLineTotal . '</td> + <td class=number>' . $DisplayLineCostTotalCurr . '</td> + <td class=number>' . $DisplayLineTotalCurr . '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $SPLLine->LineNo . '">' . _('Delete') . '</a></td></tr>'; $_SESSION['SPL']->total = $_SESSION['SPL']->total + $DisplayLineTotalCurr; } $DisplayTotal = number_format($_SESSION['SPL']->total,2); echo '<tr> - <td colspan=8 class=number>' . _('TOTAL Excl Tax') . "</td> - <td class=number><b>$DisplayTotal</b></td> - </tr></table>"; + <td colspan=8 class=number>' . _('TOTAL Excl Tax') . '</td> + <td class=number><b>' . $DisplayTotal . '</b></td> + </tr> + </table>'; } /*Set up the form to enter new special items into */ -echo "<table>"; +echo '<table>'; -echo "<input type='hidden' name='LineNo' value=" . ($_SESSION['SPL']->LinesOnOrder + 1) .">"; +echo '<input type="hidden" name="LineNo" value="' . ($_SESSION['SPL']->LinesOnOrder + 1) .'" />'; if (!isset($_POST['ItemDescription'])) {$_POST['ItemDescription']='';} -echo '<tr><td>' . _('Ordered item Description') . ":</td><td><input type=TEXT name='ItemDescription' size=40 maxlength=40 VALUE='" . $_POST['ItemDescription'] . "'></td></tr>"; +echo '<tr><td>' . _('Ordered item Description') . ':</td> + <td><input type="text" name="ItemDescription" size=40 maxlength=40 value="' . $_POST['ItemDescription'] . '"></td></tr>'; -echo '<tr><td>' . _('Category') . ':</td><td><select name=StkCat>'; +echo '<tr><td>' . _('Category') . ':</td> + <td><select name=StkCat>'; $sql = "SELECT categoryid, categorydescription FROM stockcategory"; $ErrMsg = _('The stock categories could not be retrieved because'); @@ -619,9 +613,9 @@ while ($myrow=DB_fetch_array($result)){ if (isset($_POST['StkCat']) and $myrow['categoryid']==$_POST['StkCat']){ - echo "<option selected VALUE='". $myrow['categoryid'] . "'>" . $myrow['categorydescription']; + echo '<option selected value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } else { - echo "<option VALUE='". $myrow['categoryid'] . "'>" . $myrow['categorydescription']; + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } } echo '</select></td></tr>'; @@ -630,30 +624,31 @@ /*default the order quantity to 1 unit */ $_POST['Qty'] = 1; -echo '<tr><td>' . _('Order Quantity') . ":</td> - <td><input type='Text' class='number' size=7 maxlength=6 name='Qty' value=" . $_POST['Qty'] . "></td></tr>"; +echo '<tr><td>' . _('Order Quantity') . ':</td> + <td><input type="text" class="number" size=7 maxlength=6 name="Qty" value="' . $_POST['Qty'] . '"></td> + </tr>'; if (!isset($_POST['Cost'])) {$_POST['Cost']='';} -echo '<tr><td>' . _('Unit Cost') . ":</td> - <td><input type='Text' class='number' size=15 maxlength=14 name='Cost' value=" . $_POST['Cost'] . "></td></tr>"; +echo '<tr><td>' . _('Unit Cost') . ':</td> + <td><input type="text" class="number" size=15 maxlength=14 name="Cost" value="' . $_POST['Cost'] . '"></td></tr>'; if (!isset($_POST['Price'])) { $_POST['Price']='';} -echo '<tr><td>' . _('Unit Price') . ":</td> - <td><input type='Text' class='number' size=15 maxlength=14 name='Price' value=" . $_POST['Price'] . "></td></tr>"; +echo '<tr><td>' . _('Unit Price') . ':</td> + <td><input type="text" class="number" size=15 maxlength=14 name="Price" value="' . $_POST['Price'] . '"></td></tr>'; /*Default the required delivery date to tomorrow as a starting point */ $_POST['ReqDelDate'] = Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,Date('m'),Date('d')+1,Date('y'))); -echo '<tr><td>' . _('Required Delivery Date') . ":</td> - <td><input type='Text' class='date' alt='".$_SESSION['DefaultDateFormat']."' size=12 maxlength=11 name='ReqDelDate' value=" . $_POST['ReqDelDate'] . "></td></tr>"; +echo '<tr><td>' . _('Required Delivery Date') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" size=12 maxlength=11 name="ReqDelDate" value="' . $_POST['ReqDelDate'] . '"></td></tr>'; echo '</table>'; /* end of main table */ -echo "<div class='centre'><input type=submit Name='EnterLine' VALUE='" . _('Add Item to Order') . "'>"; +echo '<div class="centre"><input type="submit" name="EnterLine" value="' . _('Add Item to Order') . '">'; -echo "<br><br><input type=submit Name='Cancel' VALUE='" . _('Start Again') . "'>"; -echo "<br><br><input type=submit Name='Commit' VALUE='" . _('Process This Order') . "'>"; +echo '<br /><br /><input type="submit" name="Cancel" value="' . _('Start Again') . '">'; +echo '<br /><br /><input type="submit" name="Commit" value="' . _('Process This Order') . '">'; echo '</div></form>'; include('includes/footer.inc'); Modified: trunk/StockCostUpdate.php =================================================================== --- trunk/StockCostUpdate.php 2011-04-28 10:39:25 UTC (rev 4557) +++ trunk/StockCostUpdate.php 2011-04-29 12:43:19 UTC (rev 4558) @@ -15,7 +15,7 @@ $StockID =trim(strtoupper($_POST['StockID'])); } -echo '<a href="' . $rootpath . '/SelectProduct.php?' . SID . '">' . _('Back to Items') . '</a><br>'; +echo '<a href="' . $rootpath . '/SelectProduct.php">' . _('Back to Items') . '</a><br>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Inventory Adjustment') . '" alt="" />' . ' ' . $title . '</p>'; @@ -23,21 +23,21 @@ if (isset($_POST['UpdateData'])){ $sql = "SELECT materialcost, - labourcost, - overheadcost, - mbflag, - sum(quantity) as totalqoh - FROM stockmaster INNER JOIN locstock - ON stockmaster.stockid=locstock.stockid - WHERE stockmaster.stockid='".$StockID."' - GROUP BY description, - units, - lastcost, - actualcost, - materialcost, - labourcost, - overheadcost, - mbflag"; + labourcost, + overheadcost, + mbflag, + sum(quantity) as totalqoh + FROM stockmaster INNER JOIN locstock + ON stockmaster.stockid=locstock.stockid + WHERE stockmaster.stockid='".$StockID."' + GROUP BY description, + units, + lastcost, + actualcost, + materialcost, + labourcost, + overheadcost, + mbflag"; $ErrMsg = _('The entered item code does not exist'); $OldResult = DB_query($sql,$db,$ErrMsg); $OldRow = DB_fetch_array($OldResult); @@ -66,12 +66,11 @@ $Result = DB_Txn_Begin($db); ItemCostUpdateGL($db, $StockID, $NewCost, $OldCost, $_POST['QOH']); - $SQL = "UPDATE stockmaster SET - materialcost='" . $_POST['MaterialCost'] . "', - labourcost='" . $_POST['LabourCost'] . "', - overheadcost='" . $_POST['OverheadCost'] . "', - lastcost='" . $OldCost . "' - WHERE stockid='" . $StockID . "'"; + $SQL = "UPDATE stockmaster SET materialcost='" . $_POST['MaterialCost'] . "', + labourcost='" . $_POST['LabourCost'] . "', + overheadcost='" . $_POST['OverheadCost'] . "', + lastcost='" . $OldCost . "' + WHERE stockid='" . $StockID . "'"; $ErrMsg = _('The cost details for the stock item could not be updated because'); $DbgMsg = _('The SQL that failed was'); @@ -87,30 +86,30 @@ $DbgMsg = _('The SQL that failed was'); $result = DB_query("SELECT description, - units, - lastcost, - actualcost, - materialcost, - labourcost, - overheadcost, - mbflag, - stocktype, - sum(quantity) as totalqoh - FROM stockmaster INNER JOIN locstock - ON stockmaster.stockid=locstock.stockid - INNER JOIN stockcategory - ON stockmaster.categoryid = stockcategory.categoryid - WHERE stockmaster.stockid='" . $StockID . "' - GROUP BY description, - units, - lastcost, - actualcost, - materialcost, - labourcost, - overheadcost, - mbflag, - stocktype", - $db,$ErrMsg,$DbgMsg); + units, + lastcost, + actualcost, + materialcost, + labourcost, + overheadcost, + mbflag, + stocktype, + sum(quantity) as totalqoh + FROM stockmaster INNER JOIN locstock + ON stockmaster.stockid=locstock.stockid + INNER JOIN stockcategory + ON stockmaster.categoryid = stockcategory.categoryid + WHERE stockmaster.stockid='" . $StockID . "' + GROUP BY description, + units, + lastcost, + actualcost, + materialcost, + labourcost, + overheadcost, + mbflag, + stocktype", + $db,$ErrMsg,$DbgMsg); $myrow = DB_fetch_array($result); @@ -125,8 +124,8 @@ echo '<tr><th colspan=2><font color=navy size=2>'. _('Total Quantity On Hand') . ': ' . $myrow['totalqoh'] . ' ' . $myrow['units'] .'</font></th></tr>'; if (($myrow['mbflag']=='D' AND $myrow['stocktype'] != 'L') - OR $myrow['mbflag']=='A' - OR $myrow['mbflag']=='K'){ + OR $myrow['mbflag']=='A' + OR $myrow['mbflag']=='K'){ echo '</form>'; // Close the form if ($myrow['mbflag']=='D'){ echo '<br>' . $StockID .' ' . _('is a service item'); @@ -164,11 +163,11 @@ echo '</table><br /><div class="centre"><input type="submit" name="UpdateData" VALUE="' . _('Update') . '"><br /><br />'; } if ($myrow['mbflag']!='D'){ - echo '<div class="centre"><a href="' . $rootpath . '/StockStatus.php?' . SID . '&StockID=' . $StockID . '>' . _('Show Stock Status') . '</a>'; - echo '<br><a href="' . $rootpath . '/StockMovements.php?' . SID . '&StockID=' . $StockID . '">' . _('Show Stock Movements') . '</a>'; - echo '<br><a href="' . $rootpath . '/StockUsage.php?' . SID . '&StockID=' . $StockID . '">' . _('Show Stock Usage') .'</a>'; - echo '<br><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '&SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Sales Orders') . '</a>'; - echo '<br><a href="' . $rootpath . '/SelectCompletedOrder.php?' . SID . '&SelectedStockItem=' . $StockID . '">' . _('Search Completed Sales Orders') . '</a></div>'; + echo '<div class="centre"><a href="' . $rootpath . '/StockStatus.php?StockID=' . $StockID . '>' . _('Show Stock Status') . '</a>'; + echo '<br><a href="' . $rootpath . '/StockMovements.php?StockID=' . $StockID . '">' . _('Show Stock Movements') . '</a>'; + echo '<br><a href="' . $rootpath . '/StockUsage.php?StockID=' . $StockID . '">' . _('Show Stock Usage') .'</a>'; + echo '<br><a href="' . $rootpath . '/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Sales Orders') . '</a>'; + echo '<br><a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Completed Sales Orders') . '</a></div>'; } echo '</form></div>'; include('includes/footer.inc'); Modified: trunk/StockLocMovements.php =================================================================== --- trunk/StockLocMovements.php 2011-04-28 10:39:25 UTC (rev 4557) +++ trunk/StockLocMovements.php 2011-04-29 12:43:19 UTC (rev 4558) @@ -1,15 +1,13 @@ <?php /* $Id$*/ -//$PageSecurity = 2; - include('includes/session.inc'); $title = _('All Stock Movements By Location'); include('includes/header.inc'); -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . @@ -18,20 +16,20 @@ echo '<table class=selection><tr><td>'; echo ' ' . _('From Stock Location') . ':<select name="StockLocation"> '; -$sql = 'SELECT loccode, locationname FROM locations'; +$sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ if ($myrow['loccode'] == $_POST['StockLocation']){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; $_POST['StockLocation']=$myrow['loccode']; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } @@ -43,7 +41,7 @@ if (!isset($_POST['AfterDate']) OR !Is_Date($_POST['AfterDate'])){ $_POST['AfterDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-1,Date('d'),Date('y'))); } -echo ' ' . _('Show Movements before') . ': <input type=TEXT name="BeforeDate" size=12 maxlength=12 Value="' . $_POST['BeforeDate'] . '">'; +echo ' ' . _('Show Movements before') . ': <input type="text" name="BeforeDate" size=12 maxlength=12 Value="' . $_POST['BeforeDate'] . '">'; echo ' ' . _('But after') . ': <input type=TEXT name="AfterDate" size=12 maxlength=12 Value="' . $_POST['AfterDate'] . '">'; echo '</td></tr></table><br>'; echo '<div class=centre><input type=submit name="ShowMoves" VALUE="' . _('Show Stock Movements') . '"></div><br>'; @@ -77,7 +75,7 @@ $ErrMsg = _('The stock movements for the selected criteria could not be retrieved because'); $MovtsResult = DB_query($sql, $db,$ErrMsg); -echo '<table cellpadding=5 CELLSPACING=4 class=selection>'; +echo '<table cellpadding=5 cellspacing="4 "class="selection">'; $tableheader = '<tr> <th>' . _('Item Code') . '</th> <th>' . _('Type') . '</th> @@ -108,29 +106,29 @@ $DisplayTranDate = ConvertSQLDate($myrow['trandate']); - printf("<td><a target='_blank' href='StockStatus.php?" . SID . "&StockID=%s'>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - </tr>", - strtoupper($myrow['stockid']), - strtoupper($myrow['stockid']), - $myrow['typename'], - $myrow['transno'], - $DisplayTranDate, - $myrow['debtorno'], - number_format($myrow['qty'], - $myrow['decimalplaces']), - $myrow['reference'], - number_format($myrow['price'],2), - number_format($myrow['discountpercent']*100,2), - number_format($myrow['newqoh'],$myrow['decimalplaces'])); + printf('<td><a target="_blank" href="' . $rootpath . '/StockStatus.php?StockID=%s">%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td class=number>%s</td> + <td class=number>%s</td> + </tr>', + strtoupper($myrow['stockid']), + strtoupper($myrow['stockid']), + $myrow['typename'], + $myrow['transno'], + $DisplayTranDate, + $myrow['debtorno'], + number_format($myrow['qty'], + $myrow['decimalplaces']), + $myrow['reference'], + number_format($myrow['price'],$_SESSION['CompanyRecord']['decimalplaces']), + number_format($myrow['discountpercent']*100,2), + number_format($myrow['newqoh'],$myrow['decimalplaces'])); $j++; If ($j == 16){ $j=1; Modified: trunk/StockLocStatus.php =================================================================== --- trunk/StockLocStatus.php 2011-04-28 10:39:25 UTC (rev 4557) +++ trunk/StockLocStatus.php 2011-04-29 12:43:19 UTC (rev 4558) @@ -1,8 +1,7 @@ <?php + /* $Id$*/ -//$PageSecurity = 2; - include('includes/session.inc'); $title = _('All Stock Status By Location/Category'); @@ -16,7 +15,7 @@ } -echo '<form action="' . $_SERVER['PHP_SELF'] . '?'. SID . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $sql = "SELECT loccode, @@ -27,7 +26,9 @@ echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; -echo '<table class=selection><tr><td>' . _('From Stock Location') . ':</td><td><select name="StockLocation"> '; +echo '<table class=selection> + <tr><td>' . _('From Stock Location') . ':</td> + <td><select name="StockLocation"> '; while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ if ($myrow['loccode'] == $_POST['StockLocation']){ @@ -44,17 +45,21 @@ } echo '</select></td></tr>'; -$SQL='SELECT categoryid, categorydescription FROM stockcategory ORDER BY categorydescription'; +$SQL="SELECT categoryid, + categorydescription + FROM stockcategory + ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); if (DB_num_rows($result1)==0){ echo '</table><p>'; prnMsg(_('There are no stock categories currently defined please use the link below to set them up'),'warn'); - echo '<br><a href="' . $rootpath . '/StockCategories.php?' . SID .'">' . _('Define Stock Categories') . '</a>'; + echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a>'; include ('includes/footer.inc'); exit; } -echo '<tr><td>' . _('In Stock Category') . ':</td><td><select name="StockCat">'; +echo '<tr><td>' . _('In Stock Category') . ':</td> + <td><select name="StockCat">'; if (!isset($_POST['StockCat'])){ $_POST['StockCat']='All'; } @@ -73,8 +78,8 @@ echo '</select></td></tr>'; - -echo '<tr><td>' . _('Shown Only Items Where') . ':</td><td><select name="BelowReorderQuantity">'; +echo '<tr><td>' . _('Shown Only Items Where') . ':</td> + <td><select name="BelowReorderQuantity">'; if (!isset($_POST['BelowReorderQuantity'])){ $_POST['BelowReorderQuantity']='All'; } @@ -94,7 +99,7 @@ echo '</td></tr></table>'; -echo '<br><div class="centre"><input type=submit name="ShowStatus" value="' . _('Show Stock Status') . '"></div>'; +echo '<br /><div class="centre"><input type=submit name="ShowStatus" value="' . _('Show Stock Status') . '"></div>'; if (isset($_POST['ShowStatus'])){ @@ -142,7 +147,7 @@ $DbgMsg = _('The SQL that failed was'); $LocStockResult = DB_query($sql, $db, $ErrMsg, $DbgMsg); - echo '<br><table cellpadding=5 cellspacing=4 class=selection>'; + echo '<br /><table cellpadding=5 cellspacing=4 class="selection">'; $tableheader = '<tr> <th>' . _('StockID') . '</th> @@ -161,7 +166,7 @@ $StockID = $myrow['stockid']; - $sql = "SELECT Sum(salesorderdetails.quantity-salesorderdetails.qtyinvoiced) AS dem + $sql = "SELECT SUM(salesorderdetails.quantity-salesorderdetails.qtyinvoiced) AS dem FROM salesorderdetails, salesorders WHERE salesorders.orderno = salesorderdetails.orderno @@ -181,17 +186,17 @@ //Also need to add in the demand as a component of an assembly items if this items has any assembly parents. $sql = "SELECT Sum((salesorderdetails.quantity-salesorderdetails.qtyinvoiced)*bom.quantity) AS dem - FROM salesorderdetails, - salesorders, - bom, - stockmaster - WHERE salesorderdetails.stkcode=bom.parent - AND salesorders.orderno = salesorderdetails.orderno - AND salesorders.fromstkloc='" . $myrow['loccode'] . "' - AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 - AND bom.component='" . $StockID . "' - AND stockmaster.stockid=bom.parent - AND stockmaster.mbflag='A'"; + FROM salesorderdetails, + salesorders, + bom, + stockmaster + WHERE salesorderdetails.stkcode=bom.parent + AND salesorders.orderno = salesorderdetails.orderno + AND salesorders.fromstkloc='" . $myrow['loccode'] . "' + AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 + AND bom.component='" . $StockID . "' + AND stockmaster.stockid=bom.parent + AND stockmaster.mbflag='A'"; $ErrMsg = _('The demand for this product from') . ' ' . $myrow['loccode'] . ' ' . _('cannot be retrieved because'); $DemandResult = DB_query($sql,$db, $ErrMsg); @@ -201,12 +206,12 @@ $DemandQty += $DemandRow[0]; } $sql = "SELECT SUM((woitems.qtyreqd-woitems.qtyrecd)*bom.quantity) AS dem - FROM workorders, woitems, bom - WHERE woitems.wo = workorders.wo - AND woitems.stockid = bom.parent - AND workorders.closed=0 - AND bom.component = '". $StockID . "' - AND workorders.loccode='". $myrow['loccode'] ."'"; + FROM workorders, woitems, bom + WHERE woitems.wo = workorders.wo + AND woitems.stockid = bom.parent + AND workorders.closed=0 + AND bom.component = '". $StockID . "' + AND workorders.loccode='". $myrow['loccode'] ."'"; $DemandResult = DB_query($sql,$db, $ErrMsg); if (DB_num_rows($DemandResult)==1){ @@ -215,19 +220,15 @@ } - $sql = "SELECT SUM(purchorderdetails.quantityord*(CASE WHEN purchdata.conversionfactor IS NULL THEN 1 ELSE purchdata.conversionfactor END) - - purchorderdetails.quantityrecd*(CASE WHEN purchdata.conversionfactor IS NULL THEN 1 ELSE purchdata.conversionfactor END)) AS qoo - FROM purchorderdetails - INNER JOIN purchorders - ON purchorderdetails.orderno=purchorders.orderno - LEFT JOIN purchdata - ON purchorders.supplierno=purchdata.supplierno - AND purchorderdetails.itemcode=purchdata.stockid - WHERE purchorders.intostocklocation='" . $myrow['loccode'] . "' - AND purchorderdetails.itemcode='" . $StockID . "' - AND purchorders.status <> 'Cancelled' - AND purchorders.status <> 'Rejected' - AND purchorders.status <> 'Pending'"; + $sql = "SELECT SUM(purchorderdetails.quantityord - purchorderdetails.quantityrecd) AS qoo + FROM purchorderdetails + INNER JOIN purchorders + ON purchorderdetails.orderno=purchorders.orderno + WHERE purchorders.intostocklocation='" . $myrow['loccode'] . "' + AND purchorderdetails.itemcode='" . $StockID . "' + AND purchorders.status <> 'Cancelled' + AND purchorders.status <> 'Rejected' + AND purchorders.status <> 'Pending'"; $ErrMsg = _('The quantity on order for this product to be received into') . ' ' . $myrow['loccode'] . ' ' . _('cannot be retrieved because'); $QOOResult = DB_query($sql,$db,$ErrMsg); @@ -251,27 +252,29 @@ echo '<tr class="EvenTableRows">'; $k=1; } - printf("<td><a target='_blank' href='StockStatus.php?StockID=%s'>%s</a></td> + printf('<td><a target="_blank" href="' . $rootpath . '/StockStatus.php?StockID=%s">%s</a></td> <td>%s</td> <td class=number>%s</td> <td class=number>%s</td> <td class=number>%s</td> - <td class=number><a target='_blank' href='SelectProduct.php?StockID=%s'>%s</a></td> - <td class=number>%s</td></tr>", + <td class=number><a target="_blank" href="' . $rootpath . 'SelectProduct.php?StockID=%s">%s</a></td> + <td class=number>%s</td> + </tr>', strtoupper($myrow['stockid']), strtoupper($myrow['stockid']), $myrow['description'], number_format($myrow['quantity'],$myrow['decimalplaces']), number_format($myrow['reorderlevel'],$myrow['decimalplaces']), number_format($DemandQty,$myrow['decimalplaces']), - strtoupper($myrow['stockid']), + strtoupper($myrow['stockid']), number_format($myrow['quantity'] - $DemandQty,$myrow['decimalplaces']), number_format($QOO,$myrow['decimalplaces'])); + if ($myrow['serialised'] ==1){ /*The line is a serialised item*/ - echo '<td><a target="_blank" href="' . $rootpath . '/StockSerialItems.php?' . SID . '&Serialised=Yes&Location=' . $myrow['loccode'] . '&StockID=' . $StockID . '">' . _('Serial Numbers') . '</a></td></tr>'; + echo '<td><a target="_blank" href="' . $rootpath . '/StockSerialItems.php?Serialised=Yes&Location=' . $myrow['loccode'] . '&StockID=' . $StockID . '">' . _('Serial Numbers') . '</a></td></tr>'; } elseif ($myrow['controlled']==1){ - echo '<td><a target="_blank" href="' . $rootpath . '/StockSerialItems.php?' . SID . '&Location=' . $myrow['loccode'] . '&StockID=' . $StockID . '">' . _('Batches') . '</a></td></tr>'; + echo '<td><a target="_blank" href="' . $rootpath . '/StockSerialItems.php?Location=' . $myrow['loccode'] . '&StockID=' . $StockID . '">' . _('Batches') . '</a></td></tr>'; } } else if ($_POST['BelowReorderQuantity']!='NotZero') { if ($k==1){ @@ -281,13 +284,13 @@ echo '<tr class="EvenTableRows">'; $k=1; } - printf("<td><a target='_blank' href='StockStatus.php?StockID=%s'>%s</a></td> + printf('<td><a target="_blank" href="' . $rootpath . '/StockStatus.php?StockID=%s">%s</a></td> <td>%s</td> <td class=number>%s</td> <td class=number>%s</td> <td class=number>%s</td> - <td class=number><a target='_blank' href='SelectProduct.php?StockID=%s'>%s</a></td> - <td class=number>%s</td>", + <td class=number><a target="_blank" href="' . $rootpath . 'SelectProduct.php?StockID=%s">%s</a></td> + <td class=number>%s</td>', strtoupper($myrow['stockid']), strtoupper($myrow['stockid']), $myrow['description'], Modified: trunk/StockMovements.php =================================================================== --- trunk/StockMovements.php 2011-04-28 10:39:25 UTC (rev 4557) +++ trunk/StockMovements.php 2011-04-29 12:43:19 UTC (rev 4558) @@ -2,13 +2,10 @@ /* $Id$*/ -//$PageSecurity = 2; - include('includes/session.inc'); $title = _('Stock Movements'); include('includes/header.inc'); - if (isset($_GET['StockID'])){ $StockID = trim(strtoupper($_GET['StockID'])); } elseif (isset($_POST['StockID'])){ @@ -17,50 +14,46 @@ $StockID = ''; } - -// This is already linked from this page -//echo "<a href='" . $rootpath . '/SelectProduct.php?' . SID . "'>" . _('Back to Items') . '</a><br>'; - $result = DB_query("SELECT description, units FROM stockmaster WHERE stockid='".$StockID."'",$db); $myrow = DB_fetch_row($result); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" /><b>' . ' ' . $StockID . ' - ' . $myrow['0'] . ' : ' . _('in units of') . ' : ' . $myrow[1] . '</b></p>'; -echo "<form action='". $_SERVER['PHP_SELF'] . "?" . SID . "' method=post>"; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($_POST['BeforeDate']) OR !Is_Date($_POST['BeforeDate'])){ $_POST['BeforeDate'] = Date($_SESSION['DefaultDateFormat']); } if (!isset($_POST['AfterDate']) OR !Is_Date($_POST['AfterDate'])){ - $_POST['AfterDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date("m")-3,Date("d"),Date("y"))); + $_POST['AfterDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-3,Date('d'),Date('y'))); } echo '<br /><table cellpadding=2 class=selection>'; -echo '<tr><th colspan=10>' . _('Stock Code') . ":<input type=TEXT name='StockID' size=21 VALUE='$StockID' maxlength=20>"; +echo '<tr><th colspan=10>' . _('Stock Code') . ':<input type="text" name="StockID" size=21 value="' . $StockID . '" maxlength=20>'; -echo ' ' . _('From Stock Location') . ":<select name='StockLocation'> "; +echo ' ' . _('From Stock Location') . ':<select name="StockLocation"> '; -$sql = 'SELECT loccode, locationname FROM locations'; +$sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ if ($myrow['loccode'] == $_POST['StockLocation']){ - echo "<option selected VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo "<option selected VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; $_POST['StockLocation']=$myrow['loccode']; } else { - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } echo '</select></th></tr>'; echo '<tr><th colspan=10>' . _('Show Movements before') . ': <input type=text name="BeforeDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" VALUE="' . $_POST['BeforeDate'] . '">'; echo ' ' . _('But after') . ': <input type=TEXT name="AfterDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" VALUE="' . $_POST['AfterDate'] . '">'; -echo " <input type=submit name='ShowMoves' VALUE='" . _('Show Stock Movements') . "'></th></tr>"; +echo ' <input type="submit" name="ShowMoves" value="' . _('Show Stock Movements') . '"></th></tr>'; $SQLBeforeDate = FormatDateForSQL($_POST['BeforeDate']); $SQLAfterDate = FormatDateForSQL($_POST['AfterDate']); @@ -93,14 +86,19 @@ $MovtsResult = DB_query($sql, $db, $ErrMsg, $DbgMsg); -$tableheader = "<tr> - <th>" . _('Type') . "</th><th>" . _('Number') . "</th> - <th>" . _('Date') . "</th><th>" . _('Customer') . "</th> - <th>" . _('Branch') . "</th><th>" . _('Quantity') . "</th> - <th>" . _('Reference') . "</th><th>" . _('Price') . "</th> - <th>" . _('Discount') . "</th><th>" . _('New Qty') . "</th> - </tr>"; - +$tableheader = '<tr> + <th>' . _('Type') . '</th> + <th>' . _('Number') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Branch') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Reference') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('New Qty') . '</th> + </tr>'; + echo $tableheader; $j = 1; @@ -120,61 +118,59 @@ if ($myrow['type']==10){ /*its a sales invoice allow link to show invoice it was sold on*/ - printf("<td><a TARGET='_blank' href='%s/PrintCustTrans.php?%s&FromTransNo=%s&InvOrCredit=Invoice'>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s%%</td> - <td class=number>%s</td> - </tr>", - $rootpath, - SID, - $myrow['transno'], - $myrow['typename'], - $myrow['transno'], - $DisplayTranDate, - $myrow['debtorno'], - $myrow['branchcode'], - number_format($myrow['qty'], - $myrow['decimalplaces']), - $myrow['reference'], - number_format($myrow['price'],2), - number_format($myrow['discountpercent']*100,2), - number_format($myrow['newqoh'],$myrow['decimalplaces'])); + printf('<td><a target="_blank" href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice">%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td class=number>%s%%</td> + <td class=number>%s</td> + </tr>', + $rootpath, + $myrow['transno'], + $myrow['typename'], + $myrow['transno'], + $DisplayTranDate, + $myrow['debtorno'], + $myrow['branchcode'], + number_format($myrow['qty'], + $myrow['decimalplaces']), + $myrow['reference'], + number_format($myrow['price'],2), + number_format($myrow['discountpercent']*100,2), + number_format($myrow['newqoh'],$myrow['decimalplaces'])); } elseif ($myrow['type']==11){ - printf("<td><a TARGET='_blank' href='%s/PrintCustTrans.php?%s&FromTransNo=%s&InvOrCredit=Credit'>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s%%</td> - <td class=number>%s</td> - </tr>", - $rootpath, - SID, - $myrow['transno'], - $myrow['typename'], - $myrow['transno'], - $DisplayTranDate, - $myrow['debtorno'], - $myrow['branchcode'], - number_format($myrow['qty'],$myrow['decimalplaces']), - $myrow['reference'], - number_format($myrow['price'],2), - number_format($myrow['discountpercent']*100,2), - number_format($myrow['newqoh'],$myrow['decimalplaces'])); + printf('<td><a target="_blank" href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Credit">%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td class=number>%s%%</td> + <td class=number>%s</td> + </tr>', + $rootpath, + $myrow['transno'], + $myrow['typename'], + $myrow['transno'], + $DisplayTranDate, + $myrow['debtorno'], + $myrow['branchcode'], + number_format($myrow['qty'],$myrow['decimalplaces']), + $myrow['reference'], + number_format($myrow['price'],$_SESSION['CompanyRecord']['decimalplaces']), + number_format($myrow['discountpercent']*100,2), + number_format($myrow['newqoh'],$myrow['decimalplaces'])); } else { - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> @@ -184,7 +180,7 @@ <td class=number>%s</td> <td class=number>%s%%</td> <td class=number>%s</td> - </tr>", + </tr>', $myrow['typename'], $myrow['transno'], $DisplayTranDate, @@ -192,7 +188,7 @@ $myrow['branchcode'], number_format($myrow['qty'],$myrow['decimalplaces']), $myrow['reference'], - number_format($myrow['price'],2), + number_format($myrow['price'],$_SESSION['CompanyRecord']['decimalplaces']), number_format($myrow['discountpercent']*100,2), number_format($myrow['newqoh'],$myrow['decimalplaces'])); } @@ -201,10 +197,10 @@ //end of while loop echo '</table>'; -echo "<div class=centre><br /><a href='$rootpath/StockStatus.php?" . SID . "&StockID=$StockID'>" . _('Show Stock Status') . '</a>'; -echo "<br><a href='$rootpath/StockUsage.php?" . SID . "&StockID=$StockID&StockLocation=" . $_POST['StockLocation'] . "'>" . _('Show Stock Usage') . '</a>'; -echo "<br><a href='$rootpath/SelectSalesOrder.php?" . SID . "&SelectedStockItem=$StockID&StockLocation=" . $_POST['StockLocation'] . "'>" . _('Search Outstanding Sales Orders') . '</a>'; -echo "<br><a href='$rootpath/SelectCompletedOrder.php?" . SID . "&SelectedStockItem=$StockID'>" . _('Search Completed Sales Orders') . '</a>'; +echo '<div class="centre"><br /><a href="' . $rootpath . '/StockStatus.php?StockID=' . $StockID . '">' . _('Show Stock Status') . '</a>'; +echo '<br /><a href="' . $rootpath . '/StockUsage.php?StockID=' . $StockID . '&StockLocation=' . $_POST['StockLocation'] . '">' . _('Show Stock Usage') . '</a>'; +echo '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '&StockLocation=' . $_POST['StockLocation'] . '">' . _('Search Outstanding Sales Orders') . '</a>'; +echo '<br /><a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Completed Sales Orders') . '</a>'; echo '</form></div>'; Modified: trunk/StockQuantityByDate.php =================================================================== --- trunk/StockQuantityByDate.php 2011-04-28 10:39:25 UTC (rev 4557) +++ trunk/StockQuantityByDate.php 2011-04-29 12:43:19 UTC (rev 4558) @@ -1,11 +1,7 @@ <?php /* $Id$ */ -/* Contributed by Chris Bice - gettext by Kitch*/ - -//$PageSecurity = 2; - include('includes/session.inc'); $title = _('Stock On Hand By Date'); include('includes/header.inc'); @@ -13,65 +9,65 @@ echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" /><b>' . $title. '</b></p>'; -echo "<form action='" . $_SERVER['PHP_SELF'] . "?". SID . "' method=post>"; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -$sql = 'SELECT categoryid, categorydescription FROM stockcategory'; +$sql = "SELECT categoryid, categorydescription FROM stockcategory"; $resultStkLocs = DB_query($sql, $db); echo '<table class=selection><tr>'; -echo '<td>' . _('For Stock Category') . ":</td> - <td><select name='StockCategory'> "; +echo '<td>' . _('For Stock Category') . ':</td> + <td><select name="StockCategory"> '; echo '<option value="All">' . _('All') . '</option>'; while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockCategory']) AND $_POST['StockCategory']!='All'){ if ($myrow['categoryid'] == $_POST['StockCategory']){ - echo "<option selected VALUE='" . $myrow['categoryid'] . "'>" . $myrow['categorydescription'] . '</option>'; + echo '<option selected value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } else { - echo "<option VALUE='" . $myrow['categoryid'] . "'>" . $myrow['categorydescription'] . '</option>'; + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } }else { - echo "<option VALUE='" . $myrow['categoryid'] . "'>" . $myrow['categorydescription'] . '</option>'; + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } } echo '</select></td>'; -$sql = 'SELECT loccode, locationname FROM locations'; +$sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql, $db); -echo '<td>' . _('For Stock Location') . ":</td> - <td><select name='StockLocation'> "; +echo '<td>' . _('For Stock Location') . ':</td> + <td><select name="StockLocation"> '; while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ if ($myrow['loccode'] == $_POST['StockLocation']){ - echo "<option selected VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo "<option selected VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; $_POST['StockLocation']=$myrow['loccode']; } else { - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } echo '</select></td>'; if (!isset($_POST['OnHandDate'])){ - $_POST['OnHandDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date("m"),0,Date("y"))); + $_POST['OnHandDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),0,Date('y'))); } -echo '<td>' . _("On-Hand On Date") . ":</td> - <td><input type=TEXT class='date' alt='".$_SESSION['DefaultDateFormat']."' name='OnHandDate' size=12 maxlength=12 VALUE='" . $_POST['OnHandDate'] . "'></td></tr>"; -echo "<tr><td colspan=6><div class='centre'><input type=submit n... [truncated message content] |
From: <dai...@us...> - 2011-04-28 10:39:34
|
Revision: 4557 http://web-erp.svn.sourceforge.net/web-erp/?rev=4557&view=rev Author: daintree Date: 2011-04-28 10:39:25 +0000 (Thu, 28 Apr 2011) Log Message: ----------- quoting Modified Paths: -------------- trunk/AccountGroups.php trunk/Credit_Invoice.php trunk/FixedAssetItems.php trunk/GLTags.php trunk/PDFBankingSummary.php trunk/PDFChequeListing.php trunk/PDFOrderStatus.php trunk/Payments.php trunk/Suppliers.php trunk/UpgradeDatabase.php trunk/WWW_Access.php trunk/WorkOrderEntry.php trunk/doc/Change.log.html trunk/includes/ConnectDB.inc trunk/includes/ConnectDB_mysql.inc trunk/includes/ConnectDB_mysqli.inc trunk/includes/Login.php trunk/includes/MiscFunctions.php Added Paths: ----------- trunk/SecurityTokens.php trunk/sql/mysql/upgrade4.03-4.04.sql Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2011-04-26 11:03:36 UTC (rev 4556) +++ trunk/AccountGroups.php 2011-04-28 10:39:25 UTC (rev 4557) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.23 $ */ + /* $Id$*/ -//$PageSecurity = 10; - include('includes/session.inc'); $title = _('Account Groups'); @@ -227,12 +225,12 @@ echo '<table class="selection"> <tr> - <th>' . _('Group Name') . "</th> - <th>" . _('Section') . "</th> - <th>" . _('Sequence In TB') . "</th> - <th>" . _('Profit and Loss') . "</th> - <th>" . _('Parent Group') . "</th> - </tr>"; + <th>' . _('Group Name') . '</th> + <th>' . _('Section') . '</th> + <th>' . _('Sequence In TB') . '</th> + <th>' . _('Profit and Loss') . '</th> + <th>' . _('Parent Group') . '</th> + </tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_row($result)) { @@ -262,8 +260,8 @@ <td>' . $myrow[2] . '</td> <td>' . $PandLText . '</td> <td>' . $myrow[4] . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '&delete=1">' . _('Delete') .'</a></td></tr>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '&delete=1">' . _('Delete') .'</a></td></tr>'; } //END WHILE LIST LOOP echo '</table>'; @@ -271,12 +269,12 @@ if (isset($_POST['SelectedAccountGroup']) OR isset($_GET['SelectedAccountGroup'])) { - echo '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID .'">' . _('Review Account Groups') . '</a></div>'; + echo '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Review Account Groups') . '</a></div>'; } if (! isset($_GET['delete'])) { - echo '<br /><form method="post" id="AccountGroups" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; + echo '<br /><form method="post" id="AccountGroups" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -339,13 +337,12 @@ <input tabindex="1" ' . (in_array('GroupName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="GroupName" size="50" maxlength="50" value="' . $_POST['GroupName'] . '" /></td></tr>'; } echo '<tr><td>' . _('Parent Group') . ':' . '</td> - <td><select tabindex="2" ' . (in_array('ParentGroupName',$Errors) ? 'class="selecterror"' : '' ) . - ' name="ParentGroupName">'; + <td><select tabindex="2" ' . (in_array('ParentGroupName',$Errors) ? 'class="selecterror"' : '' ) . ' name="ParentGroupName">'; - $sql = 'SELECT groupname FROM accountgroups'; + $sql = "SELECT groupname FROM accountgroups"; $groupresult = DB_query($sql, $db,$ErrMsg,$DbgMsg); if (!isset($_POST['ParentGroupName'])){ - echo '<option selected="selected" value="">' ._('Top Level Group').'</option>'; + echo '<option selected value="">' ._('Top Level Group').'</option>'; } else { echo '<option value="">' ._('Top Level Group').'</option>'; } Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-04-26 11:03:36 UTC (rev 4556) +++ trunk/Credit_Invoice.php 2011-04-28 10:39:25 UTC (rev 4557) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity =3; - /*Functions to get the GL codes to post the transaction to */ include('includes/GetSalesTransGLCodes.inc'); /*defines the structure of the data required to hold the transaction as a session variable */ @@ -398,8 +396,8 @@ <td colspan=3 class=number>' . _('Freight cost charged on invoice') . '</td> <td class=number>' . number_format($_SESSION['Old_FreightCost'],2) . '</td> <td></td> - <td colspan=2 class=number>' . _('Credit Freight Cost') . "</td> - <td><input tabindex=".$j." type=text class=number size=6 maxlength=6 name='ChargeFreightCost' value=" . $_SESSION['CreditItems']->FreightCost . "></td>"; + <td colspan=2 class=number>' . _('Credit Freight Cost') . '</td> + <td><input tabindex='.$j.' type=text class="number" size=6 maxlength=6 name="ChargeFreightCost" value="' . $_SESSION['CreditItems']->FreightCost . '"></td>'; echo '<td>'; echo '</td><td>'; @@ -422,7 +420,7 @@ } if (!isset($_POST['ProcessCredit'])) { - echo '<input type=text class=number name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength=4 size=4 VALUE=' . $FreightTaxLine->TaxRate * 100 . '>'; + echo '<input type=text class=number name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength=4 size=4 value=' . $FreightTaxLine->TaxRate * 100 . '>'; } if ($FreightTaxLine->TaxOnTax ==1){ $TaxTotals[$FreightTaxLine->TaxAuthID] += ($FreightTaxLine->TaxRate * ($_SESSION['CreditItems']->FreightCost + $FreightTaxTotal)); @@ -437,8 +435,8 @@ if (!isset($_POST['ProcessCredit'])) { echo '</td>'; - echo '<td class=number>' . number_format($FreightTaxTotal,2) . '</td> - <td class=number>' . number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,2) . '</td> + echo '<td class="number">' . number_format($FreightTaxTotal,2) . '</td> + <td class="number">' . number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,2) . '</td> </tr>'; } @@ -447,12 +445,12 @@ if (!isset($_POST['ProcessCredit'])) { echo '<tr> - <td colspan=7 class=number>' . _('Credit Totals') . "</td> - <td class=number><hr><b>$DisplayTotal</b><hr></td> + <td colspan=7 class=number>' . _('Credit Totals') . '</td> + <td class=number><hr><b>' . $DisplayTotal . '</b><hr></td> <td colspan=2></td> - <td class=number><hr><b>" . number_format($TaxTotal,2) . "<hr></td> - <td class=number><hr><b>" . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),2) . "</b><hr></td> - </tr></table>"; + <td class=number><hr><b>' . number_format($TaxTotal,2) . '<hr></td> + <td class=number><hr><b>' . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),2) . '</b><hr></td> + </tr></table>'; } $DefaultDispatchDate = Date($_SESSION['DefaultDateFormat']); @@ -493,12 +491,11 @@ /*Start an SQL transaction */ - $SQL = 'BEGIN'; - $Result = DB_query($SQL,$db); + + $Result = DB_Txn_Begin($db); $DefaultDispatchDate= FormatDateForSQL($DefaultDispatchDate); - /*Calculate the allocation and see if it is possible to allocate to the invoice being credited */ $SQL = "SELECT (ovamount+ovgst+ovfreight-ovdiscount-alloc) as baltoallocate @@ -822,7 +819,7 @@ /* Insert stock movements for the stock coming back in - with unit cost */ - if ($MBFlag=="M" OR $MBFlag=="B"){ + if ($MBFlag=='M' OR $MBFlag=='B'){ $SQL = "INSERT INTO stockmoves ( stockid, type, @@ -1437,8 +1434,7 @@ } } /*end of if Sales and GL integrated */ - $SQL='COMMIT'; - $Result = DB_query($SQL,$db); + $Result = DB_Txn_Commit($db); unset($_SESSION['CreditItems']->LineItems); unset($_SESSION['CreditItems']); Modified: trunk/FixedAssetItems.php =================================================================== --- trunk/FixedAssetItems.php 2011-04-26 11:03:36 UTC (rev 4556) +++ trunk/FixedAssetItems.php 2011-04-28 10:39:25 UTC (rev 4557) @@ -50,7 +50,7 @@ if ($UploadTheFile=='Yes'){ $result = move_uploaded_file($_FILES['ItemPicture']['tmp_name'], $filename); - $message = ($result)?_('File url') ."<a href='". $filename ."'>" . $filename . '</a>' : _('Something is wrong with uploading a file'); + $message = ($result)?_('File url') .'<a href="' . $filename .'">' . $filename . '</a>' : _('Something is wrong with uploading a file'); } /* EOR Add Image upload for New Item - by Ori */ } @@ -262,10 +262,6 @@ prnMsg( _('The new asset has been added to the database with an asset code of:') . ' ' . $NewAssetID,'success'); unset($_POST['LongDescription']); unset($_POST['Description']); -// unset($_POST['AssetCategoryID']); -// unset($_POST['AssetLocation']); -// unset($_POST['DepnType']); -// unset($_POST['DepnRate']); unset($_POST['BarCode']); unset($_POST['SerialNo']); }//ALL WORKED SO RESET THE FORM VARIABLES @@ -374,8 +370,8 @@ } /* end if delete asset */ $result = DB_Txn_Commit($db); -echo '<form name="AssetForm" enctype="multipart/form-data" method="post" action="' . $_SERVER['PHP_SELF'] . '?' .SID . - '"><table class=selection>'; +echo '<form name="AssetForm" enctype="multipart/form-data" method="post" action="' . $_SERVER['PHP_SELF'] . '"> + <table class=selection>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -452,7 +448,7 @@ echo '<tr><td>'. _('Image File (.jpg)') . ':</td><td><input type="file" id="ItemPicture" name="ItemPicture"></td>'; if (function_exists('imagecreatefromjpg')){ - $StockImgLink = '<img src="GetStockImage.php?SID&automake=1&textcolor=FFFFFF&bgcolor=CCCCCC'. + $StockImgLink = '<img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC'. '&AssetID='.urlencode($AssetID). '&text='. '&width=64'. Modified: trunk/GLTags.php =================================================================== --- trunk/GLTags.php 2011-04-26 11:03:36 UTC (rev 4556) +++ trunk/GLTags.php 2011-04-28 10:39:25 UTC (rev 4557) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -//$PageSecurity = 10; + include('includes/session.inc'); $title = _('Maintain General Ledger Tags'); @@ -19,13 +19,13 @@ } if (isset($_POST['submit'])) { - $sql = "insert into tags values(NULL, '".$_POST['description']."')"; + $sql = "INSERT INTO tags values(NULL, '".$_POST['description']."')"; $result= DB_query($sql,$db); } if (isset($_POST['update'])) { - $sql = "update tags set tagdescription='".$_POST['description']. - "' where tagref='".$_POST['reference']."'"; + $sql = "UPDATE tags SET tagdescription='".$_POST['description']. + "' WHERE tagref='".$_POST['reference']."'"; $result= DB_query($sql,$db); } echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . @@ -41,9 +41,9 @@ <input type="hidden" name="reference" value="'.$_GET['SelectedTag'].'">'; if (isset($_GET['Action']) and $_GET['Action']=='edit') { - echo '<input type=Submit name=update value=' . _('Update') . '>'; + echo '<input type="submit" name=update value=' . _('Update') . '>'; } else { - echo '<input type=Submit name=submit value=' . _('Insert') . '>'; + echo '<input type="submit" name=submit value=' . _('Insert') . '>'; } echo '</td></tr></table><p></p>'; @@ -58,13 +58,13 @@ $result= DB_query($sql,$db); while ($myrow = DB_fetch_array($result,$db)){ - echo '<tr><td>'.$myrow[0].'</td><td>'.$myrow[1].'</td><td><a href="' . - $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedTag=' . $myrow[0] . '&Action=edit">' . _('Edit') . '</a></td></tr>'; + echo '<tr><td>'.$myrow[0].'</td><td>'.$myrow[1].'</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedTag=' . $myrow[0] . '&Action=edit">' . _('Edit') . '</a></td></tr>'; } echo '</table><p></p>'; -echo "<script>defaultControl(document.form.description);</script>"; +echo '<script>defaultControl(document.form.description);</script>'; include('includes/footer.inc'); Modified: trunk/PDFBankingSummary.php =================================================================== --- trunk/PDFBankingSummary.php 2011-04-26 11:03:36 UTC (rev 4556) +++ trunk/PDFBankingSummary.php 2011-04-28 10:39:25 UTC (rev 4557) @@ -16,15 +16,16 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . $title . '" alt="" />' . ' ' . $title . '</p>'; - $sql='SELECT DISTINCT + $sql="SELECT DISTINCT transno, transdate FROM banktrans WHERE type=12 - ORDER BY transno DESC'; + ORDER BY transno DESC"; $result=DB_query($sql, $db); - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '"><table class=selection>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '"> + <table class=selection>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('Select the batch number of receipts to be printed') . ':</td>'; echo '<td><select name="BatchNo">'; @@ -165,7 +166,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format($TotalBanked,2), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,300,$FontSize,_('TOTAL') . ' ' . $Currency . ' ' . _('BANKED'), 'left'); - $pdf->OutputD($_SESSION['DatabaseName'] . '_BankingSummary_' . date('Y-m-d').'.pdf');//UldisN + $pdf->OutputD($_SESSION['DatabaseName'] . '_BankingSummary_' . date('Y-m-d').'.pdf'); $pdf->__destruct(); } Modified: trunk/PDFChequeListing.php =================================================================== --- trunk/PDFChequeListing.php 2011-04-26 11:03:36 UTC (rev 4556) +++ trunk/PDFChequeListing.php 2011-04-28 10:39:25 UTC (rev 4557) @@ -31,6 +31,7 @@ } echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection> <tr> Modified: trunk/PDFOrderStatus.php =================================================================== --- trunk/PDFOrderStatus.php 2011-04-26 11:03:36 UTC (rev 4556) +++ trunk/PDFOrderStatus.php 2011-04-28 10:39:25 UTC (rev 4557) @@ -27,12 +27,11 @@ prnMsg($msg,'error'); } - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' ' - . _('Order Status Report') . '</p>'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' ' . _('Order Status Report') . '</p>'; echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection> + echo '<table class="selection"> <tr> <td>' . _('Enter the date from which orders are to be listed') . ':</td> <td><input type=text class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" maxlength=10 size=10 value="' . Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))) . '"></td> @@ -54,7 +53,7 @@ echo '</select></td></tr>'; echo '<tr><td>' . _('Inventory Location') . ':</td><td><select name="Location">'; - echo '<option selected value="All">' . _('All Locations'); + echo '<option selected value="All">' . _('All Locations') . '</option>'; $result= DB_query("SELECT loccode, locationname FROM locations",$db); while ($myrow=DB_fetch_array($result)){ @@ -242,9 +241,9 @@ if (DB_error_no($db)!=0){ include('includes/header.inc'); - echo '<br>' . _('An error occurred getting the orders details'); + echo '<br />' . _('An error occurred getting the orders details'); if ($debug==1){ - echo '<br>' . _('The SQL used to get the orders that failed was') . '<br>' . $sql; + echo '<br />' . _('The SQL used to get the orders that failed was') . '<br />' . $sql; } include ('includes/footer.inc'); exit; @@ -341,6 +340,6 @@ $OrderNo=0; } /*end of new page header */ } /* end of while there are delivery differences to print */ -$pdf->OutputD($_SESSION['DatabaseName'] . '_OrderStatus_' . date('Y-m-d') . '.pdf');//UldisN -$pdf->__destruct(); //UldisN +$pdf->OutputD($_SESSION['DatabaseName'] . '_OrderStatus_' . date('Y-m-d') . '.pdf'); +$pdf->__destruct(); ?> \ No newline at end of file Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2011-04-26 11:03:36 UTC (rev 4556) +++ trunk/Payments.php 2011-04-28 10:39:25 UTC (rev 4557) @@ -723,18 +723,19 @@ echo ' ' . _('on') . ' ' . $_SESSION['PaymentDetail']->DatePaid . '</font></th></tr>'; -$SQL = 'SELECT bankaccountname, +$SQL = "SELECT bankaccountname, bankaccounts.accountcode, bankaccounts.currcode FROM bankaccounts, chartmaster - WHERE bankaccounts.accountcode=chartmaster.accountcode'; + WHERE bankaccounts.accountcode=chartmaster.accountcode"; $ErrMsg = _('The bank accounts could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the bank accounts was'); $AccountsResults = DB_query($SQL,$db,$ErrMsg,$DbgMsg); -echo '<tr><td>' . _('Bank Account') . ':</td><td><select name="BankAccount" onChange="ReloadForm(UpdateHeader)">'; +echo '<tr><td>' . _('Bank Account') . ':</td> + <td><select name="BankAccount" onChange="ReloadForm(UpdateHeader)">'; if (DB_num_rows($AccountsResults)==0){ echo '</select></td></tr></table><p>'; @@ -746,9 +747,9 @@ while ($myrow=DB_fetch_array($AccountsResults)){ /*list the bank account names */ if (isset($_POST['BankAccount']) and $_POST['BankAccount']==$myrow['accountcode']){ - echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode']; + echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode'] . '</option>'; } else { - echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode']; + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode'] . '</option>'; } } echo '</select></td></tr>'; @@ -762,7 +763,7 @@ if ($_SESSION['PaymentDetail']->SupplierID==''){ echo '<tr><td>' . _('Currency of Payment') . ':</td><td><select name="Currency" onChange="ReloadForm(UpdateHeader)">'; - $SQL = 'SELECT currency, currabrev, rate FROM currencies'; + $SQL = "SELECT currency, currabrev, rate FROM currencies"; $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ @@ -771,9 +772,9 @@ } else { while ($myrow=DB_fetch_array($result)){ if ($_SESSION['PaymentDetail']->Currency==$myrow['currabrev']){ - echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['currency']; + echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>'; } else { - echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['currency']; + echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>'; } } echo '</select></td><td><i>' . _('The transaction currency does not need to be the same as the bank account currency') . '</i></td></tr>'; @@ -822,10 +823,12 @@ if ($_POST['FunctionalExRate']==1 AND isset($SuggestedFunctionalExRate)){ $_POST['FunctionalExRate'] = $SuggestedFunctionalExRate; } - echo '<tr><td>' . _('Functional Exchange Rate') . ':</td><td><input type="text" name="FunctionalExRate" maxlength=10 size=12 value="' . $_POST['FunctionalExRate'] . '"></td> + echo '<tr><td>' . _('Functional Exchange Rate') . ':</td> + <td><input type="text" name="FunctionalExRate" maxlength=10 size=12 value="' . $_POST['FunctionalExRate'] . '"></td> <td>' . ' ' . $SuggestedFunctionalExRateText . ' <i>' . _('The exchange rate between the currency of the business (the functional currency) and the currency of the bank account') . '. 1 ' . $_SESSION['CompanyRecord']['currencydefault'] . ' = ? ' . $_SESSION['PaymentDetail']->AccountCurrency . '</i></td></tr>'; } -echo '<tr><td>' . _('Payment type') . ':</td><td><select name="Paymenttype">'; +echo '<tr><td>' . _('Payment type') . ':</td> + <td><select name="Paymenttype">'; include('includes/GetPaymentMethods.php'); /* The array Payttypes is set up in includes/GetPaymentMethods.php @@ -834,9 +837,9 @@ foreach ($PaytTypes as $PaytType) { if (isset($_POST['Paymenttype']) and $_POST['Paymenttype']==$PaytType){ - echo '<option selected value="' . $PaytType . '">' . $PaytType; + echo '<option selected value="' . $PaytType . '">' . $PaytType . '</option>'; } else { - echo '<option Value="' . $PaytType . '">' . $PaytType; + echo '<option Value="' . $PaytType . '">' . $PaytType . '</option>'; } } //end foreach echo '</select></td></tr>'; @@ -853,7 +856,7 @@ } echo '<tr><td>' . _('Reference / Narrative') . ':</td> - <td colspan=2><input type="text" name="Narrative" maxlength=80 size=82 value="' . $_POST['Narrative'] . '"> ' . _('(Max. length 80 characters)') . '</td></tr>'; + <td colspan=2><input type="text" name="Narrative" maxlength=80 size=82 value="' . $_POST['Narrative'] . '"> ' . _('(Max. length 80 characters)') . '</td></tr>'; echo '<tr><td colspan=3><div class="centre"><input type="submit" name="UpdateHeader" value="' . _('Update'). '"></td></tr>'; @@ -894,13 +897,46 @@ echo '<tr><td>' . _('Enter GL Account Manually') . ':</td> <td><input type=Text class="number" Name="GLManualCode" Maxlength=12 size=12 onChange="return inArray(this, GLCode.options,'. "'".'The account code '."'".'+ this.value+ '."'".' doesnt exist'."'".')"></td></tr>'; } - echo '<tr><td>' . _('Select GL Account') . ':</td> - <td><select name="GLCode" onChange="return assignComboToInput(this,'.'GLManualCode'.')">'; + + echo '<tr><td>' . _('Select GL Group') . ':</td> + <td><select name="GLGroup" onChange="return ReloadForm(UpdateCodes)">'; - $SQL = 'SELECT accountcode, + $SQL = "SELECT groupname + FROM accountgroups + ORDER BY sequenceintb"; + + $result=DB_query($SQL,$db); + if (DB_num_rows($result)==0){ + echo '</select></td></tr>'; + prnMsg(_('No General ledger account groups have been set up yet') . ' - ' . _('payments cannot be analysed against GL accounts until the GL accounts are set up'),'error'); + } else { + echo '<option value=""></option>'; + while ($myrow=DB_fetch_array($result)){ + if (isset($_POST['GLGroup']) and ($_POST['GLGroup']==$myrow['groupname'])){ + echo '<option selected value="' . $myrow['groupname'] . '">' . $myrow['groupname'] . '</option>'; + } else { + echo '<option value="' . $myrow['groupname'] . '">' . $myrow['groupname'] . '</option>'; + } + } + echo '</select><input type="submit" name="UpdateCodes" value="Select" /></td></tr>'; + } + + if (isset($_POST['GLGroup']) and $_POST['GLGroup']!='') { + $SQL = "SELECT accountcode, accountname FROM chartmaster - ORDER BY accountcode'; + WHERE group_='".$_POST['GLGroup']."' + ORDER BY accountcode"; + } else { + $SQL = "SELECT accountcode, + accountname + FROM chartmaster + ORDER BY accountcode"; + } + + + echo '<tr><td>' . _('Select GL Account') . ':</td> + <td><select name="GLCode" onChange="return assignComboToInput(this,'.'GLManualCode'.')">'; $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ @@ -909,40 +945,47 @@ } else { echo '<option value=""></option>'; while ($myrow=DB_fetch_array($result)){ - if (isset($_POST['GLCode']) and $_POST['GLCode']==$myrow["accountcode"]){ - echo '<option selected value=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' - ' . $myrow['accountname']; + if (isset($_POST['GLCode']) and $_POST['GLCode']==$myrow['accountcode']){ + echo '<option selected value=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; } else { - echo '<option value=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' - ' . $myrow['accountname']; + echo '<option value=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; } } echo '</select></td></tr>'; } - echo '<tr><td>'. _('Cheque/Voucher Number') .'</td><td><input type="text" name="cheque" Maxlength=12 size=12></td></tr>'; + echo '<tr><td>'. _('Cheque/Voucher Number') .'</td> + <td><input type="text" name="cheque" Maxlength=12 size=12></td></tr>'; if (isset($_POST['GLNarrative'])) { - echo '<tr><td>' . _('GL Narrative') . ':</td><td><input type="text" name="GLNarrative" maxlength=50 size=52 value="' . $_POST['GLNarrative'] . '"></td></tr>'; + echo '<tr><td>' . _('GL Narrative') . ':</td> + <td><input type="text" name="GLNarrative" maxlength=50 size=52 value="' . $_POST['GLNarrative'] . '"></td></tr>'; } else { - echo '<tr><td>' . _('GL Narrative') . ':</td><td><input type="text" name="GLNarrative" maxlength=50 size=52></td></tr>'; + echo '<tr><td>' . _('GL Narrative') . ':</td> + <td><input type="text" name="GLNarrative" maxlength=50 size=52></td></tr>'; } if (isset($_POST['GLAmount'])) { - echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td><td><input type=Text Name="GLAmount" Maxlength=12 size=12 class=number value=' . $_POST['GLAmount'] . '></td></tr>'; + echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td> + <td><input type=Text Name="GLAmount" Maxlength=12 size=12 class=number value=' . $_POST['GLAmount'] . '></td></tr>'; } else { - echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td><td><input type=Text Name="GLAmount" Maxlength=12 size=12 class=number></td></tr>'; + echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td> + <td><input type=Text Name="GLAmount" Maxlength=12 size=12 class=number></td></tr>'; } echo '</table><br />'; echo '<div class="centre"><input type=submit name="Process" value="' . _('Accept') . '"><input type=submit name="Cancel" value="' . _('Cancel') . '"></div>'; if (sizeOf($_SESSION['PaymentDetail']->GLItems)>0) { - echo '<br /><table class=selection><tr> - <th>' . _('Cheque No').'</th> - <th>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . ')</th> - <th>' . _('GL Account') . '</th> - <th>' . _('Narrative') . '</th> - <th>' . _('Tag') . '</th> - </tr>'; + echo '<br /> + <table class=selection> + <tr> + <th>' . _('Cheque No').'</th> + <th>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . ')</th> + <th>' . _('GL Account') . '</th> + <th>' . _('Narrative') . '</th> + <th>' . _('Tag') . '</th> + </tr>'; $PaymentTotal = 0; foreach ($_SESSION['PaymentDetail']->GLItems as $PaymentItem) { Added: trunk/SecurityTokens.php =================================================================== --- trunk/SecurityTokens.php (rev 0) +++ trunk/SecurityTokens.php 2011-04-28 10:39:25 UTC (rev 4557) @@ -0,0 +1,86 @@ +<?php + +/* $Id$*/ +//$PageSecurity = 10; +include('includes/session.inc'); +$title = _('Maintain Security Tokens'); + +include('includes/header.inc'); + +if (isset($_GET['SelectedToken'])) { + $sql="SELECT tokenid, tokenname FROM securitytokens where tokenid='".$_GET['SelectedToken']."'"; + $result= DB_query($sql,$db); + $myrow = DB_fetch_array($result,$db); + $ref=$myrow[0]; + $description=$myrow[1]; +} else if (!isset($_POST['TokenID'])){ + $description=''; + $_POST['TokenID']=''; + $_GET['SelectedToken']=''; +} else { + $description=$_POST['Description']; +} + +if (isset($_POST['submit'])) { + $TestSQL="SELECT tokenid FROM securitytokens WHERE tokenid='".$_POST['TokenID']."'"; + $TestResult=DB_query($TestSQL, $db); + if (DB_num_rows($TestResult)==0) { + $sql = "INSERT INTO securitytokens values('".$_POST['TokenID']."', '".$_POST['Description']."')"; + $result= DB_query($sql,$db); + unset($description); + unset($_POST['TokenID']); + } else { + prnMsg( _('This token ID has already been used. Please use a new one') , 'warn'); + } +} + +if (isset($_POST['update'])) { + $sql = "UPDATE securitytokens SET tokenname='".$_POST['Description']. + "' WHERE tokenid='".$_POST['TokenID']."'"; + $result= DB_query($sql,$db); + unset($description); + unset($_POST['TokenID']); +} +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . + _('Print') . '" alt="" />' . ' ' . $title . '</p>'; + +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" name="form">'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +echo '<br><table><tr>'; + + + +if (isset($_GET['Action']) and $_GET['Action']=='edit') { + echo '<td>'. _('Description') . '</td> + <td><input type="text" size=30 maxlength=30 name="Description" value="'.$description.'"></td><td> + <input type="hidden" name="TokenID" value="'.$_GET['SelectedToken'].'">'; + echo '<input type=Submit name=update value=' . _('Update') . '>'; +} else { + echo '<td>'._('Token ID') . '<td><input type="text" name="TokenID" value="'.$_POST['TokenID'].'"></td></tr> + <tr><td>'. _('Description') . '</td><td><input type="text" size=30 maxlength=30 name="Description" value="'.$description.'"></td><td>'; + echo '<input type=Submit name=submit value=' . _('Insert') . '>'; +} + +echo '</td></tr></table><p></p>'; + +echo '</form>'; + +echo '<table class=selection>'; +echo '<tr><th>'. _('Token ID') .'</th>'; +echo '<th>'. _('Description'). '</th>'; + +$sql="SELECT tokenid, tokenname FROM securitytokens ORDER BY tokenid"; +$result= DB_query($sql,$db); + +while ($myrow = DB_fetch_array($result,$db)){ + echo '<tr><td>'.$myrow[0].'</td><td>'.$myrow[1].'</td><td><a href="' . + $_SERVER['PHP_SELF'] . '?SelectedToken=' . $myrow[0] . '&Action=edit">' . _('Edit') . '</a></td></tr>'; +} + +echo '</table><p></p>'; + +echo "<script>defaultControl(document.form.description);</script>"; + +include('includes/footer.inc'); + +?> \ No newline at end of file Modified: trunk/Suppliers.php =================================================================== --- trunk/Suppliers.php 2011-04-26 11:03:36 UTC (rev 4556) +++ trunk/Suppliers.php 2011-04-28 10:39:25 UTC (rev 4557) @@ -2,8 +2,6 @@ /* $Id$ */ -//$PageSecurity = 5; - include('includes/session.inc'); $title = _('Supplier Maintenance'); @@ -137,7 +135,7 @@ break; default: - echo _('The prefix') . ' - ' . $BankPrefix . ' ' . _('is not a valid New Zealand Bank') . '.<br>' . + echo _('The prefix') . ' - ' . $BankPrefix . ' ' . _('is not a valid New Zealand Bank') . '.<br />' . _('If you are using webERP outside New Zealand error trapping relevant to your country should be used'); return False; exit; @@ -301,8 +299,6 @@ unset($SupplierID); } -// This is aleady linked from this page -//echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Suppliers') . '</p>'; $InputError = 0; @@ -426,7 +422,7 @@ $longitude = $coordinatesSplit[0]; $status = $xml->Response->Status->code; - if (strcmp($status, "200") == 0) { + if (strcmp($status, '200') == 0) { // Successful geocode $geocode_pending = false; $coordinates = $xml->Response->Placemark->Point->coordinates; @@ -437,22 +433,22 @@ } else { // failure to geocode $geocode_pending = false; - echo '<p>Address: ' . $address . ' failed to geocode'."\n"; - echo 'Received status ' . $status . "\n" . '</p>'; + echo '<p>' . _('Address') . ': ' . $address . ' ' . _('failed to geocode') ."\n"; + echo _('Received status') . ' ' . $status . "\n" . '</p>'; } } } if (!isset($_POST['New'])) { $supptranssql = "SELECT supplierno - FROM supptrans - WHERE supplierno='".$SupplierID ."'"; + FROM supptrans + WHERE supplierno='".$SupplierID ."'"; $suppresult = DB_query($supptranssql, $db); $supptrans = DB_num_rows($suppresult); $suppcurrssql = "SELECT currcode - FROM suppliers - WHERE supplierid='".$SupplierID ."'"; + FROM suppliers + WHERE supplierid='".$SupplierID ."'"; $currresult = DB_query($suppcurrssql, $db); $suppcurr = DB_fetch_row($currresult); @@ -516,49 +512,49 @@ } else { //its a new supplier $sql = "INSERT INTO suppliers (supplierid, - suppname, - address1, - address2, - address3, - address4, - telephone, - fax, - email, - supptype, - currcode, - suppliersince, - paymentterms, - bankpartics, - bankref, - bankact, - remittance, - taxgroupid, - factorcompanyid, - lat, - lng, - taxref) - VALUES ('$SupplierID', - '" . $_POST['SuppName'] . "', - '" . $_POST['Address1'] . "', - '" . $_POST['Address2'] . "', - '" . $_POST['Address3'] . "', - '" . $_POST['Address4'] . "', - '".$_POST['Phone']."', - '".$_POST['Fax']."', - '".$_POST['Email']."', - '".$_POST['SupplierType']."', - '" . $_POST['CurrCode'] . "', - '" . $SQL_SupplierSince . "', - '" . $_POST['PaymentTerms'] . "', - '" . $_POST['BankPartics'] . "', - '" . $_POST['BankRef'] . "', - '" . $_POST['BankAct'] . "', - '" . $_POST['Remittance'] . "', - '" . $_POST['TaxGroup'] . "', - '" . $_POST['FactorID'] . "', - '" . $latitude ."', - '" . $longitude ."', - '" . $_POST['TaxRef'] . "')"; + suppname, + address1, + address2, + address3, + address4, + telephone, + fax, + email, + supptype, + currcode, + suppliersince, + paymentterms, + bankpartics, + bankref, + bankact, + remittance, + taxgroupid, + factorcompanyid, + lat, + lng, + taxref) + VALUES ('$SupplierID', + '" . $_POST['SuppName'] . "', + '" . $_POST['Address1'] . "', + '" . $_POST['Address2'] . "', + '" . $_POST['Address3'] . "', + '" . $_POST['Address4'] . "', + '".$_POST['Phone']."', + '".$_POST['Fax']."', + '".$_POST['Email']."', + '".$_POST['SupplierType']."', + '" . $_POST['CurrCode'] . "', + '" . $SQL_SupplierSince . "', + '" . $_POST['PaymentTerms'] . "', + '" . $_POST['BankPartics'] . "', + '" . $_POST['BankRef'] . "', + '" . $_POST['BankAct'] . "', + '" . $_POST['Remittance'] . "', + '" . $_POST['TaxGroup'] . "', + '" . $_POST['FactorID'] . "', + '" . $latitude ."', + '" . $longitude ."', + '" . $_POST['TaxRef'] . "')"; $ErrMsg = _('The supplier') . ' ' . $_POST['SuppName'] . ' ' . _('could not be added because'); $DbgMsg = _('The SQL that was used to insert the supplier but failed was'); @@ -610,7 +606,7 @@ if ($myrow[0] > 0) { $CancelDelete = 1; prnMsg(_('Cannot delete this supplier because there are transactions that refer to this supplier'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions against this supplier'); + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions against this supplier'); } else { $sql= "SELECT COUNT(*) FROM purchorders WHERE supplierno='" . $SupplierID . "'"; @@ -619,7 +615,7 @@ if ($myrow[0] > 0) { $CancelDelete = 1; prnMsg(_('Cannot delete the supplier record because purchase orders have been created against this supplier'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('orders against this supplier'); + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('orders against this supplier'); } else { $sql= "SELECT COUNT(*) FROM suppliercontacts WHERE supplierid='" . $SupplierID . "'"; $result = DB_query($sql, $db); @@ -627,7 +623,7 @@ if ($myrow[0] > 0) { $CancelDelete = 1; prnMsg(_('Cannot delete this supplier because there are supplier contacts set up against it') . ' - ' . _('delete these first'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('supplier contacts relating to this supplier'); + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('supplier contacts relating to this supplier'); } } @@ -647,105 +643,140 @@ /*If the page was called without $SupplierID passed to page then assume a new supplier is to be entered show a form with a Supplier Code field other wise the form showing the fields with the existing entries against the supplier will show for editing with only a hidden SupplierID field*/ - echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . "?" . SID . "'>"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo "<input type='hidden' name='New' VALUE='Yes'>"; + echo '<input type="hidden" name="New" value="Yes">'; echo '<table class=selection>'; - echo '<tr><td>' . _('Supplier Code') . ":</td><td><input type='text' name='SupplierID' size=11 maxlength=10></td></tr>"; - echo '<tr><td>' . _('Supplier Name') . ":</td><td><input type='text' name='SuppName' size=42 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Address Line 1 (Street)') . ":</td><td><input type='text' name='Address1' size=42 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ":</td><td><input type='text' name='Address2' size=42 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Address Line 3 (State/Province)') . ":</td><td><input type='text' name='Address3' size=42 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ":</td><td><input type='text' name='Address4' size=42 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Telephone') . ":</td><td><input type='text' name='Phone' size=30 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Facsimile') . ":</td><td><input type='text' name='Fax' size=30 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Email Address') . ":</td><td><input type='text' name='Email' size=30 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Supplier Type') . ":</td><td><select name='SupplierType'>"; - $result=DB_query('SELECT typeid, typename FROM suppliertype', $db); + echo '<tr><td>' . _('Supplier Code') . ':</td> + <td><input type="text" name="SupplierID" size=11 maxlength=10></td> + </tr>'; + echo '<tr><td>' . _('Supplier Name') . ':</td> + <td><input type="text" name="SuppName" size=42 maxlength=40></td> + </tr>'; + echo '<tr><td>' . _('Address Line 1 (Street)') . ':</td> + <td><input type="text" name="Address1" size=42 maxlength=40></td> + </tr>'; + echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ':</td> + <td><input type="text" name="Address2" size=42 maxlength=40></td> + </tr>'; + echo '<tr><td>' . _('Address Line 3 (State/Province)') . ':</td> + <td><input type="text" name="Address3" size=42 maxlength=40></td> + </tr>'; + echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ':</td> + <td><input type="text" name="Address4" size=42 maxlength=40></td> + </tr>'; + echo '<tr><td>' . _('Telephone') . ':</td> + <td><input type="text" name="Phone" size=30 maxlength=40></td> + </tr>'; + echo '<tr><td>' . _('Facsimile') . ':</td> + <td><input type="text" name="Fax" size=30 maxlength=40></td> + </tr>'; + echo '<tr><td>' . _('Email Address') . ':</td> + <td><input type="text" name="Email" size=30 maxlength=40></td> + </tr>'; + echo '<tr><td>' . _('Supplier Type') . ':</td> + <td><select name="SupplierType">'; + $result=DB_query("SELECT typeid, typename FROM suppliertype", $db); while ($myrow = DB_fetch_array($result)) { - echo "<option VALUE='". $myrow['typeid'] . "'>" . $myrow['typename']; + echo '<option value="' . $myrow['typeid'] . '">' . $myrow['typename'] .'</option>'; } //end while loop - echo "</select></td></tr>"; + echo '</select></td></tr>'; $DateString = Date($_SESSION['DefaultDateFormat']); - echo '<tr><td>' . _('Supplier Since') . ' (' . $_SESSION['DefaultDateFormat'] . "):</td><td><input type='text' class='date' alt='".$_SESSION['DefaultDateFormat']."' name='SupplierSince' VALUE=$DateString size=12 maxlength=10></td></tr>"; - echo '<tr><td>' . _('Bank Particulars') . ":</td><td><input type='text' name='BankPartics' size=13 maxlength=12></td></tr>"; - echo '<tr><td>' . _('Bank reference') . ":</td><td><input type='text' name='BankRef' VALUE=0 size=13 maxlength=12></td></tr>"; - echo '<tr><td>' . _('Bank Account No') . ":</td><td><input type='text' name='BankAct' size=31 maxlength=30></td></tr>"; + echo '<tr><td>' . _('Supplier Since') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> + <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="SupplierSince" value="' . $DateString . '" size=12 maxlength=10></td> + </tr>'; + echo '<tr><td>' . _('Bank Particulars') . ':</td> + <td><input type="text" name="BankPartics" size=13 maxlength=12></td> + </tr>'; + echo '<tr><td>' . _('Bank reference') . ':</td> + <td><input type="text" name="BankRef" value=0 size=13 maxlength=12></td> + </tr>'; + echo '<tr><td>' . _('Bank Account No') . ':</td> + <td><input type="text" name="BankAct" size=31 maxlength=30></td></tr>'; - $result=DB_query('SELECT terms, termsindicator FROM paymentterms', $db); + $result=DB_query("SELECT terms, termsindicator FROM paymentterms", $db); - echo '<tr><td>' . _('Payment Terms') . ":</td><td><select name='PaymentTerms'>"; + echo '<tr><td>' . _('Payment Terms') . ':</td> + <td><select name="PaymentTerms">'; while ($myrow = DB_fetch_array($result)) { - echo "<option VALUE='". $myrow['termsindicator'] . "'>" . $myrow['terms']; + echo '<option value="'. $myrow['termsindicator'] . '">' . $myrow['terms'] .'</option>'; } //end while loop DB_data_seek($result, 0); echo '</select></td></tr>'; - $result=DB_query('SELECT id, coyname FROM factorcompanies', $db); + $result=DB_query("SELECT id, coyname FROM factorcompanies", $db); - echo '<tr><td>' . _('Factor Company') . ":</td><td><select name='FactorID'>"; - echo '<option VALUE=0>' . _('None'); + echo '<tr><td>' . _('Factor Company') . ':</td> + <td><select name="FactorID">'; + echo '<option value=0>' . _('None'); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['FactorID']) and $_POST['FactorID'] == $myrow['id']){ - echo '<option selected VALUE=' . $myrow['id'] . '>' . $myrow['coyname']; + echo '<option selected value=' . $myrow['id'] . '>' . $myrow['coyname'] .'</option>'; } else { - echo '<option VALUE=' . $myrow['id'] . '>' . $myrow['coyname']; + echo '<option value=' . $myrow['id'] . '>' . $myrow['coyname'] .'</option>'; } } //end while loop DB_data_seek($result, 0); echo '</select></td></tr>'; - echo '<tr><td>' . _('Tax Reference') . ':</td><td><input type="text" name=2TaxRef" size=21 maxlength=20></td></tr>'; + echo '<tr><td>' . _('Tax Reference') . ':</td> + <td><input type="text" name="TaxRef" size=21 maxlength=20></td></tr>'; - $result=DB_query('SELECT currency, currabrev FROM currencies', $db); + $result=DB_query("SELECT currency, currabrev FROM currencies", $db); if (!isset($_POST['CurrCode'])){ - $CurrResult = DB_query('SELECT currencydefault FROM companies WHERE coycode=1', $db); + $CurrResult = DB_query("SELECT currencydefault FROM companies WHERE coycode=1", $db); $myrow = DB_fetch_row($CurrResult); $_POST['CurrCode'] = $myrow[0]; } - echo '<tr><td>' . _('Supplier Currency') . ':</td><td><select name="CurrCode">'; + echo '<tr><td>' . _('Supplier Currency') . ':</td> + <td><select name="CurrCode">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['CurrCode'] == $myrow['currabrev']){ - echo '<option selected VALUE=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>'; + echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>'; } else { - echo '<option VALUE=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>'; + echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>'; } } //end while loop DB_data_seek($result, 0); - echo '</select></td></tr><tr><td>' . _('Remittance Advice') . ':</td><td><select name="Remittance">'; - echo '<option VALUE=0>' . _('Not Required') . '</option>'; - echo '<option VALUE=1>' . _('Required') . '</option>'; + echo '</select></td></tr> + <tr><td>' . _('Remittance Advice') . ':</td> + <td><select name="Remittance">'; + echo '<option value=0>' . _('Not Required') . '</option>'; + echo '<option value=1>' . _('Required') . '</option>'; echo '</select></td></tr>'; - echo '<tr><td>' . _('Tax Group') . ':</td><td><select name="TaxGroup">'; + echo '<tr><td>' . _('Tax Group') . ':</td> + <td><select name="TaxGroup">'; DB_data_seek($result, 0); - $sql = 'SELECT taxgroupid, taxgroupdescription FROM taxgroups'; + $sql = "SELECT taxgroupid, taxgroupdescription FROM taxgroups"; $result = DB_query($sql, $db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['TaxGroup']) and $_POST['TaxGroup'] == $myrow['taxgroupid']){ - echo '<option selected VALUE=' . $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription'] . '</option>'; + echo '<option selected value=' . $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription'] . '</option>'; } else { - echo '<option VALUE=' . $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription'] . '</option>'; + echo '<option value=' . $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription'] . '</option>'; } } //end while loop - echo '</select></td></tr></table><p><div class="centre"><input type="Submit" name="submit" VALUE="' . _('Insert New Supplier') . '">'; + echo '</select></td></tr> + </table> + <p><div class="centre"><input type="Submit" name="submit" value="' . _('Insert New Supplier') . '">'; echo '</div></form>'; } else { //SupplierID exists - either passed when calling the form or from the form itself - echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . "?" . SID . "'>"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection>'; @@ -796,91 +827,112 @@ $_POST['FactorID'] = $myrow['factorcompanyid']; $_POST['TaxRef'] = $myrow['taxref']; - echo '<input type=hidden name="SupplierID" VALUE="' . $SupplierID . '">'; + echo '<input type=hidden name="SupplierID" value="' . $SupplierID . '">'; } else { // its a new supplier being added - echo '<input type=hidden name="New" VALUE="Yes">'; - echo '<tr><td>' . _('Supplier Code') . ':</td><td><input '.(in_array('ID',$Errors) ? 'class="inputerror"' : '').' type="text" name="SupplierID" VALUE="' . $SupplierID . '" size=12 maxlength=10></td></tr>'; + echo '<input type=hidden name="New" value="Yes">'; + echo '<tr><td>' . _('Supplier Code') . ':</td> + <td><input '.(in_array('ID',$Errors) ? 'class="inputerror"' : '').' type="text" name="SupplierID" value="' . $SupplierID . '" size=12 maxlength=10></td></tr>'; } - echo '<tr><td>' . _('Supplier Name') . ':</td><td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="SuppName" VALUE="' . $_POST['SuppName'] . '" size=42 maxlength=40></td></tr>'; - echo '<tr><td>' . _('Address Line 1 (Street)') . ':</td><td><input type="text" name="Address1" VALUE="' . $_POST['Address1'] . '" size=42 maxlength=40></td></tr>'; - echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ':</td><td><input type="text" name="Address2" VALUE="' . $_POST['Address2'] . '" size=42 maxlength=40></td></tr>'; - echo '<tr><td>' . _('Address Line 3 (State/Province)') . ':</td><td><input type="text" name="Address3" VALUE="' . $_POST['Address3'] . '" size=42 maxlength=40></td></tr>'; - echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ':</td><td><input type="text" name="Address4" VALUE="' . $_POST['Address4'] . '" size=42 maxlength=40></td></tr>'; - echo '<tr><td>' . _('Telephone') . ':</td><td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Phone" VALUE="' . $_POST['Phone'] . '" size=42 maxlength=40></td></tr>'; - echo '<tr><td>' . _('Facsimile') . ':</td><td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Fax" VALUE="' . $_POST['Fax'] . '" size=42 maxlength=40></td></tr>'; - echo '<tr><td>' . _('Email Address') . ':</td><td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Email" VALUE="' . $_POST['Email'] . '" size=42 maxlength=40></td></tr>'; - echo '<tr><td>' . _('Supplier Type') . ":</td><td><select name='SupplierType'>"; - $result=DB_query('SELECT typeid, typename FROM suppliertype', $db); + echo '<tr><td>' . _('Supplier Name') . ':</td> + <td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="SuppName" value="' . $_POST['SuppName'] . '" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Address Line 1 (Street)') . ':</td> + <td><input type="text" name="Address1" value="' . $_POST['Address1'] . '" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ':</td> + <td><input type="text" name="Address2" value="' . $_POST['Address2'] . '" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Address Line 3 (State/Province)') . ':</td> + <td><input type="text" name="Address3" value="' . $_POST['Address3'] . '" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ':</td> + <td><input type="text" name="Address4" value="' . $_POST['Address4'] . '" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Telephone') . ':</td> + <td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Phone" value="' . $_POST['Phone'] . '" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Facsimile') . ':</td> + <td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Fax" value="' . $_POST['Fax'] . '" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Email Address') . ':</td> + <td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Email" value="' . $_POST['Email'] . '" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Supplier Type') . ':</td> + <td><select name="SupplierType">'; + $result=DB_query("SELECT typeid, typename FROM suppliertype", $db); while ($myrow = DB_fetch_array($result)) { if ($_POST['SupplierType']==$myrow['typeid']) { - echo "<option selected value='". $myrow['typeid'] . "'>" . $myrow['typename']; + echo '<option selected value="'. $myrow['typeid'] . '">' . $myrow['typename'] .'</option>'; } else { - echo "<option value='". $myrow['typeid'] . "'>" . $myrow['typename']; + echo '<option value="' . $myrow['typeid'] . '">' . $myrow['typename'] .'</option>'; } } //end while loop - echo "</select></td></tr>"; + echo '</select></td></tr>'; - echo '<tr><td>' . _('Supplier Since') . ' (' . $_SESSION['DefaultDateFormat'] .'):</td><td><input '.(in_array('SupplierSince',$Errors) ? 'class="inputerror"' : '').' size=12 maxlength=10 type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="SupplierSince" VALUE=' . $_POST['SupplierSince'] . '></td></tr>'; - echo '<tr><td>' . _('Bank Particulars') . ":</td><td><input type='text' name='BankPartics' size=13 maxlength=12 VALUE='" . $_POST['BankPartics'] . "'></td></tr>"; - echo '<tr><td>' . _('Bank Reference') . ':</td><td><input '.(in_array('BankRef',$Errors) ? 'class="inputerror"' : '').' type="text" name="BankRef" size=13 maxlength=12 VALUE="' . $_POST['BankRef'] . '"></td></tr>'; - echo '<tr><td>' . _('Bank Account No') . ":</td><td><input type='text' name='BankAct' size=31 maxlength=30 VALUE='" . $_POST['BankAct'] . "'></td></tr>"; + echo '<tr><td>' . _('Supplier Since') . ' (' . $_SESSION['DefaultDateFormat'] .'):</td> + <td><input '.(in_array('SupplierSince',$Errors) ? 'class="inputerror"' : '').' size=12 maxlength=10 type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="SupplierSince" value=' . $_POST['SupplierSince'] . '></td></tr>'; + echo '<tr><td>' . _('Bank Particulars') . ':</td> + <td><input type="text" name="BankPartics" size=13 maxlength=12 value="' . $_POST['BankPartics'] . '"></td></tr>'; + echo '<tr><td>' . _('Bank Reference') . ':</td> + <td><input '.(in_array('BankRef',$Errors) ? 'class="inputerror"' : '').' type="text" name="BankRef" size=13 maxlength=12 value="' . $_POST['BankRef'] . '"></td></tr>'; + echo '<tr><td>' . _('Bank Account No') . ':</td> + <td><input type="text" name="BankAct" size=31 maxlength=30 value="' . $_POST['BankAct'] . '"></td></tr>'; - $result=DB_query('SELECT terms, termsindicator FROM paymentterms', $db); + $result=DB_query("SELECT terms, termsindicator FROM paymentterms", $db); - echo '<tr><td>' . _('Payment Terms') . ":</td><td><select name='PaymentTerms'>"; + echo '<tr><td>' . _('Payment Terms') . ':</td> + <td><select name="PaymentTerms">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['PaymentTerms'] == $myrow['termsindicator']){ - echo '<option selected VALUE=' . $myrow['termsindicator'] . '>' . $myrow['terms']; + echo '<option selected value=' . $myrow['termsindicator'] . '>' . $myrow['terms'] .'</option>'; } else { - echo '<option VALUE=' . $myrow['termsindicator'] . '>' . $myrow['terms']; + echo '<option value=' . $myrow['termsindicator'] . '>' . $myrow['terms'] .'</option>'; } } //end while loop DB_data_seek($result, 0); - $result=DB_query('SELECT id, coyname FROM factorcompanies', $db); + $result=DB_query("SELECT id, coyname FROM factorcompanies", $db); - echo '<tr><td>' . _('Factor Company') . ":</td><td><select name='FactorID'>"; - echo '<option VALUE=0>' . _('None'); + echo '<tr><td>' . _('Factor Company') . ':</td> + <td><select name="FactorID">'; + echo '<option value=0>' . _('None'); while ($myrow = DB_fetch_array($result)) { if ($_POST['FactorID'] == $myrow['id']){ - echo '<option selected VALUE=' . $myrow['id'] . '>' . $myrow['coyname']; + echo '<option selected value=' . $myrow['id'] . '>' . $myrow['coyname'] .'</option>'; } else { - echo '<option VALUE=' . $myrow['id'] . '>' . $myrow['coyname']; + echo '<option value=' . $myrow['id'] . '>' . $myrow['coyname'] .'</option>'; } } //end while loop DB_data_seek($result, 0); - echo '<tr><td>' . _('Tax Reference') . ":</td><td><input type='text' name='TaxRef' size=21 maxlength=20 VALUE='".$_POST['TaxRef']."'></td></tr>"; + echo '<tr><td>' . _('Tax Reference') . ':</td> + <td><input type="text" name="TaxRef" size=21 maxlength=20 value="' . $_POST['TaxRef'] .'"></td></tr>'; - $result=DB_query('SELECT currency, currabrev FROM currencies', $db); + $result=DB_query("SELECT currency, currabrev FROM currencies", $db); - echo '</select></td></tr><tr><td>' . _('Supplier Currency') . ":</td><td><select name='CurrCode'>"; + echo '</select></td></tr><tr><td>' . _('Supplier Currency') . ':</td> + <td><select name="CurrCode">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['CurrCode'] == $myrow['currabrev']){ - echo '<option selected VALUE=' . $myrow['currabrev'] . '>' . $myrow['currency']; + echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['currency'] .'</option>'; } else { - echo '<option VALUE=' . $myrow['currabrev'] . '>' . $myrow['currency']; + echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['currency'] .'</option>'; } } //end while loop DB_data_seek($result, 0); - echo '</select></td></tr><tr><td>' . _('Remittance Advice') . ":</td><td><select name='Remittance'>"; + echo '</select></td></tr> + <tr><td>' . _('Remittance Advice') . ':</td> + <td><select name="Remittance">'; if ($_POST['Remittance'] == 0){ - echo '<option selected VALUE=0>' . _('Not Required'); - echo '<option VALUE=1>' . _('Required'); + echo '<option selected value=0>' . _('Not Required') .'</option>'; + echo '<option value=1>' . _('Required') .'</option>'; } else { - echo '<option VALUE=0>' . _('Not Required'); - echo '<option selected VALUE=1>' . _('Required'); + echo '<option value=0>' . _('Not Required') .'</option>'; + echo '<option selected value=1>' . _('Required') .'</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('Tax Group') . ":</td><td><select name='TaxGroup'>"; + echo '<tr><td>' . _('Tax Group') . ':</td> + <td><select name="TaxGroup">'; DB_data_seek($result, 0); @@ -889,9 +941,9 @@ while ($myrow = DB_fetch_array($result)) { if ($myrow['taxgroupid'] == $_POST['TaxGroup']) { - echo '<option selected VALUE="'.$myrow['taxgroupid'] . '">' . $myrow['taxgroupdescription'] . '</option>'; + echo '<option selected value="'.$myrow['taxgroupid'] . '">' . $myrow['taxgroupdescription'] . '</option>'; } else { - echo '<option VALUE="' . $myrow['taxgroupid'] . '">' . $myrow['taxgroupdescription'] . '</option>'; + echo '<option value="' . $myrow['taxgroupid'] . '">' . $myrow['taxgroupdescription'] . '</option>'; } } //end while loop @@ -899,13 +951,13 @@ echo '</select></td></tr></table>'; if (isset($_POST['New'])) { - echo '<p><div class="centre"><input type="Submit" name="submit" VALUE="' . _('Add These New Supplier Details') . '"></form>'; + echo '<p><div class="centre"><input type="Submit" name="submit" value="' . _('Add These New Supplier Details') . '"></form>'; } else { - echo '<br><p><div class="centre"><input type="Submit" name="submit" VALUE="' . _('Update Supplier') . '"></div><br>'; -// echo '<p><font color=red><b>' . _('WARNING') . ': ' . _('There is no second warning if you hit the delete button below') . '. ' . _('However checks will be made to ensure there are no outstanding purchase orders or existing accounts payable transactions before the deletion is processed') . '<br></font></b>'; + echo '<br /><p><div class="centre"><input type="Submit" name="submit" value="' . _('Update Supplier') . '"></div><br />'; +// echo '<p><font color=red><b>' . _('WARNING') . ': ' . _('There is no second warning if you hit the delete button below') . '. ' . _('However checks will be made to ensure there are no outstanding purchase orders or existing accounts payable transactions before the deletion is processed') . '<br /></font></b>'; prnMsg(_('WARNING') . ': ' . _('There is no second warning if you hit the delete button below') . '. ' . _('However checks will be made to ensure there are no outstanding purchase orders or existing accounts payable transactions before the deletion is processed'), 'Warn'); - echo '<br><div class=centre><input type="submit" name="delete" VALUE="' . _('Delete Supplier') . '" onclick=\"return confirm(\'' . _('Are you sure you wish to delete this supplier?') . '\');\"></form>'; - echo '<br><a href="' . $rootpath . '/SupplierContacts.php?SupplierID=' . $SupplierID . '">' . _('Review Contact Details') . '</a></div>'; + echo '<br /><div class=centre><input type="submit" name="delete" value="' . _('Delete Supplier') . '" onclick=\"return confirm(\'' . _('Are you sure you wish to delete this supplier?') . '\');\"></form>'; + echo '<br /><a href="' . $rootpath . '/SupplierContacts.php?SupplierID=' . $SupplierID . '">' . _('Review Contact Details') . '</a></div>'; } echo '</div>'; } // end of main ifs Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-04-26 11:03:36 UTC (r... [truncated message content] |
From: <dai...@us...> - 2011-04-28 10:39:34
|
Revision: 4557 http://web-erp.svn.sourceforge.net/web-erp/?rev=4557&view=rev Author: daintree Date: 2011-04-28 10:39:25 +0000 (Thu, 28 Apr 2011) Log Message: ----------- quoting Modified Paths: -------------- trunk/AccountGroups.php trunk/Credit_Invoice.php trunk/FixedAssetItems.php trunk/GLTags.php trunk/PDFBankingSummary.php trunk/PDFChequeListing.php trunk/PDFOrderStatus.php trunk/Payments.php trunk/Suppliers.php trunk/UpgradeDatabase.php trunk/WWW_Access.php trunk/WorkOrderEntry.php trunk/doc/Change.log.html trunk/includes/ConnectDB.inc trunk/includes/ConnectDB_mysql.inc trunk/includes/ConnectDB_mysqli.inc trunk/includes/Login.php trunk/includes/MiscFunctions.php Added Paths: ----------- trunk/SecurityTokens.php trunk/sql/mysql/upgrade4.03-4.04.sql Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2011-04-26 11:03:36 UTC (rev 4556) +++ trunk/AccountGroups.php 2011-04-28 10:39:25 UTC (rev 4557) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.23 $ */ + /* $Id$*/ -//$PageSecurity = 10; - include('includes/session.inc'); $title = _('Account Groups'); @@ -227,12 +225,12 @@ echo '<table class="selection"> <tr> - <th>' . _('Group Name') . "</th> - <th>" . _('Section') . "</th> - <th>" . _('Sequence In TB') . "</th> - <th>" . _('Profit and Loss') . "</th> - <th>" . _('Parent Group') . "</th> - </tr>"; + <th>' . _('Group Name') . '</th> + <th>' . _('Section') . '</th> + <th>' . _('Sequence In TB') . '</th> + <th>' . _('Profit and Loss') . '</th> + <th>' . _('Parent Group') . '</th> + </tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_row($result)) { @@ -262,8 +260,8 @@ <td>' . $myrow[2] . '</td> <td>' . $PandLText . '</td> <td>' . $myrow[4] . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '&delete=1">' . _('Delete') .'</a></td></tr>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '&delete=1">' . _('Delete') .'</a></td></tr>'; } //END WHILE LIST LOOP echo '</table>'; @@ -271,12 +269,12 @@ if (isset($_POST['SelectedAccountGroup']) OR isset($_GET['SelectedAccountGroup'])) { - echo '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID .'">' . _('Review Account Groups') . '</a></div>'; + echo '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Review Account Groups') . '</a></div>'; } if (! isset($_GET['delete'])) { - echo '<br /><form method="post" id="AccountGroups" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; + echo '<br /><form method="post" id="AccountGroups" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -339,13 +337,12 @@ <input tabindex="1" ' . (in_array('GroupName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="GroupName" size="50" maxlength="50" value="' . $_POST['GroupName'] . '" /></td></tr>'; } echo '<tr><td>' . _('Parent Group') . ':' . '</td> - <td><select tabindex="2" ' . (in_array('ParentGroupName',$Errors) ? 'class="selecterror"' : '' ) . - ' name="ParentGroupName">'; + <td><select tabindex="2" ' . (in_array('ParentGroupName',$Errors) ? 'class="selecterror"' : '' ) . ' name="ParentGroupName">'; - $sql = 'SELECT groupname FROM accountgroups'; + $sql = "SELECT groupname FROM accountgroups"; $groupresult = DB_query($sql, $db,$ErrMsg,$DbgMsg); if (!isset($_POST['ParentGroupName'])){ - echo '<option selected="selected" value="">' ._('Top Level Group').'</option>'; + echo '<option selected value="">' ._('Top Level Group').'</option>'; } else { echo '<option value="">' ._('Top Level Group').'</option>'; } Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-04-26 11:03:36 UTC (rev 4556) +++ trunk/Credit_Invoice.php 2011-04-28 10:39:25 UTC (rev 4557) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity =3; - /*Functions to get the GL codes to post the transaction to */ include('includes/GetSalesTransGLCodes.inc'); /*defines the structure of the data required to hold the transaction as a session variable */ @@ -398,8 +396,8 @@ <td colspan=3 class=number>' . _('Freight cost charged on invoice') . '</td> <td class=number>' . number_format($_SESSION['Old_FreightCost'],2) . '</td> <td></td> - <td colspan=2 class=number>' . _('Credit Freight Cost') . "</td> - <td><input tabindex=".$j." type=text class=number size=6 maxlength=6 name='ChargeFreightCost' value=" . $_SESSION['CreditItems']->FreightCost . "></td>"; + <td colspan=2 class=number>' . _('Credit Freight Cost') . '</td> + <td><input tabindex='.$j.' type=text class="number" size=6 maxlength=6 name="ChargeFreightCost" value="' . $_SESSION['CreditItems']->FreightCost . '"></td>'; echo '<td>'; echo '</td><td>'; @@ -422,7 +420,7 @@ } if (!isset($_POST['ProcessCredit'])) { - echo '<input type=text class=number name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength=4 size=4 VALUE=' . $FreightTaxLine->TaxRate * 100 . '>'; + echo '<input type=text class=number name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength=4 size=4 value=' . $FreightTaxLine->TaxRate * 100 . '>'; } if ($FreightTaxLine->TaxOnTax ==1){ $TaxTotals[$FreightTaxLine->TaxAuthID] += ($FreightTaxLine->TaxRate * ($_SESSION['CreditItems']->FreightCost + $FreightTaxTotal)); @@ -437,8 +435,8 @@ if (!isset($_POST['ProcessCredit'])) { echo '</td>'; - echo '<td class=number>' . number_format($FreightTaxTotal,2) . '</td> - <td class=number>' . number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,2) . '</td> + echo '<td class="number">' . number_format($FreightTaxTotal,2) . '</td> + <td class="number">' . number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,2) . '</td> </tr>'; } @@ -447,12 +445,12 @@ if (!isset($_POST['ProcessCredit'])) { echo '<tr> - <td colspan=7 class=number>' . _('Credit Totals') . "</td> - <td class=number><hr><b>$DisplayTotal</b><hr></td> + <td colspan=7 class=number>' . _('Credit Totals') . '</td> + <td class=number><hr><b>' . $DisplayTotal . '</b><hr></td> <td colspan=2></td> - <td class=number><hr><b>" . number_format($TaxTotal,2) . "<hr></td> - <td class=number><hr><b>" . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),2) . "</b><hr></td> - </tr></table>"; + <td class=number><hr><b>' . number_format($TaxTotal,2) . '<hr></td> + <td class=number><hr><b>' . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),2) . '</b><hr></td> + </tr></table>'; } $DefaultDispatchDate = Date($_SESSION['DefaultDateFormat']); @@ -493,12 +491,11 @@ /*Start an SQL transaction */ - $SQL = 'BEGIN'; - $Result = DB_query($SQL,$db); + + $Result = DB_Txn_Begin($db); $DefaultDispatchDate= FormatDateForSQL($DefaultDispatchDate); - /*Calculate the allocation and see if it is possible to allocate to the invoice being credited */ $SQL = "SELECT (ovamount+ovgst+ovfreight-ovdiscount-alloc) as baltoallocate @@ -822,7 +819,7 @@ /* Insert stock movements for the stock coming back in - with unit cost */ - if ($MBFlag=="M" OR $MBFlag=="B"){ + if ($MBFlag=='M' OR $MBFlag=='B'){ $SQL = "INSERT INTO stockmoves ( stockid, type, @@ -1437,8 +1434,7 @@ } } /*end of if Sales and GL integrated */ - $SQL='COMMIT'; - $Result = DB_query($SQL,$db); + $Result = DB_Txn_Commit($db); unset($_SESSION['CreditItems']->LineItems); unset($_SESSION['CreditItems']); Modified: trunk/FixedAssetItems.php =================================================================== --- trunk/FixedAssetItems.php 2011-04-26 11:03:36 UTC (rev 4556) +++ trunk/FixedAssetItems.php 2011-04-28 10:39:25 UTC (rev 4557) @@ -50,7 +50,7 @@ if ($UploadTheFile=='Yes'){ $result = move_uploaded_file($_FILES['ItemPicture']['tmp_name'], $filename); - $message = ($result)?_('File url') ."<a href='". $filename ."'>" . $filename . '</a>' : _('Something is wrong with uploading a file'); + $message = ($result)?_('File url') .'<a href="' . $filename .'">' . $filename . '</a>' : _('Something is wrong with uploading a file'); } /* EOR Add Image upload for New Item - by Ori */ } @@ -262,10 +262,6 @@ prnMsg( _('The new asset has been added to the database with an asset code of:') . ' ' . $NewAssetID,'success'); unset($_POST['LongDescription']); unset($_POST['Description']); -// unset($_POST['AssetCategoryID']); -// unset($_POST['AssetLocation']); -// unset($_POST['DepnType']); -// unset($_POST['DepnRate']); unset($_POST['BarCode']); unset($_POST['SerialNo']); }//ALL WORKED SO RESET THE FORM VARIABLES @@ -374,8 +370,8 @@ } /* end if delete asset */ $result = DB_Txn_Commit($db); -echo '<form name="AssetForm" enctype="multipart/form-data" method="post" action="' . $_SERVER['PHP_SELF'] . '?' .SID . - '"><table class=selection>'; +echo '<form name="AssetForm" enctype="multipart/form-data" method="post" action="' . $_SERVER['PHP_SELF'] . '"> + <table class=selection>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -452,7 +448,7 @@ echo '<tr><td>'. _('Image File (.jpg)') . ':</td><td><input type="file" id="ItemPicture" name="ItemPicture"></td>'; if (function_exists('imagecreatefromjpg')){ - $StockImgLink = '<img src="GetStockImage.php?SID&automake=1&textcolor=FFFFFF&bgcolor=CCCCCC'. + $StockImgLink = '<img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC'. '&AssetID='.urlencode($AssetID). '&text='. '&width=64'. Modified: trunk/GLTags.php =================================================================== --- trunk/GLTags.php 2011-04-26 11:03:36 UTC (rev 4556) +++ trunk/GLTags.php 2011-04-28 10:39:25 UTC (rev 4557) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -//$PageSecurity = 10; + include('includes/session.inc'); $title = _('Maintain General Ledger Tags'); @@ -19,13 +19,13 @@ } if (isset($_POST['submit'])) { - $sql = "insert into tags values(NULL, '".$_POST['description']."')"; + $sql = "INSERT INTO tags values(NULL, '".$_POST['description']."')"; $result= DB_query($sql,$db); } if (isset($_POST['update'])) { - $sql = "update tags set tagdescription='".$_POST['description']. - "' where tagref='".$_POST['reference']."'"; + $sql = "UPDATE tags SET tagdescription='".$_POST['description']. + "' WHERE tagref='".$_POST['reference']."'"; $result= DB_query($sql,$db); } echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . @@ -41,9 +41,9 @@ <input type="hidden" name="reference" value="'.$_GET['SelectedTag'].'">'; if (isset($_GET['Action']) and $_GET['Action']=='edit') { - echo '<input type=Submit name=update value=' . _('Update') . '>'; + echo '<input type="submit" name=update value=' . _('Update') . '>'; } else { - echo '<input type=Submit name=submit value=' . _('Insert') . '>'; + echo '<input type="submit" name=submit value=' . _('Insert') . '>'; } echo '</td></tr></table><p></p>'; @@ -58,13 +58,13 @@ $result= DB_query($sql,$db); while ($myrow = DB_fetch_array($result,$db)){ - echo '<tr><td>'.$myrow[0].'</td><td>'.$myrow[1].'</td><td><a href="' . - $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedTag=' . $myrow[0] . '&Action=edit">' . _('Edit') . '</a></td></tr>'; + echo '<tr><td>'.$myrow[0].'</td><td>'.$myrow[1].'</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedTag=' . $myrow[0] . '&Action=edit">' . _('Edit') . '</a></td></tr>'; } echo '</table><p></p>'; -echo "<script>defaultControl(document.form.description);</script>"; +echo '<script>defaultControl(document.form.description);</script>'; include('includes/footer.inc'); Modified: trunk/PDFBankingSummary.php =================================================================== --- trunk/PDFBankingSummary.php 2011-04-26 11:03:36 UTC (rev 4556) +++ trunk/PDFBankingSummary.php 2011-04-28 10:39:25 UTC (rev 4557) @@ -16,15 +16,16 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . $title . '" alt="" />' . ' ' . $title . '</p>'; - $sql='SELECT DISTINCT + $sql="SELECT DISTINCT transno, transdate FROM banktrans WHERE type=12 - ORDER BY transno DESC'; + ORDER BY transno DESC"; $result=DB_query($sql, $db); - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '"><table class=selection>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '"> + <table class=selection>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('Select the batch number of receipts to be printed') . ':</td>'; echo '<td><select name="BatchNo">'; @@ -165,7 +166,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format($TotalBanked,2), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,300,$FontSize,_('TOTAL') . ' ' . $Currency . ' ' . _('BANKED'), 'left'); - $pdf->OutputD($_SESSION['DatabaseName'] . '_BankingSummary_' . date('Y-m-d').'.pdf');//UldisN + $pdf->OutputD($_SESSION['DatabaseName'] . '_BankingSummary_' . date('Y-m-d').'.pdf'); $pdf->__destruct(); } Modified: trunk/PDFChequeListing.php =================================================================== --- trunk/PDFChequeListing.php 2011-04-26 11:03:36 UTC (rev 4556) +++ trunk/PDFChequeListing.php 2011-04-28 10:39:25 UTC (rev 4557) @@ -31,6 +31,7 @@ } echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection> <tr> Modified: trunk/PDFOrderStatus.php =================================================================== --- trunk/PDFOrderStatus.php 2011-04-26 11:03:36 UTC (rev 4556) +++ trunk/PDFOrderStatus.php 2011-04-28 10:39:25 UTC (rev 4557) @@ -27,12 +27,11 @@ prnMsg($msg,'error'); } - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' ' - . _('Order Status Report') . '</p>'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' ' . _('Order Status Report') . '</p>'; echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection> + echo '<table class="selection"> <tr> <td>' . _('Enter the date from which orders are to be listed') . ':</td> <td><input type=text class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" maxlength=10 size=10 value="' . Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))) . '"></td> @@ -54,7 +53,7 @@ echo '</select></td></tr>'; echo '<tr><td>' . _('Inventory Location') . ':</td><td><select name="Location">'; - echo '<option selected value="All">' . _('All Locations'); + echo '<option selected value="All">' . _('All Locations') . '</option>'; $result= DB_query("SELECT loccode, locationname FROM locations",$db); while ($myrow=DB_fetch_array($result)){ @@ -242,9 +241,9 @@ if (DB_error_no($db)!=0){ include('includes/header.inc'); - echo '<br>' . _('An error occurred getting the orders details'); + echo '<br />' . _('An error occurred getting the orders details'); if ($debug==1){ - echo '<br>' . _('The SQL used to get the orders that failed was') . '<br>' . $sql; + echo '<br />' . _('The SQL used to get the orders that failed was') . '<br />' . $sql; } include ('includes/footer.inc'); exit; @@ -341,6 +340,6 @@ $OrderNo=0; } /*end of new page header */ } /* end of while there are delivery differences to print */ -$pdf->OutputD($_SESSION['DatabaseName'] . '_OrderStatus_' . date('Y-m-d') . '.pdf');//UldisN -$pdf->__destruct(); //UldisN +$pdf->OutputD($_SESSION['DatabaseName'] . '_OrderStatus_' . date('Y-m-d') . '.pdf'); +$pdf->__destruct(); ?> \ No newline at end of file Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2011-04-26 11:03:36 UTC (rev 4556) +++ trunk/Payments.php 2011-04-28 10:39:25 UTC (rev 4557) @@ -723,18 +723,19 @@ echo ' ' . _('on') . ' ' . $_SESSION['PaymentDetail']->DatePaid . '</font></th></tr>'; -$SQL = 'SELECT bankaccountname, +$SQL = "SELECT bankaccountname, bankaccounts.accountcode, bankaccounts.currcode FROM bankaccounts, chartmaster - WHERE bankaccounts.accountcode=chartmaster.accountcode'; + WHERE bankaccounts.accountcode=chartmaster.accountcode"; $ErrMsg = _('The bank accounts could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the bank accounts was'); $AccountsResults = DB_query($SQL,$db,$ErrMsg,$DbgMsg); -echo '<tr><td>' . _('Bank Account') . ':</td><td><select name="BankAccount" onChange="ReloadForm(UpdateHeader)">'; +echo '<tr><td>' . _('Bank Account') . ':</td> + <td><select name="BankAccount" onChange="ReloadForm(UpdateHeader)">'; if (DB_num_rows($AccountsResults)==0){ echo '</select></td></tr></table><p>'; @@ -746,9 +747,9 @@ while ($myrow=DB_fetch_array($AccountsResults)){ /*list the bank account names */ if (isset($_POST['BankAccount']) and $_POST['BankAccount']==$myrow['accountcode']){ - echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode']; + echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode'] . '</option>'; } else { - echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode']; + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode'] . '</option>'; } } echo '</select></td></tr>'; @@ -762,7 +763,7 @@ if ($_SESSION['PaymentDetail']->SupplierID==''){ echo '<tr><td>' . _('Currency of Payment') . ':</td><td><select name="Currency" onChange="ReloadForm(UpdateHeader)">'; - $SQL = 'SELECT currency, currabrev, rate FROM currencies'; + $SQL = "SELECT currency, currabrev, rate FROM currencies"; $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ @@ -771,9 +772,9 @@ } else { while ($myrow=DB_fetch_array($result)){ if ($_SESSION['PaymentDetail']->Currency==$myrow['currabrev']){ - echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['currency']; + echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>'; } else { - echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['currency']; + echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>'; } } echo '</select></td><td><i>' . _('The transaction currency does not need to be the same as the bank account currency') . '</i></td></tr>'; @@ -822,10 +823,12 @@ if ($_POST['FunctionalExRate']==1 AND isset($SuggestedFunctionalExRate)){ $_POST['FunctionalExRate'] = $SuggestedFunctionalExRate; } - echo '<tr><td>' . _('Functional Exchange Rate') . ':</td><td><input type="text" name="FunctionalExRate" maxlength=10 size=12 value="' . $_POST['FunctionalExRate'] . '"></td> + echo '<tr><td>' . _('Functional Exchange Rate') . ':</td> + <td><input type="text" name="FunctionalExRate" maxlength=10 size=12 value="' . $_POST['FunctionalExRate'] . '"></td> <td>' . ' ' . $SuggestedFunctionalExRateText . ' <i>' . _('The exchange rate between the currency of the business (the functional currency) and the currency of the bank account') . '. 1 ' . $_SESSION['CompanyRecord']['currencydefault'] . ' = ? ' . $_SESSION['PaymentDetail']->AccountCurrency . '</i></td></tr>'; } -echo '<tr><td>' . _('Payment type') . ':</td><td><select name="Paymenttype">'; +echo '<tr><td>' . _('Payment type') . ':</td> + <td><select name="Paymenttype">'; include('includes/GetPaymentMethods.php'); /* The array Payttypes is set up in includes/GetPaymentMethods.php @@ -834,9 +837,9 @@ foreach ($PaytTypes as $PaytType) { if (isset($_POST['Paymenttype']) and $_POST['Paymenttype']==$PaytType){ - echo '<option selected value="' . $PaytType . '">' . $PaytType; + echo '<option selected value="' . $PaytType . '">' . $PaytType . '</option>'; } else { - echo '<option Value="' . $PaytType . '">' . $PaytType; + echo '<option Value="' . $PaytType . '">' . $PaytType . '</option>'; } } //end foreach echo '</select></td></tr>'; @@ -853,7 +856,7 @@ } echo '<tr><td>' . _('Reference / Narrative') . ':</td> - <td colspan=2><input type="text" name="Narrative" maxlength=80 size=82 value="' . $_POST['Narrative'] . '"> ' . _('(Max. length 80 characters)') . '</td></tr>'; + <td colspan=2><input type="text" name="Narrative" maxlength=80 size=82 value="' . $_POST['Narrative'] . '"> ' . _('(Max. length 80 characters)') . '</td></tr>'; echo '<tr><td colspan=3><div class="centre"><input type="submit" name="UpdateHeader" value="' . _('Update'). '"></td></tr>'; @@ -894,13 +897,46 @@ echo '<tr><td>' . _('Enter GL Account Manually') . ':</td> <td><input type=Text class="number" Name="GLManualCode" Maxlength=12 size=12 onChange="return inArray(this, GLCode.options,'. "'".'The account code '."'".'+ this.value+ '."'".' doesnt exist'."'".')"></td></tr>'; } - echo '<tr><td>' . _('Select GL Account') . ':</td> - <td><select name="GLCode" onChange="return assignComboToInput(this,'.'GLManualCode'.')">'; + + echo '<tr><td>' . _('Select GL Group') . ':</td> + <td><select name="GLGroup" onChange="return ReloadForm(UpdateCodes)">'; - $SQL = 'SELECT accountcode, + $SQL = "SELECT groupname + FROM accountgroups + ORDER BY sequenceintb"; + + $result=DB_query($SQL,$db); + if (DB_num_rows($result)==0){ + echo '</select></td></tr>'; + prnMsg(_('No General ledger account groups have been set up yet') . ' - ' . _('payments cannot be analysed against GL accounts until the GL accounts are set up'),'error'); + } else { + echo '<option value=""></option>'; + while ($myrow=DB_fetch_array($result)){ + if (isset($_POST['GLGroup']) and ($_POST['GLGroup']==$myrow['groupname'])){ + echo '<option selected value="' . $myrow['groupname'] . '">' . $myrow['groupname'] . '</option>'; + } else { + echo '<option value="' . $myrow['groupname'] . '">' . $myrow['groupname'] . '</option>'; + } + } + echo '</select><input type="submit" name="UpdateCodes" value="Select" /></td></tr>'; + } + + if (isset($_POST['GLGroup']) and $_POST['GLGroup']!='') { + $SQL = "SELECT accountcode, accountname FROM chartmaster - ORDER BY accountcode'; + WHERE group_='".$_POST['GLGroup']."' + ORDER BY accountcode"; + } else { + $SQL = "SELECT accountcode, + accountname + FROM chartmaster + ORDER BY accountcode"; + } + + + echo '<tr><td>' . _('Select GL Account') . ':</td> + <td><select name="GLCode" onChange="return assignComboToInput(this,'.'GLManualCode'.')">'; $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ @@ -909,40 +945,47 @@ } else { echo '<option value=""></option>'; while ($myrow=DB_fetch_array($result)){ - if (isset($_POST['GLCode']) and $_POST['GLCode']==$myrow["accountcode"]){ - echo '<option selected value=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' - ' . $myrow['accountname']; + if (isset($_POST['GLCode']) and $_POST['GLCode']==$myrow['accountcode']){ + echo '<option selected value=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; } else { - echo '<option value=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' - ' . $myrow['accountname']; + echo '<option value=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; } } echo '</select></td></tr>'; } - echo '<tr><td>'. _('Cheque/Voucher Number') .'</td><td><input type="text" name="cheque" Maxlength=12 size=12></td></tr>'; + echo '<tr><td>'. _('Cheque/Voucher Number') .'</td> + <td><input type="text" name="cheque" Maxlength=12 size=12></td></tr>'; if (isset($_POST['GLNarrative'])) { - echo '<tr><td>' . _('GL Narrative') . ':</td><td><input type="text" name="GLNarrative" maxlength=50 size=52 value="' . $_POST['GLNarrative'] . '"></td></tr>'; + echo '<tr><td>' . _('GL Narrative') . ':</td> + <td><input type="text" name="GLNarrative" maxlength=50 size=52 value="' . $_POST['GLNarrative'] . '"></td></tr>'; } else { - echo '<tr><td>' . _('GL Narrative') . ':</td><td><input type="text" name="GLNarrative" maxlength=50 size=52></td></tr>'; + echo '<tr><td>' . _('GL Narrative') . ':</td> + <td><input type="text" name="GLNarrative" maxlength=50 size=52></td></tr>'; } if (isset($_POST['GLAmount'])) { - echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td><td><input type=Text Name="GLAmount" Maxlength=12 size=12 class=number value=' . $_POST['GLAmount'] . '></td></tr>'; + echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td> + <td><input type=Text Name="GLAmount" Maxlength=12 size=12 class=number value=' . $_POST['GLAmount'] . '></td></tr>'; } else { - echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td><td><input type=Text Name="GLAmount" Maxlength=12 size=12 class=number></td></tr>'; + echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td> + <td><input type=Text Name="GLAmount" Maxlength=12 size=12 class=number></td></tr>'; } echo '</table><br />'; echo '<div class="centre"><input type=submit name="Process" value="' . _('Accept') . '"><input type=submit name="Cancel" value="' . _('Cancel') . '"></div>'; if (sizeOf($_SESSION['PaymentDetail']->GLItems)>0) { - echo '<br /><table class=selection><tr> - <th>' . _('Cheque No').'</th> - <th>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . ')</th> - <th>' . _('GL Account') . '</th> - <th>' . _('Narrative') . '</th> - <th>' . _('Tag') . '</th> - </tr>'; + echo '<br /> + <table class=selection> + <tr> + <th>' . _('Cheque No').'</th> + <th>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . ')</th> + <th>' . _('GL Account') . '</th> + <th>' . _('Narrative') . '</th> + <th>' . _('Tag') . '</th> + </tr>'; $PaymentTotal = 0; foreach ($_SESSION['PaymentDetail']->GLItems as $PaymentItem) { Added: trunk/SecurityTokens.php =================================================================== --- trunk/SecurityTokens.php (rev 0) +++ trunk/SecurityTokens.php 2011-04-28 10:39:25 UTC (rev 4557) @@ -0,0 +1,86 @@ +<?php + +/* $Id$*/ +//$PageSecurity = 10; +include('includes/session.inc'); +$title = _('Maintain Security Tokens'); + +include('includes/header.inc'); + +if (isset($_GET['SelectedToken'])) { + $sql="SELECT tokenid, tokenname FROM securitytokens where tokenid='".$_GET['SelectedToken']."'"; + $result= DB_query($sql,$db); + $myrow = DB_fetch_array($result,$db); + $ref=$myrow[0]; + $description=$myrow[1]; +} else if (!isset($_POST['TokenID'])){ + $description=''; + $_POST['TokenID']=''; + $_GET['SelectedToken']=''; +} else { + $description=$_POST['Description']; +} + +if (isset($_POST['submit'])) { + $TestSQL="SELECT tokenid FROM securitytokens WHERE tokenid='".$_POST['TokenID']."'"; + $TestResult=DB_query($TestSQL, $db); + if (DB_num_rows($TestResult)==0) { + $sql = "INSERT INTO securitytokens values('".$_POST['TokenID']."', '".$_POST['Description']."')"; + $result= DB_query($sql,$db); + unset($description); + unset($_POST['TokenID']); + } else { + prnMsg( _('This token ID has already been used. Please use a new one') , 'warn'); + } +} + +if (isset($_POST['update'])) { + $sql = "UPDATE securitytokens SET tokenname='".$_POST['Description']. + "' WHERE tokenid='".$_POST['TokenID']."'"; + $result= DB_query($sql,$db); + unset($description); + unset($_POST['TokenID']); +} +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . + _('Print') . '" alt="" />' . ' ' . $title . '</p>'; + +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" name="form">'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +echo '<br><table><tr>'; + + + +if (isset($_GET['Action']) and $_GET['Action']=='edit') { + echo '<td>'. _('Description') . '</td> + <td><input type="text" size=30 maxlength=30 name="Description" value="'.$description.'"></td><td> + <input type="hidden" name="TokenID" value="'.$_GET['SelectedToken'].'">'; + echo '<input type=Submit name=update value=' . _('Update') . '>'; +} else { + echo '<td>'._('Token ID') . '<td><input type="text" name="TokenID" value="'.$_POST['TokenID'].'"></td></tr> + <tr><td>'. _('Description') . '</td><td><input type="text" size=30 maxlength=30 name="Description" value="'.$description.'"></td><td>'; + echo '<input type=Submit name=submit value=' . _('Insert') . '>'; +} + +echo '</td></tr></table><p></p>'; + +echo '</form>'; + +echo '<table class=selection>'; +echo '<tr><th>'. _('Token ID') .'</th>'; +echo '<th>'. _('Description'). '</th>'; + +$sql="SELECT tokenid, tokenname FROM securitytokens ORDER BY tokenid"; +$result= DB_query($sql,$db); + +while ($myrow = DB_fetch_array($result,$db)){ + echo '<tr><td>'.$myrow[0].'</td><td>'.$myrow[1].'</td><td><a href="' . + $_SERVER['PHP_SELF'] . '?SelectedToken=' . $myrow[0] . '&Action=edit">' . _('Edit') . '</a></td></tr>'; +} + +echo '</table><p></p>'; + +echo "<script>defaultControl(document.form.description);</script>"; + +include('includes/footer.inc'); + +?> \ No newline at end of file Modified: trunk/Suppliers.php =================================================================== --- trunk/Suppliers.php 2011-04-26 11:03:36 UTC (rev 4556) +++ trunk/Suppliers.php 2011-04-28 10:39:25 UTC (rev 4557) @@ -2,8 +2,6 @@ /* $Id$ */ -//$PageSecurity = 5; - include('includes/session.inc'); $title = _('Supplier Maintenance'); @@ -137,7 +135,7 @@ break; default: - echo _('The prefix') . ' - ' . $BankPrefix . ' ' . _('is not a valid New Zealand Bank') . '.<br>' . + echo _('The prefix') . ' - ' . $BankPrefix . ' ' . _('is not a valid New Zealand Bank') . '.<br />' . _('If you are using webERP outside New Zealand error trapping relevant to your country should be used'); return False; exit; @@ -301,8 +299,6 @@ unset($SupplierID); } -// This is aleady linked from this page -//echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Suppliers') . '</p>'; $InputError = 0; @@ -426,7 +422,7 @@ $longitude = $coordinatesSplit[0]; $status = $xml->Response->Status->code; - if (strcmp($status, "200") == 0) { + if (strcmp($status, '200') == 0) { // Successful geocode $geocode_pending = false; $coordinates = $xml->Response->Placemark->Point->coordinates; @@ -437,22 +433,22 @@ } else { // failure to geocode $geocode_pending = false; - echo '<p>Address: ' . $address . ' failed to geocode'."\n"; - echo 'Received status ' . $status . "\n" . '</p>'; + echo '<p>' . _('Address') . ': ' . $address . ' ' . _('failed to geocode') ."\n"; + echo _('Received status') . ' ' . $status . "\n" . '</p>'; } } } if (!isset($_POST['New'])) { $supptranssql = "SELECT supplierno - FROM supptrans - WHERE supplierno='".$SupplierID ."'"; + FROM supptrans + WHERE supplierno='".$SupplierID ."'"; $suppresult = DB_query($supptranssql, $db); $supptrans = DB_num_rows($suppresult); $suppcurrssql = "SELECT currcode - FROM suppliers - WHERE supplierid='".$SupplierID ."'"; + FROM suppliers + WHERE supplierid='".$SupplierID ."'"; $currresult = DB_query($suppcurrssql, $db); $suppcurr = DB_fetch_row($currresult); @@ -516,49 +512,49 @@ } else { //its a new supplier $sql = "INSERT INTO suppliers (supplierid, - suppname, - address1, - address2, - address3, - address4, - telephone, - fax, - email, - supptype, - currcode, - suppliersince, - paymentterms, - bankpartics, - bankref, - bankact, - remittance, - taxgroupid, - factorcompanyid, - lat, - lng, - taxref) - VALUES ('$SupplierID', - '" . $_POST['SuppName'] . "', - '" . $_POST['Address1'] . "', - '" . $_POST['Address2'] . "', - '" . $_POST['Address3'] . "', - '" . $_POST['Address4'] . "', - '".$_POST['Phone']."', - '".$_POST['Fax']."', - '".$_POST['Email']."', - '".$_POST['SupplierType']."', - '" . $_POST['CurrCode'] . "', - '" . $SQL_SupplierSince . "', - '" . $_POST['PaymentTerms'] . "', - '" . $_POST['BankPartics'] . "', - '" . $_POST['BankRef'] . "', - '" . $_POST['BankAct'] . "', - '" . $_POST['Remittance'] . "', - '" . $_POST['TaxGroup'] . "', - '" . $_POST['FactorID'] . "', - '" . $latitude ."', - '" . $longitude ."', - '" . $_POST['TaxRef'] . "')"; + suppname, + address1, + address2, + address3, + address4, + telephone, + fax, + email, + supptype, + currcode, + suppliersince, + paymentterms, + bankpartics, + bankref, + bankact, + remittance, + taxgroupid, + factorcompanyid, + lat, + lng, + taxref) + VALUES ('$SupplierID', + '" . $_POST['SuppName'] . "', + '" . $_POST['Address1'] . "', + '" . $_POST['Address2'] . "', + '" . $_POST['Address3'] . "', + '" . $_POST['Address4'] . "', + '".$_POST['Phone']."', + '".$_POST['Fax']."', + '".$_POST['Email']."', + '".$_POST['SupplierType']."', + '" . $_POST['CurrCode'] . "', + '" . $SQL_SupplierSince . "', + '" . $_POST['PaymentTerms'] . "', + '" . $_POST['BankPartics'] . "', + '" . $_POST['BankRef'] . "', + '" . $_POST['BankAct'] . "', + '" . $_POST['Remittance'] . "', + '" . $_POST['TaxGroup'] . "', + '" . $_POST['FactorID'] . "', + '" . $latitude ."', + '" . $longitude ."', + '" . $_POST['TaxRef'] . "')"; $ErrMsg = _('The supplier') . ' ' . $_POST['SuppName'] . ' ' . _('could not be added because'); $DbgMsg = _('The SQL that was used to insert the supplier but failed was'); @@ -610,7 +606,7 @@ if ($myrow[0] > 0) { $CancelDelete = 1; prnMsg(_('Cannot delete this supplier because there are transactions that refer to this supplier'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions against this supplier'); + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions against this supplier'); } else { $sql= "SELECT COUNT(*) FROM purchorders WHERE supplierno='" . $SupplierID . "'"; @@ -619,7 +615,7 @@ if ($myrow[0] > 0) { $CancelDelete = 1; prnMsg(_('Cannot delete the supplier record because purchase orders have been created against this supplier'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('orders against this supplier'); + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('orders against this supplier'); } else { $sql= "SELECT COUNT(*) FROM suppliercontacts WHERE supplierid='" . $SupplierID . "'"; $result = DB_query($sql, $db); @@ -627,7 +623,7 @@ if ($myrow[0] > 0) { $CancelDelete = 1; prnMsg(_('Cannot delete this supplier because there are supplier contacts set up against it') . ' - ' . _('delete these first'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('supplier contacts relating to this supplier'); + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('supplier contacts relating to this supplier'); } } @@ -647,105 +643,140 @@ /*If the page was called without $SupplierID passed to page then assume a new supplier is to be entered show a form with a Supplier Code field other wise the form showing the fields with the existing entries against the supplier will show for editing with only a hidden SupplierID field*/ - echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . "?" . SID . "'>"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo "<input type='hidden' name='New' VALUE='Yes'>"; + echo '<input type="hidden" name="New" value="Yes">'; echo '<table class=selection>'; - echo '<tr><td>' . _('Supplier Code') . ":</td><td><input type='text' name='SupplierID' size=11 maxlength=10></td></tr>"; - echo '<tr><td>' . _('Supplier Name') . ":</td><td><input type='text' name='SuppName' size=42 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Address Line 1 (Street)') . ":</td><td><input type='text' name='Address1' size=42 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ":</td><td><input type='text' name='Address2' size=42 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Address Line 3 (State/Province)') . ":</td><td><input type='text' name='Address3' size=42 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ":</td><td><input type='text' name='Address4' size=42 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Telephone') . ":</td><td><input type='text' name='Phone' size=30 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Facsimile') . ":</td><td><input type='text' name='Fax' size=30 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Email Address') . ":</td><td><input type='text' name='Email' size=30 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Supplier Type') . ":</td><td><select name='SupplierType'>"; - $result=DB_query('SELECT typeid, typename FROM suppliertype', $db); + echo '<tr><td>' . _('Supplier Code') . ':</td> + <td><input type="text" name="SupplierID" size=11 maxlength=10></td> + </tr>'; + echo '<tr><td>' . _('Supplier Name') . ':</td> + <td><input type="text" name="SuppName" size=42 maxlength=40></td> + </tr>'; + echo '<tr><td>' . _('Address Line 1 (Street)') . ':</td> + <td><input type="text" name="Address1" size=42 maxlength=40></td> + </tr>'; + echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ':</td> + <td><input type="text" name="Address2" size=42 maxlength=40></td> + </tr>'; + echo '<tr><td>' . _('Address Line 3 (State/Province)') . ':</td> + <td><input type="text" name="Address3" size=42 maxlength=40></td> + </tr>'; + echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ':</td> + <td><input type="text" name="Address4" size=42 maxlength=40></td> + </tr>'; + echo '<tr><td>' . _('Telephone') . ':</td> + <td><input type="text" name="Phone" size=30 maxlength=40></td> + </tr>'; + echo '<tr><td>' . _('Facsimile') . ':</td> + <td><input type="text" name="Fax" size=30 maxlength=40></td> + </tr>'; + echo '<tr><td>' . _('Email Address') . ':</td> + <td><input type="text" name="Email" size=30 maxlength=40></td> + </tr>'; + echo '<tr><td>' . _('Supplier Type') . ':</td> + <td><select name="SupplierType">'; + $result=DB_query("SELECT typeid, typename FROM suppliertype", $db); while ($myrow = DB_fetch_array($result)) { - echo "<option VALUE='". $myrow['typeid'] . "'>" . $myrow['typename']; + echo '<option value="' . $myrow['typeid'] . '">' . $myrow['typename'] .'</option>'; } //end while loop - echo "</select></td></tr>"; + echo '</select></td></tr>'; $DateString = Date($_SESSION['DefaultDateFormat']); - echo '<tr><td>' . _('Supplier Since') . ' (' . $_SESSION['DefaultDateFormat'] . "):</td><td><input type='text' class='date' alt='".$_SESSION['DefaultDateFormat']."' name='SupplierSince' VALUE=$DateString size=12 maxlength=10></td></tr>"; - echo '<tr><td>' . _('Bank Particulars') . ":</td><td><input type='text' name='BankPartics' size=13 maxlength=12></td></tr>"; - echo '<tr><td>' . _('Bank reference') . ":</td><td><input type='text' name='BankRef' VALUE=0 size=13 maxlength=12></td></tr>"; - echo '<tr><td>' . _('Bank Account No') . ":</td><td><input type='text' name='BankAct' size=31 maxlength=30></td></tr>"; + echo '<tr><td>' . _('Supplier Since') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> + <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="SupplierSince" value="' . $DateString . '" size=12 maxlength=10></td> + </tr>'; + echo '<tr><td>' . _('Bank Particulars') . ':</td> + <td><input type="text" name="BankPartics" size=13 maxlength=12></td> + </tr>'; + echo '<tr><td>' . _('Bank reference') . ':</td> + <td><input type="text" name="BankRef" value=0 size=13 maxlength=12></td> + </tr>'; + echo '<tr><td>' . _('Bank Account No') . ':</td> + <td><input type="text" name="BankAct" size=31 maxlength=30></td></tr>'; - $result=DB_query('SELECT terms, termsindicator FROM paymentterms', $db); + $result=DB_query("SELECT terms, termsindicator FROM paymentterms", $db); - echo '<tr><td>' . _('Payment Terms') . ":</td><td><select name='PaymentTerms'>"; + echo '<tr><td>' . _('Payment Terms') . ':</td> + <td><select name="PaymentTerms">'; while ($myrow = DB_fetch_array($result)) { - echo "<option VALUE='". $myrow['termsindicator'] . "'>" . $myrow['terms']; + echo '<option value="'. $myrow['termsindicator'] . '">' . $myrow['terms'] .'</option>'; } //end while loop DB_data_seek($result, 0); echo '</select></td></tr>'; - $result=DB_query('SELECT id, coyname FROM factorcompanies', $db); + $result=DB_query("SELECT id, coyname FROM factorcompanies", $db); - echo '<tr><td>' . _('Factor Company') . ":</td><td><select name='FactorID'>"; - echo '<option VALUE=0>' . _('None'); + echo '<tr><td>' . _('Factor Company') . ':</td> + <td><select name="FactorID">'; + echo '<option value=0>' . _('None'); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['FactorID']) and $_POST['FactorID'] == $myrow['id']){ - echo '<option selected VALUE=' . $myrow['id'] . '>' . $myrow['coyname']; + echo '<option selected value=' . $myrow['id'] . '>' . $myrow['coyname'] .'</option>'; } else { - echo '<option VALUE=' . $myrow['id'] . '>' . $myrow['coyname']; + echo '<option value=' . $myrow['id'] . '>' . $myrow['coyname'] .'</option>'; } } //end while loop DB_data_seek($result, 0); echo '</select></td></tr>'; - echo '<tr><td>' . _('Tax Reference') . ':</td><td><input type="text" name=2TaxRef" size=21 maxlength=20></td></tr>'; + echo '<tr><td>' . _('Tax Reference') . ':</td> + <td><input type="text" name="TaxRef" size=21 maxlength=20></td></tr>'; - $result=DB_query('SELECT currency, currabrev FROM currencies', $db); + $result=DB_query("SELECT currency, currabrev FROM currencies", $db); if (!isset($_POST['CurrCode'])){ - $CurrResult = DB_query('SELECT currencydefault FROM companies WHERE coycode=1', $db); + $CurrResult = DB_query("SELECT currencydefault FROM companies WHERE coycode=1", $db); $myrow = DB_fetch_row($CurrResult); $_POST['CurrCode'] = $myrow[0]; } - echo '<tr><td>' . _('Supplier Currency') . ':</td><td><select name="CurrCode">'; + echo '<tr><td>' . _('Supplier Currency') . ':</td> + <td><select name="CurrCode">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['CurrCode'] == $myrow['currabrev']){ - echo '<option selected VALUE=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>'; + echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>'; } else { - echo '<option VALUE=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>'; + echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>'; } } //end while loop DB_data_seek($result, 0); - echo '</select></td></tr><tr><td>' . _('Remittance Advice') . ':</td><td><select name="Remittance">'; - echo '<option VALUE=0>' . _('Not Required') . '</option>'; - echo '<option VALUE=1>' . _('Required') . '</option>'; + echo '</select></td></tr> + <tr><td>' . _('Remittance Advice') . ':</td> + <td><select name="Remittance">'; + echo '<option value=0>' . _('Not Required') . '</option>'; + echo '<option value=1>' . _('Required') . '</option>'; echo '</select></td></tr>'; - echo '<tr><td>' . _('Tax Group') . ':</td><td><select name="TaxGroup">'; + echo '<tr><td>' . _('Tax Group') . ':</td> + <td><select name="TaxGroup">'; DB_data_seek($result, 0); - $sql = 'SELECT taxgroupid, taxgroupdescription FROM taxgroups'; + $sql = "SELECT taxgroupid, taxgroupdescription FROM taxgroups"; $result = DB_query($sql, $db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['TaxGroup']) and $_POST['TaxGroup'] == $myrow['taxgroupid']){ - echo '<option selected VALUE=' . $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription'] . '</option>'; + echo '<option selected value=' . $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription'] . '</option>'; } else { - echo '<option VALUE=' . $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription'] . '</option>'; + echo '<option value=' . $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription'] . '</option>'; } } //end while loop - echo '</select></td></tr></table><p><div class="centre"><input type="Submit" name="submit" VALUE="' . _('Insert New Supplier') . '">'; + echo '</select></td></tr> + </table> + <p><div class="centre"><input type="Submit" name="submit" value="' . _('Insert New Supplier') . '">'; echo '</div></form>'; } else { //SupplierID exists - either passed when calling the form or from the form itself - echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . "?" . SID . "'>"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection>'; @@ -796,91 +827,112 @@ $_POST['FactorID'] = $myrow['factorcompanyid']; $_POST['TaxRef'] = $myrow['taxref']; - echo '<input type=hidden name="SupplierID" VALUE="' . $SupplierID . '">'; + echo '<input type=hidden name="SupplierID" value="' . $SupplierID . '">'; } else { // its a new supplier being added - echo '<input type=hidden name="New" VALUE="Yes">'; - echo '<tr><td>' . _('Supplier Code') . ':</td><td><input '.(in_array('ID',$Errors) ? 'class="inputerror"' : '').' type="text" name="SupplierID" VALUE="' . $SupplierID . '" size=12 maxlength=10></td></tr>'; + echo '<input type=hidden name="New" value="Yes">'; + echo '<tr><td>' . _('Supplier Code') . ':</td> + <td><input '.(in_array('ID',$Errors) ? 'class="inputerror"' : '').' type="text" name="SupplierID" value="' . $SupplierID . '" size=12 maxlength=10></td></tr>'; } - echo '<tr><td>' . _('Supplier Name') . ':</td><td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="SuppName" VALUE="' . $_POST['SuppName'] . '" size=42 maxlength=40></td></tr>'; - echo '<tr><td>' . _('Address Line 1 (Street)') . ':</td><td><input type="text" name="Address1" VALUE="' . $_POST['Address1'] . '" size=42 maxlength=40></td></tr>'; - echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ':</td><td><input type="text" name="Address2" VALUE="' . $_POST['Address2'] . '" size=42 maxlength=40></td></tr>'; - echo '<tr><td>' . _('Address Line 3 (State/Province)') . ':</td><td><input type="text" name="Address3" VALUE="' . $_POST['Address3'] . '" size=42 maxlength=40></td></tr>'; - echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ':</td><td><input type="text" name="Address4" VALUE="' . $_POST['Address4'] . '" size=42 maxlength=40></td></tr>'; - echo '<tr><td>' . _('Telephone') . ':</td><td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Phone" VALUE="' . $_POST['Phone'] . '" size=42 maxlength=40></td></tr>'; - echo '<tr><td>' . _('Facsimile') . ':</td><td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Fax" VALUE="' . $_POST['Fax'] . '" size=42 maxlength=40></td></tr>'; - echo '<tr><td>' . _('Email Address') . ':</td><td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Email" VALUE="' . $_POST['Email'] . '" size=42 maxlength=40></td></tr>'; - echo '<tr><td>' . _('Supplier Type') . ":</td><td><select name='SupplierType'>"; - $result=DB_query('SELECT typeid, typename FROM suppliertype', $db); + echo '<tr><td>' . _('Supplier Name') . ':</td> + <td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="SuppName" value="' . $_POST['SuppName'] . '" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Address Line 1 (Street)') . ':</td> + <td><input type="text" name="Address1" value="' . $_POST['Address1'] . '" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ':</td> + <td><input type="text" name="Address2" value="' . $_POST['Address2'] . '" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Address Line 3 (State/Province)') . ':</td> + <td><input type="text" name="Address3" value="' . $_POST['Address3'] . '" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ':</td> + <td><input type="text" name="Address4" value="' . $_POST['Address4'] . '" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Telephone') . ':</td> + <td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Phone" value="' . $_POST['Phone'] . '" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Facsimile') . ':</td> + <td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Fax" value="' . $_POST['Fax'] . '" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Email Address') . ':</td> + <td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Email" value="' . $_POST['Email'] . '" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Supplier Type') . ':</td> + <td><select name="SupplierType">'; + $result=DB_query("SELECT typeid, typename FROM suppliertype", $db); while ($myrow = DB_fetch_array($result)) { if ($_POST['SupplierType']==$myrow['typeid']) { - echo "<option selected value='". $myrow['typeid'] . "'>" . $myrow['typename']; + echo '<option selected value="'. $myrow['typeid'] . '">' . $myrow['typename'] .'</option>'; } else { - echo "<option value='". $myrow['typeid'] . "'>" . $myrow['typename']; + echo '<option value="' . $myrow['typeid'] . '">' . $myrow['typename'] .'</option>'; } } //end while loop - echo "</select></td></tr>"; + echo '</select></td></tr>'; - echo '<tr><td>' . _('Supplier Since') . ' (' . $_SESSION['DefaultDateFormat'] .'):</td><td><input '.(in_array('SupplierSince',$Errors) ? 'class="inputerror"' : '').' size=12 maxlength=10 type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="SupplierSince" VALUE=' . $_POST['SupplierSince'] . '></td></tr>'; - echo '<tr><td>' . _('Bank Particulars') . ":</td><td><input type='text' name='BankPartics' size=13 maxlength=12 VALUE='" . $_POST['BankPartics'] . "'></td></tr>"; - echo '<tr><td>' . _('Bank Reference') . ':</td><td><input '.(in_array('BankRef',$Errors) ? 'class="inputerror"' : '').' type="text" name="BankRef" size=13 maxlength=12 VALUE="' . $_POST['BankRef'] . '"></td></tr>'; - echo '<tr><td>' . _('Bank Account No') . ":</td><td><input type='text' name='BankAct' size=31 maxlength=30 VALUE='" . $_POST['BankAct'] . "'></td></tr>"; + echo '<tr><td>' . _('Supplier Since') . ' (' . $_SESSION['DefaultDateFormat'] .'):</td> + <td><input '.(in_array('SupplierSince',$Errors) ? 'class="inputerror"' : '').' size=12 maxlength=10 type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="SupplierSince" value=' . $_POST['SupplierSince'] . '></td></tr>'; + echo '<tr><td>' . _('Bank Particulars') . ':</td> + <td><input type="text" name="BankPartics" size=13 maxlength=12 value="' . $_POST['BankPartics'] . '"></td></tr>'; + echo '<tr><td>' . _('Bank Reference') . ':</td> + <td><input '.(in_array('BankRef',$Errors) ? 'class="inputerror"' : '').' type="text" name="BankRef" size=13 maxlength=12 value="' . $_POST['BankRef'] . '"></td></tr>'; + echo '<tr><td>' . _('Bank Account No') . ':</td> + <td><input type="text" name="BankAct" size=31 maxlength=30 value="' . $_POST['BankAct'] . '"></td></tr>'; - $result=DB_query('SELECT terms, termsindicator FROM paymentterms', $db); + $result=DB_query("SELECT terms, termsindicator FROM paymentterms", $db); - echo '<tr><td>' . _('Payment Terms') . ":</td><td><select name='PaymentTerms'>"; + echo '<tr><td>' . _('Payment Terms') . ':</td> + <td><select name="PaymentTerms">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['PaymentTerms'] == $myrow['termsindicator']){ - echo '<option selected VALUE=' . $myrow['termsindicator'] . '>' . $myrow['terms']; + echo '<option selected value=' . $myrow['termsindicator'] . '>' . $myrow['terms'] .'</option>'; } else { - echo '<option VALUE=' . $myrow['termsindicator'] . '>' . $myrow['terms']; + echo '<option value=' . $myrow['termsindicator'] . '>' . $myrow['terms'] .'</option>'; } } //end while loop DB_data_seek($result, 0); - $result=DB_query('SELECT id, coyname FROM factorcompanies', $db); + $result=DB_query("SELECT id, coyname FROM factorcompanies", $db); - echo '<tr><td>' . _('Factor Company') . ":</td><td><select name='FactorID'>"; - echo '<option VALUE=0>' . _('None'); + echo '<tr><td>' . _('Factor Company') . ':</td> + <td><select name="FactorID">'; + echo '<option value=0>' . _('None'); while ($myrow = DB_fetch_array($result)) { if ($_POST['FactorID'] == $myrow['id']){ - echo '<option selected VALUE=' . $myrow['id'] . '>' . $myrow['coyname']; + echo '<option selected value=' . $myrow['id'] . '>' . $myrow['coyname'] .'</option>'; } else { - echo '<option VALUE=' . $myrow['id'] . '>' . $myrow['coyname']; + echo '<option value=' . $myrow['id'] . '>' . $myrow['coyname'] .'</option>'; } } //end while loop DB_data_seek($result, 0); - echo '<tr><td>' . _('Tax Reference') . ":</td><td><input type='text' name='TaxRef' size=21 maxlength=20 VALUE='".$_POST['TaxRef']."'></td></tr>"; + echo '<tr><td>' . _('Tax Reference') . ':</td> + <td><input type="text" name="TaxRef" size=21 maxlength=20 value="' . $_POST['TaxRef'] .'"></td></tr>'; - $result=DB_query('SELECT currency, currabrev FROM currencies', $db); + $result=DB_query("SELECT currency, currabrev FROM currencies", $db); - echo '</select></td></tr><tr><td>' . _('Supplier Currency') . ":</td><td><select name='CurrCode'>"; + echo '</select></td></tr><tr><td>' . _('Supplier Currency') . ':</td> + <td><select name="CurrCode">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['CurrCode'] == $myrow['currabrev']){ - echo '<option selected VALUE=' . $myrow['currabrev'] . '>' . $myrow['currency']; + echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['currency'] .'</option>'; } else { - echo '<option VALUE=' . $myrow['currabrev'] . '>' . $myrow['currency']; + echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['currency'] .'</option>'; } } //end while loop DB_data_seek($result, 0); - echo '</select></td></tr><tr><td>' . _('Remittance Advice') . ":</td><td><select name='Remittance'>"; + echo '</select></td></tr> + <tr><td>' . _('Remittance Advice') . ':</td> + <td><select name="Remittance">'; if ($_POST['Remittance'] == 0){ - echo '<option selected VALUE=0>' . _('Not Required'); - echo '<option VALUE=1>' . _('Required'); + echo '<option selected value=0>' . _('Not Required') .'</option>'; + echo '<option value=1>' . _('Required') .'</option>'; } else { - echo '<option VALUE=0>' . _('Not Required'); - echo '<option selected VALUE=1>' . _('Required'); + echo '<option value=0>' . _('Not Required') .'</option>'; + echo '<option selected value=1>' . _('Required') .'</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('Tax Group') . ":</td><td><select name='TaxGroup'>"; + echo '<tr><td>' . _('Tax Group') . ':</td> + <td><select name="TaxGroup">'; DB_data_seek($result, 0); @@ -889,9 +941,9 @@ while ($myrow = DB_fetch_array($result)) { if ($myrow['taxgroupid'] == $_POST['TaxGroup']) { - echo '<option selected VALUE="'.$myrow['taxgroupid'] . '">' . $myrow['taxgroupdescription'] . '</option>'; + echo '<option selected value="'.$myrow['taxgroupid'] . '">' . $myrow['taxgroupdescription'] . '</option>'; } else { - echo '<option VALUE="' . $myrow['taxgroupid'] . '">' . $myrow['taxgroupdescription'] . '</option>'; + echo '<option value="' . $myrow['taxgroupid'] . '">' . $myrow['taxgroupdescription'] . '</option>'; } } //end while loop @@ -899,13 +951,13 @@ echo '</select></td></tr></table>'; if (isset($_POST['New'])) { - echo '<p><div class="centre"><input type="Submit" name="submit" VALUE="' . _('Add These New Supplier Details') . '"></form>'; + echo '<p><div class="centre"><input type="Submit" name="submit" value="' . _('Add These New Supplier Details') . '"></form>'; } else { - echo '<br><p><div class="centre"><input type="Submit" name="submit" VALUE="' . _('Update Supplier') . '"></div><br>'; -// echo '<p><font color=red><b>' . _('WARNING') . ': ' . _('There is no second warning if you hit the delete button below') . '. ' . _('However checks will be made to ensure there are no outstanding purchase orders or existing accounts payable transactions before the deletion is processed') . '<br></font></b>'; + echo '<br /><p><div class="centre"><input type="Submit" name="submit" value="' . _('Update Supplier') . '"></div><br />'; +// echo '<p><font color=red><b>' . _('WARNING') . ': ' . _('There is no second warning if you hit the delete button below') . '. ' . _('However checks will be made to ensure there are no outstanding purchase orders or existing accounts payable transactions before the deletion is processed') . '<br /></font></b>'; prnMsg(_('WARNING') . ': ' . _('There is no second warning if you hit the delete button below') . '. ' . _('However checks will be made to ensure there are no outstanding purchase orders or existing accounts payable transactions before the deletion is processed'), 'Warn'); - echo '<br><div class=centre><input type="submit" name="delete" VALUE="' . _('Delete Supplier') . '" onclick=\"return confirm(\'' . _('Are you sure you wish to delete this supplier?') . '\');\"></form>'; - echo '<br><a href="' . $rootpath . '/SupplierContacts.php?SupplierID=' . $SupplierID . '">' . _('Review Contact Details') . '</a></div>'; + echo '<br /><div class=centre><input type="submit" name="delete" value="' . _('Delete Supplier') . '" onclick=\"return confirm(\'' . _('Are you sure you wish to delete this supplier?') . '\');\"></form>'; + echo '<br /><a href="' . $rootpath . '/SupplierContacts.php?SupplierID=' . $SupplierID . '">' . _('Review Contact Details') . '</a></div>'; } echo '</div>'; } // end of main ifs Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-04-26 11:03:36 UTC (r... [truncated message content] |
From: <dai...@us...> - 2011-04-26 11:03:46
|
Revision: 4556 http://web-erp.svn.sourceforge.net/web-erp/?rev=4556&view=rev Author: daintree Date: 2011-04-26 11:03:36 +0000 (Tue, 26 Apr 2011) Log Message: ----------- rework scripts for xhtml and quoting Modified Paths: -------------- trunk/CustEDISetup.php trunk/CustLoginSetup.php trunk/CustWhereAlloc.php trunk/CustomerBranches.php trunk/CustomerReceipt.php trunk/CustomerTypes.php trunk/Customers.php trunk/InventoryValuation.php trunk/WWW_Users.php trunk/build/make_release.sh trunk/includes/GetConfig.php trunk/includes/LanguageSetup.php trunk/includes/PDFInventoryValnPageHeader.inc trunk/includes/session.inc 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/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.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/CustEDISetup.php =================================================================== --- trunk/CustEDISetup.php 2011-04-19 10:18:49 UTC (rev 4555) +++ trunk/CustEDISetup.php 2011-04-26 11:03:36 UTC (rev 4556) @@ -1,14 +1,12 @@ <?php -/* $Revision: 1.11 $ */ + /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Customer EDI Set Up'); include('includes/header.inc'); -echo "<a href='" . $rootpath . '/SelectCustomer.php?' . SID . "'>" . _('Back to Customers') . '</a><br>'; +echo '<a href="' . $rootpath . '/SelectCustomer.php">' . _('Back to Customers') . '</a><br />'; if (isset($Errors)) { unset($Errors); @@ -27,10 +25,7 @@ //first off validate inputs sensible - if (strstr($_POST['EDIReference'],"'") - OR strstr($_POST['EDIReference'],'+') - OR strstr($_POST['EDIReference'],"\"") - OR strstr($_POST['EDIReference'],'&') + if (ContainsIllegalCharacters($_POST['EDIReference']) OR strstr($_POST['EDIReference'],' ')) { $InputError = 1; prnMsg(_('The customers EDI reference code cannot contain any of the following characters') .' - \' & + \" ' . _('or a space'),'warn'); @@ -75,9 +70,9 @@ } } -echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID ."'>"; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<br><table class=selection>'; +echo '<br /><table class=selection>'; $sql = "SELECT debtorno, name, @@ -105,59 +100,59 @@ if ($myrow['ediinvoices']==0){ - echo '<option selected VALUE=0>'._('Disabled'); - echo '<option VALUE=1>'._('Enabled'); + echo '<option selected value=0>'._('Disabled') . '</option>'; + echo '<option value=1>'._('Enabled'). '</option>'; } else { - echo '<option VALUE=0>'._('Disabled'); - echo '<option selected VALUE=1>'._('Enabled'); + echo '<option value=0>'._('Disabled') . '</option>'; + echo '<option selected value=1>'._('Enabled') . '</option>'; } -echo "</select><a href='$rootpath/EDIMessageFormat.php?" . SID . "&MessageType=INVOIC&PartnerCode=" . $_SESSION['CustomerID'] . "'>"._('Create') . '/' . _('Edit Invoice Message Format').'</a></td></tr>'; +echo '</select><a href="' . $rootpath . '/EDIMessageFormat.php?MessageType=INVOIC&PartnerCode=' . $_SESSION['CustomerID'] . '">'._('Create') . '/' . _('Edit Invoice Message Format').'</a></td></tr>'; -echo '<tr><td>'._('Enable Receiving of EDI Orders').":</td> - <td><select tabindex=2 name='EDIOrders'>"; +echo '<tr><td>'._('Enable Receiving of EDI Orders') . ':</td> + <td><select tabindex=2 name="EDIOrders">'; if ($myrow['ediorders']==0){ - echo '<option selected VALUE=0>'._('Disabled'); - echo '<option VALUE=1>'._('Enabled'); + echo '<option selected value=0>'._('Disabled') . '</option>'; + echo '<option value=1>'._('Enabled') . '</option>'; } else { - echo '<option VALUE=0>'._('Disabled'); - echo '<option selected VALUE=1>'._('Enabled'); + echo '<option value=0>'._('Disabled') . '</option>'; + echo '<option selected value=1>'._('Enabled') . '</option>'; } echo '</select></td></tr>'; -echo '<tr><td>'._('Customer EDI Reference').":</td> - <td><input " . (in_array('EDIReference',$Errors) ? 'class="inputerror"' : '' ) . - " tabindex=3 type='Text' name='EDIReference' size=20 maxlength=20 value='" . $myrow['edireference'] . "'></td></tr>"; +echo '<tr><td>'._('Customer EDI Reference') . ':</td> + <td><input ' . (in_array('EDIReference',$Errors) ? 'class="inputerror"' : '' ) . + ' tabindex=3 type="text" name="EDIReference" size=20 maxlength=20 value="' . $myrow['edireference'] . '"></td></tr>'; -echo '<tr><td>'._('EDI Communication Method').":</td> - <td><select tabindex=4 name='EDITransport'>"; +echo '<tr><td>'._('EDI Communication Method') . ':</td> + <td><select tabindex=4 name="EDITransport" >'; if ($myrow['editransport']=='email'){ - echo "<option selected value='email'>"._('Email Attachments'); - echo "<option value='ftp'>"._('File Transfer Protocol (FTP)'); + echo '<option selected value="email">'._('Email Attachments') . '</option>'; + echo '<option value="ftp">'._('File Transfer Protocol (FTP)') . '</option>'; } else { - echo "<option value='email'>"._('Email Attachments'); - echo "<option selected value='ftp'>"._('File Transfer Protocol (FTP)'); + echo '<option value="email">'._('Email Attachments') . '</option>'; + echo '<option selected value="ftp">'._('File Transfer Protocol (FTP)') . '</option>'; } echo '</select></td></tr>'; -echo '<tr><td>'._('FTP Server or Email Address').":</td> - <td><input " . (in_array('EDIAddress',$Errors) ? 'class="inputerror"' : '' ) . - " tabindex=5 type='Text' name='EDIAddress' size=42 maxlength=40 value='" . $myrow['ediaddress'] . "'></td></tr>"; +echo '<tr><td>'._('FTP Server or Email Address') . ':</td> + <td><input ' . (in_array('EDIAddress',$Errors) ? 'class="inputerror"' : '' ) . + ' tabindex=5 type="text" name="EDIAddress" size=42 maxlength=40 value="' . $myrow['ediaddress'] . '"></td></tr>'; if ($myrow['editransport']=='ftp'){ - echo '<tr><td>'._('FTP Server User Name').":</td> - <td><input tabindex=6 type='Text' name='EDIServerUser' size=20 maxlength=20 value=" . $myrow['ediserveruser'] . "></td></tr>"; - echo '<tr><td>'._('FTP Server Password').":</td> - <td><input tabindex=7 type='Text' name='EDIServerPwd' size=20 maxlength=20 value='" . $myrow['ediserverpwd'] . "'></td></tr>"; + echo '<tr><td>'._('FTP Server User Name') . ':</td> + <td><input tabindex=6 type="text" name="EDIServerUser" size=20 maxlength=20 value="' . $myrow['ediserveruser'] . '"></td></tr>'; + echo '<tr><td>'._('FTP Server Password') . ':</td> + <td><input tabindex=7 type="text" name="EDIServerPwd" size=20 maxlength=20 value="' . $myrow['ediserverpwd'] . '"></td></tr>'; } -echo "</table><br><div class='centre'><input tabindex=8 type='Submit' name='submit' value='"._('Update EDI Configuration')."'></div></form>"; +echo '</table><br /><div class="centre"><input tabindex=8 type="submit" name="submit" value="' ._('Update EDI Configuration'). '"></div></form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/CustLoginSetup.php =================================================================== --- trunk/CustLoginSetup.php 2011-04-19 10:18:49 UTC (rev 4555) +++ trunk/CustLoginSetup.php 2011-04-26 11:03:36 UTC (rev 4556) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.2 $ */ + /* $Id$*/ -//$PageSecurity = 15; - include('includes/session.inc'); $title = _('Customer Login Configuration'); include('includes/header.inc'); @@ -21,7 +19,7 @@ _('Petty Cash'), _('Setup')); -echo "<a href='" . $rootpath . '/SelectCustomer.php?' . SID . "'>" . _('Back to Customers') . '</a><br>'; +echo '<a href="' . $rootpath . '/SelectCustomer.php">' . _('Back to Customers') . '</a><br>'; $sql="SELECT name FROM debtorsmaster @@ -33,17 +31,15 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Customer') . ' : ' . $_SESSION['CustomerID'] . ' - ' . $CustomerName. _(' has been selected') . - '</p><br />';//'</p>'; -//echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'<br>'; + '</p><br />'; - //Make an array of the security roles where only one role is active and is ID 1 //For the security role selection box, we will only show roles that have: //- Only one entry in securitygroups AND the tokenid of this entry == 1 //First get all available security role ID's' -$query_roles = 'SELECT secroleid FROM securityroles'; +$query_roles = "SELECT secroleid FROM securityroles"; $result_roles = DB_query($query_roles, $db); //Check for every security role if they have only one entry in securitygroups, if so check if the tokenid == 1, then store in selection box @@ -65,9 +61,7 @@ $SecurityRoles[$Sec_row[0]] = $Sec_row[1]; } DB_free_result($Sec_Result); - } - } if (isset($_GET['SelectedUser'])){ @@ -88,7 +82,7 @@ if (strlen($_POST['UserID'])<3){ $InputError = 1; prnMsg(_('The user ID entered must be at least 4 characters long'),'error'); - } elseif (ContainsIllegalCharacters($_POST['UserID'])) { + } elseif (ContainsIllegalCharacters($_POST['UserID']) OR strstr($_POST['UserID'],' ')) { $InputError = 1; prnMsg(_('User names cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); } elseif (strlen($_POST['Password'])<5){ @@ -270,18 +264,19 @@ $result = DB_query($sql,$db); echo '<table class=selection>'; - echo "<tr><th>" . _('User Login') . "</th> - <th>" . _('Full Name') . "</th> - <th>" . _('Telephone') . "</th> - <th>" . _('Email') . "</th> - <th>" . _('Customer Code') . "</th> - <th>" . _('Branch Code') . "</th> - <th>" . _('Last Visit') . "</th> - <th>" . _('Security Role') ."</th> - <th>" . _('Report Size') ."</th> - <th>" . _('Theme') ."</th> - <th>" . _('Language') ."</th> - </tr>"; + + echo '<tr><th>' . _('User Login') . '</th> + <th>' . _('Full Name') . '</th> + <th>' . _('Telephone') . '</th> + <th>' . _('Email') . '</th> + <th>' . _('Customer Code') . '</th> + <th>' . _('Branch Code') . '</th> + <th>' . _('Last Visit') . '</th> + <th>' . _('Security Role') .'</th> + <th>' . _('Report Size') .'</th> + <th>' . _('Theme') .'</th> + <th>' . _('Language') .'</th> + </tr>'; $k=0; //row colour counter @@ -298,7 +293,7 @@ /*The SecurityHeadings array is defined in config.php */ - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> @@ -309,9 +304,9 @@ <td>%s</td> <td>%s</td> <td>%s</td> - <td><a href=\"%s&SelectedUser=%s\">" . _('Edit') . "</a></td> - <td><a href=\"%s&SelectedUser=%s&delete=1\">" . _('Delete') . "</a></td> - </tr>", + <td><a href="%s&SelectedUser=%s">' . _('Edit') . '</a></td> + <td><a href="%s&SelectedUser=%s&delete=1">' . _('Delete') . '</a></td> + </tr>', $myrow[0], $myrow[1], $myrow[2], @@ -323,9 +318,9 @@ $myrow[8], $myrow[9], $myrow[10], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0]); } //END WHILE LIST LOOP @@ -334,10 +329,9 @@ if (isset($SelectedUser)) { - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] ."?" . SID . "'>" . _('Review Existing Users') . '</a></div><br>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Review Existing Users') . '</a></div><br>'; } - -echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedUser)) { @@ -377,17 +371,16 @@ $_POST['UserLanguage'] = $myrow['language']; $_POST['Blocked'] = $myrow['blocked']; - echo "<input type='hidden' name='SelectedUser' value='" . $SelectedUser . "'>"; - echo "<input type='hidden' name='UserID' value='" . $_POST['UserID'] . "'>"; - echo "<input type='hidden' name='ModulesAllowed' value='" . $_POST['ModulesAllowed'] . "'>"; + echo '<input type="hidden" name="SelectedUser" value="' . $SelectedUser . '">'; + echo '<input type="hidden" name="UserID" value="' . $_POST['UserID'] . '">'; + echo '<input type="hidden" name="ModulesAllowed" value="' . $_POST['ModulesAllowed'] . '">'; - echo '<table class=selection> <tr><td>' . _('User code') . ':</td><td>'; + echo '<table class="selection"> <tr><td>' . _('User code') . ':</td><td>'; echo $_POST['UserID'] . '</td></tr>'; } else { //end of if $SelectedUser only do the else when a new record is being entered + echo '<table class=selection><tr><td>' . _('User Login') . ':</td><td><input type="text" name="UserID" size=22 maxlength=20 /></td></tr>'; - echo '<table class=selection><tr><td>' . _('User Login') . ":</td><td><input type='text' name='UserID' size=22 maxlength=20 ></td></tr>"; - /*set the default modules to show to all this had trapped a few people previously*/ $i=0; @@ -415,53 +408,48 @@ if (!isset($_POST['Email'])) { $_POST['Email']=''; } -echo '<tr><td>' . _('Password') . ":</td> - <td><input type='password' name='Password' size=22 maxlength=20 value='" . $_POST['Password'] . "'></tr>"; -echo '<tr><td>' . _('Full Name') . ":</td> - <td><input type='text' name='RealName' value='" . $_POST['RealName'] . "' size=36 maxlength=35></td></tr>"; -echo '<tr><td>' . _('Telephone No') . ":</td> - <td><input type='text' name='Phone' value='" . $_POST['Phone'] . "' size=32 maxlength=30></td></tr>"; -echo '<tr><td>' . _('Email Address') .":</td> - <td><input type='text' name='Email' value='" . $_POST['Email'] ."' size=32 maxlength=55></td></tr>"; -echo '<tr><td>' . _('Security Role') . ":</td><td><select name='Access'>"; +echo '<tr><td>' . _('Password') . ':</td> + <td><input type="password" name="Password" size=22 maxlength=20 value="' . $_POST['Password'] . '"></tr>'; +echo '<tr><td>' . _('Full Name') . ':</td> + <td><input type="text" name="RealName" value="' . $_POST['RealName'] . '" size=36 maxlength=35></td></tr>'; +echo '<tr><td>' . _('Telephone No') . ':</td> + <td><input type="text" name="Phone" value="' . $_POST['Phone'] . '" size=32 maxlength=30></td></tr>'; +echo '<tr><td>' . _('Email Address') .':</td> + <td><input type="text" name="Email" value="' . $_POST['Email'] .'" size=32 maxlength=55></td></tr>'; +echo '<tr><td>' . _('Security Role') . ':</td><td><select name="Access">'; foreach ($SecurityRoles as $SecKey => $SecVal) { if (isset($_POST['Access']) and $SecKey == $_POST['Access']){ - echo "<option selected value=" . $SecKey . ">" . $SecVal; + echo '<option selected value="' . $SecKey . '">' . $SecVal .'</option>'; } else { - echo "<option value=" . $SecKey . ">" . $SecVal; + echo '<option value="' . $SecKey . '">' . $SecVal .'</option>'; } } echo '</select></td></tr>'; echo '<input type="hidden" name="ID" value="'.$_SESSION['UserID'].'">'; +echo '<tr><td>' . _('Default Location') . ':</td> + <td><select name="DefaultLocation">'; -echo '<tr><td>' . _('Default Location') . ":</td> - <td><select name='DefaultLocation'>"; - $sql = "SELECT loccode, locationname FROM locations"; $result = DB_query($sql,$db); while ($myrow=DB_fetch_array($result)){ - if (isset($_POST['DefaultLocation']) and $myrow['loccode'] == $_POST['DefaultLocation']){ - - echo "<option selected value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; - + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] .'</option>'; } else { - echo "<option Value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; - + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] .'</option>'; } - } + //Customer is fixed by selection of customer $_POST['Cust']=$_SESSION['CustomerID']; echo '<input type="hidden" name="Cust" value="' . $_POST['Cust'] . '">'; echo '<tr><td>'._('Customer Code').':</td> <td>' . $_POST['Cust'] . '</td></tr>'; -echo '<tr><td>' . _('Branch Code') . ":</td> - <td><select name='BranchCode'>"; +echo '<tr><td>' . _('Branch Code') . ':</td> + <td><select name="BranchCode">'; $sql = "SELECT branchcode FROM custbranch WHERE debtorno = '" . $_POST['Cust'] . "'"; $result = DB_query($sql,$db); @@ -474,79 +462,75 @@ } if (isset($_POST['BranchCode']) and $myrow['branchcode'] == $_POST['BranchCode']){ - - echo "<option selected value='" . $myrow['branchcode'] . "'>" . $myrow['branchcode']; - + echo '<option selected value="' . $myrow['branchcode'] . '">' . $myrow['branchcode'] . '</option>'; } else { - echo "<option Value='" . $myrow['branchcode'] . "'>" . $myrow['branchcode']; - + echo '<option Value="' . $myrow['branchcode'] . '">' . $myrow['branchcode'] . '</option>'; } - } -echo '<tr><td>' . _('Reports Page Size') .":</td> - <td><select name='PageSize'>"; +echo '<tr><td>' . _('Reports Page Size') .':</td> + <td><select name="PageSize">'; if(isset($_POST['PageSize']) and $_POST['PageSize']=='A4'){ - echo "<option selected value='A4'>" . _('A4'); + echo '<option selected value="A4">' . _('A4') .'</option>'; } else { - echo "<option value='A4'>A4"; + echo '<option value="A4">' . _('A4') . '</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='A3'){ - echo "<option selected Value='A3'>" . _('A3'); + echo '<option selected value="A3">' . _('A3') .'</option>'; } else { - echo "<option value='A3'>A3"; + echo '<option value="A3">' . _('A3') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='A3_landscape'){ - echo "<option selected Value='A3_landscape'>" . _('A3') . ' ' . _('landscape'); + echo '<option selected value="A3_landscape">' . _('A3') . ' ' . _('landscape') .'</option>'; } else { - echo "<option value='A3_landscape'>" . _('A3') . ' ' . _('landscape'); + echo '<option value="A3_landscape">' . _('A3') . ' ' . _('landscape') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='letter'){ - echo "<option selected Value='letter'>" . _('Letter'); + echo '<option selected value="letter">' . _('Letter') .'</option>'; } else { - echo "<option value='letter'>" . _('Letter'); + echo '<option value="letter">' . _('Letter') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='letter_landscape'){ - echo "<option selected Value='letter_landscape'>" . _('Letter') . ' ' . _('landscape'); + echo '<option selected value="letter_landscape">' . _('Letter') . ' ' . _('landscape') .'</option>'; } else { - echo "<option value='letter_landscape'>" . _('Letter') . ' ' . _('landscape'); + echo '<option value="letter_landscape">' . _('Letter') . ' ' . _('landscape') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='legal'){ - echo "<option selected value='legal'>" . _('Legal'); + echo '<option selected value="legal">' . _('Legal') .'</option>'; } else { - echo "<option Value='legal'>" . _('Legal'); + echo '<option value="legal">' . _('Legal') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='legal_landscape'){ - echo "<option selected value='legal_landscape'>" . _('Legal') . ' ' . _('landscape'); + echo '<option selected value="legal_landscape">' . _('Legal') . ' ' . _('landscape') .'</option>'; } else { - echo "<option value='legal_landscape'>" . _('Legal') . ' ' . _('landscape'); + echo '<option value="legal_landscape">' . _('Legal') . ' ' . _('landscape') .'</option>'; } echo '</select></td></tr>'; echo '<tr> - <td>' . _('Theme') . ":</td> - <td><select name='Theme'>"; + <td>' . _('Theme') . ':</td> + <td><select name="Theme">'; $ThemeDirectory = dir('css/'); while (false != ($ThemeName = $ThemeDirectory->read())){ - if (is_dir("css/$ThemeName") AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != 'CVS'){ + if (is_dir('css/' . $ThemeName) AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != '.svn'){ if (isset($_POST['Theme']) and $_POST['Theme'] == $ThemeName){ - echo "<option selected value='$ThemeName'>$ThemeName"; + echo '<option selected value="' . $ThemeName . '">' . $ThemeName .'</option>'; } else if (!isset($_POST['Theme']) and ($_SESSION['DefaultTheme']==$ThemeName)) { - echo "<option selected value='$ThemeName'>$ThemeName"; + echo '<option selected value="' . $ThemeName . '">' . $ThemeName .'</option>'; } else { - echo "<option value='$ThemeName'>$ThemeName"; + echo '<option value="' . $ThemeName . '">' . $ThemeName .'</option>'; } } } @@ -555,22 +539,25 @@ echo '<tr> - <td>' . _('Language') . ":</td> - <td><select name='UserLanguage'>"; + <td>' . _('Language') . ':</td> + <td><select name="UserLanguage">'; - $LangDirHandle = dir('locale/'); +$Languages = scandir('locale/', 0); -while (false != ($LanguageEntry = $LangDirHandle->read())){ +foreach ($Languages as $LanguageEntry){ - if (is_dir('locale/' . $LanguageEntry) AND $LanguageEntry != '..' AND $LanguageEntry != 'CVS' AND $LanguageEntry!='.'){ + if (is_dir('locale/' . $LanguageEntry) + AND $LanguageEntry != '..' + AND $LanguageEntry != '.svn' + AND $LanguageEntry!='.'){ if (isset($_POST['UserLanguage']) and $_POST['UserLanguage'] == $LanguageEntry){ - echo "<option selected value='$LanguageEntry'>$LanguageEntry"; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } elseif (!isset($_POST['UserLanguage']) and $LanguageEntry == $DefaultLanguage) { - echo "<option selected value='$LanguageEntry'>$LanguageEntry"; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } else { - echo "<option value='$LanguageEntry'>$LanguageEntry"; + echo '<option value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } } } @@ -584,32 +571,34 @@ $i=0; foreach($ModuleList as $ModuleName){ - echo '<tr><td>' . _('Display') . ' ' . $ModuleName . ' ' . _('options') . ": </td><td><select name='Module_" . $i . "'>"; + echo '<tr><td>' . _('Display') . ' ' . $ModuleName . ' ' . _('options') . ': </td> + <td><select name="Module_' . $i . '">'; if ($ModulesAllowed[$i]==0){ - echo '<option selected value=0>' . _('No'); - echo '<option value=1>' . _('Yes'); + echo '<option selected value=0>' . _('No') . '</option>'; + echo '<option value=1>' . _('Yes') . '</option>'; } else { - echo '<option selected value=1>' . _('Yes'); - echo '<option value=0>' . _('No'); + echo '<option selected value=1>' . _('Yes') . '</option>'; + echo '<option value=0>' . _('No') . '</option>'; } echo '</select></td></tr>'; $i++; } -echo '<tr><td>' . _('Account Status') . ":</td><td><select name='Blocked'>"; +echo '<tr><td>' . _('Account Status') . ':</td> + <td><select name="Blocked">'; if ($_POST['Blocked']==0){ - echo '<option selected value=0>' . _('Open'); - echo '<option value=1>' . _('Blocked'); + echo '<option selected value=0>' . _('Open') . '</option>'; + echo '<option value=1>' . _('Blocked') . '</option>'; } else { - echo '<option selected value=1>' . _('Blocked'); - echo '<option value=0>' . _('Open'); + echo '<option selected value=1>' . _('Blocked') . '</option>'; + echo '<option value=0>' . _('Open') . '</option>'; } echo '</select></td></tr>'; +echo '</table><br> + <div class="centre"><input type="submit" name="submit" value="' . _('Enter Information') . '"></div> + </form>'; -echo "</table><br> - <div class='centre'><input type='submit' name='submit' value='" . _('Enter Information') . "'></div></form>"; - if (isset($_GET['SelectedUser'])) { echo '<script type="text/javascript">defaultControl(document.forms[0].Password);</script>'; } else { @@ -617,5 +606,4 @@ } include('includes/footer.inc'); - ?> \ No newline at end of file Modified: trunk/CustWhereAlloc.php =================================================================== --- trunk/CustWhereAlloc.php 2011-04-19 10:18:49 UTC (rev 4555) +++ trunk/CustWhereAlloc.php 2011-04-26 11:03:36 UTC (rev 4556) @@ -1,13 +1,12 @@ <?php -/* $Revision: 1.10 $ */ + /* $Id$*/ -//$PageSecurity = 2; include('includes/session.inc'); $title = _('Customer How Paid Inquiry'); include('includes/header.inc'); -echo "<form action='" . $_SERVER['PHP_SELF'] . "' method=post>"; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . @@ -15,32 +14,33 @@ echo '<table class=selection cellpadding=2><tr>'; -echo '<td>' . _('Type') . ":</td><td><select tabindex=1 name='TransType'> "; +echo '<td>' . _('Type') . ':</td> + <td><select tabindex=1 name="TransType"> '; $sql = "SELECT typeid, typename FROM systypes WHERE typeid = 10 OR typeid=12"; $resultTypes = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultTypes)){ if (isset($_POST['TransType'])){ if ($myrow['typeid'] == $_POST['TransType']){ - echo "<option selected Value='" . $myrow['typeid'] . "'>" . $myrow['typename']; + echo '<option selected value="' . $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; } else { - echo "<option Value='" . $myrow['typeid'] . "'>" . $myrow['typename']; + echo '<option Value="' . $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; } } else { - echo "<option Value='" . $myrow['typeid'] . "'>" . $myrow['typename']; + echo '<option value="' . $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; } } echo '</select></td>'; if (!isset($_POST['TransNo'])) {$_POST['TransNo']='';} -echo '<td>'._('Transaction Number').":</td> - <td><input tabindex=2 type=text name='TransNo' maxlength=10 size=10 value=". $_POST['TransNo'] . '></td>'; +echo '<td>'._('Transaction Number').':</td> + <td><input tabindex=2 type="text" name="TransNo" maxlength=10 size=10 value="'. $_POST['TransNo'] . '"></td>'; -echo "</tr></table><br> - <div class='centre'><input tabindex=3 type=submit name='ShowResults' value="._('Show How Allocated').'></div>'; +echo '</tr></table><br /> + <div class="centre"><input tabindex=3 type="submit" name="ShowResults" value="' . _('Show How Allocated') . '"></div>'; if (isset($_POST['ShowResults']) AND $_POST['TransNo']==''){ - echo '<br>'; + echo '<br />'; prnMsg(_('The transaction number to be queried must be entered first'),'warn'); } @@ -59,7 +59,6 @@ $myrow = DB_fetch_array($result); $AllocToID = $myrow['id']; - $sql = "SELECT type, transno, trandate, @@ -79,18 +78,20 @@ if (DB_num_rows($TransResult)==0){ prnMsg(_('There are no allocations made against this transaction'),'info'); } else { - echo '<br><table cellpadding=2 class=selection>'; + echo '<br /><table cellpadding=2 class=selection>'; - echo '<tr><th colspan=6><div class="centre"><font size=3 color=blue><b>'._('Allocations made against invoice number') . ' ' . $_POST['TransNo'] - . '<br>'._('Transaction Total').': '. number_format($myrow['totamt'],2) . '</font></b></div></th></tr>'; + echo '<tr> + <th colspan=6><div class="centre"><font size=3 color=blue><b>'._('Allocations made against invoice number') . ' ' . $_POST['TransNo'] . '<br />'._('Transaction Total').': '. number_format($myrow['totamt'],2) . '</font></b></div></th> + </tr>'; - $tableheader = "<tr><th>"._('Type')."</th> - <th>"._('Number')."</th> - <th>"._('Reference')."</th> - <th>"._('Ex Rate')."</th> - <th>"._('Amount')."</th> - <th>"._('Alloc').'</th> - </tr>'; + $tableheader = '<tr> + <th>' . _('Type') . '</th> + <th>' . _('Number') . '</th> + <th>' . _('Reference') . '</th> + <th>' . _('Ex Rate') . '</th> + <th>' . _('Amount') . '</th> + <th>' . _('Alloc') . '</th> + </tr>'; echo $tableheader; $RowCounter = 1; @@ -112,13 +113,13 @@ } else { $TransType = _('Receipt'); } - echo "<td>".$TransType."</td> - <td>".$myrow['transno']."</td> - <td>".$myrow['reference']."</td> - <td>".$myrow['rate']."</td> - <td class=number>".number_format($myrow['totalamt'],2)."</td> - <td class=number>".number_format($myrow['amt'],2)."</td> - </tr>"; + echo '<td>' . $TransType . '</td> + <td>' . $myrow['transno'] . '</td> + <td>' . $myrow['reference'] . '</td> + <td>' . $myrow['rate'] . '</td> + <td class=number>' . number_format($myrow['totalamt'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class=number>' . number_format($myrow['amt'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; $RowCounter++; If ($RowCounter == 12){ Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2011-04-19 10:18:49 UTC (rev 4555) +++ trunk/CustomerBranches.php 2011-04-26 11:03:36 UTC (rev 4556) @@ -1,10 +1,7 @@ <?php -/* $Revision: 1.53 $ */ /* $Id$*/ -//$PageSecurity = 3; - include('includes/session.inc'); $title = _('Customer Branches'); include('includes/header.inc'); @@ -17,7 +14,7 @@ if (!isset($DebtorNo)) { prnMsg(_('This page must be called with the debtor code of the customer for whom you wish to edit the branches for').'. - <br>'._('When the pages is called from within the system this will always be the case').' <br>'. + <br />'._('When the pages is called from within the system this will always be the case').' <br />'. _('Select a customer first then select the link to add/edit/delete branches'),'warn'); include('includes/footer.inc'); exit; @@ -30,9 +27,6 @@ $SelectedBranch = strtoupper($_POST['SelectedBranch']); } -// This link is already available on the menu on this page -//echo "<a href='" . $rootpath . '/SelectCustomer.php?' . SID . "'>" . _('Back to Customers') . '</a><br>'; - if (isset($Errors)) { unset($Errors); } @@ -107,39 +101,35 @@ define("KEY", $api_key); if ($map_host=="") { // check that some sane values are setup already in geocode tables, if not skip the geocoding but add the record anyway. - echo '<div class="warn">' . _('Warning - Geocode Integration is enabled, but no hosts are setup. Go to Geocode Setup') . '</div>'; + echo '<div class="warn">' . _('Warning - Geocode Integration is enabled, but no hosts are setup. Go to Geocode Setup') . '</div>'; } else { - - $address = $_POST["BrAddress1"] . ", " . $_POST["BrAddress2"] . ", " . $_POST["BrAddress3"] . ", " . $_POST["BrAddress4"]; - - $base_url = "http://" . MAPS_HOST . "/maps/geo?output=xml" . "&key=" . KEY; - $request_url = $base_url . "&q=" . urlencode($address); - $xml = simplexml_load_string(utf8_encode(file_get_contents($request_url))) or die("url not loading"); -// $xml = simplexml_load_file($request_url) or die("url not loading"); - - $coordinates = $xml->Response->Placemark->Point->coordinates; - $coordinatesSplit = explode(",", $coordinates); - // Format: Longitude, Latitude, Altitude - $latitude = $coordinatesSplit[1]; - $longitude = $coordinatesSplit[0]; - - $status = $xml->Response->Status->code; - if (strcmp($status, "200") == 0) { - // Successful geocode - $geocode_pending = false; - $coordinates = $xml->Response->Placemark->Point->coordinates; - $coordinatesSplit = explode(",", $coordinates); - // Format: Longitude, Latitude, Altitude - $latitude = $coordinatesSplit[1]; - $longitude = $coordinatesSplit[0]; - } else { - // failure to geocode - $geocode_pending = false; - echo '<div class="page_help_text"><b>Geocode Notice:</b> Address: ' . $address . ' failed to geocode. '; - echo 'Received status ' . $status . '</div>'; - } + $address = $_POST['BrAddress1'] . ", " . $_POST['BrAddress2'] . ", " . $_POST['BrAddress3'] . ", " . $_POST['BrAddress4']; + $base_url = 'http://' . MAPS_HOST . '/maps/geo?output=xml&key=' . KEY; + $request_url = $base_url . '&q=' . urlencode($address); + $xml = simplexml_load_string(utf8_encode(file_get_contents($request_url))) or die("url not loading"); + $coordinates = $xml->Response->Placemark->Point->coordinates; + $coordinatesSplit = explode(",", $coordinates); + // Format: Longitude, Latitude, Altitude + $latitude = $coordinatesSplit[1]; + $longitude = $coordinatesSplit[0]; + + $status = $xml->Response->Status->code; + if (strcmp($status, '200') == 0) { + // Successful geocode + $geocode_pending = false; + $coordinates = $xml->Response->Placemark->Point->coordinates; + $coordinatesSplit = explode(",", $coordinates); + // Format: Longitude, Latitude, Altitude + $latitude = $coordinatesSplit[1]; + $longitude = $coordinatesSplit[0]; + } else { + // failure to geocode + $geocode_pending = false; + echo '<div class="page_help_text"><b>' . _('Geocode Notice') . ':</b> ' . _('Address') . ': ' . $address . ' ' . _('failed to geocode'); + echo _('Received status') . ' ' . $status . '</div>'; + } + } } - } if (isset($SelectedBranch) AND $InputError !=1) { /*SelectedBranch 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*/ @@ -242,8 +232,8 @@ '" . $_POST['DeliverBlind'] . "' )"; } - echo '<br>'; - $msg = _('Customer branch<b>').' ' . $_POST['BranchCode'] . ': ' . $_POST['BrName'] . ' '._('</b>has been added, add another branch, or return to <a href=index.php>Main Menu</a>'); + echo '<br />'; + $msg = _('Customer branch').'<b> ' . $_POST['BranchCode'] . ': ' . $_POST['BrName'] . ' </b>'._('has been added, add another branch, or return to the') . ' <a href="index.php">' . _('Main Menu') . '</a>'; //run the SQL from either of the above possibilites @@ -292,7 +282,7 @@ $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { - prnMsg(_('Cannot delete this branch because customer transactions have been created to this branch') . '<br>' . + prnMsg(_('Cannot delete this branch because customer transactions have been created to this branch') . '<br />' . _('There are').' ' . $myrow[0] . ' '._('transactions with this Branch Code'),'error'); } else { @@ -303,7 +293,7 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg(_('Cannot delete this branch because sales analysis records exist for it'),'error'); - echo '<br>'._('There are').' ' . $myrow[0] . ' '._('sales analysis records with this Branch Code/customer'); + echo '<br />'._('There are').' ' . $myrow[0] . ' '._('sales analysis records with this Branch Code/customer'); } else { @@ -313,7 +303,7 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg(_('Cannot delete this branch because sales orders exist for it') . '. ' . _('Purge old sales orders first'),'warn'); - echo '<br>'._('There are').' ' . $myrow[0] . ' '._('sales orders for this Branch/customer'); + echo '<br />'._('There are').' ' . $myrow[0] . ' '._('sales orders for this Branch/customer'); } else { // Check if there are any users that refer to this branch code $sql= "SELECT COUNT(*) FROM www_users WHERE www_users.branchcode='".$SelectedBranch."' AND www_users.customerid = '".$DebtorNo."'"; @@ -323,7 +313,7 @@ if ($myrow[0]>0) { prnMsg(_('Cannot delete this branch because users exist that refer to it') . '. ' . _('Purge old users first'),'warn'); - echo '<br>'._('There are').' ' . $myrow[0] . ' '._('users referring to this Branch/customer'); + echo '<br />'._('There are').' ' . $myrow[0] . ' '._('users referring to this Branch/customer'); } else { $sql="DELETE FROM custbranch WHERE branchcode='" . $SelectedBranch . "' AND debtorno='" . $DebtorNo . "'"; @@ -373,16 +363,18 @@ echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Branches defined for'). ' '. $DebtorNo . ' - ' . $myrow[0] . '</p>'; echo '<table class=selection>'; - echo "<tr><th>"._('Code')."</th> - <th>"._('Name')."</th> - <th>"._('Branch Contact')."</th> - <th>"._('Salesman')."</th> - <th>"._('Area')."</th> - <th>"._('Phone No')."</th> - <th>"._('Fax No')."</th> - <th>"._('Email')."</th> - <th>"._('Tax Group')."</th> - <th>"._('Enabled?')."</th></tr>"; + + echo '<tr><th>'._('Code').'</th> + <th>'._('Name').'</th> + <th>'._('Branch Contact').'</th> + <th>'._('Salesman').'</th> + <th>'._('Area').'</th> + <th>'._('Phone No').'</th> + <th>'._('Fax No').'</th> + <th>'._('Email').'</th> + <th>'._('Tax Group').'</th> + <th>'._('Enabled?').'</th></tr>'; + $k=0; do { if ($k==1){ @@ -393,20 +385,19 @@ $k=1; } - - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> - <td><a href='Mailto:%s'>%s</a></td> + <td><a href="Mailto:%s">%s</a></td> <td>%s</td> <td>%s</td> - <td><a href='%s?DebtorNo=%s&SelectedBranch=%s'>%s</td> - <td><a href='%s?DebtorNo=%s&SelectedBranch=%s&delete=yes' onclick=\"return confirm('" . - _('Are you sure you wish to delete this branch?') . "');\">%s</td></tr>", + <td><a href="%s?DebtorNo=%s&SelectedBranch=%s">%s</td> + <td><a href="%s?DebtorNo=%s&SelectedBranch=%s&delete=yes" onclick=\'return confirm("' . + _('Are you sure you wish to delete this branch?') . '");\'>%s</td></tr>', $myrow[10], $myrow[2], $myrow[5], @@ -431,9 +422,9 @@ } while ($myrow = DB_fetch_row($result)); //END WHILE LIST LOOP - echo '</table><br><table class=selection><tr><td><div class="centre">'; - echo '<b>'.$TotalEnable.'</b> ' . _('Branches are enabled.') . '<br>'; - echo '<b>'.$TotalDisable.'</b> ' . _('Branches are disabled.') . '<br>'; + echo '</table><br /><table class=selection><tr><td><div class="centre">'; + echo '<b>'.$TotalEnable.'</b> ' . _('Branches are enabled.') . '<br />'; + echo '<b>'.$TotalDisable.'</b> ' . _('Branches are disabled.') . '<br />'; echo '<b>'.($TotalEnable+$TotalDisable). '</b> ' . _('Total Branches') . '</div></td></tr></table>'; } else { $sql = "SELECT debtorsmaster.name, @@ -462,7 +453,7 @@ } if (!isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] .'?' . SID . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] .'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedBranch)) { @@ -532,17 +523,18 @@ $_POST['DeliverBlind'] = $myrow['deliverblind']; } - echo "<input type=hidden name='SelectedBranch' VALUE='" . $SelectedBranch . "'>"; - echo "<input type=hidden name='BranchCode' VALUE='" . $_POST['BranchCode'] . "'>"; - + echo '<input type=hidden name="SelectedBranch" value="' . $SelectedBranch . '" />'; + echo '<input type=hidden name="BranchCode" value="' . $_POST['BranchCode'] . '" />'; + echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Change Details for Branch'). ' '. $SelectedBranch . '</p>'; if (isset($SelectedBranch)) { - echo '<div class="centre"><a href=' . $_SERVER['PHP_SELF'] . '?' . SID . 'DebtorNo=' . $DebtorNo. '>' . _('Show all branches defined for'). ' '. $DebtorNo . '</a></div>'; + echo '<div class="centre"><a href=' . $_SERVER['PHP_SELF'] . '?DebtorNo=' . $DebtorNo. '>' . _('Show all branches defined for'). ' '. $DebtorNo . '</a></div>'; } - echo "<br><table class=selection>"; - echo "<tr><th colspan=2><div class='centre'><b>"._('Change Branch')."</b></th></tr>"; - echo "<tr><td>"._('Branch Code').':</td><td>'; + echo '<br><table class="selection">'; + echo '<tr><th colspan=2><div class="centre"><b>'._('Change Branch').'</b></th></tr>'; + echo '<tr><td>'._('Branch Code').':</td><td>'; + echo $_POST['BranchCode'] . '</td></tr>'; } else { //end of if $SelectedBranch only do the else when a new record is being entered @@ -577,8 +569,7 @@ } echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Add a Branch').'</p>'; echo '<table class=selection><tr><td>'._('Branch Code'). ':</td> - <td><input ' .(in_array('BranchCode',$Errors) ? 'class="inputerror"' : '' ) . - " tabindex=1 type='Text' name='BranchCode' size=12 maxlength=10 value=" . $_POST['BranchCode'] . '></td></tr>'; + <td><input ' .(in_array('BranchCode',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex=1 type="text" name="BranchCode" size=12 maxlength=10 value="' . $_POST['BranchCode'] . '"></td></tr>'; $_POST['DeliverBlind'] = $_SESSION['DefaultBlindPackNote']; } @@ -590,7 +581,7 @@ if (DB_num_rows($result)==0){ echo '</table>'; prnMsg(_('There are no sales people defined as yet') . ' - ' . _('customer branches must be allocated to a sales person') . '. ' . _('Please use the link below to define at least one sales person'),'error'); - echo '<p align="center"><a href="' . $rootpath . '/SalesPeople.php?"' . SID . '">'._('Define Sales People') . '</a>'; + echo '<p align="center"><a href="' . $rootpath . '/SalesPeople.php">'._('Define Sales People') . '</a>'; include('includes/footer.inc'); exit; } @@ -654,7 +645,7 @@ if (DB_num_rows($result)==0){ echo '</table>'; prnMsg(_('There are no areas defined as yet') . ' - ' . _('customer branches must be allocated to an area') . '. ' . _('Please use the link below to define at least one sales area'),'error'); - echo "<br><a href='$rootpath/Areas.php?" . SID . "'>"._('Define Sales Areas').'</a>'; + echo '<br /><a href="' . $rootpath. '/Areas.php">'._('Define Sales Areas').'</a>'; include('includes/footer.inc'); exit; } @@ -681,7 +672,7 @@ if (DB_num_rows($result)==0){ echo '</table>'; prnMsg(_('There are no stock locations defined as yet') . ' - ' . _('customer branches must refer to a default location where stock is normally drawn from') . '. ' . _('Please use the link below to define at least one stock location'),'error'); - echo "<br><a href='$rootpath/Locations.php?" . SID . "'>"._('Define Stock Locations').'</a>'; + echo '<br /><a href="' . $rootpath . '/Locations.php">'._('Define Stock Locations').'</a>'; include('includes/footer.inc'); exit; } @@ -691,11 +682,11 @@ while ($myrow = DB_fetch_array($result)) { if (isset($_POST['DefaultLocation']) and $myrow['loccode']==$_POST['DefaultLocation']) { - echo '<option selected VALUE='; + echo '<option selected value='; } else { - echo '<option VALUE='; + echo '<option value='; } - echo $myrow['loccode'] . '>' . $myrow['locationname']; + echo $myrow['loccode'] . '>' . $myrow['locationname'] . '</option>'; } //end while loop @@ -718,7 +709,7 @@ DB_data_seek($result,0); - $sql = 'SELECT taxgroupid, taxgroupdescription FROM taxgroups'; + $sql = "SELECT taxgroupid, taxgroupdescription FROM taxgroups"; $result = DB_query($sql,$db); while ($myrow = DB_fetch_array($result)) { @@ -727,30 +718,32 @@ } else { echo '<option VALUE='; } - echo $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription']; + echo $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription'] . '</option>'; } //end while loop echo '</select></td></tr>'; - echo '<tr><td>'._('Transactions on this branch').":</td><td><select tabindex=20 name='DisableTrans'>"; + echo '<tr><td>'._('Transactions on this branch') . ':</td> + <td><select tabindex=20 name="DisableTrans">'; if ($_POST['DisableTrans']==0){ - echo '<option selected VALUE=0>' . _('Enabled'); - echo '<option VALUE=1>' . _('Disabled'); + echo '<option selected value=0>' . _('Enabled') . '</option>'; + echo '<option value=1>' . _('Disabled') . '</option>'; } else { - echo '<option selected VALUE=1>' . _('Disabled'); - echo '<option VALUE=0>' . _('Enabled'); + echo '<option selected value=1>' . _('Disabled') . '</option>'; + echo '<option value=0>' . _('Enabled') . '</option>'; } echo ' </select></td></tr>'; - echo '<tr><td>'._('Default freight/shipper method').":</td><td><select tabindex=21 name='DefaultShipVia'>"; - $SQL = 'SELECT shipper_id, shippername FROM shippers'; + echo '<tr><td>'._('Default freight/shipper method') . ':</td> + <td><select tabindex=21 name="DefaultShipVia">'; + $SQL = "SELECT shipper_id, shippername FROM shippers"; $ShipperResults = DB_query($SQL,$db); while ($myrow=DB_fetch_array($ShipperResults)){ if (isset($_POST['DefaultShipVia'])and $myrow['shipper_id']==$_POST['DefaultShipVia']){ - echo '<option selected VALUE=' . $myrow['shipper_id'] . '>' . $myrow['shippername']; + echo '<option selected value=' . $myrow['shipper_id'] . '>' . $myrow['shippername'] . '</option>'; }else { - echo '<option VALUE=' . $myrow['shipper_id'] . '>' . $myrow['shippername']; + echo '<option value=' . $myrow['shipper_id'] . '>' . $myrow['shippername'] . '</option>'; } } @@ -759,22 +752,16 @@ /* This field is a default value that will be used to set the value on the sales order which will control whether or not to display the company logo and address on the packlist */ - echo '<tr><td>' . _('Default Packlist') . ":</td><td><select tabindex=22 name='DeliverBlind'>"; - for ($p = 1; $p <= 2; $p++) { - echo '<option VALUE=' . $p; - if ($p == $_POST['DeliverBlind']) { - echo ' selected>'; - } else { - echo '>'; - } - switch ($p) { - case 1: - echo _('Show company details and logo'); break; - case 2: - echo _('Hide company details and logo'); break; - } - } - echo '</select></td></tr>'; + echo '<tr><td>' . _('Default Packlist') . ':</td><td><select tabindex=22 name="DeliverBlind">'; + if ($_POST['DeliverBlind']==2){ + echo '<option value="1">' . _('Show company details and logo') . '</option>'; + echo '<option selected value="2">' . _('Hide company details and logo') . '</option>'; + } else { + echo '<option selected value="1">' . _('Show company details and logo') . '</option>'; + echo '<option value="2">' . _('Hide company details and logo') . '</option>'; + } + + echo '</select></td></tr>'; echo '<tr><td>'._('Postal Address 1 (Street)').':</td>'; if (!isset($_POST['BrPostAddr1'])) {$_POST['BrPostAddr1']='';} @@ -792,7 +779,7 @@ if (!isset($_POST['CustBranchCode'])) {$_POST['CustBranchCode']='';} echo '<td><input tabindex=27 type="Text" name="CustBranchCode" size=31 maxlength=30 value="'. $_POST['CustBranchCode'].'"></td></tr>'; echo '</table>'; - echo '<br><div class="centre"><input tabindex=28 type="Submit" name="submit" value="' . _('Enter Branch') . '"></div>'; + echo '<br /><div class="centre"><input tabindex=28 type="Submit" name="submit" value="' . _('Enter Branch') . '"></div>'; echo '</form>'; } //end if record deleted no point displaying form to add record Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2011-04-19 10:18:49 UTC (rev 4555) +++ trunk/CustomerReceipt.php 2011-04-26 11:03:36 UTC (rev 4556) @@ -231,10 +231,10 @@ echo '<br /><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Allocate') . '" alt="" />' . ' ' . _('Summary of Receipt Batch').'</p><br />'; echo '<table class=selection><tr><th>'._('Batch Number').'</th> - <th>'._('Date Banked').'</th> - <th>'._('Customer Name').'</th - <th>'._('GL Code').'</th - <th>'._('Amount of Receipt').'</th></tr>'; + <th>' . _('Date Banked') . '</th> + <th>' . _('Customer Name') . '</th> + <th>' . _('GL Code') . '</th> + <th>' . _('Amount of Receipt').'</th></tr>'; foreach ($_SESSION['ReceiptBatch']->Items as $ReceiptItem) { @@ -859,8 +859,8 @@ <td class=number>' . number_format($ReceiptItem->Discount,2) . '</td> <td>' . stripslashes($ReceiptItem->CustomerName) . '</td> <td>'.$ReceiptItem->GLCode.' - '.$myrow['accountname'].'</td> - <td>'.$ReceiptItem->Narrative . "</td> - <td><a href='" . $_SERVER['PHP_SELF'] . '?Delete=' . $ReceiptItem->ID . "&Type=".$_GET['Type']."'>" . _('Delete') . '</a></td> + <td>'.$ReceiptItem->Narrative . '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $ReceiptItem->ID . '&Type=' . $_GET['Type']. '">' . _('Delete') . '</a></td> </tr>'; $BatchTotal= $BatchTotal + $ReceiptItem->Amount; } @@ -918,7 +918,7 @@ echo '<table class=selection>'; - $DisplayDiscountPercent = number_format($_SESSION['CustomerRecord']['pymtdiscount']*100,2) . "%"; + $DisplayDiscountPercent = number_format($_SESSION['CustomerRecord']['pymtdiscount']*100,2) . '%'; echo '<input type="hidden" name="CustomerID" value="' . $_POST['CustomerID'] . '">'; echo '<input type="hidden" name="CustomerName" value="' . $_SESSION['CustomerRecord']['name'] . '">'; @@ -1050,9 +1050,9 @@ echo '<tr class="EvenTableRows">'; $k=1; } - - printf("<td><font size=1><input tabindex=".number_format(12+$j)." type=submit name='Select' value='%s'</font></td> - <td>%s</td></tr>", + printf('<td><font size=1> + <input tabindex='.number_format(12+$j).' type=submit name="Select" value="%s"></font></td> + <td>%s</td></tr>', $myrow['debtorno'], $myrow['name']); Modified: trunk/CustomerTypes.php =================================================================== --- trunk/CustomerTypes.php 2011-04-19 10:18:49 UTC (rev 4555) +++ trunk/CustomerTypes.php 2011-04-26 11:03:36 UTC (rev 4556) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.6 $ */ + /* $Id$*/ -//$PageSecurity = 15; - include('includes/session.inc'); $title = _('Customer Types') . ' / ' . _('Maintenance'); include('includes/header.inc'); @@ -43,7 +41,7 @@ if (strlen($_POST['typename'])==0) { $InputError = 1; - echo '<br>'; + echo '<br />'; prnMsg(_('The customer type name description must contain at least one character'),'error'); $Errors[$i] = 'CustomerType'; $i++; @@ -56,7 +54,7 @@ $checkrow=DB_fetch_row($checkresult); if ($checkrow[0]>0 and !isset($SelectedType)) { $InputError = 1; - echo '<br>'; + echo '<br />'; prnMsg(_('You already have a customer type called').' '.$_POST['typename'],'error'); $Errors[$i] = 'CustomerName'; $i++; @@ -124,7 +122,7 @@ $result = DB_query($sql,$db); $_SESSION['DefaultCustomerType'] = $_POST['typeid']; } - echo '<br>'; + echo '<br />'; prnMsg($msg,'success'); unset($SelectedType); @@ -146,7 +144,7 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { - prnMsg(_('Cannot delete this type because customer transactions have been created using this type') . '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions using this type'),'error'); + prnMsg(_('Cannot delete this type because customer transactions have been created using this type') . '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions using this type'),'error'); } else { @@ -156,13 +154,13 @@ $result = DB_query($sql,$db,$ErrMsg); $myrow = DB_fetch_row($result); 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')); + 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>'; + echo '<br />'; prnMsg(_('Customer type') . $SelectedType . ' ' . _('has been deleted') ,'success'); unset ($SelectedType); @@ -182,11 +180,11 @@ $sql = 'SELECT typeid, typename FROM debtortype'; $result = DB_query($sql,$db); - echo '<br><table class=selection>'; - echo "<tr> - <th>" . _('Type ID') . "</th> - <th>" . _('Type Name') . "</th> - </tr>"; + echo '<br /><table class=selection>'; + echo '<tr> + <th>' . _('Type ID') . '</th> + <th>' . _('Type Name') . '</th> + </tr>'; $k=0; //row colour counter @@ -199,16 +197,17 @@ $k=1; } - printf(" +printf('<td>%s</td> <td>%s</td> - <td>%s</td> - <td><a href='%sSelectedType=%s'>" . _('Edit') . "</td> - <td><a href='%sSelectedType=%s&delete=yes' onclick=\"return confirm('" . _('Are you sure you wish to delete this Customer Type?') . "');\">" . _('Delete') . "</td> - </tr>", + <td><a href="%sSelectedType=%s">' . _('Edit') . '</td> + <td><a href="%sSelectedType=%s&delete=yes" onclick=\'return confirm("' . _('Are you sure you wish to delete this Customer Type?') . '");\'>' . _('Delete') . '</td> + </tr>', $myrow[0], $myrow[1], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0]); + $_SERVER['PHP_SELF'] . '?', + $myrow[0], + $_SERVER['PHP_SELF'] . '?', + $myrow[0]); } //END WHILE LIST LOOP echo '</table>'; @@ -217,18 +216,17 @@ //end of ifs and buts! if (isset($SelectedType)) { - echo '<div class="centre"><p><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Show All Types Defined') . '</a></div><p>'; + echo '<div class="centre"><p><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Types Defined') . '</a></div><p>'; } if (! isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p><table class=selection>'; //Main table // The user wish to EDIT an existing type - if ( isset($SelectedType) AND $SelectedType!='' ) - { + if ( isset($SelectedType) AND $SelectedType!='' ) { $sql = "SELECT typeid, typename @@ -241,26 +239,23 @@ $_POST['typeid'] = $myrow['typeid']; $_POST['typename'] = $myrow['typename']; - echo "<input type=hidden name='SelectedType' VALUE=" . $SelectedType . ">"; - echo "<input type=hidden name='typeid' VALUE=" . $_POST['typeid'] . ">"; - echo "<table class=selection> <tr><td>"; + echo '<input type=hidden name="SelectedType" value="' . $SelectedType . '">'; + echo '<input type=hidden name="typeid" value=' . $_POST['typeid'] . '">'; + echo '<table class="selection">'; // We dont allow the user to change an existing type code - echo 'Type ID: ' . $_POST['typeid'] . '</td></tr>'; + echo '<tr><td>' . _('Type ID') . ': ' . $_POST['typeid'] . '</td></tr>'; } else { - // This is a new type so the user may volunteer a type code - - echo "<table class=selection>"; - + echo '<table class="selection">'; } if (!isset($_POST['typename'])) { $_POST['typename']=''; } - echo "<tr><td>" . _('Type Name') . ":</td><td><input type='Text' name='typename' value='" . $_POST['typename'] . "'></td></tr>"; + echo '<tr><td>' . _('Type Name') . ':</td><td><input type="Text" name="typename" value="' . $_POST['typename'] . '"></td></tr>'; echo '</td></tr></table>'; // close main table Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2011-04-19 10:18:49 UTC (rev 4555) +++ trunk/Customers.php 2011-04-26 11:03:36 UTC (rev 4556) @@ -281,11 +281,11 @@ $BranchCode = substr($_POST['DebtorNo'],0,4); - echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath ."/CustomerBranches.php?" . SID . "&DebtorNo=" . $_POST['DebtorNo'] . "'>"; + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath .'/CustomerBranches.php?DebtorNo=' . $_POST['DebtorNo'] . '">'; echo '<div class="centre">' . _('You should automatically be forwarded to the entry of a new Customer Branch page') . '. ' . _('If this does not happen') .' (' . _('if the browser does not support META Refresh') . ') ' . - "<a href='" . $rootpath . "/CustomerBranches.php?" . SID . "&DebtorNo=" . $_POST['DebtorNo'] . '.</div>'; + '<a href="' . $rootpath . '/CustomerBranches.php?DebtorNo=' . $_POST['DebtorNo'] . '"></a></div>'; include('includes/footer.inc'); exit; @@ -421,8 +421,8 @@ /* First check that all the necessary items have been setup */ $SetupErrors=0; //Count errors - $sql='SELECT COUNT(typeabbrev) - FROM salestypes'; + $sql="SELECT COUNT(typeabbrev) + FROM salestypes"; $result=DB_query($sql, $db); $myrow=DB_fetch_row($result); if ($myrow[0]==0) { @@ -430,8 +430,8 @@ _('Click').' '.'<a target="_blank" href="' . $rootpath . '/SalesTypes.php">' . _('here').' ' . '</a>'._('to set up your price lists'),'warning').'<br />'; $SetupErrors += 1; } - $sql='SELECT COUNT(typeid) - FROM debtortype'; + $sql="SELECT COUNT(typeid) + FROM debtortype"; $result=DB_query($sql, $db); $myrow=DB_fetch_row($result); if ($myrow[0]==0) { @@ -445,20 +445,20 @@ include('includes/footer.inc'); exit; } - - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo "<input type='Hidden' name='New' value='Yes'>"; + echo '<input type="hidden" name="New" value="Yes" />'; $DataError =0; - echo '<table class=selection cellspacing=4><tr><td valign=top><table class=selection>'; + echo '<table cl... [truncated message content] |
From: <dai...@us...> - 2011-04-26 11:03:46
|
Revision: 4556 http://web-erp.svn.sourceforge.net/web-erp/?rev=4556&view=rev Author: daintree Date: 2011-04-26 11:03:36 +0000 (Tue, 26 Apr 2011) Log Message: ----------- rework scripts for xhtml and quoting Modified Paths: -------------- trunk/CustEDISetup.php trunk/CustLoginSetup.php trunk/CustWhereAlloc.php trunk/CustomerBranches.php trunk/CustomerReceipt.php trunk/CustomerTypes.php trunk/Customers.php trunk/InventoryValuation.php trunk/WWW_Users.php trunk/build/make_release.sh trunk/includes/GetConfig.php trunk/includes/LanguageSetup.php trunk/includes/PDFInventoryValnPageHeader.inc trunk/includes/session.inc 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/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.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/CustEDISetup.php =================================================================== --- trunk/CustEDISetup.php 2011-04-19 10:18:49 UTC (rev 4555) +++ trunk/CustEDISetup.php 2011-04-26 11:03:36 UTC (rev 4556) @@ -1,14 +1,12 @@ <?php -/* $Revision: 1.11 $ */ + /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Customer EDI Set Up'); include('includes/header.inc'); -echo "<a href='" . $rootpath . '/SelectCustomer.php?' . SID . "'>" . _('Back to Customers') . '</a><br>'; +echo '<a href="' . $rootpath . '/SelectCustomer.php">' . _('Back to Customers') . '</a><br />'; if (isset($Errors)) { unset($Errors); @@ -27,10 +25,7 @@ //first off validate inputs sensible - if (strstr($_POST['EDIReference'],"'") - OR strstr($_POST['EDIReference'],'+') - OR strstr($_POST['EDIReference'],"\"") - OR strstr($_POST['EDIReference'],'&') + if (ContainsIllegalCharacters($_POST['EDIReference']) OR strstr($_POST['EDIReference'],' ')) { $InputError = 1; prnMsg(_('The customers EDI reference code cannot contain any of the following characters') .' - \' & + \" ' . _('or a space'),'warn'); @@ -75,9 +70,9 @@ } } -echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID ."'>"; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<br><table class=selection>'; +echo '<br /><table class=selection>'; $sql = "SELECT debtorno, name, @@ -105,59 +100,59 @@ if ($myrow['ediinvoices']==0){ - echo '<option selected VALUE=0>'._('Disabled'); - echo '<option VALUE=1>'._('Enabled'); + echo '<option selected value=0>'._('Disabled') . '</option>'; + echo '<option value=1>'._('Enabled'). '</option>'; } else { - echo '<option VALUE=0>'._('Disabled'); - echo '<option selected VALUE=1>'._('Enabled'); + echo '<option value=0>'._('Disabled') . '</option>'; + echo '<option selected value=1>'._('Enabled') . '</option>'; } -echo "</select><a href='$rootpath/EDIMessageFormat.php?" . SID . "&MessageType=INVOIC&PartnerCode=" . $_SESSION['CustomerID'] . "'>"._('Create') . '/' . _('Edit Invoice Message Format').'</a></td></tr>'; +echo '</select><a href="' . $rootpath . '/EDIMessageFormat.php?MessageType=INVOIC&PartnerCode=' . $_SESSION['CustomerID'] . '">'._('Create') . '/' . _('Edit Invoice Message Format').'</a></td></tr>'; -echo '<tr><td>'._('Enable Receiving of EDI Orders').":</td> - <td><select tabindex=2 name='EDIOrders'>"; +echo '<tr><td>'._('Enable Receiving of EDI Orders') . ':</td> + <td><select tabindex=2 name="EDIOrders">'; if ($myrow['ediorders']==0){ - echo '<option selected VALUE=0>'._('Disabled'); - echo '<option VALUE=1>'._('Enabled'); + echo '<option selected value=0>'._('Disabled') . '</option>'; + echo '<option value=1>'._('Enabled') . '</option>'; } else { - echo '<option VALUE=0>'._('Disabled'); - echo '<option selected VALUE=1>'._('Enabled'); + echo '<option value=0>'._('Disabled') . '</option>'; + echo '<option selected value=1>'._('Enabled') . '</option>'; } echo '</select></td></tr>'; -echo '<tr><td>'._('Customer EDI Reference').":</td> - <td><input " . (in_array('EDIReference',$Errors) ? 'class="inputerror"' : '' ) . - " tabindex=3 type='Text' name='EDIReference' size=20 maxlength=20 value='" . $myrow['edireference'] . "'></td></tr>"; +echo '<tr><td>'._('Customer EDI Reference') . ':</td> + <td><input ' . (in_array('EDIReference',$Errors) ? 'class="inputerror"' : '' ) . + ' tabindex=3 type="text" name="EDIReference" size=20 maxlength=20 value="' . $myrow['edireference'] . '"></td></tr>'; -echo '<tr><td>'._('EDI Communication Method').":</td> - <td><select tabindex=4 name='EDITransport'>"; +echo '<tr><td>'._('EDI Communication Method') . ':</td> + <td><select tabindex=4 name="EDITransport" >'; if ($myrow['editransport']=='email'){ - echo "<option selected value='email'>"._('Email Attachments'); - echo "<option value='ftp'>"._('File Transfer Protocol (FTP)'); + echo '<option selected value="email">'._('Email Attachments') . '</option>'; + echo '<option value="ftp">'._('File Transfer Protocol (FTP)') . '</option>'; } else { - echo "<option value='email'>"._('Email Attachments'); - echo "<option selected value='ftp'>"._('File Transfer Protocol (FTP)'); + echo '<option value="email">'._('Email Attachments') . '</option>'; + echo '<option selected value="ftp">'._('File Transfer Protocol (FTP)') . '</option>'; } echo '</select></td></tr>'; -echo '<tr><td>'._('FTP Server or Email Address').":</td> - <td><input " . (in_array('EDIAddress',$Errors) ? 'class="inputerror"' : '' ) . - " tabindex=5 type='Text' name='EDIAddress' size=42 maxlength=40 value='" . $myrow['ediaddress'] . "'></td></tr>"; +echo '<tr><td>'._('FTP Server or Email Address') . ':</td> + <td><input ' . (in_array('EDIAddress',$Errors) ? 'class="inputerror"' : '' ) . + ' tabindex=5 type="text" name="EDIAddress" size=42 maxlength=40 value="' . $myrow['ediaddress'] . '"></td></tr>'; if ($myrow['editransport']=='ftp'){ - echo '<tr><td>'._('FTP Server User Name').":</td> - <td><input tabindex=6 type='Text' name='EDIServerUser' size=20 maxlength=20 value=" . $myrow['ediserveruser'] . "></td></tr>"; - echo '<tr><td>'._('FTP Server Password').":</td> - <td><input tabindex=7 type='Text' name='EDIServerPwd' size=20 maxlength=20 value='" . $myrow['ediserverpwd'] . "'></td></tr>"; + echo '<tr><td>'._('FTP Server User Name') . ':</td> + <td><input tabindex=6 type="text" name="EDIServerUser" size=20 maxlength=20 value="' . $myrow['ediserveruser'] . '"></td></tr>'; + echo '<tr><td>'._('FTP Server Password') . ':</td> + <td><input tabindex=7 type="text" name="EDIServerPwd" size=20 maxlength=20 value="' . $myrow['ediserverpwd'] . '"></td></tr>'; } -echo "</table><br><div class='centre'><input tabindex=8 type='Submit' name='submit' value='"._('Update EDI Configuration')."'></div></form>"; +echo '</table><br /><div class="centre"><input tabindex=8 type="submit" name="submit" value="' ._('Update EDI Configuration'). '"></div></form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/CustLoginSetup.php =================================================================== --- trunk/CustLoginSetup.php 2011-04-19 10:18:49 UTC (rev 4555) +++ trunk/CustLoginSetup.php 2011-04-26 11:03:36 UTC (rev 4556) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.2 $ */ + /* $Id$*/ -//$PageSecurity = 15; - include('includes/session.inc'); $title = _('Customer Login Configuration'); include('includes/header.inc'); @@ -21,7 +19,7 @@ _('Petty Cash'), _('Setup')); -echo "<a href='" . $rootpath . '/SelectCustomer.php?' . SID . "'>" . _('Back to Customers') . '</a><br>'; +echo '<a href="' . $rootpath . '/SelectCustomer.php">' . _('Back to Customers') . '</a><br>'; $sql="SELECT name FROM debtorsmaster @@ -33,17 +31,15 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Customer') . ' : ' . $_SESSION['CustomerID'] . ' - ' . $CustomerName. _(' has been selected') . - '</p><br />';//'</p>'; -//echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'<br>'; + '</p><br />'; - //Make an array of the security roles where only one role is active and is ID 1 //For the security role selection box, we will only show roles that have: //- Only one entry in securitygroups AND the tokenid of this entry == 1 //First get all available security role ID's' -$query_roles = 'SELECT secroleid FROM securityroles'; +$query_roles = "SELECT secroleid FROM securityroles"; $result_roles = DB_query($query_roles, $db); //Check for every security role if they have only one entry in securitygroups, if so check if the tokenid == 1, then store in selection box @@ -65,9 +61,7 @@ $SecurityRoles[$Sec_row[0]] = $Sec_row[1]; } DB_free_result($Sec_Result); - } - } if (isset($_GET['SelectedUser'])){ @@ -88,7 +82,7 @@ if (strlen($_POST['UserID'])<3){ $InputError = 1; prnMsg(_('The user ID entered must be at least 4 characters long'),'error'); - } elseif (ContainsIllegalCharacters($_POST['UserID'])) { + } elseif (ContainsIllegalCharacters($_POST['UserID']) OR strstr($_POST['UserID'],' ')) { $InputError = 1; prnMsg(_('User names cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); } elseif (strlen($_POST['Password'])<5){ @@ -270,18 +264,19 @@ $result = DB_query($sql,$db); echo '<table class=selection>'; - echo "<tr><th>" . _('User Login') . "</th> - <th>" . _('Full Name') . "</th> - <th>" . _('Telephone') . "</th> - <th>" . _('Email') . "</th> - <th>" . _('Customer Code') . "</th> - <th>" . _('Branch Code') . "</th> - <th>" . _('Last Visit') . "</th> - <th>" . _('Security Role') ."</th> - <th>" . _('Report Size') ."</th> - <th>" . _('Theme') ."</th> - <th>" . _('Language') ."</th> - </tr>"; + + echo '<tr><th>' . _('User Login') . '</th> + <th>' . _('Full Name') . '</th> + <th>' . _('Telephone') . '</th> + <th>' . _('Email') . '</th> + <th>' . _('Customer Code') . '</th> + <th>' . _('Branch Code') . '</th> + <th>' . _('Last Visit') . '</th> + <th>' . _('Security Role') .'</th> + <th>' . _('Report Size') .'</th> + <th>' . _('Theme') .'</th> + <th>' . _('Language') .'</th> + </tr>'; $k=0; //row colour counter @@ -298,7 +293,7 @@ /*The SecurityHeadings array is defined in config.php */ - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> @@ -309,9 +304,9 @@ <td>%s</td> <td>%s</td> <td>%s</td> - <td><a href=\"%s&SelectedUser=%s\">" . _('Edit') . "</a></td> - <td><a href=\"%s&SelectedUser=%s&delete=1\">" . _('Delete') . "</a></td> - </tr>", + <td><a href="%s&SelectedUser=%s">' . _('Edit') . '</a></td> + <td><a href="%s&SelectedUser=%s&delete=1">' . _('Delete') . '</a></td> + </tr>', $myrow[0], $myrow[1], $myrow[2], @@ -323,9 +318,9 @@ $myrow[8], $myrow[9], $myrow[10], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0]); } //END WHILE LIST LOOP @@ -334,10 +329,9 @@ if (isset($SelectedUser)) { - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] ."?" . SID . "'>" . _('Review Existing Users') . '</a></div><br>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Review Existing Users') . '</a></div><br>'; } - -echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedUser)) { @@ -377,17 +371,16 @@ $_POST['UserLanguage'] = $myrow['language']; $_POST['Blocked'] = $myrow['blocked']; - echo "<input type='hidden' name='SelectedUser' value='" . $SelectedUser . "'>"; - echo "<input type='hidden' name='UserID' value='" . $_POST['UserID'] . "'>"; - echo "<input type='hidden' name='ModulesAllowed' value='" . $_POST['ModulesAllowed'] . "'>"; + echo '<input type="hidden" name="SelectedUser" value="' . $SelectedUser . '">'; + echo '<input type="hidden" name="UserID" value="' . $_POST['UserID'] . '">'; + echo '<input type="hidden" name="ModulesAllowed" value="' . $_POST['ModulesAllowed'] . '">'; - echo '<table class=selection> <tr><td>' . _('User code') . ':</td><td>'; + echo '<table class="selection"> <tr><td>' . _('User code') . ':</td><td>'; echo $_POST['UserID'] . '</td></tr>'; } else { //end of if $SelectedUser only do the else when a new record is being entered + echo '<table class=selection><tr><td>' . _('User Login') . ':</td><td><input type="text" name="UserID" size=22 maxlength=20 /></td></tr>'; - echo '<table class=selection><tr><td>' . _('User Login') . ":</td><td><input type='text' name='UserID' size=22 maxlength=20 ></td></tr>"; - /*set the default modules to show to all this had trapped a few people previously*/ $i=0; @@ -415,53 +408,48 @@ if (!isset($_POST['Email'])) { $_POST['Email']=''; } -echo '<tr><td>' . _('Password') . ":</td> - <td><input type='password' name='Password' size=22 maxlength=20 value='" . $_POST['Password'] . "'></tr>"; -echo '<tr><td>' . _('Full Name') . ":</td> - <td><input type='text' name='RealName' value='" . $_POST['RealName'] . "' size=36 maxlength=35></td></tr>"; -echo '<tr><td>' . _('Telephone No') . ":</td> - <td><input type='text' name='Phone' value='" . $_POST['Phone'] . "' size=32 maxlength=30></td></tr>"; -echo '<tr><td>' . _('Email Address') .":</td> - <td><input type='text' name='Email' value='" . $_POST['Email'] ."' size=32 maxlength=55></td></tr>"; -echo '<tr><td>' . _('Security Role') . ":</td><td><select name='Access'>"; +echo '<tr><td>' . _('Password') . ':</td> + <td><input type="password" name="Password" size=22 maxlength=20 value="' . $_POST['Password'] . '"></tr>'; +echo '<tr><td>' . _('Full Name') . ':</td> + <td><input type="text" name="RealName" value="' . $_POST['RealName'] . '" size=36 maxlength=35></td></tr>'; +echo '<tr><td>' . _('Telephone No') . ':</td> + <td><input type="text" name="Phone" value="' . $_POST['Phone'] . '" size=32 maxlength=30></td></tr>'; +echo '<tr><td>' . _('Email Address') .':</td> + <td><input type="text" name="Email" value="' . $_POST['Email'] .'" size=32 maxlength=55></td></tr>'; +echo '<tr><td>' . _('Security Role') . ':</td><td><select name="Access">'; foreach ($SecurityRoles as $SecKey => $SecVal) { if (isset($_POST['Access']) and $SecKey == $_POST['Access']){ - echo "<option selected value=" . $SecKey . ">" . $SecVal; + echo '<option selected value="' . $SecKey . '">' . $SecVal .'</option>'; } else { - echo "<option value=" . $SecKey . ">" . $SecVal; + echo '<option value="' . $SecKey . '">' . $SecVal .'</option>'; } } echo '</select></td></tr>'; echo '<input type="hidden" name="ID" value="'.$_SESSION['UserID'].'">'; +echo '<tr><td>' . _('Default Location') . ':</td> + <td><select name="DefaultLocation">'; -echo '<tr><td>' . _('Default Location') . ":</td> - <td><select name='DefaultLocation'>"; - $sql = "SELECT loccode, locationname FROM locations"; $result = DB_query($sql,$db); while ($myrow=DB_fetch_array($result)){ - if (isset($_POST['DefaultLocation']) and $myrow['loccode'] == $_POST['DefaultLocation']){ - - echo "<option selected value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; - + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] .'</option>'; } else { - echo "<option Value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; - + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] .'</option>'; } - } + //Customer is fixed by selection of customer $_POST['Cust']=$_SESSION['CustomerID']; echo '<input type="hidden" name="Cust" value="' . $_POST['Cust'] . '">'; echo '<tr><td>'._('Customer Code').':</td> <td>' . $_POST['Cust'] . '</td></tr>'; -echo '<tr><td>' . _('Branch Code') . ":</td> - <td><select name='BranchCode'>"; +echo '<tr><td>' . _('Branch Code') . ':</td> + <td><select name="BranchCode">'; $sql = "SELECT branchcode FROM custbranch WHERE debtorno = '" . $_POST['Cust'] . "'"; $result = DB_query($sql,$db); @@ -474,79 +462,75 @@ } if (isset($_POST['BranchCode']) and $myrow['branchcode'] == $_POST['BranchCode']){ - - echo "<option selected value='" . $myrow['branchcode'] . "'>" . $myrow['branchcode']; - + echo '<option selected value="' . $myrow['branchcode'] . '">' . $myrow['branchcode'] . '</option>'; } else { - echo "<option Value='" . $myrow['branchcode'] . "'>" . $myrow['branchcode']; - + echo '<option Value="' . $myrow['branchcode'] . '">' . $myrow['branchcode'] . '</option>'; } - } -echo '<tr><td>' . _('Reports Page Size') .":</td> - <td><select name='PageSize'>"; +echo '<tr><td>' . _('Reports Page Size') .':</td> + <td><select name="PageSize">'; if(isset($_POST['PageSize']) and $_POST['PageSize']=='A4'){ - echo "<option selected value='A4'>" . _('A4'); + echo '<option selected value="A4">' . _('A4') .'</option>'; } else { - echo "<option value='A4'>A4"; + echo '<option value="A4">' . _('A4') . '</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='A3'){ - echo "<option selected Value='A3'>" . _('A3'); + echo '<option selected value="A3">' . _('A3') .'</option>'; } else { - echo "<option value='A3'>A3"; + echo '<option value="A3">' . _('A3') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='A3_landscape'){ - echo "<option selected Value='A3_landscape'>" . _('A3') . ' ' . _('landscape'); + echo '<option selected value="A3_landscape">' . _('A3') . ' ' . _('landscape') .'</option>'; } else { - echo "<option value='A3_landscape'>" . _('A3') . ' ' . _('landscape'); + echo '<option value="A3_landscape">' . _('A3') . ' ' . _('landscape') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='letter'){ - echo "<option selected Value='letter'>" . _('Letter'); + echo '<option selected value="letter">' . _('Letter') .'</option>'; } else { - echo "<option value='letter'>" . _('Letter'); + echo '<option value="letter">' . _('Letter') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='letter_landscape'){ - echo "<option selected Value='letter_landscape'>" . _('Letter') . ' ' . _('landscape'); + echo '<option selected value="letter_landscape">' . _('Letter') . ' ' . _('landscape') .'</option>'; } else { - echo "<option value='letter_landscape'>" . _('Letter') . ' ' . _('landscape'); + echo '<option value="letter_landscape">' . _('Letter') . ' ' . _('landscape') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='legal'){ - echo "<option selected value='legal'>" . _('Legal'); + echo '<option selected value="legal">' . _('Legal') .'</option>'; } else { - echo "<option Value='legal'>" . _('Legal'); + echo '<option value="legal">' . _('Legal') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='legal_landscape'){ - echo "<option selected value='legal_landscape'>" . _('Legal') . ' ' . _('landscape'); + echo '<option selected value="legal_landscape">' . _('Legal') . ' ' . _('landscape') .'</option>'; } else { - echo "<option value='legal_landscape'>" . _('Legal') . ' ' . _('landscape'); + echo '<option value="legal_landscape">' . _('Legal') . ' ' . _('landscape') .'</option>'; } echo '</select></td></tr>'; echo '<tr> - <td>' . _('Theme') . ":</td> - <td><select name='Theme'>"; + <td>' . _('Theme') . ':</td> + <td><select name="Theme">'; $ThemeDirectory = dir('css/'); while (false != ($ThemeName = $ThemeDirectory->read())){ - if (is_dir("css/$ThemeName") AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != 'CVS'){ + if (is_dir('css/' . $ThemeName) AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != '.svn'){ if (isset($_POST['Theme']) and $_POST['Theme'] == $ThemeName){ - echo "<option selected value='$ThemeName'>$ThemeName"; + echo '<option selected value="' . $ThemeName . '">' . $ThemeName .'</option>'; } else if (!isset($_POST['Theme']) and ($_SESSION['DefaultTheme']==$ThemeName)) { - echo "<option selected value='$ThemeName'>$ThemeName"; + echo '<option selected value="' . $ThemeName . '">' . $ThemeName .'</option>'; } else { - echo "<option value='$ThemeName'>$ThemeName"; + echo '<option value="' . $ThemeName . '">' . $ThemeName .'</option>'; } } } @@ -555,22 +539,25 @@ echo '<tr> - <td>' . _('Language') . ":</td> - <td><select name='UserLanguage'>"; + <td>' . _('Language') . ':</td> + <td><select name="UserLanguage">'; - $LangDirHandle = dir('locale/'); +$Languages = scandir('locale/', 0); -while (false != ($LanguageEntry = $LangDirHandle->read())){ +foreach ($Languages as $LanguageEntry){ - if (is_dir('locale/' . $LanguageEntry) AND $LanguageEntry != '..' AND $LanguageEntry != 'CVS' AND $LanguageEntry!='.'){ + if (is_dir('locale/' . $LanguageEntry) + AND $LanguageEntry != '..' + AND $LanguageEntry != '.svn' + AND $LanguageEntry!='.'){ if (isset($_POST['UserLanguage']) and $_POST['UserLanguage'] == $LanguageEntry){ - echo "<option selected value='$LanguageEntry'>$LanguageEntry"; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } elseif (!isset($_POST['UserLanguage']) and $LanguageEntry == $DefaultLanguage) { - echo "<option selected value='$LanguageEntry'>$LanguageEntry"; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } else { - echo "<option value='$LanguageEntry'>$LanguageEntry"; + echo '<option value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } } } @@ -584,32 +571,34 @@ $i=0; foreach($ModuleList as $ModuleName){ - echo '<tr><td>' . _('Display') . ' ' . $ModuleName . ' ' . _('options') . ": </td><td><select name='Module_" . $i . "'>"; + echo '<tr><td>' . _('Display') . ' ' . $ModuleName . ' ' . _('options') . ': </td> + <td><select name="Module_' . $i . '">'; if ($ModulesAllowed[$i]==0){ - echo '<option selected value=0>' . _('No'); - echo '<option value=1>' . _('Yes'); + echo '<option selected value=0>' . _('No') . '</option>'; + echo '<option value=1>' . _('Yes') . '</option>'; } else { - echo '<option selected value=1>' . _('Yes'); - echo '<option value=0>' . _('No'); + echo '<option selected value=1>' . _('Yes') . '</option>'; + echo '<option value=0>' . _('No') . '</option>'; } echo '</select></td></tr>'; $i++; } -echo '<tr><td>' . _('Account Status') . ":</td><td><select name='Blocked'>"; +echo '<tr><td>' . _('Account Status') . ':</td> + <td><select name="Blocked">'; if ($_POST['Blocked']==0){ - echo '<option selected value=0>' . _('Open'); - echo '<option value=1>' . _('Blocked'); + echo '<option selected value=0>' . _('Open') . '</option>'; + echo '<option value=1>' . _('Blocked') . '</option>'; } else { - echo '<option selected value=1>' . _('Blocked'); - echo '<option value=0>' . _('Open'); + echo '<option selected value=1>' . _('Blocked') . '</option>'; + echo '<option value=0>' . _('Open') . '</option>'; } echo '</select></td></tr>'; +echo '</table><br> + <div class="centre"><input type="submit" name="submit" value="' . _('Enter Information') . '"></div> + </form>'; -echo "</table><br> - <div class='centre'><input type='submit' name='submit' value='" . _('Enter Information') . "'></div></form>"; - if (isset($_GET['SelectedUser'])) { echo '<script type="text/javascript">defaultControl(document.forms[0].Password);</script>'; } else { @@ -617,5 +606,4 @@ } include('includes/footer.inc'); - ?> \ No newline at end of file Modified: trunk/CustWhereAlloc.php =================================================================== --- trunk/CustWhereAlloc.php 2011-04-19 10:18:49 UTC (rev 4555) +++ trunk/CustWhereAlloc.php 2011-04-26 11:03:36 UTC (rev 4556) @@ -1,13 +1,12 @@ <?php -/* $Revision: 1.10 $ */ + /* $Id$*/ -//$PageSecurity = 2; include('includes/session.inc'); $title = _('Customer How Paid Inquiry'); include('includes/header.inc'); -echo "<form action='" . $_SERVER['PHP_SELF'] . "' method=post>"; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . @@ -15,32 +14,33 @@ echo '<table class=selection cellpadding=2><tr>'; -echo '<td>' . _('Type') . ":</td><td><select tabindex=1 name='TransType'> "; +echo '<td>' . _('Type') . ':</td> + <td><select tabindex=1 name="TransType"> '; $sql = "SELECT typeid, typename FROM systypes WHERE typeid = 10 OR typeid=12"; $resultTypes = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultTypes)){ if (isset($_POST['TransType'])){ if ($myrow['typeid'] == $_POST['TransType']){ - echo "<option selected Value='" . $myrow['typeid'] . "'>" . $myrow['typename']; + echo '<option selected value="' . $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; } else { - echo "<option Value='" . $myrow['typeid'] . "'>" . $myrow['typename']; + echo '<option Value="' . $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; } } else { - echo "<option Value='" . $myrow['typeid'] . "'>" . $myrow['typename']; + echo '<option value="' . $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; } } echo '</select></td>'; if (!isset($_POST['TransNo'])) {$_POST['TransNo']='';} -echo '<td>'._('Transaction Number').":</td> - <td><input tabindex=2 type=text name='TransNo' maxlength=10 size=10 value=". $_POST['TransNo'] . '></td>'; +echo '<td>'._('Transaction Number').':</td> + <td><input tabindex=2 type="text" name="TransNo" maxlength=10 size=10 value="'. $_POST['TransNo'] . '"></td>'; -echo "</tr></table><br> - <div class='centre'><input tabindex=3 type=submit name='ShowResults' value="._('Show How Allocated').'></div>'; +echo '</tr></table><br /> + <div class="centre"><input tabindex=3 type="submit" name="ShowResults" value="' . _('Show How Allocated') . '"></div>'; if (isset($_POST['ShowResults']) AND $_POST['TransNo']==''){ - echo '<br>'; + echo '<br />'; prnMsg(_('The transaction number to be queried must be entered first'),'warn'); } @@ -59,7 +59,6 @@ $myrow = DB_fetch_array($result); $AllocToID = $myrow['id']; - $sql = "SELECT type, transno, trandate, @@ -79,18 +78,20 @@ if (DB_num_rows($TransResult)==0){ prnMsg(_('There are no allocations made against this transaction'),'info'); } else { - echo '<br><table cellpadding=2 class=selection>'; + echo '<br /><table cellpadding=2 class=selection>'; - echo '<tr><th colspan=6><div class="centre"><font size=3 color=blue><b>'._('Allocations made against invoice number') . ' ' . $_POST['TransNo'] - . '<br>'._('Transaction Total').': '. number_format($myrow['totamt'],2) . '</font></b></div></th></tr>'; + echo '<tr> + <th colspan=6><div class="centre"><font size=3 color=blue><b>'._('Allocations made against invoice number') . ' ' . $_POST['TransNo'] . '<br />'._('Transaction Total').': '. number_format($myrow['totamt'],2) . '</font></b></div></th> + </tr>'; - $tableheader = "<tr><th>"._('Type')."</th> - <th>"._('Number')."</th> - <th>"._('Reference')."</th> - <th>"._('Ex Rate')."</th> - <th>"._('Amount')."</th> - <th>"._('Alloc').'</th> - </tr>'; + $tableheader = '<tr> + <th>' . _('Type') . '</th> + <th>' . _('Number') . '</th> + <th>' . _('Reference') . '</th> + <th>' . _('Ex Rate') . '</th> + <th>' . _('Amount') . '</th> + <th>' . _('Alloc') . '</th> + </tr>'; echo $tableheader; $RowCounter = 1; @@ -112,13 +113,13 @@ } else { $TransType = _('Receipt'); } - echo "<td>".$TransType."</td> - <td>".$myrow['transno']."</td> - <td>".$myrow['reference']."</td> - <td>".$myrow['rate']."</td> - <td class=number>".number_format($myrow['totalamt'],2)."</td> - <td class=number>".number_format($myrow['amt'],2)."</td> - </tr>"; + echo '<td>' . $TransType . '</td> + <td>' . $myrow['transno'] . '</td> + <td>' . $myrow['reference'] . '</td> + <td>' . $myrow['rate'] . '</td> + <td class=number>' . number_format($myrow['totalamt'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class=number>' . number_format($myrow['amt'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; $RowCounter++; If ($RowCounter == 12){ Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2011-04-19 10:18:49 UTC (rev 4555) +++ trunk/CustomerBranches.php 2011-04-26 11:03:36 UTC (rev 4556) @@ -1,10 +1,7 @@ <?php -/* $Revision: 1.53 $ */ /* $Id$*/ -//$PageSecurity = 3; - include('includes/session.inc'); $title = _('Customer Branches'); include('includes/header.inc'); @@ -17,7 +14,7 @@ if (!isset($DebtorNo)) { prnMsg(_('This page must be called with the debtor code of the customer for whom you wish to edit the branches for').'. - <br>'._('When the pages is called from within the system this will always be the case').' <br>'. + <br />'._('When the pages is called from within the system this will always be the case').' <br />'. _('Select a customer first then select the link to add/edit/delete branches'),'warn'); include('includes/footer.inc'); exit; @@ -30,9 +27,6 @@ $SelectedBranch = strtoupper($_POST['SelectedBranch']); } -// This link is already available on the menu on this page -//echo "<a href='" . $rootpath . '/SelectCustomer.php?' . SID . "'>" . _('Back to Customers') . '</a><br>'; - if (isset($Errors)) { unset($Errors); } @@ -107,39 +101,35 @@ define("KEY", $api_key); if ($map_host=="") { // check that some sane values are setup already in geocode tables, if not skip the geocoding but add the record anyway. - echo '<div class="warn">' . _('Warning - Geocode Integration is enabled, but no hosts are setup. Go to Geocode Setup') . '</div>'; + echo '<div class="warn">' . _('Warning - Geocode Integration is enabled, but no hosts are setup. Go to Geocode Setup') . '</div>'; } else { - - $address = $_POST["BrAddress1"] . ", " . $_POST["BrAddress2"] . ", " . $_POST["BrAddress3"] . ", " . $_POST["BrAddress4"]; - - $base_url = "http://" . MAPS_HOST . "/maps/geo?output=xml" . "&key=" . KEY; - $request_url = $base_url . "&q=" . urlencode($address); - $xml = simplexml_load_string(utf8_encode(file_get_contents($request_url))) or die("url not loading"); -// $xml = simplexml_load_file($request_url) or die("url not loading"); - - $coordinates = $xml->Response->Placemark->Point->coordinates; - $coordinatesSplit = explode(",", $coordinates); - // Format: Longitude, Latitude, Altitude - $latitude = $coordinatesSplit[1]; - $longitude = $coordinatesSplit[0]; - - $status = $xml->Response->Status->code; - if (strcmp($status, "200") == 0) { - // Successful geocode - $geocode_pending = false; - $coordinates = $xml->Response->Placemark->Point->coordinates; - $coordinatesSplit = explode(",", $coordinates); - // Format: Longitude, Latitude, Altitude - $latitude = $coordinatesSplit[1]; - $longitude = $coordinatesSplit[0]; - } else { - // failure to geocode - $geocode_pending = false; - echo '<div class="page_help_text"><b>Geocode Notice:</b> Address: ' . $address . ' failed to geocode. '; - echo 'Received status ' . $status . '</div>'; - } + $address = $_POST['BrAddress1'] . ", " . $_POST['BrAddress2'] . ", " . $_POST['BrAddress3'] . ", " . $_POST['BrAddress4']; + $base_url = 'http://' . MAPS_HOST . '/maps/geo?output=xml&key=' . KEY; + $request_url = $base_url . '&q=' . urlencode($address); + $xml = simplexml_load_string(utf8_encode(file_get_contents($request_url))) or die("url not loading"); + $coordinates = $xml->Response->Placemark->Point->coordinates; + $coordinatesSplit = explode(",", $coordinates); + // Format: Longitude, Latitude, Altitude + $latitude = $coordinatesSplit[1]; + $longitude = $coordinatesSplit[0]; + + $status = $xml->Response->Status->code; + if (strcmp($status, '200') == 0) { + // Successful geocode + $geocode_pending = false; + $coordinates = $xml->Response->Placemark->Point->coordinates; + $coordinatesSplit = explode(",", $coordinates); + // Format: Longitude, Latitude, Altitude + $latitude = $coordinatesSplit[1]; + $longitude = $coordinatesSplit[0]; + } else { + // failure to geocode + $geocode_pending = false; + echo '<div class="page_help_text"><b>' . _('Geocode Notice') . ':</b> ' . _('Address') . ': ' . $address . ' ' . _('failed to geocode'); + echo _('Received status') . ' ' . $status . '</div>'; + } + } } - } if (isset($SelectedBranch) AND $InputError !=1) { /*SelectedBranch 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*/ @@ -242,8 +232,8 @@ '" . $_POST['DeliverBlind'] . "' )"; } - echo '<br>'; - $msg = _('Customer branch<b>').' ' . $_POST['BranchCode'] . ': ' . $_POST['BrName'] . ' '._('</b>has been added, add another branch, or return to <a href=index.php>Main Menu</a>'); + echo '<br />'; + $msg = _('Customer branch').'<b> ' . $_POST['BranchCode'] . ': ' . $_POST['BrName'] . ' </b>'._('has been added, add another branch, or return to the') . ' <a href="index.php">' . _('Main Menu') . '</a>'; //run the SQL from either of the above possibilites @@ -292,7 +282,7 @@ $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { - prnMsg(_('Cannot delete this branch because customer transactions have been created to this branch') . '<br>' . + prnMsg(_('Cannot delete this branch because customer transactions have been created to this branch') . '<br />' . _('There are').' ' . $myrow[0] . ' '._('transactions with this Branch Code'),'error'); } else { @@ -303,7 +293,7 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg(_('Cannot delete this branch because sales analysis records exist for it'),'error'); - echo '<br>'._('There are').' ' . $myrow[0] . ' '._('sales analysis records with this Branch Code/customer'); + echo '<br />'._('There are').' ' . $myrow[0] . ' '._('sales analysis records with this Branch Code/customer'); } else { @@ -313,7 +303,7 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg(_('Cannot delete this branch because sales orders exist for it') . '. ' . _('Purge old sales orders first'),'warn'); - echo '<br>'._('There are').' ' . $myrow[0] . ' '._('sales orders for this Branch/customer'); + echo '<br />'._('There are').' ' . $myrow[0] . ' '._('sales orders for this Branch/customer'); } else { // Check if there are any users that refer to this branch code $sql= "SELECT COUNT(*) FROM www_users WHERE www_users.branchcode='".$SelectedBranch."' AND www_users.customerid = '".$DebtorNo."'"; @@ -323,7 +313,7 @@ if ($myrow[0]>0) { prnMsg(_('Cannot delete this branch because users exist that refer to it') . '. ' . _('Purge old users first'),'warn'); - echo '<br>'._('There are').' ' . $myrow[0] . ' '._('users referring to this Branch/customer'); + echo '<br />'._('There are').' ' . $myrow[0] . ' '._('users referring to this Branch/customer'); } else { $sql="DELETE FROM custbranch WHERE branchcode='" . $SelectedBranch . "' AND debtorno='" . $DebtorNo . "'"; @@ -373,16 +363,18 @@ echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Branches defined for'). ' '. $DebtorNo . ' - ' . $myrow[0] . '</p>'; echo '<table class=selection>'; - echo "<tr><th>"._('Code')."</th> - <th>"._('Name')."</th> - <th>"._('Branch Contact')."</th> - <th>"._('Salesman')."</th> - <th>"._('Area')."</th> - <th>"._('Phone No')."</th> - <th>"._('Fax No')."</th> - <th>"._('Email')."</th> - <th>"._('Tax Group')."</th> - <th>"._('Enabled?')."</th></tr>"; + + echo '<tr><th>'._('Code').'</th> + <th>'._('Name').'</th> + <th>'._('Branch Contact').'</th> + <th>'._('Salesman').'</th> + <th>'._('Area').'</th> + <th>'._('Phone No').'</th> + <th>'._('Fax No').'</th> + <th>'._('Email').'</th> + <th>'._('Tax Group').'</th> + <th>'._('Enabled?').'</th></tr>'; + $k=0; do { if ($k==1){ @@ -393,20 +385,19 @@ $k=1; } - - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> - <td><a href='Mailto:%s'>%s</a></td> + <td><a href="Mailto:%s">%s</a></td> <td>%s</td> <td>%s</td> - <td><a href='%s?DebtorNo=%s&SelectedBranch=%s'>%s</td> - <td><a href='%s?DebtorNo=%s&SelectedBranch=%s&delete=yes' onclick=\"return confirm('" . - _('Are you sure you wish to delete this branch?') . "');\">%s</td></tr>", + <td><a href="%s?DebtorNo=%s&SelectedBranch=%s">%s</td> + <td><a href="%s?DebtorNo=%s&SelectedBranch=%s&delete=yes" onclick=\'return confirm("' . + _('Are you sure you wish to delete this branch?') . '");\'>%s</td></tr>', $myrow[10], $myrow[2], $myrow[5], @@ -431,9 +422,9 @@ } while ($myrow = DB_fetch_row($result)); //END WHILE LIST LOOP - echo '</table><br><table class=selection><tr><td><div class="centre">'; - echo '<b>'.$TotalEnable.'</b> ' . _('Branches are enabled.') . '<br>'; - echo '<b>'.$TotalDisable.'</b> ' . _('Branches are disabled.') . '<br>'; + echo '</table><br /><table class=selection><tr><td><div class="centre">'; + echo '<b>'.$TotalEnable.'</b> ' . _('Branches are enabled.') . '<br />'; + echo '<b>'.$TotalDisable.'</b> ' . _('Branches are disabled.') . '<br />'; echo '<b>'.($TotalEnable+$TotalDisable). '</b> ' . _('Total Branches') . '</div></td></tr></table>'; } else { $sql = "SELECT debtorsmaster.name, @@ -462,7 +453,7 @@ } if (!isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] .'?' . SID . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] .'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedBranch)) { @@ -532,17 +523,18 @@ $_POST['DeliverBlind'] = $myrow['deliverblind']; } - echo "<input type=hidden name='SelectedBranch' VALUE='" . $SelectedBranch . "'>"; - echo "<input type=hidden name='BranchCode' VALUE='" . $_POST['BranchCode'] . "'>"; - + echo '<input type=hidden name="SelectedBranch" value="' . $SelectedBranch . '" />'; + echo '<input type=hidden name="BranchCode" value="' . $_POST['BranchCode'] . '" />'; + echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Change Details for Branch'). ' '. $SelectedBranch . '</p>'; if (isset($SelectedBranch)) { - echo '<div class="centre"><a href=' . $_SERVER['PHP_SELF'] . '?' . SID . 'DebtorNo=' . $DebtorNo. '>' . _('Show all branches defined for'). ' '. $DebtorNo . '</a></div>'; + echo '<div class="centre"><a href=' . $_SERVER['PHP_SELF'] . '?DebtorNo=' . $DebtorNo. '>' . _('Show all branches defined for'). ' '. $DebtorNo . '</a></div>'; } - echo "<br><table class=selection>"; - echo "<tr><th colspan=2><div class='centre'><b>"._('Change Branch')."</b></th></tr>"; - echo "<tr><td>"._('Branch Code').':</td><td>'; + echo '<br><table class="selection">'; + echo '<tr><th colspan=2><div class="centre"><b>'._('Change Branch').'</b></th></tr>'; + echo '<tr><td>'._('Branch Code').':</td><td>'; + echo $_POST['BranchCode'] . '</td></tr>'; } else { //end of if $SelectedBranch only do the else when a new record is being entered @@ -577,8 +569,7 @@ } echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Add a Branch').'</p>'; echo '<table class=selection><tr><td>'._('Branch Code'). ':</td> - <td><input ' .(in_array('BranchCode',$Errors) ? 'class="inputerror"' : '' ) . - " tabindex=1 type='Text' name='BranchCode' size=12 maxlength=10 value=" . $_POST['BranchCode'] . '></td></tr>'; + <td><input ' .(in_array('BranchCode',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex=1 type="text" name="BranchCode" size=12 maxlength=10 value="' . $_POST['BranchCode'] . '"></td></tr>'; $_POST['DeliverBlind'] = $_SESSION['DefaultBlindPackNote']; } @@ -590,7 +581,7 @@ if (DB_num_rows($result)==0){ echo '</table>'; prnMsg(_('There are no sales people defined as yet') . ' - ' . _('customer branches must be allocated to a sales person') . '. ' . _('Please use the link below to define at least one sales person'),'error'); - echo '<p align="center"><a href="' . $rootpath . '/SalesPeople.php?"' . SID . '">'._('Define Sales People') . '</a>'; + echo '<p align="center"><a href="' . $rootpath . '/SalesPeople.php">'._('Define Sales People') . '</a>'; include('includes/footer.inc'); exit; } @@ -654,7 +645,7 @@ if (DB_num_rows($result)==0){ echo '</table>'; prnMsg(_('There are no areas defined as yet') . ' - ' . _('customer branches must be allocated to an area') . '. ' . _('Please use the link below to define at least one sales area'),'error'); - echo "<br><a href='$rootpath/Areas.php?" . SID . "'>"._('Define Sales Areas').'</a>'; + echo '<br /><a href="' . $rootpath. '/Areas.php">'._('Define Sales Areas').'</a>'; include('includes/footer.inc'); exit; } @@ -681,7 +672,7 @@ if (DB_num_rows($result)==0){ echo '</table>'; prnMsg(_('There are no stock locations defined as yet') . ' - ' . _('customer branches must refer to a default location where stock is normally drawn from') . '. ' . _('Please use the link below to define at least one stock location'),'error'); - echo "<br><a href='$rootpath/Locations.php?" . SID . "'>"._('Define Stock Locations').'</a>'; + echo '<br /><a href="' . $rootpath . '/Locations.php">'._('Define Stock Locations').'</a>'; include('includes/footer.inc'); exit; } @@ -691,11 +682,11 @@ while ($myrow = DB_fetch_array($result)) { if (isset($_POST['DefaultLocation']) and $myrow['loccode']==$_POST['DefaultLocation']) { - echo '<option selected VALUE='; + echo '<option selected value='; } else { - echo '<option VALUE='; + echo '<option value='; } - echo $myrow['loccode'] . '>' . $myrow['locationname']; + echo $myrow['loccode'] . '>' . $myrow['locationname'] . '</option>'; } //end while loop @@ -718,7 +709,7 @@ DB_data_seek($result,0); - $sql = 'SELECT taxgroupid, taxgroupdescription FROM taxgroups'; + $sql = "SELECT taxgroupid, taxgroupdescription FROM taxgroups"; $result = DB_query($sql,$db); while ($myrow = DB_fetch_array($result)) { @@ -727,30 +718,32 @@ } else { echo '<option VALUE='; } - echo $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription']; + echo $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription'] . '</option>'; } //end while loop echo '</select></td></tr>'; - echo '<tr><td>'._('Transactions on this branch').":</td><td><select tabindex=20 name='DisableTrans'>"; + echo '<tr><td>'._('Transactions on this branch') . ':</td> + <td><select tabindex=20 name="DisableTrans">'; if ($_POST['DisableTrans']==0){ - echo '<option selected VALUE=0>' . _('Enabled'); - echo '<option VALUE=1>' . _('Disabled'); + echo '<option selected value=0>' . _('Enabled') . '</option>'; + echo '<option value=1>' . _('Disabled') . '</option>'; } else { - echo '<option selected VALUE=1>' . _('Disabled'); - echo '<option VALUE=0>' . _('Enabled'); + echo '<option selected value=1>' . _('Disabled') . '</option>'; + echo '<option value=0>' . _('Enabled') . '</option>'; } echo ' </select></td></tr>'; - echo '<tr><td>'._('Default freight/shipper method').":</td><td><select tabindex=21 name='DefaultShipVia'>"; - $SQL = 'SELECT shipper_id, shippername FROM shippers'; + echo '<tr><td>'._('Default freight/shipper method') . ':</td> + <td><select tabindex=21 name="DefaultShipVia">'; + $SQL = "SELECT shipper_id, shippername FROM shippers"; $ShipperResults = DB_query($SQL,$db); while ($myrow=DB_fetch_array($ShipperResults)){ if (isset($_POST['DefaultShipVia'])and $myrow['shipper_id']==$_POST['DefaultShipVia']){ - echo '<option selected VALUE=' . $myrow['shipper_id'] . '>' . $myrow['shippername']; + echo '<option selected value=' . $myrow['shipper_id'] . '>' . $myrow['shippername'] . '</option>'; }else { - echo '<option VALUE=' . $myrow['shipper_id'] . '>' . $myrow['shippername']; + echo '<option value=' . $myrow['shipper_id'] . '>' . $myrow['shippername'] . '</option>'; } } @@ -759,22 +752,16 @@ /* This field is a default value that will be used to set the value on the sales order which will control whether or not to display the company logo and address on the packlist */ - echo '<tr><td>' . _('Default Packlist') . ":</td><td><select tabindex=22 name='DeliverBlind'>"; - for ($p = 1; $p <= 2; $p++) { - echo '<option VALUE=' . $p; - if ($p == $_POST['DeliverBlind']) { - echo ' selected>'; - } else { - echo '>'; - } - switch ($p) { - case 1: - echo _('Show company details and logo'); break; - case 2: - echo _('Hide company details and logo'); break; - } - } - echo '</select></td></tr>'; + echo '<tr><td>' . _('Default Packlist') . ':</td><td><select tabindex=22 name="DeliverBlind">'; + if ($_POST['DeliverBlind']==2){ + echo '<option value="1">' . _('Show company details and logo') . '</option>'; + echo '<option selected value="2">' . _('Hide company details and logo') . '</option>'; + } else { + echo '<option selected value="1">' . _('Show company details and logo') . '</option>'; + echo '<option value="2">' . _('Hide company details and logo') . '</option>'; + } + + echo '</select></td></tr>'; echo '<tr><td>'._('Postal Address 1 (Street)').':</td>'; if (!isset($_POST['BrPostAddr1'])) {$_POST['BrPostAddr1']='';} @@ -792,7 +779,7 @@ if (!isset($_POST['CustBranchCode'])) {$_POST['CustBranchCode']='';} echo '<td><input tabindex=27 type="Text" name="CustBranchCode" size=31 maxlength=30 value="'. $_POST['CustBranchCode'].'"></td></tr>'; echo '</table>'; - echo '<br><div class="centre"><input tabindex=28 type="Submit" name="submit" value="' . _('Enter Branch') . '"></div>'; + echo '<br /><div class="centre"><input tabindex=28 type="Submit" name="submit" value="' . _('Enter Branch') . '"></div>'; echo '</form>'; } //end if record deleted no point displaying form to add record Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2011-04-19 10:18:49 UTC (rev 4555) +++ trunk/CustomerReceipt.php 2011-04-26 11:03:36 UTC (rev 4556) @@ -231,10 +231,10 @@ echo '<br /><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Allocate') . '" alt="" />' . ' ' . _('Summary of Receipt Batch').'</p><br />'; echo '<table class=selection><tr><th>'._('Batch Number').'</th> - <th>'._('Date Banked').'</th> - <th>'._('Customer Name').'</th - <th>'._('GL Code').'</th - <th>'._('Amount of Receipt').'</th></tr>'; + <th>' . _('Date Banked') . '</th> + <th>' . _('Customer Name') . '</th> + <th>' . _('GL Code') . '</th> + <th>' . _('Amount of Receipt').'</th></tr>'; foreach ($_SESSION['ReceiptBatch']->Items as $ReceiptItem) { @@ -859,8 +859,8 @@ <td class=number>' . number_format($ReceiptItem->Discount,2) . '</td> <td>' . stripslashes($ReceiptItem->CustomerName) . '</td> <td>'.$ReceiptItem->GLCode.' - '.$myrow['accountname'].'</td> - <td>'.$ReceiptItem->Narrative . "</td> - <td><a href='" . $_SERVER['PHP_SELF'] . '?Delete=' . $ReceiptItem->ID . "&Type=".$_GET['Type']."'>" . _('Delete') . '</a></td> + <td>'.$ReceiptItem->Narrative . '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $ReceiptItem->ID . '&Type=' . $_GET['Type']. '">' . _('Delete') . '</a></td> </tr>'; $BatchTotal= $BatchTotal + $ReceiptItem->Amount; } @@ -918,7 +918,7 @@ echo '<table class=selection>'; - $DisplayDiscountPercent = number_format($_SESSION['CustomerRecord']['pymtdiscount']*100,2) . "%"; + $DisplayDiscountPercent = number_format($_SESSION['CustomerRecord']['pymtdiscount']*100,2) . '%'; echo '<input type="hidden" name="CustomerID" value="' . $_POST['CustomerID'] . '">'; echo '<input type="hidden" name="CustomerName" value="' . $_SESSION['CustomerRecord']['name'] . '">'; @@ -1050,9 +1050,9 @@ echo '<tr class="EvenTableRows">'; $k=1; } - - printf("<td><font size=1><input tabindex=".number_format(12+$j)." type=submit name='Select' value='%s'</font></td> - <td>%s</td></tr>", + printf('<td><font size=1> + <input tabindex='.number_format(12+$j).' type=submit name="Select" value="%s"></font></td> + <td>%s</td></tr>', $myrow['debtorno'], $myrow['name']); Modified: trunk/CustomerTypes.php =================================================================== --- trunk/CustomerTypes.php 2011-04-19 10:18:49 UTC (rev 4555) +++ trunk/CustomerTypes.php 2011-04-26 11:03:36 UTC (rev 4556) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.6 $ */ + /* $Id$*/ -//$PageSecurity = 15; - include('includes/session.inc'); $title = _('Customer Types') . ' / ' . _('Maintenance'); include('includes/header.inc'); @@ -43,7 +41,7 @@ if (strlen($_POST['typename'])==0) { $InputError = 1; - echo '<br>'; + echo '<br />'; prnMsg(_('The customer type name description must contain at least one character'),'error'); $Errors[$i] = 'CustomerType'; $i++; @@ -56,7 +54,7 @@ $checkrow=DB_fetch_row($checkresult); if ($checkrow[0]>0 and !isset($SelectedType)) { $InputError = 1; - echo '<br>'; + echo '<br />'; prnMsg(_('You already have a customer type called').' '.$_POST['typename'],'error'); $Errors[$i] = 'CustomerName'; $i++; @@ -124,7 +122,7 @@ $result = DB_query($sql,$db); $_SESSION['DefaultCustomerType'] = $_POST['typeid']; } - echo '<br>'; + echo '<br />'; prnMsg($msg,'success'); unset($SelectedType); @@ -146,7 +144,7 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { - prnMsg(_('Cannot delete this type because customer transactions have been created using this type') . '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions using this type'),'error'); + prnMsg(_('Cannot delete this type because customer transactions have been created using this type') . '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions using this type'),'error'); } else { @@ -156,13 +154,13 @@ $result = DB_query($sql,$db,$ErrMsg); $myrow = DB_fetch_row($result); 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')); + 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>'; + echo '<br />'; prnMsg(_('Customer type') . $SelectedType . ' ' . _('has been deleted') ,'success'); unset ($SelectedType); @@ -182,11 +180,11 @@ $sql = 'SELECT typeid, typename FROM debtortype'; $result = DB_query($sql,$db); - echo '<br><table class=selection>'; - echo "<tr> - <th>" . _('Type ID') . "</th> - <th>" . _('Type Name') . "</th> - </tr>"; + echo '<br /><table class=selection>'; + echo '<tr> + <th>' . _('Type ID') . '</th> + <th>' . _('Type Name') . '</th> + </tr>'; $k=0; //row colour counter @@ -199,16 +197,17 @@ $k=1; } - printf(" +printf('<td>%s</td> <td>%s</td> - <td>%s</td> - <td><a href='%sSelectedType=%s'>" . _('Edit') . "</td> - <td><a href='%sSelectedType=%s&delete=yes' onclick=\"return confirm('" . _('Are you sure you wish to delete this Customer Type?') . "');\">" . _('Delete') . "</td> - </tr>", + <td><a href="%sSelectedType=%s">' . _('Edit') . '</td> + <td><a href="%sSelectedType=%s&delete=yes" onclick=\'return confirm("' . _('Are you sure you wish to delete this Customer Type?') . '");\'>' . _('Delete') . '</td> + </tr>', $myrow[0], $myrow[1], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0]); + $_SERVER['PHP_SELF'] . '?', + $myrow[0], + $_SERVER['PHP_SELF'] . '?', + $myrow[0]); } //END WHILE LIST LOOP echo '</table>'; @@ -217,18 +216,17 @@ //end of ifs and buts! if (isset($SelectedType)) { - echo '<div class="centre"><p><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Show All Types Defined') . '</a></div><p>'; + echo '<div class="centre"><p><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Types Defined') . '</a></div><p>'; } if (! isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p><table class=selection>'; //Main table // The user wish to EDIT an existing type - if ( isset($SelectedType) AND $SelectedType!='' ) - { + if ( isset($SelectedType) AND $SelectedType!='' ) { $sql = "SELECT typeid, typename @@ -241,26 +239,23 @@ $_POST['typeid'] = $myrow['typeid']; $_POST['typename'] = $myrow['typename']; - echo "<input type=hidden name='SelectedType' VALUE=" . $SelectedType . ">"; - echo "<input type=hidden name='typeid' VALUE=" . $_POST['typeid'] . ">"; - echo "<table class=selection> <tr><td>"; + echo '<input type=hidden name="SelectedType" value="' . $SelectedType . '">'; + echo '<input type=hidden name="typeid" value=' . $_POST['typeid'] . '">'; + echo '<table class="selection">'; // We dont allow the user to change an existing type code - echo 'Type ID: ' . $_POST['typeid'] . '</td></tr>'; + echo '<tr><td>' . _('Type ID') . ': ' . $_POST['typeid'] . '</td></tr>'; } else { - // This is a new type so the user may volunteer a type code - - echo "<table class=selection>"; - + echo '<table class="selection">'; } if (!isset($_POST['typename'])) { $_POST['typename']=''; } - echo "<tr><td>" . _('Type Name') . ":</td><td><input type='Text' name='typename' value='" . $_POST['typename'] . "'></td></tr>"; + echo '<tr><td>' . _('Type Name') . ':</td><td><input type="Text" name="typename" value="' . $_POST['typename'] . '"></td></tr>'; echo '</td></tr></table>'; // close main table Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2011-04-19 10:18:49 UTC (rev 4555) +++ trunk/Customers.php 2011-04-26 11:03:36 UTC (rev 4556) @@ -281,11 +281,11 @@ $BranchCode = substr($_POST['DebtorNo'],0,4); - echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath ."/CustomerBranches.php?" . SID . "&DebtorNo=" . $_POST['DebtorNo'] . "'>"; + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath .'/CustomerBranches.php?DebtorNo=' . $_POST['DebtorNo'] . '">'; echo '<div class="centre">' . _('You should automatically be forwarded to the entry of a new Customer Branch page') . '. ' . _('If this does not happen') .' (' . _('if the browser does not support META Refresh') . ') ' . - "<a href='" . $rootpath . "/CustomerBranches.php?" . SID . "&DebtorNo=" . $_POST['DebtorNo'] . '.</div>'; + '<a href="' . $rootpath . '/CustomerBranches.php?DebtorNo=' . $_POST['DebtorNo'] . '"></a></div>'; include('includes/footer.inc'); exit; @@ -421,8 +421,8 @@ /* First check that all the necessary items have been setup */ $SetupErrors=0; //Count errors - $sql='SELECT COUNT(typeabbrev) - FROM salestypes'; + $sql="SELECT COUNT(typeabbrev) + FROM salestypes"; $result=DB_query($sql, $db); $myrow=DB_fetch_row($result); if ($myrow[0]==0) { @@ -430,8 +430,8 @@ _('Click').' '.'<a target="_blank" href="' . $rootpath . '/SalesTypes.php">' . _('here').' ' . '</a>'._('to set up your price lists'),'warning').'<br />'; $SetupErrors += 1; } - $sql='SELECT COUNT(typeid) - FROM debtortype'; + $sql="SELECT COUNT(typeid) + FROM debtortype"; $result=DB_query($sql, $db); $myrow=DB_fetch_row($result); if ($myrow[0]==0) { @@ -445,20 +445,20 @@ include('includes/footer.inc'); exit; } - - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo "<input type='Hidden' name='New' value='Yes'>"; + echo '<input type="hidden" name="New" value="Yes" />'; $DataError =0; - echo '<table class=selection cellspacing=4><tr><td valign=top><table class=selection>'; + echo '<table cl... [truncated message content] |
From: <dai...@us...> - 2011-04-19 10:18:59
|
Revision: 4555 http://web-erp.svn.sourceforge.net/web-erp/?rev=4555&view=rev Author: daintree Date: 2011-04-19 10:18:49 +0000 (Tue, 19 Apr 2011) Log Message: ----------- more quoting xhtml sql Modified Paths: -------------- trunk/DebtorsAtPeriodEnd.php trunk/DeliveryDetails.php trunk/DiscountCategories.php trunk/DiscountMatrix.php trunk/EDIMessageFormat.php trunk/EmailCustTrans.php trunk/ExchangeRateTrend.php trunk/FixedAssetCategories.php trunk/GLAccountInquiry.php trunk/GLBalanceSheet.php trunk/GLBudgets.php trunk/GLTags.php trunk/GLTrialBalance.php trunk/GoodsReceived.php trunk/InventoryQuantities.php trunk/InventoryValuation.php trunk/Locations.php trunk/MRPReschedules.php trunk/OutstandingGRNs.php trunk/geo_displaymap_customers.php trunk/geo_displaymap_suppliers.php trunk/includes/ConnectDB_mysqli.inc trunk/includes/PDFInventoryValnPageHeader.inc trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/sql/mysql/upgrade3.11.1-4.00.sql trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/DebtorsAtPeriodEnd.php =================================================================== --- trunk/DebtorsAtPeriodEnd.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/DebtorsAtPeriodEnd.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -1,9 +1,7 @@ <?php -//$PageSecurity = 2; /* $Id$*/ -/* $Revision: 1.16 $ */ include('includes/session.inc'); if (isset($_POST['PrintPDF']) @@ -58,9 +56,9 @@ $title = _('Customer Balances') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg(_('The customer details could not be retrieved by the SQL because') . DB_error_msg($db),'error'); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$SQL"; + echo '<br />' . $SQL; } include('includes/footer.inc'); exit; @@ -70,7 +68,7 @@ $title = _('Customer Balances') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg(_('The customer details listing has no clients to report on'),'warn'); - echo "<br><a href='".$rootpath."'/index.php?.'" . SID . "'>" . _('Back to the menu') . "</a>"; + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; } @@ -115,22 +113,10 @@ $LeftOvers = $pdf->addTextWrap(50,$YPos,160,$FontSize,_('Total balances'),'left'); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); - /* UldisN - $buf = $pdf->output(); - $len = strlen($buf); + + $pdf->OutputD($_SESSION['DatabaseName'] . '_DebtorBals_' . date('Y-m-d').'.pdf'); + $pdf->__destruct(); - header('Content-type: application/pdf'); - header("Content-Length: ".$len); - header('Content-Disposition: inline; filename=DebtorBals.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->stream(); - */ - $pdf->OutputD($_SESSION['DatabaseName'] . '_DebtorBals_' . date('Y-m-d').'.pdf');//UldisN - $pdf->__destruct(); //UldisN - } else { /*The option to print PDF was not hit */ $title=_('Debtor Balances'); @@ -142,29 +128,33 @@ /*if $FromCriteria is not set then show a form to allow input */ - echo '<form action=' . $_SERVER['PHP_SELF'] . " method='POST'><table class=selection>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('From Customer Code') .":</font></td><td><input tabindex=1 Type=text maxlength=6 size=7 name=FromCriteria value='1'></td></tr>"; - echo '<tr><td>' . _('To Customer Code') . ":</td><td><input tabindex=2 Type=text maxlength=6 size=7 name=ToCriteria value='zzzzzz'></td></tr>"; + echo '<tr><td>' . _('From Customer Code') .':</font></td> + <td><input tabindex=1 Type=text maxlength=6 size=7 name="FromCriteria" value="1"></td> + </tr>'; + echo '<tr><td>' . _('To Customer Code') . ':</td> + <td><input tabindex=2 type="text" maxlength=6 size=7 name="ToCriteria" value="zzzzzz"></td></tr>'; - echo '<tr><td>' . _('Balances As At') . ":</td><td><select tabindex=3 Name='PeriodEnd'>"; + echo '<tr><td>' . _('Balances As At') . ':</td> + <td><select tabindex=3 name="PeriodEnd">'; - $sql = 'SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC'; + $sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC"; $Periods = DB_query($sql,$db,_('Could not retrieve period data because'),_('The SQL that failed to get the period data was')); while ($myrow = DB_fetch_array($Periods,$db)){ - echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } } echo '</select></td></tr>'; + echo '</table> + <br /><div class="centre"><input tabindex=5 type=submit name="PrintPDF" value="' . _('Print PDF') . '"></div>'; - - echo "</table><br><div class='centre'><input tabindex=5 type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'></div>"; - include('includes/footer.inc'); } /*end of else not PrintPDF */ Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/DeliveryDetails.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -10,7 +10,6 @@ /* Session started in header.inc for password checking the session will contain the details of the order from the Cart class object. The details of the order come from SelectOrderItems.php */ -//$PageSecurity=1; include('includes/session.inc'); $title = _('Order Delivery Details'); include('includes/header.inc'); @@ -644,35 +643,35 @@ WHERE orderno='" .$_SESSION['ExistingOrder'] . "'", $db,$ErrMsg,$DbgMsg,true); $ErrMsg = _('Could not insert the contract bill of materials'); $InsContractBOM = DB_query("INSERT INTO bom (parent, - component, - workcentreadded, - loccode, - effectiveafter, - effectiveto) - SELECT contractref, - stockid, - workcentreadded, - '" . $_SESSION['Items'.$identifier]->Location ."', - '" . Date('Y-m-d') . "', - '2037-12-31' - FROM contractbom - WHERE contractref='" . $ContractRow['contractref'] . "'",$db,$ErrMsg,$DbgMsg); + component, + workcentreadded, + loccode, + effectiveafter, + effectiveto) + SELECT contractref, + stockid, + workcentreadded, + '" . $_SESSION['Items'.$identifier]->Location ."', + '" . Date('Y-m-d') . "', + '2037-12-31' + FROM contractbom + WHERE contractref='" . $ContractRow['contractref'] . "'",$db,$ErrMsg,$DbgMsg); $ErrMsg = _('Unable to insert a new work order for the sales order item'); $InsWOResult = DB_query("INSERT INTO workorders (wo, - loccode, - requiredby, - startdate) - VALUES ('" . $WONo . "', - '" . $_SESSION['Items'.$identifier]->Location ."', - '" . $ContractRow['requireddate'] . "', - '" . Date('Y-m-d'). "')", - $db,$ErrMsg,$DbgMsg); + loccode, + requiredby, + startdate) + VALUES ('" . $WONo . "', + '" . $_SESSION['Items'.$identifier]->Location ."', + '" . $ContractRow['requireddate'] . "', + '" . Date('Y-m-d'). "')", + $db,$ErrMsg,$DbgMsg); //Need to get the latest BOM to roll up cost but also add the contract other requirements $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*contractbom.quantity) AS cost - FROM stockmaster INNER JOIN contractbom - ON stockmaster.stockid=contractbom.stockid - WHERE contractbom.contractref='" . $ContractRow['contractref'] . "'", + FROM stockmaster INNER JOIN contractbom + ON stockmaster.stockid=contractbom.stockid + WHERE contractbom.contractref='" . $ContractRow['contractref'] . "'", $db); $CostRow = DB_fetch_row($CostResult); if (is_null($CostRow[0]) OR $CostRow[0]==0){ @@ -682,8 +681,8 @@ $Cost = $CostRow[0]; //cost of contract BOM } $CostResult = DB_query("SELECT SUM(costperunit*quantity) AS cost - FROM contractreqts - WHERE contractreqts.contractref='" . $ContractRow['contractref'] . "'", + FROM contractreqts + WHERE contractreqts.contractref='" . $ContractRow['contractref'] . "'", $db); $CostRow = DB_fetch_row($CostResult); //add other requirements cost to cost of contract BOM @@ -750,13 +749,13 @@ } $LineItemsSQL = "UPDATE salesorderdetails SET unitprice='" . $StockItem->Price . "', - quantity='" . $StockItem->Quantity . "', - discountpercent='" . floatval($StockItem->DiscountPercent) . "', - completed='" . $Completed . "', - poline='" . $StockItem->POLine . "', - itemdue='" . FormatDateForSQL($StockItem->ItemDue) . "' - WHERE salesorderdetails.orderno='" . $_SESSION['ExistingOrder'] . "' - AND salesorderdetails.orderlineno='" . $StockItem->LineNumber . "'"; + quantity='" . $StockItem->Quantity . "', + discountpercent='" . floatval($StockItem->DiscountPercent) . "', + completed='" . $Completed . "', + poline='" . $StockItem->POLine . "', + itemdue='" . FormatDateForSQL($StockItem->ItemDue) . "' + WHERE salesorderdetails.orderno='" . $_SESSION['ExistingOrder'] . "' + AND salesorderdetails.orderlineno='" . $StockItem->LineNumber . "'"; $DbgMsg = _('The SQL that was used to modify the order line and failed was'); $ErrMsg = _('The updated order line cannot be modified because'); @@ -771,10 +770,24 @@ prnMsg(_('Order Number') .' ' . $_SESSION['ExistingOrder'] . ' ' . _('has been updated'),'success'); - echo '<br /><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip - pre-printed stationery') .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td><td><a href="' . $rootpath .'/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $_SESSION['ExistingOrder'] . '">'. _('Confirm Order Delivery Quantities and Produce Invoice') .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td><td><a href="' . $rootpath .'/SelectSalesOrder.php?identifier='.$identifier . '">'. _('Select A Different Order') .'</a></td></tr></table>'; + echo '<br /> + <table class="selection"> + <tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip - pre-printed stationery') .'</a></td> + </tr>'; + echo '<tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td> + <td><a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td> + </tr>'; + echo '<tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td> + <td><a href="' . $rootpath .'/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $_SESSION['ExistingOrder'] . '">'. _('Confirm Order Delivery Quantities and Produce Invoice') .'</a></td> + </tr>'; + echo '<tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td> + <td><a href="' . $rootpath .'/SelectSalesOrder.php?identifier='.$identifier . '">'. _('Select A Different Order') .'</a></td> + </tr> + </table>'; include('includes/footer.inc'); exit; } @@ -786,7 +799,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Delivery') . '" alt="" />' . ' ' . _('Delivery Details'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Customer Code') . ' :<b> ' . $_SESSION['Items'.$identifier]->DebtorNo; echo '</b> ' . _('Customer Name') . ' :<b> ' . $_SESSION['Items'.$identifier]->CustomerName . '</p>'; -//echo '<font size=4><b>'. _('Customer') .' : ' . $_SESSION['Items'.$identifier]->CustomerName . '</b></font>'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -942,14 +955,14 @@ $ErrMsg = _('The stock locations could not be retrieved'); $DbgMsg = _('SQL used to retrieve the stock locations was') . ':'; -$StkLocsResult = DB_query('SELECT locationname,loccode - FROM locations',$db, $ErrMsg, $DbgMsg); +$StkLocsResult = DB_query("SELECT locationname,loccode + FROM locations",$db, $ErrMsg, $DbgMsg); while ($myrow=DB_fetch_row($StkLocsResult)){ if ($_SESSION['Items'.$identifier]->Location==$myrow[1]){ - echo '<option selected value="'.$myrow[1].'">'.$myrow[0]; + echo '<option selected value="' . $myrow[1] . '">' . $myrow[0] . '</option>'; } else { - echo '<option value="'.$myrow[1].'">'.$myrow[0]; + echo '<option value="'.$myrow[1].'">'.$myrow[0] . '</option>'; } } @@ -1031,75 +1044,68 @@ /* This field will control whether or not to display the company logo and address on the packlist */ - echo '<tr><td>' . _('Packlist Type') . ':</td><td><select name="DeliverBlind">'; - for ($p = 1; $p <= 2; $p++) { - echo '<option value=' . $p; - if ($p == $_SESSION['Items'.$identifier]->DeliverBlind) { - echo ' selected>'; - } else { - echo '>'; - } - switch ($p) { - case 2: - echo _('Hide Company Details/Logo'); - break; - default: - echo _('Show Company Details/Logo'); - break; - } - } + echo '<tr><td>' . _('Packlist Type') . ':</td> + <td><select name="DeliverBlind">'; + + if ($_SESSION['Items'.$identifier]->DeliverBlind ==2){ + echo '<option value="1">' . _('Show Company Details/Logo') . '</option>'; + echo '<option selected value="2">' . _('Hide Company Details/Logo') . '</option>'; + } else { + echo '<option selected value="1">' . _('Show Company Details/Logo') . '</option>'; + echo '<option value="2">' . _('Hide Company Details/Logo') . '</option>'; + } echo '</select></td></tr>'; if (isset($_SESSION['PrintedPackingSlip']) and $_SESSION['PrintedPackingSlip']==1){ echo '<tr> <td>'. _('Reprint packing slip') .':</td> - <td><select name="ReprintPackingSlip">'; - echo '<option value=0>' . _('Yes'); - echo '<option selected value=1>' . _('No'); + <td><select name="ReprintPackingSlip">'; + echo '<option value=0>' . _('Yes') . '</option>'; + echo '<option selected value=1>' . _('No') . '</option>'; echo '</select> '. _('Last printed') .': ' . ConvertSQLDate($_SESSION['DatePackingSlipPrinted']) . '</td></tr>'; - } else { - echo '<input type=hidden name="ReprintPackingSlip" value=0>'; - } echo '<tr><td>'. _('Charge Freight Cost inc tax') .':</td>'; -echo '<td><input type=text class=number size=10 maxlength=12 name="FreightCost" VALUE=' . $_SESSION['Items'.$identifier]->FreightCost . '></td>'; +echo '<td><input type=text class="number" size=10 maxlength=12 name="FreightCost" value="' . $_SESSION['Items'.$identifier]->FreightCost . '"></td>'; if ($_SESSION['DoFreightCalc']==true){ - echo '<td><input type=submit name="Update" VALUE="' . _('Recalc Freight Cost') . '"></td></tr>'; + echo '<td><input type=submit name="Update" value="' . _('Recalc Freight Cost') . '"></td></tr>'; } if ((!isset($_POST['ShipVia']) OR $_POST['ShipVia']=='') AND isset($_SESSION['Items'.$identifier]->ShipVia)){ $_POST['ShipVia'] = $_SESSION['Items'.$identifier]->ShipVia; } -echo '<tr><td>'. _('Freight/Shipper Method') .':</td><td><select name="ShipVia">'; +echo '<tr><td>'. _('Freight/Shipper Method') .':</td> + <td><select name="ShipVia">'; + $ErrMsg = _('The shipper details could not be retrieved'); $DbgMsg = _('SQL used to retrieve the shipper details was') . ':'; -$sql = 'SELECT shipper_id, shippername - FROM shippers'; + +$sql = "SELECT shipper_id, shippername FROM shippers"; $ShipperResults = DB_query($sql,$db,$ErrMsg,$DbgMsg); while ($myrow=DB_fetch_array($ShipperResults)){ if ($myrow['shipper_id']==$_POST['ShipVia']){ - echo '<option selected value=' . $myrow['shipper_id'] . '>' . $myrow['shippername']; + echo '<option selected value=' . $myrow['shipper_id'] . '>' . $myrow['shippername'] . '</option>'; }else { - echo '<option value=' . $myrow['shipper_id'] . '>' . $myrow['shippername']; + echo '<option value=' . $myrow['shipper_id'] . '>' . $myrow['shippername'] . '</option>'; } } echo '</select></td></tr>'; -echo '<tr><td>'. _('Quotation Only') .':</td><td><select name="Quotation">'; +echo '<tr><td>'. _('Quotation Only') .':</td> + <td><select name="Quotation">'; if ($_SESSION['Items'.$identifier]->Quotation==1){ - echo '<option selected value=1>' . _('Yes'); - echo '<option value=0>' . _('No'); + echo '<option selected value=1>' . _('Yes') . '</option>'; + echo '<option value=0>' . _('No') . '</option>'; } else { - echo '<option VALUE=1>' . _('Yes'); - echo '<option selected VALUE=0>' . _('No'); + echo '<option value=1>' . _('Yes') . '</option>'; + echo '<option selected value=0>' . _('No') . '</option>'; } echo '</select></td></tr>'; @@ -1110,9 +1116,9 @@ if ($_SESSION['ExistingOrder']==0){ echo '<br /><br /><input type=submit name="ProcessOrder" value="' . _('Place Order') . '">'; - echo '<br /><br /><input type=submit name="MakeRecurringOrder" VALUE="' . _('Create Recurring Order') . '">'; + echo '<br /><br /><input type=submit name="MakeRecurringOrder" value="' . _('Create Recurring Order') . '">'; } else { - echo '<br /><input type=submit name="ProcessOrder" VALUE="' . _('Commit Order Changes') . '">'; + echo '<br /><input type=submit name="ProcessOrder" value="' . _('Commit Order Changes') . '">'; } echo '</div></form>'; Modified: trunk/DiscountCategories.php =================================================================== --- trunk/DiscountCategories.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/DiscountCategories.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.10 $ */ + /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Discount Categories Maintenance'); @@ -15,7 +13,7 @@ $_POST['StockID']=$_POST['stockID']; } elseif (isset($_GET['StockID'])) { $_POST['StockID']=$_GET['StockID']; - $_POST['chooseoption']=1; + $_POST['ChooseOption']=1; $_POST['selectchoice']=1; } @@ -42,7 +40,7 @@ if ($InputError !=1) { $sql = "UPDATE stockmaster SET discountcategory='" . $_POST['DiscountCategory'] . "' - WHERE stockid='" . strtoupper($_POST['StockID']) . "'"; + WHERE stockid='" . strtoupper($_POST['StockID']) . "'"; $result = DB_query($sql,$db, _('The discount category') . ' ' . $_POST['DiscountCategory'] . ' ' . _('record for') . ' ' . strtoupper($_POST['StockID']) . ' ' . _('could not be updated because')); @@ -58,8 +56,8 @@ $sql="UPDATE stockmaster SET discountcategory='' WHERE stockid='" . trim(strtoupper($_GET['StockID'])) ."'"; $result = DB_query($sql,$db); prnMsg( _('The stock master record has been updated to no discount category'),'success'); - echo '<br>'; -} elseif (isset($_POST['submitcategory'])) { + echo '<br />'; +} elseif (isset($_POST['SubmitCategory'])) { $sql="UPDATE stockmaster SET discountcategory='".$_POST['DiscountCategory']."' WHERE categoryid='".$_POST['stockcategory']."'"; @@ -67,7 +65,7 @@ } if (isset($_POST['selectchoice'])) { - echo "<form name='update' method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form name="update" method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $sql = "SELECT DISTINCT discountcategory FROM stockmaster WHERE discountcategory <>''"; @@ -79,31 +77,37 @@ while ($myrow = DB_fetch_array($result)){ if ($myrow['discountcategory']==$_POST['DiscCat']){ - echo "<option selected value='" . $myrow['discountcategory'] . "'>" . $myrow['discountcategory']; + echo '<option selected value="' . $myrow['discountcategory'] . '">' . $myrow['discountcategory'] . '</option>'; } else { - echo "<option value='" . $myrow['discountcategory'] . "'>" . $myrow['discountcategory']; + echo '<option value="' . $myrow['discountcategory'] . '">' . $myrow['discountcategory'] . '</option>'; } echo '</option>'; } echo '</select></td>'; - echo '<td><input type="submit" name="select" value="'._('Select').'"></td></tr></table><br>'; + echo '<td><input type="submit" name="select" value="'._('Select').'"></td></tr></table><br />'; } - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<input type="hidden" name="chooseoption" value="'.$_POST['chooseoption'].'">'; + echo '<input type="hidden" name="ChooseOption" value="'.$_POST['ChooseOption'].'">'; echo '<input type="hidden" name="selectchoice" value="'.$_POST['selectchoice'].'">'; - if (isset($_POST['chooseoption']) and $_POST['chooseoption']==1) { - echo '<table class=selection><tr><td>'. _('Discount Category Code') .':</td><td>'; + if (isset($_POST['ChooseOption']) and $_POST['ChooseOption']==1) { + echo '<table class="selection"><tr><td>'. _('Discount Category Code') .':</td><td>'; if (isset($_POST['DiscCat'])) { - echo "<input type='text' name='DiscountCategory' maxlength=2 size=2 value='" . $_POST['DiscCat'] . - "'></td><td>"._('OR')."</td><td></td><td>"._('OR')."</td></tr>"; + echo '<input type="text" name="DiscountCategory" maxlength=2 size=2 value="' . $_POST['DiscCat'] .'"></td> + <td>'._('OR') . '</td> + <td></td> + <td>'._('OR').'</td> + </tr>'; } else { - echo "<input type='text' name='DiscountCategory' maxlength=2 size=2></td><td>". - _('OR')."</td><td></td><td>"._('OR')."</td></tr>"; + echo '<input type="text" name="DiscountCategory" maxlength=2 size=2></td> + <td>' ._('OR') . '</td> + <td></td> + <td>'._('OR') . '</td> + </tr>'; } if (!isset($_POST['StockID'])) { @@ -115,46 +119,53 @@ if (!isset($_POST['PartDesc'])) { $_POST['PartDesc']=''; } - echo '<tr><td>'. _('Enter Stock Code') .":</td><td><input type='text' name='StockID' size=20 maxlength=20 - value='".$_POST['StockID']."'></td> - <td>"._('Partial code').":</td><td><input type='text' name='PartID' size=10 maxlength=10 value='".$_POST['PartID']."'></td> - <td>"._('Partial description').":</td><td><input type='text' name='PartDesc' size=10 value='".$_POST['PartDesc']."' maxlength=10></td> - <td><input type='Submit' name='search' value='". _('Search') ."'></td></tr>"; + echo '<tr><td>'. _('Enter Stock Code') .':</td> + <td><input type="text" name="StockID" size=20 maxlength=20 value="' . $_POST['StockID'] . '"></td> + <td>'._('Partial code') . ':</td> + <td><input type="text" name="PartID" size=10 maxlength=10 value="' . $_POST['PartID'] . '"></td> + <td>' . _('Partial description') . ':</td> + <td><input type="text" name="PartDesc" size=10 value="' . $_POST['PartDesc'] .'" maxlength=10></td> + <td><input type="submit" name="search" value="' . _('Search') .'"></td></tr>'; echo '</table>'; - echo "<br><div class='centre'><input type='Submit' name='submit' value='". _('Update Item') ."'></div>"; + echo '<br /><div class="centre"><input type="submit" name="submit" value="'. _('Update Item') .'"></div>'; if (isset($_POST['search'])) { if ($_POST['PartID']!='' and $_POST['PartDesc']=='') - $sql="SELECT stockid, description FROM stockmaster WHERE stockid LIKE '%".$_POST['PartID']."%'"; + $sql="SELECT stockid, description FROM stockmaster + WHERE stockid " . LIKE . " '%".$_POST['PartID']."%'"; if ($_POST['PartID']=='' and $_POST['PartDesc']!='') - $sql="SELECT stockid, description FROM stockmaster WHERE description LIKE '%".$_POST['PartDesc']."%'"; + $sql="SELECT stockid, description FROM stockmaster + WHERE description " . LIKE . " '%".$_POST['PartDesc']."%'"; if ($_POST['PartID']!='' and $_POST['PartDesc']!='') - $sql="SELECT stockid, description FROM stockmaster WHERE stockid LIKE '%".$_POST['PartID']."%' and - description LIKE '%".$_POST['PartDesc']."%'"; + $sql="SELECT stockid, description FROM stockmaster + WHERE stockid " . LIKE . " '%".$_POST['PartID']."%' + AND description " . LIKE . " '%".$_POST['PartDesc']."%'"; $result=DB_query($sql,$db); if (!isset($_POST['stockID'])) { - echo _('Select a part code').':<br>'; + echo _('Select a part code').':<br />'; while ($myrow=DB_fetch_array($result)) { - echo '<input type="submit" name="stockID" value="'.$myrow['stockid'].'"><br>'; + echo '<input type="submit" name="stockID" value="'.$myrow['stockid'].'" /><br />'; } } } } else { - echo '<table class=selection><tr><td>'._('Assign discount category').'</td>'; - echo '<td><input type="text" name="DiscountCategory" maxlength=2 size=2></td>'; + echo '<table class=selection> + <tr> + <td>'._('Assign discount category').'</td>'; + echo '<td><input type="text" name="DiscountCategory" maxlength=2 size=2 /></td>'; echo '<td>'._('to all items in stock category').'</td>'; - $sql = 'SELECT categoryid, + $sql = "SELECT categoryid, categorydescription - FROM stockcategory'; + FROM stockcategory"; $result = DB_query($sql, $db); echo '<td><select name="stockcategory">'; while ($myrow=DB_fetch_array($result)) { echo '<option value="'.$myrow['categoryid'].'">'.$myrow['categorydescription'].'</option>'; } echo '</select></td></tr></table>'; - echo "<br><div class='centre'><input type='Submit' name='submitcategory' value='". _('Update Items') ."'></div>"; + echo '<br /><div class="centre"><input type="submit" name="SubmitCategory" value="'. _('Update Items') .'"></div>'; } echo '</form>'; @@ -182,10 +193,10 @@ $result = DB_query($sql,$db); - echo '<br><table class=selection>'; - echo "<tr> - <th>". _('Discount Category') ."</th> - <th>". _('Item') .'</th></tr>'; + echo '<br /><table class="selection">'; + echo '<tr> + <th>'. _('Discount Category') .'</th> + <th>'. _('Item') .'</th></tr>'; $k=0; //row colour counter @@ -197,16 +208,16 @@ echo '<tr class="OddTableRows">'; $k=1; } - $DeleteURL = $_SERVER['PHP_SELF'] . '?' . SID . '&Delete=yes&StockID=' . $myrow['stockid'] . '&DiscountCategory=' . $myrow['discountcategory']; + $DeleteURL = $_SERVER['PHP_SELF'] . '?Delete=yes&StockID=' . $myrow['stockid'] . '&DiscountCategory=' . $myrow['discountcategory']; - printf("<td>%s</td> - <td>%s - %s</td> - <td><a href='%s'>". _('Delete') .'</td> - </tr>', - $myrow['discountcategory'], - $myrow['stockid'], - $myrow['description'], - $DeleteURL); + printf('<td>%s</td> + <td>%s - %s</td> + <td><a href="%s">'. _('Delete') .'</td> + </tr>', + $myrow['discountcategory'], + $myrow['stockid'], + $myrow['description'], + $DeleteURL); } @@ -214,20 +225,22 @@ } else { /* $_POST['DiscCat'] ==0 */ - echo '</div><br>'; + echo '</div><br />'; prnMsg( _('There are currently no discount categories defined') . '. ' . _('Enter a two character abbreviation for the discount category and the stock code to which this category will apply to. Discount rules can then be applied to this discount category'),'info'); } } if (!isset($_POST['selectchoice'])) { - echo "<form method='post' name='choose' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" name="choose" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection>'; + echo '<table class="selection">'; echo '<tr><td>'._('Update discount category for').'</td>'; - echo '<td><select name="chooseoption" onChange="ReloadForm(choose.selectchoice)">'; + echo '<td><select name="ChooseOption" onChange="ReloadForm(choose.selectchoice)">'; echo '<option value="1">'._('a single stock item').'</option>'; echo '<option value="2">'._('a complete stock category').'</option>'; - echo '</select></td></tr></table><br>'; + echo '</select></td></tr> + </table> + <br />'; echo '<div class="centre"><input type="submit" name="selectchoice" value="'._('Select').'"></div>'; } Modified: trunk/DiscountMatrix.php =================================================================== --- trunk/DiscountMatrix.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/DiscountMatrix.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -1,13 +1,11 @@ <?php -/* $Revision: 1.9 $ */ + /* $Id$*/ -//$PageSecurity = 11; include('includes/session.inc'); $title = _('Discount Matrix Maintenance'); include('includes/header.inc'); - if (isset($Errors)) { unset($Errors); } @@ -64,7 +62,7 @@ $result = DB_query($sql,$db); prnMsg( _('The discount matrix record has been added'),'success'); - echo '<br>'; + echo '<br />'; unset($_POST['DiscountCategory']); unset($_POST['SalesType']); unset($_POST['QuantityBreak']); @@ -80,30 +78,30 @@ $result = DB_query($sql,$db); prnMsg( _('The discount matrix record has been deleted'),'success'); - echo '<br>'; + echo '<br />'; } -echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table class=selection>'; +echo '<table class="selection">'; -$sql = 'SELECT typeabbrev, +$sql = "SELECT typeabbrev, sales_type - FROM salestypes'; + FROM salestypes"; $result = DB_query($sql, $db); echo '<tr><td>' . _('Customer Price List') . ' (' . _('Sales Type') . '):</td><td>'; -echo "<select tabindex=1 name='SalesType'>"; +echo '<select tabindex=1 name="SalesType">'; while ($myrow = DB_fetch_array($result)){ if (isset($_POST['SalesType']) and $myrow['typeabbrev']==$_POST['SalesType']){ - echo "<option selected value='" . $myrow['typeabbrev'] . "'>" . $myrow['sales_type']; + echo '<option selected value="' . $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; } else { - echo "<option value='" . $myrow['typeabbrev'] . "'>" . $myrow['sales_type']; + echo '<option value="' . $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; } } @@ -118,29 +116,26 @@ while ($myrow = DB_fetch_array($result)){ if ($myrow['discountcategory']==$_POST['DiscCat']){ - echo "<option selected value='" . $myrow['discountcategory'] . "'>" . $myrow['discountcategory']; + echo '<option selected value="' . $myrow['discountcategory'] . '">' . $myrow['discountcategory'] . '</option>'; } else { - echo "<option value='" . $myrow['discountcategory'] . "'>" . $myrow['discountcategory']; + echo '<option value="' . $myrow['discountcategory'] . '">' . $myrow['discountcategory'] . '</option>'; } - echo '</option>'; } echo '</select></td>'; } else { echo '<input type="hidden" name="DiscountCategory" value="">'; } -echo '<tr><td>' . _('Quantity Break') . ":</td><td><input class='number' tabindex=3 " - . (in_array('QuantityBreak',$Errors) ? "class='inputerror'" : "") - ." type='text' name='QuantityBreak' size=10 maxlength=10></td></tr>"; +echo '<tr><td>' . _('Quantity Break') . '</td> + <td><input class="number" tabindex=3 ' . (in_array('QuantityBreak',$Errors) ? 'class="inputerror"' : '') .' type="text" name="QuantityBreak" size=10 maxlength=10></td></tr>'; -echo '<tr><td>' . _('Discount Rate') . " (%):</td><td><input class='number' tabindex=4 " - . (in_array('DiscountRate',$Errors) ? "class='inputerror'" : "") . - "type='text' name='DiscountRate' size=11 maxlength=14></td></tr>"; -echo '</table><br>'; +echo '<tr><td>' . _('Discount Rate') . ' (%):</td> + <td><input class="number" tabindex=4 ' . (in_array('DiscountRate',$Errors) ? 'class="inputerror"' : '') . 'type="text" name="DiscountRate" size=11 maxlength=14></td></tr>'; +echo '</table><br />'; -echo "<div class='centre'><input tabindex=5 type='submit' name='submit' value='" . _('Enter Information') . "'></div><br>"; +echo '<div class="centre"><input tabindex=5 type="submit" name="submit" value="' . _('Enter Information') . '"></div><br />'; -$sql = 'SELECT sales_type, +$sql = "SELECT sales_type, salestype, discountcategory, quantitybreak, @@ -149,15 +144,15 @@ ON discountmatrix.salestype=salestypes.typeabbrev ORDER BY salestype, discountcategory, - quantitybreak'; + quantitybreak"; $result = DB_query($sql,$db); echo '<table class=selection>'; -echo "<tr><th>" . _('Sales Type') . "</th> - <th>" . _('Discount Category') . "</th> - <th>" . _('Quantity Break') . "</th> - <th>" . _('Discount Rate') . ' %' . "</th></tr>"; +echo '<tr><th>' . _('Sales Type') . '</th> + <th>' . _('Discount Category') . '</th> + <th>' . _('Quantity Break') . '</th> + <th>' . _('Discount Rate') . ' %' . '</th></tr>'; $k=0; //row colour counter @@ -169,13 +164,13 @@ echo '<tr class="OddTableRows">'; $k=1; } - $DeleteURL = $_SERVER['PHP_SELF'] . '?' . SID . '&Delete=yes&SalesType=' . $myrow['salestype'] . '&DiscountCategory=' . $myrow['discountcategory'] . '&QuantityBreak=' . $myrow['quantitybreak']; + $DeleteURL = $_SERVER['PHP_SELF'] . '?Delete=yes&SalesType=' . $myrow['salestype'] . '&DiscountCategory=' . $myrow['discountcategory'] . '&QuantityBreak=' . $myrow['quantitybreak']; - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> - <td class='number'>%s</td> - <td class='number'>%s</td> - <td><a href='%s'>" . _('Delete') . '</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td><a href="%s">' . _('Delete') . '</td> </tr>', $myrow['sales_type'], $myrow['discountcategory'], Modified: trunk/EDIMessageFormat.php =================================================================== --- trunk/EDIMessageFormat.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/EDIMessageFormat.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -97,7 +97,7 @@ prnMsg($msg,'success'); } -echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p><table border=0 width=100%> @@ -124,12 +124,12 @@ $result = DB_query($sql,$db); echo '<table class=selection>'; - echo '<tr><th colspan=5><font size=3>' . _('Definition of') . ' ' . $MessageType . ' ' . _('for') . ' ' . $PartnerCode."</font></th></tr>"; - $TableHeader = "<tr> - <th>" . _('Section') . "</th> - <th>" . _('Sequence') . "</th> - <th>" . _('Format String') . "</th> - </tr>"; + echo '<tr><th colspan=5><font size=3>' . _('Definition of') . ' ' . $MessageType . ' ' . _('for') . ' ' . $PartnerCode.'</font></th></tr>'; + $TableHeader = '<tr> + <th>' . _('Section') . '</th> + <th>' . _('Sequence') . '</th> + <th>' . _('Format String') . '</th> + </tr>'; echo $TableHeader; $k=0; //row colour counter @@ -144,12 +144,12 @@ } - printf("<td>%s</td> + printf('<td>%s</td> <td class=number>%s</td> <td>%s</td> - <td><a href=\"%s&SelectedMessageLine=%s\">" . _('Edit') . "</a></td> - <td><a href=\"%s&delete=%s\">" . _('Delete') . "</a></td> - </tr>", + <td><a href="%s&SelectedMessageLine=%s">' . _('Edit') . '</a></td> + <td><a href="%s&delete=%s">' . _('Delete') . '</a></td> + </tr>', $myrow[1], $myrow[2], $myrow[3], @@ -161,8 +161,8 @@ } //END WHILE LIST LOOP echo '</table><p>'; if (DB_num_rows($result)==0){ - echo "<div class='centre'><input tabindex=1 type=submit name='NewEDIInvMsg' value='" . - _('Create New EDI Invoice Message From Default Template') . "'></div><br>"; + echo '<div class="centre"><input tabindex=1 type=submit name="NewEDIInvMsg" value="' . + _('Create New EDI Invoice Message From Default Template') . '"></div><br>'; } } //end of ifs SelectedLine is not set @@ -188,14 +188,14 @@ $_POST['SequenceNo'] = $myrow['sequenceno']; $_POST['LineText'] = $myrow['linetext']; - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . 'MessageType=INVOIC&PartnerCode=' . $myrow['partnercode'] . "'>" . _('Review Message Lines') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?MessageType=INVOIC&PartnerCode=' . $myrow['partnercode'] . '">' . _('Review Message Lines') . '</a></div>'; - echo "<input type=hidden name='SelectedMessageLine' VALUE='" . $SelectedMessageLine . "'>"; - echo "<input type=hidden name='MessageType' VALUE='" . $myrow['messagetype'] . "'>"; - echo "<input type=hidden name='PartnerCode' VALUE='" . $myrow['partnercode'] . "'>"; + echo '<input type=hidden name="SelectedMessageLine" VALUE="' . $SelectedMessageLine . '">'; + echo '<input type=hidden name="MessageType" VALUE="' . $myrow['messagetype'] . '">'; + echo '<input type=hidden name="PartnerCode" VALUE="' . $myrow['partnercode'] . '">'; } else { //end of if $SelectedMessageLine only do the else when a new record is being entered - echo "<input type=hidden name='MessageType' VALUE='" . $MessageType . "'>"; - echo "<input type=hidden name='PartnerCode' VALUE='" . $PartnerCode . "'>"; + echo '<input type=hidden name="MessageType" VALUE="' . $MessageType . '">'; + echo '<input type=hidden name="PartnerCode" VALUE="' . $PartnerCode . '">'; } echo '<table class=selection>'; @@ -209,20 +209,20 @@ echo '<select tabindex=2 name="Section">'; if ($_POST['Section']=='Heading') { - echo "<option selected VALUE='Heading'>" . _('Heading') . '</option>'; + echo '<option selected VALUE="Heading">' . _('Heading') . '</option>'; } else { - echo "<option value='Heading'>" . _('Heading') . '</option>'; + echo '<option value="Heading">' . _('Heading') . '</option>'; } if (isset($_POST['Section']) and $_POST['Section']=='Detail') { - echo "<option selected VALUE='Detail'>" . _('Detail') . '</option>'; + echo '<option selected VALUE="Detail">' . _('Detail') . '</option>'; } else { - echo "<option value='Detail'>" . _('Detail') . '</option>'; + echo '<option value="Detail">' . _('Detail') . '</option>'; } if (isset($_POST['Section']) and $_POST['Section']=='Summary') { - echo "<option selected VALUE='Summary'>" . _('Summary') . '</option>'; + echo '<option selected VALUE="Summary">' . _('Summary') . '</option>'; } else { - echo "<option value='Summary'>" . _('Summary') . '</option>'; + echo '<option value="Summary">' . _('Summary') . '</option>'; } echo '</select>'; @@ -234,20 +234,20 @@ echo '</td></tr>'; echo '<tr><td>Sequence Number:</td>'; -echo "<td><input tabindex=3 type=text name=SequenceNo size=3 maxlength=3 value=".$_POST['SequenceNo'].">"; -echo "</td></tr>"; -echo "<tr><td>" . _('Line Text') . ':' ."</td>"; -echo "<td>"; -echo "<input tabindex=4 type='Text' name='LineText' size=50 maxlength=50 VALUE=".$_POST['LineText'] .">"; -echo "</td></tr>"; -echo "</table><br>"; +echo '<td><input tabindex=3 type=text name=SequenceNo size=3 maxlength=3 value='.$_POST['SequenceNo'].'>'; +echo '</td></tr>'; +echo '<tr><td>' . _('Line Text') . ':' .'</td>'; +echo '<td>'; +echo '<input tabindex=4 type="Text" name="LineText" size=50 maxlength=50 VALUE='.$_POST['LineText'] .'>'; +echo '</td></tr>'; +echo '</table><br>'; if (isset($_GET['SelectedMessageLine'])) { - echo "<div class='centre'><input tabindex=5 type='submit' name='update' value='". _('Update Information'). "'></div>"; + echo '<div class="centre"><input tabindex=5 type="submit" name="update" value="'. _('Update Information'). '"></div>'; } else { - echo "<div class='centre'><input tabindex=5 type='submit' name='submit' value='". _('Enter Information'). "'></div>"; + echo '<div class="centre"><input tabindex=5 type="submit" name="submit" value="'. _('Enter Information'). '"></div>'; } -echo "</form>"; +echo '</form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/EmailCustTrans.php =================================================================== --- trunk/EmailCustTrans.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/EmailCustTrans.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -37,13 +37,13 @@ include ('includes/header.inc'); -echo "<form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "' method=post>"; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo "<input type=hidden name='TransNo' VALUE=" . $_GET['FromTransNo'] . ">"; -echo "<input type=hidden name='InvOrCredit' VALUE=" . $_GET['InvOrCredit'] . '>'; +echo '<input type=hidden name="TransNo" VALUE="' . $_GET['FromTransNo'] . '">'; +echo '<input type=hidden name="InvOrCredit" VALUE="' . $_GET['InvOrCredit'] . '>'; -echo '<p><table>'; +echo '<br /><table>'; $SQL = "SELECT email FROM custbranch INNER JOIN debtortrans @@ -62,11 +62,11 @@ $EmailAddress =''; } -echo '<tr><td>' . _('Email') . ' ' . $_GET['InvOrCredit'] . ' ' . _('number') . ' ' . $_GET['FromTransNo'] . ' ' . _('to') . ":</td> - <td><input type=TEXT name='EmailAddr' maxlength=60 size=60 VALUE='" . $EmailAddress . "'</td> - </table>"; +echo '<tr><td>' . _('Email') . ' ' . $_GET['InvOrCredit'] . ' ' . _('number') . ' ' . $_GET['FromTransNo'] . ' ' . _('to') . ':</td> + <td><input type=TEXT name="EmailAddr" maxlength=60 size=60 VALUE="' . $EmailAddress . '"></td> + </table>'; -echo "<br><div class='centre'><input type=submit name='DoIt' VALUE='" . _('OK') . "'>"; +echo '<br><div class="centre"><input type=submit name="DoIt" VALUE="' . _('OK') . '">'; echo '</div></form>'; include ('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/ExchangeRateTrend.php =================================================================== --- trunk/ExchangeRateTrend.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/ExchangeRateTrend.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -23,7 +23,7 @@ // SHOW OUR MAIN INPUT FORM // ************************ - echo "<form method='post' name=update action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" name=update action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<div class="centre"><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('View Currency Trend') . '" alt="" />' . ' ' . _('View Currency Trend') . '</p>'; @@ -40,9 +40,9 @@ while ($myrow=DB_fetch_array($result)) { if ($myrow['currabrev']!=$_SESSION['CompanyRecord']['currencydefault']){ if ( $CurrencyToShow==$myrow['currabrev'] ) { - echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['country'] . ' ' . $myrow['currency'] . ' (' . $myrow['currabrev'] . ')'; + echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['country'] . ' ' . $myrow['currency'] . ' (' . $myrow['currabrev'] . ')'. '</option>'; } else { - echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['country'] . ' ' . $myrow['currency'] . ' (' . $myrow['currabrev'] . ')'; + echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['country'] . ' ' . $myrow['currency'] . ' (' . $myrow['currabrev'] . ')'. '</option>'; } } } Modified: trunk/FixedAssetCategories.php =================================================================== --- trunk/FixedAssetCategories.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/FixedAssetCategories.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -154,7 +154,7 @@ FROM fixedassetcategories'; $result = DB_query($sql,$db); - echo "<br /><table class=selection>\n"; + echo '<br /><table class=selection>'; echo '<tr><th>' . _('Cat Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Cost GL') . '</th> @@ -172,15 +172,15 @@ echo '<tr class="OddTableRows">'; $k=1; } - printf("<td>%s</td> + 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><a href=\"%sSelectedCategory=%s\">" . _('Edit') . "</td> - <td><a href=\"%sSelectedCategory=%s&delete=yes\" onclick=\"return confirm('" . _('Are you sure you wish to delete this fixed asset category? Additional checks will be performed before actual deletion to ensure data integrity is not compromised.') . "');\">" . _('Delete') . "</td> - </tr>", + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td><a href="%sSelectedCategory=%s">' . _('Edit') . '</td> + <td><a href="%sSelectedCategory=%s&delete=yes" onclick="return confirm("' . _('Are you sure you wish to delete this fixed asset category? Additional checks will be performed before actual deletion to ensure data integrity is not compromised.') . '");">' . _('Delete') . '</td> + </tr>', $myrow['categoryid'], $myrow['categorydescription'], $myrow['costact'], @@ -199,7 +199,7 @@ //end of ifs and buts! if (isset($SelectedCategory)) { - echo "<br /><div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . ">" ._('Show All Fixed Asset Categories') . "</a></div>"; + echo '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' ._('Show All Fixed Asset Categories') . '</a></div>'; } echo '<form name="CategoryForm" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; @@ -273,11 +273,10 @@ while ($myrow = DB_fetch_array($BSAccountsResult)){ if (isset($_POST['CostAct']) and $myrow['accountcode']==$_POST['CostAct']) { - echo '<option selected value='; + echo '<option selected value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')</option>'; } else { - echo '<option value='; + echo '<option value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')</option>'; } - echo $myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')'; } //end while loop echo '</select></td></tr>'; @@ -286,11 +285,10 @@ while ($myrow = DB_fetch_array($PnLAccountsResult)) { if (isset($_POST['DepnAct']) and $myrow['accountcode']==$_POST['DepnAct']) { - echo '<option selected value='; + echo '<option selected value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')</option>'; } else { - echo '<option value='; + echo '<option value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')</option>'; } - echo $myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')</option>'; } //end while loop echo '</select></td></tr>'; @@ -298,11 +296,10 @@ echo '<tr><td>' . _('Profit or Loss on Disposal GL Code:') . '</td><td><select name="DisposalAct">'; while ($myrow = DB_fetch_array($PnLAccountsResult)) { if (isset($_POST['DisposalAct']) and $myrow['accountcode']==$_POST['DisposalAct']) { - echo '<option selected value='; + echo '<option selected value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } else { - echo '<option value='; + echo '<option value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } - echo $myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } //end while loop echo '</select></td></tr>'; @@ -313,11 +310,10 @@ while ($myrow = DB_fetch_array($BSAccountsResult)) { if (isset($_POST['AccumDepnAct']) and $myrow['accountcode']==$_POST['AccumDepnAct']) { - echo '<option selected value='; + echo '<option selected value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } else { - echo '<option value='; + echo '<option value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } - echo $myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } //end while loop Modified: trunk/GLAccountInquiry.php =================================================================== --- trunk/GLAccountInquiry.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/GLAccountInquiry.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -25,14 +25,14 @@ echo '<div class="page_help_text">' . _('Use the keyboard Shift key to select multiple periods') . '</div><br>'; -echo "<form method='POST' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; +echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; /*Dates in SQL format for the last day of last month*/ $DefaultPeriodDate = Date ('Y-m-d', Mktime(0,0,0,Date('m'),0,Date('Y'))); /*Show a form to allow input of criteria for TB to show */ -echo '<table class=selection><tr><td>'._('Account').":</td><td><select Name='Account'>"; +echo '<table class=selection><tr><td>'._('Account').':</td><td><select Name="Account">'; $sql = "SELECT accountcode, accountname FROM chartmaster ORDER BY accountcode"; $Account = DB_query($sql,$db); while ($myrow=DB_fetch_array($Account,$db)){ @@ -55,7 +55,7 @@ $result=DB_query($SQL,$db); echo '<option value=0>0 - '._('All tags'); while ($myrow=DB_fetch_array($result)){ - if (isset($_POST['tag']) and $_POST['tag']==$myrow["tagref"]){ + if (isset($_POST['tag']) and $_POST['tag']==$myrow['tagref']){ echo '<option selected value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']; } else { echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']; @@ -75,8 +75,8 @@ echo '<option value=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])); } } -echo "</select></td></tr><table>"; -echo "<p><div class='centre'><input type=submit name='Show' value='"._('Show Account Transactions')."'></div></form>"; +echo '</select></td></tr><table>'; +echo '<p><div class="centre"><input type=submit name="Show" value="'._('Show Account Transactions').'"></div></form>'; /* End of the Form rest of script is what happens if the show button is hit*/ @@ -148,16 +148,16 @@ echo '<br><table class=selection>'; echo '<tr><th colspan=8><b>' ._('Transactions for account').' '.$SelectedAccount. ' - '. $SelectedAccountName.'</b></th></tr>'; - $TableHeader = "<tr> - <th>" . _('Type') . "</th> - <th>" . _('Number') . "</th> - <th>" . _('Date') . "</th> - <th>" . _('Debit') . "</th> - <th>" . _('Credit') . "</th> - <th>" . _('Narrative') . "</th> - <th>" . _('Balance') . "</th> - <th>" . _('Tag') . "</th> - </tr>"; + $TableHeader = '<tr> + <th>' . _('Type') . '</th> + <th>' . _('Number') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Debit') . '</th> + <th>' . _('Credit') . '</th> + <th>' . _('Narrative') . '</th> + <th>' . _('Balance') . '</th> + <th>' . _('Tag') . '</th> + </tr>'; echo $TableHeader; @@ -179,15 +179,15 @@ $RunningTotal =$ChartDetailRow['bfwd']; if ($RunningTotal < 0 ){ //its a credit balance b/fwd - echo "<tr bgcolor='#FDFEEF'> - <td colspan=3><b>" . _('Brought Forward Balance') . '</b><td> + echo '<tr bgcolor="#FDFEEF"> + <td colspan=3><b>' . _('Brought Forward Balance') . '</b><td> </td></td> <td class=number><b>' . number_format(-$RunningTotal,2) . '</b></td> <td></td> </tr>'; } else { //its a debit balance b/fwd - echo "<tr bgcolor='#FDFEEF'> - <td colspan=3><b>" . _('Brought Forward Balance') . '</b></td> + echo '<tr bgcolor="#FDFEEF"> + <td colspan=3><b>' . _('Brought Forward Balance') . '</b></td> <td class=number><b>' . number_format($RunningTotal,2) . '</b></td> <td colspan=2></td> </tr>'; @@ -215,8 +215,8 @@ $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); $ChartDetailRow = DB_fetch_array($ChartDetailsResult); - echo "<tr bgcolor='#FDFEEF'> - <td colspan=3><b>" . _('Total for period') . ' ' . $PeriodNo . '</b></td>'; + echo '<tr bgcolor="#FDFEEF"> + <td colspan=3><b>' . _('Total for period') . ' ' . $PeriodNo . '</b></td>'; if ($PeriodTotal < 0 ){ //its a credit balance b/fwd if ($PandLAccount==True) { $RunningTotal = 0; @@ -271,15 +271,15 @@ if ($tagrow['tagdescription']=='') { $tagrow['tagdescription']=_('None'); } - printf("<td>%s</td> - <td class=number><a href='%s'>%s</a></td> + printf('<td>%s</td> + <td class=number><a href="%s">%s</a></td> <td>%s</td> <td class=number>%s</td> <td class=number>%s</td> <td>%s</td> <td class=number><b>%s</b></td> <td>%s</td> - </tr>", + </tr>', $myrow['typename'], $URL_to_TransDetail, $myrow['typeno'], @@ -292,7 +292,7 @@ } - echo "<tr bgcolor='#FDFEEF'><td colspan=3><b>"; + echo '<tr bgcolor="#FDFEEF"><td colspan=3><b>'; if ($PandLAccount==True){ echo _('Total Period Movement'); } else { /*its a balance sheet account*/ Modified: trunk/GLBalanceSheet.php =================================================================== --- trunk/GLBalanceSheet.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/GLBalanceSheet.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -24,9 +24,9 @@ . _('The balance sheet has three parts: assets, liabilities and ownership equity. The main categories of assets are listed first and are followed by the liabilities. The difference between the assets and the liabilities is known as equity or the net assets or the net worth or capital of the company and according to the accounting equation, net worth must equal assets minus liabilities.') . '<br>' . _('webERP is an "accrual" based system (not a "cash based" system). Accrual systems include items when they are invoiced to the customer, and when expenses are owed based on the supplier invoice date.') . '</div>'; - echo "<form method='POST' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p><table class="selection"><tr><td>'._('Select the balance date').":</td><td><select Name='BalancePeriodEnd'>"; + echo '<p><table class="selection"><tr><td>'._('Select the balance date').':</td><td><select Name="BalancePeriodEnd">'; $periodno=GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); $sql = "SELECT lastdate_in_period FROM periods WHERE periodno='".$periodno . "'"; @@ -47,15 +47,15 @@ echo '</select></td></tr>'; - echo '<tr><td>'._('Detail Or Summary').":</td><td><select Name='Detail'>"; - echo "<option selected VALUE='Summary'>"._('Summary'); - echo "<option selected VALUE='Detailed'>"._('All Accounts'); + echo '<tr><td>'._('Detail Or Summary').':</td><td><select Name="Detail">'; + echo '<option selected VALUE="Summary">'._('Summary') . '</option>'; + echo '<option selected VALUE="Detailed">'._('All Accounts') . '</option>'; echo '</select></td></tr>'; echo '</table>'; - echo "<br><div class='centre'><input type=submit Name='ShowBalanceSheet' Value='"._('Show on Screen (HTML)')."'</div>"; - echo "<br><div class='centre'><input type=submit Name='PrintPDF' Value='"._('Produce PDF Report')."'></div>"; + echo '<br><div class="centre"><input type=submit Name="ShowBalanceSheet" Value="'._('Show on Screen (HTML)').'"></div>'; + echo '<br><div class="centre"><input type=submit Name="PrintPDF" Value="'._('Produce PDF Report').'"></div>'; /*Now do the posting while the user is thinking about the period to select */ include ('includes/GLPostings.inc'); @@ -301,9 +301,9 @@ exit; } else { include('includes/header.inc'); - echo "<form method='POST' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo "<input type=hidden name='BalancePeriodEnd' VALUE=" . $_POST['BalancePeriodEnd'] . '>'; + echo '<input type=hidden name="BalancePeriodEnd" VALUE="' . $_POST['BalancePeriodEnd'] . '">'; $RetainedEarningsAct = $_SESSION['CompanyRecord']['retainedearnings']; @@ -354,17 +354,17 @@ _('Balance Sheet as at') . ' ' . $BalanceDate .'</b></font></div></th></tr>'; if ($_POST['Detail']=='Detailed'){ - $TableHeader = "<tr> - <th>"._('Account')."</td> - <th>"._('Account Name')."</td> + $TableHeader = '<tr> + <th>'._('Account').'</td> + <th>'._('Account Name').'</td> <th colspan=2>$BalanceDate</th> - <th colspan=2>"._('Last Year').'</th> + <th colspan=2>'._('Last Year').'</th> </tr>'; } else { /*summary */ - $TableHeader = "<tr> + $TableHeader = '<tr> <th colspan=2></th> <th colspan=2>$BalanceDate</th> - <th colspan=2>"._('Last Year').'</th> + <th colspan=2>'._('Last Year').'</th> </tr>'; } @@ -533,7 +533,7 @@ $k++; } - $ActEnquiryURL = "<a href='$rootpath/GLAccountInquiry.php?" . SID . "Period=" . $_POST['BalancePeriodEnd'] . '&Account=' . $myrow['accountcode'] . "'>" . $myrow['accountcode'] . '<a>'; + $ActEnquiryURL = '<a href="' . $rootpath . '/GLAccountInquiry.php?Period=' . $_POST['BalancePeriodEnd'] . '&Account=' . $myrow['accountcode'] . '">' . $myrow['accountcode'] . '</a>'; $PrintString = '<td>%s</td> <td>%s</td> @@ -658,7 +658,7 @@ </tr>'; echo '</table>'; - echo "<br><div class='centre'><input type=submit Name='SelectADifferentPeriod' Value='"._('Select A Different Balance Date')."'></div>"; + echo '<br><div class="centre"><input type=submit Name="SelectADifferentPeriod" Value="'._('Select A Different Balance Date').'"></div>'; } echo '</form>'; Modified: trunk/GLBudgets.php =================================================================== --- trunk/GLBudgets.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/GLBudgets.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -24,7 +24,7 @@ prnMsg(_('Budget updated successfully'), 'success'); } -//If an account hasn't been selected then select one here. +//If an account has not been selected then select one here. echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="selectaccount">'; echo '<input type="hidden" name="F... [truncated message content] |
From: <dai...@us...> - 2011-04-19 10:18:58
|
Revision: 4555 http://web-erp.svn.sourceforge.net/web-erp/?rev=4555&view=rev Author: daintree Date: 2011-04-19 10:18:49 +0000 (Tue, 19 Apr 2011) Log Message: ----------- more quoting xhtml sql Modified Paths: -------------- trunk/DebtorsAtPeriodEnd.php trunk/DeliveryDetails.php trunk/DiscountCategories.php trunk/DiscountMatrix.php trunk/EDIMessageFormat.php trunk/EmailCustTrans.php trunk/ExchangeRateTrend.php trunk/FixedAssetCategories.php trunk/GLAccountInquiry.php trunk/GLBalanceSheet.php trunk/GLBudgets.php trunk/GLTags.php trunk/GLTrialBalance.php trunk/GoodsReceived.php trunk/InventoryQuantities.php trunk/InventoryValuation.php trunk/Locations.php trunk/MRPReschedules.php trunk/OutstandingGRNs.php trunk/geo_displaymap_customers.php trunk/geo_displaymap_suppliers.php trunk/includes/ConnectDB_mysqli.inc trunk/includes/PDFInventoryValnPageHeader.inc trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/sql/mysql/upgrade3.11.1-4.00.sql trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/DebtorsAtPeriodEnd.php =================================================================== --- trunk/DebtorsAtPeriodEnd.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/DebtorsAtPeriodEnd.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -1,9 +1,7 @@ <?php -//$PageSecurity = 2; /* $Id$*/ -/* $Revision: 1.16 $ */ include('includes/session.inc'); if (isset($_POST['PrintPDF']) @@ -58,9 +56,9 @@ $title = _('Customer Balances') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg(_('The customer details could not be retrieved by the SQL because') . DB_error_msg($db),'error'); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$SQL"; + echo '<br />' . $SQL; } include('includes/footer.inc'); exit; @@ -70,7 +68,7 @@ $title = _('Customer Balances') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg(_('The customer details listing has no clients to report on'),'warn'); - echo "<br><a href='".$rootpath."'/index.php?.'" . SID . "'>" . _('Back to the menu') . "</a>"; + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; } @@ -115,22 +113,10 @@ $LeftOvers = $pdf->addTextWrap(50,$YPos,160,$FontSize,_('Total balances'),'left'); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); - /* UldisN - $buf = $pdf->output(); - $len = strlen($buf); + + $pdf->OutputD($_SESSION['DatabaseName'] . '_DebtorBals_' . date('Y-m-d').'.pdf'); + $pdf->__destruct(); - header('Content-type: application/pdf'); - header("Content-Length: ".$len); - header('Content-Disposition: inline; filename=DebtorBals.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->stream(); - */ - $pdf->OutputD($_SESSION['DatabaseName'] . '_DebtorBals_' . date('Y-m-d').'.pdf');//UldisN - $pdf->__destruct(); //UldisN - } else { /*The option to print PDF was not hit */ $title=_('Debtor Balances'); @@ -142,29 +128,33 @@ /*if $FromCriteria is not set then show a form to allow input */ - echo '<form action=' . $_SERVER['PHP_SELF'] . " method='POST'><table class=selection>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('From Customer Code') .":</font></td><td><input tabindex=1 Type=text maxlength=6 size=7 name=FromCriteria value='1'></td></tr>"; - echo '<tr><td>' . _('To Customer Code') . ":</td><td><input tabindex=2 Type=text maxlength=6 size=7 name=ToCriteria value='zzzzzz'></td></tr>"; + echo '<tr><td>' . _('From Customer Code') .':</font></td> + <td><input tabindex=1 Type=text maxlength=6 size=7 name="FromCriteria" value="1"></td> + </tr>'; + echo '<tr><td>' . _('To Customer Code') . ':</td> + <td><input tabindex=2 type="text" maxlength=6 size=7 name="ToCriteria" value="zzzzzz"></td></tr>'; - echo '<tr><td>' . _('Balances As At') . ":</td><td><select tabindex=3 Name='PeriodEnd'>"; + echo '<tr><td>' . _('Balances As At') . ':</td> + <td><select tabindex=3 name="PeriodEnd">'; - $sql = 'SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC'; + $sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC"; $Periods = DB_query($sql,$db,_('Could not retrieve period data because'),_('The SQL that failed to get the period data was')); while ($myrow = DB_fetch_array($Periods,$db)){ - echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } } echo '</select></td></tr>'; + echo '</table> + <br /><div class="centre"><input tabindex=5 type=submit name="PrintPDF" value="' . _('Print PDF') . '"></div>'; - - echo "</table><br><div class='centre'><input tabindex=5 type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'></div>"; - include('includes/footer.inc'); } /*end of else not PrintPDF */ Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/DeliveryDetails.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -10,7 +10,6 @@ /* Session started in header.inc for password checking the session will contain the details of the order from the Cart class object. The details of the order come from SelectOrderItems.php */ -//$PageSecurity=1; include('includes/session.inc'); $title = _('Order Delivery Details'); include('includes/header.inc'); @@ -644,35 +643,35 @@ WHERE orderno='" .$_SESSION['ExistingOrder'] . "'", $db,$ErrMsg,$DbgMsg,true); $ErrMsg = _('Could not insert the contract bill of materials'); $InsContractBOM = DB_query("INSERT INTO bom (parent, - component, - workcentreadded, - loccode, - effectiveafter, - effectiveto) - SELECT contractref, - stockid, - workcentreadded, - '" . $_SESSION['Items'.$identifier]->Location ."', - '" . Date('Y-m-d') . "', - '2037-12-31' - FROM contractbom - WHERE contractref='" . $ContractRow['contractref'] . "'",$db,$ErrMsg,$DbgMsg); + component, + workcentreadded, + loccode, + effectiveafter, + effectiveto) + SELECT contractref, + stockid, + workcentreadded, + '" . $_SESSION['Items'.$identifier]->Location ."', + '" . Date('Y-m-d') . "', + '2037-12-31' + FROM contractbom + WHERE contractref='" . $ContractRow['contractref'] . "'",$db,$ErrMsg,$DbgMsg); $ErrMsg = _('Unable to insert a new work order for the sales order item'); $InsWOResult = DB_query("INSERT INTO workorders (wo, - loccode, - requiredby, - startdate) - VALUES ('" . $WONo . "', - '" . $_SESSION['Items'.$identifier]->Location ."', - '" . $ContractRow['requireddate'] . "', - '" . Date('Y-m-d'). "')", - $db,$ErrMsg,$DbgMsg); + loccode, + requiredby, + startdate) + VALUES ('" . $WONo . "', + '" . $_SESSION['Items'.$identifier]->Location ."', + '" . $ContractRow['requireddate'] . "', + '" . Date('Y-m-d'). "')", + $db,$ErrMsg,$DbgMsg); //Need to get the latest BOM to roll up cost but also add the contract other requirements $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*contractbom.quantity) AS cost - FROM stockmaster INNER JOIN contractbom - ON stockmaster.stockid=contractbom.stockid - WHERE contractbom.contractref='" . $ContractRow['contractref'] . "'", + FROM stockmaster INNER JOIN contractbom + ON stockmaster.stockid=contractbom.stockid + WHERE contractbom.contractref='" . $ContractRow['contractref'] . "'", $db); $CostRow = DB_fetch_row($CostResult); if (is_null($CostRow[0]) OR $CostRow[0]==0){ @@ -682,8 +681,8 @@ $Cost = $CostRow[0]; //cost of contract BOM } $CostResult = DB_query("SELECT SUM(costperunit*quantity) AS cost - FROM contractreqts - WHERE contractreqts.contractref='" . $ContractRow['contractref'] . "'", + FROM contractreqts + WHERE contractreqts.contractref='" . $ContractRow['contractref'] . "'", $db); $CostRow = DB_fetch_row($CostResult); //add other requirements cost to cost of contract BOM @@ -750,13 +749,13 @@ } $LineItemsSQL = "UPDATE salesorderdetails SET unitprice='" . $StockItem->Price . "', - quantity='" . $StockItem->Quantity . "', - discountpercent='" . floatval($StockItem->DiscountPercent) . "', - completed='" . $Completed . "', - poline='" . $StockItem->POLine . "', - itemdue='" . FormatDateForSQL($StockItem->ItemDue) . "' - WHERE salesorderdetails.orderno='" . $_SESSION['ExistingOrder'] . "' - AND salesorderdetails.orderlineno='" . $StockItem->LineNumber . "'"; + quantity='" . $StockItem->Quantity . "', + discountpercent='" . floatval($StockItem->DiscountPercent) . "', + completed='" . $Completed . "', + poline='" . $StockItem->POLine . "', + itemdue='" . FormatDateForSQL($StockItem->ItemDue) . "' + WHERE salesorderdetails.orderno='" . $_SESSION['ExistingOrder'] . "' + AND salesorderdetails.orderlineno='" . $StockItem->LineNumber . "'"; $DbgMsg = _('The SQL that was used to modify the order line and failed was'); $ErrMsg = _('The updated order line cannot be modified because'); @@ -771,10 +770,24 @@ prnMsg(_('Order Number') .' ' . $_SESSION['ExistingOrder'] . ' ' . _('has been updated'),'success'); - echo '<br /><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip - pre-printed stationery') .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td><td><a href="' . $rootpath .'/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $_SESSION['ExistingOrder'] . '">'. _('Confirm Order Delivery Quantities and Produce Invoice') .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td><td><a href="' . $rootpath .'/SelectSalesOrder.php?identifier='.$identifier . '">'. _('Select A Different Order') .'</a></td></tr></table>'; + echo '<br /> + <table class="selection"> + <tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip - pre-printed stationery') .'</a></td> + </tr>'; + echo '<tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td> + <td><a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td> + </tr>'; + echo '<tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td> + <td><a href="' . $rootpath .'/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $_SESSION['ExistingOrder'] . '">'. _('Confirm Order Delivery Quantities and Produce Invoice') .'</a></td> + </tr>'; + echo '<tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td> + <td><a href="' . $rootpath .'/SelectSalesOrder.php?identifier='.$identifier . '">'. _('Select A Different Order') .'</a></td> + </tr> + </table>'; include('includes/footer.inc'); exit; } @@ -786,7 +799,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Delivery') . '" alt="" />' . ' ' . _('Delivery Details'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Customer Code') . ' :<b> ' . $_SESSION['Items'.$identifier]->DebtorNo; echo '</b> ' . _('Customer Name') . ' :<b> ' . $_SESSION['Items'.$identifier]->CustomerName . '</p>'; -//echo '<font size=4><b>'. _('Customer') .' : ' . $_SESSION['Items'.$identifier]->CustomerName . '</b></font>'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -942,14 +955,14 @@ $ErrMsg = _('The stock locations could not be retrieved'); $DbgMsg = _('SQL used to retrieve the stock locations was') . ':'; -$StkLocsResult = DB_query('SELECT locationname,loccode - FROM locations',$db, $ErrMsg, $DbgMsg); +$StkLocsResult = DB_query("SELECT locationname,loccode + FROM locations",$db, $ErrMsg, $DbgMsg); while ($myrow=DB_fetch_row($StkLocsResult)){ if ($_SESSION['Items'.$identifier]->Location==$myrow[1]){ - echo '<option selected value="'.$myrow[1].'">'.$myrow[0]; + echo '<option selected value="' . $myrow[1] . '">' . $myrow[0] . '</option>'; } else { - echo '<option value="'.$myrow[1].'">'.$myrow[0]; + echo '<option value="'.$myrow[1].'">'.$myrow[0] . '</option>'; } } @@ -1031,75 +1044,68 @@ /* This field will control whether or not to display the company logo and address on the packlist */ - echo '<tr><td>' . _('Packlist Type') . ':</td><td><select name="DeliverBlind">'; - for ($p = 1; $p <= 2; $p++) { - echo '<option value=' . $p; - if ($p == $_SESSION['Items'.$identifier]->DeliverBlind) { - echo ' selected>'; - } else { - echo '>'; - } - switch ($p) { - case 2: - echo _('Hide Company Details/Logo'); - break; - default: - echo _('Show Company Details/Logo'); - break; - } - } + echo '<tr><td>' . _('Packlist Type') . ':</td> + <td><select name="DeliverBlind">'; + + if ($_SESSION['Items'.$identifier]->DeliverBlind ==2){ + echo '<option value="1">' . _('Show Company Details/Logo') . '</option>'; + echo '<option selected value="2">' . _('Hide Company Details/Logo') . '</option>'; + } else { + echo '<option selected value="1">' . _('Show Company Details/Logo') . '</option>'; + echo '<option value="2">' . _('Hide Company Details/Logo') . '</option>'; + } echo '</select></td></tr>'; if (isset($_SESSION['PrintedPackingSlip']) and $_SESSION['PrintedPackingSlip']==1){ echo '<tr> <td>'. _('Reprint packing slip') .':</td> - <td><select name="ReprintPackingSlip">'; - echo '<option value=0>' . _('Yes'); - echo '<option selected value=1>' . _('No'); + <td><select name="ReprintPackingSlip">'; + echo '<option value=0>' . _('Yes') . '</option>'; + echo '<option selected value=1>' . _('No') . '</option>'; echo '</select> '. _('Last printed') .': ' . ConvertSQLDate($_SESSION['DatePackingSlipPrinted']) . '</td></tr>'; - } else { - echo '<input type=hidden name="ReprintPackingSlip" value=0>'; - } echo '<tr><td>'. _('Charge Freight Cost inc tax') .':</td>'; -echo '<td><input type=text class=number size=10 maxlength=12 name="FreightCost" VALUE=' . $_SESSION['Items'.$identifier]->FreightCost . '></td>'; +echo '<td><input type=text class="number" size=10 maxlength=12 name="FreightCost" value="' . $_SESSION['Items'.$identifier]->FreightCost . '"></td>'; if ($_SESSION['DoFreightCalc']==true){ - echo '<td><input type=submit name="Update" VALUE="' . _('Recalc Freight Cost') . '"></td></tr>'; + echo '<td><input type=submit name="Update" value="' . _('Recalc Freight Cost') . '"></td></tr>'; } if ((!isset($_POST['ShipVia']) OR $_POST['ShipVia']=='') AND isset($_SESSION['Items'.$identifier]->ShipVia)){ $_POST['ShipVia'] = $_SESSION['Items'.$identifier]->ShipVia; } -echo '<tr><td>'. _('Freight/Shipper Method') .':</td><td><select name="ShipVia">'; +echo '<tr><td>'. _('Freight/Shipper Method') .':</td> + <td><select name="ShipVia">'; + $ErrMsg = _('The shipper details could not be retrieved'); $DbgMsg = _('SQL used to retrieve the shipper details was') . ':'; -$sql = 'SELECT shipper_id, shippername - FROM shippers'; + +$sql = "SELECT shipper_id, shippername FROM shippers"; $ShipperResults = DB_query($sql,$db,$ErrMsg,$DbgMsg); while ($myrow=DB_fetch_array($ShipperResults)){ if ($myrow['shipper_id']==$_POST['ShipVia']){ - echo '<option selected value=' . $myrow['shipper_id'] . '>' . $myrow['shippername']; + echo '<option selected value=' . $myrow['shipper_id'] . '>' . $myrow['shippername'] . '</option>'; }else { - echo '<option value=' . $myrow['shipper_id'] . '>' . $myrow['shippername']; + echo '<option value=' . $myrow['shipper_id'] . '>' . $myrow['shippername'] . '</option>'; } } echo '</select></td></tr>'; -echo '<tr><td>'. _('Quotation Only') .':</td><td><select name="Quotation">'; +echo '<tr><td>'. _('Quotation Only') .':</td> + <td><select name="Quotation">'; if ($_SESSION['Items'.$identifier]->Quotation==1){ - echo '<option selected value=1>' . _('Yes'); - echo '<option value=0>' . _('No'); + echo '<option selected value=1>' . _('Yes') . '</option>'; + echo '<option value=0>' . _('No') . '</option>'; } else { - echo '<option VALUE=1>' . _('Yes'); - echo '<option selected VALUE=0>' . _('No'); + echo '<option value=1>' . _('Yes') . '</option>'; + echo '<option selected value=0>' . _('No') . '</option>'; } echo '</select></td></tr>'; @@ -1110,9 +1116,9 @@ if ($_SESSION['ExistingOrder']==0){ echo '<br /><br /><input type=submit name="ProcessOrder" value="' . _('Place Order') . '">'; - echo '<br /><br /><input type=submit name="MakeRecurringOrder" VALUE="' . _('Create Recurring Order') . '">'; + echo '<br /><br /><input type=submit name="MakeRecurringOrder" value="' . _('Create Recurring Order') . '">'; } else { - echo '<br /><input type=submit name="ProcessOrder" VALUE="' . _('Commit Order Changes') . '">'; + echo '<br /><input type=submit name="ProcessOrder" value="' . _('Commit Order Changes') . '">'; } echo '</div></form>'; Modified: trunk/DiscountCategories.php =================================================================== --- trunk/DiscountCategories.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/DiscountCategories.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.10 $ */ + /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Discount Categories Maintenance'); @@ -15,7 +13,7 @@ $_POST['StockID']=$_POST['stockID']; } elseif (isset($_GET['StockID'])) { $_POST['StockID']=$_GET['StockID']; - $_POST['chooseoption']=1; + $_POST['ChooseOption']=1; $_POST['selectchoice']=1; } @@ -42,7 +40,7 @@ if ($InputError !=1) { $sql = "UPDATE stockmaster SET discountcategory='" . $_POST['DiscountCategory'] . "' - WHERE stockid='" . strtoupper($_POST['StockID']) . "'"; + WHERE stockid='" . strtoupper($_POST['StockID']) . "'"; $result = DB_query($sql,$db, _('The discount category') . ' ' . $_POST['DiscountCategory'] . ' ' . _('record for') . ' ' . strtoupper($_POST['StockID']) . ' ' . _('could not be updated because')); @@ -58,8 +56,8 @@ $sql="UPDATE stockmaster SET discountcategory='' WHERE stockid='" . trim(strtoupper($_GET['StockID'])) ."'"; $result = DB_query($sql,$db); prnMsg( _('The stock master record has been updated to no discount category'),'success'); - echo '<br>'; -} elseif (isset($_POST['submitcategory'])) { + echo '<br />'; +} elseif (isset($_POST['SubmitCategory'])) { $sql="UPDATE stockmaster SET discountcategory='".$_POST['DiscountCategory']."' WHERE categoryid='".$_POST['stockcategory']."'"; @@ -67,7 +65,7 @@ } if (isset($_POST['selectchoice'])) { - echo "<form name='update' method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form name="update" method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $sql = "SELECT DISTINCT discountcategory FROM stockmaster WHERE discountcategory <>''"; @@ -79,31 +77,37 @@ while ($myrow = DB_fetch_array($result)){ if ($myrow['discountcategory']==$_POST['DiscCat']){ - echo "<option selected value='" . $myrow['discountcategory'] . "'>" . $myrow['discountcategory']; + echo '<option selected value="' . $myrow['discountcategory'] . '">' . $myrow['discountcategory'] . '</option>'; } else { - echo "<option value='" . $myrow['discountcategory'] . "'>" . $myrow['discountcategory']; + echo '<option value="' . $myrow['discountcategory'] . '">' . $myrow['discountcategory'] . '</option>'; } echo '</option>'; } echo '</select></td>'; - echo '<td><input type="submit" name="select" value="'._('Select').'"></td></tr></table><br>'; + echo '<td><input type="submit" name="select" value="'._('Select').'"></td></tr></table><br />'; } - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<input type="hidden" name="chooseoption" value="'.$_POST['chooseoption'].'">'; + echo '<input type="hidden" name="ChooseOption" value="'.$_POST['ChooseOption'].'">'; echo '<input type="hidden" name="selectchoice" value="'.$_POST['selectchoice'].'">'; - if (isset($_POST['chooseoption']) and $_POST['chooseoption']==1) { - echo '<table class=selection><tr><td>'. _('Discount Category Code') .':</td><td>'; + if (isset($_POST['ChooseOption']) and $_POST['ChooseOption']==1) { + echo '<table class="selection"><tr><td>'. _('Discount Category Code') .':</td><td>'; if (isset($_POST['DiscCat'])) { - echo "<input type='text' name='DiscountCategory' maxlength=2 size=2 value='" . $_POST['DiscCat'] . - "'></td><td>"._('OR')."</td><td></td><td>"._('OR')."</td></tr>"; + echo '<input type="text" name="DiscountCategory" maxlength=2 size=2 value="' . $_POST['DiscCat'] .'"></td> + <td>'._('OR') . '</td> + <td></td> + <td>'._('OR').'</td> + </tr>'; } else { - echo "<input type='text' name='DiscountCategory' maxlength=2 size=2></td><td>". - _('OR')."</td><td></td><td>"._('OR')."</td></tr>"; + echo '<input type="text" name="DiscountCategory" maxlength=2 size=2></td> + <td>' ._('OR') . '</td> + <td></td> + <td>'._('OR') . '</td> + </tr>'; } if (!isset($_POST['StockID'])) { @@ -115,46 +119,53 @@ if (!isset($_POST['PartDesc'])) { $_POST['PartDesc']=''; } - echo '<tr><td>'. _('Enter Stock Code') .":</td><td><input type='text' name='StockID' size=20 maxlength=20 - value='".$_POST['StockID']."'></td> - <td>"._('Partial code').":</td><td><input type='text' name='PartID' size=10 maxlength=10 value='".$_POST['PartID']."'></td> - <td>"._('Partial description').":</td><td><input type='text' name='PartDesc' size=10 value='".$_POST['PartDesc']."' maxlength=10></td> - <td><input type='Submit' name='search' value='". _('Search') ."'></td></tr>"; + echo '<tr><td>'. _('Enter Stock Code') .':</td> + <td><input type="text" name="StockID" size=20 maxlength=20 value="' . $_POST['StockID'] . '"></td> + <td>'._('Partial code') . ':</td> + <td><input type="text" name="PartID" size=10 maxlength=10 value="' . $_POST['PartID'] . '"></td> + <td>' . _('Partial description') . ':</td> + <td><input type="text" name="PartDesc" size=10 value="' . $_POST['PartDesc'] .'" maxlength=10></td> + <td><input type="submit" name="search" value="' . _('Search') .'"></td></tr>'; echo '</table>'; - echo "<br><div class='centre'><input type='Submit' name='submit' value='". _('Update Item') ."'></div>"; + echo '<br /><div class="centre"><input type="submit" name="submit" value="'. _('Update Item') .'"></div>'; if (isset($_POST['search'])) { if ($_POST['PartID']!='' and $_POST['PartDesc']=='') - $sql="SELECT stockid, description FROM stockmaster WHERE stockid LIKE '%".$_POST['PartID']."%'"; + $sql="SELECT stockid, description FROM stockmaster + WHERE stockid " . LIKE . " '%".$_POST['PartID']."%'"; if ($_POST['PartID']=='' and $_POST['PartDesc']!='') - $sql="SELECT stockid, description FROM stockmaster WHERE description LIKE '%".$_POST['PartDesc']."%'"; + $sql="SELECT stockid, description FROM stockmaster + WHERE description " . LIKE . " '%".$_POST['PartDesc']."%'"; if ($_POST['PartID']!='' and $_POST['PartDesc']!='') - $sql="SELECT stockid, description FROM stockmaster WHERE stockid LIKE '%".$_POST['PartID']."%' and - description LIKE '%".$_POST['PartDesc']."%'"; + $sql="SELECT stockid, description FROM stockmaster + WHERE stockid " . LIKE . " '%".$_POST['PartID']."%' + AND description " . LIKE . " '%".$_POST['PartDesc']."%'"; $result=DB_query($sql,$db); if (!isset($_POST['stockID'])) { - echo _('Select a part code').':<br>'; + echo _('Select a part code').':<br />'; while ($myrow=DB_fetch_array($result)) { - echo '<input type="submit" name="stockID" value="'.$myrow['stockid'].'"><br>'; + echo '<input type="submit" name="stockID" value="'.$myrow['stockid'].'" /><br />'; } } } } else { - echo '<table class=selection><tr><td>'._('Assign discount category').'</td>'; - echo '<td><input type="text" name="DiscountCategory" maxlength=2 size=2></td>'; + echo '<table class=selection> + <tr> + <td>'._('Assign discount category').'</td>'; + echo '<td><input type="text" name="DiscountCategory" maxlength=2 size=2 /></td>'; echo '<td>'._('to all items in stock category').'</td>'; - $sql = 'SELECT categoryid, + $sql = "SELECT categoryid, categorydescription - FROM stockcategory'; + FROM stockcategory"; $result = DB_query($sql, $db); echo '<td><select name="stockcategory">'; while ($myrow=DB_fetch_array($result)) { echo '<option value="'.$myrow['categoryid'].'">'.$myrow['categorydescription'].'</option>'; } echo '</select></td></tr></table>'; - echo "<br><div class='centre'><input type='Submit' name='submitcategory' value='". _('Update Items') ."'></div>"; + echo '<br /><div class="centre"><input type="submit" name="SubmitCategory" value="'. _('Update Items') .'"></div>'; } echo '</form>'; @@ -182,10 +193,10 @@ $result = DB_query($sql,$db); - echo '<br><table class=selection>'; - echo "<tr> - <th>". _('Discount Category') ."</th> - <th>". _('Item') .'</th></tr>'; + echo '<br /><table class="selection">'; + echo '<tr> + <th>'. _('Discount Category') .'</th> + <th>'. _('Item') .'</th></tr>'; $k=0; //row colour counter @@ -197,16 +208,16 @@ echo '<tr class="OddTableRows">'; $k=1; } - $DeleteURL = $_SERVER['PHP_SELF'] . '?' . SID . '&Delete=yes&StockID=' . $myrow['stockid'] . '&DiscountCategory=' . $myrow['discountcategory']; + $DeleteURL = $_SERVER['PHP_SELF'] . '?Delete=yes&StockID=' . $myrow['stockid'] . '&DiscountCategory=' . $myrow['discountcategory']; - printf("<td>%s</td> - <td>%s - %s</td> - <td><a href='%s'>". _('Delete') .'</td> - </tr>', - $myrow['discountcategory'], - $myrow['stockid'], - $myrow['description'], - $DeleteURL); + printf('<td>%s</td> + <td>%s - %s</td> + <td><a href="%s">'. _('Delete') .'</td> + </tr>', + $myrow['discountcategory'], + $myrow['stockid'], + $myrow['description'], + $DeleteURL); } @@ -214,20 +225,22 @@ } else { /* $_POST['DiscCat'] ==0 */ - echo '</div><br>'; + echo '</div><br />'; prnMsg( _('There are currently no discount categories defined') . '. ' . _('Enter a two character abbreviation for the discount category and the stock code to which this category will apply to. Discount rules can then be applied to this discount category'),'info'); } } if (!isset($_POST['selectchoice'])) { - echo "<form method='post' name='choose' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" name="choose" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection>'; + echo '<table class="selection">'; echo '<tr><td>'._('Update discount category for').'</td>'; - echo '<td><select name="chooseoption" onChange="ReloadForm(choose.selectchoice)">'; + echo '<td><select name="ChooseOption" onChange="ReloadForm(choose.selectchoice)">'; echo '<option value="1">'._('a single stock item').'</option>'; echo '<option value="2">'._('a complete stock category').'</option>'; - echo '</select></td></tr></table><br>'; + echo '</select></td></tr> + </table> + <br />'; echo '<div class="centre"><input type="submit" name="selectchoice" value="'._('Select').'"></div>'; } Modified: trunk/DiscountMatrix.php =================================================================== --- trunk/DiscountMatrix.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/DiscountMatrix.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -1,13 +1,11 @@ <?php -/* $Revision: 1.9 $ */ + /* $Id$*/ -//$PageSecurity = 11; include('includes/session.inc'); $title = _('Discount Matrix Maintenance'); include('includes/header.inc'); - if (isset($Errors)) { unset($Errors); } @@ -64,7 +62,7 @@ $result = DB_query($sql,$db); prnMsg( _('The discount matrix record has been added'),'success'); - echo '<br>'; + echo '<br />'; unset($_POST['DiscountCategory']); unset($_POST['SalesType']); unset($_POST['QuantityBreak']); @@ -80,30 +78,30 @@ $result = DB_query($sql,$db); prnMsg( _('The discount matrix record has been deleted'),'success'); - echo '<br>'; + echo '<br />'; } -echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table class=selection>'; +echo '<table class="selection">'; -$sql = 'SELECT typeabbrev, +$sql = "SELECT typeabbrev, sales_type - FROM salestypes'; + FROM salestypes"; $result = DB_query($sql, $db); echo '<tr><td>' . _('Customer Price List') . ' (' . _('Sales Type') . '):</td><td>'; -echo "<select tabindex=1 name='SalesType'>"; +echo '<select tabindex=1 name="SalesType">'; while ($myrow = DB_fetch_array($result)){ if (isset($_POST['SalesType']) and $myrow['typeabbrev']==$_POST['SalesType']){ - echo "<option selected value='" . $myrow['typeabbrev'] . "'>" . $myrow['sales_type']; + echo '<option selected value="' . $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; } else { - echo "<option value='" . $myrow['typeabbrev'] . "'>" . $myrow['sales_type']; + echo '<option value="' . $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; } } @@ -118,29 +116,26 @@ while ($myrow = DB_fetch_array($result)){ if ($myrow['discountcategory']==$_POST['DiscCat']){ - echo "<option selected value='" . $myrow['discountcategory'] . "'>" . $myrow['discountcategory']; + echo '<option selected value="' . $myrow['discountcategory'] . '">' . $myrow['discountcategory'] . '</option>'; } else { - echo "<option value='" . $myrow['discountcategory'] . "'>" . $myrow['discountcategory']; + echo '<option value="' . $myrow['discountcategory'] . '">' . $myrow['discountcategory'] . '</option>'; } - echo '</option>'; } echo '</select></td>'; } else { echo '<input type="hidden" name="DiscountCategory" value="">'; } -echo '<tr><td>' . _('Quantity Break') . ":</td><td><input class='number' tabindex=3 " - . (in_array('QuantityBreak',$Errors) ? "class='inputerror'" : "") - ." type='text' name='QuantityBreak' size=10 maxlength=10></td></tr>"; +echo '<tr><td>' . _('Quantity Break') . '</td> + <td><input class="number" tabindex=3 ' . (in_array('QuantityBreak',$Errors) ? 'class="inputerror"' : '') .' type="text" name="QuantityBreak" size=10 maxlength=10></td></tr>'; -echo '<tr><td>' . _('Discount Rate') . " (%):</td><td><input class='number' tabindex=4 " - . (in_array('DiscountRate',$Errors) ? "class='inputerror'" : "") . - "type='text' name='DiscountRate' size=11 maxlength=14></td></tr>"; -echo '</table><br>'; +echo '<tr><td>' . _('Discount Rate') . ' (%):</td> + <td><input class="number" tabindex=4 ' . (in_array('DiscountRate',$Errors) ? 'class="inputerror"' : '') . 'type="text" name="DiscountRate" size=11 maxlength=14></td></tr>'; +echo '</table><br />'; -echo "<div class='centre'><input tabindex=5 type='submit' name='submit' value='" . _('Enter Information') . "'></div><br>"; +echo '<div class="centre"><input tabindex=5 type="submit" name="submit" value="' . _('Enter Information') . '"></div><br />'; -$sql = 'SELECT sales_type, +$sql = "SELECT sales_type, salestype, discountcategory, quantitybreak, @@ -149,15 +144,15 @@ ON discountmatrix.salestype=salestypes.typeabbrev ORDER BY salestype, discountcategory, - quantitybreak'; + quantitybreak"; $result = DB_query($sql,$db); echo '<table class=selection>'; -echo "<tr><th>" . _('Sales Type') . "</th> - <th>" . _('Discount Category') . "</th> - <th>" . _('Quantity Break') . "</th> - <th>" . _('Discount Rate') . ' %' . "</th></tr>"; +echo '<tr><th>' . _('Sales Type') . '</th> + <th>' . _('Discount Category') . '</th> + <th>' . _('Quantity Break') . '</th> + <th>' . _('Discount Rate') . ' %' . '</th></tr>'; $k=0; //row colour counter @@ -169,13 +164,13 @@ echo '<tr class="OddTableRows">'; $k=1; } - $DeleteURL = $_SERVER['PHP_SELF'] . '?' . SID . '&Delete=yes&SalesType=' . $myrow['salestype'] . '&DiscountCategory=' . $myrow['discountcategory'] . '&QuantityBreak=' . $myrow['quantitybreak']; + $DeleteURL = $_SERVER['PHP_SELF'] . '?Delete=yes&SalesType=' . $myrow['salestype'] . '&DiscountCategory=' . $myrow['discountcategory'] . '&QuantityBreak=' . $myrow['quantitybreak']; - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> - <td class='number'>%s</td> - <td class='number'>%s</td> - <td><a href='%s'>" . _('Delete') . '</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td><a href="%s">' . _('Delete') . '</td> </tr>', $myrow['sales_type'], $myrow['discountcategory'], Modified: trunk/EDIMessageFormat.php =================================================================== --- trunk/EDIMessageFormat.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/EDIMessageFormat.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -97,7 +97,7 @@ prnMsg($msg,'success'); } -echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p><table border=0 width=100%> @@ -124,12 +124,12 @@ $result = DB_query($sql,$db); echo '<table class=selection>'; - echo '<tr><th colspan=5><font size=3>' . _('Definition of') . ' ' . $MessageType . ' ' . _('for') . ' ' . $PartnerCode."</font></th></tr>"; - $TableHeader = "<tr> - <th>" . _('Section') . "</th> - <th>" . _('Sequence') . "</th> - <th>" . _('Format String') . "</th> - </tr>"; + echo '<tr><th colspan=5><font size=3>' . _('Definition of') . ' ' . $MessageType . ' ' . _('for') . ' ' . $PartnerCode.'</font></th></tr>'; + $TableHeader = '<tr> + <th>' . _('Section') . '</th> + <th>' . _('Sequence') . '</th> + <th>' . _('Format String') . '</th> + </tr>'; echo $TableHeader; $k=0; //row colour counter @@ -144,12 +144,12 @@ } - printf("<td>%s</td> + printf('<td>%s</td> <td class=number>%s</td> <td>%s</td> - <td><a href=\"%s&SelectedMessageLine=%s\">" . _('Edit') . "</a></td> - <td><a href=\"%s&delete=%s\">" . _('Delete') . "</a></td> - </tr>", + <td><a href="%s&SelectedMessageLine=%s">' . _('Edit') . '</a></td> + <td><a href="%s&delete=%s">' . _('Delete') . '</a></td> + </tr>', $myrow[1], $myrow[2], $myrow[3], @@ -161,8 +161,8 @@ } //END WHILE LIST LOOP echo '</table><p>'; if (DB_num_rows($result)==0){ - echo "<div class='centre'><input tabindex=1 type=submit name='NewEDIInvMsg' value='" . - _('Create New EDI Invoice Message From Default Template') . "'></div><br>"; + echo '<div class="centre"><input tabindex=1 type=submit name="NewEDIInvMsg" value="' . + _('Create New EDI Invoice Message From Default Template') . '"></div><br>'; } } //end of ifs SelectedLine is not set @@ -188,14 +188,14 @@ $_POST['SequenceNo'] = $myrow['sequenceno']; $_POST['LineText'] = $myrow['linetext']; - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . 'MessageType=INVOIC&PartnerCode=' . $myrow['partnercode'] . "'>" . _('Review Message Lines') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?MessageType=INVOIC&PartnerCode=' . $myrow['partnercode'] . '">' . _('Review Message Lines') . '</a></div>'; - echo "<input type=hidden name='SelectedMessageLine' VALUE='" . $SelectedMessageLine . "'>"; - echo "<input type=hidden name='MessageType' VALUE='" . $myrow['messagetype'] . "'>"; - echo "<input type=hidden name='PartnerCode' VALUE='" . $myrow['partnercode'] . "'>"; + echo '<input type=hidden name="SelectedMessageLine" VALUE="' . $SelectedMessageLine . '">'; + echo '<input type=hidden name="MessageType" VALUE="' . $myrow['messagetype'] . '">'; + echo '<input type=hidden name="PartnerCode" VALUE="' . $myrow['partnercode'] . '">'; } else { //end of if $SelectedMessageLine only do the else when a new record is being entered - echo "<input type=hidden name='MessageType' VALUE='" . $MessageType . "'>"; - echo "<input type=hidden name='PartnerCode' VALUE='" . $PartnerCode . "'>"; + echo '<input type=hidden name="MessageType" VALUE="' . $MessageType . '">'; + echo '<input type=hidden name="PartnerCode" VALUE="' . $PartnerCode . '">'; } echo '<table class=selection>'; @@ -209,20 +209,20 @@ echo '<select tabindex=2 name="Section">'; if ($_POST['Section']=='Heading') { - echo "<option selected VALUE='Heading'>" . _('Heading') . '</option>'; + echo '<option selected VALUE="Heading">' . _('Heading') . '</option>'; } else { - echo "<option value='Heading'>" . _('Heading') . '</option>'; + echo '<option value="Heading">' . _('Heading') . '</option>'; } if (isset($_POST['Section']) and $_POST['Section']=='Detail') { - echo "<option selected VALUE='Detail'>" . _('Detail') . '</option>'; + echo '<option selected VALUE="Detail">' . _('Detail') . '</option>'; } else { - echo "<option value='Detail'>" . _('Detail') . '</option>'; + echo '<option value="Detail">' . _('Detail') . '</option>'; } if (isset($_POST['Section']) and $_POST['Section']=='Summary') { - echo "<option selected VALUE='Summary'>" . _('Summary') . '</option>'; + echo '<option selected VALUE="Summary">' . _('Summary') . '</option>'; } else { - echo "<option value='Summary'>" . _('Summary') . '</option>'; + echo '<option value="Summary">' . _('Summary') . '</option>'; } echo '</select>'; @@ -234,20 +234,20 @@ echo '</td></tr>'; echo '<tr><td>Sequence Number:</td>'; -echo "<td><input tabindex=3 type=text name=SequenceNo size=3 maxlength=3 value=".$_POST['SequenceNo'].">"; -echo "</td></tr>"; -echo "<tr><td>" . _('Line Text') . ':' ."</td>"; -echo "<td>"; -echo "<input tabindex=4 type='Text' name='LineText' size=50 maxlength=50 VALUE=".$_POST['LineText'] .">"; -echo "</td></tr>"; -echo "</table><br>"; +echo '<td><input tabindex=3 type=text name=SequenceNo size=3 maxlength=3 value='.$_POST['SequenceNo'].'>'; +echo '</td></tr>'; +echo '<tr><td>' . _('Line Text') . ':' .'</td>'; +echo '<td>'; +echo '<input tabindex=4 type="Text" name="LineText" size=50 maxlength=50 VALUE='.$_POST['LineText'] .'>'; +echo '</td></tr>'; +echo '</table><br>'; if (isset($_GET['SelectedMessageLine'])) { - echo "<div class='centre'><input tabindex=5 type='submit' name='update' value='". _('Update Information'). "'></div>"; + echo '<div class="centre"><input tabindex=5 type="submit" name="update" value="'. _('Update Information'). '"></div>'; } else { - echo "<div class='centre'><input tabindex=5 type='submit' name='submit' value='". _('Enter Information'). "'></div>"; + echo '<div class="centre"><input tabindex=5 type="submit" name="submit" value="'. _('Enter Information'). '"></div>'; } -echo "</form>"; +echo '</form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/EmailCustTrans.php =================================================================== --- trunk/EmailCustTrans.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/EmailCustTrans.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -37,13 +37,13 @@ include ('includes/header.inc'); -echo "<form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "' method=post>"; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo "<input type=hidden name='TransNo' VALUE=" . $_GET['FromTransNo'] . ">"; -echo "<input type=hidden name='InvOrCredit' VALUE=" . $_GET['InvOrCredit'] . '>'; +echo '<input type=hidden name="TransNo" VALUE="' . $_GET['FromTransNo'] . '">'; +echo '<input type=hidden name="InvOrCredit" VALUE="' . $_GET['InvOrCredit'] . '>'; -echo '<p><table>'; +echo '<br /><table>'; $SQL = "SELECT email FROM custbranch INNER JOIN debtortrans @@ -62,11 +62,11 @@ $EmailAddress =''; } -echo '<tr><td>' . _('Email') . ' ' . $_GET['InvOrCredit'] . ' ' . _('number') . ' ' . $_GET['FromTransNo'] . ' ' . _('to') . ":</td> - <td><input type=TEXT name='EmailAddr' maxlength=60 size=60 VALUE='" . $EmailAddress . "'</td> - </table>"; +echo '<tr><td>' . _('Email') . ' ' . $_GET['InvOrCredit'] . ' ' . _('number') . ' ' . $_GET['FromTransNo'] . ' ' . _('to') . ':</td> + <td><input type=TEXT name="EmailAddr" maxlength=60 size=60 VALUE="' . $EmailAddress . '"></td> + </table>'; -echo "<br><div class='centre'><input type=submit name='DoIt' VALUE='" . _('OK') . "'>"; +echo '<br><div class="centre"><input type=submit name="DoIt" VALUE="' . _('OK') . '">'; echo '</div></form>'; include ('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/ExchangeRateTrend.php =================================================================== --- trunk/ExchangeRateTrend.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/ExchangeRateTrend.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -23,7 +23,7 @@ // SHOW OUR MAIN INPUT FORM // ************************ - echo "<form method='post' name=update action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" name=update action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<div class="centre"><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('View Currency Trend') . '" alt="" />' . ' ' . _('View Currency Trend') . '</p>'; @@ -40,9 +40,9 @@ while ($myrow=DB_fetch_array($result)) { if ($myrow['currabrev']!=$_SESSION['CompanyRecord']['currencydefault']){ if ( $CurrencyToShow==$myrow['currabrev'] ) { - echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['country'] . ' ' . $myrow['currency'] . ' (' . $myrow['currabrev'] . ')'; + echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['country'] . ' ' . $myrow['currency'] . ' (' . $myrow['currabrev'] . ')'. '</option>'; } else { - echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['country'] . ' ' . $myrow['currency'] . ' (' . $myrow['currabrev'] . ')'; + echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['country'] . ' ' . $myrow['currency'] . ' (' . $myrow['currabrev'] . ')'. '</option>'; } } } Modified: trunk/FixedAssetCategories.php =================================================================== --- trunk/FixedAssetCategories.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/FixedAssetCategories.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -154,7 +154,7 @@ FROM fixedassetcategories'; $result = DB_query($sql,$db); - echo "<br /><table class=selection>\n"; + echo '<br /><table class=selection>'; echo '<tr><th>' . _('Cat Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Cost GL') . '</th> @@ -172,15 +172,15 @@ echo '<tr class="OddTableRows">'; $k=1; } - printf("<td>%s</td> + 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><a href=\"%sSelectedCategory=%s\">" . _('Edit') . "</td> - <td><a href=\"%sSelectedCategory=%s&delete=yes\" onclick=\"return confirm('" . _('Are you sure you wish to delete this fixed asset category? Additional checks will be performed before actual deletion to ensure data integrity is not compromised.') . "');\">" . _('Delete') . "</td> - </tr>", + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td><a href="%sSelectedCategory=%s">' . _('Edit') . '</td> + <td><a href="%sSelectedCategory=%s&delete=yes" onclick="return confirm("' . _('Are you sure you wish to delete this fixed asset category? Additional checks will be performed before actual deletion to ensure data integrity is not compromised.') . '");">' . _('Delete') . '</td> + </tr>', $myrow['categoryid'], $myrow['categorydescription'], $myrow['costact'], @@ -199,7 +199,7 @@ //end of ifs and buts! if (isset($SelectedCategory)) { - echo "<br /><div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . ">" ._('Show All Fixed Asset Categories') . "</a></div>"; + echo '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' ._('Show All Fixed Asset Categories') . '</a></div>'; } echo '<form name="CategoryForm" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; @@ -273,11 +273,10 @@ while ($myrow = DB_fetch_array($BSAccountsResult)){ if (isset($_POST['CostAct']) and $myrow['accountcode']==$_POST['CostAct']) { - echo '<option selected value='; + echo '<option selected value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')</option>'; } else { - echo '<option value='; + echo '<option value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')</option>'; } - echo $myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')'; } //end while loop echo '</select></td></tr>'; @@ -286,11 +285,10 @@ while ($myrow = DB_fetch_array($PnLAccountsResult)) { if (isset($_POST['DepnAct']) and $myrow['accountcode']==$_POST['DepnAct']) { - echo '<option selected value='; + echo '<option selected value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')</option>'; } else { - echo '<option value='; + echo '<option value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')</option>'; } - echo $myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')</option>'; } //end while loop echo '</select></td></tr>'; @@ -298,11 +296,10 @@ echo '<tr><td>' . _('Profit or Loss on Disposal GL Code:') . '</td><td><select name="DisposalAct">'; while ($myrow = DB_fetch_array($PnLAccountsResult)) { if (isset($_POST['DisposalAct']) and $myrow['accountcode']==$_POST['DisposalAct']) { - echo '<option selected value='; + echo '<option selected value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } else { - echo '<option value='; + echo '<option value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } - echo $myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } //end while loop echo '</select></td></tr>'; @@ -313,11 +310,10 @@ while ($myrow = DB_fetch_array($BSAccountsResult)) { if (isset($_POST['AccumDepnAct']) and $myrow['accountcode']==$_POST['AccumDepnAct']) { - echo '<option selected value='; + echo '<option selected value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } else { - echo '<option value='; + echo '<option value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } - echo $myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } //end while loop Modified: trunk/GLAccountInquiry.php =================================================================== --- trunk/GLAccountInquiry.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/GLAccountInquiry.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -25,14 +25,14 @@ echo '<div class="page_help_text">' . _('Use the keyboard Shift key to select multiple periods') . '</div><br>'; -echo "<form method='POST' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; +echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; /*Dates in SQL format for the last day of last month*/ $DefaultPeriodDate = Date ('Y-m-d', Mktime(0,0,0,Date('m'),0,Date('Y'))); /*Show a form to allow input of criteria for TB to show */ -echo '<table class=selection><tr><td>'._('Account').":</td><td><select Name='Account'>"; +echo '<table class=selection><tr><td>'._('Account').':</td><td><select Name="Account">'; $sql = "SELECT accountcode, accountname FROM chartmaster ORDER BY accountcode"; $Account = DB_query($sql,$db); while ($myrow=DB_fetch_array($Account,$db)){ @@ -55,7 +55,7 @@ $result=DB_query($SQL,$db); echo '<option value=0>0 - '._('All tags'); while ($myrow=DB_fetch_array($result)){ - if (isset($_POST['tag']) and $_POST['tag']==$myrow["tagref"]){ + if (isset($_POST['tag']) and $_POST['tag']==$myrow['tagref']){ echo '<option selected value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']; } else { echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']; @@ -75,8 +75,8 @@ echo '<option value=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])); } } -echo "</select></td></tr><table>"; -echo "<p><div class='centre'><input type=submit name='Show' value='"._('Show Account Transactions')."'></div></form>"; +echo '</select></td></tr><table>'; +echo '<p><div class="centre"><input type=submit name="Show" value="'._('Show Account Transactions').'"></div></form>'; /* End of the Form rest of script is what happens if the show button is hit*/ @@ -148,16 +148,16 @@ echo '<br><table class=selection>'; echo '<tr><th colspan=8><b>' ._('Transactions for account').' '.$SelectedAccount. ' - '. $SelectedAccountName.'</b></th></tr>'; - $TableHeader = "<tr> - <th>" . _('Type') . "</th> - <th>" . _('Number') . "</th> - <th>" . _('Date') . "</th> - <th>" . _('Debit') . "</th> - <th>" . _('Credit') . "</th> - <th>" . _('Narrative') . "</th> - <th>" . _('Balance') . "</th> - <th>" . _('Tag') . "</th> - </tr>"; + $TableHeader = '<tr> + <th>' . _('Type') . '</th> + <th>' . _('Number') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Debit') . '</th> + <th>' . _('Credit') . '</th> + <th>' . _('Narrative') . '</th> + <th>' . _('Balance') . '</th> + <th>' . _('Tag') . '</th> + </tr>'; echo $TableHeader; @@ -179,15 +179,15 @@ $RunningTotal =$ChartDetailRow['bfwd']; if ($RunningTotal < 0 ){ //its a credit balance b/fwd - echo "<tr bgcolor='#FDFEEF'> - <td colspan=3><b>" . _('Brought Forward Balance') . '</b><td> + echo '<tr bgcolor="#FDFEEF"> + <td colspan=3><b>' . _('Brought Forward Balance') . '</b><td> </td></td> <td class=number><b>' . number_format(-$RunningTotal,2) . '</b></td> <td></td> </tr>'; } else { //its a debit balance b/fwd - echo "<tr bgcolor='#FDFEEF'> - <td colspan=3><b>" . _('Brought Forward Balance') . '</b></td> + echo '<tr bgcolor="#FDFEEF"> + <td colspan=3><b>' . _('Brought Forward Balance') . '</b></td> <td class=number><b>' . number_format($RunningTotal,2) . '</b></td> <td colspan=2></td> </tr>'; @@ -215,8 +215,8 @@ $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); $ChartDetailRow = DB_fetch_array($ChartDetailsResult); - echo "<tr bgcolor='#FDFEEF'> - <td colspan=3><b>" . _('Total for period') . ' ' . $PeriodNo . '</b></td>'; + echo '<tr bgcolor="#FDFEEF"> + <td colspan=3><b>' . _('Total for period') . ' ' . $PeriodNo . '</b></td>'; if ($PeriodTotal < 0 ){ //its a credit balance b/fwd if ($PandLAccount==True) { $RunningTotal = 0; @@ -271,15 +271,15 @@ if ($tagrow['tagdescription']=='') { $tagrow['tagdescription']=_('None'); } - printf("<td>%s</td> - <td class=number><a href='%s'>%s</a></td> + printf('<td>%s</td> + <td class=number><a href="%s">%s</a></td> <td>%s</td> <td class=number>%s</td> <td class=number>%s</td> <td>%s</td> <td class=number><b>%s</b></td> <td>%s</td> - </tr>", + </tr>', $myrow['typename'], $URL_to_TransDetail, $myrow['typeno'], @@ -292,7 +292,7 @@ } - echo "<tr bgcolor='#FDFEEF'><td colspan=3><b>"; + echo '<tr bgcolor="#FDFEEF"><td colspan=3><b>'; if ($PandLAccount==True){ echo _('Total Period Movement'); } else { /*its a balance sheet account*/ Modified: trunk/GLBalanceSheet.php =================================================================== --- trunk/GLBalanceSheet.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/GLBalanceSheet.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -24,9 +24,9 @@ . _('The balance sheet has three parts: assets, liabilities and ownership equity. The main categories of assets are listed first and are followed by the liabilities. The difference between the assets and the liabilities is known as equity or the net assets or the net worth or capital of the company and according to the accounting equation, net worth must equal assets minus liabilities.') . '<br>' . _('webERP is an "accrual" based system (not a "cash based" system). Accrual systems include items when they are invoiced to the customer, and when expenses are owed based on the supplier invoice date.') . '</div>'; - echo "<form method='POST' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p><table class="selection"><tr><td>'._('Select the balance date').":</td><td><select Name='BalancePeriodEnd'>"; + echo '<p><table class="selection"><tr><td>'._('Select the balance date').':</td><td><select Name="BalancePeriodEnd">'; $periodno=GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); $sql = "SELECT lastdate_in_period FROM periods WHERE periodno='".$periodno . "'"; @@ -47,15 +47,15 @@ echo '</select></td></tr>'; - echo '<tr><td>'._('Detail Or Summary').":</td><td><select Name='Detail'>"; - echo "<option selected VALUE='Summary'>"._('Summary'); - echo "<option selected VALUE='Detailed'>"._('All Accounts'); + echo '<tr><td>'._('Detail Or Summary').':</td><td><select Name="Detail">'; + echo '<option selected VALUE="Summary">'._('Summary') . '</option>'; + echo '<option selected VALUE="Detailed">'._('All Accounts') . '</option>'; echo '</select></td></tr>'; echo '</table>'; - echo "<br><div class='centre'><input type=submit Name='ShowBalanceSheet' Value='"._('Show on Screen (HTML)')."'</div>"; - echo "<br><div class='centre'><input type=submit Name='PrintPDF' Value='"._('Produce PDF Report')."'></div>"; + echo '<br><div class="centre"><input type=submit Name="ShowBalanceSheet" Value="'._('Show on Screen (HTML)').'"></div>'; + echo '<br><div class="centre"><input type=submit Name="PrintPDF" Value="'._('Produce PDF Report').'"></div>'; /*Now do the posting while the user is thinking about the period to select */ include ('includes/GLPostings.inc'); @@ -301,9 +301,9 @@ exit; } else { include('includes/header.inc'); - echo "<form method='POST' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo "<input type=hidden name='BalancePeriodEnd' VALUE=" . $_POST['BalancePeriodEnd'] . '>'; + echo '<input type=hidden name="BalancePeriodEnd" VALUE="' . $_POST['BalancePeriodEnd'] . '">'; $RetainedEarningsAct = $_SESSION['CompanyRecord']['retainedearnings']; @@ -354,17 +354,17 @@ _('Balance Sheet as at') . ' ' . $BalanceDate .'</b></font></div></th></tr>'; if ($_POST['Detail']=='Detailed'){ - $TableHeader = "<tr> - <th>"._('Account')."</td> - <th>"._('Account Name')."</td> + $TableHeader = '<tr> + <th>'._('Account').'</td> + <th>'._('Account Name').'</td> <th colspan=2>$BalanceDate</th> - <th colspan=2>"._('Last Year').'</th> + <th colspan=2>'._('Last Year').'</th> </tr>'; } else { /*summary */ - $TableHeader = "<tr> + $TableHeader = '<tr> <th colspan=2></th> <th colspan=2>$BalanceDate</th> - <th colspan=2>"._('Last Year').'</th> + <th colspan=2>'._('Last Year').'</th> </tr>'; } @@ -533,7 +533,7 @@ $k++; } - $ActEnquiryURL = "<a href='$rootpath/GLAccountInquiry.php?" . SID . "Period=" . $_POST['BalancePeriodEnd'] . '&Account=' . $myrow['accountcode'] . "'>" . $myrow['accountcode'] . '<a>'; + $ActEnquiryURL = '<a href="' . $rootpath . '/GLAccountInquiry.php?Period=' . $_POST['BalancePeriodEnd'] . '&Account=' . $myrow['accountcode'] . '">' . $myrow['accountcode'] . '</a>'; $PrintString = '<td>%s</td> <td>%s</td> @@ -658,7 +658,7 @@ </tr>'; echo '</table>'; - echo "<br><div class='centre'><input type=submit Name='SelectADifferentPeriod' Value='"._('Select A Different Balance Date')."'></div>"; + echo '<br><div class="centre"><input type=submit Name="SelectADifferentPeriod" Value="'._('Select A Different Balance Date').'"></div>'; } echo '</form>'; Modified: trunk/GLBudgets.php =================================================================== --- trunk/GLBudgets.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/GLBudgets.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -24,7 +24,7 @@ prnMsg(_('Budget updated successfully'), 'success'); } -//If an account hasn't been selected then select one here. +//If an account has not been selected then select one here. echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="selectaccount">'; echo '<input type="hidden" name="F... [truncated message content] |
From: <dai...@us...> - 2011-04-18 07:49:50
|
Revision: 4554 http://web-erp.svn.sourceforge.net/web-erp/?rev=4554&view=rev Author: daintree Date: 2011-04-18 07:49:36 +0000 (Mon, 18 Apr 2011) Log Message: ----------- pre 4.03.8 Modified Paths: -------------- trunk/PO_Header.php trunk/PO_Items.php trunk/PO_PDFPurchOrder.php trunk/PurchData.php trunk/doc/Change.log.html trunk/includes/ConnectDB.inc trunk/includes/DefinePOClass.php trunk/includes/PO_ReadInOrder.inc 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/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.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/upgrade3.11.1-4.00.sql trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/PO_Header.php 2011-04-18 07:49:36 UTC (rev 4554) @@ -228,7 +228,7 @@ $_POST['RePrint'] = 0; } - echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PO_Items.php?identifier='.$identifier. "'>"; + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/PO_Items.php?identifier='.$identifier. '">'; echo '<p>'; prnMsg(_('You should automatically be forwarded to the entry of the purchase order line items page') . '. ' . _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . @@ -613,6 +613,7 @@ purchdata.suppliersuom, purchdata.suppliers_partno, purchdata.conversionfactor, + purchdata.leadtime, stockcategory.stockact FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid @@ -626,6 +627,9 @@ if (!isset($PurchItemRow['conversionfactor'])) { $PurchItemRow['conversionfactor']=1; } + if (!isset($PurchItemRow['leadtime'])) { + $PurchItemRow['leadtime']=1; + } $_SESSION['PO'.$identifier]->add_to_order( 1, $Purch_Item, @@ -644,18 +648,10 @@ 0, '', $PurchItemRow['decimalplaces'], - $Purch_Item, $PurchItemRow['suppliersuom'], $PurchItemRow['conversionfactor'], - $PurchItemRow['suppliers_partno'], - $Qty*$PurchItemRow['price'], - '', - 0, - 0, - 0, - 0, - $Qty, - $Qty*$PurchItemRow['price']); + $PurchItemRow['leadtime'], + $PurchItemRow['suppliers_partno'] ); echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PO_Items.php?identifier='.$identifier. "'>"; } Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/PO_Items.php 2011-04-18 07:49:36 UTC (rev 4554) @@ -49,7 +49,6 @@ } else { //ok to update the PO object variables $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Price=(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['SuppPrice'.$POLine->LineNo]))/$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor); } - $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->NetWeight=$_POST['NetWeight'.$POLine->LineNo]; $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ReqDelDate=$_POST['ReqDelDate'.$POLine->LineNo]; } } @@ -202,57 +201,39 @@ foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) { if ($POLine->Deleted==False) { $sql = "INSERT INTO purchorderdetails ( orderno, - itemcode, - deliverydate, - itemdescription, - glcode, - unitprice, - quantityord, - shiptref, - jobref, - itemno, - suppliersunit, - suppliers_partno, - subtotal_amount, - package, - pcunit, - netweight, - kgs, - cuft, - total_quantity, - total_amount, - assetid, - conversionfactor ) - VALUES ( - '" . $_SESSION['PO'.$identifier]->OrderNo . "', - '" . $POLine->StockID . "', - '" . FormatDateForSQL($POLine->ReqDelDate) . "', - '" . $POLine->ItemDescription . "', - '" . $POLine->GLCode . "', - '" . $POLine->Price . "', - '" . $POLine->Quantity . "', - '" . $POLine->ShiptRef . "', - '" . $POLine->JobRef . "', - '" . $POLine->ItemNo . "', - '" . $POLine->SuppliersUnit . "', - '" . $POLine->Suppliers_PartNo . "', - '" . $POLine->SubTotal_Amount . "', - '" . $POLine->Package . "', - '" . $POLine->PcUnit . "', - '" . $POLine->NetWeight . "', - '" . $POLine->KGs . "', - '" . $POLine->CuFt . "', - '" . $POLine->Total_Quantity . "', - '" . $POLine->Total_Amount . "', - '" . $POLine->AssetID . "', - '" . $POLine->ConversionFactor . "')"; + itemcode, + deliverydate, + itemdescription, + glcode, + unitprice, + quantityord, + shiptref, + jobref, + suppliersunit, + suppliers_partno, + assetid, + conversionfactor ) + VALUES ( + '" . $_SESSION['PO'.$identifier]->OrderNo . "', + '" . $POLine->StockID . "', + '" . FormatDateForSQL($POLine->ReqDelDate) . "', + '" . $POLine->ItemDescription . "', + '" . $POLine->GLCode . "', + '" . $POLine->Price . "', + '" . $POLine->Quantity . "', + '" . $POLine->ShiptRef . "', + '" . $POLine->JobRef . "', + '" . $POLine->SuppliersUnit . "', + '" . $POLine->Suppliers_PartNo . "', + '" . $POLine->AssetID . "', + '" . $POLine->ConversionFactor . "')"; $ErrMsg =_('One of the purchase order detail records could not be inserted into the database because'); $DbgMsg =_('The SQL statement used to insert the purchase order detail record and failed was'); $result =DB_query($sql,$db,$ErrMsg,$DbgMsg,true); } } /* end of the loop round the detail line items on the order */ - echo '<p>'; + echo '<p />'; prnMsg(_('Purchase Order') . ' ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . _('on') . ' ' . $_SESSION['PO'.$identifier]->SupplierName . ' ' . _('has been created'),'success'); } else { /*its an existing order need to update the old order info */ @@ -315,17 +296,8 @@ quantityord, shiptref, jobref, - itemno, suppliersunit, suppliers_partno, - subtotal_amount, - package, - pcunit, - netweight, - kgs, - cuft, - total_quantity, - total_amount, assetid, conversionfactor) VALUES ( @@ -338,17 +310,8 @@ '" . $POLine->Quantity . "', '" . $POLine->ShiptRef . "', '" . $POLine->JobRef . "', - '" . $POLine->ItemNo . "', '" . $POLine->SuppliersUnit . "', '" . $POLine->Suppliers_PartNo . "', - '" . $POLine->SubTotal_Amount . "', - '" . $POLine->Package . "', - '" . $POLine->PcUnit . "', - '" . $POLine->NetWeight . "', - '" . $POLine->KGs . "', - '" . $POLine->CuFt . "', - '" . $POLine->Total_Quantity . "', - '" . $POLine->Total_Amount . "', '" . $POLine->AssetID . "', '" . $POLine->ConversionFactor . "')"; @@ -362,17 +325,8 @@ quantityord='" . $POLine->Quantity . "', shiptref='" . $POLine->ShiptRef . "', jobref='" . $POLine->JobRef . "', - itemno='" . $POLine->ItemNo . "', suppliersunit='" . $POLine->SuppliersUnit . "', suppliers_partno='" . $POLine->Suppliers_PartNo . "', - subtotal_amount='" . $POLine->SubTotal_Amount . "', - package='" . $POLine->Package . "', - pcunit='" . $POLine->PcUnit . "', - netweight='" . $POLine->NetWeight . "', - kgs='" . $POLine->KGs . "', - cuft='" . $POLine->CuFt . "', - total_quantity='" . $POLine->Total_Quantity . "', - total_amount='" . $POLine->Total_Amount . "', completed=1, assetid='" . $POLine->AssetID . "', conversionfactor = '" . $POLine->ConversionFactor . "' @@ -386,17 +340,8 @@ quantityord='" . $POLine->Quantity . "', shiptref='" . $POLine->ShiptRef . "', jobref='" . $POLine->JobRef . "', - itemno='" . $POLine->ItemNo . "', suppliersunit='" . $POLine->SuppliersUnit . "', suppliers_partno='" . $POLine->Suppliers_PartNo . "', - subtotal_amount='" . $POLine->SubTotal_Amount . "', - package='" . $POLine->Package . "', - pcunit='" . $POLine->PcUnit . "', - netweight='" . $POLine->NetWeight . "', - kgs='" . $POLine->KGs . "', - cuft='" . $POLine->CuFt . "', - total_quantity='" . $POLine->Total_Quantity . "', - total_amount='" . $POLine->Total_Amount . "', assetid='" . $POLine->AssetID . "', conversionfactor = '" . $POLine->ConversionFactor . "' WHERE podetailitem='" . $POLine->PODetailRec . "'"; @@ -540,19 +485,9 @@ 0, $GLAccountName, 2, - '', $_POST['SuppliersUnit'], 1, '', - '', - ($_POST['Qty']*$_POST['Price']), - '', - '', - '', - '', - '', - $_POST['Qty'], - ($_POST['Qty']*$_POST['Price']), $_POST['AssetID']); include ('includes/PO_UnsetFormVbls.php'); } @@ -592,8 +527,6 @@ stockid, units, decimalplaces, - kgs, - netweight, stockact, accountname FROM stockmaster INNER JOIN stockcategory @@ -612,12 +545,10 @@ conversionfactor, supplierdescription, suppliersuom, - unitname, suppliers_partno, leadtime, MAX(purchdata.effectivefrom) AS latesteffectivefrom - FROM purchdata LEFT JOIN unitsofmeasure - ON purchdata.suppliersuom=unitsofmeasure.unitid + FROM purchdata WHERE purchdata.supplierno = '" . $_SESSION['PO'.$identifier]->SupplierID . "' AND purchdata.effectivefrom <='" . Date('Y-m-d') . "' AND purchdata.stockid = '". $ItemCode . "' @@ -625,7 +556,6 @@ purchdata.conversionfactor, purchdata.supplierdescription, purchdata.suppliersuom, - unitsofmeasure.unitname, purchdata.suppliers_partno, purchdata.leadtime"; @@ -637,14 +567,14 @@ $PurchPrice = $PurchRow['price']/$PurchRow['conversionfactor']; $ConversionFactor = $PurchRow['conversionfactor']; $SupplierDescription = $PurchRow['suppliers_partno'] .' - ' . $PurchRow['supplierdescription']; - $SuppliersUnitOfMeasure = $PurchRow['unitname']; + $SuppliersUnitOfMeasure = $PurchRow['suppliersuom']; $SuppliersPartNo = $PurchRow['suppliers_partno']; $LeadTime = $PurchRow['leadtime']; } else { // no purchasing data setup $PurchPrice = 0; $ConversionFactor = 1; $SupplierDescription = $ItemRow['description']; - $SuppliersUnitOfMeasure = $ItemRow['units']; + $SuppliersUnitOfMeasure = $ItemRow['unitname']; $SuppliersPartNo = ''; $LeadTime = 1; } @@ -666,19 +596,11 @@ 0, $Itemrow['accountname'], $ItemRow['decimalplaces'], - $ItemCode, $SuppliersUnitOfMeasure, $ConversionFactor, $LeadTime, - $SuppliersPartNo, - $Quantity*$PurchPrice, - '', - 0, - $ItemRow['netweight'], - $ItemRow['kgs'], - '', - $Quantity, - $Quantity*$PurchPrice ); + $SuppliersPartNo + ); } else { //no rows returned by the SQL to get the item prnMsg (_('The item code') . ' ' . $ItemCode . ' ' . _('does not exist in the database and therefore cannot be added to the order'),'error'); if ($debug==1){ @@ -711,15 +633,14 @@ echo '<tr> <th>' . _('Item Code') . '</th> <th>' . _('Description') . '</th> - <th>' . _('Weight') . '</th> <th>' . _('Quantity Our Units') . '</th> <th>' . _('Our Unit') .'</th> <th>' . _('Price Our Units') .' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th> <th>' . _('Unit Conversion Factor') . '</th> - <th>' . _('Quantity Supplier Units') . '</th> + <th>' . _('Order Quantity') . '<br />' . _('Supplier Units') . '</th> <th>' . _('Supplier Unit') . '</th> - <th>' . _('Price Supp Units') . ' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th> - <th>' . _('Subtotal') .' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th> + <th>' . _('Order Price') . '<br />' . _('Supp Units') . ' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th> + <th>' . _('Sub-Total') .' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th> <th>' . _('Deliver By') .'</th> </tr>'; @@ -749,7 +670,6 @@ echo '<td>' . $POLine->StockID . '</td> <td>' . $POLine->ItemDescription . '</td> - <td><input type="text" class="number" name="NetWeight' . $POLine->LineNo . '" size="8" value="' . $POLine->NetWeight . '"></td> <td class="number">' . number_format($POLine->Quantity,$POLine->DecimalPlaces) . '</td> <td>' . $POLine->Units . '</td> <td class="number">' . $DisplayPrice . '</td> @@ -759,7 +679,7 @@ <td><input type="text" class="number" name="SuppPrice' . $POLine->LineNo . '" size="10" value="' .number_format(($POLine->Price *$POLine->ConversionFactor),2) .'"></td> <td class="number">' . $DisplayLineTotal . '</td> <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'].'" name="ReqDelDate' . $POLine->LineNo.'" size="10" value="' .$POLine->ReqDelDate .'"></td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . 'identifier='.$identifier. '&Delete=' . $POLine->LineNo . '">' . _('Delete') . '</a></td></tr>'; + <td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier. '&Delete=' . $POLine->LineNo . '">' . _('Delete') . '</a></td></tr>'; $_SESSION['PO'.$identifier]->Total = $_SESSION['PO'.$identifier]->Total + $LineTotal; } } @@ -777,14 +697,15 @@ if (isset($_POST['NonStockOrder'])) { - echo '<br /><table class=selection><tr><td>' . _('Item Description') . '</td>'; + echo '<br /><table class="selection"><tr> + <td>' . _('Item Description') . '</td>'; echo '<td><input type=text name=ItemDescription size=40></td></tr>'; echo '<tr><td>' . _('General Ledger Code') . '</td>'; echo '<td><select name="GLCode">'; - $sql='SELECT accountcode, + $sql="SELECT accountcode, accountname FROM chartmaster - ORDER BY accountcode ASC'; + ORDER BY accountcode ASC"; $result=DB_query($sql, $db); while ($myrow=DB_fetch_array($result)) { @@ -793,7 +714,7 @@ echo '</select></td></tr>'; echo '<tr><td>'._('OR Asset ID'). '</td> <td><select name="AssetID">'; - $AssetsResult = DB_query('SELECT assetid, description, datepurchased FROM fixedassets ORDER BY assetid DESC',$db); + $AssetsResult = DB_query("SELECT assetid, description, datepurchased FROM fixedassets ORDER BY assetid DESC",$db); echo '<option selected value="Not an Asset">' . _('Not an Asset') . '</option>'; while ($AssetRow = DB_fetch_array($AssetsResult)){ if ($AssetRow['datepurchased']=='0000-00-00'){ @@ -831,42 +752,26 @@ $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 AND stockmaster.description " . LIKE . " '" . $SearchString ."' - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) ORDER BY stockmaster.stockid LIMIT " .$_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) AND stockmaster.description " . LIKE . " '". $SearchString ."' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' ORDER BY stockmaster.stockid @@ -880,42 +785,26 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' ORDER BY stockmaster.stockid LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' and stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' ORDER BY stockmaster.stockid @@ -926,41 +815,25 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) AND stockmaster.categoryid='" . $_POST['StockCat'] . "' ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; @@ -994,11 +867,16 @@ $DbgMsg = _('The SQL used to retrieve the category details but failed was'); $result1 = DB_query($sql,$db,$ErrMsg,$DbgMsg); - echo '<table class=selection><tr><th colspan=3><font size=3 color=blue>'. _('Search For Stock Items') . '</th>'; + echo '<table class=selection> + <tr> + <th colspan=3><font size=3 color=blue>'. _('Search For Stock Items') . '</th>'; - echo ':</font></tr><tr><td><select name="StockCat">'; + echo ':</font> + </tr> + <tr><td><select name="StockCat">'; - echo '<option selected value="All">' . _('All'); + echo '<option selected value="All">' . _('All') . '</option>'; + while ($myrow1 = DB_fetch_array($result1)) { if (isset($_POST['StockCat']) and $_POST['StockCat']==$myrow1['categoryid']){ echo '<option selected value="'. $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; @@ -1019,16 +897,17 @@ } echo '</select></td> - <td>' . _('Enter text extracts in the description') . ":</td> - <td><input type='text' name='Keywords' size=20 maxlength=25 value='" . $_POST['Keywords'] . "'></td></tr> + <td>' . _('Enter text extracts in the description') . ':</td> + <td><input type="text" name="Keywords" size=20 maxlength=25 value="' . $_POST['Keywords'] . '"></td></tr> <tr><td></td> - <td><font size=3><b>" . _('OR') . ' </b></font>' . _('Enter extract of the Stock Code') . - ":</td> - <td><input type='text' name='StockCode' size=15 maxlength=18 value='" . $_POST['StockCode'] . "'></td> + <td><font size=3><b>' . _('OR') . ' </b></font>' . _('Enter extract of the Stock Code') . ':</td> + <td><input type="text" name="StockCode" size=15 maxlength=18 value="' . $_POST['StockCode'] . '"></td> </tr> <tr><td></td> - <td><font size=3><b>" . _('OR') . ' </b></font><a target="_blank" href="'.$rootpath.'/Stocks.php?">' . _('Create a New Stock Item') . '</a></td></tr> - </table><br /> + <td><font size=3><b>' . _('OR') . ' </b></font><a target="_blank" href="'.$rootpath.'/Stocks.php">' . _('Create a New Stock Item') . '</a></td></tr> + </table> + <br /> + <div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '"> <input type="submit" name="NonStockOrder" value="' . _('Order a non stock item') . '"> </div><br />'; @@ -1070,9 +949,19 @@ $ImageSource = '<i>'._('No Image').'</i>'; } - if (strlen($myrow['unitname'])>0) { - $OrderUnits=$myrow['unitname']; - $ConversionFactor =$myrow['conversionfactor']; + /*Get conversion factor and supplier units if any */ + $sql = "SELECT purchdata.conversionfactor, + purchdata.suppliersuom + FROM purchdata + WHERE purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' + AND purchdata.stockid='" . $myrow['stockid'] . "'"; + $ErrMsg = _('Could not retrieve the purchasing data for the item'); + $PurchDataResult = DB_query($sql,$db,$ErrMsg); + + if (DB_num_rows($PurchDataResult)>0) { + $PurchDataRow = DB_fetch_array($PurchDataResult); + $OrderUnits=$PurchDataRow['suppliersuom']; + $ConversionFactor =$PurchDataRow['conversionfactor']; } else { $OrderUnits=$myrow['units']; $ConversionFactor =1; Modified: trunk/PO_PDFPurchOrder.php =================================================================== --- trunk/PO_PDFPurchOrder.php 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/PO_PDFPurchOrder.php 2011-04-18 07:49:36 UTC (rev 4554) @@ -1,6 +1,7 @@ <?php + /* $Id$*/ -//$PageSecurity = 2; + include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); include('includes/DefinePOClass.php'); @@ -69,31 +70,31 @@ $ErrMsg = _('There was a problem retrieving the purchase order header details for Order Number'). ' ' . $OrderNo . ' ' . _('from the database'); $sql = "SELECT purchorders.supplierno, - suppliers.suppname, - suppliers.address1, - suppliers.address2, - suppliers.address3, - suppliers.address4, - purchorders.comments, - purchorders.orddate, - purchorders.rate, - purchorders.dateprinted, - purchorders.deladd1, - purchorders.deladd2, - purchorders.deladd3, - purchorders.deladd4, - purchorders.deladd5, - purchorders.deladd6, - purchorders.allowprint, - purchorders.requisitionno, - purchorders.initiator, - purchorders.paymentterms, - suppliers.currcode, - purchorders.status, - purchorders.stat_comment - FROM purchorders INNER JOIN suppliers - ON purchorders.supplierno = suppliers.supplierid - WHERE purchorders.orderno='" . $OrderNo ."'"; + suppliers.suppname, + suppliers.address1, + suppliers.address2, + suppliers.address3, + suppliers.address4, + purchorders.comments, + purchorders.orddate, + purchorders.rate, + purchorders.dateprinted, + purchorders.deladd1, + purchorders.deladd2, + purchorders.deladd3, + purchorders.deladd4, + purchorders.deladd5, + purchorders.deladd6, + purchorders.allowprint, + purchorders.requisitionno, + purchorders.initiator, + purchorders.paymentterms, + suppliers.currcode, + purchorders.status, + purchorders.stat_comment + FROM purchorders INNER JOIN suppliers + ON purchorders.supplierno = suppliers.supplierid + WHERE purchorders.orderno='" . $OrderNo ."'"; $result=DB_query($sql,$db, $ErrMsg); if (DB_num_rows($result)==0){ /*There is no order header returned */ $title = _('Print Purchase Order Error'); @@ -101,16 +102,16 @@ echo '<div class="centre"><br /><br /><br />'; prnMsg( _('Unable to Locate Purchase Order Number') . ' : ' . $OrderNo . ' ', 'error'); echo '<br /> - <br /> - <br /> - <table class="table_index"> - <tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?'.SID .'">' . _('Outstanding Purchase Orders') . '</a></li> - <li><a href="'. $rootpath . '/PO_SelectPurchOrder.php?'. SID .'">' . _('Purchase Order Inquiry') . '</a></li> - </td> - </tr> - </table> - </div><br /><br /><br />'; + <br /> + <br /> + <table class="table_index"> + <tr><td class="menu_group_item"> + <li><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?'.SID .'">' . _('Outstanding Purchase Orders') . '</a></li> + <li><a href="'. $rootpath . '/PO_SelectPurchOrder.php?'. SID .'">' . _('Purchase Order Inquiry') . '</a></li> + </td> + </tr> + </table> + </div><br /><br /><br />'; include('includes/footer.inc'); exit(); } elseif (DB_num_rows($result)==1){ /*There is only one order header returned (as it should be!)*/ @@ -192,17 +193,17 @@ $ErrMsg = _('There was a problem retrieving the line details for order number') . ' ' . $OrderNo . ' ' . _('from the database'); $sql = "SELECT itemcode, - deliverydate, - itemdescription, - unitprice, - suppliersunit, - quantityord, - decimalplaces, - conversionfactor, - suppliers_partno - FROM purchorderdetails LEFT JOIN stockmaster - ON purchorderdetails.itemcode=stockmaster.stockid - WHERE orderno ='" . $OrderNo ."'"; + deliverydate, + itemdescription, + unitprice, + suppliersunit, + quantityord, + decimalplaces, + conversionfactor, + suppliers_partno + FROM purchorderdetails LEFT JOIN stockmaster + ON purchorderdetails.itemcode=stockmaster.stockid + WHERE orderno ='" . $OrderNo ."'"; $result=DB_query($sql,$db); } if ($OrderNo=='Preview' or DB_num_rows($result)>0){ @@ -210,7 +211,8 @@ include('includes/PO_PDFOrderPageHeader.inc'); $YPos=$Page_Height - $FormDesign->Data->y; $OrderTotal = 0; - while ((isset($OrderNo) and $OrderNo=='Preview') or (isset($result) and $POLine=DB_fetch_array($result))) { + while ((isset($OrderNo) and $OrderNo=='Preview') + OR (isset($result) and $POLine=DB_fetch_array($result))) { /* If we are previewing the order then fill the * order line with dummy data */ if ($OrderNo=='Preview') { @@ -306,33 +308,33 @@ $StatusComment = date($_SESSION['DefaultDateFormat']) .' - ' . _('Printed by') . '<a href="mailto:'.$_SESSION['UserEmail'] .'">'.$_SESSION['UsersRealName']. '</a><br />' . $POHeader['stat_comment']; $sql = "UPDATE purchorders SET allowprint = 0, - dateprinted = '" . Date('Y-m-d') . "', - status = 'Printed', - stat_comment = '" . $StatusComment . "' - WHERE purchorders.orderno = '" . $OrderNo."'"; + dateprinted = '" . Date('Y-m-d') . "', + status = 'Printed', + stat_comment = '" . $StatusComment . "' + WHERE purchorders.orderno = '" . $OrderNo."'"; $result = DB_query($sql,$db); } } /* There was enough info to either print or email the purchase order */ else { /*the user has just gone into the page need to ask the question whether to print the order or email it to the supplier */ include ('includes/header.inc'); - echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if ($ViewingOnly==1){ - echo '<input type=hidden name="ViewingOnly" VALUE=1>'; + echo '<input type=hidden name="ViewingOnly" value=1>'; } echo '<br /><br />'; - echo '<input type=hidden name="OrderNo" VALUE="'. $OrderNo. '">'; + echo '<input type=hidden name="OrderNo" value="'. $OrderNo. '">'; echo '<table><tr><td>'. _('Print or Email the Order'). '</td><td> <select name="PrintOrEmail">'; if (!isset($_POST['PrintOrEmail'])){ $_POST['PrintOrEmail'] = 'Print'; } if ($_POST['PrintOrEmail']=='Print'){ - echo '<option selected VALUE="Print">'. _('Print'); - echo '<option VALUE="Email">' . _('Email'); + echo '<option selected value="Print">'. _('Print'); + echo '<option value="Email">' . _('Email'); } else { - echo '<option VALUE="Print">'. _('Print'); - echo '<option selected VALUE="Email">'. _('Email'); + echo '<option value="Print">'. _('Print'); + echo '<option selected value="Email">'. _('Email'); } echo '</select></td></tr>'; echo '<tr><td>'. _('Show Amounts on the Order'). '</td><td> @@ -341,29 +343,29 @@ $_POST['ShowAmounts'] = 'Yes'; } if ($_POST['ShowAmounts']=='Yes'){ - echo '<option selected VALUE="Yes">'. _('Yes'); - echo '<option VALUE="No">' . _('No'); + echo '<option selected value="Yes">'. _('Yes'); + echo '<option value="No">' . _('No'); } else { - echo '<option VALUE="Yes">'. _('Yes'); - echo '<option selected VALUE="No">'. _('No'); + echo '<option value="Yes">'. _('Yes'); + echo '<option selected value="No">'. _('No'); } echo '</select></td></tr>'; if ($_POST['PrintOrEmail']=='Email'){ $ErrMsg = _('There was a problem retrieving the contact details for the supplier'); $SQL = "SELECT suppliercontacts.contact, - suppliercontacts.email - FROM suppliercontacts INNER JOIN purchorders - ON suppliercontacts.supplierid=purchorders.supplierno - WHERE purchorders.orderno='".$OrderNo."'"; + suppliercontacts.email + FROM suppliercontacts INNER JOIN purchorders + ON suppliercontacts.supplierid=purchorders.supplierno + WHERE purchorders.orderno='".$OrderNo."'"; $ContactsResult=DB_query($SQL,$db, $ErrMsg); if (DB_num_rows($ContactsResult)>0){ echo '<tr><td>'. _('Email to') .':</td><td><select name="EmailTo">'; while ($ContactDetails = DB_fetch_array($ContactsResult)){ if (strlen($ContactDetails['email'])>2 AND strpos($ContactDetails['email'],'@')>0){ if ($_POST['EmailTo']==$ContactDetails['email']){ - echo '<option selected VALUE="' . $ContactDetails['email'] . '">' . $ContactDetails['Contact'] . ' - ' . $ContactDetails['email'] . '</option>'; + echo '<option selected value="' . $ContactDetails['email'] . '">' . $ContactDetails['Contact'] . ' - ' . $ContactDetails['email'] . '</option>'; } else { - echo '<option VALUE="' . $ContactDetails['email'] . '">' . $ContactDetails['contact'] . ' - ' . $ContactDetails['email'] . '</option>'; + echo '<option value="' . $ContactDetails['email'] . '">' . $ContactDetails['contact'] . ' - ' . $ContactDetails['email'] . '</option>'; } } } @@ -377,7 +379,7 @@ } else { echo '</table>'; } - echo '<br /><div class="centre"><input type=submit name="DoIt" VALUE="' . _('OK') . '"></div>'; + echo '<br /><div class="centre"><input type=submit name="DoIt" value="' . _('OK') . '"></div>'; echo '</form>'; include('includes/footer.inc'); } Modified: trunk/PurchData.php =================================================================== --- trunk/PurchData.php 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/PurchData.php 2011-04-18 07:49:36 UTC (rev 4554) @@ -32,34 +32,42 @@ } if ((isset($_POST['AddRecord']) OR isset($_POST['UpdateRecord'])) AND isset($SupplierID)) { /*Validate Inputs */ - $InputError = 0; /*Start assuming the best */ - if ($StockID == '' OR !isset($StockID)) { - $InputError = 1; - prnMsg(_('There is no stock item set up enter the stock code or select a stock item using the search page'), 'error'); - } - if (!is_numeric($_POST['Price'])) { - $InputError = 1; - unset($_POST['Price']); - prnMsg(_('The price entered was not numeric and a number is expected. No changes have been made to the database'), 'error'); - } - if ($_POST['Price'] == 0) { - prnMsg(_('The price entered is zero') . ' ' . _('Is this intentional?'), 'warn'); - } - if (!is_numeric($_POST['LeadTime'])) { - $InputError = 1; - unset($_POST['LeadTime']); - prnMsg(_('The lead time entered was not numeric a number of days is expected no changes have been made to the database'), 'error'); - } - if (!is_numeric($_POST['MinOrderQty'])) { - $InputError = 1; - unset($_POST['MinOrderQty']); - prnMsg(_('The minimum order quantity was not numeric and a number is expected no changes have been made to the database'), 'error'); - } - if (!is_numeric($_POST['ConversionFactor'])) { - $InputError = 1; - unset($_POST['ConversionFactor']); - prnMsg(_('The conversion factor entered was not numeric') . ' (' . _('a number is expected') . '). ' . _('The conversion factor is the number which the price must be divided by to get the unit price in our unit of measure') . '. <br />' . _('E.g.') . ' ' . _('The supplier sells an item by the tonne and we hold stock by the kg') . '. ' . _('The suppliers price must be divided by 1000 to get to our cost per kg') . '. ' . _('The conversion factor to enter is 1000') . '. <br /><br />' . _('No changes will be made to the database'), 'error'); - } + $InputError = 0; /*Start assuming the best */ + if ($StockID == '' OR !isset($StockID)) { + $InputError = 1; + prnMsg(_('There is no stock item set up enter the stock code or select a stock item using the search page'), 'error'); + } + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price'])))) { + $InputError = 1; + unset($_POST['Price']); + prnMsg(_('The price entered was not numeric and a number is expected. No changes have been made to the database'), 'error'); + } else { + $_POST['Price'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price'])); + } + if ($_POST['Price'] == 0) { + prnMsg(_('The price entered is zero') . ' ' . _('Is this intentional?'), 'warn'); + } + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['LeadTime'])))) { + $InputError = 1; + unset($_POST['LeadTime']); + prnMsg(_('The lead time entered was not numeric a number of days is expected no changes have been made to the database'), 'error'); + } else { + $_POST['LeadTime'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['LeadTime'])); + } + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['MinOrderQty'])))) { + $InputError = 1; + unset($_POST['MinOrderQty']); + prnMsg(_('The minimum order quantity was not numeric and a number is expected no changes have been made to the database'), 'error'); + } else { + $_POST['MinOrderQty'] =doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['MinOrderQty'])); + } + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['ConversionFactor'])))) { + $InputError = 1; + unset($_POST['ConversionFactor']); + prnMsg(_('The conversion factor entered was not numeric') . ' (' . _('a number is expected') . '). ' . _('The conversion factor is the number which the price must be divided by to get the unit price in our unit of measure') . '. <br />' . _('E.g.') . ' ' . _('The supplier sells an item by the tonne and we hold stock by the kg') . '. ' . _('The suppliers price must be divided by 1000 to get to our cost per kg') . '. ' . _('The conversion factor to enter is 1000') . '. <br /><br />' . _('No changes will be made to the database'), 'error'); + } else { + $_POST['ConversionFactor'] =doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['ConversionFactor'])); + } if ($InputError == 0 AND isset($_POST['AddRecord'])) { $sql = "INSERT INTO purchdata (supplierno, stockid, @@ -137,23 +145,21 @@ if (!isset($_GET['Edit'])) { echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . ' ' . _('For Stock Code') . ' - ' . $StockID . '</p><br />'; $sql = "SELECT purchdata.supplierno, - suppliers.suppname, - purchdata.price, - suppliers.currcode, - purchdata.effectivefrom, - unitsofmeasure.unitname, - purchdata.supplierdescription, - purchdata.leadtime, - purchdata.suppliers_partno, - purchdata.minorderqty, - purchdata.preferred, - purchdata.conversionfactor - FROM purchdata INNER JOIN suppliers - ON purchdata.supplierno=suppliers.supplierid - LEFT JOIN unitsofmeasure - ON purchdata.suppliersuom=unitsofmeasure.unitid - WHERE purchdata.stockid = '" . $StockID . "' - ORDER BY purchdata.effectivefrom DESC"; + suppliers.suppname, + purchdata.price, + suppliers.currcode, + purchdata.effectivefrom, + purchdata.suppliersuom, + purchdata.supplierdescription, + purchdata.leadtime, + purchdata.suppliers_partno, + purchdata.minorderqty, + purchdata.preferred, + purchdata.conversionfactor + FROM purchdata INNER JOIN suppliers + ON purchdata.supplierno=suppliers.supplierid + WHERE purchdata.stockid = '" . $StockID . "' + ORDER BY purchdata.effectivefrom DESC"; $ErrMsg = _('The supplier purchasing details for the selected part could not be retrieved because'); $PurchDataResult = DB_query($sql, $db, $ErrMsg); if (DB_num_rows($PurchDataResult) == 0 and $StockID != '') { @@ -206,7 +212,7 @@ </tr>", $myrow['suppname'], number_format($myrow['price'], 3), - $myrow['unitname'], + $myrow['suppliersuom'], $myrow['conversionfactor'], number_format($myrow['price']/$myrow['conversionfactor'],2), $myrow['currcode'], @@ -260,7 +266,7 @@ echo '<td>' . _('Text in Supplier') . ' <b>' . _('CODE') . '</b>:</font></td>'; echo '<td><input type="Text" name="SupplierCode" size=15 maxlength=18></td>'; echo '</tr></table><br />'; - echo '<div class="centre"><input type=submit name="SearchSupplier" VALUE="' . _('Find Suppliers Now') . '"></div></form>'; + echo '<div class="centre"><input type=submit name="SearchSupplier" value="' . _('Find Suppliers Now') . '"></div></form>'; include ('includes/footer.inc'); exit; }; @@ -347,13 +353,20 @@ echo '<tr class="OddTableRows">'; $k++; } - printf("<td><font size=1><input type=submit name='SupplierID' VALUE='%s'</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - </tr>", $myrow['supplierid'], $myrow['suppname'], $myrow['currcode'], $myrow['address1'], $myrow['address2'], $myrow['address3']); + printf('<td><font size=1><input type="submit" name="SupplierID" value="%s"</font></td> + <td><font size=1>%s</font></td> + <td><font size=1>%s</font></td> + <td><font size=1>%s</font></td> + <td><font size=1>%s</font></td> + <td><font size=1>%s</font></td> + </tr>', + $myrow['supplierid'], + $myrow['suppname'], + $myrow['currcode'], + $myrow['address1'], + $myrow['address2'], + $myrow['address3']); + echo '<input type=hidden name=StockID value="' . $StockID . '">'; echo '<input type=hidden name=StockUOM value="' . $StockUOM . '">'; @@ -405,17 +418,18 @@ $_POST['SupplierCode'] = $myrow['suppliers_partno']; $StockUOM=$myrow['units']; } - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table class=selection>'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($SupplierID)) { $SupplierID = ''; } if (isset($_GET['Edit'])) { echo '<tr><td>' . _('Supplier Name') . ':</td> - <td><input type=hidden name="SupplierID" VALUE="' . $SupplierID . '">' . $SupplierID . ' - ' . $SuppName . '<input type=hidden name="WasEffectiveFrom" VALUE="' . $myrow['effectivefrom'] . '"></td></tr>'; + <td><input type=hidden name="SupplierID" value="' . $SupplierID . '">' . $SupplierID . ' - ' . $SuppName . '<input type=hidden name="WasEffectiveFrom" value="' . $myrow['effectivefrom'] . '"></td></tr>'; } else { echo '<tr><td>' . _('Supplier Name') . ':</td> - <input type=hidden name="SupplierID" maxlength=10 size=11 VALUE="' . $SupplierID . '">'; + <input type=hidden name="SupplierID" maxlength=10 size=11 value="' . $SupplierID . '">'; if ($SupplierID!='') { echo '<td>'.$SuppName; } @@ -426,7 +440,7 @@ } echo '</td></tr>'; } - echo '<td><input type=hidden name="StockID" maxlength=10 size=11 VALUE="' . $StockID . '">'; + echo '<td><input type=hidden name="StockID" maxlength=10 size=11 value="' . $StockID . '">'; if (!isset($CurrCode)) { $CurrCode = ''; } @@ -449,57 +463,48 @@ $_POST['MinOrderQty'] = '1'; } echo '<tr><td>' . _('Currency') . ':</td> - <td><input type=hidden name="CurrCode" . VALUE="' . $CurrCode . '">' . $CurrCode . '</td></tr>'; + <td><input type=hidden name="CurrCode" . value="' . $CurrCode . '">' . $CurrCode . '</td></tr>'; echo '<tr><td>' . _('Price') . ' (' . _('in Supplier Currency') . '):</td> - <td><input type="text" class="number" name="Price" maxlength=12 size=12 VALUE=' . number_format($_POST['Price'], $myrow['decimalplaces'] ,'.','') . '></td></tr>'; + <td><input type="text" class="number" name="Price" maxlength=12 size=12 value=' . number_format($_POST['Price'], $myrow['decimalplaces']) . '></td></tr>'; echo '<tr><td>' . _('Date Updated') . ':</td> - <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveFrom" maxlength=10 size=11 VALUE="' . $_POST['EffectiveFrom'] . '"></td></tr>'; + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveFrom" maxlength=10 size=11 value="' . $_POST['EffectiveFrom'] . '"></td></tr>'; echo '<tr><td>' . _('Our Unit of Measure') . ':</td>'; if (isset($SupplierID)) { echo '<td>' . $StockUOM . '</td></tr>'; } echo '<tr><td>' . _('Suppliers Unit of Measure') . ':</td>'; - echo '<td><select name="SuppliersUOM">'; - $sql = 'SELECT * FROM unitsofmeasure'; - $result = DB_query($sql, $db); - while ($myrow = DB_fetch_array($result)) { - if ($_POST['SuppliersUOM'] == $myrow['unitid']) { - echo '<option selected value="' . $myrow['unitid'] . '">' . $myrow['unitname'] . '</option>'; - } else { - echo '<option value="' . $myrow['unitid'] . '">' . $myrow['unitname'] . '</option>'; - } - } - echo '</td></tr>'; + echo '<td><input type="text" name="SuppliersUOM" size="20" maxlength="20" value ="' . $_POST['SuppliersUOM'] . '"/>'; + echo '</td></tr>'; if (!isset($_POST['ConversionFactor']) OR $_POST['ConversionFactor'] == "") { $_POST['ConversionFactor'] = 1; } echo '<tr><td>' . _('Conversion Factor (to our UOM)') . ':</td> - <td><input type=text class=number name="ConversionFactor" maxlength=12 size=12 VALUE=' . $_POST['ConversionFactor'] . '></td></tr>'; + <td><input type=text class=number name="ConversionFactor" maxlength=12 size=12 value=' . $_POST['ConversionFactor'] . '></td></tr>'; echo '<tr><td>' . _('Supplier Stock Code') . ':</td> - <td><input type=text name="SupplierCode" maxlength=15 size=15 VALUE="' . $_POST['SupplierCode'] . '"></td></tr>'; + <td><input type=text name="SupplierCode" maxlength=15 size=15 value="' . $_POST['SupplierCode'] . '"></td></tr>'; echo '<tr><td>' . _('MinOrderQty') . ':</td> - <td><input type=text class=number name="MinOrderQty" maxlength=15 size=15 VALUE="' . $_POST['MinOrderQty'] . '"></td></tr>'; + <td><input type=text class=number name="MinOrderQty" maxlength=15 size=15 value="' . $_POST['MinOrderQty'] . '"></td></tr>'; echo '<tr><td>' . _('Supplier Stock Description') . ':</td> - <td><input type=text name="SupplierDescription" maxlength=50 size=51 VALUE="' . $_POST['SupplierDescription'] . '"></td></tr>'; + <td><input type=text name="SupplierDescription" maxlength=50 size=51 value="' . $_POST['SupplierDescription'] . '"></td></tr>'; if (!isset($_POST['LeadTime']) OR $_POST['LeadTime'] == "") { $_POST['LeadTime'] = 1; } echo '<tr><td>' . _('Lead Time') . ' (' . _('in days from date of order') . '):</td> - <td><input type=text class=number name="LeadTime" maxlength=4 size=5 VALUE=' . $_POST['LeadTime'] . '></td></tr>'; + <td><input type=text class=number name="LeadTime" maxlength=4 size=5 value=' . $_POST['LeadTime'] . '></td></tr>'; echo '<tr><td>' . _('Preferred Supplier') . ':</td> <td><select name="Preferred">'; if ($_POST['Preferred'] == 1) { - echo '<option selected VALUE=1>' . _('Yes') . '</option>'; - echo '<option VALUE=0>' . _('No') . '</option>'; + echo '<option selected value=1>' . _('Yes') . '</option>'; + echo '<option value=0>' . _('No') . '</option>'; } else { - echo '<option VALUE=1>' . _('Yes') . '</option>'; - echo '<option selected VALUE=0>' . _('No') . '</option>'; + echo '<option value=1>' . _('Yes') . '</option>'; + echo '<option selected value=0>' . _('No') . '</option>'; } echo '</select></td></tr></table><br /><div class="centre">'; if (isset($_GET['Edit'])) { - echo '<input type=submit name="UpdateRecord" VALUE="' . _('Update') . '">'; + echo '<input type=submit name="UpdateRecord" value="' . _('Update') . '">'; } else { - echo '<input type=submit name="AddRecord" VALUE="' . _('Add') . '">'; + echo '<input type=submit name="AddRecord" value="' . _('Add') . '">'; } echo '</div>'; echo '<div class="centre">'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/doc/Change.log.html 2011-04-18 07:49:36 UTC (rev 4554) @@ -1,6 +1,11 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> - +<p /> +<p>18/4/11 - Version 4.03.8 Release +<p> +<p>18/4/11 Phil: Update zh_HK.utf8, pt_BR.utf8, fa_IR.utf8 from launchpad translations</p> +<p>18/4/11 Phil: Changed PurchData.php back to now have free form text entry of unit of measure - as suggested by Brian May - think it works better this way</p> +<p>18/4/11 Phil: Removed redundant fields that are not used anywhere from DefinePOClass and the various function to add lines to purchase orders and to update purhcase order lines - netweight, cuft, kgs, itemno, total_quantity etc. all this data can be retrieved without duplication in purchorderdetails</p> <p>16/4/11 Phil: Tim's changes in launchpad fork to 4663 - xhtml syntax fixes</p> <p>15/4/11 Phil: Copy Exson's traditional Chinese back to zh_HK.utf8</p> <p>11/4/11 Ricard: new pcAuthorizeExpenses.php that shows the current balance of the tab to the authorizer. Before the authorizer did not see this information.</p> Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/includes/ConnectDB.inc 2011-04-18 07:49:36 UTC (rev 4554) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.03.7'; //must update manually every time there is a DB change +$Version='4.03.8'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Modified: trunk/includes/DefinePOClass.php =================================================================== --- trunk/includes/DefinePOClass.php 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/includes/DefinePOClass.php 2011-04-18 07:49:36 UTC (rev 4554) @@ -73,19 +73,10 @@ $QtyRecd=0, $GLActName='', $DecimalPlaces=2, - $ItemNo, $SuppliersUnit, $ConversionFactor=1, $LeadTime=1, $Suppliers_PartNo='', - $SubTotal_Amount=0, - $Package=0, - $PcUnit=0, - $NetWeight=0, - $KGs=0, - $CuFt=0, - $Total_Quantity=0, - $Total_Amount=0, $AssetID=0){ if ($Qty!=0 && isset($Qty)){ @@ -107,19 +98,10 @@ $QtyRecd, $GLActName, $DecimalPlaces, - $ItemNo, $SuppliersUnit, $ConversionFactor, $LeadTime, $Suppliers_PartNo, - $SubTotal_Amount, - $Package, - $PcUnit, - $NetWeight, - $KGs, - $CuFt, - $Total_Quantity, - $Total_Amount, $AssetID); $this->LinesOnOrder++; Return 1; @@ -136,19 +118,9 @@ $ReqDelDate, $ShiptRef, $JobRef , - $ItemNo, $SuppliersUnit, $ConversionFactor, - $Suppliers_PartNo, - $SubTotal_Amount, - $Package, - $PcUnit, - $NetWeight, - $KGs, - $CuFt, - $Total_Quantity, - $Total_Amount, - $SuppUOM){ + $Suppliers_PartNo){ $this->LineItems[$LineNo]->ItemDescription = $ItemDescription; $this->LineItems[$LineNo]->Quantity = $Qty; @@ -158,19 +130,9 @@ $this->LineItems[$LineNo]->ReqDelDate = $ReqDelDate; $this->LineItems[$LineNo]->ShiptRef = $ShiptRef; $this->LineItems[$LineNo]->JobRef = $JobRef; - $this->LineItems[$LineNo]->ItemNo = $ItemNo; $this->LineItems[$LineNo]->SuppliersUnit = $SuppliersUnit; $this->LineItems[$LineNo]->ConversionFactor = $ConversionFactor; $this->LineItems[$LineNo]->Suppliers_PartNo = $Suppliers_PartNo; - $this->LineItems[$LineNo]->Subtotal_Amount = $SubTotal_Amount; - $this->LineItems[$LineNo]->Package = $Package; - $this->LineItems[$LineNo]->PcUnit = $PcUnit; - $this->LineItems[$LineNo]->NetWeight = $NetWeight; - $this->LineItems[$LineNo]->KGs = $KGs; - $this->LineItems[$LineNo]->CuFt = $CuFt; - $this->LineItems[$LineNo]->Total_Quantity = $Total_Quantity; - $this->LineItems[$LineNo]->Total_Amount = $Total_Amount; - $this->LineItems[$LineNo]->SuppUOM = $SuppUOM; } function remove_from_order(&$LineNo){ @@ -248,19 +210,10 @@ var $ShiptRef; var $Completed; Var $JobRef; - Var $ItemNo; var $ConversionFactor; var $SuppliersUnit; Var $Suppliers_PartNo; - Var $SubTotal_Amount; Var $LeadTime; - Var $Package; - Var $PcUnit; - Var $NetWeight; - Var $KGs; - Var $CuFt; - Var $Total_Quantity; - Var $Total_Amount; Var $ReceiveQty; //this receipt of stock Var $Deleted; Var $Controlled; @@ -285,19 +238,10 @@ $QtyRecd, $GLActName, $DecimalPlaces, - $ItemNo, $SuppliersUnit, $ConversionFactor, - $Suppliers_PartNo, - $SubTotal_Amount, $LeadTime, - $Package, - $PcUnit, - $NetWeight, - $KGs, - $CuFt, - $Total_Quantity, - $Total_Amount, + $Suppliers_PartNo, $AssetID) { /* Constructor function to add a new LineDetail object with passed params */ @@ -315,18 +259,10 @@ $this->QtyInv = $QtyInv; $this->GLCode = $GLCode; $this->JobRef = $JobRef; - $this->ItemNo = $ItemNo; $this->SuppliersUnit = $SuppliersUnit; $this->ConversionFactor = $ConversionFactor; $this->Suppliers_PartNo = $Suppliers_PartNo; - $this->Subtotal_Amount = $SubTotal_Amount; $this->LeadTime = $LeadTime; - $this->PcUnit = $PcUnit; - $this->NetWeight = $NetWeight; - $this->KGs = $KGs; - $this->CuFt = $CuFt; - $this->Total_Quantity = $Total_Quantity; - $this->Total_Amount = $Total_Amount; if (is_numeric($ShiptRef)){ $this->ShiptRef = $ShiptRef; } else { Modified: trunk/includes/PO_ReadInOrder.inc =================================================================== --- trunk/includes/PO_ReadInOrder.inc 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/includes/PO_ReadInOrder.inc 2011-04-18 07:49:36 UTC (rev 4554) @@ -140,18 +140,9 @@ purchorderdetails.completed, purchorderdetails.jobref, purchorderdetails.stdcostunit, - purchorderdetails.itemno, stockmaster.controlled, stockmaster.serialised, stockmaster.decimalplaces, - purchorderdetails.subtotal_amount, - purchorderdetails.package, - purchorderdetails.pcunit, - purchorderdetails.netweight, - purchorderdetails.kgs, - purchorderdetails.cuft, - purchorderdetails.total_quantity, - purchorderdetails.total_amount, purchorderdetails.assetid, purchorderdetails.conversionfactor, purchorderdetails.suppliersunit, @@ -208,19 +199,10 @@ $myrow['quantityrecd'], $myrow['accountname'], $myrow['decimalplaces'], - $myrow['itemno'], $myrow['suppliersunit'], $myrow['conversionfactor'], + 1, $myrow['suppliers_partno'], - $myrow['subtotal_amount'], - 0, - $myrow['package'], - $myrow['pcunit'], - $myrow['netweight'], - $myrow['kgs'], - $myrow['cuft'], - $myrow['total_quantity'], - $myrow['total_amount'], $myrow['assetid'] ); $_SESSION['PO'.$identifier]->LineItems[$_SESSION['PO'.$identifier]->LinesOnOrder]->PODetailRec = $myrow['podetailitem']; Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-04-18 07:49:36 UTC (rev 4554) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: webERP 3.08\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-... [truncated message content] |
From: <dai...@us...> - 2011-04-18 07:49:49
|
Revision: 4554 http://web-erp.svn.sourceforge.net/web-erp/?rev=4554&view=rev Author: daintree Date: 2011-04-18 07:49:36 +0000 (Mon, 18 Apr 2011) Log Message: ----------- pre 4.03.8 Modified Paths: -------------- trunk/PO_Header.php trunk/PO_Items.php trunk/PO_PDFPurchOrder.php trunk/PurchData.php trunk/doc/Change.log.html trunk/includes/ConnectDB.inc trunk/includes/DefinePOClass.php trunk/includes/PO_ReadInOrder.inc 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/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.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/upgrade3.11.1-4.00.sql trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/PO_Header.php 2011-04-18 07:49:36 UTC (rev 4554) @@ -228,7 +228,7 @@ $_POST['RePrint'] = 0; } - echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PO_Items.php?identifier='.$identifier. "'>"; + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/PO_Items.php?identifier='.$identifier. '">'; echo '<p>'; prnMsg(_('You should automatically be forwarded to the entry of the purchase order line items page') . '. ' . _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . @@ -613,6 +613,7 @@ purchdata.suppliersuom, purchdata.suppliers_partno, purchdata.conversionfactor, + purchdata.leadtime, stockcategory.stockact FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid @@ -626,6 +627,9 @@ if (!isset($PurchItemRow['conversionfactor'])) { $PurchItemRow['conversionfactor']=1; } + if (!isset($PurchItemRow['leadtime'])) { + $PurchItemRow['leadtime']=1; + } $_SESSION['PO'.$identifier]->add_to_order( 1, $Purch_Item, @@ -644,18 +648,10 @@ 0, '', $PurchItemRow['decimalplaces'], - $Purch_Item, $PurchItemRow['suppliersuom'], $PurchItemRow['conversionfactor'], - $PurchItemRow['suppliers_partno'], - $Qty*$PurchItemRow['price'], - '', - 0, - 0, - 0, - 0, - $Qty, - $Qty*$PurchItemRow['price']); + $PurchItemRow['leadtime'], + $PurchItemRow['suppliers_partno'] ); echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PO_Items.php?identifier='.$identifier. "'>"; } Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/PO_Items.php 2011-04-18 07:49:36 UTC (rev 4554) @@ -49,7 +49,6 @@ } else { //ok to update the PO object variables $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Price=(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['SuppPrice'.$POLine->LineNo]))/$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor); } - $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->NetWeight=$_POST['NetWeight'.$POLine->LineNo]; $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ReqDelDate=$_POST['ReqDelDate'.$POLine->LineNo]; } } @@ -202,57 +201,39 @@ foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) { if ($POLine->Deleted==False) { $sql = "INSERT INTO purchorderdetails ( orderno, - itemcode, - deliverydate, - itemdescription, - glcode, - unitprice, - quantityord, - shiptref, - jobref, - itemno, - suppliersunit, - suppliers_partno, - subtotal_amount, - package, - pcunit, - netweight, - kgs, - cuft, - total_quantity, - total_amount, - assetid, - conversionfactor ) - VALUES ( - '" . $_SESSION['PO'.$identifier]->OrderNo . "', - '" . $POLine->StockID . "', - '" . FormatDateForSQL($POLine->ReqDelDate) . "', - '" . $POLine->ItemDescription . "', - '" . $POLine->GLCode . "', - '" . $POLine->Price . "', - '" . $POLine->Quantity . "', - '" . $POLine->ShiptRef . "', - '" . $POLine->JobRef . "', - '" . $POLine->ItemNo . "', - '" . $POLine->SuppliersUnit . "', - '" . $POLine->Suppliers_PartNo . "', - '" . $POLine->SubTotal_Amount . "', - '" . $POLine->Package . "', - '" . $POLine->PcUnit . "', - '" . $POLine->NetWeight . "', - '" . $POLine->KGs . "', - '" . $POLine->CuFt . "', - '" . $POLine->Total_Quantity . "', - '" . $POLine->Total_Amount . "', - '" . $POLine->AssetID . "', - '" . $POLine->ConversionFactor . "')"; + itemcode, + deliverydate, + itemdescription, + glcode, + unitprice, + quantityord, + shiptref, + jobref, + suppliersunit, + suppliers_partno, + assetid, + conversionfactor ) + VALUES ( + '" . $_SESSION['PO'.$identifier]->OrderNo . "', + '" . $POLine->StockID . "', + '" . FormatDateForSQL($POLine->ReqDelDate) . "', + '" . $POLine->ItemDescription . "', + '" . $POLine->GLCode . "', + '" . $POLine->Price . "', + '" . $POLine->Quantity . "', + '" . $POLine->ShiptRef . "', + '" . $POLine->JobRef . "', + '" . $POLine->SuppliersUnit . "', + '" . $POLine->Suppliers_PartNo . "', + '" . $POLine->AssetID . "', + '" . $POLine->ConversionFactor . "')"; $ErrMsg =_('One of the purchase order detail records could not be inserted into the database because'); $DbgMsg =_('The SQL statement used to insert the purchase order detail record and failed was'); $result =DB_query($sql,$db,$ErrMsg,$DbgMsg,true); } } /* end of the loop round the detail line items on the order */ - echo '<p>'; + echo '<p />'; prnMsg(_('Purchase Order') . ' ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . _('on') . ' ' . $_SESSION['PO'.$identifier]->SupplierName . ' ' . _('has been created'),'success'); } else { /*its an existing order need to update the old order info */ @@ -315,17 +296,8 @@ quantityord, shiptref, jobref, - itemno, suppliersunit, suppliers_partno, - subtotal_amount, - package, - pcunit, - netweight, - kgs, - cuft, - total_quantity, - total_amount, assetid, conversionfactor) VALUES ( @@ -338,17 +310,8 @@ '" . $POLine->Quantity . "', '" . $POLine->ShiptRef . "', '" . $POLine->JobRef . "', - '" . $POLine->ItemNo . "', '" . $POLine->SuppliersUnit . "', '" . $POLine->Suppliers_PartNo . "', - '" . $POLine->SubTotal_Amount . "', - '" . $POLine->Package . "', - '" . $POLine->PcUnit . "', - '" . $POLine->NetWeight . "', - '" . $POLine->KGs . "', - '" . $POLine->CuFt . "', - '" . $POLine->Total_Quantity . "', - '" . $POLine->Total_Amount . "', '" . $POLine->AssetID . "', '" . $POLine->ConversionFactor . "')"; @@ -362,17 +325,8 @@ quantityord='" . $POLine->Quantity . "', shiptref='" . $POLine->ShiptRef . "', jobref='" . $POLine->JobRef . "', - itemno='" . $POLine->ItemNo . "', suppliersunit='" . $POLine->SuppliersUnit . "', suppliers_partno='" . $POLine->Suppliers_PartNo . "', - subtotal_amount='" . $POLine->SubTotal_Amount . "', - package='" . $POLine->Package . "', - pcunit='" . $POLine->PcUnit . "', - netweight='" . $POLine->NetWeight . "', - kgs='" . $POLine->KGs . "', - cuft='" . $POLine->CuFt . "', - total_quantity='" . $POLine->Total_Quantity . "', - total_amount='" . $POLine->Total_Amount . "', completed=1, assetid='" . $POLine->AssetID . "', conversionfactor = '" . $POLine->ConversionFactor . "' @@ -386,17 +340,8 @@ quantityord='" . $POLine->Quantity . "', shiptref='" . $POLine->ShiptRef . "', jobref='" . $POLine->JobRef . "', - itemno='" . $POLine->ItemNo . "', suppliersunit='" . $POLine->SuppliersUnit . "', suppliers_partno='" . $POLine->Suppliers_PartNo . "', - subtotal_amount='" . $POLine->SubTotal_Amount . "', - package='" . $POLine->Package . "', - pcunit='" . $POLine->PcUnit . "', - netweight='" . $POLine->NetWeight . "', - kgs='" . $POLine->KGs . "', - cuft='" . $POLine->CuFt . "', - total_quantity='" . $POLine->Total_Quantity . "', - total_amount='" . $POLine->Total_Amount . "', assetid='" . $POLine->AssetID . "', conversionfactor = '" . $POLine->ConversionFactor . "' WHERE podetailitem='" . $POLine->PODetailRec . "'"; @@ -540,19 +485,9 @@ 0, $GLAccountName, 2, - '', $_POST['SuppliersUnit'], 1, '', - '', - ($_POST['Qty']*$_POST['Price']), - '', - '', - '', - '', - '', - $_POST['Qty'], - ($_POST['Qty']*$_POST['Price']), $_POST['AssetID']); include ('includes/PO_UnsetFormVbls.php'); } @@ -592,8 +527,6 @@ stockid, units, decimalplaces, - kgs, - netweight, stockact, accountname FROM stockmaster INNER JOIN stockcategory @@ -612,12 +545,10 @@ conversionfactor, supplierdescription, suppliersuom, - unitname, suppliers_partno, leadtime, MAX(purchdata.effectivefrom) AS latesteffectivefrom - FROM purchdata LEFT JOIN unitsofmeasure - ON purchdata.suppliersuom=unitsofmeasure.unitid + FROM purchdata WHERE purchdata.supplierno = '" . $_SESSION['PO'.$identifier]->SupplierID . "' AND purchdata.effectivefrom <='" . Date('Y-m-d') . "' AND purchdata.stockid = '". $ItemCode . "' @@ -625,7 +556,6 @@ purchdata.conversionfactor, purchdata.supplierdescription, purchdata.suppliersuom, - unitsofmeasure.unitname, purchdata.suppliers_partno, purchdata.leadtime"; @@ -637,14 +567,14 @@ $PurchPrice = $PurchRow['price']/$PurchRow['conversionfactor']; $ConversionFactor = $PurchRow['conversionfactor']; $SupplierDescription = $PurchRow['suppliers_partno'] .' - ' . $PurchRow['supplierdescription']; - $SuppliersUnitOfMeasure = $PurchRow['unitname']; + $SuppliersUnitOfMeasure = $PurchRow['suppliersuom']; $SuppliersPartNo = $PurchRow['suppliers_partno']; $LeadTime = $PurchRow['leadtime']; } else { // no purchasing data setup $PurchPrice = 0; $ConversionFactor = 1; $SupplierDescription = $ItemRow['description']; - $SuppliersUnitOfMeasure = $ItemRow['units']; + $SuppliersUnitOfMeasure = $ItemRow['unitname']; $SuppliersPartNo = ''; $LeadTime = 1; } @@ -666,19 +596,11 @@ 0, $Itemrow['accountname'], $ItemRow['decimalplaces'], - $ItemCode, $SuppliersUnitOfMeasure, $ConversionFactor, $LeadTime, - $SuppliersPartNo, - $Quantity*$PurchPrice, - '', - 0, - $ItemRow['netweight'], - $ItemRow['kgs'], - '', - $Quantity, - $Quantity*$PurchPrice ); + $SuppliersPartNo + ); } else { //no rows returned by the SQL to get the item prnMsg (_('The item code') . ' ' . $ItemCode . ' ' . _('does not exist in the database and therefore cannot be added to the order'),'error'); if ($debug==1){ @@ -711,15 +633,14 @@ echo '<tr> <th>' . _('Item Code') . '</th> <th>' . _('Description') . '</th> - <th>' . _('Weight') . '</th> <th>' . _('Quantity Our Units') . '</th> <th>' . _('Our Unit') .'</th> <th>' . _('Price Our Units') .' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th> <th>' . _('Unit Conversion Factor') . '</th> - <th>' . _('Quantity Supplier Units') . '</th> + <th>' . _('Order Quantity') . '<br />' . _('Supplier Units') . '</th> <th>' . _('Supplier Unit') . '</th> - <th>' . _('Price Supp Units') . ' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th> - <th>' . _('Subtotal') .' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th> + <th>' . _('Order Price') . '<br />' . _('Supp Units') . ' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th> + <th>' . _('Sub-Total') .' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th> <th>' . _('Deliver By') .'</th> </tr>'; @@ -749,7 +670,6 @@ echo '<td>' . $POLine->StockID . '</td> <td>' . $POLine->ItemDescription . '</td> - <td><input type="text" class="number" name="NetWeight' . $POLine->LineNo . '" size="8" value="' . $POLine->NetWeight . '"></td> <td class="number">' . number_format($POLine->Quantity,$POLine->DecimalPlaces) . '</td> <td>' . $POLine->Units . '</td> <td class="number">' . $DisplayPrice . '</td> @@ -759,7 +679,7 @@ <td><input type="text" class="number" name="SuppPrice' . $POLine->LineNo . '" size="10" value="' .number_format(($POLine->Price *$POLine->ConversionFactor),2) .'"></td> <td class="number">' . $DisplayLineTotal . '</td> <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'].'" name="ReqDelDate' . $POLine->LineNo.'" size="10" value="' .$POLine->ReqDelDate .'"></td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . 'identifier='.$identifier. '&Delete=' . $POLine->LineNo . '">' . _('Delete') . '</a></td></tr>'; + <td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier. '&Delete=' . $POLine->LineNo . '">' . _('Delete') . '</a></td></tr>'; $_SESSION['PO'.$identifier]->Total = $_SESSION['PO'.$identifier]->Total + $LineTotal; } } @@ -777,14 +697,15 @@ if (isset($_POST['NonStockOrder'])) { - echo '<br /><table class=selection><tr><td>' . _('Item Description') . '</td>'; + echo '<br /><table class="selection"><tr> + <td>' . _('Item Description') . '</td>'; echo '<td><input type=text name=ItemDescription size=40></td></tr>'; echo '<tr><td>' . _('General Ledger Code') . '</td>'; echo '<td><select name="GLCode">'; - $sql='SELECT accountcode, + $sql="SELECT accountcode, accountname FROM chartmaster - ORDER BY accountcode ASC'; + ORDER BY accountcode ASC"; $result=DB_query($sql, $db); while ($myrow=DB_fetch_array($result)) { @@ -793,7 +714,7 @@ echo '</select></td></tr>'; echo '<tr><td>'._('OR Asset ID'). '</td> <td><select name="AssetID">'; - $AssetsResult = DB_query('SELECT assetid, description, datepurchased FROM fixedassets ORDER BY assetid DESC',$db); + $AssetsResult = DB_query("SELECT assetid, description, datepurchased FROM fixedassets ORDER BY assetid DESC",$db); echo '<option selected value="Not an Asset">' . _('Not an Asset') . '</option>'; while ($AssetRow = DB_fetch_array($AssetsResult)){ if ($AssetRow['datepurchased']=='0000-00-00'){ @@ -831,42 +752,26 @@ $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 AND stockmaster.description " . LIKE . " '" . $SearchString ."' - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) ORDER BY stockmaster.stockid LIMIT " .$_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) AND stockmaster.description " . LIKE . " '". $SearchString ."' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' ORDER BY stockmaster.stockid @@ -880,42 +785,26 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' ORDER BY stockmaster.stockid LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' and stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' ORDER BY stockmaster.stockid @@ -926,41 +815,25 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) AND stockmaster.categoryid='" . $_POST['StockCat'] . "' ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; @@ -994,11 +867,16 @@ $DbgMsg = _('The SQL used to retrieve the category details but failed was'); $result1 = DB_query($sql,$db,$ErrMsg,$DbgMsg); - echo '<table class=selection><tr><th colspan=3><font size=3 color=blue>'. _('Search For Stock Items') . '</th>'; + echo '<table class=selection> + <tr> + <th colspan=3><font size=3 color=blue>'. _('Search For Stock Items') . '</th>'; - echo ':</font></tr><tr><td><select name="StockCat">'; + echo ':</font> + </tr> + <tr><td><select name="StockCat">'; - echo '<option selected value="All">' . _('All'); + echo '<option selected value="All">' . _('All') . '</option>'; + while ($myrow1 = DB_fetch_array($result1)) { if (isset($_POST['StockCat']) and $_POST['StockCat']==$myrow1['categoryid']){ echo '<option selected value="'. $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; @@ -1019,16 +897,17 @@ } echo '</select></td> - <td>' . _('Enter text extracts in the description') . ":</td> - <td><input type='text' name='Keywords' size=20 maxlength=25 value='" . $_POST['Keywords'] . "'></td></tr> + <td>' . _('Enter text extracts in the description') . ':</td> + <td><input type="text" name="Keywords" size=20 maxlength=25 value="' . $_POST['Keywords'] . '"></td></tr> <tr><td></td> - <td><font size=3><b>" . _('OR') . ' </b></font>' . _('Enter extract of the Stock Code') . - ":</td> - <td><input type='text' name='StockCode' size=15 maxlength=18 value='" . $_POST['StockCode'] . "'></td> + <td><font size=3><b>' . _('OR') . ' </b></font>' . _('Enter extract of the Stock Code') . ':</td> + <td><input type="text" name="StockCode" size=15 maxlength=18 value="' . $_POST['StockCode'] . '"></td> </tr> <tr><td></td> - <td><font size=3><b>" . _('OR') . ' </b></font><a target="_blank" href="'.$rootpath.'/Stocks.php?">' . _('Create a New Stock Item') . '</a></td></tr> - </table><br /> + <td><font size=3><b>' . _('OR') . ' </b></font><a target="_blank" href="'.$rootpath.'/Stocks.php">' . _('Create a New Stock Item') . '</a></td></tr> + </table> + <br /> + <div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '"> <input type="submit" name="NonStockOrder" value="' . _('Order a non stock item') . '"> </div><br />'; @@ -1070,9 +949,19 @@ $ImageSource = '<i>'._('No Image').'</i>'; } - if (strlen($myrow['unitname'])>0) { - $OrderUnits=$myrow['unitname']; - $ConversionFactor =$myrow['conversionfactor']; + /*Get conversion factor and supplier units if any */ + $sql = "SELECT purchdata.conversionfactor, + purchdata.suppliersuom + FROM purchdata + WHERE purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' + AND purchdata.stockid='" . $myrow['stockid'] . "'"; + $ErrMsg = _('Could not retrieve the purchasing data for the item'); + $PurchDataResult = DB_query($sql,$db,$ErrMsg); + + if (DB_num_rows($PurchDataResult)>0) { + $PurchDataRow = DB_fetch_array($PurchDataResult); + $OrderUnits=$PurchDataRow['suppliersuom']; + $ConversionFactor =$PurchDataRow['conversionfactor']; } else { $OrderUnits=$myrow['units']; $ConversionFactor =1; Modified: trunk/PO_PDFPurchOrder.php =================================================================== --- trunk/PO_PDFPurchOrder.php 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/PO_PDFPurchOrder.php 2011-04-18 07:49:36 UTC (rev 4554) @@ -1,6 +1,7 @@ <?php + /* $Id$*/ -//$PageSecurity = 2; + include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); include('includes/DefinePOClass.php'); @@ -69,31 +70,31 @@ $ErrMsg = _('There was a problem retrieving the purchase order header details for Order Number'). ' ' . $OrderNo . ' ' . _('from the database'); $sql = "SELECT purchorders.supplierno, - suppliers.suppname, - suppliers.address1, - suppliers.address2, - suppliers.address3, - suppliers.address4, - purchorders.comments, - purchorders.orddate, - purchorders.rate, - purchorders.dateprinted, - purchorders.deladd1, - purchorders.deladd2, - purchorders.deladd3, - purchorders.deladd4, - purchorders.deladd5, - purchorders.deladd6, - purchorders.allowprint, - purchorders.requisitionno, - purchorders.initiator, - purchorders.paymentterms, - suppliers.currcode, - purchorders.status, - purchorders.stat_comment - FROM purchorders INNER JOIN suppliers - ON purchorders.supplierno = suppliers.supplierid - WHERE purchorders.orderno='" . $OrderNo ."'"; + suppliers.suppname, + suppliers.address1, + suppliers.address2, + suppliers.address3, + suppliers.address4, + purchorders.comments, + purchorders.orddate, + purchorders.rate, + purchorders.dateprinted, + purchorders.deladd1, + purchorders.deladd2, + purchorders.deladd3, + purchorders.deladd4, + purchorders.deladd5, + purchorders.deladd6, + purchorders.allowprint, + purchorders.requisitionno, + purchorders.initiator, + purchorders.paymentterms, + suppliers.currcode, + purchorders.status, + purchorders.stat_comment + FROM purchorders INNER JOIN suppliers + ON purchorders.supplierno = suppliers.supplierid + WHERE purchorders.orderno='" . $OrderNo ."'"; $result=DB_query($sql,$db, $ErrMsg); if (DB_num_rows($result)==0){ /*There is no order header returned */ $title = _('Print Purchase Order Error'); @@ -101,16 +102,16 @@ echo '<div class="centre"><br /><br /><br />'; prnMsg( _('Unable to Locate Purchase Order Number') . ' : ' . $OrderNo . ' ', 'error'); echo '<br /> - <br /> - <br /> - <table class="table_index"> - <tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?'.SID .'">' . _('Outstanding Purchase Orders') . '</a></li> - <li><a href="'. $rootpath . '/PO_SelectPurchOrder.php?'. SID .'">' . _('Purchase Order Inquiry') . '</a></li> - </td> - </tr> - </table> - </div><br /><br /><br />'; + <br /> + <br /> + <table class="table_index"> + <tr><td class="menu_group_item"> + <li><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?'.SID .'">' . _('Outstanding Purchase Orders') . '</a></li> + <li><a href="'. $rootpath . '/PO_SelectPurchOrder.php?'. SID .'">' . _('Purchase Order Inquiry') . '</a></li> + </td> + </tr> + </table> + </div><br /><br /><br />'; include('includes/footer.inc'); exit(); } elseif (DB_num_rows($result)==1){ /*There is only one order header returned (as it should be!)*/ @@ -192,17 +193,17 @@ $ErrMsg = _('There was a problem retrieving the line details for order number') . ' ' . $OrderNo . ' ' . _('from the database'); $sql = "SELECT itemcode, - deliverydate, - itemdescription, - unitprice, - suppliersunit, - quantityord, - decimalplaces, - conversionfactor, - suppliers_partno - FROM purchorderdetails LEFT JOIN stockmaster - ON purchorderdetails.itemcode=stockmaster.stockid - WHERE orderno ='" . $OrderNo ."'"; + deliverydate, + itemdescription, + unitprice, + suppliersunit, + quantityord, + decimalplaces, + conversionfactor, + suppliers_partno + FROM purchorderdetails LEFT JOIN stockmaster + ON purchorderdetails.itemcode=stockmaster.stockid + WHERE orderno ='" . $OrderNo ."'"; $result=DB_query($sql,$db); } if ($OrderNo=='Preview' or DB_num_rows($result)>0){ @@ -210,7 +211,8 @@ include('includes/PO_PDFOrderPageHeader.inc'); $YPos=$Page_Height - $FormDesign->Data->y; $OrderTotal = 0; - while ((isset($OrderNo) and $OrderNo=='Preview') or (isset($result) and $POLine=DB_fetch_array($result))) { + while ((isset($OrderNo) and $OrderNo=='Preview') + OR (isset($result) and $POLine=DB_fetch_array($result))) { /* If we are previewing the order then fill the * order line with dummy data */ if ($OrderNo=='Preview') { @@ -306,33 +308,33 @@ $StatusComment = date($_SESSION['DefaultDateFormat']) .' - ' . _('Printed by') . '<a href="mailto:'.$_SESSION['UserEmail'] .'">'.$_SESSION['UsersRealName']. '</a><br />' . $POHeader['stat_comment']; $sql = "UPDATE purchorders SET allowprint = 0, - dateprinted = '" . Date('Y-m-d') . "', - status = 'Printed', - stat_comment = '" . $StatusComment . "' - WHERE purchorders.orderno = '" . $OrderNo."'"; + dateprinted = '" . Date('Y-m-d') . "', + status = 'Printed', + stat_comment = '" . $StatusComment . "' + WHERE purchorders.orderno = '" . $OrderNo."'"; $result = DB_query($sql,$db); } } /* There was enough info to either print or email the purchase order */ else { /*the user has just gone into the page need to ask the question whether to print the order or email it to the supplier */ include ('includes/header.inc'); - echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if ($ViewingOnly==1){ - echo '<input type=hidden name="ViewingOnly" VALUE=1>'; + echo '<input type=hidden name="ViewingOnly" value=1>'; } echo '<br /><br />'; - echo '<input type=hidden name="OrderNo" VALUE="'. $OrderNo. '">'; + echo '<input type=hidden name="OrderNo" value="'. $OrderNo. '">'; echo '<table><tr><td>'. _('Print or Email the Order'). '</td><td> <select name="PrintOrEmail">'; if (!isset($_POST['PrintOrEmail'])){ $_POST['PrintOrEmail'] = 'Print'; } if ($_POST['PrintOrEmail']=='Print'){ - echo '<option selected VALUE="Print">'. _('Print'); - echo '<option VALUE="Email">' . _('Email'); + echo '<option selected value="Print">'. _('Print'); + echo '<option value="Email">' . _('Email'); } else { - echo '<option VALUE="Print">'. _('Print'); - echo '<option selected VALUE="Email">'. _('Email'); + echo '<option value="Print">'. _('Print'); + echo '<option selected value="Email">'. _('Email'); } echo '</select></td></tr>'; echo '<tr><td>'. _('Show Amounts on the Order'). '</td><td> @@ -341,29 +343,29 @@ $_POST['ShowAmounts'] = 'Yes'; } if ($_POST['ShowAmounts']=='Yes'){ - echo '<option selected VALUE="Yes">'. _('Yes'); - echo '<option VALUE="No">' . _('No'); + echo '<option selected value="Yes">'. _('Yes'); + echo '<option value="No">' . _('No'); } else { - echo '<option VALUE="Yes">'. _('Yes'); - echo '<option selected VALUE="No">'. _('No'); + echo '<option value="Yes">'. _('Yes'); + echo '<option selected value="No">'. _('No'); } echo '</select></td></tr>'; if ($_POST['PrintOrEmail']=='Email'){ $ErrMsg = _('There was a problem retrieving the contact details for the supplier'); $SQL = "SELECT suppliercontacts.contact, - suppliercontacts.email - FROM suppliercontacts INNER JOIN purchorders - ON suppliercontacts.supplierid=purchorders.supplierno - WHERE purchorders.orderno='".$OrderNo."'"; + suppliercontacts.email + FROM suppliercontacts INNER JOIN purchorders + ON suppliercontacts.supplierid=purchorders.supplierno + WHERE purchorders.orderno='".$OrderNo."'"; $ContactsResult=DB_query($SQL,$db, $ErrMsg); if (DB_num_rows($ContactsResult)>0){ echo '<tr><td>'. _('Email to') .':</td><td><select name="EmailTo">'; while ($ContactDetails = DB_fetch_array($ContactsResult)){ if (strlen($ContactDetails['email'])>2 AND strpos($ContactDetails['email'],'@')>0){ if ($_POST['EmailTo']==$ContactDetails['email']){ - echo '<option selected VALUE="' . $ContactDetails['email'] . '">' . $ContactDetails['Contact'] . ' - ' . $ContactDetails['email'] . '</option>'; + echo '<option selected value="' . $ContactDetails['email'] . '">' . $ContactDetails['Contact'] . ' - ' . $ContactDetails['email'] . '</option>'; } else { - echo '<option VALUE="' . $ContactDetails['email'] . '">' . $ContactDetails['contact'] . ' - ' . $ContactDetails['email'] . '</option>'; + echo '<option value="' . $ContactDetails['email'] . '">' . $ContactDetails['contact'] . ' - ' . $ContactDetails['email'] . '</option>'; } } } @@ -377,7 +379,7 @@ } else { echo '</table>'; } - echo '<br /><div class="centre"><input type=submit name="DoIt" VALUE="' . _('OK') . '"></div>'; + echo '<br /><div class="centre"><input type=submit name="DoIt" value="' . _('OK') . '"></div>'; echo '</form>'; include('includes/footer.inc'); } Modified: trunk/PurchData.php =================================================================== --- trunk/PurchData.php 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/PurchData.php 2011-04-18 07:49:36 UTC (rev 4554) @@ -32,34 +32,42 @@ } if ((isset($_POST['AddRecord']) OR isset($_POST['UpdateRecord'])) AND isset($SupplierID)) { /*Validate Inputs */ - $InputError = 0; /*Start assuming the best */ - if ($StockID == '' OR !isset($StockID)) { - $InputError = 1; - prnMsg(_('There is no stock item set up enter the stock code or select a stock item using the search page'), 'error'); - } - if (!is_numeric($_POST['Price'])) { - $InputError = 1; - unset($_POST['Price']); - prnMsg(_('The price entered was not numeric and a number is expected. No changes have been made to the database'), 'error'); - } - if ($_POST['Price'] == 0) { - prnMsg(_('The price entered is zero') . ' ' . _('Is this intentional?'), 'warn'); - } - if (!is_numeric($_POST['LeadTime'])) { - $InputError = 1; - unset($_POST['LeadTime']); - prnMsg(_('The lead time entered was not numeric a number of days is expected no changes have been made to the database'), 'error'); - } - if (!is_numeric($_POST['MinOrderQty'])) { - $InputError = 1; - unset($_POST['MinOrderQty']); - prnMsg(_('The minimum order quantity was not numeric and a number is expected no changes have been made to the database'), 'error'); - } - if (!is_numeric($_POST['ConversionFactor'])) { - $InputError = 1; - unset($_POST['ConversionFactor']); - prnMsg(_('The conversion factor entered was not numeric') . ' (' . _('a number is expected') . '). ' . _('The conversion factor is the number which the price must be divided by to get the unit price in our unit of measure') . '. <br />' . _('E.g.') . ' ' . _('The supplier sells an item by the tonne and we hold stock by the kg') . '. ' . _('The suppliers price must be divided by 1000 to get to our cost per kg') . '. ' . _('The conversion factor to enter is 1000') . '. <br /><br />' . _('No changes will be made to the database'), 'error'); - } + $InputError = 0; /*Start assuming the best */ + if ($StockID == '' OR !isset($StockID)) { + $InputError = 1; + prnMsg(_('There is no stock item set up enter the stock code or select a stock item using the search page'), 'error'); + } + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price'])))) { + $InputError = 1; + unset($_POST['Price']); + prnMsg(_('The price entered was not numeric and a number is expected. No changes have been made to the database'), 'error'); + } else { + $_POST['Price'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price'])); + } + if ($_POST['Price'] == 0) { + prnMsg(_('The price entered is zero') . ' ' . _('Is this intentional?'), 'warn'); + } + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['LeadTime'])))) { + $InputError = 1; + unset($_POST['LeadTime']); + prnMsg(_('The lead time entered was not numeric a number of days is expected no changes have been made to the database'), 'error'); + } else { + $_POST['LeadTime'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['LeadTime'])); + } + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['MinOrderQty'])))) { + $InputError = 1; + unset($_POST['MinOrderQty']); + prnMsg(_('The minimum order quantity was not numeric and a number is expected no changes have been made to the database'), 'error'); + } else { + $_POST['MinOrderQty'] =doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['MinOrderQty'])); + } + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['ConversionFactor'])))) { + $InputError = 1; + unset($_POST['ConversionFactor']); + prnMsg(_('The conversion factor entered was not numeric') . ' (' . _('a number is expected') . '). ' . _('The conversion factor is the number which the price must be divided by to get the unit price in our unit of measure') . '. <br />' . _('E.g.') . ' ' . _('The supplier sells an item by the tonne and we hold stock by the kg') . '. ' . _('The suppliers price must be divided by 1000 to get to our cost per kg') . '. ' . _('The conversion factor to enter is 1000') . '. <br /><br />' . _('No changes will be made to the database'), 'error'); + } else { + $_POST['ConversionFactor'] =doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['ConversionFactor'])); + } if ($InputError == 0 AND isset($_POST['AddRecord'])) { $sql = "INSERT INTO purchdata (supplierno, stockid, @@ -137,23 +145,21 @@ if (!isset($_GET['Edit'])) { echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . ' ' . _('For Stock Code') . ' - ' . $StockID . '</p><br />'; $sql = "SELECT purchdata.supplierno, - suppliers.suppname, - purchdata.price, - suppliers.currcode, - purchdata.effectivefrom, - unitsofmeasure.unitname, - purchdata.supplierdescription, - purchdata.leadtime, - purchdata.suppliers_partno, - purchdata.minorderqty, - purchdata.preferred, - purchdata.conversionfactor - FROM purchdata INNER JOIN suppliers - ON purchdata.supplierno=suppliers.supplierid - LEFT JOIN unitsofmeasure - ON purchdata.suppliersuom=unitsofmeasure.unitid - WHERE purchdata.stockid = '" . $StockID . "' - ORDER BY purchdata.effectivefrom DESC"; + suppliers.suppname, + purchdata.price, + suppliers.currcode, + purchdata.effectivefrom, + purchdata.suppliersuom, + purchdata.supplierdescription, + purchdata.leadtime, + purchdata.suppliers_partno, + purchdata.minorderqty, + purchdata.preferred, + purchdata.conversionfactor + FROM purchdata INNER JOIN suppliers + ON purchdata.supplierno=suppliers.supplierid + WHERE purchdata.stockid = '" . $StockID . "' + ORDER BY purchdata.effectivefrom DESC"; $ErrMsg = _('The supplier purchasing details for the selected part could not be retrieved because'); $PurchDataResult = DB_query($sql, $db, $ErrMsg); if (DB_num_rows($PurchDataResult) == 0 and $StockID != '') { @@ -206,7 +212,7 @@ </tr>", $myrow['suppname'], number_format($myrow['price'], 3), - $myrow['unitname'], + $myrow['suppliersuom'], $myrow['conversionfactor'], number_format($myrow['price']/$myrow['conversionfactor'],2), $myrow['currcode'], @@ -260,7 +266,7 @@ echo '<td>' . _('Text in Supplier') . ' <b>' . _('CODE') . '</b>:</font></td>'; echo '<td><input type="Text" name="SupplierCode" size=15 maxlength=18></td>'; echo '</tr></table><br />'; - echo '<div class="centre"><input type=submit name="SearchSupplier" VALUE="' . _('Find Suppliers Now') . '"></div></form>'; + echo '<div class="centre"><input type=submit name="SearchSupplier" value="' . _('Find Suppliers Now') . '"></div></form>'; include ('includes/footer.inc'); exit; }; @@ -347,13 +353,20 @@ echo '<tr class="OddTableRows">'; $k++; } - printf("<td><font size=1><input type=submit name='SupplierID' VALUE='%s'</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - </tr>", $myrow['supplierid'], $myrow['suppname'], $myrow['currcode'], $myrow['address1'], $myrow['address2'], $myrow['address3']); + printf('<td><font size=1><input type="submit" name="SupplierID" value="%s"</font></td> + <td><font size=1>%s</font></td> + <td><font size=1>%s</font></td> + <td><font size=1>%s</font></td> + <td><font size=1>%s</font></td> + <td><font size=1>%s</font></td> + </tr>', + $myrow['supplierid'], + $myrow['suppname'], + $myrow['currcode'], + $myrow['address1'], + $myrow['address2'], + $myrow['address3']); + echo '<input type=hidden name=StockID value="' . $StockID . '">'; echo '<input type=hidden name=StockUOM value="' . $StockUOM . '">'; @@ -405,17 +418,18 @@ $_POST['SupplierCode'] = $myrow['suppliers_partno']; $StockUOM=$myrow['units']; } - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table class=selection>'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($SupplierID)) { $SupplierID = ''; } if (isset($_GET['Edit'])) { echo '<tr><td>' . _('Supplier Name') . ':</td> - <td><input type=hidden name="SupplierID" VALUE="' . $SupplierID . '">' . $SupplierID . ' - ' . $SuppName . '<input type=hidden name="WasEffectiveFrom" VALUE="' . $myrow['effectivefrom'] . '"></td></tr>'; + <td><input type=hidden name="SupplierID" value="' . $SupplierID . '">' . $SupplierID . ' - ' . $SuppName . '<input type=hidden name="WasEffectiveFrom" value="' . $myrow['effectivefrom'] . '"></td></tr>'; } else { echo '<tr><td>' . _('Supplier Name') . ':</td> - <input type=hidden name="SupplierID" maxlength=10 size=11 VALUE="' . $SupplierID . '">'; + <input type=hidden name="SupplierID" maxlength=10 size=11 value="' . $SupplierID . '">'; if ($SupplierID!='') { echo '<td>'.$SuppName; } @@ -426,7 +440,7 @@ } echo '</td></tr>'; } - echo '<td><input type=hidden name="StockID" maxlength=10 size=11 VALUE="' . $StockID . '">'; + echo '<td><input type=hidden name="StockID" maxlength=10 size=11 value="' . $StockID . '">'; if (!isset($CurrCode)) { $CurrCode = ''; } @@ -449,57 +463,48 @@ $_POST['MinOrderQty'] = '1'; } echo '<tr><td>' . _('Currency') . ':</td> - <td><input type=hidden name="CurrCode" . VALUE="' . $CurrCode . '">' . $CurrCode . '</td></tr>'; + <td><input type=hidden name="CurrCode" . value="' . $CurrCode . '">' . $CurrCode . '</td></tr>'; echo '<tr><td>' . _('Price') . ' (' . _('in Supplier Currency') . '):</td> - <td><input type="text" class="number" name="Price" maxlength=12 size=12 VALUE=' . number_format($_POST['Price'], $myrow['decimalplaces'] ,'.','') . '></td></tr>'; + <td><input type="text" class="number" name="Price" maxlength=12 size=12 value=' . number_format($_POST['Price'], $myrow['decimalplaces']) . '></td></tr>'; echo '<tr><td>' . _('Date Updated') . ':</td> - <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveFrom" maxlength=10 size=11 VALUE="' . $_POST['EffectiveFrom'] . '"></td></tr>'; + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveFrom" maxlength=10 size=11 value="' . $_POST['EffectiveFrom'] . '"></td></tr>'; echo '<tr><td>' . _('Our Unit of Measure') . ':</td>'; if (isset($SupplierID)) { echo '<td>' . $StockUOM . '</td></tr>'; } echo '<tr><td>' . _('Suppliers Unit of Measure') . ':</td>'; - echo '<td><select name="SuppliersUOM">'; - $sql = 'SELECT * FROM unitsofmeasure'; - $result = DB_query($sql, $db); - while ($myrow = DB_fetch_array($result)) { - if ($_POST['SuppliersUOM'] == $myrow['unitid']) { - echo '<option selected value="' . $myrow['unitid'] . '">' . $myrow['unitname'] . '</option>'; - } else { - echo '<option value="' . $myrow['unitid'] . '">' . $myrow['unitname'] . '</option>'; - } - } - echo '</td></tr>'; + echo '<td><input type="text" name="SuppliersUOM" size="20" maxlength="20" value ="' . $_POST['SuppliersUOM'] . '"/>'; + echo '</td></tr>'; if (!isset($_POST['ConversionFactor']) OR $_POST['ConversionFactor'] == "") { $_POST['ConversionFactor'] = 1; } echo '<tr><td>' . _('Conversion Factor (to our UOM)') . ':</td> - <td><input type=text class=number name="ConversionFactor" maxlength=12 size=12 VALUE=' . $_POST['ConversionFactor'] . '></td></tr>'; + <td><input type=text class=number name="ConversionFactor" maxlength=12 size=12 value=' . $_POST['ConversionFactor'] . '></td></tr>'; echo '<tr><td>' . _('Supplier Stock Code') . ':</td> - <td><input type=text name="SupplierCode" maxlength=15 size=15 VALUE="' . $_POST['SupplierCode'] . '"></td></tr>'; + <td><input type=text name="SupplierCode" maxlength=15 size=15 value="' . $_POST['SupplierCode'] . '"></td></tr>'; echo '<tr><td>' . _('MinOrderQty') . ':</td> - <td><input type=text class=number name="MinOrderQty" maxlength=15 size=15 VALUE="' . $_POST['MinOrderQty'] . '"></td></tr>'; + <td><input type=text class=number name="MinOrderQty" maxlength=15 size=15 value="' . $_POST['MinOrderQty'] . '"></td></tr>'; echo '<tr><td>' . _('Supplier Stock Description') . ':</td> - <td><input type=text name="SupplierDescription" maxlength=50 size=51 VALUE="' . $_POST['SupplierDescription'] . '"></td></tr>'; + <td><input type=text name="SupplierDescription" maxlength=50 size=51 value="' . $_POST['SupplierDescription'] . '"></td></tr>'; if (!isset($_POST['LeadTime']) OR $_POST['LeadTime'] == "") { $_POST['LeadTime'] = 1; } echo '<tr><td>' . _('Lead Time') . ' (' . _('in days from date of order') . '):</td> - <td><input type=text class=number name="LeadTime" maxlength=4 size=5 VALUE=' . $_POST['LeadTime'] . '></td></tr>'; + <td><input type=text class=number name="LeadTime" maxlength=4 size=5 value=' . $_POST['LeadTime'] . '></td></tr>'; echo '<tr><td>' . _('Preferred Supplier') . ':</td> <td><select name="Preferred">'; if ($_POST['Preferred'] == 1) { - echo '<option selected VALUE=1>' . _('Yes') . '</option>'; - echo '<option VALUE=0>' . _('No') . '</option>'; + echo '<option selected value=1>' . _('Yes') . '</option>'; + echo '<option value=0>' . _('No') . '</option>'; } else { - echo '<option VALUE=1>' . _('Yes') . '</option>'; - echo '<option selected VALUE=0>' . _('No') . '</option>'; + echo '<option value=1>' . _('Yes') . '</option>'; + echo '<option selected value=0>' . _('No') . '</option>'; } echo '</select></td></tr></table><br /><div class="centre">'; if (isset($_GET['Edit'])) { - echo '<input type=submit name="UpdateRecord" VALUE="' . _('Update') . '">'; + echo '<input type=submit name="UpdateRecord" value="' . _('Update') . '">'; } else { - echo '<input type=submit name="AddRecord" VALUE="' . _('Add') . '">'; + echo '<input type=submit name="AddRecord" value="' . _('Add') . '">'; } echo '</div>'; echo '<div class="centre">'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/doc/Change.log.html 2011-04-18 07:49:36 UTC (rev 4554) @@ -1,6 +1,11 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> - +<p /> +<p>18/4/11 - Version 4.03.8 Release +<p> +<p>18/4/11 Phil: Update zh_HK.utf8, pt_BR.utf8, fa_IR.utf8 from launchpad translations</p> +<p>18/4/11 Phil: Changed PurchData.php back to now have free form text entry of unit of measure - as suggested by Brian May - think it works better this way</p> +<p>18/4/11 Phil: Removed redundant fields that are not used anywhere from DefinePOClass and the various function to add lines to purchase orders and to update purhcase order lines - netweight, cuft, kgs, itemno, total_quantity etc. all this data can be retrieved without duplication in purchorderdetails</p> <p>16/4/11 Phil: Tim's changes in launchpad fork to 4663 - xhtml syntax fixes</p> <p>15/4/11 Phil: Copy Exson's traditional Chinese back to zh_HK.utf8</p> <p>11/4/11 Ricard: new pcAuthorizeExpenses.php that shows the current balance of the tab to the authorizer. Before the authorizer did not see this information.</p> Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/includes/ConnectDB.inc 2011-04-18 07:49:36 UTC (rev 4554) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.03.7'; //must update manually every time there is a DB change +$Version='4.03.8'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Modified: trunk/includes/DefinePOClass.php =================================================================== --- trunk/includes/DefinePOClass.php 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/includes/DefinePOClass.php 2011-04-18 07:49:36 UTC (rev 4554) @@ -73,19 +73,10 @@ $QtyRecd=0, $GLActName='', $DecimalPlaces=2, - $ItemNo, $SuppliersUnit, $ConversionFactor=1, $LeadTime=1, $Suppliers_PartNo='', - $SubTotal_Amount=0, - $Package=0, - $PcUnit=0, - $NetWeight=0, - $KGs=0, - $CuFt=0, - $Total_Quantity=0, - $Total_Amount=0, $AssetID=0){ if ($Qty!=0 && isset($Qty)){ @@ -107,19 +98,10 @@ $QtyRecd, $GLActName, $DecimalPlaces, - $ItemNo, $SuppliersUnit, $ConversionFactor, $LeadTime, $Suppliers_PartNo, - $SubTotal_Amount, - $Package, - $PcUnit, - $NetWeight, - $KGs, - $CuFt, - $Total_Quantity, - $Total_Amount, $AssetID); $this->LinesOnOrder++; Return 1; @@ -136,19 +118,9 @@ $ReqDelDate, $ShiptRef, $JobRef , - $ItemNo, $SuppliersUnit, $ConversionFactor, - $Suppliers_PartNo, - $SubTotal_Amount, - $Package, - $PcUnit, - $NetWeight, - $KGs, - $CuFt, - $Total_Quantity, - $Total_Amount, - $SuppUOM){ + $Suppliers_PartNo){ $this->LineItems[$LineNo]->ItemDescription = $ItemDescription; $this->LineItems[$LineNo]->Quantity = $Qty; @@ -158,19 +130,9 @@ $this->LineItems[$LineNo]->ReqDelDate = $ReqDelDate; $this->LineItems[$LineNo]->ShiptRef = $ShiptRef; $this->LineItems[$LineNo]->JobRef = $JobRef; - $this->LineItems[$LineNo]->ItemNo = $ItemNo; $this->LineItems[$LineNo]->SuppliersUnit = $SuppliersUnit; $this->LineItems[$LineNo]->ConversionFactor = $ConversionFactor; $this->LineItems[$LineNo]->Suppliers_PartNo = $Suppliers_PartNo; - $this->LineItems[$LineNo]->Subtotal_Amount = $SubTotal_Amount; - $this->LineItems[$LineNo]->Package = $Package; - $this->LineItems[$LineNo]->PcUnit = $PcUnit; - $this->LineItems[$LineNo]->NetWeight = $NetWeight; - $this->LineItems[$LineNo]->KGs = $KGs; - $this->LineItems[$LineNo]->CuFt = $CuFt; - $this->LineItems[$LineNo]->Total_Quantity = $Total_Quantity; - $this->LineItems[$LineNo]->Total_Amount = $Total_Amount; - $this->LineItems[$LineNo]->SuppUOM = $SuppUOM; } function remove_from_order(&$LineNo){ @@ -248,19 +210,10 @@ var $ShiptRef; var $Completed; Var $JobRef; - Var $ItemNo; var $ConversionFactor; var $SuppliersUnit; Var $Suppliers_PartNo; - Var $SubTotal_Amount; Var $LeadTime; - Var $Package; - Var $PcUnit; - Var $NetWeight; - Var $KGs; - Var $CuFt; - Var $Total_Quantity; - Var $Total_Amount; Var $ReceiveQty; //this receipt of stock Var $Deleted; Var $Controlled; @@ -285,19 +238,10 @@ $QtyRecd, $GLActName, $DecimalPlaces, - $ItemNo, $SuppliersUnit, $ConversionFactor, - $Suppliers_PartNo, - $SubTotal_Amount, $LeadTime, - $Package, - $PcUnit, - $NetWeight, - $KGs, - $CuFt, - $Total_Quantity, - $Total_Amount, + $Suppliers_PartNo, $AssetID) { /* Constructor function to add a new LineDetail object with passed params */ @@ -315,18 +259,10 @@ $this->QtyInv = $QtyInv; $this->GLCode = $GLCode; $this->JobRef = $JobRef; - $this->ItemNo = $ItemNo; $this->SuppliersUnit = $SuppliersUnit; $this->ConversionFactor = $ConversionFactor; $this->Suppliers_PartNo = $Suppliers_PartNo; - $this->Subtotal_Amount = $SubTotal_Amount; $this->LeadTime = $LeadTime; - $this->PcUnit = $PcUnit; - $this->NetWeight = $NetWeight; - $this->KGs = $KGs; - $this->CuFt = $CuFt; - $this->Total_Quantity = $Total_Quantity; - $this->Total_Amount = $Total_Amount; if (is_numeric($ShiptRef)){ $this->ShiptRef = $ShiptRef; } else { Modified: trunk/includes/PO_ReadInOrder.inc =================================================================== --- trunk/includes/PO_ReadInOrder.inc 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/includes/PO_ReadInOrder.inc 2011-04-18 07:49:36 UTC (rev 4554) @@ -140,18 +140,9 @@ purchorderdetails.completed, purchorderdetails.jobref, purchorderdetails.stdcostunit, - purchorderdetails.itemno, stockmaster.controlled, stockmaster.serialised, stockmaster.decimalplaces, - purchorderdetails.subtotal_amount, - purchorderdetails.package, - purchorderdetails.pcunit, - purchorderdetails.netweight, - purchorderdetails.kgs, - purchorderdetails.cuft, - purchorderdetails.total_quantity, - purchorderdetails.total_amount, purchorderdetails.assetid, purchorderdetails.conversionfactor, purchorderdetails.suppliersunit, @@ -208,19 +199,10 @@ $myrow['quantityrecd'], $myrow['accountname'], $myrow['decimalplaces'], - $myrow['itemno'], $myrow['suppliersunit'], $myrow['conversionfactor'], + 1, $myrow['suppliers_partno'], - $myrow['subtotal_amount'], - 0, - $myrow['package'], - $myrow['pcunit'], - $myrow['netweight'], - $myrow['kgs'], - $myrow['cuft'], - $myrow['total_quantity'], - $myrow['total_amount'], $myrow['assetid'] ); $_SESSION['PO'.$identifier]->LineItems[$_SESSION['PO'.$identifier]->LinesOnOrder]->PODetailRec = $myrow['podetailitem']; Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-04-18 07:49:36 UTC (rev 4554) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: webERP 3.08\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-... [truncated message content] |
From: <dai...@us...> - 2011-04-18 00:09:33
|
Revision: 4553 http://web-erp.svn.sourceforge.net/web-erp/?rev=4553&view=rev Author: daintree Date: 2011-04-18 00:09:23 +0000 (Mon, 18 Apr 2011) Log Message: ----------- lang updates, xhtml, closing > Modified Paths: -------------- trunk/Prices_Customer.php trunk/SelectCustomer.php trunk/SelectOrderItems.php trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po Modified: trunk/Prices_Customer.php =================================================================== --- trunk/Prices_Customer.php 2011-04-17 10:18:02 UTC (rev 4552) +++ trunk/Prices_Customer.php 2011-04-18 00:09:23 UTC (rev 4553) @@ -330,7 +330,7 @@ $result = DB_query($sql, $db); echo '<table class=selection>'; echo '<tr><td>' . _('Branch') . ':</td>'; -echo '<td><select name="Branch"'; +echo '<td><select name="Branch">'; while ($myrow=DB_fetch_array($result)) { if ($myrow['branchcode']==$_POST['branch']) { echo '<option selected value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; @@ -338,13 +338,13 @@ echo '<option value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; } } -echo '></td></tr>'; +echo '</select></td></tr>'; echo '<tr><td>' . _('Start Date') . ':</td> <td><input type="Text" name="StartDate" class=date alt='.$_SESSION['DefaultDateFormat']. - ' size=11 maxlength=10 value=' . $_POST['StartDate'] . '></td></tr>'; + ' size=11 maxlength=10 value="' . $_POST['StartDate'] . '"></td></tr>'; echo '<tr><td>' . _('End Date') . ':</td> <td><input type="Text" name="EndDate" class=date alt='.$_SESSION['DefaultDateFormat']. - ' size=11 maxlength=10 value=' . $_POST['EndDate'] . '></td></tr>'; + ' size=11 maxlength=10 value="' . $_POST['EndDate'] . '"></td></tr>'; echo '<tr><td>' . _('Price') . ':</td> <td><input type="Text" class=number name="Price" size=11 maxlength=10 value=' . $_POST['Price'] . '></td> Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2011-04-17 10:18:02 UTC (rev 4552) +++ trunk/SelectCustomer.php 2011-04-18 00:09:23 UTC (rev 4553) @@ -541,8 +541,8 @@ echo '<tr><td colspan=2>'; echo '<table width=45% colspan=2 cellpadding=4>'; echo '<tr><th width=33%>' . _('Customer Mapping') . '</th></tr>'; - echo '</td><td valign=TOp>'; /* Mapping */ - echo '<div class="centre"' . _('Mapping is enabled, Map will display below.') . '</div>'; + echo '</td><td valign="top">'; /* Mapping */ + echo '<div class="centre">' . _('Mapping is enabled, Map will display below.') . '</div>'; echo '<div align="center" id="map" style="width: ' . $map_width . 'px; height: ' . $map_height . 'px"></div><br />'; echo '</th></tr></table>'; } Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-04-17 10:18:02 UTC (rev 4552) +++ trunk/SelectOrderItems.php 2011-04-18 00:09:23 UTC (rev 4553) @@ -658,7 +658,7 @@ echo '<td></td>'; } echo '<td><input tabindex='.($j+5).' type=submit name="SubmitCustomerSelection' . $j .'" value="' . htmlentities($myrow['brname'], ENT_QUOTES,'UTF-8'). '"></td> - <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'].'"><input type="hidden" name="SelectedBranch' . $j .'" value="'. $myrow['branchcode'].'"> + <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'].'"><input type="hidden" name="SelectedBranch' . $j .'" value="'. $myrow['branchcode'].'" /> <td>'.$myrow['contactname'].'</td> <td>'.$myrow['phoneno'].'</td> <td>'.$myrow['faxno'].'</td> Modified: trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po 2011-04-17 10:18:02 UTC (rev 4552) +++ trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po 2011-04-18 00:09:23 UTC (rev 4553) @@ -7,21 +7,21 @@ msgstr "" "Project-Id-Version: Persian & rtl support\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-03-31 20:06+1200\n" -"PO-Revision-Date: 2011-02-18 11:42+0000\n" -"Last-Translator: Mohsen Karimi <Unknown>\n" +"POT-Creation-Date: 2011-01-04 22:15+1200\n" +"PO-Revision-Date: 2011-04-10 22:01+0000\n" +"Last-Translator: پویان <Unknown>\n" "Language-Team: Persian <hos...@io...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-03-31 06:31+0000\n" -"X-Generator: Launchpad (build 12696)\n" +"X-Launchpad-Export-Date: 2011-04-17 23:41+0000\n" +"X-Generator: Launchpad (build 12821)\n" "X-Poedit-Country: IRAN, ISLAMIC REPUBLIC OF\n" "Language: fa\n" "X-Poedit-Language: Persian\n" "X-Poedit-SourceCharset: utf-8\n" -#: AccountGroups.php:9 index.php:1277 +#: AccountGroups.php:9 index.php:1273 msgid "Account Groups" msgstr "گروه حساب" @@ -59,7 +59,7 @@ msgstr "حساب کاربری نام گروه می تواند شخصیت نیست" #: AccountGroups.php:71 AccountSections.php:75 PaymentMethods.php:41 -#: TaxCategories.php:33 TaxProvinces.php:32 UnitsOfMeasure.php:30 +#: TaxCategories.php:33 TaxProvinces.php:32 UnitsOfMeasure.php:32 msgid "or the character" msgstr "و یا شخصیت" @@ -117,7 +117,8 @@ msgstr "درج رکورد" #: AccountGroups.php:176 -msgid "An error occurred in retrieving the group information from chartmaster" +msgid "" +"An error occurred in retrieving the group information from chartmaster" msgstr "خطا رخ داده است در بازیابی اطلاعات از گروه chartmaster" #: AccountGroups.php:181 @@ -132,21 +133,22 @@ #: 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:311 Customers.php:320 -#: Customers.php:328 Customers.php:336 CustomerTypes.php:149 -#: CustomerTypes.php:159 Factors.php:136 FixedAssetCategories.php:131 +#: 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:129 SalesCategories.php:127 SalesCategories.php:135 +#: 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:469 Stocks.php:478 Stocks.php:486 Stocks.php:494 Stocks.php:502 -#: Stocks.php:510 Suppliers.php:613 Suppliers.php:622 Suppliers.php:630 +#: 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:137 -#: WorkCentres.php:90 WorkCentres.php:96 WWW_Access.php:87 +#: TaxGroups.php:135 TaxProvinces.php:127 UnitsOfMeasure.php:142 +#: UnitsOfMeasure.php:149 WorkCentres.php:90 WorkCentres.php:96 +#: WWW_Access.php:87 msgid "There are" msgstr "وجود دارند" @@ -195,17 +197,17 @@ #: 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:272 BOMIndented.php:252 -#: BOMIndentedReverse.php:246 BOMInquiry.php:165 BOMListing.php:128 -#: BOMs.php:214 BOMs.php:793 COGSGLPostings.php:20 CompanyPreferences.php:155 -#: CounterSales.php:1983 CounterSales.php:2107 Credit_Invoice.php:256 +#: 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:104 FixedAssetLocations.php:9 -#: FixedAssetRegister.php:13 FixedAssetRegister.php:238 +#: 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:28 GLJournal.php:228 InventoryPlanning.php:374 +#: 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 @@ -213,24 +215,24 @@ #: 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:256 PurchData.php:275 -#: RecurringSalesOrders.php:311 SalesAnalReptCols.php:51 SalesAnalRepts.php:13 +#: 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:202 -#: SelectCreditItems.php:270 SelectCustomer.php:323 SelectGLAccount.php:19 -#: SelectGLAccount.php:79 SelectOrderItems.php:607 SelectOrderItems.php:1431 -#: SelectOrderItems.php:1555 SelectProduct.php:473 SelectSalesOrder.php:457 +#: 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:62 +#: TaxGroups.php:16 TaxProvinces.php:12 TopItems.php:60 #: WhereUsedInquiry.php:18 WorkCentres.php:111 WorkCentres.php:158 -#: WorkOrderCosting.php:14 WorkOrderEntry.php:10 WorkOrderIssue.php:22 +#: WorkOrderCosting.php:14 WorkOrderEntry.php:12 WorkOrderIssue.php:22 #: WorkOrderReceive.php:15 WorkOrderStatus.php:43 WWW_Access.php:13 -#: WWW_Users.php:33 Z_BottomUpCosts.php:51 +#: WWW_Users.php:38 Z_BottomUpCosts.php:51 msgid "Search" msgstr "جستجو" @@ -238,7 +240,7 @@ msgid "Group Name" msgstr "نام گروه" -#: AccountGroups.php:231 EDIMessageFormat.php:129 EDIMessageFormat.php:207 +#: AccountGroups.php:231 EDIMessageFormat.php:131 msgid "Section" msgstr "قسمت" @@ -260,34 +262,34 @@ #: 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:452 CompanyPreferences.php:454 -#: CompanyPreferences.php:465 CompanyPreferences.php:467 +#: 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:590 Customers.php:847 -#: Customers.php:854 Customers.php:857 DeliveryDetails.php:1034 +#: 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 -#: MRPCalendar.php:222 MRP.php:529 MRP.php:533 MRP.php:537 MRP.php:541 -#: PaymentMethods.php:203 PaymentMethods.php:204 PaymentMethods.php:264 -#: PaymentMethods.php:270 PDFChequeListing.php:63 +#: 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:754 PO_PDFPurchOrder.php:344 PO_PDFPurchOrder.php:347 -#: PurchData.php:192 PurchData.php:494 PurchData.php:497 -#: RecurringSalesOrders.php:483 RecurringSalesOrders.php:486 +#: 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:869 Stocks.php:871 Stocks.php:889 Stocks.php:891 +#: Stocks.php:867 Stocks.php:869 Stocks.php:887 Stocks.php:889 #: SuppContractChgs.php:83 SuppLoginSetup.php:511 SuppLoginSetup.php:513 -#: SystemParameters.php:376 SystemParameters.php:399 SystemParameters.php:415 +#: SystemParameters.php:373 SystemParameters.php:405 SystemParameters.php:450 #: SystemParameters.php:468 SystemParameters.php:476 SystemParameters.php:516 -#: SystemParameters.php:589 SystemParameters.php:598 SystemParameters.php:606 -#: SystemParameters.php:624 SystemParameters.php:631 SystemParameters.php:756 -#: SystemParameters.php:887 SystemParameters.php:889 SystemParameters.php:899 -#: SystemParameters.php:901 SystemParameters.php:955 SystemParameters.php:967 -#: SystemParameters.php:969 TaxGroups.php:292 TaxGroups.php:295 -#: TaxGroups.php:344 WWW_Users.php:605 WWW_Users.php:607 +#: 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 msgid "Yes" msgstr "بلی" @@ -295,60 +297,59 @@ #: 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:451 CompanyPreferences.php:455 -#: CompanyPreferences.php:464 CompanyPreferences.php:468 +#: CompanyPreferences.php:450 CompanyPreferences.php:454 +#: CompanyPreferences.php:462 CompanyPreferences.php:466 #: ContractCosting.php:172 CustLoginSetup.php:589 CustLoginSetup.php:593 -#: CustomerBranches.php:420 Customers.php:589 Customers.php:845 -#: Customers.php:853 Customers.php:856 DeliveryDetails.php:1035 +#: CustomerBranches.php:420 Customers.php:599 Customers.php:855 +#: Customers.php:863 Customers.php:866 DeliveryDetails.php:1035 #: DeliveryDetails.php:1075 DeliveryDetails.php:1078 GLTransInquiry.php:127 -#: MRPCalendar.php:224 MRP.php:527 MRP.php:531 MRP.php:535 MRP.php:539 -#: PaymentMethods.php:203 PaymentMethods.php:204 PaymentMethods.php:265 -#: PaymentMethods.php:271 PDFChequeListing.php:62 +#: Locations.php:375 MRPCalendar.php:224 MRP.php:528 MRP.php:532 MRP.php:536 +#: MRP.php:540 PaymentMethods.php:203 PaymentMethods.php:204 +#: PaymentMethods.php:265 PaymentMethods.php:271 PDFChequeListing.php:62 #: PDFDeliveryDifferences.php:63 PDFDIFOT.php:66 #: PO_AuthorisationLevels.php:134 PO_AuthorisationLevels.php:139 -#: PO_Header.php:753 PO_PDFPurchOrder.php:345 PO_PDFPurchOrder.php:348 -#: PurchData.php:195 PurchData.php:495 PurchData.php:498 -#: RecurringSalesOrders.php:482 RecurringSalesOrders.php:485 +#: PO_Header.php:757 PO_PDFPurchOrder.php:368 PO_PDFPurchOrder.php:371 +#: PurchData.php:192 PurchData.php:470 PurchData.php:473 +#: RecurringSalesOrders.php:478 RecurringSalesOrders.php:481 #: SalesAnalReptCols.php:277 SalesAnalReptCols.php:402 #: SalesAnalReptCols.php:405 SalesAnalRepts.php:405 SalesAnalRepts.php:408 #: SalesAnalRepts.php:431 SalesAnalRepts.php:434 SalesAnalRepts.php:457 #: SalesAnalRepts.php:460 SelectProduct.php:353 ShipmentCosting.php:623 -#: Stocks.php:864 Stocks.php:866 Stocks.php:884 Stocks.php:886 +#: Stocks.php:862 Stocks.php:864 Stocks.php:882 Stocks.php:884 #: SuppContractChgs.php:85 SuppLoginSetup.php:510 SuppLoginSetup.php:514 -#: SystemParameters.php:377 SystemParameters.php:400 SystemParameters.php:416 +#: SystemParameters.php:374 SystemParameters.php:406 SystemParameters.php:451 #: SystemParameters.php:469 SystemParameters.php:477 SystemParameters.php:517 -#: SystemParameters.php:590 SystemParameters.php:599 SystemParameters.php:607 -#: SystemParameters.php:625 SystemParameters.php:632 SystemParameters.php:757 -#: SystemParameters.php:886 SystemParameters.php:890 SystemParameters.php:898 -#: SystemParameters.php:902 SystemParameters.php:956 SystemParameters.php:966 -#: SystemParameters.php:970 TaxGroups.php:293 TaxGroups.php:296 -#: TaxGroups.php:346 WWW_Users.php:604 WWW_Users.php:608 -#: includes/PDFLowGPPageHeader.inc:44 includes/PDFTaxPageHeader.inc:35 +#: SystemParameters.php:590 SystemParameters.php:598 SystemParameters.php:616 +#: SystemParameters.php:623 SystemParameters.php:747 SystemParameters.php:876 +#: SystemParameters.php:880 SystemParameters.php:888 SystemParameters.php:892 +#: SystemParameters.php:946 SystemParameters.php:956 SystemParameters.php:960 +#: TaxGroups.php:293 TaxGroups.php:296 TaxGroups.php:346 WWW_Users.php:609 +#: WWW_Users.php:613 includes/PDFLowGPPageHeader.inc:44 +#: includes/PDFTaxPageHeader.inc:35 msgid "No" msgstr "خیر" #: AccountGroups.php:265 AccountSections.php:197 AddCustomerContacts.php:131 #: AddCustomerNotes.php:125 AddCustomerTypeNotes.php:123 Areas.php:165 #: BankAccounts.php:226 BOMs.php:150 COGSGLPostings.php:113 -#: COGSGLPostings.php:215 CreditStatus.php:175 Currencies.php:239 -#: CustLoginSetup.php:312 CustomerBranches.php:424 Customers.php:899 -#: Customers.php:931 CustomerTypes.php:205 EDIMessageFormat.php:150 -#: Factors.php:208 FixedAssetCategories.php:181 FixedAssetLocations.php:102 +#: COGSGLPostings.php:218 CreditStatus.php:175 Currencies.php:239 +#: CustLoginSetup.php:312 CustomerBranches.php:424 Customers.php:909 +#: Customers.php:941 CustomerTypes.php:205 EDIMessageFormat.php:152 +#: Factors.php:208 FixedAssetCategories.php:182 FixedAssetLocations.php:102 #: FreightCosts.php:243 GeocodeSetup.php:169 GLAccounts.php:319 GLTags.php:62 -#: Labels.php:414 Locations.php:380 MRPDemands.php:304 MRPDemandTypes.php:122 +#: Labels.php:414 Locations.php:382 MRPDemands.php:304 MRPDemandTypes.php:122 #: PaymentMethods.php:205 PaymentTerms.php:203 PcAssignCashToTab.php:251 -#: PcClaimExpensesFromTab.php:229 PcExpenses.php:186 PcTabs.php:188 -#: PcTypeTabs.php:174 PO_AuthorisationLevels.php:148 Prices_Customer.php:283 -#: Prices.php:227 PurchData.php:207 SalesCategories.php:263 +#: PcClaimExpensesFromTab.php:229 PcExpenses.php:176 PcTabs.php:188 +#: PcTypeTabs.php:171 PO_AuthorisationLevels.php:148 Prices_Customer.php:283 +#: Prices.php:227 PurchData.php:202 SalesCategories.php:263 #: SalesGLPostings.php:135 SalesGLPostings.php:247 SalesPeople.php:210 -#: SalesTypes.php:206 SelectCustomer.php:610 SelectCustomer.php:626 -#: SelectCustomer.php:648 SelectCustomer.php:664 SelectCustomer.php:686 -#: SelectCustomer.php:702 Shippers.php:144 StockCategories.php:244 -#: SupplierContacts.php:153 SupplierTypes.php:192 SuppLoginSetup.php:274 +#: SalesTypes.php:206 SelectCustomer.php:607 SelectCustomer.php:623 +#: SelectCustomer.php:645 SelectCustomer.php:661 SelectCustomer.php:683 +#: SelectCustomer.php:699 Shippers.php:144 StockCategories.php:244 +#: SupplierContacts.php:156 SupplierTypes.php:192 SuppLoginSetup.php:274 #: TaxAuthorities.php:173 TaxCategories.php:184 TaxGroups.php:179 -#: TaxProvinces.php:178 UnitsOfMeasure.php:187 WorkCentres.php:138 -#: WWW_Access.php:127 WWW_Users.php:307 includes/InputSerialItems.php:88 -#: includes/OutputSerialItems.php:21 +#: TaxProvinces.php:178 UnitsOfMeasure.php:201 WorkCentres.php:138 +#: WWW_Access.php:127 WWW_Users.php:312 includes/InputSerialItems.php:88 #, php-format msgid "Edit" msgstr "ویرایش" @@ -356,32 +357,31 @@ #: AccountGroups.php:266 AccountSections.php:201 AddCustomerContacts.php:132 #: AddCustomerNotes.php:126 AddCustomerTypeNotes.php:124 Areas.php:166 #: BankAccounts.php:227 BOMs.php:152 COGSGLPostings.php:114 -#: COGSGLPostings.php:216 ContractBOM.php:272 ContractOtherReqts.php:121 -#: CounterSales.php:781 Credit_Invoice.php:385 CreditStatus.php:176 -#: Currencies.php:242 CustLoginSetup.php:313 CustomerReceipt.php:863 -#: Customers.php:932 CustomerTypes.php:206 DiscountCategories.php:204 -#: DiscountMatrix.php:178 EDIMessageFormat.php:151 -#: FixedAssetCategories.php:182 FreightCosts.php:244 GeocodeSetup.php:170 -#: GLAccounts.php:320 GLJournal.php:385 Labels.php:414 Locations.php:381 +#: COGSGLPostings.php:219 ContractBOM.php:272 ContractOtherReqts.php:121 +#: CounterSales.php:741 Credit_Invoice.php:386 CreditStatus.php:176 +#: Currencies.php:242 CustLoginSetup.php:313 CustomerReceipt.php:866 +#: Customers.php:942 CustomerTypes.php:206 DiscountCategories.php:204 +#: DiscountMatrix.php:178 EDIMessageFormat.php:153 +#: FixedAssetCategories.php:183 FreightCosts.php:244 GeocodeSetup.php:170 +#: GLAccounts.php:320 GLJournal.php:403 Labels.php:414 Locations.php:383 #: MRPDemands.php:305 MRPDemandTypes.php:123 PaymentMethods.php:206 -#: Payments.php:959 PaymentTerms.php:204 PcAssignCashToTab.php:255 -#: PcClaimExpensesFromTab.php:230 PcExpenses.php:187 PcExpensesTypeTab.php:164 -#: PcTabs.php:189 PcTypeTabs.php:175 PO_AuthorisationLevels.php:150 -#: PO_Items.php:762 Prices_Customer.php:284 Prices.php:228 PurchData.php:208 +#: Payments.php:961 PaymentTerms.php:204 PcAssignCashToTab.php:255 +#: PcClaimExpensesFromTab.php:230 PcExpenses.php:177 PcExpensesTypeTab.php:161 +#: PcTabs.php:189 PcTypeTabs.php:172 PO_AuthorisationLevels.php:150 +#: PO_Items.php:976 Prices_Customer.php:284 Prices.php:228 PurchData.php:203 #: SalesAnalReptCols.php:294 SalesAnalRepts.php:305 SalesCategories.php:264 #: SalesGLPostings.php:136 SalesGLPostings.php:248 SalesPeople.php:211 -#: SalesTypes.php:207 SelectCreditItems.php:745 SelectCustomer.php:611 -#: SelectCustomer.php:627 SelectCustomer.php:649 SelectCustomer.php:665 -#: SelectCustomer.php:687 SelectCustomer.php:703 SelectOrderItems.php:1358 +#: SalesTypes.php:207 SelectCreditItems.php:747 SelectCustomer.php:608 +#: SelectCustomer.php:624 SelectCustomer.php:646 SelectCustomer.php:662 +#: SelectCustomer.php:684 SelectCustomer.php:700 SelectOrderItems.php:1363 #: Shipments.php:424 Shippers.php:145 SpecialOrder.php:590 #: StockCategories.php:245 StockCategories.php:539 SuppContractChgs.php:91 -#: SuppCreditGRNs.php:93 SuppFixedAssetChgs.php:81 SuppInvGRNs.php:135 -#: SupplierContacts.php:154 SupplierTypes.php:194 SuppLoginSetup.php:275 +#: SuppCreditGRNs.php:93 SuppFixedAssetChgs.php:87 SuppInvGRNs.php:135 +#: SupplierContacts.php:157 SupplierTypes.php:194 SuppLoginSetup.php:275 #: SuppShiptChgs.php:86 SuppTransGLAnalysis.php:111 TaxAuthorities.php:174 #: TaxCategories.php:185 TaxGroups.php:180 TaxProvinces.php:179 -#: UnitsOfMeasure.php:188 WorkCentres.php:139 WOSerialNos.php:300 -#: WWW_Access.php:128 WWW_Users.php:308 includes/InputSerialItemsKeyed.php:57 -#: includes/OutputSerialItems.php:98 +#: UnitsOfMeasure.php:202 WorkCentres.php:139 WOSerialNos.php:300 +#: WWW_Access.php:128 WWW_Users.php:313 includes/InputSerialItemsKeyed.php:54 #, php-format msgid "Delete" msgstr "حذف" @@ -425,23 +425,23 @@ #: AccountGroups.php:401 AccountSections.php:262 AddCustomerContacts.php:208 #: AddCustomerNotes.php:201 AddCustomerTypeNotes.php:192 Areas.php:222 -#: BankAccounts.php:373 BOMs.php:725 COGSGLPostings.php:353 +#: BankAccounts.php:373 BOMs.php:725 COGSGLPostings.php:347 #: CreditStatus.php:247 Currencies.php:339 CustLoginSetup.php:611 -#: DiscountMatrix.php:141 EDIMessageFormat.php:247 -#: FixedAssetCategories.php:327 FixedAssetLocations.php:148 +#: DiscountMatrix.php:141 EDIMessageFormat.php:249 +#: FixedAssetCategories.php:328 FixedAssetLocations.php:148 #: FreightCosts.php:342 GeocodeSetup.php:266 GLAccounts.php:269 -#: Locations.php:558 MRPDemands.php:402 MRPDemandTypes.php:182 +#: Locations.php:553 MRPDemands.php:402 MRPDemandTypes.php:182 #: OffersReceived.php:52 OffersReceived.php:128 PaymentMethods.php:276 #: PaymentTerms.php:282 PO_AuthorisationLevels.php:217 Prices_Customer.php:372 #: SalesAnalReptCols.php:510 SalesAnalRepts.php:496 SalesGLPostings.php:415 #: SalesPeople.php:302 Shippers.php:196 StockCategories.php:561 -#: SupplierContacts.php:250 SuppLoginSetup.php:532 TaxAuthorities.php:313 -#: TaxCategories.php:235 TaxProvinces.php:229 UnitsOfMeasure.php:239 -#: WorkCentres.php:261 WWW_Users.php:638 +#: SupplierContacts.php:251 SuppLoginSetup.php:532 TaxAuthorities.php:313 +#: TaxCategories.php:235 TaxProvinces.php:229 UnitsOfMeasure.php:253 +#: WorkCentres.php:261 WWW_Users.php:643 msgid "Enter Information" msgstr "ورود اطلاعات" -#: AccountSections.php:9 index.php:1282 +#: AccountSections.php:9 index.php:1278 msgid "Account Sections" msgstr "بخش ها حساب کاربری" @@ -501,8 +501,8 @@ msgid "Could not retrieve the requested section please try again." msgstr "نمی توان بازیابی بخش های درخواست شده لطفا دوباره سعی کنید." -#: AddCustomerContacts.php:6 AddCustomerContacts.php:59 SelectCustomer.php:604 -#: SelectCustomer.php:633 +#: AddCustomerContacts.php:6 AddCustomerContacts.php:59 SelectCustomer.php:601 +#: SelectCustomer.php:630 msgid "Customer Contacts" msgstr "تماس با ما مشتریان" @@ -533,10 +533,10 @@ #: AddCustomerContacts.php:59 AddCustomerNotes.php:49 #: AddCustomerTypeNotes.php:49 Areas.php:74 CustomerTypes.php:71 -#: DeliveryDetails.php:748 Factors.php:117 FixedAssetItems.php:236 -#: PcAssignCashToTab.php:73 PcClaimExpensesFromTab.php:61 PcExpenses.php:70 -#: PcTabs.php:60 PcTypeTabs.php:62 PO_Items.php:411 SalesAnalReptCols.php:129 -#: SalesPeople.php:94 SalesTypes.php:63 Stocks.php:353 Suppliers.php:514 +#: DeliveryDetails.php:748 Factors.php:117 FixedAssetItems.php:230 +#: PcAssignCashToTab.php:73 PcClaimExpensesFromTab.php:61 PcExpenses.php:60 +#: PcTabs.php:60 PcTypeTabs.php:59 PO_Items.php:381 SalesAnalReptCols.php:129 +#: SalesPeople.php:94 SalesTypes.php:63 Stocks.php:355 Suppliers.php:514 #: SupplierTypes.php:69 msgid "has been updated" msgstr "به روز شده است" @@ -549,31 +549,31 @@ msgid "The contact record has been deleted" msgstr "تماس با سابقه حذف شده است" -#: AddCustomerContacts.php:112 CompanyPreferences.php:224 -#: CustomerBranches.php:377 Customers.php:889 Customers.php:895 -#: Customers.php:961 SalesPeople.php:185 SelectCustomer.php:606 -#: StockDispatch.php:186 StockDispatch.php:198 SupplierContacts.php:141 -#: SupplierCredit.php:437 SupplierInvoice.php:408 SuppTransGLAnalysis.php:96 +#: AddCustomerContacts.php:112 CompanyPreferences.php:229 +#: CustomerBranches.php:377 Customers.php:899 Customers.php:905 +#: Customers.php:971 SalesPeople.php:185 SelectCustomer.php:603 +#: StockDispatch.php:186 StockDispatch.php:198 SupplierContacts.php:144 +#: SupplierCredit.php:433 SupplierInvoice.php:407 SuppTransGLAnalysis.php:96 #: includes/InputSerialItemsFile.php:84 includes/InputSerialItemsFile.php:124 #: includes/PDFTaxPageHeader.inc:37 msgid "Name" msgstr "نام" -#: AddCustomerContacts.php:113 AddCustomerContacts.php:190 Customers.php:890 -#: Customers.php:896 Customers.php:962 SelectCustomer.php:607 +#: AddCustomerContacts.php:113 AddCustomerContacts.php:190 Customers.php:900 +#: Customers.php:906 Customers.php:972 SelectCustomer.php:604 #: WWW_Access.php:111 WWW_Access.php:172 msgid "Role" msgstr "نقش" -#: AddCustomerContacts.php:114 Customers.php:963 +#: AddCustomerContacts.php:114 Customers.php:973 msgid "Phone no" msgstr "تلفن" -#: AddCustomerContacts.php:115 AddCustomerContacts.php:202 Customers.php:892 -#: Customers.php:898 Customers.php:964 PcAssignCashToTab.php:216 +#: AddCustomerContacts.php:115 AddCustomerContacts.php:202 Customers.php:902 +#: Customers.php:908 Customers.php:974 PcAssignCashToTab.php:216 #: PcAssignCashToTab.php:341 PcAuthorizeExpenses.php:85 #: PcClaimExpensesFromTab.php:195 PcClaimExpensesFromTab.php:348 -#: PcReportTab.php:348 SelectCustomer.php:609 SystemParameters.php:316 +#: PcReportTab.php:348 SelectCustomer.php:606 SystemParameters.php:313 #: WOSerialNos.php:277 WOSerialNos.php:279 msgid "Notes" msgstr "یادداشت ها" @@ -586,20 +586,20 @@ msgid "Contact Code" msgstr "تماس با کد" -#: AddCustomerContacts.php:184 Factors.php:279 SupplierContacts.php:218 +#: AddCustomerContacts.php:184 Factors.php:279 SupplierContacts.php:219 msgid "Contact Name" msgstr "نام تماس با ما" -#: AddCustomerContacts.php:196 Contracts.php:777 PDFRemittanceAdvice.php:247 -#: PO_Header.php:956 PO_Header.php:1026 SelectCreditItems.php:223 -#: SelectCustomer.php:464 SelectOrderItems.php:639 -#: includes/PDFStatementPageHeader.inc:63 includes/PDFTransPageHeader.inc:117 +#: AddCustomerContacts.php:196 Contracts.php:766 PDFRemittanceAdvice.php:247 +#: PO_Header.php:958 PO_Header.php:1028 SelectCreditItems.php:225 +#: SelectCustomer.php:461 SelectOrderItems.php:638 +#: includes/PDFStatementPageHeader.inc:63 includes/PDFTransPageHeader.inc:113 #: includes/PDFTransPageHeaderPortrait.inc:105 msgid "Phone" msgstr "تلفن" -#: AddCustomerNotes.php:6 AddCustomerNotes.php:49 SelectCustomer.php:641 -#: SelectCustomer.php:671 +#: AddCustomerNotes.php:6 AddCustomerNotes.php:49 SelectCustomer.php:638 +#: SelectCustomer.php:668 msgid "Customer Notes" msgstr "مشتری یادداشت ها" @@ -640,29 +640,28 @@ #: GLAccountReport.php:369 GLTransInquiry.php:45 MRPCalendar.php:217 #: PaymentAllocations.php:77 PcAssignCashToTab.php:212 #: PcAuthorizeExpenses.php:81 PDFRemittanceAdvice.php:308 -#: PrintCustTrans.php:616 PrintCustTransPortrait.php:790 ReverseGRN.php:378 +#: PrintCustTrans.php:678 PrintCustTransPortrait.php:860 ReverseGRN.php:378 #: ShipmentCosting.php:503 ShipmentCosting.php:574 Shipments.php:467 #: StockDispatch.php:188 StockDispatch.php:200 StockLocMovements.php:85 #: StockMovements.php:98 StockSerialItemResearch.php:79 #: SupplierAllocations.php:464 SupplierAllocations.php:576 #: SupplierAllocations.php:646 SupplierInquiry.php:195 #: SupplierTransInquiry.php:89 includes/PDFQuotationPageHeader.inc:91 -#: includes/PDFQuotationPortraitPageHeader.inc:90 #: includes/PDFStatementPageHeader.inc:169 includes/PDFTaxPageHeader.inc:36 -#: includes/PDFTransPageHeader.inc:84 +#: includes/PDFTransPageHeader.inc:80 #: includes/PDFTransPageHeaderPortrait.inc:58 msgid "Date" msgstr "تاریخ" #: AddCustomerNotes.php:107 AddCustomerTypeNotes.php:105 PcReportTab.php:176 -#: Stocks.php:873 UpgradeDatabase.php:147 UpgradeDatabase.php:150 -#: UpgradeDatabase.php:153 UpgradeDatabase.php:156 UpgradeDatabase.php:159 -#: UpgradeDatabase.php:162 UpgradeDatabase.php:165 UpgradeDatabase.php:168 -#: Z_Upgrade_3.10-3.11.php:62 Z_Upgrade_3.10-3.11.php:66 -#: Z_Upgrade_3.10-3.11.php:70 Z_Upgrade_3.10-3.11.php:74 -#: Z_Upgrade_3.10-3.11.php:78 Z_Upgrade_3.11-4.00.php:62 -#: Z_Upgrade_3.11-4.00.php:66 Z_Upgrade_3.11-4.00.php:70 -#: Z_Upgrade_3.11-4.00.php:74 Z_Upgrade_3.11-4.00.php:78 +#: Stocks.php:871 UpgradeDatabase.php:145 UpgradeDatabase.php:148 +#: UpgradeDatabase.php:151 UpgradeDatabase.php:154 UpgradeDatabase.php:157 +#: UpgradeDatabase.php:160 UpgradeDatabase.php:163 Z_Upgrade_3.10-3.11.php:62 +#: Z_Upgrade_3.10-3.11.php:66 Z_Upgrade_3.10-3.11.php:70 +#: Z_Upgrade_3.10-3.11.php:74 Z_Upgrade_3.10-3.11.php:78 +#: Z_Upgrade_3.11-4.00.php:62 Z_Upgrade_3.11-4.00.php:66 +#: Z_Upgrade_3.11-4.00.php:70 Z_Upgrade_3.11-4.00.php:74 +#: Z_Upgrade_3.11-4.00.php:78 msgid "Note" msgstr "یادداشت" @@ -687,7 +686,7 @@ msgid "Contact Note" msgstr "تماس با تبصره" -#: AddCustomerTypeNotes.php:6 SelectCustomer.php:679 +#: AddCustomerTypeNotes.php:6 SelectCustomer.php:676 msgid "Customer Type (Group) Notes" msgstr "نوع مشتری (گروه) یادداشت ها" @@ -695,7 +694,7 @@ msgid "The Contact priority must be an integer." msgstr "تماس با اولویت باید یک عدد صحیح باشد." -#: AddCustomerTypeNotes.php:49 SelectCustomer.php:709 +#: AddCustomerTypeNotes.php:49 SelectCustomer.php:706 msgid "Customer Group Notes" msgstr "یادداشت های مشتریان گروه" @@ -740,26 +739,26 @@ msgstr "سالمندان مشتریان تجزیه و تحلیل حساب کاربری" #: AgedDebtors.php:267 AgedDebtors.php:365 AgedDebtors.php:436 -#: AgedSuppliers.php:105 BOMExtendedQty.php:159 BOMIndented.php:150 -#: BOMIndentedReverse.php:151 BOMListing.php:48 BOMListing.php:59 +#: AgedSuppliers.php:105 BOMExtendedQty.php:156 BOMIndented.php:149 +#: BOMIndentedReverse.php:148 BOMListing.php:48 BOMListing.php:59 #: DebtorsAtPeriodEnd.php:58 DebtorsAtPeriodEnd.php:70 GLBalanceSheet.php:90 #: GLBalanceSheet.php:128 GLProfit_Loss.php:157 GLTagProfit_Loss.php:174 #: GLTrialBalance.php:151 InventoryPlanning.php:99 InventoryPlanning.php:174 -#: InventoryPlanning.php:209 InventoryPlanning.php:257 -#: InventoryPlanning.php:295 InventoryPlanningPrefSupplier.php:208 +#: InventoryPlanning.php:209 InventoryPlanning.php:252 +#: InventoryPlanning.php:290 InventoryPlanningPrefSupplier.php:208 #: InventoryPlanningPrefSupplier.php:276 InventoryPlanningPrefSupplier.php:310 -#: InventoryPlanningPrefSupplier.php:355 InventoryPlanningPrefSupplier.php:401 +#: InventoryPlanningPrefSupplier.php:353 InventoryPlanningPrefSupplier.php:401 #: InventoryQuantities.php:83 InventoryValuation.php:76 -#: MailInventoryValuation.php:115 MRPPlannedPurchaseOrders.php:114 +#: MailInventoryValuation.php:115 MRPPlannedPurchaseOrders.php:111 #: MRPPlannedWorkOrders.php:105 MRPReport.php:147 MRPReport.php:529 -#: MRPReschedules.php:46 MRPReschedules.php:58 MRPShortages.php:145 -#: MRPShortages.php:157 OutstandingGRNs.php:51 OutstandingGRNs.php:63 +#: MRPReschedules.php:46 MRPReschedules.php:58 MRPShortages.php:137 +#: MRPShortages.php:149 OutstandingGRNs.php:51 OutstandingGRNs.php:63 #: PDFCustomerList.php:20 PDFCustomerList.php:232 PDFCustomerList.php:244 #: PDFLowGP.php:23 PDFStockCheckComparison.php:35 #: PDFStockCheckComparison.php:61 PDFStockCheckComparison.php:262 #: ReorderLevel.php:59 SelectAsset.php:36 SelectProduct.php:37 #: StockCheck.php:65 StockCheck.php:139 SupplierTenders.php:325 -#: SuppPriceList.php:118 includes/PDFPaymentRun_PymtFooter.php:149 +#: SuppPriceList.php:118 includes/PDFPaymentRun_PymtFooter.php:148 msgid "Problem Report" msgstr "گزارش مشکل" @@ -769,38 +768,38 @@ msgstr "جزئیات مشتری می تواند با گذاشتن زیرا قابل بازیابی نیست" #: AgedDebtors.php:270 AgedDebtors.php:368 AgedDebtors.php:442 -#: AgedSuppliers.php:108 AgedSuppliers.php:190 BOMExtendedQty.php:162 -#: BOMExtendedQty.php:259 BOMIndented.php:153 BOMIndented.php:239 -#: BOMIndentedReverse.php:154 BOMIndentedReverse.php:232 BOMListing.php:51 -#: Credit_Invoice.php:185 DebtorsAtPeriodEnd.php:61 DebtorsAtPeriodEnd.php:73 +#: AgedSuppliers.php:108 AgedSuppliers.php:190 BOMExtendedQty.php:159 +#: BOMExtendedQty.php:263 BOMIndented.php:152 BOMIndented.php:238 +#: BOMIndentedReverse.php:151 BOMIndentedReverse.php:235 BOMListing.php:51 +#: Credit_Invoice.php:186 DebtorsAtPeriodEnd.php:61 DebtorsAtPeriodEnd.php:73 #: FTP_RadioBeacon.php:188 GetStockImage.php:154 GLBalanceSheet.php:93 #: GLBalanceSheet.php:131 GLBalanceSheet.php:294 GLProfit_Loss.php:160 #: GLProfit_Loss.php:172 GLTagProfit_Loss.php:177 GLTagProfit_Loss.php:189 #: GLTrialBalance.php:154 GLTrialBalance.php:166 InventoryPlanning.php:102 #: InventoryPlanning.php:177 InventoryPlanning.php:212 -#: InventoryPlanning.php:260 InventoryPlanning.php:298 -#: InventoryPlanning.php:361 InventoryPlanningPrefSupplier.php:211 +#: InventoryPlanning.php:255 InventoryPlanning.php:293 +#: InventoryPlanning.php:356 InventoryPlanningPrefSupplier.php:211 #: InventoryPlanningPrefSupplier.php:279 InventoryPlanningPrefSupplier.php:313 -#: InventoryPlanningPrefSupplier.php:358 InventoryPlanningPrefSupplier.php:404 +#: InventoryPlanningPrefSupplier.php:356 InventoryPlanningPrefSupplier.php:404 #: InventoryPlanningPrefSupplier.php:460 InventoryQuantities.php:86 #: InventoryQuantities.php:97 InventoryValuation.php:79 #: InventoryValuation.php:90 MailInventoryValuation.php:118 -#: MailInventoryValuation.php:214 MRPPlannedPurchaseOrders.php:117 -#: MRPPlannedPurchaseOrders.php:128 MRPPlannedWorkOrders.php:108 +#: MailInventoryValuation.php:214 MRPPlannedPurchaseOrders.php:114 +#: MRPPlannedPurchaseOrders.php:125 MRPPlannedWorkOrders.php:108 #: MRPPlannedWorkOrders.php:119 MRPPlannedWorkOrders.php:318 MRPReport.php:41 #: MRPReport.php:52 MRPReport.php:150 MRPReschedules.php:49 -#: MRPReschedules.php:61 MRPShortages.php:148 MRPShortages.php:160 +#: MRPReschedules.php:61 MRPShortages.php:140 MRPShortages.php:152 #: OutstandingGRNs.php:54 OutstandingGRNs.php:66 PcReportTab.php:236 -#: PDFCustomerList.php:235 PDFCustomerList.php:247 PDFGrn.php:123 -#: PDFLowGP.php:63 PDFLowGP.php:75 PDFPriceList.php:124 PDFQuotation.php:234 -#: PDFQuotationPortrait.php:235 PDFRemittanceAdvice.php:84 -#: PDFStockCheckComparison.php:39 PDFStockCheckComparison.php:65 -#: PDFStockCheckComparison.php:266 PDFTopItems.php:118 PO_PDFPurchOrder.php:30 -#: PO_PDFPurchOrder.php:144 PrintCustOrder_generic.php:180 -#: PrintCustOrder.php:198 ReorderLevel.php:62 ReorderLevel.php:151 -#: SalesAnalysis_UserDefined.php:28 SelectCreditItems.php:23 StockCheck.php:47 +#: PDFCustomerList.php:235 PDFCustomerList.php:247 PDFGrn.php:147 +#: PDFLowGP.php:63 PDFLowGP.php:75 PDFPriceList.php:124 PDFQuotation.php:237 +#: PDFRemittanceAdvice.php:84 PDFStockCheckComparison.php:39 +#: PDFStockCheckComparison.php:65 PDFStockCheckComparison.php:266 +#: PDFTopItems.php:123 PO_PDFPurchOrder.php:21 PO_PDFPurchOrder.php:131 +#: PrintCustOrder_generic.php:182 PrintCustOrder.php:198 +#: PrintSalesOrder_generic.php:183 ReorderLevel.php:62 ReorderLevel.php:151 +#: SalesAnalysis_UserDefined.php:28 SelectCreditItems.php:25 StockCheck.php:47 #: StockCheck.php:68 StockCheck.php:98 StockCheck.php:142 StockCheck.php:153 -#: StockCheck.php:195 StockDispatch.php:93 StockDispatch.php:105 +#: StockCheck.php:194 StockDispatch.php:93 StockDispatch.php:105 #: SupplierBalsAtPeriodEnd.php:57 SupplierBalsAtPeriodEnd.php:68 #: SuppPaymentRun.php:109 SuppPaymentRun.php:120 SuppPaymentRun.php:184 #: SuppPaymentRun.php:214 SuppPriceList.php:121 Tax.php:64 Tax.php:177 @@ -808,11 +807,11 @@ #: Z_DataExport.php:309 Z_DataExport.php:348 Z_DataExport.php:384 #: Z_DataExport.php:420 Z_DataExport.php:472 Z_poRebuildDefault.php:38 #: includes/PDFPaymentRun_PymtFooter.php:57 -#: includes/PDFPaymentRun_PymtFooter.php:87 -#: includes/PDFPaymentRun_PymtFooter.php:116 -#: includes/PDFPaymentRun_PymtFooter.php:152 -#: includes/PDFPaymentRun_PymtFooter.php:183 -#: includes/PDFPaymentRun_PymtFooter.php:215 +#: includes/PDFPaymentRun_PymtFooter.php:86 +#: includes/PDFPaymentRun_PymtFooter.php:115 +#: includes/PDFPaymentRun_PymtFooter.php:151 +#: includes/PDFPaymentRun_PymtFooter.php:182 +#: includes/PDFPaymentRun_PymtFooter.php:214 #: includes/ConstructSQLForUserDefinedSalesReport.inc:180 #: includes/ConstructSQLForUserDefinedSalesReport.inc:188 #: includes/ConstructSQLForUserDefinedSalesReport.inc:340 @@ -823,39 +822,39 @@ msgid "The details of outstanding transactions for customer" msgstr "جزئیات معاملات برجسته برای مشتری" -#: AgedDebtors.php:367 AgedSuppliers.php:189 GLAccountCSV.php:167 -#: GLAccountInquiry.php:145 GLAccountReport.php:93 PO_Items.php:471 -#: PO_Items.php:605 PO_Items.php:632 SalesAnalReptCols.php:356 -#: SpecialOrder.php:369 StockLocTransferReceive.php:373 -#: StockQuantityByDate.php:114 includes/SelectOrderItems_IntoCart.inc:53 +#: AgedDebtors.php:367 AgedSuppliers.php:189 GLAccountCSV.php:169 +#: GLAccountInquiry.php:145 GLAccountReport.php:93 PO_Items.php:532 +#: PO_Items.php:562 PO_Items.php:640 PO_Items.php:803 +#: SalesAnalReptCols.php:356 SpecialOrder.php:369 +#: StockLocTransferReceive.php:373 StockQuantityByDate.php:106 +#: includes/SelectOrderItems_IntoCart.inc:53 msgid "could not be retrieved because" msgstr "قابل بازیابی نیست زیرا" #: AgedDebtors.php:370 AgedSuppliers.php:192 Areas.php:96 -#: ConfirmDispatch_Invoice.php:152 ConfirmDispatch_Invoice.php:969 -#: ConfirmDispatch_Invoice.php:983 Contracts.php:581 CounterSales.php:1323 -#: CounterSales.php:1337 Credit_Invoice.php:706 Credit_Invoice.php:728 -#: CustomerReceipt.php:523 CustomerReceipt.php:655 CustomerReceipt.php:683 +#: ConfirmDispatch_Invoice.php:155 ConfirmDispatch_Invoice.php:962 +#: ConfirmDispatch_Invoice.php:976 Contracts.php:583 CounterSales.php:1280 +#: CounterSales.php:1294 Credit_Invoice.php:707 Credit_Invoice.php:729 +#: CustomerReceipt.php:526 CustomerReceipt.php:658 CustomerReceipt.php:686 #: CustomerTransInquiry.php:79 DeliveryDetails.php:395 GLProfit_Loss.php:578 -#: GLTagProfit_Loss.php:490 Payments.php:308 PDFRemittanceAdvice.php:86 -#: PurchData.php:89 PurchData.php:108 PurchData.php:244 ReverseGRN.php:191 -#: ReverseGRN.php:205 ReverseGRN.php:366 SelectCreditItems.php:1381 -#: SelectSalesOrder.php:113 SelectSalesOrder.php:281 StockCheck.php:225 -#: StockCostUpdate.php:79 StockCostUpdate.php:89 StockLocStatus.php:142 -#: StockMovements.php:92 StockQuantityByDate.php:90 StockReorderLevel.php:39 -#: StockStatus.php:271 StockTransfers.php:159 StockUsageGraph.php:53 -#: StockUsage.php:132 SupplierInquiry.php:79 SupplierInquiry.php:101 -#: SupplierInquiry.php:131 SupplierInquiry.php:177 SupplierTransInquiry.php:81 -#: SuppPaymentRun.php:111 SuppPaymentRun.php:186 SuppPaymentRun.php:216 -#: WorkOrderCosting.php:393 WorkOrderReceive.php:272 WOSerialNos.php:44 -#: Z_ChangeBranchCode.php:108 Z_ChangeCustomerCode.php:92 +#: GLTagProfit_Loss.php:490 Payments.php:307 PDFRemittanceAdvice.php:86 +#: PurchData.php:89 PurchData.php:108 PurchData.php:219 ReverseGRN.php:191 +#: ReverseGRN.php:205 ReverseGRN.php:366 SelectCreditItems.php:1383 +#: StockCheck.php:224 StockCostUpdate.php:79 StockCostUpdate.php:89 +#: StockLocStatus.php:142 StockMovements.php:92 StockQuantityByDate.php:82 +#: StockReorderLevel.php:39 StockStatus.php:271 StockTransfers.php:159 +#: StockUsageGraph.php:53 StockUsage.php:127 SupplierInquiry.php:79 +#: SupplierInquiry.php:101 SupplierInquiry.php:131 SupplierInquiry.php:177 +#: SupplierTransInquiry.php:81 SuppPaymentRun.php:111 SuppPaymentRun.php:186 +#: SuppPaymentRun.php:216 WorkOrderCosting.php:393 WorkOrderReceive.php:272 +#: WOSerialNos.php:44 Z_ChangeBranchCode.php:108 Z_ChangeCustomerCode.php:90 #: Z_DeleteCreditNote.php:57 Z_DeleteInvoice.php:83 #: includes/PDFPaymentRun_PymtFooter.php:59 -#: includes/PDFPaymentRun_PymtFooter.php:89 -#: includes/PDFPaymentRun_PymtFooter.php:118 -#: includes/PDFPaymentRun_PymtFooter.php:154 -#: includes/PDFPaymentRun_PymtFooter.php:185 includes/ConnectDB_mysqli.inc:79 -#: includes/ConnectDB_mysql.inc:64 +#: includes/PDFPaymentRun_PymtFooter.php:88 +#: includes/PDFPaymentRun_PymtFooter.php:117 +#: includes/PDFPaymentRun_PymtFooter.php:153 +#: includes/PDFPaymentRun_PymtFooter.php:184 includes/ConnectDB_mysqli.inc:83 +#: includes/ConnectDB_mysql.inc:65 msgid "The SQL that failed was" msgstr "گذاشتن که شکست خورده بود" @@ -911,17 +910,17 @@ msgid "Detailed Report" msgstr "جزئیات گزارش" -#: AgedDebtors.php:520 AgedSuppliers.php:320 BOMExtendedQty.php:286 -#: BOMIndented.php:268 BOMIndentedReverse.php:255 BOMListing.php:142 -#: DebtorsAtPeriodEnd.php:166 InventoryPlanning.php:442 +#: AgedDebtors.php:520 AgedSuppliers.php:320 BOMExtendedQty.php:300 +#: BOMIndented.php:278 BOMIndentedReverse.php:266 BOMListing.php:142 +#: DebtorsAtPeriodEnd.php:166 InventoryPlanning.php:437 #: InventoryPlanningPrefSupplier.php:518 InventoryQuantities.php:188 -#: InventoryValuation.php:242 MRPPlannedPurchaseOrders.php:282 -#: MRPPlannedWorkOrders.php:344 MRPReschedules.php:166 MRPShortages.php:259 +#: InventoryValuation.php:242 MRPPlannedPurchaseOrders.php:279 +#: MRPPlannedWorkOrders.php:344 MRPReschedules.php:166 MRPShortages.php:262 #: OutstandingGRNs.php:185 PDFCustomerList.php:412 PDFLowGP.php:168 #: PDFPriceList.php:301 PDFRemittanceAdvice.php:152 -#: PDFStockCheckComparison.php:379 PrintCustTrans.php:416 -#: PrintCustTransPortrait.php:560 ReorderLevel.php:229 StockDispatch.php:309 -#: SupplierBalsAtPeriodEnd.php:155 SuppPriceList.php:228 Tax.php:352 +#: PDFStockCheckComparison.php:379 PrintCustTrans.php:478 +#: PrintCustTransPortrait.php:630 ReorderLevel.php:229 StockDispatch.php:309 +#: SupplierBalsAtPeriodEnd.php:155 SuppPriceList.php:237 Tax.php:352 msgid "Print PDF" msgstr "پی دی اف نسخه قابل چاپ" @@ -1044,10 +1043,10 @@ msgstr "کد شهر" #: Areas.php:133 CustomerTypes.php:166 Factors.php:142 -#: FixedAssetCategories.php:136 GLAccounts.php:208 Locations.php:328 +#: FixedAssetCategories.php:137 GLAccounts.php:208 Locations.php:328 #: MRPDemands.php:248 PcAssignCashToTab.php:118 PcClaimExpensesFromTab.php:109 -#: PcExpenses.php:137 PcExpensesTypeTab.php:86 PcTabs.php:124 -#: PcTypeTabs.php:137 SalesAnalReptCols.php:215 SalesCategories.php:139 +#: PcExpenses.php:127 PcExpensesTypeTab.php:83 PcTabs.php:124 +#: PcTypeTabs.php:134 SalesAnalReptCols.php:215 SalesCategories.php:139 #: SalesTypes.php:163 StockCategories.php:199 Suppliers.php:639 #: SupplierTypes.php:153 Z_DeleteInvoice.php:142 msgid "has been deleted" @@ -1073,19 +1072,19 @@ msgid "Incorrect date format used, please re-enter" msgstr "اشتباه فرمت تاریخ استفاده می شود ، لطفا دوباره وارد کنید" -#: AuditTrail.php:37 BOMIndented.php:307 BOMIndentedReverse.php:294 +#: AuditTrail.php:37 BOMIndented.php:317 BOMIndentedReverse.php:305 #: MRPCalendar.php:260 msgid "From Date" msgstr "از تاریخ" -#: AuditTrail.php:39 BOMIndented.php:308 BOMIndentedReverse.php:295 +#: AuditTrail.php:39 BOMIndented.php:318 BOMIndentedReverse.php:306 #: MRPCalendar.php:262 msgid "To Date" msgstr "تا تاریخ" #: AuditTrail.php:43 PO_AuthorisationLevels.php:123 #: PO_AuthorisationLevels.php:160 PO_AuthorisationLevels.php:163 -#: UserSettings.php:109 +#: UserSettings.php:111 msgid "User ID" msgstr "شناسه کاربر" @@ -1093,8 +1092,8 @@ msgid "Table " msgstr "جدول " -#: AuditTrail.php:68 MRPReport.php:789 PO_SelectPurchOrder.php:363 -#: SelectContract.php:196 SelectProduct.php:727 +#: AuditTrail.php:68 MRPReport.php:789 PO_SelectPurchOrder.php:357 +#: SelectContract.php:196 SelectProduct.php:710 msgid "View" msgstr "نمایش" @@ -1109,9 +1108,9 @@ #: AuditTrail.php:146 BankReconciliation.php:185 BankReconciliation.php:257 #: CustomerAllocations.php:356 CustomerInquiry.php:189 #: CustomerTransInquiry.php:21 CustomerTransInquiry.php:85 -#: CustWhereAlloc.php:18 CustWhereAlloc.php:87 DailyBankTransactions.php:99 -#: GLAccountInquiry.php:152 GLAccountReport.php:367 GLJournal.php:241 -#: MRPReschedules.php:204 SelectCustomer.php:463 ShipmentCosting.php:501 +#: CustWhereAlloc.php:18 CustWhereAlloc.php:87 DailyBankTransactions.php:79 +#: GLAccountInquiry.php:152 GLAccountReport.php:367 GLJournal.php:256 +#: MRPReschedules.php:204 SelectCustomer.php:460 ShipmentCosting.php:501 #: ShipmentCosting.php:572 StockCategories.php:219 StockLocMovements.php:83 #: StockMovements.php:97 SupplierAllocations.php:462 SupplierInquiry.php:193 #: SupplierTransInquiry.php:19 SupplierTransInquiry.php:86 @@ -1131,7 +1130,7 @@ msgid "Field Name" msgstr "نام فیلد" -#: AuditTrail.php:149 SystemParameters.php:315 +#: AuditTrail.php:149 SystemParameters.php:312 #: includes/PDFInventoryValnPageHeader.inc:38 #: includes/PDFOstdgGRNsPageHeader.inc:43 msgid "Value" @@ -1227,7 +1226,7 @@ msgid "The SQL used to retrieve the bank account details was" msgstr "گذاشتن استفاده برای بازیابی جزئیات حساب بانکی بود" -#: BankAccounts.php:196 GLJournal.php:265 +#: BankAccounts.php:196 GLJournal.php:280 msgid "GL Account Code" msgstr "گرم در کد حساب کاربری" @@ -1247,16 +1246,16 @@ msgid "Bank Address" msgstr "بانک آدرس" -#: BankAccounts.php:201 CustomerReceipt.php:753 CustomerTransInquiry.php:95 +#: BankAccounts.php:201 CustomerReceipt.php:756 CustomerTransInquiry.php:95 #: OffersReceived.php:98 PcReportTab.php:291 PcTabs.php:147 PcTabs.php:295 #: PDFPrintLabel.php:94 PO_AuthorisationLevels.php:125 #: PO_AuthorisationLevels.php:180 PO_AuthorisationLevels.php:183 #: PO_AuthoriseMyOrders.php:107 PO_Header.php:534 -#: PO_SelectOSPurchOrder.php:444 PO_SelectPurchOrder.php:365 -#: PricesByCost.php:239 Prices.php:198 Prices.php:293 PurchData.php:172 -#: PurchData.php:340 PurchData.php:453 SelectSupplier.php:251 -#: SupplierCredit.php:268 SupplierInvoice.php:232 SupplierTransInquiry.php:95 -#: SuppPriceList.php:265 includes/PDFBankingSummaryPageHeader.inc:42 +#: PO_SelectOSPurchOrder.php:444 PO_SelectPurchOrder.php:359 +#: PricesByCost.php:209 Prices.php:198 Prices.php:293 PurchData.php:168 +#: PurchData.php:315 PurchData.php:428 SelectSupplier.php:251 +#: SupplierCredit.php:264 SupplierInvoice.php:232 SupplierTransInquiry.php:95 +#: SuppPriceList.php:274 includes/PDFBankingSummaryPageHeader.inc:42 #: includes/PDFDebtorBalsPageHeader.inc:33 #: includes/PDFSupplierBalsPageHeader.inc:36 msgid "Currency" @@ -1336,38 +1335,38 @@ "با استفاده از این صفحه برای مطابقت با webERP رسید و پرداخت خود را به بانک " "بیانیه. بررسی صورت حساب بانکی خود و کلیک بر روی چک باکس که همه معامله منطبق." -#: BankMatching.php:80 BankReconciliation.php:97 CustomerReceipt.php:726 -#: DailyBankTransactions.php:28 Payments.php:733 PDFChequeListing.php:46 +#: BankMatching.php:80 BankReconciliation.php:97 CustomerReceipt.php:729 +#: DailyBankTransactions.php:28 Payments.php:732 PDFChequeListing.php:46 #: TaxAuthorities.php:150 TaxAuthorities.php:306 msgid "Bank Account" msgstr "حساب بانکی ما" -#: BankMatching.php:102 +#: BankMatching.php:102 PO_SelectOSPurchOrder.php:489 msgid "Show" msgstr "نمایش" #: BankMatching.php:102 CreditItemsControlled.php:78 FreightCosts.php:270 -#: GoodsReceivedControlled.php:65 GoodsReceived.php:67 +#: GoodsReceivedControlled.php:56 GoodsReceived.php:66 #: StockLocTransferReceive.php:426 SupplierAllocations.php:443 #: SuppShiptChgs.php:126 msgid "from" msgstr "از" #: BankMatching.php:105 ConfirmDispatchControlled_Invoice.php:59 -#: EmailCustTrans.php:65 FixedAssetRegister.php:78 FTP_RadioBeacon.php:281 -#: GLAccountCSV.php:170 GLAccountReport.php:102 Payments.php:713 -#: PcReportTab.php:105 PDFChequeListing.php:108 PDFChequeListing.php:118 -#: PDFChequeListing.php:205 PDFDeliveryDifferences.php:166 -#: PDFDeliveryDifferences.php:179 PDFDeliveryDifferences.php:287 -#: PDFDIFOT.php:172 PDFDIFOT.php:185 PDFDIFOT.php:289 PDFOrdersInvoiced.php:74 -#: PDFOrdersInvoiced.php:271 PDFOrderStatus.php:75 PDFOrderStatus.php:250 -#: PO_PDFPurchOrder.php:302 PricesBasedOnMarkUp.php:216 -#: PricesBasedOnMarkUp.php:355 PrintCustStatements.php:50 -#: PrintCustTrans.php:37 PrintCustTrans.php:40 PrintCustTransPortrait.php:60 +#: EmailCustTrans.php:65 FTP_RadioBeacon.php:281 GLAccountCSV.php:172 +#: GLAccountReport.php:102 Payments.php:712 PcReportTab.php:105 +#: PDFChequeListing.php:108 PDFChequeListing.php:118 PDFChequeListing.php:205 +#: PDFDeliveryDifferences.php:166 PDFDeliveryDifferences.php:179 +#: PDFDeliveryDifferences.php:287 PDFDIFOT.php:172 PDFDIFOT.php:185 +#: PDFDIFOT.php:289 PDFOrdersInvoiced.php:74 PDFOrdersInvoiced.php:271 +#: PDFOrderStatus.php:75 PDFOrderStatus.php:250 PO_PDFPurchOrder.php:313 +#: PricesBasedOnMarkUp.php:216 PricesBasedOnMarkUp.php:334 +#: PricesBasedOnMarkUp.php:350 PrintCustStatements.php:50 +#: PrintCustTrans.php:38 PrintCustTrans.php:41 PrintCustTransPortrait.php:60 #: PrintCustTransPortrait.php:63 SalesGraph.php:200 SalesGraph.php:229 #: SalesGraph.php:233 StockLocTransferReceive.php:310 -#: StockLocTransferReceive.php:426 Stocks.php:229 Stocks.php:234 -#: StockStatus.php:309 StockStatus.php:350 StockTransfers.php:397 +#: StockLocTransferReceive.php:426 Stocks.php:231 Stocks.php:236 +#: StockStatus.php:305 StockStatus.php:347 StockTransfers.php:397 #: includes/PDFAgedDebtorsPageHeader.inc:18 #: includes/PDFAgedSuppliersPageHeader.inc:17 #: includes/PDFChequeListingPageHeader.inc:17 @@ -1458,7 +1457,8 @@ msgstr "بعد" #: BankMatching.php:218 -msgid "The payments with the selected criteria could not be retrieved because" +msgid "" +"The payments with the selected criteria could not be retrieved because" msgstr "پرداخت با معیار های انتخاب قابل بازیابی نیست زیرا" #: BankMatching.php:221 ShipmentCosting.php:502 ShipmentCosting.php:573 @@ -1466,19 +1466,19 @@ msgid "Ref" msgstr "کد عکس" -#: BankMatching.php:224 ConfirmDispatch_Invoice.php:279 Credit_Invoice.php:280 -#: CustomerAllocations.php:359 CustomerReceipt.php:842 +#: BankMatching.php:224 ConfirmDispatch_Invoice.php:272 Credit_Invoice.php:281 +#: CustomerAllocations.php:359 CustomerReceipt.php:845 #: CustomerTransInquiry.php:94 CustWhereAlloc.php:91 PaymentAllocations.php:78 -#: Payments.php:926 Payments.php:928 Payments.php:937 +#: Payments.php:928 Payments.php:930 Payments.php:939 #: PcAssignCashToTab.php:214 PcAssignCashToTab.php:335 #: PcAuthorizeExpenses.php:83 PcClaimExpensesFromTab.php:193 #: PcClaimExpensesFromTab.php:342 PcReportTab.php:175 PcReportTab.php:347 -#: PrintCheque.php:70 PrintCheque.php:84 SelectCreditItems.php:659 -#: SuppContractChgs.php:73 SuppContractChgs.php:142 SuppFixedAssetChgs.php:71 -#: SuppFixedAssetChgs.php:137 SupplierAllocations.php:466 -#: SupplierCredit.php:345 SupplierCredit.php:373 SupplierCredit.php:403 -#: SupplierCredit.php:438 SupplierInvoice.php:313 SupplierInvoice.php:344 -#: SupplierInvoice.php:373 SupplierInvoice.php:409 SupplierTransInquiry.php:94 +#: PrintCheque.php:70 PrintCheque.php:84 SelectCreditItems.php:661 +#: SuppContractChgs.php:73 SuppContractChgs.php:142 SuppFixedAssetChgs.php:77 +#: SuppFixedAssetChgs.php:136 SupplierAllocations.php:466 +#: SupplierCredit.php:341 SupplierCredit.php:369 SupplierCredit.php:399 +#: SupplierCredit.php:434 SupplierInvoice.php:312 SupplierInvoice.php:342 +#: SupplierInvoice.php:373 SupplierInvoice.php:408 SupplierTransInquiry.php:94 #: SuppShiptChgs.php:77 SuppShiptChgs.php:134 SuppTransGLAnalysis.php:97 #: SuppTransGLAnalysis.php:174 Z_CheckAllocs.php:63 #: includes/PDFBankingSummaryPageHeader.inc:55 @@ -1488,7 +1488,7 @@ #: BankMatching.php:225 BankReconciliation.php:189 BankReconciliation.php:261 #: PDFOrdersInvoiced.php:348 PDFOrderStatus.php:316 -#: PO_SelectOSPurchOrder.php:215 PO_SelectPurchOrder.php:180 +#: PO_SelectOSPurchOrder.php:215 PO_SelectPurchOrder.php:175 #: Shipt_Select.php:186 SuppCreditGRNs.php:225 #: includes/PDFStatementPageHeader.inc:173 #: includes/PDFStatementPageHeader.inc:180 @@ -1548,26 +1548,26 @@ msgid "The bank accounts could not be retrieved by the SQL because" msgstr "حساب های بانکی می تواند با گذاشتن زیرا قابل بازیابی نیست" -#: BankReconciliation.php:94 CustomerReceipt.php:717 -#: DailyBankTransactions.php:25 Payments.php:730 SuppPaymentRun.php:302 +#: BankReconciliation.php:94 CustomerReceipt.php:720 +#: DailyBankTransactions.php:25 Payments.php:729 SuppPaymentRun.php:302 msgid "The SQL used to retrieve the bank accounts was" msgstr "گذاشتن استفاده برای بازیابی حساب های بانکی شد" -#: BankReconciliation.php:100 CustomerReceipt.php:731 +#: BankReconciliation.php:100 CustomerReceipt.php:734 msgid "Bank Accounts have not yet been defined" msgstr "حساب بانک هنوز تعریف شده است" -#: BankReconciliation.php:100 CustomerReceipt.php:731 +#: BankReconciliation.php:100 CustomerReceipt.php:734 msgid "You must first" msgstr "شما باید اول" -#: BankReconciliation.php:100 CustomerReceipt.php:731 -#: DailyBankTransactions.php:32 Payments.php:737 SuppPaymentRun.php:310 +#: BankReconciliation.php:100 CustomerReceipt.php:734 +#: DailyBankTransactions.php:32 Payments.php:736 SuppPaymentRun.php:310 msgid "define the bank accounts" msgstr "تعریف حساب های بانکی" -#: BankReconciliation.php:100 CustomerReceipt.php:731 -#: DailyBankTransactions.php:32 Payments.php:737 SuppPaymentRun.php:310 +#: BankReconciliation.php:100 CustomerReceipt.php:734 +#: DailyBankTransactions.php:32 Payments.php:736 SuppPaymentRun.php:310 msgid "and general ledger accounts to be affected" msgstr "و حساب های دفتر کل عمومی که تحت تاثیر قرار" @@ -1600,24 +1600,23 @@ #: BankReconciliation.php:186 BankReconciliation.php:258 #: CustomerAllocations.php:331 CustomerAllocations.php:357 #: CustomerInquiry.php:190 CustomerTransInquiry.php:86 CustWhereAlloc.php:88 -#: EmailCustTrans.php:17 GLAccountInquiry.php:153 PrintCustTrans.php:378 -#: PrintCustTrans.php:542 PrintCustTrans.php:696 PrintCustTrans.php:735 -#: PrintCustTransPortrait.php:504 PrintCustTransPortrait.php:704 -#: PrintCustTransPortrait.php:894 PrintCustTransPortrait.php:939 +#: EmailCustTrans.php:17 GLAccountInquiry.php:153 PrintCustTrans.php:440 +#: PrintCustTrans.php:604 PrintCustTrans.php:758 PrintCustTrans.php:797 +#: PrintCustTransPortrait.php:574 PrintCustTransPortrait.php:774 +#: PrintCustTransPortrait.php:964 PrintCustTransPortrait.php:1009 #: StockMovements.php:97 SupplierAllocations.php:463 #: SupplierAllocations.php:575 SupplierAllocations.php:645 #: SupplierTransInquiry.php:87 Z_CheckAllocs.php:60 #: Z_CheckGLTransBalance.php:13 includes/PDFQuotationPageHeader.inc:87 -#: includes/PDFQuotationPortraitPageHeader.inc:86 #: includes/PDFStatementPageHeader.inc:168 -#: includes/PDFStatementPageHeader.inc:179 includes/PDFTransPageHeader.inc:80 +#: includes/PDFStatementPageHeader.inc:179 includes/PDFTransPageHeader.inc:76 #: includes/PDFTransPageHeaderPortrait.inc:52 msgid "Number" msgstr "عدد" #: BankReconciliation.php:187 BankReconciliation.php:259 #: ContractCosting.php:148 CustomerInquiry.php:193 CustomerTransInquiry.php:90 -#: CustWhereAlloc.php:89 DailyBankTransactions.php:100 GLAccountReport.php:368 +#: CustWhereAlloc.php:89 DailyBankTransactions.php:80 GLAccountReport.php:368 #: PaymentAllocations.php:75 PaymentAllocations.php:76 #: PDFRemittanceAdvice.php:309 ShiptsList.php:37 StockCounts.php:99 #: StockCounts.php:135 StockLocMovements.php:88 StockMovements.php:100 @@ -1672,9 +1671,9 @@ "کاربری ایجاد کنید. مهم است که نرخ ارز بالا نشان دهنده ارزش فعلی از ارز حساب " "بانکی" -#: BankReconciliation.php:311 CounterSales.php:781 Customers.php:1004 -#: SelectOrderItems.php:1369 Stocks.php:1031 WorkOrderCosting.php:512 -#: WorkOrderEntry.php:547 +#: BankReconciliation.php:311 CounterSales.php:741 Customers.php:1014 +#: SelectOrderItems.php:1374 Stocks.php:1029 WorkOrderCosting.php:512 +#: WorkOrderEntry.php:549 msgid "Are You Sure?" msgstr "مطمئن هستید؟" @@ -1703,135 +1702,132 @@ msgid "Match off cleared deposits" msgstr "تطابق پاک کردن رسوبات" -#: BOMExtendedQty.php:12 BOMExtendedQty.php:13 BOMExtendedQty.php:159 -#: BOMExtendedQty.php:269 +#: BOMExtendedQty.php:14 BOMExtendedQty.php:15 BOMExtendedQty.php:156 +#: BOMExtendedQty.php:283 msgid "Quantity Extended BOM Listing" msgstr "مقدار تمدید مثال BOM" -#: BOMExtendedQty.php:32 BOMIndentedReverse.php:29 MRPCalendar.php:87 +#: BOMExtendedQty.php:34 BOMIndentedReverse.php:30 MRPCalendar.php:87 #: MRP.php:29 SalesInquiry.php:1191 msgid "The SQL to to create passbom failed with the message" msgstr "گذاشتن به ایجاد passbom شکست خورده با پیام" -#: BOMExtendedQty.php:45 BOMIndented.php:40 BOMIndentedReverse.php:42 +#: BOMExtendedQty.php:47 BOMIndented.php:42 BOMIndentedReverse.php:43 #: MRP.php:36 msgid "Create of tempbom failed because" msgstr "ایجاد tempbom از شکست خورده به دلیل" -#: BOMExtendedQty.php:161 +#: BOMExtendedQty.php:158 msgid "" "The Quantiy Extended BOM Listing could not be retrieved by the SQL because" msgstr "Quantiy تمدید BOM مثال می توان با گذ... [truncated message content] |
From: <dai...@us...> - 2011-04-18 00:09:32
|
Revision: 4553 http://web-erp.svn.sourceforge.net/web-erp/?rev=4553&view=rev Author: daintree Date: 2011-04-18 00:09:23 +0000 (Mon, 18 Apr 2011) Log Message: ----------- lang updates, xhtml, closing > Modified Paths: -------------- trunk/Prices_Customer.php trunk/SelectCustomer.php trunk/SelectOrderItems.php trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po Modified: trunk/Prices_Customer.php =================================================================== --- trunk/Prices_Customer.php 2011-04-17 10:18:02 UTC (rev 4552) +++ trunk/Prices_Customer.php 2011-04-18 00:09:23 UTC (rev 4553) @@ -330,7 +330,7 @@ $result = DB_query($sql, $db); echo '<table class=selection>'; echo '<tr><td>' . _('Branch') . ':</td>'; -echo '<td><select name="Branch"'; +echo '<td><select name="Branch">'; while ($myrow=DB_fetch_array($result)) { if ($myrow['branchcode']==$_POST['branch']) { echo '<option selected value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; @@ -338,13 +338,13 @@ echo '<option value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; } } -echo '></td></tr>'; +echo '</select></td></tr>'; echo '<tr><td>' . _('Start Date') . ':</td> <td><input type="Text" name="StartDate" class=date alt='.$_SESSION['DefaultDateFormat']. - ' size=11 maxlength=10 value=' . $_POST['StartDate'] . '></td></tr>'; + ' size=11 maxlength=10 value="' . $_POST['StartDate'] . '"></td></tr>'; echo '<tr><td>' . _('End Date') . ':</td> <td><input type="Text" name="EndDate" class=date alt='.$_SESSION['DefaultDateFormat']. - ' size=11 maxlength=10 value=' . $_POST['EndDate'] . '></td></tr>'; + ' size=11 maxlength=10 value="' . $_POST['EndDate'] . '"></td></tr>'; echo '<tr><td>' . _('Price') . ':</td> <td><input type="Text" class=number name="Price" size=11 maxlength=10 value=' . $_POST['Price'] . '></td> Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2011-04-17 10:18:02 UTC (rev 4552) +++ trunk/SelectCustomer.php 2011-04-18 00:09:23 UTC (rev 4553) @@ -541,8 +541,8 @@ echo '<tr><td colspan=2>'; echo '<table width=45% colspan=2 cellpadding=4>'; echo '<tr><th width=33%>' . _('Customer Mapping') . '</th></tr>'; - echo '</td><td valign=TOp>'; /* Mapping */ - echo '<div class="centre"' . _('Mapping is enabled, Map will display below.') . '</div>'; + echo '</td><td valign="top">'; /* Mapping */ + echo '<div class="centre">' . _('Mapping is enabled, Map will display below.') . '</div>'; echo '<div align="center" id="map" style="width: ' . $map_width . 'px; height: ' . $map_height . 'px"></div><br />'; echo '</th></tr></table>'; } Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-04-17 10:18:02 UTC (rev 4552) +++ trunk/SelectOrderItems.php 2011-04-18 00:09:23 UTC (rev 4553) @@ -658,7 +658,7 @@ echo '<td></td>'; } echo '<td><input tabindex='.($j+5).' type=submit name="SubmitCustomerSelection' . $j .'" value="' . htmlentities($myrow['brname'], ENT_QUOTES,'UTF-8'). '"></td> - <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'].'"><input type="hidden" name="SelectedBranch' . $j .'" value="'. $myrow['branchcode'].'"> + <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'].'"><input type="hidden" name="SelectedBranch' . $j .'" value="'. $myrow['branchcode'].'" /> <td>'.$myrow['contactname'].'</td> <td>'.$myrow['phoneno'].'</td> <td>'.$myrow['faxno'].'</td> Modified: trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po 2011-04-17 10:18:02 UTC (rev 4552) +++ trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po 2011-04-18 00:09:23 UTC (rev 4553) @@ -7,21 +7,21 @@ msgstr "" "Project-Id-Version: Persian & rtl support\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-03-31 20:06+1200\n" -"PO-Revision-Date: 2011-02-18 11:42+0000\n" -"Last-Translator: Mohsen Karimi <Unknown>\n" +"POT-Creation-Date: 2011-01-04 22:15+1200\n" +"PO-Revision-Date: 2011-04-10 22:01+0000\n" +"Last-Translator: پویان <Unknown>\n" "Language-Team: Persian <hos...@io...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-03-31 06:31+0000\n" -"X-Generator: Launchpad (build 12696)\n" +"X-Launchpad-Export-Date: 2011-04-17 23:41+0000\n" +"X-Generator: Launchpad (build 12821)\n" "X-Poedit-Country: IRAN, ISLAMIC REPUBLIC OF\n" "Language: fa\n" "X-Poedit-Language: Persian\n" "X-Poedit-SourceCharset: utf-8\n" -#: AccountGroups.php:9 index.php:1277 +#: AccountGroups.php:9 index.php:1273 msgid "Account Groups" msgstr "گروه حساب" @@ -59,7 +59,7 @@ msgstr "حساب کاربری نام گروه می تواند شخصیت نیست" #: AccountGroups.php:71 AccountSections.php:75 PaymentMethods.php:41 -#: TaxCategories.php:33 TaxProvinces.php:32 UnitsOfMeasure.php:30 +#: TaxCategories.php:33 TaxProvinces.php:32 UnitsOfMeasure.php:32 msgid "or the character" msgstr "و یا شخصیت" @@ -117,7 +117,8 @@ msgstr "درج رکورد" #: AccountGroups.php:176 -msgid "An error occurred in retrieving the group information from chartmaster" +msgid "" +"An error occurred in retrieving the group information from chartmaster" msgstr "خطا رخ داده است در بازیابی اطلاعات از گروه chartmaster" #: AccountGroups.php:181 @@ -132,21 +133,22 @@ #: 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:311 Customers.php:320 -#: Customers.php:328 Customers.php:336 CustomerTypes.php:149 -#: CustomerTypes.php:159 Factors.php:136 FixedAssetCategories.php:131 +#: 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:129 SalesCategories.php:127 SalesCategories.php:135 +#: 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:469 Stocks.php:478 Stocks.php:486 Stocks.php:494 Stocks.php:502 -#: Stocks.php:510 Suppliers.php:613 Suppliers.php:622 Suppliers.php:630 +#: 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:137 -#: WorkCentres.php:90 WorkCentres.php:96 WWW_Access.php:87 +#: TaxGroups.php:135 TaxProvinces.php:127 UnitsOfMeasure.php:142 +#: UnitsOfMeasure.php:149 WorkCentres.php:90 WorkCentres.php:96 +#: WWW_Access.php:87 msgid "There are" msgstr "وجود دارند" @@ -195,17 +197,17 @@ #: 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:272 BOMIndented.php:252 -#: BOMIndentedReverse.php:246 BOMInquiry.php:165 BOMListing.php:128 -#: BOMs.php:214 BOMs.php:793 COGSGLPostings.php:20 CompanyPreferences.php:155 -#: CounterSales.php:1983 CounterSales.php:2107 Credit_Invoice.php:256 +#: 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:104 FixedAssetLocations.php:9 -#: FixedAssetRegister.php:13 FixedAssetRegister.php:238 +#: 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:28 GLJournal.php:228 InventoryPlanning.php:374 +#: 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 @@ -213,24 +215,24 @@ #: 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:256 PurchData.php:275 -#: RecurringSalesOrders.php:311 SalesAnalReptCols.php:51 SalesAnalRepts.php:13 +#: 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:202 -#: SelectCreditItems.php:270 SelectCustomer.php:323 SelectGLAccount.php:19 -#: SelectGLAccount.php:79 SelectOrderItems.php:607 SelectOrderItems.php:1431 -#: SelectOrderItems.php:1555 SelectProduct.php:473 SelectSalesOrder.php:457 +#: 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:62 +#: TaxGroups.php:16 TaxProvinces.php:12 TopItems.php:60 #: WhereUsedInquiry.php:18 WorkCentres.php:111 WorkCentres.php:158 -#: WorkOrderCosting.php:14 WorkOrderEntry.php:10 WorkOrderIssue.php:22 +#: WorkOrderCosting.php:14 WorkOrderEntry.php:12 WorkOrderIssue.php:22 #: WorkOrderReceive.php:15 WorkOrderStatus.php:43 WWW_Access.php:13 -#: WWW_Users.php:33 Z_BottomUpCosts.php:51 +#: WWW_Users.php:38 Z_BottomUpCosts.php:51 msgid "Search" msgstr "جستجو" @@ -238,7 +240,7 @@ msgid "Group Name" msgstr "نام گروه" -#: AccountGroups.php:231 EDIMessageFormat.php:129 EDIMessageFormat.php:207 +#: AccountGroups.php:231 EDIMessageFormat.php:131 msgid "Section" msgstr "قسمت" @@ -260,34 +262,34 @@ #: 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:452 CompanyPreferences.php:454 -#: CompanyPreferences.php:465 CompanyPreferences.php:467 +#: 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:590 Customers.php:847 -#: Customers.php:854 Customers.php:857 DeliveryDetails.php:1034 +#: 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 -#: MRPCalendar.php:222 MRP.php:529 MRP.php:533 MRP.php:537 MRP.php:541 -#: PaymentMethods.php:203 PaymentMethods.php:204 PaymentMethods.php:264 -#: PaymentMethods.php:270 PDFChequeListing.php:63 +#: 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:754 PO_PDFPurchOrder.php:344 PO_PDFPurchOrder.php:347 -#: PurchData.php:192 PurchData.php:494 PurchData.php:497 -#: RecurringSalesOrders.php:483 RecurringSalesOrders.php:486 +#: 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:869 Stocks.php:871 Stocks.php:889 Stocks.php:891 +#: Stocks.php:867 Stocks.php:869 Stocks.php:887 Stocks.php:889 #: SuppContractChgs.php:83 SuppLoginSetup.php:511 SuppLoginSetup.php:513 -#: SystemParameters.php:376 SystemParameters.php:399 SystemParameters.php:415 +#: SystemParameters.php:373 SystemParameters.php:405 SystemParameters.php:450 #: SystemParameters.php:468 SystemParameters.php:476 SystemParameters.php:516 -#: SystemParameters.php:589 SystemParameters.php:598 SystemParameters.php:606 -#: SystemParameters.php:624 SystemParameters.php:631 SystemParameters.php:756 -#: SystemParameters.php:887 SystemParameters.php:889 SystemParameters.php:899 -#: SystemParameters.php:901 SystemParameters.php:955 SystemParameters.php:967 -#: SystemParameters.php:969 TaxGroups.php:292 TaxGroups.php:295 -#: TaxGroups.php:344 WWW_Users.php:605 WWW_Users.php:607 +#: 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 msgid "Yes" msgstr "بلی" @@ -295,60 +297,59 @@ #: 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:451 CompanyPreferences.php:455 -#: CompanyPreferences.php:464 CompanyPreferences.php:468 +#: CompanyPreferences.php:450 CompanyPreferences.php:454 +#: CompanyPreferences.php:462 CompanyPreferences.php:466 #: ContractCosting.php:172 CustLoginSetup.php:589 CustLoginSetup.php:593 -#: CustomerBranches.php:420 Customers.php:589 Customers.php:845 -#: Customers.php:853 Customers.php:856 DeliveryDetails.php:1035 +#: CustomerBranches.php:420 Customers.php:599 Customers.php:855 +#: Customers.php:863 Customers.php:866 DeliveryDetails.php:1035 #: DeliveryDetails.php:1075 DeliveryDetails.php:1078 GLTransInquiry.php:127 -#: MRPCalendar.php:224 MRP.php:527 MRP.php:531 MRP.php:535 MRP.php:539 -#: PaymentMethods.php:203 PaymentMethods.php:204 PaymentMethods.php:265 -#: PaymentMethods.php:271 PDFChequeListing.php:62 +#: Locations.php:375 MRPCalendar.php:224 MRP.php:528 MRP.php:532 MRP.php:536 +#: MRP.php:540 PaymentMethods.php:203 PaymentMethods.php:204 +#: PaymentMethods.php:265 PaymentMethods.php:271 PDFChequeListing.php:62 #: PDFDeliveryDifferences.php:63 PDFDIFOT.php:66 #: PO_AuthorisationLevels.php:134 PO_AuthorisationLevels.php:139 -#: PO_Header.php:753 PO_PDFPurchOrder.php:345 PO_PDFPurchOrder.php:348 -#: PurchData.php:195 PurchData.php:495 PurchData.php:498 -#: RecurringSalesOrders.php:482 RecurringSalesOrders.php:485 +#: PO_Header.php:757 PO_PDFPurchOrder.php:368 PO_PDFPurchOrder.php:371 +#: PurchData.php:192 PurchData.php:470 PurchData.php:473 +#: RecurringSalesOrders.php:478 RecurringSalesOrders.php:481 #: SalesAnalReptCols.php:277 SalesAnalReptCols.php:402 #: SalesAnalReptCols.php:405 SalesAnalRepts.php:405 SalesAnalRepts.php:408 #: SalesAnalRepts.php:431 SalesAnalRepts.php:434 SalesAnalRepts.php:457 #: SalesAnalRepts.php:460 SelectProduct.php:353 ShipmentCosting.php:623 -#: Stocks.php:864 Stocks.php:866 Stocks.php:884 Stocks.php:886 +#: Stocks.php:862 Stocks.php:864 Stocks.php:882 Stocks.php:884 #: SuppContractChgs.php:85 SuppLoginSetup.php:510 SuppLoginSetup.php:514 -#: SystemParameters.php:377 SystemParameters.php:400 SystemParameters.php:416 +#: SystemParameters.php:374 SystemParameters.php:406 SystemParameters.php:451 #: SystemParameters.php:469 SystemParameters.php:477 SystemParameters.php:517 -#: SystemParameters.php:590 SystemParameters.php:599 SystemParameters.php:607 -#: SystemParameters.php:625 SystemParameters.php:632 SystemParameters.php:757 -#: SystemParameters.php:886 SystemParameters.php:890 SystemParameters.php:898 -#: SystemParameters.php:902 SystemParameters.php:956 SystemParameters.php:966 -#: SystemParameters.php:970 TaxGroups.php:293 TaxGroups.php:296 -#: TaxGroups.php:346 WWW_Users.php:604 WWW_Users.php:608 -#: includes/PDFLowGPPageHeader.inc:44 includes/PDFTaxPageHeader.inc:35 +#: SystemParameters.php:590 SystemParameters.php:598 SystemParameters.php:616 +#: SystemParameters.php:623 SystemParameters.php:747 SystemParameters.php:876 +#: SystemParameters.php:880 SystemParameters.php:888 SystemParameters.php:892 +#: SystemParameters.php:946 SystemParameters.php:956 SystemParameters.php:960 +#: TaxGroups.php:293 TaxGroups.php:296 TaxGroups.php:346 WWW_Users.php:609 +#: WWW_Users.php:613 includes/PDFLowGPPageHeader.inc:44 +#: includes/PDFTaxPageHeader.inc:35 msgid "No" msgstr "خیر" #: AccountGroups.php:265 AccountSections.php:197 AddCustomerContacts.php:131 #: AddCustomerNotes.php:125 AddCustomerTypeNotes.php:123 Areas.php:165 #: BankAccounts.php:226 BOMs.php:150 COGSGLPostings.php:113 -#: COGSGLPostings.php:215 CreditStatus.php:175 Currencies.php:239 -#: CustLoginSetup.php:312 CustomerBranches.php:424 Customers.php:899 -#: Customers.php:931 CustomerTypes.php:205 EDIMessageFormat.php:150 -#: Factors.php:208 FixedAssetCategories.php:181 FixedAssetLocations.php:102 +#: COGSGLPostings.php:218 CreditStatus.php:175 Currencies.php:239 +#: CustLoginSetup.php:312 CustomerBranches.php:424 Customers.php:909 +#: Customers.php:941 CustomerTypes.php:205 EDIMessageFormat.php:152 +#: Factors.php:208 FixedAssetCategories.php:182 FixedAssetLocations.php:102 #: FreightCosts.php:243 GeocodeSetup.php:169 GLAccounts.php:319 GLTags.php:62 -#: Labels.php:414 Locations.php:380 MRPDemands.php:304 MRPDemandTypes.php:122 +#: Labels.php:414 Locations.php:382 MRPDemands.php:304 MRPDemandTypes.php:122 #: PaymentMethods.php:205 PaymentTerms.php:203 PcAssignCashToTab.php:251 -#: PcClaimExpensesFromTab.php:229 PcExpenses.php:186 PcTabs.php:188 -#: PcTypeTabs.php:174 PO_AuthorisationLevels.php:148 Prices_Customer.php:283 -#: Prices.php:227 PurchData.php:207 SalesCategories.php:263 +#: PcClaimExpensesFromTab.php:229 PcExpenses.php:176 PcTabs.php:188 +#: PcTypeTabs.php:171 PO_AuthorisationLevels.php:148 Prices_Customer.php:283 +#: Prices.php:227 PurchData.php:202 SalesCategories.php:263 #: SalesGLPostings.php:135 SalesGLPostings.php:247 SalesPeople.php:210 -#: SalesTypes.php:206 SelectCustomer.php:610 SelectCustomer.php:626 -#: SelectCustomer.php:648 SelectCustomer.php:664 SelectCustomer.php:686 -#: SelectCustomer.php:702 Shippers.php:144 StockCategories.php:244 -#: SupplierContacts.php:153 SupplierTypes.php:192 SuppLoginSetup.php:274 +#: SalesTypes.php:206 SelectCustomer.php:607 SelectCustomer.php:623 +#: SelectCustomer.php:645 SelectCustomer.php:661 SelectCustomer.php:683 +#: SelectCustomer.php:699 Shippers.php:144 StockCategories.php:244 +#: SupplierContacts.php:156 SupplierTypes.php:192 SuppLoginSetup.php:274 #: TaxAuthorities.php:173 TaxCategories.php:184 TaxGroups.php:179 -#: TaxProvinces.php:178 UnitsOfMeasure.php:187 WorkCentres.php:138 -#: WWW_Access.php:127 WWW_Users.php:307 includes/InputSerialItems.php:88 -#: includes/OutputSerialItems.php:21 +#: TaxProvinces.php:178 UnitsOfMeasure.php:201 WorkCentres.php:138 +#: WWW_Access.php:127 WWW_Users.php:312 includes/InputSerialItems.php:88 #, php-format msgid "Edit" msgstr "ویرایش" @@ -356,32 +357,31 @@ #: AccountGroups.php:266 AccountSections.php:201 AddCustomerContacts.php:132 #: AddCustomerNotes.php:126 AddCustomerTypeNotes.php:124 Areas.php:166 #: BankAccounts.php:227 BOMs.php:152 COGSGLPostings.php:114 -#: COGSGLPostings.php:216 ContractBOM.php:272 ContractOtherReqts.php:121 -#: CounterSales.php:781 Credit_Invoice.php:385 CreditStatus.php:176 -#: Currencies.php:242 CustLoginSetup.php:313 CustomerReceipt.php:863 -#: Customers.php:932 CustomerTypes.php:206 DiscountCategories.php:204 -#: DiscountMatrix.php:178 EDIMessageFormat.php:151 -#: FixedAssetCategories.php:182 FreightCosts.php:244 GeocodeSetup.php:170 -#: GLAccounts.php:320 GLJournal.php:385 Labels.php:414 Locations.php:381 +#: COGSGLPostings.php:219 ContractBOM.php:272 ContractOtherReqts.php:121 +#: CounterSales.php:741 Credit_Invoice.php:386 CreditStatus.php:176 +#: Currencies.php:242 CustLoginSetup.php:313 CustomerReceipt.php:866 +#: Customers.php:942 CustomerTypes.php:206 DiscountCategories.php:204 +#: DiscountMatrix.php:178 EDIMessageFormat.php:153 +#: FixedAssetCategories.php:183 FreightCosts.php:244 GeocodeSetup.php:170 +#: GLAccounts.php:320 GLJournal.php:403 Labels.php:414 Locations.php:383 #: MRPDemands.php:305 MRPDemandTypes.php:123 PaymentMethods.php:206 -#: Payments.php:959 PaymentTerms.php:204 PcAssignCashToTab.php:255 -#: PcClaimExpensesFromTab.php:230 PcExpenses.php:187 PcExpensesTypeTab.php:164 -#: PcTabs.php:189 PcTypeTabs.php:175 PO_AuthorisationLevels.php:150 -#: PO_Items.php:762 Prices_Customer.php:284 Prices.php:228 PurchData.php:208 +#: Payments.php:961 PaymentTerms.php:204 PcAssignCashToTab.php:255 +#: PcClaimExpensesFromTab.php:230 PcExpenses.php:177 PcExpensesTypeTab.php:161 +#: PcTabs.php:189 PcTypeTabs.php:172 PO_AuthorisationLevels.php:150 +#: PO_Items.php:976 Prices_Customer.php:284 Prices.php:228 PurchData.php:203 #: SalesAnalReptCols.php:294 SalesAnalRepts.php:305 SalesCategories.php:264 #: SalesGLPostings.php:136 SalesGLPostings.php:248 SalesPeople.php:211 -#: SalesTypes.php:207 SelectCreditItems.php:745 SelectCustomer.php:611 -#: SelectCustomer.php:627 SelectCustomer.php:649 SelectCustomer.php:665 -#: SelectCustomer.php:687 SelectCustomer.php:703 SelectOrderItems.php:1358 +#: SalesTypes.php:207 SelectCreditItems.php:747 SelectCustomer.php:608 +#: SelectCustomer.php:624 SelectCustomer.php:646 SelectCustomer.php:662 +#: SelectCustomer.php:684 SelectCustomer.php:700 SelectOrderItems.php:1363 #: Shipments.php:424 Shippers.php:145 SpecialOrder.php:590 #: StockCategories.php:245 StockCategories.php:539 SuppContractChgs.php:91 -#: SuppCreditGRNs.php:93 SuppFixedAssetChgs.php:81 SuppInvGRNs.php:135 -#: SupplierContacts.php:154 SupplierTypes.php:194 SuppLoginSetup.php:275 +#: SuppCreditGRNs.php:93 SuppFixedAssetChgs.php:87 SuppInvGRNs.php:135 +#: SupplierContacts.php:157 SupplierTypes.php:194 SuppLoginSetup.php:275 #: SuppShiptChgs.php:86 SuppTransGLAnalysis.php:111 TaxAuthorities.php:174 #: TaxCategories.php:185 TaxGroups.php:180 TaxProvinces.php:179 -#: UnitsOfMeasure.php:188 WorkCentres.php:139 WOSerialNos.php:300 -#: WWW_Access.php:128 WWW_Users.php:308 includes/InputSerialItemsKeyed.php:57 -#: includes/OutputSerialItems.php:98 +#: UnitsOfMeasure.php:202 WorkCentres.php:139 WOSerialNos.php:300 +#: WWW_Access.php:128 WWW_Users.php:313 includes/InputSerialItemsKeyed.php:54 #, php-format msgid "Delete" msgstr "حذف" @@ -425,23 +425,23 @@ #: AccountGroups.php:401 AccountSections.php:262 AddCustomerContacts.php:208 #: AddCustomerNotes.php:201 AddCustomerTypeNotes.php:192 Areas.php:222 -#: BankAccounts.php:373 BOMs.php:725 COGSGLPostings.php:353 +#: BankAccounts.php:373 BOMs.php:725 COGSGLPostings.php:347 #: CreditStatus.php:247 Currencies.php:339 CustLoginSetup.php:611 -#: DiscountMatrix.php:141 EDIMessageFormat.php:247 -#: FixedAssetCategories.php:327 FixedAssetLocations.php:148 +#: DiscountMatrix.php:141 EDIMessageFormat.php:249 +#: FixedAssetCategories.php:328 FixedAssetLocations.php:148 #: FreightCosts.php:342 GeocodeSetup.php:266 GLAccounts.php:269 -#: Locations.php:558 MRPDemands.php:402 MRPDemandTypes.php:182 +#: Locations.php:553 MRPDemands.php:402 MRPDemandTypes.php:182 #: OffersReceived.php:52 OffersReceived.php:128 PaymentMethods.php:276 #: PaymentTerms.php:282 PO_AuthorisationLevels.php:217 Prices_Customer.php:372 #: SalesAnalReptCols.php:510 SalesAnalRepts.php:496 SalesGLPostings.php:415 #: SalesPeople.php:302 Shippers.php:196 StockCategories.php:561 -#: SupplierContacts.php:250 SuppLoginSetup.php:532 TaxAuthorities.php:313 -#: TaxCategories.php:235 TaxProvinces.php:229 UnitsOfMeasure.php:239 -#: WorkCentres.php:261 WWW_Users.php:638 +#: SupplierContacts.php:251 SuppLoginSetup.php:532 TaxAuthorities.php:313 +#: TaxCategories.php:235 TaxProvinces.php:229 UnitsOfMeasure.php:253 +#: WorkCentres.php:261 WWW_Users.php:643 msgid "Enter Information" msgstr "ورود اطلاعات" -#: AccountSections.php:9 index.php:1282 +#: AccountSections.php:9 index.php:1278 msgid "Account Sections" msgstr "بخش ها حساب کاربری" @@ -501,8 +501,8 @@ msgid "Could not retrieve the requested section please try again." msgstr "نمی توان بازیابی بخش های درخواست شده لطفا دوباره سعی کنید." -#: AddCustomerContacts.php:6 AddCustomerContacts.php:59 SelectCustomer.php:604 -#: SelectCustomer.php:633 +#: AddCustomerContacts.php:6 AddCustomerContacts.php:59 SelectCustomer.php:601 +#: SelectCustomer.php:630 msgid "Customer Contacts" msgstr "تماس با ما مشتریان" @@ -533,10 +533,10 @@ #: AddCustomerContacts.php:59 AddCustomerNotes.php:49 #: AddCustomerTypeNotes.php:49 Areas.php:74 CustomerTypes.php:71 -#: DeliveryDetails.php:748 Factors.php:117 FixedAssetItems.php:236 -#: PcAssignCashToTab.php:73 PcClaimExpensesFromTab.php:61 PcExpenses.php:70 -#: PcTabs.php:60 PcTypeTabs.php:62 PO_Items.php:411 SalesAnalReptCols.php:129 -#: SalesPeople.php:94 SalesTypes.php:63 Stocks.php:353 Suppliers.php:514 +#: DeliveryDetails.php:748 Factors.php:117 FixedAssetItems.php:230 +#: PcAssignCashToTab.php:73 PcClaimExpensesFromTab.php:61 PcExpenses.php:60 +#: PcTabs.php:60 PcTypeTabs.php:59 PO_Items.php:381 SalesAnalReptCols.php:129 +#: SalesPeople.php:94 SalesTypes.php:63 Stocks.php:355 Suppliers.php:514 #: SupplierTypes.php:69 msgid "has been updated" msgstr "به روز شده است" @@ -549,31 +549,31 @@ msgid "The contact record has been deleted" msgstr "تماس با سابقه حذف شده است" -#: AddCustomerContacts.php:112 CompanyPreferences.php:224 -#: CustomerBranches.php:377 Customers.php:889 Customers.php:895 -#: Customers.php:961 SalesPeople.php:185 SelectCustomer.php:606 -#: StockDispatch.php:186 StockDispatch.php:198 SupplierContacts.php:141 -#: SupplierCredit.php:437 SupplierInvoice.php:408 SuppTransGLAnalysis.php:96 +#: AddCustomerContacts.php:112 CompanyPreferences.php:229 +#: CustomerBranches.php:377 Customers.php:899 Customers.php:905 +#: Customers.php:971 SalesPeople.php:185 SelectCustomer.php:603 +#: StockDispatch.php:186 StockDispatch.php:198 SupplierContacts.php:144 +#: SupplierCredit.php:433 SupplierInvoice.php:407 SuppTransGLAnalysis.php:96 #: includes/InputSerialItemsFile.php:84 includes/InputSerialItemsFile.php:124 #: includes/PDFTaxPageHeader.inc:37 msgid "Name" msgstr "نام" -#: AddCustomerContacts.php:113 AddCustomerContacts.php:190 Customers.php:890 -#: Customers.php:896 Customers.php:962 SelectCustomer.php:607 +#: AddCustomerContacts.php:113 AddCustomerContacts.php:190 Customers.php:900 +#: Customers.php:906 Customers.php:972 SelectCustomer.php:604 #: WWW_Access.php:111 WWW_Access.php:172 msgid "Role" msgstr "نقش" -#: AddCustomerContacts.php:114 Customers.php:963 +#: AddCustomerContacts.php:114 Customers.php:973 msgid "Phone no" msgstr "تلفن" -#: AddCustomerContacts.php:115 AddCustomerContacts.php:202 Customers.php:892 -#: Customers.php:898 Customers.php:964 PcAssignCashToTab.php:216 +#: AddCustomerContacts.php:115 AddCustomerContacts.php:202 Customers.php:902 +#: Customers.php:908 Customers.php:974 PcAssignCashToTab.php:216 #: PcAssignCashToTab.php:341 PcAuthorizeExpenses.php:85 #: PcClaimExpensesFromTab.php:195 PcClaimExpensesFromTab.php:348 -#: PcReportTab.php:348 SelectCustomer.php:609 SystemParameters.php:316 +#: PcReportTab.php:348 SelectCustomer.php:606 SystemParameters.php:313 #: WOSerialNos.php:277 WOSerialNos.php:279 msgid "Notes" msgstr "یادداشت ها" @@ -586,20 +586,20 @@ msgid "Contact Code" msgstr "تماس با کد" -#: AddCustomerContacts.php:184 Factors.php:279 SupplierContacts.php:218 +#: AddCustomerContacts.php:184 Factors.php:279 SupplierContacts.php:219 msgid "Contact Name" msgstr "نام تماس با ما" -#: AddCustomerContacts.php:196 Contracts.php:777 PDFRemittanceAdvice.php:247 -#: PO_Header.php:956 PO_Header.php:1026 SelectCreditItems.php:223 -#: SelectCustomer.php:464 SelectOrderItems.php:639 -#: includes/PDFStatementPageHeader.inc:63 includes/PDFTransPageHeader.inc:117 +#: AddCustomerContacts.php:196 Contracts.php:766 PDFRemittanceAdvice.php:247 +#: PO_Header.php:958 PO_Header.php:1028 SelectCreditItems.php:225 +#: SelectCustomer.php:461 SelectOrderItems.php:638 +#: includes/PDFStatementPageHeader.inc:63 includes/PDFTransPageHeader.inc:113 #: includes/PDFTransPageHeaderPortrait.inc:105 msgid "Phone" msgstr "تلفن" -#: AddCustomerNotes.php:6 AddCustomerNotes.php:49 SelectCustomer.php:641 -#: SelectCustomer.php:671 +#: AddCustomerNotes.php:6 AddCustomerNotes.php:49 SelectCustomer.php:638 +#: SelectCustomer.php:668 msgid "Customer Notes" msgstr "مشتری یادداشت ها" @@ -640,29 +640,28 @@ #: GLAccountReport.php:369 GLTransInquiry.php:45 MRPCalendar.php:217 #: PaymentAllocations.php:77 PcAssignCashToTab.php:212 #: PcAuthorizeExpenses.php:81 PDFRemittanceAdvice.php:308 -#: PrintCustTrans.php:616 PrintCustTransPortrait.php:790 ReverseGRN.php:378 +#: PrintCustTrans.php:678 PrintCustTransPortrait.php:860 ReverseGRN.php:378 #: ShipmentCosting.php:503 ShipmentCosting.php:574 Shipments.php:467 #: StockDispatch.php:188 StockDispatch.php:200 StockLocMovements.php:85 #: StockMovements.php:98 StockSerialItemResearch.php:79 #: SupplierAllocations.php:464 SupplierAllocations.php:576 #: SupplierAllocations.php:646 SupplierInquiry.php:195 #: SupplierTransInquiry.php:89 includes/PDFQuotationPageHeader.inc:91 -#: includes/PDFQuotationPortraitPageHeader.inc:90 #: includes/PDFStatementPageHeader.inc:169 includes/PDFTaxPageHeader.inc:36 -#: includes/PDFTransPageHeader.inc:84 +#: includes/PDFTransPageHeader.inc:80 #: includes/PDFTransPageHeaderPortrait.inc:58 msgid "Date" msgstr "تاریخ" #: AddCustomerNotes.php:107 AddCustomerTypeNotes.php:105 PcReportTab.php:176 -#: Stocks.php:873 UpgradeDatabase.php:147 UpgradeDatabase.php:150 -#: UpgradeDatabase.php:153 UpgradeDatabase.php:156 UpgradeDatabase.php:159 -#: UpgradeDatabase.php:162 UpgradeDatabase.php:165 UpgradeDatabase.php:168 -#: Z_Upgrade_3.10-3.11.php:62 Z_Upgrade_3.10-3.11.php:66 -#: Z_Upgrade_3.10-3.11.php:70 Z_Upgrade_3.10-3.11.php:74 -#: Z_Upgrade_3.10-3.11.php:78 Z_Upgrade_3.11-4.00.php:62 -#: Z_Upgrade_3.11-4.00.php:66 Z_Upgrade_3.11-4.00.php:70 -#: Z_Upgrade_3.11-4.00.php:74 Z_Upgrade_3.11-4.00.php:78 +#: Stocks.php:871 UpgradeDatabase.php:145 UpgradeDatabase.php:148 +#: UpgradeDatabase.php:151 UpgradeDatabase.php:154 UpgradeDatabase.php:157 +#: UpgradeDatabase.php:160 UpgradeDatabase.php:163 Z_Upgrade_3.10-3.11.php:62 +#: Z_Upgrade_3.10-3.11.php:66 Z_Upgrade_3.10-3.11.php:70 +#: Z_Upgrade_3.10-3.11.php:74 Z_Upgrade_3.10-3.11.php:78 +#: Z_Upgrade_3.11-4.00.php:62 Z_Upgrade_3.11-4.00.php:66 +#: Z_Upgrade_3.11-4.00.php:70 Z_Upgrade_3.11-4.00.php:74 +#: Z_Upgrade_3.11-4.00.php:78 msgid "Note" msgstr "یادداشت" @@ -687,7 +686,7 @@ msgid "Contact Note" msgstr "تماس با تبصره" -#: AddCustomerTypeNotes.php:6 SelectCustomer.php:679 +#: AddCustomerTypeNotes.php:6 SelectCustomer.php:676 msgid "Customer Type (Group) Notes" msgstr "نوع مشتری (گروه) یادداشت ها" @@ -695,7 +694,7 @@ msgid "The Contact priority must be an integer." msgstr "تماس با اولویت باید یک عدد صحیح باشد." -#: AddCustomerTypeNotes.php:49 SelectCustomer.php:709 +#: AddCustomerTypeNotes.php:49 SelectCustomer.php:706 msgid "Customer Group Notes" msgstr "یادداشت های مشتریان گروه" @@ -740,26 +739,26 @@ msgstr "سالمندان مشتریان تجزیه و تحلیل حساب کاربری" #: AgedDebtors.php:267 AgedDebtors.php:365 AgedDebtors.php:436 -#: AgedSuppliers.php:105 BOMExtendedQty.php:159 BOMIndented.php:150 -#: BOMIndentedReverse.php:151 BOMListing.php:48 BOMListing.php:59 +#: AgedSuppliers.php:105 BOMExtendedQty.php:156 BOMIndented.php:149 +#: BOMIndentedReverse.php:148 BOMListing.php:48 BOMListing.php:59 #: DebtorsAtPeriodEnd.php:58 DebtorsAtPeriodEnd.php:70 GLBalanceSheet.php:90 #: GLBalanceSheet.php:128 GLProfit_Loss.php:157 GLTagProfit_Loss.php:174 #: GLTrialBalance.php:151 InventoryPlanning.php:99 InventoryPlanning.php:174 -#: InventoryPlanning.php:209 InventoryPlanning.php:257 -#: InventoryPlanning.php:295 InventoryPlanningPrefSupplier.php:208 +#: InventoryPlanning.php:209 InventoryPlanning.php:252 +#: InventoryPlanning.php:290 InventoryPlanningPrefSupplier.php:208 #: InventoryPlanningPrefSupplier.php:276 InventoryPlanningPrefSupplier.php:310 -#: InventoryPlanningPrefSupplier.php:355 InventoryPlanningPrefSupplier.php:401 +#: InventoryPlanningPrefSupplier.php:353 InventoryPlanningPrefSupplier.php:401 #: InventoryQuantities.php:83 InventoryValuation.php:76 -#: MailInventoryValuation.php:115 MRPPlannedPurchaseOrders.php:114 +#: MailInventoryValuation.php:115 MRPPlannedPurchaseOrders.php:111 #: MRPPlannedWorkOrders.php:105 MRPReport.php:147 MRPReport.php:529 -#: MRPReschedules.php:46 MRPReschedules.php:58 MRPShortages.php:145 -#: MRPShortages.php:157 OutstandingGRNs.php:51 OutstandingGRNs.php:63 +#: MRPReschedules.php:46 MRPReschedules.php:58 MRPShortages.php:137 +#: MRPShortages.php:149 OutstandingGRNs.php:51 OutstandingGRNs.php:63 #: PDFCustomerList.php:20 PDFCustomerList.php:232 PDFCustomerList.php:244 #: PDFLowGP.php:23 PDFStockCheckComparison.php:35 #: PDFStockCheckComparison.php:61 PDFStockCheckComparison.php:262 #: ReorderLevel.php:59 SelectAsset.php:36 SelectProduct.php:37 #: StockCheck.php:65 StockCheck.php:139 SupplierTenders.php:325 -#: SuppPriceList.php:118 includes/PDFPaymentRun_PymtFooter.php:149 +#: SuppPriceList.php:118 includes/PDFPaymentRun_PymtFooter.php:148 msgid "Problem Report" msgstr "گزارش مشکل" @@ -769,38 +768,38 @@ msgstr "جزئیات مشتری می تواند با گذاشتن زیرا قابل بازیابی نیست" #: AgedDebtors.php:270 AgedDebtors.php:368 AgedDebtors.php:442 -#: AgedSuppliers.php:108 AgedSuppliers.php:190 BOMExtendedQty.php:162 -#: BOMExtendedQty.php:259 BOMIndented.php:153 BOMIndented.php:239 -#: BOMIndentedReverse.php:154 BOMIndentedReverse.php:232 BOMListing.php:51 -#: Credit_Invoice.php:185 DebtorsAtPeriodEnd.php:61 DebtorsAtPeriodEnd.php:73 +#: AgedSuppliers.php:108 AgedSuppliers.php:190 BOMExtendedQty.php:159 +#: BOMExtendedQty.php:263 BOMIndented.php:152 BOMIndented.php:238 +#: BOMIndentedReverse.php:151 BOMIndentedReverse.php:235 BOMListing.php:51 +#: Credit_Invoice.php:186 DebtorsAtPeriodEnd.php:61 DebtorsAtPeriodEnd.php:73 #: FTP_RadioBeacon.php:188 GetStockImage.php:154 GLBalanceSheet.php:93 #: GLBalanceSheet.php:131 GLBalanceSheet.php:294 GLProfit_Loss.php:160 #: GLProfit_Loss.php:172 GLTagProfit_Loss.php:177 GLTagProfit_Loss.php:189 #: GLTrialBalance.php:154 GLTrialBalance.php:166 InventoryPlanning.php:102 #: InventoryPlanning.php:177 InventoryPlanning.php:212 -#: InventoryPlanning.php:260 InventoryPlanning.php:298 -#: InventoryPlanning.php:361 InventoryPlanningPrefSupplier.php:211 +#: InventoryPlanning.php:255 InventoryPlanning.php:293 +#: InventoryPlanning.php:356 InventoryPlanningPrefSupplier.php:211 #: InventoryPlanningPrefSupplier.php:279 InventoryPlanningPrefSupplier.php:313 -#: InventoryPlanningPrefSupplier.php:358 InventoryPlanningPrefSupplier.php:404 +#: InventoryPlanningPrefSupplier.php:356 InventoryPlanningPrefSupplier.php:404 #: InventoryPlanningPrefSupplier.php:460 InventoryQuantities.php:86 #: InventoryQuantities.php:97 InventoryValuation.php:79 #: InventoryValuation.php:90 MailInventoryValuation.php:118 -#: MailInventoryValuation.php:214 MRPPlannedPurchaseOrders.php:117 -#: MRPPlannedPurchaseOrders.php:128 MRPPlannedWorkOrders.php:108 +#: MailInventoryValuation.php:214 MRPPlannedPurchaseOrders.php:114 +#: MRPPlannedPurchaseOrders.php:125 MRPPlannedWorkOrders.php:108 #: MRPPlannedWorkOrders.php:119 MRPPlannedWorkOrders.php:318 MRPReport.php:41 #: MRPReport.php:52 MRPReport.php:150 MRPReschedules.php:49 -#: MRPReschedules.php:61 MRPShortages.php:148 MRPShortages.php:160 +#: MRPReschedules.php:61 MRPShortages.php:140 MRPShortages.php:152 #: OutstandingGRNs.php:54 OutstandingGRNs.php:66 PcReportTab.php:236 -#: PDFCustomerList.php:235 PDFCustomerList.php:247 PDFGrn.php:123 -#: PDFLowGP.php:63 PDFLowGP.php:75 PDFPriceList.php:124 PDFQuotation.php:234 -#: PDFQuotationPortrait.php:235 PDFRemittanceAdvice.php:84 -#: PDFStockCheckComparison.php:39 PDFStockCheckComparison.php:65 -#: PDFStockCheckComparison.php:266 PDFTopItems.php:118 PO_PDFPurchOrder.php:30 -#: PO_PDFPurchOrder.php:144 PrintCustOrder_generic.php:180 -#: PrintCustOrder.php:198 ReorderLevel.php:62 ReorderLevel.php:151 -#: SalesAnalysis_UserDefined.php:28 SelectCreditItems.php:23 StockCheck.php:47 +#: PDFCustomerList.php:235 PDFCustomerList.php:247 PDFGrn.php:147 +#: PDFLowGP.php:63 PDFLowGP.php:75 PDFPriceList.php:124 PDFQuotation.php:237 +#: PDFRemittanceAdvice.php:84 PDFStockCheckComparison.php:39 +#: PDFStockCheckComparison.php:65 PDFStockCheckComparison.php:266 +#: PDFTopItems.php:123 PO_PDFPurchOrder.php:21 PO_PDFPurchOrder.php:131 +#: PrintCustOrder_generic.php:182 PrintCustOrder.php:198 +#: PrintSalesOrder_generic.php:183 ReorderLevel.php:62 ReorderLevel.php:151 +#: SalesAnalysis_UserDefined.php:28 SelectCreditItems.php:25 StockCheck.php:47 #: StockCheck.php:68 StockCheck.php:98 StockCheck.php:142 StockCheck.php:153 -#: StockCheck.php:195 StockDispatch.php:93 StockDispatch.php:105 +#: StockCheck.php:194 StockDispatch.php:93 StockDispatch.php:105 #: SupplierBalsAtPeriodEnd.php:57 SupplierBalsAtPeriodEnd.php:68 #: SuppPaymentRun.php:109 SuppPaymentRun.php:120 SuppPaymentRun.php:184 #: SuppPaymentRun.php:214 SuppPriceList.php:121 Tax.php:64 Tax.php:177 @@ -808,11 +807,11 @@ #: Z_DataExport.php:309 Z_DataExport.php:348 Z_DataExport.php:384 #: Z_DataExport.php:420 Z_DataExport.php:472 Z_poRebuildDefault.php:38 #: includes/PDFPaymentRun_PymtFooter.php:57 -#: includes/PDFPaymentRun_PymtFooter.php:87 -#: includes/PDFPaymentRun_PymtFooter.php:116 -#: includes/PDFPaymentRun_PymtFooter.php:152 -#: includes/PDFPaymentRun_PymtFooter.php:183 -#: includes/PDFPaymentRun_PymtFooter.php:215 +#: includes/PDFPaymentRun_PymtFooter.php:86 +#: includes/PDFPaymentRun_PymtFooter.php:115 +#: includes/PDFPaymentRun_PymtFooter.php:151 +#: includes/PDFPaymentRun_PymtFooter.php:182 +#: includes/PDFPaymentRun_PymtFooter.php:214 #: includes/ConstructSQLForUserDefinedSalesReport.inc:180 #: includes/ConstructSQLForUserDefinedSalesReport.inc:188 #: includes/ConstructSQLForUserDefinedSalesReport.inc:340 @@ -823,39 +822,39 @@ msgid "The details of outstanding transactions for customer" msgstr "جزئیات معاملات برجسته برای مشتری" -#: AgedDebtors.php:367 AgedSuppliers.php:189 GLAccountCSV.php:167 -#: GLAccountInquiry.php:145 GLAccountReport.php:93 PO_Items.php:471 -#: PO_Items.php:605 PO_Items.php:632 SalesAnalReptCols.php:356 -#: SpecialOrder.php:369 StockLocTransferReceive.php:373 -#: StockQuantityByDate.php:114 includes/SelectOrderItems_IntoCart.inc:53 +#: AgedDebtors.php:367 AgedSuppliers.php:189 GLAccountCSV.php:169 +#: GLAccountInquiry.php:145 GLAccountReport.php:93 PO_Items.php:532 +#: PO_Items.php:562 PO_Items.php:640 PO_Items.php:803 +#: SalesAnalReptCols.php:356 SpecialOrder.php:369 +#: StockLocTransferReceive.php:373 StockQuantityByDate.php:106 +#: includes/SelectOrderItems_IntoCart.inc:53 msgid "could not be retrieved because" msgstr "قابل بازیابی نیست زیرا" #: AgedDebtors.php:370 AgedSuppliers.php:192 Areas.php:96 -#: ConfirmDispatch_Invoice.php:152 ConfirmDispatch_Invoice.php:969 -#: ConfirmDispatch_Invoice.php:983 Contracts.php:581 CounterSales.php:1323 -#: CounterSales.php:1337 Credit_Invoice.php:706 Credit_Invoice.php:728 -#: CustomerReceipt.php:523 CustomerReceipt.php:655 CustomerReceipt.php:683 +#: ConfirmDispatch_Invoice.php:155 ConfirmDispatch_Invoice.php:962 +#: ConfirmDispatch_Invoice.php:976 Contracts.php:583 CounterSales.php:1280 +#: CounterSales.php:1294 Credit_Invoice.php:707 Credit_Invoice.php:729 +#: CustomerReceipt.php:526 CustomerReceipt.php:658 CustomerReceipt.php:686 #: CustomerTransInquiry.php:79 DeliveryDetails.php:395 GLProfit_Loss.php:578 -#: GLTagProfit_Loss.php:490 Payments.php:308 PDFRemittanceAdvice.php:86 -#: PurchData.php:89 PurchData.php:108 PurchData.php:244 ReverseGRN.php:191 -#: ReverseGRN.php:205 ReverseGRN.php:366 SelectCreditItems.php:1381 -#: SelectSalesOrder.php:113 SelectSalesOrder.php:281 StockCheck.php:225 -#: StockCostUpdate.php:79 StockCostUpdate.php:89 StockLocStatus.php:142 -#: StockMovements.php:92 StockQuantityByDate.php:90 StockReorderLevel.php:39 -#: StockStatus.php:271 StockTransfers.php:159 StockUsageGraph.php:53 -#: StockUsage.php:132 SupplierInquiry.php:79 SupplierInquiry.php:101 -#: SupplierInquiry.php:131 SupplierInquiry.php:177 SupplierTransInquiry.php:81 -#: SuppPaymentRun.php:111 SuppPaymentRun.php:186 SuppPaymentRun.php:216 -#: WorkOrderCosting.php:393 WorkOrderReceive.php:272 WOSerialNos.php:44 -#: Z_ChangeBranchCode.php:108 Z_ChangeCustomerCode.php:92 +#: GLTagProfit_Loss.php:490 Payments.php:307 PDFRemittanceAdvice.php:86 +#: PurchData.php:89 PurchData.php:108 PurchData.php:219 ReverseGRN.php:191 +#: ReverseGRN.php:205 ReverseGRN.php:366 SelectCreditItems.php:1383 +#: StockCheck.php:224 StockCostUpdate.php:79 StockCostUpdate.php:89 +#: StockLocStatus.php:142 StockMovements.php:92 StockQuantityByDate.php:82 +#: StockReorderLevel.php:39 StockStatus.php:271 StockTransfers.php:159 +#: StockUsageGraph.php:53 StockUsage.php:127 SupplierInquiry.php:79 +#: SupplierInquiry.php:101 SupplierInquiry.php:131 SupplierInquiry.php:177 +#: SupplierTransInquiry.php:81 SuppPaymentRun.php:111 SuppPaymentRun.php:186 +#: SuppPaymentRun.php:216 WorkOrderCosting.php:393 WorkOrderReceive.php:272 +#: WOSerialNos.php:44 Z_ChangeBranchCode.php:108 Z_ChangeCustomerCode.php:90 #: Z_DeleteCreditNote.php:57 Z_DeleteInvoice.php:83 #: includes/PDFPaymentRun_PymtFooter.php:59 -#: includes/PDFPaymentRun_PymtFooter.php:89 -#: includes/PDFPaymentRun_PymtFooter.php:118 -#: includes/PDFPaymentRun_PymtFooter.php:154 -#: includes/PDFPaymentRun_PymtFooter.php:185 includes/ConnectDB_mysqli.inc:79 -#: includes/ConnectDB_mysql.inc:64 +#: includes/PDFPaymentRun_PymtFooter.php:88 +#: includes/PDFPaymentRun_PymtFooter.php:117 +#: includes/PDFPaymentRun_PymtFooter.php:153 +#: includes/PDFPaymentRun_PymtFooter.php:184 includes/ConnectDB_mysqli.inc:83 +#: includes/ConnectDB_mysql.inc:65 msgid "The SQL that failed was" msgstr "گذاشتن که شکست خورده بود" @@ -911,17 +910,17 @@ msgid "Detailed Report" msgstr "جزئیات گزارش" -#: AgedDebtors.php:520 AgedSuppliers.php:320 BOMExtendedQty.php:286 -#: BOMIndented.php:268 BOMIndentedReverse.php:255 BOMListing.php:142 -#: DebtorsAtPeriodEnd.php:166 InventoryPlanning.php:442 +#: AgedDebtors.php:520 AgedSuppliers.php:320 BOMExtendedQty.php:300 +#: BOMIndented.php:278 BOMIndentedReverse.php:266 BOMListing.php:142 +#: DebtorsAtPeriodEnd.php:166 InventoryPlanning.php:437 #: InventoryPlanningPrefSupplier.php:518 InventoryQuantities.php:188 -#: InventoryValuation.php:242 MRPPlannedPurchaseOrders.php:282 -#: MRPPlannedWorkOrders.php:344 MRPReschedules.php:166 MRPShortages.php:259 +#: InventoryValuation.php:242 MRPPlannedPurchaseOrders.php:279 +#: MRPPlannedWorkOrders.php:344 MRPReschedules.php:166 MRPShortages.php:262 #: OutstandingGRNs.php:185 PDFCustomerList.php:412 PDFLowGP.php:168 #: PDFPriceList.php:301 PDFRemittanceAdvice.php:152 -#: PDFStockCheckComparison.php:379 PrintCustTrans.php:416 -#: PrintCustTransPortrait.php:560 ReorderLevel.php:229 StockDispatch.php:309 -#: SupplierBalsAtPeriodEnd.php:155 SuppPriceList.php:228 Tax.php:352 +#: PDFStockCheckComparison.php:379 PrintCustTrans.php:478 +#: PrintCustTransPortrait.php:630 ReorderLevel.php:229 StockDispatch.php:309 +#: SupplierBalsAtPeriodEnd.php:155 SuppPriceList.php:237 Tax.php:352 msgid "Print PDF" msgstr "پی دی اف نسخه قابل چاپ" @@ -1044,10 +1043,10 @@ msgstr "کد شهر" #: Areas.php:133 CustomerTypes.php:166 Factors.php:142 -#: FixedAssetCategories.php:136 GLAccounts.php:208 Locations.php:328 +#: FixedAssetCategories.php:137 GLAccounts.php:208 Locations.php:328 #: MRPDemands.php:248 PcAssignCashToTab.php:118 PcClaimExpensesFromTab.php:109 -#: PcExpenses.php:137 PcExpensesTypeTab.php:86 PcTabs.php:124 -#: PcTypeTabs.php:137 SalesAnalReptCols.php:215 SalesCategories.php:139 +#: PcExpenses.php:127 PcExpensesTypeTab.php:83 PcTabs.php:124 +#: PcTypeTabs.php:134 SalesAnalReptCols.php:215 SalesCategories.php:139 #: SalesTypes.php:163 StockCategories.php:199 Suppliers.php:639 #: SupplierTypes.php:153 Z_DeleteInvoice.php:142 msgid "has been deleted" @@ -1073,19 +1072,19 @@ msgid "Incorrect date format used, please re-enter" msgstr "اشتباه فرمت تاریخ استفاده می شود ، لطفا دوباره وارد کنید" -#: AuditTrail.php:37 BOMIndented.php:307 BOMIndentedReverse.php:294 +#: AuditTrail.php:37 BOMIndented.php:317 BOMIndentedReverse.php:305 #: MRPCalendar.php:260 msgid "From Date" msgstr "از تاریخ" -#: AuditTrail.php:39 BOMIndented.php:308 BOMIndentedReverse.php:295 +#: AuditTrail.php:39 BOMIndented.php:318 BOMIndentedReverse.php:306 #: MRPCalendar.php:262 msgid "To Date" msgstr "تا تاریخ" #: AuditTrail.php:43 PO_AuthorisationLevels.php:123 #: PO_AuthorisationLevels.php:160 PO_AuthorisationLevels.php:163 -#: UserSettings.php:109 +#: UserSettings.php:111 msgid "User ID" msgstr "شناسه کاربر" @@ -1093,8 +1092,8 @@ msgid "Table " msgstr "جدول " -#: AuditTrail.php:68 MRPReport.php:789 PO_SelectPurchOrder.php:363 -#: SelectContract.php:196 SelectProduct.php:727 +#: AuditTrail.php:68 MRPReport.php:789 PO_SelectPurchOrder.php:357 +#: SelectContract.php:196 SelectProduct.php:710 msgid "View" msgstr "نمایش" @@ -1109,9 +1108,9 @@ #: AuditTrail.php:146 BankReconciliation.php:185 BankReconciliation.php:257 #: CustomerAllocations.php:356 CustomerInquiry.php:189 #: CustomerTransInquiry.php:21 CustomerTransInquiry.php:85 -#: CustWhereAlloc.php:18 CustWhereAlloc.php:87 DailyBankTransactions.php:99 -#: GLAccountInquiry.php:152 GLAccountReport.php:367 GLJournal.php:241 -#: MRPReschedules.php:204 SelectCustomer.php:463 ShipmentCosting.php:501 +#: CustWhereAlloc.php:18 CustWhereAlloc.php:87 DailyBankTransactions.php:79 +#: GLAccountInquiry.php:152 GLAccountReport.php:367 GLJournal.php:256 +#: MRPReschedules.php:204 SelectCustomer.php:460 ShipmentCosting.php:501 #: ShipmentCosting.php:572 StockCategories.php:219 StockLocMovements.php:83 #: StockMovements.php:97 SupplierAllocations.php:462 SupplierInquiry.php:193 #: SupplierTransInquiry.php:19 SupplierTransInquiry.php:86 @@ -1131,7 +1130,7 @@ msgid "Field Name" msgstr "نام فیلد" -#: AuditTrail.php:149 SystemParameters.php:315 +#: AuditTrail.php:149 SystemParameters.php:312 #: includes/PDFInventoryValnPageHeader.inc:38 #: includes/PDFOstdgGRNsPageHeader.inc:43 msgid "Value" @@ -1227,7 +1226,7 @@ msgid "The SQL used to retrieve the bank account details was" msgstr "گذاشتن استفاده برای بازیابی جزئیات حساب بانکی بود" -#: BankAccounts.php:196 GLJournal.php:265 +#: BankAccounts.php:196 GLJournal.php:280 msgid "GL Account Code" msgstr "گرم در کد حساب کاربری" @@ -1247,16 +1246,16 @@ msgid "Bank Address" msgstr "بانک آدرس" -#: BankAccounts.php:201 CustomerReceipt.php:753 CustomerTransInquiry.php:95 +#: BankAccounts.php:201 CustomerReceipt.php:756 CustomerTransInquiry.php:95 #: OffersReceived.php:98 PcReportTab.php:291 PcTabs.php:147 PcTabs.php:295 #: PDFPrintLabel.php:94 PO_AuthorisationLevels.php:125 #: PO_AuthorisationLevels.php:180 PO_AuthorisationLevels.php:183 #: PO_AuthoriseMyOrders.php:107 PO_Header.php:534 -#: PO_SelectOSPurchOrder.php:444 PO_SelectPurchOrder.php:365 -#: PricesByCost.php:239 Prices.php:198 Prices.php:293 PurchData.php:172 -#: PurchData.php:340 PurchData.php:453 SelectSupplier.php:251 -#: SupplierCredit.php:268 SupplierInvoice.php:232 SupplierTransInquiry.php:95 -#: SuppPriceList.php:265 includes/PDFBankingSummaryPageHeader.inc:42 +#: PO_SelectOSPurchOrder.php:444 PO_SelectPurchOrder.php:359 +#: PricesByCost.php:209 Prices.php:198 Prices.php:293 PurchData.php:168 +#: PurchData.php:315 PurchData.php:428 SelectSupplier.php:251 +#: SupplierCredit.php:264 SupplierInvoice.php:232 SupplierTransInquiry.php:95 +#: SuppPriceList.php:274 includes/PDFBankingSummaryPageHeader.inc:42 #: includes/PDFDebtorBalsPageHeader.inc:33 #: includes/PDFSupplierBalsPageHeader.inc:36 msgid "Currency" @@ -1336,38 +1335,38 @@ "با استفاده از این صفحه برای مطابقت با webERP رسید و پرداخت خود را به بانک " "بیانیه. بررسی صورت حساب بانکی خود و کلیک بر روی چک باکس که همه معامله منطبق." -#: BankMatching.php:80 BankReconciliation.php:97 CustomerReceipt.php:726 -#: DailyBankTransactions.php:28 Payments.php:733 PDFChequeListing.php:46 +#: BankMatching.php:80 BankReconciliation.php:97 CustomerReceipt.php:729 +#: DailyBankTransactions.php:28 Payments.php:732 PDFChequeListing.php:46 #: TaxAuthorities.php:150 TaxAuthorities.php:306 msgid "Bank Account" msgstr "حساب بانکی ما" -#: BankMatching.php:102 +#: BankMatching.php:102 PO_SelectOSPurchOrder.php:489 msgid "Show" msgstr "نمایش" #: BankMatching.php:102 CreditItemsControlled.php:78 FreightCosts.php:270 -#: GoodsReceivedControlled.php:65 GoodsReceived.php:67 +#: GoodsReceivedControlled.php:56 GoodsReceived.php:66 #: StockLocTransferReceive.php:426 SupplierAllocations.php:443 #: SuppShiptChgs.php:126 msgid "from" msgstr "از" #: BankMatching.php:105 ConfirmDispatchControlled_Invoice.php:59 -#: EmailCustTrans.php:65 FixedAssetRegister.php:78 FTP_RadioBeacon.php:281 -#: GLAccountCSV.php:170 GLAccountReport.php:102 Payments.php:713 -#: PcReportTab.php:105 PDFChequeListing.php:108 PDFChequeListing.php:118 -#: PDFChequeListing.php:205 PDFDeliveryDifferences.php:166 -#: PDFDeliveryDifferences.php:179 PDFDeliveryDifferences.php:287 -#: PDFDIFOT.php:172 PDFDIFOT.php:185 PDFDIFOT.php:289 PDFOrdersInvoiced.php:74 -#: PDFOrdersInvoiced.php:271 PDFOrderStatus.php:75 PDFOrderStatus.php:250 -#: PO_PDFPurchOrder.php:302 PricesBasedOnMarkUp.php:216 -#: PricesBasedOnMarkUp.php:355 PrintCustStatements.php:50 -#: PrintCustTrans.php:37 PrintCustTrans.php:40 PrintCustTransPortrait.php:60 +#: EmailCustTrans.php:65 FTP_RadioBeacon.php:281 GLAccountCSV.php:172 +#: GLAccountReport.php:102 Payments.php:712 PcReportTab.php:105 +#: PDFChequeListing.php:108 PDFChequeListing.php:118 PDFChequeListing.php:205 +#: PDFDeliveryDifferences.php:166 PDFDeliveryDifferences.php:179 +#: PDFDeliveryDifferences.php:287 PDFDIFOT.php:172 PDFDIFOT.php:185 +#: PDFDIFOT.php:289 PDFOrdersInvoiced.php:74 PDFOrdersInvoiced.php:271 +#: PDFOrderStatus.php:75 PDFOrderStatus.php:250 PO_PDFPurchOrder.php:313 +#: PricesBasedOnMarkUp.php:216 PricesBasedOnMarkUp.php:334 +#: PricesBasedOnMarkUp.php:350 PrintCustStatements.php:50 +#: PrintCustTrans.php:38 PrintCustTrans.php:41 PrintCustTransPortrait.php:60 #: PrintCustTransPortrait.php:63 SalesGraph.php:200 SalesGraph.php:229 #: SalesGraph.php:233 StockLocTransferReceive.php:310 -#: StockLocTransferReceive.php:426 Stocks.php:229 Stocks.php:234 -#: StockStatus.php:309 StockStatus.php:350 StockTransfers.php:397 +#: StockLocTransferReceive.php:426 Stocks.php:231 Stocks.php:236 +#: StockStatus.php:305 StockStatus.php:347 StockTransfers.php:397 #: includes/PDFAgedDebtorsPageHeader.inc:18 #: includes/PDFAgedSuppliersPageHeader.inc:17 #: includes/PDFChequeListingPageHeader.inc:17 @@ -1458,7 +1457,8 @@ msgstr "بعد" #: BankMatching.php:218 -msgid "The payments with the selected criteria could not be retrieved because" +msgid "" +"The payments with the selected criteria could not be retrieved because" msgstr "پرداخت با معیار های انتخاب قابل بازیابی نیست زیرا" #: BankMatching.php:221 ShipmentCosting.php:502 ShipmentCosting.php:573 @@ -1466,19 +1466,19 @@ msgid "Ref" msgstr "کد عکس" -#: BankMatching.php:224 ConfirmDispatch_Invoice.php:279 Credit_Invoice.php:280 -#: CustomerAllocations.php:359 CustomerReceipt.php:842 +#: BankMatching.php:224 ConfirmDispatch_Invoice.php:272 Credit_Invoice.php:281 +#: CustomerAllocations.php:359 CustomerReceipt.php:845 #: CustomerTransInquiry.php:94 CustWhereAlloc.php:91 PaymentAllocations.php:78 -#: Payments.php:926 Payments.php:928 Payments.php:937 +#: Payments.php:928 Payments.php:930 Payments.php:939 #: PcAssignCashToTab.php:214 PcAssignCashToTab.php:335 #: PcAuthorizeExpenses.php:83 PcClaimExpensesFromTab.php:193 #: PcClaimExpensesFromTab.php:342 PcReportTab.php:175 PcReportTab.php:347 -#: PrintCheque.php:70 PrintCheque.php:84 SelectCreditItems.php:659 -#: SuppContractChgs.php:73 SuppContractChgs.php:142 SuppFixedAssetChgs.php:71 -#: SuppFixedAssetChgs.php:137 SupplierAllocations.php:466 -#: SupplierCredit.php:345 SupplierCredit.php:373 SupplierCredit.php:403 -#: SupplierCredit.php:438 SupplierInvoice.php:313 SupplierInvoice.php:344 -#: SupplierInvoice.php:373 SupplierInvoice.php:409 SupplierTransInquiry.php:94 +#: PrintCheque.php:70 PrintCheque.php:84 SelectCreditItems.php:661 +#: SuppContractChgs.php:73 SuppContractChgs.php:142 SuppFixedAssetChgs.php:77 +#: SuppFixedAssetChgs.php:136 SupplierAllocations.php:466 +#: SupplierCredit.php:341 SupplierCredit.php:369 SupplierCredit.php:399 +#: SupplierCredit.php:434 SupplierInvoice.php:312 SupplierInvoice.php:342 +#: SupplierInvoice.php:373 SupplierInvoice.php:408 SupplierTransInquiry.php:94 #: SuppShiptChgs.php:77 SuppShiptChgs.php:134 SuppTransGLAnalysis.php:97 #: SuppTransGLAnalysis.php:174 Z_CheckAllocs.php:63 #: includes/PDFBankingSummaryPageHeader.inc:55 @@ -1488,7 +1488,7 @@ #: BankMatching.php:225 BankReconciliation.php:189 BankReconciliation.php:261 #: PDFOrdersInvoiced.php:348 PDFOrderStatus.php:316 -#: PO_SelectOSPurchOrder.php:215 PO_SelectPurchOrder.php:180 +#: PO_SelectOSPurchOrder.php:215 PO_SelectPurchOrder.php:175 #: Shipt_Select.php:186 SuppCreditGRNs.php:225 #: includes/PDFStatementPageHeader.inc:173 #: includes/PDFStatementPageHeader.inc:180 @@ -1548,26 +1548,26 @@ msgid "The bank accounts could not be retrieved by the SQL because" msgstr "حساب های بانکی می تواند با گذاشتن زیرا قابل بازیابی نیست" -#: BankReconciliation.php:94 CustomerReceipt.php:717 -#: DailyBankTransactions.php:25 Payments.php:730 SuppPaymentRun.php:302 +#: BankReconciliation.php:94 CustomerReceipt.php:720 +#: DailyBankTransactions.php:25 Payments.php:729 SuppPaymentRun.php:302 msgid "The SQL used to retrieve the bank accounts was" msgstr "گذاشتن استفاده برای بازیابی حساب های بانکی شد" -#: BankReconciliation.php:100 CustomerReceipt.php:731 +#: BankReconciliation.php:100 CustomerReceipt.php:734 msgid "Bank Accounts have not yet been defined" msgstr "حساب بانک هنوز تعریف شده است" -#: BankReconciliation.php:100 CustomerReceipt.php:731 +#: BankReconciliation.php:100 CustomerReceipt.php:734 msgid "You must first" msgstr "شما باید اول" -#: BankReconciliation.php:100 CustomerReceipt.php:731 -#: DailyBankTransactions.php:32 Payments.php:737 SuppPaymentRun.php:310 +#: BankReconciliation.php:100 CustomerReceipt.php:734 +#: DailyBankTransactions.php:32 Payments.php:736 SuppPaymentRun.php:310 msgid "define the bank accounts" msgstr "تعریف حساب های بانکی" -#: BankReconciliation.php:100 CustomerReceipt.php:731 -#: DailyBankTransactions.php:32 Payments.php:737 SuppPaymentRun.php:310 +#: BankReconciliation.php:100 CustomerReceipt.php:734 +#: DailyBankTransactions.php:32 Payments.php:736 SuppPaymentRun.php:310 msgid "and general ledger accounts to be affected" msgstr "و حساب های دفتر کل عمومی که تحت تاثیر قرار" @@ -1600,24 +1600,23 @@ #: BankReconciliation.php:186 BankReconciliation.php:258 #: CustomerAllocations.php:331 CustomerAllocations.php:357 #: CustomerInquiry.php:190 CustomerTransInquiry.php:86 CustWhereAlloc.php:88 -#: EmailCustTrans.php:17 GLAccountInquiry.php:153 PrintCustTrans.php:378 -#: PrintCustTrans.php:542 PrintCustTrans.php:696 PrintCustTrans.php:735 -#: PrintCustTransPortrait.php:504 PrintCustTransPortrait.php:704 -#: PrintCustTransPortrait.php:894 PrintCustTransPortrait.php:939 +#: EmailCustTrans.php:17 GLAccountInquiry.php:153 PrintCustTrans.php:440 +#: PrintCustTrans.php:604 PrintCustTrans.php:758 PrintCustTrans.php:797 +#: PrintCustTransPortrait.php:574 PrintCustTransPortrait.php:774 +#: PrintCustTransPortrait.php:964 PrintCustTransPortrait.php:1009 #: StockMovements.php:97 SupplierAllocations.php:463 #: SupplierAllocations.php:575 SupplierAllocations.php:645 #: SupplierTransInquiry.php:87 Z_CheckAllocs.php:60 #: Z_CheckGLTransBalance.php:13 includes/PDFQuotationPageHeader.inc:87 -#: includes/PDFQuotationPortraitPageHeader.inc:86 #: includes/PDFStatementPageHeader.inc:168 -#: includes/PDFStatementPageHeader.inc:179 includes/PDFTransPageHeader.inc:80 +#: includes/PDFStatementPageHeader.inc:179 includes/PDFTransPageHeader.inc:76 #: includes/PDFTransPageHeaderPortrait.inc:52 msgid "Number" msgstr "عدد" #: BankReconciliation.php:187 BankReconciliation.php:259 #: ContractCosting.php:148 CustomerInquiry.php:193 CustomerTransInquiry.php:90 -#: CustWhereAlloc.php:89 DailyBankTransactions.php:100 GLAccountReport.php:368 +#: CustWhereAlloc.php:89 DailyBankTransactions.php:80 GLAccountReport.php:368 #: PaymentAllocations.php:75 PaymentAllocations.php:76 #: PDFRemittanceAdvice.php:309 ShiptsList.php:37 StockCounts.php:99 #: StockCounts.php:135 StockLocMovements.php:88 StockMovements.php:100 @@ -1672,9 +1671,9 @@ "کاربری ایجاد کنید. مهم است که نرخ ارز بالا نشان دهنده ارزش فعلی از ارز حساب " "بانکی" -#: BankReconciliation.php:311 CounterSales.php:781 Customers.php:1004 -#: SelectOrderItems.php:1369 Stocks.php:1031 WorkOrderCosting.php:512 -#: WorkOrderEntry.php:547 +#: BankReconciliation.php:311 CounterSales.php:741 Customers.php:1014 +#: SelectOrderItems.php:1374 Stocks.php:1029 WorkOrderCosting.php:512 +#: WorkOrderEntry.php:549 msgid "Are You Sure?" msgstr "مطمئن هستید؟" @@ -1703,135 +1702,132 @@ msgid "Match off cleared deposits" msgstr "تطابق پاک کردن رسوبات" -#: BOMExtendedQty.php:12 BOMExtendedQty.php:13 BOMExtendedQty.php:159 -#: BOMExtendedQty.php:269 +#: BOMExtendedQty.php:14 BOMExtendedQty.php:15 BOMExtendedQty.php:156 +#: BOMExtendedQty.php:283 msgid "Quantity Extended BOM Listing" msgstr "مقدار تمدید مثال BOM" -#: BOMExtendedQty.php:32 BOMIndentedReverse.php:29 MRPCalendar.php:87 +#: BOMExtendedQty.php:34 BOMIndentedReverse.php:30 MRPCalendar.php:87 #: MRP.php:29 SalesInquiry.php:1191 msgid "The SQL to to create passbom failed with the message" msgstr "گذاشتن به ایجاد passbom شکست خورده با پیام" -#: BOMExtendedQty.php:45 BOMIndented.php:40 BOMIndentedReverse.php:42 +#: BOMExtendedQty.php:47 BOMIndented.php:42 BOMIndentedReverse.php:43 #: MRP.php:36 msgid "Create of tempbom failed because" msgstr "ایجاد tempbom از شکست خورده به دلیل" -#: BOMExtendedQty.php:161 +#: BOMExtendedQty.php:158 msgid "" "The Quantiy Extended BOM Listing could not be retrieved by the SQL because" msgstr "Quantiy تمدید BOM مثال می توان با گذ... [truncated message content] |
From: <dai...@us...> - 2011-04-17 10:18:10
|
Revision: 4552 http://web-erp.svn.sourceforge.net/web-erp/?rev=4552&view=rev Author: daintree Date: 2011-04-17 10:18:02 +0000 (Sun, 17 Apr 2011) Log Message: ----------- various Modified Paths: -------------- trunk/PO_Header.php trunk/Prices_Customer.php trunk/PrintCustTrans.php trunk/RecurringSalesOrders.php trunk/SupplierTypes.php trunk/includes/OutputSerialItems.php Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/PO_Header.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -766,7 +766,7 @@ if($_SESSION['ExistingOrder'] != 0 AND $_SESSION['PO'.$identifier]->Status == 'Printed'){ - echo '<tr><td><a href="' . $rootpath . '/GoodsReceived.php?' . SID . '&PONumber=' . + echo '<tr><td><a href="' . $rootpath . '/GoodsReceived.php?PONumber=' . $_SESSION['PO'.$identifier]->OrderNo . '&identifier=' . $identifier . '">'._('Receive this order').'</a></td></tr>'; } if ($_SESSION['PO'.$identifier]->Status==''){ //then its a new order @@ -959,9 +959,9 @@ <td><input type="text" name="Tel" size="31" maxlength="30" value="' . $_SESSION['PO'.$identifier]->Tel . '"></td> </tr>'; - echo '<tr><td>' . _('Delivery By') . ':</td><td><select name=DeliveryBy>'; + echo '<tr><td>' . _('Delivery By') . ':</td><td><select name="DeliveryBy">'; - $ShipperResult = DB_query('SELECT shipper_id, shippername FROM shippers',$db); + $ShipperResult = DB_query("SELECT shipper_id, shippername FROM shippers",$db); while ($ShipperRow=DB_fetch_array($ShipperResult)){ if (isset($_POST['DeliveryBy']) and ($_POST['DeliveryBy'] == $ShipperRow['shipper_id'])) { @@ -978,7 +978,7 @@ echo '<table class=selection width=100%><tr><td>' . _('Supplier Selection') . ':</td><td> <select name=Keywords onChange="ReloadForm(form1.SearchSuppliers)">'; - $SuppCoResult = DB_query('SELECT supplierid, suppname FROM suppliers ORDER BY suppname',$db); + $SuppCoResult = DB_query("SELECT supplierid, suppname FROM suppliers ORDER BY suppname",$db); while ( $SuppCoRow=DB_fetch_array($SuppCoResult)){ if ($SuppCoRow['suppname'] == $_SESSION['PO'.$identifier]->SupplierName) { @@ -1029,9 +1029,10 @@ </td><td><input type="text" name="SuppTel" size="31" maxlength="30" value="' . $_SESSION['PO'.$identifier]->SuppTel . '"></td> </tr>'; - $result=DB_query('SELECT terms, termsindicator FROM paymentterms', $db); + $result=DB_query("SELECT terms, termsindicator FROM paymentterms", $db); - echo '<tr><td>' . _('Payment Terms') . ':</td><td><select name="PaymentTerms">'; + echo '<tr><td>' . _('Payment Terms') . ':</td> + <td><select name="PaymentTerms">'; while ($myrow = DB_fetch_array($result)) { if ($myrow['termsindicator']==$_SESSION['PO'.$identifier]->PaymentTerms) { @@ -1054,8 +1055,9 @@ </tr>'; if ($_SESSION['PO'.$identifier]->CurrCode != $_SESSION['CompanyRecord']['currencydefault']) { - echo '<tr><td>'. _('Exchange Rate').':'.'</td><td><input type=text name="ExRate" - value='.$_POST['ExRate'].' class=number size=11></td></tr>'; + echo '<tr><td>'. _('Exchange Rate').':'.'</td> + <td><input type=text name="ExRate" value='.$_POST['ExRate'].' class="number" size=11></td> + </tr>'; } else { echo '<input type=hidden name="ExRate" value="1">'; } Modified: trunk/Prices_Customer.php =================================================================== --- trunk/Prices_Customer.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/Prices_Customer.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -1,7 +1,5 @@ <?php -/* $Revision: 1.11 $ */ /* $Id$*/ -//$PageSecurity = 11; include('includes/session.inc'); @@ -275,158 +273,142 @@ } else { $EndDateDisplay = ConvertSQLDate($myrow['enddate']); } - printf("<tr bgcolor='#CCCCCC'> - <td class=number>%0.2f</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href='%s?Item=%s&Price=%s&Branch=%s&StartDate=%s&EndDate=%s&Edit=1'>" . _('Edit') . "</td> - <td><a href='%s?Item=%s&Branch=%s&StartDate=%s&EndDate=%s&delete=yes'>" . _('Delete') . "</td></tr>", - $myrow['price'], - $Branch, - ConvertSQLDate($myrow['startdate']), - $EndDateDisplay, - $_SERVER['PHP_SELF'], - $Item, - $myrow['price'], - $myrow['branchcode'], - $myrow['startdate'], - $myrow['enddate'], - $_SERVER['PHP_SELF'], - $Item, - $myrow['branchcode'], - $myrow['startdate'], - $myrow['enddate']); + echo '<tr bgcolor="#CCCCCC"> + <td class=number>'.number_format($myrow['price'],2).'</td> + <td>'.$Branch.'</td> + <td>'.$myrow['units'].'</td> + <td class=number>'.$myrow['conversionfactor'].'</td> + <td>'.ConvertSQLDate($myrow['startdate']).'</td> + <td>'.$EndDateDisplay.'</td> + <td><a href="'.$_SERVER['PHP_SELF'].'?Item='.$Item.'&Price='.$myrow['price'].'&Branch='.$myrow['branchcode']. + '&StartDate='.$myrow['startdate'].'&EndDate='.$myrow['enddate'].'&Edit=1">' . _('Edit') . '</td> + <td><a href="'.$_SERVER['PHP_SELF'].'?Item='.$Item.'&Branch='.$myrow['branchcode'].'&StartDate='.$myrow['startdate'] .'&EndDate='.$myrow['enddate'].'&delete=yes">' . _('Delete') . '</td></tr>'; + } //END WHILE LIST LOOP } -?> +echo '</table></tr></table><p />'; -</table></tr></table> +echo '<form method="post" action=' . $_SERVER['PHP_SELF'] . '?' . SID . '>'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +echo '<input type=hidden name="Item" VALUE="' . $Item . '">'; -<p> - -<?php - echo '<form method="post" action=' . $_SERVER['PHP_SELF'] . '?' . SID . '>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<input type=hidden name="Item" VALUE="' . $Item . '">'; - - if (isset($_GET['Edit']) and $_GET['Edit']==1){ - echo '<input type=hidden name="Editing" VALUE="Yes">'; - echo '<input type=hidden name="OldStartDate" VALUE="' . $_GET['StartDate'] .'">'; - echo '<input type=hidden name="OldEndDate" VALUE="' . $_GET['EndDate'] . '">'; - $_POST['Price']=$_GET['Price']; - $_POST['Branch']=$_GET['Branch']; - $_POST['StartDate'] = ConvertSQLDate($_GET['StartDate']); - if (Is_Date($_GET['EndDate'])){ - $_POST['EndDate'] = ConvertSQLDate($_GET['EndDate']); - } else { - $_POST['EndDate']=''; - } +if (isset($_GET['Edit']) and $_GET['Edit']==1){ + echo '<input type=hidden name="Editing" VALUE="Yes">'; + echo '<input type=hidden name="OldStartDate" VALUE="' . $_GET['StartDate'] .'">'; + echo '<input type=hidden name="OldEndDate" VALUE="' . $_GET['EndDate'] . '">'; + $_POST['Price']=$_GET['Price']; + $_POST['Branch']=$_GET['Branch']; + $_POST['StartDate'] = ConvertSQLDate($_GET['StartDate']); + if (Is_Date($_GET['EndDate'])){ + $_POST['EndDate'] = ConvertSQLDate($_GET['EndDate']); + } else { + $_POST['EndDate']=''; } - if (!isset($_POST['Branch'])) { - $_POST['Branch']=''; - } - if (!isset($_POST['Price'])) { - $_POST['Price']=0; - } +} +if (!isset($_POST['Branch'])) { + $_POST['Branch']=''; +} +if (!isset($_POST['Price'])) { + $_POST['Price']=0; +} - if (!isset($_POST['StartDate'])){ - $_POST['StartDate'] = Date($_SESSION['DefaultDateFormat']); - } +if (!isset($_POST['StartDate'])){ + $_POST['StartDate'] = Date($_SESSION['DefaultDateFormat']); +} - if (!isset($_POST['EndDate'])){ - $_POST['EndDate'] = DateAdd(Date($_SESSION['DefaultDateFormat']), 'y', 1); - } +if (!isset($_POST['EndDate'])){ + $_POST['EndDate'] = ''; +} - $sql = "SELECT - branchcode, - brname - FROM custbranch - WHERE debtorno='".$_SESSION['CustomerID'] ."'"; - $result = DB_query($sql, $db); - echo '<table class=selection>'; - echo '<tr><td>' . _('Branch') . ':</td>'; - echo '<td><select name="Branch"'; - while ($myrow=DB_fetch_array($result)) { - if ($myrow['branchcode']==$_POST['branch']) { - echo '<option selected value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; - } else { - echo '<option value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; - } +$sql = "SELECT + branchcode, + brname + FROM custbranch + WHERE debtorno='".$_SESSION['CustomerID'] ."'"; +$result = DB_query($sql, $db); +echo '<table class=selection>'; +echo '<tr><td>' . _('Branch') . ':</td>'; +echo '<td><select name="Branch"'; +while ($myrow=DB_fetch_array($result)) { + if ($myrow['branchcode']==$_POST['branch']) { + echo '<option selected value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; + } else { + echo '<option value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; } - echo '></td></tr>'; - echo '<tr><td>' . _('Start Date') . ':</td> - <td><input type="Text" name="StartDate" class=date alt='.$_SESSION['DefaultDateFormat']. - ' size=11 maxlength=10 value=' . $_POST['StartDate'] . '></td></tr>'; - echo '<tr><td>' . _('End Date') . ':</td> - <td><input type="Text" name="EndDate" class=date alt='.$_SESSION['DefaultDateFormat']. - ' size=11 maxlength=10 value=' . $_POST['EndDate'] . '></td></tr>'; +} +echo '></td></tr>'; +echo '<tr><td>' . _('Start Date') . ':</td> + <td><input type="Text" name="StartDate" class=date alt='.$_SESSION['DefaultDateFormat']. + ' size=11 maxlength=10 value=' . $_POST['StartDate'] . '></td></tr>'; +echo '<tr><td>' . _('End Date') . ':</td> + <td><input type="Text" name="EndDate" class=date alt='.$_SESSION['DefaultDateFormat']. + ' size=11 maxlength=10 value=' . $_POST['EndDate'] . '></td></tr>'; - echo '<tr><td>' . _('Price') . ':</td> - <td><input type="Text" class=number name="Price" size=11 maxlength=10 value=' . $_POST['Price'] . '></td> - </tr></table>'; +echo '<tr><td>' . _('Price') . ':</td> + <td><input type="Text" class=number name="Price" size=11 maxlength=10 value=' . $_POST['Price'] . '></td> + </tr></table>'; - echo '<br><div class="centre"><input type="Submit" name="submit" VALUE="' . _('Enter Information') . '"></div>'; +echo '<br><div class="centre"><input type="Submit" name="submit" VALUE="' . _('Enter Information') . '"></div>'; - echo '</form>'; - include('includes/footer.inc'); +echo '</form>'; +include('includes/footer.inc'); - function ReSequenceEffectiveDates ($Item, $PriceList, $CurrAbbrev, $CustomerID, $db) { +function ReSequenceEffectiveDates ($Item, $PriceList, $CurrAbbrev, $CustomerID, $db) { - /*This is quite complicated - the idea is that prices set up should be unique and there is no way two prices could be returned as valid - when getting a price in includes/GetPrice.inc the logic is to first look for a price of the salestype/currency within the effective start and end dates - then if not get the price with a start date prior but a blank end date (the default price). We would not want two prices where the effective dates fall between an existing price so it is necessary to update enddates of prices - with me - I am just hanging on here myself + /*This is quite complicated - the idea is that prices set up should be unique and there is no way two prices could be returned as valid - when getting a price in includes/GetPrice.inc the logic is to first look for a price of the salestype/currency within the effective start and end dates - then if not get the price with a start date prior but a blank end date (the default price). We would not want two prices where the effective dates fall between an existing price so it is necessary to update enddates of prices - with me - I am just hanging on here myself - Prices with no end date are default prices and need to be ignored in this resquence*/ + Prices with no end date are default prices and need to be ignored in this resquence*/ - $SQL = "SELECT branchcode, - startdate, - enddate - FROM prices - WHERE debtorno='" . $CustomerID . "' - AND stockid='" . $Item . "' - AND currabrev='" . $CurrAbbrev . "' - AND typeabbrev='" . $PriceList . "' - AND enddate<>'' - ORDER BY - branchcode, - startdate, - enddate"; + $SQL = "SELECT branchcode, + startdate, + enddate + FROM prices + WHERE debtorno='" . $CustomerID . "' + AND stockid='" . $Item . "' + AND currabrev='" . $CurrAbbrev . "' + AND typeabbrev='" . $PriceList . "' + AND enddate<>'' + ORDER BY + branchcode, + startdate, + enddate"; - $result = DB_query($SQL,$db); + $result = DB_query($SQL,$db); - unset($BranchCode); + unset($BranchCode); - while ($myrow = DB_fetch_array($result)){ - if (!isset($BranchCode)){ - unset($NextDefaultStartDate); //a price with a blank end date - unset($NextStartDate); - unset($EndDate); - unset($StartDate); - $BranchCode = $myrow['branchcode']; - } - if (isset($NextStartDate)){ - if (Date1GreaterThanDate2(ConvertSQLDate($myrow['startdate']),$NextStartDate)){ - $NextStartDate = ConvertSQLDate($myrow['startdate']); - if (Date1GreaterThanDate2(ConvertSQLDate($EndDate),ConvertSQLDate($myrow['startdate']))) { - /*Need to make the end date the new start date less 1 day */ - $SQL = "UPDATE prices SET enddate = '" . FormatDateForSQL(DateAdd($NextStartDate,'d',-1)) . "' - WHERE stockid ='" .$Item . "' - AND currabrev='" . $CurrAbbrev . "' - AND typeabbrev='" . $PriceList . "' - AND startdate ='" . $StartDate . "' - AND enddate = '" . $EndDate . "' - AND debtorno ='" . $CustomerID . "'"; - $UpdateResult = DB_query($SQL,$db); - } - } //end of if startdate after NextStartDate - we have a new NextStartDate - } //end of if set NextStartDate - else { - $NextStartDate = ConvertSQLDate($myrow['startdate']); - } - $StartDate = $myrow['startdate']; - $EndDate = $myrow['enddate']; + while ($myrow = DB_fetch_array($result)){ + if (!isset($BranchCode)){ + unset($NextDefaultStartDate); //a price with a blank end date + unset($NextStartDate); + unset($EndDate); + unset($StartDate); + $BranchCode = $myrow['branchcode']; } + if (isset($NextStartDate)){ + if (Date1GreaterThanDate2(ConvertSQLDate($myrow['startdate']),$NextStartDate)){ + $NextStartDate = ConvertSQLDate($myrow['startdate']); + if (Date1GreaterThanDate2(ConvertSQLDate($EndDate),ConvertSQLDate($myrow['startdate']))) { + /*Need to make the end date the new start date less 1 day */ + $SQL = "UPDATE prices SET enddate = '" . FormatDateForSQL(DateAdd($NextStartDate,'d',-1)) . "' + WHERE stockid ='" .$Item . "' + AND currabrev='" . $CurrAbbrev . "' + AND typeabbrev='" . $PriceList . "' + AND startdate ='" . $StartDate . "' + AND enddate = '" . $EndDate . "' + AND debtorno ='" . $CustomerID . "'"; + $UpdateResult = DB_query($SQL,$db); + } + } //end of if startdate after NextStartDate - we have a new NextStartDate + } //end of if set NextStartDate + else { + $NextStartDate = ConvertSQLDate($myrow['startdate']); + } + $StartDate = $myrow['startdate']; + $EndDate = $myrow['enddate']; + } } ?> \ No newline at end of file Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/PrintCustTrans.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -1,6 +1,6 @@ <?php /* $Id$ */ -//$PageSecurity = 1; + include ('includes/session.inc'); if (isset($_GET['FromTransNo'])) { $FromTransNo = trim($_GET['FromTransNo']); @@ -31,7 +31,6 @@ if (isset($PrintPDF) or isset($_GET['PrintPDF']) and $PrintPDF and isset($FromTransNo) and isset($InvOrCredit) and $FromTransNo != '') { $PaperSize = $FormDesign->PaperSize; include ('includes/PDFStarter.php'); - // Javier: now I use the native constructor, better to not use references if ($InvOrCredit == 'Invoice') { $pdf->addInfo('Title', _('Sales Invoice') . ' ' . $FromTransNo . ' to ' . $_POST['ToTransNo']); $pdf->addInfo('Subject', _('Invoices from') . ' ' . $FromTransNo . ' ' . _('to') . ' ' . $_POST['ToTransNo']); @@ -39,11 +38,7 @@ $pdf->addInfo('Title', _('Sales Credit Note')); $pdf->addInfo('Subject', _('Credit Notes from') . ' ' . $FromTransNo . ' ' . _('to') . ' ' . $_POST['ToTransNo']); } - /* Javier: I have brought this piece from the pdf class constructor to get it closer to the admin/user, - I corrected it to match TCPDF, but it still needs some check, after which, - I think it should be moved to each report to provide flexible Document Header and Margins in a per-report basis. */ - /* END Brought from class.pdf.php constructor */ - // $pdf->selectFont('helvetica'); + $FirstPage = true; $line_height = $FormDesign->LineHeight; while ($FromTransNo <= $_POST['ToTransNo']) { @@ -167,7 +162,7 @@ AND debtortrans.branchcode=custbranch.branchcode AND custbranch.salesman=salesman.salesmancode"; if ($_POST['PrintEDI'] == 'No') { - $sql = $sql . ' AND debtorsmaster.ediinvoices=0'; + $sql = $sql . " AND debtorsmaster.ediinvoices=0"; } } // end else if ($FromTransNo!='Preview') { @@ -177,7 +172,7 @@ include ('includes/header.inc'); prnMsg(_('There was a problem retrieving the invoice or credit note details for note number') . ' ' . $InvoiceToPrint . ' ' . _('from the database') . '. ' . _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available'), 'error'); if ($debug == 1) { - prnMsg(_('The SQL used to get this information that failed was') . "<br />" . $sql, 'error'); + prnMsg(_('The SQL used to get this information that failed was') . '<br />' . $sql, 'error'); } include ('includes/footer.inc'); exit; @@ -230,9 +225,9 @@ if (DB_error_no($db) != 0) { $title = _('Transaction Print Error Report'); include ('includes/header.inc'); - echo '<br>' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database'); + echo '<br />' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database'); if ($debug == 1) { - echo '<br>' . _('The SQL used to get this information that failed was') . "<br>$sql"; + echo '<br />' . _('The SQL used to get this information that failed was') . '<br />' . $sql; } include ('includes/footer.inc'); exit; @@ -389,36 +384,40 @@ include ('includes/header.inc'); if (!isset($FromTransNo) OR $FromTransNo == '') { /* if FromTransNo is not set then show a form to allow input of either a single invoice number or a range of invoices to be printed. Also get the last invoice number created to show the user where the current range is up to */ - echo "<form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "' method='POST'><table class='selection'>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="POST"> + <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . _('Print Invoices or Credit Notes (Landscape Mode)') . '</p>'; echo '<tr><td>' . _('Print Invoices or Credit Notes') . '</td><td><select name=InvOrCredit>'; if ($InvOrCredit == 'Invoice' OR !isset($InvOrCredit)) { - echo "<option selected VALUE='Invoice'>" . _('Invoices'); - echo "<option VALUE='Credit'>" . _('Credit Notes'); + echo '<option selected value="Invoice">' . _('Invoices') . '</option>'; + echo '<option value="Credit">' . _('Credit Notes'). '</option>'; } else { - echo "<option selected VALUE='Credit'>" . _('Credit Notes'); - echo "<option VALUE='Invoice'>" . _('Invoices'); + echo '<option selected value="Credit">' . _('Credit Notes') . '</option>'; + echo '<option value="Invoice">' . _('Invoices') . '</option>'; } echo '</select></td></tr>'; echo '<tr><td>' . _('Print EDI Transactions') . '</td><td><select name=PrintEDI>'; if ($InvOrCredit == 'Invoice' OR !isset($InvOrCredit)) { - echo "<option selected VALUE='No'>" . _('Do not Print PDF EDI Transactions'); - echo "<option VALUE='Yes'>" . _('Print PDF EDI Transactions Too'); + echo '<option selected value="No">' . _('Do not Print PDF EDI Transactions') . '</option>'; + echo '<option value="Yes">' . _('Print PDF EDI Transactions Too') . '</option>'; } else { - echo "<option VALUE='No'>" . _('Do not Print PDF EDI Transactions'); - echo "<option selected VALUE='Yes'>" . _('Print PDF EDI Transactions Too'); + echo '<option value="No">' . _('Do not Print PDF EDI Transactions') . '</option>'; + echo '<option selected value="Yes">' . _('Print PDF EDI Transactions Too') . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('Start invoice/credit note number to print') . '</td><td><input Type=text class=number max=6 size=7 name=FromTransNo></td></tr>'; - echo '<tr><td>' . _('End invoice/credit note number to print') . "</td><td><input Type=text class=number max=6 size=7 name='ToTransNo'></td></tr></table>"; - echo "<br><div class='centre'><input type=Submit Name='Print' Value='" . _('Print') . "'><p>"; - echo "<input type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'></div>"; - $sql = 'SELECT typeno FROM systypes WHERE typeid=10'; + echo '<tr><td>' . _('Start invoice/credit note number to print') . '</td> + <td><input type="text" class="number" max=6 size=7 name=FromTransNo></td></tr>'; + echo '<tr><td>' . _('End invoice/credit note number to print') . '</td> + <td><input Type="text" class="number" max=6 size=7 name="ToTransNo"></td> + </tr></table>'; + echo '<br /><div class="centre"><input type="submit" name="Print" value="' . _('Print') . '"><p />'; + echo '<input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>'; + $sql = "SELECT typeno FROM systypes WHERE typeid=10"; $result = DB_query($sql, $db); $myrow = DB_fetch_row($result); - echo '<div class="page_help_text"><b>' . _('The last invoice created was number') . ' ' . $myrow[0] . '</b><br>' . _('If only a single invoice is required') . ', ' . _('enter the invoice number to print in the Start transaction number to print field and leave the End transaction number to print field blank') . '. ' . _('Only use the end invoice to print field if you wish to print a sequential range of invoices') . ''; - $sql = 'SELECT typeno FROM systypes WHERE typeid=11'; + echo '<div class="page_help_text"><b>' . _('The last invoice created was number') . ' ' . $myrow[0] . '</b><br />' . _('If only a single invoice is required') . ', ' . _('enter the invoice number to print in the Start transaction number to print field and leave the End transaction number to print field blank') . '. ' . _('Only use the end invoice to print field if you wish to print a sequential range of invoices') . ''; + $sql = "SELECT typeno FROM systypes WHERE typeid=11"; $result = DB_query($sql, $db); $myrow = DB_fetch_row($result); echo '<br /><b>' . _('The last credit note created was number') . ' ' . $myrow[0] . '</b><br />' . @@ -518,12 +517,9 @@ } $result = DB_query($sql, $db); if (DB_num_rows($result) == 0 OR DB_error_no($db) != 0) { - echo '<div class="page_help_text">' . _('There was a problem retrieving the invoice or credit note details for note number') . - ' ' . $FromTransNo . ' ' . _('from the database') . '. ' . - _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . - '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available').'</div>'; + echo '<div class="page_help_text">' . _('There was a problem retrieving the invoice or credit note details for note number') . ' ' . $FromTransNo . ' ' . _('from the database') . '. ' . _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available').'</div>'; if ($debug == 1) { - echo _('The SQL used to get this information that failed was') . "<br>$sql"; + echo _('The SQL used to get this information that failed was') . "<br />$sql"; } break; include ('includes/footer.inc'); @@ -543,22 +539,22 @@ } else { echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; } - echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br><font size=1>' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; + echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; /* Now print out the logo and company name and address */ - echo '<table class="table1"><tr><td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br>'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br>'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br>'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br>'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br>'; + echo '<table class="table1"><tr><td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br />'; + echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; + echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; + echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; + echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; echo '</td><td WIDTH=50% class=number>'; /* Now the customer charged to details in a sub table within a cell of the main table*/ echo '<table class="table1"><tr><td align=left bgcolor="#BBBBBB"><b>' . _('Charge To') . ':</b></td></tr><tr><td bgcolor="#EEEEEE">'; - echo $myrow['name'] . '<br>' . $myrow['address1'] . '<br>' . $myrow['address2'] . '<br>' . $myrow['address3'] . '<br>' . $myrow['address4'] . '<br>' . $myrow['address5'] . '<br>' . $myrow['address6']; + echo $myrow['name'] . '<br />' . $myrow['address1'] . '<br />' . $myrow['address2'] . '<br />' . $myrow['address3'] . '<br />' . $myrow['address4'] . '<br />' . $myrow['address5'] . '<br />' . $myrow['address6']; echo '</td></tr></table>'; /*end of the small table showing charge to account details */ echo _('Page') . ': ' . $PageNumber; @@ -571,8 +567,8 @@ <td align=left bgcolor="#BBBBBB"><b>' . _('Delivered To') . ':</b></td> </tr>'; echo '<tr> - <td bgcolor="#EEEEEE">' . $myrow['brname'] . '<br>' . $myrow['braddress1'] . '<br>' . $myrow['braddress2'] . '<br>' . $myrow['braddress3'] . '<br>' . $myrow['braddress4'] . '<br>' . $myrow['braddress5'] . '<br>' . $myrow['braddress6'] . '</td>'; - echo '<td bgcolor="#EEEEEE">' . $myrow['deliverto'] . '<br>' . $myrow['deladd1'] . '<br>' . $myrow['deladd2'] . '<br>' . $myrow['deladd3'] . '<br>' . $myrow['deladd4'] . '<br>' . $myrow['deladd5'] . '<br>' . $myrow['deladd6'] . '</td>'; + <td bgcolor="#EEEEEE">' . $myrow['brname'] . '<br />' . $myrow['braddress1'] . '<br />' . $myrow['braddress2'] . '<br />' . $myrow['braddress3'] . '<br />' . $myrow['braddress4'] . '<br />' . $myrow['braddress5'] . '<br />' . $myrow['braddress6'] . '</td>'; + echo '<td bgcolor="#EEEEEE">' . $myrow['deliverto'] . '<br />' . $myrow['deladd1'] . '<br />' . $myrow['deladd2'] . '<br />' . $myrow['deladd3'] . '<br />' . $myrow['deladd4'] . '<br />' . $myrow['deladd5'] . '<br />' . $myrow['deladd6'] . '</td>'; echo '</tr> </table><hr>'; echo '<table class="table1"> @@ -614,7 +610,7 @@ <td align=left bgcolor="#BBBBBB"><b>' . _('Branch') . ':</b></td> </tr>'; echo '<tr> - <td bgcolor="#EEEEEE">' . $myrow['brname'] . '<br>' . $myrow['braddress1'] . '<br>' . $myrow['braddress2'] . '<br>' . $myrow['braddress3'] . '<br>' . $myrow['braddress4'] . '<br>' . $myrow['braddress5'] . '<br>' . $myrow['braddress6'] . '</td> + <td bgcolor="#EEEEEE">' . $myrow['brname'] . '<br />' . $myrow['braddress1'] . '<br />' . $myrow['braddress2'] . '<br />' . $myrow['braddress3'] . '<br />' . $myrow['braddress4'] . '<br />' . $myrow['braddress5'] . '<br />' . $myrow['braddress6'] . '</td> </tr></table>'; echo '<hr><table class="table1"><tr> <td align=left bgcolor="#BBBBBB"><b>' . _('Date') . '</b></td> @@ -643,7 +639,7 @@ if (DB_error_no($db) != 0) { echo '<div class="page_help_text">' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database').'</div>'; if ($debug == 1) { - echo '<br>' . _('The SQL used to get this information that failed was') . '<br>'.$sql; + echo '<br />' . _('The SQL used to get this information that failed was') . '<br />'.$sql; } exit; } @@ -700,16 +696,16 @@ echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; /*Now print out company name and address */ echo '<table class="table1"><tr> - <td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br>'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br>'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br>'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br>'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br>'; + <td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br />'; + echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; + echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; + echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; + echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; echo '</td><td class=number>' . _('Page') . ': '.$PageNumber.'</td></tr></table>'; echo '<table class="table1"><tr> <th>' . _('Item Code') . '</th> @@ -736,18 +732,18 @@ } else { echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; } - echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr><table>'; + echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr><table>'; /* Print out the logo and company name and address */ - echo '<table class="table1"><tr><td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br>'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br>'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br>'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br>'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br>'; + echo '<table class="table1"><tr><td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br />'; + echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; + echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; + echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; + echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; echo '</td><td class=number>' . _('Page') . ': '.$PageNumber.'</td></tr></table>'; echo '<table class="table1"><tr> <th>' . _('Item Code') . '</th> @@ -760,10 +756,10 @@ $LineCounter = 10; } /* Space out the footer to the bottom of the page */ - echo '<br><br>' . $myrow['invtext']; + echo '<br /><br />' . $myrow['invtext']; $LineCounter = $LineCounter + 2 + $LinesRequiredForText; while ($LineCounter < ($_SESSION['PageLength'] - 6)) { - echo '<br>'; + echo '<br />'; $LineCounter++; } /* Now print out the footer and totals */ Modified: trunk/RecurringSalesOrders.php =================================================================== --- trunk/RecurringSalesOrders.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/RecurringSalesOrders.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -6,7 +6,6 @@ /* Session started in header.inc for password checking the session will contain the details of the order from the Cart class object. The details of the order come from SelectOrderItems.php */ -//$PageSecurity=1; include('includes/session.inc'); $title = _('Recurring Orders'); include('includes/header.inc'); @@ -494,13 +493,13 @@ echo '<br><div class="centre">'; if ($NewRecurringOrder=='Yes'){ - echo '<input type=hidden name="NewRecurringOrder" value="Yes">'; - echo "<input type=submit name='Process' value='" . _('Create Recurring Order') . "'>"; + echo '<input type="hidden" name="NewRecurringOrder" value="Yes">'; + echo '<input type="submit" name="Process" value="' . _('Create Recurring Order') . '">'; } else { echo '<input type=hidden name="NewRecurringOrder" value="No">'; echo '<input type=hidden name="ExistingRecurrOrderNo" value=' . $_POST['ExistingRecurrOrderNo'] . '>'; - echo "<input type=submit name='Process' value='" . _('Update Recurring Order Details') . "'>"; + echo '<input type="submit" name="Process" value="' . _('Update Recurring Order Details') . '">'; echo '<hr>'; echo '<br><br><input type=submit name="DeleteRecurringOrder" value="' . _('Delete Recurring Order') . ' ' . $_POST['ExistingRecurrOrderNo'] . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this recurring order template?') . '\');">'; } Modified: trunk/SupplierTypes.php =================================================================== --- trunk/SupplierTypes.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/SupplierTypes.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -1,8 +1,6 @@ <?php -/* $Revision: 1.6 $ */ -/* $Id$*/ -//$PageSecurity = 4; +/* $Id SupplierTypes.php 4183 2010-12-14 09:30:20Z daintree $ */ include('includes/session.inc'); $title = _('Supplier Types') . ' / ' . _('Maintenance'); Modified: trunk/includes/OutputSerialItems.php =================================================================== --- trunk/includes/OutputSerialItems.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/includes/OutputSerialItems.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -34,21 +34,21 @@ $listtableheader=$tableheader; } else if ($LineItem->Serialised==0 and $Perishable==1){ $tableheader = '<tr> - <th>'. _('Batch/Roll/Bundle'). ' #</th> - <th>'. _('Available'). '</th> - <th>'. _('Quantity'). '</th> - <th>'. _('Expiry Date'). '</th> - </tr>'; + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Available'). '</th> + <th>'. _('Quantity'). '</th> + <th>'. _('Expiry Date'). '</th> + </tr>'; $listtableheader = '<tr> - <th>'. _('Batch/Roll/Bundle'). ' #</th> - <th>'. _('Quantity'). '</th> - <th>'. _('Expiry Date'). '</th> - </tr>'; + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Quantity'). '</th> + <th>'. _('Expiry Date'). '</th> + </tr>'; } else { $tableheader = '<tr> - <th>'. _('Batch/Roll/Bundle'). ' #</th> - <th>'. _('Quantity'). '</th> - </tr>'; + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Quantity'). '</th> + </tr>'; $listtableheader=$tableheader; } @@ -97,7 +97,6 @@ echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; - $LineItem->SerialItems[]=$Bundle; $TotalQuantity += $Bundle->BundleQty; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-17 10:18:10
|
Revision: 4552 http://web-erp.svn.sourceforge.net/web-erp/?rev=4552&view=rev Author: daintree Date: 2011-04-17 10:18:02 +0000 (Sun, 17 Apr 2011) Log Message: ----------- various Modified Paths: -------------- trunk/PO_Header.php trunk/Prices_Customer.php trunk/PrintCustTrans.php trunk/RecurringSalesOrders.php trunk/SupplierTypes.php trunk/includes/OutputSerialItems.php Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/PO_Header.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -766,7 +766,7 @@ if($_SESSION['ExistingOrder'] != 0 AND $_SESSION['PO'.$identifier]->Status == 'Printed'){ - echo '<tr><td><a href="' . $rootpath . '/GoodsReceived.php?' . SID . '&PONumber=' . + echo '<tr><td><a href="' . $rootpath . '/GoodsReceived.php?PONumber=' . $_SESSION['PO'.$identifier]->OrderNo . '&identifier=' . $identifier . '">'._('Receive this order').'</a></td></tr>'; } if ($_SESSION['PO'.$identifier]->Status==''){ //then its a new order @@ -959,9 +959,9 @@ <td><input type="text" name="Tel" size="31" maxlength="30" value="' . $_SESSION['PO'.$identifier]->Tel . '"></td> </tr>'; - echo '<tr><td>' . _('Delivery By') . ':</td><td><select name=DeliveryBy>'; + echo '<tr><td>' . _('Delivery By') . ':</td><td><select name="DeliveryBy">'; - $ShipperResult = DB_query('SELECT shipper_id, shippername FROM shippers',$db); + $ShipperResult = DB_query("SELECT shipper_id, shippername FROM shippers",$db); while ($ShipperRow=DB_fetch_array($ShipperResult)){ if (isset($_POST['DeliveryBy']) and ($_POST['DeliveryBy'] == $ShipperRow['shipper_id'])) { @@ -978,7 +978,7 @@ echo '<table class=selection width=100%><tr><td>' . _('Supplier Selection') . ':</td><td> <select name=Keywords onChange="ReloadForm(form1.SearchSuppliers)">'; - $SuppCoResult = DB_query('SELECT supplierid, suppname FROM suppliers ORDER BY suppname',$db); + $SuppCoResult = DB_query("SELECT supplierid, suppname FROM suppliers ORDER BY suppname",$db); while ( $SuppCoRow=DB_fetch_array($SuppCoResult)){ if ($SuppCoRow['suppname'] == $_SESSION['PO'.$identifier]->SupplierName) { @@ -1029,9 +1029,10 @@ </td><td><input type="text" name="SuppTel" size="31" maxlength="30" value="' . $_SESSION['PO'.$identifier]->SuppTel . '"></td> </tr>'; - $result=DB_query('SELECT terms, termsindicator FROM paymentterms', $db); + $result=DB_query("SELECT terms, termsindicator FROM paymentterms", $db); - echo '<tr><td>' . _('Payment Terms') . ':</td><td><select name="PaymentTerms">'; + echo '<tr><td>' . _('Payment Terms') . ':</td> + <td><select name="PaymentTerms">'; while ($myrow = DB_fetch_array($result)) { if ($myrow['termsindicator']==$_SESSION['PO'.$identifier]->PaymentTerms) { @@ -1054,8 +1055,9 @@ </tr>'; if ($_SESSION['PO'.$identifier]->CurrCode != $_SESSION['CompanyRecord']['currencydefault']) { - echo '<tr><td>'. _('Exchange Rate').':'.'</td><td><input type=text name="ExRate" - value='.$_POST['ExRate'].' class=number size=11></td></tr>'; + echo '<tr><td>'. _('Exchange Rate').':'.'</td> + <td><input type=text name="ExRate" value='.$_POST['ExRate'].' class="number" size=11></td> + </tr>'; } else { echo '<input type=hidden name="ExRate" value="1">'; } Modified: trunk/Prices_Customer.php =================================================================== --- trunk/Prices_Customer.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/Prices_Customer.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -1,7 +1,5 @@ <?php -/* $Revision: 1.11 $ */ /* $Id$*/ -//$PageSecurity = 11; include('includes/session.inc'); @@ -275,158 +273,142 @@ } else { $EndDateDisplay = ConvertSQLDate($myrow['enddate']); } - printf("<tr bgcolor='#CCCCCC'> - <td class=number>%0.2f</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href='%s?Item=%s&Price=%s&Branch=%s&StartDate=%s&EndDate=%s&Edit=1'>" . _('Edit') . "</td> - <td><a href='%s?Item=%s&Branch=%s&StartDate=%s&EndDate=%s&delete=yes'>" . _('Delete') . "</td></tr>", - $myrow['price'], - $Branch, - ConvertSQLDate($myrow['startdate']), - $EndDateDisplay, - $_SERVER['PHP_SELF'], - $Item, - $myrow['price'], - $myrow['branchcode'], - $myrow['startdate'], - $myrow['enddate'], - $_SERVER['PHP_SELF'], - $Item, - $myrow['branchcode'], - $myrow['startdate'], - $myrow['enddate']); + echo '<tr bgcolor="#CCCCCC"> + <td class=number>'.number_format($myrow['price'],2).'</td> + <td>'.$Branch.'</td> + <td>'.$myrow['units'].'</td> + <td class=number>'.$myrow['conversionfactor'].'</td> + <td>'.ConvertSQLDate($myrow['startdate']).'</td> + <td>'.$EndDateDisplay.'</td> + <td><a href="'.$_SERVER['PHP_SELF'].'?Item='.$Item.'&Price='.$myrow['price'].'&Branch='.$myrow['branchcode']. + '&StartDate='.$myrow['startdate'].'&EndDate='.$myrow['enddate'].'&Edit=1">' . _('Edit') . '</td> + <td><a href="'.$_SERVER['PHP_SELF'].'?Item='.$Item.'&Branch='.$myrow['branchcode'].'&StartDate='.$myrow['startdate'] .'&EndDate='.$myrow['enddate'].'&delete=yes">' . _('Delete') . '</td></tr>'; + } //END WHILE LIST LOOP } -?> +echo '</table></tr></table><p />'; -</table></tr></table> +echo '<form method="post" action=' . $_SERVER['PHP_SELF'] . '?' . SID . '>'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +echo '<input type=hidden name="Item" VALUE="' . $Item . '">'; -<p> - -<?php - echo '<form method="post" action=' . $_SERVER['PHP_SELF'] . '?' . SID . '>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<input type=hidden name="Item" VALUE="' . $Item . '">'; - - if (isset($_GET['Edit']) and $_GET['Edit']==1){ - echo '<input type=hidden name="Editing" VALUE="Yes">'; - echo '<input type=hidden name="OldStartDate" VALUE="' . $_GET['StartDate'] .'">'; - echo '<input type=hidden name="OldEndDate" VALUE="' . $_GET['EndDate'] . '">'; - $_POST['Price']=$_GET['Price']; - $_POST['Branch']=$_GET['Branch']; - $_POST['StartDate'] = ConvertSQLDate($_GET['StartDate']); - if (Is_Date($_GET['EndDate'])){ - $_POST['EndDate'] = ConvertSQLDate($_GET['EndDate']); - } else { - $_POST['EndDate']=''; - } +if (isset($_GET['Edit']) and $_GET['Edit']==1){ + echo '<input type=hidden name="Editing" VALUE="Yes">'; + echo '<input type=hidden name="OldStartDate" VALUE="' . $_GET['StartDate'] .'">'; + echo '<input type=hidden name="OldEndDate" VALUE="' . $_GET['EndDate'] . '">'; + $_POST['Price']=$_GET['Price']; + $_POST['Branch']=$_GET['Branch']; + $_POST['StartDate'] = ConvertSQLDate($_GET['StartDate']); + if (Is_Date($_GET['EndDate'])){ + $_POST['EndDate'] = ConvertSQLDate($_GET['EndDate']); + } else { + $_POST['EndDate']=''; } - if (!isset($_POST['Branch'])) { - $_POST['Branch']=''; - } - if (!isset($_POST['Price'])) { - $_POST['Price']=0; - } +} +if (!isset($_POST['Branch'])) { + $_POST['Branch']=''; +} +if (!isset($_POST['Price'])) { + $_POST['Price']=0; +} - if (!isset($_POST['StartDate'])){ - $_POST['StartDate'] = Date($_SESSION['DefaultDateFormat']); - } +if (!isset($_POST['StartDate'])){ + $_POST['StartDate'] = Date($_SESSION['DefaultDateFormat']); +} - if (!isset($_POST['EndDate'])){ - $_POST['EndDate'] = DateAdd(Date($_SESSION['DefaultDateFormat']), 'y', 1); - } +if (!isset($_POST['EndDate'])){ + $_POST['EndDate'] = ''; +} - $sql = "SELECT - branchcode, - brname - FROM custbranch - WHERE debtorno='".$_SESSION['CustomerID'] ."'"; - $result = DB_query($sql, $db); - echo '<table class=selection>'; - echo '<tr><td>' . _('Branch') . ':</td>'; - echo '<td><select name="Branch"'; - while ($myrow=DB_fetch_array($result)) { - if ($myrow['branchcode']==$_POST['branch']) { - echo '<option selected value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; - } else { - echo '<option value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; - } +$sql = "SELECT + branchcode, + brname + FROM custbranch + WHERE debtorno='".$_SESSION['CustomerID'] ."'"; +$result = DB_query($sql, $db); +echo '<table class=selection>'; +echo '<tr><td>' . _('Branch') . ':</td>'; +echo '<td><select name="Branch"'; +while ($myrow=DB_fetch_array($result)) { + if ($myrow['branchcode']==$_POST['branch']) { + echo '<option selected value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; + } else { + echo '<option value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; } - echo '></td></tr>'; - echo '<tr><td>' . _('Start Date') . ':</td> - <td><input type="Text" name="StartDate" class=date alt='.$_SESSION['DefaultDateFormat']. - ' size=11 maxlength=10 value=' . $_POST['StartDate'] . '></td></tr>'; - echo '<tr><td>' . _('End Date') . ':</td> - <td><input type="Text" name="EndDate" class=date alt='.$_SESSION['DefaultDateFormat']. - ' size=11 maxlength=10 value=' . $_POST['EndDate'] . '></td></tr>'; +} +echo '></td></tr>'; +echo '<tr><td>' . _('Start Date') . ':</td> + <td><input type="Text" name="StartDate" class=date alt='.$_SESSION['DefaultDateFormat']. + ' size=11 maxlength=10 value=' . $_POST['StartDate'] . '></td></tr>'; +echo '<tr><td>' . _('End Date') . ':</td> + <td><input type="Text" name="EndDate" class=date alt='.$_SESSION['DefaultDateFormat']. + ' size=11 maxlength=10 value=' . $_POST['EndDate'] . '></td></tr>'; - echo '<tr><td>' . _('Price') . ':</td> - <td><input type="Text" class=number name="Price" size=11 maxlength=10 value=' . $_POST['Price'] . '></td> - </tr></table>'; +echo '<tr><td>' . _('Price') . ':</td> + <td><input type="Text" class=number name="Price" size=11 maxlength=10 value=' . $_POST['Price'] . '></td> + </tr></table>'; - echo '<br><div class="centre"><input type="Submit" name="submit" VALUE="' . _('Enter Information') . '"></div>'; +echo '<br><div class="centre"><input type="Submit" name="submit" VALUE="' . _('Enter Information') . '"></div>'; - echo '</form>'; - include('includes/footer.inc'); +echo '</form>'; +include('includes/footer.inc'); - function ReSequenceEffectiveDates ($Item, $PriceList, $CurrAbbrev, $CustomerID, $db) { +function ReSequenceEffectiveDates ($Item, $PriceList, $CurrAbbrev, $CustomerID, $db) { - /*This is quite complicated - the idea is that prices set up should be unique and there is no way two prices could be returned as valid - when getting a price in includes/GetPrice.inc the logic is to first look for a price of the salestype/currency within the effective start and end dates - then if not get the price with a start date prior but a blank end date (the default price). We would not want two prices where the effective dates fall between an existing price so it is necessary to update enddates of prices - with me - I am just hanging on here myself + /*This is quite complicated - the idea is that prices set up should be unique and there is no way two prices could be returned as valid - when getting a price in includes/GetPrice.inc the logic is to first look for a price of the salestype/currency within the effective start and end dates - then if not get the price with a start date prior but a blank end date (the default price). We would not want two prices where the effective dates fall between an existing price so it is necessary to update enddates of prices - with me - I am just hanging on here myself - Prices with no end date are default prices and need to be ignored in this resquence*/ + Prices with no end date are default prices and need to be ignored in this resquence*/ - $SQL = "SELECT branchcode, - startdate, - enddate - FROM prices - WHERE debtorno='" . $CustomerID . "' - AND stockid='" . $Item . "' - AND currabrev='" . $CurrAbbrev . "' - AND typeabbrev='" . $PriceList . "' - AND enddate<>'' - ORDER BY - branchcode, - startdate, - enddate"; + $SQL = "SELECT branchcode, + startdate, + enddate + FROM prices + WHERE debtorno='" . $CustomerID . "' + AND stockid='" . $Item . "' + AND currabrev='" . $CurrAbbrev . "' + AND typeabbrev='" . $PriceList . "' + AND enddate<>'' + ORDER BY + branchcode, + startdate, + enddate"; - $result = DB_query($SQL,$db); + $result = DB_query($SQL,$db); - unset($BranchCode); + unset($BranchCode); - while ($myrow = DB_fetch_array($result)){ - if (!isset($BranchCode)){ - unset($NextDefaultStartDate); //a price with a blank end date - unset($NextStartDate); - unset($EndDate); - unset($StartDate); - $BranchCode = $myrow['branchcode']; - } - if (isset($NextStartDate)){ - if (Date1GreaterThanDate2(ConvertSQLDate($myrow['startdate']),$NextStartDate)){ - $NextStartDate = ConvertSQLDate($myrow['startdate']); - if (Date1GreaterThanDate2(ConvertSQLDate($EndDate),ConvertSQLDate($myrow['startdate']))) { - /*Need to make the end date the new start date less 1 day */ - $SQL = "UPDATE prices SET enddate = '" . FormatDateForSQL(DateAdd($NextStartDate,'d',-1)) . "' - WHERE stockid ='" .$Item . "' - AND currabrev='" . $CurrAbbrev . "' - AND typeabbrev='" . $PriceList . "' - AND startdate ='" . $StartDate . "' - AND enddate = '" . $EndDate . "' - AND debtorno ='" . $CustomerID . "'"; - $UpdateResult = DB_query($SQL,$db); - } - } //end of if startdate after NextStartDate - we have a new NextStartDate - } //end of if set NextStartDate - else { - $NextStartDate = ConvertSQLDate($myrow['startdate']); - } - $StartDate = $myrow['startdate']; - $EndDate = $myrow['enddate']; + while ($myrow = DB_fetch_array($result)){ + if (!isset($BranchCode)){ + unset($NextDefaultStartDate); //a price with a blank end date + unset($NextStartDate); + unset($EndDate); + unset($StartDate); + $BranchCode = $myrow['branchcode']; } + if (isset($NextStartDate)){ + if (Date1GreaterThanDate2(ConvertSQLDate($myrow['startdate']),$NextStartDate)){ + $NextStartDate = ConvertSQLDate($myrow['startdate']); + if (Date1GreaterThanDate2(ConvertSQLDate($EndDate),ConvertSQLDate($myrow['startdate']))) { + /*Need to make the end date the new start date less 1 day */ + $SQL = "UPDATE prices SET enddate = '" . FormatDateForSQL(DateAdd($NextStartDate,'d',-1)) . "' + WHERE stockid ='" .$Item . "' + AND currabrev='" . $CurrAbbrev . "' + AND typeabbrev='" . $PriceList . "' + AND startdate ='" . $StartDate . "' + AND enddate = '" . $EndDate . "' + AND debtorno ='" . $CustomerID . "'"; + $UpdateResult = DB_query($SQL,$db); + } + } //end of if startdate after NextStartDate - we have a new NextStartDate + } //end of if set NextStartDate + else { + $NextStartDate = ConvertSQLDate($myrow['startdate']); + } + $StartDate = $myrow['startdate']; + $EndDate = $myrow['enddate']; + } } ?> \ No newline at end of file Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/PrintCustTrans.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -1,6 +1,6 @@ <?php /* $Id$ */ -//$PageSecurity = 1; + include ('includes/session.inc'); if (isset($_GET['FromTransNo'])) { $FromTransNo = trim($_GET['FromTransNo']); @@ -31,7 +31,6 @@ if (isset($PrintPDF) or isset($_GET['PrintPDF']) and $PrintPDF and isset($FromTransNo) and isset($InvOrCredit) and $FromTransNo != '') { $PaperSize = $FormDesign->PaperSize; include ('includes/PDFStarter.php'); - // Javier: now I use the native constructor, better to not use references if ($InvOrCredit == 'Invoice') { $pdf->addInfo('Title', _('Sales Invoice') . ' ' . $FromTransNo . ' to ' . $_POST['ToTransNo']); $pdf->addInfo('Subject', _('Invoices from') . ' ' . $FromTransNo . ' ' . _('to') . ' ' . $_POST['ToTransNo']); @@ -39,11 +38,7 @@ $pdf->addInfo('Title', _('Sales Credit Note')); $pdf->addInfo('Subject', _('Credit Notes from') . ' ' . $FromTransNo . ' ' . _('to') . ' ' . $_POST['ToTransNo']); } - /* Javier: I have brought this piece from the pdf class constructor to get it closer to the admin/user, - I corrected it to match TCPDF, but it still needs some check, after which, - I think it should be moved to each report to provide flexible Document Header and Margins in a per-report basis. */ - /* END Brought from class.pdf.php constructor */ - // $pdf->selectFont('helvetica'); + $FirstPage = true; $line_height = $FormDesign->LineHeight; while ($FromTransNo <= $_POST['ToTransNo']) { @@ -167,7 +162,7 @@ AND debtortrans.branchcode=custbranch.branchcode AND custbranch.salesman=salesman.salesmancode"; if ($_POST['PrintEDI'] == 'No') { - $sql = $sql . ' AND debtorsmaster.ediinvoices=0'; + $sql = $sql . " AND debtorsmaster.ediinvoices=0"; } } // end else if ($FromTransNo!='Preview') { @@ -177,7 +172,7 @@ include ('includes/header.inc'); prnMsg(_('There was a problem retrieving the invoice or credit note details for note number') . ' ' . $InvoiceToPrint . ' ' . _('from the database') . '. ' . _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available'), 'error'); if ($debug == 1) { - prnMsg(_('The SQL used to get this information that failed was') . "<br />" . $sql, 'error'); + prnMsg(_('The SQL used to get this information that failed was') . '<br />' . $sql, 'error'); } include ('includes/footer.inc'); exit; @@ -230,9 +225,9 @@ if (DB_error_no($db) != 0) { $title = _('Transaction Print Error Report'); include ('includes/header.inc'); - echo '<br>' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database'); + echo '<br />' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database'); if ($debug == 1) { - echo '<br>' . _('The SQL used to get this information that failed was') . "<br>$sql"; + echo '<br />' . _('The SQL used to get this information that failed was') . '<br />' . $sql; } include ('includes/footer.inc'); exit; @@ -389,36 +384,40 @@ include ('includes/header.inc'); if (!isset($FromTransNo) OR $FromTransNo == '') { /* if FromTransNo is not set then show a form to allow input of either a single invoice number or a range of invoices to be printed. Also get the last invoice number created to show the user where the current range is up to */ - echo "<form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "' method='POST'><table class='selection'>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="POST"> + <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . _('Print Invoices or Credit Notes (Landscape Mode)') . '</p>'; echo '<tr><td>' . _('Print Invoices or Credit Notes') . '</td><td><select name=InvOrCredit>'; if ($InvOrCredit == 'Invoice' OR !isset($InvOrCredit)) { - echo "<option selected VALUE='Invoice'>" . _('Invoices'); - echo "<option VALUE='Credit'>" . _('Credit Notes'); + echo '<option selected value="Invoice">' . _('Invoices') . '</option>'; + echo '<option value="Credit">' . _('Credit Notes'). '</option>'; } else { - echo "<option selected VALUE='Credit'>" . _('Credit Notes'); - echo "<option VALUE='Invoice'>" . _('Invoices'); + echo '<option selected value="Credit">' . _('Credit Notes') . '</option>'; + echo '<option value="Invoice">' . _('Invoices') . '</option>'; } echo '</select></td></tr>'; echo '<tr><td>' . _('Print EDI Transactions') . '</td><td><select name=PrintEDI>'; if ($InvOrCredit == 'Invoice' OR !isset($InvOrCredit)) { - echo "<option selected VALUE='No'>" . _('Do not Print PDF EDI Transactions'); - echo "<option VALUE='Yes'>" . _('Print PDF EDI Transactions Too'); + echo '<option selected value="No">' . _('Do not Print PDF EDI Transactions') . '</option>'; + echo '<option value="Yes">' . _('Print PDF EDI Transactions Too') . '</option>'; } else { - echo "<option VALUE='No'>" . _('Do not Print PDF EDI Transactions'); - echo "<option selected VALUE='Yes'>" . _('Print PDF EDI Transactions Too'); + echo '<option value="No">' . _('Do not Print PDF EDI Transactions') . '</option>'; + echo '<option selected value="Yes">' . _('Print PDF EDI Transactions Too') . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('Start invoice/credit note number to print') . '</td><td><input Type=text class=number max=6 size=7 name=FromTransNo></td></tr>'; - echo '<tr><td>' . _('End invoice/credit note number to print') . "</td><td><input Type=text class=number max=6 size=7 name='ToTransNo'></td></tr></table>"; - echo "<br><div class='centre'><input type=Submit Name='Print' Value='" . _('Print') . "'><p>"; - echo "<input type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'></div>"; - $sql = 'SELECT typeno FROM systypes WHERE typeid=10'; + echo '<tr><td>' . _('Start invoice/credit note number to print') . '</td> + <td><input type="text" class="number" max=6 size=7 name=FromTransNo></td></tr>'; + echo '<tr><td>' . _('End invoice/credit note number to print') . '</td> + <td><input Type="text" class="number" max=6 size=7 name="ToTransNo"></td> + </tr></table>'; + echo '<br /><div class="centre"><input type="submit" name="Print" value="' . _('Print') . '"><p />'; + echo '<input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>'; + $sql = "SELECT typeno FROM systypes WHERE typeid=10"; $result = DB_query($sql, $db); $myrow = DB_fetch_row($result); - echo '<div class="page_help_text"><b>' . _('The last invoice created was number') . ' ' . $myrow[0] . '</b><br>' . _('If only a single invoice is required') . ', ' . _('enter the invoice number to print in the Start transaction number to print field and leave the End transaction number to print field blank') . '. ' . _('Only use the end invoice to print field if you wish to print a sequential range of invoices') . ''; - $sql = 'SELECT typeno FROM systypes WHERE typeid=11'; + echo '<div class="page_help_text"><b>' . _('The last invoice created was number') . ' ' . $myrow[0] . '</b><br />' . _('If only a single invoice is required') . ', ' . _('enter the invoice number to print in the Start transaction number to print field and leave the End transaction number to print field blank') . '. ' . _('Only use the end invoice to print field if you wish to print a sequential range of invoices') . ''; + $sql = "SELECT typeno FROM systypes WHERE typeid=11"; $result = DB_query($sql, $db); $myrow = DB_fetch_row($result); echo '<br /><b>' . _('The last credit note created was number') . ' ' . $myrow[0] . '</b><br />' . @@ -518,12 +517,9 @@ } $result = DB_query($sql, $db); if (DB_num_rows($result) == 0 OR DB_error_no($db) != 0) { - echo '<div class="page_help_text">' . _('There was a problem retrieving the invoice or credit note details for note number') . - ' ' . $FromTransNo . ' ' . _('from the database') . '. ' . - _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . - '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available').'</div>'; + echo '<div class="page_help_text">' . _('There was a problem retrieving the invoice or credit note details for note number') . ' ' . $FromTransNo . ' ' . _('from the database') . '. ' . _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available').'</div>'; if ($debug == 1) { - echo _('The SQL used to get this information that failed was') . "<br>$sql"; + echo _('The SQL used to get this information that failed was') . "<br />$sql"; } break; include ('includes/footer.inc'); @@ -543,22 +539,22 @@ } else { echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; } - echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br><font size=1>' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; + echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; /* Now print out the logo and company name and address */ - echo '<table class="table1"><tr><td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br>'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br>'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br>'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br>'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br>'; + echo '<table class="table1"><tr><td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br />'; + echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; + echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; + echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; + echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; echo '</td><td WIDTH=50% class=number>'; /* Now the customer charged to details in a sub table within a cell of the main table*/ echo '<table class="table1"><tr><td align=left bgcolor="#BBBBBB"><b>' . _('Charge To') . ':</b></td></tr><tr><td bgcolor="#EEEEEE">'; - echo $myrow['name'] . '<br>' . $myrow['address1'] . '<br>' . $myrow['address2'] . '<br>' . $myrow['address3'] . '<br>' . $myrow['address4'] . '<br>' . $myrow['address5'] . '<br>' . $myrow['address6']; + echo $myrow['name'] . '<br />' . $myrow['address1'] . '<br />' . $myrow['address2'] . '<br />' . $myrow['address3'] . '<br />' . $myrow['address4'] . '<br />' . $myrow['address5'] . '<br />' . $myrow['address6']; echo '</td></tr></table>'; /*end of the small table showing charge to account details */ echo _('Page') . ': ' . $PageNumber; @@ -571,8 +567,8 @@ <td align=left bgcolor="#BBBBBB"><b>' . _('Delivered To') . ':</b></td> </tr>'; echo '<tr> - <td bgcolor="#EEEEEE">' . $myrow['brname'] . '<br>' . $myrow['braddress1'] . '<br>' . $myrow['braddress2'] . '<br>' . $myrow['braddress3'] . '<br>' . $myrow['braddress4'] . '<br>' . $myrow['braddress5'] . '<br>' . $myrow['braddress6'] . '</td>'; - echo '<td bgcolor="#EEEEEE">' . $myrow['deliverto'] . '<br>' . $myrow['deladd1'] . '<br>' . $myrow['deladd2'] . '<br>' . $myrow['deladd3'] . '<br>' . $myrow['deladd4'] . '<br>' . $myrow['deladd5'] . '<br>' . $myrow['deladd6'] . '</td>'; + <td bgcolor="#EEEEEE">' . $myrow['brname'] . '<br />' . $myrow['braddress1'] . '<br />' . $myrow['braddress2'] . '<br />' . $myrow['braddress3'] . '<br />' . $myrow['braddress4'] . '<br />' . $myrow['braddress5'] . '<br />' . $myrow['braddress6'] . '</td>'; + echo '<td bgcolor="#EEEEEE">' . $myrow['deliverto'] . '<br />' . $myrow['deladd1'] . '<br />' . $myrow['deladd2'] . '<br />' . $myrow['deladd3'] . '<br />' . $myrow['deladd4'] . '<br />' . $myrow['deladd5'] . '<br />' . $myrow['deladd6'] . '</td>'; echo '</tr> </table><hr>'; echo '<table class="table1"> @@ -614,7 +610,7 @@ <td align=left bgcolor="#BBBBBB"><b>' . _('Branch') . ':</b></td> </tr>'; echo '<tr> - <td bgcolor="#EEEEEE">' . $myrow['brname'] . '<br>' . $myrow['braddress1'] . '<br>' . $myrow['braddress2'] . '<br>' . $myrow['braddress3'] . '<br>' . $myrow['braddress4'] . '<br>' . $myrow['braddress5'] . '<br>' . $myrow['braddress6'] . '</td> + <td bgcolor="#EEEEEE">' . $myrow['brname'] . '<br />' . $myrow['braddress1'] . '<br />' . $myrow['braddress2'] . '<br />' . $myrow['braddress3'] . '<br />' . $myrow['braddress4'] . '<br />' . $myrow['braddress5'] . '<br />' . $myrow['braddress6'] . '</td> </tr></table>'; echo '<hr><table class="table1"><tr> <td align=left bgcolor="#BBBBBB"><b>' . _('Date') . '</b></td> @@ -643,7 +639,7 @@ if (DB_error_no($db) != 0) { echo '<div class="page_help_text">' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database').'</div>'; if ($debug == 1) { - echo '<br>' . _('The SQL used to get this information that failed was') . '<br>'.$sql; + echo '<br />' . _('The SQL used to get this information that failed was') . '<br />'.$sql; } exit; } @@ -700,16 +696,16 @@ echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; /*Now print out company name and address */ echo '<table class="table1"><tr> - <td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br>'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br>'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br>'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br>'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br>'; + <td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br />'; + echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; + echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; + echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; + echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; echo '</td><td class=number>' . _('Page') . ': '.$PageNumber.'</td></tr></table>'; echo '<table class="table1"><tr> <th>' . _('Item Code') . '</th> @@ -736,18 +732,18 @@ } else { echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; } - echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr><table>'; + echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr><table>'; /* Print out the logo and company name and address */ - echo '<table class="table1"><tr><td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br>'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br>'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br>'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br>'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br>'; + echo '<table class="table1"><tr><td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br />'; + echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; + echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; + echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; + echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; echo '</td><td class=number>' . _('Page') . ': '.$PageNumber.'</td></tr></table>'; echo '<table class="table1"><tr> <th>' . _('Item Code') . '</th> @@ -760,10 +756,10 @@ $LineCounter = 10; } /* Space out the footer to the bottom of the page */ - echo '<br><br>' . $myrow['invtext']; + echo '<br /><br />' . $myrow['invtext']; $LineCounter = $LineCounter + 2 + $LinesRequiredForText; while ($LineCounter < ($_SESSION['PageLength'] - 6)) { - echo '<br>'; + echo '<br />'; $LineCounter++; } /* Now print out the footer and totals */ Modified: trunk/RecurringSalesOrders.php =================================================================== --- trunk/RecurringSalesOrders.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/RecurringSalesOrders.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -6,7 +6,6 @@ /* Session started in header.inc for password checking the session will contain the details of the order from the Cart class object. The details of the order come from SelectOrderItems.php */ -//$PageSecurity=1; include('includes/session.inc'); $title = _('Recurring Orders'); include('includes/header.inc'); @@ -494,13 +493,13 @@ echo '<br><div class="centre">'; if ($NewRecurringOrder=='Yes'){ - echo '<input type=hidden name="NewRecurringOrder" value="Yes">'; - echo "<input type=submit name='Process' value='" . _('Create Recurring Order') . "'>"; + echo '<input type="hidden" name="NewRecurringOrder" value="Yes">'; + echo '<input type="submit" name="Process" value="' . _('Create Recurring Order') . '">'; } else { echo '<input type=hidden name="NewRecurringOrder" value="No">'; echo '<input type=hidden name="ExistingRecurrOrderNo" value=' . $_POST['ExistingRecurrOrderNo'] . '>'; - echo "<input type=submit name='Process' value='" . _('Update Recurring Order Details') . "'>"; + echo '<input type="submit" name="Process" value="' . _('Update Recurring Order Details') . '">'; echo '<hr>'; echo '<br><br><input type=submit name="DeleteRecurringOrder" value="' . _('Delete Recurring Order') . ' ' . $_POST['ExistingRecurrOrderNo'] . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this recurring order template?') . '\');">'; } Modified: trunk/SupplierTypes.php =================================================================== --- trunk/SupplierTypes.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/SupplierTypes.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -1,8 +1,6 @@ <?php -/* $Revision: 1.6 $ */ -/* $Id$*/ -//$PageSecurity = 4; +/* $Id SupplierTypes.php 4183 2010-12-14 09:30:20Z daintree $ */ include('includes/session.inc'); $title = _('Supplier Types') . ' / ' . _('Maintenance'); Modified: trunk/includes/OutputSerialItems.php =================================================================== --- trunk/includes/OutputSerialItems.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/includes/OutputSerialItems.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -34,21 +34,21 @@ $listtableheader=$tableheader; } else if ($LineItem->Serialised==0 and $Perishable==1){ $tableheader = '<tr> - <th>'. _('Batch/Roll/Bundle'). ' #</th> - <th>'. _('Available'). '</th> - <th>'. _('Quantity'). '</th> - <th>'. _('Expiry Date'). '</th> - </tr>'; + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Available'). '</th> + <th>'. _('Quantity'). '</th> + <th>'. _('Expiry Date'). '</th> + </tr>'; $listtableheader = '<tr> - <th>'. _('Batch/Roll/Bundle'). ' #</th> - <th>'. _('Quantity'). '</th> - <th>'. _('Expiry Date'). '</th> - </tr>'; + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Quantity'). '</th> + <th>'. _('Expiry Date'). '</th> + </tr>'; } else { $tableheader = '<tr> - <th>'. _('Batch/Roll/Bundle'). ' #</th> - <th>'. _('Quantity'). '</th> - </tr>'; + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Quantity'). '</th> + </tr>'; $listtableheader=$tableheader; } @@ -97,7 +97,6 @@ echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; - $LineItem->SerialItems[]=$Bundle; $TotalQuantity += $Bundle->BundleQty; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-16 06:21:05
|
Revision: 4551 http://web-erp.svn.sourceforge.net/web-erp/?rev=4551&view=rev Author: daintree Date: 2011-04-16 06:20:56 +0000 (Sat, 16 Apr 2011) Log Message: ----------- various Modified Paths: -------------- trunk/InventoryQuantities.php trunk/Locations.php trunk/MRPReschedules.php trunk/OutstandingGRNs.php trunk/PDFChequeListing.php trunk/PDFCustTransListing.php trunk/PDFLowGP.php trunk/PDFOrderStatus.php trunk/PDFPrintLabel.php trunk/PDFStockCheckComparison.php trunk/POReport.php trunk/PO_Header.php trunk/PaymentMethods.php trunk/PcAssignCashToTab.php trunk/PcAuthorizeExpenses.php trunk/PcClaimExpensesFromTab.php trunk/PcReportTab.php trunk/PcTypeTabs.php trunk/Prices.php trunk/PricesBasedOnMarkUp.php trunk/Prices_Customer.php trunk/PrintCustOrder.php trunk/PrintCustTrans.php trunk/RecurringSalesOrders.php trunk/ReorderLevel.php trunk/ReorderLevelLocation.php trunk/SalesAnalReptCols.php trunk/SalesAnalRepts.php trunk/SalesInquiry.php trunk/SalesPeople.php trunk/SalesTypes.php trunk/SelectCompletedOrder.php trunk/SelectCustomer.php trunk/SelectOrderItems.php trunk/SelectProduct.php trunk/SelectSupplier.php trunk/ShipmentCosting.php trunk/Shipments.php trunk/Shipt_Select.php trunk/StockCategories.php trunk/StockCheck.php trunk/StockCostUpdate.php trunk/StockQties_csv.php trunk/StockSerialItems.php trunk/StockTransferControlled.php trunk/StockUsage.php trunk/Stocks.php trunk/SuppInvGRNs.php trunk/SupplierAllocations.php trunk/SupplierBalsAtPeriodEnd.php trunk/SupplierCredit.php trunk/SupplierInvoice.php trunk/SupplierTypes.php trunk/Suppliers.php trunk/WOSerialNos.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/doc/Change.log.html trunk/report_runner.php Modified: trunk/InventoryQuantities.php =================================================================== --- trunk/InventoryQuantities.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/InventoryQuantities.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -1,12 +1,11 @@ <?php -/* $Revision: 1.4 $ */ /* $Id$ */ // InventoryQuantities.php - Report of parts with quantity. Sorts by part and shows // all locations where there are quantities of the part -//$PageSecurity = 2; + include('includes/session.inc'); If (isset($_POST['PrintPDF'])) { @@ -83,9 +82,9 @@ $title = _('Inventory Quantities') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The Inventory Quantity report could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); - echo "<br><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$sql"; + echo '<br>' . $sql; } include('includes/footer.inc'); exit; @@ -94,7 +93,7 @@ $title = _('Print Inventory Quantities Report'); include('includes/header.inc'); prnMsg(_('There were no items with inventory quantities'),'error'); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br><a href="'.$rootpath.'/index.php?">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; } @@ -148,12 +147,12 @@ echo '<div class="page_help_text">' . _('Use this report to display the quantity of Inventory items in different categories.') . '</div><br>'; - echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table>"; + echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection><tr><td>'; - echo '<tr><td>' . _('Selection') . ":</td><td><select name='Selection'>"; - echo "<option selected value='All'>" . _('All'); - echo "<option value='Multiple'>" . _('Only Parts With Multiple Locations'); + echo '<tr><td>' . _('Selection') . ':</td><td><select name="Selection">'; + echo '<option selected value="All">' . _('All') . '</option>'; + echo '<option value="Multiple">' . _('Only Parts With Multiple Locations') . '</option>'; echo '</select></td></tr>'; $SQL="SELECT categoryid, categorydescription FROM stockcategory where stocktype<>'A' ORDER BY categorydescription"; @@ -185,7 +184,7 @@ } } echo '</select></td></tr>'; - echo "</table><p><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; + echo '</table><p><div class="centre"><input type=submit name="PrintPDF" value="' . _('Print PDF') . '"></div>'; include('includes/footer.inc'); Modified: trunk/Locations.php =================================================================== --- trunk/Locations.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/Locations.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -1,10 +1,7 @@ <?php /* $Id$*/ -/* $Revision: 1.25 $ */ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Location Maintenance'); @@ -374,18 +371,19 @@ $myrow['managed'] = _('No'); } */ - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td>%s</td> - <td><a href='%sSelectedLocation=%s'>" . _('Edit') . "</td> - <td><a href='%sSelectedLocation=%s&delete=1'>" . _('Delete') . '</td> + <td>%s</td> + <td><a href="%sSelectedLocation=%s">' . _('Edit') . '</td> + <td><a href="%sSelectedLocation=%s&delete=1">' . _('Delete') . '</td> </tr>', $myrow['loccode'], $myrow['locationname'], $myrow['description'], - $_SERVER['PHP_SELF'] . '?' . SID . '&', + $_SERVER['PHP_SELF'] . '?', $myrow['loccode'], - $_SERVER['PHP_SELF'] . '?' . SID . '&', + $_SERVER['PHP_SELF'] . '?', $myrow['loccode']); } @@ -399,11 +397,11 @@ if (isset($SelectedLocation)) { echo '<a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Records') . '</a>'; } -echo "<p>"; +echo '<br />'; if (!isset($_GET['delete'])) { - echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedLocation)) { @@ -451,8 +449,8 @@ $_POST['Managed'] = $myrow['managed']; - echo "<input type=hidden name=SelectedLocation VALUE=" . $SelectedLocation . '>'; - echo "<input type=hidden name=LocCode VALUE=" . $_POST['LocCode'] . '>'; + echo '<input type=hidden name=SelectedLocation VALUE="' . $SelectedLocation . '>'; + echo '<input type=hidden name=LocCode VALUE="' . $_POST['LocCode'] . '>'; echo '<table class=selection>'; echo '<tr><th colspan=2><font size=3 color=blue>'._('Amend Location details').'</font></th></tr>'; echo '<tr><td>' . _('Location Code') . ':</td><td>'; Modified: trunk/MRPReschedules.php =================================================================== --- trunk/MRPReschedules.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/MRPReschedules.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -46,9 +46,9 @@ $title = _('MRP Reschedules') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The MRP reschedules could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); - echo "<br><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$sql"; + echo '<br>' . $sql; } include('includes/footer.inc'); exit; @@ -58,9 +58,9 @@ $title = _('MRP Reschedules') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('No MRP reschedule retrieved'), 'warn'); - echo "<br><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$sql"; + echo '<br>' . $sql; } include('includes/footer.inc'); exit; @@ -114,32 +114,7 @@ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, $Right_Margin); } -/*Print out the grand totals */ - //$pdf->addTextWrap(80,$YPos,260-$Left_Margin,$FontSize,_('Grand Total Value'), 'right'); - //$DisplayTotalVal = number_format($Tot_Val,2); - //$pdf->addTextWrap(500,$YPos,60,$FontSize,$DisplayTotalVal, 'right'); -/* UldisN - $pdfcode = $pdf->output(); - $len = strlen($pdfcode); - if ($len<=20){ - $title = _('Print MRP Reschedules Error'); - include('includes/header.inc'); - prnMsg(_('There were no items with due dates different from MRP dates'),'error'); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; - include('includes/footer.inc'); - exit; - } else { - header('Content-type: application/pdf'); - header("Content-Length: " . $len); - header('Content-Disposition: inline; filename=MRPReschedules.pdf'); - header('Expires: 0'); - header('Cache-Control: private, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->Output('MRPRescedules.pdf', 'I'); - } -*/ $pdf->OutputD($_SESSION['DatabaseName'] . '_MRPReschedules_' . date('Y-m-d').'.pdf');//UldisN $pdf->__destruct(); //UldisN @@ -151,19 +126,19 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Stock') . '" alt="" />' . ' ' . $title . '</p>'; - echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table class=selection>"; + echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table class=selection>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('Print Option') . ":</td><td><select name='Fill'>"; - echo "<option selected value='yes'>" . _('Print With Alternating Highlighted Lines'); - echo "<option value='no'>" . _('Plain Print'); + echo '<tr><td>' . _('Print Option') . ':</td><td><select name="Fill">'; + echo '<option selected value="yes">' . _('Print With Alternating Highlighted Lines'); + echo '<option value="no">' . _('Plain Print'); echo '</select></td></tr>'; - echo '<tr><td>' . _('Selection') . ":</td><td><select name='Selection'>"; - echo "<option selected value='All'>" . _('All')."</option>"; - echo "<option value='WO'>" . _('Work Orders Only')."</option>"; - echo "<option value='PO'>" . _('Purchase Orders Only')."</option>"; + echo '<tr><td>' . _('Selection') . ':</td><td><select name="Selection">'; + echo '<option selected value="All">' . _('All').'</option>'; + echo '<option value="WO">' . _('Work Orders Only').'</option>'; + echo '<option value="PO">' . _('Purchase Orders Only').'</option>'; echo '</select></td></tr>'; - echo "</table><br>"; - echo "<div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; + echo '</table><br>'; + echo '<div class="centre"><input type=submit name="PrintPDF" value="' . _('Print PDF') . '"></div>'; include('includes/footer.inc'); Modified: trunk/OutstandingGRNs.php =================================================================== --- trunk/OutstandingGRNs.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/OutstandingGRNs.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -51,9 +51,9 @@ $title = _('Outstanding GRN Valuation') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg(_('The outstanding GRNs valuation details could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); - echo "<br><a href='" .$rootpath ."/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>".$SQL; + echo '<br>'.$SQL; } include('includes/footer.inc'); exit; @@ -63,9 +63,9 @@ $title = _('Outstanding GRN Valuation') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg(_('No outstanding GRNs valuation details retrieved'), 'warn'); - echo "<br><a href='" .$rootpath ."/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$SQL"; + echo '<br>'.$SQL; } include('includes/footer.inc'); exit; @@ -142,28 +142,7 @@ $LeftOvers = $pdf->addTextWrap(500,$YPos,60,$FontSize,$DisplayTotalVal, 'right'); $pdf->line($Left_Margin, $YPos+$line_height-2,$Page_Width-$Right_Margin, $YPos+$line_height-2); $YPos -=(2*$line_height); -/* UldisN - $pdfcode = $pdf->output(); - $len = strlen($pdfcode); - if ($len<=20){ - $title = _('Outstanding GRNs Valuation Error'); - include('includes/header.inc'); - prnMsg(_('There were no GRNs with any value to print out for the specified supplier range'),'info'); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; - include('includes/footer.inc'); - exit; - } else { - header('Content-type: application/pdf'); - header('Content-Length: ' . $len); - header('Content-Disposition: inline; filename=OSGRNsValuation.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->Output('OutstandingGRNs.pdf','I'); - } -*/ $pdf->OutputD($_SESSION['DatabaseName'] . '_OSGRNsValuation_' . date('Y-m-d').'.pdf');//UldisN $pdf->__destruct(); //UldisN } else { /*The option to print PDF was not hit */ @@ -174,15 +153,15 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; - echo '<form action=' . $_SERVER['PHP_SELF'] . " method='POST'><table class=selection>"; + echo '<form action=' . $_SERVER['PHP_SELF'] . ' method="POST"><table class=selection>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('From Supplier Code') . ":</td> - <td><input type=text name='FromCriteria' value='0'></td></tr>"; - echo '<tr><td>' . _('To Supplier Code'). ":</td> - <td><input type=text name='ToCriteria' value='zzzzzzz'></td></tr>"; + echo '<tr><td>' . _('From Supplier Code') . ':</td> + <td><input type=text name="FromCriteria" value="0"></td></tr>'; + echo '<tr><td>' . _('To Supplier Code'). ':</td> + <td><input type=text name="ToCriteria" value="zzzzzzz"></td></tr>'; - echo "</table><br><div class='centre'><input type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'></div>"; + echo '</table><br><div class="centre"><input type=Submit Name="PrintPDF" Value="' . _('Print PDF') . '"></div>'; include('includes/footer.inc'); Modified: trunk/PDFChequeListing.php =================================================================== --- trunk/PDFChequeListing.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/PDFChequeListing.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -2,9 +2,6 @@ /* $Id$*/ -/* $Revision: 1.13 $ */ - -//$PageSecurity = 3; include('includes/SQL_CommonFunctions.inc'); include ('includes/session.inc'); @@ -33,37 +30,40 @@ prnMsg($msg,'error'); } - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection> <tr> - <td>' . _('Enter the date from which cheques are to be listed') . ":</td> - <td><input type=text name='FromDate' maxlength=10 size=10 class=date alt='".$_SESSION['DefaultDateFormat']."' VALUE='" . Date($_SESSION['DefaultDateFormat']) . "'></td> - </tr>"; - echo '<tr><td>' . _('Enter the date to which cheques are to be listed') . ":</td> - <td><input type=text name='ToDate' maxlength=10 size=10 class=date alt='".$_SESSION['DefaultDateFormat']."' VALUE='" . Date($_SESSION['DefaultDateFormat']) . "'></td> - </tr>"; + <td>' . _('Enter the date from which cheques are to be listed') . ':</td> + <td><input type="text" name="FromDate" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + </tr>'; + echo '<tr><td>' . _('Enter the date to which cheques are to be listed') . ':</td> + <td><input type=text name="ToDate" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + </tr>'; echo '<tr><td>' . _('Bank Account') . '</td><td>'; - $sql = 'SELECT bankaccountname, accountcode FROM bankaccounts'; + $sql = "SELECT bankaccountname, accountcode FROM bankaccounts"; $result = DB_query($sql,$db); - echo "<select name='BankAccount'>"; + echo '<select name="BankAccount">'; while ($myrow=DB_fetch_array($result)){ - echo '<option VALUE=' . $myrow['accountcode'] . '>' . $myrow['bankaccountname']; + echo '<option VALUE=' . $myrow['accountcode'] . '>' . $myrow['bankaccountname'] . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('Email the report off') . ":</td><td><select name='Email'>"; - echo "<option selected VALUE='No'>" . _('No'); - echo "<option VALUE='Yes'>" . _('Yes'); - echo "</select></td></tr></table><br><div class='centre'><input type=submit name='Go' VALUE='" . _('Create PDF') . "'></div>"; + echo '<tr><td>' . _('Email the report off') . ':</td> + <td><select name="Email">'; + echo '<option selected value="No">' . _('No') . '</option>'; + echo '<option value="Yes">' . _('Yes') . '</option>'; + echo '</select></td> + </tr> + </table> + <br /><div class="centre"><input type=submit name="Go" value="' . _('Create PDF') . '"></div>'; - include('includes/footer.inc'); exit; } else { @@ -71,7 +71,6 @@ include('includes/ConnectDB.inc'); } - $SQL = "SELECT bankaccountname FROM bankaccounts WHERE accountcode = '" .$_POST['BankAccount'] . "'"; @@ -91,14 +90,13 @@ AND transdate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND transdate <='" . FormatDateForSQL($_POST['ToDate']) . "'"; - $Result=DB_query($SQL,$db,'','',false,false); if (DB_error_no($db)!=0){ $title = _('Payment Listing'); include('includes/header.inc'); prnMsg(_('An error occurred getting the payments'),'error'); if ($Debug==1){ - prnMsg(_('The SQL used to get the receipt header information that failed was') . ':<br>' . $SQL,'error'); + prnMsg(_('The SQL used to get the receipt header information that failed was') . ':<br />' . $SQL,'error'); } include('includes/footer.inc'); exit; @@ -124,7 +122,7 @@ while ($myrow=DB_fetch_array($Result)){ - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format(-$myrow['amount'],2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format(-$myrow['amount'],2), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,90,$FontSize,$myrow['ref'], 'left'); $sql = "SELECT accountname, @@ -160,12 +158,12 @@ } DB_free_result($GLTransResult); - $YPos -= ($line_height); - $TotalCheques = $TotalCheques - $myrow['amount']; + $YPos -= ($line_height); + $TotalCheques = $TotalCheques - $myrow['amount']; - if ($YPos - (2 *$line_height) < $Bottom_Margin){ + if ($YPos - (2 *$line_height) < $Bottom_Margin){ /*Then set up a new page */ - $PageNumber++; + $PageNumber++; include ('includes/PDFChequeListingPageHeader.inc'); } /*end of new page header */ } /* end of while there are customer receipts in the batch to print */ @@ -175,21 +173,9 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format($TotalCheques,2), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,300,$FontSize,_('TOTAL') . ' ' . $Currency . ' ' . _('CHEQUES'), 'left'); -/* UldisN -$pdfcode = $pdf->output(); -$len = strlen($pdfcode); -header('Content-type: application/pdf'); -header('Content-Length: ' . $len); -header('Content-Disposition: inline; filename=ChequeListing.pdf'); -header('Expires: 0'); -header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); -header('Pragma: public'); - -$pdf->stream(); -*/ $ReportFileName = $_SESSION['DatabaseName'] . '_ChequeListing_' . date('Y-m-d').'.pdf'; -$pdf->OutputD($ReportFileName);//UldisN -$pdf->__destruct(); //UldisN +$pdf->OutputD($ReportFileName); +$pdf->__destruct(); if ($_POST['Email']=='Yes'){ if (file_exists($_SESSION['reports_dir'] . '/'.$ReportFileName)){ unlink($_SESSION['reports_dir'] . '/'.$ReportFileName); Modified: trunk/PDFCustTransListing.php =================================================================== --- trunk/PDFCustTransListing.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/PDFCustTransListing.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -28,9 +28,9 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection> <tr> - <td>' . _('Enter the date for which the transactions are to be listed') . ":</td> - <td><input type=text name='Date' maxlength=10 size=10 class=date alt='" . $_SESSION['DefaultDateFormat'] . "' value='" . Date($_SESSION['DefaultDateFormat']) . "'></td> - </tr>"; + <td>' . _('Enter the date for which the transactions are to be listed') . ':</td> + <td><input type=text name="Date" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + </tr>'; echo '<tr><td>' . _('Transaction type') . '</td><td>'; Modified: trunk/PDFLowGP.php =================================================================== --- trunk/PDFLowGP.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/PDFLowGP.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -2,9 +2,6 @@ /* $Id$*/ -/* $Revision: 1.15 $ */ - -//$PageSecurity = 2; include('includes/session.inc'); if (!isset($_POST['FromCat']) OR $_POST['FromCat']=='') { @@ -60,9 +57,9 @@ include('includes/header.inc'); prnMsg(_('The low GP items could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); - echo "<br><a href='" .$rootpath ."/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$SQL"; + echo '<br />' . $SQL; } include('includes/footer.inc'); exit; @@ -72,9 +69,9 @@ include('includes/header.inc'); prnMsg(_('No low GP items retrieved'), 'warn'); - echo "<br><a href='" . $rootpath . "/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$SQL"; + echo '<br />' . $SQL; } include('includes/footer.inc'); exit; @@ -112,31 +109,9 @@ $FontSize =10; $YPos -= (2*$line_height); -/* UldisN - $pdfcode = $pdf->output(); - $len = strlen($pdfcode); + $pdf->OutputD($_SESSION['DatabaseName'] . '_LowGPSales_' . date('Y-m-d') . '.pdf'); + $pdf->__destruct(); - if ($len<=20){ - $title = _('Print Low GP Items Error'); - include('includes/header.inc'); - prnMsg (_('There were no items below print out for the location specified'),'error'); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; - include('includes/footer.inc'); - exit; - } else { - header('Content-type: application/pdf'); - header('Content-Length: ' . $len); - header('Content-Disposition: inline; filename=LowGPSales.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->Output('PDFLowGP.pdf', 'I'); - } -*/ - $pdf->OutputD($_SESSION['DatabaseName'] . '_LowGPSales_' . date('Y-m-d') . '.pdf');//UldisN - $pdf->__destruct(); //UldisN - } else { /*The option to print PDF was not hit */ include('includes/header.inc'); @@ -150,22 +125,24 @@ $_POST['FromDate']=Date($_SESSION['DefaultDateFormat']); $_POST['ToDate']=Date($_SESSION['DefaultDateFormat']); $_POST['GPMin']=0; - echo '<form action=' . $_SERVER['PHP_SELF'] . " method='POST'><table class=selection>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('Sales Made From') . ' (' . _('in the format') . ' ' . $_SESSION['DefaultDateFormat'] . "):</td> - <td><input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='FromDate' size=10 maxlength=10 VALUE='" . $_POST['FromDate'] . "'></td> - </tr>"; + echo '<tr><td>' . _('Sales Made From') . ' (' . _('in the format') . ' ' . $_SESSION['DefaultDateFormat'] . '):</td> + <td><input type=text class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" size=10 maxlength="10" value="' . $_POST['FromDate'] . '"></td> + </tr>'; - echo '<tr><td>' . _('Sales Made To') . ' (' . _('in the format') . ' ' . $_SESSION['DefaultDateFormat'] . "):</td> - <td><input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='ToDate' size=10 maxlength=10 VALUE='" . $_POST['ToDate'] . "'></td> - </tr>"; + echo '<tr><td>' . _('Sales Made To') . ' (' . _('in the format') . ' ' . $_SESSION['DefaultDateFormat'] . '):</td> + <td><input type=text class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" size="10" maxlength="10" value="' . $_POST['ToDate'] . '"></td> + </tr>'; - echo '<tr><td>' . _('Show sales with GP') . '%' . _('below') . ":</td> - <td><input type=text class='number' name='GPMin' maxlength=3 size=3 value=" . $_POST['GPMin'] . "></td> - </tr>"; + echo '<tr><td>' . _('Show sales with GP') . '%' . _('below') . ':</td> + <td><input type=text class="number" name="GPMin" maxlength="3" size="3" value="' . $_POST['GPMin'] . '"></td> + </tr>'; - echo "</table><br><div class='centre'><input type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'></div>"; + echo '</table> + <br /><div class="centre"><input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>'; } include('includes/footer.inc'); Modified: trunk/PDFOrderStatus.php =================================================================== --- trunk/PDFOrderStatus.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/PDFOrderStatus.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -2,9 +2,6 @@ /* $Id$*/ -/* $Revision: 1.10 $ */ - -//$PageSecurity = 3; include ('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -33,38 +30,45 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' ' . _('Order Status Report') . '</p>'; - echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection><tr><td>' . _('Enter the date from which orders are to be listed') . ":</td><td><input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='FromDate' maxlength=10 size=10 VALUE='" . Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))) . "'></td></tr>"; - echo '<tr><td>' . _('Enter the date to which orders are to be listed') . ":</td><td>"; - echo "<input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='ToDate' maxlength=10 size=10 VALUE='" . Date($_SESSION['DefaultDateFormat']) . "'></td></tr>"; + echo '<table class=selection> + <tr> + <td>' . _('Enter the date from which orders are to be listed') . ':</td> + <td><input type=text class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" maxlength=10 size=10 value="' . Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))) . '"></td> + </tr>'; + echo '<tr><td>' . _('Enter the date to which orders are to be listed') . ':</td><td>'; + echo '<input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" maxlength=10 size=10 value="' . Date($_SESSION['DefaultDateFormat']) . '"></td></tr>'; echo '<tr><td>' . _('Inventory Category') . '</td><td>'; $sql = "SELECT categorydescription, categoryid FROM stockcategory WHERE stocktype<>'D' AND stocktype<>'L'"; $result = DB_query($sql,$db); - echo "<select name='CategoryID'>"; - echo "<option selected VALUE='All'>" . _('Over All Categories'); + echo '<select name="CategoryID">'; + echo '<option selected value="All">' . _('Over All Categories') . '</option>'; while ($myrow=DB_fetch_array($result)){ - echo '<option value=' . $myrow['categoryid'] . '>' . $myrow['categorydescription']; + echo '<option value=' . $myrow['categoryid'] . '>' . $myrow['categorydescription'] . '</option>'; } echo '</select></td></tr>'; echo '<tr><td>' . _('Inventory Location') . ':</td><td><select name="Location">'; echo '<option selected value="All">' . _('All Locations'); - $result= DB_query('SELECT loccode, locationname FROM locations',$db); + $result= DB_query("SELECT loccode, locationname FROM locations",$db); while ($myrow=DB_fetch_array($result)){ - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('Back Order Only') . ":</td><td><select name='BackOrders'>"; - echo "<option selected VALUE='Yes'>" . _('Only Show Back Orders'); - echo "<option VALUE='No'>" . _('Show All Orders'); - echo "</select></td></tr></table><br><div class='centre'><input type=submit name='Go' value='" . _('Create PDF') . "'></div>"; + echo '<tr><td>' . _('Back Order Only') . ':</td><td><select name="BackOrders">'; + echo '<option selected value="Yes">' . _('Only Show Back Orders') . '</option>'; + echo '<option value="No">' . _('Show All Orders') . '</option>'; + echo '</select></td> + </tr> + </table> + <br /><div class="centre"><input type=submit name="Go" value="' . _('Create PDF') . '"></div>'; include('includes/footer.inc'); exit; @@ -229,10 +233,10 @@ } if ($_POST['BackOrders']=='Yes'){ - $sql .= ' AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced >0'; + $sql .= " AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced >0"; } -$sql .= ' ORDER BY salesorders.orderno'; +$sql .= " ORDER BY salesorders.orderno"; $Result=DB_query($sql,$db,'','',false,false); //dont trap errors here @@ -332,23 +336,11 @@ $YPos -= ($line_height); if ($YPos - (2 *$line_height) < $Bottom_Margin){ /*Then set up a new page */ - $PageNumber++; - include ('includes/PDFOrderStatusPageHeader.inc'); + $PageNumber++; + include ('includes/PDFOrderStatusPageHeader.inc'); $OrderNo=0; } /*end of new page header */ } /* end of while there are delivery differences to print */ -/* UldisN -$pdfcode = $pdf->output(); -$len = strlen($pdfcode); -header('Content-type: application/pdf'); -header('Content-Length: ' . $len); -header('Content-Disposition: inline; filename=OrderStatus.pdf'); -header('Expires: 0'); -header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); -header('Pragma: public'); - -$pdf->stream(); -*/ $pdf->OutputD($_SESSION['DatabaseName'] . '_OrderStatus_' . date('Y-m-d') . '.pdf');//UldisN $pdf->__destruct(); //UldisN ?> \ No newline at end of file Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/PDFPrintLabel.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -17,7 +17,7 @@ // If there is no label templates, the user could select to set up a new one if ($AllLabels==null) { - echo '<br/><br/>'; + abortMsg( _('There isn\'t any label template to select for printing. Click') . ' <a href="Labels.php"><b>' . _('HERE'). '</b></a> '. _('to set up a new one') ); } @@ -49,9 +49,9 @@ $DocumentPaper='LETTER'; $DocumentOrientation='P'; // Correccion para la version trunk :( include('includes/PDFStarter.php'); - if ($Version>="3.12") + if ($Version>='3.12') $pdf->setPageFormat($formatPage); - $ok = printLabels( + $ok = printLabels( $dimensions, $lines, intval($_POST['QtyByItem']), Modified: trunk/PDFStockCheckComparison.php =================================================================== --- trunk/PDFStockCheckComparison.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/PDFStockCheckComparison.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -168,7 +168,7 @@ '" . $SQLAdjustmentDate . "', '" . $PeriodNo . "', '" . $StockGLCodes['stockact'] . "', - '" . $myrow['standardcost'] * $StockQtyDifference . ", '" . $myrow['stockid'] . " x " . $StockQtyDifference . " @ " . $myrow['standardcost'] . " - " . _('Inventory Check') . "')"; + '" . $myrow['standardcost'] * $StockQtyDifference . "', '" . $myrow['stockid'] . " x " . $StockQtyDifference . " @ " . $myrow['standardcost'] . " - " . _('Inventory Check') . "')"; $Result = DB_query($SQL,$db, $ErrMsg, $DbgMsg, true); } //END INSERT GL TRANS @@ -222,7 +222,7 @@ if ($Location!=$CheckItemRow['loccode']){ $FontSize=14; - if ($Location!=''){ /*Then it's NOT the first time round */ + if ($Location!=''){ /*Then it is NOT the first time round */ /*draw a line under the Location*/ $pdf->line($Left_Margin, $YPos-2,$Page_Width-$Right_Margin, $YPos-2); $YPos -=$line_height; @@ -236,7 +236,7 @@ if ($Category!=$CheckItemRow['categoryid']){ $FontSize=12; - if ($Category!=''){ /*Then it's NOT the first time round */ + if ($Category!=''){ /*Then it is NOT the first time round */ /*draw a line under the CATEGORY TOTAL*/ $pdf->line($Left_Margin, $YPos-2,$Page_Width-$Right_Margin, $YPos-2); $YPos -=$line_height; @@ -335,10 +335,10 @@ if ($_POST['ReportOrClose']=='ReportAndClose'){ //need to print the report first before this but don't risk re-adjusting all the stock!! - $sql = 'TRUNCATE TABLE stockcheckfreeze'; + $sql = "TRUNCATE TABLE stockcheckfreeze"; $result = DB_query($sql,$db); - $sql = 'TRUNCATE TABLE stockcounts'; + $sql = "TRUNCATE TABLE stockcounts"; $result = DB_query($sql,$db); } @@ -356,11 +356,11 @@ echo '<tr><td>' . _('Choose Option'). ':</font></td><td><select name="ReportOrClose">'; if ($_POST['ReportOrClose']=='ReportAndClose'){ - echo '<option selected VALUE="ReportAndClose">'. _('Report and Close the Inventory Comparison Processing Adjustments As Necessary'); - echo '<option VALUE="ReportOnly">'. _('Report The Inventory Comparison Differences Only - No Adjustments'); + echo '<option selected VALUE="ReportAndClose">'. _('Report and Close the Inventory Comparison Processing Adjustments As Necessary') . '</option>'; + echo '<option VALUE="ReportOnly">'. _('Report The Inventory Comparison Differences Only - No Adjustments') . '</option>'; } else { - echo '<option selected VALUE="ReportOnly">' . _('Report The Inventory Comparison Differences Only - No Adjustments'); - echo '<option VALUE="ReportAndClose">' . _('Report and Close the Inventory Comparison Processing Adjustments As Necessary'); + echo '<option selected VALUE="ReportOnly">' . _('Report The Inventory Comparison Differences Only - No Adjustments') . '</option>'; + echo '<option VALUE="ReportAndClose">' . _('Report and Close the Inventory Comparison Processing Adjustments As Necessary') . '</option>'; } echo '</select></td></tr>'; @@ -369,11 +369,11 @@ echo '<tr><td>'. _('Action for Zero Counts') . ':</td><td><select name="ZeroCounts">'; if ($_POST['ZeroCounts'] =='Adjust'){ - echo '<option selected VALUE="Adjust">'. _('Adjust System stock to Nil'); - echo '<option VALUE="Leave">' . _("Don't Adjust System stock to Nil"); + echo '<option selected VALUE="Adjust">'. _('Adjust System stock to Nil') . '</option>'; + echo '<option VALUE="Leave">' . _('Do not Adjust System stock to Nil') . '</option>'; } else { - echo '<option VALUE="Adjust">'. _('Adjust System stock to Nil'); - echo '<option selected VALUE="Leave">' . _("Don't Adjust System stock to Nil"); + echo '<option VALUE="Adjust">'. _('Adjust System stock to Nil') . '</option>'; + echo '<option selected VALUE="Leave">' . _('Do not Adjust System stock to Nil') . '</option>'; } echo '</table><br><div class="centre"><input type=Submit Name="PrintPDF" Value="' . _('Print PDF'). '"></div>'; Modified: trunk/POReport.php =================================================================== --- trunk/POReport.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/POReport.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -6,7 +6,6 @@ // Inquiry on Purchase Orders // If Date Type is Order, the main file is purchorderdetails // If Date Type is Delivery, the main file is grns -//$PageSecurity=2; include('includes/session.inc'); $title = _('Purchase Order Report'); @@ -1421,49 +1420,48 @@ echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection>'; + echo '<table class="selection">'; echo '<tr><td>' . _('Report Type') . ':</td>'; - echo "<td><select name='ReportType'>"; - echo "<option selected value='Detail'>" . _('Detail'); - echo "<option value='Summary'>" . _('Summary'); + echo '<td><select name="ReportType">'; + echo '<option selected value="Detail">' . _('Detail') . '</option>'; + echo '<option value="Summary">' . _('Summary') . '</option>'; echo '</select></td><td> </td></tr>'; echo '<tr><td>' . _('Date Type') . ':</td>'; - echo "<td><select name='DateType'>"; - echo "<option selected value='Order'>" . _('Order Date'); - echo "<option value='Delivery'>" . _('Delivery Date'); + echo '<td><select name="DateType">'; + echo '<option selected value="Order">' . _('Order Date') . '</option>'; + echo '<option value="Delivery">' . _('Delivery Date') . '</option>'; echo '</select></td><td> </td></tr>'; echo '<tr> - <td>' . _('Date Range') . ":</td> - <td><input type='Text' class=date alt='".$_SESSION['DefaultDateFormat']."' name='FromDate' size=10 maxlength=10 value=" . $_POST['FromDate'] . - '> ' . _('To') . ":   - <input type='Text' class=date alt='".$_SESSION['DefaultDateFormat']."' name='ToDate' size=10 maxlength=10 value=" . $_POST['ToDate'] . "></td> - </tr>"; + <td>' . _('Date Range') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" size="10" maxlength="10" value="' . $_POST['FromDate'] .'"> ' . _('To') . ':   + <input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" size="10" maxlength="10" value="' . $_POST['ToDate'] . '"></td> + </tr>'; echo '<tr><td>' . _('Part Number') . ':</td>'; - echo "<td><select name='PartNumberOp'>"; - echo "<option selected value='Equals'>" . _('Equals'); - echo "<option value='LIKE'>" . _('Begins With'); + echo '<td><select name="PartNumberOp">'; + echo '<option selected value="Equals">' . _('Equals') . '</option>'; + echo '<option value="LIKE">' . _('Begins With') . '</option>'; echo '</select>'; - echo "  <input type='Text' name='PartNumber' size=20 maxlength=20 value="; + echo '  <input type="text" name="PartNumber" size="20" maxlength="20" value="'; if (isset($_POST['PartNumber'])) { - echo $_POST['PartNumber'] . "></td></tr>"; + echo $_POST['PartNumber'] . '"></td></tr>'; } else { - echo "></td></tr>"; + echo '"></td></tr>'; } echo '<tr><td>' . _('Supplier Number') . ':</td>'; - echo "<td><select name='SupplierIdOp'>"; - echo "<option selected value='Equals'>" . _('Equals'); - echo "<option value='LIKE'>" . _('Begins With'); + echo '<td><select name="SupplierIdOp">'; + echo '<option selected value="Equals">' . _('Equals') . '</option>'; + echo '<option value="LIKE">' . _('Begins With') . '</option>'; echo '</select>'; - echo "  <input type='Text' name='SupplierId' size=10 maxlength=10 value="; + echo '  <input type="text" name="SupplierId" size=10 maxlength=10 value="'; if (isset($_POST['SupplierId'])) { - echo $_POST['SupplierId'] . "></td></tr>"; + echo $_POST['SupplierId'] . '"></td></tr>'; } else { - echo "></td></tr>"; + echo '"></td></tr>'; } echo '<tr><td>' . _('Supplier Name') . ':</td>'; @@ -1480,11 +1478,11 @@ echo '<tr><td>' . _('Order Number') . ':</td>'; echo '<td>'._('Equals').':  '; - echo "<input type='Text' name='OrderNo' size=10 maxlength=10 value="; + echo '<input type="text" name="OrderNo" size="10" maxlength="10" value="'; if (isset($_POST['OrderNo'])) { - echo $_POST['OrderNo'] . "></td></tr>"; + echo $_POST['OrderNo'] . '"></td></tr>'; } else { - echo "></td></tr>"; + echo '"></td></tr>'; } echo '<tr><td>' . _('Line Item Status') . ':</td>'; Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/PO_Header.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -331,7 +331,7 @@ $ErrMsg = _('The searched supplier records requested cannot be retrieved because'); $result_SuppSelect = DB_query($SQL,$db,$ErrMsg); - + $SuppliersReturned=DB_num_rows($result_SuppSelect); if (DB_num_rows($result_SuppSelect)==1){ $myrow=DB_fetch_array($result_SuppSelect); $_POST['Select'] = $myrow['supplierid']; @@ -508,6 +508,7 @@ _('Purchase Order') . '" alt="">' . ' ' . _('Purchase Order: Select Supplier') . ''; echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '" method="post" name="choosesupplier">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<input type="hidden" name="SuppliersReturned" value="' . $SuppliersReturned .'" />'; echo '<table cellpadding=3 colspan=4 class=selection> <tr> Modified: trunk/PaymentMethods.php =================================================================== --- trunk/PaymentMethods.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/PaymentMethods.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -34,9 +34,9 @@ //first off validate inputs sensible - if (strpos($_POST['MethodName'],'&')>0 OR strpos($_POST['MethodName'],"'")>0) { + if (ContainsIllegalCharacters($_POST['MethodName'])) { $InputError = 1; - prnMsg( _('The payment method cannot contain the character') . " '&' " . _('or the character') ." '",'error'); + prnMsg( _('The payment method cannot contain illegal characters'),'error'); $Errors[$i] = 'MethodName'; $i++; } Modified: trunk/PcAssignCashToTab.php =================================================================== --- trunk/PcAssignCashToTab.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/PcAssignCashToTab.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -1,8 +1,6 @@ <?php -/* $Revision: 1.0 $ */ +/* $Id$*/ -//$PageSecurity = 6; - include('includes/session.inc'); $title = _('Assignment of Cash to Petty Cash Tab'); include('includes/header.inc'); @@ -45,7 +43,7 @@ if ($_POST['Amount']==0) { $InputError = 1; - prnMsg('<br>' . _('The Amount must be inputed'),'error'); + prnMsg('<br />' . _('The Amount must be inputed'),'error'); $Errors[$i] = 'TabCode'; $i++; } @@ -58,18 +56,18 @@ $Limit=DB_fetch_array($ResultLimit); if (($_POST['CurrentAmount']+$_POST['Amount'])>$Limit['tablimit']){ - prnMsg('<br>' . _('The balance after this assignment would be greater than the specified limit for this PC tab'),'warning'); + prnMsg('<br />' . _('The balance after this assignment would be greater than the specified limit for this PC tab'),'warning'); } if ($InputError !=1 AND isset($SelectedIndex) ) { $sql = "UPDATE pcashdetails - SET date = '".FormatDateForSQL($_POST['Date'])."', - amount = '" . $_POST['Amount'] . "', - authorized = '0000-00-00', - notes = '" . $_POST['Notes'] . "', - receipt = '" . $_POST['Receipt'] . "' - WHERE counterindex = '" . $SelectedIndex . "'"; + SET date = '".FormatDateForSQL($_POST['Date'])."', + amount = '" . $_POST['Amount'] . "', + authorized = '0000-00-00', + notes = '" . $_POST['Notes'] . "', + receipt = '" . $_POST['Receipt'] . "' + WHERE counterindex = '" . $SelectedIndex . "'"; $msg = _('Assignment of cash to PC Tab ') . ' ' . $SelectedTabs . ' ' . _('has been updated'); } elseif ($InputError !=1 ) { @@ -128,11 +126,12 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Search') . '" alt="" />' . ' ' . $title. '</p>'; - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p><table class=selection>'; //Main table - echo '<tr><td>' . _('Petty Cash Tab To Assign Cash') . ":</td><td><select name='SelectedTabs'>"; + echo '<tr><td>' . _('Petty Cash Tab To Assign Cash') . ':</td> + <td><select name="SelectedTabs">'; DB_free_result($result); $SQL = "SELECT tabcode @@ -144,16 +143,16 @@ while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SelectTabs']) and $myrow['tabcode']==$_POST['SelectTabs']) { - echo "<option selected value='"; + echo '<option selected value="'; } else { - echo "<option value='"; + echo '<option value="'; } - echo $myrow['tabcode'] . "'>" . $myrow['tabcode']; + echo $myrow['tabcode'] . '">' . $myrow['tabcode'] . '</option>'; } echo '</select></td></tr>'; echo '</td></tr></table>'; // close main table - echo '<p><div class="centre"><input type=submit name=process VALUE="' . _('Accept') . '"><input type=submit name=Cancel value="' . _('Cancel') . '"></div>'; + echo '<p><div class="centre"><input type=submit name="process" value="' . _('Accept') . '"><input type=submit name="Cancel" value="' . _('Cancel') . '"></div>'; echo '</form>'; } @@ -175,20 +174,6 @@ unset($_POST['Receipt']); } -/* $sql = "SELECT pcashdetails.date, - pcashdetails.codeexpense, - pcexpenses.description - pcashdetails.amount, - pcashdetails.authorized, - pcashdetails.posted, - pcashdetails.notes, - pcashdetails.receipt - FROM pcashdetails, pcexpenses - WHERE pcashdetails.tabcode='$SelectedTabs' - AND pcashdetails.codeexpense = pcexpenses.codeexpense - AND pcashdetails.date >=DATE_SUB(CURDATE(), INTERVAL ".$Days." DAY) - ORDER BY pcashdetails.counterindex Asc"; -*/ if(!isset ($Days)){ $Days=30; } @@ -201,21 +186,21 @@ $result = DB_query($sql,$db); echo '<table class=selection>'; - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo "<tr><th colspan=8>" . _('Detail Of PC Tab Movements For Last ') .': '; - echo "<input type=hidden name='SelectedTabs' value=" . $SelectedTabs . ">"; - echo "<input type=text class=number name='Days' value=" . $Days . " maxlength =3 size=4> Days "; + echo '<tr><th colspan="8">' . _('Detail Of PC Tab Movements For Last ') .': '; + echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; + echo '<input type="text" class="number" name="Days" value="' . $Days . '" maxlength="3" size="4" /> ' . _('Days'); echo '<input type=submit name="Go" value="' . _('Go') . '">'; echo '</th></tr></form>'; - echo "<tr> - <th>" . _('Date') . "</th> - <th>" . _('Expense Code') . "</th> - <th>" . _('Amount') . "</th> - <th>" . _('Authorised') . "</th> - <th>" . _('Notes') . "</th> - <th>" . _('Receipt') . "</th> - </tr>"; + echo '<tr> + <th>' . _('Date') . '</th> + <th>' . _('Expense Code') . '</th> + <th>' . _('Amount') . '</th> + <th>' . _('Authorised') . '</th> + <th>' . _('Notes') . '</th> + <th>' . _('Receipt') . '</th> + </tr>'; $k=0; //row colour counter @@ -239,29 +224,29 @@ $Description['0']='ASSIGNCASH'; } - if (($myrow['authorized'] == "0000-00-00") and ($Description['0'] == 'ASSIGNCASH')){ + if (($myrow['authorized'] == '0000-00-00') and ($Description['0'] == 'ASSIGNCASH')){ // only cash assignations NOT authorized can be modified or deleted - echo "<td>".ConvertSQLDate($myrow['date'])."</td> - <td>".$Description['0']."</td> - <td class=number>".number_format($myrow['amount'],2)."</td> - <td>".ConvertSQLDate($myrow['authorized'])."</td> - <td>".$myrow['notes']."</td> - <td>".$myrow['receipt']."</td> - <td><a href='".$_SERVER['PHP_SELF'] . '?' . SID ."SelectedIndex=".$myrow['counterindex']."&SelectedTabs=" . - $SelectedTabs . "&Days=" . $Days . "&edit=yes'>" . _('Edit') . "</td> - <td><a href='".$_SERVER['PHP_SELF'] . '?' . SID ."SelectedIndex=".$myrow['counterindex']."&SelectedTabs=" . - $SelectedTabs . "&Days=" . $Days . "&delete=yes' onclick=\"return confirm('" . - _('Are you sure you wish to delete this code and the expense it may have set up?') . "');\">" . - _('Delete') . "</td> - </tr>"; + echo '<td>' . ConvertSQLDate($myrow['date']) . '</td> + <td>' . $Description['0'] . '</td> + <td class=number>' . number_format($myrow['amount'],2) . '</td> + <td>' . ConvertSQLDate($myrow['authorized']) . '</td> + <td>' . $myrow['notes'] . '</td> + <td>' . $myrow['receipt'] . '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedIndex=' . $myrow['counterindex'] . '&SelectedTabs=' . + $SelectedTabs . '&Days=' . $Days . '&edit=yes">' . _('Edit') . '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedIndex=' . $myrow['counterindex'] . '&SelectedTabs=' . + $SelectedTabs . '&Days=' . $Days . '&delete=yes" onclick="return confirm("' . + _('Are you sure you wish to delete this code and the expense it may have set up?') . '");">' . + _('Delete') . '</td> + </tr>'; }else{ - echo "<td>".ConvertSQLDate($myrow['date'])."</td> - <td>".$Description['0']."</td> - <td class=number>".number_format($myrow['amount'],2)."</td> - <td>".ConvertSQLDate($myrow['authorized'])."</td> - <td>".$myrow['notes']."</td> - <td>".$myrow['receipt']."</td> - </tr>"; + echo '<td>' . ConvertSQLDate($myrow['date']) . '</td> + <td>' . $Description['0'] . '</td> + <td class=number>' . number_format($myrow['amount'],2).'</td> + <td>' . ConvertSQLDate($myrow['authorized']) . '</td> + <td>' . $myrow['notes'] . '</td> + <td>' . $myrow['receipt'] . '</td> + </tr>'; } } //END WHILE LIST LOOP @@ -277,8 +262,8 @@ $Amount['0']=0; } - echo "<tr><td colspan=2 style=text-align:right ><b>" . _('Current balance') . ":</b></td> - <td>".number_format($Amount['0'],2)."</td></tr>"; + echo '<tr><td colspan="2" style="text-align:right"><b>' . _('Current balance') . ':</b></td> + <td>' . number_format($Amount['0'],2) . '</td></tr>'; echo '</table>'; @@ -290,13 +275,13 @@ $Amount['0']=0; } - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] .'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p><table class=selection>'; //Main table if (isset($_GET['SelectedIndex'])) { - echo "<tr><th colspan=2><font color=blue size=3>"._('Update Cash Assignment')."</font></th></tr>"; + echo '<tr><th colspan="2"><font color=blue size=3>'._('Update Cash Assignment').'</font></th></tr>'; } else { - echo "<tr><th colspan=2><font color=blue size=3>"._('New Cash Assignment')."</font></th></tr>"; + echo '<tr><th colspan="2"><font color=blue size=3>'._('New Cash Assignment').'</font></th></tr>'; } if ( isset($_GET['edit'])) { @@ -312,18 +297,18 @@ $_POST['Notes'] = $myrow['notes']; $_POST['Receipt'] = $myrow['receipt']; - echo "<input type=hidden name='SelectedTabs' value=" . $SelectedTabs . ">"; - echo "<input type=hidden name='SelectedIndex' value=" . $SelectedIndex. ">"; - echo "<input type=hidden name='CurrentAmount' value=" . $Amount[0]. ">"; - echo "<input type=hidden name='Days' value=" .$Days. ">"; + echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; + echo '<input type=hidden name="SelectedIndex" value="' . $SelectedIndex. '">'; + echo '<input type=hidden name="CurrentAmount" value="' . $Amount[0]. '">'; + echo '<input type=hidden name="Days" value="' .$Days. '">'; } /* Ricard: needs revision of this date initialization */ if (!isset($_POST['Date'])) { - $_POST['Date']=Date("d/m/Y"); + $_POST['Date']=Date('d/m/Y'); } - echo '<tr><td>' . _('Cash Assignation Date') . ":</td>"; + echo '<tr><td>' . _('Cash Assignation Date') . ':</td>'; echo '<td><input type=text class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="Date" size=10 maxlength=10 value=' . $_POST['Date'] . '></td></tr>'; @@ -332,23 +317,26 @@ $_POST['Amount']=0; } - echo "<tr><td>" . _('Amount') . ":</td><td><input type='Text' class='number' name='Amount' size='12' maxlength='11' value='" . $_POST['Amount'] . "'></td></tr>"; + echo '<tr><td>' . _('Amount') . ':</td> + <td><input type="text" class="number" name="Amount" size="12" maxlength="11" value="' . $_POST['Amount'] . '"></td></tr>'; if (!isset($_POST['Notes'])) { $_POST['Notes']=''; } - echo "<tr><td>" . _('Notes') . ":</td><td><input type='Text' name='Notes' size=50 maxlength=49 value='" . $_POST['Notes'] . "'></td></tr>"; + echo '<tr><td>' . _('Notes') . ':</td> + <td><input type="text" name="Notes" size=50 maxlength=49 value="' . $_POST['Notes'] . '"></td></tr>'; if (!isset($_POST['Receipt'])) { $_POST['Receipt']=''; } - echo "<tr><td>" . _('Receipt') . ":</td><td><input type='Text' name='Receipt' size=50 maxlength=49 value='" . $_POST['Receipt'] . "'></td></tr>"; + echo '<tr><td>' . _('Receipt') . ':</td> + <td><input type="text" name="Receipt" size="50" maxlength="49" value="' . $_POST['Receipt'] . '"></td></tr>'; - echo "<input type=hidden name='CurrentAmount' value=" . $Amount['0']. ">"; - echo "<input type=hidden name='SelectedTabs' value=" . $SelectedTabs . ">"; - echo "<input type=hidden name='Days' value=" .$Days. ">"; + echo '<input type=hidden name="CurrentAmount" value="' . $Amount['0']. '">'; + echo '<input type=hidden name="SelectedTabs" value="' . $SelectedTabs . '">'; + echo '<input type=hidden name="Days" value="' .$Days. '">'; echo '</td></tr></table>'; // close main table Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/PcAuthorizeExpenses.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -1,7 +1,6 @@ <?php +/* $Id$*/ -/* $Id$ */ - include('includes/session.inc'); $title = _('Authorization of Petty Cash Expenses'); include('includes/header.inc'); @@ -47,9 +46,9 @@ $Days=30; } echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; - echo '<br><table class=selection>'; - echo '<tr><th colspan="7">' . _('Detail Of Movement For Last ') .': '; - echo '<input type="text" class="number" name="Days" value="' . $Days . '" maxlength ="3" size="4"> ' ._('Days'); + echo '<br /><table class=selection>'; + echo '<tr><th colspan=7>' . _('Detail Of Movement For Last ') .': '; + echo '<input type="text" class="number" name="Days" value="' . $Days . '" maxlength="3" size="4" />' . _('Days'); echo '<input type=submit name="Go" value="' . _('Go') . '"></tr></th>'; echo '</form>'; @@ -77,14 +76,14 @@ $result = DB_query($sql,$db); echo '<tr> - <th>' . _('Date') . '</th> - <th>' . _('Expense Code') . '</th> - <th>' . _('Amount') . '</th> - <th>' . _('Posted') . '</th> - <th>' . _('Notes') . '</th> - <th>' . _('Receipt') . '</th> - <th>' . _('Authorized') . '</th> - </tr>'; + <th>' . _('Date') . '</th> + <th>' . _('Expense Code') . '</th> + <th>' . _('Amount') . '</th> + <th>' . _('Posted') . '</th> + <th>' . _('Notes') . '</th> + <th>' . _('Receipt') . '</th> + <th>' . _('Authorized') . '</th> + </tr>'; $k=0; //row colour counter echo'<form action="PcAuthorizeExpenses.php" method="POST" name="'._('update').'">'; @@ -93,7 +92,7 @@ while ($myrow=DB_fetch_array($result)) { //update database if update pressed - if ((isset($_POST['submit']) AND $_POST['submit']==_('Update')) AND isset($_POST[$myrow['counterindex']])){ + if ((isset($_POST['submit']) and $_POST['submit']=='Update') AND isset($_POST[$myrow['counterindex']])){ $PeriodNo = GetPeriod(ConvertSQLDate($myrow['date']), $db); @@ -123,90 +122,88 @@ $typeno = GetNextTransNo($type,$db); //build narrative - $narrative= _('PettyCash') . ' - ' . $myrow['tabcode'] . ' - ' . $myrow['codeexpense'] . ' - ' . DB_escape_string($myrow['notes']) . ' - '.$myrow['receipt']; + $narrative= _('PettyCash') . ' - '.$myrow['tabcode'] . ' - ' . $myrow['codeexpense'] . ' - ' . $myrow['notes'] . ' - ' . $myrow['receipt']; //insert to gltrans DB_Txn_Begin($db); - $sqlFrom="INSERT INTO `gltrans` - (`counterindex`, - `type`, - `typeno`, - `chequeno`, - `trandate`, - `periodno`, - `account`, - `narrative`, - `amount`, - `posted`, - `jobref`, - `tag`) - VALUES (NULL, - '".$type."', - '".$typeno."', - 0, - '".$myrow['date']."', - '".$PeriodNo."', - '".$AccountFrom."', - '".$narrative."', - '".-$Amount."', - 0, - '', - 0)"; - + $sqlFrom="INSERT INTO `gltrans` (`counterindex`, + `type`, + `typeno`, + `chequeno`, + `trandate`, + `periodno`, + `account`, + `narrative`, + `amount`, + `posted`, + `jobref`, + `tag`) + VALUES (NULL, + '".$type."', + '".$typeno."', + 0, + '".$myrow['date']."', + '".$PeriodNo."', + '".$AccountFrom."', + '". DB_escape_string($narrative) ."', + '".-$Amount."', + 0, + '', + 0)"; + $ResultFrom = DB_Query($sqlFrom, $db, '', '', true); - $sqlTo="INSERT INTO `gltrans` - (`counterindex`, - `type`, - `typeno`, - `chequeno`, - `trandate`, - `periodno`, - `account`, - `narrative`, - `amount`, - `posted`, - `jobref`, - `tag`) - VALUES (NULL, - '".$type."', - '".$typeno."', - 0, - '".$myrow['date']."', - '".$PeriodNo."', - '".$AccountTo."', - '".$narrative."', - '".$Amount."', - 0, - '', - 0)"; - + $sqlTo="INSERT INTO `gltrans` (`counterindex`, + `type`, + `typeno`, + `chequeno`, + `trandate`, + `periodno`, + `account`, + `narrative`, + `amount`, + `posted`, + `jobref`, + `tag`) + VALUES (NULL, + '".$type."', + '".$typeno."', + 0, + '".$myrow['date']."', + '".$PeriodNo."', + '".$AccountTo."', + '" . DB_escape_string($narrative) . "', + '".$Amount."', + 0, + '', + 0)"; + $ResultTo = DB_Query($sqlTo, $db, '', '', true); if ($myrow['codeexpense'] == 'ASSIGNCASH'){ // if it's a cash assignation we need to updated banktrans table as well. $ReceiptTransNo = GetNextTransNo( 2, $db); $SQLBank= "INSERT INTO banktrans (transno, - type, - bankact, - ref, - exrate, - functionalexrate, - transdate, - banktranstype, - amount, - currcode) - VALUES ('". $ReceiptTransNo . "', - 1, - '" . $AccountFrom . "', - '" . $narrative . "', - 1, - '" . $myrow['rate'] . "', - '" . $myrow['date'] . "'... [truncated message content] |
From: <dai...@us...> - 2011-04-16 06:21:05
|
Revision: 4551 http://web-erp.svn.sourceforge.net/web-erp/?rev=4551&view=rev Author: daintree Date: 2011-04-16 06:20:56 +0000 (Sat, 16 Apr 2011) Log Message: ----------- various Modified Paths: -------------- trunk/InventoryQuantities.php trunk/Locations.php trunk/MRPReschedules.php trunk/OutstandingGRNs.php trunk/PDFChequeListing.php trunk/PDFCustTransListing.php trunk/PDFLowGP.php trunk/PDFOrderStatus.php trunk/PDFPrintLabel.php trunk/PDFStockCheckComparison.php trunk/POReport.php trunk/PO_Header.php trunk/PaymentMethods.php trunk/PcAssignCashToTab.php trunk/PcAuthorizeExpenses.php trunk/PcClaimExpensesFromTab.php trunk/PcReportTab.php trunk/PcTypeTabs.php trunk/Prices.php trunk/PricesBasedOnMarkUp.php trunk/Prices_Customer.php trunk/PrintCustOrder.php trunk/PrintCustTrans.php trunk/RecurringSalesOrders.php trunk/ReorderLevel.php trunk/ReorderLevelLocation.php trunk/SalesAnalReptCols.php trunk/SalesAnalRepts.php trunk/SalesInquiry.php trunk/SalesPeople.php trunk/SalesTypes.php trunk/SelectCompletedOrder.php trunk/SelectCustomer.php trunk/SelectOrderItems.php trunk/SelectProduct.php trunk/SelectSupplier.php trunk/ShipmentCosting.php trunk/Shipments.php trunk/Shipt_Select.php trunk/StockCategories.php trunk/StockCheck.php trunk/StockCostUpdate.php trunk/StockQties_csv.php trunk/StockSerialItems.php trunk/StockTransferControlled.php trunk/StockUsage.php trunk/Stocks.php trunk/SuppInvGRNs.php trunk/SupplierAllocations.php trunk/SupplierBalsAtPeriodEnd.php trunk/SupplierCredit.php trunk/SupplierInvoice.php trunk/SupplierTypes.php trunk/Suppliers.php trunk/WOSerialNos.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/doc/Change.log.html trunk/report_runner.php Modified: trunk/InventoryQuantities.php =================================================================== --- trunk/InventoryQuantities.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/InventoryQuantities.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -1,12 +1,11 @@ <?php -/* $Revision: 1.4 $ */ /* $Id$ */ // InventoryQuantities.php - Report of parts with quantity. Sorts by part and shows // all locations where there are quantities of the part -//$PageSecurity = 2; + include('includes/session.inc'); If (isset($_POST['PrintPDF'])) { @@ -83,9 +82,9 @@ $title = _('Inventory Quantities') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The Inventory Quantity report could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); - echo "<br><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$sql"; + echo '<br>' . $sql; } include('includes/footer.inc'); exit; @@ -94,7 +93,7 @@ $title = _('Print Inventory Quantities Report'); include('includes/header.inc'); prnMsg(_('There were no items with inventory quantities'),'error'); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br><a href="'.$rootpath.'/index.php?">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; } @@ -148,12 +147,12 @@ echo '<div class="page_help_text">' . _('Use this report to display the quantity of Inventory items in different categories.') . '</div><br>'; - echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table>"; + echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection><tr><td>'; - echo '<tr><td>' . _('Selection') . ":</td><td><select name='Selection'>"; - echo "<option selected value='All'>" . _('All'); - echo "<option value='Multiple'>" . _('Only Parts With Multiple Locations'); + echo '<tr><td>' . _('Selection') . ':</td><td><select name="Selection">'; + echo '<option selected value="All">' . _('All') . '</option>'; + echo '<option value="Multiple">' . _('Only Parts With Multiple Locations') . '</option>'; echo '</select></td></tr>'; $SQL="SELECT categoryid, categorydescription FROM stockcategory where stocktype<>'A' ORDER BY categorydescription"; @@ -185,7 +184,7 @@ } } echo '</select></td></tr>'; - echo "</table><p><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; + echo '</table><p><div class="centre"><input type=submit name="PrintPDF" value="' . _('Print PDF') . '"></div>'; include('includes/footer.inc'); Modified: trunk/Locations.php =================================================================== --- trunk/Locations.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/Locations.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -1,10 +1,7 @@ <?php /* $Id$*/ -/* $Revision: 1.25 $ */ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Location Maintenance'); @@ -374,18 +371,19 @@ $myrow['managed'] = _('No'); } */ - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td>%s</td> - <td><a href='%sSelectedLocation=%s'>" . _('Edit') . "</td> - <td><a href='%sSelectedLocation=%s&delete=1'>" . _('Delete') . '</td> + <td>%s</td> + <td><a href="%sSelectedLocation=%s">' . _('Edit') . '</td> + <td><a href="%sSelectedLocation=%s&delete=1">' . _('Delete') . '</td> </tr>', $myrow['loccode'], $myrow['locationname'], $myrow['description'], - $_SERVER['PHP_SELF'] . '?' . SID . '&', + $_SERVER['PHP_SELF'] . '?', $myrow['loccode'], - $_SERVER['PHP_SELF'] . '?' . SID . '&', + $_SERVER['PHP_SELF'] . '?', $myrow['loccode']); } @@ -399,11 +397,11 @@ if (isset($SelectedLocation)) { echo '<a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Records') . '</a>'; } -echo "<p>"; +echo '<br />'; if (!isset($_GET['delete'])) { - echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedLocation)) { @@ -451,8 +449,8 @@ $_POST['Managed'] = $myrow['managed']; - echo "<input type=hidden name=SelectedLocation VALUE=" . $SelectedLocation . '>'; - echo "<input type=hidden name=LocCode VALUE=" . $_POST['LocCode'] . '>'; + echo '<input type=hidden name=SelectedLocation VALUE="' . $SelectedLocation . '>'; + echo '<input type=hidden name=LocCode VALUE="' . $_POST['LocCode'] . '>'; echo '<table class=selection>'; echo '<tr><th colspan=2><font size=3 color=blue>'._('Amend Location details').'</font></th></tr>'; echo '<tr><td>' . _('Location Code') . ':</td><td>'; Modified: trunk/MRPReschedules.php =================================================================== --- trunk/MRPReschedules.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/MRPReschedules.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -46,9 +46,9 @@ $title = _('MRP Reschedules') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The MRP reschedules could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); - echo "<br><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$sql"; + echo '<br>' . $sql; } include('includes/footer.inc'); exit; @@ -58,9 +58,9 @@ $title = _('MRP Reschedules') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('No MRP reschedule retrieved'), 'warn'); - echo "<br><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$sql"; + echo '<br>' . $sql; } include('includes/footer.inc'); exit; @@ -114,32 +114,7 @@ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, $Right_Margin); } -/*Print out the grand totals */ - //$pdf->addTextWrap(80,$YPos,260-$Left_Margin,$FontSize,_('Grand Total Value'), 'right'); - //$DisplayTotalVal = number_format($Tot_Val,2); - //$pdf->addTextWrap(500,$YPos,60,$FontSize,$DisplayTotalVal, 'right'); -/* UldisN - $pdfcode = $pdf->output(); - $len = strlen($pdfcode); - if ($len<=20){ - $title = _('Print MRP Reschedules Error'); - include('includes/header.inc'); - prnMsg(_('There were no items with due dates different from MRP dates'),'error'); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; - include('includes/footer.inc'); - exit; - } else { - header('Content-type: application/pdf'); - header("Content-Length: " . $len); - header('Content-Disposition: inline; filename=MRPReschedules.pdf'); - header('Expires: 0'); - header('Cache-Control: private, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->Output('MRPRescedules.pdf', 'I'); - } -*/ $pdf->OutputD($_SESSION['DatabaseName'] . '_MRPReschedules_' . date('Y-m-d').'.pdf');//UldisN $pdf->__destruct(); //UldisN @@ -151,19 +126,19 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Stock') . '" alt="" />' . ' ' . $title . '</p>'; - echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table class=selection>"; + echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table class=selection>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('Print Option') . ":</td><td><select name='Fill'>"; - echo "<option selected value='yes'>" . _('Print With Alternating Highlighted Lines'); - echo "<option value='no'>" . _('Plain Print'); + echo '<tr><td>' . _('Print Option') . ':</td><td><select name="Fill">'; + echo '<option selected value="yes">' . _('Print With Alternating Highlighted Lines'); + echo '<option value="no">' . _('Plain Print'); echo '</select></td></tr>'; - echo '<tr><td>' . _('Selection') . ":</td><td><select name='Selection'>"; - echo "<option selected value='All'>" . _('All')."</option>"; - echo "<option value='WO'>" . _('Work Orders Only')."</option>"; - echo "<option value='PO'>" . _('Purchase Orders Only')."</option>"; + echo '<tr><td>' . _('Selection') . ':</td><td><select name="Selection">'; + echo '<option selected value="All">' . _('All').'</option>'; + echo '<option value="WO">' . _('Work Orders Only').'</option>'; + echo '<option value="PO">' . _('Purchase Orders Only').'</option>'; echo '</select></td></tr>'; - echo "</table><br>"; - echo "<div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; + echo '</table><br>'; + echo '<div class="centre"><input type=submit name="PrintPDF" value="' . _('Print PDF') . '"></div>'; include('includes/footer.inc'); Modified: trunk/OutstandingGRNs.php =================================================================== --- trunk/OutstandingGRNs.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/OutstandingGRNs.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -51,9 +51,9 @@ $title = _('Outstanding GRN Valuation') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg(_('The outstanding GRNs valuation details could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); - echo "<br><a href='" .$rootpath ."/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>".$SQL; + echo '<br>'.$SQL; } include('includes/footer.inc'); exit; @@ -63,9 +63,9 @@ $title = _('Outstanding GRN Valuation') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg(_('No outstanding GRNs valuation details retrieved'), 'warn'); - echo "<br><a href='" .$rootpath ."/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$SQL"; + echo '<br>'.$SQL; } include('includes/footer.inc'); exit; @@ -142,28 +142,7 @@ $LeftOvers = $pdf->addTextWrap(500,$YPos,60,$FontSize,$DisplayTotalVal, 'right'); $pdf->line($Left_Margin, $YPos+$line_height-2,$Page_Width-$Right_Margin, $YPos+$line_height-2); $YPos -=(2*$line_height); -/* UldisN - $pdfcode = $pdf->output(); - $len = strlen($pdfcode); - if ($len<=20){ - $title = _('Outstanding GRNs Valuation Error'); - include('includes/header.inc'); - prnMsg(_('There were no GRNs with any value to print out for the specified supplier range'),'info'); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; - include('includes/footer.inc'); - exit; - } else { - header('Content-type: application/pdf'); - header('Content-Length: ' . $len); - header('Content-Disposition: inline; filename=OSGRNsValuation.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->Output('OutstandingGRNs.pdf','I'); - } -*/ $pdf->OutputD($_SESSION['DatabaseName'] . '_OSGRNsValuation_' . date('Y-m-d').'.pdf');//UldisN $pdf->__destruct(); //UldisN } else { /*The option to print PDF was not hit */ @@ -174,15 +153,15 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; - echo '<form action=' . $_SERVER['PHP_SELF'] . " method='POST'><table class=selection>"; + echo '<form action=' . $_SERVER['PHP_SELF'] . ' method="POST"><table class=selection>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('From Supplier Code') . ":</td> - <td><input type=text name='FromCriteria' value='0'></td></tr>"; - echo '<tr><td>' . _('To Supplier Code'). ":</td> - <td><input type=text name='ToCriteria' value='zzzzzzz'></td></tr>"; + echo '<tr><td>' . _('From Supplier Code') . ':</td> + <td><input type=text name="FromCriteria" value="0"></td></tr>'; + echo '<tr><td>' . _('To Supplier Code'). ':</td> + <td><input type=text name="ToCriteria" value="zzzzzzz"></td></tr>'; - echo "</table><br><div class='centre'><input type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'></div>"; + echo '</table><br><div class="centre"><input type=Submit Name="PrintPDF" Value="' . _('Print PDF') . '"></div>'; include('includes/footer.inc'); Modified: trunk/PDFChequeListing.php =================================================================== --- trunk/PDFChequeListing.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/PDFChequeListing.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -2,9 +2,6 @@ /* $Id$*/ -/* $Revision: 1.13 $ */ - -//$PageSecurity = 3; include('includes/SQL_CommonFunctions.inc'); include ('includes/session.inc'); @@ -33,37 +30,40 @@ prnMsg($msg,'error'); } - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection> <tr> - <td>' . _('Enter the date from which cheques are to be listed') . ":</td> - <td><input type=text name='FromDate' maxlength=10 size=10 class=date alt='".$_SESSION['DefaultDateFormat']."' VALUE='" . Date($_SESSION['DefaultDateFormat']) . "'></td> - </tr>"; - echo '<tr><td>' . _('Enter the date to which cheques are to be listed') . ":</td> - <td><input type=text name='ToDate' maxlength=10 size=10 class=date alt='".$_SESSION['DefaultDateFormat']."' VALUE='" . Date($_SESSION['DefaultDateFormat']) . "'></td> - </tr>"; + <td>' . _('Enter the date from which cheques are to be listed') . ':</td> + <td><input type="text" name="FromDate" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + </tr>'; + echo '<tr><td>' . _('Enter the date to which cheques are to be listed') . ':</td> + <td><input type=text name="ToDate" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + </tr>'; echo '<tr><td>' . _('Bank Account') . '</td><td>'; - $sql = 'SELECT bankaccountname, accountcode FROM bankaccounts'; + $sql = "SELECT bankaccountname, accountcode FROM bankaccounts"; $result = DB_query($sql,$db); - echo "<select name='BankAccount'>"; + echo '<select name="BankAccount">'; while ($myrow=DB_fetch_array($result)){ - echo '<option VALUE=' . $myrow['accountcode'] . '>' . $myrow['bankaccountname']; + echo '<option VALUE=' . $myrow['accountcode'] . '>' . $myrow['bankaccountname'] . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('Email the report off') . ":</td><td><select name='Email'>"; - echo "<option selected VALUE='No'>" . _('No'); - echo "<option VALUE='Yes'>" . _('Yes'); - echo "</select></td></tr></table><br><div class='centre'><input type=submit name='Go' VALUE='" . _('Create PDF') . "'></div>"; + echo '<tr><td>' . _('Email the report off') . ':</td> + <td><select name="Email">'; + echo '<option selected value="No">' . _('No') . '</option>'; + echo '<option value="Yes">' . _('Yes') . '</option>'; + echo '</select></td> + </tr> + </table> + <br /><div class="centre"><input type=submit name="Go" value="' . _('Create PDF') . '"></div>'; - include('includes/footer.inc'); exit; } else { @@ -71,7 +71,6 @@ include('includes/ConnectDB.inc'); } - $SQL = "SELECT bankaccountname FROM bankaccounts WHERE accountcode = '" .$_POST['BankAccount'] . "'"; @@ -91,14 +90,13 @@ AND transdate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND transdate <='" . FormatDateForSQL($_POST['ToDate']) . "'"; - $Result=DB_query($SQL,$db,'','',false,false); if (DB_error_no($db)!=0){ $title = _('Payment Listing'); include('includes/header.inc'); prnMsg(_('An error occurred getting the payments'),'error'); if ($Debug==1){ - prnMsg(_('The SQL used to get the receipt header information that failed was') . ':<br>' . $SQL,'error'); + prnMsg(_('The SQL used to get the receipt header information that failed was') . ':<br />' . $SQL,'error'); } include('includes/footer.inc'); exit; @@ -124,7 +122,7 @@ while ($myrow=DB_fetch_array($Result)){ - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format(-$myrow['amount'],2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format(-$myrow['amount'],2), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,90,$FontSize,$myrow['ref'], 'left'); $sql = "SELECT accountname, @@ -160,12 +158,12 @@ } DB_free_result($GLTransResult); - $YPos -= ($line_height); - $TotalCheques = $TotalCheques - $myrow['amount']; + $YPos -= ($line_height); + $TotalCheques = $TotalCheques - $myrow['amount']; - if ($YPos - (2 *$line_height) < $Bottom_Margin){ + if ($YPos - (2 *$line_height) < $Bottom_Margin){ /*Then set up a new page */ - $PageNumber++; + $PageNumber++; include ('includes/PDFChequeListingPageHeader.inc'); } /*end of new page header */ } /* end of while there are customer receipts in the batch to print */ @@ -175,21 +173,9 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format($TotalCheques,2), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,300,$FontSize,_('TOTAL') . ' ' . $Currency . ' ' . _('CHEQUES'), 'left'); -/* UldisN -$pdfcode = $pdf->output(); -$len = strlen($pdfcode); -header('Content-type: application/pdf'); -header('Content-Length: ' . $len); -header('Content-Disposition: inline; filename=ChequeListing.pdf'); -header('Expires: 0'); -header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); -header('Pragma: public'); - -$pdf->stream(); -*/ $ReportFileName = $_SESSION['DatabaseName'] . '_ChequeListing_' . date('Y-m-d').'.pdf'; -$pdf->OutputD($ReportFileName);//UldisN -$pdf->__destruct(); //UldisN +$pdf->OutputD($ReportFileName); +$pdf->__destruct(); if ($_POST['Email']=='Yes'){ if (file_exists($_SESSION['reports_dir'] . '/'.$ReportFileName)){ unlink($_SESSION['reports_dir'] . '/'.$ReportFileName); Modified: trunk/PDFCustTransListing.php =================================================================== --- trunk/PDFCustTransListing.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/PDFCustTransListing.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -28,9 +28,9 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection> <tr> - <td>' . _('Enter the date for which the transactions are to be listed') . ":</td> - <td><input type=text name='Date' maxlength=10 size=10 class=date alt='" . $_SESSION['DefaultDateFormat'] . "' value='" . Date($_SESSION['DefaultDateFormat']) . "'></td> - </tr>"; + <td>' . _('Enter the date for which the transactions are to be listed') . ':</td> + <td><input type=text name="Date" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + </tr>'; echo '<tr><td>' . _('Transaction type') . '</td><td>'; Modified: trunk/PDFLowGP.php =================================================================== --- trunk/PDFLowGP.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/PDFLowGP.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -2,9 +2,6 @@ /* $Id$*/ -/* $Revision: 1.15 $ */ - -//$PageSecurity = 2; include('includes/session.inc'); if (!isset($_POST['FromCat']) OR $_POST['FromCat']=='') { @@ -60,9 +57,9 @@ include('includes/header.inc'); prnMsg(_('The low GP items could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); - echo "<br><a href='" .$rootpath ."/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$SQL"; + echo '<br />' . $SQL; } include('includes/footer.inc'); exit; @@ -72,9 +69,9 @@ include('includes/header.inc'); prnMsg(_('No low GP items retrieved'), 'warn'); - echo "<br><a href='" . $rootpath . "/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$SQL"; + echo '<br />' . $SQL; } include('includes/footer.inc'); exit; @@ -112,31 +109,9 @@ $FontSize =10; $YPos -= (2*$line_height); -/* UldisN - $pdfcode = $pdf->output(); - $len = strlen($pdfcode); + $pdf->OutputD($_SESSION['DatabaseName'] . '_LowGPSales_' . date('Y-m-d') . '.pdf'); + $pdf->__destruct(); - if ($len<=20){ - $title = _('Print Low GP Items Error'); - include('includes/header.inc'); - prnMsg (_('There were no items below print out for the location specified'),'error'); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; - include('includes/footer.inc'); - exit; - } else { - header('Content-type: application/pdf'); - header('Content-Length: ' . $len); - header('Content-Disposition: inline; filename=LowGPSales.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->Output('PDFLowGP.pdf', 'I'); - } -*/ - $pdf->OutputD($_SESSION['DatabaseName'] . '_LowGPSales_' . date('Y-m-d') . '.pdf');//UldisN - $pdf->__destruct(); //UldisN - } else { /*The option to print PDF was not hit */ include('includes/header.inc'); @@ -150,22 +125,24 @@ $_POST['FromDate']=Date($_SESSION['DefaultDateFormat']); $_POST['ToDate']=Date($_SESSION['DefaultDateFormat']); $_POST['GPMin']=0; - echo '<form action=' . $_SERVER['PHP_SELF'] . " method='POST'><table class=selection>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('Sales Made From') . ' (' . _('in the format') . ' ' . $_SESSION['DefaultDateFormat'] . "):</td> - <td><input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='FromDate' size=10 maxlength=10 VALUE='" . $_POST['FromDate'] . "'></td> - </tr>"; + echo '<tr><td>' . _('Sales Made From') . ' (' . _('in the format') . ' ' . $_SESSION['DefaultDateFormat'] . '):</td> + <td><input type=text class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" size=10 maxlength="10" value="' . $_POST['FromDate'] . '"></td> + </tr>'; - echo '<tr><td>' . _('Sales Made To') . ' (' . _('in the format') . ' ' . $_SESSION['DefaultDateFormat'] . "):</td> - <td><input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='ToDate' size=10 maxlength=10 VALUE='" . $_POST['ToDate'] . "'></td> - </tr>"; + echo '<tr><td>' . _('Sales Made To') . ' (' . _('in the format') . ' ' . $_SESSION['DefaultDateFormat'] . '):</td> + <td><input type=text class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" size="10" maxlength="10" value="' . $_POST['ToDate'] . '"></td> + </tr>'; - echo '<tr><td>' . _('Show sales with GP') . '%' . _('below') . ":</td> - <td><input type=text class='number' name='GPMin' maxlength=3 size=3 value=" . $_POST['GPMin'] . "></td> - </tr>"; + echo '<tr><td>' . _('Show sales with GP') . '%' . _('below') . ':</td> + <td><input type=text class="number" name="GPMin" maxlength="3" size="3" value="' . $_POST['GPMin'] . '"></td> + </tr>'; - echo "</table><br><div class='centre'><input type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'></div>"; + echo '</table> + <br /><div class="centre"><input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>'; } include('includes/footer.inc'); Modified: trunk/PDFOrderStatus.php =================================================================== --- trunk/PDFOrderStatus.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/PDFOrderStatus.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -2,9 +2,6 @@ /* $Id$*/ -/* $Revision: 1.10 $ */ - -//$PageSecurity = 3; include ('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -33,38 +30,45 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' ' . _('Order Status Report') . '</p>'; - echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection><tr><td>' . _('Enter the date from which orders are to be listed') . ":</td><td><input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='FromDate' maxlength=10 size=10 VALUE='" . Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))) . "'></td></tr>"; - echo '<tr><td>' . _('Enter the date to which orders are to be listed') . ":</td><td>"; - echo "<input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='ToDate' maxlength=10 size=10 VALUE='" . Date($_SESSION['DefaultDateFormat']) . "'></td></tr>"; + echo '<table class=selection> + <tr> + <td>' . _('Enter the date from which orders are to be listed') . ':</td> + <td><input type=text class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" maxlength=10 size=10 value="' . Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))) . '"></td> + </tr>'; + echo '<tr><td>' . _('Enter the date to which orders are to be listed') . ':</td><td>'; + echo '<input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" maxlength=10 size=10 value="' . Date($_SESSION['DefaultDateFormat']) . '"></td></tr>'; echo '<tr><td>' . _('Inventory Category') . '</td><td>'; $sql = "SELECT categorydescription, categoryid FROM stockcategory WHERE stocktype<>'D' AND stocktype<>'L'"; $result = DB_query($sql,$db); - echo "<select name='CategoryID'>"; - echo "<option selected VALUE='All'>" . _('Over All Categories'); + echo '<select name="CategoryID">'; + echo '<option selected value="All">' . _('Over All Categories') . '</option>'; while ($myrow=DB_fetch_array($result)){ - echo '<option value=' . $myrow['categoryid'] . '>' . $myrow['categorydescription']; + echo '<option value=' . $myrow['categoryid'] . '>' . $myrow['categorydescription'] . '</option>'; } echo '</select></td></tr>'; echo '<tr><td>' . _('Inventory Location') . ':</td><td><select name="Location">'; echo '<option selected value="All">' . _('All Locations'); - $result= DB_query('SELECT loccode, locationname FROM locations',$db); + $result= DB_query("SELECT loccode, locationname FROM locations",$db); while ($myrow=DB_fetch_array($result)){ - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('Back Order Only') . ":</td><td><select name='BackOrders'>"; - echo "<option selected VALUE='Yes'>" . _('Only Show Back Orders'); - echo "<option VALUE='No'>" . _('Show All Orders'); - echo "</select></td></tr></table><br><div class='centre'><input type=submit name='Go' value='" . _('Create PDF') . "'></div>"; + echo '<tr><td>' . _('Back Order Only') . ':</td><td><select name="BackOrders">'; + echo '<option selected value="Yes">' . _('Only Show Back Orders') . '</option>'; + echo '<option value="No">' . _('Show All Orders') . '</option>'; + echo '</select></td> + </tr> + </table> + <br /><div class="centre"><input type=submit name="Go" value="' . _('Create PDF') . '"></div>'; include('includes/footer.inc'); exit; @@ -229,10 +233,10 @@ } if ($_POST['BackOrders']=='Yes'){ - $sql .= ' AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced >0'; + $sql .= " AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced >0"; } -$sql .= ' ORDER BY salesorders.orderno'; +$sql .= " ORDER BY salesorders.orderno"; $Result=DB_query($sql,$db,'','',false,false); //dont trap errors here @@ -332,23 +336,11 @@ $YPos -= ($line_height); if ($YPos - (2 *$line_height) < $Bottom_Margin){ /*Then set up a new page */ - $PageNumber++; - include ('includes/PDFOrderStatusPageHeader.inc'); + $PageNumber++; + include ('includes/PDFOrderStatusPageHeader.inc'); $OrderNo=0; } /*end of new page header */ } /* end of while there are delivery differences to print */ -/* UldisN -$pdfcode = $pdf->output(); -$len = strlen($pdfcode); -header('Content-type: application/pdf'); -header('Content-Length: ' . $len); -header('Content-Disposition: inline; filename=OrderStatus.pdf'); -header('Expires: 0'); -header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); -header('Pragma: public'); - -$pdf->stream(); -*/ $pdf->OutputD($_SESSION['DatabaseName'] . '_OrderStatus_' . date('Y-m-d') . '.pdf');//UldisN $pdf->__destruct(); //UldisN ?> \ No newline at end of file Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/PDFPrintLabel.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -17,7 +17,7 @@ // If there is no label templates, the user could select to set up a new one if ($AllLabels==null) { - echo '<br/><br/>'; + abortMsg( _('There isn\'t any label template to select for printing. Click') . ' <a href="Labels.php"><b>' . _('HERE'). '</b></a> '. _('to set up a new one') ); } @@ -49,9 +49,9 @@ $DocumentPaper='LETTER'; $DocumentOrientation='P'; // Correccion para la version trunk :( include('includes/PDFStarter.php'); - if ($Version>="3.12") + if ($Version>='3.12') $pdf->setPageFormat($formatPage); - $ok = printLabels( + $ok = printLabels( $dimensions, $lines, intval($_POST['QtyByItem']), Modified: trunk/PDFStockCheckComparison.php =================================================================== --- trunk/PDFStockCheckComparison.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/PDFStockCheckComparison.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -168,7 +168,7 @@ '" . $SQLAdjustmentDate . "', '" . $PeriodNo . "', '" . $StockGLCodes['stockact'] . "', - '" . $myrow['standardcost'] * $StockQtyDifference . ", '" . $myrow['stockid'] . " x " . $StockQtyDifference . " @ " . $myrow['standardcost'] . " - " . _('Inventory Check') . "')"; + '" . $myrow['standardcost'] * $StockQtyDifference . "', '" . $myrow['stockid'] . " x " . $StockQtyDifference . " @ " . $myrow['standardcost'] . " - " . _('Inventory Check') . "')"; $Result = DB_query($SQL,$db, $ErrMsg, $DbgMsg, true); } //END INSERT GL TRANS @@ -222,7 +222,7 @@ if ($Location!=$CheckItemRow['loccode']){ $FontSize=14; - if ($Location!=''){ /*Then it's NOT the first time round */ + if ($Location!=''){ /*Then it is NOT the first time round */ /*draw a line under the Location*/ $pdf->line($Left_Margin, $YPos-2,$Page_Width-$Right_Margin, $YPos-2); $YPos -=$line_height; @@ -236,7 +236,7 @@ if ($Category!=$CheckItemRow['categoryid']){ $FontSize=12; - if ($Category!=''){ /*Then it's NOT the first time round */ + if ($Category!=''){ /*Then it is NOT the first time round */ /*draw a line under the CATEGORY TOTAL*/ $pdf->line($Left_Margin, $YPos-2,$Page_Width-$Right_Margin, $YPos-2); $YPos -=$line_height; @@ -335,10 +335,10 @@ if ($_POST['ReportOrClose']=='ReportAndClose'){ //need to print the report first before this but don't risk re-adjusting all the stock!! - $sql = 'TRUNCATE TABLE stockcheckfreeze'; + $sql = "TRUNCATE TABLE stockcheckfreeze"; $result = DB_query($sql,$db); - $sql = 'TRUNCATE TABLE stockcounts'; + $sql = "TRUNCATE TABLE stockcounts"; $result = DB_query($sql,$db); } @@ -356,11 +356,11 @@ echo '<tr><td>' . _('Choose Option'). ':</font></td><td><select name="ReportOrClose">'; if ($_POST['ReportOrClose']=='ReportAndClose'){ - echo '<option selected VALUE="ReportAndClose">'. _('Report and Close the Inventory Comparison Processing Adjustments As Necessary'); - echo '<option VALUE="ReportOnly">'. _('Report The Inventory Comparison Differences Only - No Adjustments'); + echo '<option selected VALUE="ReportAndClose">'. _('Report and Close the Inventory Comparison Processing Adjustments As Necessary') . '</option>'; + echo '<option VALUE="ReportOnly">'. _('Report The Inventory Comparison Differences Only - No Adjustments') . '</option>'; } else { - echo '<option selected VALUE="ReportOnly">' . _('Report The Inventory Comparison Differences Only - No Adjustments'); - echo '<option VALUE="ReportAndClose">' . _('Report and Close the Inventory Comparison Processing Adjustments As Necessary'); + echo '<option selected VALUE="ReportOnly">' . _('Report The Inventory Comparison Differences Only - No Adjustments') . '</option>'; + echo '<option VALUE="ReportAndClose">' . _('Report and Close the Inventory Comparison Processing Adjustments As Necessary') . '</option>'; } echo '</select></td></tr>'; @@ -369,11 +369,11 @@ echo '<tr><td>'. _('Action for Zero Counts') . ':</td><td><select name="ZeroCounts">'; if ($_POST['ZeroCounts'] =='Adjust'){ - echo '<option selected VALUE="Adjust">'. _('Adjust System stock to Nil'); - echo '<option VALUE="Leave">' . _("Don't Adjust System stock to Nil"); + echo '<option selected VALUE="Adjust">'. _('Adjust System stock to Nil') . '</option>'; + echo '<option VALUE="Leave">' . _('Do not Adjust System stock to Nil') . '</option>'; } else { - echo '<option VALUE="Adjust">'. _('Adjust System stock to Nil'); - echo '<option selected VALUE="Leave">' . _("Don't Adjust System stock to Nil"); + echo '<option VALUE="Adjust">'. _('Adjust System stock to Nil') . '</option>'; + echo '<option selected VALUE="Leave">' . _('Do not Adjust System stock to Nil') . '</option>'; } echo '</table><br><div class="centre"><input type=Submit Name="PrintPDF" Value="' . _('Print PDF'). '"></div>'; Modified: trunk/POReport.php =================================================================== --- trunk/POReport.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/POReport.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -6,7 +6,6 @@ // Inquiry on Purchase Orders // If Date Type is Order, the main file is purchorderdetails // If Date Type is Delivery, the main file is grns -//$PageSecurity=2; include('includes/session.inc'); $title = _('Purchase Order Report'); @@ -1421,49 +1420,48 @@ echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection>'; + echo '<table class="selection">'; echo '<tr><td>' . _('Report Type') . ':</td>'; - echo "<td><select name='ReportType'>"; - echo "<option selected value='Detail'>" . _('Detail'); - echo "<option value='Summary'>" . _('Summary'); + echo '<td><select name="ReportType">'; + echo '<option selected value="Detail">' . _('Detail') . '</option>'; + echo '<option value="Summary">' . _('Summary') . '</option>'; echo '</select></td><td> </td></tr>'; echo '<tr><td>' . _('Date Type') . ':</td>'; - echo "<td><select name='DateType'>"; - echo "<option selected value='Order'>" . _('Order Date'); - echo "<option value='Delivery'>" . _('Delivery Date'); + echo '<td><select name="DateType">'; + echo '<option selected value="Order">' . _('Order Date') . '</option>'; + echo '<option value="Delivery">' . _('Delivery Date') . '</option>'; echo '</select></td><td> </td></tr>'; echo '<tr> - <td>' . _('Date Range') . ":</td> - <td><input type='Text' class=date alt='".$_SESSION['DefaultDateFormat']."' name='FromDate' size=10 maxlength=10 value=" . $_POST['FromDate'] . - '> ' . _('To') . ":   - <input type='Text' class=date alt='".$_SESSION['DefaultDateFormat']."' name='ToDate' size=10 maxlength=10 value=" . $_POST['ToDate'] . "></td> - </tr>"; + <td>' . _('Date Range') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" size="10" maxlength="10" value="' . $_POST['FromDate'] .'"> ' . _('To') . ':   + <input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" size="10" maxlength="10" value="' . $_POST['ToDate'] . '"></td> + </tr>'; echo '<tr><td>' . _('Part Number') . ':</td>'; - echo "<td><select name='PartNumberOp'>"; - echo "<option selected value='Equals'>" . _('Equals'); - echo "<option value='LIKE'>" . _('Begins With'); + echo '<td><select name="PartNumberOp">'; + echo '<option selected value="Equals">' . _('Equals') . '</option>'; + echo '<option value="LIKE">' . _('Begins With') . '</option>'; echo '</select>'; - echo "  <input type='Text' name='PartNumber' size=20 maxlength=20 value="; + echo '  <input type="text" name="PartNumber" size="20" maxlength="20" value="'; if (isset($_POST['PartNumber'])) { - echo $_POST['PartNumber'] . "></td></tr>"; + echo $_POST['PartNumber'] . '"></td></tr>'; } else { - echo "></td></tr>"; + echo '"></td></tr>'; } echo '<tr><td>' . _('Supplier Number') . ':</td>'; - echo "<td><select name='SupplierIdOp'>"; - echo "<option selected value='Equals'>" . _('Equals'); - echo "<option value='LIKE'>" . _('Begins With'); + echo '<td><select name="SupplierIdOp">'; + echo '<option selected value="Equals">' . _('Equals') . '</option>'; + echo '<option value="LIKE">' . _('Begins With') . '</option>'; echo '</select>'; - echo "  <input type='Text' name='SupplierId' size=10 maxlength=10 value="; + echo '  <input type="text" name="SupplierId" size=10 maxlength=10 value="'; if (isset($_POST['SupplierId'])) { - echo $_POST['SupplierId'] . "></td></tr>"; + echo $_POST['SupplierId'] . '"></td></tr>'; } else { - echo "></td></tr>"; + echo '"></td></tr>'; } echo '<tr><td>' . _('Supplier Name') . ':</td>'; @@ -1480,11 +1478,11 @@ echo '<tr><td>' . _('Order Number') . ':</td>'; echo '<td>'._('Equals').':  '; - echo "<input type='Text' name='OrderNo' size=10 maxlength=10 value="; + echo '<input type="text" name="OrderNo" size="10" maxlength="10" value="'; if (isset($_POST['OrderNo'])) { - echo $_POST['OrderNo'] . "></td></tr>"; + echo $_POST['OrderNo'] . '"></td></tr>'; } else { - echo "></td></tr>"; + echo '"></td></tr>'; } echo '<tr><td>' . _('Line Item Status') . ':</td>'; Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/PO_Header.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -331,7 +331,7 @@ $ErrMsg = _('The searched supplier records requested cannot be retrieved because'); $result_SuppSelect = DB_query($SQL,$db,$ErrMsg); - + $SuppliersReturned=DB_num_rows($result_SuppSelect); if (DB_num_rows($result_SuppSelect)==1){ $myrow=DB_fetch_array($result_SuppSelect); $_POST['Select'] = $myrow['supplierid']; @@ -508,6 +508,7 @@ _('Purchase Order') . '" alt="">' . ' ' . _('Purchase Order: Select Supplier') . ''; echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '" method="post" name="choosesupplier">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<input type="hidden" name="SuppliersReturned" value="' . $SuppliersReturned .'" />'; echo '<table cellpadding=3 colspan=4 class=selection> <tr> Modified: trunk/PaymentMethods.php =================================================================== --- trunk/PaymentMethods.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/PaymentMethods.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -34,9 +34,9 @@ //first off validate inputs sensible - if (strpos($_POST['MethodName'],'&')>0 OR strpos($_POST['MethodName'],"'")>0) { + if (ContainsIllegalCharacters($_POST['MethodName'])) { $InputError = 1; - prnMsg( _('The payment method cannot contain the character') . " '&' " . _('or the character') ." '",'error'); + prnMsg( _('The payment method cannot contain illegal characters'),'error'); $Errors[$i] = 'MethodName'; $i++; } Modified: trunk/PcAssignCashToTab.php =================================================================== --- trunk/PcAssignCashToTab.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/PcAssignCashToTab.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -1,8 +1,6 @@ <?php -/* $Revision: 1.0 $ */ +/* $Id$*/ -//$PageSecurity = 6; - include('includes/session.inc'); $title = _('Assignment of Cash to Petty Cash Tab'); include('includes/header.inc'); @@ -45,7 +43,7 @@ if ($_POST['Amount']==0) { $InputError = 1; - prnMsg('<br>' . _('The Amount must be inputed'),'error'); + prnMsg('<br />' . _('The Amount must be inputed'),'error'); $Errors[$i] = 'TabCode'; $i++; } @@ -58,18 +56,18 @@ $Limit=DB_fetch_array($ResultLimit); if (($_POST['CurrentAmount']+$_POST['Amount'])>$Limit['tablimit']){ - prnMsg('<br>' . _('The balance after this assignment would be greater than the specified limit for this PC tab'),'warning'); + prnMsg('<br />' . _('The balance after this assignment would be greater than the specified limit for this PC tab'),'warning'); } if ($InputError !=1 AND isset($SelectedIndex) ) { $sql = "UPDATE pcashdetails - SET date = '".FormatDateForSQL($_POST['Date'])."', - amount = '" . $_POST['Amount'] . "', - authorized = '0000-00-00', - notes = '" . $_POST['Notes'] . "', - receipt = '" . $_POST['Receipt'] . "' - WHERE counterindex = '" . $SelectedIndex . "'"; + SET date = '".FormatDateForSQL($_POST['Date'])."', + amount = '" . $_POST['Amount'] . "', + authorized = '0000-00-00', + notes = '" . $_POST['Notes'] . "', + receipt = '" . $_POST['Receipt'] . "' + WHERE counterindex = '" . $SelectedIndex . "'"; $msg = _('Assignment of cash to PC Tab ') . ' ' . $SelectedTabs . ' ' . _('has been updated'); } elseif ($InputError !=1 ) { @@ -128,11 +126,12 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Search') . '" alt="" />' . ' ' . $title. '</p>'; - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p><table class=selection>'; //Main table - echo '<tr><td>' . _('Petty Cash Tab To Assign Cash') . ":</td><td><select name='SelectedTabs'>"; + echo '<tr><td>' . _('Petty Cash Tab To Assign Cash') . ':</td> + <td><select name="SelectedTabs">'; DB_free_result($result); $SQL = "SELECT tabcode @@ -144,16 +143,16 @@ while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SelectTabs']) and $myrow['tabcode']==$_POST['SelectTabs']) { - echo "<option selected value='"; + echo '<option selected value="'; } else { - echo "<option value='"; + echo '<option value="'; } - echo $myrow['tabcode'] . "'>" . $myrow['tabcode']; + echo $myrow['tabcode'] . '">' . $myrow['tabcode'] . '</option>'; } echo '</select></td></tr>'; echo '</td></tr></table>'; // close main table - echo '<p><div class="centre"><input type=submit name=process VALUE="' . _('Accept') . '"><input type=submit name=Cancel value="' . _('Cancel') . '"></div>'; + echo '<p><div class="centre"><input type=submit name="process" value="' . _('Accept') . '"><input type=submit name="Cancel" value="' . _('Cancel') . '"></div>'; echo '</form>'; } @@ -175,20 +174,6 @@ unset($_POST['Receipt']); } -/* $sql = "SELECT pcashdetails.date, - pcashdetails.codeexpense, - pcexpenses.description - pcashdetails.amount, - pcashdetails.authorized, - pcashdetails.posted, - pcashdetails.notes, - pcashdetails.receipt - FROM pcashdetails, pcexpenses - WHERE pcashdetails.tabcode='$SelectedTabs' - AND pcashdetails.codeexpense = pcexpenses.codeexpense - AND pcashdetails.date >=DATE_SUB(CURDATE(), INTERVAL ".$Days." DAY) - ORDER BY pcashdetails.counterindex Asc"; -*/ if(!isset ($Days)){ $Days=30; } @@ -201,21 +186,21 @@ $result = DB_query($sql,$db); echo '<table class=selection>'; - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo "<tr><th colspan=8>" . _('Detail Of PC Tab Movements For Last ') .': '; - echo "<input type=hidden name='SelectedTabs' value=" . $SelectedTabs . ">"; - echo "<input type=text class=number name='Days' value=" . $Days . " maxlength =3 size=4> Days "; + echo '<tr><th colspan="8">' . _('Detail Of PC Tab Movements For Last ') .': '; + echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; + echo '<input type="text" class="number" name="Days" value="' . $Days . '" maxlength="3" size="4" /> ' . _('Days'); echo '<input type=submit name="Go" value="' . _('Go') . '">'; echo '</th></tr></form>'; - echo "<tr> - <th>" . _('Date') . "</th> - <th>" . _('Expense Code') . "</th> - <th>" . _('Amount') . "</th> - <th>" . _('Authorised') . "</th> - <th>" . _('Notes') . "</th> - <th>" . _('Receipt') . "</th> - </tr>"; + echo '<tr> + <th>' . _('Date') . '</th> + <th>' . _('Expense Code') . '</th> + <th>' . _('Amount') . '</th> + <th>' . _('Authorised') . '</th> + <th>' . _('Notes') . '</th> + <th>' . _('Receipt') . '</th> + </tr>'; $k=0; //row colour counter @@ -239,29 +224,29 @@ $Description['0']='ASSIGNCASH'; } - if (($myrow['authorized'] == "0000-00-00") and ($Description['0'] == 'ASSIGNCASH')){ + if (($myrow['authorized'] == '0000-00-00') and ($Description['0'] == 'ASSIGNCASH')){ // only cash assignations NOT authorized can be modified or deleted - echo "<td>".ConvertSQLDate($myrow['date'])."</td> - <td>".$Description['0']."</td> - <td class=number>".number_format($myrow['amount'],2)."</td> - <td>".ConvertSQLDate($myrow['authorized'])."</td> - <td>".$myrow['notes']."</td> - <td>".$myrow['receipt']."</td> - <td><a href='".$_SERVER['PHP_SELF'] . '?' . SID ."SelectedIndex=".$myrow['counterindex']."&SelectedTabs=" . - $SelectedTabs . "&Days=" . $Days . "&edit=yes'>" . _('Edit') . "</td> - <td><a href='".$_SERVER['PHP_SELF'] . '?' . SID ."SelectedIndex=".$myrow['counterindex']."&SelectedTabs=" . - $SelectedTabs . "&Days=" . $Days . "&delete=yes' onclick=\"return confirm('" . - _('Are you sure you wish to delete this code and the expense it may have set up?') . "');\">" . - _('Delete') . "</td> - </tr>"; + echo '<td>' . ConvertSQLDate($myrow['date']) . '</td> + <td>' . $Description['0'] . '</td> + <td class=number>' . number_format($myrow['amount'],2) . '</td> + <td>' . ConvertSQLDate($myrow['authorized']) . '</td> + <td>' . $myrow['notes'] . '</td> + <td>' . $myrow['receipt'] . '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedIndex=' . $myrow['counterindex'] . '&SelectedTabs=' . + $SelectedTabs . '&Days=' . $Days . '&edit=yes">' . _('Edit') . '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedIndex=' . $myrow['counterindex'] . '&SelectedTabs=' . + $SelectedTabs . '&Days=' . $Days . '&delete=yes" onclick="return confirm("' . + _('Are you sure you wish to delete this code and the expense it may have set up?') . '");">' . + _('Delete') . '</td> + </tr>'; }else{ - echo "<td>".ConvertSQLDate($myrow['date'])."</td> - <td>".$Description['0']."</td> - <td class=number>".number_format($myrow['amount'],2)."</td> - <td>".ConvertSQLDate($myrow['authorized'])."</td> - <td>".$myrow['notes']."</td> - <td>".$myrow['receipt']."</td> - </tr>"; + echo '<td>' . ConvertSQLDate($myrow['date']) . '</td> + <td>' . $Description['0'] . '</td> + <td class=number>' . number_format($myrow['amount'],2).'</td> + <td>' . ConvertSQLDate($myrow['authorized']) . '</td> + <td>' . $myrow['notes'] . '</td> + <td>' . $myrow['receipt'] . '</td> + </tr>'; } } //END WHILE LIST LOOP @@ -277,8 +262,8 @@ $Amount['0']=0; } - echo "<tr><td colspan=2 style=text-align:right ><b>" . _('Current balance') . ":</b></td> - <td>".number_format($Amount['0'],2)."</td></tr>"; + echo '<tr><td colspan="2" style="text-align:right"><b>' . _('Current balance') . ':</b></td> + <td>' . number_format($Amount['0'],2) . '</td></tr>'; echo '</table>'; @@ -290,13 +275,13 @@ $Amount['0']=0; } - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] .'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p><table class=selection>'; //Main table if (isset($_GET['SelectedIndex'])) { - echo "<tr><th colspan=2><font color=blue size=3>"._('Update Cash Assignment')."</font></th></tr>"; + echo '<tr><th colspan="2"><font color=blue size=3>'._('Update Cash Assignment').'</font></th></tr>'; } else { - echo "<tr><th colspan=2><font color=blue size=3>"._('New Cash Assignment')."</font></th></tr>"; + echo '<tr><th colspan="2"><font color=blue size=3>'._('New Cash Assignment').'</font></th></tr>'; } if ( isset($_GET['edit'])) { @@ -312,18 +297,18 @@ $_POST['Notes'] = $myrow['notes']; $_POST['Receipt'] = $myrow['receipt']; - echo "<input type=hidden name='SelectedTabs' value=" . $SelectedTabs . ">"; - echo "<input type=hidden name='SelectedIndex' value=" . $SelectedIndex. ">"; - echo "<input type=hidden name='CurrentAmount' value=" . $Amount[0]. ">"; - echo "<input type=hidden name='Days' value=" .$Days. ">"; + echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; + echo '<input type=hidden name="SelectedIndex" value="' . $SelectedIndex. '">'; + echo '<input type=hidden name="CurrentAmount" value="' . $Amount[0]. '">'; + echo '<input type=hidden name="Days" value="' .$Days. '">'; } /* Ricard: needs revision of this date initialization */ if (!isset($_POST['Date'])) { - $_POST['Date']=Date("d/m/Y"); + $_POST['Date']=Date('d/m/Y'); } - echo '<tr><td>' . _('Cash Assignation Date') . ":</td>"; + echo '<tr><td>' . _('Cash Assignation Date') . ':</td>'; echo '<td><input type=text class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="Date" size=10 maxlength=10 value=' . $_POST['Date'] . '></td></tr>'; @@ -332,23 +317,26 @@ $_POST['Amount']=0; } - echo "<tr><td>" . _('Amount') . ":</td><td><input type='Text' class='number' name='Amount' size='12' maxlength='11' value='" . $_POST['Amount'] . "'></td></tr>"; + echo '<tr><td>' . _('Amount') . ':</td> + <td><input type="text" class="number" name="Amount" size="12" maxlength="11" value="' . $_POST['Amount'] . '"></td></tr>'; if (!isset($_POST['Notes'])) { $_POST['Notes']=''; } - echo "<tr><td>" . _('Notes') . ":</td><td><input type='Text' name='Notes' size=50 maxlength=49 value='" . $_POST['Notes'] . "'></td></tr>"; + echo '<tr><td>' . _('Notes') . ':</td> + <td><input type="text" name="Notes" size=50 maxlength=49 value="' . $_POST['Notes'] . '"></td></tr>'; if (!isset($_POST['Receipt'])) { $_POST['Receipt']=''; } - echo "<tr><td>" . _('Receipt') . ":</td><td><input type='Text' name='Receipt' size=50 maxlength=49 value='" . $_POST['Receipt'] . "'></td></tr>"; + echo '<tr><td>' . _('Receipt') . ':</td> + <td><input type="text" name="Receipt" size="50" maxlength="49" value="' . $_POST['Receipt'] . '"></td></tr>'; - echo "<input type=hidden name='CurrentAmount' value=" . $Amount['0']. ">"; - echo "<input type=hidden name='SelectedTabs' value=" . $SelectedTabs . ">"; - echo "<input type=hidden name='Days' value=" .$Days. ">"; + echo '<input type=hidden name="CurrentAmount" value="' . $Amount['0']. '">'; + echo '<input type=hidden name="SelectedTabs" value="' . $SelectedTabs . '">'; + echo '<input type=hidden name="Days" value="' .$Days. '">'; echo '</td></tr></table>'; // close main table Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2011-04-14 10:28:52 UTC (rev 4550) +++ trunk/PcAuthorizeExpenses.php 2011-04-16 06:20:56 UTC (rev 4551) @@ -1,7 +1,6 @@ <?php +/* $Id$*/ -/* $Id$ */ - include('includes/session.inc'); $title = _('Authorization of Petty Cash Expenses'); include('includes/header.inc'); @@ -47,9 +46,9 @@ $Days=30; } echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; - echo '<br><table class=selection>'; - echo '<tr><th colspan="7">' . _('Detail Of Movement For Last ') .': '; - echo '<input type="text" class="number" name="Days" value="' . $Days . '" maxlength ="3" size="4"> ' ._('Days'); + echo '<br /><table class=selection>'; + echo '<tr><th colspan=7>' . _('Detail Of Movement For Last ') .': '; + echo '<input type="text" class="number" name="Days" value="' . $Days . '" maxlength="3" size="4" />' . _('Days'); echo '<input type=submit name="Go" value="' . _('Go') . '"></tr></th>'; echo '</form>'; @@ -77,14 +76,14 @@ $result = DB_query($sql,$db); echo '<tr> - <th>' . _('Date') . '</th> - <th>' . _('Expense Code') . '</th> - <th>' . _('Amount') . '</th> - <th>' . _('Posted') . '</th> - <th>' . _('Notes') . '</th> - <th>' . _('Receipt') . '</th> - <th>' . _('Authorized') . '</th> - </tr>'; + <th>' . _('Date') . '</th> + <th>' . _('Expense Code') . '</th> + <th>' . _('Amount') . '</th> + <th>' . _('Posted') . '</th> + <th>' . _('Notes') . '</th> + <th>' . _('Receipt') . '</th> + <th>' . _('Authorized') . '</th> + </tr>'; $k=0; //row colour counter echo'<form action="PcAuthorizeExpenses.php" method="POST" name="'._('update').'">'; @@ -93,7 +92,7 @@ while ($myrow=DB_fetch_array($result)) { //update database if update pressed - if ((isset($_POST['submit']) AND $_POST['submit']==_('Update')) AND isset($_POST[$myrow['counterindex']])){ + if ((isset($_POST['submit']) and $_POST['submit']=='Update') AND isset($_POST[$myrow['counterindex']])){ $PeriodNo = GetPeriod(ConvertSQLDate($myrow['date']), $db); @@ -123,90 +122,88 @@ $typeno = GetNextTransNo($type,$db); //build narrative - $narrative= _('PettyCash') . ' - ' . $myrow['tabcode'] . ' - ' . $myrow['codeexpense'] . ' - ' . DB_escape_string($myrow['notes']) . ' - '.$myrow['receipt']; + $narrative= _('PettyCash') . ' - '.$myrow['tabcode'] . ' - ' . $myrow['codeexpense'] . ' - ' . $myrow['notes'] . ' - ' . $myrow['receipt']; //insert to gltrans DB_Txn_Begin($db); - $sqlFrom="INSERT INTO `gltrans` - (`counterindex`, - `type`, - `typeno`, - `chequeno`, - `trandate`, - `periodno`, - `account`, - `narrative`, - `amount`, - `posted`, - `jobref`, - `tag`) - VALUES (NULL, - '".$type."', - '".$typeno."', - 0, - '".$myrow['date']."', - '".$PeriodNo."', - '".$AccountFrom."', - '".$narrative."', - '".-$Amount."', - 0, - '', - 0)"; - + $sqlFrom="INSERT INTO `gltrans` (`counterindex`, + `type`, + `typeno`, + `chequeno`, + `trandate`, + `periodno`, + `account`, + `narrative`, + `amount`, + `posted`, + `jobref`, + `tag`) + VALUES (NULL, + '".$type."', + '".$typeno."', + 0, + '".$myrow['date']."', + '".$PeriodNo."', + '".$AccountFrom."', + '". DB_escape_string($narrative) ."', + '".-$Amount."', + 0, + '', + 0)"; + $ResultFrom = DB_Query($sqlFrom, $db, '', '', true); - $sqlTo="INSERT INTO `gltrans` - (`counterindex`, - `type`, - `typeno`, - `chequeno`, - `trandate`, - `periodno`, - `account`, - `narrative`, - `amount`, - `posted`, - `jobref`, - `tag`) - VALUES (NULL, - '".$type."', - '".$typeno."', - 0, - '".$myrow['date']."', - '".$PeriodNo."', - '".$AccountTo."', - '".$narrative."', - '".$Amount."', - 0, - '', - 0)"; - + $sqlTo="INSERT INTO `gltrans` (`counterindex`, + `type`, + `typeno`, + `chequeno`, + `trandate`, + `periodno`, + `account`, + `narrative`, + `amount`, + `posted`, + `jobref`, + `tag`) + VALUES (NULL, + '".$type."', + '".$typeno."', + 0, + '".$myrow['date']."', + '".$PeriodNo."', + '".$AccountTo."', + '" . DB_escape_string($narrative) . "', + '".$Amount."', + 0, + '', + 0)"; + $ResultTo = DB_Query($sqlTo, $db, '', '', true); if ($myrow['codeexpense'] == 'ASSIGNCASH'){ // if it's a cash assignation we need to updated banktrans table as well. $ReceiptTransNo = GetNextTransNo( 2, $db); $SQLBank= "INSERT INTO banktrans (transno, - type, - bankact, - ref, - exrate, - functionalexrate, - transdate, - banktranstype, - amount, - currcode) - VALUES ('". $ReceiptTransNo . "', - 1, - '" . $AccountFrom . "', - '" . $narrative . "', - 1, - '" . $myrow['rate'] . "', - '" . $myrow['date'] . "'... [truncated message content] |
From: <dai...@us...> - 2011-04-14 10:28:59
|
Revision: 4550 http://web-erp.svn.sourceforge.net/web-erp/?rev=4550&view=rev Author: daintree Date: 2011-04-14 10:28:52 +0000 (Thu, 14 Apr 2011) Log Message: ----------- variosu Modified Paths: -------------- trunk/CustomerAllocations.php trunk/FixedAssetTransfer.php trunk/GeocodeSetup.php trunk/WorkOrderReceive.php trunk/Z_index.php Removed Paths: ------------- trunk/Z_PriceChanges.php Modified: trunk/CustomerAllocations.php =================================================================== --- trunk/CustomerAllocations.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/CustomerAllocations.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,5 +1,5 @@ <?php -/* $Revision: 1.30 $ */ + /* $Id$*/ /* @@ -10,7 +10,6 @@ */ include('includes/DefineCustAllocsClass.php'); -//$PageSecurity = 3; include('includes/session.inc'); $title = _('Customer Receipt') . '/' . _('Credit Note Allocations'); include('includes/header.inc'); @@ -70,7 +69,7 @@ if ($TotalAllocated + $_SESSION['Alloc']->TransAmt > 0.008) { prnMsg(_('Allocation could not be processed because the amount allocated is more than the').' ' . - $_SESSION['Alloc']->TransTypeName . ' '._('being allocated') . '<br>' . _('Total allocated').' = ' . + $_SESSION['Alloc']->TransTypeName . ' '._('being allocated') . '<br />' . _('Total allocated').' = ' . $TotalAllocated . ' '._('and the total amount of the') .' ' . $_SESSION['Alloc']->TransTypeName . ' '. _('was').' ' . -$_SESSION['Alloc']->TransAmt,'error'); $InputError=1; @@ -324,22 +323,22 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Allocate Receipt') . '" alt="" />' . ' ' . _('Allocate Receipts') . '</p>'; - $TableHeader = "<tr> - <th>" . _('Trans Type') . "</th> - <th>" . _('Customer') . "</th> - <th>" . _('Cust No') . "</th> - <th>" . _('Number') . "</th> - <th>" . _('Date') . "</th> - <th>" . _('Total') . "</th> - <th>" . _('To Alloc') . "</th> - <th>" . _('Action') . "</th> - </tr>"; + $TableHeader = '<tr> + <th>' . _('Trans Type') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Cust No') . '</th> + <th>' . _('Number') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Total') . '</th> + <th>' . _('To Alloc') . '</th> + <th>' . _('Action') . '</th> + </tr>'; if (isset($_POST['AllocTrans'])) { // Page called with trans number - echo "<form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "' method=post>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo "<input type=hidden name='AllocTrans' value=" . $_POST['AllocTrans'] . '>'; + echo '<input type=hidden name="AllocTrans" value="' . $_POST['AllocTrans'] . '" />'; // Show trans already allocated and potential new allocations @@ -347,20 +346,20 @@ echo '<tr><th colspan=7><div class="centre"><font color=blue><b>' . $_SESSION['Alloc']->DebtorNo . ' - ' . $_SESSION['Alloc']->CustomerName . '</b></div>'; if ($_SESSION['Alloc']->TransExRate != 1) { - echo '<br>'._('Amount in customer currency').' <b>' . + echo '<br />'._('Amount in customer currency').' <b>' . number_format(-$_SESSION['Alloc']->TransAmt,2) . '</b><i> ('._('converted into local currency at an exchange rate of'). ' ' . $_SESSION['Alloc']->TransExRate . ')</i>'; } - echo "</th></tr><tr> - <th>" . _('Trans') . '<br>' . _('Type') . "</th> - <th>" . _('Trans') . '<br>' . _('Number') . "</th> - <th>" . _('Trans') . '<br>' . _('Date') . "</th> - <th>" . _('Total') . '<br>' . _('Amount') . "</th> - <th>" . _('Yet to') . '<br>' . _('Allocate') . "</th> - <th>" . _('This') . '<br>' . _('Allocation') . "</th> - <th>" . _('Running') . '<br>' . _('Balance') . "</th> - </tr>"; + echo '</th></tr><tr> + <th>' . _('Trans') . '<br />' . _('Type') . '</th> + <th>' . _('Trans') . '<br />' . _('Number') . '</th> + <th>' . _('Trans') . '<br />' . _('Date') . '</th> + <th>' . _('Total') . '<br />' . _('Amount') . '</th> + <th>' . _('Yet to') . '<br />' . _('Allocate') . '</th> + <th>' . _('This') . '<br />' . _('Allocation') . '</th> + <th>' . _('Running') . '<br />' . _('Balance') . '</th> + </tr>'; $Counter = 0; $TotalAllocated = 0; @@ -380,37 +379,37 @@ $curTrans = " "; } - echo "<td>" . $AllocnItem->TransType . "</td> - <td>" . $AllocnItem->TypeNo . "</td> - <td class=number>" . $AllocnItem->TransDate . "</td> - <td class=number>" . number_format($AllocnItem->TransAmount,2) . "</td> - <td class=number>" . number_format($YetToAlloc,2) . "</td>"; + echo '<td>' . $AllocnItem->TransType . '</td> + <td>' . $AllocnItem->TypeNo . '</td> + <td class=number>' . $AllocnItem->TransDate . '</td> + <td class=number>' . number_format($AllocnItem->TransAmount,2) . '</td> + <td class=number>' . number_format($YetToAlloc,2) . '</td>'; $j++; if ($AllocnItem->TransAmount < 0) { $balance+=$YetToAlloc; - echo "<td>" . $curTrans ."</td><td class=number>" . number_format($balance,2) . "</td></tr>"; + echo '<td>' . $curTrans .'</td><td class="number">' . number_format($balance,2) . '</td></tr>'; } else { - echo "<input type=hidden name='YetToAlloc" . $Counter . "' value=" . round($YetToAlloc,2) . '></td>'; - echo "<td class=number><input tabindex=".$j." type='checkbox' name='All" . $Counter . "'"; + echo '<input type=hidden name="YetToAlloc' . $Counter . '" value="' . round($YetToAlloc,2) . '"></td>'; + echo '<td class="number"><input tabindex="' . $j .'" type="checkbox" name="All' . $Counter . '"'; if (ABS($AllocnItem->AllocAmt-$YetToAlloc) < 0.01) { - echo ' value=' . True . '>'; + echo ' value=' . True . ' />'; } else { - echo '>'; + echo ' />'; } $balance += $YetToAlloc-$AllocnItem->AllocAmt; $j++; - echo "<input tabindex=".$j." type=text class=number name='Amt" . $Counter ."' maxlength=12 size=13 value=" . round($AllocnItem->AllocAmt,2) . "> - <input type=hidden name='AllocID" . $Counter . "' value=" . $AllocnItem->ID . '></td> - <td class=number>' . number_format($balance,2) . '</td></tr>'; + echo '<input tabindex="'.$j.'" type="text" class="number" name="Amt' . $Counter .'" maxlength=12 size=13 value="' . round($AllocnItem->AllocAmt,2) . '" /> + <input type=hidden name="AllocID' . $Counter . '" value="' . $AllocnItem->ID . '"></td> + <td class="number">' . number_format($balance,2) . '</td></tr>'; } $TotalAllocated = $TotalAllocated + round($AllocnItem->AllocAmt,2); $Counter++; } - echo "<tr> - <td colspan=5 class=number><b>"._('Total Allocated').':</b></td> + echo '<tr> + <td colspan=5 class="number"><b>'._('Total Allocated').':</b></td> <td class=number><b><u>' . number_format($TotalAllocated,2) . '</u></b></td>'; $j++; echo '<td rowspan=2> @@ -421,9 +420,9 @@ <td class=number><b>' . number_format($remaining-$TotalAllocated,2).'</b></td> </tr>'; echo '</table><p>'; - echo "<input type=hidden name=TotalNumberOfAllocs value=" . $Counter . ">"; - echo "<div class='centre'><input tabindex=".$j." type=submit name=UpdateDatabase value=" . _('Process Allocations') . ">"; - echo "<input tabindex=".$j." type=submit name=Cancel value=" . _('Cancel') . "></div>"; + echo '<input type="hidden" name="TotalNumberOfAllocs" value="' . $Counter . '">'; + echo '<div class="centre"><input tabindex="' . $j . '" type="submit" name="UpdateDatabase" value="' . _('Process Allocations') . '">'; + echo '<input tabindex="' . $j . '" type="submit" name="Cancel" value="' . _('Cancel') . '"></div>'; } elseif (isset($_GET['DebtorNo'])) { // Page called with customer code @@ -467,14 +466,14 @@ echo '<tr class="OddTableRows">';; $k++; } - echo "<td>" . $myrow['typename'] ."</td> - <td>" . $myrow['name'] . "</td> - <td>" . $myrow['debtorno'] . "</td> - <td>" . $myrow['transno'] . "</td> - <td>" . ConvertSQLDate($myrow['trandate']) . "</td> - <td class=number>" . number_format($myrow['total'],2) . "</td> - <td class=number>" . number_format($myrow['total']-$myrow['alloc'],2) . "</td>"; - echo '<td><a href=' . $_SERVER['PHP_SELF']. '?' . SID . '&AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a></td></tr>'; + echo '<td>' . $myrow['typename'] .'</td> + <td>' . $myrow['name'] . '</td> + <td>' . $myrow['debtorno'] . '</td> + <td>' . $myrow['transno'] . '</td> + <td>' . ConvertSQLDate($myrow['trandate']) . '</td> + <td class=number>' . number_format($myrow['total'],2) . '</td> + <td class=number>' . number_format($myrow['total']-$myrow['alloc'],2) . '</td>'; + echo '<td><a href=' . $_SERVER['PHP_SELF']. '?AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a></td></tr>'; } DB_free_result($result); echo '</table><p>'; @@ -516,7 +515,7 @@ if ( $curDebtor != $myrow['debtorno'] ) { if ( $curTrans > 1 ) { - echo "<tr class='OddTableRows'><td colspan=7 class=number>" . number_format($balance,2) . "</td><td><b>Balance</b></td></tr>"; + echo '<tr class="OddTableRows"><td colspan=7 class="number">' . number_format($balance,2) . '</td><td><b>' . _('Balance') . '</b></td></tr>'; } $balance = 0; @@ -548,20 +547,22 @@ $k++; } - echo "<td>" . $myrow['typename'] ."</td> - <td>" . $myrow['name'] . "</td> - <td>" . $myrow['debtorno'] . "</td> - <td>" . $myrow['transno'] . "</td> - <td>" . ConvertSQLDate($myrow['trandate']) . "</td> - <td class=number>" . number_format($myrow['total'],2) . "</td> - <td class=number>" . number_format($myrow['total']-$myrow['alloc'],2) . "</td>"; - echo '<td>' . $allocate . '</td></tr>'; + echo '<td>' . $myrow['typename'] .'</td> + <td>' . $myrow['name'] . '</td> + <td>' . $myrow['debtorno'] . '</td> + <td>' . $myrow['transno'] . '</td> + <td>' . ConvertSQLDate($myrow['trandate']) . '</td> + <td class=number>' . number_format($myrow['total'],2) . '</td> + <td class=number>' . number_format($myrow['total']-$myrow['alloc'],2) . '</td> + <td>' . $allocate . '</td></tr>'; if ( $curTrans > $trans ) { if (!isset($balance)) { $balance=0; } - echo "<tr class='OddTableRows'><td colspan=7 class=number>" . number_format($balance,2) . "</td><td><b>Balance</b></td></tr>"; + echo '<tr class="OddTableRows"> + <td colspan="7" class="number">' . number_format($balance,2) .'</td> + <td><b>' . _('Balance') . '</b></td></tr>'; } } DB_free_result($result); Modified: trunk/FixedAssetTransfer.php =================================================================== --- trunk/FixedAssetTransfer.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/FixedAssetTransfer.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,6 +1,6 @@ <?php -//$PageSecurity = 11; +/* $Id$*/ include('includes/session.inc'); @@ -26,7 +26,7 @@ } else { $sql='SELECT categoryid, categorydescription FROM fixedassetcategories'; $result=DB_query($sql, $db); - echo '<form action="'. $_SERVER['PHP_SELF'] . '?' . SID .'" method=post>'; + echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; @@ -121,11 +121,11 @@ while ($myrow=DB_fetch_array($Result)) { echo '<tr><td>'.$myrow['assetid'].'</td> - <td>'.$myrow['description'].'</td> - <td>'.$myrow['serialno'].'</td> - <td class=number>'.number_format($myrow['cost'],2).'</td> - <td class=number>'.number_format($myrow['accumdepn'],2).'</td> - <td>'.$myrow['locationdescription'].'</td>'; + <td>'.$myrow['description'].'</td> + <td>'.$myrow['serialno'].'</td> + <td class=number>'.number_format($myrow['cost'],2).'</td> + <td class=number>'.number_format($myrow['accumdepn'],2).'</td> + <td>'.$myrow['locationdescription'].'</td>'; echo '<td><select name="Location'.$myrow['assetid'].'" onChange="ReloadForm(Move'.$myrow['assetid'].')">'; echo '<option></option>'; while ($LocationRow=DB_fetch_array($LocationResult)) { @@ -137,11 +137,11 @@ } DB_data_seek($LocationResult,0); echo '</select></td>'; - echo '<input type=hidden name=AssetCat value="' . $_POST['AssetCat'].'"'; - echo '<input type=hidden name=Keywords value="' . $_POST['Keywords'].'"'; - echo '<input type=hidden name=AssetID value="' . $_POST['AssetID'].'"'; - echo '<input type=hidden name=Search value="' . $_POST['Search'].'"'; - echo '<td><input type=submit name="Move'.$myrow['assetid'].'" value=Move></td>'; + echo '<input type="hidden" name="AssetCat" value="' . $_POST['AssetCat'].'"'; + echo '<input type="hidden" name="Keywords" value="' . $_POST['Keywords'].'"'; + echo '<input type="hidden" name="AssetID" value="' . $_POST['AssetID'].'"'; + echo '<input type="hidden" name="Search" value="' . $_POST['Search'].'"'; + echo '<td><input type="submit" name="Move'.$myrow['assetid'].'" value=Move></td>'; echo '</tr>'; } echo '</table></form>'; Modified: trunk/GeocodeSetup.php =================================================================== --- trunk/GeocodeSetup.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/GeocodeSetup.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -//$PageSecurity = 3; + include('includes/session.inc'); $title = _('Geocode Maintenance'); include('includes/header.inc'); @@ -139,15 +139,16 @@ '<a href="http://www.batchgeocode.com/lookup/" target="_blank">http://www.batchgeocode.com/lookup/</a></b>'; echo '<p>'. _('Set the maps centre point using the Center Longitude and Center Latitude. Set the maps screen size using the height and width in pixels (px)').'</div><br>'; echo '<table border=1>'; - echo "<tr> - <th>". _('Geocode ID') ."</th> - <th>". _('Geocode Key') ."</th> - <th>". _('Center Longitude') ."</th> - <th>". _('Center Latitude') ."</th> - <th>". _('Map height (px)') ."</th> - <th>". _('Map width (px)') ."</th> - <th>". _('Map host') .'</th>'; - + + echo '<tr> + <th>'. _('Geocode ID') .'</th> + <th>'. _('Geocode Key') .'</th> + <th>'. _('Center Longitude') .'</th> + <th>'. _('Center Latitude') .'</th> + <th>'. _('Map height (px)') .'</th> + <th>'. _('Map width (px)') .'</th> + <th>'. _('Map host') .'</th>'; + $k=0; //row colour counter while ($myrow=DB_fetch_row($result)) { @@ -159,15 +160,15 @@ $k=1; } - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> - <td><a href=\"%s?SelectedParam=%s\">" . _('Edit') . "</a></td> - <td><a href=\"%s?SelectedParam=%s&delete=%s\">". _('Delete') .'</a></td> + <td><a href=\'%s?SelectedParam=%s\'>' . _('Edit') . '</a></td> + <td><a href=\'%s?SelectedParam=%s&delete=%s\'>'. _('Delete') .'</a></td> </tr>', $myrow[0], $myrow[1], @@ -193,7 +194,7 @@ if (!isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedParam) and ($InputError!=1)) { @@ -220,11 +221,12 @@ $_POST['map_width'] = $myrow['map_width']; $_POST['map_host'] = $myrow['map_host']; - echo "<input type=hidden name='SelectedParam' VALUE='" . $SelectedParam . "'>"; - echo "<input type=hidden name='geocodeid' VALUE='" . $_POST['geocodeid'] . "'>"; + echo '<input type="hidden" name="SelectedParam" value="' . $SelectedParam . '" />'; + echo '<input type="hidden" name="geocodeid" value="' . $_POST['geocodeid'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Geocode Setup') . '" alt="">'. _('Setup configuration for Geocoding of Customers and Suppliers') .'</p>'; - echo "<table><tr><td>". _('Geocode Code') .':</td><td>'; - echo $_POST['geocodeid'] . '</td></tr>'; + echo '<table> + <tr><td>'. _('Geocode Code') .':</td> + <td>' . $_POST['geocodeid'] . '</td></tr>'; } else { //end of if $SelectedParam only do the else when a new record is being entered if (!isset($_POST['geocodeid'])) { @@ -242,29 +244,28 @@ $_POST['geocode_key'] = ''; } echo '<br><tr> - <td>'. _('Geocode Key') .":</td> - <td><input " . (in_array('geocode_key',$Errors) ? 'class="inputerror"' : '' ) . - " tabindex=2 type='text' name='geocode_key' VALUE='". $_POST['geocode_key'] ."' size=28 maxlength=300> - </td></tr> - <tr><td>". _('Geocode Center Long') . "</td> - <td><input tabindex=3 type='text' name='center_long' VALUE='". $_POST['center_long'] ."' size=28 maxlength=300></td></tr> + <td>'. _('Geocode Key') .':</td> + <td><input ' . (in_array('geocode_key',$Errors) ? 'class="inputerror"' : '' ) . + ' tabindex=2 type="text" name="geocode_key" VALUE="'. $_POST['geocode_key'] .'" size=28 maxlength=300> + </td></tr> + + <tr><td>'. _('Geocode Center Long') . '</td> + <td><input tabindex=3 type="text" name="center_long" VALUE="'. $_POST['center_long'] .'" size=28 maxlength=300></td></tr> -<tr><td>". _('Geocode Center Lat') . "</td> - <td><input tabindex=4 type='text' name='center_lat' VALUE='". $_POST['center_lat'] ."' size=28 maxlength=300></td></tr> + <tr><td>'. _('Geocode Center Lat') . '</td> + <td><input tabindex=4 type="text" name="center_lat" VALUE="'. $_POST['center_lat'] .'" size=28 maxlength=300></td></tr> -<tr><td>". _('Geocode Map Height') . "</td> - <td><input tabindex=5 type='text' name='map_height' VALUE='". $_POST['map_height'] ."' size=28 maxlength=300></td></tr> + <tr><td>'. _('Geocode Map Height') . '</td> + <td><input tabindex=5 type="text" name="map_height" VALUE="'. $_POST['map_height'] .'" size=28 maxlength=300></td></tr> -<tr><td>". _('Geocode Map Width') . "</td> - <td><input tabindex=6 type='text' name='map_width' VALUE='". $_POST['map_width'] ."' size=28 maxlength=300></td></tr> + <tr><td>'. _('Geocode Map Width') . '</td> + <td><input tabindex=6 type="text" name="map_width" VALUE="'. $_POST['map_width'] .'" size=28 maxlength=300></td></tr> -<tr><td>". _('Geocode Host') . "</td> - <td><input tabindex=7 type='text' name='map_host' VALUE='". $_POST['map_host'] ."' size=20 maxlength=300></td></tr> - - - </table> - <div class='centre'><input tabindex=4 type='Submit' name='submit' value='" . _('Enter Information') . "'</div><br><br> - </form>"; + <tr><td>'. _('Geocode Host') . '</td> + <td><input tabindex=7 type="text" name="map_host" VALUE="'. $_POST['map_host'] .'" size=20 maxlength=300></td></tr> + </table> + <div class="centre"><input tabindex=4 type="Submit" name="submit" value="' . _('Enter Information') . '"</div><br><br> + </form>'; echo '<div class="page_help_text">' . _('When ready, click on the link below to run the GeoCode process. This will Geocode all Branches and Suppliers. This may take some time. Errors will be returned to the screen.') . '</p>'; echo '<p>' . _('Suppliers and Customer Branches are geocoded when being entered/updated. You can rerun the geocode process from this screen at any time.') . '</p></div><br>'; Modified: trunk/WorkOrderReceive.php =================================================================== --- trunk/WorkOrderReceive.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/WorkOrderReceive.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -10,7 +10,7 @@ echo '<a href="'. $rootpath . '/WorkOrderCosting.php?WO=' . $_REQUEST['WO'] . '">' . _('Back to Costing'). '</a><br>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . - _('Search') . '" alt="" />' . ' ' . $title.'</p'; + _('Search') . '" alt="" />' . ' ' . $title.'</p>'; echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Deleted: trunk/Z_PriceChanges.php =================================================================== --- trunk/Z_PriceChanges.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/Z_PriceChanges.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,141 +0,0 @@ -<?php -/* $Id$*/ - -include('includes/session.inc'); -$title=_('Update Pricing'); -include('includes/header.inc'); - - -echo '<br />' . _('This page updates already existing prices for a specified sales type (price list)') . '. ' . _('Choose between updating only customer special prices where the customer is set up under the price list selected, or all prices under the sales type or just specific prices for a customer for the stock category selected'); - -prnMsg (_('This script takes no account of start and end dates of prices and updates all historical prices as well as current prices - better to use new scripts under Inventory -> Maintenance'),'warn'); - -echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; -echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - -$SQL = "SELECT sales_type, typeabbrev FROM salestypes"; - -$result = DB_query($SQL,$db); - -echo '<p><table> - <tr> - <td>' . _('Select the Price List to update the costs for') .':</td> - <td><select name="PriceList">'; - -if (!isset($_POST['PriceList'])){ - echo '<option selected value=0>' . _('No Price List Selected') . '</option>'; -} - -while ($PriceLists=DB_fetch_array($result)){ - echo '<option value="' . $PriceLists['typeabbrev'] . '">' . $PriceLists['sales_type'] . '</option>'; -} - -echo '</select></td></tr>'; - -echo '<tr><td>' . _('Category') . ':</td> - <td><select name="StkCat">'; - -$sql = "SELECT categoryid, categorydescription FROM stockcategory"; - -$ErrMsg = _('The stock categories could not be retrieved because'); -$DbgMsg = _('The SQL used to retrieve stock categories and failed was'); -$result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - -while ($myrow=DB_fetch_array($result)){ - if ($myrow['categoryid']==$_POST['StkCat']){ - echo '<option selected value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; - } else { - echo '<option value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; - } -} -echo '</select></td></tr>'; - -echo '<tr><td>' . _('Which Prices to update') . ":</td> - <td><select name='WhichPrices'>"; - echo "<option value='Only Non-customer special prices'>" . _('Only Non-customer special prices') . '</option>'; - echo "<option value='Only customer special prices'>" . _('Only customer special prices') . '</option>'; - echo "<option value='Both customer special prices and non-customer special prices'>" . _('Both customer special prices and non-customer special prices') . '</option>'; - echo "<option value='Selected customer special prices only'>" . $_SESSION['CustomerID'] . ' ' . _('customer special prices only') . '</option>'; -echo '</select></td></tr>'; - -if (!isset($_POST['IncreasePercent'])){ - $_POST['IncreasePercent']=0; -} - -echo '<tr><td>' . _('Percentage Increase (positive) or decrease (negative)') . "</td> - <td><input name='IncreasePercent' size=4 maxlength=4 value=" . $_POST['IncreasePercent'] . "></td></tr></table>"; - - -echo "<div class='centre'><p><input type=submit name='UpdatePrices' value='" . _('Update Prices') . '\' onclick="return confirm(\'' . _('Are you sure you wish to update all the prices according to the criteria selected?') . '\');"></div>'; - -echo '</form>'; - -if (isset($_POST['UpdatePrices']) AND isset($_POST['StkCat'])){ - - echo '<br />' . _('So we are using a price list/sales type of') .' : ' . $_POST['PriceList']; - echo '<br />' . _('and a stock category code of') . ' : ' . $_POST['StkCat']; - echo '<br />' . _('and a increase percent of') . ' : ' . $_POST['IncreasePercent']; - - if ($_POST['PriceList']=='0'){ - echo '<br />' . _('The price list/sales type to be updated must be selected first'); - include ('includes/footer.inc'); - exit; - } - - if (ABS($_POST['IncreasePercent']) < 0.5 OR ABS($_POST['IncreasePercent'])>40 OR !is_numeric($_POST['IncreasePercent'])){ - - echo '<br />' . _('The increase or decrease to be applied is expected to be an integer between 1 and 40 it is not necessary to enter the').' '. '%'.' '. _('sign') . ' - ' . _('the amount is assumed to be a percentage'); - include ('includes/footer.inc'); - exit; - } - - echo '<p>' . _('Price list') . ' ' . $_POST['PriceList'] . ' ' . _('prices for') . ' ' . $_POST['WhichPrices'] . ' ' . _('for the stock category') . ' ' . $_POST['StkCat'] . ' ' . _('will been incremented by') . ' ' . $_POST['IncreasePercent'] . ' ' . _('percent'); - - $sql = "SELECT stockid FROM stockmaster WHERE categoryid='" . $_POST['StkCat'] . "'"; - $PartsResult = DB_query($sql,$db); - - $IncrementPercentage = $_POST['IncreasePercent']/100; - - while ($myrow=DB_fetch_array($PartsResult)){ - - if ($_POST['WhichPrices'] == 'Only Non-customer special prices'){ - - $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockid='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "' - AND debtorno=''"; - - }else if ($_POST['WhichPrices'] == 'Only customer special prices'){ - - $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockid='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "' - AND debtorno!=''"; - - } else if ($_POST['WhichPrices'] == 'Both customer special prices and non-customer special prices'){ - - $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockd='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "'"; - - } else if ($_POST['WhichPrices'] == 'Selected customer special prices only'){ - - $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockid='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "' - AND debtorno='" . $_SESSION['CustomerID'] . "'"; - - } - - $result = DB_query($sql,$db); - $ErrMsg =_('Error updating prices for') . ' ' . $myrow['stockid'] . ' ' . _('because'); - prnMsg(_('Updating prices for') . ' ' . $myrow['stockid'],'info'); - } - -} -include('includes/footer.inc'); -?> \ No newline at end of file Modified: trunk/Z_index.php =================================================================== --- trunk/Z_index.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/Z_index.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,6 +1,5 @@ <?php /* $Id$*/ -// $PageSecurity = 15; include('includes/session.inc'); $title = _('Special Fixes and Utilities') . ' - ' . _('Only System Administrator'); @@ -8,38 +7,36 @@ echo '<p>' . _('BE VERY CAREFUL DO NOT RUN THESE LINKS BELOW WITHOUT UNDERSTANDING EXACTLY WHAT THEY DO AND THE IMPLICATIONS'); - echo "<p><a href='$rootpath/Z_ReApplyCostToSA.php?" . SID . "'>". _('Re-apply costs to Sales Analysis') . '</a>'; - echo "<p><a href='$rootpath/EDISendInvoices.php?" . SID . "'>" . _('Send All Unsent EDI Invoices and Credits') .'</a>'; - echo "<p><a href='$rootpath/Z_ChangeCustomerCode.php?" . SID . "'>". _('Change A Customer Code') . '</a>'; - echo "<p><a href='$rootpath/Z_ChangeBranchCode.php?" . SID . "'>" . _('Change A Customer Branch Code') . '</a>'; - echo "<p><a href='$rootpath/Z_ChangeStockCode.php?" . SID . "'>" . _('Change An Inventory Item Code') . '</a>'; - echo "<p><a href='$rootpath/Z_ChangeSupplierCode.php?" . SID . "'>" . _('Change A Supplier Code') . '</a>'; - echo "<p><a href='$rootpath/Z_PriceChanges.php?" . SID . "'>" . _('Bulk Change Customer Pricing') . '</a>'; - echo "<p><a href='$rootpath/Z_BottomUpCosts.php?" . SID . "'>" . _('Update costs for all BOM items, from the bottom up') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ReApplyCostToSA.php">'. _('Re-apply costs to Sales Analysis') . '</a>'; + echo '<p><a href="' .$rootpath . '/EDISendInvoices.php">' . _('Send All Unsent EDI Invoices and Credits') .'</a>'; + echo '<p><a href="' .$rootpath . '/Z_ChangeCustomerCode.php">'. _('Change A Customer Code') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ChangeBranchCode.php">' . _('Change A Customer Branch Code') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ChangeStockCode.php">' . _('Change An Inventory Item Code') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ChangeSupplierCode.php">' . _('Change A Supplier Code') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_BottomUpCosts.php">' . _('Update costs for all BOM items, from the bottom up') . '</a>'; - echo "<p><a href='$rootpath/Z_CurrencyDebtorsBalances.php?" . SID . "'>" . _('Show Local Currency Total Debtor Balances') . '</a>'; - echo "<p><a href='$rootpath/Z_CurrencySuppliersBalances.php?" . SID . "'>" . _('Show Local Currency Total Suppliers Balances') . '</a>'; - echo "<p><a href='$rootpath/Z_CheckGLTransBalance.php?" . SID . "'>" . _('Show General Transactions That Do Not Balance') . '</a>'; - echo "<p><a href='$rootpath/Z_poAdmin.php?" . SID . "'>" . _('Maintain Language Files') . '</a>'; - echo "<p><a href='$rootpath/Z_MakeNewCompany.php?" . SID . "'>" . _('Make New Company') . '</a>'; - echo "<p><a href='$rootpath/Z_DataExport.php?" . SID . "'>" . _('Data Export Options') . '</a>'; - echo "<p><a href='$rootpath/Z_GetStockImage.php?" . SID . "'>" . _('Image Manipulation Utility') . '</a>'; - echo "<p><a href='$rootpath/Z_ImportStocks.php?" . SID . "'>" . _('Import Stock Items from .csv') . '</a>'; - echo "<p><a href='$rootpath/Z_ImportFixedAssets.php?" . SID . "'>" . _('Import Fixed Assets from .csv file') . '</a>'; - echo "<p><a href='$rootpath/Z_CreateCompanyTemplateFile.php?" . SID . "'>" . _('Create new company template SQL file and submit to webERP') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CurrencyDebtorsBalances.php">' . _('Show Local Currency Total Debtor Balances') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CurrencySuppliersBalances.php">' . _('Show Local Currency Total Suppliers Balances') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CheckGLTransBalance.php">' . _('Show General Transactions That Do Not Balance') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_poAdmin.php">' . _('Maintain Language Files') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_MakeNewCompany.php">' . _('Make New Company') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_DataExport.php">' . _('Data Export Options') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_GetStockImage.php">' . _('Image Manipulation Utility') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ImportStocks.php">' . _('Import Stock Items from .csv') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ImportFixedAssets.php">' . _('Import Fixed Assets from .csv file') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CreateCompanyTemplateFile.php">' . _('Create new company template SQL file and submit to webERP') . '</a>'; echo '<br><br><hr><br>' . _('The stuff below is really quite dangerous!'); echo '<p>' . _('To delete a credit note call') . ' ' . $rootpath . '/Z_DeleteCreditNote.php?' . ' ' ._('and the credit note number to delete'); echo '<p>' . _('To delete an invoice call') . ' ' . $rootpath . '/Z_DeleteInvoice.php?' . _('and the invoice number to delete'); - echo "<p><a href='$rootpath/Z_UploadForm.php?" . SID . "'>" . _('Upload a file to the server') . '</a>'; - echo "<p><a href='$rootpath/Z_DeleteSalesTransActions.php?" . SID . "'>" . _('Delete sales transactions') . '</a>'; - echo "<p><a href='$rootpath/Z_ReverseSuppPaymentRun.php?" . SID . "'>" . _('Reverse all supplier payments on a specified date') . '</a>'; - echo "<p><a href='$rootpath/Z_UpdateChartDetailsBFwd.php?" . SID . "'>" . _('Re-calculate brought forward amounts in GL') . '</a>'; - echo "<p><a href='$rootpath/Z_RePostGLFromPeriod.php?" . SID . "'>" . _('Re-Post all GL transactions from a specified period') . '</a>'; - echo "<p><a href='$rootpath/Z_CheckDebtorsControl.php?" . SID . "'>" . _('Show Debtors Control (Need to edit Z_CheckDebtorsControl.php for the period to show control totals for') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_UploadForm.php">' . _('Upload a file to the server') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_DeleteSalesTransActions.php">' . _('Delete sales transactions') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ReverseSuppPaymentRun.php">' . _('Reverse all supplier payments on a specified date') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_UpdateChartDetailsBFwd.php">' . _('Re-calculate brought forward amounts in GL') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_RePostGLFromPeriod.php">' . _('Re-Post all GL transactions from a specified period') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CheckDebtorsControl.php">' . _('Show Debtors Control (Need to edit Z_CheckDebtorsControl.php for the period to show control totals for') . '</a>'; include('includes/footer.inc'); - -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-14 10:28:59
|
Revision: 4550 http://web-erp.svn.sourceforge.net/web-erp/?rev=4550&view=rev Author: daintree Date: 2011-04-14 10:28:52 +0000 (Thu, 14 Apr 2011) Log Message: ----------- variosu Modified Paths: -------------- trunk/CustomerAllocations.php trunk/FixedAssetTransfer.php trunk/GeocodeSetup.php trunk/WorkOrderReceive.php trunk/Z_index.php Removed Paths: ------------- trunk/Z_PriceChanges.php Modified: trunk/CustomerAllocations.php =================================================================== --- trunk/CustomerAllocations.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/CustomerAllocations.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,5 +1,5 @@ <?php -/* $Revision: 1.30 $ */ + /* $Id$*/ /* @@ -10,7 +10,6 @@ */ include('includes/DefineCustAllocsClass.php'); -//$PageSecurity = 3; include('includes/session.inc'); $title = _('Customer Receipt') . '/' . _('Credit Note Allocations'); include('includes/header.inc'); @@ -70,7 +69,7 @@ if ($TotalAllocated + $_SESSION['Alloc']->TransAmt > 0.008) { prnMsg(_('Allocation could not be processed because the amount allocated is more than the').' ' . - $_SESSION['Alloc']->TransTypeName . ' '._('being allocated') . '<br>' . _('Total allocated').' = ' . + $_SESSION['Alloc']->TransTypeName . ' '._('being allocated') . '<br />' . _('Total allocated').' = ' . $TotalAllocated . ' '._('and the total amount of the') .' ' . $_SESSION['Alloc']->TransTypeName . ' '. _('was').' ' . -$_SESSION['Alloc']->TransAmt,'error'); $InputError=1; @@ -324,22 +323,22 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Allocate Receipt') . '" alt="" />' . ' ' . _('Allocate Receipts') . '</p>'; - $TableHeader = "<tr> - <th>" . _('Trans Type') . "</th> - <th>" . _('Customer') . "</th> - <th>" . _('Cust No') . "</th> - <th>" . _('Number') . "</th> - <th>" . _('Date') . "</th> - <th>" . _('Total') . "</th> - <th>" . _('To Alloc') . "</th> - <th>" . _('Action') . "</th> - </tr>"; + $TableHeader = '<tr> + <th>' . _('Trans Type') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Cust No') . '</th> + <th>' . _('Number') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Total') . '</th> + <th>' . _('To Alloc') . '</th> + <th>' . _('Action') . '</th> + </tr>'; if (isset($_POST['AllocTrans'])) { // Page called with trans number - echo "<form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "' method=post>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo "<input type=hidden name='AllocTrans' value=" . $_POST['AllocTrans'] . '>'; + echo '<input type=hidden name="AllocTrans" value="' . $_POST['AllocTrans'] . '" />'; // Show trans already allocated and potential new allocations @@ -347,20 +346,20 @@ echo '<tr><th colspan=7><div class="centre"><font color=blue><b>' . $_SESSION['Alloc']->DebtorNo . ' - ' . $_SESSION['Alloc']->CustomerName . '</b></div>'; if ($_SESSION['Alloc']->TransExRate != 1) { - echo '<br>'._('Amount in customer currency').' <b>' . + echo '<br />'._('Amount in customer currency').' <b>' . number_format(-$_SESSION['Alloc']->TransAmt,2) . '</b><i> ('._('converted into local currency at an exchange rate of'). ' ' . $_SESSION['Alloc']->TransExRate . ')</i>'; } - echo "</th></tr><tr> - <th>" . _('Trans') . '<br>' . _('Type') . "</th> - <th>" . _('Trans') . '<br>' . _('Number') . "</th> - <th>" . _('Trans') . '<br>' . _('Date') . "</th> - <th>" . _('Total') . '<br>' . _('Amount') . "</th> - <th>" . _('Yet to') . '<br>' . _('Allocate') . "</th> - <th>" . _('This') . '<br>' . _('Allocation') . "</th> - <th>" . _('Running') . '<br>' . _('Balance') . "</th> - </tr>"; + echo '</th></tr><tr> + <th>' . _('Trans') . '<br />' . _('Type') . '</th> + <th>' . _('Trans') . '<br />' . _('Number') . '</th> + <th>' . _('Trans') . '<br />' . _('Date') . '</th> + <th>' . _('Total') . '<br />' . _('Amount') . '</th> + <th>' . _('Yet to') . '<br />' . _('Allocate') . '</th> + <th>' . _('This') . '<br />' . _('Allocation') . '</th> + <th>' . _('Running') . '<br />' . _('Balance') . '</th> + </tr>'; $Counter = 0; $TotalAllocated = 0; @@ -380,37 +379,37 @@ $curTrans = " "; } - echo "<td>" . $AllocnItem->TransType . "</td> - <td>" . $AllocnItem->TypeNo . "</td> - <td class=number>" . $AllocnItem->TransDate . "</td> - <td class=number>" . number_format($AllocnItem->TransAmount,2) . "</td> - <td class=number>" . number_format($YetToAlloc,2) . "</td>"; + echo '<td>' . $AllocnItem->TransType . '</td> + <td>' . $AllocnItem->TypeNo . '</td> + <td class=number>' . $AllocnItem->TransDate . '</td> + <td class=number>' . number_format($AllocnItem->TransAmount,2) . '</td> + <td class=number>' . number_format($YetToAlloc,2) . '</td>'; $j++; if ($AllocnItem->TransAmount < 0) { $balance+=$YetToAlloc; - echo "<td>" . $curTrans ."</td><td class=number>" . number_format($balance,2) . "</td></tr>"; + echo '<td>' . $curTrans .'</td><td class="number">' . number_format($balance,2) . '</td></tr>'; } else { - echo "<input type=hidden name='YetToAlloc" . $Counter . "' value=" . round($YetToAlloc,2) . '></td>'; - echo "<td class=number><input tabindex=".$j." type='checkbox' name='All" . $Counter . "'"; + echo '<input type=hidden name="YetToAlloc' . $Counter . '" value="' . round($YetToAlloc,2) . '"></td>'; + echo '<td class="number"><input tabindex="' . $j .'" type="checkbox" name="All' . $Counter . '"'; if (ABS($AllocnItem->AllocAmt-$YetToAlloc) < 0.01) { - echo ' value=' . True . '>'; + echo ' value=' . True . ' />'; } else { - echo '>'; + echo ' />'; } $balance += $YetToAlloc-$AllocnItem->AllocAmt; $j++; - echo "<input tabindex=".$j." type=text class=number name='Amt" . $Counter ."' maxlength=12 size=13 value=" . round($AllocnItem->AllocAmt,2) . "> - <input type=hidden name='AllocID" . $Counter . "' value=" . $AllocnItem->ID . '></td> - <td class=number>' . number_format($balance,2) . '</td></tr>'; + echo '<input tabindex="'.$j.'" type="text" class="number" name="Amt' . $Counter .'" maxlength=12 size=13 value="' . round($AllocnItem->AllocAmt,2) . '" /> + <input type=hidden name="AllocID' . $Counter . '" value="' . $AllocnItem->ID . '"></td> + <td class="number">' . number_format($balance,2) . '</td></tr>'; } $TotalAllocated = $TotalAllocated + round($AllocnItem->AllocAmt,2); $Counter++; } - echo "<tr> - <td colspan=5 class=number><b>"._('Total Allocated').':</b></td> + echo '<tr> + <td colspan=5 class="number"><b>'._('Total Allocated').':</b></td> <td class=number><b><u>' . number_format($TotalAllocated,2) . '</u></b></td>'; $j++; echo '<td rowspan=2> @@ -421,9 +420,9 @@ <td class=number><b>' . number_format($remaining-$TotalAllocated,2).'</b></td> </tr>'; echo '</table><p>'; - echo "<input type=hidden name=TotalNumberOfAllocs value=" . $Counter . ">"; - echo "<div class='centre'><input tabindex=".$j." type=submit name=UpdateDatabase value=" . _('Process Allocations') . ">"; - echo "<input tabindex=".$j." type=submit name=Cancel value=" . _('Cancel') . "></div>"; + echo '<input type="hidden" name="TotalNumberOfAllocs" value="' . $Counter . '">'; + echo '<div class="centre"><input tabindex="' . $j . '" type="submit" name="UpdateDatabase" value="' . _('Process Allocations') . '">'; + echo '<input tabindex="' . $j . '" type="submit" name="Cancel" value="' . _('Cancel') . '"></div>'; } elseif (isset($_GET['DebtorNo'])) { // Page called with customer code @@ -467,14 +466,14 @@ echo '<tr class="OddTableRows">';; $k++; } - echo "<td>" . $myrow['typename'] ."</td> - <td>" . $myrow['name'] . "</td> - <td>" . $myrow['debtorno'] . "</td> - <td>" . $myrow['transno'] . "</td> - <td>" . ConvertSQLDate($myrow['trandate']) . "</td> - <td class=number>" . number_format($myrow['total'],2) . "</td> - <td class=number>" . number_format($myrow['total']-$myrow['alloc'],2) . "</td>"; - echo '<td><a href=' . $_SERVER['PHP_SELF']. '?' . SID . '&AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a></td></tr>'; + echo '<td>' . $myrow['typename'] .'</td> + <td>' . $myrow['name'] . '</td> + <td>' . $myrow['debtorno'] . '</td> + <td>' . $myrow['transno'] . '</td> + <td>' . ConvertSQLDate($myrow['trandate']) . '</td> + <td class=number>' . number_format($myrow['total'],2) . '</td> + <td class=number>' . number_format($myrow['total']-$myrow['alloc'],2) . '</td>'; + echo '<td><a href=' . $_SERVER['PHP_SELF']. '?AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a></td></tr>'; } DB_free_result($result); echo '</table><p>'; @@ -516,7 +515,7 @@ if ( $curDebtor != $myrow['debtorno'] ) { if ( $curTrans > 1 ) { - echo "<tr class='OddTableRows'><td colspan=7 class=number>" . number_format($balance,2) . "</td><td><b>Balance</b></td></tr>"; + echo '<tr class="OddTableRows"><td colspan=7 class="number">' . number_format($balance,2) . '</td><td><b>' . _('Balance') . '</b></td></tr>'; } $balance = 0; @@ -548,20 +547,22 @@ $k++; } - echo "<td>" . $myrow['typename'] ."</td> - <td>" . $myrow['name'] . "</td> - <td>" . $myrow['debtorno'] . "</td> - <td>" . $myrow['transno'] . "</td> - <td>" . ConvertSQLDate($myrow['trandate']) . "</td> - <td class=number>" . number_format($myrow['total'],2) . "</td> - <td class=number>" . number_format($myrow['total']-$myrow['alloc'],2) . "</td>"; - echo '<td>' . $allocate . '</td></tr>'; + echo '<td>' . $myrow['typename'] .'</td> + <td>' . $myrow['name'] . '</td> + <td>' . $myrow['debtorno'] . '</td> + <td>' . $myrow['transno'] . '</td> + <td>' . ConvertSQLDate($myrow['trandate']) . '</td> + <td class=number>' . number_format($myrow['total'],2) . '</td> + <td class=number>' . number_format($myrow['total']-$myrow['alloc'],2) . '</td> + <td>' . $allocate . '</td></tr>'; if ( $curTrans > $trans ) { if (!isset($balance)) { $balance=0; } - echo "<tr class='OddTableRows'><td colspan=7 class=number>" . number_format($balance,2) . "</td><td><b>Balance</b></td></tr>"; + echo '<tr class="OddTableRows"> + <td colspan="7" class="number">' . number_format($balance,2) .'</td> + <td><b>' . _('Balance') . '</b></td></tr>'; } } DB_free_result($result); Modified: trunk/FixedAssetTransfer.php =================================================================== --- trunk/FixedAssetTransfer.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/FixedAssetTransfer.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,6 +1,6 @@ <?php -//$PageSecurity = 11; +/* $Id$*/ include('includes/session.inc'); @@ -26,7 +26,7 @@ } else { $sql='SELECT categoryid, categorydescription FROM fixedassetcategories'; $result=DB_query($sql, $db); - echo '<form action="'. $_SERVER['PHP_SELF'] . '?' . SID .'" method=post>'; + echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; @@ -121,11 +121,11 @@ while ($myrow=DB_fetch_array($Result)) { echo '<tr><td>'.$myrow['assetid'].'</td> - <td>'.$myrow['description'].'</td> - <td>'.$myrow['serialno'].'</td> - <td class=number>'.number_format($myrow['cost'],2).'</td> - <td class=number>'.number_format($myrow['accumdepn'],2).'</td> - <td>'.$myrow['locationdescription'].'</td>'; + <td>'.$myrow['description'].'</td> + <td>'.$myrow['serialno'].'</td> + <td class=number>'.number_format($myrow['cost'],2).'</td> + <td class=number>'.number_format($myrow['accumdepn'],2).'</td> + <td>'.$myrow['locationdescription'].'</td>'; echo '<td><select name="Location'.$myrow['assetid'].'" onChange="ReloadForm(Move'.$myrow['assetid'].')">'; echo '<option></option>'; while ($LocationRow=DB_fetch_array($LocationResult)) { @@ -137,11 +137,11 @@ } DB_data_seek($LocationResult,0); echo '</select></td>'; - echo '<input type=hidden name=AssetCat value="' . $_POST['AssetCat'].'"'; - echo '<input type=hidden name=Keywords value="' . $_POST['Keywords'].'"'; - echo '<input type=hidden name=AssetID value="' . $_POST['AssetID'].'"'; - echo '<input type=hidden name=Search value="' . $_POST['Search'].'"'; - echo '<td><input type=submit name="Move'.$myrow['assetid'].'" value=Move></td>'; + echo '<input type="hidden" name="AssetCat" value="' . $_POST['AssetCat'].'"'; + echo '<input type="hidden" name="Keywords" value="' . $_POST['Keywords'].'"'; + echo '<input type="hidden" name="AssetID" value="' . $_POST['AssetID'].'"'; + echo '<input type="hidden" name="Search" value="' . $_POST['Search'].'"'; + echo '<td><input type="submit" name="Move'.$myrow['assetid'].'" value=Move></td>'; echo '</tr>'; } echo '</table></form>'; Modified: trunk/GeocodeSetup.php =================================================================== --- trunk/GeocodeSetup.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/GeocodeSetup.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -//$PageSecurity = 3; + include('includes/session.inc'); $title = _('Geocode Maintenance'); include('includes/header.inc'); @@ -139,15 +139,16 @@ '<a href="http://www.batchgeocode.com/lookup/" target="_blank">http://www.batchgeocode.com/lookup/</a></b>'; echo '<p>'. _('Set the maps centre point using the Center Longitude and Center Latitude. Set the maps screen size using the height and width in pixels (px)').'</div><br>'; echo '<table border=1>'; - echo "<tr> - <th>". _('Geocode ID') ."</th> - <th>". _('Geocode Key') ."</th> - <th>". _('Center Longitude') ."</th> - <th>". _('Center Latitude') ."</th> - <th>". _('Map height (px)') ."</th> - <th>". _('Map width (px)') ."</th> - <th>". _('Map host') .'</th>'; - + + echo '<tr> + <th>'. _('Geocode ID') .'</th> + <th>'. _('Geocode Key') .'</th> + <th>'. _('Center Longitude') .'</th> + <th>'. _('Center Latitude') .'</th> + <th>'. _('Map height (px)') .'</th> + <th>'. _('Map width (px)') .'</th> + <th>'. _('Map host') .'</th>'; + $k=0; //row colour counter while ($myrow=DB_fetch_row($result)) { @@ -159,15 +160,15 @@ $k=1; } - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> - <td><a href=\"%s?SelectedParam=%s\">" . _('Edit') . "</a></td> - <td><a href=\"%s?SelectedParam=%s&delete=%s\">". _('Delete') .'</a></td> + <td><a href=\'%s?SelectedParam=%s\'>' . _('Edit') . '</a></td> + <td><a href=\'%s?SelectedParam=%s&delete=%s\'>'. _('Delete') .'</a></td> </tr>', $myrow[0], $myrow[1], @@ -193,7 +194,7 @@ if (!isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedParam) and ($InputError!=1)) { @@ -220,11 +221,12 @@ $_POST['map_width'] = $myrow['map_width']; $_POST['map_host'] = $myrow['map_host']; - echo "<input type=hidden name='SelectedParam' VALUE='" . $SelectedParam . "'>"; - echo "<input type=hidden name='geocodeid' VALUE='" . $_POST['geocodeid'] . "'>"; + echo '<input type="hidden" name="SelectedParam" value="' . $SelectedParam . '" />'; + echo '<input type="hidden" name="geocodeid" value="' . $_POST['geocodeid'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Geocode Setup') . '" alt="">'. _('Setup configuration for Geocoding of Customers and Suppliers') .'</p>'; - echo "<table><tr><td>". _('Geocode Code') .':</td><td>'; - echo $_POST['geocodeid'] . '</td></tr>'; + echo '<table> + <tr><td>'. _('Geocode Code') .':</td> + <td>' . $_POST['geocodeid'] . '</td></tr>'; } else { //end of if $SelectedParam only do the else when a new record is being entered if (!isset($_POST['geocodeid'])) { @@ -242,29 +244,28 @@ $_POST['geocode_key'] = ''; } echo '<br><tr> - <td>'. _('Geocode Key') .":</td> - <td><input " . (in_array('geocode_key',$Errors) ? 'class="inputerror"' : '' ) . - " tabindex=2 type='text' name='geocode_key' VALUE='". $_POST['geocode_key'] ."' size=28 maxlength=300> - </td></tr> - <tr><td>". _('Geocode Center Long') . "</td> - <td><input tabindex=3 type='text' name='center_long' VALUE='". $_POST['center_long'] ."' size=28 maxlength=300></td></tr> + <td>'. _('Geocode Key') .':</td> + <td><input ' . (in_array('geocode_key',$Errors) ? 'class="inputerror"' : '' ) . + ' tabindex=2 type="text" name="geocode_key" VALUE="'. $_POST['geocode_key'] .'" size=28 maxlength=300> + </td></tr> + + <tr><td>'. _('Geocode Center Long') . '</td> + <td><input tabindex=3 type="text" name="center_long" VALUE="'. $_POST['center_long'] .'" size=28 maxlength=300></td></tr> -<tr><td>". _('Geocode Center Lat') . "</td> - <td><input tabindex=4 type='text' name='center_lat' VALUE='". $_POST['center_lat'] ."' size=28 maxlength=300></td></tr> + <tr><td>'. _('Geocode Center Lat') . '</td> + <td><input tabindex=4 type="text" name="center_lat" VALUE="'. $_POST['center_lat'] .'" size=28 maxlength=300></td></tr> -<tr><td>". _('Geocode Map Height') . "</td> - <td><input tabindex=5 type='text' name='map_height' VALUE='". $_POST['map_height'] ."' size=28 maxlength=300></td></tr> + <tr><td>'. _('Geocode Map Height') . '</td> + <td><input tabindex=5 type="text" name="map_height" VALUE="'. $_POST['map_height'] .'" size=28 maxlength=300></td></tr> -<tr><td>". _('Geocode Map Width') . "</td> - <td><input tabindex=6 type='text' name='map_width' VALUE='". $_POST['map_width'] ."' size=28 maxlength=300></td></tr> + <tr><td>'. _('Geocode Map Width') . '</td> + <td><input tabindex=6 type="text" name="map_width" VALUE="'. $_POST['map_width'] .'" size=28 maxlength=300></td></tr> -<tr><td>". _('Geocode Host') . "</td> - <td><input tabindex=7 type='text' name='map_host' VALUE='". $_POST['map_host'] ."' size=20 maxlength=300></td></tr> - - - </table> - <div class='centre'><input tabindex=4 type='Submit' name='submit' value='" . _('Enter Information') . "'</div><br><br> - </form>"; + <tr><td>'. _('Geocode Host') . '</td> + <td><input tabindex=7 type="text" name="map_host" VALUE="'. $_POST['map_host'] .'" size=20 maxlength=300></td></tr> + </table> + <div class="centre"><input tabindex=4 type="Submit" name="submit" value="' . _('Enter Information') . '"</div><br><br> + </form>'; echo '<div class="page_help_text">' . _('When ready, click on the link below to run the GeoCode process. This will Geocode all Branches and Suppliers. This may take some time. Errors will be returned to the screen.') . '</p>'; echo '<p>' . _('Suppliers and Customer Branches are geocoded when being entered/updated. You can rerun the geocode process from this screen at any time.') . '</p></div><br>'; Modified: trunk/WorkOrderReceive.php =================================================================== --- trunk/WorkOrderReceive.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/WorkOrderReceive.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -10,7 +10,7 @@ echo '<a href="'. $rootpath . '/WorkOrderCosting.php?WO=' . $_REQUEST['WO'] . '">' . _('Back to Costing'). '</a><br>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . - _('Search') . '" alt="" />' . ' ' . $title.'</p'; + _('Search') . '" alt="" />' . ' ' . $title.'</p>'; echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Deleted: trunk/Z_PriceChanges.php =================================================================== --- trunk/Z_PriceChanges.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/Z_PriceChanges.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,141 +0,0 @@ -<?php -/* $Id$*/ - -include('includes/session.inc'); -$title=_('Update Pricing'); -include('includes/header.inc'); - - -echo '<br />' . _('This page updates already existing prices for a specified sales type (price list)') . '. ' . _('Choose between updating only customer special prices where the customer is set up under the price list selected, or all prices under the sales type or just specific prices for a customer for the stock category selected'); - -prnMsg (_('This script takes no account of start and end dates of prices and updates all historical prices as well as current prices - better to use new scripts under Inventory -> Maintenance'),'warn'); - -echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; -echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - -$SQL = "SELECT sales_type, typeabbrev FROM salestypes"; - -$result = DB_query($SQL,$db); - -echo '<p><table> - <tr> - <td>' . _('Select the Price List to update the costs for') .':</td> - <td><select name="PriceList">'; - -if (!isset($_POST['PriceList'])){ - echo '<option selected value=0>' . _('No Price List Selected') . '</option>'; -} - -while ($PriceLists=DB_fetch_array($result)){ - echo '<option value="' . $PriceLists['typeabbrev'] . '">' . $PriceLists['sales_type'] . '</option>'; -} - -echo '</select></td></tr>'; - -echo '<tr><td>' . _('Category') . ':</td> - <td><select name="StkCat">'; - -$sql = "SELECT categoryid, categorydescription FROM stockcategory"; - -$ErrMsg = _('The stock categories could not be retrieved because'); -$DbgMsg = _('The SQL used to retrieve stock categories and failed was'); -$result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - -while ($myrow=DB_fetch_array($result)){ - if ($myrow['categoryid']==$_POST['StkCat']){ - echo '<option selected value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; - } else { - echo '<option value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; - } -} -echo '</select></td></tr>'; - -echo '<tr><td>' . _('Which Prices to update') . ":</td> - <td><select name='WhichPrices'>"; - echo "<option value='Only Non-customer special prices'>" . _('Only Non-customer special prices') . '</option>'; - echo "<option value='Only customer special prices'>" . _('Only customer special prices') . '</option>'; - echo "<option value='Both customer special prices and non-customer special prices'>" . _('Both customer special prices and non-customer special prices') . '</option>'; - echo "<option value='Selected customer special prices only'>" . $_SESSION['CustomerID'] . ' ' . _('customer special prices only') . '</option>'; -echo '</select></td></tr>'; - -if (!isset($_POST['IncreasePercent'])){ - $_POST['IncreasePercent']=0; -} - -echo '<tr><td>' . _('Percentage Increase (positive) or decrease (negative)') . "</td> - <td><input name='IncreasePercent' size=4 maxlength=4 value=" . $_POST['IncreasePercent'] . "></td></tr></table>"; - - -echo "<div class='centre'><p><input type=submit name='UpdatePrices' value='" . _('Update Prices') . '\' onclick="return confirm(\'' . _('Are you sure you wish to update all the prices according to the criteria selected?') . '\');"></div>'; - -echo '</form>'; - -if (isset($_POST['UpdatePrices']) AND isset($_POST['StkCat'])){ - - echo '<br />' . _('So we are using a price list/sales type of') .' : ' . $_POST['PriceList']; - echo '<br />' . _('and a stock category code of') . ' : ' . $_POST['StkCat']; - echo '<br />' . _('and a increase percent of') . ' : ' . $_POST['IncreasePercent']; - - if ($_POST['PriceList']=='0'){ - echo '<br />' . _('The price list/sales type to be updated must be selected first'); - include ('includes/footer.inc'); - exit; - } - - if (ABS($_POST['IncreasePercent']) < 0.5 OR ABS($_POST['IncreasePercent'])>40 OR !is_numeric($_POST['IncreasePercent'])){ - - echo '<br />' . _('The increase or decrease to be applied is expected to be an integer between 1 and 40 it is not necessary to enter the').' '. '%'.' '. _('sign') . ' - ' . _('the amount is assumed to be a percentage'); - include ('includes/footer.inc'); - exit; - } - - echo '<p>' . _('Price list') . ' ' . $_POST['PriceList'] . ' ' . _('prices for') . ' ' . $_POST['WhichPrices'] . ' ' . _('for the stock category') . ' ' . $_POST['StkCat'] . ' ' . _('will been incremented by') . ' ' . $_POST['IncreasePercent'] . ' ' . _('percent'); - - $sql = "SELECT stockid FROM stockmaster WHERE categoryid='" . $_POST['StkCat'] . "'"; - $PartsResult = DB_query($sql,$db); - - $IncrementPercentage = $_POST['IncreasePercent']/100; - - while ($myrow=DB_fetch_array($PartsResult)){ - - if ($_POST['WhichPrices'] == 'Only Non-customer special prices'){ - - $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockid='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "' - AND debtorno=''"; - - }else if ($_POST['WhichPrices'] == 'Only customer special prices'){ - - $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockid='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "' - AND debtorno!=''"; - - } else if ($_POST['WhichPrices'] == 'Both customer special prices and non-customer special prices'){ - - $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockd='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "'"; - - } else if ($_POST['WhichPrices'] == 'Selected customer special prices only'){ - - $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockid='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "' - AND debtorno='" . $_SESSION['CustomerID'] . "'"; - - } - - $result = DB_query($sql,$db); - $ErrMsg =_('Error updating prices for') . ' ' . $myrow['stockid'] . ' ' . _('because'); - prnMsg(_('Updating prices for') . ' ' . $myrow['stockid'],'info'); - } - -} -include('includes/footer.inc'); -?> \ No newline at end of file Modified: trunk/Z_index.php =================================================================== --- trunk/Z_index.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/Z_index.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,6 +1,5 @@ <?php /* $Id$*/ -// $PageSecurity = 15; include('includes/session.inc'); $title = _('Special Fixes and Utilities') . ' - ' . _('Only System Administrator'); @@ -8,38 +7,36 @@ echo '<p>' . _('BE VERY CAREFUL DO NOT RUN THESE LINKS BELOW WITHOUT UNDERSTANDING EXACTLY WHAT THEY DO AND THE IMPLICATIONS'); - echo "<p><a href='$rootpath/Z_ReApplyCostToSA.php?" . SID . "'>". _('Re-apply costs to Sales Analysis') . '</a>'; - echo "<p><a href='$rootpath/EDISendInvoices.php?" . SID . "'>" . _('Send All Unsent EDI Invoices and Credits') .'</a>'; - echo "<p><a href='$rootpath/Z_ChangeCustomerCode.php?" . SID . "'>". _('Change A Customer Code') . '</a>'; - echo "<p><a href='$rootpath/Z_ChangeBranchCode.php?" . SID . "'>" . _('Change A Customer Branch Code') . '</a>'; - echo "<p><a href='$rootpath/Z_ChangeStockCode.php?" . SID . "'>" . _('Change An Inventory Item Code') . '</a>'; - echo "<p><a href='$rootpath/Z_ChangeSupplierCode.php?" . SID . "'>" . _('Change A Supplier Code') . '</a>'; - echo "<p><a href='$rootpath/Z_PriceChanges.php?" . SID . "'>" . _('Bulk Change Customer Pricing') . '</a>'; - echo "<p><a href='$rootpath/Z_BottomUpCosts.php?" . SID . "'>" . _('Update costs for all BOM items, from the bottom up') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ReApplyCostToSA.php">'. _('Re-apply costs to Sales Analysis') . '</a>'; + echo '<p><a href="' .$rootpath . '/EDISendInvoices.php">' . _('Send All Unsent EDI Invoices and Credits') .'</a>'; + echo '<p><a href="' .$rootpath . '/Z_ChangeCustomerCode.php">'. _('Change A Customer Code') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ChangeBranchCode.php">' . _('Change A Customer Branch Code') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ChangeStockCode.php">' . _('Change An Inventory Item Code') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ChangeSupplierCode.php">' . _('Change A Supplier Code') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_BottomUpCosts.php">' . _('Update costs for all BOM items, from the bottom up') . '</a>'; - echo "<p><a href='$rootpath/Z_CurrencyDebtorsBalances.php?" . SID . "'>" . _('Show Local Currency Total Debtor Balances') . '</a>'; - echo "<p><a href='$rootpath/Z_CurrencySuppliersBalances.php?" . SID . "'>" . _('Show Local Currency Total Suppliers Balances') . '</a>'; - echo "<p><a href='$rootpath/Z_CheckGLTransBalance.php?" . SID . "'>" . _('Show General Transactions That Do Not Balance') . '</a>'; - echo "<p><a href='$rootpath/Z_poAdmin.php?" . SID . "'>" . _('Maintain Language Files') . '</a>'; - echo "<p><a href='$rootpath/Z_MakeNewCompany.php?" . SID . "'>" . _('Make New Company') . '</a>'; - echo "<p><a href='$rootpath/Z_DataExport.php?" . SID . "'>" . _('Data Export Options') . '</a>'; - echo "<p><a href='$rootpath/Z_GetStockImage.php?" . SID . "'>" . _('Image Manipulation Utility') . '</a>'; - echo "<p><a href='$rootpath/Z_ImportStocks.php?" . SID . "'>" . _('Import Stock Items from .csv') . '</a>'; - echo "<p><a href='$rootpath/Z_ImportFixedAssets.php?" . SID . "'>" . _('Import Fixed Assets from .csv file') . '</a>'; - echo "<p><a href='$rootpath/Z_CreateCompanyTemplateFile.php?" . SID . "'>" . _('Create new company template SQL file and submit to webERP') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CurrencyDebtorsBalances.php">' . _('Show Local Currency Total Debtor Balances') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CurrencySuppliersBalances.php">' . _('Show Local Currency Total Suppliers Balances') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CheckGLTransBalance.php">' . _('Show General Transactions That Do Not Balance') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_poAdmin.php">' . _('Maintain Language Files') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_MakeNewCompany.php">' . _('Make New Company') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_DataExport.php">' . _('Data Export Options') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_GetStockImage.php">' . _('Image Manipulation Utility') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ImportStocks.php">' . _('Import Stock Items from .csv') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ImportFixedAssets.php">' . _('Import Fixed Assets from .csv file') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CreateCompanyTemplateFile.php">' . _('Create new company template SQL file and submit to webERP') . '</a>'; echo '<br><br><hr><br>' . _('The stuff below is really quite dangerous!'); echo '<p>' . _('To delete a credit note call') . ' ' . $rootpath . '/Z_DeleteCreditNote.php?' . ' ' ._('and the credit note number to delete'); echo '<p>' . _('To delete an invoice call') . ' ' . $rootpath . '/Z_DeleteInvoice.php?' . _('and the invoice number to delete'); - echo "<p><a href='$rootpath/Z_UploadForm.php?" . SID . "'>" . _('Upload a file to the server') . '</a>'; - echo "<p><a href='$rootpath/Z_DeleteSalesTransActions.php?" . SID . "'>" . _('Delete sales transactions') . '</a>'; - echo "<p><a href='$rootpath/Z_ReverseSuppPaymentRun.php?" . SID . "'>" . _('Reverse all supplier payments on a specified date') . '</a>'; - echo "<p><a href='$rootpath/Z_UpdateChartDetailsBFwd.php?" . SID . "'>" . _('Re-calculate brought forward amounts in GL') . '</a>'; - echo "<p><a href='$rootpath/Z_RePostGLFromPeriod.php?" . SID . "'>" . _('Re-Post all GL transactions from a specified period') . '</a>'; - echo "<p><a href='$rootpath/Z_CheckDebtorsControl.php?" . SID . "'>" . _('Show Debtors Control (Need to edit Z_CheckDebtorsControl.php for the period to show control totals for') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_UploadForm.php">' . _('Upload a file to the server') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_DeleteSalesTransActions.php">' . _('Delete sales transactions') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ReverseSuppPaymentRun.php">' . _('Reverse all supplier payments on a specified date') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_UpdateChartDetailsBFwd.php">' . _('Re-calculate brought forward amounts in GL') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_RePostGLFromPeriod.php">' . _('Re-Post all GL transactions from a specified period') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CheckDebtorsControl.php">' . _('Show Debtors Control (Need to edit Z_CheckDebtorsControl.php for the period to show control totals for') . '</a>'; include('includes/footer.inc'); - -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |