diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 1a43a999ea1..d01ad89293f 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1883,7 +1883,7 @@ class BookKeeping extends CommonObject $sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,'; $sql .= ' numero_compte, label_compte, label_operation, debit, credit,'; $sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, '.((int) $next_piecenum).", '".$this->db->idate($now)."'"; - $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity); + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND numero_compte IS NOT NULL AND entity = ' .((int) $conf->entity); $resql = $this->db->query($sql); if (!$resql) { $error++; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index fc1f12afa04..05949d09fce 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1517,6 +1517,7 @@ class Propal extends CommonObject $sql = "SELECT p.rowid, p.ref, p.entity, p.remise, p.remise_percent, p.remise_absolue, p.fk_soc"; $sql .= ", p.total_ttc, p.total_tva, p.localtax1, p.localtax2, p.total_ht"; $sql .= ", p.datec"; + $sql .= ", p.date_signature as dates"; $sql .= ", p.date_valid as datev"; $sql .= ", p.datep as dp"; $sql .= ", p.fin_validite as dfv"; @@ -1600,6 +1601,7 @@ class Propal extends CommonObject $this->date_creation = $this->db->jdate($obj->datec); //Creation date $this->date_validation = $this->db->jdate($obj->datev); //Validation date $this->date_modification = $this->db->jdate($obj->date_modification); // tms + $this->date_signature = $this->db->jdate($obj->dates); // Signature date $this->date = $this->db->jdate($obj->dp); // Proposal date $this->datep = $this->db->jdate($obj->dp); // deprecated $this->fin_validite = $this->db->jdate($obj->dfv); diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index b94655fbc14..5acc6b22ee2 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1468,6 +1468,7 @@ if (!$error && ($massaction == 'approveleave' || ($action == 'approveleave' && $ $trackid = 'leav'.$objecttmp->id; + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 0, '', '', $trackid); // Sending email diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index b6acbbbfbc9..94fb05d5346 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -597,7 +597,7 @@ class CMailFile } $sendingmode = $this->sendmode; - if ($this->context == 'emailing' && !empty($conf->global->MAILING_NO_USING_PHPMAIL) && $sendingmode == 'mail') { + if ($this->sendcontext == 'emailing' && !empty($conf->global->MAILING_NO_USING_PHPMAIL) && $sendingmode == 'mail') { // List of sending methods $listofmethods = array(); $listofmethods['mail'] = 'PHP mail function'; diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 1ad02edc46b..a9d6bb9f00b 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -523,9 +523,9 @@ class pdf_squille extends ModelePdfReception while ($pagenb < $pageposafter) { $pdf->setPage($pagenb); if ($pagenb == 1) { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object); } else { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); + $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object); } $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; @@ -534,9 +534,9 @@ class pdf_squille extends ModelePdfReception } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object); } else { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); + $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object); } $this->_pagefoot($pdf, $object, $outputlangs, 1); // New page @@ -550,10 +550,10 @@ class pdf_squille extends ModelePdfReception // Show square if ($pagenb == 1) { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0, $object); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } else { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); + $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -719,9 +719,10 @@ class pdf_squille extends ModelePdfReception * @param Translate $outputlangs Langs object * @param int $hidetop Hide top bar of array * @param int $hidebottom Hide bottom bar of array + * @param Object|NULL $object Object reception to generate * @return void */ - protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0) + protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $object = null) { global $conf; @@ -767,7 +768,18 @@ class pdf_squille extends ModelePdfReception $pdf->line($this->posxqtytoship - 1, $tab_top, $this->posxqtytoship - 1, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxqtytoship, $tab_top + 1); - $pdf->MultiCell(($this->posxpuht - $this->posxqtytoship), 2, $outputlangs->transnoentities("QtyToReceive"), '', 'C'); + $statusreceived = Reception::STATUS_CLOSED; + if (getDolGlobalInt("STOCK_CALCULATE_ON_RECEPTION")) { + $statusreceived = Reception::STATUS_VALIDATED; + } + if (getDolGlobalInt("STOCK_CALCULATE_ON_RECEPTION_CLOSE")) { + $statusreceived = Reception::STATUS_CLOSED; + } + if ($object && $object->statut < $statusreceived) { + $pdf->MultiCell(($this->posxpuht - $this->posxqtytoship), 2, $outputlangs->transnoentities('QtyToReceive'), '', 'C'); + } else { + $pdf->MultiCell(($this->posxpuht - $this->posxqtytoship), 2, $outputlangs->transnoentities('QtyReceived'), '', 'C'); + } } if (!empty($conf->global->MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT)) { diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 0953d314202..1a289e61e2e 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -166,7 +166,7 @@ if ($action == 'add') { // on récupère les enregistrements $object->fetch($id); - + $res = $object->fetch_lines(); // on transfert les données de l'un vers l'autre if ($object->socid > 0) { $newinter->socid = $object->socid; @@ -178,6 +178,7 @@ if ($action == 'add') { $newinter->entity = $object->entity; $newinter->duree = $object->duree; + $newinter->datei = $object->date; $newinter->description = $object->description; $newinter->note_private = $object->note_private; @@ -194,7 +195,7 @@ if ($action == 'add') { if ($newfichinterid > 0) { // Now we add line of details foreach ($object->lines as $line) { - $newinter->addline($user, $newfichinterid, $line->desc, '', $line->duree, ''); + $newinter->addline($user, $newfichinterid, $line->desc, $line->datei, $line->duree, ''); } // on update le nombre d'inter crée à partir du modèle @@ -737,7 +738,7 @@ if ($action == 'create') { print '
'; print ''; - print $langs->trans("CreateFichInter").'
'; + print $langs->trans("AddIntervention").''; } if ($user->rights->ficheinter->supprimer) { diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 9c27843567a..24d9bf91af1 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -1349,7 +1349,6 @@ class Fichinter extends CommonObject $line->fetch_optionals(); $this->lines[$i] = $line; - $i++; } $this->db->free($resql); diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php index beb17cd3a67..b128bba60f8 100644 --- a/htdocs/fichinter/class/fichinterrec.class.php +++ b/htdocs/fichinter/class/fichinterrec.class.php @@ -351,7 +351,7 @@ class FichinterRec extends Fichinter $this->lines = array(); $sql = 'SELECT l.rowid, l.fk_product, l.product_type as product_type, l.label as custom_label, l.description, '; - $sql .= ' l.price, l.qty, l.tva_tx, l.remise, l.remise_percent, l.subprice, l.duree, '; + $sql .= ' l.price, l.qty, l.tva_tx, l.remise_percent, l.subprice, l.duree, '; $sql .= ' l.total_ht, l.total_tva, l.total_ttc,'; $sql .= ' l.rang, l.special_code,'; $sql .= ' l.fk_unit, p.ref as product_ref, p.fk_product_type as fk_product_type,'; @@ -370,7 +370,6 @@ class FichinterRec extends Fichinter $objp = $this->db->fetch_object($result); $line = new FichinterLigne($this->db); - $line->id = $objp->rowid; $line->label = $objp->custom_label; // Label line $line->desc = $objp->description; // Description line @@ -390,8 +389,6 @@ class FichinterRec extends Fichinter $line->fk_product = $objp->fk_product; $line->date_start = $objp->date_start; $line->date_end = $objp->date_end; - $line->date_start = $objp->date_start; - $line->date_end = $objp->date_end; $line->info_bits = $objp->info_bits; $line->total_ht = $objp->total_ht; $line->total_tva = $objp->total_tva; diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index 84b394da808..01f22d744b8 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -436,7 +436,7 @@ if ($action == 'edit') { if ($resprod > 0) { print $product->ref; } elseif ($resprod < 0) { - setEventMessages(null, $object->errors, "errors"); + setEventMessages(null, $product->errors, "errors"); } } else { print $conf->global->{$constname}; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index a170a2b777e..164f327a52d 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2790,6 +2790,7 @@ if (!GETPOST('hide_websitemenu')) { $htmltext .= '
'.$langs->trans("GoTo").' '.$virtualurl.'

'; } if (!empty($conf->global->WEBSITE_REPLACE_INFO_ABOUT_USAGE_WITH_WEBSERVER)) { + $htmltext .= ''; $htmltext .= '
'.$langs->trans($conf->global->WEBSITE_REPLACE_INFO_ABOUT_USAGE_WITH_WEBSERVER); } else { $htmltext .= $langs->trans("SetHereVirtualHost", $dataroot);