issue #20040: sales order bugfixes