From 9370da18028b0dd6d2785bd803d145200a1de0bb Mon Sep 17 00:00:00 2001
From: lwlshawn <37958530+lwlshawn@users.noreply.github.com>
Date: Sun, 7 Nov 2021 14:57:30 +0800
Subject: [PATCH] Fix addorder id change bug
---
docs/UserGuide.md | 10 +++++-----
src/main/java/seedu/address/model/order/Order.java | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/docs/UserGuide.md b/docs/UserGuide.md
index 05f13c1fec4..1a03c9ae4f9 100644
--- a/docs/UserGuide.md
+++ b/docs/UserGuide.md
@@ -191,7 +191,7 @@ Allows you to delete a client from SalesNote.
Examples:
* Using `listclients` first, to display all clients in SalesNote followed by `deleteclient 2` will
delete the 2nd client in the displayed list.
-* Using `find Alice` first, followed by `deleteclient 1` will delete the 1st client in the results of the `find` command.
+* Using `findclient Alice` first, followed by `deleteclient 1` will delete the 1st client in the results of the `findclient` command.
This is a quick and convenient way to remove a specific client that you know is in SalesNote, without
having to scroll to find them.
@@ -637,10 +637,10 @@ If your changes to the data file make its format invalid, SalesNote will discard
Action | Format, Examples
--------|------------------
**ListClients** | `listclients`
-**AddClient** | `addclient n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS m/MEASUREMENT g/GENDER [r/REMARK] [t/TAG]…`
e.g., `add n/John Doe p/98765432 e/johnd@example.com a/John street Blk 92 g/M m/170_100_40 t/friend`
-**DeleteClient** | `deleteclient INDEX`
e.g., `delete 3`
-**EditClient** | `editclient INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [m/MEASUREMENT] [g/GENDER] [r/REMARK] [t/TAG]…`
e.g.,`edit 2 n/James Lee e/jameslee@example.com`
-**FindClients** | `findclient KEYWORD [MORE_KEYWORDS]`
e.g., `find James Jake`
+**AddClient** | `addclient n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS m/MEASUREMENT g/GENDER [r/REMARK] [t/TAG]…`
e.g., `addclient n/John Doe p/98765432 e/johnd@example.com a/John street Blk 92 g/M m/170_100_40 t/friend`
+**DeleteClient** | `deleteclient INDEX`
e.g., `deleteclient 3`
+**EditClient** | `editclient INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [m/MEASUREMENT] [g/GENDER] [r/REMARK] [t/TAG]…`
e.g.,`editclient 2 n/James Lee e/jameslee@example.com`
+**FindClients** | `findclient KEYWORD [MORE_KEYWORDS]`
e.g., `findclient James Jake`
### Task Commands
diff --git a/src/main/java/seedu/address/model/order/Order.java b/src/main/java/seedu/address/model/order/Order.java
index dfd83edb7be..1bf94aeb4f8 100644
--- a/src/main/java/seedu/address/model/order/Order.java
+++ b/src/main/java/seedu/address/model/order/Order.java
@@ -31,8 +31,8 @@ public Order(Label label, Customer customer, Date date, Amount amount) {
* Confirms the id when the application is sure the order is valid.
*/
public void confirmId() {
- this.id = id;
- id++;
+ this.id = count;
+ count++;
}
public boolean getIsComplete() {