<%= render "layouts/portlet-config" %> <%= render "layouts/theme-panel" %> <% if @dashboard && @dashboard.to_i >0 %> <% if flash[:error] %>
× <%= flash[:error] %>
<% end %> <%= render "layouts/breadcrumbs" %> <%= form_tag({:action=>'create'} ,:multipart=>true,:id=>"isMyForms" ) do %> <% end %>
<% # if session[:req_username] && session[:req_username].to_s.downcase != session[:req_username] %>

Total Order This Month

<% tbvalues = 0 if @bExport && @bExport.length >0 tbvalues += @bExport[0].dtValues.to_f end if @bLocal && @bLocal.length >0 tbvalues += @bLocal[0].dtValues.to_f end if @bPI && @bPI.length >0 tbvalues += @bPI[0].dtValues.to_f end %> <% tbquantity = 0 if @bExport && @bExport.length >0 tbquantity += @bExport[0].dtqnty.to_i end if @bLocal && @bLocal.length >0 tbquantity += @bLocal[0].dtqnty.to_i end if @bPI && @bPI.length >0 tbquantity += @bPI[0].dtqnty.to_i end %> <% avlcquantity = 0 avexpquantity = 0 avpiquantity = 0 tavgcost = 0 if @bExport && @bExport.length >0 qnt = @bExport[0].dtqnty.to_i avcost = @bExport[0].dtValues.to_f if qnt.to_i >0 && tbvalues.to_f >0 avexpquantity1 = (avcost.to_f/qnt.to_i) avexpquantity = "%.2f" % avexpquantity1.to_f tavgcost += avexpquantity1.to_f end end if @bLocal && @bLocal.length >0 lcqt = @bLocal[0].dtqnty.to_i lval = @bLocal[0].dtValues.to_f if lcqt.to_i >0 && lval.to_f >0 avlcquantity1 = (lval.to_f/lcqt.to_i) avlcquantity = "%.2f" % avlcquantity1.to_f tavgcost += avlcquantity1.to_f end end if @bPI && @bPI.length >0 piqnt = @bPI[0].dtqnty.to_i pivals = @bPI[0].dtValues.to_f if piqnt.to_i >0 && pivals.to_f >0 avpiquantity1 = (pivals.to_f/piqnt.to_i) avpiquantity = "%.2f" % avpiquantity1.to_f tavgcost += avpiquantity1.to_f end end %>
Description Export Local PI Total
Value <% if @bExport && @bExport.length >0 %><%="%.2f" % @bExport[0].dtValues.to_f%><% else %>0.00<% end %><% else %>0.00<% end %>"/> <% if @bLocal && @bLocal.length >0 %><%="%.2f" % @bLocal[0].dtValues.to_f%><% else %>0.00<% end %> <% else %>0.00<% end %>"/> <% if @bPI && @bPI.length >0 %><%="%.2f" % @bPI[0].dtValues.to_f%><% else %>0.00<% end %><% else %>0.00<% end %>"/> <%="%.2f" % tbvalues%> "/>
Quantity <% if @bExport && @bExport.length >0 %><%=@bExport[0].dtqnty.to_i%><% else %>0<% end %> <% if @bLocal && @bLocal.length >0 %><%=@bLocal[0].dtqnty.to_i%><% else %>0<% end %> <% if @bPI && @bPI.length >0 %><%=@bPI[0].dtqnty.to_i%><% else %>0<% end %> <% if tbquantity %><%=tbquantity.to_i%><% else %>0<% end %>
Avg Quantity Cost <% if avexpquantity.to_f >0 %><%=avexpquantity%><% else %>0.00<% end %> <% if avlcquantity.to_f >0 %><%=avlcquantity%><% else %>0.00<% end %> <% if avpiquantity.to_f >0 %><%=avpiquantity%><% else %>0.00<% end %> <% if tavgcost.to_f >0 %><%="%.2f" % tavgcost.to_f %><% end %> <% end %>"/>

Order Age Calculation

<% if @orderTSummary && @orderTSummary.length >0 @orderTSummary.each do |torder| %> <% end %> <% else %> <% end %> <% if @orderESummary && @orderESummary.length >0 @orderESummary.each do |exorder| %> <% end %> <% else %> <% end %> <% if @orderESummary && @orderESummary.length >0 @orderESummary.each do |holdorder| %> <% end %> <% else %> <% end %>
Description View Total Orders Pending Value Age <7 Age 8-15 Age 16-30 Age 31-60 Age 61-90 Age >90
Total Pending Order <%=torder.totalpendingorder%> <%=currency_formatted(torder.totavalue)%> <%=torder.ageseven%> <%=torder.agefifteen%> <%=torder.agexixteen%> <%=torder.agedaythirty%> <%=torder.agedaysixty%> <%=torder.agedayonetwenty%>
Pending Order -- -- -- -- -- -- -- --
Executed Order <%=exorder.totalorder%> <%=currency_formatted(exorder.totavalue)%> <%=exorder.ageseven%> <%=exorder.agefifteen%> <%=exorder.agexixteen%> <%=exorder.agedaythirty%> <%=exorder.agedaysixty%> <%=exorder.agedayonetwenty%>
Executed Order -- -- -- -- -- -- -- --
Hold Order <%=holdorder.totalorder%> <%=currency_formatted(holdorder.totavalue)%> <%=holdorder.ageseven%> <%=holdorder.agefifteen%> <%=holdorder.agexixteen%> <%=holdorder.agedaythirty%> <%=holdorder.agedaysixty%> <%=holdorder.agedayonetwenty%>
Hold Order -- -- -- -- -- -- -- --
Open Tabular Buyer-Order
<% l1 = 1; k = 1 if @buyresOrder && @buyresOrder.length >0 @buyresOrder.each do |byrs| mytotalpending = 0 buersid = byrs.hd_customer_id salesid = byrs.cs_salesman jbsorders = get_buyers_job_order_details('S',buersid,salesid) if jbsorders && jbsorders.length >0 mytotalpending = jbsorders.length end if mytotalpending.to_i >0 %>

<% if jbsorders.length >0 jbsorders.each do |jo| %> <% k +=1 end else %> <% end %>
View Buyer Order No Buyer Order date Type Initiated by Buyer
PO No
Buyer
PO date
Payment Terms Payment Status Order Status OA Value OA Qty Dispatch Date Partial
Ship(Y/N)
Ship Date
<%=jo.hd_billnumber%> <% dt = '' if jo.hd_billdate!=nil && jo.hd_billdate!='' dt = Date.parse(jo.hd_billdate.to_s).strftime("%d-%m-%Y") end %> <%=dt%> <%=jo.exprtype%> <%=jo.sl_name%> <%=jo.hd_po_number%> <% pdt = '' if jo.hd_po_date!=nil && jo.hd_po_date!='' pdt = Date.parse(jo.hd_po_date.to_s).strftime("%d-%m-%Y") end %> <%=pdt%> <%=jo.hd_payment_terms!=nil && jo.hd_payment_terms!='' ? jo.hd_payment_terms : '----'%> <%=jo.pamtstatus%> <%=jo.orderstatus%> <%="%.2f" % jo.dtValues.to_f%> <%=jo.dtqnty%> <%=jo.dispdate%> <%=jo.shipped%> <%=jo.shipdate%>
PO No Po Date Supplier Currency Prep By Auth By Remarks Approve Rmk Tot. Qty Tot. Value Bal. Qty
No Record(s) found.
<% l1 +=1 end end %>
<% #end %>
<% # if session[:req_username] && session[:autherizedUserName].to_s.downcase != session[:req_username] %>
Calendar

checked="checked"<% end %> id="orddelvdate" onclick="process_calendar_filters(this.value,'ODD');" value="ODD" />Order Delivery Date

checked="checked"<% end %> id="popendingdate" onclick="process_calendar_filters(this.value,'PODT');" value="PODT" />PO Pending Date

checked="checked"<% end %> id="pendingpayment" onclick="process_calendar_filters(this.value,'PPMT');" value="PPMT"/>Pending Payment

checked="checked"<% end %> id="dispatchdated" onclick="process_calendar_filters(this.value,'DSD');" value="DSD"/>Dispatch/Ship Date

checked="checked"<% end %> id="birthdated" onclick="process_calendar_filters(this.value,'BTHD');" value="BTHD"/>Birthday

<% #end %>