Skip to content

Commit

Permalink
Merge pull request #183 from nguyenngoclinhchi/master
Browse files Browse the repository at this point in the history
Change minor error to fix import
  • Loading branch information
tenvinc authored Nov 8, 2018
2 parents 20151cc + 6546fde commit a11f022
Show file tree
Hide file tree
Showing 26 changed files with 176 additions and 108 deletions.
54 changes: 41 additions & 13 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ The `Storage` component,
[[Design-Commons]]
=== Common classes

Classes used by multiple components are in the `seedu.addressbook.commons` package.
Classes used by multiple components are in the `seedu.planner.commons` package.

== Implementation

Expand Down Expand Up @@ -757,7 +757,7 @@ DeleteByDateEntryCommand calls `ModelManager#getFilteredRecordList` to retrieve

If there exists target records, `ModelManager#commitFinancialPlanner` will be called to update the current version of Financial Planner and the message, which states records have been deleted. Then, `ModelManager#autoLimitCheck` will be called to check the current change in limit as we delete some records exceeds the limit or not.

This feature has only one keyword `delete_date` and implements only 1 argument mode.
This feature has only one keyword `deletedate` and implements only 1 argument mode.
The three argument modes are as listed below:

* Single Argument mode -- Requires only one date. It deletes all records whose date is required.
Expand All @@ -769,7 +769,7 @@ image::DeleteByDateEntrySequenceDiagram.png[width:800]

// end::delete_by_date_entry[]

// tag::export_excel[]
// tag::exportexcel[]
=== Export into Excel file
==== Current implementation
The export into excel file mechanism is facilitated by `ModelManager` with the help of `ExcelUtil`, the utility created to handle all methods relating to Excel. It represents an in-memory model of the FinancialPlanner and is the component which manages the interactions between the commands, `ExcelUtil` and the `VersionedFinancialPlanner`.
Expand All @@ -790,27 +790,27 @@ With the sufficient information, `List<Record> records`, `List<SummaryByDateEntr

image::Export_Capture1_LinhChi.png[width:800]

* `SUMMARY DATA` stored the summary statistics for the period you exported, and there is a *Line Chart* next to the table for visual statistic [refer to `Draw line chart` part for more information]. As you can see in the picture, there are 3 series shown:
* `SUMMARY DATA` stored the summary statistics for the period you exported, and there is a *Line Chart* next to the table for visual statistic [refer to `Draw a line chart automatically inside the Excel sheet` part for more information]. As you can see in the picture, there are 3 series shown:
** The first blue line named Income represents the relation between Timeline (each component is one Date) and the Income (each component is one income).
** The second orange line named Outcome represents the relation between Timeline (each component is one Date) and the Outcome (each component is one outcome).
** The third grey line named Net represents the relation Timeline (each component is one Date) and the Net - Sum of income and outcome (each component is one net).

image::Export_Capture2_LinhChi.png[width:800]

This feature has only one keyword `export_excel` but implements 6 different argument modes to allow users to access multiple versions of the same command.
This feature has only one keyword `exportexcel` but implements 6 different argument modes to allow users to access multiple versions of the same command.
The six argument modes are as listed below:

* *No argument mode* `export_excel` will list down all records in the Financial Planner and exports all of them to an Excel file and store the file in the default *WORKING DIRECTORY*, it will *detect automatically User's Working Directory*.
* *No argument mode* `exportexcel` will list down all records in the Financial Planner and exports all of them to an Excel file and store the file in the default *WORKING DIRECTORY*, it will *detect automatically User's Working Directory*.

* *Single argument Date mode* `export_excel d/DATE` will list down all records with the specified date and exports all shown records to an Excel file and store the file in the default *WORKING DIRECTORY*, it will *detect automatically user's Working Directory*.
* *Single argument Date mode* `exportexcel d/DATE` will list down all records with the specified date and exports all shown records to an Excel file and store the file in the default *WORKING DIRECTORY*, it will *detect automatically user's Working Directory*.

* *Dual argument Date mode* `export_excel d/START_DATE END_DATE` will list down all records with the date that fall on either dates or between both dates and exports all shown records to an Excel file and store the file in the default *WORKING DIRECTORY*, it will *detect automatically User's Working Directory*.
* *Dual argument Date mode* `exportexcel d/START_DATE END_DATE` will list down all records with the date that fall on either dates or between both dates and exports all shown records to an Excel file and store the file in the default *WORKING DIRECTORY*, it will *detect automatically User's Working Directory*.

* *Single argument Directory Path mode* `export_excel dir/DIRECTORY_PATH` will list down all records in the Financial Planner and exports all of them to an Excel file and store the file in the chosen Directory Path.
* *Single argument Directory Path mode* `exportexcel dir/DIRECTORY_PATH` will list down all records in the Financial Planner and exports all of them to an Excel file and store the file in the chosen Directory Path.

* *Single argument Date mode + Single argument Directory path mode* `export_excel d/DATE dir/DIRECTORY_PATH` will list down all records with the specified date and exports all shown records to an Excel file and store the file in the chosen Directory Path.
* *Single argument Date mode + Single argument Directory path mode* `exportexcel d/DATE dir/DIRECTORY_PATH` will list down all records with the specified date and exports all shown records to an Excel file and store the file in the chosen Directory Path.

* *Dual argument Date mode + Single argument Directory path mode* `export_excel d/START_DATE END_DATE dir/DIRECTORY_PATH` will list down all records with the date that fall on either dates or between both dates and exports all shown records to an Excel file and store the file in the chosen Directory Path.
* *Dual argument Date mode + Single argument Directory path mode* `exportexcel d/START_DATE END_DATE dir/DIRECTORY_PATH` will list down all records with the date that fall on either dates or between both dates and exports all shown records to an Excel file and store the file in the chosen Directory Path.
+

The mechanism that facilitates these modes can be found in the `ExportExcelCommandParser#parse`. Below is a overview of the mechanism:
Expand Down Expand Up @@ -846,7 +846,7 @@ The update of the UI `RecordListPanel` is done through the event system. `Filter
implemented by the Java 8 API and it will propagate any changes to the list to any listeners listening to it. This
listener is present in `RecordListPanel` and will update the UI list automatically.

// end::export_excel[]
// end::exportexcel[]

// tag::import[]

Expand All @@ -856,6 +856,12 @@ The import from Excel file mechanism is facilitated by `ExcelUtil`, the utility

ImportExcelCommand calls `ExcelUtil#readExcelSheet` to read the Excel file and retrieve data of records from them to create a list of record List<Record>.

In `ExcelUtil#readExcelSheet`, by using method `XSSFWorkbook#setMissingCellPolicy`, every missing cell will be considered as Null cell, quite useful when you export or archive the record data if the record does not have tag.

If blank row is found, the `ExcelUtil#readExcelSheet` will ignore and read the next line, until the last line is read. This concept also applies to read multiple sheets until all sheets have been read.

However, please take note that in order to prevent errors, every sheet that user want to read have to set the First row of the table *must* have 4 cells, namely NAME, DATE, MONEY, TAGS. These 4 columns can be case-insensitive. The sheet with records data but does not have the first row, NAME, DATE, MONEY, TAGS will *not* be read.

After that, `ModelManager#addListUniqueRecord` is called to add the records in the List<Record>. If the record has already existed in the Financial Planner, it will be ignored and not added into the Financial Planner.

Eventually, when all the records are added in the Financial Planner, `ModelManager#commitFinancialPlanner` will be called to update the current version of Financial Planner and the message, which states records have been added.
Expand Down Expand Up @@ -931,7 +937,7 @@ With the sufficient information, `List<Record> records`, `List<SummaryByDateEntr

image::Export_Capture1_LinhChi.png[width:800]

* `SUMMARY DATA` stored the summary statistics for the period you archived, and there is a *Line Chart* next to the table for visual statistic [refer to `Draw line chart` part for more information]. As you can see in the picture, there are 3 series shown:
* `SUMMARY DATA` stored the summary statistics for the period you archived, and there is a *Line Chart* next to the table for visual statistic [refer to `Draw a line chart automatically inside the Excel sheet` part for more information]. As you can see in the picture, there are 3 series shown:
** The first blue line named Income represents the relation between Timeline (each component is one Date) and the Income (each component is one income).
** The second orange line named Outcome represents the relation between Timeline (each component is one Date) and the Outcome (each component is one outcome).
** The third grey line named Net represents the relation Timeline (each component is one Date) and the Net - Sum of income and outcome (each component is one net).
Expand Down Expand Up @@ -991,6 +997,28 @@ listener is present in `RecordListPanel` and will update the UI list automatical

// end::archive[]

// tag::draw_line_chart[]

=== Draw a line chart automatically inside the Excel sheet
==== Current implementation

This feature will automatically uses the the summary data from the `SUMMARY DATA` sheet in the Excel sheet after the command `archive` or `export_excel` is called.

The feature mechanism is facilitated by `ExcelUtil`, the utility created to handle all methods relating to Excel. It is the component which manages the interactions between the ExportExcelCommand or the ArchiveCommand with `ExcelUtil#drawChart`.

As you can see the screenshot below, in the `SUMMARY DATA` sheet (refer to `Export into Excel file` or `Archive into Excel file` feature), next to the summary table:

* The size of the line chart (based on default column width and default row height) is:
** The width is 15 columns
** The height is 30 rows.
* On the top left of the chart, the legend shows 3 lines, namely Income, Outcome, and Net.
** The first blue line shows the Income based on Date.
** The second orange line shows the Outcome based on Date
** The third grey line shows the Net (total of income and outcome) based on Date.

image::Export_Capture2_LinhChi.png[width:800]

// end::draw_line_chart[]

=== Design Considerations
==== Aspect: Data structure to support listing of records
Expand Down
64 changes: 38 additions & 26 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,10 @@ Deletes the 2nd record in the expense book.
Deletes the 1st record in the results of the `find` command.

// tag::delete_by_date_entry[]
=== Deleting records by date. `delete_date`
=== Deleting records by date. `deletedate`

Deletes the records with a specified date from the expense book. +
Format: `delete_date DATE`
Format: `deletedate DATE`

****
* Deletes records with the specified `DATE`.
Expand All @@ -281,7 +281,7 @@ Format: `delete_date DATE`

Examples:

* `delete_date 31-7-2018` +
* `deletedate 31-7-2018` +
Deletes the records with date 31-7-2018.

// end::delete_by_date_entry[]
Expand All @@ -304,7 +304,7 @@ Format: `undo`
[NOTE]
====
Undoable commands: those commands that modify the FinancialPlanner's stored content (
`add`, `delete`, `deletedate`, `edit`, `addlimit`, `deletelimit`, `editlimit` and `clear`).
`add`, `delete`, `deletedate`, `exportexcel`, `archive`, `import`, `edit`, `addlimit`, `deletelimit`, `editlimit` and `clear`).
====

Examples:
Expand Down Expand Up @@ -515,22 +515,22 @@ image::WelcomePanelWithPieCharts.png[width="790"]

This section describe features for the user to manage his/her records data in the Financial Planner, with the help of Excel.

// tag::export_excel[]
// tag::exportexcel[]

=== Export the records into the Excel file. `export_excel`
=== Export the records into the Excel file. `exportexcel`

Exports the records into an Excel file. +


There are 6 modes, default mode, single argument mode and dual argument mode (for Date) and single argument mode (Directory Path). +
Format: +

* Default mode: `export_excel` +
* Single argument Date mode: `export_excel d/DATE` +
* Dual argument Date mode: `export_excel d/START_DATE END_DATE`
* Single argument Directory Path mode: `export_excel dir/DIRECTORY_PATH`
* Single argument Directory Path + Single argument Date mode: `export_excel d/DATE dir/DIRECTORY_PATH`
* Single argument Directory Path + Dual argument Date mode: `export_excel d/START_DATE END_DATE dir/DIRECTORY_PATH`
* Default mode: `exportexcel` +
* Single argument Date mode: `exportexcel d/DATE` +
* Dual argument Date mode: `exportexcel d/START_DATE END_DATE`
* Single argument Directory Path mode: `exportexcel dir/DIRECTORY_PATH`
* Single argument Directory Path + Single argument Date mode: `exportexcel d/DATE dir/DIRECTORY_PATH`
* Single argument Directory Path + Dual argument Date mode: `exportexcel d/START_DATE END_DATE dir/DIRECTORY_PATH`

****
* *Default mode* will list down all records in the Financial Planner and exports all of them to an Excel file and store the file in the default *WORKING DIRECTORY*, it will *detect automatically user's Working Directory*.
Expand All @@ -547,18 +547,21 @@ Format: +
+
****

Please note that

****
* Date follow the same configurations as date parameters required when adding records. It is in the form of *dd-mm-yyyy* where *dd* represents day, *mm* represents month and *yyyy* represents the year. *dd* and *mm* both require 1 to 2 digits while
*yyyy* requires exactly 4 digits.
****

Examples:

* `export_excel`
* `export_excel d/31-3-1999`
* `export_excel d/31-3-1999 31-03-2019`
* `export_excel d/31-3-1999 dir/C:\`
* `export_excel d/31-3-1999 31-3-2019 dir/C:\`
* `exportexcel`
* `exportexcel d/31-3-1999`
* `exportexcel dir/C:\`
* `exportexcel d/31-3-1999 31-03-2019`
* `exportexcel d/31-3-1999 dir/C:\`
* `exportexcel d/31-3-1999 31-3-2019 dir/C:\`

The Excel file name will be named based on the command, relating to Date: +

Expand All @@ -573,7 +576,7 @@ There will be two sheets in the Excel file, namely `RECORD DATA` and `SUMMARY DA

image::Export_Capture1_LinhChi.png[width:800]

* `SUMMARY DATA` stored the summary statistics for the period you exported, and there is a *Line Chart* next to the table for visual statistic [refer to `Draw line chart` part for more information].
* `SUMMARY DATA` stored the summary statistics for the period you exported, and there is a *Line Chart* next to the table for visual statistic [refer to `Draw a line chart automatically inside the Excel sheet` part for more information].
** As you can see in the picture, there are 3 series shown:
*** The first blue line named Income represents the relation between Timeline (each component is one Date) and the Income (each component is one income).
*** The second orange line named Outcome represents the relation between Timeline (each component is one Date) and the Outcome (each component is one outcome).
Expand All @@ -584,11 +587,11 @@ image::Export_Capture2_LinhChi.png[width:800]
As the size of the Chart is fixed initially. Sometimes, when user exports too many dates, the distance between each date on the chart might be tight. It is suggesting that the user justify the size of the chart by himself/herself.


// end::export_excel[]
// end::exportexcel[]

// tag::import[]

=== Import the records stored from the Excel file. `import`
=== Import the records stored from the Excel file into the App. `import`

There are 2 modes, single argument File Path mode and (single argument Directory Path + single argument File Name) mode +

Expand Down Expand Up @@ -658,6 +661,8 @@ Format: +
+
****

Please note that

****
* Date follow the same configurations as date parameters required when adding records. It is in the form of *dd-mm-yyyy* where *dd* represents day, *mm* represents month and *yyyy* represents the year. *dd* and *mm* both require 1 to 2 digits while
*yyyy* requires exactly 4 digits.
Expand All @@ -674,6 +679,7 @@ Examples:

* `archive`
* `archive d/31-3-1999`
* `archive dir/C:\`
* `archive d/31-3-1999 31-03-2019`
* `archive d/31-3-1999 dir/C:\`
* `archive d/31-3-1999 31-3-2019 dir/C:\`
Expand All @@ -684,7 +690,7 @@ There will be two sheets in the Excel file, namely `RECORD DATA` and `SUMMARY DA

image::Export_Capture1_LinhChi.png[width:800]

* `SUMMARY DATA` stored the summary statistics for the period you archived, and there is a *Line Chart* next to the table for visual statistic [refer to `Draw line chart` part for more information].
* `SUMMARY DATA` stored the summary statistics for the period you archived, and there is a *Line Chart* next to the table for visual statistic [refer to `Draw a line chart automatically inside the Excel sheet` part for more information].
** As you can see in the picture, there are 3 series shown:
*** The first blue line named Income represents the relation between Timeline (each component is one Date) and the Income (each component is one income).
*** The second orange line named Outcome represents the relation between Timeline (each component is one Date) and the Outcome (each component is one outcome).
Expand All @@ -696,11 +702,11 @@ image::Export_Capture2_LinhChi.png[width:800]

// end::archive[]

=== Draw a line chart automatically inside the Excel sheet
// tag::draw_line_chart[]

Automatically uses the the summary data from the `SUMMARY DATA` sheet in the Excel sheet after the command `archive` or `export_excel` is called.
=== Draw a line chart automatically inside the Excel sheet

This feature does not require user typing the command. It is automatically done if the user type in command `archive` or `export_excel`.
Automatically uses the the summary data from the `SUMMARY DATA` sheet in the Excel sheet after the command `archive` or `exportexcel` is called.

As you can see the screenshot below, in the `SUMMARY DATA` sheet, next to the summary table:

Expand All @@ -714,6 +720,8 @@ As you can see the screenshot below, in the `SUMMARY DATA` sheet, next to the su

image::Export_Capture2_LinhChi.png[width:800]

// end::draw_line_chart[]

// tag::limitfeatures[]

== Spending Limit Features
Expand Down Expand Up @@ -862,6 +870,8 @@ Examples:

=== Auto Complete for wider range of inputs and accuracy `[Coming in v2.0]`

===

== FAQ

*Q*: How do I transfer my data to another Computer? +
Expand Down Expand Up @@ -925,19 +935,21 @@ e.g. `stats d/20-12-2017 31-09-2018`
e.g. +
. `exportexcel`
. `exportexcel d/31-3-1999`
. `exportexcel dir/C:\`
. `exportexcel d/31-3-1999 31-03-2019`
. `exportexcel d/31-3-1999 dir/C:\`
. `exportexcel d/31-3-1999 31-3-2019 dir/C:\`

* *Import into app* : multiple modes of `import` +
* *Import from Excel file into app* : multiple modes of `import` +
e.g. +
. `import dir/C:\Financial_Planner_ALL.xlsx`
. `import dir/C:\ n/Financial_Planner_All.xlsx`

* *Archive records* : multiple modes of `archive` +
* *Archive records into Excel file* : multiple modes of `archive` +
e.g. +
. `archive`
. `archive d/31-3-1999`
. `archive dir/C:\`
. `archive d/31-3-1999 31-03-2019`
. `archive d/31-3-1999 dir/C:\`
. `archive d/31-3-1999 31-3-2019 dir/C:\`
Expand Down
Loading

0 comments on commit a11f022

Please sign in to comment.