Skip to content

Commit

Permalink
Merge pull request #1 from beckf/devel
Browse files Browse the repository at this point in the history
added export
  • Loading branch information
beckf authored Sep 5, 2023
2 parents e75cdd2 + 7ef0b48 commit a5a3c7d
Show file tree
Hide file tree
Showing 4 changed files with 563 additions and 58 deletions.
70 changes: 57 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,30 @@ This script can be run as python in its own virtualenv or by using the pyinstall
[releases](https://github.com/beckf/ls-vc-connector-cmd/releases).

### <a name="getting-started"></a>How to Get Started
Export all of your settings from LSVCConnector using version >= 1.52.
1) Follow the steps to creating an authorized Lightspeed app using the [LSVCConnector](https://github.com/beckf/lightspeed-vc-connector/wiki "LSVCConnector") PyQT app.
2) Export all of your settings from LSVCConnector using version >= 1.52.
On the Settings Tab, click Export Settings.

**Keep this file safe as it contains your API credentials.**

Download the latest release from releases and uncompress.
3) Download the latest release from releases and uncompress. OR clone and create a new virtualenv using requirements.txt

Check out the help by running the binary with --help
```angular2html
/path/to/lsvcconnector-cmd --help
```

You can specify how to sync records using a json file as input, directly using commandline switches,
or a mix of both.
### Syncing Lightspeed with Veracross
Students, Faculty and Staff can be synced from Veracross to LightspeedHQ.

First create a json file that defines how you want to sync the data. See sample_export_settings.json

JSON Options:
```angular2html
sync_type: "Students" or "Faculty Staff"
sync_force: false or true
sync_delete_missing: false or true
after_date: YYYY-MM-DD,
type: "Students" or "FacultyStaff" - This is the endpoint in Veracross which should match as CustomerType in LS
sync_force: false or true - Force updating all records in search.
sync_delete_missing: false or true - Delete any record of this type not found in Veracross.
after_date: YYYY-MM-DD - Only sync records that have been updated after YYYY-MM-DD in Veracross.
grade_level: Grade Level ID from Veracross System Homepage in JSON list form -- [1,2,3,4]
```

Expand All @@ -37,7 +40,7 @@ Sample JSON Files:
All Students
```
{
"sync_type": "Students",
"type": "Students",
"sync_force": false,
"sync_delete_missing": false,
"sync_filters": {
Expand All @@ -50,7 +53,7 @@ All Students
Students Grade 1-4 updated after 2022-12-02
```
{
"sync_type": "Students",
"type": "Students",
"sync_force": false,
"sync_delete_missing": false,
"sync_filters": {
Expand All @@ -63,7 +66,7 @@ Students Grade 1-4 updated after 2022-12-02
Faculty records updated after 12-02-2022
```
{
"sync_type": "Faculty Staff",
"type": "Faculty Staff",
"sync_force": false,
"sync_delete_missing": false,
"sync_filters": {
Expand All @@ -75,12 +78,53 @@ Faculty records updated after 12-02-2022

Then execute using:
```angular2html
/path/to/lsvcconnector-cmd --sync --config=config.json --sync_json=my_input_file.json
/path/to/lsvcconnector-cmd --operation=sync --config=config.json --operation_json=my_input_file.json
```

You can also mix cdm switches with json. The switches will override the json file.

```angular2html
/path/to/lsvcconnector-cmd --sync --config=config.json --sync_json=my_input_file.json --sync_type="Students" --filter_after_date="2022-12-01"
/path/to/lsvcconnector-cmd --operation=sync --config=config.json --operation_json=my_input_file.json --sync_type="Students" --filter_after_date="2022-12-01"
```

### Exporting from Lightspeed for Upload to Veracross CSV
Create a json definition file that contains the settings you want for your export. Files are generated in format the works with
https://import.veracross.com/SCHOOLCODE

```angular2html
type: "Students" or "FacultyStaff" - This is the endpoint in Veracross which should match as CustomerType in LS
export_shop: The name of the shop as listed in Lightspeed.
export_path: Full OS path to folder for export file.
export_clear_charges: true or false - Clear charges of accounts that have balances. Only applies to those in this export.
export_clear_charges_employee_name: Name of the employee in Lightspeed that will show as who applied the credit.
export_clear_payment_type: The name of the tender type in Lightspeed that the cleared balance will be assigned to.
export_date_begin: Export charges begin search date.
export_date_end: Export charges end search date.
export_options_transaction_source: Veracross Transaction Source code applied to each item in export.
export_options_school_year: Veracross invoice school year.
export_options_transaction_type: Veracross Transaction Source applied to each item in export.
export_options_catalog_item: Veracross catalog item
```

Example:
```angular2html
{
"type": "Student",
"export_shop": "Bookstore",
"export_path": "/home/user/store_exports",
"export_clear_charges": false,
"export_clear_charges_employee_name": "John Smith",
"export_clear_payment_type" : "Charge Account",
"export_date_begin": "2023-12-01",
"export_date_end": "2023-12-31",
"export_options_transaction_source": 2,
"export_options_school_year": 2023,
"export_options_transaction_type": 1,
"export_options_catalog_item": 22
}
```

Execute the export operation.
```angular2html
/path/to/lsvcconnector-cmd --operation=export --config=config.json --operation_json=my_export_file.json
```
Loading

0 comments on commit a5a3c7d

Please sign in to comment.