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

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.

Related

Woocommerce not diplaying correct price with "Math Formula"

I'm using WooCommerce and also I'm using "Global Extra Product Options".
I'm trying to calculate a custom price based on two "date field".
In the second field I set as price the result of the following formula:
abs((({this.value}-{date1.value})/1000000)*{product_price})
I can't use datediff() so I had to be creative on how to get the number of days between two day (hence the /1000000).
Using this formula on the product page the price is display correctly (eg. for two days it would display € 2Price).
When I go to the my cart the final price is deducted by a value equal to the previously calculated price for field2.
(eg. the final price would be: € FinalPrice - € 2Price)
I'm messing around with the options but I can't find a solution, am I doing something wrong?

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"

How to add a Reference Line to a row chart in Tableau that calculates from previous time periods?

I'd like to create a row chart that shows sales by product where aggregate sales is the length of the row and product is each row. The data is filtered for only the current quarter.
However, I'd like to add a reference line that shows what the average sales by product was for the previous 4 quarters.
However, after reading Tableau's documentation, it seems like this cannot be done with a parameter, but with a different procedure as stated below
You cannot select a measure that isn't currently in the view as the
basis for your reference line. If you want to use such a measure,
close the Add Reference Line, Band, or Box dialog box and then drag
the measure from the Data pane to the Details target on the Marks
card. Change the measure's aggregation if necessary. This will not
change the view, but it will allow you to use that measure as the
basis for your reference line. Now re-open the Add Reference Line,
Band, or Box dialog box and resume at step 1, above.
However, after adding the measure from the Data pane to the Details target, the measure is being impacted by the filter and only showing the average for the current quarter. How can I have this reference line show the average of the previous four quarters?
First of all, you need to understand that if you have a date filter for the first quarter, you won't have the previous quarters available - because, well, your filter says that you only want the data for the first quarter.
What I would suggest is filtering the previous four quarters and adding the filter for the current quarter directly in the field (formula). The formula would be:
IF DATEPART('quarter',[Date]) = DATEPART('quarter',TODAY())
THEN [Sales]
END
Here follows an example image from a test data source: you would only need to change from text to bar and remove the original "Sales" field (that I left so you could see the difference). After that, you could use the original field (be it as a SUM or AVG) to get the previous quarters.
Edit: Here follows another take you could have in this view. Without using reference lines, now that you have two fields you can easily use both of them in the same view using dual axis (remember to sync them).

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.

avoid rounding in SalesPrice

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.

Resources