Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
v.4.0.39.0
Browse files Browse the repository at this point in the history
- Correction de la récupération des frais stripe
- Correction mineure
  • Loading branch information
kamel committed Sep 30, 2019
1 parent 0e374e6 commit 19bae40
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 9 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ChangeLog

## 4.0.39.0
- Correction de la récupération des frais stripe
- Correction mineure

## 4.0.38.0
- Correction de la récupération des modes de paiements de la boutique (libellé et ne recupère que ceux activés)
- Correction de la recherche du produit/service utilisé pour les frais de la facture fournisseur
Expand Down
2 changes: 1 addition & 1 deletion admin/tpl/eCommerceSetup.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ function update_act_ef_crp_order_all() {
if (!empty($ecommerceOrderActions['create_supplier_invoice'])) {
?>
<td><?php print $form->select_company($infos['supplier_id'], 'supplier_id_'.$key, 's.fournisseur=1 AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300') ?></td>
<td><?php $form->select_produits($infos['product_id_for_fee'], 'product_id_for_fee_'.$key, '', $conf->product->limit_size, 0, 1, 2, '', 0, array(), 0, '1', 0, 'maxwidth300') ?></td>
<td><?php $form->select_produits($infos['product_id_for_fee'], 'product_id_for_fee_'.$key, '', $conf->product->limit_size, 0, -1, 2, '', 0, array(), 0, '1', 0, 'maxwidth300') ?></td>
<td align="center"><input type="checkbox" id="<?php print 'create_supplier_invoice_payment_'.$key ?>" name="<?php print 'create_supplier_invoice_payment_'.$key ?>" value="1" <?php print !empty($infos['create_supplier_invoice_payment']) ? ' checked' : '' ?>></td>
<?php
}
Expand Down
12 changes: 5 additions & 7 deletions class/business/eCommerceSynchro.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2759,12 +2759,10 @@ public function synchCommande($toNb=0)
}

if (!$error) {
$now = dol_now();

// Create invoice
$dBInvoice->socid = $dBCommande->socid;
$dBInvoice->type = Facture::TYPE_STANDARD;
$dBInvoice->date = $now;
$dBInvoice->date = $dBCommande->date;
$dBInvoice->ref_ext = $ref_ext;
$dBInvoice->modelpdf = $conf->global->FACTURE_ADDON_PDF;
$dBInvoice->cond_reglement_id = $dBCommande->cond_reglement_id;
Expand Down Expand Up @@ -2925,7 +2923,7 @@ public function synchCommande($toNb=0)
if (!empty($ecommerceSelectedPaymentGateway['create_invoice_payment'])) {
// Creation of payment line
$paiement = new Paiement($this->db);
$paiement->datepaye = $now;
$paiement->datepaye = $dBCommande->date;
$paiement->amounts = array($dBInvoice->id => $dBInvoice->total_ttc); // Array with all payments dispatching with invoice id
$paiement->multicurrency_amounts = array(); // Array with all payments dispatching
$paiement->paiementid = $dBCommande->mode_reglement_id;
Expand Down Expand Up @@ -2967,7 +2965,7 @@ public function synchCommande($toNb=0)
$dBSupplierInvoice->ref_supplier = $ref_ext;
$dBSupplierInvoice->socid = $ecommerceSelectedPaymentGateway['supplier_id'];
$dBSupplierInvoice->libelle = '';
$dBSupplierInvoice->date = $now;
$dBSupplierInvoice->date = $dBCommande->date;
$dBSupplierInvoice->date_echeance = '';
$dBSupplierInvoice->cond_reglement_id = 0;
$dBSupplierInvoice->mode_reglement_id = $dBCommande->mode_reglement_id;
Expand All @@ -2982,7 +2980,7 @@ public function synchCommande($toNb=0)
if ($id > 0) {
$product_id = $ecommerceSelectedPaymentGateway['product_id_for_fee'] > 0 ? $ecommerceSelectedPaymentGateway['product_id_for_fee'] : 0;
foreach ($commandeArray['fee_lines'] as $fee_line) {
if ((float)DOL_VERSION < 8) $this->db->begin(); // Not exist in addline function but commit and rollback exist
if (floatval(DOL_VERSION) < 8) $this->db->begin(); // Not exist in addline function but commit and rollback exist
$result = $dBSupplierInvoice->addline(
$fee_line['label'],
$fee_line['amount'],
Expand Down Expand Up @@ -3039,7 +3037,7 @@ public function synchCommande($toNb=0)
if (!$error && !empty($ecommerceSelectedPaymentGateway['create_supplier_invoice_payment'])) {
// Creation of payment line
$paiement = new PaiementFourn($this->db);
$paiement->datepaye = $now;
$paiement->datepaye = $dBCommande->date;
$paiement->amounts = array($dBSupplierInvoice->id => $dBSupplierInvoice->total_ttc); // Array of amounts
$paiement->multicurrency_amounts = array();
$paiement->paiementid = $dBSupplierInvoice->mode_reglement_id;
Expand Down
16 changes: 16 additions & 0 deletions class/data/woocommerce/eCommerceRemoteAccessWoocommerce.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,22 @@ public function convertRemoteObjectIntoDolibarrCommande($remoteObject, $toNb=0)
}
}

$meta_data = [];
if (!empty($order->meta_data)) {
foreach ($order->meta_data as $meta) {
$meta_data[$meta->key] = [ 'id' => $meta->id, 'value' => $meta->value ];
}
}

// Manage stripe payment
if (isset($meta_data['_stripe_fee']) && $meta_data['_stripe_fee']['value'] > 0) {
$fee_lines[] = [
'label' => 'Stripe',
'amount' => $meta_data['_stripe_fee']['value'],
'tax' => 0,
];
}

// Add order content to array or orders
$orders[$order->id] = [
'last_update' => $last_update->format('Y-m-d H:i:s'),
Expand Down
2 changes: 1 addition & 1 deletion core/modules/modECommerceNg.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function __construct($db)
$this->editor_url = 'http://www.open-dsi.fr';

// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = '4.0.38';
$this->version = '4.0.39';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
Expand Down

0 comments on commit 19bae40

Please sign in to comment.