Example #1
0
    // 1) Set new Client
    $api->setClient(array('name' => 'Example client (test)', 'ico' => mt_rand(10000000, 99999999), 'dic' => '012345678', 'email' => '*****@*****.**'));
    // 2) Set Expense data to update
    $api->setExpense(array('id' => $expense_id, 'name' => 'Expense example EDIT', 'amount' => round(M_E * 100), 'currency' => 'CZK'));
    // 3) Update Expense data
    $response = $api->edit();
    if (!empty($bench)) {
        _debug($response, 'Edit expense example');
    }
}
/********************************************
 * Example; send invoice by email
 * , post
 ********************************************/
if (!empty($invoice_id)) {
    $response = $api->sendInvoiceEmail(array('invoice_id' => $invoice_id, 'to' => '*****@*****.**', 'cc' => array('*****@*****.**', '*****@*****.**'), 'bcc' => array('*****@*****.**')));
    if (!empty($bench)) {
        _debug($response, 'Send email example');
    }
    $send_invoice_post = false;
    if ($send_invoice_post) {
        $response = $api->sendInvoicePost(array('invoice_id' => $invoice_id));
        if (!empty($bench)) {
            _debug($response, 'Send invoice post');
        }
    }
}
/*******************************************
 * Example; update invoice item
 *******************************************/
$invoice_item_id = 0;