updated invoice lib, now on refresh docalculation function called and api corrected for proper result to return in invoice creation