avoid rounding in SalesPrice - axapta

When setting trade agreament price to 12.8888, the unit price used in Sales Line is 12.8900. what should I do to avoid this rounding?

On the PriceDiscTable form set the NoOfDecimals property of the PriceDiscTable_Amount control to 4.
Note that there are many places in the code where that amount will get rounded to the roundoff setting for the currency. You can change that rounding for the entire application under General ledger/Setup/Exchange rates on the Round-off tab.

In the Price List form, under Details, click Price List Items, and then click Add Price List Item, then change the Rounding Policy.

Set price to 1288.88 per 100 items.

Related

tryton: problem in taxes table when i add a negative value in the field quantity

Am using tryton 6.0.0,
In the table Lines ,I have create an invoice has two lines (the name of the account tax in both of them is "Umsatzsteuer – Normalsatz", one of them has a quantity positive and the other one has a negative value.
the story that after add a negative value in quantity field to one line, like in the screenshoot.
enter image description here
in the Tax Lines , there was 2 lines of taxes appear like in the screenshoot:
enter image description here
i want to know, why the second line appear in Tax Lines table in case i add a negative value of quantity in the Lines table???
PS: the second line from the table Tax Lines does not appear when i add a positive value of the quantity.
How i can fix that and why this thing happen if we add a negative value of quantity.
Thanks in advance.
This is the expected behaviour because tryton allows to set different account on taxes depending on the sign. As the tax lines are used to properly create the account moves the amounts are splited based on the sign.

Woocommerce: How to change the item cost when editing orders?

I have default prices set for every product in the shop, but sometimes we agree on different prices per item with certain distributors, so I edit the prices in the order creation.
When editing, I would like to display the agreed price per item in the item_cost td and get the totals calculated in consecuence rather than editing the totals and getting the discount applied.
I thought this was a base feature of Woocommerce but apparently it isn't. Any ideas?
After so many time looking for a solution for the same problem, the support from Rednao team juste gave me the answer.
The light gray "before discount" field ("antes del descuento" in your case) is editable!
So just add your new price in the total field, add the same price in the "before discount" field, and that's it. The unit price will be OK now.

How can I add weight units to my quantity in woocommerce?

I would like to add a weight quantity input field on product pages that allow customer to change the item weight by clicking on a plus or minus buttons. For example, you want to buy 1.25kg of tomatoes. For that, you can just click the plus icon until it reaches 1.25kg or you can type 1.25 kg. Here is an example of what I am looking for (this one does not have the ability to insert your quantity though).
Currently, I have used the plugins WPC Product Quantity and WooCommerce Price Per Unit PRO, but the problem is that it does not show the "kg" unit after the quantity number. You can have a look at that over here
Is there a plugin or a custom code that I can insert to fix this issue?
Note: I have products, which use units "kg" and "tk". So the code/plugin should be able to fix this issue on a product basis. "tk" just means "piece" in Estonian.
You may try to change the quantity box from integer datatype to float/double datatype, So the customer can place float number like 0.25 or 0.5,
you can use settype($var,"double"); in your code.
if the kg is not showing you also can use concatenate to add "kg" to your return value.
you return your value with concatenate by adding this to the end of your return value:
. " kg"

Rounding in salesLine price field

I need to show 5 decimal places in the price field in sales line, purch line and item master (sales tab).
I created new EDTs with 5 decimal places to replace the salesLine.SalesPrice and InventTableModule.Price field. But as soon as the sales line is created. The value in SalesPrice field is rounded off to 2 decimals. For eg value in Item master is 10.12345 but on sales line it is displayed as 10.12000. The last 3 digits are gone.
I have heard multiple approaches till now from various posts/blogs.
To change the NoOfDecimals property to 5 on RealBase EDT effectively changing the Amount field across the application. I do not want to do this.
Changing the rounding rule at GL>Setup>Currency>Rounding rules. The fields are not editable.
I changed the EDT to 5 decimals for PriceDiscTable.Amount field. But no help. I guess the SalesPrice in my case is not flowing from Trade Agreements.
Anything i am overlooking/missing?
Thanks
Take a look at PriceDisc.price() method. Even if you change the decimals in the EDT or create a new EDT method Dynamics will round the price by code regardless of if you're getting the price from trade agreements or the InventTableModule price field.
The PriceDisc.price() method will later call the Currency.priceTypeRound(...) method where it will be rounded to 2 decimals:
private Price priceTyperound(Price _price,
PriceRoundOff _unit)
{
Price price;
real decimals;
;
switch (this.RoundOffTypePrice)
{
case RoundOffType::Ordinary:
if (_unit)
price = round(_price, _unit);
else
price = round(_price,0.01);
break;
(...)
The rounding type will depend on the values of the last tab (Round-off) in the Exchange Rates form. So you'll have to modify some more things if you want the decimals to work properly.
I hope this was helpful.
aariste i think you are refering to AX version 2009 since Currency.priceTypeRound method is deprecated in 2012. But i did find similar methods in Currency table and in a new class called CurrencyExchangeHelper added in 2012. Sadly, the whole pricing mechanism is too complex and i decided not to meddle with it. Another difference in 2012 is that few methods run in IL so normal debugger cant catch them until you change a setting in Tools called "Execute business operations in IL". I am now forcefully pushing the salesPrice and recalculating the lineAmount overriding the Trade agreements pricing logic. I am totally in favor of increasing the Price Unit as David Lawson suggested instead of code changes. Thank you both for looking into the problem and advising.

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