|
From: <ex...@us...> - 2015-10-31 06:37:49
|
Revision: 7375
http://sourceforge.net/p/web-erp/reponame/7375
Author: exsonqu
Date: 2015-10-31 06:37:46 +0000 (Sat, 31 Oct 2015)
Log Message:
-----------
31/10/15 Exson: Tidy code up with Tim's suggestion in GoodsReceived.php and SupplierGRNAndInvoiceInquiry.php and SupplierInvoice.php.
Modified Paths:
--------------
trunk/GoodsReceived.php
trunk/SupplierGRNAndInvoiceInquiry.php
trunk/SupplierInvoice.php
trunk/sql/mysql/upgrade4.12.3-4.13.sql
Modified: trunk/GoodsReceived.php
===================================================================
--- trunk/GoodsReceived.php 2015-10-30 12:13:50 UTC (rev 7374)
+++ trunk/GoodsReceived.php 2015-10-31 06:37:46 UTC (rev 7375)
@@ -97,6 +97,7 @@
$_SESSION['PO' . $identifier]->SupplierReference = $_POST['SupplierReference'];
}
}
+ $SupplierReference = isset($_SESSION['PO' . $identifier]->SupplierReference)? $_SESSION['PO' . $identifier]->SupplierReference: $_POST['SupplierReference'];
echo '<table class="selection">
<tr>
@@ -104,7 +105,7 @@
<td><input type="text" class="date" alt="'. $_SESSION['DefaultDateFormat'] .'" maxlength="10" size="10" onchange="return isDate(this, this.value, '."'".
$_SESSION['DefaultDateFormat']."'".')" name="DefaultReceivedDate" value="' . $_SESSION['PO' . $identifier]->DefaultReceivedDate . '" /></td>
<td>' . _("Supplier's Reference") . ':</td>
- <td><input type="text" name="SupplierReference" value="' . $_SESSION['PO' . $identifier]->SupplierReference. '" maxlength="30" size="20" onchange="ReloadForm(form1.Update)"/></td>
+ <td><input type="text" name="SupplierReference" value="' . $SupplierReference. '" maxlength="30" size="20" onchange="ReloadForm(form1.Update)"/></td>
</tr>
</table>
<br />';
@@ -251,7 +252,6 @@
$InputError = true;
prnMsg(_('The goods received date is not a date format'),'error');
-} else {
}
if (isset($_POST['SupplierReference']) AND mb_strlen(trim($_POST['SupplierReference']))>30) {
Modified: trunk/SupplierGRNAndInvoiceInquiry.php
===================================================================
--- trunk/SupplierGRNAndInvoiceInquiry.php 2015-10-30 12:13:50 UTC (rev 7374)
+++ trunk/SupplierGRNAndInvoiceInquiry.php 2015-10-31 06:37:46 UTC (rev 7375)
@@ -35,15 +35,16 @@
echo '<table class="selection">
<tr>
- <td class="label">' . _('Part of Supplier\'s Delivery Note') . ':</td><td><input type="text" name="SupplierRef" value="' . $_POST['SupplierRef'] . '" size="20" maxlength="30" ></td>
- <td class="label">' . _('GRN No') . ':</td><td><input type="text" name="GRNBatchNo" value="' . $_POST['GRNBatchNo'] . '" size="6" maxlength="6" /></td>
- <td class="label">' . _('Invoice No') . ':</td><td><input type="text" name="InvoiceNo" value="' . $_POST['InvoiceNo'] . '" size="11" maxlength="11" /></td>
+ <td class="label">' . _('Part of Supplier\'s Delivery Note') . ':</td>
+ <td><input type="text" name="SupplierRef" value="' . $_POST['SupplierRef'] . '" size="20" maxlength="30" ></td>
+ <td class="label">' . _('GRN No') . ':</td><td><input type="text" name="GRNBatchNo" value="' . $_POST['GRNBatchNo'] . '" size="6" maxlength="6" /></td>
+ <td class="label">' . _('Invoice No') . ':</td><td><input type="text" name="InvoiceNo" value="' . $_POST['InvoiceNo'] . '" size="11" maxlength="11" /></td>
</tr>
</table>';
echo '<div class="center">
<input type="submit" name="Submit" value="' . _('Submit') . '" />
- </div>';
+ </div>';
if (isset($_POST['Submit'])) {
$Where = '';
if (isset($_POST['SupplierRef']) AND trim($_POST['SupplierRef']) != '') {
@@ -82,10 +83,11 @@
echo '<tr class="OddTableRows">';
$k = 0;
}
- echo '<td class="ascending">' . $myrow['supplierref'] . '</td>
- <td class="ascending"><a href="' . $RootPath .'/PDFGrn.php?GRNNo=' . $myrow['grnbatch'] . '&PONo=' . $myrow['orderno'] . '">' . $myrow['grnbatch']. '</td>
- <td class="ascending">' . $myrow['orderno'] . '</td>
- <td class="ascending">' . $myrow['suppinv'] . '</td></tr>';
+ echo '<td class="ascending">' . $myrow['supplierref'] . '</td>
+ <td class="ascending"><a href="' . $RootPath .'/PDFGrn.php?GRNNo=' . $myrow['grnbatch'] . '&PONo=' . $myrow['orderno'] . '">' . $myrow['grnbatch']. '</td>
+ <td class="ascending">' . $myrow['orderno'] . '</td>
+ <td class="ascending">' . $myrow['suppinv'] . '</td>
+ </tr>';
}
echo '</table><br/>';
Modified: trunk/SupplierInvoice.php
===================================================================
--- trunk/SupplierInvoice.php 2015-10-30 12:13:50 UTC (rev 7374)
+++ trunk/SupplierInvoice.php 2015-10-31 06:37:46 UTC (rev 7375)
@@ -1551,8 +1551,7 @@
$Result = DB_query($SQL, $ErrMsg, $DbgMsg, True);
$SQL = "INSERT INTO suppinvstogrn VALUES ('" . $InvoiceNo . "',
- '" . $EnteredGRN->GRNNo . "',
- '" . $EnteredGRN->SupplierRef . "')";
+ '" . $EnteredGRN->GRNNo . "')";
$ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The invoice could not be mapped to the
goods received record because');
$DbgMsg = _('The following SQL to map the invoice to the GRN was used');
Modified: trunk/sql/mysql/upgrade4.12.3-4.13.sql
===================================================================
--- trunk/sql/mysql/upgrade4.12.3-4.13.sql 2015-10-30 12:13:50 UTC (rev 7374)
+++ trunk/sql/mysql/upgrade4.12.3-4.13.sql 2015-10-31 06:37:46 UTC (rev 7375)
@@ -15,7 +15,6 @@
CREATE TABLE `suppinvstogrn` (
`suppinv` int(11) NOT NULL,
`grnno` int(11) NOT NULL,
- `supplierref` varchar(30) NOT NULL DEFAULT '',
PRIMARY KEY (`suppinv`,`grnno`),
KEY `suppinvstogrn_ibfk_2` (`grnno`),
CONSTRAINT `suppinvstogrn_ibfk_1` FOREIGN KEY (`suppinv`) REFERENCES
|