<%= render "layouts/portlet-config" %> <%= render "layouts/theme-panel" %> <% if flash[:error] %>
× <%= flash[:error] %>
<% end %> <%= render "layouts/breadcrumbs" %> <%= form_tag({:action=>'create'} ,:multipart=>true,:id=>'myForms' ) do %>

Total MRN Balance<%=@tseach%>

<% if @TotalSale.length >0 if @TotalSale[0].totalAmount.to_f >0 %> <%=currency_formatted(@TotalSale[0].totalAmount)%> <% else %> 0.00 <% end %> <% else %> 0.00 <% end %>

Total Due Outstanding

<% if @TotalOutStand.to_f >0 %> <%=currency_formatted(@TotalOutStand)%> <% else %> 0.00 <% end %>

Last Month Purchase

<% if @TotalLastSale.length >0 if @TotalLastSale[0].totalAmount.to_f >0 %> <%=currency_formatted(@TotalLastSale[0].totalAmount)%> <% else %> 0.00 <% end %> <% else %> 0.00 <% end %>

Current Month Purchase

<% if @TotalCurSale.length >0 %> <%=currency_formatted(@TotalCurSale[0].totalAmount)%> <% else %> 0.00 <% end %>

Avg Monthly Purchase

<%=currency_formatted((@AvrgMSale.to_f >0 ? @AvrgMSale : '0.00'))%>

Avg Monthly Payment

<%=currency_formatted((@AvrgMRecv.to_f >0 ? @AvrgMRecv : '0.00'))%>
<% i = 1 totalinvoices = 0 totalinvamt = 0 totalinvdue = 0 if @CustomerDtl.length >0 @CustomerDtl.each do |custm| totalinvoices += custm.totalInvoice.to_f totalinvamt += custm.totalAmount.to_f if custm.duepends == 'Y' totalinvdue += custm.totaldueamt.to_f end %> <% k = 1 newinvamt = 0 newdueamt = 0 newcomm = 0 newcredits = 0 newcommulative = 0 dyscredits = 0 objcustomerbill = get_all_selected_customer_mrns(custm.hd_customer_id,@finayear,@lastfinyear) if objcustomerbill.length >0 objcustomerbill.each do |custdetail| newinvamt += custdetail.totalinvoice.to_f if custdetail.duepends == 'Y' newdueamt += custdetail.balanceamount.to_f else newdueamt += 0 end newcomm += custdetail.cummulative.to_i newcredits += custdetail.creditdays.to_i >0 ? custdetail.creditdays.to_i : 0 dyscredits += custdetail.newcreditdays.to_i >0 ? custdetail.newcreditdays.to_i : 0 if k ==1 if custdetail.duepends == 'Y' newcommulative = custdetail.balanceamount.to_f end else if custdetail.duepends == 'Y' newcommulative += custdetail.balanceamount.to_f end end newcomm +=newcommulative.to_f %> <% k +=1 end %> <% else %> <% end %> <% i +=1 end %> <% else %> <% end %>
View SL.No. Customer Name No of MRN Total MRN
Amount
Total Due
Amount
Last Payment
Details
Click Below
to Send Mail
<%=i%> <%=custm.cs_customername%> <%=custm.totalInvoice%> <%=currency_formatted(custm.totalAmount)%> <%=currency_formatted(custm.totaldueamt)%> <%=custm.lastdate%>
Grand Total <%=currency_formatted(totalinvoices)%> <%=currency_formatted(totalinvamt)%> <%=currency_formatted(totalinvdue)%>
No Record(s) Found.
  <% if @OrdPrint!=nil %> <% end %>
<% end %>
<%=render 'layouts/common/send_email_tocustomer'%>