webERP Forum

Full Version: Need to change Sales Type code from 2 characters
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I am new to WebErp and i want to know is it possible to change the Sales Type code characters from 2 to 4?

Regards,
Sandeep.
Hi, Sandeep,

It's not easy for a new user to change it in my opinion. You have to modify at least salestypes table and SalesTypes.php script.
Since sales types has been used in other place.
I'm wondering if you really need to change it. The sales type code is used for system use only, the Sales Types description are use in each interface.

Best regards!

Exson
It is not too hard, but there are several tables that need changing:

ALTER TABLE salestypes CHANGE COLUMN typeabbrev typeabbrev VARCHAR(4);
ALTER TABLE cogsglpostings CHANGE COLUMN salestype salestype VARCHAR(4);
ALTER TABLE debtorsmaster CHANGE COLUMN salestype salestype VARCHAR(4);
ALTER TABLE discountmatrix CHANGE COLUMN salestype salestype VARCHAR(4);
ALTER TABLE pricematrix CHANGE COLUMN salestype salestype VARCHAR(4);
ALTER TABLE prices CHANGE COLUMN typeabbrev typeabbrev VARCHAR(4);
ALTER TABLE salesglpostings CHANGE COLUMN salestype salestype VARCHAR(4);

There maybe others but I think that is all. Then you need to widen the input field in SalesTypes.php by changing the line

<td><input type="text" ' . (in_array('SalesType',$Errors) ? 'class="inputerror"' : '' ) .' size="3" maxlength="2" name="TypeAbbrev" /></td>

to

<td><input type="text" ' . (in_array('SalesType',$Errors) ? 'class="inputerror"' : '' ) .' size="5" maxlength="4" name="TypeAbbrev" /></td>

and changing the input checking line from

if (mb_strlen($_POST['TypeAbbrev']) > 2) {

to

if (mb_strlen($_POST['TypeAbbrev']) > 4) {

Thanks
Tim