Topic: Validate fields: sales_order_entry.php modification
Hi,
We want to ensure in our direct invoice entry that the customer branch and dimension selected by the users match. This is very crucial for our set up as we do not want users posting wrongly.
Here is the code i have included in the sale_order_entry.php file.
if (get_post ('branch_id') != get_post('dimension_id'))
{
display_error(_("The branch does not match the dimension chosen."));
set_focus ('dimension_id');
return false;
}
The problem is that the dimension field options contains the IDs of the dimensions themselves. e.g. 1 Brisbane, 2 London etc. while the branches are Brisbane, London etc.
So every time an entry is made, the error "The branch does not match the dimension chosen." appears because of the number IDs that appear with the dimensions. i have tried the substr() but have not had luck.
Please i need help in ensuring that these two fields match and the effective way to do that is to warn the user before the invoice is posted.
Help is urgently needed. Thanks.