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

develop
This commit is contained in:
Laurent Destailleur 2023-02-21 02:37:22 +01:00
commit 80df9434db
6 changed files with 32 additions and 14 deletions

View File

@ -214,6 +214,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<a id="hide_all" href="#">'.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").'</a>&nbsp;';
}
print '</td>';
if ($action == 'treeview') print '<td class="left">'.$langs->trans('ProducedBy').'</td>';
print '<td class="linecolqty right">'.$langs->trans('Quantity').'</td>';
print '<td class="linecolstock right">'.$form->textwithpicto($langs->trans("PhysicalStock"), $text_stock_options, 1).'</td>';
print '<td class="linecoltheoricalstock right">'.$form->textwithpicto($langs->trans("VirtualStock"), $langs->trans("VirtualStockDesc")).'</td>';
@ -226,13 +227,17 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
foreach ($TChildBom as $fk_bom => $TProduct) {
$repeatChar = '&emsp;';
if (!empty($TProduct['bom'])) {
$prod = new Product($db);
$prod->fetch($TProduct['bom']->fk_product);
if ($TProduct['parentid'] != $object->id) print '<tr class="sub_bom_lines oddeven" parentid="'.$TProduct['parentid'].'">';
else print '<tr class="oddeven">';
print '<td class="linecoldescription">'.str_repeat($repeatChar, $TProduct['level']).$TProduct['bom']->getNomUrl(1);
if ($action == 'treeview') print '<td class="linecoldescription">'.str_repeat($repeatChar, $TProduct['level']).$prod->getNomUrl(1);
else print '<td class="linecoldescription">'.str_repeat($repeatChar, $TProduct['level']).$TProduct['bom']->getNomUrl(1);
print ' <a class="collapse_bom" id="collapse-'.$fk_bom.'" href="#">';
print img_picto('', 'folder-open');
print '</a>';
print '</td>';
if ($action == 'treeview') print '<td class="left">'.$TProduct['bom']->getNomUrl(1).'</td>';
print '<td class="linecolqty right">'.$TProduct['qty'].'</td>';
print '<td class="linecolstock right"></td>';
print '<td class="linecoltheoricalstock right"></td>';
@ -247,6 +252,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($fk_bom != $object->id) print '<tr class="sub_bom_lines oddeven" parentid="'.$fk_bom.'">';
else print '<tr class="oddeven">';
print '<td class="linecoldescription">'.str_repeat($repeatChar, $TInfos['level']).$prod->getNomUrl(1).'</td>';
if ($action == 'treeview') print '<td></td>';
print '<td class="linecolqty right">'.$TInfos['qty'].'</td>';
print '<td class="linecolstock right">'.price2num($prod->stock_reel, 'MS').'</td>';
print '<td class="linecoltheoricalstock right">'.$prod->stock_theorique.'</td>';
@ -290,20 +296,30 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
<script type="text/javascript" language="javascript">
$(document).ready(function() {
// When clicking on collapse
$(".collapse_bom").click(function() {
console.log("We click on collapse");
var id_bom_line = $(this).attr('id').replace('collapse-', '');
console.log($(this).html().indexOf('folder-open'));
if($(this).html().indexOf('folder-open') <= 0) {
function folderManage(element) {
var id_bom_line = element.attr('id').replace('collapse-', '');
let TSubLines = $('[parentid="'+ id_bom_line +'"]');
if(element.html().indexOf('folder-open') <= 0) {
$('[parentid="'+ id_bom_line +'"]').show();
$(this).html('<?php echo dol_escape_js(img_picto('', 'folder-open')); ?>');
element.html('<?php echo dol_escape_js(img_picto('', 'folder-open')); ?>');
}
else {
$('[parentid="'+ id_bom_line +'"]').hide();
$(this).html('<?php echo dol_escape_js(img_picto('', 'folder')); ?>');
for (let i = 0; i < TSubLines.length; i++) {
let subBomFolder = $(TSubLines[i]).children('.linecoldescription').children('.collapse_bom');
if (subBomFolder.length > 0) {
folderManage(subBomFolder);
}
}
TSubLines.hide();
element.html('<?php echo dol_escape_js(img_picto('', 'folder')); ?>');
}
}
// When clicking on collapse
$(".collapse_bom").click(function() {
folderManage($(this));
return false;
});

View File

@ -109,8 +109,7 @@ $search_date_endyear = GETPOST('search_date_endyear', 'int');
$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
$search_date_end_startday = GETPOST('search_date_end_startday', 'int');
$search_date_end_startmonth = GETPOST('se$sql .= $db->plimit($limit + 1, $offset);
arch_date_end_startmonth', 'int');
$search_date_end_startmonth = GETPOST('search_date_end_startmonth', 'int');
$search_date_end_startyear = GETPOST('search_date_end_startyear', 'int');
$search_date_end_endday = GETPOST('search_date_end_endday', 'int');
$search_date_end_endmonth = GETPOST('search_date_end_endmonth', 'int');

View File

@ -837,7 +837,7 @@ if ($action == 'create2') {
}
$help_url = 'EN:Module_Shipments|FR:Module_Expéditions|ES:M&oacute;dulo_Expediciones|DE:Modul_Lieferungen';
llxHeader('', $title, 'Expedition', $help_url);
llxHeader('', $title, $help_url);
if (empty($action)) {
$action = 'view';

View File

@ -599,7 +599,8 @@ class Expedition extends CommonObject
$this->socid = $obj->socid;
$this->ref_customer = $obj->ref_customer;
$this->ref_ext = $obj->ref_ext;
$this->statut = $obj->fk_statut;
$this->status = $obj->fk_statut;
$this->statut = $this->status; // Deprecated
$this->user_author_id = $obj->fk_user_author;
$this->fk_user_author = $obj->fk_user_author;
$this->date_creation = $this->db->jdate($obj->date_creation);

View File

@ -121,3 +121,4 @@ BOMProductsList=BOM's products
BOMServicesList=BOM's services
Manufacturing=Manufacturing
Disassemble=Disassemble
ProducedBy=Produced by

View File

@ -119,3 +119,4 @@ BomCantAddChildBom=La nomenclature %s est déjà présente dans l'arbre menant
BOMNetNeeds = Besoins nets
BOMProductsList=Les produits de BOM
BOMServicesList=Les services de BOM
ProducedBy=Produit par