- 0of 0 votes
Our merchants receive "weekly" invoices, following these rules:- deepakmr2008 May 02, 2016 in United States
- Each Saturday (00:00 UTC) marks the beginning of a new billing period
- Each 1st of a month (00:00 UTC) marks the beginning of a new billing
- Within a year, billing periods are numbered consecutively, starting
with billing period number 1 on Jan 1
Billing periods can therefore be identified by a year and a period
Write the following functions:
*) For a given date, return the id of the latest period that ends
before this date, e.g.
auto getLatestBillingPeriodId(Date date) -> PeriodId;
*) For a given period id, return the begin and the end date of the
billing period, e.g.
auto getDateRange(PeriodId periodId) -> std::pair<Date, Date>;
| Report Duplicate | Flag | PURGE