Fix INSERT rule of api.cashreceiptapply

`INSERT INTO api.cashreceiptapply ...` did not work correctly if there were posted cash receipts with the same customerId, fundsType and refnumber as the new receipt. This change makes the INSERT rule affect un-posted cash receipts only.