Edition Ligne Travaux Supplémentaires

Correction pour permettre l'édition si la ligne n'existe pas dans une précédente situation. Permet l'édition d'une ligne si elle a été ajouté dans la situation actuelle.
This commit is contained in:
Pierre Ardoin
2019-01-29 11:30:14 +01:00
committed by GitHub
parent 30548d977f
commit dd0f6b3829

View File

@@ -99,7 +99,7 @@ $coldisplay=-1; // We remove first td
}
// Do not allow editing during a situation cycle
if (empty($this->situation_cycle_ref) || $this->situation_counter == 1)
if ($line->fk_prev_id == NULL )
{
// editeur wysiwyg
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@@ -137,7 +137,7 @@ $coldisplay=-1; // We remove first td
}
$coldisplay++;
if ($this->situation_counter == 1 || !$this->situation_cycle_ref) {
if ($line->fk_prev_id == NULL ) {
print '<td align="right">' . $form->load_tva('tva_tx', $line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), $seller, $buyer, 0, $line->info_bits, $line->product_type, false, 1) . '</td>';
} else {
print '<td align="right"><input size="1" type="text" class="flat right" name="tva_tx" value="' . price($line->tva_tx) . '" readonly />%</td>';
@@ -145,7 +145,7 @@ $coldisplay=-1; // We remove first td
$coldisplay++;
print '<td align="right"><input type="text" class="flat right" size="5" id="price_ht" name="price_ht" value="' . (isset($line->pu_ht)?price($line->pu_ht,0,'',0):price($line->subprice,0,'',0)) . '"';
if ($this->situation_counter > 1) print ' readonly';
if ($line->fk_prev_id != NULL ) print ' readonly';
print '></td>';
if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) {
@@ -156,7 +156,7 @@ $coldisplay=-1; // We remove first td
{
$coldisplay++;
print '<td align="right"><input type="text" class="flat right" size="5" id="price_ttc" name="price_ttc" value="'.(isset($line->pu_ttc)?price($line->pu_ttc,0,'',0):'').'"';
if ($this->situation_counter > 1) print ' readonly';
if ($line->fk_prev_id != NULL ) print ' readonly';
print '></td>';
}
?>
@@ -167,7 +167,7 @@ $coldisplay=-1; // We remove first td
// must also not be output for most entities (proposal, intervention, ...)
//if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." ";
print '<input size="3" type="text" class="flat right" name="qty" id="qty" value="' . $line->qty . '"';
if ($this->situation_counter > 1) print ' readonly';
if ($line->fk_prev_id != NULL ) print ' readonly';
print '>';
} else { ?>
&nbsp;
@@ -186,7 +186,7 @@ $coldisplay=-1; // We remove first td
<td align="right" class="nowrap"><?php $coldisplay++; ?>
<?php if (($line->info_bits & 2) != 2) {
print '<input size="1" type="text" class="flat right" name="remise_percent" id="remise_percent" value="' . $line->remise_percent . '"';
if ($this->situation_counter > 1) print ' readonly';
if ($line->fk_prev_id != NULL ) print ' readonly';
print '>%';
} else { ?>
&nbsp;