diff --git a/core/asset/language/wpshop-fr_FR.mo b/core/asset/language/wpshop-fr_FR.mo index 05500ee..4bb6f28 100644 Binary files a/core/asset/language/wpshop-fr_FR.mo and b/core/asset/language/wpshop-fr_FR.mo differ diff --git a/core/asset/language/wpshop-fr_FR.po b/core/asset/language/wpshop-fr_FR.po index 463569c..82756dd 100644 --- a/core/asset/language/wpshop-fr_FR.po +++ b/core/asset/language/wpshop-fr_FR.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: wpshop\n" -"POT-Creation-Date: 2020-10-23 17:26+0200\n" -"PO-Revision-Date: 2020-10-23 17:26+0200\n" +"POT-Creation-Date: 2021-02-04 12:08+0100\n" +"PO-Revision-Date: 2021-02-04 12:08+0100\n" "Last-Translator: \n" "Language-Team: Eoxia\n" "Language: fr_FR\n" @@ -130,16 +130,16 @@ msgstr "Produit \"%1$s\" x%2$d ajouté au panier" msgid "View cart" msgstr "Voir le panier" -#: modules/checkout/action/class-checkout-action.php:487 +#: modules/checkout/action/class-checkout-action.php:489 msgid "I accept " msgstr "J'accepte " -#: modules/checkout/action/class-checkout-action.php:491 +#: modules/checkout/action/class-checkout-action.php:493 #, php-format msgid "the %2$s and " msgstr "les %2$s et " -#: modules/checkout/action/class-checkout-action.php:496 +#: modules/checkout/action/class-checkout-action.php:498 #, php-format msgid "the %2$s" msgstr "la %2$s" @@ -277,7 +277,7 @@ msgstr "Adresse postale" msgid "Postcode / ZIP" msgstr "Code postal" -#: modules/checkout/view/frontend/payment.php:27 +#: modules/checkout/view/frontend/payment.php:26 #: modules/dashboard/view/metaboxes/metabox-payment.view.php:34 #: modules/dolibarr/doli-invoice/view/metabox-invoice-details.view.php:29 #: modules/dolibarr/doli-invoice/view/metabox-invoice-details.view.php:44 @@ -406,7 +406,7 @@ msgstr "Derniers clients" #: modules/dolibarr/doli-categories/view/item.view.php:42 #: modules/dolibarr/doli-invoice/view/item.view.php:39 #: modules/dolibarr/doli-invoice/view/item.view.php:61 -#: modules/dolibarr/doli-order/view/item.view.php:39 +#: modules/dolibarr/doli-order/view/item.view.php:40 #: modules/dolibarr/doli-proposals/view/item.view.php:38 #: modules/proposals/view/item.view.php:34 msgid "See in Dolibarr" @@ -456,7 +456,7 @@ msgstr "Prix TTC" #: modules/dashboard/view/metaboxes/metabox-invoice.view.php:45 #: modules/dashboard/view/metaboxes/metabox-order.view.php:45 #: modules/dashboard/view/metaboxes/metabox-proposal.view.php:45 -#: modules/dolibarr/doli-order/view/item.view.php:54 +#: modules/dolibarr/doli-order/view/item.view.php:55 #: modules/dolibarr/doli-order/view/metabox-order-details.view.php:37 #: modules/dolibarr/doli-order/view/metabox-order-details.view.php:38 msgid "unknown" @@ -548,19 +548,18 @@ msgid "Last update the %s" msgstr "Dernière mise à jour le %s" #: modules/dolibarr/doli-associate/view/compare-wps-product.view.php:36 -#: modules/products/view/metabox/main.view.php:25 #: modules/settings/view/payment-method-single.view.php:50 msgid "Description" msgstr "Description" #: modules/dolibarr/doli-associate/view/compare-wps-product.view.php:37 #: modules/products/view/list.view.php:34 -#: modules/products/view/metabox/main.view.php:30 +#: modules/products/view/metabox/main.view.php:47 msgid "Price HT(€)" msgstr "Prix HT(€)" #: modules/dolibarr/doli-associate/view/compare-wps-product.view.php:38 -#: modules/products/view/metabox/main.view.php:34 +#: modules/products/view/metabox/main.view.php:53 msgid "VAT Rate" msgstr "Taux de TVA" @@ -569,7 +568,7 @@ msgstr "Taux de TVA" #: modules/dolibarr/doli-order/view/list.view.php:33 #: modules/dolibarr/doli-proposals/view/list.view.php:33 #: modules/products/view/list.view.php:36 -#: modules/products/view/metabox/main.view.php:38 +#: modules/products/view/metabox/main.view.php:75 #: modules/proposals/view/list.view.php:25 msgid "Price TTC(€)" msgstr "Prix TTC(€)" @@ -652,15 +651,18 @@ msgid "Compare elements" msgstr "Comparer les éléments" #: modules/dolibarr/doli-categories/action/class-doli-categories-action.php:58 -#: modules/dolibarr/doli-categories/action/class-doli-categories-action.php:161 #: modules/dolibarr/doli-categories/view/main.view.php:25 +msgid "Categories WPshop" +msgstr "" + +#: modules/dolibarr/doli-categories/action/class-doli-categories-action.php:161 #: modules/dolibarr/doli-sync/class/class-doli-sync.php:84 #: modules/products/view/list.view.php:33 msgid "Categories" msgstr "" -#: modules/dolibarr/doli-categories/class/class-doli-categories.php:218 -#: modules/dolibarr/doli-products/class/class-doli-products.php:85 +#: modules/dolibarr/doli-categories/class/class-doli-categories.php:224 +#: modules/dolibarr/doli-products/class/class-doli-products.php:87 #: modules/dolibarr/doli-sync/class/class-doli-sync.php:188 #, php-format msgid "" @@ -678,7 +680,7 @@ msgstr "Modifier" #: modules/dolibarr/doli-categories/view/item.view.php:44 #: modules/dolibarr/doli-invoice/view/item.view.php:37 #: modules/dolibarr/doli-invoice/view/item.view.php:60 -#: modules/dolibarr/doli-order/view/item.view.php:37 +#: modules/dolibarr/doli-order/view/item.view.php:38 #: modules/dolibarr/doli-proposals/view/item.view.php:36 #: modules/proposals/view/item.view.php:32 #: modules/third-parties/view/item.view.php:36 @@ -721,7 +723,7 @@ msgstr "Ajouter" msgid "Invoice details %s" msgstr "Facture détails %s" -#: modules/dolibarr/doli-invoice/action/class-doli-invoice-action.php:108 +#: modules/dolibarr/doli-invoice/action/class-doli-invoice-action.php:109 #: modules/dolibarr/doli-invoice/filter/class-doli-invoice-filter.php:70 #: modules/dolibarr/doli-invoice/filter/class-doli-invoice-filter.php:72 #: modules/dolibarr/doli-invoice/view/main.view.php:32 @@ -729,7 +731,7 @@ msgstr "Facture détails %s" msgid "Invoices" msgstr "Factures" -#: modules/dolibarr/doli-invoice/action/class-doli-invoice-action.php:357 +#: modules/dolibarr/doli-invoice/action/class-doli-invoice-action.php:359 msgid "Invoice not found" msgstr "Facture non trouvée" @@ -886,13 +888,13 @@ msgstr "Editer sur Dolibarr" #: modules/dolibarr/doli-order/action/class-doli-order-action.php:87 #: modules/dolibarr/doli-statut/class/class-doli-statut.php:64 -#: modules/dolibarr/doli-statut/class/class-doli-statut.php:86 +#: modules/dolibarr/doli-statut/class/class-doli-statut.php:90 msgid "Delivered" -msgstr "Délivrée" +msgstr "Livrée" #: modules/dolibarr/doli-order/action/class-doli-order-action.php:97 #: modules/dolibarr/doli-statut/class/class-doli-statut.php:78 -#: modules/dolibarr/doli-statut/class/class-doli-statut.php:108 +#: modules/dolibarr/doli-statut/class/class-doli-statut.php:112 msgid "Canceled" msgstr "Anulée" @@ -949,8 +951,10 @@ msgid "Traitment in progress" msgstr "Traitements en cours" #: modules/dolibarr/doli-order/filter/class-doli-order-filter.php:123 -msgid "(Delivery)" -msgstr "Délivrée" +#: modules/dolibarr/doli-order/view/metabox-order-payment.view.php:64 +#: modules/dolibarr/doli-statut/class/class-doli-statut.php:60 +msgid "Billed" +msgstr "Facturée" #: modules/dolibarr/doli-order/view/list.view.php:30 #: modules/dolibarr/doli-order/view/metabox-order-details.view.php:46 @@ -1016,13 +1020,6 @@ msgstr "Montant TTC" msgid "Already settled" msgstr "Déjà réglé" -#: modules/dolibarr/doli-order/view/metabox-order-payment.view.php:64 -#: modules/dolibarr/doli-statut/class/class-doli-statut.php:60 -#: modules/dolibarr/doli-statut/class/class-doli-statut.php:82 -#: modules/dolibarr/doli-statut/class/class-doli-statut.php:100 -msgid "Billed" -msgstr "Facturé" - #: modules/dolibarr/doli-order/view/metabox-order-payment.view.php:68 msgid "Remaining unpaid" msgstr "Reste à payer" @@ -1062,6 +1059,18 @@ msgstr "Propositions commerciales" msgid "Proposals Dolibarr" msgstr "Propositions commerciales" +#: modules/dolibarr/doli-proposals/filter/class-doli-proposals-filter.php:46 +msgid " (open proposal)" +msgstr " (proposition ouverte)" + +#: modules/dolibarr/doli-proposals/filter/class-doli-proposals-filter.php:49 +msgid " (to be invoiced)" +msgstr " (à facturée)" + +#: modules/dolibarr/doli-proposals/filter/class-doli-proposals-filter.php:52 +msgid " (closed)" +msgstr " (fermée)" + #: modules/dolibarr/doli-proposals/view/list.view.php:29 #: modules/proposals/view/list.view.php:21 msgid "Proposal reference" @@ -1069,28 +1078,44 @@ msgstr "Référence du devis" #: modules/dolibarr/doli-statut/class/class-doli-statut.php:44 #: modules/dolibarr/doli-statut/class/class-doli-statut.php:70 -#: modules/dolibarr/doli-statut/class/class-doli-statut.php:92 +#: modules/dolibarr/doli-statut/class/class-doli-statut.php:96 msgid "Draft" msgstr "Brouillon" #: modules/dolibarr/doli-statut/class/class-doli-statut.php:48 -msgid "Waiting for a signature" -msgstr "En attente de la signature" +#: modules/dolibarr/doli-statut/class/class-doli-statut.php:74 +msgid "Validated" +msgstr "Validée" #: modules/dolibarr/doli-statut/class/class-doli-statut.php:52 msgid "Signed" -msgstr "Signé" +msgstr "Signée" #: modules/dolibarr/doli-statut/class/class-doli-statut.php:56 msgid "Not signed" -msgstr "Non signé" +msgstr "Non signée" -#: modules/dolibarr/doli-statut/class/class-doli-statut.php:74 -#: modules/dolibarr/doli-statut/class/class-doli-statut.php:96 -msgid "Not paid" -msgstr "Non payée" +#: modules/dolibarr/doli-statut/class/class-doli-statut.php:82 +msgid "Processed" +msgstr "Traitée" + +#: modules/dolibarr/doli-statut/class/class-doli-statut.php:86 +msgid "In progress" +msgstr "En cours" + +#: modules/dolibarr/doli-statut/class/class-doli-statut.php:100 +msgid "Unpaid" +msgstr "Impayée" #: modules/dolibarr/doli-statut/class/class-doli-statut.php:104 +#: modules/payment/class/class-payment.php:94 +#: modules/payment/class/class-payment.php:98 +#: modules/payment/class/class-payment.php:102 +#: modules/payment/class/class-payment.php:106 +msgid "Paid" +msgstr "Payée" + +#: modules/dolibarr/doli-statut/class/class-doli-statut.php:108 msgid "Abandoned" msgstr "Abondonée" @@ -1119,24 +1144,24 @@ msgstr "" "Effacer les données pour le tiers %s avec les données de " "dolibarr" -#: modules/dolibarr/doli-sync/class/class-doli-sync.php:335 -#: modules/dolibarr/doli-sync/class/class-doli-sync.php:345 +#: modules/dolibarr/doli-sync/class/class-doli-sync.php:360 +#: modules/dolibarr/doli-sync/class/class-doli-sync.php:370 msgid "WP Object is not equal Dolibarr Object" msgstr "L'objet WordPress n'est pas égal à l'objet Dolibarr" -#: modules/dolibarr/doli-sync/class/class-doli-sync.php:359 +#: modules/dolibarr/doli-sync/class/class-doli-sync.php:384 msgid "Sync OK" msgstr "Synchronisation OK" -#: modules/dolibarr/doli-sync/class/class-doli-sync.php:382 +#: modules/dolibarr/doli-sync/class/class-doli-sync.php:407 msgid "Looking for sync status" msgstr "Rechercher un statut de synchronisation" -#: modules/dolibarr/doli-sync/class/class-doli-sync.php:393 +#: modules/dolibarr/doli-sync/class/class-doli-sync.php:418 msgid "No associated to an ERP Entity" msgstr "Cette entitée n'est pas associé à votre ERP" -#: modules/dolibarr/doli-sync/class/class-doli-sync.php:424 +#: modules/dolibarr/doli-sync/class/class-doli-sync.php:449 msgid "Error not defined" msgstr "Erreur non définie" @@ -1144,12 +1169,12 @@ msgstr "Erreur non définie" msgid "Synchro" msgstr "Synchroniser" -#: modules/dolibarr/doli-sync/view/sync-item.view.php:37 +#: modules/dolibarr/doli-sync/view/sync-item.view.php:38 #, php-format msgid "Associate and synchronize %s" msgstr "Associer et synchroniser %s" -#: modules/dolibarr/doli-third-parties/class/class-doli-third-parties.php:138 +#: modules/dolibarr/doli-third-parties/class/class-doli-third-parties.php:141 #, php-format msgid "" "Erase data for the third party %s with the " @@ -1405,23 +1430,21 @@ msgid "Stripe" msgstr "Stripe" #: modules/payment/class/class-payment.php:76 +#: modules/payment/class/class-payment.php:85 msgid "Use your credit card to place your order" msgstr "Utilisez votre carte de crédit pour passer votre commande" -#: modules/payment/class/class-payment.php:87 +#: modules/payment/class/class-payment.php:84 +msgid "Carte Bancaire" +msgstr "" + +#: modules/payment/class/class-payment.php:93 msgid "Waiting for the check" msgstr "En attente du chèque" -#: modules/payment/class/class-payment.php:88 -#: modules/payment/class/class-payment.php:92 -#: modules/payment/class/class-payment.php:96 -#: modules/payment/class/class-payment.php:100 -msgid "Paid" -msgstr "Payée" - -#: modules/payment/class/class-payment.php:91 -#: modules/payment/class/class-payment.php:95 -#: modules/payment/class/class-payment.php:99 +#: modules/payment/class/class-payment.php:97 +#: modules/payment/class/class-payment.php:101 +#: modules/payment/class/class-payment.php:105 msgid "Waiting for the payment" msgstr "En attente du paiement" @@ -1456,16 +1479,12 @@ msgid "Product title" msgstr "Nom du produit" #: modules/products/class/class-product.php:202 -#, fuzzy -#| msgid "Product configuration" msgid "Dolibarr Product configuration" -msgstr "Configuration du produit" +msgstr "Configuration du produit Dolibarr" #: modules/products/class/class-product.php:209 -#, fuzzy -#| msgid "Product configuration" msgid "WordPress Product configuration" -msgstr "Configuration du produit" +msgstr "Configuration du produit WordPress" #: modules/products/class/class-product.php:216 msgid "Product Gallery" @@ -1566,10 +1585,8 @@ msgid "See the product" msgstr "Rechercher un produit" #: modules/products/view/frontend/wps-product-grid.php:50 -#, fuzzy -#| msgid "Add New Product category" msgid "Add the product to cart" -msgstr "Ajouter une nouvelle catégorie de produits" +msgstr "Ajouter le produit au panier" #: modules/products/view/frontend/wps-product-list-edit.php:50 #: modules/products/view/frontend/wps-product-list.php:37 @@ -1651,9 +1668,9 @@ msgstr "Modifier la galerie sur Dolibarr" msgid "Add an image to the gallery" msgstr "Ajouter une image à la galerie" -#: modules/products/view/metabox/main.view.php:46 -msgid "Connect WPshop to your ERP to edit product datas" -msgstr "" +#: modules/products/view/metabox/main.view.php:86 +msgid "To modify the data of this product, go to Dolibarr" +msgstr "Pour modifier les données de ce produit, aller sur Dolibarr" #: modules/proposals/action/class-proposals-action.php:78 msgid "Quotation" @@ -1734,25 +1751,25 @@ msgstr "Nouveau titre" msgid "Title:" msgstr "Titre:" -#: modules/settings/action/class-settings-action.php:150 -#: modules/settings/action/class-settings-action.php:313 +#: modules/settings/action/class-settings-action.php:152 +#: modules/settings/action/class-settings-action.php:315 msgid "WPshop cannot connect to dolibarr. Please check your settings" msgstr "" "WPshop n'est pas connecté à Dolibarr. Veuillez vérifier vos configurations" -#: modules/settings/action/class-settings-action.php:157 -#: modules/settings/action/class-settings-action.php:194 -#: modules/settings/action/class-settings-action.php:227 -#: modules/settings/action/class-settings-action.php:256 -#: modules/settings/action/class-settings-action.php:320 +#: modules/settings/action/class-settings-action.php:159 +#: modules/settings/action/class-settings-action.php:196 +#: modules/settings/action/class-settings-action.php:229 +#: modules/settings/action/class-settings-action.php:258 +#: modules/settings/action/class-settings-action.php:322 msgid "Your settings have been saved." msgstr "Vos réglages ont été enregistrés." -#: modules/settings/class/class-settings.php:141 +#: modules/settings/class/class-settings.php:145 msgid "No page" msgstr "Pas de page" -#: modules/settings/class/class-settings.php:229 +#: modules/settings/class/class-settings.php:233 msgid "No product" msgstr "Aucun produit" @@ -1851,7 +1868,7 @@ msgid "Dolibarr Payments Lists" msgstr "Listes des Paiements Dolibarr" #: modules/settings/view/erp.view.php:187 -#: modules/settings/view/general.view.php:68 +#: modules/settings/view/general.view.php:75 #: modules/settings/view/pages.view.php:66 #: modules/settings/view/payment-method-single.view.php:58 #: modules/settings/view/shipping-cost.view.php:57 @@ -1878,6 +1895,10 @@ msgstr "Activer la liste d'envies" msgid "Split product" msgstr "Séparer les lignes des produits dans le panier" +#: modules/settings/view/general.view.php:70 +msgid "Debug mode" +msgstr "" + #: modules/settings/view/main.view.php:40 modules/tools/view/main.view.php:29 msgid "General" msgstr "Général" @@ -2066,6 +2087,15 @@ msgstr "Importer des produits depuis un CSV" msgid "Tools" msgstr "Outils" +#~ msgid "Waiting for a signature" +#~ msgstr "En attente de la signature" + +#~ msgid "(Delivery)" +#~ msgstr "Délivrée" + +#~ msgid "Not paid" +#~ msgstr "Non payée" + #~ msgid "Products Category" #~ msgstr "Catégories de produits" @@ -2280,9 +2310,6 @@ msgstr "Outils" #~ msgid "Filter" #~ msgstr "Filtrer" -#~ msgid "Valid page" -#~ msgstr "Validation" - #~ msgid "Proposal details %s" #~ msgstr "Details de la proposition commerciale %s" diff --git a/modules/checkout/action/class-checkout-action.php b/modules/checkout/action/class-checkout-action.php index 9c50ccd..cab790f 100644 --- a/modules/checkout/action/class-checkout-action.php +++ b/modules/checkout/action/class-checkout-action.php @@ -249,8 +249,6 @@ public function callback_checkout_create_third() { if ( ! is_user_logged_in() ) { $third_party = Third_Party::g()->update( $posted_data['third_party'] ); - // Call wpshop to update attached ERP. - do_action( 'wps_checkout_create_third_party', $third_party ); $posted_data['contact']['login'] = sanitize_user( current( explode( '@', $posted_data['contact']['email'] ) ), true ); $posted_data['contact']['password'] = wp_generate_password(); @@ -262,6 +260,9 @@ public function callback_checkout_create_third() { $third_party->data['contact_ids'][] = $contact->data['id']; $third_party = Third_Party::g()->update( $third_party->data ); + // Call wpshop to update attached ERP. + do_action( 'wps_checkout_create_third_party', $third_party ); + // Call wpshop to update attached ERP. do_action( 'wps_checkout_create_contact', $contact ); @@ -416,6 +417,7 @@ public function callback_checkout_proposal( $third_party, $contact ) { * @param User $contact Les données du contact. */ public function callback_checkout_doli_proposal( $third_party, $contact ) { + $type_payment = ! empty( $_POST['type_payment'] ) ? sanitize_text_field( $_POST['type_payment'] ) : ''; $proposal_data = array( diff --git a/modules/dolibarr/doli-invoice/action/class-doli-invoice-action.php b/modules/dolibarr/doli-invoice/action/class-doli-invoice-action.php index b90a681..2a02b3e 100644 --- a/modules/dolibarr/doli-invoice/action/class-doli-invoice-action.php +++ b/modules/dolibarr/doli-invoice/action/class-doli-invoice-action.php @@ -105,7 +105,9 @@ public function add_meta_box() { * @version 2.0.0 */ public function callback_admin_menu() { - add_submenu_page( 'wpshop', __( 'Invoices', 'wpshop' ), __( 'Invoices', 'wpshop' ), 'manage_options', 'wps-invoice', array( $this, 'callback_add_menu_page' ) ); + if ( Settings::g()->dolibarr_is_active() ) { + add_submenu_page('wpshop', __('Invoices', 'wpshop'), __('Invoices', 'wpshop'), 'manage_options', 'wps-invoice', array($this, 'callback_add_menu_page')); + } } /** diff --git a/modules/dolibarr/doli-order/action/class-doli-order-action.php b/modules/dolibarr/doli-order/action/class-doli-order-action.php index f965675..f487dfa 100644 --- a/modules/dolibarr/doli-order/action/class-doli-order-action.php +++ b/modules/dolibarr/doli-order/action/class-doli-order-action.php @@ -257,11 +257,13 @@ public function metabox_order_details( $order ) { * La metabox des paiements d'une commande * * @since 2.0.0 - * @version 2.0.0 + * @version 2.3.3 * * @param Doli_Order $order Les données d'une commande. */ public function metabox_order_payment( $order ) { + $dolibarr_option = get_option( 'wps_dolibarr', Settings::g()->default_settings ); + $doli_invoices = array(); $wp_invoices = array(); @@ -269,7 +271,7 @@ public function metabox_order_payment( $order ) { if ( ! empty( $order->data['linked_objects_ids']['facture'] ) ) { $route = 'invoices?sortfield=t.rowid&sortorder=ASC&limit=100&sqlfilters='; foreach ( $order->data['linked_objects_ids']['facture'] as $doli_invoice_id ) { - $route .= '(t.rowid:=:' . $doli_invoice_id . ') or'; + $route .= 't.rowid=' . $doli_invoice_id . ' or '; } $route = substr( $route, 0, strlen( $route ) - 3 ); @@ -300,6 +302,7 @@ public function metabox_order_payment( $order ) { 'already_paid' => $already_paid, 'total_ttc_invoices' => $total_ttc_invoices, 'remaining_unpaid' => $remaining_unpaid, + 'doli_url' => $dolibarr_option['dolibarr_url'], ) ); } @@ -414,7 +417,6 @@ public function create_order( $proposal ) { $wp_order = Doli_Order::g()->get( array( 'schema' => true ), true ); $wp_order = Doli_Order::g()->doli_to_wp( $doli_order, $wp_order, true ); - return $wp_order; } diff --git a/modules/dolibarr/doli-order/class/class-doli-order.php b/modules/dolibarr/doli-order/class/class-doli-order.php index f8285f0..1c4955b 100644 --- a/modules/dolibarr/doli-order/class/class-doli-order.php +++ b/modules/dolibarr/doli-order/class/class-doli-order.php @@ -263,19 +263,21 @@ public function doli_to_wp( $doli_order, $wp_order, $only_convert = false ) { $status = 'publish'; break; case 2: + $status = 'wps-shipmentprocess'; break; case 3: $status = 'wps-delivered'; $wp_order->data['delivered'] = 1; + if ( $wp_order->data['billed'] ) { + $status = 'wps-billed'; + } break; default: $status = 'publish'; break; } - if ( $wp_order->data['billed'] ) { - $status = 'wps-billed'; - + if ( $wp_order->data['billed'] && $status = 'wps-billed' ) { if ( ! $only_convert ) { Product_Downloadable::g()->create_from_order( $wp_order ); } diff --git a/modules/dolibarr/doli-order/filter/class-doli-order-filter.php b/modules/dolibarr/doli-order/filter/class-doli-order-filter.php index a2011bc..97de74a 100644 --- a/modules/dolibarr/doli-order/filter/class-doli-order-filter.php +++ b/modules/dolibarr/doli-order/filter/class-doli-order-filter.php @@ -6,7 +6,7 @@ * @author Eoxia * @copyright (c) 2011-2020 Eoxia . * @since 2.0.0 - * @version 2.0.0 + * @version 2.3.3 */ namespace wpshop; @@ -106,7 +106,7 @@ public function add_review_order_table_class( $class, $object ) { * Change le statut d'une commande. * * @since 2.0.0 - * @version 2.0.0 + * @version 2.3.3 * * @param string $status Le statut d'une facture. * @param Doli_Invoice $object Les données d'une facture. @@ -119,8 +119,8 @@ public function wps_doli_status( $status, $object ) { return __( 'Traitment in progress', 'wpshop' ); } - if ( $object->data['delivered'] ) { - return $status . ' ' . __( '(Delivery)', 'wpshop' ); + if ( $object->data['billed'] ) { + return $status . ' - ' . __( 'Billed', 'wpshop' ); } } diff --git a/modules/dolibarr/doli-order/view/metabox-order-payment.view.php b/modules/dolibarr/doli-order/view/metabox-order-payment.view.php index ce9ea8b..8ba4975 100644 --- a/modules/dolibarr/doli-order/view/metabox-order-payment.view.php +++ b/modules/dolibarr/doli-order/view/metabox-order-payment.view.php @@ -6,7 +6,7 @@ * @author Eoxia * @copyright (c) 2011-2020 Eoxia . * @since 2.0.0 - * @version 2.0.0 + * @version 2.3.3 */ namespace wpshop; @@ -70,4 +70,14 @@ + + + + diff --git a/modules/dolibarr/doli-payment/class/class-doli-payment.php b/modules/dolibarr/doli-payment/class/class-doli-payment.php index d6ae156..ff1d642 100644 --- a/modules/dolibarr/doli-payment/class/class-doli-payment.php +++ b/modules/dolibarr/doli-payment/class/class-doli-payment.php @@ -154,9 +154,7 @@ public function convert_to_wp( $payment_method ) { $payment_methods_option = get_option( 'wps_payment_methods', Payment::g()->default_options ); if ( 'CB' === $payment_method ) { - return 'paypal'; - } elseif ( 'STR' === $payment_method ) { - return 'stripe'; + return 'carte_bancaire'; } elseif ( 'CHQ' === $payment_method ) { return 'cheque'; } elseif ( 'LIQ' === $payment_method ) { diff --git a/modules/dolibarr/doli-proposals/class/class-doli-proposals.php b/modules/dolibarr/doli-proposals/class/class-doli-proposals.php index 69d72de..7f47382 100644 --- a/modules/dolibarr/doli-proposals/class/class-doli-proposals.php +++ b/modules/dolibarr/doli-proposals/class/class-doli-proposals.php @@ -6,7 +6,7 @@ * @author Eoxia * @copyright (c) 2011-2020 Eoxia . * @since 2.0.0 - * @version 2.0.0 + * @version 2.3.3 */ namespace wpshop; @@ -53,7 +53,7 @@ protected function construct() {} * Synchronise Dolibarr vers WPshop. * * @since 2.0.0 - * @version 2.0.0 + * @version 2.3.3 * * @param stdClass $doli_proposal Les données d'une proposition commerciale Dolibarr. * @param Proposals $wp_proposal Les données d'une proposition commerciale WordPress. @@ -116,7 +116,7 @@ public function doli_to_wp( $doli_proposal, $wp_proposal ) { $status = 'wps-refused'; break; case 4: - $status = 'publish'; + $status = 'wps-billed'; $wp_proposal->data['billed'] = 1; break; default: diff --git a/modules/dolibarr/doli-proposals/doli-proposals.config.json b/modules/dolibarr/doli-proposals/doli-proposals.config.json index 65c0c8d..41ed161 100644 --- a/modules/dolibarr/doli-proposals/doli-proposals.config.json +++ b/modules/dolibarr/doli-proposals/doli-proposals.config.json @@ -2,11 +2,12 @@ "name": "Doli Proposals", "slug": "doli-proposals", "since": "2.0.0", - "version": "2.0.0", + "version": "2.3.3", "description": "Le module gérant les propositions commerciales", "path": "modules/dolibarr/doli-proposals/", "dependencies": { - "class": {}, - "action": {} + "filter": {}, + "class": {}, + "action": {} } } diff --git a/modules/dolibarr/doli-proposals/filter/class-doli-proposals-filter.php b/modules/dolibarr/doli-proposals/filter/class-doli-proposals-filter.php new file mode 100644 index 0000000..a5af011 --- /dev/null +++ b/modules/dolibarr/doli-proposals/filter/class-doli-proposals-filter.php @@ -0,0 +1,60 @@ + + * @copyright (c) 2011-2020 Eoxia . + * @since 2.3.3 + * @version 2.3.3 + */ + +namespace wpshop; + +defined( 'ABSPATH' ) || exit; + +/** + * Doli Proposals Filter Class. + */ +class Doli_Proposals_Filter { + + /** + * Le constructeur. + * + * @since 2.3.3 + * @version 2.3.3 + */ + public function __construct() { + add_filter( 'wps_doli_status', array( $this, 'wps_doli_status' ), 10, 2 ); + } + + /** + * Change le statut d'une proposition commerciale. + * + * @since 2.3.3 + * @version 2.3.3 + * + * @param string $status Le statut d'une proposition commerciale. + * @param Proposals $object Les données d'une proposition commerciale. + * + * @return string Le nouveau statut d'une proposition commerciale. + */ + public function wps_doli_status( $status, $object ) { + if ( $object->data['type'] == Proposals::g()->get_type() ) { + switch ($object->data['status']) { + case 'publish': + $status .= __(' (open proposal)', 'wpshop'); + break; + case 'wps-accepted': + $status .= __(' (to be invoiced)', 'wpshop'); + break; + case 'wps-refused': + $status .= __(' (closed)', 'wpshop'); + break; + } + } + return $status; + } +} + +new Doli_Proposals_Filter(); diff --git a/modules/dolibarr/doli-proposals/filter/index.php b/modules/dolibarr/doli-proposals/filter/index.php new file mode 100644 index 0000000..6220032 --- /dev/null +++ b/modules/dolibarr/doli-proposals/filter/index.php @@ -0,0 +1,2 @@ + * @copyright (c) 2011-2020 Eoxia . * @since 2.0.0 - * @version 2.0.0 + * @version 2.3.3 */ namespace wpshop; @@ -35,7 +35,7 @@ class Doli_Statut extends Singleton_Util { * Le constructeur. * * @since 2.0.0 - * @version 2.0.0 + * @version 2.3.3 */ protected function construct() { $this->status = array( @@ -45,20 +45,20 @@ protected function construct() { 'class' => 'status-grey', ), 'publish' => array( - 'text' => __( 'Waiting for a signature', 'wpshop' ), + 'text' => __( 'Validated', 'wpshop' ), 'class' => 'status-orange', ), 'wps-accepted' => array( 'text' => __( 'Signed', 'wpshop' ), - 'class' => 'status-orange', + 'class' => 'status-green', ), 'wps-refused' => array( 'text' => __( 'Not signed', 'wpshop' ), - 'class' => 'status-red', + 'class' => 'status-grey', ), 'wps-billed' => array( 'text' => __( 'Billed', 'wpshop' ), - 'class' => 'status-green', + 'class' => 'status-grey', ), 'wps-delivered' => array( 'text' => __( 'Delivered', 'wpshop' ), @@ -71,7 +71,7 @@ protected function construct() { 'class' => 'status-grey', ), 'publish' => array( - 'text' => __( 'Not paid', 'wpshop' ), + 'text' => __( 'Validated', 'wpshop' ), 'class' => 'status-orange', ), 'wps-canceled' => array( @@ -79,7 +79,11 @@ protected function construct() { 'class' => 'status-red', ), 'wps-billed' => array( - 'text' => __( 'Billed', 'wpshop' ), + 'text' => __( 'Processed', 'wpshop' ), + 'class' => 'status-grey', + ), + 'wps-shipmentprocess' => array( + 'text' => __( 'In progress', 'wpshop' ), 'class' => 'status-green', ), 'wps-delivered' => array( @@ -93,12 +97,12 @@ protected function construct() { 'class' => 'status-grey', ), 'publish' => array( - 'text' => __( 'Not paid', 'wpshop' ), + 'text' => __( 'Unpaid', 'wpshop' ), 'class' => 'status-orange', ), 'wps-billed' => array( - 'text' => __( 'Billed', 'wpshop' ), - 'class' => 'status-green', + 'text' => __( 'Paid', 'wpshop' ), + 'class' => 'status-grey', ), 'wps-abandoned' => array( 'text' => __( 'Abandoned', 'wpshop' ), diff --git a/modules/dolibarr/doli-third-parties/class/class-doli-third-parties.php b/modules/dolibarr/doli-third-parties/class/class-doli-third-parties.php index a8c39eb..64ee180 100644 --- a/modules/dolibarr/doli-third-parties/class/class-doli-third-parties.php +++ b/modules/dolibarr/doli-third-parties/class/class-doli-third-parties.php @@ -114,6 +114,8 @@ public function wp_to_doli( $wp_third_party, $doli_third_party, $save = true, &$ 'errors' => array(), 'messages' => array(), ) ) { + $contact = User::g()->get( array( 'id' => $wp_third_party->data['contact_ids'][0] ), true ); + $data = array( 'name' => $wp_third_party->data['title'], 'country' => $wp_third_party->data['country'], @@ -127,7 +129,8 @@ public function wp_to_doli( $wp_third_party, $doli_third_party, $save = true, &$ 'client' => 1, 'code_client' => 'auto', 'array_options' => array( - 'options__wps_id' => $wp_third_party->data['id'], + 'options_firstname' => $contact->data['firstname'], + 'options__wps_id' => $wp_third_party->data['id'], ), ); diff --git a/modules/payment/class/class-payment.php b/modules/payment/class/class-payment.php index 58c1ac5..4a346d6 100644 --- a/modules/payment/class/class-payment.php +++ b/modules/payment/class/class-payment.php @@ -6,7 +6,7 @@ * @author Eoxia * @copyright (c) 2011-2020 Eoxia . * @since 2.0.0 - * @version 2.0.0 + * @version 2.3.3 */ namespace wpshop; @@ -44,7 +44,7 @@ class Payment extends Singleton_Util { * Le constructeur. * * @since 2.0.0 - * @version 2.0.0 + * @version 2.3.3 */ protected function construct() { $this->default_options = array( @@ -78,6 +78,12 @@ protected function construct() { 'secret_key' => '', 'use_stripe_sandbox' => false, ), + 'carte_bancaire' => array( + 'active' => true, + 'logo' => '', + 'title' => __( 'Carte Bancaire', 'wpshop' ), + 'description' => __( 'Use your credit card to place your order', 'wpshop' ), + ), ); $this->default_options = apply_filters( 'wps_payment_methods', $this->default_options ); diff --git a/modules/products/view/metabox/main.view.php b/modules/products/view/metabox/main.view.php index 1772930..e8a1038 100644 --- a/modules/products/view/metabox/main.view.php +++ b/modules/products/view/metabox/main.view.php @@ -6,7 +6,7 @@ * @author Eoxia * @copyright (c) 2011-2020 Eoxia . * @since 2.0.0 - * @version 2.0.0 + * @version 2.3.3 */ namespace wpshop; @@ -21,29 +21,69 @@ ?>
- dolibarr_is_active() ) : ?> -
-

data['content']; ?>

+ dolibarr_is_active() ) : ?> + + data['content']; ?> + + + + + data['price'] != 0 ? esc_html( $product->data['price'] ) : ''; ?> + + + + data['tva_tx'] ); ?> + + + + data['price_ttc'] ); ?> + + -
-
-
-
data['price'] != 0 ? esc_html( $product->data['price'] ) : ''; ?>
-
-
-
-
data['tva_tx'] ); ?>%
-
-
-
-
data['price_ttc'] ); ?>
+
+ +
+
+ + +
+
+ + +
+
+ + +
- +
diff --git a/readme.txt b/readme.txt index d671725..a52fa06 100644 --- a/readme.txt +++ b/readme.txt @@ -3,9 +3,9 @@ Contributors: Eoxia Tags: boutique, catalog, catalogue, commerce, e-commerce, ecommerce, m-commerce, mcommerce, produits, shop, shopping cart, wp shop, wordpress ecommerce, wordpress shop, WPShop, wp-shop, french payment gateway, Donate link: https://www.wpshop.fr/ Requires at least: 4.4 -Tested up to: 5.5.3 +Tested up to: 5.6.1 Requires PHP: 7.0 -Stable tag: 2.3.2 +Stable tag: 2.3.3 License: GPLv3 or later License URI: https://spdx.org/licenses/GPL-3.0-or-later.html @@ -65,6 +65,17 @@ Il n'est pas possible de migrer les données vers la version WPShop 2.X.X. == Changelog == += Version 2.3.3 = + +* Add - Change on Statut for Proposals, orders and invoices. +* Add - Change on payment method paypal/stripe -> credit card. +* Add - Invoice link on single page order. +* Add - Translate. +* Add - Edit Dolibarr product configuration on single page. + +* Fix - First name doesn't appear on Dolibarr tiers. +* Fix - Invoice module appear on WPshop without Dolibarr. + = Version 2.3.2 = * Add - Add stock to product synchronisation. diff --git a/wpshop.config.json b/wpshop.config.json index 5600120..74ca2d8 100644 --- a/wpshop.config.json +++ b/wpshop.config.json @@ -2,7 +2,7 @@ "name": "WPshop", "slug": "wpshop", "since": "2.0.0", - "version": "2.3.2", + "version": "2.3.3", "description": "L'application WPshop 2", "externals": [], "modules": [ diff --git a/wpshop.php b/wpshop.php index 59881f2..ce7e509 100644 --- a/wpshop.php +++ b/wpshop.php @@ -3,7 +3,7 @@ * Plugin Name: WPshop 2 * Plugin URI: https://wpshop.fr/ * Description: Simple, fast, efficient it will transform your WordPress into an internet sales site - * Version: 2.3.2 + * Version: 2.3.3 * Author: Eoxia * Author URI: http://www.eoxia.com/ * License: GPLv3 @@ -37,8 +37,10 @@ add_filter('site_transient_update_plugins', function ($value) { - if ( $value->checked[plugin_basename(__FILE__)] <= "1.6.4" ) { - unset( $value->response[plugin_basename(__FILE__)] ); + if (!empty($value->checked)) { + if ( $value->checked[plugin_basename(__FILE__)] <= "1.6.4" ) { + unset( $value->response[plugin_basename(__FILE__)] ); + } } return $value; }