Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added date issued and date when to finished

  • Loading branch information...
commit 23eda27b024f76f36d48772b80212123bece249d 1 parent f46e0b3
jameskyokushin authored
4 app/admin/job_orders.rb
View
@@ -140,6 +140,7 @@ def generate_joborder(joborder)
show :title => :category do
panel "Company Information" do
attributes_table_for job_order do
+ row("Date Issue") { job_order.date_issued}
row("Company Name") { job_order.company_name }
row("Contact Person") { job_order.contact_person }
row("Address") { job_order.address }
@@ -149,6 +150,7 @@ def generate_joborder(joborder)
row("Installer") { job_order.technical2 }
panel "Remarks" do
attributes_table_for job_order do
+ row("Date Created") { Date.today(job_order.created_at)}
row("To Do ") { simple_format job_order.todo }
row("Work Done") { simple_format job_order.work_done }
row("Remarks") { simple_format job_order.remarks }
@@ -168,7 +170,7 @@ def generate_joborder(joborder)
column :system
column :technical1
column :prepared_by
- column :created_at
+ column :date_issued
column do |joborder|
link_to("Details", admin_job_order_path(joborder)) + " | " + \
link_to("Delete", admin_job_order_path(joborder), :method => :delete, :confirm => "Are you sure?")
4 app/models/job_order.rb
View
@@ -3,7 +3,9 @@ class JobOrder < ActiveRecord::Base
validates :company_name,
:category,
:system,
- :technical1, :presence => true
+ :technical1,
+ :date_issued,
+ :date_finished, :presence => true
STATUS_PENDING = 'PENDING'
STATUS_COMPLETED = 'COMPLETED'
8 app/views/job_orders/_form.html.erb
View
@@ -22,9 +22,15 @@
<%= f.input :address %>
<% end %>
<%= f.inputs "Job Order" do %>
+ <%= f.input :date_issued, :label => "Date Issue : " %>
+ <%= f.input :date_finished, :label => "Expected Date to be Finished : " %>
<%= f.input :category, :collection => JobOrder.category_collection, :as => :radio %>
<%= f.input :system,:collection => [["- Select -"," "],["Automatic Gates"," Automatic Gates"],["Metal Detectors","Metal Detectors"],["CCTV","CCTV"],["Access Control","Access Control"],["Intrusion","Intrusion"],["Fire Alarm","Fire Alarm"],["Light Automation","Light Automation"],["Automated Window Treatment","Automated Window Treatment"],["Home Run","Home Run"],["Installation Accessories","Installation Accessories"],["Cable","Cable"],["Radio","Radio"],["Voip","Voip"],["Network Cabinet","Network Cabinet"],["Public Address System","Public Address System"],["Telecom","Telecom"],["Id Printer","Id Printer"],["Pc Pheripherals","Pc Pheripherals"],["Card","Card"],["Networking","Networking"],["Door Automation","Door Automation"],["Parking System","Parking System"],["Turnstile","Turnstile"],["Others","Others"]], :include_blank => false %>
- <%= f.input :technical1, :label => "Team Leader", :collection => [["Brian Flores","BRIAN FLORES"],["Excel Abejuela","EXCEL ABEJUELA"],["Armas Melvin","ARMAS MELVIN"],["Alinsoot Alberto","ALINSOOT ALBERTO"],["Tan Edwin","TAN EDWIN"],["Borres Stephene","BORRES STEPHENE"],["Dumale Adrian","DUMALE ADRIAN"],["Ebo Alpin","EBO ALPIN"],["Babaylo Herbert","BABAYLO HERBERT"],["Calzada Roel","CALZADA ROEL"],["Lapasaran Arvin","LAPASARAN ARVIN"],["Ruiz Dani Lee","RUIZ DANI LEE"],["Sangrador Allan","SANGRADOR ALLAN"],["Sarco Estelito","SARCO ESTELITO"],["Payot Nizan"],["Ungui Jenny","UNGUI JENNY"],["Compra Honey Mae","COMPRA HONEY MAE"],["Turpias Felix","TURPIAS FELIX"],["Managase Junryll","MANAGASE JUNRYLL"],["Natividad Allen","NATIVIDAD ALLEN"],["Lemuel Ibo","LEMUEL IBO"],["Rodado Joshua","RODADO JOSHUA"],["Quintana Mirro","QUINTANA MIRROO"],["Templado Eleazar","TEMPLADO ELEAZAR"],["Viajar Romy","VIAJAR ROMY"],["Villaflor Edison","VILLAFLOR EDISON"],["Anciano Ronilo","ANCIANO RONILLO"],["Dumaya Elzy","DUMAYA ELZY"],["Jamolin Lyka","JAMOLIN LYKA"],["Morena Apollo","MORENA APOLLO"],["Rodado Jahaziel","Rodado Jahaziel"],["Sinda Mark Nemesis","SINDA MARK NEMESIS"],["Metchil Balili","METCHIL BALILI"],["Nowel Roble","NOWEL ROBLE"],["Hermino Decretales","HERMINIO DECRETALES"],["Rechie Delegencia","RECHIE DELEGENCIA"],["Ronnie Orolfo","RONNIE OROLFO "],["Glenn Pidlaon","GLENN PIDLAOAN"],["James Morandarte","JAMES MORANDARTE"],["Julius Aviles","JULIUS AVILES"],["Felino Valerio","FELINO VALERIO"],[" John Michael Ledda","JOHN MICHAEL LEDDA"]] %>
+ <%= f.input :technical1, :label => "Team Leader", :collection => [["Brian Flores","BRIAN FLORES"],["Excel Abejuela","EXCEL ABEJUELA"],["Armas Melvin","ARMAS MELVIN"],["Alinsoot Alberto","ALINSOOT ALBERTO"],["Tan Edwin","TAN EDWIN"],["Borres Stephene","BORRES STEPHENE"],["Dumale Adrian","DUMALE ADRIAN"],["Ebo Alpin","EBO ALPIN"],["Babaylo Herbert","BABAYLO HERBERT"],["Calzada Roel","CALZADA ROEL"],["Lapasaran Arvin","LAPASARAN ARVIN"],["Ruiz Dani Lee","RUIZ DANI LEE"],["Sangrador Allan","SANGRADOR ALLAN"],["Sarco Estelito","SARCO ESTELITO"],["Payot Nizan"],["Ungui Jenny","UNGUI JENNY"],["Compra Honey Mae","COMPRA HONEY MAE"],["Turpias Felix","TURPIAS FELIX"],["Managase Junryll","MANAGASE JUNRYLL"],["Natividad Allen","NATIVIDAD ALLEN"],["Lemuel Ibo","LEMUEL IBO"],["
+
+
+
+ Rodado Joshua","RODADO JOSHUA"],["Quintana Mirro","QUINTANA MIRROO"],["Templado Eleazar","TEMPLADO ELEAZAR"],["Viajar Romy","VIAJAR ROMY"],["Villaflor Edison","VILLAFLOR EDISON"],["Anciano Ronilo","ANCIANO RONILLO"],["Dumaya Elzy","DUMAYA ELZY"],["Jamolin Lyka","JAMOLIN LYKA"],["Morena Apollo","MORENA APOLLO"],["Rodado Jahaziel","Rodado Jahaziel"],["Sinda Mark Nemesis","SINDA MARK NEMESIS"],["Metchil Balili","METCHIL BALILI"],["Nowel Roble","NOWEL ROBLE"],["Hermino Decretales","HERMINIO DECRETALES"],["Rechie Delegencia","RECHIE DELEGENCIA"],["Ronnie Orolfo","RONNIE OROLFO "],["Glenn Pidlaon","GLENN PIDLAOAN"],["James Morandarte","JAMES MORANDARTE"],["Julius Aviles","JULIUS AVILES"],["Felino Valerio","FELINO VALERIO"],[" John Michael Ledda","JOHN MICHAEL LEDDA"]] %>
<%= f.input :technical2, :label => "Technical/s" %>
<%= f.input :todo, :input_html => { :rows => 4 }, :label => "Things To do" %>
<%= f.input :work_done, :input_html => { :rows => 4 }, :label => "Work Done" %>
8 app/views/job_orders/show.html.erb
View
@@ -27,12 +27,12 @@
</headers>
<table border="2" cellpadding="0" cellspacing="0" width="100%">
<tr>
- <th width="55%"><h4><b>Generated Job-order NO:</b> 2011-0A0<%= @job_order.id %></h4></th>
- <th width="45%"><p><b>Datetime Start:</b></p></th>
+ <th width="55%"><h4><b>Generated Job-order NO:</b> 2012 - <%= @job_order.id %></h4></th>
+ <th width="45%"><p><b>Date Issue:</b><%= @job_order.date_issued %></p></th>
</tr>
<tr>
- <td><p><b>Date Issue:</b><%= @job_order.created_at %></p></td>
- <td><p><b>Datetime Finished:</b></p></td>
+ <td><p><b>Date Created:</b><%= Date.today(@job_order.created_at) %></p></td>
+ <td><p><b>Expected D-Finished:</b><%= @job_order.date_finished %></p></td>
</tr>
<tr>
<td><p><b>Company:</b><%= @job_order.company_name %></p></td>
11 db/migrate/20120402073842_add_date_issued_to_job_orders.rb
View
@@ -0,0 +1,11 @@
+class AddDateIssuedToJobOrders < ActiveRecord::Migration
+ def self.up
+ add_column :job_orders, :date_issued, :date
+ add_column :job_orders, :date_finished, :date
+ end
+
+ def self.down
+ remove_column :job_orders, :date_finished
+ remove_column :job_orders, :date_issued
+ end
+end
68 db/schema.rb
View
@@ -11,17 +11,17 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20111129050312) do
+ActiveRecord::Schema.define(:version => 20120402073842) do
create_table "active_admin_comments", :force => true do |t|
- t.integer "resource_id", :null => false
- t.string "resource_type", :null => false
- t.integer "author_id"
- t.string "author_type"
- t.text "body"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.string "namespace"
+ t.integer "resource_id", :null => false
+ t.string "resource_type", :null => false
+ t.integer "author_id"
+ t.string "author_type"
+ t.text "body"
+ t.timestamp "created_at"
+ t.timestamp "updated_at"
+ t.string "namespace"
end
add_index "active_admin_comments", ["author_type", "author_id"], :name => "index_active_admin_comments_on_author_type_and_author_id"
@@ -29,18 +29,18 @@
add_index "active_admin_comments", ["resource_type", "resource_id"], :name => "index_admin_notes_on_resource_type_and_resource_id"
create_table "admin_users", :force => true do |t|
- t.string "email", :default => "", :null => false
- t.string "encrypted_password", :limit => 128, :default => "", :null => false
- t.string "reset_password_token"
- t.datetime "reset_password_sent_at"
- t.datetime "remember_created_at"
- t.integer "sign_in_count", :default => 0
- t.datetime "current_sign_in_at"
- t.datetime "last_sign_in_at"
- t.string "current_sign_in_ip"
- t.string "last_sign_in_ip"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.string "email", :default => "", :null => false
+ t.string "encrypted_password", :limit => 128, :default => "", :null => false
+ t.string "reset_password_token"
+ t.timestamp "reset_password_sent_at"
+ t.timestamp "remember_created_at"
+ t.integer "sign_in_count", :default => 0
+ t.timestamp "current_sign_in_at"
+ t.timestamp "last_sign_in_at"
+ t.string "current_sign_in_ip"
+ t.string "last_sign_in_ip"
+ t.timestamp "created_at"
+ t.timestamp "updated_at"
end
add_index "admin_users", ["email"], :name => "index_admin_users_on_email", :unique => true
@@ -62,21 +62,23 @@
t.datetime "created_at"
t.datetime "updated_at"
t.string "prepared_by"
+ t.date "date_issued"
+ t.date "date_finished"
end
create_table "users", :force => true do |t|
- t.string "email", :default => "", :null => false
- t.string "encrypted_password", :limit => 128, :default => "", :null => false
- t.string "reset_password_token"
- t.datetime "reset_password_sent_at"
- t.datetime "remember_created_at"
- t.integer "sign_in_count", :default => 0
- t.datetime "current_sign_in_at"
- t.datetime "last_sign_in_at"
- t.string "current_sign_in_ip"
- t.string "last_sign_in_ip"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.string "email", :default => "", :null => false
+ t.string "encrypted_password", :limit => 128, :default => "", :null => false
+ t.string "reset_password_token"
+ t.timestamp "reset_password_sent_at"
+ t.timestamp "remember_created_at"
+ t.integer "sign_in_count", :default => 0
+ t.timestamp "current_sign_in_at"
+ t.timestamp "last_sign_in_at"
+ t.string "current_sign_in_ip"
+ t.string "last_sign_in_ip"
+ t.timestamp "created_at"
+ t.timestamp "updated_at"
end
add_index "users", ["email"], :name => "index_users_on_email", :unique => true
Please sign in to comment.
Something went wrong with that request. Please try again.