|
From: <dai...@us...> - 2017-07-15 01:07:00
|
Revision: 7809
http://sourceforge.net/p/web-erp/reponame/7809
Author: daintree
Date: 2017-07-15 01:06:57 +0000 (Sat, 15 Jul 2017)
Log Message:
-----------
Added script to remove all purchase order back orders
Modified Paths:
--------------
trunk/CounterSales.php
trunk/ReorderLevel.php
trunk/doc/Change.log
trunk/includes/MainMenuLinksArray.php
trunk/sql/mysql/upgrade4.14.1-4.14.2.sql
Added Paths:
-----------
trunk/Z_RemovePurchaseBackOrders.php
Modified: trunk/CounterSales.php
===================================================================
--- trunk/CounterSales.php 2017-07-10 01:33:03 UTC (rev 7808)
+++ trunk/CounterSales.php 2017-07-15 01:06:57 UTC (rev 7809)
@@ -2053,10 +2053,14 @@
echo '<br /><div class="centre">';
if ($_SESSION['InvoicePortraitFormat']==0){
- echo '<img src="'.$RootPath.'/css/'.$Theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . '<a target="_blank" href="'.$RootPath.'/PrintCustTrans.php?FromTransNo='.$InvoiceNo.'&InvOrCredit=Invoice&PrintPDF=True">' . _('Print this invoice'). ' (' . _('Landscape') . ')</a><br /><br />';
+ echo '<meta http-equiv="Refresh" content="0; url=' . $RootPath.'/PrintCustTrans.php?FromTransNo='.$InvoiceNo.'&InvOrCredit=Invoice&PrintPDF=True" />';
+
+ //echo '<img src="'.$RootPath.'/css/'.$Theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . '<a target="_blank" href="'.$RootPath.'/PrintCustTrans.php?FromTransNo='.$InvoiceNo.'&InvOrCredit=Invoice&PrintPDF=True">' . _('Print this invoice'). ' (' . _('Landscape') . ')</a><br /><br />';
} else {
- echo '<img src="'.$RootPath.'/css/'.$Theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . '<a target="_blank" href="'.$RootPath.'/PrintCustTransPortrait.php?FromTransNo='.$InvoiceNo.'&InvOrCredit=Invoice&PrintPDF=True">' . _('Print this invoice'). ' (' . _('Portrait') . ')</a><br /><br />';
+ //echo '<img src="'.$RootPath.'/css/'.$Theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . '<a target="_blank" href="'.$RootPath.'/PrintCustTransPortrait.php?FromTransNo='.$InvoiceNo.'&InvOrCredit=Invoice&PrintPDF=True">' . _('Print this invoice'). ' (' . _('Portrait') . ')</a><br /><br />';
+ echo '<meta http-equiv="Refresh" content="0; url=' . $RootPath.'/PrintCustTransPortrait.php?FromTransNo='.$InvoiceNo.'&InvOrCredit=Invoice&PrintPDF=True" />';
}
+
echo '<br /><br /><a href="' .htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">' . _('Start a new Counter Sale') . '</a></div>';
}
Modified: trunk/ReorderLevel.php
===================================================================
--- trunk/ReorderLevel.php 2017-07-10 01:33:03 UTC (rev 7808)
+++ trunk/ReorderLevel.php 2017-07-15 01:06:57 UTC (rev 7809)
@@ -109,17 +109,6 @@
PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width,
$Right_Margin,$CategoryDescription);
}
- $OnOrderSQL = "SELECT SUM(quantityord-quantityrecd) AS quantityonorder
- FROM purchorders
- LEFT JOIN purchorderdetails
- ON purchorders.orderno=purchorderdetails.orderno
- WHERE purchorders.status != 'Cancelled'
- AND purchorders.status != 'Rejected'
- AND purchorders.status != 'Pending'
- AND purchorderdetails.itemcode='".$myrow['stockid']."'
- AND purchorders.intostocklocation='".$myrow['loccode']."'";
- $OnOrderResult = DB_query($OnOrderSQL);
- $OnOrderRow = DB_fetch_array($OnOrderResult);
// Print if stock for part in other locations
$sql2 = "SELECT locstock.quantity,
Added: trunk/Z_RemovePurchaseBackOrders.php
===================================================================
--- trunk/Z_RemovePurchaseBackOrders.php (rev 0)
+++ trunk/Z_RemovePurchaseBackOrders.php 2017-07-15 01:06:57 UTC (rev 7809)
@@ -0,0 +1,25 @@
+<?php
+
+/* $Id: Z_RemovePurchaseBackOrders.php 7751 2017-04-13 16:34:26Z rchacon $*/
+
+include('includes/session.php');
+$Title=_('Remove Purchase Order Back Orders');
+include('includes/header.php');
+
+echo "<form method='post' action='" . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?' . SID . "'>";
+echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
+
+echo '<br />
+ <div class="centre">' . _('This will alter all purchase orders where the quantity required is more than the quantity delivered - where some has been delivered already. The quantity ordered will be reduced to the same as the quantity already delivered - removing all back orders') . '<br /><input type="submit" name="RemovePOBackOrders" value="' . _('Remove Purchase Back Orders') .'" />
+ </div></form>';
+
+if (isset($_POST['RemovePOBackOrders'])){
+ DB_query('UPDATE purchorderdetails
+ SET quantityord=quantityrecd
+ WHERE quantityrecd>0 AND quantityord > quantityrecd
+ AND deliverydate < CURRENT_DATE();');
+ prnMsg(_('Updated all purchase orders to remove back orders'),'success');
+}
+
+include('includes/footer.php');
+?>
\ No newline at end of file
Modified: trunk/doc/Change.log
===================================================================
--- trunk/doc/Change.log 2017-07-10 01:33:03 UTC (rev 7808)
+++ trunk/doc/Change.log 2017-07-15 01:06:57 UTC (rev 7809)
@@ -1,6 +1,7 @@
webERP Change Log
-10/07/17 Exson: Fixed the wrong price bug and GP not updated correctly in SelectOrderItems.php. Report by Robert from MHHK forum.
+15/7/17 Phil: Utility script to remove all purchase back orders
+10/07/17 Exson: Fixed the wrong price bug and GP not updated correctly in SelectOrderItems.php. Report by Robert from MHHK forum.
08/07/17 PaulT: reportwriter/admin/forms area, fix tag name in four files: <image> to <img>
04/07/17 PaulT: DefineImportBankTransClass.php - Remove extra (
30/06/17 Exson: Fixed the argument count error in SupplierInvoice.php.
@@ -15,7 +16,7 @@
2017-06-20 4.14 release
-19/06/17 Exson: Add menu.css to make the main menu workable in header.php.
+19/06/17 Exson: Add menu.css to make the main menu workable in header.php.
19/06/17 Exson: Fixed the variable not existed error (Reported by Tim). Add a feature to add favorite script under main menu which idea originated from Tim's Kwamoja project.
19/06/17 Exson: Add a empty submit blocked feature to SupplierInvoice.php to avoid a empty invoice.
19/06/17 Exson: Make these classes defined php 7 compliant and keep php4 backwards compatibility.
Modified: trunk/includes/MainMenuLinksArray.php
===================================================================
--- trunk/includes/MainMenuLinksArray.php 2017-07-10 01:33:03 UTC (rev 7808)
+++ trunk/includes/MainMenuLinksArray.php 2017-07-15 01:06:57 UTC (rev 7809)
@@ -622,7 +622,8 @@
_('Create new company template SQL file and submit to webERP'),
_('Re-calculate brought forward amounts in GL'),
_('Re-Post all GL transactions from a specified period'),
- _('Purge all old prices'));
+ _('Purge all old prices'),
+ _('Remove all purchase back orders'));
$MenuItems['Utilities']['Maintenance']['URL'] = array( '/Z_poAdmin.php',
'/Z_MakeNewCompany.php',
@@ -635,5 +636,6 @@
'/Z_CreateCompanyTemplateFile.php',
'/Z_UpdateChartDetailsBFwd.php',
'/Z_RePostGLFromPeriod.php',
- '/Z_DeleteOldPrices.php');
+ '/Z_DeleteOldPrices.php',
+ '/Z_RemovePurchaseBackOrders.php');
?>
Modified: trunk/sql/mysql/upgrade4.14.1-4.14.2.sql
===================================================================
--- trunk/sql/mysql/upgrade4.14.1-4.14.2.sql 2017-07-10 01:33:03 UTC (rev 7808)
+++ trunk/sql/mysql/upgrade4.14.1-4.14.2.sql 2017-07-15 01:06:57 UTC (rev 7809)
@@ -1,5 +1,5 @@
ALTER table supptrans ADD chequeno varchar(16) NOT NULL DEFAULT '';
ALTER table supptrans ADD void tinyint(1) NOT NULL DEFAULT 0;
ALTER table banktrans ADD chequeno varchar(16) NOT NULL DEFAULT '';
+INSERT INTO `scripts` (`script` ,`pagesecurity` ,`description`) VALUES ('Z_RemovePurchaseBackOrders.php', '1', 'Removes all purchase order back orders');
-
|