task #0000890: PRINTJRN : export PDF et CSV des operations detaillees
This commit is contained in:
parent
eb7fab94e3
commit
87e82733bd
7 changed files with 277 additions and 67 deletions
|
|
@ -107,3 +107,84 @@ cette fonctionnalité. Vous pouvez en ajouter, en supprimer ou les modifier' whe
|
|||
update menu_ref set me_description_etendue='Suivi des administrations : courrrier, déclarations.' where me_code='ADM' ;
|
||||
update menu_ref set me_description_etendue='Prévision de vos achats, revenus, permet de suivre l''évolution de votre société. Vos prévisions sont des formules sur les postes comptables et vous permettent aussi vos marges brutes.' where me_code='FORECAST' ;
|
||||
|
||||
CREATE OR REPLACE VIEW v_detail_sale AS
|
||||
with m as
|
||||
(select sum(qs_price) as htva, sum(qs_vat) as tot_vat,jr_id from quant_sold join jrnx using (j_id) join jrn on (j_grpt=jr_grpt_id) group by jr_id)
|
||||
SELECT jrn.jr_id,
|
||||
jrn.jr_date,
|
||||
jrn.jr_tech_per,
|
||||
jrn.jr_comment,
|
||||
jrn.jr_pj_number,
|
||||
jrn.jr_internal,
|
||||
jrn.jr_def_id,
|
||||
jrnx.j_poste,
|
||||
jrnx.j_text,
|
||||
jrnx.j_qcode,
|
||||
quant_sold.qs_fiche as item_card,
|
||||
a.name AS item_name,
|
||||
quant_sold.qs_client,
|
||||
b.vw_name AS tiers_name,
|
||||
b.quick_code,
|
||||
tva_rate.tva_label,
|
||||
tva_rate.tva_comment,
|
||||
tva_rate.tva_both_side,
|
||||
quant_sold.qs_vat_sided as vat_sided,
|
||||
quant_sold.qs_vat_code as vat_code,
|
||||
quant_sold.qs_vat as vat,
|
||||
quant_sold.qs_price as price,
|
||||
quant_sold.qs_quantite as quantity,
|
||||
quant_sold.qs_price / quant_sold.qs_quantite AS price_per_unit
|
||||
, htva
|
||||
,tot_vat
|
||||
FROM jrn
|
||||
JOIN jrnx ON jrn.jr_grpt_id = jrnx.j_grpt
|
||||
JOIN quant_sold USING (j_id)
|
||||
JOIN vw_fiche_name a ON quant_sold.qs_fiche = a.f_id
|
||||
JOIN vw_fiche_attr b ON quant_sold.qs_client = b.f_id
|
||||
JOIN tva_rate ON quant_sold.qs_vat_code = tva_rate.tva_id
|
||||
join m on (m.jr_id=jrn.jr_id)
|
||||
;
|
||||
|
||||
CREATE OR REPLACE VIEW v_detail_purchase AS
|
||||
WITH m AS (
|
||||
SELECT sum(quant_purchase.qp_price) AS htva, sum(quant_purchase.qp_vat) AS tot_vat, jrn.jr_id
|
||||
FROM quant_purchase
|
||||
JOIN jrnx USING (j_id)
|
||||
JOIN jrn ON jrnx.j_grpt = jrn.jr_grpt_id
|
||||
GROUP BY jrn.jr_id
|
||||
)
|
||||
SELECT jrn.jr_id,
|
||||
jrn.jr_date
|
||||
, jrn.jr_tech_per
|
||||
, jrn.jr_comment
|
||||
, jrn.jr_pj_number
|
||||
, jrn.jr_internal
|
||||
, jrn.jr_def_id
|
||||
, jrnx.j_poste
|
||||
, jrnx.j_text
|
||||
, jrnx.j_qcode
|
||||
, quant_purchase.qp_fiche AS item_card
|
||||
, a.name AS item_name
|
||||
, quant_purchase.qp_supplier
|
||||
, b.vw_name AS tiers_name
|
||||
, b.quick_code
|
||||
, tva_rate.tva_label
|
||||
, tva_rate.tva_comment
|
||||
, tva_rate.tva_both_side
|
||||
, quant_purchase.qp_vat_sided AS vat_sided
|
||||
, quant_purchase.qp_vat_code AS vat_code
|
||||
, quant_purchase.qp_vat AS vat
|
||||
, quant_purchase.qp_price AS price
|
||||
, quant_purchase.qp_quantite AS quantity
|
||||
, quant_purchase.qp_price / quant_purchase.qp_quantite AS price_per_unit
|
||||
, quant_purchase.qp_nd_amount AS non_ded_amount
|
||||
, quant_purchase.qp_nd_tva AS non_ded_tva
|
||||
, quant_purchase.qp_nd_tva_recup AS non_ded_tva_recup
|
||||
, m.htva, m.tot_vat
|
||||
FROM jrn
|
||||
JOIN jrnx ON jrn.jr_grpt_id = jrnx.j_grpt
|
||||
JOIN quant_purchase USING (j_id)
|
||||
JOIN vw_fiche_name a ON quant_purchase.qp_fiche = a.f_id
|
||||
JOIN vw_fiche_attr b ON quant_purchase.qp_supplier = b.f_id
|
||||
JOIN tva_rate ON quant_purchase.qp_vat_code = tva_rate.tva_id
|
||||
JOIN m ON m.jr_id = jrn.jr_id;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue