You need two payment terms for this purpose: 0000 (In advance) and 0045 (Within 45 days). 0045 should look like that:
In payment terms customizing create a new entry, tick it as Installment payment and its definition should be "%90 In Advance, rest within 45 days". (For ex: IN45). Then in installment payment terms customizing, create entries as follows: