Page 1 of 1

Yay for production estimates! :D ... but...

Posted: Mon Nov 08, 2010 12:52 pm
by alkhaef
This has been a much anticipated feature for us! Thanks!

I ran into something when testing it though... It doesn't respect the WriteOffEstOverride ... Here are the relevant code sections in "Data Interface\Appointments.cs":

Line 646+...

Code: Select all

				command="SELECT AptNum,PlannedAptNum,"//AbbrDesc,procedurecode.CodeNum
					+"ProcFee, "
					+"SUM(WriteOffEst) writeoffPPO "
					//+"Surf,ToothNum,TreatArea  "
					+"FROM procedurelog "
					+"LEFT JOIN procedurecode ON procedurelog.CodeNum=procedurecode.CodeNum "
					+"LEFT JOIN claimproc ON claimproc.ProcNum=procedurelog.ProcNum "
					+"AND claimproc.WriteOffEst != -1 "
					+"WHERE ";
Line 920+...

Code: Select all

						production+=PIn.Decimal(rawProc.Rows[p]["ProcFee"].ToString());
						//WriteOffEst -1 already excluded
						production-=PIn.Decimal(rawProc.Rows[p]["writeoffPPO"].ToString());//frequently zero
One way to fix it that appears consistent with your approach would be to apply the following respective modifications:

Line 646+...

Code: Select all

				command="SELECT AptNum,PlannedAptNum,"//AbbrDesc,procedurecode.CodeNum
					+"ProcFee, "
					+"SUM(cpa.WriteOffEst) writeoffPPO, "
					+"SUM(cpb.WriteOffEstOverride) writeoffPPOOverride "
					//+"Surf,ToothNum,TreatArea  "
					+"FROM procedurelog "
					+"LEFT JOIN procedurecode ON procedurelog.CodeNum=procedurecode.CodeNum "
					+"LEFT JOIN claimproc cpa ON cpa.ProcNum=procedurelog.ProcNum "
					+"AND cpa.WriteOffEstOverride = -1 AND cpa.WriteOffEst != -1 "
					+"LEFT JOIN claimproc cpb ON cpb.ProcNum=procedurelog.ProcNum "
					+"AND cpb.WriteOffEstOverride != -1 "
					+"WHERE ";
Line 920+...

Code: Select all

						production+=PIn.Decimal(rawProc.Rows[p]["ProcFee"].ToString());
						//WriteOffEst -1 already excluded
						production-=PIn.Decimal(rawProc.Rows[p]["writeoffPPO"].ToString());//frequently zero
						production-=PIn.Decimal(rawProc.Rows[p]["writeoffPPOOverride"].ToString());//even more frequently zero
I tested it under some exotic possibilities and it works.

Also... Can I suggest to refactor this functionality out? It would be very useful for use in other parts of OD as well if you guys want to expand reporting, etc, and save me a lot of hassles in reimplimenting it in my plugin.

Thanks,
Al

Re: Yay for production estimates! :D ... but...

Posted: Mon Nov 08, 2010 12:57 pm
by alkhaef
Whoops... This was probably better suited in the "Developers" forum... I probably misposted it when looking for a duplicate report...

Oh well :oops:

Re: Yay for production estimates! :D ... but...

Posted: Wed Nov 10, 2010 1:12 pm
by alkhaef
Ping? :)

Re: Yay for production estimates! :D ... but...

Posted: Wed Nov 10, 2010 9:08 pm
by jordansparks
This was added to the bug list.