Skip to content

Commit

Permalink
Merge pull request #151 from OPEN-DSI/2024_rc
Browse files Browse the repository at this point in the history
2024 rc
  • Loading branch information
kkhelifa-opendsi authored Aug 20, 2024
2 parents d3c0107 + 73ce352 commit 3d2c372
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 13 deletions.
13 changes: 10 additions & 3 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# ChangeLog

## [14.0.7] - 25-07-2024
- Correction compatibilité PHP 8.2
## [14.0.8] - 14-08-2024
- Correction du nettoyage des id distants en doublons par site
- Precision lors d'un message d'erreur lors de la synchro des categories
- Correction d'une synchro du site vers dolibarr de produit avec creation lorsque le codebare est obligatoire, il est generé maintenant automatiquement

## [14.0.7] - 01-08-2024
- Correction de la synchro des modes de paiements

## [14.0.6] - 10-07-2024
- Correction compatibilité PHP 8.2
Expand Down Expand Up @@ -916,7 +921,9 @@
- Initial version.


[Non Distribué]: https://github.com/OPEN-DSI/ecommerceng_woosync/compare/14.0.6...HEAD
[Non Distribué]: https://github.com/OPEN-DSI/ecommerceng_woosync/compare/14.0.8...HEAD
[14.0.8]: https://github.com/OPEN-DSI/ecommerceng_woosync/commits/14.0.8
[14.0.7]: https://github.com/OPEN-DSI/ecommerceng_woosync/commits/14.0.7
[14.0.6]: https://github.com/OPEN-DSI/ecommerceng_woosync/commits/14.0.6
[14.0.5]: https://github.com/OPEN-DSI/ecommerceng_woosync/commits/14.0.5
[14.0.4]: https://github.com/OPEN-DSI/ecommerceng_woosync/commits/14.0.4
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.0.7
14.0.8
4 changes: 0 additions & 4 deletions class/actions_ecommerceng.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -873,16 +873,12 @@ public function stockMovementCreate($parameters, &$object, &$action, $hookmanage
$this->errors[] = $product->errorsToString();
return -1;
} elseif ($result == 0) {
//TODO remove after PR #30471 is accepted, this is a temporary patch
$this->resprints = "1";
return 1;
}

if (isset($product->array_options['options_ecommerceng_stockable_product']) &&
$product->array_options['options_ecommerceng_stockable_product'] == 0
) {
//TODO remove after PR #30471 is accepted, this is a temporary patch
$this->resprints = "1";
return 1;
}
}
Expand Down
3 changes: 3 additions & 0 deletions class/business/eCommerceSynchro.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,9 @@ public function synchCategory($toNb=0)
}
else
{
dol_syslog(__METHOD__ . " - Error synchro categories for parent remote_id=".$categoryArray['parent_id'].", name=".$categoryArray['name'].", remote_id=".$categoryArray['category_id']." : " . $this->errorsToString());
$this->success[] = $nbgoodsunchronize . ' ' . $this->langs->trans('ECommerceSynchCategorySuccess');
if (isset($categoryArray['name'])) $this->errors[] = "Category parent remote_id=".$categoryArray['parent_id'].", name=".$categoryArray['name'].", remote_id=".$categoryArray['category_id'];
eCommerceUtils::stopAndLogStopwatch($stopwatch_id);
return -1;
}
Expand Down Expand Up @@ -3524,6 +3526,7 @@ public function synchronizeProduct($product_data, $object_origin = null)
$product->accountancy_code_buy_intra = isset($this->eCommerceSite->parameters['default_account']['accounting_service_buy_intra_account']) ? $this->eCommerceSite->parameters['default_account']['accounting_service_buy_intra_account'] : $conf->global->ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT;
$product->accountancy_code_buy_export = isset($this->eCommerceSite->parameters['default_account']['accounting_service_buy_export_account']) ? $this->eCommerceSite->parameters['default_account']['accounting_service_buy_export_account'] : $conf->global->ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT;
}
$product->barcode = -1;

$product->error = '';
$product->errors = array();
Expand Down
11 changes: 7 additions & 4 deletions class/data/eCommerceSite.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,19 @@ function cleanDuplicatesRemoteID()
{
$stopwatch_id = eCommerceUtils::startAndLogStopwatch(__METHOD__);
$ids = array();
$sql = "SELECT remote_id FROM " . MAIN_DB_PREFIX . "ecommerce_product GROUP BY remote_id HAVING COUNT(*) > 1";
$sql = "SELECT fk_site, remote_id FROM " . MAIN_DB_PREFIX . "ecommerce_product GROUP BY fk_site, remote_id HAVING COUNT(*) > 1";
$resql = $this->db->query($sql);
if ($resql) {
while ($obj = $this->db->fetch_object($resql)) {
$ids[] = $obj->remote_id;
if (!isset($ids[$obj->fk_site])) $ids[$obj->fk_site] = [];
$ids[$obj->fk_site][] = $obj->remote_id;
}
}
if (!empty($ids)) {
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "ecommerce_product WHERE remote_id IN (" . implode(',', $ids) . ")";
$this->db->query($sql);
foreach ($ids as $site_id => $remote_ids) {
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "ecommerce_product WHERE fk_site = " . $site_id . " AND remote_id IN (" . implode(',', $remote_ids) . ")";
$this->db->query($sql);
}
}
eCommerceUtils::stopAndLogStopwatch($stopwatch_id);
}
Expand Down
6 changes: 5 additions & 1 deletion lib/eCommerce.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,11 @@ function ecommerceng_update_payment_gateways($db, $site)
'payment_mode_id' => $currentPaymentGateways[$id]['payment_mode_id'] > 0 ? $currentPaymentGateways[$id]['payment_mode_id'] : 0,
'bank_account_id' => $currentPaymentGateways[$id]['bank_account_id'] > 0 ? $currentPaymentGateways[$id]['bank_account_id'] : 0,
'supplier_id' => $currentPaymentGateways[$id]['supplier_id'] > 0 ? $currentPaymentGateways[$id]['supplier_id'] : 0,
);
'create_invoice_payment' => $currentPaymentGateways[$id]['create_invoice_payment'] > 0 ? $currentPaymentGateways[$id]['create_invoice_payment'] : 0,
'mail_model_for_send_invoice' => $currentPaymentGateways[$id]['mail_model_for_send_invoice'],
'product_id_for_fee' => $currentPaymentGateways[$id]['product_id_for_fee'] > 0 ? $currentPaymentGateways[$id]['product_id_for_fee'] : 0,
'create_supplier_invoice_payment' => $currentPaymentGateways[$id]['create_supplier_invoice_payment'] > 0 ? $currentPaymentGateways[$id]['create_supplier_invoice_payment'] : 0
);
}

$result = $pay_gateways->set($site->id, $payment_gateways);
Expand Down

0 comments on commit 3d2c372

Please sign in to comment.