implement generate bill core functionality