Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/compta/prelevement/card.php htdocs/compta/prelevement/class/ligneprelevement.class.php htdocs/compta/prelevement/create.php htdocs/compta/prelevement/line.php
This commit is contained in:
commit
ff9312c96a
@ -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);
|
||||
@ -379,7 +382,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>';
|
||||
@ -475,7 +484,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";
|
||||
|
||||
@ -488,11 +501,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);
|
||||
@ -521,10 +538,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>';
|
||||
} else {
|
||||
@ -564,13 +582,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";
|
||||
|
||||
@ -618,7 +640,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,13 +405,30 @@ if ($id > 0 || $ref)
|
||||
|
||||
print '<td class="right">'.price($obj->amount)."</td>\n";
|
||||
|
||||
print '<td>';
|
||||
print '<td class="right">';
|
||||
|
||||
if ($obj->statut == 3)
|
||||
{
|
||||
print '<b>'.$langs->trans("StatusRefused").'</b>';
|
||||
} 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>';
|
||||
|
||||
@ -276,7 +276,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;
|
||||
@ -303,7 +303,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";
|
||||
@ -97,18 +97,18 @@ class LignePrelevement
|
||||
$this->bon_ref = $obj->ref;
|
||||
$this->bon_rowid = $obj->bon_rowid;
|
||||
} else {
|
||||
$result++;
|
||||
$error++;
|
||||
dol_syslog("LignePrelevement::Fetch rowid=$rowid numrows=0");
|
||||
}
|
||||
|
||||
$this->db->free($resql);
|
||||
} else {
|
||||
$result++;
|
||||
$error++;
|
||||
dol_syslog("LignePrelevement::Fetch rowid=$rowid");
|
||||
dol_syslog($this->db->error());
|
||||
}
|
||||
|
||||
return $result;
|
||||
return $error;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -96,6 +96,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -138,8 +141,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);
|
||||
@ -175,17 +178,32 @@ 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 {
|
||||
$title = $langs->trans("CreateAll");
|
||||
if ($type == 'bank-transfer') {
|
||||
@ -195,7 +213,13 @@ if ($nb) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NoInvoiceToWithdraw", $langs->transnoentitiesnoconv("StandingOrders"))).'">'.$langs->trans("CreateAll")."</a>\n";
|
||||
$titlefortab = $langs->transnoentitiesnoconv("StandingOrders");
|
||||
$title = $langs->trans("CreateAll");
|
||||
if ($type == 'bank-transfer') {
|
||||
$titlefortab = $langs->transnoentitiesnoconv("PaymentByBankTransfers");
|
||||
$title = $langs->trans("CreateFileForPaymentByBankTransfer");
|
||||
}
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NoInvoiceToWithdraw", $titlefortab, $titlefortab)).'">'.$title."</a>\n";
|
||||
}
|
||||
|
||||
print "</form>\n";
|
||||
@ -227,9 +251,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;
|
||||
|
||||
@ -290,23 +314,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');
|
||||
|
||||
@ -197,14 +197,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');
|
||||
@ -181,7 +181,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"].'">';
|
||||
@ -193,7 +193,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 = '';
|
||||
|
||||
|
||||
@ -118,11 +118,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++;
|
||||
|
||||
@ -130,20 +137,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)
|
||||
{
|
||||
@ -151,8 +162,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 */
|
||||
@ -161,9 +172,9 @@ 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>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -185,7 +196,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>';
|
||||
@ -205,13 +216,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>';
|
||||
|
||||
@ -230,16 +241,18 @@ 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);
|
||||
@ -137,7 +152,7 @@ if ($resql)
|
||||
*/
|
||||
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("WithdrawRejectStatistics"), '', '');
|
||||
print load_fiche_titre($langs->trans("Rejects"), '', '');
|
||||
|
||||
|
||||
// Define total and nbtotal
|
||||
@ -147,6 +162,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)
|
||||
{
|
||||
@ -164,6 +184,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";
|
||||
@ -172,6 +193,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";
|
||||
|
||||
|
||||
@ -3043,7 +3043,12 @@ abstract class CommonObject
|
||||
//print 'Line '.$i.' rowid='.$obj->rowid.' vat_rate='.$obj->vatrate.' total_ht='.$obj->total_ht.' total_tva='.$obj->total_tva.' total_ttc='.$obj->total_ttc.' total_ht_by_vats='.$total_ht_by_vats[$obj->vatrate].' total_tva_by_vats='.$total_tva_by_vats[$obj->vatrate].' (new calculation = '.$tmpvat.') total_ttc_by_vats='.$total_ttc_by_vats[$obj->vatrate].($diff?" => DIFF":"")."<br>\n";
|
||||
if ($diff)
|
||||
{
|
||||
if (abs($diff) > 0.1) { dol_syslog('A rounding difference was detected into TOTAL but is too high to be corrected', LOG_WARNING); exit; }
|
||||
if (abs($diff) > 0.1) {
|
||||
$errmsg = 'A rounding difference was detected into TOTAL but is too high to be corrected. Some data in your line may be corrupted. Try to edit each line manually.';
|
||||
dol_syslog($errmsg, LOG_WARNING);
|
||||
dol_print_error('', $errmsg);
|
||||
exit;
|
||||
}
|
||||
$sqlfix = "UPDATE ".MAIN_DB_PREFIX.$this->table_element_line." SET ".$fieldtva." = ".($obj->total_tva - $diff).", total_ttc = ".($obj->total_ttc - $diff)." WHERE rowid = ".$obj->rowid;
|
||||
dol_syslog('We found a difference of '.$diff.' for line rowid = '.$obj->rowid.". We fix the total_vat and total_ttc of line by running sqlfix = ".$sqlfix);
|
||||
$resqlfix = $this->db->query($sqlfix);
|
||||
|
||||
@ -1037,3 +1037,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
|
||||
@ -265,3 +265,4 @@ NewInvoice=New invoice
|
||||
OneLinePerTask=One line per task
|
||||
OneLinePerPeriod=One line per period
|
||||
RefTaskParent=Ref. Parent Task
|
||||
ProfitIsCalculatedWith=Profit is calculated using
|
||||
@ -130,6 +130,7 @@ WarehouseForStockDecrease=The warehouse <b>%s</b> will be used for stock decreas
|
||||
WarehouseForStockIncrease=The warehouse <b>%s</b> will be used for stock increase
|
||||
ForThisWarehouse=For this warehouse
|
||||
ReplenishmentStatusDesc=This is a list of all products with a stock lower than desired stock (or lower than alert value if checkbox "alert only" is checked). Using the checkbox, you can create purchase orders to fill the difference.
|
||||
ReplenishmentStatusDescPerWarehouse=If you want a replenishment based on desired quantity defined per warehouse, you must add a filter on the warehouse.
|
||||
ReplenishmentOrdersDesc=This is a list of all open purchase orders including predefined products. Only open orders with predefined products, so orders that may affect stocks, are visible here.
|
||||
Replenishments=Replenishments
|
||||
NbOfProductBeforePeriod=Quantity of product %s in stock before selected period (< %s)
|
||||
|
||||
@ -16,6 +16,7 @@ WEBSITE_ROBOT=Robot file (robots.txt)
|
||||
WEBSITE_HTACCESS=Website .htaccess file
|
||||
WEBSITE_MANIFEST_JSON=Website manifest.json file
|
||||
WEBSITE_README=README.md file
|
||||
WEBSITE_KEYWORDSDesc=Use a comma to separate values
|
||||
EnterHereLicenseInformation=Enter here meta data or license information to fille a README.md file. if you distribute your website as a template, the file will be included into the temptate package.
|
||||
HtmlHeaderPage=HTML header (specific to this page only)
|
||||
PageNameAliasHelp=Name or alias of the page.<br>This alias is also used to forge a SEO URL when website is ran from a Virtual host of a Web server (like Apacke, Nginx, ...). Use the button "<strong>%s</strong>" to edit this alias.
|
||||
|
||||
@ -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.
|
||||
NoInvoiceToWithdraw=No invoice open for '%s' 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
|
||||
|
||||
@ -876,6 +876,7 @@ if (!$variants) {
|
||||
print "\n".'<tr>';
|
||||
print '<td colspan="9">';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="pdluoid" value="'.$pdluo->id.'"><input type="hidden" name="action" value="updateline"><input type="hidden" name="id" value="'.$id.'"><table class="noborder centpercent"><tr><td width="10%"></td>';
|
||||
print '<td class="right" width="10%"><input type="text" name="batch_number" value="'.$pdluo->batch.'"></td>';
|
||||
print '<td class="center" width="10%">';
|
||||
@ -943,6 +944,7 @@ if (!$variants) {
|
||||
|
||||
if (!empty($user->rights->produit->creer)) {
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="addlimitstockwarehouse">';
|
||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||
}
|
||||
|
||||
@ -99,6 +99,7 @@ $parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@ -107,7 +108,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
||||
{
|
||||
$sref = '';
|
||||
$snom = '';
|
||||
$sal = '';
|
||||
$sall = '';
|
||||
$salert = '';
|
||||
$draftorder = '';
|
||||
}
|
||||
@ -299,7 +300,6 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entre
|
||||
$sqlalertstock = 'p.seuil_stock_alerte';
|
||||
}
|
||||
|
||||
|
||||
$sql = 'SELECT p.rowid, p.ref, p.label, p.description, p.price,';
|
||||
$sql .= ' p.price_ttc, p.price_base_type,p.fk_product_type,';
|
||||
$sql .= ' p.tms as datem, p.duration, p.tobuy,';
|
||||
@ -489,6 +489,9 @@ print load_fiche_titre($langs->trans('Replenishment'), '', 'stock');
|
||||
dol_fiche_head($head, 'replenish', '', -1, '');
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("ReplenishmentStatusDesc").'</span><br>'."\n";
|
||||
if (empty($fk_warhouse) && !empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE)) {
|
||||
print '<span class="opacitymedium">'.$langs->trans("ReplenishmentStatusDescPerWarehouse").'</span>'."<br>\n";
|
||||
}
|
||||
if ($usevirtualstock == 1)
|
||||
{
|
||||
print $langs->trans("CurentSelectionMode").': ';
|
||||
|
||||
@ -526,7 +526,7 @@ $listofreferent = array(
|
||||
*/
|
||||
);
|
||||
|
||||
// Change rules for benefit calculation
|
||||
// Change rules for profit/benefit calculation
|
||||
if (! empty($conf->global->PROJECT_ELEMENTS_FOR_PLUS_MARGIN)) {
|
||||
foreach ($listofreferent as $key => $element) {
|
||||
if ($listofreferent[$key]['margin'] == 'add') {
|
||||
@ -623,7 +623,28 @@ print load_fiche_titre($langs->trans("Profit"), '', 'title_accountancy');
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="left" width="200">'.$langs->trans("Element").'</td>';
|
||||
print '<td class="left" width="200">';
|
||||
$tooltiponprofit = $langs->trans("ProfitIsCalculatedWith")."<br>\n";
|
||||
$tooltiponprofitplus = $tooltiponprofitminus = '';
|
||||
foreach($listofreferent as $key => $value)
|
||||
{
|
||||
$name = $langs->trans($value['name']);
|
||||
$qualified = $value['test'];
|
||||
$margin = $value['margin'];
|
||||
if ($qualified && isset($margin)) // If this element must be included into profit calculation ($margin is 'minus' or 'add')
|
||||
{
|
||||
if ($margin == 'add') {
|
||||
$tooltiponprofitplus.=' + '.$name."<br>\n";
|
||||
}
|
||||
if ($margin == 'minus') {
|
||||
$tooltiponprofitminus.=' - '.$name."<br>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
$tooltiponprofit .= $tooltiponprofitplus;
|
||||
$tooltiponprofit .= $tooltiponprofitminus;
|
||||
print $form->textwithpicto($langs->trans("Element"), $tooltiponprofit);
|
||||
print '</td>';
|
||||
print '<td class="right" width="100">'.$langs->trans("Number").'</td>';
|
||||
print '<td class="right" width="100">'.$langs->trans("AmountHT").'</td>';
|
||||
print '<td class="right" width="100">'.$langs->trans("AmountTTC").'</td>';
|
||||
@ -639,7 +660,7 @@ foreach ($listofreferent as $key => $value)
|
||||
$qualified = $value['test'];
|
||||
$margin = $value['margin'];
|
||||
$project_field = $value['project_field'];
|
||||
if ($qualified && isset($margin)) // If this element must be included into profit calculation ($margin is 'minus' or 'plus')
|
||||
if ($qualified && isset($margin)) // If this element must be included into profit calculation ($margin is 'minus' or 'add')
|
||||
{
|
||||
$element = new $classname($db);
|
||||
|
||||
|
||||
@ -1601,6 +1601,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;
|
||||
@ -1622,14 +1623,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>';
|
||||
}
|
||||
|
||||
@ -209,11 +209,9 @@ a.top-menu-dropdown-link {
|
||||
}
|
||||
|
||||
.dropdown-menu > .user-header{
|
||||
background: rgb(<?php echo $colorbackhmenu1 ?>);
|
||||
background: var(--colorbackhmenu1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.dropdown-menu .dropdown-header{
|
||||
padding: 8px 8px 8px 8px;
|
||||
}
|
||||
|
||||
@ -3362,8 +3362,10 @@ if ($action == 'editmeta' || $action == 'createcontainer')
|
||||
print '<input type="text" class="flat quatrevingtpercent" name="WEBSITE_IMAGE" value="'.dol_escape_htmltag($pageimage).'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Keywords
|
||||
print '<tr><td>';
|
||||
print $langs->trans('WEBSITE_KEYWORDS');
|
||||
$htmlhelp = $langs->trans("WEBSITE_KEYWORDSDesc");
|
||||
print $form->textwithpicto($langs->trans('WEBSITE_KEYWORDS'), $htmlhelp, 1, 'help', '', 0, 2, 'keywordtooltip');
|
||||
print '</td><td>';
|
||||
print '<input type="text" class="flat quatrevingtpercent" name="WEBSITE_KEYWORDS" value="'.dol_escape_htmltag($pagekeywords).'">';
|
||||
print '</td></tr>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user