diff --git a/erpnext/projects/doctype/timesheet/timesheet.js b/erpnext/projects/doctype/timesheet/timesheet.js
index 8811ab9..8ffc10e 100644
--- a/erpnext/projects/doctype/timesheet/timesheet.js
+++ b/erpnext/projects/doctype/timesheet/timesheet.js
@@ -10,8 +10,8 @@
 				filters:{
 					'status': 'Active'
 				}
-			}
-		}
+			};
+		};
 
 		frm.fields_dict['time_logs'].grid.get_field('task').get_query = function(frm, cdt, cdn) {
 			var child = locals[cdt][cdn];
@@ -20,33 +20,37 @@
 					'project': child.project,
 					'status': ["!=", "Cancelled"]
 				}
-			}
-		}
+			};
+		};
 
 		frm.fields_dict['time_logs'].grid.get_field('project').get_query = function() {
 			return{
 				filters: {
 					'company': frm.doc.company
 				}
-			}
-		}
+			};
+		};
 	},
 
 	onload: function(frm){
 		if (frm.doc.__islocal && frm.doc.time_logs) {
 			calculate_time_and_amount(frm);
 		}
+
+		if (frm.is_new()) {
+			set_employee_and_company(frm);
+		}
 	},
 
 	refresh: function(frm) {
 		if(frm.doc.docstatus==1) {
 			if(frm.doc.per_billed < 100 && frm.doc.total_billable_hours && frm.doc.total_billable_hours > frm.doc.total_billed_hours){
-				frm.add_custom_button(__("Make Sales Invoice"), function() { frm.trigger("make_invoice") },
+				frm.add_custom_button(__("Make Sales Invoice"), function() { frm.trigger("make_invoice"); },
 					"fa fa-file-alt");
 			}
 
 			if(!frm.doc.salary_slip && frm.doc.employee){
-				frm.add_custom_button(__("Make Salary Slip"), function() { frm.trigger("make_salary_slip") },
+				frm.add_custom_button(__("Make Salary Slip"), function() { frm.trigger("make_salary_slip"); },
 					"fa fa-file-alt");
 			}
 		}
@@ -58,7 +62,7 @@
 				if ((row.from_time <= frappe.datetime.now_datetime()) && !row.completed) {
 					button = 'Resume Timer';
 				}
-			})
+			});
 
 			frm.add_custom_button(__(button), function() {
 				var flag = true;
@@ -77,7 +81,7 @@
 						erpnext.timesheet.timer(frm, row, timestamp);
 						flag = false;
 					}
-				})
+				});
 				// If no activities found to start a timer, create new
 				if (flag) {
 					erpnext.timesheet.timer(frm);
@@ -94,7 +98,7 @@
 		frappe.db.get_value('Company', { 'company_name' : frm.doc.company }, 'standard_working_hours')
 			.then(({ message }) => {
 				(frappe.working_hours = message.standard_working_hours || 0);
-		});
+			});
 	},
 
 	make_invoice: function(frm) {
@@ -125,8 +129,8 @@
 						frappe.set_route("Form", r.message.doctype, r.message.name);
 					}
 				}
-			})
-		})
+			});
+		});
 		dialog.show();
 	},
 
@@ -136,7 +140,7 @@
 			frm: frm
 		});
 	},
-})
+});
 
 frappe.ui.form.on("Timesheet Detail", {
 	time_logs_remove: function(frm) {
@@ -171,22 +175,22 @@
 				.find('[data-fieldname="timer"]')
 				.append(frappe.render_template("timesheet"));
 			frm.trigger("control_timer");
-		})
+		});
 	},
 	hours: function(frm, cdt, cdn) {
-		calculate_end_time(frm, cdt, cdn)
+		calculate_end_time(frm, cdt, cdn);
 	},
 
 	billing_hours: function(frm, cdt, cdn) {
-		calculate_billing_costing_amount(frm, cdt, cdn)
+		calculate_billing_costing_amount(frm, cdt, cdn);
 	},
 
 	billing_rate: function(frm, cdt, cdn) {
-		calculate_billing_costing_amount(frm, cdt, cdn)
+		calculate_billing_costing_amount(frm, cdt, cdn);
 	},
 
 	costing_rate: function(frm, cdt, cdn) {
-		calculate_billing_costing_amount(frm, cdt, cdn)
+		calculate_billing_costing_amount(frm, cdt, cdn);
 	},
 
 	billable: function(frm, cdt, cdn) {
@@ -212,7 +216,7 @@
 					calculate_billing_costing_amount(frm, cdt, cdn);
 				}
 			}
-		})
+		});
 	}
 });
 
@@ -240,23 +244,23 @@
 			frm._setting_hours = true;
 			frappe.model.set_value(cdt, cdn, "to_time",
 				d.format(frappe.defaultDatetimeFormat)).then(() => {
-					frm._setting_hours = false;
-				});
+				frm._setting_hours = false;
+			});
 		}
 	}
-}
+};
 
 var update_billing_hours = function(frm, cdt, cdn){
 	var child = locals[cdt][cdn];
 	if(!child.billable) frappe.model.set_value(cdt, cdn, 'billing_hours', 0.0);
-}
+};
 
 var update_time_rates = function(frm, cdt, cdn){
 	var child = locals[cdt][cdn];
 	if(!child.billable){
 		frappe.model.set_value(cdt, cdn, 'billing_rate', 0.0);
 	}
-}
+};
 
 var calculate_billing_costing_amount = function(frm, cdt, cdn){
 	var child = locals[cdt][cdn];
@@ -270,7 +274,7 @@
 	frappe.model.set_value(cdt, cdn, 'billing_amount', billing_amount);
 	frappe.model.set_value(cdt, cdn, 'costing_amount', costing_amount);
 	calculate_time_and_amount(frm);
-}
+};
 
 var calculate_time_and_amount = function(frm) {
 	var tl = frm.doc.time_logs || [];
@@ -294,4 +298,17 @@
 	frm.set_value("total_hours", total_working_hr);
 	frm.set_value("total_billable_amount", total_billable_amount);
 	frm.set_value("total_costing_amount", total_costing_amount);
-}
\ No newline at end of file
+};
+
+// set employee (and company) to the one that's currently logged in
+const set_employee_and_company = function(frm) {
+	const options = { user_id: frappe.session.user };
+	const fields = ['name', 'company'];
+	frappe.db.get_value('Employee', options, fields).then(({ message }) => {
+		if (message) {
+			// there is an employee with the currently logged in user_id
+			frm.set_value("employee", message.name);
+			frm.set_value("company", message.company);
+		}
+	});
+};
