Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.6
This commit is contained in:
commit
47fc72a001
@ -8,6 +8,7 @@ For users:
|
||||
- Fix: sql errors on updat fichinter
|
||||
- Fix: debian script syntax error
|
||||
- Fix: error "menu param is not inside list" into pos module.
|
||||
- Fix: Salary payments are not reflected on the reporting sheets
|
||||
|
||||
***** ChangeLog for 3.6 compared to 3.5.* *****
|
||||
For users:
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@ -538,6 +539,69 @@ if ($mysoc->tva_assuj == 'franchise') // Non assujeti
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
/*
|
||||
* Salaries
|
||||
*/
|
||||
|
||||
print '<tr><td colspan="4">'.$langs->trans("Salaries").'</td></tr>';
|
||||
$sql = "SELECT p.label as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount, u.firstname, u.lastname, p.fk_user";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
|
||||
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user";
|
||||
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||
if (! empty($date_start) && ! empty($date_end))
|
||||
$sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
|
||||
|
||||
$sql.= " GROUP BY u.rowid";
|
||||
$sql.= " ORDER BY u.firstname";
|
||||
|
||||
dol_syslog("get payment salaries sql=".$sql);
|
||||
$result=$db->query($sql);
|
||||
$subtotal_ht = 0;
|
||||
$subtotal_ttc = 0;
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$var=true;
|
||||
$i = 0;
|
||||
if ($num)
|
||||
{
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
$total_ht -= $obj->amount;
|
||||
$total_ttc -= $obj->amount;
|
||||
$subtotal_ht += $obj->amount;
|
||||
$subtotal_ttc += $obj->amount;
|
||||
|
||||
$var = !$var;
|
||||
print "<tr ".$bc[$var]."><td> </td>";
|
||||
|
||||
print "<td>".$langs->trans("Salaries")." <a href=\"".DOL_URL_ROOT."/compta/salaries/index.php?filtre=s.fk_user=".$obj->fk_user."\">".$obj->firstname." ".$obj->lastname."</a></td>\n";
|
||||
|
||||
if ($modecompta == 'CREANCES-DETTES') print '<td align="right">'.price(-$obj->amount).'</td>';
|
||||
print '<td align="right">'.price(-$obj->amount).'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$var = !$var;
|
||||
print "<tr ".$bc[$var]."><td> </td>";
|
||||
print '<td colspan="3">'.$langs->trans("None").'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
print '<tr class="liste_total">';
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
print '<td colspan="3" align="right">'.price(-$subtotal_ht).'</td>';
|
||||
print '<td colspan="3" align="right">'.price(-$subtotal_ttc).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
/*
|
||||
* VAT
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@ -469,6 +470,44 @@ $parameters["mode"] = $modecompta;
|
||||
$hookmanager->initHooks(array('externalbalance'));
|
||||
$reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
/*
|
||||
* Salaries
|
||||
*/
|
||||
$subtotal_ht = 0;
|
||||
$subtotal_ttc = 0;
|
||||
$sql = "SELECT p.label as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
|
||||
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||
$sql.= " GROUP BY p.label, dm";
|
||||
|
||||
dol_syslog("get social salaries payments sql=".$sql);
|
||||
$result=$db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$var=false;
|
||||
$i = 0;
|
||||
if ($num)
|
||||
{
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0;
|
||||
$decaiss[$obj->dm] += $obj->amount;
|
||||
|
||||
if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0;
|
||||
$decaiss_ttc[$obj->dm] += $obj->amount;
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
/*
|
||||
* Show result array
|
||||
*/
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/* Copyright (c) 2008-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (c) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (c) 2013 Charles-Fr BENKE <charles.fr@benke.fr>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (c) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
/* Copyright (C) 2008-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Charles-Fr BENKE <charles.fr@benke.fr>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* 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
|
||||
@ -270,7 +270,7 @@ class FormFile
|
||||
if (! empty($iconPDF)) {
|
||||
return $this->getDocumentsLink($modulepart, $modulesubdir, $filedir);
|
||||
}
|
||||
$printer = ($user->rights->printipp->read && $conf->printipp->enabled)?true:false;
|
||||
$printer = (!empty($user->rights->printipp->read) && !empty($conf->printipp->enabled))?true:false;
|
||||
$hookmanager->initHooks(array('formfile'));
|
||||
$forname='builddoc';
|
||||
$out='';
|
||||
@ -514,11 +514,11 @@ class FormFile
|
||||
$out.= $genbutton;
|
||||
$out.= '</th>';
|
||||
|
||||
if($hookmanager->hooks['formfile'])
|
||||
if (!empty($hookmanager->hooks['formfile']))
|
||||
{
|
||||
foreach($hookmanager->hooks['formfile'] as $module)
|
||||
{
|
||||
if(method_exists($module, 'formBuilddocLineOptions')) $out .= '<th></th>';
|
||||
if (method_exists($module, 'formBuilddocLineOptions')) $out .= '<th></th>';
|
||||
}
|
||||
}
|
||||
$out.= '</tr>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user