Not sure either as quinientos is in the custom function.
lczp, you may want to remove 8th and 48th...51th lines from the function, they are for invoice formatting. ( pesos ... )
I'm not sure of this is allowable variation or not, for the last example made different result.
tres millones ciento cincuenta y cinco mil trescientos veinticinco