From: <tim...@us...> - 2010-05-02 11:55:31
|
Revision: 3439 http://web-erp.svn.sourceforge.net/web-erp/?rev=3439&view=rev Author: tim_schofield Date: 2010-05-02 11:55:23 +0000 (Sun, 02 May 2010) Log Message: ----------- Tim: Add picking list printing Modified Paths: -------------- trunk/FormDesigner.php trunk/css/silverwolf/default.css trunk/doc/Change.log.html trunk/index.php trunk/sql/mysql/upgrade3.11.1-3.12.sql Added Paths: ----------- trunk/PDFPickingList.php trunk/companies/weberpdemo/FormDesigns/PickingList.xml trunk/includes/PDFPickingListHeader.inc Modified: trunk/FormDesigner.php =================================================================== --- trunk/FormDesigner.php 2010-05-02 10:25:49 UTC (rev 3438) +++ trunk/FormDesigner.php 2010-05-02 11:55:23 UTC (rev 3439) @@ -111,6 +111,9 @@ case 'SalesInvoice.xml': echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/PrintCustTrans.php?' . SID .'FromTransNo=Preview&InvOrCredit=Invoice&PrintPDF=True">'; break; + case 'PickingList.xml': + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/PDFPickingList.php?' . SID .'TransNo=Preview">'; + break; } } else { /* otherwise check that the web server has write premissions on the companies @@ -208,6 +211,11 @@ echo '<td>'.$subkey['name'].'</td>'; SimpleTextLine($subkey); echo '</tr>'; + } else if ($subkey['type']=='MultiLineText') { + echo '<tr>'; + echo '<td>'.$subkey['name'].'</td>'; + MultiTextLine($subkey); + echo '</tr>'; } else { echo '<tr>'; if ($subkey['type']=='DataText') { Added: trunk/PDFPickingList.php =================================================================== --- trunk/PDFPickingList.php (rev 0) +++ trunk/PDFPickingList.php 2010-05-02 11:55:23 UTC (rev 3439) @@ -0,0 +1,329 @@ +<?php + +/* $Id$*/ + +$PageSecurity = 2; + +include('includes/session.inc'); +include('includes/SQL_CommonFunctions.inc'); + +/* Check that the config variable is set for + * picking notes and get out if not. + */ +if ($_SESSION['RequirePickingNote']==0) { + $title = _('Picking Lists Not Enabled'); + include('includes/header.inc'); + echo '<br>'; + prnMsg( _('The system is not configured for picking lists. Please consult your system administrator.'), 'info'); + include('includes/footer.inc'); + exit; +} + +/* Show selection screen if we have no orders to work with */ +if ((!isset($_GET['TransNo']) or $_GET['TransNo']=="") and !isset($_POST['TransDate'])){ + $title = _('Select Picking Lists'); + include('includes/header.inc'); + $sql='SELECT loccode, + locationname + FROM locations'; + $result=DB_query($sql, $db); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'<br></p>'; + echo '<form action=' . $_SERVER['PHP_SELF'] . '?' . SID . ' method=post name="form">'; + echo '<table class="selection"><tr>'; + echo '<td>'._('Create picking lists for all deliveries to be made on').' : '.'</td>'; + echo '<td><input type=text class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="TransDate" maxlength=10 size=11 value='.date($_SESSION['DefaultDateFormat'], mktime(date('m'),date('Y'),date('d')+1)).'></td></tr>'; + echo '<tr><td>'._('From Warehouse').' : '.'</td><td><select name="loccode">'; + while ($myrow=DB_fetch_array($result)) { + echo '<option value='.$myrow['loccode'].'>'.$myrow['locationname'].'</option>'; + } + echo '</select></td></tr>'; + echo '</table>'; + echo "<br><div class='centre'><input type=submit name=Process value='" . _('Print Picking Lists') . "'></div></form>"; + include('includes/footer.inc'); + exit(); +} + +/*retrieve the order details from the database to print */ +$ErrMsg = _('There was a problem retrieving the order header details from the database'); + +if (!isset($_POST['TransDate']) and $_GET['TransNo'] != 'Preview') { +/* If there is no transaction date set, then it must be for a single order */ + $sql = "SELECT salesorders.debtorno, + salesorders.orderno, + salesorders.customerref, + salesorders.comments, + salesorders.orddate, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + salesorders.deliverblind, + salesorders.deliverydate, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + shippers.shippername, + salesorders.printedpackingslip, + salesorders.datepackingslipprinted, + locations.locationname + FROM salesorders, + debtorsmaster, + shippers, + locations + WHERE salesorders.debtorno=debtorsmaster.debtorno + AND salesorders.shipvia=shippers.shipper_id + AND salesorders.fromstkloc=locations.loccode + AND salesorders.orderno=" . $_GET['TransNo']; +} else if (isset($_POST['TransDate']) or (isset($_GET['TransNo']) and $_GET['TransNo'] != 'Preview')) { +/* We are printing picking lists for all orders on a day */ + $sql = "SELECT salesorders.debtorno, + salesorders.orderno, + salesorders.customerref, + salesorders.comments, + salesorders.orddate, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + salesorders.deliverblind, + salesorders.deliverydate, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + shippers.shippername, + salesorders.printedpackingslip, + salesorders.datepackingslipprinted, + locations.locationname + FROM salesorders, + debtorsmaster, + shippers, + locations + WHERE salesorders.debtorno=debtorsmaster.debtorno + AND salesorders.shipvia=shippers.shipper_id + AND salesorders.fromstkloc=locations.loccode + AND salesorders.fromstkloc='".$_POST['loccode']."' + AND salesorders.deliverydate='" . FormatDateForSQL($_POST['TransDate'])."'"; +} + +if (isset($_POST['TransDate']) or (isset($_GET['TransNo']) and $_GET['TransNo'] != 'Preview')) { + $result=DB_query($sql,$db, $ErrMsg); + + /*if there are no rows, there's a problem. */ + if (DB_num_rows($result)==0){ + $title = _('Print Picking List Error'); + include('includes/header.inc'); + echo '<br>'; + prnMsg( _('Unable to Locate any orders for this criteria '), 'info'); + echo '<br><table class="selection"><tr><td> + <a href="'. $rootpath . '/PDFPickingList.php?'. SID .'">' . _('Enter Another Date') . '</a> + </td></tr></table><br>'; + include('includes/footer.inc'); + exit(); + } + + /*retrieve the order details from the database and place them in an array */ + $i=0; + while ($myrow=DB_fetch_array($result)) { + $OrdersToPick[$i]=$myrow; + $i++; + } +} else { + $OrdersToPick[0]['debtorno']=str_pad('',10,'x'); + $OrdersToPick[0]['orderno']='Preview'; + $OrdersToPick[0]['customerref']=str_pad('',20,'x'); + $OrdersToPick[0]['comments']=str_pad('',100,'x'); + $OrdersToPick[0]['orddate']='1900-00-01'; + $OrdersToPick[0]['deliverto']=str_pad('',20,'x'); + $OrdersToPick[0]['deladd1']=str_pad('',20,'x'); + $OrdersToPick[0]['deladd2']=str_pad('',20,'x'); + $OrdersToPick[0]['deladd3']=str_pad('',20,'x'); + $OrdersToPick[0]['deladd4']=str_pad('',20,'x'); + $OrdersToPick[0]['deladd5']=str_pad('',20,'x'); + $OrdersToPick[0]['deladd6']=str_pad('',20,'x'); + $OrdersToPick[0]['deliverblind']=str_pad('',20,'x'); + $OrdersToPick[0]['deliverydate']='1900-00-01'; + $OrdersToPick[0]['name']=str_pad('',20,'x'); + $OrdersToPick[0]['address1']=str_pad('',20,'x'); + $OrdersToPick[0]['address2']=str_pad('',20,'x'); + $OrdersToPick[0]['address3']=str_pad('',20,'x'); + $OrdersToPick[0]['address4']=str_pad('',20,'x'); + $OrdersToPick[0]['address5']=str_pad('',20,'x'); + $OrdersToPick[0]['address6']=str_pad('',20,'x'); + $OrdersToPick[0]['shippername']=str_pad('',20,'x'); + $OrdersToPick[0]['printedpackingslip']=str_pad('',20,'x'); + $OrdersToPick[0]['datepackingslipprinted']='1900-00-01'; + $OrdersToPick[0]['locationname']=str_pad('',15,'x'); +} +/* Then there's an order to print and its not been printed already (or its been flagged for reprinting/ge_Width=807; +) +LETS GO */ + +if ($OrdersToPick[0]['orderno']=='Preview') { + $FormDesign = simplexml_load_file(sys_get_temp_dir().'/PickingList.xml'); +} else { + $FormDesign = simplexml_load_file($PathPrefix.'companies/'.$_SESSION['DatabaseName'].'/FormDesigns/PickingList.xml'); +} + +$PaperSize = $FormDesign->PaperSize; +include('includes/PDFStarter.php'); +$pdf->addInfo('Title', _('Picking List') ); +$pdf->addInfo('Subject', _('Laser Picking List') ); +$FontSize=12; +$ListCount = 0; // UldisN +$Copy=''; + +$line_height=$FormDesign->LineHeight; + +for ($i=0;$i<sizeof($OrdersToPick);$i++){ +/*Cycle through each of the orders to pick */ + if ($i>0) { + $pdf->newPage(); + } + + /* Now ... Has the order got any line items still outstanding to be picked */ + + $PageNumber = 1; + + if (isset($_POST['TransDate']) or (isset($_GET['TransNo']) and $_GET['TransNo'] != 'Preview')) { + $ErrMsg = _('There was a problem retrieving the order line details for Order Number') . ' ' . + $OrdersToPick[$i]['orderno'] . ' ' . _('from the database'); + + /* Are there any picking lists for this order already */ + $sql='SELECT COUNT(orderno) + FROM pickinglists + WHERE orderno='.$OrdersToPick[$i]['orderno']; + $countresult=DB_query($sql, $db); + $count=DB_fetch_row($countresult); + if ($count[0]==0) { + /* There are no previous picking lists for this order */ + $sql = "SELECT salesorderdetails.stkcode, + stockmaster.description, + salesorderdetails.orderlineno, + salesorderdetails.quantity, + salesorderdetails.qtyinvoiced, + salesorderdetails.unitprice, + salesorderdetails.narrative + FROM salesorderdetails + INNER JOIN stockmaster + ON salesorderdetails.stkcode=stockmaster.stockid + WHERE salesorderdetails.orderno=" . $OrdersToPick[$i]['orderno'] ;; + } else { + /* There are previous picking lists for this order so + * need to take those quantities into account + */ + $sql = "SELECT salesorderdetails.stkcode, + stockmaster.description, + salesorderdetails.orderlineno, + salesorderdetails.quantity, + salesorderdetails.qtyinvoiced, + SUM(pickinglistdetails.qtyexpected) as qtyexpected, + SUM(pickinglistdetails.qtypicked) as qtypicked, + salesorderdetails.unitprice, + salesorderdetails.narrative + FROM salesorderdetails + INNER JOIN stockmaster + ON salesorderdetails.stkcode=stockmaster.stockid + LEFT JOIN pickinglists + ON salesorderdetails.orderno=pickinglists.orderno + LEFT JOIN pickinglistdetails + ON pickinglists.pickinglistno=pickinglistdetails.pickinglistno + WHERE salesorderdetails.orderno=" . $OrdersToPick[$i]['orderno'] ." + AND salesorderdetails.orderlineno=pickinglistdetails.orderlineno"; + } + $lineresult=DB_query($sql,$db, $ErrMsg); + } + + if ((isset($_GET['TransNo']) and $_GET['TransNo'] == 'Preview') or (isset($lineresult) and DB_num_rows($lineresult)>0)){ + /*Yes there are line items to start the ball rolling with a page header */ + include('includes/PDFPickingListHeader.inc'); + if (isset($_POST['TransDate']) or (isset($_GET['TransNo']) and $_GET['TransNo'] != 'Preview')) { + $LinesToShow=DB_num_rows($lineresult); + $PickingListNo = GetNextTransNo(19, $db); + $sql='INSERT INTO pickinglists + VALUES ('. + $PickingListNo .','. + $OrdersToPick[$i]['orderno'].',"'. + FormatDateForSQL($_POST['TransDate']).'","'. + date('Y-m-d').'", + "0000-00-00")'; + $headerresult=DB_query($sql, $db); + } else { + $LinesToShow=1; + } + $YPos=$FormDesign->Data->y; + $Lines=0; + + while ($Lines<$LinesToShow){ + if (isset($_GET['TransNo']) and $_GET['TransNo'] == 'Preview') { + $myrow2['stkcode']=str_pad('',10,'x'); + $DisplayQty='XXXX.XX'; + $DisplayPrevDel='XXXX.XX'; + $DisplayQtySupplied='XXXX.XX'; + $myrow2['description']=str_pad('',18,'x'); + $myrow2['narrative']=str_pad('',18,'x'); + $itemdesc = $myrow2['description'] . ' - ' . $myrow2['narrative']; + } else { + $myrow2=DB_fetch_array($lineresult); + if ($count[0]==0) { + $myrow2['qtyexpected']=0; + $myrow2['qtypicked']=0; + } + $DisplayQty = number_format($myrow2['quantity'],2); + $DisplayPrevDel = number_format($myrow2['qtyinvoiced'],2); + $DisplayQtySupplied = number_format($myrow2['quantity'] - $myrow2['qtyinvoiced']-$myrow2['qtyexpected']-$myrow2['qtypicked'],2); + $itemdesc = $myrow2['description'] . ' - ' . $myrow2['narrative']; + $sql='INSERT INTO pickinglistdetails + VALUES('. + $PickingListNo .','. + $Lines.','. + $myrow2['orderlineno'].','. + $DisplayQtySupplied.',0)'; + $lineresult=DB_query($sql, $db); + } + $ListCount ++; + + $LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column1->x,$Page_Height - $YPos,$FormDesign->Headings->Column1->Length,$FormDesign->Headings->Column1->FontSize,$myrow2['stkcode'],'left'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column2->x,$Page_Height - $YPos,$FormDesign->Headings->Column2->Length,$FormDesign->Headings->Column2->FontSize,$itemdesc); + $LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column3->x,$Page_Height - $YPos,$FormDesign->Headings->Column3->Length,$FormDesign->Headings->Column3->FontSize,$DisplayQty,'right'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column4->x,$Page_Height - $YPos,$FormDesign->Headings->Column4->Length,$FormDesign->Headings->Column4->FontSize,$DisplayQtySupplied,'right'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column5->x,$Page_Height - $YPos,$FormDesign->Headings->Column5->Length,$FormDesign->Headings->Column5->FontSize,$DisplayPrevDel,'right'); + + if ($Page_Height-$YPos-$line_height <= 50){ + /* We reached the end of the page so finsih off the page and start a newy */ + $PageNumber++; + include ('includes/PDFPickingListHeader.inc'); + } //end if need a new page headed up + else{ + /*increment a line down for the next line item */ + $YPos += ($line_height); + } + $Lines++; + } //end while there are line items to print out + + } /*end if there are order details to show on the order*/ +} /*end for loop to print the whole lot twice */ + +if ($ListCount == 0){ + $title = _('Print Picking List Error'); + include('includes/header.inc'); + include('includes/footer.inc'); + exit; +} else { + $pdf->OutputD($_SESSION['DatabaseName'] . '_PickingLists_' . date('Y-m-d') . '.pdf');//UldisN + $pdf->__destruct(); //UldisN +} +?> \ No newline at end of file Property changes on: trunk/PDFPickingList.php ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/companies/weberpdemo/FormDesigns/PickingList.xml =================================================================== --- trunk/companies/weberpdemo/FormDesigns/PickingList.xml (rev 0) +++ trunk/companies/weberpdemo/FormDesigns/PickingList.xml 2010-05-02 11:55:23 UTC (rev 3439) @@ -0,0 +1,321 @@ +<?xml version="1.0" encoding="UTF-8"?> +<form name="Picking List"> + <PaperSize name="Paper size">A4_Landscape</PaperSize> + <LineHeight name="Line height">12</LineHeight> + <logo type="image" name="Logo" id="Logo"> + <x>281</x> + <y>65</y> + <width>0</width> + <height>60</height> + </logo> + <Heading type="SimpleText" name="Heading" id="Heading"> + <FontSize>18</FontSize> + <x>341</x> + <y>80</y> + </Heading> + <HeadingLine2 type="SimpleText" name="Heading Line 2" id="HeadingLine2"> + <FontSize>18</FontSize> + <x>251</x> + <y>100</y> + </HeadingLine2> + <CompanyName type="SimpleText" name="Company name" id="CompanyName"> + <FontSize>10</FontSize> + <x>340</x> + <y>120</y> + </CompanyName> + <CompanyAddress type="ElementArray" name="Company address"> + <Line1 type="SimpleText" name="Line 1" id="CompanyAddress1"> + <FontSize>10</FontSize> + <x>340</x> + <y>130</y> + </Line1> + <Line2 type="SimpleText" name="Line 2" id="CompanyAddress2"> + <FontSize>10</FontSize> + <x>340</x> + <y>140</y> + </Line2> + <Line3 type="SimpleText" name="Line 3" id="CompanyAddress3"> + <FontSize>10</FontSize> + <x>340</x> + <y>150</y> + </Line3> + <Line4 type="SimpleText" name="Line 4" id="CompanyAddress4"> + <FontSize>10</FontSize> + <x>340</x> + <y>160</y> + </Line4> + <Line5 type="SimpleText" name="Line 5" id="CompanyAddress5"> + <FontSize>10</FontSize> + <x>340</x> + <y>170</y> + </Line5> + </CompanyAddress> + <CompanyPhone type="SimpleText" name="Company phone number" id="CompanyPhone"> + <FontSize>10</FontSize> + <x>340</x> + <y>180</y> + </CompanyPhone> + <CompanyFax type="SimpleText" name="Company fax number" id="CompanyFax"> + <FontSize>10</FontSize> + <x>340</x> + <y>190</y> + </CompanyFax> + <CompanyEmail type="SimpleText" name="Company email address" id="CompanyEmail"> + <FontSize>10</FontSize> + <x>340</x> + <y>200</y> + </CompanyEmail> + <DeliveryAddress type="ElementArray" name="Delivery address"> + <Caption type="SimpleText" name="Caption" id="DeliveryAddressCaption"> + <FontSize>14</FontSize> + <x>46</x> + <y>26</y> + </Caption> + <Line1 type="SimpleText" name="Line 1" id="DeliveryAddress1"> + <FontSize>12</FontSize> + <x>46</x> + <y>42</y> + </Line1> + <Line2 type="SimpleText" name="Line 2" id="DeliveryAddress2"> + <FontSize>12</FontSize> + <x>46</x> + <y>56</y> + </Line2> + <Line3 type="SimpleText" name="Line 3" id="DeliveryAddress3"> + <FontSize>12</FontSize> + <x>46</x> + <y>70</y> + </Line3> + <Line4 type="SimpleText" name="Line 4" id="DeliveryAddress4"> + <FontSize>12</FontSize> + <x>46</x> + <y>84</y> + </Line4> + <Line5 type="SimpleText" name="Line 5" id="DeliveryAddress5"> + <FontSize>12</FontSize> + <x>46</x> + <y>98</y> + </Line5> + </DeliveryAddress> + <CustomerAddress type="ElementArray" name="Delivery address"> + <Caption type="SimpleText" name="Caption" id="CustomerAddressCaption"> + <FontSize>14</FontSize> + <x>46</x> + <y>119</y> + </Caption> + <Name type="SimpleText" name="Name" id="Name"> + <FontSize>12</FontSize> + <x>46</x> + <y>133</y> + </Name> + <Line1 type="SimpleText" name="Line 1" id="CustomerAddress1"> + <FontSize>12</FontSize> + <x>46</x> + <y>147</y> + </Line1> + <Line2 type="SimpleText" name="Line 2" id="CustomerAddress2"> + <FontSize>12</FontSize> + <x>46</x> + <y>161</y> + </Line2> + <Line3 type="SimpleText" name="Line 3" id="CustomerAddress3"> + <FontSize>12</FontSize> + <x>46</x> + <y>175</y> + </Line3> + <Line4 type="SimpleText" name="Line 4" id="CustomerAddress4"> + <FontSize>12</FontSize> + <x>46</x> + <y>189</y> + </Line4> + <Line5 type="SimpleText" name="Line 5" id="CustomerAddress5"> + <FontSize>12</FontSize> + <x>46</x> + <y>203</y> + </Line5> + </CustomerAddress> + <OrderNumberCaption type="SimpleText" name="Order Number Caption" id="OrderNumberCaption"> + <FontSize>12</FontSize> + <x>620</x> + <y>35</y> + </OrderNumberCaption> + <OrderNumber type="SimpleText" name="Order Number" id="OrderNumber"> + <FontSize>12</FontSize> + <x>700</x> + <y>35</y> + </OrderNumber> + <DeliveryDateCaption type="SimpleText" name="Delivery Date Caption" id="DeliveryDateCaption"> + <FontSize>12</FontSize> + <x>620</x> + <y>49</y> + </DeliveryDateCaption> + <DeliveryDate type="SimpleText" name="Delivery Date" id="DeliveryDate"> + <FontSize>12</FontSize> + <x>700</x> + <y>49</y> + </DeliveryDate> + <DatePrintedCaption type="SimpleText" name="Date Printed Caption" id="DatePrintedCaption"> + <FontSize>12</FontSize> + <x>620</x> + <y>63</y> + </DatePrintedCaption> + <DatePrinted type="SimpleText" name="Date Printed" id="DatePrinted"> + <FontSize>12</FontSize> + <x>700</x> + <y>63</y> + </DatePrinted> + <CustomerCode type="SimpleText" name="Customer Code" id="CustomerCode"> + <FontSize>12</FontSize> + <x>620</x> + <y>83</y> + </CustomerCode> + <ShipperCode type="SimpleText" name="Shipper Code" id="ShipperCode"> + <FontSize>12</FontSize> + <x>620</x> + <y>97</y> + </ShipperCode> + <Comments type="MultiLineText" name="Comments" id="Comments"> + <FontSize>12</FontSize> + <x>620</x> + <y>117</y> + <Length>125</Length> + </Comments> + <PageNumberCaption type="SimpleText" name="Page Number Caption" id="PageNumberCaption"> + <FontSize>12</FontSize> + <x>620</x> + <y>173</y> + </PageNumberCaption> + <PageNumber type="SimpleText" name="Page Number" id="PageNumber"> + <FontSize>12</FontSize> + <x>700</x> + <y>173</y> + </PageNumber> + <Headings type="ElementArray" name="Column headings"> + <Column1 type="MultiLineText" name="Heading 1" id="Heading1"> + <FontSize>12</FontSize> + <x>25</x> + <y>228</y> + <Length>127</Length> + </Column1> + <Column2 type="MultiLineText" name="Heading 2" id="Heading2"> + <FontSize>12</FontSize> + <x>147</x> + <y>228</y> + <Length>255</Length> + </Column2> + <Column3 type="MultiLineText" name="Heading 3" id="Heading3"> + <FontSize>12</FontSize> + <x>400</x> + <y>228</y> + <Length>85</Length> + </Column3> + <Column4 type="MultiLineText" name="Heading 4" id="Heading4"> + <FontSize>12</FontSize> + <x>503</x> + <y>228</y> + <Length>85</Length> + </Column4> + <Column5 type="MultiLineText" name="Heading 5" id="Heading5"> + <FontSize>12</FontSize> + <x>602</x> + <y>228</y> + <Length>85</Length> + </Column5> + <Column6 type="MultiLineText" name="Heading 6" id="Heading6"> + <FontSize>12</FontSize> + <x>700</x> + <y>228</y> + <Length>85</Length> + </Column6> + </Headings> + <Data type="ElementArray" name="Column Data"> + <y type="StartLine" name="Y co-ordinate of first data line" id="DataStartLine">260</y> + <Column1 type="DataText" name="Heading 1" id="Heading1"> + <FontSize>12</FontSize> + <x>25</x> + <Length>127</Length> + </Column1> + <Column2 type="DataText" name="Heading 2" id="Heading2"> + <FontSize>12</FontSize> + <x>147</x> + <Length>255</Length> + </Column2> + <Column3 type="DataText" name="Heading 3" id="Heading3"> + <FontSize>12</FontSize> + <x>400</x> + <Length>85</Length> + </Column3> + <Column4 type="DataText" name="Heading 4" id="Heading4"> + <FontSize>12</FontSize> + <x>503</x> + <Length>85</Length> + </Column4> + <Column5 type="DataText" name="Heading 5" id="Heading5"> + <FontSize>12</FontSize> + <x>602</x> + <Length>85</Length> + </Column5> + <Column6 type="DataText" name="Heading 6" id="Heading6"> + <FontSize>12</FontSize> + <x>700</x> + <Length>85</Length> + </Column6> + </Data> + <DeliveryAddressBox type="CurvedRectangle" name="Delivery Address Box" id="DeliveryAddressBox"> + <x>40</x> + <y>22</y> + <width>180</width> + <height>70</height> + <radius>10</radius> + </DeliveryAddressBox> + <CustomerAddressBox type="CurvedRectangle" name="Customer Address Box" id="CustomerAddressBox"> + <x>40</x> + <y>116</y> + <width>200</width> + <height>80</height> + <radius>10</radius> + </CustomerAddressBox> + <DataBox type="CurvedRectangle" name="Data Box" id="DataBox"> + <x>20</x> + <y>226</y> + <width>792</width> + <height>350</height> + <radius>10</radius> + </DataBox> + <LineBelowColumns type="Line" name="Line Below Columns" id="LineBelowColumns"> + <startx>20</startx> + <starty>236</starty> + <endx>822</endx> + <endy>236</endy> + </LineBelowColumns> + <ColumnLine1 type="Line" name="Column Line 1" id="ColumnLine1"> + <startx>140</startx> + <starty>216</starty> + <endx>140</endx> + <endy>586</endy> + </ColumnLine1> + <ColumnLine2 type="Line" name="Column Line 2" id="ColumnLine2"> + <startx>395</startx> + <starty>216</starty> + <endx>395</endx> + <endy>586</endy> + </ColumnLine2> + <ColumnLine3 type="Line" name="Column Line 3" id="ColumnLine3"> + <startx>500</startx> + <starty>216</starty> + <endx>500</endx> + <endy>586</endy> + </ColumnLine3> + <ColumnLine4 type="Line" name="Column Line 4" id="ColumnLine4"> + <startx>600</startx> + <starty>216</starty> + <endx>600</endx> + <endy>586</endy> + </ColumnLine4> + <ColumnLine5 type="Line" name="Column Line 5" id="ColumnLine5"> + <startx>690</startx> + <starty>216</starty> + <endx>690</endx> + <endy>586</endy> + </ColumnLine5> +</form> \ No newline at end of file Property changes on: trunk/companies/weberpdemo/FormDesigns/PickingList.xml ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/css/silverwolf/default.css =================================================================== --- trunk/css/silverwolf/default.css 2010-05-02 10:25:49 UTC (rev 3438) +++ trunk/css/silverwolf/default.css 2010-05-02 11:55:23 UTC (rev 3439) @@ -87,6 +87,7 @@ table.selection { background-color:#eee; outline-style:solid; + outline-color: #8e8a8a; outline-width:1px; } Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-05-02 10:25:49 UTC (rev 3438) +++ trunk/doc/Change.log.html 2010-05-02 11:55:23 UTC (rev 3439) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>02/05/10 Tim: Add picking list printing</p> <p>02/05/10 Tim: Updates for case where no internet connection is present</p> <p>02/05/10 Tim: SelectProduct.php - Correctly show the next page of products in a search.</p> <p>01/05/10 Lindsay: Install now includes an option to install a logo.jpg file</p> Added: trunk/includes/PDFPickingListHeader.inc =================================================================== --- trunk/includes/PDFPickingListHeader.inc (rev 0) +++ trunk/includes/PDFPickingListHeader.inc 2010-05-02 11:55:23 UTC (rev 3439) @@ -0,0 +1,90 @@ +<?php +/* $Id$*/ +/* pdf-php by R&OS code to set up a new sales order page */ +if ($PageNumber>1){ + $pdf->newPage(); +} + +/* if the deliver blind flag is set on the order, we do not want to output +the company logo */ +$pdf->addJpegFromFile($_SESSION['LogoFile'],$FormDesign->logo->x,$Page_Height-$FormDesign->logo->y,$FormDesign->logo->width,$FormDesign->logo->height); + +$pdf->addText($FormDesign->Heading->x, $Page_Height-$FormDesign->Heading->y,$FormDesign->Heading->FontSize, _('Picking List') ); +$pdf->addText($FormDesign->HeadingLine2->x, $Page_Height-$FormDesign->HeadingLine2->y,$FormDesign->HeadingLine2->FontSize, _('From').' '.$OrdersToPick[$i]['locationname'].' '. _('Warehouse')); + +/* if the deliver blind flag is set on the order, we do not want to output +the company contact info */ +$pdf->addText($FormDesign->CompanyName->x,$Page_Height - $FormDesign->CompanyName->y, $FormDesign->CompanyName->FontSize, $_SESSION['CompanyRecord']['coyname']); +$pdf->addText($FormDesign->CompanyAddress->Line1->x,$Page_Height - $FormDesign->CompanyAddress->Line1->y, $FormDesign->CompanyAddress->Line1->FontSize, $_SESSION['CompanyRecord']['regoffice1']); +$pdf->addText($FormDesign->CompanyAddress->Line2->x,$Page_Height - $FormDesign->CompanyAddress->Line2->y, $FormDesign->CompanyAddress->Line2->FontSize, $_SESSION['CompanyRecord']['regoffice2']); +$pdf->addText($FormDesign->CompanyAddress->Line3->x,$Page_Height - $FormDesign->CompanyAddress->Line3->y, $FormDesign->CompanyAddress->Line3->FontSize, $_SESSION['CompanyRecord']['regoffice3']); +$pdf->addText($FormDesign->CompanyAddress->Line4->x,$Page_Height - $FormDesign->CompanyAddress->Line4->y, $FormDesign->CompanyAddress->Line4->FontSize, $_SESSION['CompanyRecord']['regoffice4']); +$pdf->addText($FormDesign->CompanyAddress->Line5->x,$Page_Height - $FormDesign->CompanyAddress->Line5->y, $FormDesign->CompanyAddress->Line5->FontSize, $_SESSION['CompanyRecord']['regoffice5']); +$pdf->addText($FormDesign->CompanyPhone->x,$Page_Height - $FormDesign->CompanyPhone->y, $FormDesign->CompanyPhone->FontSize, _('Tel'). ': ' . $_SESSION['CompanyRecord']['telephone']); +$pdf->addText($FormDesign->CompanyFax->x,$Page_Height - $FormDesign->CompanyFax->y, $FormDesign->CompanyFax->FontSize, _('Fax').': ' . $_SESSION['CompanyRecord']['fax']); +$pdf->addText($FormDesign->CompanyEmail->x,$Page_Height - $FormDesign->CompanyEmail->y, $FormDesign->CompanyEmail->FontSize, _('Email'). ': ' .$_SESSION['CompanyRecord']['email']); + +/*Now the delivery details */ +$pdf->addText($FormDesign->DeliveryAddress->Caption->x,$Page_Height - $FormDesign->DeliveryAddress->Caption->y, $FormDesign->DeliveryAddress->Caption->FontSize, _('Deliver To') . ':' ); +$pdf->addText($FormDesign->DeliveryAddress->Line1->x,$Page_Height - $FormDesign->DeliveryAddress->Line1->y, $FormDesign->DeliveryAddress->Line1->FontSize, $OrdersToPick[$i]['deladd1']); +$pdf->addText($FormDesign->DeliveryAddress->Line2->x,$Page_Height - $FormDesign->DeliveryAddress->Line2->y, $FormDesign->DeliveryAddress->Line2->FontSize, $OrdersToPick[$i]['deladd2']); +$pdf->addText($FormDesign->DeliveryAddress->Line3->x,$Page_Height - $FormDesign->DeliveryAddress->Line3->y, $FormDesign->DeliveryAddress->Line3->FontSize, $OrdersToPick[$i]['deladd3']); +$pdf->addText($FormDesign->DeliveryAddress->Line4->x,$Page_Height - $FormDesign->DeliveryAddress->Line4->y, $FormDesign->DeliveryAddress->Line4->FontSize, $OrdersToPick[$i]['deladd4']); +$pdf->addText($FormDesign->DeliveryAddress->Line5->x,$Page_Height - $FormDesign->DeliveryAddress->Line5->y, $FormDesign->DeliveryAddress->Line5->FontSize, $OrdersToPick[$i]['deladd5']); + +/*Now the customer details */ +$pdf->addText($FormDesign->CustomerAddress->Caption->x,$Page_Height - $FormDesign->CustomerAddress->Caption->y, $FormDesign->CustomerAddress->Caption->FontSize, _('Customer') . ':' ); +$pdf->addText($FormDesign->CustomerAddress->Name->x,$Page_Height - $FormDesign->CustomerAddress->Name->y, $FormDesign->CustomerAddress->Name->FontSize, $OrdersToPick[$i]['name']); +$pdf->addText($FormDesign->CustomerAddress->Line1->x,$Page_Height - $FormDesign->CustomerAddress->Line1->y, $FormDesign->CustomerAddress->Line1->FontSize, $OrdersToPick[$i]['address1']); +$pdf->addText($FormDesign->CustomerAddress->Line2->x,$Page_Height - $FormDesign->CustomerAddress->Line2->y, $FormDesign->CustomerAddress->Line2->FontSize, $OrdersToPick[$i]['address2']); +$pdf->addText($FormDesign->CustomerAddress->Line3->x,$Page_Height - $FormDesign->CustomerAddress->Line3->y, $FormDesign->CustomerAddress->Line3->FontSize, $OrdersToPick[$i]['address3']); +$pdf->addText($FormDesign->CustomerAddress->Line4->x,$Page_Height - $FormDesign->CustomerAddress->Line4->y, $FormDesign->CustomerAddress->Line4->FontSize, $OrdersToPick[$i]['address4']); +$pdf->addText($FormDesign->CustomerAddress->Line5->x,$Page_Height - $FormDesign->CustomerAddress->Line5->y, $FormDesign->CustomerAddress->Line5->FontSize, $OrdersToPick[$i]['address5']); + +$pdf->addText($FormDesign->OrderNumberCaption->x,$Page_Height - $FormDesign->OrderNumberCaption->y, $FormDesign->OrderNumberCaption->FontSize, _('Order No'). ':'); +$pdf->addText($FormDesign->OrderNumber->x,$Page_Height - $FormDesign->OrderNumber->y, $FormDesign->OrderNumber->FontSize, $OrdersToPick[$i]['orderno']); +$pdf->addText($FormDesign->DeliveryDateCaption->x,$Page_Height - $FormDesign->DeliveryDateCaption->y, $FormDesign->DeliveryDateCaption->FontSize, _('Delivery Date'). ':'); +$pdf->addText($FormDesign->DeliveryDate->x,$Page_Height - $FormDesign->DeliveryDate->y, $FormDesign->DeliveryDate->FontSize, ConvertSQLDate($OrdersToPick[$i]['deliverydate'])); +$pdf->addText($FormDesign->DatePrintedCaption->x,$Page_Height - $FormDesign->DatePrintedCaption->y, $FormDesign->DatePrintedCaption->FontSize, _('Printed') . ': '); +$pdf->addText($FormDesign->DatePrinted->x,$Page_Height - $FormDesign->DatePrinted->y, $FormDesign->DatePrinted->FontSize, Date($_SESSION['DefaultDateFormat'])); + +$pdf->addText($FormDesign->CustomerCode->x,$Page_Height - $FormDesign->CustomerCode->y, $FormDesign->CustomerCode->FontSize, _('Customer No.'). ' : ' . $OrdersToPick[$i]['debtorno']); +$pdf->addText($FormDesign->ShipperCode->x,$Page_Height - $FormDesign->ShipperCode->y, $FormDesign->ShipperCode->FontSize, _('Shipped by'). ' : ' . $OrdersToPick[$i]['shippername']); + +$LeftOvers = $pdf->addTextWrap($FormDesign->Comments->x,$Page_Height - $FormDesign->Comments->y, $FormDesign->Comments->Length, $FormDesign->Comments->FontSize,stripcslashes($OrdersToPick[$i]['comments'])); + +if (strlen($LeftOvers)>1){ + $LeftOvers = $pdf->addTextWrap($FormDesign->Comments->x,$Page_Height - $FormDesign->Comments->y-14, $FormDesign->Comments->Length, $FormDesign->Comments->FontSize,$LeftOvers); + if (strlen($LeftOvers)>1){ + $LeftOvers = $pdf->addTextWrap($FormDesign->Comments->x,$Page_Height - $FormDesign->Comments->y-28, $FormDesign->Comments->Length, $FormDesign->Comments->FontSize,$LeftOvers); + if (strlen($LeftOvers)>1){ + $LeftOvers = $pdf->addTextWrap($FormDesign->Comments->x,$Page_Height - $FormDesign->Comments->y-42, $FormDesign->Comments->Length, $FormDesign->Comments->FontSize,$LeftOvers); + if (strlen($LeftOvers)>1){ + $LeftOvers = $pdf->addTextWrap($FormDesign->Comments->x,$Page_Height - $FormDesign->Comments->y-56, $FormDesign->Comments->Length, $FormDesign->Comments->FontSize,$LeftOvers); + } + } + } +} + +$pdf->addText($FormDesign->PageNumberCaption->x,$Page_Height - $FormDesign->PageNumberCaption->y, $FormDesign->PageNumberCaption->FontSize, _('Page'). ':'); +$pdf->addText($FormDesign->PageNumber->x,$Page_Height - $FormDesign->PageNumber->y, $FormDesign->PageNumber->FontSize, $PageNumber); + +$LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column1->x,$Page_Height - $FormDesign->Headings->Column1->y,$FormDesign->Headings->Column1->Length , $FormDesign->Headings->Column1->FontSize, _('Item Code'),'left'); +$LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column2->x,$Page_Height - $FormDesign->Headings->Column2->y,$FormDesign->Headings->Column2->Length , $FormDesign->Headings->Column2->FontSize, _('Item Description'),'left'); +$LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column3->x,$Page_Height - $FormDesign->Headings->Column3->y,$FormDesign->Headings->Column3->Length , $FormDesign->Headings->Column3->FontSize, _('Quantity'),'right'); +$LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column4->x,$Page_Height - $FormDesign->Headings->Column4->y,$FormDesign->Headings->Column4->Length , $FormDesign->Headings->Column4->FontSize,_('This Del'),'right'); +$LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column5->x,$Page_Height - $FormDesign->Headings->Column5->y,$FormDesign->Headings->Column5->Length , $FormDesign->Headings->Column5->FontSize, _('Prev Dels'),'right'); +$LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column6->x,$Page_Height - $FormDesign->Headings->Column6->y,$FormDesign->Headings->Column6->Length , $FormDesign->Headings->Column6->FontSize, _('Actual Picked'),'right'); + +$pdf->RoundRectangle($FormDesign->DeliveryAddressBox->x, $Page_Height - $FormDesign->DeliveryAddressBox->y,$FormDesign->DeliveryAddressBox->width, $FormDesign->DeliveryAddressBox->height, $FormDesign->DeliveryAddressBox->radius); +$pdf->RoundRectangle($FormDesign->CustomerAddressBox->x, $Page_Height - $FormDesign->CustomerAddressBox->y,$FormDesign->CustomerAddressBox->width, $FormDesign->CustomerAddressBox->height, $FormDesign->CustomerAddressBox->radius); +$pdf->RoundRectangle($FormDesign->DataBox->x, $Page_Height - $FormDesign->DataBox->y,$FormDesign->DataBox->width, $FormDesign->DataBox->height, $FormDesign->DataBox->radius); + +$pdf->line($FormDesign->LineBelowColumns->startx, $Page_Height -$FormDesign->LineBelowColumns->starty,$FormDesign->LineBelowColumns->endx, $Page_Height -$FormDesign->LineBelowColumns->endy); +$pdf->line($FormDesign->ColumnLine1->startx, $Page_Height -$FormDesign->ColumnLine1->starty,$FormDesign->ColumnLine1->endx, $Page_Height -$FormDesign->ColumnLine1->endy); +$pdf->line($FormDesign->ColumnLine2->startx, $Page_Height -$FormDesign->ColumnLine2->starty,$FormDesign->ColumnLine2->endx, $Page_Height -$FormDesign->ColumnLine2->endy); +$pdf->line($FormDesign->ColumnLine3->startx, $Page_Height -$FormDesign->ColumnLine3->starty,$FormDesign->ColumnLine3->endx, $Page_Height -$FormDesign->ColumnLine3->endy); +$pdf->line($FormDesign->ColumnLine4->startx, $Page_Height -$FormDesign->ColumnLine4->starty,$FormDesign->ColumnLine4->endx, $Page_Height -$FormDesign->ColumnLine4->endy); +$pdf->line($FormDesign->ColumnLine5->startx, $Page_Height -$FormDesign->ColumnLine5->starty,$FormDesign->ColumnLine5->endx, $Page_Height -$FormDesign->ColumnLine5->endy); + +?> \ No newline at end of file Property changes on: trunk/includes/PDFPickingListHeader.inc ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/index.php =================================================================== --- trunk/index.php 2010-05-02 10:25:49 UTC (rev 3438) +++ trunk/index.php 2010-05-02 11:55:23 UTC (rev 3439) @@ -109,7 +109,7 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFPickingList.php?' .sid . '&NewOrder=Yes">' . _('Print Picking Lists') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFPickingList.php?' .sid . '">' . _('Print Picking Lists') . '</a></p>'; ?> </td> </tr> <tr> Modified: trunk/sql/mysql/upgrade3.11.1-3.12.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-3.12.sql 2010-05-02 10:25:49 UTC (rev 3438) +++ trunk/sql/mysql/upgrade3.11.1-3.12.sql 2010-05-02 11:55:23 UTC (rev 3439) @@ -132,6 +132,27 @@ INSERT INTO `config` (`confname`, `confvalue`) VALUES ('RequirePickingNote',0); +CREATE TABLE IF NOT EXISTS `pickinglists` ( + `pickinglistno` int(11) NOT NULL DEFAULT 0, + `orderno` int(11) NOT NULL DEFAULT 0, + `pickinglistdate` date NOT NULL default '0000-00-00', + `dateprinted` date NOT NULL default '0000-00-00', + `deliverynotedate` date NOT NULL default '0000-00-00', + CONSTRAINT `pickinglists_ibfk_1` FOREIGN KEY (`orderno`) REFERENCES `salesorders` (`orderno`), + PRIMARY KEY (`pickinglistno`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `pickinglistdetails` ( + `pickinglistno` int(11) NOT NULL DEFAULT 0, + `pickinglistlineno` int(11) NOT NULL DEFAULT 0, + `orderlineno` int(11) NOT NULL DEFAULT 0, + `qtyexpected` double NOT NULL default 0.00, + `qtypicked` double NOT NULL default 0.00, + CONSTRAINT `pickinglistdetails_ibfk_1` FOREIGN KEY (`pickinglistno`) REFERENCES `pickinglists` (`pickinglistno`), + PRIMARY KEY (`pickinglistno`, `pickinglistlineno`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO `systypes` VALUES(19, 'Picking List', 0); ALTER TABLE `prices` ADD `startdate` DATE NOT NULL , ADD `enddate` DATE NOT NULL DEFAULT '9999-12-31'; ALTER TABLE prices DROP PRIMARY KEY , ADD PRIMARY KEY ( `stockid` , `typeabbrev` , `currabrev` , `debtorno` , `startdate` , `enddate` ) ; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |