} elseif ($links[$key]['type'] == 'payment_donation') { print '<a href="' . DOL_URL_ROOT . '/don/payment/card.php?id=' . $links[$key]['url_id'] . '">'; print ' ' . img_object($langs->trans('ShowPayment'), 'payment') . ' '; print '</a>'; } elseif ($links[$key]['type'] == 'payment_expensereport') { print '<a href="' . DOL_URL_ROOT . '/expensereport/payment/card.php?id=' . $links[$key]['url_id'] . '">'; print ' ' . img_object($langs->trans('ShowPayment'), 'payment') . ' '; print '</a>'; } elseif ($links[$key]['type'] == 'banktransfert') { // Do not show link to transfer since there is no transfer card (avoid confusion). Can already be accessed from transaction detail. if ($objp->amount > 0) { $banklinestatic->fetch($links[$key]['url_id']); $bankstatic->id = $banklinestatic->fk_account; $bankstatic->label = $banklinestatic->bank_account_label; print ' (' . $langs->trans("TransferFrom") . ' '; print $bankstatic->getNomUrl(1, 'transactions'); print ' ' . $langs->trans("toward") . ' '; $bankstatic->id = $objp->bankid; $bankstatic->label = $objp->bankref; print $bankstatic->getNomUrl(1, ''); print ')'; } else { $bankstatic->id = $objp->bankid; $bankstatic->label = $objp->bankref; print ' (' . $langs->trans("TransferFrom") . ' '; print $bankstatic->getNomUrl(1, ''); print ' ' . $langs->trans("toward") . ' '; $banklinestatic->fetch($links[$key]['url_id']); $bankstatic->id = $banklinestatic->fk_account; $bankstatic->label = $banklinestatic->bank_account_label; print $bankstatic->getNomUrl(1, 'transactions');
} if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"])) { $bankcash = new Account($db); $bankcash->fetch($_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"]); $bankcash->label = $bankcash->ref; $bankcashLink = $bankcash->getNomUrl(1); } if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CB"])) { $bankcb = new Account($db); $bankcb->fetch($_SESSION["CASHDESK_ID_BANKACCOUNT_CB"]); $bankcbLink = $bankcb->getNomUrl(1); } if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CHEQUE"])) { $bankcheque = new Account($db); $bankcheque->fetch($_SESSION["CASHDESK_ID_BANKACCOUNT_CHEQUE"]); $bankchequeLink = $bankcheque->getNomUrl(1); } if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && !empty($conf->stock->enabled)) { $warehouse = new Entrepot($db); $warehouse->fetch($_SESSION["CASHDESK_ID_WAREHOUSE"]); $warehouseLink = $warehouse->getNomUrl(1); } $langs->load("cashdesk"); $langs->load("main"); print '<div class="menu_bloc">'; print '<ul class="menu">'; // Link to new sell print '<li class="menu_choix1"><a href="affIndex.php?menu=facturation&id=NOUV"><span>' . $langs->trans("NewSell") . '</span></a></li>'; // Open new tab on backoffice (this is not a disconnect from POS) print '<li class="menu_choix2"><a href=".." target="backoffice"><span>' . $langs->trans("BackOffice") . '</span></a></li>'; // Disconnect
print '<td>' . $langs->trans("Account") . '</td>'; print '<td align="right">' . $langs->trans("NbOfCheques") . '</td>'; print '<td align="right">' . $langs->trans("Amount") . '</td>'; print '<td align="right">' . $langs->trans("Status") . '</td>'; print "</tr>\n"; $var = true; while ($objp = $db->fetch_object($resql)) { $checkdepositstatic->id = $objp->rowid; $checkdepositstatic->ref = $objp->ref ? $objp->ref : $objp->rowid; $checkdepositstatic->statut = $objp->statut; $accountstatic->id = $objp->bid; $accountstatic->label = $objp->label; $var = !$var; print "<tr {$bc[$var]}>\n"; print '<td>' . $checkdepositstatic->getNomUrl(1) . '</td>'; print '<td>' . dol_print_date($db->jdate($objp->db), 'day') . '</td>'; print '<td>' . $accountstatic->getNomUrl(1) . '</td>'; print '<td align="right">' . $objp->nbcheque . '</td>'; print '<td align="right">' . price($objp->amount) . '</td>'; print '<td align="right">' . $checkdepositstatic->LibStatut($objp->statut, 3) . '</td>'; print '</tr>'; } print "</table>"; $db->free($resql); } else { dol_print_error($db); } print "</td></tr>\n"; print "</table>\n"; $db->close(); llxFooter('$Date: 2011/08/03 00:46:28 $ - $Revision: 1.21 $');
if ($num > 0) { while ($i < $num) { $objp = $db->fetch_object($result); $var = !$var; print '<tr ' . $bc[$var] . '><td>'; print '<a href="' . DOL_URL_ROOT . '/compta/paiement/card.php?id=' . $objp->rowid . '">' . img_object($langs->trans('ShowPayment'), 'payment') . ' '; print dol_print_date($db->jdate($objp->dp), 'day') . '</a></td>'; $label = $langs->trans("PaymentType" . $objp->payment_code) != "PaymentType" . $objp->payment_code ? $langs->trans("PaymentType" . $objp->payment_code) : $objp->payment_label; print '<td>' . $label . ' ' . $objp->num_paiement . '</td>'; if (!empty($conf->banque->enabled)) { $bankaccountstatic->id = $objp->baid; $bankaccountstatic->ref = $objp->ref; $bankaccountstatic->label = $objp->ref; print '<td align="right">'; if ($bankaccountstatic->id) { print $bankaccountstatic->getNomUrl(1, 'transactions'); } print '</td>'; } print '<td align="right">' . price($sign * $objp->amount) . '</td>'; print '<td> </td>'; print '</tr>'; $i++; } } else { print '<tr ' . $bc[false] . '><td colspan="' . $nbcols . '">' . $langs->trans("None") . '</td><td></td><td></td></tr>'; } // } $db->free($result); } else { dol_print_error($db);
$paymentvatstatic->fetch($links[$key]['url_id']); if ($accountelem) { $accountelem .= ', '; } $accountelem .= $langs->transnoentitiesnoconv("VATPayments") . ' ' . $paymentvatstatic->ref; } elseif ($links[$key]['type'] == 'banktransfert') { $comment = $outputlangs->transnoentitiesnoconv("Transfer"); if ($objp->amount > 0) { if ($comment) { $comment .= ' '; } $banklinestatic->fetch($links[$key]['url_id']); $bankstatic->id = $banklinestatic->fk_account; $bankstatic->label = $banklinestatic->bank_account_label; $comment .= ' (' . $langs->transnoentitiesnoconv("from") . ' '; $comment .= $bankstatic->getNomUrl(1, 'transactions'); $comment .= ' ' . $langs->transnoentitiesnoconv("toward") . ' '; $bankstatic->id = $objp->bankid; $bankstatic->label = $objp->bankref; $comment .= $bankstatic->getNomUrl(1, ''); $comment .= ')'; } else { if ($comment) { $comment .= ' '; } $bankstatic->id = $objp->bankid; $bankstatic->label = $objp->bankref; $comment .= ' (' . $langs->transnoentitiesnoconv("from") . ' '; $comment .= $bankstatic->getNomUrl(1, ''); $comment .= ' ' . $langs->transnoentitiesnoconv("toward") . ' '; $banklinestatic->fetch($links[$key]['url_id']);
print '</tr></table>'; print '</td><td colspan="2">'; if ($action == 'editrefext') { print '<form name="setrefext" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="setrefext">'; print '<input type="text" name="ref_ext" value="' . $object->ref_ext . '">'; print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">'; print '</form>'; } else { print $object->ref_ext; } print '</td>'; print '</tr>'; print '<tr><td>' . $langs->trans('Account') . '</td><td colspan="2">'; print $accountstatic->getNomUrl(1); print '</td></tr>'; // Nb of cheques print '<tr><td>' . $langs->trans('NbOfCheques') . '</td><td colspan="2">'; print $object->nbcheque; print '</td></tr>'; print '<tr><td>' . $langs->trans('Total') . '</td><td colspan="2">'; print price($object->amount); print '</td></tr>'; print '<tr><td>' . $langs->trans('Status') . '</td><td colspan="2">'; print $object->getLibStatut(4); print '</td></tr>'; print '</table><br>'; // Liste des cheques $sql = "SELECT b.rowid, b.amount, b.num_chq, b.emetteur,"; $sql .= " b.dateo as date, b.datec as datec, b.banque,";
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="orig_account" value="' . $orig_account . '">'; print '<input type="hidden" name="id" value="' . $acct->id . '">'; print '<table class="border" width="100%">'; $linkback = '<a href="' . DOL_URL_ROOT . '/compta/bank/search.php">' . $langs->trans("BackToList") . '</a>'; // Ref print '<tr><td width="20%">' . $langs->trans("Ref") . "</td>"; print '<td colspan="4">'; print $form->showrefnav($bankline, 'rowid', $linkback, 1, 'rowid', 'rowid'); print '</td>'; print '</tr>'; $i++; // Bank account print "<tr><td>" . $langs->trans("Account") . "</td>"; print '<td colspan="4">'; print $acct->getNomUrl(1, 'transactions'); print '</td>'; print '</tr>'; // Show links of bank transactions if (count($links)) { print "<tr><td>" . $langs->trans("Links") . "</td>"; print '<td colspan="4">'; foreach ($links as $key => $val) { if ($key) { print '<br>'; } if ($links[$key]['type'] == 'payment') { print '<a href="' . DOL_URL_ROOT . '/compta/paiement/card.php?id=' . $links[$key]['url_id'] . '">'; print img_object($langs->trans('ShowPayment'), 'payment') . ' '; print $langs->trans("Payment"); print '</a>';
$moreparam = '&month=' . $month . '&year=' . $year . ($mode == 'showalltime' ? '&mode=showalltime' : ''); if ($_GET["option"] != 'all') { $morehtml = '<a href="' . $_SERVER["PHP_SELF"] . '?account=' . $account . '&option=all' . $moreparam . '">' . $langs->trans("ShowAllAccounts") . '</a>'; print $form->showrefnav($acct, 'ref', $linkback, 1, 'ref', 'ref', '', $moreparam); } else { $morehtml = '<a href="' . $_SERVER["PHP_SELF"] . '?account=' . $account . $moreparam . '">' . $langs->trans("BackToAccount") . '</a>'; print $langs->trans("All"); //print $morehtml; } } else { $bankaccount = new Account($db); $listid = explode(',', $account); foreach ($listid as $key => $id) { $bankaccount->fetch($id); $bankaccount->label = $bankaccount->ref; print $bankaccount->getNomUrl(1); if ($key < count($listid) - 1) { print ', '; } } } } else { print $langs->trans("All"); } print '</td></tr>'; // Label print '<tr><td>' . $langs->trans("Label") . '</td>'; print '<td colspan="3">'; if ($account && $_GET["option"] != 'all') { print $acct->label; } else {
print '<td align="center" width="100">' . $langs->trans("TransactionsToConciliate") . '</td>'; print '<td align="center" width="70">' . $langs->trans("Status") . '</td>'; print '<td align="right" width="100">' . $langs->trans("BankBalance") . '</td>'; print "</tr>\n"; $total = 0; $found = 0; $var = true; foreach ($accounts as $key => $type) { if ($type == 0) { $found++; $acc = new Account($db); $acc->fetch($key); $var = !$var; $solde = $acc->solde(1); print "<tr " . $bc[$var] . ">"; print '<td width="30%">' . $acc->getNomUrl(1) . '</td>'; print '<td>' . $acc->bank . '</td>'; print '<td>' . $acc->number . '</td>'; print '<td align="center">'; if ($acc->rappro) { $result = $acc->load_board($user, $acc->id); print $acc->nbtodo; if ($acc->nbtodolate) { print ' (' . $acc->nbtodolate . img_warning($langs->trans("Late")) . ')'; } } else { print $langs->trans("FeatureDisabled"); } print '</td>'; print '<td align="center">' . $acc->getLibStatut(2) . '</td>'; print '<td align="right">';
/** * Return clicable name (with picto eventually) * * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto * @param int $maxlen Longueur max libelle * @param string $option Option ('showall') * @return string Chaine avec URL */ function getNomUrl($withpicto = 0, $maxlen = 0, $option = '') { global $langs; $result = ''; $label = $langs->trans("ShowTransaction") . ': ' . $this->rowid; $link = '<a href="' . DOL_URL_ROOT . '/compta/bank/ligne.php?rowid=' . $this->rowid . '" title="' . dol_escape_htmltag($label, 1) . '" class="classfortooltip">'; $linkend = '</a>'; if ($withpicto) { $result .= $link . img_object($label, 'account', 'class="classfortooltip"') . $linkend . ' '; } $result .= $link . $this->rowid . $linkend; if ($option == 'showall' || $option == 'showconciliated') { $result .= ' ('; } if ($option == 'showall') { $result .= $langs->trans("BankAccount") . ': '; $accountstatic = new Account($this->db); $accountstatic->id = $this->fk_account; $accountstatic->label = $this->bank_account_label; $result .= $accountstatic->getNomUrl(0) . ', '; } if ($option == 'showall' || $option == 'showconciliated') { $result .= $langs->trans("BankLineConciliated") . ': '; $result .= yn($this->rappro); } if ($option == 'showall' || $option == 'showconciliated') { $result .= ')'; } return $result; }
print '<td>' . $langs->trans('PaymentBank') . '</td>'; print '<td colspan="3">'; //print $bankline->getNomUrl(1,0,'showall'); print '</td>'; print '</tr>'; } } // Bank_extra if ($conf->banque->enabled) { if ($cash->fk_paycash) { $bankline_extra = new Account($db); $bankline_extra->fetch($cash->fk_paybank_extra); print '<tr>'; print '<td>' . $langs->trans('PaymentBankExtra') . '</td>'; print '<td colspan="3">'; print $bankline_extra->getNomUrl(1); print '</td>'; print '</tr>'; // Payment mode print '<tr>'; print '<td>' . $langs->trans('ModePaymentBankExtra') . '</td>'; print '<td colspan="3">'; $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $cash->id, $cash->fk_modepaybank_extra, 'none'); print "</td>"; print '</tr>'; } else { print '<tr>'; print '<td>' . $langs->trans('PaymentBankExtra') . '</td>'; print '<td colspan="3">'; //print $bankline->getNomUrl(1,0,'showall'); print '</td>';
foreach ($tabbq[$key] as $k => $mt) { print '"' . $date . '"' . $sep; print '"' . $val["ref"] . '"' . $sep; print '"' . length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) . '"' . $sep; print '"' . $langs->trans("Bank") . '"' . $sep; print '"' . ($mt < 0 ? price(-$mt) : '') . '"' . $sep; print '"' . ($mt >= 0 ? price($mt) : '') . '"'; print "\n"; } } } } } else { $form = new Form($db); llxHeader('', $langs->trans("FinanceJournal")); $nom = $langs->trans("FinanceJournal") . ' - ' . $bank_code_journal->getNomUrl(1); $builddate = time(); $description = $langs->trans("DescFinanceJournal") . '<br>'; $period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1); $varlink = 'id_account=' . $id_bank_account; report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink); print '<input type="button" class="button" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />'; print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />'; print ' <script type="text/javascript"> function launch_export() { $("div.fiche div.tabBar form input[name=\\"action\\"]").val("export_csv"); $("div.fiche div.tabBar form input[type=\\"submit\\"]").click(); $("div.fiche div.tabBar form input[name=\\"action\\"]").val(""); } function writebookkeeping() {
/** * Renvoie nom clicable (avec eventuellement le picto) * * @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul * @param int $maxlen Longueur max libelle * @param string $option Option ('showall') * @return string Chaine avec URL */ function getNomUrl($withpicto = 0, $maxlen = 0, $option = '') { global $langs; $result = ''; $lien = '<a href="' . DOL_URL_ROOT . '/compta/bank/ligne.php?rowid=' . $this->rowid . '">'; $lienfin = '</a>'; if ($withpicto) { $result .= $lien . img_object($langs->trans("ShowTransaction"), 'account') . $lienfin . ' '; } $result .= $lien . $this->rowid . $lienfin; if ($option == 'showall') { $result .= ' ('; $result .= $langs->trans("BankAccount") . ': '; $accountstatic = new Account($this->db); $accountstatic->id = $this->fk_account; $accountstatic->label = $this->bank_account_label; $result .= $accountstatic->getNomUrl(0) . ', '; $result .= $langs->trans("BankLineConciliated") . ': '; $result .= yn($this->rappro); $result .= ')'; } return $result; }
print ' '; } print '</td>'; // Debit/Credit if ($objp->amount < 0) { print '<td align="right">' . price($objp->amount * -1) . "</td><td> </td>\n"; $total_debit += $objp->amount; } else { print "<td> </td><td align=\"right\">" . price($objp->amount) . "</td>\n"; $total_credit += $objp->amount; } // Bank account print '<td align="right" class="nowrap">'; $bankaccountstatic->id = $objp->bankid; $bankaccountstatic->label = $objp->bankref; print $bankaccountstatic->getNomUrl(1); print "</td>\n"; print "</tr>"; } $i++; } if ($num > 0) { print '<tr class="liste_total">'; print '<td>' . $langs->trans('Total') . '</td>'; print '<td colspan="6"></td>'; print '<td align="right">' . price($total_debit * -1) . '</td>'; print '<td align="right">' . price($total_credit) . '</td>'; print '<td></td>'; print '</tr>'; } print "</table>";
/** * Load data into info_box_contents array to show array later. * * @param int $max Maximum number of records to load * @return void */ function loadBox($max = 5) { global $user, $langs, $db, $conf; $this->max = $max; $this->info_box_head = array('text' => $langs->trans("BoxTitleCurrentAccounts")); if ($user->rights->banque->lire) { $sql = "SELECT rowid, ref, label, bank, number, courant, clos, rappro, url,"; $sql .= " code_banque, code_guichet, cle_rib, bic, iban_prefix as iban,"; $sql .= " domiciliation, proprio, owner_address,"; $sql .= " account_number, currency_code,"; $sql .= " min_allowed, min_desired, comment"; $sql .= " FROM " . MAIN_DB_PREFIX . "bank_account"; $sql .= " WHERE entity = " . $conf->entity; $sql .= " AND clos = 0"; //$sql.= " AND courant = 1"; $sql .= " ORDER BY label"; $sql .= $db->plimit($max, 0); dol_syslog(get_class($this) . "::loadBox", LOG_DEBUG); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); $line = 0; $solde_total = array(); $account_static = new Account($db); while ($line < $num) { $objp = $db->fetch_object($result); $account_static->id = $objp->rowid; $account_static->label = $objp->label; $account_static->number = $objp->number; $solde = $account_static->solde(0); $solde_total[$objp->currency_code] += $solde; $this->info_box_contents[$line][] = array('td' => 'align="left"', 'text' => $account_static->getNomUrl(1), 'asis' => 1); $this->info_box_contents[$line][] = array('td' => 'align="left"', 'text' => $objp->number); $this->info_box_contents[$line][] = array('td' => 'align="right"', 'text' => price($solde, 0, $langs, 0, -1, -1, $objp->currency_code)); $line++; } // Total foreach ($solde_total as $key => $solde) { $this->info_box_contents[$line][] = array('tr' => 'class="liste_total"', 'td' => 'align="left" class="liste_total"', 'text' => $langs->trans('Total') . ' ' . $key); $this->info_box_contents[$line][] = array('td' => 'align="right" class="liste_total"', 'text' => ' '); $this->info_box_contents[$line][] = array('td' => 'align="right" class="liste_total"', 'text' => price($solde, 0, $langs, 0, -1, -1, $key)); $line++; } $db->free($result); } else { $this->info_box_contents[0][0] = array('td' => 'align="left"', 'maxlength' => 500, 'text' => $db->error() . ' sql=' . $sql); } } else { $this->info_box_contents[0][0] = array('td' => 'align="left"', 'text' => $langs->trans("ReadPermissionNotAllowed")); } }