From: <tim...@us...> - 2010-03-19 06:40:56
|
Revision: 3393 http://web-erp.svn.sourceforge.net/web-erp/?rev=3393&view=rev Author: tim_schofield Date: 2010-03-19 06:40:49 +0000 (Fri, 19 Mar 2010) Log Message: ----------- Tim: Add report of custmer transactions entered on a given date Modified Paths: -------------- trunk/ConfirmDispatch_Invoice.php trunk/Credit_Invoice.php trunk/CustomerReceipt.php trunk/RecurringSalesOrdersProcess.php trunk/SelectCreditItems.php trunk/doc/Change.log.html trunk/index.php trunk/sql/mysql/upgrade3.11.1-3.12.sql Added Paths: ----------- trunk/PDFCustTransListing.php trunk/includes/PDFCustTransListingPageHeader.inc Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2010-03-18 19:15:51 UTC (rev 3392) +++ trunk/ConfirmDispatch_Invoice.php 2010-03-19 06:40:49 UTC (rev 3393) @@ -715,6 +715,7 @@ debtorno, branchcode, trandate, + inputdate, prd, reference, tpe, @@ -733,6 +734,7 @@ '" . $_SESSION['Items']->DebtorNo . "', '" . $_SESSION['Items']->Branch . "', '" . $DefaultDispatchDate . "', + '" . date('Y-m-d H-i-s') . "', " . $PeriodNo . ", '', '" . $_SESSION['Items']->DefaultSalesType . "', @@ -1447,7 +1449,7 @@ unset($_SESSION['ProcessingOrder']); echo prnMsg( _('Invoice number'). ' '. $InvoiceNo .' '. _('processed'), 'success'); - + echo '<br><div class="centre">'; if ($_SESSION['InvoicePortraitFormat']==0){ @@ -1461,7 +1463,7 @@ } else { /*Process Invoice not set so allow input of invoice data */ - + if (!isset($_POST['Consignment'])) { $_POST['Consignment']=''; } Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2010-03-18 19:15:51 UTC (rev 3392) +++ trunk/Credit_Invoice.php 2010-03-19 06:40:49 UTC (rev 3393) @@ -53,7 +53,7 @@ locations.taxprovinceid FROM debtortrans INNER JOIN debtorsmaster ON debtortrans.debtorno = debtorsmaster.debtorno - INNER JOIN custbranch ON + INNER JOIN custbranch ON debtortrans.branchcode = custbranch.branchcode AND debtortrans.debtorno = custbranch.debtorno INNER JOIN currencies ON @@ -92,7 +92,7 @@ $_SESSION['CreditItems']->FreightCost = $myrow['ovfreight']; $_SESSION['CreditItems']->DispatchTaxProvince = $myrow['taxprovinceid']; $_SESSION['CreditItems']->GetFreightTaxes(); - + DB_free_result($GetInvHdrResult); /*now populate the line items array with the stock movement records for the invoice*/ @@ -114,8 +114,8 @@ stockmoves.qty as quantity, stockmoves.discountpercent, stockmoves.trandate, - stockmaster.materialcost - + stockmaster.labourcost + stockmaster.materialcost + + stockmaster.labourcost + stockmaster.overheadcost AS standardcost, stockmoves.narrative FROM stockmoves, stockmaster @@ -132,9 +132,9 @@ if (db_num_rows($LineItemsResult)>0) { while ($myrow=db_fetch_array($LineItemsResult)) { - + $LineNumber = $_SESSION['CreditItems']->LineCounter; - + $_SESSION['CreditItems']->add_to_cart($myrow['stockid'], $myrow['quantity'], $myrow['description'], @@ -161,7 +161,7 @@ $myrow['standardcost'] ); $_SESSION['CreditItems']->GetExistingTaxes($LineNumber, $myrow['stkmoveno']); - + if ($myrow['controlled']==1){/* Populate the SerialItems array too*/ $SQL = 'SELECT serialno, @@ -199,12 +199,12 @@ if (isset($_POST['Location'])){ $_SESSION['CreditItems']->Location = $_POST['Location']; - + $NewDispatchTaxProvResult = DB_query("SELECT taxprovinceid FROM locations WHERE loccode='" . $_POST['Location'] . "'",$db); $myrow = DB_fetch_array($NewDispatchTaxProvResult); - + $_SESSION['CreditItems']->DispatchTaxProvince = $myrow['taxprovinceid']; - + foreach ($_SESSION['CreditItems']->LineItems as $LineItem) { $_SESSION['CreditItems']->GetTaxes($LineItem->LineNumber); } @@ -324,7 +324,7 @@ 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>'; $i=0; @@ -339,10 +339,10 @@ } echo '</td>'; echo '<td class=number>'; - + $i=0; // initialise the number of taxes iterated through $TaxLineTotal =0; //initialise tax total for the line - + if (is_array($LnItm->Taxes) ){ foreach ($LnItm->Taxes AS $Tax) { if ($i>0){ @@ -360,10 +360,10 @@ $TaxGLCodes[$Tax->TaxAuthID] = $Tax->TaxGLCode; } } - echo '</td>'; - + echo '</td>'; + $TaxTotal += $TaxLineTotal; - + $DisplayTaxAmount = number_format($TaxLineTotal ,2); $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,2); @@ -406,9 +406,9 @@ if ($i>0){ echo '<br>'; } - + 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)); $FreightTaxTotal += ($FreightTaxLine->TaxRate * ($_SESSION['CreditItems']->FreightCost + $FreightTaxTotal)); @@ -450,9 +450,9 @@ /* SQL to process the postings for sales credit notes... First Get the area where the credit note is to from the branches table */ - $SQL = "SELECT area - FROM custbranch - WHERE custbranch.debtorno ='". $_SESSION['CreditItems']->DebtorNo . "' + $SQL = "SELECT area + FROM custbranch + WHERE custbranch.debtorno ='". $_SESSION['CreditItems']->DebtorNo . "' AND custbranch.branchcode = '" . $_SESSION['CreditItems']->Branch . "'"; $Result = DB_query($SQL,$db); @@ -471,10 +471,10 @@ /*Now Get the next credit note number - function in SQL_CommonFunctions*/ - + $CreditNo = GetNextTransNo(11, $db); $PeriodNo = GetPeriod($DefaultDispatchDate, $db); - + /*Start an SQL transaction */ $SQL = 'BEGIN'; @@ -537,6 +537,7 @@ debtorno, branchcode, trandate, + inputdate, prd, reference, tpe, @@ -553,6 +554,7 @@ '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', '" . $DefaultDispatchDate . "', + '" . date('Y-m-d H-i-s') . "', " . $PeriodNo . ", 'Inv-" . $_SESSION['ProcessingCredit'] . "', '" . $_SESSION['CreditItems']->DefaultSalesType . "', " . $_SESSION['CreditItems']->OrderNo . ", @@ -568,17 +570,17 @@ $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); $CreditTransID = DB_Last_Insert_ID($db,'debtortrans','id'); - + /* Insert the tax totals for each tax authority where tax was charged on the invoice */ foreach ($TaxTotals AS $TaxAuthID => $TaxAmount) { - + $SQL = 'INSERT INTO debtortranstaxes (debtortransid, taxauthid, taxamount) VALUES (' . $CreditTransID . ', ' . $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'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); @@ -637,7 +639,7 @@ if ($_POST['CreditType']=='Return'){ /* some want this some do not */ - + $SQL = "UPDATE salesorderdetails SET qtyinvoiced = qtyinvoiced - " . $OrderLine->QtyDispatched . ", completed=0 @@ -648,9 +650,9 @@ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales order detail record could not be updated for the reduced quantity invoiced because'); $DbgMsg = _('The following SQL to update the sales order detail record was used'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); - - - + + + /* Update location stock records if not a dummy stock item */ if ($MBFlag=='B' OR $MBFlag=='M') { @@ -672,10 +674,10 @@ $sql = "SELECT bom.component, bom.quantity, - stockmaster.materialcost - + stockmaster.labourcost + stockmaster.materialcost + + stockmaster.labourcost + stockmaster.overheadcost AS standard - FROM bom, + FROM bom, stockmaster WHERE bom.component=stockmaster.stockid AND bom.parent='" . $OrderLine->StockID . "' @@ -687,7 +689,7 @@ $AssResult = DB_query($sql,$db, $ErrMsg, $DbgMsg, true); while ($AssParts = DB_fetch_array($AssResult,$db)){ - + $StandardCost += $AssParts['standard']; /*Determine the type of stock item being credited */ $SQL = "SELECT mbflag @@ -882,22 +884,22 @@ WHERE stockid='" . $OrderLine->StockID . "' AND loccode='" . $_SESSION['CreditItems']->Location . "' AND serialno='" . $Item->BundleRef . "'"; - + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be selected because'); $DbgMsg = _('The following SQL to select the serial stock item record was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); if (DB_num_rows($Result)==0){ - $SQL = "INSERT INTO stockserialitems (stockid, - loccode, - serialno, + $SQL = "INSERT INTO stockserialitems (stockid, + loccode, + serialno, quantity) VALUES - ('" . $OrderLine->StockID . "', - '" . $_SESSION['CreditItems']->Location . "', - '" . $Item->BundleRef . "', + ('" . $OrderLine->StockID . "', + '" . $_SESSION['CreditItems']->Location . "', + '" . $Item->BundleRef . "', ". $Item->BundleQty .")"; - + $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'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -915,13 +917,13 @@ /* now insert the serial stock movement */ - $SQL = "INSERT INTO stockserialmoves (stockmoveno, - stockid, - serialno, - moveqty) - VALUES (" . $StkMoveNo . ", - '" . $OrderLine->StockID . "', - '" . $Item->BundleRef . "', + $SQL = "INSERT INTO stockserialmoves (stockmoveno, + 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'); @@ -959,7 +961,7 @@ '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', " . $LocalCurrencyPrice . ", - " . $PeriodNo . ", + " . $PeriodNo . ", '" . _('Ex Inv') . ' - ' . $_SESSION['ProcessingCredit'] . "', " . $OrderLine->QtyDispatched . ", " . $OrderLine->DiscountPercent . ", @@ -1069,7 +1071,7 @@ ' . $Tax->TaxRate . ', ' . $Tax->TaxCalculationOrder . ', ' . $Tax->TaxOnTax . ')'; - + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Taxes and rates applicable to this credit note line item could not be inserted because'); $DbgMsg = _('The following SQL to insert the stock movement tax detail records was used'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); @@ -1216,7 +1218,7 @@ /* If GLLink_Stock then insert GLTrans to credit stock and debit cost of sales at standard cost*/ - if ($_SESSION['CompanyRecord']['gllink_stock']==1 + if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND ($OrderLine->StandardCost !=0 OR (isset($StandardCost) and $StandardCost !=0)) AND $_POST['CreditType']!='ReverseOverCharge'){ @@ -1388,24 +1390,24 @@ $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); } - foreach ( $TaxTotals as $TaxAuthID => $TaxAmount){ + foreach ( $TaxTotals as $TaxAuthID => $TaxAmount){ if ($TaxAmount !=0 ){ $SQL = "INSERT INTO gltrans ( - type, - typeno, - trandate, - periodno, - account, - narrative, + type, + typeno, + trandate, + periodno, + account, + narrative, amount - ) + ) VALUES ( - 11, - " . $CreditNo . ", - '" . $DefaultDispatchDate . "', - " . $PeriodNo . ", - " . $TaxGLCodes[$TaxAuthID] . ", - '" . $_SESSION['CreditItems']->DebtorNo . "', + 11, + " . $CreditNo . ", + '" . $DefaultDispatchDate . "', + " . $PeriodNo . ", + " . $TaxGLCodes[$TaxAuthID] . ", + '" . $_SESSION['CreditItems']->DebtorNo . "', " . ($TaxAmount/$_SESSION['CurrencyRate']) . " )"; @@ -1418,7 +1420,7 @@ $SQL='COMMIT'; $Result = DB_query($SQL,$db); - + unset($_SESSION['CreditItems']->LineItems); unset($_SESSION['CreditItems']); unset($_SESSION['ProcessingCredit']); @@ -1482,10 +1484,10 @@ echo '<tr><td>' . _('Write off the cost of the goods to') . '</td><td><select TABINDEX='.$j.' name="WriteOffGLCode">'; - $SQL='SELECT accountcode, - accountname - FROM chartmaster, accountgroups - WHERE chartmaster.group_=accountgroups.groupname + $SQL='SELECT accountcode, + accountname + FROM chartmaster, accountgroups + WHERE chartmaster.group_=accountgroups.groupname AND accountgroups.pandl=1 ORDER BY chartmaster.accountcode'; $Result = DB_query($SQL,$db); Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2010-03-18 19:15:51 UTC (rev 3392) +++ trunk/CustomerReceipt.php 2010-03-19 06:40:49 UTC (rev 3393) @@ -144,7 +144,7 @@ if (!isset($_POST['CustomerName'])) { $_POST['CustomerName']=''; } - + $_SESSION['ReceiptBatch']->add_to_batch($_POST['Amount'], $_POST['CustomerID'], $_POST['Discount'], @@ -214,7 +214,7 @@ $CustomerReceiptCounter=1; //Count lines of customer receipts in this batch 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><tr><th>'._('Batch Number').'</th> <th>'._('Date Banked').'</th> <th>'._('Customer Name').'</th @@ -222,7 +222,7 @@ <th>'._('Amount of Receipt').'</th></tr>'; foreach ($_SESSION['ReceiptBatch']->Items as $ReceiptItem) { - + if ($k==1){ echo '<tr class="OddTableRows">'; $k=0; @@ -241,7 +241,7 @@ echo '<td><a target="_blank" href="' . $rootpath . '/PDFReceipt.php?BatchNumber=' . $_SESSION['ReceiptBatch']->BatchNo. '&ReceiptNumber='.$CustomerReceiptCounter.'">'._('Print a Customer Receipt').'</a></td></tr>'; $CustomerReceiptCounter += 1; } - + if ($ReceiptItem->GLCode !=''){ if ($_SESSION['CompanyRecord']['gllink_debtors']==1){ /* then enter a GLTrans record */ $SQL = 'INSERT INTO gltrans (type, @@ -353,6 +353,7 @@ debtorno, branchcode, trandate, + inputdate, prd, reference, tpe, @@ -365,6 +366,7 @@ '" . $ReceiptItem->Customer . "', '', '" . FormatDateForSQL($_SESSION['ReceiptBatch']->DateBanked) . "', + '" . date('Y-m-d H-i-s') . "', " . $PeriodNo . ", '" . $_SESSION['ReceiptBatch']->ReceiptType . ' ' . $ReceiptItem->PayeeBankDetail . "', '', @@ -515,7 +517,7 @@ if (strlen($_POST['Keywords'])>0) { //insert wildcard characters in spaces $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; - + $SQL = "SELECT debtorsmaster.debtorno, debtorsmaster.name FROM debtorsmaster Added: trunk/PDFCustTransListing.php =================================================================== --- trunk/PDFCustTransListing.php (rev 0) +++ trunk/PDFCustTransListing.php 2010-03-19 06:40:49 UTC (rev 3393) @@ -0,0 +1,143 @@ +<?php + +/* $Id$*/ + +/* $Revision: 1.13 $ */ + +$PageSecurity = 3; +include('includes/SQL_CommonFunctions.inc'); +include ('includes/session.inc'); + +$InputError=0; +if (isset($_POST['Date']) AND !Is_Date($_POST['Date'])){ + $msg = _('The date must be specified in the format') . ' ' . $_SESSION['DefaultDateFormat']; + $InputError=1; + unset($_POST['Date']); +} + +if (!isset($_POST['Date'])){ + + $title = _('Customer Transaction Listing'); + include ('includes/header.inc'); + + echo '<div class="centre"><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="">' . ' ' + . _('Customer Transaction Listing'); + + if ($InputError==1){ + prnMsg($msg,'error'); + } + + echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; + echo '<table> + <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>'; + + echo "<select name='TransType'>"; + + echo '<option value=10>' . _('Invoices').'</option>'; + echo '<option value=11>' . _('Credit Notes').'</option>'; + echo '<option value=12>' . _('Receipts').'</option>'; + + echo '</select></td></tr>'; + + echo "</select></td></tr></table><div class='centre'><input type=submit name='Go' value='" . _('Create PDF') . "'></div>"; + + + include('includes/footer.inc'); + exit; +} else { + + include('includes/ConnectDB.inc'); +} + +$sql= "SELECT type, + debtorno, + transno, + trandate, + ovamount, + ovgst, + invtext + FROM debtortrans + WHERE type=" . $_POST['TransType'] . " + AND date_format(inputdate, '%Y/%m/%d')='".FormatDateForSQL($_POST['Date'])."'"; + +$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'); + } + include('includes/footer.inc'); + exit; +} elseif (DB_num_rows($result) == 0){ + $title = _('Payment Listing'); + include('includes/header.inc'); + prnMsg (_('There were no bank transactions found in the database within the period from') . ' ' . $_POST['Date'] ._('Please try again selecting a different date range or account'), 'error'); + include('includes/footer.inc'); + exit; +} + +include('includes/PDFStarter.php'); + +/*PDFStarter.php has all the variables for page size and width set up depending on the users default preferences for paper size */ + +$pdf->addInfo('Title',_('Customer Transaction Listing')); +$pdf->addInfo('Subject',_('Customer transaction listing from') . ' ' . $_POST['Date'] ); +$line_height=12; +$PageNumber = 1; +$TotalCheques = 0; + +include ('includes/PDFCustTransListingPageHeader.inc'); + +while ($myrow=DB_fetch_array($result)){ + + $sql='SELECT name FROM debtorsmaster WHERE debtorno="'.$myrow['debtorno'].'"'; + $supplierresult=DB_query($sql, $db); + $supplierrow=DB_fetch_array($supplierresult); + + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$supplierrow['name'], 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,$myrow['transno'], 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,ConvertSQLDate($myrow['trandate']), 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,number_format($myrow['ovamount'],2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,number_format($myrow['ovgst'],2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,number_format($myrow['ovamount']+$myrow['ovgst'],2), 'right'); + + $YPos -= ($line_height); + $TotalCheques = $TotalCheques - $myrow['ovamount']; + + if ($YPos - (2 *$line_height) < $Bottom_Margin){ + /*Then set up a new page */ + $PageNumber++; + include ('includes/PDFCustTransListingPageHeader.inc'); + } /*end of new page header */ +} /* end of while there are customer receipts in the batch to print */ + + +$YPos-=$line_height; +$LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,number_format(-$TotalCheques,2), 'right'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+265,$YPos,300,$FontSize,_('Total') . ' ' . _('Transactions'), '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'] . '_CustTransListing_' . date('Y-m-d').'.pdf'; +$pdf->OutputD($ReportFileName);//UldisN +$pdf->__destruct(); //UldisN + +?> \ No newline at end of file Property changes on: trunk/PDFCustTransListing.php ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/RecurringSalesOrdersProcess.php =================================================================== --- trunk/RecurringSalesOrdersProcess.php 2010-03-18 19:15:51 UTC (rev 3392) +++ trunk/RecurringSalesOrdersProcess.php 2010-03-19 06:40:49 UTC (rev 3393) @@ -83,7 +83,7 @@ echo '<br>' . _('Date calculated for the next recurrence was') .': ' . $DelDate; $OrderNo = GetNextTransNo(30, $db); - + $HeaderSQL = "INSERT INTO salesorders ( orderno, debtorno, @@ -633,6 +633,7 @@ debtorno, branchcode, trandate, + inputdate, prd, reference, tpe, @@ -650,6 +651,7 @@ '" . $RecurrOrderRow['debtorno'] . "', '" . $RecurrOrderRow['branchcode'] . "', '" . $DelDate . "', + '" . date('Y-m-d H-i-s') . "', " . $PeriodNo . ", '" . $RecurrOrderRow['customerref'] . "', '" . $RecurrOrderRow['sales_type'] . "', Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2010-03-18 19:15:51 UTC (rev 3392) +++ trunk/SelectCreditItems.php 2010-03-19 06:40:49 UTC (rev 3393) @@ -281,7 +281,7 @@ If ($_POST['Keywords']!="") { //insert wildcard characters in spaces $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; - + if ($_POST['StockCat']=='All'){ $SQL = "SELECT stockmaster.stockid, stockmaster.description, @@ -1066,6 +1066,7 @@ debtorno, branchcode, trandate, + inputdate, prd, tpe, ovamount, @@ -1077,7 +1078,9 @@ 11, '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', - '" . $SQLCreditDate . "', " . $PeriodNo . ", + '" . $SQLCreditDate . "', + '" . date('Y-m-d H-i-s') . "', + " . $PeriodNo . ", '" . $_SESSION['CreditItems']->DefaultSalesType . "', " . -($_SESSION['CreditItems']->total) . ", " . -$TaxTotal . ", Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-03-18 19:15:51 UTC (rev 3392) +++ trunk/doc/Change.log.html 2010-03-19 06:40:49 UTC (rev 3393) @@ -1,6 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> -<p>18/03/10 Tim: Add report of supplier ransactions entered on a given date</p> +<p>18/03/10 Tim: Add report of customer transactions entered on a given date</p> +<p>18/03/10 Tim: Add report of supplier transactions entered on a given date</p> <p>17/03/10 Tim: Various layout improvements to top items report</p> <p>16/03/10 Tim: PO_SelecOSPurchOrder.php - Various layout changes for consistency and to stick to coding guidelines</p> <p>16/03/10 Anand: DateFunctions.inc - When getting the period number compare the same date formats</p> Added: trunk/includes/PDFCustTransListingPageHeader.inc =================================================================== --- trunk/includes/PDFCustTransListingPageHeader.inc (rev 0) +++ trunk/includes/PDFCustTransListingPageHeader.inc 2010-03-19 06:40:49 UTC (rev 3393) @@ -0,0 +1,60 @@ +<?php +/* $Id$*/ +if ($PageNumber>1){ + $pdf->newPage(); +} + +$YPos = $Page_Height - $Top_Margin - 50; + +$pdf->addJpegFromFile($_SESSION['LogoFile'],$Left_Margin,$YPos,0,50); + +$FontSize=15; + +Switch ($_POST['TransType']) { + case 10: + $TransType=_('Customer Invoices'); + break; + case 11: + $TransType=_('Customer Credit Notes'); + break; + case 12: + $TransType=_('Customer Payments'); +} + +$XPos = $Left_Margin; +$YPos -= 40; +$pdf->addText($XPos, $YPos,$FontSize, $_SESSION['CompanyRecord']['coyname']); +$FontSize=12; +$pdf->addText($XPos, $YPos-20,$FontSize, $TransType . ' ' ._('input on') . ' ' . $_POST['Date']); + +$XPos = $Page_Width-$Right_Margin-50; +$YPos -=30; +$pdf->addText($XPos, $YPos,$FontSize, _('Page') . ': ' . $PageNumber); + +/*Now print out the company name and address */ +$XPos = $Left_Margin; +$YPos -= $line_height; + +/*draw a square grid for entering line items */ +$pdf->line($XPos, $YPos,$Page_Width-$Right_Margin, $YPos); +$pdf->line($Page_Width-$Right_Margin, $YPos,$Page_Width-$Right_Margin, $Bottom_Margin); +$pdf->line($Page_Width-$Right_Margin, $Bottom_Margin,$XPos, $Bottom_Margin); +$pdf->line($XPos, $Bottom_Margin,$XPos, $YPos); + +$YPos -= $line_height; +/*Set up headings */ +$FontSize=8; + +$LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,_('Customer'), 'centre'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,_('Reference'), 'centre'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,_('Trans Date'), 'centre'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,_('Net Amount'), 'right'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,_('Tax Amount'), 'right'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,_('Total Amount'), 'right'); +$YPos-=$line_height; + +/*draw a line */ +$pdf->line($XPos, $YPos,$Page_Width-$Right_Margin, $YPos); + +$YPos -= ($line_height); +?> \ No newline at end of file Property changes on: trunk/includes/PDFCustTransListingPageHeader.inc ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/index.php =================================================================== --- trunk/index.php 2010-03-18 19:15:51 UTC (rev 3392) +++ trunk/index.php 2010-03-19 06:40:49 UTC (rev 3393) @@ -307,6 +307,11 @@ </tr> <tr> <td class="menu_group_item"> + <?php echo '<p>• <a href="' . $rootpath . '/PDFCustTransListing.php?' . SID . '">' . _('List Daily Transactions') . '</a></p>'; ?> + </td> + </tr> + <tr> + <td class="menu_group_item"> <?php echo GetRptLinks('ar'); ?> </td> </tr> Modified: trunk/sql/mysql/upgrade3.11.1-3.12.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-3.12.sql 2010-03-18 19:15:51 UTC (rev 3392) +++ trunk/sql/mysql/upgrade3.11.1-3.12.sql 2010-03-19 06:40:49 UTC (rev 3393) @@ -123,4 +123,7 @@ ADD CONSTRAINT `pctabs_ibfk_5` FOREIGN KEY (`glaccountassignment`) REFERENCES `chartmaster` (`accountcode`); ALTER TABLE `supptrans` - ADD COLUMN `inputdate` datetime NOT NULL AFTER `duedate` ; \ No newline at end of file + ADD COLUMN `inputdate` datetime NOT NULL AFTER `duedate` ; + +ALTER TABLE `debtortrans` + ADD COLUMN `inputdate` datetime NOT NULL AFTER `trandate` ; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |