Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stock and Supplier Notes as on Customer
02-16-2018, 12:51 AM (This post was last modified: 02-16-2018 08:06 AM by VortecCPI.)
Post: #1
Stock and Supplier Notes as on Customer
I realize we can integrate webERP with WIKIs but it sure would be nice if we had an area for each Stock and Supplier where we could enter data in a memo area. It would be the same as "Add a note on this customer".

Many of my customers enter bits of data into these areas in their ERP systems.
Well... That was pretty easy...

Can somebody please check my work to be sure it meets webERP standards?

Code:
CREATE TABLE `suppnotes` (
  `noteid` tinyint(4) NOT NULL AUTO_INCREMENT,
  `supplierid` varchar(10) NOT NULL DEFAULT '0',
  `href` varchar(100) NOT NULL,
  `note` text NOT NULL,
  `date` date NOT NULL DEFAULT '0000-00-00',
  `priority` varchar(20) NOT NULL,
  PRIMARY KEY (`noteid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Of course we also need to:

Add area to bottom of Supplier page:

PHP Code:
        // Supplier Notes
        
$SQL "SELECT
                    noteid,
                    supplierid,
                    href,
                    note,
                    date,
                    priority
                FROM suppnotes
                WHERE supplierid='" 
$_SESSION['SupplierID'] . "'
                ORDER BY date DESC"
;
        
$result DB_query($SQL);
        if(
DB_num_rows($result) <> 0) {
            echo 
'<br /><div class="centre"><img src="' $RootPath '/css/' $Theme '/images/note_add.png" title="' _('Supplier Notes') . '" alt="" />' ' ' _('Supplier Notes') . '</div><br />';
            echo 
'<table style="width: 45%;">';
            echo 
'<tr>
                    <th class="ascending">' 
_('Date') . '</th>
                    <th>' 
_('Note') . '</th>
                    <th>' 
_('Hyperlink') . '</th>
                    <th class="ascending">' 
_('Priority') . '</th>
                    <th>' 
_('Edit') . '</th>
                    <th>' 
_('Delete') . '</th>
                    <th> <a href="AddSupplierNotes.php?SupplierID='
urlencode($_SESSION['SupplierID']), '">' ' ' _('Add New Note') . '</a> </th>
                </tr>'
;
            
$k 0;// row colour counter
            
while ($myrow DB_fetch_array($result)) {
                if(
$k == 1) {
                    echo 
'<tr class="OddTableRows">';
                    
$k 0;
                }
// $k == 1
                
else {
                    echo 
'<tr class="EvenTableRows">';
                    
$k 1;
                }
                echo 
'<td>' ConvertSQLDate($myrow['date']) . '</td>
                    <td>' 
$myrow['note'] . '</td>
                    <td><a href="' 
$myrow['href'] . '">' $myrow['href'] . '</a></td>
                    <td>' 
$myrow['priority'] . '</td>
                    <td><a href="AddSupplierNotes.php?Id=' 
$myrow['noteid'] . '&amp;SupplierID=' $myrow['supplierid'] . '">' _('Edit') . '</a></td>
                    <td><a href="AddSupplierNotes.php?Id=' 
$myrow['noteid'] . '&amp;SupplierID=' $myrow['supplierid'] . '&amp;delete=1">' _('Delete') . '</a></td>
                    </tr>'
;
            }
// END WHILE LIST LOOP
            
echo '</table>';
        }
// end if there are supplier notes to display 


Add entry to scripts table
Add line of code in SelectSupplier.php

PHP Code:
<br /><a href="' . $RootPath . '/AddSupplierNotes.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Add a note on this supplier') . '</a

Add applicable entries to messages.mo

_('Supplier Notes')
_('Notes for Supplier')
_('Are you sure you wish to delete this supplier note?')
_('Review all notes for this Supplier')


Attached File(s)
.php  AddSupplierNotes.php (Size: 7.56 KB / Downloads: 0)

https://www.linkedin.com/in/eclipsepaulbecker
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Stock and Supplier Notes as on Customer - VortecCPI - 02-16-2018 12:51 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)