Consolidated Statements of Cash Flows (Unaudited) - USD ($)
$ in Thousands
6 Months Ended
Jun. 30, 2018
Jun. 30, 2017
Cash flows used in operating activities:    
Net income (loss) $ 2,339 $ (1,522)
Adjustments to reconcile net income (loss) to net cash provided by (used in) operating activities:    
Depreciation and amortization 2,367 2,427
Warrants to customers 1,533 2,353
Share-based compensation 2,380 1,948
Amortization of premium on marketable securities 241 277
Realized gain on sale of marketable securities (29)
Increase in accrued severance pay, net 109 28
Decrease (increase) in trade receivables (10,141) 2,894
Decrease (increase) in other receivables and prepaid expenses (522) 747
Decrease (increase) in inventories 9,044 (8,652)
Change in deferred taxes, net (219) (183)
Decrease (increase) in other assets (97) 194
Decrease in trade payables (2,192) (2,060)
Increase (decrease) in employees and payroll accruals 759 (833)
Increase (decrease) in deferred revenues and advances from customers 412 (692)
Increase in other payables and accrued expenses 203 122
Increase in other long-term liabilities 175 369
Loss from sale of property and equipment 29
Foreign currency translation loss (gain) on inter company balances with foreign subsidiaries 293 (595)
Net cash provided by (used in) operating activities 6,684 (3,178)
Cash flows used in investing activities:    
Purchase of property and equipment (1,244) (3,431)
Investments in bank deposits, net (3,000)
Proceeds from maturity of marketable securities 2,150 6,740
Proceeds from sale of marketable securities 38,312
Purchase of marketable securities (6,130) (70,648)
Net cash used in investing activities (8,224) (29,027)
Cash flows provided by financing activities:    
Proceeds from issuance of ordinary shares in a follow-on offering, net 35,077
Exercise of employee stock options 1,067 1,347
Payment of contingent consideration (900) (1,400)
Net cash provided by financing activities 167 35,024
Foreign currency translation adjustments on cash and cash equivalents (33) 99
Increase (decrease) in cash and cash equivalents (1,373) 2,819
Cash and cash equivalents at the beginning of the period 18,629 22,789
Cash and cash equivalents at the end of the period 17,223 25,707
Supplemental disclosure of non-cash investing and financing activities:    
Property and equipment acquired in credit 200 863
Inventory transferred to be used as property and equipment 591 167
Receipts on account of shares $ 20 $ 167