
<!---<cfoutput>
<cfif isdefined('form.InvoiceTotal')>#MID(form.InvoiceTotal,2,9)#,#form.InvoiceTotal#,</cfif>
<cfif isdefined('form.Date') and form.Date neq ''>#form.Date#</cfif>
<cfif isdefined('form.Payment_ID')>#form.Payment_ID#</cfif>
</cfoutput>
<cfabort>--->
<cfparam name ="form.payerstype" default="">
<cfif form.Payment_ID GT 0>
	<cfset getsucess= generalCFC.AddPaymentHistory(form.Payment_ID) />	
	<cfquery  name="UpdatePayment" datasource="#Application.DataSrc#"> 
		UPDATE #Request.prefix_db_agency#.Payments SET 
		<cfif isdefined('form.InvoiceTotal') and form.InvoiceTotal neq ''  AND form.payerstype NEQ 'nonmedicare'>
			WriteOffAmount = #form.InvoiceTotal#,
		</cfif>
		<cfif isdefined('form.Date') and form.Date neq ''>
		PaymentDate = #CreateODBCDateTime(form.Date)#,
		</cfif>
		<cfif isdefined('form.Approve') and form.Approve neq ''>
		 Approve = #form.Approve#,
		</cfif>
		Record_Modified_By = '#Session.EmployeeId#',
		Record_Modified_Date = #now()#
		WHERE Payment_ID = #form.Payment_ID#
	</cfquery>

	<cfif form.Approve EQ 1>
		<cflocation url="/agencyadmin/index.cfm?page=agency&cat=BillingReports&rpt=AR_invoice_payments&inv=#form.Invoice_ID#&df=&dt=" addtoken="no">
	<cfelse>
		<cflocation url="/agencyadmin/index.cfm?page=agency&cat=BillingReports&rpt=WriteOff_report" addtoken="no">
	</cfif>
</cfif>



