Merge branch 'dev-7200'

This commit is contained in:
Dany De Bontridder 2019-12-02 20:22:42 +01:00
commit 2366dcae49
11 changed files with 79 additions and 33 deletions

View file

@ -321,34 +321,79 @@ class Acc_Ledger_Search
case
when jrn_def_type='VEN' then
(select ad_value from fiche_detail where ad_id=1
and f_id=(select max(qs_client) from quant_sold join jrnx using (j_id) join jrn as e on (e.jr_grpt_id=j_grpt) where e.jr_id=x.jr_id))
and f_id=(select max(qs_client) from quant_sold join jrnx
using (j_id) join jrn as e on (e.jr_grpt_id=j_grpt)
where e.jr_id=x.jr_id))
when jrn_def_type = 'ACH' then
(select ad_value from fiche_detail where ad_id=1
and f_id=(select max(qp_supplier) from quant_purchase join jrnx using (j_id) join jrn as e on (e.jr_grpt_id=j_grpt) where e.jr_id=x.jr_id))
(select ad_value
from fiche_detail
where ad_id=1
and f_id=(select max(qp_supplier) from quant_purchase
join jrnx using (j_id) join jrn as e on (e.jr_grpt_id=j_grpt) where e.jr_id=x.jr_id))
when jrn_def_type = 'FIN' then
(select ad_value from fiche_detail where ad_id=1
and f_id=(select qf_other from quant_fin where quant_fin.jr_id=x.jr_id))
end as name,
case
when jrn_def_type='VEN' then (select ad_value from fiche_detail where ad_id=32 and f_id=(select max(qs_client) from quant_sold join jrnx using (j_id) join jrn as e on (e.jr_grpt_id=j_grpt) where e.jr_id=x.jr_id))
when jrn_def_type = 'ACH' then (select ad_value from fiche_detail where ad_id=32 and f_id=(select max(qp_supplier) from quant_purchase join jrnx using (j_id) join jrn as e on (e.jr_grpt_id=j_grpt) where e.jr_id=x.jr_id))
when jrn_def_type = 'FIN' then (select ad_value from fiche_detail where ad_id=32 and f_id=(select qf_other from quant_fin where quant_fin.jr_id=x.jr_id))
when jrn_def_type='VEN' then
(select ad_value from fiche_detail
where ad_id=32
and f_id=(select max(qs_client)
from quant_sold
join jrnx using (j_id)
join jrn as e on (e.jr_grpt_id=j_grpt)
where e.jr_id=x.jr_id))
when jrn_def_type = 'ACH' then (select ad_value
from fiche_detail
where ad_id=32
and f_id=(select max(qp_supplier)
from quant_purchase
join jrnx using (j_id)
join jrn as e on (e.jr_grpt_id=j_grpt)
where e.jr_id=x.jr_id))
when jrn_def_type = 'FIN' then (select ad_value
from fiche_detail
where ad_id=32
and f_id=(select qf_other from quant_fin where quant_fin.jr_id=x.jr_id))
end as first_name,
case
when jrn_def_type='VEN' then (select ad_value from fiche_detail where ad_id=23 and f_id=(select max(qs_client) from quant_sold join jrnx using (j_id) join jrn as e on (e.jr_grpt_id=j_grpt) where e.jr_id=x.jr_id))
when jrn_def_type = 'ACH' then (select ad_value from fiche_detail where ad_id=23 and f_id=(select max(qp_supplier) from quant_purchase join jrnx using (j_id) join jrn as e on (e.jr_grpt_id=j_grpt) where e.jr_id=x.jr_id))
when jrn_def_type = 'FIN' then (select ad_value from fiche_detail where ad_id=23 and f_id=(select qf_other from quant_fin where quant_fin.jr_id=x.jr_id))
when jrn_def_type='VEN' then
(select ad_value
from fiche_detail
where ad_id=23
and f_id=(select max(qs_client)
from quant_sold
join jrnx using (j_id)
join jrn as e on (e.jr_grpt_id=j_grpt)
where e.jr_id=x.jr_id))
when jrn_def_type = 'ACH' then (select ad_value
from fiche_detail
where ad_id=23
and f_id=(select max(qp_supplier)
from quant_purchase
join jrnx using (j_id)
join jrn as e on (e.jr_grpt_id=j_grpt)
where e.jr_id=x.jr_id))
when jrn_def_type = 'FIN' then (select ad_value
from fiche_detail
where ad_id=23
and f_id=(select qf_other from quant_fin where quant_fin.jr_id=x.jr_id))
end as quick_code,
case
when jrn_def_type='VEN' then
(select sum(qs_price)+sum(vat) from
(select qs_internal,qs_price,case when qs_vat_sided<>0 then 0 else qs_vat end as vat from quant_sold where qs_internal=X.jr_internal) as ven_invoice
(select qs_internal,qs_price,case when qs_vat_sided<>0 then 0
else qs_vat end as vat
from quant_sold
where qs_internal=X.jr_internal) as ven_invoice
)
when jrn_def_type = 'ACH' then
(
select sum(qp_price)+sum(vat)+sum(qp_nd_tva)+sum(qp_nd_tva_recup)
from
(select qp_internal,qp_price,qp_nd_tva,qp_nd_tva_recup,qp_vat-qp_vat_sided as vat from quant_purchase where qp_internal=X.jr_internal) as invoice_purchase
(select qp_internal,qp_price,qp_nd_tva,qp_nd_tva_recup,qp_vat-qp_vat_sided as vat
from quant_purchase
where qp_internal=X.jr_internal) as invoice_purchase
)
else null
end as total_invoice,
@ -1069,7 +1114,7 @@ class Acc_Ledger_Search
}
$r.="<TD align=\"right\">";
$r.=( $positive!=0 )?"<font color=\"red\"> - ".nbm($row['jr_montant'])."</font>":nbm($row['jr_montant']);
$r.=( $positive!=0 )?"<font color=\"red\"> - ".nbm($row['total_invoice'])."</font>":nbm($row['total_invoice']);
$r.="</TD>";

View file

@ -28,7 +28,7 @@ if (!defined('ALLOWED'))
*
*/
/**
* @class
* @class Anc_Account_Table
* @brief derived from Manage_Table_SQL ,
*/
require_once NOALYSS_INCLUDE."/lib/manage_table_sql.class.php";
@ -90,4 +90,4 @@ class Anc_Account_Table extends Manage_Table_SQL
if ($is_error==0)return TRUE;
return FALSE;
}
}
}

View file

@ -32,7 +32,7 @@ require_once NOALYSS_INCLUDE.'/class/anc_print.class.php';
require_once NOALYSS_INCLUDE.'/class/anc_plan.class.php';
require_once NOALYSS_INCLUDE.'/class/pdf.class.php';
/**
* @class
* @class Anc_Balance_Double
* @brief Print the crossed balance between 2 plan
*
*/

View file

@ -26,7 +26,7 @@
require_once NOALYSS_INCLUDE."/class/package_noalyss.class.php";
/**
* @class
* @class Package_Plugin
* @brief Manage the installation of plug
*/
class Package_Plugin extends Package_Noalyss

View file

@ -28,7 +28,7 @@ require_once NOALYSS_INCLUDE.'/database/fiche_def_ref_sql.class.php';
*/
/**
* @class
* @class Template_Card_Category
* @brief Manage the template of card category
*/
class Template_Card_Category extends Manage_Table_SQL

View file

@ -29,7 +29,7 @@ require_once NOALYSS_INCLUDE."/database/v_tva_rate_sql.class.php";
require_once NOALYSS_INCLUDE."/database/tva_rate_sql.class.php";
/**
* @class
* @class Tva_Rate_MTable
* @brief Configure the tva : code , rate, label ...
* When using Manage_Table_SQL
*/