backport cust_bill_ApplicationCommon::applied_to_invoice and cust_bill::invnum_date_p...