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

Commit

Permalink
- Ajout d'une option pour creer la facture meme si le montant est ega…
Browse files Browse the repository at this point in the history
…le a 0
  • Loading branch information
kamel committed Jul 12, 2022
1 parent b43b774 commit a47af9a
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# ChangeLog

## 4.1.8.0
- Ajout d'une option pour creer la facture meme si le montant est egale a 0

## 4.1.7.0
- Mouvement de stock à la validation d'une commande synchronisée si la synchro des stocks est paramètré dolibarr vers WooCommerce et qu'il n'y a qu'un entrepot de selectionné

Expand Down
2 changes: 2 additions & 0 deletions admin/eCommerceSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,12 @@
$ecommerceOrderActions['send_invoice_by_mail'] = GETPOST('ecommerce_send_invoice_by_mail', 'int') ? 1 : 0;
$ecommerceOrderActions['create_invoice_deposit_type'] = GETPOST('ecommerce_create_invoice_deposit_type', 'aZ09');
$ecommerceOrderActions['create_invoice_deposit_value'] = GETPOST('ecommerce_create_invoice_deposit_value', 'int');
$ecommerceOrderActions['create_invoice_if_amount_0'] = GETPOST('ecommerce_create_invoice_if_amount_0', 'int') ? 1 : 0;
if (empty($ecommerceOrderActions['create_invoice'])) {
$ecommerceOrderActions['send_invoice_by_mail'] = 0;
$ecommerceOrderActions['create_invoice_deposit_type'] = '';
$ecommerceOrderActions['create_invoice_deposit_value'] = 0;
$ecommerceOrderActions['create_invoice_if_amount_0'] = 0;
}
}
if ($conf->supplier_invoice->enabled && !empty($ecommerceOrderActions['create_invoice'])) {
Expand Down
2 changes: 2 additions & 0 deletions admin/tpl/eCommerceSetup.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ function ecommerce_update_invoice_deposit_value_text() {
}
});
</script>
<br>
<input type="checkbox" id="ecommerce_create_invoice_if_amount_0" name="ecommerce_create_invoice_if_amount_0" value="1" <?php print !empty($ecommerceOrderActions['create_invoice_if_amount_0']) ? ' checked' : '' ?>>&nbsp;<label for="ecommerce_create_invoice_if_amount_0"><?php print $langs->trans('ECommerceCreateInvoiceIfAmount0') ?></label>&nbsp;
<?php
}
}
Expand Down
4 changes: 3 additions & 1 deletion class/business/eCommerceSynchro.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4957,7 +4957,9 @@ public function synchronizeInvoiceFromOrder($order_data, $dont_synchronize_produ
$this->error = $invoice->error;
$this->errors = array_merge($this->errors, $invoice->errors);
$error++;
} elseif (!empty($this->eCommerceSite->parameters['order_actions']['create_invoice']) && !empty($order_data['billed'])) {
} elseif (!empty($this->eCommerceSite->parameters['order_actions']['create_invoice']) && !empty($order_data['billed']) &&
(empty($this->eCommerceSite->parameters['order_actions']['create_invoice_if_amount_0']) || price2num($order_data['payment_amount_ttc']) != 0)
) {
// Check if order / invoice already synchronized
$this->initECommerceCommande();
$result = $this->eCommerceCommande->fetchByRemoteId($order_data['remote_id'], $this->eCommerceSite->id);
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.1.7';
$this->version = '4.1.8';
// 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
1 change: 1 addition & 0 deletions langs/en_US/ecommerce.lang
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ ECommerceCreateInvoice = Create the bill
ECommerceCreateSupplierInvoiceFromFee = Create the supplier bill from the charges
ECommerceSendInvoiceByMail = Send the bill by email
ECommerceCreateOrderDescription = Related actions when retrieving WooCommerce orders (Enter the payment methods associated with WooCommerce)
ECommerceCreateInvoiceIfAmount0 =Créer la facture même si le montant est égale à 0

ECommercePaymentGatewaysCorrespondence = Correspondence of the payment methods with the site
ECommercePaymentGatewayLabel = Payment method on the site
Expand Down
1 change: 1 addition & 0 deletions langs/fr_FR/ecommerce.lang
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ ECommerceCreateInvoice
ECommerceCreateSupplierInvoiceFromFee =Créer la facture fournisseur à partir des frais
ECommerceSendInvoiceByMail =Envoyer la facture par mail
ECommerceCreateOrderDescription =Actions associées lors de la récupération des commandes WooCommerce (Renseigner les modes de paiements associés à WooCommerce)
ECommerceCreateInvoiceIfAmount0 =Créer la facture même si le montant est égale à 0

ECommercePaymentGatewaysCorrespondence =Correspondance des modes de paiements avec le site
ECommercePaymentGatewayLabel =Mode de paiement sur le site
Expand Down
11 changes: 11 additions & 0 deletions syncmanual.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

// Change this following line to use the correct relative path (../, ../../, etc)
$res=0;
if (! $res && file_exists("../main.inc.php")) $res=@include '../main.inc.php'; // to work if your module directory is into a subdir of root htdocs directory
if (! $res && file_exists("../../main.inc.php")) $res=@include '../../main.inc.php'; // to work if your module directory is into a subdir of root htdocs directory
if (! $res) die("Include of main fails");

exec('php ' . dol_buildpath('/ecommerceng/scripts/syncronize_to_dolibarr.php', 0) . ' ' . GETPOST('login', 'alphanohtml') . ' ' . GETPOST('site_id', 'int') . ' ' . GETPOST('type', 'alphanohtml') . ' ' . GETPOST('id_from', 'int') . ' ' . GETPOST('id_to', 'int') . ' >> ' . DOL_DATA_ROOT . '/manualsync.log & echo $!;');

$db->close();

0 comments on commit a47af9a

Please sign in to comment.