mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-11 03:51:25 +01:00
Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
@@ -106,7 +106,7 @@ if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))
|
||||
$date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
|
||||
}
|
||||
|
||||
$sql = "SELECT f.rowid, f.ref, f.type, f.datef as df, f.ref_client, f.date_lim_reglement as dlr, f.close_code, f.retained_warranty,";
|
||||
$sql = "SELECT f.rowid, f.ref, f.type, f.situation_cycle_ref, f.datef as df, f.ref_client, f.date_lim_reglement as dlr, f.close_code, f.retained_warranty,";
|
||||
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.situation_percent, fd.vat_src_code, fd.info_bits,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.code_client, s.code_fournisseur,";
|
||||
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
||||
@@ -206,21 +206,23 @@ if ($result) {
|
||||
$def_tva[$obj->rowid][$compta_tva][vatrate($obj->tva_tx).($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : '')] = (vatrate($obj->tva_tx).($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''));
|
||||
}
|
||||
|
||||
if ($obj->type == Facture::TYPE_SITUATION) {
|
||||
// Avoid divide by 0
|
||||
if ($obj->situation_percent == 0) {
|
||||
$situation_ratio = 0;
|
||||
} else {
|
||||
$line = new FactureLigne($db);
|
||||
$line->fetch($obj->fdid);
|
||||
// Create a compensation rate.
|
||||
$situation_ratio = 1;
|
||||
if (getDolGlobalInt('INVOICE_USE_SITUATION') == 1) {
|
||||
if ($obj->situation_cycle_ref) {
|
||||
// Avoid divide by 0
|
||||
if ($obj->situation_percent == 0) {
|
||||
$situation_ratio = 0;
|
||||
} else {
|
||||
$line = new FactureLigne($db);
|
||||
$line->fetch($obj->fdid);
|
||||
|
||||
// Situation invoices handling
|
||||
$prev_progress = $line->get_prev_progress($obj->rowid);
|
||||
// Situation invoices handling
|
||||
$prev_progress = $line->get_prev_progress($obj->rowid);
|
||||
|
||||
$situation_ratio = ($obj->situation_percent - $prev_progress) / $obj->situation_percent;
|
||||
$situation_ratio = ($obj->situation_percent - $prev_progress) / $obj->situation_percent;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$situation_ratio = 1;
|
||||
}
|
||||
|
||||
// Invoice lines
|
||||
|
||||
Reference in New Issue
Block a user