Fixed order sorting + instore orders missing values

master
Mark Moffat 2020-03-25 12:48:23 +10:30
parent 52af6e1490
commit e91b44074a
3 changed files with 11 additions and 2 deletions

View File

@ -206,5 +206,6 @@
"Company": "Company",
"View": "View",
"Related products": "Related products",
"Disable stock tracking": "Disable stock tracking"
"Disable stock tracking": "Disable stock tracking",
"Company name": "Company name"
}

View File

@ -21,7 +21,7 @@ router.get('/admin/orders/:page?', restrict, async (req, res, next) => {
}
// Get our paginated data
const orders = await paginateData(false, req, pageNum, 'orders', {}, { productAddedDate: -1 });
const orders = await paginateData(false, req, pageNum, 'orders', {}, { orderDate: -1 });
// If API request, return json
if(req.apiAuthenticated){
@ -133,7 +133,9 @@ router.post('/admin/order/create', async (req, res, next) => {
orderShipping: req.session.totalCartShipping,
orderItemCount: req.session.totalCartItems,
orderProductCount: req.session.totalCartProducts,
orderCustomer: getId(req.session.customerId),
orderEmail: req.body.email || req.session.customerEmail,
orderCompany: req.body.company || req.session.customerCompany,
orderFirstname: req.body.firstName || req.session.customerFirstname,
orderLastname: req.body.lastName || req.session.customerLastname,
orderAddr1: req.body.address1 || req.session.customerAddress1,

View File

@ -44,6 +44,12 @@
<input type="text" class="form-control" name="orderLastName" id="orderLastName" value="{{session.customerLastname}}" placeholder="Last name" required>
</div>
</div>
<div class="col-12">
<div class="form-group">
<label class="control-label">{{ @root.__ "Company name" }}</label>
<input type="text" class="form-control" name="orderCompany" id="orderCompany" value="{{session.customerCompany}}" placeholder="Company name">
</div>
</div>
<div class="col-12">
<div class="form-group">
<label class="control-label">{{ @root.__ "Address 1" }} *</label>