getInvoiceLine((int)($data['invoice_id'] ?? 0), (int)($data['item_id'] ?? 0)); } else { $answer['output'] = $assets->getCapitalizableLines( (string)($data['date_from'] ?? ''), (string)($data['date_to'] ?? '') ); } $answer['success'] = 1; } catch (PDOException $e) { error_log('[asset invoice lines] ' . $e->getMessage()); $answer['message'] = 'Database error, please try again.'; http_response_code(500); } catch (Exception $e) { $answer['message'] = $e->getMessage(); http_response_code(400); } exit(json_encode($answer));