Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
11488a1f8d
@ -4,7 +4,7 @@ LOG INALTERABLE
|
|||||||
## Fonctionnalité
|
## Fonctionnalité
|
||||||
|
|
||||||
Ce module trace, en temps réel, certains évènements métiers dans une log inaltérable (que vous ne pouvez pas modifier une fois enregistrés) de type blockchain.
|
Ce module trace, en temps réel, certains évènements métiers dans une log inaltérable (que vous ne pouvez pas modifier une fois enregistrés) de type blockchain.
|
||||||
Ce module est requis pour la compatibilité avec les exigences légales de certains pays (comme la France avec la loi Fincance 2016 - Norme NF535).
|
Ce module est requis pour la compatibilité avec les exigences légales de certains pays (comme la France avec la loi Finance 2016 - Norme NF525).
|
||||||
|
|
||||||
|
|
||||||
**Les évènements tracés de manière inaltérables sont:**
|
**Les évènements tracés de manière inaltérables sont:**
|
||||||
|
|||||||
@ -4,7 +4,7 @@ BLOCKED LOG
|
|||||||
## Feature
|
## Feature
|
||||||
|
|
||||||
This module tracks, in real time, some events into a non reversible log (that you can't modify once recorded) into a block chain.
|
This module tracks, in real time, some events into a non reversible log (that you can't modify once recorded) into a block chain.
|
||||||
This module provides compatibility with requirements of laws of some countries (like France with the law Fincance 2016 - Norme NF535).
|
This module provides compatibility with requirements of laws of some countries (like France with the law Finance 2016 - Norme NF525).
|
||||||
|
|
||||||
|
|
||||||
**The tracked events are:**
|
**The tracked events are:**
|
||||||
|
|||||||
@ -80,8 +80,6 @@ if (isModEnabled('margin')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// General $Variables
|
// General $Variables
|
||||||
$projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : 0);
|
|
||||||
|
|
||||||
$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
|
$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
|
||||||
$ref = GETPOST('ref', 'alpha');
|
$ref = GETPOST('ref', 'alpha');
|
||||||
$socid = GETPOST('socid', 'int');
|
$socid = GETPOST('socid', 'int');
|
||||||
@ -100,6 +98,7 @@ $fac_rec = GETPOST('fac_rec', 'int');
|
|||||||
$facid = GETPOST('facid', 'int');
|
$facid = GETPOST('facid', 'int');
|
||||||
$ref_client = GETPOST('ref_client', 'int');
|
$ref_client = GETPOST('ref_client', 'int');
|
||||||
$rank = (GETPOST('rank', 'int') > 0) ? GETPOST('rank', 'int') : -1;
|
$rank = (GETPOST('rank', 'int') > 0) ? GETPOST('rank', 'int') : -1;
|
||||||
|
$projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : 0);
|
||||||
|
|
||||||
// PDF
|
// PDF
|
||||||
$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
|
$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
|
||||||
@ -3149,7 +3148,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST" id="formtocreate" name="formtocreate">';
|
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST" id="formtocreate" name="formtocreate">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" id="formtocreateaction" value="add">';
|
||||||
if ($soc->id > 0) {
|
if ($soc->id > 0) {
|
||||||
print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
|
print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
|
||||||
}
|
}
|
||||||
@ -3215,11 +3214,10 @@ if ($action == 'create') {
|
|||||||
$(\'input[name="force_fk_account"]\').val(\'1\');
|
$(\'input[name="force_fk_account"]\').val(\'1\');
|
||||||
$("#formtocreate").submit(); */
|
$("#formtocreate").submit(); */
|
||||||
|
|
||||||
// For company change, we must reuse data of comany, not input already done, so we call a GET with action=create, not a POST submit.
|
// For company change, we must submit page with action=create instead of action=add
|
||||||
console.log("We have changed the company - Reload page");
|
console.log("We have changed the company - Resubmit page");
|
||||||
var socid = $(this).val();
|
jQuery("#formtocreateaction").val("create");
|
||||||
var fac_rec = $(\'#fac_rec\').val();
|
jQuery("#formtocreate").submit();
|
||||||
window.location.href = "'.$_SERVER["PHP_SELF"].'?action=create&socid="+socid+"&fac_rec="+fac_rec;
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
|
|||||||
@ -1793,11 +1793,11 @@ if ($resql) {
|
|||||||
|
|
||||||
$with_margin_info = false;
|
$with_margin_info = false;
|
||||||
if (isModEnabled('margin') && (
|
if (isModEnabled('margin') && (
|
||||||
!empty($arrayfields['total_pa']['checked'])
|
!empty($arrayfields['total_pa']['checked'])
|
||||||
|| !empty($arrayfields['total_margin']['checked'])
|
|| !empty($arrayfields['total_margin']['checked'])
|
||||||
|| !empty($arrayfields['total_margin_rate']['checked'])
|
|| !empty($arrayfields['total_margin_rate']['checked'])
|
||||||
|| !empty($arrayfields['total_mark_rate']['checked'])
|
|| !empty($arrayfields['total_mark_rate']['checked'])
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
$with_margin_info = true;
|
$with_margin_info = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,7 +50,7 @@ UseDateWithoutHourOnFichinter=Hides hours and minutes off the date field for int
|
|||||||
InterventionStatistics=Statistics of interventions
|
InterventionStatistics=Statistics of interventions
|
||||||
NbOfinterventions=No. of intervention cards
|
NbOfinterventions=No. of intervention cards
|
||||||
NumberOfInterventionsByMonth=No. of intervention cards by month (date of validation)
|
NumberOfInterventionsByMonth=No. of intervention cards by month (date of validation)
|
||||||
AmountOfInteventionNotIncludedByDefault=Amount of intervention is not included by default into profit (in most cases, timesheets are used to count time spent). Add option PROJECT_INCLUDE_INTERVENTION_AMOUNT_IN_PROFIT to 1 into home-setup-other to include them.
|
AmountOfInteventionNotIncludedByDefault=Amount of intervention is not included by default into profit (in most cases, timesheets are used to count time spent). You can use PROJECT_ELEMENTS_FOR_ADD_MARGIN and PROJECT_ELEMENTS_FOR_MINUS_MARGIN option into home-setup-other to complete list of element included into profit.
|
||||||
InterId=Intervention id
|
InterId=Intervention id
|
||||||
InterRef=Intervention ref.
|
InterRef=Intervention ref.
|
||||||
InterDateCreation=Date creation intervention
|
InterDateCreation=Date creation intervention
|
||||||
|
|||||||
@ -475,7 +475,7 @@ $listofreferent = array(
|
|||||||
'table'=>'fichinter',
|
'table'=>'fichinter',
|
||||||
'datefieldname'=>'date_valid',
|
'datefieldname'=>'date_valid',
|
||||||
'disableamount'=>0,
|
'disableamount'=>0,
|
||||||
'margin'=>'minus',
|
'margin'=>'',
|
||||||
'urlnew'=>DOL_URL_ROOT.'/fichinter/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
'urlnew'=>DOL_URL_ROOT.'/fichinter/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
||||||
'lang'=>'interventions',
|
'lang'=>'interventions',
|
||||||
'buttonnew'=>'AddIntervention',
|
'buttonnew'=>'AddIntervention',
|
||||||
@ -585,9 +585,9 @@ $listofreferent = array(
|
|||||||
'name'=>"MouvementStockAssociated",
|
'name'=>"MouvementStockAssociated",
|
||||||
'title'=>"ListMouvementStockProject",
|
'title'=>"ListMouvementStockProject",
|
||||||
'class'=>'MouvementStock',
|
'class'=>'MouvementStock',
|
||||||
'margin'=>'minus',
|
|
||||||
'table'=>'stock_mouvement',
|
'table'=>'stock_mouvement',
|
||||||
'datefieldname'=>'datem',
|
'datefieldname'=>'datem',
|
||||||
|
'margin'=>'minus',
|
||||||
'disableamount'=>0,
|
'disableamount'=>0,
|
||||||
'test'=>!empty($conf->stock->enabled) && $user->hasRight('stock', 'mouvement', 'lire') && !empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW)),
|
'test'=>!empty($conf->stock->enabled) && $user->hasRight('stock', 'mouvement', 'lire') && !empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW)),
|
||||||
'salaries'=>array(
|
'salaries'=>array(
|
||||||
@ -752,6 +752,7 @@ $total_revenue_ht = 0;
|
|||||||
$balance_ht = 0;
|
$balance_ht = 0;
|
||||||
$balance_ttc = 0;
|
$balance_ttc = 0;
|
||||||
|
|
||||||
|
// Loop on each element type (proposal, sale order, invoices, ...)
|
||||||
foreach ($listofreferent as $key => $value) {
|
foreach ($listofreferent as $key => $value) {
|
||||||
$parameters = array(
|
$parameters = array(
|
||||||
'total_revenue_ht' =>& $total_revenue_ht,
|
'total_revenue_ht' =>& $total_revenue_ht,
|
||||||
@ -787,6 +788,7 @@ foreach ($listofreferent as $key => $value) {
|
|||||||
$total_ht = 0;
|
$total_ht = 0;
|
||||||
$total_ttc = 0;
|
$total_ttc = 0;
|
||||||
|
|
||||||
|
// Loop on each object for the current element type
|
||||||
$num = count($elementarray);
|
$num = count($elementarray);
|
||||||
for ($i = 0; $i < $num; $i++) {
|
for ($i = 0; $i < $num; $i++) {
|
||||||
$tmp = explode('_', $elementarray[$i]);
|
$tmp = explode('_', $elementarray[$i]);
|
||||||
@ -871,7 +873,7 @@ foreach ($listofreferent as $key => $value) {
|
|||||||
$defaultvat = get_default_tva($mysoc, $mysoc);
|
$defaultvat = get_default_tva($mysoc, $mysoc);
|
||||||
$total_ttc_by_line = price2num($total_ht_by_line * (1 + ($defaultvat / 100)), 'MT');
|
$total_ttc_by_line = price2num($total_ht_by_line * (1 + ($defaultvat / 100)), 'MT');
|
||||||
} elseif ($key == 'loan') {
|
} elseif ($key == 'loan') {
|
||||||
$total_ttc_by_line = $total_ht_by_line; // For loan there is actually no taxe managed in Dolibarr
|
$total_ttc_by_line = $total_ht_by_line; // For loan there is actually no taxe managed in Dolibarr
|
||||||
} else {
|
} else {
|
||||||
$total_ttc_by_line = $element->total_ttc;
|
$total_ttc_by_line = $element->total_ttc;
|
||||||
}
|
}
|
||||||
@ -892,19 +894,14 @@ foreach ($listofreferent as $key => $value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Each element with at least one line is output
|
// Each element with at least one line is output
|
||||||
$qualifiedforfinalprofit = true;
|
|
||||||
if ($key == 'intervention' && empty($conf->global->PROJECT_INCLUDE_INTERVENTION_AMOUNT_IN_PROFIT)) {
|
|
||||||
$qualifiedforfinalprofit = false;
|
|
||||||
}
|
|
||||||
//var_dump($key.' '.$qualifiedforfinalprofit);
|
|
||||||
|
|
||||||
// Calculate margin
|
// Calculate margin
|
||||||
if ($qualifiedforfinalprofit) {
|
if ($margin) {
|
||||||
if ($margin == 'add') {
|
if ($margin === 'add') {
|
||||||
$total_revenue_ht += $total_ht;
|
$total_revenue_ht += $total_ht;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($margin != "add") { // Revert sign
|
if ($margin === "minus") { // Revert sign
|
||||||
$total_ht = -$total_ht;
|
$total_ht = -$total_ht;
|
||||||
$total_ttc = -$total_ttc;
|
$total_ttc = -$total_ttc;
|
||||||
}
|
}
|
||||||
@ -920,24 +917,24 @@ foreach ($listofreferent as $key => $value) {
|
|||||||
print '<td class="right">'.$i.'</td>';
|
print '<td class="right">'.$i.'</td>';
|
||||||
// Amount HT
|
// Amount HT
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if ($key == 'intervention' && !$qualifiedforfinalprofit) {
|
if ($key == 'intervention' && !$margin) {
|
||||||
print '<span class="opacitymedium">'.$form->textwithpicto($langs->trans("NA"), $langs->trans("AmountOfInteventionNotIncludedByDefault")).'</span>';
|
print '<span class="opacitymedium">'.$form->textwithpicto($langs->trans("NA"), $langs->trans("AmountOfInteventionNotIncludedByDefault")).'</span>';
|
||||||
} else {
|
} else {
|
||||||
print price($total_ht);
|
|
||||||
if ($key == 'propal') {
|
if ($key == 'propal') {
|
||||||
print '<span class="opacitymedium">'.$form->textwithpicto('', $langs->trans("SignedOnly")).'</span>';
|
print '<span class="opacitymedium">'.$form->textwithpicto('', $langs->trans("SignedOnly")).'</span>';
|
||||||
}
|
}
|
||||||
|
print price($total_ht);
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Amount TTC
|
// Amount TTC
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if ($key == 'intervention' && !$qualifiedforfinalprofit) {
|
if ($key == 'intervention' && !$margin) {
|
||||||
print '<span class="opacitymedium">'.$form->textwithpicto($langs->trans("NA"), $langs->trans("AmountOfInteventionNotIncludedByDefault")).'</span>';
|
print '<span class="opacitymedium">'.$form->textwithpicto($langs->trans("NA"), $langs->trans("AmountOfInteventionNotIncludedByDefault")).'</span>';
|
||||||
} else {
|
} else {
|
||||||
print price($total_ttc);
|
|
||||||
if ($key == 'propal') {
|
if ($key == 'propal') {
|
||||||
print '<span class="opacitymedium">'.$form->textwithpicto('', $langs->trans("SignedOnly")).'</span>';
|
print '<span class="opacitymedium">'.$form->textwithpicto('', $langs->trans("SignedOnly")).'</span>';
|
||||||
}
|
}
|
||||||
|
print price($total_ttc);
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user