How to print subtotal amount in qweb odoo - odoo

In sales, there is a field named subtotal which holds the value of total amount of all products in line items 'order_line'.
In sale order Qweb report,
Consider if I'm having 12 products showing in first page of my Qweb costing for say 12000, and 6 products in second page of my Qweb costing for say 8000,
I need to print at the end of first page subtotal = 12000 and at the end of second page subtotal = 8000.
Kindly help me to solve this!
Thanks in advance!

Hi have you tried usage of sections (Add Section) in quotation for example? When you use this approach you can see subtotal in section header.
Create quations with sections:
Print report:

Related

Sum Calculation for Tax

Can you please help me on Crystal Report, where I'm trying to create a formula.
Case:
I have 2 tables, Table1 has some columns (like ItemName, ItemPrice, TaxType, TaxRate).
Table2 has Items sold with columns (like ItemName, Qty, ItemPrice, ItemTotal).
I have also linked the column in crystal report for ItemName, so that they can fetch related data.
I am looking for a formula in crystal report that can sum up tax rate * item total where tax type= VAT and TaxType= GST
My formula structure will be like:
VATSum ({table1.taxrate}*{table2.totalamount}) where table1.taxtype= 'VAT'
GSTSum ({table1.taxrate}*{table2.totalamount}) where table1.taxtype= 'GST'
Please guide.
I would really appreciate any body's efforts to solve this problem.
In Group Expert you will want to begin by creating a Group on the {table1.taxtype} field. This will ensure all of your VAT and GST items sold are grouped together. If you have other taxtype values than VAT and GST you will need to decide how to handle those taxtypes. You use Select Expert to filter them out if they are not needed for the report, or do nothing and they will all appear within additional groups on the report by their taxtype values.
You will need to then create a formula field that can be used to calculate the tax for each item sold. The name of this formula will be referenced by other formula fields in the report, so I will call this formula field itemTax in this example. The formula for this field will be:
{table1.taxrate}*{table2.totalamount};
Place the itemTax formula field into the details section of the report.
From here you have 3 options on how to calculate the sum of itemTax. You may insert a Summary Field, a Running Total Field, or another Formula Field. Any of them will work for you, but I will continue with the Formula Field option.
Create another formula field and name it totalTaxByGroup. The formula for this field will be:
Sum({#itemTax}, {table1.taxtype});
Then place this formula field in the Group Footer section of the taxtype group.

get previous total from filtered amount in crystal report

I have created the following report in Crystal Report using VB.Net 2012. The OPENING BALANCE & NET TOTAL rows are not in my report but my question is there.
TR_ID | TR_DATE |DETAILS | EXPENSE | INCOME | BALANCE
OPENING BALANCE 0.00
1005 08/24/2015 CASH RTN 0.00 10,000.00 10,000.00
1013 08/25/2015 PURCHASE 3,500.00 0.00 6,500.00
1014 08/25/2015 DEPOSIT 5,000.00 0.00 1,500.00
1013 08/27/2015 SALES 0.00 4,000.00 5,500.00
NET TOTAL 5,500.00
I filtered the specific records within the date range of 08/25/2015 and 08/26/2015 & it works well. My question is how I get the previous balance (10000) of the specific date (08/25/2015) in "OPENING BALANCE" row and the total balance in "NET TOTAL" row?
As per the given datas above, the report shows the 4 records well excluding the rows of OPENING BALANCE & NET TOTAL. I want to add the OPENING BALANCE row to show the opening balance of every vendors' accounts when I open the report. And if I view the records of a particular customer within a date range, then OPENING BALANCE row should show the previous balance until the start date of the given date criteria. Ex: If I select records from 08/25/2015 to 08/26/2015 as per above datas, the report will show the two particular records (2nd & 3rd). But I want to show the previous balance 10,000 or the total amount which is above to the star date (08/25/2015) should be shown in the OPENING BALANCE row. And the sub total amount of this vendor's
should be shown in the last NET TOTAL row. So, pls help me, how the formulas will come & how to do.
Thank you
I expect your great help
Thank you
It´s not too much clear to me, but you may try to get the values directly from the report using a variable to do it.
With the report opened, you may entry in the CrystalReport option and select "Selection Expert - Saved Data".
You must create a formula using the "Formula Field" at left panel, and build it using the top 3 windows:
The first top window shows the fields of the table your report handles;
The middle top window show some built-in formulas
SO, you must
Go to formula field and create a new one;
Select the field at the top-left window you want to get (the Openning)
Drag-drop it into the main window (below the 3 top selections) and save it as a new variable
Add this variable into your report. This way, you may get this field for calculations in the same report.
Is it you need to do?
Sorry if I cannot understand exactly what you need.
Hugs!
UPDATE
You may have TOTAL creating a formula of SUM within report.
Click on the field EXPENSE (which appear in 3 rows) and select in menu: CRYSTAL REPORTS - INSERT - SUMMARY. It will create a field that must be positioned at the bottom (in the new Group will be created).
Do the same with INCOME field.
Create a FORMULA FIELD at the bottom to calculate the difference between both SUMARIES. You can name each of these summary fields (like IncSum and ExpSum) and put in that third field: IncSum-ExpSum. You may also put them as invisible.
Your final balance should be:
OldBalance (the parameter I point next lines)
+
Movement (the field that reflects IncSum-ExpSum)
To get the last/old Balance, you may have to get it from code as pass it as a PARAMETER. To do this, create a parameter in te report: see in the FIELD EXPLORER you have a choice of PARAMETER FIELD. AFter create it, use this code:
Dim MyCrystalReportt As New ReportDocument()
MyCrystalReportt.Load(Application.StartupPath & "\ReportSample.rpt\")
MyCrystalReportt.SetDatabaseLogon(UserID, Password, DataSource, InitialCatalog)
Dim myLogonInfo As New TableLogOnInfo()
Dim myTable As Table
For Each myTable In MyCrystalReportt.Database.Tables
myLogonInfo = myTable.LogOnInfo
myLogonInfo.ConnectionInfo.ServerName = DataSource
myLogonInfo.ConnectionInfo.DatabaseName = InitialCatalog
myLogonInfo.ConnectionInfo.UserID = UserID
myLogonInfo.ConnectionInfo.Password = Password
myTable.ApplyLogOnInfo(myLogonInfo)
Next
MyCrystalReportt.SetParameterValue("Data1", LastBalance.Value.ToString)
ReportsForm.CrystalReportViewer1.Reportsource = MyCrystalReport
ReportsForm.show
Notes:
You may have a form (ReportsForm) with a Crystal Control within (CrystalReportViewer1).
Datasource is the Server Name or IP
InitialCatalog is the Database (not the table!)
The ParameterValue MUST be a string - is numeric is required, convert it to number inside the Report. Use a temp_field to get it (see formulas of Crystal and you will find some to make this task).
I hope it can help you.
Good luck.

Conditionate percentage formula Crystal reports

What I'm trying to do is to get the percentage of quotes that got converted into sales orders by each sales reps. So I have something that looks like this
John Doe
Sales orders Quotes
2302000
2304921 90039393
2353647
2609439
2340055
Given that info, 20% of orders by the rep were converted from a quote. the logic obviously is (#qt/#so)*100, but I don't know how to type in that formula in SQL into the FORMULA FIELDS part. Any Help will be appreciated.
Add the following formula to group's header or footer section:
// {#% Total}
IF Count({table.order_id},{table.rep})<>0 THEN
Count({table.quote_id},{table.rep}) / Count({table.order_id},{table.rep}) * 100

Counting text-items per page in MS access

I'd like to count a text-string in every page on a report and print out the count of the strings in the page-footer.
Searching for a string in a text field is straight forward, counting the findings within the text-field too, but how is it possible to sum the findings in a integer variable per report-page when it has several entries?
i.e. I´ve got a report-page like this where each new line is a new record.
Here the first report-page:
aaaaaaF
aaaaaFF
ffaaaaaaaaa
FaaaaaFF
Now the page-footer:
There are 4 records. The letter "F" has been found 6 times on this report page.
Now the second report-page:
aaaFaaF
aaaaaF
fFaaaaaaaaa
FaaaFaFF
FFaaaaFa
page-footer:
There are 5 records. The letter "F" has been found 10 times on this report page.
I'd be happy if smdy has an advice for me.
Thanks!
First step is to figure out how many occurances of "f" occur in each record. Which you can do using
= Len([myField]) - Len(Replace([myField],"f",""))
Now for the total occurances in that page you use the Sum function in a text box in the report footer section.
= Sum( ... )
= Sum(Len([myField]) - Len(Replace([myField],"f",""))) ' if report based on a table
= Sum([myCalculatedField]) ' if you use the occurance count formula in the query instead
If you need to total across the page there is a link detailing how to go about it here (you'll have to scroll down a bit)
http://office.microsoft.com/en-us/access-help/summing-in-reports-HA001122444.aspx
You haven't shown any of the expressions that you are using but, essentially, in the Report Footer you would include a textbox which uses your aggregate function:
=COUNT([SomeField]) 'or
=SUM(iif(some condition, 1, 0))
where SomeField is a field in the detail section, or some condition refers to this field.
That is, you need to SUM (or COUNT) across the whole report by referring to field(s) in the details section. You do not do this by attempting to refer to the subtotals that you have in the page-footers - this won't work.

profile loss statement report

i want to make crystal report of profit and loss statement
i have a column of "vr_type" and there are 4 types in it "sale invoice", purchase invoice" now i want that put a 4 formula s where i select that "sum (vr_detail.debit) where vr_detail.vr_type} sale invoice it make Sum of al these types so kindly tell me what formula i should use to get the result
in simply i want sum of sale,sum of purchase,sum of expense
thanks
Crystal Reports doesn't have a sumif() function. You will need to create a formula field for each type of field that you want to summarize, then insert a Summarized field on the formula field.
For example, you could create a field named 'sales invoice'. The text of the formula would be:
if {vr_detail.vr_type}="sales invoice" then
{vr_detail.debit}
else
0
You would then select this field, then Insert | Summary...
You'll need to repeat this for each field.
** edit **
If you simply want subtotals by vr_type, follow these steps:
Insert a group on the {vr_detail.vr_type} field. This will add a group-header (GH) and group-footer (GF) section to the report.
Insert a summarized field on the {vr_detail.debit} and/or {vr_detail.credit} field.