A
|
ann 7/5/2010 |
Hi, $values["ExtendedPrice"] = $values["UnitPrice"] * $values["Quantity"] - $values["Discount"];
|
B
|
bangke author 7/5/2010 |
Hi, try this code: $values["ExtendedPrice"] = $values["UnitPrice"] * $values["Quantity"] - $values["Discount"];
|
A
|
ann 7/5/2010 |
Hi, |
S
|
swanside 7/5/2010 |
Hi, it's difficult to tell you what's happening without seeing actual files. Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error. 'Demo Account' button can be found on the last screen in the program.
|
S
|
swanside 7/6/2010 |
I use a similar formular in my Invoiceing table. Try something like this in your SQL editor. It might not work due to the select sum, as mine goes across different tables, so you may have to play around with it. SELECT UnitPrice, Quantity, Discount, IFNULL((select sum(QuantityUnitPrice-(QuantityUnitPrice-Discount/100))), 0) AS ExtendedPrice, Or SELECT UnitPrice, Quantity, Discount, IFNULL((select QuantityUnitPrice-(QuantityUnitPrice-Discount/100)), 0) AS ExtendedPrice, This should give something like this, The first part should come to; QuantityUnitPrice = 1010=100 The second part should come to; QuantityUnitPrice-Discount/100 = 1010-10/100=10 So this should show the discount as 10 and the Extended Price = 90 I think, I have not tried it,but can try tomorrow on a database.
|
![]() |
romaldus 7/6/2010 |
How i calculate ExtendedPrice with this formula: *UnitPrice = UnitPrice Quantity - Discount*, where discount field is percentage I have tried to add this code to Before record Added and before record updated* bi it was not works : $values["ExtendedPrice"] = $values["UnitPrice"] * $values["Quantity"] - ($values["Discount"];
$values["ExtendedPrice"] = ($values["UnitPrice"] * $values["Quantity"]) - (($values["Discount"]/100)*($values["UnitPrice"] * $values["Quantity"])); |
B
|
bangke author 7/6/2010 |
Thanks, both swanside's and Romaldus' solvied the problem <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=51028&image=1&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' /> <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=51028&image=2&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' /> <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=51028&image=3&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' /> |
![]() |
romaldus 7/7/2010 |
I have tested this one and it works : $values["ExtendedPrice"] = ($values["UnitPrice"] * $values["Quantity"]) - (($values["Discount"]/100)*($values["UnitPrice"] * $values["Quantity"]));
|
S
|
swanside 7/7/2010 |
Just do it in the edit SQL query. |