Hi!
This could be hard to do, but I trust you professionals
I need to make so called referencenumber from deliverynumber to use for bank -payment. In Finland the formula to generate the referencenumber is like this:
Original number=1234
Those numbers must be multiply with the formula "7,3,1" from right to left. So in this case we must do the multiply 7*4, 3*3, 1*2, 7*1. We get numbers 28,9,2,7. Then we take the SUM 28+9+2+7 and we get number 46. Then we take the nearest FULL TEN upward, which is 50. Then we must do subtraction 50-46 and we get number 4. That "4" is the "checknumber" what we need. So the full referencenumber in this case is 12344 (Original number and checknumber)
How can I do this with Coldfusion -code? Original number can be longer than in this 4-digit example and it´s important to follow that multiply -system. First number from right with "7", next one with "3" etc.
AND if the last subtraction gives the number 10, it must be changed to "0".
I hope that somebody understood something from my question. I think it´s more harder to read than make
This could be hard to do, but I trust you professionals
I need to make so called referencenumber from deliverynumber to use for bank -payment. In Finland the formula to generate the referencenumber is like this:
Original number=1234
Those numbers must be multiply with the formula "7,3,1" from right to left. So in this case we must do the multiply 7*4, 3*3, 1*2, 7*1. We get numbers 28,9,2,7. Then we take the SUM 28+9+2+7 and we get number 46. Then we take the nearest FULL TEN upward, which is 50. Then we must do subtraction 50-46 and we get number 4. That "4" is the "checknumber" what we need. So the full referencenumber in this case is 12344 (Original number and checknumber)
How can I do this with Coldfusion -code? Original number can be longer than in this 4-digit example and it´s important to follow that multiply -system. First number from right with "7", next one with "3" etc.
AND if the last subtraction gives the number 10, it must be changed to "0".
I hope that somebody understood something from my question. I think it´s more harder to read than make