diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php
index 41498ff586d..66ce09e5310 100644
--- a/htdocs/accountancy/bookkeeping/list.php
+++ b/htdocs/accountancy/bookkeeping/list.php
@@ -483,6 +483,10 @@ if (empty($reshook)) {
setEventMessages($object->error, $object->errors, 'errors');
$error++;
break;
+ } elseif (isset($object->date_validation) || $object->date_validation != '') {
+ setEventMessages($langs->trans("ValidatedRecordWhereFound"), null, 'errors');
+ $error++;
+ break;
}
}
}
diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php
index 3e4055510cd..7b87db12c32 100644
--- a/htdocs/accountancy/bookkeeping/listbyaccount.php
+++ b/htdocs/accountancy/bookkeeping/listbyaccount.php
@@ -447,6 +447,10 @@ if (empty($reshook)) {
setEventMessages($object->error, $object->errors, 'errors');
$error++;
break;
+ } elseif (isset($object->date_validation) || $object->date_validation != '') {
+ setEventMessages($langs->trans("ValidatedRecordWhereFound"), null, 'errors');
+ $error++;
+ break;
}
}
}
diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php
index 48a3e6891cc..75503e8cca9 100644
--- a/htdocs/accountancy/class/bookkeeping.class.php
+++ b/htdocs/accountancy/class/bookkeeping.class.php
@@ -807,7 +807,7 @@ class BookKeeping extends CommonObject
$this->piece_num = $obj->piece_num;
$this->date_creation = $this->db->jdate($obj->date_creation);
$this->date_export = $this->db->jdate($obj->date_export);
- $this->date_validation = isset($obj->date_validated) ? $this->db->jdate($obj->date_validated) : '';
+ $this->date_validation = isset($obj->date_validation) ? $this->db->jdate($obj->date_validation) : '';
}
$this->db->free($resql);
diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php
index 1a43efcdd02..72c0aa505d6 100644
--- a/htdocs/commande/class/api_orders.class.php
+++ b/htdocs/commande/class/api_orders.class.php
@@ -156,16 +156,15 @@ class Orders extends DolibarrApi
* @param int $page Page number
* @param string $thirdparty_ids Thirdparty ids to filter orders of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
+ * @param string $sqlfilterlines Other criteria to filter answers separated by a comma. Syntax example "(tl.fk_product:=:'17') and (tl.price:<:'250')"
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
* @return array Array of order objects
*
* @throws RestException 404 Not found
* @throws RestException 503 Error
*/
- public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '')
+ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $sqlfilterlines = '', $properties = '')
{
- global $db, $conf;
-
if (!DolibarrApiAccess::$user->hasRight('commande', 'lire')) {
throw new RestException(401);
}
@@ -213,7 +212,16 @@ class Orders extends DolibarrApi
throw new RestException(400, 'Error when validating parameter sqlfilters -> '.$errormessage);
}
}
-
+ // Add sql filters for lines
+ if ($sqlfilterlines) {
+ $errormessage = '';
+ $sql .= " AND EXISTS (SELECT tl.rowid FROM ".MAIN_DB_PREFIX."commandedet AS tl WHERE tl.fk_commande = t.rowid";
+ $sql .= forgeSQLFromUniversalSearchCriteria($sqlfilterlines, $errormessage);
+ $sql .= ")";
+ if ($errormessage) {
+ throw new RestException(400, 'Error when validating parameter sqlfilterlines -> '.$errormessage);
+ }
+ }
$sql .= $this->db->order($sortfield, $sortorder);
if ($limit) {
if ($page < 0) {
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 069de0018b1..bbc1346a1c4 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -5252,6 +5252,7 @@ if ($action == 'create') {
print dol_print_date($dateofpayment, 'dayhour', 'tzuser');
}
print '';
+
$label = ($langs->trans("PaymentType".$objp->payment_code) != ("PaymentType".$objp->payment_code)) ? $langs->trans("PaymentType".$objp->payment_code) : $objp->payment_label;
print '
'.dol_escape_htmltag($label.' '.$objp->num_payment).' | ';
if (isModEnabled("banque")) {
@@ -5277,7 +5278,10 @@ if ($action == 'create') {
}
print ''.price($sign * $objp->amount).' | ';
print '';
- if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $user->socid == 0) {
+
+ $paiement = new Paiement($db);
+ $paiement->fetch($objp->rowid);
+ if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $user->socid == 0 && !$paiement->isReconciled()) {
print 'id.'&action=deletepayment&token='.newToken().'&paiement_id='.$objp->rowid.'">';
print img_delete();
print '';
diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php
index 6f95b6237bc..6fd6d438002 100644
--- a/htdocs/compta/paiement/class/paiement.class.php
+++ b/htdocs/compta/paiement/class/paiement.class.php
@@ -1398,4 +1398,17 @@ class Paiement extends CommonObject
return parent::fetch_thirdparty($force_thirdparty_id);
}
+
+
+ /**
+ * Return if payment is reconciled
+ *
+ * @return boolean True if payment is reconciled
+ */
+ public function isReconciled()
+ {
+ $accountline = new AccountLine($this->db);
+ $accountline->fetch($this->bank_line);
+ return $accountline->rappro;
+ }
}
diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php
index ee23d52ae99..eb19526e858 100644
--- a/htdocs/compta/sociales/payments.php
+++ b/htdocs/compta/sociales/payments.php
@@ -288,7 +288,7 @@ while ($i < min($num, $limit)) {
print $socialcontrib->getNomUrl(1, '');
print ' | ';
// Type
- print ''.$obj->label_sc.' | ';
+ print ''.$obj->type_label.' | ';
// Date
$date = $obj->periode;
if (empty($date)) {
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index d8807b9bca9..1be9ec5323a 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -123,7 +123,7 @@ class Contact extends CommonObject
'priv' =>array('type'=>'smallint(6)', 'label'=>'ContactVisibility', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>175),
'fk_stcommcontact' =>array('type'=>'integer', 'label'=>'ProspectStatus', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>220),
'fk_prospectcontactlevel' =>array('type'=>'varchar(12)', 'label'=>'ProspectLevel', 'enabled'=>1, 'visible'=>-1, 'position'=>255),
- 'no_email' =>array('type'=>'smallint(6)', 'label'=>'No_Email', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>180),
+ //no more used. Replace by a scan of email into mailing_unsubscribe. 'no_email' =>array('type'=>'smallint(6)', 'label'=>'No_Email', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>180),
'note_private' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>3, 'position'=>195, 'searchall'=>1),
'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>3, 'position'=>200, 'searchall'=>1),
'default_lang' =>array('type'=>'varchar(6)', 'label'=>'Default lang', 'enabled'=>1, 'visible'=>3, 'position'=>205),
@@ -243,6 +243,7 @@ class Contact extends CommonObject
/**
* Unsubscribe all : 1 = contact has globally unsubscribed of all mass emailing
* @var int
+ * @deprecated Has been replaced by a search into llx_mailing_unsubscribe
*/
public $no_email;
diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php
index 2d1299e502b..4b2de3b6262 100644
--- a/htdocs/core/actions_sendmails.inc.php
+++ b/htdocs/core/actions_sendmails.inc.php
@@ -378,7 +378,7 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO
$action = 'presend';
} else {
$result = $mailfile->sendfile();
- if ($result >= 0) {
+ if ($result) {
// Initialisation of datas of object to call trigger
if (is_object($object)) {
if (empty($actiontypecode)) {
diff --git a/htdocs/core/actions_setnotes.inc.php b/htdocs/core/actions_setnotes.inc.php
index 44fd5754e22..6ce9d3b08b3 100644
--- a/htdocs/core/actions_setnotes.inc.php
+++ b/htdocs/core/actions_setnotes.inc.php
@@ -81,7 +81,7 @@ if ($action == 'setnote_public' && !empty($permissionnote) && !GETPOST('cancel',
if (empty($object->id)) {
$object->fetch($id); // Fetch may not be already done
}
- $result = $object->update_note(dol_html_entity_decode(GETPOST('note_private', 'restricthtml'), ENT_QUOTES | ENT_HTML5), '_private');
+ $result = $object->update_note(dol_html_entity_decode(GETPOST('note_private', 'restricthtml'), ENT_QUOTES | ENT_HTML5, 'UTF-8', 1), '_private');
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php
index 0cfc5eed6d3..d72f0bea0f0 100644
--- a/htdocs/core/class/CMailFile.class.php
+++ b/htdocs/core/class/CMailFile.class.php
@@ -1217,7 +1217,6 @@ class CMailFile
}
error_reporting($errorlevel); // Reactive niveau erreur origine
-
return $res;
}
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index d8ba9353af9..90b4276c535 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -2137,7 +2137,7 @@ abstract class CommonObject
}
// For backward compatibility
- if ($this->table_element == 'facture_rec' && $fieldid == 'title') {
+ if (in_array($this->table_element, array('facture_rec', 'facture_fourn_rec')) && $fieldid == 'title') {
$fieldid = 'titre';
}
@@ -3468,9 +3468,10 @@ abstract class CommonObject
*
* @param string $note New value for note
* @param string $suffix '', '_public' or '_private'
+ * @param int $notrigger 1=Does not execute triggers, 0=execute triggers
* @return int <0 if KO, >0 if OK
*/
- public function update_note($note, $suffix = '')
+ public function update_note($note, $suffix = '', $notrigger = 0)
{
// phpcs:enable
global $user;
@@ -3514,6 +3515,32 @@ abstract class CommonObject
$this->note = $note; // deprecated
$this->note_private = $note;
}
+ if(empty($notrigger)) {
+ switch($this->element) {
+ case 'societe':
+ $trigger_name = 'COMPANY_MODIFY';
+ break;
+ case 'commande':
+ $trigger_name = 'ORDER_MODIFY';
+ break;
+ case 'facture':
+ $trigger_name = 'BILL_MODIFY';
+ break;
+ case 'invoice_supplier':
+ $trigger_name = 'BILL_SUPPLIER_MODIFY';
+ break;
+ case 'facturerec':
+ $trigger_name = 'BILLREC_MODIFIY';
+ break;
+ case 'expensereport':
+ $trigger_name = 'EXPENSE_REPORT_MODIFY';
+ break;
+ default:
+ $trigger_name = strtoupper($this->element) . '_MODIFY';
+ }
+ $ret = $this->call_trigger($trigger_name, $user);
+ if($ret < 0 ) { return -1; }
+ }
return 1;
} else {
$this->error = $this->db->lasterror();
diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php
index 636a4ef4907..479417cc32f 100644
--- a/htdocs/core/lib/date.lib.php
+++ b/htdocs/core/lib/date.lib.php
@@ -789,6 +789,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '',
$sql = "SELECT code, entity, fk_country, dayrule, year, month, day, active";
$sql .= " FROM ".MAIN_DB_PREFIX."c_hrm_public_holiday";
$sql .= " WHERE active = 1 and fk_country IN (0".($country_id > 0 ? ", ".$country_id : 0).")";
+ $sql .= " AND entity IN (0," .getEntity('holiday') .")";
$resql = $db->query($sql);
if ($resql) {
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index fbd9bc1a143..bc4ff82d72c 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -223,7 +223,9 @@ function isModEnabled($module)
'bank' => 'banque',
'category' => 'categorie',
'contract' => 'contrat',
- 'project' => 'projet'
+ 'project' => 'projet',
+ 'bank' => 'banque',
+ 'category' => 'categorie'
);
if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) {
$arrayconv['supplier_order'] = 'fournisseur';
diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index 412535d0691..cc9a03ca441 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -932,7 +932,8 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
// Extra fields
$extrafieldsobjectkey = $taskstatic->table_element;
- $obj = $lines[$i];
+ $extrafieldsobjectprefix = 'efpt.';
+ $obj = $lines[$i]->obj;
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$lines[$i]);
@@ -1113,7 +1114,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
// Check if Extrafields is totalizable
if (!empty($extrafields->attributes['projet_task']['totalizable'])) {
foreach ($extrafields->attributes['projet_task']['totalizable'] as $key => $value) {
- if (!empty($arrayfields['ef.'.$key]['checked']) && $arrayfields['ef.'.$key]['checked'] == 1) {
+ if (!empty($arrayfields['efpt.'.$key]['checked']) && $arrayfields['ef.'.$key]['checked'] == 1) {
print '';
if ($value == 1) {
print empty($totalarray['totalizable'][$key]['total']) ? '' : $totalarray['totalizable'][$key]['total'];
diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php
index 16da9c88def..b993e26283d 100644
--- a/htdocs/core/modules/modStock.class.php
+++ b/htdocs/core/modules/modStock.class.php
@@ -160,6 +160,13 @@ class modStock extends DolibarrModules
$this->rights[6][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[6][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
+ $this->rights[6][0] = 1013;
+ $this->rights[6][1] = 'inventoryDeletePermission'; // Permission label
+ $this->rights[6][3] = 0; // Permission by default for new user (0/1)
+ $this->rights[6][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
+ $this->rights[6][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
+
+
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
$this->rights[8][0] = 1014;
$this->rights[8][1] = 'inventoryValidatePermission'; // Permission label
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index 71987efca9a..d667cd795dd 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -1609,6 +1609,10 @@ class Expedition extends CommonObject
$this->total_localtax1 = 0;
$this->total_localtax2 = 0;
+ $this->multicurrency_total_ht = 0;
+ $this->multicurrency_total_tva = 0;
+ $this->multicurrency_total_ttc = 0;
+
$shipmentlinebatch = new ExpeditionLineBatch($this->db);
while ($i < $num) {
@@ -1699,10 +1703,14 @@ class Expedition extends CommonObject
// Multicurrency
$this->fk_multicurrency = $obj->fk_multicurrency;
$this->multicurrency_code = $obj->multicurrency_code;
- $this->multicurrency_subprice = $obj->multicurrency_subprice;
- $this->multicurrency_total_ht = $obj->multicurrency_total_ht;
- $this->multicurrency_total_tva = $obj->multicurrency_total_tva;
- $this->multicurrency_total_ttc = $obj->multicurrency_total_ttc;
+ $line->multicurrency_subprice = $obj->multicurrency_subprice;
+ $line->multicurrency_total_ht = $obj->multicurrency_total_ht;
+ $line->multicurrency_total_tva = $obj->multicurrency_total_tva;
+ $line->multicurrency_total_ttc = $obj->multicurrency_total_ttc;
+
+ $this->multicurrency_total_ht += $obj->multicurrency_total_ht;
+ $this->multicurrency_total_tva += $obj->multicurrency_total_tva;
+ $this->multicurrency_total_ttc += $obj->multicurrency_total_ttc;
if ($originline != $obj->fk_origin_line) {
$line->detail_batch = array();
diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php
index 3dad6ca8a9e..34748782386 100644
--- a/htdocs/fourn/class/api_supplier_orders.class.php
+++ b/htdocs/fourn/class/api_supplier_orders.class.php
@@ -93,15 +93,14 @@ class SupplierOrders extends DolibarrApi
* @param string $product_ids Product ids to filter orders of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
* @param string $status Filter by order status : draft | validated | approved | running | received_start | received_end | cancelled | refused
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'20160101')"
+ * @param string $sqlfilterlines Other criteria to filter answers separated by a comma. Syntax example "(tl.fk_product:=:'17') and (tl.price:<:'250')"
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
* @return array Array of order objects
*
* @throws RestException
*/
- public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $product_ids = '', $status = '', $sqlfilters = '', $properties = '')
+ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $product_ids = '', $status = '', $sqlfilters = '', $sqlfilterlines = '', $properties = '')
{
- global $db, $conf;
-
if (!DolibarrApiAccess::$user->hasRight("fournisseur", "commande", "lire")) {
throw new RestException(401);
}
@@ -179,6 +178,16 @@ class SupplierOrders extends DolibarrApi
throw new RestException(400, 'Error when validating parameter sqlfilters -> '.$errormessage);
}
}
+ // Add sql filters for lines
+ if ($sqlfilterlines) {
+ $errormessage = '';
+ $sql .= " AND EXISTS (SELECT tl.rowid FROM ".MAIN_DB_PREFIX."commande_fournisseurdet AS tl WHERE tl.fk_commande = t.rowid";
+ $sql .= forgeSQLFromUniversalSearchCriteria($sqlfilterlines, $errormessage);
+ $sql .= ")";
+ if ($errormessage) {
+ throw new RestException(400, 'Error when validating parameter sqlfilterlines -> '.$errormessage);
+ }
+ }
$sql .= $this->db->order($sortfield, $sortorder);
if ($limit) {
diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php
index 373441b0136..b905a699c53 100644
--- a/htdocs/fourn/class/fournisseur.facture-rec.class.php
+++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php
@@ -1306,6 +1306,7 @@ class FactureFournisseurRec extends CommonInvoice
}
$saventity = $conf->entity;
+ $laststep="None";
while ($i < $num) { // Loop on each template invoice. If $num = 0, test is false at first pass.
$line = $this->db->fetch_object($resql);
@@ -1316,6 +1317,7 @@ class FactureFournisseurRec extends CommonInvoice
$new_fac_fourn = null;
$facturerec = new FactureFournisseurRec($this->db);
+ $laststep="Fetch {$line->rowid}";
$facturerec->fetch($line->rowid);
if ($facturerec->id > 0) {
@@ -1341,6 +1343,7 @@ class FactureFournisseurRec extends CommonInvoice
$new_fac_fourn->libelle = $facturerec->label; // deprecated
$invoiceidgenerated = $new_fac_fourn->create($user);
+ $laststep="Create invoiceidgenerated $invoiceidgenerated";
if ($invoiceidgenerated <= 0) {
$this->errors = $new_fac_fourn->errors;
$this->error = $new_fac_fourn->error;
@@ -1348,6 +1351,7 @@ class FactureFournisseurRec extends CommonInvoice
}
if (!$error && ($facturerec->auto_validate || $forcevalidation)) {
$result = $new_fac_fourn->validate($user);
+ $laststep="Validate by user $user";
if ($result <= 0) {
$this->errors = $new_fac_fourn->errors;
$this->error = $new_fac_fourn->error;
@@ -1357,7 +1361,9 @@ class FactureFournisseurRec extends CommonInvoice
if (!$error && $facturerec->generate_pdf) {
// We refresh the object in order to have all necessary data (like date_lim_reglement)
+ $laststep="Refresh {$new_fac_fourn->id}";
$new_fac_fourn->fetch($new_fac_fourn->id);
+ $laststep="GenerateDocument {$new_fac_fourn->id}";
$result = $new_fac_fourn->generateDocument($facturerec->model_pdf, $langs);
if ($result < 0) {
$this->errors = $new_fac_fourn->errors;
@@ -1382,7 +1388,7 @@ class FactureFournisseurRec extends CommonInvoice
$nb_create++;
$this->output .= $langs->trans('InvoiceGeneratedFromTemplate', $new_fac_fourn->ref, $facturerec->title)."\n";
} else {
- $this->db->rollback('createRecurringInvoices Process invoice template id=' .$facturerec->id. ', title=' .$facturerec->title);
+ $this->db->rollback('createRecurringInvoices Process invoice template error='.$error.' invoiceidgenerated='.$invoiceidgenerated.' LastStep='.$laststep.' id=' .$facturerec->id. ', title=' .$facturerec->title);
}
$parameters = array(
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 71024d6cd82..72e5005a3e4 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -1108,6 +1108,7 @@ class FactureFournisseur extends CommonInvoice
return 1;
} else {
$this->error = $this->db->error();
+ dol_syslog(get_class($this)."::fetch_lines - No lines:{$this->error} Error:{$this->error}", LOG_DEBUG);
return -3;
}
}
diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php
index dfc7e4be621..f587bc6e8f2 100644
--- a/htdocs/fourn/class/paiementfourn.class.php
+++ b/htdocs/fourn/class/paiementfourn.class.php
@@ -909,17 +909,4 @@ class PaiementFourn extends Paiement
return parent::fetch_thirdparty($force_thirdparty_id);
}
-
-
- /**
- * Return if payment is reconciled
- *
- * @return boolean True if payment is reconciled
- */
- public function isReconciled()
- {
- $accountline = new AccountLine($this->db);
- $accountline->fetch($this->bank_line);
- return $accountline->rappro;
- }
}
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index d00cb01f02b..e26767dd815 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -407,7 +407,7 @@ if (empty($reshook)) {
}
// Add a product line
- if ($action == 'addline' && GETPOST('submitforalllines', 'aZ09') && GETPOST('vatforalllines', 'alpha') && $usercancreate) {
+ if ($action == 'addline' && GETPOST('submitforalllines', 'aZ09') && GETPOST('vatforalllines', 'alpha') !== '' && $usercancreate) {
// Define new vat_rate for all lines
$vat_rate = (GETPOST('vatforalllines') ? GETPOST('vatforalllines') : 0);
$vat_rate = str_replace('*', '', $vat_rate);
diff --git a/htdocs/index.php b/htdocs/index.php
index 6901fed16fb..c3ff57ded4d 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -205,7 +205,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
$dashboardlines[$board->element.'_signed'] = $board->load_board($user, "signed");
}
- // Number of sales orders a deal
+ // Number of sales orders
if (isModEnabled('commande') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->hasRight('commande', 'lire')) {
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$board = new Commande($db);
@@ -219,7 +219,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
$dashboardlines[$board->element.'_shippedtobill'] = $board->load_board($user, 'shippedtobill');
}
- // Number of suppliers orders a deal
+ // Number of suppliers orders
if (isModEnabled('supplier_order') && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && $user->hasRight('fournisseur', 'commande', 'lire')) {
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
$board = new CommandeFournisseur($db);
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 8d0026d3857..6a226c69e30 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -725,6 +725,7 @@ RecordModifiedSuccessfully=Record modified successfully
RecordsModified=%s record(s) modified
RecordsDeleted=%s record(s) deleted
RecordsGenerated=%s record(s) generated
+ValidatedRecordWhereFound = Some of the selected records have already been validated. No records have been deleted.
AutomaticCode=Automatic code
FeatureDisabled=Feature disabled
MoveBox=Move widget
diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang
index 4035d17d1b3..8e60cbbba56 100644
--- a/htdocs/langs/en_US/products.lang
+++ b/htdocs/langs/en_US/products.lang
@@ -354,6 +354,7 @@ PackagingForThisProductDesc=You will automatically purchase a multiple of this q
QtyRecalculatedWithPackaging=The quantity of the line were recalculated according to supplier packaging
#Attributes
+Attributes=Attributes
VariantAttributes=Variant attributes
ProductAttributes=Variant attributes for products
ProductAttributeName=Variant attribute %s
diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang
index bb36f5d7a9a..54c3f7a5a1c 100644
--- a/htdocs/langs/en_US/stocks.lang
+++ b/htdocs/langs/en_US/stocks.lang
@@ -334,4 +334,4 @@ ConfirmDeleteBatch=Are you sure you want to delete lot/serial ?
WarehouseUsage=Warehouse usage
InternalWarehouse=Internal warehouse
ExternalWarehouse=External warehouse
-
+WarningThisWIllAlsoDeleteStock=Warning, this will also destroy all quantities in stock in the warehouse
diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang
index eb5f6a7655f..8a4c6ab2584 100644
--- a/htdocs/langs/fr_FR/main.lang
+++ b/htdocs/langs/fr_FR/main.lang
@@ -725,6 +725,7 @@ RecordModifiedSuccessfully=Enregistrement modifié avec succès
RecordsModified=%s enregistrements modifiés
RecordsDeleted=%s enregistrement(s) supprimé(s)
RecordsGenerated=%s enregistrement(s) généré(s)
+ValidatedRecordWhereFound = Certains des enregistrements sélectionnés ont déjà été validés. Aucun enregistrement n'a été supprimé.
AutomaticCode=Création automatique du code
FeatureDisabled=Fonction désactivée
MoveBox=Déplacer le widget
diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang
index 0438b46a111..67215702075 100644
--- a/htdocs/langs/fr_FR/products.lang
+++ b/htdocs/langs/fr_FR/products.lang
@@ -354,6 +354,7 @@ PackagingForThisProductDesc=Vous achèterez automatiquement un multiple de cette
QtyRecalculatedWithPackaging=La quantité de la ligne a été recalculée en fonction de l'emballage du fournisseur
#Attributes
+Attributes=Attributs
VariantAttributes=Attributs de variante
ProductAttributes=Attributs de variantes pour les produits
ProductAttributeName=Attribut de variante %s
diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php
index 5f42266d617..4827f170cbe 100644
--- a/htdocs/product/inventory/card.php
+++ b/htdocs/product/inventory/card.php
@@ -93,7 +93,7 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
} else {
$permissiontoread = $user->rights->stock->inventory_advance->read;
$permissiontoadd = $user->rights->stock->inventory_advance->write;
- $permissiontodelete = $user->rights->stock->inventory_advance->write;
+ $permissiontodelete = $user->rights->stock->inventory_advance->delete;
$permissionnote = $user->rights->stock->inventory_advance->write; // Used by the include of actions_setnotes.inc.php
$permissiondellink = $user->rights->stock->inventory_advance->write; // Used by the include of actions_dellink.inc.php
$upload_dir = $conf->stock->multidir_output[isset($object->entity) ? $object->entity : 1];
diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php
index d95d70fa39c..bbc9e020834 100644
--- a/htdocs/product/inventory/inventory.php
+++ b/htdocs/product/inventory/inventory.php
@@ -97,11 +97,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
//$result = restrictedArea($user, 'mymodule', $id);
//Parameters Page
-$param = '&id='.$object->id;
+$paramwithsearch = '';
if ($limit > 0 && $limit != $conf->liste_limit) {
- $param .= '&limit='.((int) $limit);
+ $paramwithsearch .= '&limit='.((int) $limit);
}
-$paramwithsearch = $param;
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
@@ -459,7 +458,7 @@ if ($action == 'clone') {
// Confirmation to close
if ($action == 'record') {
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('Close'), $langs->trans('ConfirmFinish'), 'update', '', 0, 1);
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&page='.$page.$paramwithsearch, $langs->trans('Close'), $langs->trans('ConfirmFinish'), 'update', '', 0, 1);
$action = 'view';
}
@@ -598,13 +597,13 @@ if ($action != 'record') {
// Save
if ($object->status == $object::STATUS_VALIDATED) {
if ($permissiontoadd) {
- print 'id.'&action=record&token='.newToken().'" title="'.dol_escape_htmltag($langs->trans("MakeMovementsAndClose")).'">'.$langs->trans("MakeMovementsAndClose").''."\n";
+ print 'id.'&action=record&page='.$page.$paramwithsearch.'&token='.newToken().'" title="'.dol_escape_htmltag($langs->trans("MakeMovementsAndClose")).'">'.$langs->trans("MakeMovementsAndClose").''."\n";
} else {
print ''.$langs->trans('MakeMovementsAndClose').''."\n";
}
if ($permissiontoadd) {
- print 'id.'&action=confirm_cancel&token='.newToken().'">'.$langs->trans("Cancel").''."\n";
+ print 'id.'&action=confirm_cancel&page='.$page.$paramwithsearch.'&token='.newToken().'">'.$langs->trans("Cancel").''."\n";
}
}
}
@@ -1005,7 +1004,7 @@ if ($resql) {
$num = $db->num_rows($resql);
if (!empty($limit != 0) || $num > $limit || $page) {
- print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num >= $limit), '', '', $limit);
+ print_fleche_navigation($page, $_SERVER["PHP_SELF"], '&id='.$object->id.$paramwithsearch, ($num >= $limit), '', '', $limit);
}
$i = 0;
@@ -1221,38 +1220,38 @@ print ' |