diff --git a/plugins/fio_cz/fio_cz.zip b/plugins/fio_cz/fio_cz.zip index de6ce31b7..7a2e0d167 100644 Binary files a/plugins/fio_cz/fio_cz.zip and b/plugins/fio_cz/fio_cz.zip differ diff --git a/plugins/fio_cz/src/manifest.json b/plugins/fio_cz/src/manifest.json index 0c7142dd8..d30a0c7e9 100644 --- a/plugins/fio_cz/src/manifest.json +++ b/plugins/fio_cz/src/manifest.json @@ -5,7 +5,7 @@ "displayName": "Fio bank payment import", "description": "This plugin enables you to import payments from Fio bank to UCRM. See https://www.fio.cz/bankovni-sluzby/api-bankovnictvi", "url": "https://github.com/Ubiquiti-App/UCRM-plugins/tree/master/plugins/fio_cz", - "version": "1.2.0", + "version": "1.2.8", "unmsVersionCompliancy": { "min": "2.1.0", "max": null @@ -17,37 +17,43 @@ "key": "token", "label": "Fio token", "description": "Token obtained from Fio bank internet banking. NOTE: the bank can issue the token with an expiration date, or without one (expired tokens will result in error 500, brand new tokens will return error 500 for a few minutes). Please do not reuse one token for multiple apps - generate one token for each, Fio bank's API usage limits are per token (exceeding limits will result in error 409).", - "required": 1 + "required": 1, + "type": "text" }, { "key": "startDate", "label": "Payments start date", - "description": "Payments older than this date will be ignored. Use d.m.Y format.", - "required": 1 + "description": "Payments older than this date will be ignored. Import of payments older than 90 days must be enabled in the Fio bank interface.", + "required": 1, + "type": "datetime" }, { "key": "paymentMatchAttribute", "label": "Match attribute from payment variable symbol to UCRM", "description": "Can be 'invoiceNumber', 'clientId', 'clientUserIdent' or a custom attribute key.", - "required": 1 + "required": 1, + "type": "text" }, { "key": "importUnattached", - "label": "Import all payments. (0|1)", + "label": "Import all payments.", "description": "Import all payments. Payments without match will be imported as \"Unattached payments\". Fill 1 to enable or 0 to disable this feature (when disabled, the unmatched payment will only be logged and skipped).", - "required": 1 + "required": 1, + "type": "checkbox" }, { "key": "lastProcessedPayment", "label": "Last processed payment", "description": "Internal payment tracking to avoid duplicate processing of the same payment", - "required": 0 + "required": 0, + "type": "text" }, { "key": "lastProcessedTimestamp", "label": "Last time the payment list was requested", "description": "Internal timestamp tracking to politely avoid API request rate limits", - "required": 0 + "required": 0, + "type": "text" } ] } diff --git a/plugins/fio_cz/src/src/Data/PluginData.php b/plugins/fio_cz/src/src/Data/PluginData.php index fc2aace7c..96b00f863 100644 --- a/plugins/fio_cz/src/src/Data/PluginData.php +++ b/plugins/fio_cz/src/src/Data/PluginData.php @@ -35,4 +35,9 @@ class PluginData extends UcrmData * @var string */ public $importUnattached; + + /** + * @var string + */ + public $lastProcessedPaymentDateTime; } diff --git a/plugins/fio_cz/src/src/Facade/UcrmFacade.php b/plugins/fio_cz/src/src/Facade/UcrmFacade.php index 387e7f7e1..5d8b9d822 100644 --- a/plugins/fio_cz/src/src/Facade/UcrmFacade.php +++ b/plugins/fio_cz/src/src/Facade/UcrmFacade.php @@ -62,6 +62,7 @@ public function import( ); $optionsData->lastProcessedPayment = $transaction['id']; + $optionsData->lastProcessedPaymentDateTime = $transaction['date']; $this->optionsManager->updateOptions(); $this->logger->debug(sprintf('lastProcessedPayment set to %s', $optionsData->lastProcessedPayment)); diff --git a/plugins/fio_cz/src/src/Importer.php b/plugins/fio_cz/src/src/Importer.php index e6566d2d9..db9ce6a09 100644 --- a/plugins/fio_cz/src/src/Importer.php +++ b/plugins/fio_cz/src/src/Importer.php @@ -76,6 +76,10 @@ public function import(): void return; } + if ($optionsData->lastProcessedPaymentDateTime !== null) { + $startDate = new \DateTimeImmutable($optionsData->lastProcessedPaymentDateTime); + } + $this->logger->debug('Processing range: ', [ 'startDate' => $startDate->format($this->dateFormat), 'endDate' => $endDate->format($this->dateFormat), diff --git a/plugins_2.1.x.json b/plugins_2.1.x.json index 97ae82160..18f82cb54 100644 --- a/plugins_2.1.x.json +++ b/plugins_2.1.x.json @@ -31,7 +31,7 @@ "displayName": "Fio bank payment import", "description": "This plugin enables you to import payments from Fio bank to UCRM. See https:\/\/www.fio.cz\/bankovni-sluzby\/api-bankovnictvi", "url": "https:\/\/github.com\/Ubiquiti-App\/UCRM-plugins\/tree\/master\/plugins\/fio_cz", - "version": "1.2.7", + "version": "1.2.8", "unmsVersionCompliancy": { "min": "2.1.0", "max": null diff --git a/plugins_2.2.x.json b/plugins_2.2.x.json index 83c8d7657..ec92c22c9 100644 --- a/plugins_2.2.x.json +++ b/plugins_2.2.x.json @@ -31,7 +31,7 @@ "displayName": "Fio bank payment import", "description": "This plugin enables you to import payments from Fio bank to UCRM. See https:\/\/www.fio.cz\/bankovni-sluzby\/api-bankovnictvi", "url": "https:\/\/github.com\/Ubiquiti-App\/UCRM-plugins\/tree\/master\/plugins\/fio_cz", - "version": "1.2.7", + "version": "1.2.8", "unmsVersionCompliancy": { "min": "2.1.0", "max": null diff --git a/plugins_2.3.x.json b/plugins_2.3.x.json index 0f8d9b603..a1bce0b15 100644 --- a/plugins_2.3.x.json +++ b/plugins_2.3.x.json @@ -31,7 +31,7 @@ "displayName": "Fio bank payment import", "description": "This plugin enables you to import payments from Fio bank to UCRM. See https:\/\/www.fio.cz\/bankovni-sluzby\/api-bankovnictvi", "url": "https:\/\/github.com\/Ubiquiti-App\/UCRM-plugins\/tree\/master\/plugins\/fio_cz", - "version": "1.2.7", + "version": "1.2.8", "unmsVersionCompliancy": { "min": "2.1.0", "max": null diff --git a/plugins_2.4.x.json b/plugins_2.4.x.json index 0f8d9b603..a1bce0b15 100644 --- a/plugins_2.4.x.json +++ b/plugins_2.4.x.json @@ -31,7 +31,7 @@ "displayName": "Fio bank payment import", "description": "This plugin enables you to import payments from Fio bank to UCRM. See https:\/\/www.fio.cz\/bankovni-sluzby\/api-bankovnictvi", "url": "https:\/\/github.com\/Ubiquiti-App\/UCRM-plugins\/tree\/master\/plugins\/fio_cz", - "version": "1.2.7", + "version": "1.2.8", "unmsVersionCompliancy": { "min": "2.1.0", "max": null