Description
Give the vat number back in the right format
Parameters
iiCountryId | input | integer | country ID |
icCountryCode | input | character | countrycode |
icVatNumber | input | character | Tax Number |
ocVatNumberShort | output | character | Vat Number to write into the database |
ocVatNumberLong | output | character | Vat Number to show on User Interface |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
unused
program code (program3/bbusinessrelation.p)
/* ==================== */
/* Skip Unknown-values */
/* ==================== */
if icCountryCode = ? then assign icCountryCode = "":U.
if iiCountryId = ? then assign iiCountryId = 0.
/* ===================================================== */
/* if no country defined, give the given vat number back */
/* ===================================================== */
if iiCountryId = 0 and icCountryCode = "":U
then do:
assign ocVatNumberLong = icVatNumber.
return.
end.
/* ======================================================== */
/* check the vat number and get it back in the right format */
/* ======================================================== */
assign vhFcComponent = ?.
<M-1 run ApiCheckVatNumber
(input iiCountryId (iiCountryId),
input icCountryCode (icCountryCode),
input icVatNumber (icVatNumber),
input false (ilMessage),
output ocVatNumberShort (ocVatNumberShort),
output ocVatNumberLong (ocVatNumberLong),
output viFcReturnSuper (oiReturnStatus)) in BCountry>
if viFcReturnSuper < 0 or
(viFcReturnSuper > 0 and oiReturnStatus = 0)
then assign oiReturnStatus = viFcReturnSuper.