';
- // Ref
- print '| ';
- print ' | ';
- print '';
- print '';
- print ' | ';
- print '';
- print '';
- $syear = $year;
- $formother->select_year($syear?$syear:-1,'year',1, 20, 5);
- print ' | ';
- // Late
- print '';
- print ' '.$langs->trans("Late");
- print ' | ';
- print ' | ';
- print '';
- $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 0, 1);
- print ' | ';
- print ' | ';
- print ' | ';
- print ' | ';
- print ' | ';
- print ' | ';
- print '';
- $liststatus=array('paye:0'=>$langs->trans("Unpaid"), 'paye:1'=>$langs->trans("Paid"));
- print $form->selectarray('filtre', $liststatus, $filter, 1);
- print ' | ';
- print '';
- $searchpitco=$form->showFilterAndCheckAddButtons(1, empty($mode)?'checkformerge':'checkforsend');
- print $searchpitco;
- print ' | ';
- print "
\n";
-
- if ($num > 0)
- {
- $var=true;
- $total_ht=0;
- $total_tva=0;
- $total_ttc=0;
- $total_paid=0;
-
- $facturestatic=new Facture($db);
-
- while ($i < $num)
- {
- $objp = $db->fetch_object($resql);
- $date_limit=$db->jdate($objp->datelimite);
-
- $var=!$var;
-
- print "";
- $classname = "impayee";
-
- print '';
-
- $facturestatic->id=$objp->facid;
- $facturestatic->ref=$objp->facnumber;
- $facturestatic->type=$objp->type;
- $facturestatic->statut=$objp->fk_statut;
- $facturestatic->date_lim_reglement= $db->jdate($objp->datelimite);
-
- print '';
-
- // Ref
- print '| ';
- print $facturestatic->getNomUrl(1);
- print ' | ';
-
- // Warning picto
- print '';
- if ($facturestatic->hasDelay()) {
- print img_warning($langs->trans("Late"));
- }
- print ' | ';
-
- // PDF Picto
- print '';
- $filename=dol_sanitizeFileName($objp->facnumber);
- $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber);
- print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
- print ' | ';
-
- print ' ';
-
- print " | \n";
-
- // Customer ref
- print '';
- print $objp->ref_client;
- print ' | ';
-
- print ''.dol_print_date($db->jdate($objp->df),'day').' | '."\n";
- print ''.dol_print_date($db->jdate($objp->datelimite),'day').' | '."\n";
-
- print '';
- $thirdparty=new Societe($db);
- $thirdparty->id=$objp->socid;
- $thirdparty->name=$objp->name;
- $thirdparty->client=$objp->client;
- $thirdparty->code_client=$objp->code_client;
- print $thirdparty->getNomUrl(1,'customer');
- print ' | ';
-
- // Payment mode
- print '';
- $form->form_modes_reglement($_SERVER['PHP_SELF'], $objp->fk_mode_reglement, 'none', '', -1);
- print ' | ';
-
-
- print ''.price($objp->total_ht).' | ';
- print ''.price($objp->total_tva);
- $tx1=price2num($objp->localtax1);
- $tx2=price2num($objp->localtax2);
- $revenuestamp=price2num($objp->revenuestamp);
- if (! empty($tx1) || ! empty($tx2) || ! empty($revenuestamp)) print '+'.price($tx1 + $tx2 + $revenuestamp);
- print ' | ';
- print ''.price($objp->total_ttc).' | ';
- print '';
- $cn=$facturestatic->getSumCreditNotesUsed();
- $dep=$facturestatic->getSumDepositsUsed();
- if (! empty($objp->am)) print price($objp->am);
- if (! empty($objp->am) && ! empty($cn)) print '+';
- if (! empty($cn)) print price($cn);
- if (! empty($dep)) print price(-$dep);
- print ' | ';
-
- // Remain to receive
- print ''.(((! empty($objp->total_ttc) || ! empty($objp->am) || ! empty($cn) || ! empty($dep)) && ($objp->total_ttc - $objp->am - $cn - $dep)) ? price($objp->total_ttc - $objp->am - $cn - $dep):' ').' | ';
-
- // Status of invoice
- print '';
- print $facturestatic->LibStatut($objp->paye,$objp->fk_statut,5,$objp->am);
- print ' | ';
-
- if (empty($mode))
- {
- // Checkbox to merge
- print '';
- if (! empty($formfile->infofiles['extensions']['pdf']))
- print '';
- print ' | ' ;
- }
- else
- {
- // Checkbox to send remind
- print '';
- $selected=0;
- if (in_array($objp->facid, $arrayofinvoices)) $selected=1;
- if ($objp->email) print '';
- else print img_picto($langs->trans("NoEMail"), 'warning.png');
- print ' | ' ;
- }
-
- print "
\n";
- $total_ht+=$objp->total_ht;
- $total_tva+=($objp->total_tva + $tx1 + $tx2 + $revenuestamp);
- $total_ttc+=$objp->total_ttc;
- $total_paid+=$objp->am + $cn + $dep;
-
- $i++;
- }
-
- print '