Yay for production estimates! :D ... but...
Posted: Mon Nov 08, 2010 12:52 pm
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+...
Line 920+...
One way to fix it that appears consistent with your approach would be to apply the following respective modifications:
Line 646+...
Line 920+...
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
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 ";
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
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 ";
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
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