At the Payment if invoice is linked WithHolding Tax is not calculated

hi… i have updated bench using ‘bench update’ command but after updating bench i have an bug in accounting module. When i create payment entry against purchase invoice and have to withhold on that amount and save the document Withhold tax category isn’t working. I have to remove purchase invoice and than check Apply Withholding Tex after that tax calculation is applied. Than i have to use payment reconcile tool to adjust payment entry against invoice. Because system considered payed amount as advance which is not linked to any invoice.