Filter query results where original fee and reversals wash to zero - cognos-10

In Cognos 10 query, What method is best to remove items from list below
where the Fee charged and the fee assessed Tran Amounts are a wash, ie, sum to zero?

Detail filter, property after aggregation
Total ([Tran Amount] for [Loan#]) <> 0

Related

Gravity Forms - Conditional Result

I have a GF with 3 products at a set price. However, if the user purchases more than one, there's a $50 discount on each additional item.
EX: Product 1 = $500
User buys 2 items, $500 + $450 (total = $950). Is there a way to do this with native (or plugin) conditional logic?
The only way I know how to do this natively is to create an extra Product field that adds as a "base" fee. In your case, that fee would be $50. Then your product price would be $450 all the time. Use conditional logic to "show" the base fee when only 1 item is ordered and to "hide" the base fee when more than 1 item is ordered.

Tax calculation issue for a Prestashop Plugin

I am building a Prestashop plugin, and i have stumbled on to this tax calculation issue.
The program flow is as follows:
A person places an order at the eCommerce website, the order is accepted, the order details such as items, prices, taxes, discounts etc is send to an external invoice API service.
An example of an order could be:
(These prices include taxes)
1x T-shirt 20.64
1x Shipping 125
1x Discount -18.58 (In this particular test case, the discount is 90% off the product, the math is simple 20.64 * 0.90 = 18.58)
Order total after tax is applied: 127.06
This is all fine, but, when i send the details off to the API, the order is saved as the following:
(These prices are saved without tax applied, the tax rate being 25%)
1x T-shirt 16.51
1x Shipping 100
1x Discount -14
Order total after tax is applied: 128.14
As you see, the order totals do not mach, the difference is 1.08, i am thinking this a discount & tax issue.
Its worth noting that the external site does its own math on the values sent, e.g products, tax etc. I cannot influence the way the external invoicing site does its calculations. I think the issue occurs in the order of which the operations are performed on the different platforms.
Its also worth mentioning that the code works perfectly fine when there is no discount present.
What can i do prior to sending the values, so that i end up with the same values both places.
The total they compute is indeed (100 + 16.51 - 14) x 1.25 = 128.1375
However their computation of taxless discount is wrong, 18.58 / 1.25 = 14.864 not 14.
Is there a rule that discount should be rounded (or floored or ceiled) to an integer value ?
discount may be non-integer, implying different tax rate
If not that means they divide the discount by 1.32714285714, thus considering there is 32.71...% taxes on discounts. This would be strange and unlikely, since when adding the discount again they use the normal 25%
Check your prestashop documentation, local laws or whatever to find out if this is real, and whether the value is for example 33% or 32.7% Since I reverse-engineered the value from the tax value they stored, it could be distorted by the rounding to 2 decimals.
Then, to get the correct result, replace the discount by discount * 1.32714285714 / 1.25, that is, replace your expected tax rate by the one they apply.
discount is rounded to integer
If the taxless discount does have to be an integer, we can modify it so that it is on our side as well, since I guess what matters most is the final price. So use this algorithm to send in a discount that will finally be an integer:
% get taxless prices
price_notax = price / 1.25
discount_notax = discount / 1.25
% transfer decimal part of discount into price reduction
discount_int = floor(discount_notax)
price_compensated = price_notax - (discount_int - discount_notax)
% re-add tax to get values to send
discount_send = discount_int * 1.25
price_send = price_compensated * 1.25
The sum of values should be the same : price - discount == price_send - discount_send
check if it's not a bug in Prestashop
Update to the latest version, look up their bug tracker or contact them. File a report if there isn't one.
One of the workarounds above will work for now, but if it's a bug that gets fixed and you use the first one, you will be billing wrong amounts again.

Rate issue in Trade agreement journal

I have created multiple journals for an item (suppose "item1") in AX2012 with multiple rates and different from and to date.
Like for Journal 1, From date is set as 1/12/2013 and to date is NULL and rate as 50.
for journal 2, From date is set as 7/12/2013 and to date is NULL and rate as 60.
Now, logically when selecting item in sales line form on or after 07/12/2013, I must get unit price 60. But unit price that i am getting is 50.
How to get latest price of an item, account, to, from date in sales line form?
It is valid in AX to have more than one active price record (PriceDiscTable).
In your case both 50 and 60 are valid rates, it then does the service of choosing the lesser one!
In journal 2 you should find the old rate, then apply an end date of 06/12/2013.
As this is cumbersome, it is a usual customization to auto-close prices. This could be done in the insert method of PriceDiscTable.

Query on use of aggregate functions over recursive groups in microsoft report designer

I have to point out that I'm fairly new to reporting outside of Microsoft Access, and new to the site, so please bear with me!
Stripped down to essential items, my data object has:
CategoryID, ParentCategoryID, TransactionID, TransactionDate, SplitID, CurrencyID and Value.
I don't think this is relevant, but just in case -
A Split has a Category and a Value, with one to many belonging to a Transaction.
Multiple Splits may exist for the same Category & Transaction with
different, or the same, Value (to support different combinations of the other data
items I haven't listed).
A Transaction has a TransactionDate and a CurrencyID, so all Splits
belonging to a Transaction are for the same Currency.
A Category belongs to a Category recursively.
A Split may be assigned a Category at any level in the recursive hierarchy and the crux of my problem is to report Transaction / Split detail under the appropriate Category heading, with a sub-total to include all those details AND the totals of all child Categories.
So, I have a Detail row group holding all the ancilliary data items that aren't relevant and a TransactionIDGroup row group on the same row. I then have a CategoryGroup row group based on CategoryID with a Parent of ParentCategoryID to handle the recursive nature of the data and a CurrencyIDGroup column group to handle the possible multiple currencies involved.
Also in the CategoryIDGroup row group is a total row with the Value cell holding an expression.
If I leave that expression as =Sum(Fields!AccountValue.Value), the report quite nicely totals the Value for each Currency column for all the details specifically in each Category (the default scope), so I thought I needed to make the Sum 'Recursive'. However, you don't seem able to specify the optional Recursive parameter without specifying the scope as well.
If I specify scope as CategoryIDGroup, I get all zero sub-totals. If I use CurrencyIDGroup I get each one being the same report total for the Currency. Anything else either gets me a build error or a combined-currency report total.
The other issue I have is that the recursive child Category groups are reported sequentially underneath the parent Category group (so, outside the header row, detail rows and total row, and not within the group. However, if I can get the total to reflect the children as well as the details at that level, I'd be happy enough, even though it wouldn't seem to add up until you realised what was going on.
What I have in mind is something like:
Category A
Transaction 1 10/02/2011 ...................... £100.00
---------------------- £14.50
Transaction 2 18/03/2011 ...................... $159.34
Category Ai
Transaction 3 18/06/2011 ---------------------- £295.60
Total Category Ai £295.60
Total Category A £410.10 $159.34*
But what I get is this:
Category A
Transaction 1 10/02/2011 ...................... £100.00
---------------------- £14.50
Transaction 2 18/03/2011 ...................... $159.34
Total Category A £114.50 $159.34*
Category Ai
Transaction 3 18/06/2011 ---------------------- £295.60
Total Category Ai £295.60
I guess the fundamental question is - am I asking the impossible? Do I need to take a different approach, perhaps with sub-reports for the details? I've wondered about including a Sum of the values of the child Categories within the data object at each Category level, but is there something simple I'm missing?
Any pointers in the right direction would be greatly appreciated after several days tearing my hair out :)
I have no idea whether there was something simple I missed, but resolved the issue to my satisfaction by including another property in the data object, being the sum of all child categories for each currency, and including a new row to print the sum of that field. Just in case someone else hits just the same question!

Access Report - Can't add a sum for a calculated currency column

I've generated a simple access report that is used for purchasing.
Basically, there are two tables, one for purchase orders, and one for the items on the purchase orders.
For the items on an order, I store the item details, quantity ordered, quantity delivered, and price per unit. (plus a few other fields which aren't relevant in the context of this question).
I'm generating a report to list all outstanding items still on order, and the report has a calculated field showing the outstanding quantity * cost per item. This works perfectly fine.
What I'm struggling with, is showing a sum of this calculated field (i.e. a total cost of all outstanding items), but when I try to add a total to the column, it only gives me the option of adding an item count for the column. The column is a 'Currency' field.
What might I be doing wrong, or am I expecting too much from access?
Resolved. I created the only option that the GUI would allow (item count), then modified the query from:
=Count(*)
to
=Sum([Quantity]*[Cost])
Works perfectly.

Resources