Compare commits

...

42 Commits

Author SHA1 Message Date
Laurent Destailleur
7350331865 Prepare 10.0.6 2020-01-05 20:41:12 +01:00
Laurent Destailleur
cc4c2d8a0b Prepare 10.0.6 2020-01-05 20:39:45 +01:00
Laurent Destailleur
eca91af2ca Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 10.0 2020-01-04 14:21:56 +01:00
Laurent Destailleur
7853427bb1 FIX product with empty stock were not visible 2020-01-04 14:21:38 +01:00
Laurent Destailleur
0dafbd194f Merge pull request #12750 from OPEN-DSI/v10-fix-product-virtual-stock-stats-sending
FIX add product qty in shipment already sent (fix for option STOCK_CALCULATE_ON_SHIPMENT_CLOSE)
2020-01-03 20:56:59 +01:00
Laurent Destailleur
37f9307732 Update product.class.php 2020-01-03 20:53:49 +01:00
Laurent Destailleur
88d97104be Merge pull request #12789 from aspangaro/10.0_p32
FIX Some problems on conciliation with others modules
2020-01-03 20:47:33 +01:00
Laurent Destailleur
e178d38bf8 Merge pull request #12791 from ptocquin/patch-1
Update api_supplier_invoices.class.php
2020-01-03 20:42:55 +01:00
Laurent Destailleur
e83b71f271 Merge pull request #12787 from aspangaro/10.0_p30
FIX Loan card - Wrong language key used
2020-01-03 20:42:01 +01:00
Laurent Destailleur
b452fc8442 Merge pull request #12788 from aspangaro/10.0_p31
FIX typo on language key
2020-01-03 20:41:04 +01:00
Laurent Destailleur
2c141d57df Merge pull request #12790 from mapiolca/patch-18
FIX an issue that shows all entities stock
2020-01-03 20:40:44 +01:00
Pierre Tocquin
8a5f3d48f4 Update api_supplier_invoices.class.php
Correction test data 'date'  lors de la création d'une facture fournisseur. `array_keys` remplacé par `array_key_exists` dans la clause `if`. Cette clause est correcte dans api_invoices.class.php.
2020-01-03 19:18:24 +01:00
Pierre Ardoin
79458ac139 FIX an issue that shows all entities stock
Before : If products are shared between several entities, the stock of each entity are to add in this page (reassort.php)
 
Now : Each entity see only her stock and not other's stock.
2020-01-03 18:05:49 +01:00
Alexandre SPANGARO
f14aaf5e50 FIX Some problems on conciliation with others modules 2020-01-03 16:35:02 +01:00
Alexandre SPANGARO
93d87d581b FIX typo on language key 2020-01-03 14:56:49 +01:00
Alexandre SPANGARO
67316c9125 FIX Loan card - Wrong language key used 2020-01-03 14:38:25 +01:00
Laurent Destailleur
103f41f571 Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 10.0 2019-12-31 18:22:34 +01:00
Laurent Destailleur
d2efe1d427 Fix SQL injection on type parameter in list of events 2019-12-31 17:52:28 +01:00
Laurent Destailleur
31c5f4eb0b Merge pull request #12748 from OPEN-DSI/v10-fix-projet-element-linkto
FIX remove backward compatibility projectid and uses object id instead
2019-12-31 17:40:01 +01:00
Laurent Destailleur
ff1c96f985 Merge pull request #12753 from aspangaro/10.0_p9
FIX : Some issues on salary payment
2019-12-31 17:39:08 +01:00
Laurent Destailleur
4c6c8e172f Merge pull request #12784 from Dolibarr/revert-12751-v10-fix-html-form-margin-class
Revert "FIX class Facture undefined in displaying margin information"
2019-12-31 17:33:21 +01:00
Laurent Destailleur
08d0d63a04 FIX #12760 #12763 #12755 #12765 #12751 2019-12-31 17:30:27 +01:00
Laurent Destailleur
5cc0d26eae Revert "FIX class Facture undefined in displaying margin information" 2019-12-31 17:26:02 +01:00
Laurent Destailleur
10d6d00c17 Merge pull request #12749 from OPEN-DSI/v10-fix-admin-dict-transkey-not-defined
FIX var transkey not defined in input hidden
2019-12-30 22:01:16 +01:00
Laurent Destailleur
6e90e81be1 Merge pull request #12751 from OPEN-DSI/v10-fix-html-form-margin-class
FIX class Facture undefined in displaying margin information
2019-12-30 22:00:28 +01:00
Laurent Destailleur
b067653070 Merge pull request #12757 from aspangaro/10.0_p12
FIX Missing language key for MAIN_MAXTABS_IN_CARD
2019-12-30 21:59:32 +01:00
Laurent Destailleur
aa390b8c3c Merge pull request #12771 from tuxgasy/10.0_Fix_double_value_on_update_object
Fix decimal value on update object
2019-12-30 21:50:53 +01:00
Laurent Destailleur
e2c7ee7d09 Merge pull request #12772 from hregis/10.0_mc
FIX wrong var name and avoid warning
2019-12-30 21:48:56 +01:00
Laurent Destailleur
5a34874b0a Merge pull request #12752 from OPEN-DSI/v10-fix-project-element-task-urlnew
FIX url new for task time spent in project element tab
2019-12-30 21:47:26 +01:00
Laurent Destailleur
eb659ab68c Merge pull request #12755 from ATM-Marc/FIX_10.0_margin_error500
FIX: error 500 when getting margin info for objects other than invoices
2019-12-30 21:40:26 +01:00
Regis Houssin
71a2998118 FIX wrong var name and avoid warning 2019-12-30 15:36:09 +01:00
TuxGasy
c9cc6cbbea Fix decimal value on update object 2019-12-29 23:15:49 +01:00
Alexandre SPANGARO
a804208b32 Fix missing language key 2019-12-27 20:54:47 +01:00
Alexandre SPANGARO
9a7307eea8 FIX Missing language key for MAIN_MAXTABS_IN_CARD 2019-12-26 12:01:09 +01:00
Marc de Lima Lucio
c8dfc3d9fc FIX: error 500 when getting margin info for objects other than invoices 2019-12-24 16:09:29 +01:00
Alexandre SPANGARO
44400b7866 FIX : Some issues on salary payment 2019-12-24 07:22:25 +01:00
VESSILLER
792096ad08 FIX url new for task time spent in project element tab 2019-12-23 16:00:35 +01:00
VESSILLER
720146c45f FIX class Facture undefined in displaying margin information 2019-12-23 15:37:12 +01:00
VESSILLER
99e63ad507 FIX uses GETPOSTISSET instead of GETPOST for projectfield 2019-12-23 15:18:45 +01:00
VESSILLER
b0edd46494 FIX add product qty in shipment already sent 2019-12-23 15:07:26 +01:00
VESSILLER
e03222b831 FIX var transkey not defined in input hidden 2019-12-23 14:38:01 +01:00
VESSILLER
e7a5d26355 FIX remove backward compatibility projectid and uses object id instead 2019-12-23 14:25:54 +01:00
18 changed files with 118 additions and 49 deletions

View File

@@ -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

View File

@@ -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);

View File

@@ -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

View File

@@ -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)

View File

@@ -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

View File

@@ -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');
}

View File

@@ -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;

View File

@@ -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));

View File

@@ -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

View File

@@ -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

View File

@@ -982,3 +982,4 @@ PaymentInformation=Payment information
ValidFrom=Valid from
ValidUntil=Valid until
NoRecordedUsers=No users
More=More

View File

@@ -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

View File

@@ -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))

View File

@@ -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++;

View File

@@ -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'];
}

View File

@@ -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";

View File

@@ -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'];
}

View File

@@ -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>';
}