Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CustomerBranches.php webERP v4.07.7
05-17-2012, 12:03 PM, (This post was last modified: 05-17-2012, 12:04 PM by Ahmed.Fawzy.)
CustomerBranches.php webERP v4.07.7
According to the manual:
Quote:Branch codes (and other codes) cannot contain spaces, commas, & or - .

I would suggest to add a check in line 49 so it looks like this:

PHP Code:
if (ContainsIllegalCharacters($_POST['BranchCode']) OR mb_strstr($_POST['BranchCode'],' ') OR mb_strstr($_POST['BranchCode'],'-')) { 

05-18-2012, 09:06 AM,
RE: CustomerBranches.php webERP v4.07.7
Hi, Ahmed´╝Ü

Thank you for your report. I'm wondering if this check is too strict?

Best regards!

05-18-2012, 09:32 AM,
RE: CustomerBranches.php webERP v4.07.7
Hi Exsonqu_Qu,

Quote:I'm wondering if this check is too strict?

yes, I agree this seems too strict for me too. But changing this needs huge effort because inside the code sometimes you are:
1. retrieving the customer and the branch from the DB
2. concatenating them using "-" as separator.
3. in another place in the code you explode them again using the separator which is "-".
This makes the branch name to be the same as the customer name.
This happens in Contracts.php

Concatenating in line 668:
PHP Code:
$SelectedCustomer $myrow['debtorno'] . '-' $myrow['branchcode']; 

exploding in line 695:
PHP Code:
    $CustomerBranchArray explode('-',$SelectedCustomer);
$_SESSION['Contract'.$identifier]->DebtorNo  trim($CustomerBranchArray[0]);
$_SESSION['Contract'.$identifier]->BranchCode trim($CustomerBranchArray[1]); 

And I do not know if this occurs elsewhere. This is why avoiding the "-" in branch name is the easiest way.

Best regards,
05-18-2012, 05:00 PM,
RE: CustomerBranches.php webERP v4.07.7
Hi, Ahmed,

Thank you very much. I've commit your fix to SVN.

Best regards!

05-20-2012, 06:58 PM,
RE: CustomerBranches.php webERP v4.07.7
We need to change contracts on the same basis as we changed SelectOrderItems - we decided to avoid this method of parsing the debtorno and branchcode into their components. Had forgotten about Contracts.php I think.
Phil Daintree
webERP Admin
Logic Works Ltd

Forum Jump:

Users browsing this thread: 1 Guest(s)