Revision 409d5d5f
Von Kivitendo Admin vor etwa 11 Jahren hinzugefügt
SL/VK.pm | ||
---|---|---|
53 | 53 |
# default usage: always use parts.description for (sub-)totalling and in header and subheader lines |
54 | 54 |
# but use invoice.description in article mode |
55 | 55 |
# so we extract both versions in our query and later overwrite the description in article mode |
56 |
# qq| , (SELECT sum(invoice.qty*invoice.sellprice/CASE WHEN price_factor IS NOT NULL THEN price_factor ELSE 1.0 END) FROM invoice where invoice.parts_id = i.parts_id) as "sellpricelinetotal2" | . |
|
57 | 56 |
|
58 | 57 |
my $query = |
59 |
qq|SELECT ct.id as customerid, ct.name as customername,ct.customernumber,ct.country,ar.invnumber,ar.id,ar.transdate,p.partnumber,p.description as description, pg.partsgroup,i.parts_id,i.qty,i.price_factor,i.discount,i.description as invoice_description,i.lastcost,i.sellprice,i.fxsellprice,i.marge_total,i.marge_percent,i.unit,b.description as business,e.name as employee,e2.name as salesman, to_char(ar.transdate,'Month') as month, to_char(ar.transdate, 'YYYYMM') as nummonth, p.unit as parts_unit, p.weight |; |
|
60 |
|
|
61 |
# debug modus for comparing linetotal according to database and perl |
|
62 |
$query .= qq| , (i.qty*i.sellprice/CASE WHEN price_factor IS NOT NULL THEN i.price_factor ELSE 1.0 END) as sellpricelinetotal | if $form->{"l_sellpricelinetotal"}; |
|
63 |
|
|
64 |
$query .= |
|
58 |
qq|SELECT ct.id as customerid, ct.name as customername,ct.customernumber,ct.country,ar.invnumber,ar.id,ar.transdate,p.partnumber,p.description as description, pg.partsgroup,i.parts_id,i.qty,i.price_factor,i.discount,i.description as invoice_description,i.lastcost,i.sellprice,i.fxsellprice,i.marge_total,i.marge_percent,i.unit,b.description as business,e.name as employee,e2.name as salesman, to_char(ar.transdate,'Month') as month, to_char(ar.transdate, 'YYYYMM') as nummonth, p.unit as parts_unit, p.weight | . |
|
65 | 59 |
qq|FROM invoice i | . |
66 | 60 |
qq|JOIN ar on (i.trans_id = ar.id) | . |
67 | 61 |
qq|JOIN parts p on (i.parts_id = p.id) | . |
Auch abrufbar als: Unified diff
Revert "Neue Verkaufsberichtvariante mit Umsatz-Sortierung"
This reverts commit 5ef8b31028dada9eff3c317fe92c0a9b05ea41a4.
Bevor mit das jemand um die Ohren haut, das sollte eigentlich nicht
committed werden. Kommt vielleicht in Zukunft mal rein.