Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
moneyworks:edi_manager [2025/10/08 03:02] – created Craig Drown | moneyworks:edi_manager [2025/10/08 03:33] (current) – [Configuration Settings] Craig Drown | ||
---|---|---|---|
Line 9: | Line 9: | ||
====== Key features: ====== | ====== Key features: ====== | ||
- | - **MW Transaction Export:** Extracts transactions from MW, builds UBL XML documents using JSON templates, and exports them to Edimondo. | + | * **MW Transaction Export:** Extracts transactions from Moneyworks, builds UBL XML documents using JSON templates, and exports them to Edimondo. |
- | - **MW Transaction Reprocessing: | + | |
- | - **Edimondo Status Checking:** Checks the delivery status of sent documents and updates MW/DB accordingly. | + | |
- | - **Order Import:** Retrieves orders from Edimondo, parses UBL XML, and imports them into MW. | + | |
- | - **Configurable: | + | |
- | - **Logging: | + | |
- | - **Utilities: | + | |
====== Main modules: ====== | ====== Main modules: ====== | ||
- | - mw_to_ubl.rs: | + | * mw_to_ubl.rs: |
- | - ubl_to_mw.rs: | + | |
- | - mw.rs: MW API communication. | + | |
- | - edimondo.rs: | + | |
- | - invoice.rs, order.rs: UBL document construction and parsing. | + | |
- | - export.rs, operations.rs: | + | |
- | - db.rs: Database operations for exports/ | + | |
- | - config.rs: Configuration management. | + | |
- | - utilities.rs: | + | |
====== Entry point: ====== | ====== Entry point: ====== | ||
Line 35: | Line 35: | ||
====== Data flow: ====== | ====== Data flow: ====== | ||
- | MW transactions are exported, transformed to UBL XML, sent to Edimondo, and their status is tracked. Incoming orders from Edimondo are parsed and imported into MW. | + | Moneyworks |
====== Config files: ====== | ====== Config files: ====== | ||
- | - config.toml for settings | + | * config.toml for settings |
- | - control_file.txt for last modified timestamps | + | |
- | - JSON templates for UBL documents in templates | + | |
For more details, see the main service logic in lib.rs and mw_to_ubl.rs | For more details, see the main service logic in lib.rs and mw_to_ubl.rs | ||
+ | |||
+ | ===== Configuration Settings ===== | ||
+ | |||
+ | The configuration file (config.toml) controls all runtime behaviour. The main sections and their fields are: | ||
+ | |||
+ | | ||
+ | * `url`: Base URL for Moneyworks REST API. | ||
+ | * `folder_name`, | ||
+ | * `document_username`, | ||
+ | * `file_name`: | ||
+ | |||
+ | | ||
+ | * `party_endpoint_id`: | ||
+ | * `party_identification`: | ||
+ | * `party_name`: | ||
+ | * `street_name`, | ||
+ | * `city_name`, | ||
+ | * `tax_scheme`: | ||
+ | |||
+ | | ||
+ | * `url`: Edimondo API base URL. | ||
+ | * `api_key`: API key for Edimondo authentication. | ||
+ | * `outbox_faktura_boxid`: | ||
+ | * `inbox_ordrer_boxid`: | ||
+ | |||
+ | | ||
+ | * `invoices_out_folder`: | ||
+ | * `orders_in_folder`: | ||
+ | |||
+ | | ||
+ | * `reexport_colour`: | ||
+ | * `database_url`: | ||
+ | |||
+ | | ||
+ | * `host_name`: | ||
+ | * `from_name_address`: | ||
+ | * `email_address`: | ||
+ | * `password`: SMTP password. | ||
+ | * `port_number`: | ||
+ | * `send_to_addresses`: | ||
+ | |||
+ | Note that the config file contains passwords and keys, so you should not send it via email or store it at any other location unless the data is encrypted and password protected. | ||