Skip to content

Commit

Permalink
Fix archiveordercard to not show schedule tags for cancelled orders +…
Browse files Browse the repository at this point in the history
… UG complete order
  • Loading branch information
qiujiaaa committed Nov 11, 2019
1 parent f03bbc9 commit e17130d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 3 additions & 1 deletion docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,9 @@ Format: `find-o KEYWORD [KEYWORD]...`


==== Complete an order : `complete`
Completes the order, order status changed to `COMPLETED`. Phone associated with order will also be deleted. +
Completes the order, order status changed to `COMPLETED`. +
Only `SCHEDULED` orders can be completed. +
Phone associated with order will also be deleted. +
Format: `complete INDEX`

==== Cancel an order : `cancel`
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/seedu/address/ui/cards/ArchivedOrderCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ public ArchivedOrderCard(Order order, int displayedIndex) {
orderPrice.setText(order.getPrice().value);

if (order.getStatus().equals(Status.COMPLETED)) {
order.getSchedule().get().getTags().stream().sorted(Comparator.comparing(tag -> tag.tagName))
.forEach(tag -> scheduleTags.getChildren().add(new Label(tag.tagName)));
assert(order.getSchedule().isPresent());
try {
orderStatus.setText(String.format("%s : %s | Venue: %s", order.getStatus().toString(),
Expand All @@ -100,10 +102,6 @@ public ArchivedOrderCard(Order order, int displayedIndex) {
orderStatus.setText(order.getStatus().toString());
}

if (order.getSchedule().isPresent()) {
order.getSchedule().get().getTags().stream().sorted(Comparator.comparing(tag -> tag.tagName))
.forEach(tag -> scheduleTags.getChildren().add(new Label(tag.tagName)));
}
if (order.getCustomer() != null) {
order.getCustomer().getTags().stream()
.sorted(Comparator.comparing(tag -> tag.tagName))
Expand Down

0 comments on commit e17130d

Please sign in to comment.