mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 09:08:09 +01:00
Compare commits
55 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1ecc1afa9e | ||
|
|
ceb1e699b7 | ||
|
|
c028819cab | ||
|
|
9d582a53ca | ||
|
|
ca1e3b4d55 | ||
|
|
94bb1ac511 | ||
|
|
8893d8d59f | ||
|
|
e61bcd03ed | ||
|
|
3295498e9e | ||
|
|
71818da6a5 | ||
|
|
c53aef9955 | ||
|
|
a18995d3dc | ||
|
|
3017e2b3a0 | ||
|
|
adbb41799c | ||
|
|
12d7b92556 | ||
|
|
6fb0fc7b71 | ||
|
|
f694939fc7 | ||
|
|
d0d9de37f4 | ||
|
|
1bfdc7438a | ||
|
|
9352ecca1f | ||
|
|
774c624687 | ||
|
|
5439390461 | ||
|
|
6fc4dacd42 | ||
|
|
b970596310 | ||
|
|
38ccf7ffdd | ||
|
|
290caba160 | ||
|
|
c01988ba43 | ||
|
|
797b68fc20 | ||
|
|
90e8f062e9 | ||
|
|
f49552f6b7 | ||
|
|
39f35bbaab | ||
|
|
321933f267 | ||
|
|
f49d332b73 | ||
|
|
46d84f8f11 | ||
|
|
97e21cb775 | ||
|
|
829ff2299e | ||
|
|
f516660c0f | ||
|
|
73f0159578 | ||
|
|
7acc14903c | ||
|
|
57a8e053b4 | ||
|
|
3dbab863a7 | ||
|
|
be493fcf09 | ||
|
|
5e7c72068d | ||
|
|
2a4517e1bc | ||
|
|
e4da87d31c | ||
|
|
fe71c0cb2d | ||
|
|
a814e02d53 | ||
|
|
6a944bb6a3 | ||
|
|
87e8ac51be | ||
|
|
ffd486e3d6 | ||
|
|
45dfb8ca62 | ||
|
|
298e5cee61 | ||
|
|
b7b18e3355 | ||
|
|
b19b624908 | ||
|
|
56245e2c9a |
@@ -126,10 +126,10 @@ before_script:
|
||||
echo "Set timezone"
|
||||
echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||
if [ "$TRAVIS_PHP_VERSION" = '5.3' ] || [ "$TRAVIS_PHP_VERSION" = '5.4' ]; then
|
||||
echo
|
||||
echo "Enabling APC for PHP <= 5.4"
|
||||
#echo
|
||||
#echo "Enabling APC for PHP <= 5.4"
|
||||
# Documentation says it should be available for PHP <= 5.6 but it's not for 5.5 and 5.6!
|
||||
echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||
#echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||
echo
|
||||
echo "Enabling Memcached for PHP <= 5.4"
|
||||
# Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0 and nightly!
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2006-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
@@ -592,17 +592,19 @@ class Categorie extends CommonObject
|
||||
{
|
||||
if ($this->db->num_rows($resql) > 0)
|
||||
{
|
||||
$objparent = $this->db->fetch_object($resql);
|
||||
$objparent = $this->db->fetch_object($resql);
|
||||
|
||||
if (!empty($objparent->fk_parent))
|
||||
{
|
||||
$cat = new Categorie($this->db);
|
||||
$cat->id=$objparent->fk_parent;
|
||||
$result=$cat->add_type($obj, $type);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error=$cat->error;
|
||||
$error++;
|
||||
$cat->id = $objparent->fk_parent;
|
||||
if (!$cat->containsObject($type, $obj->id)) {
|
||||
$result = $cat->add_type($obj, $type);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error = $cat->error;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -919,7 +919,14 @@ if (count($listofextcals))
|
||||
// Complete $eventarray with events coming from external module
|
||||
$parameters=array(); $object=null;
|
||||
$reshook=$hookmanager->executeHooks('getCalendarEvents',$parameters,$object,$action);
|
||||
if (! empty($hookmanager->resArray['eventarray'])) $eventarray=array_merge($eventarray, $hookmanager->resArray['eventarray']);
|
||||
if (! empty($hookmanager->resArray['eventarray'])) {
|
||||
foreach ($hookmanager->resArray['eventarray'] as $keyDate => $events) {
|
||||
if (!isset($eventarray[$keyDate])) {
|
||||
$eventarray[$keyDate]=array();
|
||||
}
|
||||
$eventarray[$keyDate]=array_merge($eventarray[$keyDate], $events);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -87,6 +87,17 @@ if ($action == 'delete')
|
||||
{
|
||||
if (GETPOST('categid'))
|
||||
{
|
||||
// Delete bank class
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class";
|
||||
$sql.= " WHERE fk_categ = '".GETPOST('categid')."'";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if (!$result)
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
// Delete bank categ
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_categ";
|
||||
$sql.= " WHERE rowid = '".GETPOST('categid')."'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
@@ -282,6 +282,8 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
||||
$refcomp=$societestatic->getNomUrl(1,'',24);
|
||||
|
||||
$paiement = $facturestatic->getSommePaiement(); // Payment already done
|
||||
$paiement+= $facturestatic->getSumDepositsUsed();
|
||||
$paiement+= $facturestatic->getSumCreditNotesUsed();
|
||||
}
|
||||
if ($obj->family == 'social_contribution')
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2012-2014 Charles-François BENKE <charles.fr@benke.fr>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2016 Juan José 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
|
||||
@@ -79,8 +80,10 @@ class box_project extends ModeleBoxes
|
||||
|
||||
$sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut ";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
if($user->socid) $sql.= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=p.fk_soc";
|
||||
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||
$sql.= " AND p.fk_statut = 1"; // Seulement les projets ouverts
|
||||
if($user->socid) $sql.= " AND s.rowid = ".$user->socid;
|
||||
$sql.= " AND p.fk_statut = 1"; // Seulement les projets ouverts
|
||||
$sql.= " ORDER BY p.datec DESC";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
|
||||
|
||||
@@ -127,13 +127,15 @@ class FormProjets
|
||||
// Search all projects
|
||||
$sql = 'SELECT p.rowid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX .'projet as p';
|
||||
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||
$sql.= " WHERE p.entity IN (".getEntity('project',1).")";
|
||||
if ($projectsListId !== false) $sql.= " AND p.rowid IN (".$projectsListId.")";
|
||||
if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
|
||||
if ($socid > 0) $sql.= " AND (p.fk_soc=".$socid." OR p.fk_soc IS NULL)";
|
||||
if (!empty($filterkey)) {
|
||||
$sql .= ' AND p.title LIKE "%'.$this->db->escape($filterkey).'%"';
|
||||
$sql .= ' AND (';
|
||||
$sql .= ' p.title LIKE "%'.$this->db->escape($filterkey).'%"';
|
||||
$sql .= ' OR p.ref LIKE "%'.$this->db->escape($filterkey).'%"';
|
||||
$sql .= ')';
|
||||
}
|
||||
$sql.= " ORDER BY p.ref ASC";
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2013 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2014 Cédric GROSS <c.gross@kreiz-it.fr>
|
||||
@@ -3170,7 +3170,7 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
|
||||
{
|
||||
if ($local == 1)
|
||||
{
|
||||
if(! $mysoc->localtax1_assuj) return 0;
|
||||
if(! $mysoc->localtax1_assuj || $tva=="0") return 0;
|
||||
if ($thirdparty_seller->id==$mysoc->id)
|
||||
{
|
||||
if (! $thirdparty_buyer->localtax1_assuj) return 0;
|
||||
@@ -3183,7 +3183,7 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
|
||||
|
||||
if ($local == 2)
|
||||
{
|
||||
if(! $mysoc->localtax2_assuj) return 0;
|
||||
if(! $mysoc->localtax2_assuj || $tva=="0") return 0;
|
||||
if ($thirdparty_seller->id==$mysoc->id )
|
||||
{
|
||||
if (! $thirdparty_buyer->localtax2_assuj) return 0;
|
||||
|
||||
@@ -211,7 +211,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$hookmanager->initHooks(array('pdfgeneration'));
|
||||
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
||||
global $action;
|
||||
$reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||
$reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
$nblignes = count($object->lines);
|
||||
|
||||
|
||||
@@ -527,13 +527,14 @@ class PaymentExpenseReport extends CommonObject
|
||||
{
|
||||
if ($mode == 'payment_expensereport')
|
||||
{
|
||||
$euser = new User($this->db);
|
||||
$euser->fetch($key);
|
||||
$er = new ExpenseReport($this->db);
|
||||
$er->fetch($key);
|
||||
$er->fetch_user($er->fk_user_author);
|
||||
$result=$acc->add_url_line(
|
||||
$bank_line_id,
|
||||
$euser->id,
|
||||
$er->user->id,
|
||||
DOL_URL_ROOT.'/user/card.php?id=',
|
||||
$euser->getFullName($langs),
|
||||
$er->user->getFullName($langs),
|
||||
'user'
|
||||
);
|
||||
if ($result <= 0)
|
||||
|
||||
@@ -131,11 +131,11 @@ class Export
|
||||
//print_r("$perm[0]-$perm[1]-$perm[2]<br>");
|
||||
if (! empty($perm[2]))
|
||||
{
|
||||
$bool=$user->rights->$perm[0]->$perm[1]->$perm[2];
|
||||
$bool=$user->rights->{$perm[0]}->{$perm[1]}->{$perm[2]};
|
||||
}
|
||||
else
|
||||
{
|
||||
$bool=$user->rights->$perm[0]->$perm[1];
|
||||
$bool=$user->rights->{$perm[0]}->{$perm[1]};
|
||||
}
|
||||
if ($perm[0]=='user' && $user->admin) $bool=true;
|
||||
if (! $bool) break;
|
||||
|
||||
@@ -950,6 +950,8 @@ class CommandeFournisseur extends CommonOrder
|
||||
{
|
||||
$result = 1;
|
||||
$this->log($user, 3, $date, $comment);
|
||||
$this->date_commande = $date;
|
||||
$this->methode_commande = $methode;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1049,6 +1051,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
$this->lines[$i]->remise_percent,
|
||||
'HT',
|
||||
0,
|
||||
$this->lines[$i]->product_type,
|
||||
$this->lines[$i]->info_bits
|
||||
);
|
||||
if ($result < 0)
|
||||
|
||||
@@ -62,6 +62,21 @@ ALTER TABLE llx_societe MODIFY COLUMN fk_currency varchar(3) NULL;
|
||||
ALTER TABLE llx_bookmark ADD COLUMN entity integer DEFAULT 1 NOT NULL;
|
||||
ALTER TABLE llx_bookmark MODIFY COLUMN url varchar(255) NOT NULL;
|
||||
|
||||
|
||||
-- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT '2001-01-01 00:00:00';
|
||||
|
||||
-- Clean corrupted values for tms
|
||||
-- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES';
|
||||
-- VMYSQL4.1 update llx_opensurvey_sondage set tms = date_fin where DATE(STR_TO_DATE(tms, '%Y-%m-%d')) IS NULL;
|
||||
-- VMYSQL4.1 SET sql_mode = 'NO_ZERO_DATE';
|
||||
-- VMYSQL4.1 update llx_opensurvey_sondage set tms = date_fin where DATE(STR_TO_DATE(tms, '%Y-%m-%d')) IS NULL;
|
||||
-- Remove default not null on date_fin
|
||||
-- VMYSQL4.3 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN date_fin DATETIME NULL DEFAULT NULL;
|
||||
-- VPGSQL8.2 ALTER TABLE llx_opensurvey_sondage ALTER COLUMN date_fin DROP NOT NULL;
|
||||
|
||||
-- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP;
|
||||
|
||||
|
||||
ALTER TABLE llx_opensurvey_sondage ADD COLUMN entity integer DEFAULT 1 NOT NULL;
|
||||
ALTER TABLE llx_opensurvey_sondage ADD COLUMN allow_comments tinyint NOT NULL DEFAULT 1;
|
||||
-- ALTER TABLE llx_opensurvey_sondage DROP COLUMN survey_link_visible;
|
||||
@@ -189,9 +204,14 @@ CREATE TABLE llx_payment_salary (
|
||||
fk_user_modif integer
|
||||
)ENGINE=innodb;
|
||||
|
||||
|
||||
DELETE FROM llx_product_batch where fk_product_stock NOT IN (SELECT rowid from llx_product_stock);
|
||||
|
||||
ALTER TABLE llx_product_batch ADD INDEX idx_fk_product_stock (fk_product_stock);
|
||||
ALTER TABLE llx_product_batch ADD CONSTRAINT fk_product_batch_fk_product_stock FOREIGN KEY (fk_product_stock) REFERENCES llx_product_stock (rowid);
|
||||
|
||||
DELETE FROM llx_expeditiondet_batch where fk_expeditiondet NOT IN (SELECT rowid from llx_expeditiondet);
|
||||
|
||||
ALTER TABLE llx_expeditiondet_batch ADD INDEX idx_fk_expeditiondet (fk_expeditiondet);
|
||||
ALTER TABLE llx_expeditiondet_batch ADD CONSTRAINT fk_expeditiondet_batch_fk_expeditiondet FOREIGN KEY (fk_expeditiondet) REFERENCES llx_expeditiondet(rowid);
|
||||
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
--
|
||||
-- Be carefull to requests order.
|
||||
-- This file must be loaded by calling /install/index.php page
|
||||
-- when current version is 3.9.0 or higher.
|
||||
--
|
||||
-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new;
|
||||
-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol;
|
||||
-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60);
|
||||
-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname;
|
||||
-- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60);
|
||||
-- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name;
|
||||
-- To restrict request to Mysql version x.y use -- VMYSQLx.y
|
||||
-- To restrict request to Pgsql version x.y use -- VPGSQLx.y
|
||||
-- To make pk to be auto increment (mysql): VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
|
||||
-- To make pk to be auto increment (postgres): VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE
|
||||
-- To set a field as NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL;
|
||||
-- To set a field as default NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL;
|
||||
-- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user);
|
||||
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
|
||||
|
||||
-- Fix bad data
|
||||
update llx_opensurvey_sondage set format = 'D' where format = 'D+';
|
||||
update llx_opensurvey_sondage set format = 'A' where format = 'A+';
|
||||
|
||||
INSERT INTO llx_const (name, value, type, note, visible) values ('MAIN_DELAY_EXPENSEREPORTS_TO_PAY','31','chaine','Tolérance de retard avant alerte (en jours) sur les notes de frais impayées',0);
|
||||
|
||||
ALTER TABLE llx_accounting_system MODIFY COLUMN pcg_version varchar(32);
|
||||
ALTER TABLE llx_accountingaccount MODIFY COLUMN fk_pcg_version varchar(32);
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ create table llx_product
|
||||
|
||||
datec datetime,
|
||||
tms timestamp,
|
||||
virtual tinyint DEFAULT 0 NOT NULL, -- Not used. Used by external modules. Value 0 for physical product, 1 for virtual product
|
||||
`virtual` tinyint DEFAULT 0 NOT NULL, -- Not used. Used by external modules. Value 0 for physical product, 1 for virtual product
|
||||
fk_parent integer DEFAULT 0, -- Not used. Used by external modules. Virtual product id
|
||||
|
||||
label varchar(255) NOT NULL,
|
||||
|
||||
@@ -576,6 +576,7 @@ MailSentBy=Email sent by
|
||||
TextUsedInTheMessageBody=Email body
|
||||
SendAcknowledgementByMail=Send Ack. by email
|
||||
NoEMail=No email
|
||||
Email=Email
|
||||
NoMobilePhone=No mobile phone
|
||||
Owner=Owner
|
||||
DetectedVersion=Detected version
|
||||
|
||||
@@ -152,7 +152,7 @@ if ($socid > 0)
|
||||
$sql.= ", ".MAIN_DB_PREFIX."facturedet as d";
|
||||
$sql.= " WHERE f.fk_soc = s.rowid";
|
||||
$sql.= " AND f.fk_statut > 0";
|
||||
$sql.= " AND s.entity = ".$conf->entity;
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
$sql.= " AND d.fk_facture = f.rowid";
|
||||
$sql.= " AND f.fk_soc = $socid";
|
||||
$sql.= " AND d.buy_price_ht IS NOT NULL";
|
||||
|
||||
@@ -876,10 +876,26 @@ class Product extends CommonObject
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
// Delete all child tables
|
||||
// Delete from product_batch on product delete
|
||||
if (! $error)
|
||||
{
|
||||
$elements = array('product_fournisseur_price','product_price','product_lang','categorie_product','product_stock','product_customer_price');
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.'product_batch';
|
||||
$sql.= " WHERE fk_product_stock IN (";
|
||||
$sql.= "SELECT rowid FROM ".MAIN_DB_PREFIX.'product_stock';
|
||||
$sql.= " WHERE fk_product = ".$id.")";
|
||||
dol_syslog(get_class($this).'::delete', LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
if (! $result)
|
||||
{
|
||||
$error++;
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
}
|
||||
}
|
||||
|
||||
// Delete all child tables
|
||||
if (! $error)
|
||||
{
|
||||
$elements = array('product_fournisseur_price','product_price','product_lang','categorie_product','product_stock','product_customer_price'); // product_batch done before
|
||||
foreach($elements as $table)
|
||||
{
|
||||
if (! $error)
|
||||
|
||||
Reference in New Issue
Block a user