Ejemplo n.º 1
0
            $error++;
        }
    }
    if (!$error) {
        setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
    } else {
        setEventMessages($langs->trans("Error"), null, 'errors');
    }
}
/*
 * View
 */
llxHeader('', $langs->trans('SalariesSetup'));
$form = new Form($db);
if (!empty($conf->accounting->enabled)) {
    $formaccountancy = new FormVentilation($db);
}
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
print load_fiche_titre($langs->trans('SalariesSetup'), $linkback, 'title_setup');
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="update">';
dol_fiche_head();
/*
 *  Params
 */
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">' . $langs->trans('Options') . '</td>';
print "</tr>\n";
foreach ($list as $key) {
Ejemplo n.º 2
0
if (!$sortfield) {
    $sortfield = "f.datef, f.facnumber, l.rowid";
}
if (!$sortorder) {
    if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
        $sortorder = " DESC ";
    }
}
// Security check
if ($user->societe_id > 0) {
    accessforbidden();
}
if (!$user->rights->accounting->ventilation->dispatch) {
    accessforbidden();
}
$formventilation = new FormVentilation($db);
// Purge search criteria
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) {
    $search_ref = '';
    $search_invoice = '';
    $search_label = '';
    $search_desc = '';
    $search_amount = '';
    $search_account = '';
    $search_vat = '';
}
if (is_array($changeaccount) && count($changeaccount) > 0) {
    $error = 0;
    $db->begin();
    $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as l";
    $sql1 .= " SET l.fk_code_ventilation=" . $account_parent;
Ejemplo n.º 3
0
        exit;
    }
}
/*
 * View
 */
llxHeader("", "", "FicheVentilation");
if ($cancel == $langs->trans("Cancel")) {
    $action = '';
}
/*
 * Create
 */
$form = new Form($db);
$facture_static = new Facture($db);
$formventilation = new FormVentilation($db);
if (!empty($id)) {
    $sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.price,";
    $sql .= " l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice, p.accountancy_code_sell as code_sell,";
    $sql .= " l.fk_code_ventilation, aa.account_number, aa.label";
    $sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as l";
    $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
    $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON l.fk_code_ventilation = aa.rowid";
    $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = l.fk_facture";
    $sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id;
    if (!empty($conf->multicompany->enabled)) {
        $sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")";
    }
    dol_syslog("/accounting/customer/card.php sql=" . $sql, LOG_DEBUG);
    $result = $db->query($sql);
    if ($result) {
Ejemplo n.º 4
0
if (!$sortfield) {
    $sortfield = "f.datef, f.facnumber, l.rowid";
}
if (!$sortorder) {
    if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
        $sortorder = " DESC ";
    }
}
// Security check
if ($user->societe_id > 0) {
    accessforbidden();
}
if (!$user->rights->accounting->ventilation->dispatch) {
    accessforbidden();
}
$formventilation = new FormVentilation($db);
$accounting = new AccountingAccount($db);
$aarowid_s = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT, 1);
$aarowid_p = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT, 1);
// Purge search criteria
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) {
    $search_ref = '';
    $search_invoice = '';
    $search_label = '';
    $search_desc = '';
    $search_amount = '';
    $search_account = '';
    $search_vat = '';
}
/*
 * View
Ejemplo n.º 5
0
                    dol_syslog("/accountancy/admin/productaccount.php sql=" . $sql, LOG_DEBUG);
                    if ($db->query($sql)) {
                        $msg .= '<div><font color="green">' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . length_accountg($accounting->account_number) . '</font></div>';
                    } else {
                        $msg .= '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . length_accountg($accounting->account_number) . '<br/> <pre>' . $sql . '</pre></font></div>';
                    }
                }
                $cpt++;
            }
        } else {
            $msg .= '<div><font color="red">' . $langs->trans("AnyLineVentilate") . '</font></div>';
        }
        $msg .= '<div><font color="red">' . $langs->trans("EndProcessing") . '</font></div>';
    }
}
$form = new FormVentilation($db);
// Defaut AccountingAccount RowId Product / Service
// at this time ACCOUNTING_SERVICE_SOLD_ACCOUNT & ACCOUNTING_PRODUCT_SOLD_ACCOUNT are account number not accountingacount rowid
// so we need to get those default value rowid first
$accounting = new AccountingAccount($db);
// TODO: we should need to check if result is a really exist accountaccount rowid.....
$aarowid_servbuy = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT, 1);
$aarowid_prodbuy = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT, 1);
$aarowid_servsell = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT, 1);
$aarowid_prodsell = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT, 1);
$aacompta_servbuy = !empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef");
$aacompta_prodbuy = !empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef");
$aacompta_servsell = !empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef");
$aacompta_prodsell = !empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef");
// Purge search criteria
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) {
Ejemplo n.º 6
0
$sortorder = GETPOST("sortorder");
$sortfield = GETPOST("sortfield");
$action = GETPOST('action', 'alpha');
$search_doc_type = GETPOST("search_doc_type");
$search_doc_ref = GETPOST("search_doc_ref");
$search_account = GETPOST("search_account");
$search_thirdparty = GETPOST("search_thirdparty");
$search_journal = GETPOST("search_journal");
if ($sortorder == "") {
    $sortorder = "ASC";
}
if ($sortfield == "") {
    $sortfield = "bk.rowid";
}
$offset = $conf->liste_limit * $page;
$formventilation = new FormVentilation($db);
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) {
    $search_doc_type = "";
    $search_doc_ref = "";
    $search_account = "";
    $search_thirdparty = "";
    $search_journal = "";
}
/*
 * Action
 */
if ($action == 'delbookkeeping') {
    $import_key = GETPOST('importkey', 'alpha');
    if (!empty($import_key)) {
        $object = new BookKeeping($db);
        $result = $object->delete_by_importkey($import_key);
Ejemplo n.º 7
0
                    setEventMessages($book->error, $book->errors, 'errors');
                } else {
                    setEventMessages($langs->trans('Saved'), null, 'mesgs');
                    $action = '';
                    $piece_num = $book->piece_num;
                }
            }
        }
    }
}
/*
 * View
 */
llxHeader();
$html = new Form($db);
$formventilation = new FormVentilation($db);
/*
 *  Confirmation to delete the command
 */
if ($action == 'delete') {
    $formconfirm = $html->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $id, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'confirm_delete', '', 0, 1);
    print $formconfirm;
}
if ($action == 'create') {
    print load_fiche_titre($langs->trans("CreateMvts"));
    $code_journal_array = array($conf->global->ACCOUNTING_SELL_JOURNAL => $conf->global->ACCOUNTING_SELL_JOURNAL, $conf->global->ACCOUNTING_PURCHASE_JOURNAL => $conf->global->ACCOUNTING_PURCHASE_JOURNAL, $conf->global->ACCOUNTING_SOCIAL_JOURNAL => $conf->global->ACCOUNTING_SOCIAL_JOURNAL, $conf->global->ACCOUNTING_MISCELLANEOUS_JOURNAL => $conf->global->ACCOUNTING_MISCELLANEOUS_JOURNAL, $conf->global->ACCOUNTING_EXPENSEREPORT_JOURNAL => $conf->global->ACCOUNTING_EXPENSEREPORT_JOURNAL);
    $sql = 'SELECT DISTINCT accountancy_journal FROM ' . MAIN_DB_PREFIX . 'bank_account WHERE clos=0';
    $resql = $db->query($sql);
    if (!$resql) {
        setEventMessages($db->lasterror, null, 'errors');
    } else {
Ejemplo n.º 8
0
                if ($result > 0) {
                    Header("Location: account.php");
                }
            }
            if ($result < 0) {
                setEventMessage($accounting->error, 'errors');
            }
        }
    }
}
/*
 * View
 */
llxheader('', $langs->trans('AccountAccounting'));
$form = new Form($db);
$htmlacc = new FormVentilation($db);
if ($action == 'create') {
    print_fiche_titre($langs->trans('NewAccount'));
    print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
    print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
    print '<input type="hidden" name="action" value="add">';
    dol_fiche_head();
    print '<table class="border" width="100%">';
    print '<tr><td width="25%">' . $langs->trans("AccountNumber") . '</td>';
    print '<td><input name="account_number" size="30" value="' . $accounting->account_number . '"</td></tr>';
    print '<tr><td>' . $langs->trans("Label") . '</td>';
    print '<td><input name="label" size="70" value="' . $accounting->label . '"</td></tr>';
    print '<tr><td>' . $langs->trans("Accountparent") . '</td>';
    print '<td>';
    print $htmlacc->select_account($accounting->account_parent, 'account_parent');
    print '</td></tr>';
Ejemplo n.º 9
0
if (!$sortfield) {
    $sortfield = "f.datef, f.ref, l.rowid";
}
if (!$sortorder) {
    if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
        $sortorder = " DESC ";
    }
}
// Security check
if ($user->societe_id > 0) {
    accessforbidden();
}
if (!$user->rights->accounting->ventilation->dispatch) {
    accessforbidden();
}
$formventilation = new FormVentilation($db);
// Purge search criteria
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) {
    $search_ref = '';
    $search_invoice = '';
    $search_label = '';
    $search_desc = '';
    $search_amount = '';
    $search_account = '';
    $search_vat = '';
}
if (is_array($changeaccount) && count($changeaccount) > 0) {
    $error = 0;
    $db->begin();
    $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as l";
    $sql1 .= " SET l.fk_code_ventilation=" . GETPOST('account_parent');
Ejemplo n.º 10
0
 * View
 */

$helpurl='';
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos';
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:M&oacute;dulo_Servicios';

if (isset($_GET['type'])) $title = $langs->trans('CardProduct'.GETPOST('type'));
else $title = $langs->trans('ProductServiceCard');

llxHeader('', $title, $helpurl);

$form = new Form($db);
$formfile = new FormFile($db);
$formproduct = new FormProduct($db);
if (! empty($conf->accounting->enabled)) $formaccountancy = New FormVentilation($db);


if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
{
	// -----------------------------------------
	// When used with CANVAS
	// -----------------------------------------
	if (empty($object->error) && $id)
	{
		$object = new Product($db);
		$result=$object->fetch($id);
		if ($result <= 0) dol_print_error('',$object->error);
	}
	$objcanvas->assign_values($action, $object->id, $object->ref);	// Set value for templates
	$objcanvas->display_canvas($action);							// Show template
Ejemplo n.º 11
0
$search_accountancy_aux_code = GETPOST("search_accountancy_aux_code");
$search_accountancy_aux_code_start = GETPOST('search_accountancy_aux_code_start', 'alpha');
if ($search_accountancy_aux_code_start == -1) {
    $search_accountancy_aux_code_start = '';
}
$search_accountancy_aux_code_end = GETPOST('search_accountancy_aux_code_end', 'alpha');
if ($search_accountancy_aux_code_end == -1) {
    $search_accountancy_aux_code_end = '';
}
$search_mvt_label = GETPOST('search_mvt_label', 'alpha');
$search_direction = GETPOST('search_direction', 'alpha');
$search_ledger_code = GETPOST('search_ledger_code', 'alpha');
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : $conf->liste_limit;
$offset = $limit * $page;
$object = new BookKeeping($db);
$formventilation = new FormVentilation($db);
$formother = new FormOther($db);
$form = new Form($db);
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) {
    $search_mvt_num = '';
    $search_doc_type = '';
    $search_doc_ref = '';
    $search_doc_date = '';
    $search_accountancy_code = '';
    $search_accountancy_code_start = '';
    $search_accountancy_code_end = '';
    $search_accountancy_aux_code = '';
    $search_accountancy_aux_code_start = '';
    $search_accountancy_aux_code_end = '';
    $search_mvt_label = '';
    $search_direction = '';
Ejemplo n.º 12
0
/**
 *	Show fields in insert/edit mode
 *
 * 	@param		array	$fieldlist		Array of fields
 * 	@param		Object	$obj			If we show a particular record, obj is filled with record fields
 *  @param		string	$tabname		Name of SQL table
 *  @param		string	$context		'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
 *	@return		void
 */
function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
{
    global $conf, $langs, $db;
    global $form;
    global $region_id;
    global $elementList, $sourceList, $localtax_typeList;
    global $bc;
    $formadmin = new FormAdmin($db);
    $formcompany = new FormCompany($db);
    if (!empty($conf->accounting->enabled)) {
        $formaccountancy = new FormVentilation($db);
    }
    foreach ($fieldlist as $field => $value) {
        if ($fieldlist[$field] == 'country') {
            if (in_array('region_id', $fieldlist)) {
                print '<td>';
                //print join(',',$fieldlist);
                print '</td>';
                continue;
            }
            // For state page, we do not show the country input (we link to region, not country)
            print '<td>';
            $fieldname = 'country';
            print $form->select_country(!empty($obj->country_code) ? $obj->country_code : (!empty($obj->country) ? $obj->country : ''), $fieldname, '', 28, 'maxwidth300');
            print '</td>';
        } elseif ($fieldlist[$field] == 'country_id') {
            if (!in_array('country', $fieldlist)) {
                $country_id = !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : 0;
                print '<td>';
                print '<input type="hidden" name="' . $fieldlist[$field] . '" value="' . $country_id . '">';
                print '</td>';
            }
        } elseif ($fieldlist[$field] == 'region') {
            print '<td>';
            $formcompany->select_region($region_id, 'region');
            print '</td>';
        } elseif ($fieldlist[$field] == 'region_id') {
            $region_id = !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : 0;
            print '<td>';
            print '<input type="hidden" name="' . $fieldlist[$field] . '" value="' . $region_id . '">';
            print '</td>';
        } elseif ($fieldlist[$field] == 'lang') {
            print '<td>';
            print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'lang');
            print '</td>';
        } elseif ($fieldlist[$field] == 'type_template') {
            print '<td>';
            print $form->selectarray('type_template', $elementList, !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '');
            print '</td>';
        } elseif ($fieldlist[$field] == 'element') {
            print '<td>';
            print $form->selectarray('element', $elementList, !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '');
            print '</td>';
        } elseif ($fieldlist[$field] == 'source') {
            print '<td>';
            print $form->selectarray('source', $sourceList, !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '');
            print '</td>';
        } elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX . "c_actioncomm") {
            print '<td>';
            print 'user<input type="hidden" name="type" value="user">';
            print '</td>';
        } elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'fdm' || $fieldlist[$field] == 'deductible') {
            print '<td>';
            print $form->selectyesno($fieldlist[$field], !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '', 1);
            print '</td>';
        } elseif (in_array($fieldlist[$field], array('nbjour', 'decalage', 'taux', 'localtax1', 'localtax2'))) {
            $align = "left";
            if (in_array($fieldlist[$field], array('taux', 'localtax1', 'localtax2'))) {
                $align = "right";
            }
            // Fields aligned on right
            print '<td align="' . $align . '">';
            print '<input type="text" class="flat" value="' . (isset($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '" size="3" name="' . $fieldlist[$field] . '">';
            print '</td>';
        } elseif (in_array($fieldlist[$field], array('libelle_facture'))) {
            print '<td><textarea cols="30" rows="' . ROWS_2 . '" class="flat" name="' . $fieldlist[$field] . '">' . (!empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '</textarea></td>';
        } elseif (in_array($fieldlist[$field], array('content'))) {
            if ($tabname == MAIN_DB_PREFIX . 'c_email_templates') {
                print '<td colspan="4"></td></tr><tr class="pair nohover"><td colspan="5">';
                // To create an artificial CR for the current tr we are on
            } else {
                print '<td>';
            }
            if ($context != 'hide') {
                //print '<textarea cols="3" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'</textarea>';
                $doleditor = new DolEditor($fieldlist[$field], !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '', '', 140, 'dolibarr_mailings', 'In', 0, false, true, ROWS_5, '90%');
                print $doleditor->Create(1);
            } else {
                print '&nbsp;';
            }
            print '</td>';
        } elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i', $fieldlist[$field])) {
            print '<td><input type="text" class="flat" value="' . price(!empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '" size="8" name="' . $fieldlist[$field] . '"></td>';
        } elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist}[$field])) {
            print '<td><input type="text" class="flat" value="' . (!empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '" size="10" name="' . $fieldlist[$field] . '"></td>';
        } elseif ($fieldlist[$field] == 'unit') {
            print '<td>';
            $units = array('mm' => $langs->trans('SizeUnitmm'), 'cm' => $langs->trans('SizeUnitcm'), 'point' => $langs->trans('SizeUnitpoint'), 'inch' => $langs->trans('SizeUnitinch'));
            print $form->selectarray('unit', $units, !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '', 0, 0, 0);
            print '</td>';
        } elseif ($fieldlist[$field] == 'localtax1_type' || $fieldlist[$field] == 'localtax2_type') {
            print '<td align="center">';
            print $form->selectarray($fieldlist[$field], $localtax_typeList, !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '');
            print '</td>';
        } elseif ($fieldlist[$field] == 'accountancy_code' || $fieldlist[$field] == 'accountancy_code_sell' || $fieldlist[$field] == 'accountancy_code_buy') {
            print '<td>';
            if (!empty($conf->accounting->enabled)) {
                $accountancy_account = !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : 0;
                print $formaccountancy->select_account($accountancy_account, $fieldlist[$field], 1, '', 1, 1);
            } else {
                print '<input type="text" size="10" class="flat" value="' . (isset($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '" name="' . $fieldlist[$field] . '">';
            }
            print '</td>';
        } else {
            print '<td>';
            $size = '';
            if ($fieldlist[$field] == 'code') {
                $size = 'size="8" ';
            }
            if ($fieldlist[$field] == 'position') {
                $size = 'size="4" ';
            }
            if ($fieldlist[$field] == 'libelle') {
                $size = 'size="32" ';
            }
            if ($fieldlist[$field] == 'tracking') {
                $size = 'size="92" ';
            }
            if ($fieldlist[$field] == 'sortorder') {
                $size = 'size="2" ';
            }
            print '<input type="text" ' . $size . ' class="flat" value="' . (isset($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '" name="' . $fieldlist[$field] . '">';
            print '</td>';
        }
    }
}
Ejemplo n.º 13
0
}
$search_code_tiers = GETPOST('search_code_tiers', 'alpha');
$search_code_tiers_start = GETPOST('search_code_tiers_start', 'alpha');
if ($search_code_tiers_start == -1) {
    $search_code_tiers_start = '';
}
$search_code_tiers_end = GETPOST('search_code_tiers_end', 'alpha');
if ($search_code_tiers_end == -1) {
    $search_code_tiers_end = '';
}
$search_label_compte = GETPOST('search_label_compte', 'alpha');
$search_sens = GETPOST('search_sens', 'alpha');
$search_code_journal = GETPOST('search_code_journal', 'alpha');
$object = new BookKeeping($db);
$form = new Form($db);
$formventilation = new FormVentilation($db);
// Filter
if (empty($search_date_start)) {
    $search_date_start = dol_mktime(0, 0, 0, 1, 1, dol_print_date(dol_now(), '%Y'));
    $search_date_end = dol_mktime(0, 0, 0, 12, 31, dol_print_date(dol_now(), '%Y'));
}
if ($sortorder == "") {
    $sortorder = "ASC";
}
if ($sortfield == "") {
    $sortfield = "t.rowid";
}
$offset = $limit * $page;
llxHeader('', $langs->trans("Bookkeeping"));
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) {
    $search_doc_type = "";
Ejemplo n.º 14
0
if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes" && $user->rights->banque->configurer) {
    // Delete
    $account = new Account($db);
    $account->fetch($_GET["id"]);
    $account->delete();
    header("Location: " . DOL_URL_ROOT . "/compta/bank/index.php");
    exit;
}
/*
 * View
 */
$form = new Form($db);
$formbank = new FormBank($db);
$formcompany = new FormCompany($db);
if (!empty($conf->accounting->enabled)) {
    $formaccountancy = new FormVentilation($db);
}
$countrynotdefined = $langs->trans("ErrorSetACountryFirst") . ' (' . $langs->trans("SeeAbove") . ')';
llxHeader();
// Creation
if ($action == 'create') {
    $account = new Account($db);
    print load_fiche_titre($langs->trans("NewFinancialAccount"), '', 'title_bank.png');
    if ($conf->use_javascript_ajax) {
        print "\n" . '<script type="text/javascript" language="javascript">';
        print 'jQuery(document).ready(function () {
                    jQuery("#selecttype").change(function() {
                        document.formsoc.action.value="create";
                        document.formsoc.submit();
                    });
                    jQuery("#selectaccount_country_id").change(function() {
Ejemplo n.º 15
0
$search_date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'));
$search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha');
if ($search_accountancy_code_start == -1) {
    $search_accountancy_code_start = '';
}
$search_accountancy_code_end = GETPOST('search_accountancy_code_end', 'alpha');
if ($search_accountancy_code_end == -1) {
    $search_accountancy_code_end = '';
}
if (GETPOST("button_export_csv_x") || GETPOST("button_export_csv")) {
    $action = 'export_csv';
}
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : $conf->liste_limit;
$offset = $limit * $page;
$object = new BookKeeping($db);
$formventilation = new FormVentilation($db);
$formother = new FormOther($db);
$form = new Form($db);
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) {
    $search_accountancy_code_start = '';
    $search_accountancy_code_end = '';
    $search_date_start = '';
    $search_date_end = '';
}
if (empty($search_date_start)) {
    $search_date_start = dol_mktime(0, 0, 0, 1, 1, dol_print_date(dol_now(), '%Y'));
    $search_date_end = dol_mktime(0, 0, 0, 12, 31, dol_print_date(dol_now(), '%Y'));
}
if ($sortorder == "") {
    $sortorder = "ASC";
}
Ejemplo n.º 16
0
                if (!$error) {
                    setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
                } else {
                    setEventMessages($langs->trans("Error"), null, 'mesgs');
                }
            }
        }
    }
}
/*
 * View
 */
$dir = "../../core/modules/dons/";
$form = new Form($db);
if (!empty($conf->accounting->enabled)) {
    $formaccountancy = new FormVentilation($db);
}
llxHeader('', $langs->trans("DonationsSetup"), 'DonConfiguration');
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
print load_fiche_titre($langs->trans("DonationsSetup"), $linkback, 'title_setup');
$head = donation_admin_prepare_head();
dol_fiche_head($head, 'general', $langs->trans("Donations"), 0, 'payment');
/*
 *  Params
 */
print load_fiche_titre($langs->trans("Options"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">' . $langs->trans("Parameters") . '</td>';
//print '<td width="80">&nbsp;</td>';
print "</tr>\n";