add template invoice  logic