This commit is contained in:
2020-06-09 22:34:52 +00:00
parent 9fed178542
commit 1406e5cdc9
6 changed files with 27 additions and 12 deletions

View File

@@ -216,8 +216,9 @@ app.purchaseEdit = (function() {
.attr("name", "customerId")
.attr("value", res.customerId)
.appendTo("#frm");
title = "Purchase - " + res.name;
if (stateMap.id != "new") {
//fetch existing record
app.api.get("purchase/" + stateMap.id, function(res) {
@@ -230,10 +231,18 @@ app.purchaseEdit = (function() {
});
} else {
//it's a new record, set default
$("#quantity").val(1);
$("#purchaseDate").val(new Date().toISOString().substring(0, 10));
$("#expireDate").val(
moment()
.add(1, "years")
.toISOString()
.substring(0, 10)
);
$("#vendorName").val("ShareIt");
}
//set title
//app.nav.setContextTitle(title);
}
});