$invoicestatic = new Facture($db); $bprev = new BonPrelevement($db); $var = true; print '<table class="noborder" width="100%">'; print '<tr class="liste_titre"><td colspan="2">' . $langs->trans("Statistics") . '</td></tr>'; $var = !$var; print '<tr ' . $bc[$var] . '><td>' . $langs->trans("NbOfInvoiceToWithdraw") . '</td>'; print '<td align="right">'; print '<a href="' . DOL_URL_ROOT . '/compta/prelevement/demandes.php?status=0">'; print $bprev->NbFactureAPrelever(); print '</a>'; print '</td></tr>'; $var = !$var; print '<tr ' . $bc[$var] . '><td>' . $langs->trans("AmountToWithdraw") . '</td>'; print '<td align="right">'; print price($bprev->SommeAPrelever(), '', '', 1, -1, -1, 'auto'); print '</td></tr></table><br>'; /* * Invoices waiting for withdraw */ $sql = "SELECT f.facnumber, f.rowid, f.total_ttc, f.fk_statut, f.paye, f.type,"; $sql .= " pfd.date_demande, pfd.amount,"; $sql .= " s.nom as name, s.rowid as socid"; $sql .= " FROM " . MAIN_DB_PREFIX . "facture as f,"; $sql .= " " . MAIN_DB_PREFIX . "societe as s"; if (!$user->rights->societe->client->voir && !$socid) { $sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc"; } $sql .= " , " . MAIN_DB_PREFIX . "prelevement_facture_demande as pfd"; $sql .= " WHERE s.rowid = f.fk_soc"; $sql .= " AND f.entity = " . $conf->entity;
} /*$h=0; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/create.php'; $head[$h][1] = $langs->trans("NewStandingOrder"); $head[$h][2] = 'payment'; $hselected = 'payment'; $h++; dol_fiche_head($head, $hselected, $langs->trans("StandingOrders"), 0, 'payment'); */ print load_fiche_titre($langs->trans("NewStandingOrder")); dol_fiche_head(); $nb = $bprev->NbFactureAPrelever(); $nb1 = $bprev->NbFactureAPrelever(1); $nb11 = $bprev->NbFactureAPrelever(1, 1); $pricetowithdraw = $bprev->SommeAPrelever(); if ($nb < 0 || $nb1 < 0 || $nb11 < 0) { dol_print_error($bprev->error); } print '<table class="border" width="100%">'; print '<tr><td>' . $langs->trans("NbOfInvoiceToWithdraw") . '</td>'; print '<td align="right">'; print $nb; print '</td></tr>'; print '<tr><td>' . $langs->trans("AmountToWithdraw") . '</td>'; print '<td align="right">'; print price($pricetowithdraw); print '</td>'; print '</tr>'; //print '<tr><td>'.$langs->trans("NbOfInvoiceToWithdraw").' + '.$langs->trans("ThirdPartyBankCode").'='.$conf->global->PRELEVEMENT_CODE_BANQUE.'</td><td align="right">'; //print $nb1;
$invoicestatic = new Facture($db); $bprev = new BonPrelevement($db); $var = true; print '<table class="noborder" width="100%">'; print '<tr class="liste_titre"><td colspan="2">' . $langs->trans("Statistics") . '</td></tr>'; $var = !$var; print '<tr ' . $bc[$var] . '><td>' . $langs->trans("NbOfInvoiceToWithdraw") . '</td>'; print '<td align="right">'; print '<a href="' . DOL_URL_ROOT . '/compta/prelevement/demandes.php?status=0">'; print $bprev->NbFactureAPrelever(); print '</a>'; print '</td></tr>'; $var = !$var; print '<tr class="liste_total"><td>' . $langs->trans("AmountToWithdraw") . '</td>'; print '<td align="right">'; print price($bprev->SommeAPrelever()); print '</td></tr></table><br>'; print '</td><td valign="top" width="70%">'; /* * Withdraw receipts */ $limit = 5; $sql = "SELECT p.rowid, p.ref, p.amount, p.datec"; $sql .= " ,p.statut "; $sql .= " FROM " . MAIN_DB_PREFIX . "prelevement_bons as p"; $sql .= " ORDER BY datec DESC LIMIT " . $limit; $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); $i = 0; $var = True;