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 insérer la note de la commande WooCommerce …
Browse files Browse the repository at this point in the history
…dans la note publique de la commande/facture dolibarr au lieu de la note privée (par défaut)
  • Loading branch information
kkhelifa-opendsi committed Apr 18, 2023
1 parent ae489e4 commit 070b4ba
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 3 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.47.0
- Ajout d'une option pour insérer la note de la commande WooCommerce dans la note publique de la commande/facture dolibarr au lieu de la note privée (par défaut)

## 4.1.46.0
- Correction bug

Expand Down
9 changes: 9 additions & 0 deletions admin/order.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@
$object->parameters['order_metadata_product_lines_to_description_etod'] = GETPOST('order_metadata_product_lines_to_description_etod', 'int') ? 1 : 0;
$object->parameters['order_filter_mode_metadata_product_lines_to_description_etod'] = GETPOST('order_filter_mode_metadata_product_lines_to_description_etod', 'az09');
$object->parameters['order_filter_keys_metadata_product_lines_to_description_etod'] = GETPOST('order_filter_keys_metadata_product_lines_to_description_etod', 'alphanohtml');
$object->parameters['order_actions']['order_note_into_public_note'] = GETPOST('order_note_into_public_note', 'int') ? 1 : 0;

$result = $object->update($user);

Expand Down Expand Up @@ -410,6 +411,14 @@
if (!empty($object->parameters['order_actions']['create_order']) ||
!empty($object->parameters['order_actions']['create_invoice'])
) {
// Order note into public note
print '<tr class="oddeven">' . "\n";
print '<td>' . $langs->trans("ECommerceOrderNoteIntoPublicNote") . '</td>' . "\n";
print '<td>' . $langs->trans("ECommerceOrderNoteIntoPublicNoteDescription") . '</td>' . "\n";
print '<td class="right">' . "\n";
print '<input type="checkbox" name="order_note_into_public_note" value="1"' . (!empty($object->parameters['order_actions']['order_note_into_public_note']) ? ' checked' : '') . ' />' . "\n";
print '</td></tr>' . "\n";

// Default sale representative
print '<tr class="oddeven">' . "\n";
print '<td>' . $langs->trans("ECommerceCreateOrderSalesRepresentativeFollowByDefault") . '</td>' . "\n";
Expand Down
18 changes: 16 additions & 2 deletions class/business/eCommerceSynchro.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4265,7 +4265,14 @@ public function synchronizeOrder($order_data, $dont_synchronize_products = false
$order->statut = Commande::STATUS_DRAFT; // STATUS_DRAFT by default at creation
$order->cond_reglement_id = $third_party->cond_reglement_id > 0 ? $third_party->cond_reglement_id : (isset($this->eCommerceSite->parameters['payment_cond']) ? $this->eCommerceSite->parameters['payment_cond'] : null);
$order->source = dol_getIdFromCode($this->db, 'OrderByWWW', 'c_input_method', 'code', 'rowid'); // Order mode. Not visible with some Dolibarr versions
$order->note_private = isset($order_data['note']) ? $order_data['note'] : "";
$order->note_private = "";
if (isset($order_data['note'])) {
if (!empty($this->eCommerceSite->parameters['order_actions']['order_note_into_public_note'])) {
$order->note_public = $order_data['note'];
} else {
$order->note_private = $order_data['note'];
}
}
if (!empty($conf->global->ECOMMERCENG_ENABLE_LOG_IN_NOTE)) {
$order->note_private = dol_concatdesc($order->note_private, $this->langs->trans('ECommerceCreateOrderFromSiteNote', $this->eCommerceSite->name) . " :\n" . json_encode($order_data['remote_order']));
}
Expand Down Expand Up @@ -5011,7 +5018,14 @@ public function synchronizeInvoiceFromOrder($order_data, $dont_synchronize_produ
$invoice->entity = $conf->entity;
$invoice->statut = Facture::STATUS_DRAFT;

$invoice->note_private = isset($order_data['note']) ? $order_data['note'] : "";
$invoice->note_private = "";
if (isset($order_data['note'])) {
if (!empty($this->eCommerceSite->parameters['order_actions']['order_note_into_public_note'])) {
$invoice->note_public = $order_data['note'];
} else {
$invoice->note_private = $order_data['note'];
}
}
if (!empty($conf->global->ECOMMERCENG_ENABLE_LOG_IN_NOTE)) {
$invoice->note_private = dol_concatdesc($invoice->note_private, $this->langs->trans('ECommerceCreateInvoiceFromSiteNote', $this->eCommerceSite->name) . " :\n" . json_encode($order_data['remote_order']));
}
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.46';
$this->version = '4.1.47';
// 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
2 changes: 2 additions & 0 deletions langs/en_US/ecommerce.lang
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ ECommerceCreateAssociatePaymentForInvoice = Create the associated paym
ECommerceSelectMailModelForSendInvoice = Choice of email template for bill sending
ECommerceProductForFee = Product for the supplier bill fees
ECommerceCreateAssociatePaymentForSupplierInvoice = Create the associated payment for the supplier bill
ECommerceOrderNoteIntoPublicNote =Note de la commande
ECommerceOrderNoteIntoPublicNoteDescription =L'insérer dans la note publique au lieu de la note privée (par défaut)

ECommerceCreateOrderSalesRepresentativeFollowByDefault = Customer care manager
ECommerceCreateOrderSalesRepresentativeFollowByDefaultDescription = User type "Manager of the tracking of order/bill/... client" assigned by default when synchronizing an order from the site
Expand Down
2 changes: 2 additions & 0 deletions langs/fr_FR/ecommerce.lang
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ ECommerceCreateAssociatePaymentForInvoice
ECommerceSelectMailModelForSendInvoice =Choix du modèle de courriel pour l'envoi de la facture
ECommerceProductForFee =Produit pour les frais de la facture fournisseur
ECommerceCreateAssociatePaymentForSupplierInvoice =Créer le règlement associé pour la facture fournisseur
ECommerceOrderNoteIntoPublicNote =Note de la commande
ECommerceOrderNoteIntoPublicNoteDescription =L'insérer dans la note publique au lieu de la note privée (par défaut)

ECommerceCreateOrderSalesRepresentativeFollowByDefault =Responsable suivi client
ECommerceCreateOrderSalesRepresentativeFollowByDefaultDescription =Utilisateur de type "Responsable suivi commande/facture/... client" par défaut affecté lors de la synchronisation d'une commande depuis le site E-Commerce
Expand Down
2 changes: 2 additions & 0 deletions langs/it_IT/ecommerce.lang
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ ECommerceCreateAssociatePaymentForInvoice = Create the associated paym
ECommerceSelectMailModelForSendInvoice = Choice of email template for bill sending
ECommerceProductForFee = Product for the supplier bill fees
ECommerceCreateAssociatePaymentForSupplierInvoice = Create the associated payment for the supplier bill
ECommerceOrderNoteIntoPublicNote =Note de la commande
ECommerceOrderNoteIntoPublicNoteDescription =L'insérer dans la note publique au lieu de la note privée (par défaut)

ECommerceCreateOrderSalesRepresentativeFollowByDefault = Customer care manager
ECommerceCreateOrderSalesRepresentativeFollowByDefaultDescription = User type "Manager of the tracking of order/bill/... client" assigned by default when synchronizing an order from the site
Expand Down

0 comments on commit 070b4ba

Please sign in to comment.