forked from Wavyzz/dolibarr
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
45d57b0492 | ||
|
|
ccddf0d1be | ||
|
|
0b2a81f4b8 | ||
|
|
9c7647a7ae | ||
|
|
e8ffb0dacf | ||
|
|
bf9ec22cd0 | ||
|
|
800ded40d3 | ||
|
|
d8fe7b904e | ||
|
|
65b7f3d744 | ||
|
|
86f4b874eb | ||
|
|
bb201010e5 | ||
|
|
069cf61d72 | ||
|
|
0e2de54660 | ||
|
|
1dc3412bbd | ||
|
|
fc2bd4ab4e |
@@ -10,6 +10,7 @@ Fix: Add a limit into list to avoid browser to hang when database is too large.
|
||||
Fix: [ bug #1212 ] 'jqueryFileTree.php' directory traversal vulnerability
|
||||
Fix: Agenda and Banks module were not working with multicompany module
|
||||
Fix: [ bug #1317 ] Removing a category does not remove all child categories
|
||||
Fix: [ bug #1380 ] Customer invoices are not grouped in company results report.
|
||||
|
||||
***** ChangeLog for 3.4.2 compared to 3.4.1 *****
|
||||
Fix: field's problem into company's page (RIB).
|
||||
@@ -238,7 +239,7 @@ For users:
|
||||
- New: Can list elements (invoices, orders or proposals) on a particular
|
||||
user contact). This allow to view a "basket" of its elements.
|
||||
- New: Show bank account on payment list of invoice card.
|
||||
- New: Cloning project allow to clones task, notes, files, contacts.
|
||||
- New: Cloning project allow to clones task, notes, projects files, tasks files, contacts.
|
||||
- New: Enhance default style.
|
||||
- New: Can edit and resiliate member status from list.
|
||||
- New: Can insert URL links into elements lines. Also reported into PDF.
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -185,7 +185,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";
|
||||
$sql.= " ORDER BY s.nom, s.rowid";
|
||||
|
||||
dol_syslog("get customer invoices sql=".$sql);
|
||||
$result = $db->query($sql);
|
||||
@@ -279,11 +279,11 @@ print '</tr>';
|
||||
|
||||
|
||||
/*
|
||||
* Frais, factures fournisseurs.
|
||||
* Suppliers invoices
|
||||
*/
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
{
|
||||
$sql = "SELECT s.nom, s.rowid as socid, date_format(f.datef,'%Y-%m') as dm, sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc";
|
||||
$sql = "SELECT s.nom, s.rowid as socid, sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||
$sql.= " WHERE f.fk_soc = s.rowid";
|
||||
@@ -297,7 +297,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "SELECT s.nom, s.rowid as socid, date_format(p.datep,'%Y-%m') as dm, sum(pf.amount) as amount_ttc";
|
||||
$sql = "SELECT s.nom, s.rowid as socid, sum(pf.amount) as amount_ttc";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn as p";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||
@@ -310,7 +310,7 @@ else
|
||||
}
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||
$sql .= " GROUP BY s.nom, s.rowid, dm";
|
||||
$sql .= " GROUP BY s.nom, s.rowid";
|
||||
$sql .= " ORDER BY s.nom, s.rowid";
|
||||
|
||||
print '<tr><td colspan="4">'.$langs->trans("SuppliersInvoices").'</td></tr>';
|
||||
@@ -370,11 +370,11 @@ print '</tr>';
|
||||
* Charges sociales non deductibles
|
||||
*/
|
||||
|
||||
print '<tr><td colspan="4">'.$langs->trans("SocialContributions").'</td></tr>';
|
||||
print '<tr><td colspan="4">'.$langs->trans("SocialContributions").' ('.$langs->trans("Type").' 0)</td></tr>';
|
||||
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
{
|
||||
$sql = "SELECT c.libelle as nom, sum(cs.amount) as amount";
|
||||
$sql = "SELECT c.id, c.libelle as nom, sum(cs.amount) as amount";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
$sql.= " WHERE cs.fk_type = c.id";
|
||||
@@ -384,7 +384,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "SELECT c.libelle as nom, sum(p.amount) as amount";
|
||||
$sql = "SELECT c.id, c.libelle as nom, sum(p.amount) as amount";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p";
|
||||
@@ -395,8 +395,8 @@ else
|
||||
$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";
|
||||
$sql.= " ORDER BY c.libelle";
|
||||
$sql.= " GROUP BY c.libelle, c.id";
|
||||
$sql.= " ORDER BY c.libelle, c.id";
|
||||
|
||||
dol_syslog("get social contributions deductible=0 sql=".$sql);
|
||||
$result=$db->query($sql);
|
||||
@@ -444,11 +444,11 @@ print '</tr>';
|
||||
* Charges sociales deductibles
|
||||
*/
|
||||
|
||||
print '<tr><td colspan="4">'.$langs->trans("SocialContributions").'</td></tr>';
|
||||
print '<tr><td colspan="4">'.$langs->trans("SocialContributions").' ('.$langs->trans("Type").' 1)</td></tr>';
|
||||
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
{
|
||||
$sql = "SELECT c.libelle as nom, sum(cs.amount) as amount";
|
||||
$sql = "SELECT c.id, c.libelle as nom, sum(cs.amount) as amount";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
$sql.= " WHERE cs.fk_type = c.id";
|
||||
@@ -456,12 +456,12 @@ 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";
|
||||
$sql.= " ORDER BY c.libelle";
|
||||
$sql.= " GROUP BY c.libelle, c.id";
|
||||
$sql.= " ORDER BY c.libelle, c.id";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "SELECT c.libelle as nom, sum(p.amount) as amount";
|
||||
$sql = "SELECT c.id, c.libelle as nom, sum(p.amount) as amount";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p";
|
||||
@@ -471,8 +471,8 @@ 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";
|
||||
$sql.= " ORDER BY c.libelle";
|
||||
$sql.= " GROUP BY c.libelle, c.id";
|
||||
$sql.= " ORDER BY c.libelle, c.id";
|
||||
}
|
||||
|
||||
dol_syslog("get social contributions deductible=1 sql=".$sql);
|
||||
@@ -539,6 +539,7 @@ if ($mysoc->tva_assuj == 'franchise') // Non assujeti
|
||||
/*
|
||||
* VAT
|
||||
*/
|
||||
|
||||
print '<tr><td colspan="4">'.$langs->trans("VAT").'</td></tr>';
|
||||
$subtotal_ht = 0;
|
||||
$subtotal_ttc = 0;
|
||||
@@ -562,12 +563,15 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
|
||||
dol_syslog("get vat to pay sql=".$sql);
|
||||
$result=$db->query($sql);
|
||||
if ($result) {
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$var=false;
|
||||
$i = 0;
|
||||
if ($num) {
|
||||
while ($i < $num) {
|
||||
if ($num)
|
||||
{
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
$amount -= $obj->amount;
|
||||
@@ -604,12 +608,15 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
|
||||
dol_syslog("get vat received back sql=".$sql);
|
||||
$result=$db->query($sql);
|
||||
if ($result) {
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$var=true;
|
||||
$i = 0;
|
||||
if ($num) {
|
||||
while ($i < $num) {
|
||||
if ($num)
|
||||
{
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
$amount += $obj->amount;
|
||||
@@ -632,7 +639,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
}
|
||||
else
|
||||
{
|
||||
// TVA reellement deja payee
|
||||
// VAT really already paid
|
||||
$amount=0;
|
||||
$sql = "SELECT date_format(t.datev,'%Y-%m') as dm, sum(t.amount) as amount";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."tva as t";
|
||||
@@ -673,7 +680,7 @@ else
|
||||
print "<td align=\"right\">".price($amount)."</td>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
// TVA recuperee
|
||||
// VAT really received
|
||||
$amount=0;
|
||||
$sql = "SELECT date_format(t.datev,'%Y-%m') as dm, sum(t.amount) as amount";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."tva as t";
|
||||
|
||||
@@ -182,6 +182,7 @@ class CommActionRapport
|
||||
$sql.= " WHERE c.id=a.fk_action AND a.fk_user_author = u.rowid";
|
||||
$sql.= " AND a.datep BETWEEN '".$this->db->idate(dol_get_first_day($this->year,$this->month,false))."'";
|
||||
$sql.= " AND '".$this->db->idate(dol_get_last_day($this->year,$this->month,false))."'";
|
||||
$sql.= " AND a.entity = ".$conf->entity;
|
||||
$sql.= " ORDER BY a.datep DESC";
|
||||
|
||||
dol_syslog(get_class($this)."::_page sql=".$sql);
|
||||
|
||||
@@ -249,7 +249,7 @@ AddCreditNote=Créer facture avoir
|
||||
Deposit=Acompte
|
||||
Deposits=Acomptes
|
||||
DiscountFromCreditNote=Remise issue de l'avoir %s
|
||||
DiscountFromDeposit=Paiements issue de l'acompte %s
|
||||
DiscountFromDeposit=Paiement issu de l'acompte %s
|
||||
AbsoluteDiscountUse=Ce type de crédit ne peut s'utiliser que sur une facture non validée
|
||||
CreditNoteDepositUse=La facture doit être validée pour pouvoir utiliser ce type de crédit
|
||||
NewGlobalDiscount=Nouvelle ligne de déduction
|
||||
|
||||
@@ -53,7 +53,7 @@ class Project extends CommonObject
|
||||
var $statuts_short;
|
||||
var $statuts;
|
||||
var $oldcopy;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -147,7 +147,7 @@ class Project extends CommonObject
|
||||
dol_syslog(get_class($this)."::create error -2 " . $this->error, LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
//Update extrafield
|
||||
if (!$error) {
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||
@@ -204,9 +204,9 @@ class Project extends CommonObject
|
||||
$sql.= ", fk_soc = " . ($this->socid > 0 ? $this->socid : "null");
|
||||
$sql.= ", fk_statut = " . $this->statut;
|
||||
$sql.= ", public = " . ($this->public ? 1 : 0);
|
||||
$sql.= ", datec=" . ($this->date_c != '' ? $this->db->idate($this->date_c) : 'null');
|
||||
$sql.= ", dateo=" . ($this->date_start != '' ? $this->db->idate($this->date_start) : 'null');
|
||||
$sql.= ", datee=" . ($this->date_end != '' ? $this->db->idate($this->date_end) : 'null');
|
||||
$sql.= ", datec=" . ($this->date_c != '' ? "'".$this->db->idate($this->date_c)."'" : 'null');
|
||||
$sql.= ", dateo=" . ($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : 'null');
|
||||
$sql.= ", datee=" . ($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : 'null');
|
||||
$sql.= " WHERE rowid = " . $this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::Update sql=" . $sql, LOG_DEBUG);
|
||||
@@ -225,7 +225,7 @@ class Project extends CommonObject
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
|
||||
//Update extrafield
|
||||
if (!$error) {
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||
@@ -262,6 +262,7 @@ class Project extends CommonObject
|
||||
else
|
||||
{
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->error;
|
||||
dol_syslog(get_class($this)."::Update error -2 " . $this->error, LOG_ERR);
|
||||
$result = -2;
|
||||
}
|
||||
@@ -478,10 +479,10 @@ class Project extends CommonObject
|
||||
|
||||
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet_task_extrafields";
|
||||
$sql.= " WHERE fk_object IN (SELECT rowid FROM " . MAIN_DB_PREFIX . "projet_task WHERE fk_projet=" . $this->id . ")";
|
||||
|
||||
|
||||
dol_syslog(get_class($this) . "::delete sql=" . $sql, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
|
||||
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet_task";
|
||||
$sql.= " WHERE fk_projet=" . $this->id;
|
||||
|
||||
@@ -493,13 +494,13 @@ class Project extends CommonObject
|
||||
|
||||
dol_syslog(get_class($this) . "::delete sql=" . $sql, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
|
||||
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet_extrafields";
|
||||
$sql.= " WHERE fk_object=" . $this->id;
|
||||
|
||||
|
||||
dol_syslog(get_class($this) . "::delete sql=" . $sql, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
|
||||
if ($resql)
|
||||
{
|
||||
// We remove directory
|
||||
@@ -1277,7 +1278,7 @@ class Project extends CommonObject
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Build Select List of element associable to a project
|
||||
*
|
||||
@@ -1312,7 +1313,7 @@ class Project extends CommonObject
|
||||
$sql.= " WHERE ".$projectkey." is null";
|
||||
if (!empty($this->societe->id)) {
|
||||
$sql.= " AND fk_soc=".$this->societe->id;
|
||||
}
|
||||
}
|
||||
$sql.= " ORDER BY ref DESC";
|
||||
|
||||
dol_syslog(get_class($this).'::select_element sql='.$sql,LOG_DEBUG);
|
||||
@@ -1334,11 +1335,11 @@ class Project extends CommonObject
|
||||
$sellist .='</select>';
|
||||
}
|
||||
return $sellist ;
|
||||
|
||||
|
||||
$this->db->free($resql);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Associate element to a project
|
||||
*
|
||||
@@ -1349,7 +1350,7 @@ class Project extends CommonObject
|
||||
function update_element($TableName, $ElementSelectId)
|
||||
{
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX.$TableName;
|
||||
|
||||
|
||||
if ($TableName=="actioncomm")
|
||||
{
|
||||
$sql.= " SET fk_project=".$this->id;
|
||||
@@ -1360,17 +1361,17 @@ class Project extends CommonObject
|
||||
$sql.= " SET fk_projet=".$this->id;
|
||||
$sql.= " WHERE rowid=".$ElementSelectId;
|
||||
}
|
||||
|
||||
|
||||
dol_syslog(get_class($this)."::update_element sql=" . $sql, LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$this->error=$this->db->lasterror();
|
||||
$this->error=$this->db->lasterror();
|
||||
dol_syslog(get_class($this)."::update_element error : " . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}else {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user