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