Technical Reference¶
This section describes the technical details of the integration and field mapping.
Architecture¶
The integration is built on the Provider principle. Each entity (Invoice, Quote) has its own Provider that handles the transformation of data into XML format for Pohoda.
- Namespace:
Espo\Modules\Pohoda\Tools\Pohoda\Providers - Base Class:
AbstractProvider
List of Providers¶
| CRM Entity | Pohoda Entity | Provider Class |
|---|---|---|
| Account | Addressbook | AccountProvider |
| Invoice | Invoice | InvoiceProvider |
| Quote | Offer | QuoteProvider |
| SalesOrder | Order | SalesOrderProvider |
| Product | Stock Item | ProductProvider |
| ProformaInvoice | Proforma Invoice | ProformaInvoiceProvider |
| BankAccount | Bank Account | BankAccountProvider |
| ... | ... | ... |
Field Mapping¶
Most fields are mapped automatically based on name if they match the schema.
Invoices¶
number->ExtId(CRM document number)account->PartnerIdentity(Customer)items->InvoiceItem(Invoice Items)status->state(Status)
Products¶
name->Namecode->Code(Key for matching)price->SellingPrice
Jobs¶
Espo\Modules\Pohoda\Classes\Jobs\PohodaSync: Data export.Espo\Modules\Pohoda\Classes\Jobs\PohodaFetch: Data import.
Entities¶
The module defines helper entities:
PohodaAccount: Stores connection configuration.PohodaAccountItem: Items associated with the account (logging).
Hooks¶
The module uses hooks (afterSave) on entities like Invoice or Quote to mark records for synchronization (flag pohodaSyncNeeded or similar mechanism, or relies on modifiedAt timestamp and Job).