global $current_language, $adb; $invocieLang = return_module_language($current_language, "Invoice"); $sql = "SELECT * FROM vtiger_invoicestatus where presence = ? OR presence = ?"; $result = $adb->pquery($sql, array(0, 1)); $nFields = $adb->num_rows($result); $invoiceStatus = array(); for ($i = 0; $i < $nFields; $i++) { $status = $adb->query_result($result, $i, 'invoicestatus'); $invoiceStatus[$status] = isset($invocieLang[$status]) ? $invocieLang[$status] : $status; } $smarty->assign('ACCOUNTING_CONFIG', $config); $smarty->assign('INVOICE_STATUS', $invoiceStatus); $customflds = array(); _getCustomFieldTrans("Invoice", $customflds); $smarty->assign('INVOICE_CUSTOM_FLD', $customflds); $methods = Accounting::get_transaction_methods(false); $smarty->assign('TRANSACTION_METHOD', $methods); $querystr = "select version from vtiger_tab where name='Accounting'"; $res = $adb->pquery($querystr, array()); $numrows = $adb->num_rows($res); $version = $adb->query_result($res, 0, "version"); $smarty->assign('MODULE_VERSION', $version); $sql = "select * from vtiger_currency_info where deleted=0"; $result = $adb->pquery($sql, array()); $temprow = $adb->fetch_array($result); $cnt = 1; $currency = array(); $currencies = array(); $currency_default = ''; do { $currency_element = array();