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

Conflicts:
	htdocs/comm/remx.php
	htdocs/expedition/card.php
	htdocs/fourn/facture/card.php
This commit is contained in:
Laurent Destailleur 2019-11-22 15:04:40 +01:00
commit e4d9f99484
4 changed files with 43 additions and 33 deletions

View File

@ -1437,7 +1437,7 @@ if ($id > 0)
// related contact
print '<tr><td>'.$langs->trans("ActionOnContact").'</td><td>';
print '<div class="maxwidth200onsmartphone">';
print $form->selectcontacts($object->socid, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 0, 'quatrevingtpercent', false, 0, 0, array(), 'multiple', 'contactid');
print $form->selectcontacts($object->socid, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 1, 'quatrevingtpercent', false, 0, 0, array(), 'multiple', 'contactid');
print '</div>';
print '</td>';
print '</tr>';

View File

@ -736,35 +736,34 @@ if ($socid > 0)
// Discount linked to invoice lines
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
$sql .= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,";
$sql .= " rc.fk_facture_source,";
$sql .= " u.login, u.rowid as user_id,";
$sql .= " f.rowid, f.ref,";
$sql .= " fa.ref as ref, fa.type as type";
$sql .= " f.rowid as invoiceid, f.ref,";
$sql .= " fa.ref as invoice_source_ref, fa.type as type";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
$sql .= " , ".MAIN_DB_PREFIX."user as u";
$sql .= " , ".MAIN_DB_PREFIX."facturedet as fc";
$sql .= " , ".MAIN_DB_PREFIX."societe_remise_except as rc";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fa ON rc.fk_facture_source = fa.rowid";
$sql .= " WHERE rc.fk_soc =".$object->id;
$sql .= " WHERE rc.fk_soc =". $object->id;
$sql .= " AND rc.fk_facture_line = fc.rowid";
$sql .= " AND fc.fk_facture = f.rowid";
$sql .= " AND rc.fk_user = u.rowid";
$sql .= " AND rc.discount_type = 0"; // Eliminate supplier discounts
$sql .= " ORDER BY dc DESC";
//$sql.= " UNION ";
// Remises liees a factures
// Discount linked to invoices
$sql2 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,";
$sql2 .= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,";
$sql2 .= " rc.fk_facture_source,";
$sql2 .= " u.login, u.rowid as user_id,";
$sql2 .= " f.rowid, f.ref,";
$sql2 .= " fa.ref as ref, fa.type as type";
$sql2 .= " f.rowid as invoiceid, f.ref,";
$sql2 .= " fa.ref as invoice_source_ref, fa.type as type";
$sql2 .= " FROM ".MAIN_DB_PREFIX."facture as f";
$sql2 .= " , ".MAIN_DB_PREFIX."user as u";
$sql2 .= " , ".MAIN_DB_PREFIX."societe_remise_except as rc";
$sql2 .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fa ON rc.fk_facture_source = fa.rowid";
$sql2 .= " WHERE rc.fk_soc =".$object->id;
$sql2 .= " WHERE rc.fk_soc =". $object->id;
$sql2 .= " AND rc.fk_facture = f.rowid";
$sql2 .= " AND rc.fk_user = u.rowid";
$sql2 .= " AND rc.discount_type = 0"; // Eliminate supplier discounts
@ -833,7 +832,7 @@ if ($socid > 0)
{
print '<td class="minwidth100">';
$facturestatic->id = $obj->fk_facture_source;
$facturestatic->ref = $obj->ref;
$facturestatic->ref = $obj->invoice_source_ref;
$facturestatic->type = $obj->type;
print preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $obj->description).' '.$facturestatic->getNomURl(1);
print '</td>';
@ -842,7 +841,7 @@ if ($socid > 0)
{
print '<td class="minwidth100">';
$facturestatic->id = $obj->fk_facture_source;
$facturestatic->ref = $obj->ref;
$facturestatic->ref = $obj->invoice_source_ref;
$facturestatic->type = $obj->type;
print preg_replace('/\(DEPOSIT\)/', $langs->trans("InvoiceDeposit"), $obj->description).' '.$facturestatic->getNomURl(1);
print '</td>';
@ -851,7 +850,7 @@ if ($socid > 0)
{
print '<td class="minwidth100">';
$facturestatic->id = $obj->fk_facture_source;
$facturestatic->ref = $obj->ref;
$facturestatic->ref = $obj->invoice_source_ref;
$facturestatic->type = $obj->type;
print preg_replace('/\(EXCESS RECEIVED\)/', $langs->trans("Invoice"), $obj->description).' '.$facturestatic->getNomURl(1);
print '</td>';
@ -862,7 +861,12 @@ if ($socid > 0)
print $obj->description;
print '</td>';
}
print '<td class="left nowrap"><a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->rowid.'">'.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.'</a></td>';
print '<td class="left nowrap">';
if ($obj->invoiceid)
{
print '<a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->invoiceid.'">'.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.'</a>';
}
print '</td>';
print '<td class="right">'.price($obj->amount_ht).'</td>';
if (!empty($conf->multicurrency->enabled))
{
@ -909,32 +913,32 @@ if ($socid > 0)
$sql .= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,";
$sql .= " rc.fk_invoice_supplier_source,";
$sql .= " u.login, u.rowid as user_id,";
$sql .= " f.rowid, f.ref as ref,";
$sql .= " fa.ref, fa.type as type";
$sql .= " f.rowid as invoiceid, f.ref as ref,";
$sql .= " fa.ref as invoice_source_ref, fa.type as type";
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
$sql .= " , ".MAIN_DB_PREFIX."user as u";
$sql .= " , ".MAIN_DB_PREFIX."facture_fourn_det as fc";
$sql .= " , ".MAIN_DB_PREFIX."societe_remise_except as rc";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as fa ON rc.fk_invoice_supplier_source = fa.rowid";
$sql .= " WHERE rc.fk_soc =".$object->id;
$sql .= " WHERE rc.fk_soc =". $object->id;
$sql .= " AND rc.fk_invoice_supplier_line = fc.rowid";
$sql .= " AND fc.fk_facture_fourn = f.rowid";
$sql .= " AND rc.fk_user = u.rowid";
$sql .= " AND rc.discount_type = 1"; // Eliminate customer discounts
$sql .= " ORDER BY dc DESC";
//$sql.= " UNION ";
// Remises liees a factures
// Discount linked to invoices
$sql2 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,";
$sql2 .= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,";
$sql2 .= " rc.fk_invoice_supplier_source,";
$sql2 .= " u.login, u.rowid as user_id,";
$sql2 .= " f.rowid, f.ref as ref,";
$sql2 .= " fa.ref, fa.type as type";
$sql2 .= " f.rowid as invoiceid, f.ref as ref,";
$sql2 .= " fa.ref as invoice_source_ref, fa.type as type";
$sql2 .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
$sql2 .= " , ".MAIN_DB_PREFIX."user as u";
$sql2 .= " , ".MAIN_DB_PREFIX."societe_remise_except as rc";
$sql2 .= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as fa ON rc.fk_invoice_supplier_source = fa.rowid";
$sql2 .= " WHERE rc.fk_soc =".$object->id;
$sql2 .= " WHERE rc.fk_soc =". $object->id;
$sql2 .= " AND rc.fk_invoice_supplier = f.rowid";
$sql2 .= " AND rc.fk_user = u.rowid";
$sql2 .= " AND rc.discount_type = 1"; // Eliminate customer discounts
@ -1003,7 +1007,7 @@ if ($socid > 0)
{
print '<td class="minwidth100">';
$facturefournstatic->id = $obj->fk_invoice_supplier_source;
$facturefournstatic->ref = $obj->ref;
$facturefournstatic->ref = $obj->invoice_source_ref;
$facturefournstatic->type = $obj->type;
print preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $obj->description).' '.$facturefournstatic->getNomURl(1);
print '</td>';
@ -1012,7 +1016,7 @@ if ($socid > 0)
{
print '<td class="minwidth100">';
$facturefournstatic->id = $obj->fk_invoice_supplier_source;
$facturefournstatic->ref = $obj->ref;
$facturefournstatic->ref = $obj->invoice_source_ref;
$facturefournstatic->type = $obj->type;
print preg_replace('/\(DEPOSIT\)/', $langs->trans("InvoiceDeposit"), $obj->description).' '.$facturefournstatic->getNomURl(1);
print '</td>';
@ -1021,7 +1025,7 @@ if ($socid > 0)
{
print '<td class="minwidth100">';
$facturefournstatic->id = $obj->fk_invoice_supplier_source;
$facturefournstatic->ref = $obj->ref;
$facturefournstatic->ref = $obj->invoice_source_ref;
$facturefournstatic->type = $obj->type;
print preg_replace('/\(EXCESS PAID\)/', $langs->trans("Invoice"), $obj->description).' '.$facturefournstatic->getNomURl(1);
print '</td>';
@ -1032,7 +1036,11 @@ if ($socid > 0)
print $obj->description;
print '</td>';
}
print '<td class="left nowrap"><a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$obj->rowid.'">'.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.'</a></td>';
print '<td class="left nowrap">';
if ($obj->invoiceid) {
print '<a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$obj->invoiceid.'">'.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.'</a>';
}
print '</td>';
print '<td class="right">'.price($obj->amount_ht).'</td>';
if (!empty($conf->multicurrency->enabled))
{

View File

@ -2459,10 +2459,10 @@ elseif ($id || $ref)
if (!empty($conf->productbatch->enabled)) $colspan++;
if (!empty($conf->stock->enabled)) $colspan++;
$lines[$i]->fetch_optionals($lines[$i]->id);
$line = $lines[$i];
$line->fetch_optionals($line->id);
print '<tr class="oddeven">';
if ($action == 'editline' && $lines[$i]->id == $line_id)
if ($action == 'editline' && $line->id == $line_id)
{
print $lines[$i]->showOptionals($extrafields, 'edit', array('colspan'=>$colspan), $indiceAsked);
}
@ -2470,7 +2470,6 @@ elseif ($id || $ref)
{
print $lines[$i]->showOptionals($extrafields, 'view', array('colspan'=>$colspan), $indiceAsked);
}
print '</tr>';
}
}
}

View File

@ -2674,11 +2674,14 @@ else
else $calculationrule = (empty($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND) ? 'totalofround' : 'roundoftotal');
if ($calculationrule == 'totalofround') $calculationrulenum = 1;
else $calculationrulenum = 2;
$s = $langs->trans("ReCalculate").' ';
$s .= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=totalofround">'.$langs->trans("Mode1").'</a>';
$s .= ' / ';
$s .= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=roundoftotal">'.$langs->trans("Mode2").'</a>';
print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc", $calculationrulenum).'<br>'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('', 'help'));
// Show link for "recalculate"
if (empty($object->getVentilExportCompta())) {
$s = $langs->trans("ReCalculate").' ';
$s .= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=totalofround">'.$langs->trans("Mode1").'</a>';
$s .= ' / ';
$s .= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=roundoftotal">'.$langs->trans("Mode2").'</a>';
print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc", $calculationrulenum).'<br>'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('', 'help'));
}
print '</div></td></tr>';
// Amount Local Taxes