Maxi debug of direct debit order
This commit is contained in:
parent
f7563818ac
commit
c386f4b2e3
@ -333,7 +333,6 @@ class Account extends CommonObject
|
||||
public function __toString()
|
||||
{
|
||||
$string = '';
|
||||
|
||||
foreach ($this->getFieldsToShow() as $val) {
|
||||
if ($val == 'BankCode') {
|
||||
$string .= $this->code_banque.' ';
|
||||
|
||||
@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
|
||||
|
||||
if (!$user->rights->facture->lire) accessforbidden();
|
||||
|
||||
@ -44,6 +45,8 @@ $ref = GETPOST('ref', 'alpha');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$action = GETPOST('action', 'alpha');
|
||||
|
||||
$type = GETPOST('type', 'aZ09');
|
||||
|
||||
$fieldid = (!empty($ref) ? 'ref' : 'rowid');
|
||||
if ($user->socid) $socid = $user->socid;
|
||||
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid);
|
||||
@ -397,7 +400,13 @@ if ($object->id > 0)
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("RIB").'</td><td colspan="3">';
|
||||
print $object->thirdparty->display_rib();
|
||||
|
||||
$bac = new CompanyBankAccount($db);
|
||||
$bac->fetch(0, $object->thirdparty->id);
|
||||
|
||||
print $bac->iban.(($bac->iban && $bac->bic) ? ' / ' : '').$bac->bic;
|
||||
if ($bac->verif() <= 0) print img_warning('Error on default bank number for IBAN : '.$bac->error_message);
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
@ -493,7 +502,11 @@ if ($object->id > 0)
|
||||
$sql .= " , pfd.date_traite as date_traite";
|
||||
$sql .= " , pfd.amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
|
||||
$sql .= " WHERE fk_facture = ".$object->id;
|
||||
if ($type == 'bank-transfer') {
|
||||
$sql .= " WHERE fk_facture_fourn = ".$object->id;
|
||||
} else {
|
||||
$sql .= " WHERE fk_facture = ".$object->id;
|
||||
}
|
||||
$sql .= " AND pfd.traite = 0";
|
||||
$sql .= " ORDER BY pfd.date_demande DESC";
|
||||
|
||||
@ -508,11 +521,15 @@ if ($object->id > 0)
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
// For wich amount ?
|
||||
// For which amount ?
|
||||
|
||||
$sql = "SELECT SUM(pfd.amount) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
|
||||
$sql .= " WHERE fk_facture = ".$object->id;
|
||||
if ($type == 'bank-transfer') {
|
||||
$sql .= " WHERE fk_facture_fourn = ".$object->id;
|
||||
} else {
|
||||
$sql .= " WHERE fk_facture = ".$object->id;
|
||||
}
|
||||
$sql .= " AND pfd.traite = 0";
|
||||
|
||||
$result_sql = $db->query($sql);
|
||||
@ -543,10 +560,11 @@ if ($object->id > 0)
|
||||
$remaintopaylesspendingdebit = $resteapayer - $pending;
|
||||
|
||||
print '<form method="POST" action="">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'" />';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'" />';
|
||||
print '<input type="hidden" name="action" value="new" />';
|
||||
print '<label for="withdraw_request_amount">'.$langs->trans('WithdrawRequestAmount').' </label>';
|
||||
print '<input type="text" id="withdraw_request_amount" name="withdraw_request_amount" value="'.$remaintopaylesspendingdebit.'" size="10" />';
|
||||
print '<input type="text" id="withdraw_request_amount" name="withdraw_request_amount" value="'.$remaintopaylesspendingdebit.'" size="9" />';
|
||||
print '<input type="submit" class="butAction" value="'.$langs->trans("MakeWithdrawRequest").'" />';
|
||||
print '</form>';
|
||||
}
|
||||
@ -593,13 +611,17 @@ if ($object->id > 0)
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
$sql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande";
|
||||
$sql .= " , pfd.date_traite as date_traite, pfd.amount,";
|
||||
$sql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande,";
|
||||
$sql .= " pfd.date_traite as date_traite, pfd.amount,";
|
||||
$sql .= " u.rowid as user_id, u.lastname, u.firstname, u.login";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on pfd.fk_user_demande = u.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."prelevement_bons as pb ON pb.rowid = pfd.fk_prelevement_bons";
|
||||
$sql .= " WHERE fk_facture = ".$object->id;
|
||||
if ($type == 'bank-transfer') {
|
||||
$sql .= " WHERE fk_facture_fourn = ".$object->id;
|
||||
} else {
|
||||
$sql .= " WHERE fk_facture = ".$object->id;
|
||||
}
|
||||
$sql .= " AND pfd.traite = 0";
|
||||
$sql .= " ORDER BY pfd.date_demande DESC";
|
||||
|
||||
@ -649,7 +671,11 @@ if ($object->id > 0)
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on pfd.fk_user_demande = u.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."prelevement_bons as pb ON pb.rowid = pfd.fk_prelevement_bons";
|
||||
$sql .= " WHERE fk_facture = ".$object->id;
|
||||
if ($type == 'bank-transfer') {
|
||||
$sql .= " WHERE fk_facture_fourn = ".$object->id;
|
||||
} else {
|
||||
$sql .= " WHERE fk_facture = ".$object->id;
|
||||
}
|
||||
$sql .= " AND pfd.traite = 1";
|
||||
$sql .= " ORDER BY pfd.date_demande DESC";
|
||||
|
||||
|
||||
@ -174,35 +174,40 @@ if ($result)
|
||||
|
||||
$directdebitorder = new BonPrelevement($db);
|
||||
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
if ($num) {
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
$directdebitorder->id = $obj->rowid;
|
||||
$directdebitorder->ref = $obj->ref;
|
||||
$directdebitorder->datec = $obj->datec;
|
||||
$directdebitorder->amount = $obj->amount;
|
||||
$directdebitorder->statut = $obj->statut;
|
||||
$directdebitorder->id = $obj->rowid;
|
||||
$directdebitorder->ref = $obj->ref;
|
||||
$directdebitorder->datec = $obj->datec;
|
||||
$directdebitorder->amount = $obj->amount;
|
||||
$directdebitorder->statut = $obj->statut;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>';
|
||||
print $directdebitorder->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
print '<td>';
|
||||
print $directdebitorder->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->datec), 'day')."</td>\n";
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->datec), 'day')."</td>\n";
|
||||
|
||||
print '<td class="right">'.price($obj->amount)."</td>\n";
|
||||
print '<td class="right">'.price($obj->amount)."</td>\n";
|
||||
|
||||
print '<td class="right">';
|
||||
print $bon->LibStatut($obj->statut, 3);
|
||||
print '</td>';
|
||||
print '<td class="right">';
|
||||
print $bon->LibStatut($obj->statut, 3);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="right"></td>'."\n";
|
||||
print '<td class="right"></td>'."\n";
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
print '<tr><td class="opacitymedium" colspan="5">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
|
||||
@ -292,7 +292,7 @@ if ($id > 0 || $ref)
|
||||
print $form->selectDate('', '', '', '', '', "infocredit", 1, 1);
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
print '<br>'.$langs->trans("ThisWillAlsoAddPaymentOnInvoice");
|
||||
print '<br><div class="center"><span class="opacitymedium">'.$langs->trans("ThisWillAlsoAddPaymentOnInvoice").'</span></div>';
|
||||
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("ClassCredited")).'"></div>';
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
@ -405,7 +405,7 @@ if ($id > 0 || $ref)
|
||||
|
||||
print '<td class="right">'.price($obj->amount)."</td>\n";
|
||||
|
||||
print '<td>';
|
||||
print '<td class="right">';
|
||||
|
||||
if ($obj->statut == 3)
|
||||
{
|
||||
@ -413,7 +413,24 @@ if ($id > 0 || $ref)
|
||||
}
|
||||
else
|
||||
{
|
||||
print " ";
|
||||
if ($object->statut == BonPrelevement::STATUS_CREDITED)
|
||||
{
|
||||
if ($obj->statut == 2) {
|
||||
if ($user->rights->prelevement->bons->credit)
|
||||
{
|
||||
//print '<a class="butActionDelete" href="line.php?action=rejet&id='.$obj->rowid.'">'.$langs->trans("StandingOrderReject").'</a>';
|
||||
print '<a href="line.php?action=rejet&id='.$obj->rowid.'">'.$langs->trans("StandingOrderReject").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
//print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("StandingOrderReject").'</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotPossibleForThisStatusOfWithdrawReceiptORLine").'">'.$langs->trans("StandingOrderReject").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
@ -288,7 +288,7 @@ class BonPrelevement extends CommonObject
|
||||
$sql .= ", p.method_trans, p.fk_user_trans";
|
||||
$sql .= ", p.date_credit as date_credit";
|
||||
$sql .= ", p.fk_user_credit";
|
||||
$sql .= ", p.statut";
|
||||
$sql .= ", p.statut as status";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
|
||||
$sql .= " WHERE p.entity IN (".getEntity('invoice').")";
|
||||
if ($rowid > 0) $sql .= " AND p.rowid = ".$rowid;
|
||||
@ -315,7 +315,8 @@ class BonPrelevement extends CommonObject
|
||||
$this->date_credit = $this->db->jdate($obj->date_credit);
|
||||
$this->user_credit = $obj->fk_user_credit;
|
||||
|
||||
$this->statut = $obj->statut;
|
||||
$this->status = $obj->status;
|
||||
$this->statut = $obj->status; // For backward compatibility
|
||||
|
||||
$this->fetched = 1;
|
||||
|
||||
|
||||
@ -66,14 +66,14 @@ class LignePrelevement
|
||||
/**
|
||||
* Recupere l'objet prelevement
|
||||
*
|
||||
* @param int $rowid id de la facture a recuperer
|
||||
* @return integer
|
||||
* @param int $rowid Id de la facture a recuperer
|
||||
* @return integer <0 if KO, >=0 if OK
|
||||
*/
|
||||
public function fetch($rowid)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$result = 0;
|
||||
$error = 0;
|
||||
|
||||
$sql = "SELECT pl.rowid, pl.amount, p.ref, p.rowid as bon_rowid";
|
||||
$sql .= ", pl.statut, pl.fk_soc";
|
||||
@ -99,7 +99,7 @@ class LignePrelevement
|
||||
}
|
||||
else
|
||||
{
|
||||
$result++;
|
||||
$error++;
|
||||
dol_syslog("LignePrelevement::Fetch rowid=$rowid numrows=0");
|
||||
}
|
||||
|
||||
@ -107,12 +107,12 @@ class LignePrelevement
|
||||
}
|
||||
else
|
||||
{
|
||||
$result++;
|
||||
$error++;
|
||||
dol_syslog("LignePrelevement::Fetch rowid=$rowid");
|
||||
dol_syslog($this->db->error());
|
||||
}
|
||||
|
||||
return $result;
|
||||
return $error;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -99,6 +99,9 @@ if (empty($reshook))
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null);
|
||||
|
||||
header("Location: ".DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$bprev->id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -141,8 +144,8 @@ print load_fiche_titre($title);
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
$nb = $bprev->NbFactureAPrelever();
|
||||
$pricetowithdraw = $bprev->SommeAPrelever();
|
||||
$nb = $bprev->nbOfInvoiceToPay($type);
|
||||
$pricetowithdraw = $bprev->SommeAPrelever($type);
|
||||
if ($nb < 0)
|
||||
{
|
||||
dol_print_error($bprev->error);
|
||||
@ -178,19 +181,34 @@ if ($nb) {
|
||||
if ($pricetowithdraw) {
|
||||
print $langs->trans('ExecutionDate').' ';
|
||||
print $form->selectDate();
|
||||
|
||||
if ($mysoc->isInEEC()) {
|
||||
$title = $langs->trans("CreateForSepa");
|
||||
|
||||
print '<select name="format"><option value="FRST">'.$langs->trans('SEPAFRST').'</option><option value="RCUR">'.$langs->trans('SEPARCUR').'</option></select>';
|
||||
print '<input class="butAction" type="submit" value="'.$langs->trans("CreateForSepa").'"/>';
|
||||
print '<input class="butAction" type="submit" value="'.$title.'"/>';
|
||||
} else {
|
||||
print '<a class="butAction" type="submit" href="create.php?action=create&format=ALL">'.$langs->trans("CreateAll")."</a>\n";
|
||||
$title = $langs->trans("CreateAll");
|
||||
if ($type == 'bank-transfer') {
|
||||
$title = $langs->trans("CreateFileForPaymentByBankTransfer");
|
||||
}
|
||||
print '<a class="butAction" type="submit" href="create.php?action=create&format=ALL&type='.$type.'">'.$title."</a>\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($mysoc->isInEEC())
|
||||
{
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("CreateForSepaFRST")."</a>\n";
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("CreateForSepaRCUR")."</a>\n";
|
||||
$title = $langs->trans("CreateForSepaFRST");
|
||||
if ($type == 'bank-transfer') {
|
||||
$title = $langs->trans("CreateSepaFileForPaymentByBankTransfer");
|
||||
}
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("AmountMustBePositive").'">'.$title."</a>\n";
|
||||
|
||||
if ($type != 'bank-transfer') {
|
||||
$title = $langs->trans("CreateForSepaRCUR");
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("AmountMustBePositive").'">'.$title."</a>\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -236,9 +254,9 @@ if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS))
|
||||
$sql .= " AND f.total_ttc > 0";
|
||||
$sql .= " AND pfd.traite = 0";
|
||||
if ($type == 'bank-transfer') {
|
||||
$sql .= " AND pfd.fk_facture = f.rowid";
|
||||
} else {
|
||||
$sql .= " AND pfd.fk_facture_fourn = f.rowid";
|
||||
} else {
|
||||
$sql .= " AND pfd.fk_facture = f.rowid";
|
||||
}
|
||||
if ($socid > 0) $sql .= " AND f.fk_soc = ".$socid;
|
||||
|
||||
@ -299,23 +317,29 @@ if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$bac->fetch(0, $obj->socid);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Ref invoice
|
||||
print '<td>';
|
||||
$invoicestatic->id = $obj->rowid;
|
||||
$invoicestatic->ref = $obj->ref;
|
||||
print $invoicestatic->getNomUrl(1, 'withdraw');
|
||||
print '</td>';
|
||||
|
||||
// Thirdparty
|
||||
print '<td>';
|
||||
$thirdpartystatic->fetch($obj->socid);
|
||||
print $thirdpartystatic->getNomUrl(1, 'ban');
|
||||
print '</td>';
|
||||
|
||||
// RIB
|
||||
print '<td>';
|
||||
print $thirdpartystatic->display_rib();
|
||||
$bac->fetch(0, $obj->socid);
|
||||
print $bac->iban.(($bac->iban && $bac->bic) ? ' / ' : '').$bac->bic;
|
||||
if ($bac->verif() <= 0) print img_warning('Error on default bank number for IBAN : '.$bac->error_message);
|
||||
print '</td>';
|
||||
|
||||
// RUM
|
||||
print '<td>';
|
||||
print $thirdpartystatic->display_rib('rum');
|
||||
|
||||
@ -199,14 +199,14 @@ print '<table class="liste centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Bill", $_SERVER["PHP_SELF"]);
|
||||
print_liste_field_titre("Company", $_SERVER["PHP_SELF"]);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "", "", $param, 'class="right"');
|
||||
print_liste_field_titre("DateRequest", $_SERVER["PHP_SELF"], "", "", $param, 'class="center"');
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "", "", $param, '', '', '', 'right ');
|
||||
print_liste_field_titre("DateRequest", $_SERVER["PHP_SELF"], "", "", $param, '', '', '', 'center ');
|
||||
print_liste_field_titre('');
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_facture" size="12" value="'.dol_escape_htmltag($search_facture).'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_societe" size="18" value="'.dol_escape_htmltag($search_societe).'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth150" name="search_facture" value="'.dol_escape_htmltag($search_facture).'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth150" name="search_societe" value="'.dol_escape_htmltag($search_societe).'"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
// Action column
|
||||
|
||||
@ -38,7 +38,7 @@ $langs->loadLangs(array('banks', 'categories', 'companies', 'withdrawals', 'bill
|
||||
if ($user->socid > 0) accessforbidden();
|
||||
|
||||
// Get supervariables
|
||||
$prev_id = GETPOST('id', 'int');
|
||||
$id = GETPOST('id', 'int');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
|
||||
@ -68,9 +68,9 @@ $thirdpartytmp = new Societe($db);
|
||||
|
||||
llxHeader('', $langs->trans("WithdrawalsReceipts"));
|
||||
|
||||
if ($prev_id > 0 || $ref)
|
||||
if ($id > 0 || $ref)
|
||||
{
|
||||
if ($object->fetch($prev_id, $ref) >= 0)
|
||||
if ($object->fetch($id, $ref) >= 0)
|
||||
{
|
||||
$head = prelevement_prepare_head($object);
|
||||
dol_fiche_head($head, 'invoices', $langs->trans("WithdrawalsReceipts"), -1, 'payment');
|
||||
@ -183,7 +183,7 @@ if ($result)
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
$param = "&id=".$prev_id;
|
||||
$param = "&id=".$id;
|
||||
|
||||
// Lines of title fields
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
@ -195,7 +195,7 @@ if ($result)
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="search_status" value="'.$search_status.'">';
|
||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||
|
||||
$massactionbutton = '';
|
||||
|
||||
|
||||
@ -124,11 +124,18 @@ if ($action == 'confirm_rejet')
|
||||
|
||||
$invoicestatic = new Facture($db);
|
||||
|
||||
llxHeader('', $langs->trans("StandingOrder"));
|
||||
$title = $langs->trans("WithdrawalsLine");
|
||||
if ($type == 'bank-transfer') {
|
||||
$title = $langs->trans("CreditTransferLine");
|
||||
}
|
||||
|
||||
llxHeader('', $title);
|
||||
|
||||
$head = array();
|
||||
|
||||
$h = 0;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$id;
|
||||
$head[$h][1] = $langs->trans("StandingOrder");
|
||||
$head[$h][1] = $title;
|
||||
$hselected = $h;
|
||||
$h++;
|
||||
|
||||
@ -136,20 +143,24 @@ if ($id)
|
||||
{
|
||||
$lipre = new LignePrelevement($db);
|
||||
|
||||
if ($lipre->fetch($id) == 0)
|
||||
if ($lipre->fetch($id) >= 0)
|
||||
{
|
||||
$bon = new BonPrelevement($db);
|
||||
$bon->fetch($lipre->bon_rowid);
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("StandingOrder"));
|
||||
dol_fiche_head($head, $hselected, $title);
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans("WithdrawalsReceipts").'</td><td>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';
|
||||
print $id.'</td></tr>';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("WithdrawalsReceipts").'</td><td>';
|
||||
print $bon->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec, 'day').'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($lipre->amount).'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Status").'</td><td>'.$lipre->LibStatut($lipre->statut, 1).'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec, 'day').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($lipre->amount).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$lipre->LibStatut($lipre->statut, 1).'</td></tr>';
|
||||
|
||||
if ($lipre->statut == 3)
|
||||
{
|
||||
@ -157,8 +168,8 @@ if ($id)
|
||||
$resf = $rej->fetch($lipre->id);
|
||||
if ($resf == 0)
|
||||
{
|
||||
print '<tr><td width="20%">'.$langs->trans("RefusedReason").'</td><td>'.$rej->motif.'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("RefusedData").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("RefusedReason").'</td><td>'.$rej->motif.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("RefusedData").'</td><td>';
|
||||
if ($rej->date_rejet == 0)
|
||||
{
|
||||
/* Historique pour certaines install */
|
||||
@ -169,11 +180,11 @@ if ($id)
|
||||
print dol_print_date($rej->date_rejet, 'day');
|
||||
}
|
||||
print '</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("RefusedInvoicing").'</td><td>'.$rej->invoicing.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("RefusedInvoicing").'</td><td>'.$rej->invoicing.'</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td width="20%">'.$resf.'</td></tr>';
|
||||
print '<tr><td>'.$resf.'</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -197,7 +208,7 @@ if ($id)
|
||||
print '<form name="confirm_rejet" method="post" action="line.php?id='.$id.'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="confirm_rejet">';
|
||||
print '<table class="border centpercent">';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">'.$langs->trans("WithdrawalRefused").'</td></tr>';
|
||||
@ -217,13 +228,13 @@ if ($id)
|
||||
//Reason
|
||||
print '<tr><td class="fieldrequired valid">'.$langs->trans("RefusedReason").'</td>';
|
||||
print '<td class="valid">';
|
||||
print $form->selectarray("motif", $rej->motifs);
|
||||
print $form->selectarray("motif", $rej->motifs, GETPOSTISSET('motif') ? GETPOST('motif', 'int') : '');
|
||||
print '</td></tr>';
|
||||
|
||||
//Facturer
|
||||
print '<tr><td class="valid">'.$langs->trans("RefusedInvoicing").'</td>';
|
||||
print '<td class="valid" colspan="2">';
|
||||
print $form->selectarray("facturer", $rej->facturer);
|
||||
print $form->selectarray("facturer", $rej->facturer, GETPOSTISSET('facturer') ? GETPOST('facturer', 'int') : '');
|
||||
print '</td></tr>';
|
||||
print '</table><br>';
|
||||
|
||||
@ -242,20 +253,22 @@ if ($id)
|
||||
|
||||
if ($action == '')
|
||||
{
|
||||
if ($bon->statut == 2 && $lipre->statut == 2)
|
||||
if ($bon->statut == BonPrelevement::STATUS_CREDITED)
|
||||
{
|
||||
if ($user->rights->prelevement->bons->credit)
|
||||
{
|
||||
print "<a class=\"butAction\" href=\"line.php?action=rejet&id=$lipre->id\">".$langs->trans("StandingOrderReject")."</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<a class=\"butActionRefused classfortooltip\" href=\"#\" title=\"".$langs->trans("NotAllowed")."\">".$langs->trans("StandingOrderReject")."</a>";
|
||||
if ($lipre->statut == 2) {
|
||||
if ($user->rights->prelevement->bons->credit)
|
||||
{
|
||||
print '<a class="butActionDelete" href="line.php?action=rejet&id='.$lipre->id.'">'.$langs->trans("StandingOrderReject").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("StandingOrderReject").'</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<a class=\"butActionRefused classfortooltip\" href=\"#\" title=\"".$langs->trans("NotPossibleForThisStatusOfWithdrawReceiptORLine")."\">".$langs->trans("StandingOrderReject")."</a>";
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotPossibleForThisStatusOfWithdrawReceiptORLine").'">'.$langs->trans("StandingOrderReject").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
/**
|
||||
* \file htdocs/compta/prelevement/list.php
|
||||
* \ingroup prelevement
|
||||
* \brief Page liste des prelevements
|
||||
* \brief Page list of direct debit orders or credit transfers orders
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
@ -96,23 +96,35 @@ $form = new Form($db);
|
||||
llxHeader('', $langs->trans("WithdrawalsLines"));
|
||||
|
||||
$sql = "SELECT p.rowid, p.ref, p.statut as status, p.datec";
|
||||
$sql .= " ,f.rowid as facid, f.ref as invoiceref, f.total_ttc";
|
||||
$sql .= " , f.rowid as facid, f.ref as invoiceref, f.total_ttc";
|
||||
$sql .= " , s.rowid as socid, s.nom as name, s.code_client, s.email";
|
||||
$sql .= " , pl.amount, pl.statut as statut_ligne, pl.rowid as rowid_ligne";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
|
||||
$sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
|
||||
$sql .= " , ".MAIN_DB_PREFIX."prelevement_facture as pf";
|
||||
$sql .= " , ".MAIN_DB_PREFIX."facture as f";
|
||||
if ($type == 'bank-transfer') {
|
||||
$sql .= " , ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||
} else {
|
||||
$sql .= " , ".MAIN_DB_PREFIX."facture as f";
|
||||
}
|
||||
$sql .= " , ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= " WHERE pl.fk_prelevement_bons = p.rowid";
|
||||
$sql .= " AND pf.fk_prelevement_lignes = pl.rowid";
|
||||
$sql .= " AND pf.fk_facture = f.rowid";
|
||||
if ($type == 'bank-transfer') {
|
||||
$sql .= " AND pf.fk_facture_fourn = f.rowid";
|
||||
} else {
|
||||
$sql .= " AND pf.fk_facture = f.rowid";
|
||||
}
|
||||
$sql .= " AND f.fk_soc = s.rowid";
|
||||
$sql .= " AND f.entity IN (".getEntity('invoice').")";
|
||||
if ($socid) $sql .= " AND s.rowid = ".$socid;
|
||||
if ($search_line) $sql .= " AND pl.rowid = '".$db->escape($search_line)."'";
|
||||
if ($search_bon) $sql .= natural_search("p.ref", $search_bon);
|
||||
if ($search_code) $sql .= natural_search("s.code_client", $search_code);
|
||||
if ($type == 'bank-transfer') {
|
||||
if ($search_code) $sql .= natural_search("s.code_fourn", $search_code);
|
||||
} else {
|
||||
if ($search_code) $sql .= natural_search("s.code_client", $search_code);
|
||||
}
|
||||
if ($search_company) $sql .= natural_search("s.nom", $search_company);
|
||||
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
@ -152,7 +164,11 @@ if ($result)
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
print_barre_liste($langs->trans("WithdrawalsLines"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, '', '', $limit, 0, 0, 1);
|
||||
$title = $langs->trans("WithdrawalsLines");
|
||||
if ($type == 'bank-transfer') {
|
||||
$title = $langs->trans("CreditTransferLines");
|
||||
}
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, '', '', $limit, 0, 0, 1);
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
@ -173,9 +189,14 @@ if ($result)
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$columntitle= "WithdrawalsReceipts";
|
||||
if ($type == 'bank-transfer') {
|
||||
$columntitle= "BankTransferReceipts";
|
||||
}
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($columntitle, $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Line", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("WithdrawalsReceipts", $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Bill", $_SERVER["PHP_SELF"], "f.ref", '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CustomerCode", $_SERVER["PHP_SELF"], "s.code_client", '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
@ -184,53 +205,58 @@ if ($result)
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
if ($num) {
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
$bon->ref = $obj->ref;
|
||||
$bon->statut = $obj->status;
|
||||
$bon->id = $obj->rowid;
|
||||
$bon->ref = $obj->ref;
|
||||
$bon->statut = $obj->status;
|
||||
|
||||
$company->id = $obj->socid;
|
||||
$company->name = $obj->name;
|
||||
$company->email = $obj->email;
|
||||
$company->code_client = $obj->code_client;
|
||||
$company->id = $obj->socid;
|
||||
$company->name = $obj->name;
|
||||
$company->email = $obj->email;
|
||||
$company->code_client = $obj->code_client;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>';
|
||||
print $line->LibStatut($obj->statut_ligne, 2);
|
||||
print " ";
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid_ligne.'">';
|
||||
print substr('000000'.$obj->rowid_ligne, -6);
|
||||
print '</a></td>';
|
||||
print '<td>';
|
||||
print $bon->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
|
||||
print '<td>';
|
||||
print $bon->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
print '<td>';
|
||||
print $line->LibStatut($obj->statut_ligne, 2);
|
||||
print " ";
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid_ligne.'">';
|
||||
print substr('000000'.$obj->rowid_ligne, -6);
|
||||
print '</a></td>';
|
||||
|
||||
print '<td>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->facid.'">';
|
||||
print img_object($langs->trans("ShowBill"), "bill");
|
||||
print ' <a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->facid.'">'.$obj->invoiceref."</a></td>\n";
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->facid.'">';
|
||||
print img_object($langs->trans("ShowBill"), "bill");
|
||||
print ' <a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->facid.'">'.$obj->invoiceref."</a></td>\n";
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $company->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
print '<td>';
|
||||
print $company->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
|
||||
print '<td align="center"><a href="card.php?id='.$obj->rowid.'">'.$obj->code_client."</a></td>\n";
|
||||
print '<td align="center"><a href="card.php?id='.$obj->rowid.'">'.$obj->code_client."</a></td>\n";
|
||||
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->datec), 'day')."</td>\n";
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->datec), 'day')."</td>\n";
|
||||
|
||||
print '<td class="right">'.price($obj->amount)."</td>\n";
|
||||
print '<td class="right">'.price($obj->amount)."</td>\n";
|
||||
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
print '<tr><td class="opacitymedium" colspan="8">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
|
||||
@ -55,7 +55,12 @@ $pagenext = $page + 1;
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('', $langs->trans("WithdrawsRefused"));
|
||||
$title = $langs->trans("WithdrawsRefused");
|
||||
if ($type == 'bank-transfer') {
|
||||
$title = $langs->trans("CreditTransfersRefused");
|
||||
}
|
||||
|
||||
llxHeader('', $title);
|
||||
|
||||
if ($sortorder == "") $sortorder = "DESC";
|
||||
if ($sortfield == "") $sortfield = "p.datec";
|
||||
@ -80,9 +85,14 @@ $sql .= " WHERE pr.fk_prelevement_lignes = pl.rowid";
|
||||
$sql .= " AND pl.fk_prelevement_bons = p.rowid";
|
||||
$sql .= " AND pl.fk_soc = s.rowid";
|
||||
$sql .= " AND p.entity = ".$conf->entity;
|
||||
if ($type == 'bank-transfer') {
|
||||
$sql .= " AND p.type = 'bank-transfer'";
|
||||
} else {
|
||||
$sql .= " AND p.type = 'debit-order'";
|
||||
}
|
||||
if ($socid) $sql .= " AND s.rowid = ".$socid;
|
||||
$sql .= " ".$db->order($sortfield, $sortorder);
|
||||
$sql .= " ".$db->plimit($conf->liste_limit + 1, $offset);
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
@ -90,33 +100,39 @@ if ($result)
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
print_barre_liste($langs->trans("WithdrawsRefused"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num);
|
||||
$param = '';
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num);
|
||||
print"\n<!-- debut table -->\n";
|
||||
print '<table class="noborder tagtable liste" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Line", $_SERVER["PHP_SELF"], "p.ref", '', $urladd);
|
||||
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", '', $urladd);
|
||||
print_liste_field_titre("Reason", $_SERVER["PHP_SELF"], "pr.motif", "", $urladd);
|
||||
print_liste_field_titre("Line", $_SERVER["PHP_SELF"], "p.ref", '', $param);
|
||||
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", '', $param);
|
||||
print_liste_field_titre("Reason", $_SERVER["PHP_SELF"], "pr.motif", "", $param);
|
||||
print "</tr>\n";
|
||||
|
||||
$total = 0;
|
||||
if ($num) {
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
while ($i < min($num, $conf->liste_limit))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $line->LibStatut($obj->statut, 2).' ';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid.'">';
|
||||
print '<td>';
|
||||
print $line->LibStatut($obj->statut, 2).' ';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid.'">';
|
||||
print substr('000000'.$obj->rowid, -6)."</a></td>";
|
||||
|
||||
print substr('000000'.$obj->rowid, -6)."</a></td>";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.$obj->nom."</a></td>\n";
|
||||
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n";
|
||||
print '<td>'.$rej->motifs[$obj->motif].'</td>';
|
||||
|
||||
print '<td>'.$rej->motifs[$obj->motif].'</td>';
|
||||
print "</tr>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
$i++;
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
print '<tr><td class="opacitymedium" colspan="3">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
@ -43,15 +43,25 @@ $type = GETPOST('type', 'aZ09');
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('', $langs->trans("WithdrawStatistics"));
|
||||
$title = $langs->trans("WithdrawStatistics");
|
||||
if ($type == 'bank-transfer') {
|
||||
$title = $langs->trans("CreditTransferStatistics");
|
||||
}
|
||||
|
||||
print load_fiche_titre($langs->trans("Statistics"));
|
||||
llxHeader('', $title);
|
||||
|
||||
print load_fiche_titre($title);
|
||||
|
||||
// Define total and nbtotal
|
||||
$sql = "SELECT sum(pl.amount), count(pl.amount)";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."prelevement_bons as pb";
|
||||
$sql .= " WHERE pl.fk_prelevement_bons = pb.rowid";
|
||||
if ($type == 'bank-transfer') {
|
||||
$sql .= " AND pb.type = 'bank-transfer'";
|
||||
} else {
|
||||
$sql .= " AND pb.type = 'debit-order'";
|
||||
}
|
||||
$sql .= " AND pb.entity = ".$conf->entity;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
@ -73,7 +83,7 @@ if ($resql)
|
||||
*/
|
||||
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("WithdrawStatistics"), '', '');
|
||||
print load_fiche_titre($langs->trans("ByStatus"), '', '');
|
||||
|
||||
$ligne = new LignePrelevement($db);
|
||||
|
||||
@ -82,6 +92,11 @@ $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."prelevement_bons as pb";
|
||||
$sql .= " WHERE pl.fk_prelevement_bons = pb.rowid";
|
||||
$sql .= " AND pb.entity = ".$conf->entity;
|
||||
if ($type == 'bank-transfer') {
|
||||
$sql .= " AND pb.type = 'bank-transfer'";
|
||||
} else {
|
||||
$sql .= " AND pb.type = 'debit-order'";
|
||||
}
|
||||
$sql .= " GROUP BY pl.statut";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
@ -139,7 +154,7 @@ else
|
||||
*/
|
||||
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("WithdrawRejectStatistics"), '', '');
|
||||
print load_fiche_titre($langs->trans("Rejects"), '', '');
|
||||
|
||||
|
||||
// Define total and nbtotal
|
||||
@ -149,6 +164,11 @@ $sql .= ", ".MAIN_DB_PREFIX."prelevement_bons as pb";
|
||||
$sql .= " WHERE pl.fk_prelevement_bons = pb.rowid";
|
||||
$sql .= " AND pb.entity = ".$conf->entity;
|
||||
$sql .= " AND pl.statut = 3";
|
||||
if ($type == 'bank-transfer') {
|
||||
$sql .= " AND pb.type = 'bank-transfer'";
|
||||
} else {
|
||||
$sql .= " AND pb.type = 'debit-order'";
|
||||
}
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -166,6 +186,7 @@ if ($resql)
|
||||
/*
|
||||
* Stats sur les rejets
|
||||
*/
|
||||
|
||||
$sql = "SELECT sum(pl.amount), count(pl.amount) as cc, pr.motif";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."prelevement_bons as pb";
|
||||
@ -174,6 +195,11 @@ $sql .= " WHERE pl.fk_prelevement_bons = pb.rowid";
|
||||
$sql .= " AND pb.entity = ".$conf->entity;
|
||||
$sql .= " AND pl.statut = 3";
|
||||
$sql .= " AND pr.fk_prelevement_lignes = pl.rowid";
|
||||
if ($type == 'bank-transfer') {
|
||||
$sql .= " AND pb.type = 'bank-transfer'";
|
||||
} else {
|
||||
$sql .= " AND pb.type = 'debit-order'";
|
||||
}
|
||||
$sql .= " GROUP BY pr.motif";
|
||||
$sql .= " ORDER BY cc DESC";
|
||||
|
||||
|
||||
@ -1035,3 +1035,5 @@ DeleteFileText=Do you really want delete this file?
|
||||
ShowOtherLanguages=Show other languages
|
||||
SwitchInEditModeToAddTranslation=Switch in edit mode to add translations for this language
|
||||
NotUsedForThisCustomer=Not used for this customer
|
||||
AmountMustBePositive=Amount must be positive
|
||||
ByStatus=By status
|
||||
@ -1,6 +1,6 @@
|
||||
# Dolibarr language file - Source file is en_US - withdrawals
|
||||
CustomersStandingOrdersArea=Direct debit payment orders area
|
||||
SuppliersStandingOrdersArea=Direct credit payment orders area
|
||||
CustomersStandingOrdersArea=Payments by Direct debit orders
|
||||
SuppliersStandingOrdersArea=Payments by Credit transfer
|
||||
StandingOrdersPayment=Direct debit payment orders
|
||||
StandingOrderPayment=Direct debit payment order
|
||||
NewStandingOrder=New direct debit order
|
||||
@ -10,26 +10,34 @@ PaymentByBankTransferReceipts=Credit transfer orders
|
||||
PaymentByBankTransferLines=Credit transfer order lines
|
||||
WithdrawalsReceipts=Direct debit orders
|
||||
WithdrawalReceipt=Direct debit order
|
||||
BankTransferReceipts=Credit transfer receipts
|
||||
BankTransferReceipt=Credit transfer receipt
|
||||
LatestBankTransferReceipts=Latest %s credit transfer orders
|
||||
LastWithdrawalReceipts=Latest %s direct debit files
|
||||
WithdrawalsLine=Direct debit order line
|
||||
CreditTransferLine=Credit transfer line
|
||||
WithdrawalsLines=Direct debit order lines
|
||||
RequestStandingOrderToTreat=Request for direct debit payment order to process
|
||||
RequestStandingOrderTreated=Request for direct debit payment order processed
|
||||
CreditTransferLines=Credit transfer lines
|
||||
RequestStandingOrderToTreat=Requests for direct debit payment order to process
|
||||
RequestStandingOrderTreated=Requests for direct debit payment order processed
|
||||
RequestPaymentsByBankTransferToTreat=Requests for credit transfer to process
|
||||
RequestPaymentsByBankTransferTreated=Requests for credit transfer processed
|
||||
NotPossibleForThisStatusOfWithdrawReceiptORLine=Not yet possible. Withdraw status must be set to 'credited' before declaring reject on specific lines.
|
||||
NbOfInvoiceToWithdraw=No. of qualified customer invoices with waiting direct debit order
|
||||
NbOfInvoiceToWithdrawWithInfo=No. of customer invoice with direct debit payment orders having defined bank account information
|
||||
NbOfInvoiceToPayByBankTransfer=No. of qualified supplier invoices waiting for a payment by credit transfer
|
||||
SupplierInvoiceWaitingWithdraw=Vendor invoice waiting for payment by credit transfer
|
||||
InvoiceWaitingWithdraw=Invoice waiting for direct debit
|
||||
InvoiceWaitingPaymentByBankTransfer=Invoice waiting for credit transfer
|
||||
AmountToWithdraw=Amount to withdraw
|
||||
WithdrawsRefused=Direct debit refused
|
||||
NoInvoiceToWithdraw=No customer invoice with open 'Direct debit requests' is waiting. Go on tab '%s' on invoice card to make a request.
|
||||
NoSupplierInvoiceToWithdraw=No supplier invoice with open 'Direct credit requests' is waiting. Go on tab '%s' on invoice card to make a request.
|
||||
ResponsibleUser=User Responsible
|
||||
WithdrawalsSetup=Direct debit payment setup
|
||||
CreditTransferSetup=Crebit transfer setup
|
||||
WithdrawStatistics=Direct debit payment statistics
|
||||
WithdrawRejectStatistics=Direct debit payment reject statistics
|
||||
CreditTransferStatistics=Credit transfer statistics
|
||||
Rejects=Rejects
|
||||
LastWithdrawalReceipt=Latest %s direct debit receipts
|
||||
MakeWithdrawRequest=Make a direct debit payment request
|
||||
WithdrawRequestsDone=%s direct debit payment requests recorded
|
||||
@ -42,7 +50,9 @@ TransMetod=Transmission method
|
||||
Send=Send
|
||||
Lines=Lines
|
||||
StandingOrderReject=Issue a rejection
|
||||
WithdrawsRefused=Direct debit refused
|
||||
WithdrawalRefused=Withdrawal refused
|
||||
CreditTransfersRefused=Credit transfers refused
|
||||
WithdrawalRefusedConfirm=Are you sure you want to enter a withdrawal rejection for society
|
||||
RefusedData=Date of rejection
|
||||
RefusedReason=Reason for rejection
|
||||
@ -66,6 +76,8 @@ StatusMotif8=Other reason
|
||||
CreateForSepaFRST=Create direct debit file (SEPA FRST)
|
||||
CreateForSepaRCUR=Create direct debit file (SEPA RCUR)
|
||||
CreateAll=Create direct debit file (all)
|
||||
CreateFileForPaymentByBankTransfer=Create credit transfer (all)
|
||||
CreateSepaFileForPaymentByBankTransfer=Create credit transfer file (SEPA)
|
||||
CreateGuichet=Only office
|
||||
CreateBanque=Only bank
|
||||
OrderWaiting=Waiting for treatment
|
||||
@ -83,7 +95,7 @@ IfInvoiceNeedOnWithdrawPaymentWontBeClosed=However, if invoice has at least one
|
||||
DoStandingOrdersBeforePayments=This tab allows you to request a direct debit payment order. Once done, go into menu Bank->Direct Debit orders to manage the direct debit payment order. When payment order is closed, payment on invoice will be automatically recorded, and invoice closed if remainder to pay is null.
|
||||
WithdrawalFile=Withdrawal file
|
||||
SetToStatusSent=Set to status "File Sent"
|
||||
ThisWillAlsoAddPaymentOnInvoice=This will also record payments to invoices and will classify them as "Paid" if remain to pay is null
|
||||
ThisWillAlsoAddPaymentOnInvoice=This will also record payments on invoices and will classify them as "Paid" if remain to pay is null
|
||||
StatisticsByLineStatus=Statistics by status of lines
|
||||
RUM=UMR
|
||||
DateRUM=Mandate signature date
|
||||
|
||||
@ -1660,6 +1660,7 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer)
|
||||
// Show fields of bank account
|
||||
foreach ($companybankaccount->getFieldsToShow(1) as $val) {
|
||||
$require = false;
|
||||
$tooltip = '';
|
||||
if ($val == 'BankCode') {
|
||||
$name = 'code_banque';
|
||||
$size = 8;
|
||||
@ -1681,14 +1682,22 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer)
|
||||
$size = 30;
|
||||
$content = $companybankaccount->iban;
|
||||
if ($companybankaccount->needIBAN()) $require = true;
|
||||
$tooltip = $langs->trans("Example").':<br>LT12 1000 0111 0100 1000<br>FR14 2004 1010 0505 0001 3M02 606<br>LU28 0019 4006 4475 0000<br>DE89 3704 0044 0532 0130 00';
|
||||
} elseif ($val == 'BIC') {
|
||||
$name = 'bic';
|
||||
$size = 12;
|
||||
$content = $companybankaccount->bic;
|
||||
if ($companybankaccount->needIBAN()) $require = true;
|
||||
$tooltip = $langs->trans("Example").': LIABLT2XXXX';
|
||||
}
|
||||
|
||||
print '<tr><td'.($require ? ' class="fieldrequired" ' : '').'>'.$langs->trans($val).'</td>';
|
||||
print '<tr><td'.($require ? ' class="fieldrequired" ' : '').'>';
|
||||
if ($tooltip) {
|
||||
print $form->textwithpicto($langs->trans($val), $tooltip, 4, 'help', '', 0, 3, $name);
|
||||
} else {
|
||||
print $langs->trans($val);
|
||||
}
|
||||
print '</td>';
|
||||
print '<td><input size="'.$size.'" type="text" class="flat" name="'.$name.'" value="'.$content.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user