I will allow that two Customers have the same VAT(boolean checkVATNumUsed)

Hi,

I will allow that two Customers have the same VAT:

boolean checkVATNumUsed()
{
boolean ret = true;
CustTable tmpCustTable;
;

if (TaxParameters::find().VatBookEnable == NoYes::Yes && this.VATNum)
{
select firstonly tmpCustTable
where tmpCustTable.RecId != this.RecId &&
tmpCustTable.VATNum == this.VATNum;
if (tmpCustTable.RecId)
{
ret = checkFailed(strfmt("@SYS79490",fieldpname(CustTable, VATNum)));
}
}
return ret;
}

Thanks a lot in advance

Aiman

Hi,

IF excluded:

// if (tmpCustTable.RecId)
// {
// ret = checkFailed(strfmt("@SYS79490",fieldpname(CustTable, VATNum)));
// }

After insert the VAT–> activate it again.

Aiman