« Return to Thread: Adding Encoded Customer ID Numbers

Adding Encoded Customer ID Numbers

by sunshine33777 :: Rate this Message:

Reply to Author | View in Thread

Hello,

I just did a change to my WebERP.  This may not be suitable for everyone, or even anyone for that matter.

I am a locksmith and on certain keys I stamp the customer ID number on the key so I can track which keys belong to which customer if they ever get lost, or a customer comes in and doesn't know who "owns" the rights to maintain their key system.

Being at WebERP for almost 2 years now, I have entered the 4 digit customer ID a few months ago.  (I'm stamping 1057 on keys, etc.)  Space is limited, so I wrote this hack to enable smaller characters to be stamped on the keys.

I'm currently running 3.071, so not sure what changes have been made since that may interfere with this:

In "index.php" I did this:


					<td class="menu_group_items">
						<table width="100%" class="table_index">
							<tr>
							<td class="menu_group_item">
								<?php echo "<A HREF='" . $rootpath . ' /SunshineDecodeCustomer.php?' . SID "'><LI>" . _('Decode Encoded Customer ID') . '</LI></A>'; ?>
							</td>
							</tr>
							<tr>
							<td class="menu_group_item">
								<?php echo "<A HREF='" . $rootpath . ' /SelectCustomer.php?' . SID "'><LI>" . _('Customer Transaction Inquiries') . '</LI></A>'; ?>
							</td>
							</tr>
							<tr>
							<td class="menu_group_item">
								<?php echo "<A HREF='" . $rootpath . ' /CustWhereAlloc.php?' . SID "'><LI>" . _('Where Allocated Inquiry') . '</LI></A>'; ?>
							</td>
							</tr>
							<tr>



Where I addded the above code:

				<tr>
							<td class="menu_group_item">
								<?php echo "<A HREF='" . $rootpath . ' /SunshineDecodeCustomer.php?' . SID "'><LI>" . _('Decode Encoded Customer ID') . '</LI></A>'; ?>
							</td>
							</tr>
							<tr>


to above the Customer Transaction Inquiries.



Then in "SelectCustomer.php" I did this:


echo '<CENTER><FONT SIZE=3>' . _('Customer') . ' :<B> ' . $_SESSION['CustomerID'] . ' - ' . $CustomerName . ' (Encoded as ' . strtoupper(base_convert($_SESSION['CustomerID'], 10, 36)) . ')</B> ' . _('has been selected') . '.<BR>' . _('Select a menu option to operate using this customer') . '.</FONT><BR>';



Where I added the base_convert into the line that has "has been selected" in there.


Then I added a new file "SunshineDecodeCustomer.php" in the root directory with this code:


<?php


$PageSecurity = 2;

include('includes/session.inc');
$title = _('Sunshine Decode Customer Number');
include('includes/header.inc');

include('includes/Wiki.php');

?>
<BR>
<FORM ACTION="<?php echo $_SERVER['PHP_SELF'] . '?' . SID; ?>" METHOD=POST>
<CENTER>
Enter Encoded Customer ID: <INPUT TYPE="Text" NAME="EncodedCustID">
</CENTER>
</FORM>

<?php
$EncodedCustID = $_POST['EncodedCustID'];
?>

<CENTER>
Actual Customer Number of <B><?php echo strtoupper($_POST['EncodedCustID']);?></B> is <B><?php echo strtoupper(base_convert($EncodedCustID, 36, 10));?></B>
</CENTER>

<?php

include('includes/footer.inc');

?>



Now when I select a customer, I get the following at the top of the screen:

Customer : 1031 - Name Removed (Encoded as SN) has been selected.
Select a menu option to operate using this customer.



This tells me I can stamp the keys as SN.  (SN converted from base 36 to base 10 is 1031.  Much easier to stamp.)

Now if I get a key here and it's stamped SN I go to the "Receivables" menu, under "Inquiries and Reports" I can click the "Decode Encoded Customer ID" and get the screen prompt:

Enter Encoded Customer ID:
Actual Customer Number of is 0

I can enter "SN" into the input box and it will tell me this:

Enter Encoded Customer ID:
Actual Customer Number of SN is 1031


Then I just go to the customer ID 1031 and do my thing from there.


Just a space saver for me on my keys.

May not be useful at all for anybody else, but then again, it may be.

 « Return to Thread: Adding Encoded Customer ID Numbers

LightInTheBox - Buy quality products at wholesale price!