";
// Num ref cheque
- print '| ';
+ print ' | ';
$checkdepositstatic->id=$objp->rowid;
$checkdepositstatic->ref=($objp->ref?$objp->ref:$objp->rowid);
$checkdepositstatic->statut=$objp->statut;
diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php
index 9495b56e90b..f55d5917750 100644
--- a/htdocs/compta/paiement/list.php
+++ b/htdocs/compta/paiement/list.php
@@ -186,7 +186,7 @@ else
}
$sql.= $db->order($sortfield,$sortorder);
-$nbtotalofrecords = 0;
+$nbtotalofrecords = -1;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php
index b39e5c47f7f..6f780de554b 100644
--- a/htdocs/compta/resultat/clientfourn.php
+++ b/htdocs/compta/resultat/clientfourn.php
@@ -52,6 +52,17 @@ if ($user->societe_id > 0) $socid = $user->societe_id;
if (! empty($conf->comptabilite->enabled)) $result=restrictedArea($user,'compta','','','resultat');
if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accounting','','','comptarapport');
+$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
+$sortfield = GETPOST("sortfield",'alpha');
+$sortorder = GETPOST("sortorder",'alpha');
+$page = GETPOST("page",'int');
+if ($page == -1) { $page = 0; }
+$offset = $limit * $page;
+$pageprev = $page - 1;
+$pagenext = $page + 1;
+if (! $sortfield) $sortfield='s.nom, s.rowid';
+if (! $sortorder) $sortorder='ASC';
+
// Date range
$year=GETPOST("year");
if (empty($year))
@@ -155,12 +166,23 @@ if (! empty($conf->accounting->enabled))
}
// Show report array
+$param='&modecompta='.$modecompta;
+if ($date_startday) $param.='&date_startday='.$date_startday;
+if ($date_startmonth) $param.='&date_startmonth='.$date_startmonth;
+if ($date_startyear) $param.='&date_startyear='.$date_startyear;
+if ($date_endday) $param.='&date_endday='.$date_endday;
+if ($date_endmonth) $param.='&date_endmonth='.$date_endmonth;
+if ($date_endyear) $param.='&date_endyear='.$date_startyear;
+
print '';
print '';
-print '| | | ';
+print_liste_field_titre('');
+print_liste_field_titre($langs->trans("Name"), $_SERVER["PHP_SELF"],'s.nom, s.rowid','',$param,'',$sortfield,$sortorder);
if ($modecompta == 'CREANCES-DETTES')
- print "".$langs->trans("AmountHT")." | ";
-print "".$langs->trans("AmountTTC")." | ";
+{
+ print_liste_field_titre($langs->trans("AmountHT"), $_SERVER["PHP_SELF"],'amount_ht','',$param,'align="right"',$sortfield,$sortorder);
+}
+print_liste_field_titre($langs->trans("AmountTTC"), $_SERVER["PHP_SELF"],'amount_ttc','',$param,'align="right"',$sortfield,$sortorder);
print " \n";
/*
@@ -202,7 +224,7 @@ else
$sql.= " AND f.entity = ".$conf->entity;
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
$sql.= " GROUP BY s.nom, s.rowid";
-$sql.= " ORDER BY s.nom, s.rowid";
+$sql.= $db->order($sortfield, $sortorder);
dol_syslog("get customer invoices", LOG_DEBUG);
$result = $db->query($sql);
@@ -328,7 +350,7 @@ else
$sql.= " AND f.entity = ".$conf->entity;
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
$sql .= " GROUP BY s.nom, s.rowid";
-$sql .= " ORDER BY s.nom, s.rowid";
+$sql.= $db->order($sortfield, $sortorder);
print '| '.$langs->trans("SuppliersInvoices").' | ';
@@ -413,7 +435,11 @@ else
}
$sql.= " AND cs.entity = ".$conf->entity;
$sql.= " GROUP BY c.libelle, c.id";
-$sql.= " ORDER BY c.libelle, c.id";
+$newsortfield = $sortfield;
+if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'c.libelle, c.id';
+if ($newsortfield == 'amount_ht') $newsortfield = 'amount';
+if ($newsortfield == 'amount_ttc') $newsortfield = 'amount';
+$sql.= $db->order($newsortfield, $sortorder);
dol_syslog("get social contributions deductible=0", LOG_DEBUG);
$result=$db->query($sql);
@@ -473,8 +499,6 @@ if ($modecompta == 'CREANCES-DETTES')
if (! empty($date_start) && ! empty($date_end))
$sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'";
$sql.= " AND cs.entity = ".$conf->entity;
- $sql.= " GROUP BY c.libelle, c.id";
- $sql.= " ORDER BY c.libelle, c.id";
}
else
{
@@ -488,9 +512,13 @@ else
if (! empty($date_start) && ! empty($date_end))
$sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
$sql.= " AND cs.entity = ".$conf->entity;
- $sql.= " GROUP BY c.libelle, c.id";
- $sql.= " ORDER BY c.libelle, c.id";
}
+$sql.= " GROUP BY c.libelle, c.id";
+$newsortfield = $sortfield;
+if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'c.libelle, c.id';
+if ($newsortfield == 'amount_ht') $newsortfield = 'amount';
+if ($newsortfield == 'amount_ttc') $newsortfield = 'amount';
+$sql.= $db->order($newsortfield, $sortorder);
dol_syslog("get social contributions deductible=1", LOG_DEBUG);
$result=$db->query($sql);
@@ -574,8 +602,12 @@ if (! empty($conf->salaries->enabled))
$sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'";
$sql.= " GROUP BY u.rowid, u.firstname, u.lastname, p.fk_user, p.label, dm";
- $sql.= " ORDER BY u.firstname";
-
+ $newsortfield = $sortfield;
+ if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'u.firstname, u.lastname';
+ if ($newsortfield == 'amount_ht') $newsortfield = 'amount';
+ if ($newsortfield == 'amount_ttc') $newsortfield = 'amount';
+ $sql.= $db->order($newsortfield, $sortorder);
+
dol_syslog("get payment salaries");
$result=$db->query($sql);
$subtotal_ht = 0;
@@ -642,7 +674,7 @@ if (! empty($conf->expensereport->enabled))
$column='p.date_valid';
} else {
- $sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc";
+ $sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.total_ht) as amount_ht, sum(p.total_ttc) as amount_ttc";
$sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p";
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author";
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_expensereport as pe ON pe.fk_expensereport = p.rowid";
@@ -656,55 +688,59 @@ if (! empty($conf->expensereport->enabled))
print '| '.$langs->trans("ExpenseReport").' | ';
if (! empty($date_start) && ! empty($date_end))
+ {
$sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'";
+ }
+
+ $sql.= " GROUP BY u.rowid, p.rowid, p.ref, u.firstname, u.lastname, dm";
+ $newsortfield = $sortfield;
+ if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'p.ref';
+ $sql.= $db->order($newsortfield, $sortorder);
- $sql.= " GROUP BY u.rowid, p.rowid, p.ref, u.firstname, u.lastname, dm";
- $sql.= " ORDER BY p.ref";
-
- dol_syslog("get expense report outcome");
- $result=$db->query($sql);
- $subtotal_ht = 0;
- $subtotal_ttc = 0;
- if ($result)
+ dol_syslog("get expense report outcome");
+ $result=$db->query($sql);
+ $subtotal_ht = 0;
+ $subtotal_ttc = 0;
+ if ($result)
+ {
+ $num = $db->num_rows($result);
+ $var=true;
+ if ($num)
{
- $num = $db->num_rows($result);
- $var=true;
- if ($num)
+ while ($obj = $db->fetch_object($result))
{
- while ($obj = $db->fetch_object($result))
- {
- $total_ht -= $obj->amount_ht;
- $total_ttc -= $obj->amount_ttc;
- $subtotal_ht += $obj->amount_ht;
- $subtotal_ttc += $obj->amount_ttc;
+ $total_ht -= $obj->amount_ht;
+ $total_ttc -= $obj->amount_ttc;
+ $subtotal_ht += $obj->amount_ht;
+ $subtotal_ttc += $obj->amount_ttc;
- $var = !$var;
- print "| | ";
-
- print "".$langs->trans("ExpenseReport")." userid."\">".$obj->firstname." ".$obj->lastname." | \n";
-
- if ($modecompta == 'CREANCES-DETTES') print ''.price(-$obj->amount_ht).' | ';
- print ''.price(-$obj->amount_ttc).' | ';
- print ' ';
- }
- }
- else
- {
$var = !$var;
print "| | ";
- print ''.$langs->trans("None").' | ';
+
+ print "".$langs->trans("ExpenseReport")." userid."\">".$obj->firstname." ".$obj->lastname." | \n";
+
+ if ($modecompta == 'CREANCES-DETTES') print ''.price(-$obj->amount_ht).' | ';
+ print ''.price(-$obj->amount_ttc).' | ';
print ' ';
}
}
else
{
- dol_print_error($db);
- }
- print '';
- if ($modecompta == 'CREANCES-DETTES')
- print '| '.price(-$subtotal_ht).' | ';
- print ''.price(-$subtotal_ttc).' | ';
+ $var = !$var;
+ print " | | ";
+ print ''.$langs->trans("None").' | ';
print ' ';
+ }
+ }
+ else
+ {
+ dol_print_error($db);
+ }
+ print '';
+ if ($modecompta == 'CREANCES-DETTES')
+ print '| '.price(-$subtotal_ht).' | ';
+ print ''.price(-$subtotal_ttc).' | ';
+ print ' ';
}
/*
@@ -733,7 +769,11 @@ if (! empty($conf->don->enabled))
if (! empty($date_start) && ! empty($date_end))
$sql.= " AND p.datedon >= '".$db->idate($date_start)."' AND p.datedon <= '".$db->idate($date_end)."'";
$sql.= " GROUP BY p.societe, p.firstname, p.lastname, dm";
- $sql.= " ORDER BY p.societe, p.firstname, p.lastname, dm";
+ $newsortfield = $sortfield;
+ if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'p.societe, p.firstname, p.lastname, dm';
+ if ($newsortfield == 'amount_ht') $newsortfield = 'amount';
+ if ($newsortfield == 'amount_ttc') $newsortfield = 'amount';
+ $sql.= $db->order($newsortfield, $sortorder);
dol_syslog("get dunning");
$result=$db->query($sql);
@@ -808,7 +848,11 @@ if ($modecompta == 'CREANCES-DETTES')
$sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
$sql.= " AND f.entity = ".$conf->entity;
$sql.= " GROUP BY dm";
- $sql.= " ORDER BY dm";
+ $newsortfield = $sortfield;
+ if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm';
+ if ($newsortfield == 'amount_ht') $newsortfield = 'amount';
+ if ($newsortfield == 'amount_ttc') $newsortfield = 'amount';
+ $sql.= $db->order($newsortfield, $sortorder);
dol_syslog("get vat to pay", LOG_DEBUG);
$result=$db->query($sql);
@@ -853,7 +897,11 @@ if ($modecompta == 'CREANCES-DETTES')
$sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
$sql.= " AND f.entity = ".$conf->entity;
$sql.= " GROUP BY dm";
- $sql.= " ORDER BY dm";
+ $newsortfield = $sortfield;
+ if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm';
+ if ($newsortfield == 'amount_ht') $newsortfield = 'amount';
+ if ($newsortfield == 'amount_ttc') $newsortfield = 'amount';
+ $sql.= $db->order($newsortfield, $sortorder);
dol_syslog("get vat received back", LOG_DEBUG);
$result=$db->query($sql);
@@ -897,7 +945,11 @@ else
$sql.= " AND t.datev >= '".$db->idate($date_start)."' AND t.datev <= '".$db->idate($date_end)."'";
$sql.= " AND t.entity = ".$conf->entity;
$sql.= " GROUP BY dm";
- $sql.= " ORDER BY dm";
+ $newsortfield = $sortfield;
+ if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm';
+ if ($newsortfield == 'amount_ht') $newsortfield = 'amount';
+ if ($newsortfield == 'amount_ttc') $newsortfield = 'amount';
+ $sql.= $db->order($newsortfield, $sortorder);
dol_syslog("get vat really paid", LOG_DEBUG);
$result=$db->query($sql);
@@ -938,7 +990,11 @@ else
$sql.= " AND t.datev >= '".$db->idate($date_start)."' AND t.datev <= '".$db->idate($date_end)."'";
$sql.= " AND t.entity = ".$conf->entity;
$sql.= " GROUP BY dm";
- $sql.= " ORDER BY dm";
+ $newsortfield = $sortfield;
+ if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm';
+ if ($newsortfield == 'amount_ht') $newsortfield = 'amount';
+ if ($newsortfield == 'amount_ttc') $newsortfield = 'amount';
+ $sql.= $db->order($newsortfield, $sortorder);
dol_syslog("get vat really received back", LOG_DEBUG);
$result=$db->query($sql);
diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php
index 8c21bf32ceb..79401b57798 100644
--- a/htdocs/compta/sociales/card.php
+++ b/htdocs/compta/sociales/card.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2004-2016 Laurent Destailleur
* Copyright (C) 2005-2013 Regis Houssin
* Copyright (C) 2016 Frédéric France
+ * Copyright (C) 2016 Alexandre Spangaro
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -72,6 +73,14 @@ if ($action == 'reopen' && $user->rights->tax->charges->creer) {
}
}
+if ($action == 'setlib' && $user->rights->tax->charges->creer)
+{
+ $object->fetch($id);
+ $result = $object->setValueFrom('libelle', GETPOST('lib'), '', '', 'text', '', $user, 'TAX_MODIFY');
+ if ($result < 0)
+ setEventMessages($object->error, $object->errors, 'errors');
+}
+
// payment mode
if ($action == 'setmode' && $user->rights->tax->charges->creer) {
$object->fetch($id);
@@ -278,14 +287,16 @@ if ($action == 'create')
dol_fiche_head();
print '';
- print "";
+
// Label
- print '| ';
+ print " | ";
+ print '| ';
print $langs->trans("Label");
print ' | ';
- print ' | ';
+ print ' | ';
print ' ';
print '';
+
// Type
print '| ';
print $langs->trans("Type");
@@ -294,6 +305,7 @@ if ($action == 'create')
$formsocialcontrib->select_type_socialcontrib(GETPOST("actioncode")?GETPOST("actioncode"):'','actioncode',1);
print ' | ';
print ' ';
+
// Date end period
print '';
print '| ';
@@ -303,6 +315,7 @@ if ($action == 'create')
print $form->select_date(! empty($dateperiod)?$dateperiod:'-1', 'period', 0, 0, 0, 'charge', 1);
print ' | ';
print ' ';
+
// Amount
print '';
print '| ';
@@ -310,10 +323,12 @@ if ($action == 'create')
print ' | ';
print ' | ';
print ' ';
+
// Payment Mode
print '| ' . $langs->trans('PaymentMode') . ' | ';
$form->select_types_paiements($mode_reglement_id, 'mode_reglement_id');
print ' | ';
+
// Bank Account
if (! empty($conf->banque->enabled))
{
@@ -321,6 +336,7 @@ if ($action == 'create')
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
print '';
}
+
// Date due
print '';
print '';
@@ -337,7 +353,9 @@ if ($action == 'create')
print '';
print ' ';
- print ' ';
+ print ' ';
+ print '';
+ print ' ';
print '';
}
@@ -356,6 +374,8 @@ if ($id > 0)
{
$head=tax_prepare_head($object);
+ $totalpaye = $object->getSommePaiement();
+
// Clone confirmation
if ($action === 'clone')
{
@@ -386,101 +406,47 @@ if ($id > 0)
print ' ';
}
-
dol_fiche_head($head, 'card', $langs->trans("SocialContribution"),0,'bill');
+
+ $morehtmlref=' ';
+ // Ref customer
+ $morehtmlref.=$form->editfieldkey("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
+ $morehtmlref.=$form->editfieldval("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
+ $morehtmlref.=' ';
+
+ $linkback = ' ' . $langs->trans("BackToList") . '';
+
+ $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
+
+ dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
+
+ print ' ';
+ print ' ';
+ print ' ';
print ' ';
- $linkback = '' . $langs->trans("BackToList") . '';
-
+ /*
// Ref
- print '| '.$langs->trans("Ref").' | ';
+ print ' | | '.$langs->trans("Ref").' | ';
print $form->showrefnav($object,'id',$linkback);
print " | ";
+ */
// Label
- if ($action == 'edit')
+ /*if ($action == 'edit')
{
- print '| '.$langs->trans("Label").' | ';
+ print ' | | '.$langs->trans("Label").' | ';
print '';
print ' | ';
}
else
{
print '| '.$langs->trans("Label").' | '.$object->lib.' | ';
- }
-
+ }*/
+
// Type
print "| ".$langs->trans("Type")." | ".$object->type_libelle." | ";
-
- $rowspan=6;
- if (! empty($conf->banque->enabled)) $rowspan++;
- print '';
-
- /*
- * Payments
- */
- $sql = "SELECT p.rowid, p.num_paiement, datep as dp, p.amount,";
- $sql.= "c.code as type_code,c.libelle as paiement_type";
- $sql.= " FROM ".MAIN_DB_PREFIX."paiementcharge as p";
- $sql.= ", ".MAIN_DB_PREFIX."c_paiement as c ";
- $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
- $sql.= " WHERE p.fk_charge = ".$id;
- $sql.= " AND p.fk_charge = cs.rowid";
- $sql.= " AND cs.entity = ".$conf->entity;
- $sql.= " AND p.fk_typepaiement = c.id";
- $sql.= " ORDER BY dp DESC";
-
- //print $sql;
- $resql = $db->query($sql);
- if ($resql)
- {
- $num = $db->num_rows($resql);
- $i = 0; $total = 0;
- print '';
- print '';
- print '| '.$langs->trans("RefPayment").' | ';
- print ''.$langs->trans("Date").' | ';
- print ''.$langs->trans("Type").' | ';
- print ''.$langs->trans("Amount").' | ';
- print ' | ';
- print ' ';
-
- $var=True;
- while ($i < $num)
- {
- $objp = $db->fetch_object($resql);
- $var=!$var;
- print "| ";
- print ''.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.' | ';
- print ''.dol_print_date($db->jdate($objp->dp),'day')." | \n";
- $labeltype=$langs->trans("PaymentType".$objp->type_code)!=("PaymentType".$objp->type_code)?$langs->trans("PaymentType".$objp->type_code):$objp->paiement_type;
- print "".$labeltype.' '.$objp->num_paiement." | \n";
- print ''.price($objp->amount)." | ".$langs->trans("Currency".$conf->currency)." | \n";
- print " ";
- $totalpaye += $objp->amount;
- $i++;
- }
-
- if ($object->paye == 0)
- {
- print "| ".$langs->trans("AlreadyPaid")." : | ".price($totalpaye)." | ".$langs->trans("Currency".$conf->currency)." | \n";
- print "| ".$langs->trans("AmountExpected")." : | ".price($object->amount)." | ".$langs->trans("Currency".$conf->currency)." | \n";
-
- $resteapayer = $object->amount - $totalpaye;
-
- print "| ".$langs->trans("RemainderToPay")." : | ";
- print "".price($resteapayer)." | ".$langs->trans("Currency".$conf->currency)." | \n";
- }
- print " ";
- $db->free($resql);
- }
- else
- {
- dol_print_error($db);
- }
- print " | ";
-
print " ";
// Period end date
@@ -555,13 +521,85 @@ if ($id > 0)
}
// Status
- print '| '.$langs->trans("Status").' | '.$object->getLibStatut(4, $totalpaye).' | ';
+ //print '| '.$langs->trans("Status").' | '.$object->getLibStatut(4, $totalpaye).' | ';
print ' ';
+ print ' ';
+ print ' ';
+ print ' ';
+
+ /*
+ * Payments
+ */
+ $sql = "SELECT p.rowid, p.num_paiement, datep as dp, p.amount,";
+ $sql.= "c.code as type_code,c.libelle as paiement_type";
+ $sql.= " FROM ".MAIN_DB_PREFIX."paiementcharge as p";
+ $sql.= ", ".MAIN_DB_PREFIX."c_paiement as c ";
+ $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
+ $sql.= " WHERE p.fk_charge = ".$id;
+ $sql.= " AND p.fk_charge = cs.rowid";
+ $sql.= " AND cs.entity = ".$conf->entity;
+ $sql.= " AND p.fk_typepaiement = c.id";
+ $sql.= " ORDER BY dp DESC";
+
+ //print $sql;
+ $resql = $db->query($sql);
+ if ($resql)
+ {
+ $num = $db->num_rows($resql);
+ $i = 0; $total = 0;
+ print ' ';
+ print '';
+ print '| '.$langs->trans("RefPayment").' | ';
+ print ''.$langs->trans("Date").' | ';
+ print ''.$langs->trans("Type").' | ';
+ print ''.$langs->trans("Amount").' | ';
+ print ' | ';
+ print ' ';
+
+ $var=True;
+ while ($i < $num)
+ {
+ $objp = $db->fetch_object($resql);
+ $var=!$var;
+ print "| ";
+ print ''.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.' | ';
+ print ''.dol_print_date($db->jdate($objp->dp),'day')." | \n";
+ $labeltype=$langs->trans("PaymentType".$objp->type_code)!=("PaymentType".$objp->type_code)?$langs->trans("PaymentType".$objp->type_code):$objp->paiement_type;
+ print "".$labeltype.' '.$objp->num_paiement." | \n";
+ print ''.price($objp->amount)." | ".$langs->trans("Currency".$conf->currency)." | \n";
+ print " ";
+ $totalpaye += $objp->amount;
+ $i++;
+ }
+
+ if ($object->paye == 0)
+ {
+ print "| ".$langs->trans("AlreadyPaid")." : | ".price($totalpaye)." | ".$langs->trans("Currency".$conf->currency)." | \n";
+ print "| ".$langs->trans("AmountExpected")." : | ".price($object->amount)." | ".$langs->trans("Currency".$conf->currency)." | \n";
+
+ $resteapayer = $object->amount - $totalpaye;
+
+ print "| ".$langs->trans("RemainderToPay")." : | ";
+ print "".price($resteapayer)." | ".$langs->trans("Currency".$conf->currency)." | \n";
+ }
+ print " ";
+ $db->free($resql);
+ }
+ else
+ {
+ dol_print_error($db);
+ }
+
+ print ' ';
+ print ' ';
+ print ' ';
+
+ print ' ';
+
dol_fiche_end();
-
-
+
if ($action == 'edit')
{
print ' ';
@@ -587,7 +625,7 @@ if ($id > 0)
{
print " id&action=reopen\">".$langs->trans("ReOpen")."";
}
-
+
// Edit
if ($object->paye == 0 && $user->rights->tax->charges->creer)
{
diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php
index ca9af965758..1ba0773afff 100644
--- a/htdocs/compta/sociales/class/chargesociales.class.php
+++ b/htdocs/compta/sociales/class/chargesociales.class.php
@@ -34,7 +34,8 @@ class ChargeSociales extends CommonObject
public $element='chargesociales';
public $table='chargesociales';
public $table_element='chargesociales';
-
+ public $picto = 'bill';
+
/**
* {@inheritdoc}
*/
@@ -371,7 +372,7 @@ class ChargeSociales extends CommonObject
/**
* Retourne le libelle du statut d'une charge (impaye, payee)
*
- * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
+ * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto
* @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
* @return string Label
*/
@@ -384,7 +385,7 @@ class ChargeSociales extends CommonObject
* Renvoi le libelle d'un statut donne
*
* @param int $statut Id statut
- * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
+ * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto
* @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
* @return string Label
*/
@@ -428,7 +429,13 @@ class ChargeSociales extends CommonObject
if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
}
-
+ if ($mode == 6)
+ {
+ if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
+ if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
+ if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
+ }
+
return "Error, mode/status not found";
}
diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php
index befc9d5c208..236e22ba981 100644
--- a/htdocs/compta/stats/cabyprodserv.php
+++ b/htdocs/compta/stats/cabyprodserv.php
@@ -1,7 +1,7 @@
- * Copyright (C) 2013 Laurent Destailleur
- * Copyright (C) 2015 Raphaël Doursenaud
+/* Copyright (C) 2013 Antoine Iauch
+ * Copyright (C) 2013-2016 Laurent Destailleur
+ * Copyright (C) 2015 Raphaël Doursenaud
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -262,7 +262,11 @@ if ($modecompta == 'CREANCES-DETTES')
print '';
}
- print '';
+ $moreforfilter='';
+
+ print '';
+ print ' '."\n";
+
// Category filter
print '';
print '| ';
@@ -418,6 +422,8 @@ if ($modecompta == 'CREANCES-DETTES')
$db->free($result);
}
print " | ";
+ print ' ';
+
print '';
} else {
// $modecompta != 'CREANCES-DETTES'
diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php
index e5a4bc37f78..d72b06a1bb0 100644
--- a/htdocs/compta/stats/cabyuser.php
+++ b/htdocs/compta/stats/cabyuser.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004-2011 Laurent Destailleur
+ * Copyright (C) 2004-2016 Laurent Destailleur
* Copyright (C) 2005-2009 Regis Houssin
* Copyright (C) 2013 Antoine Iauch
*
@@ -260,8 +260,11 @@ if ($modecompta != 'CREANCES-DETTES') {
}
}
-$i = 0;
-print "";
+$morefilter='';
+
+print '';
+print ' '."\n";
+
print "";
print_liste_field_titre(
$langs->trans("User"),
@@ -346,6 +349,8 @@ if (count($amount)) {
$arrayforsort=$amount;
}
+ $i = 0;
+
foreach($arrayforsort as $key => $value) {
$var=!$var;
print " ";
@@ -432,6 +437,8 @@ if (count($amount)) {
}
print " ";
+print ' ';
+print '';
llxFooter();
diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php
index e2e092b032f..26063587c5d 100644
--- a/htdocs/compta/stats/casoc.php
+++ b/htdocs/compta/stats/casoc.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004-2013 Laurent Destailleur
+ * Copyright (C) 2004-2016 Laurent Destailleur
* Copyright (C) 2005-2009 Regis Houssin
* Copyright (C) 2007 Franky Van Liedekerke
* Copyright (C) 2013 Antoine Iauch
@@ -22,7 +22,7 @@
/**
* \file htdocs/compta/stats/casoc.php
- * \brief Page reporting CA par societe
+ * \brief Page reporting Turnover (CA) by thirdparty
*/
require '../../main.inc.php';
@@ -151,6 +151,7 @@ foreach($allparams as $key => $value) {
$paramslink .= '&' . $key . '=' . $value;
}
+
/*
* View
*/
@@ -338,8 +339,13 @@ foreach($headerparams as $key => $value)
{
print '';
}
-print "";
- // Category filter
+
+$moreforfilter='';
+
+print '';
+print ' '."\n";
+
+// Category filter
print '';
print '| ';
print $langs->trans("Category") . ': ' . $formother->select_categories(Categorie::TYPE_CUSTOMER, $selected_cat, 'search_categ', true);
@@ -614,6 +620,8 @@ if (count($amount)) {
}
print " | ";
+print " ";
+
print '';
llxFooter();
diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php
index 1a343cbcb0b..a32a67bb9fe 100644
--- a/htdocs/compta/stats/index.php
+++ b/htdocs/compta/stats/index.php
@@ -178,12 +178,11 @@ if ($modecompta != 'CREANCES-DETTES')
}
}
+$moreforfilter='';
-/*
- * Show result array
- */
+print '';
+print ' '."\n";
-print '';
print '| | ';
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
@@ -433,6 +432,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
}
print " \n";
print " ";
+print '';
/*
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index 04b73ccbb6d..33e5110153b 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -365,7 +365,7 @@ else
}
// Count total nb of records
-$nbtotalofrecords = 0;
+$nbtotalofrecords = -1;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php
index e0f465b5389..efb2c13ea9e 100644
--- a/htdocs/contrat/list.php
+++ b/htdocs/contrat/list.php
@@ -288,7 +288,7 @@ if ($result)
$totalnboflines = $db->num_rows($result);
}
-$nbtotalofrecords = 0;
+$nbtotalofrecords = -1;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index dadc470e273..05a4a8d398e 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -549,7 +549,7 @@ class FormFile
$buttonlabeltoshow=$buttonlabel;
if (empty($buttonlabel)) $buttonlabel=$langs->trans('Generate');
- if ($conf->browser->layout == 'phone') $urlsource.='#'.$forname.'_form'; # So we switch to form after a generation
+ if ($conf->browser->layout == 'phone') $urlsource.='#'.$forname.'_form'; // So we switch to form after a generation
if (empty($noform)) $out.= ' | |