Debug numbering module for customer payment

This commit is contained in:
Laurent Destailleur 2016-02-07 14:22:52 +01:00
parent 28c89dc3e3
commit c1a6a2880b
3 changed files with 35 additions and 19 deletions

View File

@ -39,6 +39,8 @@ $label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha'); $scandir = GETPOST('scandir','alpha');
$type='invoice'; $type='invoice';
if (empty($conf->global->PAYMENT_ADDON)) $conf->global->PAYMENT_ADDON = 'mod_payment_cicada.php';
/* /*
* Actions * Actions
@ -62,11 +64,13 @@ if ($action == 'updateMask')
} }
} }
if ($action == 'setmod') if ($action == 'setmod')
{ {
dolibarr_set_const($db, "PAYMENT_ADDON",$value,'chaine',0,'',$conf->entity); dolibarr_set_const($db, "PAYMENT_ADDON",$value,'chaine',0,'',$conf->entity);
} }
/* /*
* View * View
*/ */
@ -88,7 +92,7 @@ dol_fiche_head($head, 'payment', $langs->trans("Invoices"), 0, 'invoice');
* Numbering module * Numbering module
*/ */
print load_fiche_titre($langs->trans("PaymentsNumberingModule")); print load_fiche_titre($langs->trans("PaymentsNumberingModule"), '', '');
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';

View File

@ -1827,6 +1827,7 @@ $form = new Form($db);
$formother = new FormOther($db); $formother = new FormOther($db);
$formfile = new FormFile($db); $formfile = new FormFile($db);
$formmargin = new FormMargin($db); $formmargin = new FormMargin($db);
$paymentstatic=new Paiement($db);
$bankaccountstatic = new Account($db); $bankaccountstatic = new Account($db);
if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); } if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); }
@ -3125,6 +3126,7 @@ else if ($id > 0 || ! empty($ref))
// List of payments already done // List of payments already done
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td class="liste_titre">' . ($object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')) . '</td>'; print '<td class="liste_titre">' . ($object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')) . '</td>';
print '<td class="liste_titre">' . $langs->trans('Date') . '</td>';
print '<td class="liste_titre">' . $langs->trans('Type') . '</td>'; print '<td class="liste_titre">' . $langs->trans('Type') . '</td>';
if (! empty($conf->banque->enabled)) if (! empty($conf->banque->enabled))
print '<td class="liste_titre" align="right">' . $langs->trans('BankAccount') . '</td>'; print '<td class="liste_titre" align="right">' . $langs->trans('BankAccount') . '</td>';
@ -3135,10 +3137,10 @@ else if ($id > 0 || ! empty($ref))
$var = true; $var = true;
// Payments already done (from payment on this invoice) // Payments already done (from payment on this invoice)
$sql = 'SELECT p.datep as dp, p.num_paiement, p.rowid, p.fk_bank,'; $sql = 'SELECT p.datep as dp, p.ref, p.num_paiement, p.rowid, p.fk_bank,';
$sql .= ' c.code as payment_code, c.libelle as payment_label,'; $sql .= ' c.code as payment_code, c.libelle as payment_label,';
$sql .= ' pf.amount,'; $sql .= ' pf.amount,';
$sql .= ' ba.rowid as baid, ba.ref, ba.label'; $sql .= ' ba.rowid as baid, ba.ref as baref, ba.label';
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'c_paiement as c, ' . MAIN_DB_PREFIX . 'paiement_facture as pf, ' . MAIN_DB_PREFIX . 'paiement as p'; $sql .= ' FROM ' . MAIN_DB_PREFIX . 'c_paiement as c, ' . MAIN_DB_PREFIX . 'paiement_facture as pf, ' . MAIN_DB_PREFIX . 'paiement as p';
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank as b ON p.fk_bank = b.rowid'; $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank as b ON p.fk_bank = b.rowid';
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank_account as ba ON b.fk_account = ba.rowid'; $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank_account as ba ON b.fk_account = ba.rowid';
@ -3160,15 +3162,21 @@ else if ($id > 0 || ! empty($ref))
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$var = ! $var; $var = ! $var;
print '<tr ' . $bc [$var] . '><td>'; print '<tr ' . $bc [$var] . '><td>';
print '<a href="' . DOL_URL_ROOT . '/compta/paiement/card.php?id=' . $objp->rowid . '">' . img_object($langs->trans('ShowPayment'), 'payment') . ' '; $paymentstatic->id=$objp->rowid;
print dol_print_date($db->jdate($objp->dp), 'day') . '</a></td>'; $paymentstatic->datepaye=$db->jdate($objp->dp);
$paymentstatic->ref=$objp->ref;
$paymentstatic->num_paiement=$objp->num_paiement;
$paymentstatic->payment_code=$objp->payment_code;
print $paymentstatic->getNomUrl(1);
print '</td>';
print '<td>'.dol_print_date($db->jdate($objp->dp), 'day') . '</td>';
$label = ($langs->trans("PaymentType" . $objp->payment_code) != ("PaymentType" . $objp->payment_code)) ? $langs->trans("PaymentType" . $objp->payment_code) : $objp->payment_label; $label = ($langs->trans("PaymentType" . $objp->payment_code) != ("PaymentType" . $objp->payment_code)) ? $langs->trans("PaymentType" . $objp->payment_code) : $objp->payment_label;
print '<td>' . $label . ' ' . $objp->num_paiement . '</td>'; print '<td>' . $label . ' ' . $objp->num_paiement . '</td>';
if (! empty($conf->banque->enabled)) if (! empty($conf->banque->enabled))
{ {
$bankaccountstatic->id = $objp->baid; $bankaccountstatic->id = $objp->baid;
$bankaccountstatic->ref = $objp->ref; $bankaccountstatic->ref = $objp->baref;
$bankaccountstatic->label = $objp->ref; $bankaccountstatic->label = $objp->baref;
print '<td align="right">'; print '<td align="right">';
if ($bankaccountstatic->id) if ($bankaccountstatic->id)
print $bankaccountstatic->getNomUrl(1, 'transactions'); print $bankaccountstatic->getNomUrl(1, 'transactions');

View File

@ -121,7 +121,8 @@ $boxinfo.= '</td>';
$boxinfo.= "</tr>\n"; $boxinfo.= "</tr>\n";
$boxinfo.= "</table>\n"; $boxinfo.= "</table>\n";
$boxinfo.= '</div>'; $boxinfo.= '</div>';
print $boxinfo; //print $boxinfo;
/* /*
* Dashboard Dolibarr states (statistics) * Dashboard Dolibarr states (statistics)
@ -309,7 +310,7 @@ if (empty($user->societe_id))
$boxstat.='</table>'; $boxstat.='</table>';
$boxstat.='</div>'; $boxstat.='</div>';
} }
print $boxstat; //print $boxstat;
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">'; print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
@ -323,6 +324,7 @@ $showweather=empty($conf->global->MAIN_DISABLE_METEO)?1:0;
$dashboardlines=array(); $dashboardlines=array();
$boxwork=''; $boxwork='';
$boxwork.='<div class="box">';
$boxwork.='<table summary="'.dol_escape_htmltag($langs->trans("WorkingBoard")).'" class="noborder boxtable" width="100%">'."\n"; $boxwork.='<table summary="'.dol_escape_htmltag($langs->trans("WorkingBoard")).'" class="noborder boxtable" width="100%">'."\n";
$boxwork.='<tr class="liste_titre">'; $boxwork.='<tr class="liste_titre">';
$boxwork.='<th class="liste_titre" colspan="2">'.$langs->trans("DolibarrWorkBoard").'</th>'; $boxwork.='<th class="liste_titre" colspan="2">'.$langs->trans("DolibarrWorkBoard").'</th>';
@ -514,8 +516,9 @@ foreach($valid_dashboardlines as $board)
} }
$boxwork.='</table>'; // End table array of working board $boxwork.='</table>'; // End table array of working board
$boxwork.='</div>';
print $boxwork; //print $boxwork;
print '</div></div></div><div class="clearboth"></div>'; print '</div></div></div><div class="clearboth"></div>';
@ -531,10 +534,13 @@ $boxlist.='<tr><td class="notopnoleftnoright">'."\n";
$boxlist.='<div class="fichehalfleft">'; $boxlist.='<div class="fichehalfleft">';
$boxlist.=$boxinfo;
$boxlist.=$boxstat;
$boxlist.=$resultboxes['boxlista']; $boxlist.=$resultboxes['boxlista'];
$boxlist.= '</div><div class="fichehalfright"><div class="ficheaddleft">'; $boxlist.= '</div><div class="fichehalfright"><div class="ficheaddleft">';
$boxlist.=$boxwork;
$boxlist.=$resultboxes['boxlistb']; $boxlist.=$resultboxes['boxlistb'];
$boxlist.= '</div></div>'; $boxlist.= '</div></div>';
@ -592,8 +598,7 @@ $db->close();
/** /**
* Show weather logo. Logo to show depends on $totallate and values for * Show weather logo. Logo to show depends on $totallate and values for
* $conf->global->MAIN_METEO_OFFSET * $conf->global->MAIN_METEO_LEVELx
* $conf->global->MAIN_METEO_GAP
* *
* @param int $totallate Nb of element late * @param int $totallate Nb of element late
* @param string $text Text to show on logo * @param string $text Text to show on logo
@ -606,13 +611,12 @@ function showWeather($totallate,$text,$options)
$out=''; $out='';
$offset=0; $offset=0;
$cursor=10; // By default $factor=10; // By default
//if (! empty($conf->global->MAIN_METEO_OFFSET)) $offset=$conf->global->MAIN_METEO_OFFSET;
//if (! empty($conf->global->MAIN_METEO_GAP)) $cursor=$conf->global->MAIN_METEO_GAP;
$level0=$offset; if (! empty($conf->global->MAIN_METEO_LEVEL0)) $level0=$conf->global->MAIN_METEO_LEVEL0; $level0=$offset; if (! empty($conf->global->MAIN_METEO_LEVEL0)) $level0=$conf->global->MAIN_METEO_LEVEL0;
$level1=$offset+1*$cursor; if (! empty($conf->global->MAIN_METEO_LEVEL1)) $level1=$conf->global->MAIN_METEO_LEVEL1; $level1=$offset+1*$factor; if (! empty($conf->global->MAIN_METEO_LEVEL1)) $level1=$conf->global->MAIN_METEO_LEVEL1;
$level2=$offset+2*$cursor; if (! empty($conf->global->MAIN_METEO_LEVEL2)) $level2=$conf->global->MAIN_METEO_LEVEL2; $level2=$offset+2*$factor; if (! empty($conf->global->MAIN_METEO_LEVEL2)) $level2=$conf->global->MAIN_METEO_LEVEL2;
$level3=$offset+3*$cursor; if (! empty($conf->global->MAIN_METEO_LEVEL3)) $level3=$conf->global->MAIN_METEO_LEVEL3; $level3=$offset+3*$factor; if (! empty($conf->global->MAIN_METEO_LEVEL3)) $level3=$conf->global->MAIN_METEO_LEVEL3;
if ($totallate <= $level0) $out.=img_picto_common($text,'weather/weather-clear.png',$options); if ($totallate <= $level0) $out.=img_picto_common($text,'weather/weather-clear.png',$options);
if ($totallate > $level0 && $totallate <= $level1) $out.=img_picto_common($text,'weather/weather-few-clouds.png',$options); if ($totallate > $level0 && $totallate <= $level1) $out.=img_picto_common($text,'weather/weather-few-clouds.png',$options);