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

develop
This commit is contained in:
Laurent Destailleur 2023-04-01 15:06:15 +02:00
commit 254e785c47
8 changed files with 843 additions and 767 deletions

View File

@ -1599,17 +1599,21 @@ abstract class CommonDocGenerator
// set cell padding with column title definition // set cell padding with column title definition
$pdf->setCellPaddings($colDef['title']['padding'][3], $colDef['title']['padding'][0], $colDef['title']['padding'][1], $colDef['title']['padding'][2]); $pdf->setCellPaddings($colDef['title']['padding'][3], $colDef['title']['padding'][0], $colDef['title']['padding'][1], $colDef['title']['padding'][2]);
} }
if (isset($colDef['title']['align'])) {
$align = $colDef['title']['align'];
} else {
$align = '';
}
$pdf->SetXY($colDef['xStartPos'], $tab_top); $pdf->SetXY($colDef['xStartPos'], $tab_top);
$textWidth = $colDef['width']; $textWidth = $colDef['width'];
$pdf->MultiCell($textWidth, 2, $colDef['title']['label'], '', $colDef['title']['align']); $pdf->MultiCell($textWidth, 2, $colDef['title']['label'], '', $align);
// Add variant of translation if $outputlangsbis is an object // Add variant of translation if $outputlangsbis is an object
if (is_object($outputlangsbis) && trim($colDef['title']['label'])) { if (is_object($outputlangsbis) && trim($colDef['title']['label'])) {
$pdf->setCellPaddings($colDef['title']['padding'][3], 0, $colDef['title']['padding'][1], $colDef['title']['padding'][2]); $pdf->setCellPaddings($colDef['title']['padding'][3], 0, $colDef['title']['padding'][1], $colDef['title']['padding'][2]);
$pdf->SetXY($colDef['xStartPos'], $pdf->GetY()); $pdf->SetXY($colDef['xStartPos'], $pdf->GetY());
$textbis = $outputlangsbis->transnoentities($colDef['title']['textkey']); $textbis = $outputlangsbis->transnoentities($colDef['title']['textkey']);
$pdf->MultiCell($textWidth, 2, $textbis, '', $colDef['title']['align']); $pdf->MultiCell($textWidth, 2, $textbis, '', $align);
} }
$this->tabTitleHeight = max($pdf->GetY() - $tab_top, $this->tabTitleHeight); $this->tabTitleHeight = max($pdf->GetY() - $tab_top, $this->tabTitleHeight);

View File

@ -41,11 +41,8 @@ if (isModEnabled('categorie')) {
global $dolibarr_main_url_root; global $dolibarr_main_url_root;
// for other modules
//dol_include_once('/othermodule/class/otherobject.class.php');
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("eventorganization", "other", "projects")); $langs->loadLangs(array("eventorganization", "other", "projects", "bills"));
// Get Paramters // Get Paramters
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...

View File

@ -428,69 +428,74 @@ $help_url = '';
llxHeader('', $langs->trans('Inventory'), $help_url); llxHeader('', $langs->trans('Inventory'), $help_url);
// Part to show record // Part to show record
if ($object->id > 0) { if ($object->id <= 0) {
$res = $object->fetch_optionals(); dol_print_error('', 'Bad value for object id');
exit;
}
$head = inventoryPrepareHead($object);
print dol_get_fiche_head($head, 'inventory', $langs->trans("Inventory"), -1, 'stock');
$formconfirm = ''; $res = $object->fetch_optionals();
// Confirmation to delete $head = inventoryPrepareHead($object);
if ($action == 'delete') { print dol_get_fiche_head($head, 'inventory', $langs->trans("Inventory"), -1, 'stock');
$formconfirm = '';
// Confirmation to delete
if ($action == 'delete') {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteInventory'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteInventory'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1);
} }
// Confirmation to delete line // Confirmation to delete line
if ($action == 'deleteline') { if ($action == 'deleteline') {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid.'&page='.$page.$paramwithsearch, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid.'&page='.$page.$paramwithsearch, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
} }
// Clone confirmation // Clone confirmation
if ($action == 'clone') { if ($action == 'clone') {
// Create an array for form // Create an array for form
$formquestion = array(); $formquestion = array();
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneMyObject', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneMyObject', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
} }
// Confirmation to close // Confirmation to close
if ($action == 'record') { 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, $langs->trans('Close'), $langs->trans('ConfirmFinish'), 'update', '', 0, 1);
$action = 'view'; $action = 'view';
} }
// Confirmation to close // Confirmation to close
if ($action == 'confirm_cancel') { if ($action == 'confirm_cancel') {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('Cancel'), $langs->trans('ConfirmCancel'), 'cancel_record', '', 0, 1); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('Cancel'), $langs->trans('ConfirmCancel'), 'cancel_record', '', 0, 1);
$action = 'view'; $action = 'view';
} }
// Call Hook formConfirm // Call Hook formConfirm
$parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid); $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) { if (empty($reshook)) {
$formconfirm .= $hookmanager->resPrint; $formconfirm .= $hookmanager->resPrint;
} elseif ($reshook > 0) { } elseif ($reshook > 0) {
$formconfirm = $hookmanager->resPrint; $formconfirm = $hookmanager->resPrint;
} }
// Print form confirm // Print form confirm
print $formconfirm; print $formconfirm;
// Object card // Object card
// ------------------------------------------------------------ // ------------------------------------------------------------
$linkback = '<a href="'.DOL_URL_ROOT.'/product/inventory/list.php">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/product/inventory/list.php">'.$langs->trans("BackToList").'</a>';
$morehtmlref = '<div class="refidno">'; $morehtmlref = '<div class="refidno">';
/* /*
// Ref bis // Ref bis
$morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->inventory->creer, 'string', '', 0, 1); $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->inventory->creer, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->inventory->creer, 'string', '', null, null, '', 1); $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->inventory->creer, 'string', '', null, null, '', 1);
// Thirdparty // Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
// Project // Project
if (!empty($conf->project->enabled)) if (!empty($conf->project->enabled))
{ {
$langs->load("projects"); $langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->inventory->creer) if ($user->rights->inventory->creer)
@ -519,46 +524,46 @@ if ($object->id > 0) {
$morehtmlref.=''; $morehtmlref.='';
} }
} }
} }
*/ */
$morehtmlref .= '</div>'; $morehtmlref .= '</div>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<div class="fichecenter">'; print '<div class="fichecenter">';
print '<div class="fichehalfleft">'; print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent tableforfield">'."\n"; print '<table class="border centpercent tableforfield">'."\n";
// Common attributes // Common attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
// Other attributes. Fields from hook formObjectOptions and Extrafields. // Other attributes. Fields from hook formObjectOptions and Extrafields.
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
//print '<tr><td class="titlefield fieldname_invcode">'.$langs->trans("InventoryCode").'</td><td>INV'.$object->id.'</td></tr>'; //print '<tr><td class="titlefield fieldname_invcode">'.$langs->trans("InventoryCode").'</td><td>INV'.$object->id.'</td></tr>';
print '</table>'; print '</table>';
print '</div>'; print '</div>';
print '</div>'; print '</div>';
print '<div class="clearboth"></div>'; print '<div class="clearboth"></div>';
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<form id="formrecord" name="formrecord" method="POST" action="'.$_SERVER["PHP_SELF"].'?page='.$page.'&id='.$object->id.'">'; print '<form id="formrecord" name="formrecord" method="POST" action="'.$_SERVER["PHP_SELF"].'?page='.$page.'&id='.$object->id.'">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="updateinventorylines">'; print '<input type="hidden" name="action" value="updateinventorylines">';
print '<input type="hidden" name="id" value="'.$object->id.'">'; print '<input type="hidden" name="id" value="'.$object->id.'">';
if ($backtopage) { if ($backtopage) {
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
} }
// Buttons for actions // Buttons for actions
if ($action != 'record') { if ($action != 'record') {
print '<div class="tabsAction">'."\n"; print '<div class="tabsAction">'."\n";
$parameters = array(); $parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
@ -593,11 +598,11 @@ if ($object->id > 0) {
if ($object->status != Inventory::STATUS_DRAFT && $object->status != Inventory::STATUS_VALIDATED) { if ($object->status != Inventory::STATUS_DRAFT && $object->status != Inventory::STATUS_VALIDATED) {
print '<br><br>'; print '<br><br>';
} }
} }
if ($object->status == Inventory::STATUS_VALIDATED) { if ($object->status == Inventory::STATUS_VALIDATED) {
print '<center>'; print '<center>';
if (!empty($conf->use_javascript_ajax)) { if (!empty($conf->use_javascript_ajax)) {
if ($permissiontoadd) { if ($permissiontoadd) {
@ -618,7 +623,7 @@ if ($object->id > 0) {
jQuery(".realqty").trigger("change"); jQuery(".realqty").trigger("change");
}) })
console.log("Values filled (after click on fillwithexpected)"); console.log("Values filled (after click on fillwithexpected)");
disablebuttonmakemovementandclose(); /* disablebuttonmakemovementandclose(); */
return false; return false;
});'; });';
print '});'; print '});';
@ -633,11 +638,11 @@ if ($object->id > 0) {
print '<br>'; print '<br>';
print '<br>'; print '<br>';
print '</center>'; print '</center>';
} }
// Popup for mass barcode scanning // Popup for mass barcode scanning
if ($action == 'updatebyscaning') { if ($action == 'updatebyscaning') {
if ($permissiontoadd) { if ($permissiontoadd) {
// Output the javascript to manage the scanner tool. // Output the javascript to manage the scanner tool.
print '<script>'; print '<script>';
@ -864,14 +869,14 @@ if ($object->id > 0) {
include DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; include DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
$formother = new FormOther($db); $formother = new FormOther($db);
print $formother->getHTMLScannerForm("barcodescannerjs", 'all'); print $formother->getHTMLScannerForm("barcodescannerjs", 'all');
} }
//Call method to undo changes in real qty //Call method to undo changes in real qty
print '<script>'; print '<script>';
print 'jQuery(document).ready(function() { print 'jQuery(document).ready(function() {
$("#clearqty").on("click", function() { $("#clearqty").on("click", function() {
console.log("Clear all values"); console.log("Clear all values");
disablebuttonmakemovementandclose(); /* disablebuttonmakemovementandclose(); */
jQuery(".realqty").val(""); jQuery(".realqty").val("");
jQuery(".realqty").trigger("change"); jQuery(".realqty").trigger("change");
return false; /* disable submit */ return false; /* disable submit */
@ -882,55 +887,55 @@ if ($object->id > 0) {
id = id.split("_")[1]; id = id.split("_")[1];
tmpvalue = $("#id_"+id+"_input_tmp").val() tmpvalue = $("#id_"+id+"_input_tmp").val()
$("#id_"+id+"_input")[0].value = tmpvalue; $("#id_"+id+"_input")[0].value = tmpvalue;
disablebuttonmakemovementandclose(); /* disablebuttonmakemovementandclose(); */
return false; /* disable submit */ return false; /* disable submit */
}); });
});'; });';
print '</script>'; print '</script>';
print '<div class="fichecenter">'; print '<div class="fichecenter">';
//print '<div class="fichehalfleft">'; //print '<div class="fichehalfleft">';
print '<div class="clearboth"></div>'; print '<div class="clearboth"></div>';
//print load_fiche_titre($langs->trans('Consumption'), '', ''); //print load_fiche_titre($langs->trans('Consumption'), '', '');
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table id="tablelines" class="noborder noshadow centpercent">'; print '<table id="tablelines" class="noborder noshadow centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Warehouse").'</td>'; print '<td>'.$langs->trans("Warehouse").'</td>';
print '<td>'.$langs->trans("Product").'</td>'; print '<td>'.$langs->trans("Product").'</td>';
if (isModEnabled('productbatch')) { if (isModEnabled('productbatch')) {
print '<td>'; print '<td>';
print $langs->trans("Batch"); print $langs->trans("Batch");
print '</td>'; print '</td>';
} }
print '<td class="right">'.$langs->trans("ExpectedQty").'</td>'; print '<td class="right">'.$langs->trans("ExpectedQty").'</td>';
if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) {
print '<td class="right">'.$langs->trans('PMPExpected').'</td>'; print '<td class="right">'.$langs->trans('PMPExpected').'</td>';
print '<td class="right">'.$langs->trans('ExpectedValuation').'</td>'; print '<td class="right">'.$langs->trans('ExpectedValuation').'</td>';
print '<td class="right">'.$form->textwithpicto($langs->trans("RealQty"), $langs->trans("InventoryRealQtyHelp")).'</td>'; print '<td class="right">'.$form->textwithpicto($langs->trans("RealQty"), $langs->trans("InventoryRealQtyHelp")).'</td>';
print '<td class="right">'.$langs->trans('PMPReal').'</td>'; print '<td class="right">'.$langs->trans('PMPReal').'</td>';
print '<td class="right">'.$langs->trans('RealValuation').'</td>'; print '<td class="right">'.$langs->trans('RealValuation').'</td>';
} else { } else {
print '<td class="right">'; print '<td class="right">';
print $form->textwithpicto($langs->trans("RealQty"), $langs->trans("InventoryRealQtyHelp")); print $form->textwithpicto($langs->trans("RealQty"), $langs->trans("InventoryRealQtyHelp"));
print '</td>'; print '</td>';
} }
if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) { if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) {
// Actions or link to stock movement // Actions or link to stock movement
print '<td class="center">'; print '<td class="center">';
print '</td>'; print '</td>';
} else { } else {
// Actions or link to stock movement // Actions or link to stock movement
print '<td class="right">'; print '<td class="right">';
//print $langs->trans("StockMovement"); //print $langs->trans("StockMovement");
print '</td>'; print '</td>';
} }
print '</tr>'; print '</tr>';
// Line to add a new line in inventory // Line to add a new line in inventory
if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) { if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) {
print '<tr>'; print '<tr>';
print '<td>'; print '<td>';
print $formproduct->selectWarehouses((GETPOSTISSET('fk_warehouse') ? GETPOST('fk_warehouse', 'int') : $object->fk_warehouse), 'fk_warehouse', 'warehouseopen', 1, 0, 0, '', 0, 0, array(), 'maxwidth300'); print $formproduct->selectWarehouses((GETPOSTISSET('fk_warehouse') ? GETPOST('fk_warehouse', 'int') : $object->fk_warehouse), 'fk_warehouse', 'warehouseopen', 1, 0, 0, '', 0, 0, array(), 'maxwidth300');
@ -966,22 +971,22 @@ if ($object->id > 0) {
print '<input type="submit" class="button paddingright" name="addline" value="'.$langs->trans("Add").'">'; print '<input type="submit" class="button paddingright" name="addline" value="'.$langs->trans("Add").'">';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }
// Request to show lines of inventory (prefilled after start/validate step) // Request to show lines of inventory (prefilled after start/validate step)
$sql = 'SELECT id.rowid, id.datec as date_creation, id.tms as date_modification, id.fk_inventory, id.fk_warehouse,'; $sql = 'SELECT id.rowid, id.datec as date_creation, id.tms as date_modification, id.fk_inventory, id.fk_warehouse,';
$sql .= ' id.fk_product, id.batch, id.qty_stock, id.qty_view, id.qty_regulated, id.fk_movement, id.pmp_real, id.pmp_expected'; $sql .= ' id.fk_product, id.batch, id.qty_stock, id.qty_view, id.qty_regulated, id.fk_movement, id.pmp_real, id.pmp_expected';
$sql .= ' FROM '.MAIN_DB_PREFIX.'inventorydet as id'; $sql .= ' FROM '.MAIN_DB_PREFIX.'inventorydet as id';
$sql .= ' WHERE id.fk_inventory = '.((int) $object->id); $sql .= ' WHERE id.fk_inventory = '.((int) $object->id);
$sql .= $db->order('id.rowid', 'ASC'); $sql .= $db->order('id.rowid', 'ASC');
$sql .= $db->plimit($limit, $offset); $sql .= $db->plimit($limit, $offset);
$cacheOfProducts = array(); $cacheOfProducts = array();
$cacheOfWarehouses = array(); $cacheOfWarehouses = array();
//$sql = ''; //$sql = '';
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) { if ($resql) {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
if (!empty($limit != 0) || $num > $limit || $page) { if (!empty($limit != 0) || $num > $limit || $page) {
@ -1159,41 +1164,43 @@ if ($object->id > 0) {
$i++; $i++;
} }
} else { } else {
dol_print_error($db); dol_print_error($db);
} }
if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) {
print '<tr class="liste_total">'; print '<tr class="liste_total">';
print '<td colspan="4">'.$langs->trans("Total").'</td>'; print '<td colspan="4">'.$langs->trans("Total").'</td>';
print '<td class="right" colspan="2">'.price($totalExpectedValuation).'</td>'; print '<td class="right" colspan="2">'.price($totalExpectedValuation).'</td>';
print '<td class="right" id="totalRealValuation" colspan="3">'.price($totalRealValuation).'</td>'; print '<td class="right" id="totalRealValuation" colspan="3">'.price($totalRealValuation).'</td>';
print '<td></td>'; print '<td></td>';
print '</tr>'; print '</tr>';
} }
print '</table>'; print '</table>';
print '</div>'; print '</div>';
if ($object->status == $object::STATUS_VALIDATED) { if ($object->status == $object::STATUS_VALIDATED) {
print '<center><input id="submitrecord" type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'"></center>'; print '<center><input id="submitrecord" type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'"></center>';
} }
print '</div>'; print '</div>';
// Call method to disable the button if no qty entered yet for inventory // Call method to disable the button if no qty entered yet for inventory
/*
if ($object->status != $object::STATUS_VALIDATED || !$hasinput) { if ($object->status != $object::STATUS_VALIDATED || !$hasinput) {
print '<script type="text/javascript"> print '<script type="text/javascript">
jQuery(document).ready(function() { jQuery(document).ready(function() {
console.log("Call disablebuttonmakemovementandclose because status = '.((int) $object->status).' or $hasinput = '.((int) $hasinput).'"); console.log("Call disablebuttonmakemovementandclose because status = '.((int) $object->status).' or $hasinput = '.((int) $hasinput).'");
disablebuttonmakemovementandclose(); disablebuttonmakemovementandclose();
}); });
</script>'; </script>';
} }
print '</form>'; */
print '<script type="text/javascript"> print '</form>';
print '<script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$(".paginationnext:last").click(function(e){ $(".paginationnext:last").click(function(e){
@ -1233,13 +1240,13 @@ if ($object->id > 0) {
}}); }});
}); });
}); });
</script>'; </script>';
if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) {
?> ?>
<script type="text/javascript"> <script type="text/javascript">
$('.realqty').on('change', function () { $('.realqty').on('change', function () {
let realqty = $(this).closest('tr').find('.realqty').val(); let realqty = $(this).closest('tr').find('.realqty').val();
let inputPmp = $(this).closest('tr').find('input[class*=realpmp]'); let inputPmp = $(this).closest('tr').find('input[class*=realpmp]');
let realpmp = $(inputPmp).val(); let realpmp = $(inputPmp).val();
@ -1248,9 +1255,9 @@ if ($object->id > 0) {
$(this).closest('tr').find('input[name^=realvaluation]').val(realval.toFixed(2)); $(this).closest('tr').find('input[name^=realvaluation]').val(realval.toFixed(2));
} }
updateTotalValuation(); updateTotalValuation();
}); });
$('input[class*=realpmp]').on('change', function () { $('input[class*=realpmp]').on('change', function () {
let inputQtyReal = $(this).closest('tr').find('.realqty'); let inputQtyReal = $(this).closest('tr').find('.realqty');
let realqty = $(inputQtyReal).val(); let realqty = $(inputQtyReal).val();
let inputPmp = $(this).closest('tr').find('input[class*=realpmp]'); let inputPmp = $(this).closest('tr').find('input[class*=realpmp]');
@ -1267,9 +1274,9 @@ if ($object->id > 0) {
$('.realqty').trigger('change'); $('.realqty').trigger('change');
updateTotalValuation(); updateTotalValuation();
} }
}); });
$('input[name^=realvaluation]').on('change', function () { $('input[name^=realvaluation]').on('change', function () {
let inputQtyReal = $(this).closest('tr').find('.realqty'); let inputQtyReal = $(this).closest('tr').find('.realqty');
let realqty = $(inputQtyReal).val(); let realqty = $(inputQtyReal).val();
let inputPmp = $(this).closest('tr').find('input[class*=realpmp]'); let inputPmp = $(this).closest('tr').find('input[class*=realpmp]');
@ -1282,9 +1289,9 @@ if ($object->id > 0) {
$('.realqty').trigger('change'); $('.realqty').trigger('change');
updateTotalValuation(); updateTotalValuation();
} }
}); });
function updateTotalValuation() { function updateTotalValuation() {
let total = 0; let total = 0;
$('input[name^=realvaluation]').each(function( index ) { $('input[name^=realvaluation]').each(function( index ) {
let val = $(this).val(); let val = $(this).val();
@ -1297,11 +1304,10 @@ if ($object->id > 0) {
$('#totalRealValuation').html(total.toLocaleString('fr-FR', { $('#totalRealValuation').html(total.toLocaleString('fr-FR', {
maximumFractionDigits: currencyFractionDigits maximumFractionDigits: currencyFractionDigits
})); }));
} }
</script> </script>
<?php <?php
}
} }
// End of page // End of page

View File

@ -581,7 +581,7 @@ $listofreferent = array(
'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&action=createtime&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&action=createtime&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
'buttonnew'=>'AddTimeSpent', 'buttonnew'=>'AddTimeSpent',
'testnew'=>$user->hasRight('project', 'creer'), 'testnew'=>$user->hasRight('project', 'creer'),
'test'=>!empty($conf->project->enabled) && $user->hasRight('projet', 'lire') && !empty($conf->global->PROJECT_HIDE_TASKS)), 'test'=>!empty($conf->project->enabled) && $user->hasRight('projet', 'lire') && empty($conf->global->PROJECT_HIDE_TASKS)),
'stock_mouvement'=>array( 'stock_mouvement'=>array(
'name'=>"MouvementStockAssociated", 'name'=>"MouvementStockAssociated",
'title'=>"ListMouvementStockProject", 'title'=>"ListMouvementStockProject",

View File

@ -890,7 +890,9 @@ if ((!empty($conference->id) && $conference->status == ConferenceOrBooth::STATUS
print "<br>"; print "<br>";
} }
} else { } else {
print '<br><br>';
print $langs->trans("ConferenceIsNotConfirmed"); print $langs->trans("ConferenceIsNotConfirmed");
print '<br><br>';
} }
print '</div></div>'; print '</div></div>';

View File

@ -131,7 +131,9 @@ dol_syslog("Callback url when an online payment is refused or canceled. query_st
$tracepost = ""; $tracepost = "";
foreach ($_POST as $k => $v) { foreach ($_POST as $k => $v) {
if (is_scalar($k) && is_scalar($v)) {
$tracepost .= "{$k} - {$v}\n"; $tracepost .= "{$k} - {$v}\n";
}
} }
dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_payment'); dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_payment');

View File

@ -175,12 +175,16 @@ dol_syslog("_SERVER[SERVER_ADDR] = ".(empty($_SERVER["SERVER_ADDR"]) ? '' : dol_
$tracepost = ""; $tracepost = "";
foreach ($_POST as $k => $v) { foreach ($_POST as $k => $v) {
if (is_scalar($k) && is_scalar($v)) {
$tracepost .= "{$k} - {$v}\n"; $tracepost .= "{$k} - {$v}\n";
}
} }
dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_payment'); dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_payment');
$tracesession = ""; $tracesession = "";
foreach ($_SESSION as $k => $v) { foreach ($_SESSION as $k => $v) {
if (is_scalar($k) && is_scalar($v)) {
$tracesession .= "{$k} - {$v}\n"; $tracesession .= "{$k} - {$v}\n";
}
} }
dol_syslog("SESSION=".$tracesession, LOG_DEBUG, 0, '_payment'); dol_syslog("SESSION=".$tracesession, LOG_DEBUG, 0, '_payment');

View File

@ -128,6 +128,9 @@ $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '<div>' : '').'<div>';
llxHeader($head, $langs->trans("SuggestForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); llxHeader($head, $langs->trans("SuggestForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea);
//llxHeaderVierge($langs->trans("SuggestForm"));
print '<span id="dolpaymentspan"></span>'."\n"; print '<span id="dolpaymentspan"></span>'."\n";
print '<div class="center">'."\n"; print '<div class="center">'."\n";
@ -154,7 +157,7 @@ if (!empty($conf->global->$paramlogo)) {
} elseif (!empty($conf->global->ONLINE_PAYMENT_LOGO)) { } elseif (!empty($conf->global->ONLINE_PAYMENT_LOGO)) {
$logosmall = $conf->global->ONLINE_PAYMENT_LOGO; $logosmall = $conf->global->ONLINE_PAYMENT_LOGO;
} }
//print '<!-- Show logo (logosmall='.$logosmall.' logo='.$logo.') -->'."\n"; //print '- Show logo (logosmall='.$logosmall.' logo='.$logo.') '."\n";
// Define urllogo // Define urllogo
$urllogo = ''; $urllogo = '';
$urllogofull = ''; $urllogofull = '';
@ -298,3 +301,61 @@ htmlPrintOnlineFooter($mysoc, $langs, 1, $suffix, $object);
llxFooter('', 'public'); llxFooter('', 'public');
$db->close(); $db->close();
/**
* Show header for new member
*
* @param string $title Title
* @param string $head Head array
* @param int $disablejs More content into html header
* @param int $disablehead More content into html header
* @param array $arrayofjs Array of complementary js files
* @param array $arrayofcss Array of complementary css files
* @return void
*/
function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '')
{
global $user, $conf, $langs, $mysoc;
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
print '<body id="mainbody" class="publicnewmemberform">';
// Define urllogo
$urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png';
if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) {
$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_small);
} elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) {
$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/'.$mysoc->logo);
} elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) {
$urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg';
}
print '<div class="center">';
// Output html code for logo
if ($urllogo) {
print '<div class="backgreypublicpayment">';
print '<div class="logopublicpayment">';
print '<img id="dolpaymentlogo" src="'.$urllogo.'"';
print '>';
print '</div>';
if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
print '<div class="poweredbypublicpayment opacitymedium right"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans("PoweredBy").'<br><img class="poweredbyimg" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
}
print '</div>';
}
if (!empty($conf->global->PROJECT_IMAGE_PUBLIC_SUGGEST_CONFERENCE)) {
print '<div class="backimagepublicsuggestconference">';
print '<img id="idPROJECT_IMAGE_PUBLIC_SUGGEST_CONFERENCE" src="'.$conf->global->PROJECT_IMAGE_PUBLIC_SUGGEST_CONFERENCE.'">';
print '</div>';
}
print '</div>';
print '<div class="divmainbodylarge">';
}