This paper builds upon previous research to develop a new mixed integer linear program (MILP) for optimal PV-battery sizing and energy scheduling. Unlike previous formulations, the MILP optimises under both time-of-use (TOU) and demand tariff structures. Optimisation is based on the highest system net present value (NPV). One residential and one commercial customer are used as case studies to contrast optimisation under TOU and demand tariff structures. Optimal PV-battery sizing is not found to be affected by the tariff structures analysed. Optimal solutions under both tariffs prefer larger PV systems coupled with small battery systems. Energy consumption from the grid under TOU tariff optimisation reflects a scaled profile of the consumer's energy demand curve. Peak consumption from the grid is heavily reduced under demand tariff optimisation to decrease the associated demand charge. In the residential case study, peak grid consumption over one year is reduced from 5.98 kWh to 2.25 kWh under demand tariff optimisation. In the commercial case study, peak grid consumption over one year is reduced from 450.3 kWh to 348.6 kWh. The reduction of peak grid consumption is achieved by using the stored energy in the battery.