Topic: formula error Posted: 24 Sep 2014 at 7:55am
Hi. I pretty much know very little about programming in Crystal. Just enough to get a few pre-written reports to look how I want them. Add data fields, format, that's about it.
I am trying to get our invoices to subtract a "unit discount", and display a "net extended" on the item line. I was able to write the code to make the subtraction just fine. The problem I'm having is on the report, if other items ordered by a customer do not have a discount, the "net extended" field on this item line is blank.
Another issue is the "total" on the invoice only calculates the line that has a "unit discount", most likely because the line that does not have a disc has no line total. Does this make sense?
The data section I'm working in is a "detail" section.
The "unit price" is the data field "ord_dtl.prcby_prc".
The "extended" field originally was @totprdamt, and the formula was simply, round({ord_dtl.totprdamt},2), which i mean to round off the result to 2 decimal places
The formula i substituted is as follows:
round(({ord_dtl.totprdamt})-(({ord_ddl.oi_rat})*{ord_dtl.shpqty}),2)
ord_ddl.oi_rate = the amount off per unit of measure
ord_dtl.shpqty = units shipped on the order
as i stated, this formula will correctly display a "net extended" but will result in a blank field if there is no discount applied. I have no idea how to move forward...
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum