Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0
Conflicts: htdocs/compta/facture/class/facture.class.php
This commit is contained in:
commit
21665cdc85
@ -1713,6 +1713,8 @@ if (empty($reshook))
|
||||
|
||||
if (!empty($origin) && !empty($originid))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||
|
||||
$object->origin = $origin;
|
||||
$object->origin_id = $originid;
|
||||
|
||||
@ -1724,6 +1726,17 @@ if (empty($reshook))
|
||||
$line->fetch_optionals($line->id);
|
||||
$line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note
|
||||
|
||||
// The $line->situation_percent has been modified, so we must recalculate all amounts
|
||||
$tabprice = calcul_price_total($line->qty, $line->subprice, $line->remise_percent, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 0, 'HT', 0, $line->product_type, $mysoc, '', $line->situation_percent);
|
||||
$line->total_ht = $tabprice[0];
|
||||
$line->total_tva = $tabprice[1];
|
||||
$line->total_ttc = $tabprice[2];
|
||||
$line->total_localtax1 = $tabprice[9];
|
||||
$line->total_localtax2 = $tabprice[10];
|
||||
$line->multicurrency_total_ht = $tabprice[16];
|
||||
$line->multicurrency_total_tva = $tabprice[17];
|
||||
$line->multicurrency_total_ttc = $tabprice[18];
|
||||
|
||||
// Si fk_remise_except defini on vérifie si la réduction à déjà été appliquée
|
||||
if ($line->fk_remise_except)
|
||||
{
|
||||
@ -1768,6 +1781,7 @@ if (empty($reshook))
|
||||
{
|
||||
$nextSituationInvoice = new Facture($db);
|
||||
$nextSituationInvoice->fetch($id);
|
||||
|
||||
// create extrafields with data from create form
|
||||
$extrafields->fetch_name_optionals_label($nextSituationInvoice->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $nextSituationInvoice);
|
||||
|
||||
@ -5404,7 +5404,7 @@ class FactureLigne extends CommonInvoiceLine
|
||||
$sql = 'SELECT fd.situation_percent FROM '.MAIN_DB_PREFIX.'facturedet fd';
|
||||
$sql .= ' JOIN '.MAIN_DB_PREFIX.'facture f ON (f.rowid = fd.fk_facture) ';
|
||||
$sql .= ' WHERE fd.fk_prev_id ='.$this->fk_prev_id;
|
||||
$sql .= ' AND f.situation_cycle_ref = '.$tmpinvoice->situation_cycle_ref; // Prevent cycle outed
|
||||
$sql .= ' AND f.situation_cycle_ref = '.$invoicecache[$invoiceid]->situation_cycle_ref; // Prevent cycle outed
|
||||
$sql .= ' AND f.type = '.Facture::TYPE_CREDIT_NOTE;
|
||||
|
||||
$res = $this->db->query($sql);
|
||||
@ -5412,6 +5412,8 @@ class FactureLigne extends CommonInvoiceLine
|
||||
while ($obj = $this->db->fetch_object($res)) {
|
||||
$returnPercent = $returnPercent + floatval($obj->situation_percent);
|
||||
}
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user