diff --git a/app/controllers/clients.js b/app/controllers/clients.js index 3f9490e..b1202f7 100644 --- a/app/controllers/clients.js +++ b/app/controllers/clients.js @@ -8,7 +8,7 @@ var frequencies = ["annual","semi","quarterly","sterilizer","tg","ert","rae","me exports.index = function(req, res) { var query = Client.find({ deleted: false }) - .select('name identifier') + .select('name identifier address') .slice('contacts', 1) .sort('name') .exec(function(err, results) { @@ -79,6 +79,7 @@ exports.create = function(req, res, next) { identifier: req.body.identifier, contacts: req.body.contacts, address: req.body.address, + notes: req.body.notes, frequencies: {} }); @@ -108,6 +109,7 @@ exports.update = function(req, res, next) { client.contacts = req.body.contacts; client.address = req.body.address; client.frequencies = req.body.frequencies; + client.notes = req.body.notes; return client.save(function(err) { if (!err) { diff --git a/app/controllers/workorders.js b/app/controllers/workorders.js index 4400980..4f2950c 100644 --- a/app/controllers/workorders.js +++ b/app/controllers/workorders.js @@ -134,6 +134,8 @@ module.exports = function(calendar) { cmd.$inc[key] = 1; console.log(cmd); Client.findByIdAndUpdate(req.body.client, cmd, function(err, ignored) { callback(err, result) }); + } else { + callback(null, result); } }, ], diff --git a/app/model/client.js b/app/model/client.js index db0969a..b78de98 100644 --- a/app/model/client.js +++ b/app/model/client.js @@ -20,7 +20,11 @@ var clientSchema = new Schema({ frequencies: {}, pms: {}, workorders: [{ type: ObjectId, ref: 'Workorder' }], - deleted: { type: Boolean, default: false } + deleted: { type: Boolean, default: false }, + notes: { + internal: String, + tech: String + } }); module.exports = mongoose.model('Client', clientSchema); diff --git a/public/js/controllers.js b/public/js/controllers.js index 3891fb7..77a1dfc 100644 --- a/public/js/controllers.js +++ b/public/js/controllers.js @@ -131,7 +131,8 @@ biomed.ClientEditCtrl = function($scope, $routeParams, Clients) { $scope.primaryContact = createContactController(0); $scope.secondaryContact = createContactController(1); $scope.other = createOtherController(); - + $scope.internalNotes = createController(); + $scope.techNotes = createController(); function updatePms() { var currentMonth = new Date().getMonth(); diff --git a/public/partials/clients/add.html b/public/partials/clients/add.html index 487eb44..9a74a69 100644 --- a/public/partials/clients/add.html +++ b/public/partials/clients/add.html @@ -165,6 +165,27 @@ + +
+
Notes
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
 
diff --git a/public/partials/clients/edit.html b/public/partials/clients/edit.html index d9a7f3d..8986d3b 100644 --- a/public/partials/clients/edit.html +++ b/public/partials/clients/edit.html @@ -6,6 +6,7 @@

{{master.name}}

{{master.identifier}}

+ Create new Workorder
@@ -224,9 +225,6 @@
- @@ -312,4 +310,51 @@ + +
+
+ +
+
+ {{master.notes.internal}}
+ Edit +
+
+
+ +
+ +
+
+
+ + +
+
+
+
+ +
+ +
+
+ {{master.notes.tech}}
+ Edit +
+
+
+ +
+ +
+
+
+ + +
+
+
+
+
+ diff --git a/public/partials/workorders/add.html b/public/partials/workorders/add.html index ce5467c..155594c 100644 --- a/public/partials/workorders/add.html +++ b/public/partials/workorders/add.html @@ -22,6 +22,7 @@ +
@@ -185,10 +186,6 @@
-

Note:

-

Please only click save once, your work order is being saved the first time you click the button. There is a small bug preventing the page from returning you back to where you came from. This will be fixed after working hours.

-

If you notice any other issues, or need help with a work order, please feel free to Open a Ticket -