forked from Wavyzz/dolibarr
Fix multicurrency not yet supported on contracts
This commit is contained in:
@@ -1559,9 +1559,9 @@ else
|
|||||||
print '<td>'.$langs->trans("ServiceNb", $cursorline).'</td>';
|
print '<td>'.$langs->trans("ServiceNb", $cursorline).'</td>';
|
||||||
print '<td width="80" class="center">'.$langs->trans("VAT").'</td>';
|
print '<td width="80" class="center">'.$langs->trans("VAT").'</td>';
|
||||||
print '<td width="80" class="right">'.$langs->trans("PriceUHT").'</td>';
|
print '<td width="80" class="right">'.$langs->trans("PriceUHT").'</td>';
|
||||||
if (!empty($conf->multicurrency->enabled)) {
|
//if (!empty($conf->multicurrency->enabled)) {
|
||||||
print '<td width="80" class="right">'.$langs->trans("PriceUHTCurrency").'</td>';
|
// print '<td width="80" class="right">'.$langs->trans("PriceUHTCurrency").'</td>';
|
||||||
}
|
//}
|
||||||
print '<td width="30" class="center">'.$langs->trans("Qty").'</td>';
|
print '<td width="30" class="center">'.$langs->trans("Qty").'</td>';
|
||||||
if ($conf->global->PRODUCT_USE_UNITS) print '<td width="30" class="left">'.$langs->trans("Unit").'</td>';
|
if ($conf->global->PRODUCT_USE_UNITS) print '<td width="30" class="left">'.$langs->trans("Unit").'</td>';
|
||||||
print '<td width="50" class="right">'.$langs->trans("ReductionShort").'</td>';
|
print '<td width="50" class="right">'.$langs->trans("ReductionShort").'</td>';
|
||||||
@@ -1571,8 +1571,7 @@ else
|
|||||||
|
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
|
||||||
//
|
// Line in view mode
|
||||||
|
|
||||||
if ($action != 'editline' || GETPOST('rowid') != $objp->rowid)
|
if ($action != 'editline' || GETPOST('rowid') != $objp->rowid)
|
||||||
{
|
{
|
||||||
print '<tr class="tdtop oddeven">';
|
print '<tr class="tdtop oddeven">';
|
||||||
@@ -1608,21 +1607,21 @@ else
|
|||||||
{
|
{
|
||||||
print '<td>'.img_object($langs->trans("ShowProductOrService"), ($objp->product_type ? 'service' : 'product')).' '.dol_htmlentitiesbr($objp->description)."</td>\n";
|
print '<td>'.img_object($langs->trans("ShowProductOrService"), ($objp->product_type ? 'service' : 'product')).' '.dol_htmlentitiesbr($objp->description)."</td>\n";
|
||||||
}
|
}
|
||||||
// TVA
|
// VAT
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print vatrate($objp->tva_tx.($objp->vat_src_code?(' ('.$objp->vat_src_code.')'):''), '%', $objp->info_bits);
|
print vatrate($objp->tva_tx.($objp->vat_src_code?(' ('.$objp->vat_src_code.')'):''), '%', $objp->info_bits);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Price
|
// Price
|
||||||
print '<td class="right">'.($objp->subprice != '' ? price($objp->subprice) : '')."</td>\n";
|
print '<td class="right">'.($objp->subprice != '' ? price($objp->subprice) : '')."</td>\n";
|
||||||
// Price multicurrency
|
// Price multicurrency
|
||||||
if (!empty($conf->multicurrency->enabled)) {
|
/*if (!empty($conf->multicurrency->enabled)) {
|
||||||
print '<td class="linecoluht_currency nowrap right">'.price($objp->multicurrency_subprice).'</td>';
|
print '<td class="linecoluht_currency nowrap right">'.price($objp->multicurrency_subprice).'</td>';
|
||||||
}
|
}*/
|
||||||
// Quantite
|
// Quantity
|
||||||
print '<td class="center">'.$objp->qty.'</td>';
|
print '<td class="center">'.$objp->qty.'</td>';
|
||||||
// Unit
|
// Unit
|
||||||
if($conf->global->PRODUCT_USE_UNITS) print '<td class="left">'.$langs->trans($object->lines[$cursorline-1]->getLabelOfUnit()).'</td>';
|
if($conf->global->PRODUCT_USE_UNITS) print '<td class="left">'.$langs->trans($object->lines[$cursorline-1]->getLabelOfUnit()).'</td>';
|
||||||
// Remise
|
// Discount
|
||||||
if ($objp->remise_percent > 0)
|
if ($objp->remise_percent > 0)
|
||||||
{
|
{
|
||||||
print '<td class="right">'.$objp->remise_percent."%</td>\n";
|
print '<td class="right">'.$objp->remise_percent."%</td>\n";
|
||||||
@@ -1711,7 +1710,7 @@ else
|
|||||||
print $line->showOptionals($extrafields, 'view', array('style'=>'class="oddeven"', 'colspan'=>$colspan), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
print $line->showOptionals($extrafields, 'view', array('style'=>'class="oddeven"', 'colspan'=>$colspan), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Ligne en mode update
|
// Line in mode update
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Ligne carac
|
// Ligne carac
|
||||||
@@ -1741,18 +1740,34 @@ else
|
|||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
// VAT
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
print $form->load_tva("eltva_tx", $objp->tva_tx.($objp->vat_src_code?(' ('.$objp->vat_src_code.')'):''), $mysoc, $object->thirdparty, $objp->fk_product, $objp->info_bits, $objp->product_type, 0, 1);
|
print $form->load_tva("eltva_tx", $objp->tva_tx.($objp->vat_src_code?(' ('.$objp->vat_src_code.')'):''), $mysoc, $object->thirdparty, $objp->fk_product, $objp->info_bits, $objp->product_type, 0, 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
// Price
|
||||||
print '<td class="right"><input size="5" type="text" name="elprice" value="'.price($objp->subprice).'"></td>';
|
print '<td class="right"><input size="5" type="text" name="elprice" value="'.price($objp->subprice).'"></td>';
|
||||||
|
|
||||||
|
// Price multicurrency
|
||||||
|
/*if (!empty($conf->multicurrency->enabled)) {
|
||||||
|
print '<td class="linecoluht_currency nowrap right">'.price($objp->multicurrency_subprice).'</td>';
|
||||||
|
}*/
|
||||||
|
|
||||||
|
// Quantity
|
||||||
print '<td class="center"><input size="2" type="text" name="elqty" value="'.$objp->qty.'"></td>';
|
print '<td class="center"><input size="2" type="text" name="elqty" value="'.$objp->qty.'"></td>';
|
||||||
|
|
||||||
|
// Unit
|
||||||
if ($conf->global->PRODUCT_USE_UNITS)
|
if ($conf->global->PRODUCT_USE_UNITS)
|
||||||
{
|
{
|
||||||
print '<td class="left">';
|
print '<td class="left">';
|
||||||
print $form->selectUnits($objp->fk_unit, "unit");
|
print $form->selectUnits($objp->fk_unit, "unit");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Discount
|
||||||
print '<td class="nowrap right"><input size="1" type="text" name="elremise_percent" value="'.$objp->remise_percent.'">%</td>';
|
print '<td class="nowrap right"><input size="1" type="text" name="elremise_percent" value="'.$objp->remise_percent.'">%</td>';
|
||||||
|
|
||||||
if (! empty($usemargins))
|
if (! empty($usemargins))
|
||||||
{
|
{
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
@@ -2063,6 +2078,7 @@ else
|
|||||||
if ($action != 'editline')
|
if ($action != 'editline')
|
||||||
{
|
{
|
||||||
$forcetoshowtitlelines=1;
|
$forcetoshowtitlelines=1;
|
||||||
|
if (empty($object->multicurrency_code)) $object->multicurrency_code = $conf->currency; // TODO Remove this when multicurrency supported on contracts
|
||||||
|
|
||||||
// Add free products/services
|
// Add free products/services
|
||||||
$object->formAddObjectLine(1, $mysoc, $soc);
|
$object->formAddObjectLine(1, $mysoc, $soc);
|
||||||
|
|||||||
Reference in New Issue
Block a user