There is wrong condition in Node and that is why in some cases - for example in case the payment origin is "HR-PY" - the amount generated in the ouput is always zero.