forked from Wavyzz/dolibarr
Compare commits
42 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7350331865 | ||
|
|
cc4c2d8a0b | ||
|
|
eca91af2ca | ||
|
|
7853427bb1 | ||
|
|
0dafbd194f | ||
|
|
37f9307732 | ||
|
|
88d97104be | ||
|
|
e178d38bf8 | ||
|
|
e83b71f271 | ||
|
|
b452fc8442 | ||
|
|
2c141d57df | ||
|
|
8a5f3d48f4 | ||
|
|
79458ac139 | ||
|
|
f14aaf5e50 | ||
|
|
93d87d581b | ||
|
|
67316c9125 | ||
|
|
103f41f571 | ||
|
|
d2efe1d427 | ||
|
|
31c5f4eb0b | ||
|
|
ff1c96f985 | ||
|
|
4c6c8e172f | ||
|
|
08d0d63a04 | ||
|
|
5cc0d26eae | ||
|
|
10d6d00c17 | ||
|
|
6e90e81be1 | ||
|
|
b067653070 | ||
|
|
aa390b8c3c | ||
|
|
e2c7ee7d09 | ||
|
|
5a34874b0a | ||
|
|
eb659ab68c | ||
|
|
71a2998118 | ||
|
|
c9cc6cbbea | ||
|
|
a804208b32 | ||
|
|
9a7307eea8 | ||
|
|
c8dfc3d9fc | ||
|
|
44400b7866 | ||
|
|
792096ad08 | ||
|
|
720146c45f | ||
|
|
99e63ad507 | ||
|
|
b0edd46494 | ||
|
|
e03222b831 | ||
|
|
e7a5d26355 |
19
ChangeLog
19
ChangeLog
@@ -2,6 +2,25 @@
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
***** ChangeLog for 10.0.6 compared to 10.0.5 *****
|
||||
FIX Regression of 10.0.5 to create/edit proposals and orders.
|
||||
FIX: #12760 #12763 #12755 #12765 #12751
|
||||
FIX: add product qty in shipment already sent (fix for option STOCK_CALCULATE_ON_SHIPMENT_NEW)
|
||||
FIX: an issue that shows all entities stock
|
||||
FIX: class Facture undefined in displaying margin information
|
||||
FIX: error 500 when getting margin info for objects other than invoices
|
||||
FIX: Loan card - Wrong language key used
|
||||
FIX: Missing language key for MAIN_MAXTABS_IN_CARD
|
||||
FIX: product with empty stock were not visible
|
||||
FIX: remove backward compatibility projectid and uses object id instead
|
||||
FIX: Some issues on salary payment
|
||||
FIX: Some problems on conciliation with others modules
|
||||
FIX: typo on language key
|
||||
FIX: url new for task time spent in project element tab
|
||||
FIX: uses GETPOSTISSET instead of GETPOST for projectfield
|
||||
FIX: var transkey not defined in input hidden
|
||||
FIX: wrong var name and avoid warning
|
||||
|
||||
***** ChangeLog for 10.0.5 compared to 10.0.4 *****
|
||||
FIX: 10.0: add URL param "restore_last_search_values=1" to all backlinks pointing to lists
|
||||
FIX: 10.0: do not display single-letter values (indicating duration unit without value) in product list
|
||||
|
||||
@@ -1985,9 +1985,9 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
if (in_array($fieldlist[$field], array('libelle', 'label', 'tracking'))) $class='quatrevingtpercent';
|
||||
print '<td class="'.$classtd.'">';
|
||||
$transfound=0;
|
||||
$transkey='';
|
||||
if (in_array($fieldlist[$field], array('label','libelle')))
|
||||
{
|
||||
$transkey='';
|
||||
// Special case for labels
|
||||
if ($tabname == MAIN_DB_PREFIX.'c_civility') {
|
||||
$transkey="Civility".strtoupper($obj->code);
|
||||
|
||||
@@ -301,7 +301,7 @@ if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc I
|
||||
if ($socid > 0) $sql.= " AND s.rowid = ".$socid;
|
||||
// We must filter on assignement table
|
||||
if ($filtert > 0 || $usergroup > 0) $sql.= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'";
|
||||
if ($type) $sql.= " AND c.id = ".$type;
|
||||
if ($type) $sql.= " AND c.id = ".(int) $type;
|
||||
if ($status == '0') { $sql.= " AND a.percent = 0"; }
|
||||
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
|
||||
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
|
||||
|
||||
@@ -37,12 +37,15 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/don/class/paymentdonation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/loan/class/paymentloan.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php';
|
||||
//show files
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("banks","categories","companies","bills","trips"));
|
||||
$langs->loadLangs(array("banks","categories","companies","bills","trips","donations","loan"));
|
||||
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$id=GETPOST('account', 'int');
|
||||
@@ -363,7 +366,10 @@ $paymentsupplierstatic=new PaiementFourn($db);
|
||||
$paymentvatstatic=new TVA($db);
|
||||
$bankstatic=new Account($db);
|
||||
$banklinestatic=new AccountLine($db);
|
||||
$remisestatic = new RemiseCheque($db);
|
||||
$remisestatic=new RemiseCheque($db);
|
||||
$paymentdonationstatic=new PaymentDonation($db);
|
||||
$paymentloanstatic=new PaymentLoan($db);
|
||||
$paymentvariousstatic=new PaymentVarious($db);
|
||||
|
||||
// Must be before button action
|
||||
$param='';
|
||||
@@ -668,6 +674,27 @@ else
|
||||
print '</a>';
|
||||
$newline=0;
|
||||
}
|
||||
elseif ($links[$key]['type']=='payment_donation')
|
||||
{
|
||||
$paymentdonationstatic->id=$links[$key]['url_id'];
|
||||
$paymentdonationstatic->ref=$langs->trans("Payment");
|
||||
print ' '.$paymentdonationstatic->getNomUrl(1);
|
||||
$newline = 0;
|
||||
}
|
||||
elseif ($links[$key]['type']=='payment_loan')
|
||||
{
|
||||
$paymentloanstatic->id=$links[$key]['url_id'];
|
||||
$paymentloanstatic->ref=$langs->trans("Payment");
|
||||
print ' '.$paymentloanstatic->getNomUrl(1);
|
||||
$newline = 0;
|
||||
}
|
||||
elseif ($links[$key]['type']=='payment_various')
|
||||
{
|
||||
$paymentvariousstatic->id=$links[$key]['url_id'];
|
||||
$paymentvariousstatic->ref=$langs->trans("Payment");
|
||||
print ' '.$paymentvariousstatic->getNomUrl(1);
|
||||
$newline = 0;
|
||||
}
|
||||
elseif ($links[$key]['type']=='banktransfert') {
|
||||
// Do not show link to transfer since there is no transfer card (avoid confusion). Can already be accessed from transaction detail.
|
||||
if ($objp->amount > 0)
|
||||
|
||||
@@ -44,6 +44,12 @@ $id=GETPOST("id", 'int');
|
||||
$action=GETPOST('action', 'aZ09');
|
||||
$cancel= GETPOST('cancel', 'aZ09');
|
||||
$projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : GETPOST('fk_project', 'int'));
|
||||
$accountid = GETPOST('accountid', 'int') > 0 ? GETPOST('accountid', 'int') : 0;
|
||||
|
||||
$datep = dol_mktime(12, 0, 0, GETPOST("datepmonth", 'int'), GETPOST("datepday", 'int'), GETPOST("datepyear", 'int'));
|
||||
$datev = dol_mktime(12, 0, 0, GETPOST("datevmonth", 'int'), GETPOST("datevday", 'int'), GETPOST("datevyear", 'int'));
|
||||
$datesp = dol_mktime(12, 0, 0, GETPOST("datespmonth", 'int'), GETPOST("datespday", 'int'), GETPOST("datespyear", 'int'));
|
||||
$dateep = dol_mktime(12, 0, 0, GETPOST("dateepmonth", 'int'), GETPOST("dateepday", 'int'), GETPOST("dateepyear", 'int'));
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST("socid", "int");
|
||||
@@ -71,34 +77,30 @@ if ($cancel)
|
||||
if ($action == 'classin' && $user->rights->banque->modifier)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$object->setProject(GETPOST('projectid'));
|
||||
$object->setProject($projectid);
|
||||
}
|
||||
|
||||
if ($action == 'add' && empty($cancel))
|
||||
{
|
||||
$error=0;
|
||||
|
||||
$datep=dol_mktime(12, 0, 0, GETPOST("datepmonth", 'int'), GETPOST("datepday", 'int'), GETPOST("datepyear", 'int'));
|
||||
$datev=dol_mktime(12, 0, 0, GETPOST("datevmonth", 'int'), GETPOST("datevday", 'int'), GETPOST("datevyear", 'int'));
|
||||
$datesp=dol_mktime(12, 0, 0, GETPOST("datespmonth", 'int'), GETPOST("datespday", 'int'), GETPOST("datespyear", 'int'));
|
||||
$dateep=dol_mktime(12, 0, 0, GETPOST("dateepmonth", 'int'), GETPOST("dateepday", 'int'), GETPOST("dateepyear", 'int'));
|
||||
if (empty($datev)) $datev=$datep;
|
||||
|
||||
$type_payment = dol_getIdFromCode($db, GETPOST("paymenttype", 'alpha'), 'c_paiement', 'code', 'id', 1);
|
||||
|
||||
$object->accountid=GETPOST("accountid") > 0 ? GETPOST("accountid", "int") : 0;
|
||||
$object->fk_user=GETPOST("fk_user") > 0 ? GETPOST("fk_user", "int") : 0;
|
||||
$object->accountid=GETPOST("accountid", "int") > 0 ? GETPOST("accountid", "int") : 0;
|
||||
$object->fk_user=GETPOST("fk_user", "int") > 0 ? GETPOST("fk_user", "int") : 0;
|
||||
$object->datev=$datev;
|
||||
$object->datep=$datep;
|
||||
$object->amount=price2num(GETPOST("amount"));
|
||||
$object->label=GETPOST("label");
|
||||
$object->amount=price2num(GETPOST("amount", "alpha"));
|
||||
$object->label=GETPOST("label", "alphanohtml");
|
||||
$object->datesp=$datesp;
|
||||
$object->dateep=$dateep;
|
||||
$object->note=GETPOST("note");
|
||||
$object->note=GETPOST("note", "none");
|
||||
$object->type_payment=($type_payment > 0 ? $type_payment : 0);
|
||||
$object->num_payment=GETPOST("num_payment");
|
||||
$object->num_payment=GETPOST("num_payment", "alphanohtml");
|
||||
$object->fk_user_author=$user->id;
|
||||
$object->fk_project= GETPOST('fk_project', 'int');
|
||||
$object->fk_project= $projectid;
|
||||
|
||||
// Set user current salary as ref salaray for the payment
|
||||
$fuser=new User($db);
|
||||
@@ -303,7 +305,7 @@ if ($action == 'create')
|
||||
|
||||
print '<tr><td>'.$langs->trans("Project").'</td><td>';
|
||||
|
||||
$numproject=$formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1);
|
||||
$formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1);
|
||||
|
||||
print '</td></tr>';
|
||||
}
|
||||
@@ -313,14 +315,14 @@ if ($action == 'create')
|
||||
{
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).'</td><td>';
|
||||
$form->select_comptes($_POST["accountid"], "accountid", 0, '', 1); // Affiche liste des comptes courant
|
||||
$form->select_comptes($accountid, "accountid", 0, '', 1); // Affiche liste des comptes courant
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Type payment
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey('PaymentMode', 'selectpaymenttype', '', $object, 0, 'string', '', 1).'</td><td>';
|
||||
$form->select_types_paiements(GETPOST("paymenttype"), "paymenttype", '', 2);
|
||||
$form->select_types_paiements(GETPOST("paymenttype", "aZ09"), "paymenttype", '', 2);
|
||||
print '</td></tr>';
|
||||
|
||||
// Number
|
||||
|
||||
@@ -113,8 +113,8 @@ if ($action == 'update' && ! empty($permissiontoadd))
|
||||
$value = dol_mktime(12, 0, 0, GETPOST($key.'month'), GETPOST($key.'day'), GETPOST($key.'year'));
|
||||
} elseif ($object->fields[$key]['type']=='datetime') {
|
||||
$value = dol_mktime(GETPOST($key.'hour'), GETPOST($key.'min'), 0, GETPOST($key.'month'), GETPOST($key.'day'), GETPOST($key.'year'));
|
||||
} elseif ($object->fields[$key]['type']=='price') {
|
||||
$value = price2num(GETPOST($key));
|
||||
} elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) {
|
||||
$value = price2num(GETPOST($key, 'none')); // To fix decimal separator according to lang setup
|
||||
} else {
|
||||
$value = GETPOST($key, 'alpha');
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (c) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (c) 2015-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
@@ -98,7 +98,7 @@ class FormMargin
|
||||
|
||||
$pv = $line->total_ht;
|
||||
$pa_ht = ($pv < 0 ? - $line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign
|
||||
if ($object->type == Facture::TYPE_SITUATION) {
|
||||
if ($object->element == 'facture' && $object->type == $object::TYPE_SITUATION) {
|
||||
$pa = $line->qty * $pa_ht * ($line->situation_percent / 100);
|
||||
} else {
|
||||
$pa = $line->qty * $pa_ht;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr');
|
||||
if (! defined('DOL_VERSION')) define('DOL_VERSION', '10.0.5'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
|
||||
if (! defined('DOL_VERSION')) define('DOL_VERSION', '10.0.6'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
|
||||
|
||||
if (! defined('EURO')) define('EURO', chr(128));
|
||||
|
||||
|
||||
@@ -200,7 +200,7 @@ class SupplierInvoices extends DolibarrApi
|
||||
foreach($request_data as $field => $value) {
|
||||
$this->invoice->$field = $value;
|
||||
}
|
||||
if(! array_keys($request_data, 'date')) {
|
||||
if(! array_key_exists('date', $request_data)) {
|
||||
$this->invoice->date = dol_now();
|
||||
}
|
||||
/* We keep lines as an array
|
||||
|
||||
@@ -84,4 +84,5 @@ ForProposals=Proposals
|
||||
LastXMonthRolling=The latest %s month rolling
|
||||
ChooseBoxToAdd=Add widget to your dashboard
|
||||
BoxAdded=Widget was added in your dashboard
|
||||
BoxTitleUserBirthdaysOfMonth=Birthdays of this month
|
||||
BoxTitleUserBirthdaysOfMonth=Birthdays of this month
|
||||
BoxBirthdays=Birthdays of this month
|
||||
|
||||
@@ -982,3 +982,4 @@ PaymentInformation=Payment information
|
||||
ValidFrom=Valid from
|
||||
ValidUntil=Valid until
|
||||
NoRecordedUsers=No users
|
||||
More=More
|
||||
|
||||
@@ -56,7 +56,7 @@ Notify_BILL_SUPPLIER_PAYED=Vendor invoice paid
|
||||
Notify_BILL_SUPPLIER_SENTBYMAIL=Vendor invoice sent by mail
|
||||
Notify_BILL_SUPPLIER_CANCELED=Vendor invoice cancelled
|
||||
Notify_CONTRACT_VALIDATE=Contract validated
|
||||
Notify_FICHEINTER_VALIDATE=Intervention validated
|
||||
Notify_FICHINTER_VALIDATE=Intervention validated
|
||||
Notify_FICHINTER_ADD_CONTACT=Added contact to Intervention
|
||||
Notify_FICHINTER_SENTBYMAIL=Intervention sent by mail
|
||||
Notify_SHIPPING_VALIDATE=Shipping validated
|
||||
@@ -269,4 +269,4 @@ WEBSITE_KEYWORDS=Keywords
|
||||
LinesToImport=Lines to import
|
||||
|
||||
MemoryUsage=Memory usage
|
||||
RequestDuration=Duration of request
|
||||
RequestDuration=Duration of request
|
||||
|
||||
@@ -624,7 +624,7 @@ if ($id > 0)
|
||||
else
|
||||
{
|
||||
print '<td class="nowrap">';
|
||||
print $langs->trans("LoanAccountancyCapitalCode");
|
||||
print $langs->trans("LoanAccountancyInsuranceCode");
|
||||
print '</td><td>';
|
||||
|
||||
if (! empty($conf->accounting->enabled))
|
||||
|
||||
@@ -135,7 +135,7 @@ if ($action == 'convert')
|
||||
$newlevel=$level;
|
||||
|
||||
//print "$objectstatic->id $newprice, $price_base_type, $newvat, $newminprice, $newlevel, $newnpr<br>\n";
|
||||
$retm=$objectstatic->updatePrice($newprice, $price_base_type, $user, $newvatratclean, $newminprice, $newlevel, $newnpr, 0, 0, $localtaxes_type, $newdefaultvatcode);
|
||||
$retm=$objectstatic->updatePrice($newprice, $price_base_type, $user, $newvatrateclean, $newminprice, $newlevel, $newnpr, 0, 0, $localtaxes_type, $newdefaultvatcode);
|
||||
if ($retm < 0)
|
||||
{
|
||||
$error++;
|
||||
|
||||
@@ -1859,6 +1859,9 @@ class Product extends CommonObject
|
||||
if (empty($newnpr)) {
|
||||
$newnpr=0;
|
||||
}
|
||||
if (empty($newminprice)) {
|
||||
$newminprice=0;
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
if ($newvat == '') {
|
||||
@@ -2633,12 +2636,13 @@ class Product extends CommonObject
|
||||
/**
|
||||
* Charge tableau des stats expedition client pour le produit/service
|
||||
*
|
||||
* @param int $socid Id societe pour filtrer sur une societe
|
||||
* @param string $filtrestatut Id statut pour filtrer sur un statut
|
||||
* @param int $forVirtualStock Ignore rights filter for virtual stock calculation.
|
||||
* @return array Tableau des stats
|
||||
* @param int $socid Id societe pour filtrer sur une societe
|
||||
* @param string $filtrestatut [=''] Ids order status separated by comma
|
||||
* @param int $forVirtualStock Ignore rights filter for virtual stock calculation.
|
||||
* @param string $filterShipmentStatus [=''] Ids shipment status separated by comma
|
||||
* @return int <0 if KO, >0 if OK (Tableau des stats)
|
||||
*/
|
||||
public function load_stats_sending($socid = 0, $filtrestatut = '', $forVirtualStock = 0)
|
||||
public function load_stats_sending($socid = 0, $filtrestatut = '', $forVirtualStock = 0, $filterShipmentStatus = '')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$user;
|
||||
@@ -2668,6 +2672,7 @@ class Product extends CommonObject
|
||||
if ($filtrestatut <> '') {
|
||||
$sql.= " AND c.fk_statut in (".$filtrestatut.")";
|
||||
}
|
||||
if (!empty($filterShipmentStatus)) $sql.= " AND e.fk_statut IN (" . $filterShipmentStatus . ")";
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result ) {
|
||||
@@ -4461,7 +4466,14 @@ class Product extends CommonObject
|
||||
}
|
||||
if (! empty($conf->expedition->enabled))
|
||||
{
|
||||
$result=$this->load_stats_sending(0, '1,2', 1);
|
||||
require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php';
|
||||
$filterShipmentStatus = '';
|
||||
if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) {
|
||||
$filterShipmentStatus = Expedition::STATUS_VALIDATED . ',' . Expedition::STATUS_CLOSED;
|
||||
} elseif (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
|
||||
$filterShipmentStatus = Expedition::STATUS_CLOSED;
|
||||
}
|
||||
$result = $this->load_stats_sending(0, '1,2', 1, $filterShipmentStatus);
|
||||
if ($result < 0) dol_print_error($this->db, $this->error);
|
||||
$stock_sending_client=$this->stats_expedition['qty'];
|
||||
}
|
||||
|
||||
@@ -123,6 +123,7 @@ $sql.= ' SUM(s.reel) as stock_physique';
|
||||
if (! empty($conf->global->PRODUCT_USE_UNITS)) $sql.= ', u.short_label as unit_short';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'product as p';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s on p.rowid = s.fk_product';
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot as e on s.fk_entrepot = e.rowid AND e.entity IN ('.getEntity('entrepot').')';
|
||||
if (! empty($conf->global->PRODUCT_USE_UNITS)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_units as u on p.fk_unit = u.rowid';
|
||||
// We'll need this table joined to the select in order to filter by categ
|
||||
if ($search_categ) $sql.= ", ".MAIN_DB_PREFIX."categorie_product as cp";
|
||||
|
||||
@@ -666,8 +666,15 @@ if ($id > 0 || $ref)
|
||||
|
||||
// Number of product from customer order already sent (partial shipping)
|
||||
if (!empty($conf->expedition->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php';
|
||||
$filterShipmentStatus = '';
|
||||
if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) {
|
||||
$filterShipmentStatus = Expedition::STATUS_VALIDATED . ',' . Expedition::STATUS_CLOSED;
|
||||
} elseif (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
|
||||
$filterShipmentStatus = Expedition::STATUS_CLOSED;
|
||||
}
|
||||
if ($found) $helpondiff .= '<br>'; else $found = 1;
|
||||
$result = $object->load_stats_sending(0, '2', 1);
|
||||
$result = $object->load_stats_sending(0, '2', 1, $filterShipmentStatus);
|
||||
$helpondiff .= $langs->trans("ProductQtyInShipmentAlreadySent") . ': ' . $object->stats_expedition['qty'];
|
||||
}
|
||||
|
||||
|
||||
@@ -83,17 +83,16 @@ if (! isset($_POST['datesrfc']) && ! isset($_POST['datesday']) && ! empty($conf-
|
||||
//$dates=dol_time_plus_duree($datee, -1, 'y');
|
||||
$dates=dol_get_first_day($tmp['year'], 1);
|
||||
}
|
||||
if ($id == '' && $projectid == '' && $ref == '')
|
||||
if ($id == '' && $ref == '')
|
||||
{
|
||||
dol_print_error('', 'Bad parameter');
|
||||
exit;
|
||||
setEventMessage($langs->trans('ErrorBadParameters'), 'errors');
|
||||
header('Location: list.php');
|
||||
exit();
|
||||
}
|
||||
|
||||
$mine = $_REQUEST['mode']=='mine' ? 1 : 0;
|
||||
//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects
|
||||
|
||||
$projectid=$id; // For backward compatibility
|
||||
|
||||
$object = new Project($db);
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
||||
@@ -102,7 +101,7 @@ if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($ob
|
||||
// Security check
|
||||
$socid=$object->socid;
|
||||
//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
|
||||
$result = restrictedArea($user, 'projet', $projectid, 'projet&project');
|
||||
$result = restrictedArea($user, 'projet', $object->id, 'projet&project');
|
||||
|
||||
$hookmanager->initHooks(array('projectOverview'));
|
||||
|
||||
@@ -436,7 +435,7 @@ $listofreferent=array(
|
||||
'table'=>'projet_task',
|
||||
'datefieldname'=>'task_date',
|
||||
'disableamount'=>0,
|
||||
'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?id='.$id,
|
||||
'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&action=createtime&projectid='.$id,
|
||||
'buttonnew'=>'AddTimeSpent',
|
||||
'testnew'=>$user->rights->projet->creer,
|
||||
'test'=>($conf->projet->enabled && $user->rights->projet->lire && empty($conf->global->PROJECT_HIDE_TASKS))),
|
||||
@@ -513,7 +512,7 @@ elseif ($action == "unlink")
|
||||
{
|
||||
|
||||
$tablename = GETPOST("tablename", "aZ09");
|
||||
$projectField = GETPOST("projectfield", "aZ09");
|
||||
$projectField = GETPOSTISSET('projectfield') ? GETPOST('projectfield', 'aZ09') : 'fk_projet';
|
||||
$elementselectid = GETPOST("elementselect", "int");
|
||||
|
||||
$result = $object->remove_element($tablename, $elementselectid, $projectField);
|
||||
@@ -532,7 +531,7 @@ $showdatefilter=0;
|
||||
if (! $showdatefilter)
|
||||
{
|
||||
print '<div class="center centpercent">';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$projectid.'" method="post">';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id=' . $object->id . '" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION["newtoken"].'">';
|
||||
print '<input type="hidden" name="tablename" value="'.$tablename.'">';
|
||||
print '<input type="hidden" name="action" value="view">';
|
||||
@@ -755,7 +754,7 @@ foreach ($listofreferent as $key => $value)
|
||||
if (empty($conf->global->PROJECT_LINK_ON_OVERWIEW_DISABLED) && $idtofilterthirdparty && !in_array($tablename, $exclude_select_element))
|
||||
{
|
||||
$selectList=$formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth300', -2, !empty($project_field)?$project_field:'fk_projet');
|
||||
if (! $selectList || ($selectList<0))
|
||||
if ($selectList<0)
|
||||
{
|
||||
setEventMessages($formproject->error, $formproject->errors, 'errors');
|
||||
}
|
||||
@@ -763,7 +762,7 @@ foreach ($listofreferent as $key => $value)
|
||||
{
|
||||
// Define form with the combo list of elements to link
|
||||
$addform.='<div class="inline-block valignmiddle">';
|
||||
$addform.='<form action="'.$_SERVER["PHP_SELF"].'?id='.$projectid.'" method="post">';
|
||||
$addform.='<form action="'.$_SERVER["PHP_SELF"].'?id=' . $object->id . '" method="post">';
|
||||
$addform.='<input type="hidden" name="token" value="'.$_SESSION["newtoken"].'">';
|
||||
$addform.='<input type="hidden" name="tablename" value="'.$tablename.'">';
|
||||
$addform.='<input type="hidden" name="action" value="addelement">';
|
||||
@@ -890,7 +889,7 @@ foreach ($listofreferent as $key => $value)
|
||||
{
|
||||
if (empty($conf->global->PROJECT_DISABLE_UNLINK_FROM_OVERVIEW) || $user->admin) // PROJECT_DISABLE_UNLINK_FROM_OVERVIEW is empty by defaut, so this test true
|
||||
{
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $projectid . '&action=unlink&tablename=' . $tablename . '&elementselect=' . $element->id . ($project_field ? '&projectfield=' . $project_field : '') . '" class="reposition">';
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=unlink&tablename=' . $tablename . '&elementselect=' . $element->id . ($project_field ? '&projectfield=' . $project_field : '') . '" class="reposition">';
|
||||
print img_picto($langs->trans('Unlink'), 'unlink');
|
||||
print '</a>';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user