';
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.= ' |