| Schedule of revenue from external customers |
Revenue from external customers (including, but not limited to homeowners) for each group of similar products and services is as follows (in thousands): | | | | | | | | | | | | | | | | | | | | Three Months Ended June 30, | | Six Months Ended June 30, | | | 2018 | | 2017 | | 2018 | | 2017 | Customer agreements | | $ | 66,658 |
| | $ | 51,220 |
| | $ | 128,307 |
| | $ | 97,545 |
| Incentives | | 24,947 |
| | 6,891 |
| | 30,288 |
| | 9,656 |
| Customer agreements and incentives | | 91,605 |
| | 58,111 |
| | 158,595 |
| | 107,201 |
| | | | | | | | | | Solar energy systems | | 40,734 |
| | 28,079 |
| | 74,732 |
| | 48,698 |
| Products | | 38,199 |
| | 44,432 |
| | 81,574 |
| | 79,832 |
| Solar energy systems and product sales | | 78,933 |
| | 72,511 |
| | 156,306 |
| | 128,530 |
| Total revenue | | $ | 170,538 |
| | $ | 130,622 |
| | $ | 314,901 |
| | $ | 235,731 |
|
|
| Adoption of new accounting pronouncement |
The following table presents the effect of the adoption of Topic 606 and Topic 842 on the Company's condensed consolidated balance sheet as of December 31, 2017 (in thousands): | | | | | | | | | | | | | | | | December 31, 2017 | | | Previously Reported | | Adoption Impact | | Restated |
| | | | | | | Accounts receivable, net of allowances for doubtful accounts | | $ | 76,198 |
| | $ | 35,871 |
| | $ | 112,069 |
| Solar energy systems, net | | 3,319,708 |
| | (158,138 | ) | | 3,161,570 |
| Other assets | | 37,225 |
| | 157,529 |
| | 194,754 |
| Accrued expenses and other liabilities | | 85,639 |
| | 11,591 |
| | 97,230 |
| Deferred revenue, current portion | | 77,310 |
| | (34,701 | ) | | 42,609 |
| Deferred grants, current portion | | 8,269 |
| | (76 | ) | | 8,193 |
| Pass-through financing obligation, current portion | | 6,087 |
| | (700 | ) | | 5,387 |
| Deferred revenue, net of current portion | | 584,427 |
| | (62,184 | ) | | 522,243 |
| Deferred grants, net of current portion | | 228,603 |
| | (1,084 | ) | | 227,519 |
| Pass-through financing obligation, net of current portion | | 138,124 |
| | (5,301 | ) | | 132,823 |
| Other liabilities | | 13,520 |
| | 29,223 |
| | 42,743 |
| Deferred tax liabilities | | 59,131 |
| | 23,988 |
| | 83,119 |
| Redeemable noncontrolling interests | | 123,737 |
| | 64 |
| | 123,801 |
| Additional paid-in capital | | 684,141 |
| | (1,191 | ) | | 682,950 |
| Retained earnings | | 131,959 |
| | 70,775 |
| | 202,734 |
| Noncontrolling interests | | 354,076 |
| | 4,858 |
| | 358,934 |
|
The following table presents the effect of the adoption of Topic 606 and Topic 842 on the Company's condensed consolidated statement of operations for the three and six months ended June 30, 2017 (in thousands except per share amounts): | | | | | | | | | | | | | | | | | | | | | | | | | | | | Three Months Ended June 30, 2017 | | Six Months Ended June 30, 2017 | | | Previously Reported | | Adoption Impact | | Restated | | Previously Reported | | Adoption Impact | | Restated |
| | | | | | | | | | | | | Revenue: Customer agreements and incentives | | $ | 65,337 |
| | $ | (7,226 | ) | | $ | 58,111 |
| | $ | 113,435 |
| | $ | (6,234 | ) | | $ | 107,201 |
| Cost of customer agreements and incentives | | 47,114 |
| | (1,825 | ) | | 45,289 |
| | 91,450 |
| | (3,548 | ) | | 87,902 |
| Sales and marketing | | 32,784 |
| | 2,272 |
| | 35,056 |
| | 64,460 |
| | 3,728 |
| | 68,188 |
| General and administrative | | 25,230 |
| | (2 | ) | | 25,228 |
| | 49,851 |
| | (15 | ) | | 49,836 |
| Interest expense, net | | 16,602 |
| | 5,369 |
| | 21,971 |
| | 31,879 |
| | 10,650 |
| | 42,529 |
| Income tax expense | | 15,453 |
| | (4,672 | ) | | 10,781 |
| | 22,791 |
| | (6,610 | ) | | 16,181 |
| Net loss | | (65,242 | ) | | (8,368 | ) | | (73,610 | ) | | (138,326 | ) | | (10,439 | ) | | (148,765 | ) | Net loss attributable to noncontrolling interests and redeemable noncontrolling interests | | (90,364 | ) | | (1,592 | ) | | (91,956 | ) | | (176,175 | ) | | (818 | ) | | (176,993 | ) | Net income available to common stockholders | | 25,122 |
| | (6,776 | ) | | 18,346 |
| | 37,849 |
| | (9,621 | ) | | 28,228 |
| Basic net income per share available to common stockholders | | 0.24 |
| | (0.07 | ) | | 0.17 |
| | 0.36 |
| | (0.09 | ) | | 0.27 |
| Diluted net income per share available to common stockholders | | 0.23 |
| | (0.06 | ) | | 0.17 |
| | 0.35 |
| | (0.09 | ) | | 0.26 |
|
The following table presents the effect of the adoption of Topic 230, Topic 606 and Topic 842 on the Company's condensed consolidated statement of cash flows for the six months ended June 30, 2017 (in thousands): | | | | | | | | | | | | | | | | Six Months Ended June 30, 2017 | | | Previously Reported | | Adoption Impact | | Restated |
| | | | | | | Net loss | | $ | (138,326 | ) | | $ | (10,439 | ) | | $ | (148,765 | ) | Net cash used in operating activities | | (33,457 | ) | | (15,714 | ) | | (49,171 | ) | Net cash used in investing activities | | (361,190 | ) | | 16,747 |
| | (344,443 | ) | Net cash provided by financing activities | | 399,604 |
| | 2,592 |
| | 402,196 |
| Net change in cash and restricted cash(1) | | 4,957 |
| | 3,625 |
| | 8,582 |
| Cash and restricted cash, beginning of period(1) | | 206,364 |
| | 17,999 |
| | 224,363 |
| Cash and restricted cash, end of period(1) | | 211,321 |
| | 21,624 |
| | 232,945 |
|
(1)Pursuant to Topic 230, restricted cash is included in the restated balances in the statement of cashflows, as described above. The amounts in the previously reported column include only cash.
|