Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 15.0

Conflicts:
	htdocs/accountancy/class/bookkeeping.class.php
This commit is contained in:
Laurent Destailleur 2022-05-20 23:28:01 +02:00
commit ee6131612a
6 changed files with 27 additions and 17 deletions

View File

@ -1872,7 +1872,7 @@ class BookKeeping extends CommonObject
$sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,'; $sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,';
$sql .= ' numero_compte, label_compte, label_operation, debit, credit,'; $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 .= ' 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); $resql = $this->db->query($sql);
if (!$resql) { if (!$resql) {
$error++; $error++;

View File

@ -523,9 +523,9 @@ class pdf_squille extends ModelePdfReception
while ($pagenb < $pageposafter) { while ($pagenb < $pageposafter) {
$pdf->setPage($pagenb); $pdf->setPage($pagenb);
if ($pagenb == 1) { 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 { } 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); $this->_pagefoot($pdf, $object, $outputlangs, 1);
$pagenb++; $pagenb++;
@ -534,9 +534,9 @@ class pdf_squille extends ModelePdfReception
} }
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
if ($pagenb == 1) { 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 { } 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); $this->_pagefoot($pdf, $object, $outputlangs, 1);
// New page // New page
@ -550,10 +550,10 @@ class pdf_squille extends ModelePdfReception
// Show square // Show square
if ($pagenb == 1) { 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; $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
} else { } 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; $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
} }
@ -719,9 +719,10 @@ class pdf_squille extends ModelePdfReception
* @param Translate $outputlangs Langs object * @param Translate $outputlangs Langs object
* @param int $hidetop Hide top bar of array * @param int $hidetop Hide top bar of array
* @param int $hidebottom Hide bottom bar of array * @param int $hidebottom Hide bottom bar of array
* @param Object|NULL $object Object reception to generate
* @return void * @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; 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); $pdf->line($this->posxqtytoship - 1, $tab_top, $this->posxqtytoship - 1, $tab_top + $tab_height);
if (empty($hidetop)) { if (empty($hidetop)) {
$pdf->SetXY($this->posxqtytoship, $tab_top + 1); $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)) { if (!empty($conf->global->MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT)) {

View File

@ -166,7 +166,7 @@ if ($action == 'add') {
// on récupère les enregistrements // on récupère les enregistrements
$object->fetch($id); $object->fetch($id);
$res = $object->fetch_lines();
// on transfert les données de l'un vers l'autre // on transfert les données de l'un vers l'autre
if ($object->socid > 0) { if ($object->socid > 0) {
$newinter->socid = $object->socid; $newinter->socid = $object->socid;
@ -178,6 +178,7 @@ if ($action == 'add') {
$newinter->entity = $object->entity; $newinter->entity = $object->entity;
$newinter->duree = $object->duree; $newinter->duree = $object->duree;
$newinter->datei = $object->date;
$newinter->description = $object->description; $newinter->description = $object->description;
$newinter->note_private = $object->note_private; $newinter->note_private = $object->note_private;
@ -194,7 +195,7 @@ if ($action == 'add') {
if ($newfichinterid > 0) { if ($newfichinterid > 0) {
// Now we add line of details // Now we add line of details
foreach ($object->lines as $line) { 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 // on update le nombre d'inter crée à partir du modèle
@ -737,7 +738,7 @@ if ($action == 'create') {
print '<div class="inline-block divButAction">'; print '<div class="inline-block divButAction">';
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=createfrommodel&token='.newToken().''; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=createfrommodel&token='.newToken().'';
print '&socid='.$object->thirdparty->id.'&id='.$object->id.'">'; print '&socid='.$object->thirdparty->id.'&id='.$object->id.'">';
print $langs->trans("CreateFichInter").'</a></div>'; print $langs->trans("AddIntervention").'</a></div>';
} }
if ($user->rights->ficheinter->supprimer) { if ($user->rights->ficheinter->supprimer) {

View File

@ -1347,7 +1347,6 @@ class Fichinter extends CommonObject
$line->fetch_optionals(); $line->fetch_optionals();
$this->lines[$i] = $line; $this->lines[$i] = $line;
$i++; $i++;
} }
$this->db->free($resql); $this->db->free($resql);

View File

@ -349,7 +349,7 @@ class FichinterRec extends Fichinter
{ {
// phpcs:enable // phpcs:enable
$sql = 'SELECT l.rowid, l.fk_product, l.product_type, l.label as custom_label, l.description, '; $sql = 'SELECT l.rowid, l.fk_product, l.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, l.remise_percent, l.subprice, l.duree, l.date, ';
$sql .= ' l.total_ht, l.total_tva, l.total_ttc,'; $sql .= ' l.total_ht, l.total_tva, l.total_ttc,';
$sql .= ' l.rang, l.special_code,'; $sql .= ' l.rang, l.special_code,';
$sql .= ' l.fk_unit, p.ref as product_ref, p.fk_product_type as fk_product_type,'; $sql .= ' l.fk_unit, p.ref as product_ref, p.fk_product_type as fk_product_type,';
@ -366,7 +366,6 @@ class FichinterRec extends Fichinter
while ($i < $num) { while ($i < $num) {
$objp = $this->db->fetch_object($result); $objp = $this->db->fetch_object($result);
$line = new FichinterLigne($this->db); $line = new FichinterLigne($this->db);
$line->id = $objp->rowid; $line->id = $objp->rowid;
$line->label = $objp->custom_label; // Label line $line->label = $objp->custom_label; // Label line
$line->desc = $objp->description; // Description line $line->desc = $objp->description; // Description line
@ -386,8 +385,6 @@ class FichinterRec extends Fichinter
$line->fk_product = $objp->fk_product; $line->fk_product = $objp->fk_product;
$line->date_start = $objp->date_start; $line->date_start = $objp->date_start;
$line->date_end = $objp->date_end; $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->info_bits = $objp->info_bits;
$line->total_ht = $objp->total_ht; $line->total_ht = $objp->total_ht;
$line->total_tva = $objp->total_tva; $line->total_tva = $objp->total_tva;

View File

@ -2738,6 +2738,7 @@ if (!GETPOST('hide_websitemenu')) {
$htmltext .= '<br><center>'.$langs->trans("GoTo").' <a href="'.$virtualurl.'" target="_website">'.$virtualurl.'</a></center><br>'; $htmltext .= '<br><center>'.$langs->trans("GoTo").' <a href="'.$virtualurl.'" target="_website">'.$virtualurl.'</a></center><br>';
} }
if (!empty($conf->global->WEBSITE_REPLACE_INFO_ABOUT_USAGE_WITH_WEBSERVER)) { if (!empty($conf->global->WEBSITE_REPLACE_INFO_ABOUT_USAGE_WITH_WEBSERVER)) {
$htmltext .= '<!-- Message defined translate key set into WEBSITE_REPLACE_INFO_ABOUT_USAGE_WITH_WEBSERVER -->';
$htmltext .= '<br>'.$langs->trans($conf->global->WEBSITE_REPLACE_INFO_ABOUT_USAGE_WITH_WEBSERVER); $htmltext .= '<br>'.$langs->trans($conf->global->WEBSITE_REPLACE_INFO_ABOUT_USAGE_WITH_WEBSERVER);
} else { } else {
$htmltext .= $langs->trans("SetHereVirtualHost", $dataroot); $htmltext .= $langs->trans("SetHereVirtualHost", $dataroot);