// Other search criteria for ($i = 1; $i <= $si; $i++) { $sql .= " AND " . $sqlw[$i]; } $sql .= $db->order($sortfield, $sortorder); $sql .= $db->plimit($limit + 1, $offset); //print $sql; $resql = $db->query($sql); if ($resql) { $var = True; $num = $db->num_rows($resql); $i = 0; // Title $bankcateg = new BankCateg($db); if (!empty($_REQUEST["bid"])) { $result = $bankcateg->fetch($_REQUEST["bid"]); print_barre_liste($langs->trans("BankTransactionForCategory", $bankcateg->label) . ' ' . ($socid ? ' ' . $soc->nom : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num); } else { print_barre_liste($langs->trans("BankTransactions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num); } print '<table class="liste" width="100%">'; print '<tr class="liste_titre">'; print_liste_field_titre($langs->trans('Ref'), $_SERVER['PHP_SELF'], 'b.rowid', '', $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans('DateOperationShort'), $_SERVER['PHP_SELF'], 'b.dateo', '', $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre($langs->trans('Value'), $_SERVER['PHP_SELF'], 'b.datev', '', $param, 'align="center"', $sortfield, $sortorder); print '<td class="liste_titre" align="center">' . $langs->trans("Type") . '</td>'; print '<td class="liste_titre">' . $langs->trans("Numero") . '</td>'; print '<td class="liste_titre">' . $langs->trans("Description") . '</td>'; print '<td class="liste_titre">' . $langs->trans("ThirdParty") . '</td>'; print '<td class="liste_titre" align="right">' . $langs->trans("Debit") . '</td>'; print '<td class="liste_titre" align="right">' . $langs->trans("Credit") . '</td>';
for ($i = 1; $i <= $si; $i++) { $sql .= " AND " . $sqlw[$i]; } $sql .= $db->order($sortfield, $sortorder); $sql .= $db->plimit($limit + 1, $offset); //print $sql; dol_syslog('compta/bank/search.php::', LOG_DEBUG); $resql = $db->query($sql); if ($resql) { $var = True; $num = $db->num_rows($resql); $i = 0; // Title $bankcateg = new BankCateg($db); if (GETPOST("bid")) { $result = $bankcateg->fetch(GETPOST("bid")); print_barre_liste($langs->trans("BankTransactionForCategory", $bankcateg->label) . ' ' . ($socid ? ' ' . $soc->name : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, '', 'title_bank.png'); } else { print_barre_liste($langs->trans("BankTransactions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, '', 'title_bank.png'); } print '<form method="post" action="search.php" name="search_form">' . "\n"; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">' . "\n"; $moreforfilter = ''; $moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= $langs->trans('Period') . ' (' . $langs->trans('DateOperationShort') . ') : ' . $langs->trans('StartDate') . ' '; $moreforfilter .= $form->select_date($search_dt_start, 'search_start_dt', 0, 0, 1, "search_form", 1, 0, 1); $moreforfilter .= ' - '; $moreforfilter .= $langs->trans('EndDate') . ' ' . $form->select_date($search_dt_end, 'search_end_dt', 0, 0, 1, "search_form", 1, 0, 1); $moreforfilter .= '</div>'; if ($moreforfilter) { print '<div class="liste_titre liste_titre_bydiv centpercent">';
/** * Load an object from its id and create a new one in database * * @param int $fromid Id of object to clone * @return int New id of clone */ function createFromClone($fromid) { global $user, $langs; $error = 0; $object = new BankCateg($this->db); $object->context['createfromclone'] = 'createfromclone'; $this->db->begin(); // Load source object $object->fetch($fromid); $object->id = 0; $object->statut = 0; // Clear fields // ... // Create clone $result = $object->create($user); // Other options if ($result < 0) { $this->error = $object->error; $error++; } if (!$error) { } unset($object->context['createfromclone']); // End if (!$error) { $this->db->commit(); return $object->id; } else { $this->db->rollback(); return -1; } }