Shopware 6 and counting of VAT - shopware

Can anyone explain how Shopware counts VAT in total price for Cart?
I have a cart with one product that costs 1.309 euro. Tax rate is 19%, so tax value is 0.24871. This I can understand: 1.309/100*19=0,24871.
But then it adds shipping cost (2 euro). It somehow makes 3.3074732824427 euro (don't konow how), but even more strange for me that 19% from this amount makes 0.56871. How they are calculating this? 3.307/10019 is about 0.63, and 3.307/11919 is about 0.53, but not 0.57.
Also, is there any way to change this algorithm programmatically? I use in my Calculator $this->taxCalculator->calculateNetTaxes() for every product, but it doesn't count total sum. And method $toCalculate->setPrice() in my CartProcessor doesn't work.

If 1.309 is a gross price, it means that tax is included and in fact it is 119% (net prices(100%) + VAT(19%)).
So VAT of product is (1.309/119)*19 = 0.209
VAT of shipping is (2/119)*19 = 0.319.... (by same logic)
and at the end 0.209+0.319 = 0.528

Related

Debating: Average of the Average vs Average

I know this is an old question. You will probably conclude that Average of the Average is always wrong. Consider the following example:
You want to know the purchasing behaviour for a supermarket by understanding the share% of the baskeket. For each order, you can have a share% across product categories. The dataset can be like this:
order_id, grocery%, tabacco%, cloth%, etc. The share% is based on the order amount. Each row is a unique order_id.
If you are summing up all grocery amount and divided by total order amount, you can indeed get the average grocery share. If given more contexts, let's say, the VIP in this supermarket accounts for 10% and each order they can spend 1 million (just assumption). So it is quite possible that the result tends to be close to the VIP result.
If I am more interested in the average player behaviour, it seems to use the average of the average metric, which is this one: (grocery% + grocery% + ...)/order number.
Any thoughts?
So let me try to answer your question with an example.
Let us say, there were only three purchases made in the supermarket.
Purchase 1
Grocery Amount = 30$ (60%)
Cloth Amount = 20$ (40%)
Purchase 2
Grocery Amount = 10$ (50%)
Cloth Amount = 10$ (50%)
Purchase 3
Grocery Amount = 5$ (25%)
Cloth Amount = 15$ (75%)
Now let us calculate our metrics:
Approach "Average of Average"
Final Answer = (25% + 50% + 60%)/3 = 45%
Approach "Average"
Final Answer = (5$ + 10$ + 30$)*100/140$ = 32.14%
Conclusion
Given the example above, obviously, the "average" approach leads to a more accurate result. But given your use case, you can use any of these.
Hope this helps!

Excel formula for recommending a value based on a dynamic set of rules

Hi I am not sure if this specific question has been asked but I am wondering if anyone can help me with this.
Sale Price
9.98
Fixed
Expenses %
0.35
Fixed
Expenses
3.49
Sale Price * Expenses %
Cost
4.99
Fixed
ROI %
0.40
Dynamic
Adjusted Cost
Result
Basically what we want to achieve is a cost recommendation based off of the ROI %, so as you change the ROI % then the Cost Adjustment should also change to be true if you took Sale Price - Cost - Expense.
Calc for ROI = ( Sale - Expense - Cost) / Sale
In the area where you have Adjusted Cost, where I figure you're trying to calculate what Cost you need for a 40% ROI. I'm assuming your ROI is a manual input.
Cost = [Sale Price] * ( 1 - [ROI] ) - [Expense]

How to Calculate Loan Balance at Any Given Point In Time Without Use of a Table in Excel

I'm trying to calculate the remaining balance of a home loan at any point in time for multiple home loans.
Its looks like it is not possible to find the home loan balance w/ out creating one of those long tables (example). Finding the future balance for multiple home loans would require setting up a table for ea. home (in this case, 25).
With a table, when you want to look at the balance after a certain amount of payments have been made for the home loan, you would just visually scan the table for that period...
But is there any single formula which shows the remaining loan balance by just changing the "time" variable? (# of years/mths in the future)...
An example of the information I'm trying to find is "what would be the remaining balance on a home loan with the following criteria after 10 years":
original loan amt: $100K
term: 30-yr
rate: 5%
mthly pmts: $536.82
pmts per yr: 12
I'd hate to have to create 25 different amortization schedules - a lot of copy-paste-dragging...
Thanks in advance!
You're looking for =FV(), or "future value).
The function needs 5 inputs, as follows:
=FV(rate, nper, pmt, pv, type)
Where:
rate = interest rate for the period of interest. In this case, you are making payments and compounding interest monthly, so your interest rate would be 0.05/12 = 0.00417
nper = the number of periods elapsed. This is your 'time' variable, in this case, number of months elapsed.
pmt = the payment in each period. in your case $536.82.
pv = the 'present value', in this case the principle of the loan at the start, or -100,000. Note that for a debt example, you can use a negative value here.
type = Whether payments are made at the beginning (1) or end (0) of the period.
In your example, to calculate the principle after 10 years, you could use:
=FV(0.05/12,10*12,536.82,-100000,0)
Which produces:
=81,342.32
For a loan this size, you would have $81,342.32 left to pay off after 10 years.
I don't like to post answer when there already exist a brilliant answer, but I want to give some views. Understanding why the formula works and why you should use FV as P.J correctly states!
They use PV in the example and you can always double-check Present Value (PV) vs Future Value (FV), why?
Because they are linked to each other.
FV is the compounded value of PV.
PV is the discounted value at interest rate of FV.
Which can be illustrated in this graph, source link:
In the example below, where I replicated the way the example calculate PV (Column E the example from excel-easy, Loan Amortization Schedule) and in Column F we use Excel's build in function PV. You want to know the other way... therefore FV Column J.
Since they are linked they need to give the same Cash Flows over time (bit more tricky if the period/interest rate is not constant over time)!!
And they indeed do:
Payment number is the number of periods you want to look at (10 year * 12 payments per year = 120, yellow cells).
PV function is composed by:
rate: discount rate per period
nper: total amount of periods left. (total periods - current period), (12*30-120)
pmt: the fixed amount paid every month
FV: is the value of the loan in the future at end after 360 periods (after 30 year * 12 payments per year). A future value of a loan at the end is always 0.
Type: when payments occur in the year, usually calculated at the end.
PV: 0.05/12, (12*30)-120, 536.82 ,0 , 0 = 81 342.06
=
FV: 0.05/12, 120, 536.82 , 100 000.00 , 0 = -81 342.06

DAX/Power Pivot: Calculate 75% Expended Date from Cumulative Total

I have three tables that contain cost: Forecasted Cost, Actual Costs, Invoiced Costs. Each has an "EAC Filter" column for a Y/N of whether to include the cost in an Estimate at Completion, which automatically changes over time and/or as data is added. Here are examples:
EAC from the three tables can be calculated as follows:
Total Cost = Sum(Forecast[Cost])+Sum(Actual[Cost])+Sum(Invoice[Cost])
EAC = Calculate([Total Cost],EAC_Filter[EAC Filter]="Y")
I have a budget at the "Account" level, which could also be rolled up to a "Dept" level budget.
I need a measure for my Power Pivot table which will display the week at which costs have exceeded, or are forecasted to exceed 75% of the budget, using some sort of a cumulative cost, combined with the max week where cumulative cost >= .75 * Budget.
The weeks are numbered through the year as follows:
Thanks for your help!
Given an EAC measure which sums the cost per week,
EAC = CALCULATE(SUM(Forcast[Cost]) + SUM(Acutal[Cost]) + SUM(Invoice[Cost]),
EAC_Filter[EAC Filter] = "Y")
You can create a Cumulative Cost measure as follows:
Cumulative Cost = CALCULATE([EAC],
FILTER(ALL('Calendar'), 'Calendar'[Week] <= MAX('Calendar'[Week])))
Using this, we can create a measure that predicts the week the cost exceeds 75% of the budget:
75% Week = MINX(FILTER(ALL('Calendar'), [Cumulative Cost] > 0.75 * SUM(Budget[Budget])),
'Calendar'[Week])
Here's what the relationships structure looks like:

how Calculate Margin in GP

I want to Calculate profit margin from Dynamics GP Database.
Which fields or table been used. and How Can I do that.
If any one have an idea please share with me.
In general, there are many different ways to calculate gross profit margin. Be sure you are using the method which is accepted by your companies accounting policies.
Here is an example which looks at all invoices which have been posted year to date and calculates the gross profit margin percentage.
Assuming gross profit margin = total profit / total revenue.
SELECT ( SUM(SUBTOTAL) - SUM(EXTDCOST) ) / SUM(SUBTOTAL)
FROM SOP30200 t1
WHERE t1.SOPTYPE = 3
AND t1.DOCDATE BETWEEN '1/1/2013' AND GETDATE()
This will return a decimal number like .44323. In that case you would be making an average gross profit margin of 44% for every invoice year to date.
SOP30200 = posted sales transaction documents

Resources