Plugin Directory

Changeset 3049737


Ignore:
Timestamp:
03/12/2024 11:53:14 AM (2 years ago)
Author:
intia
Message:

1.0.24

Location:
infast
Files:
5 edited
9 copied

Legend:

Unmodified
Added
Removed
  • infast/tags/1.0.24/README.txt

    r3027253 r3049737  
    55Tested up to: 6.4
    66Requires PHP: 7.2
    7 Stable tag: 1.0.23
     7Stable tag: 1.0.24
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    3737- Envoi automatique des factures par e-mail (paramétrable)
    3838- Ajout d’un destinataire en copie lors des envois d’e-mails (paramétrable)
     39- En revanche le plugin ne gère pas pour le moment les remboursements sur les commandes. Les factures seront créées au staut Brouillon dans INFast de manière à gérer plus facilement les avoir depuis INFast.
    3940
    4041**Consulter l’exemple de facture disponible depuis un portail personnalisé pour voir la facturation INFast en action**
     
    124125
    125126== Changelog ==
     127= Version 1.0.24 =
     128- Si une commande contient des remboursements, la facture INFast restera au statut "Brouillon". Ceci permet de gérer les avoirs manullement depuis INFast tant que le plugin ne sait pas gérer les avoirs automatiquement.
     129
    126130= Version 1.0.23 =
    127131- Délier les produits WooCommerce des articles INFast ne fonctionnait pas pour les variantes de produite
  • infast/tags/1.0.24/README_DEV.txt

    r3027253 r3049737  
    8787=== Send new version to SVN ===
    8888- Change version in infast-woocommerce.php
     89- Change version in class-infast-woocommerce-admin.php http_headers_useragent function
    8990- Change stage version in README.txt
    9091- Add a release description for this version
  • infast/tags/1.0.24/admin/class-infast-woocommerce-admin.php

    r3027253 r3049737  
    264264
    265265    public function http_headers_useragent( $user_agent, $url) {
    266         return $user_agent . '; infast-plugin-version/1.0.23';
     266        return $user_agent . '; infast-plugin-version/1.0.24';
    267267    }   
    268268   
  • infast/tags/1.0.24/includes/infast-api/class-infast-woocommerce-document-api.php

    r3012062 r3049737  
    151151            $document_validated = false;
    152152            $rounded_offset = 0;
     153            $have_refund = false;
    153154
    154155            do{
     
    176177
    177178                if ( $document_id ) {
    178                     // check amounts
    179                     // if amounts are different, add a error log and stop process
    180                     $order_total = floatval($order->get_total());
    181                     if($document_amount_vat !== $order_total) {
    182                         $rounded_offset = ($order_total - $document_amount_vat) / ($max_try / $nb_try);
    183                         $rounded_offset = round($rounded_offset, 4, PHP_ROUND_HALF_DOWN);
    184                         $abs_rounded_offset = abs($rounded_offset);
    185                         if( $abs_rounded_offset > 0.01 ) {                           
    186                             $order = wc_get_order( $order_id );     
    187                             $order->add_order_note( 'INFast API: La facture créée dans INFast n\'a pas le même montant (' . $document_amount_vat . ') que la commande WooCommerce (' . $order_total . '). La facture est restée à l\'état "brouillon" dans INFast' );
    188                             error_log( 'INFast API: INFast document has not same amount that the WooCommerce order:');   
     179                    // check if WooCommerce command have refund.
     180                    // In this case we keep the invoice in draft state
     181                    $refunds = $order->get_refunds();
     182                    $have_refund = (count ( $refunds ) != 0 );
     183                    if($have_refund) {
     184                        $order = wc_get_order( $order_id );     
     185                        $order->add_order_note( 'INFast API: La commande WooCommerce contient des remboursements. Le plugin INFast n\'est actuellement pas en mesure de traiter ces remboursements. La facture est restée à l\'état "brouillon" dans INFast' );
     186                        error_log( 'INFast API: WooCommerce order has refund, INFast plugin cannot manage them. The document is created in draft state in INFast.');   
     187                    } else {
     188                        // check amounts
     189                        // if amounts are different, add a error log and stop process
     190                        $order_total = floatval($order->get_total());
     191                        if($document_amount_vat !== $order_total) {
     192                            $rounded_offset = ($order_total - $document_amount_vat) / ($max_try / $nb_try);
     193                            $rounded_offset = round($rounded_offset, 4, PHP_ROUND_HALF_DOWN);
     194                            $abs_rounded_offset = abs($rounded_offset);
     195                            if( $abs_rounded_offset > 0.01 ) {                           
     196                                $order = wc_get_order( $order_id );     
     197                                $order->add_order_note( 'INFast API: La facture créée dans INFast n\'a pas le même montant (' . $document_amount_vat . ') que la commande WooCommerce (' . $order_total . '). La facture est restée à l\'état "brouillon" dans INFast' );
     198                                error_log( 'INFast API: INFast document has not same amount that the WooCommerce order.');   
     199                            }
     200                        } else {
     201                            $this->validate_invoice( $order_id, $document_id, $check_wip_random, $check_wip_step );
     202                            $document_validated = true;
    189203                        }
    190                     } else {
    191                         $this->validate_invoice( $order_id, $document_id, $check_wip_random, $check_wip_step );
    192                         $document_validated = true;
    193204                    }
     205                   
    194206                }
    195             } while ($nb_try < $max_try && !$document_validated && $abs_rounded_offset < 0.01);           
     207            } while ($nb_try < $max_try && !$document_validated && $abs_rounded_offset < 0.01 && !$have_refund);           
    196208
    197209            $this->delete_wip();                   
  • infast/tags/1.0.24/infast-woocommerce.php

    r3027253 r3049737  
    1717 * Plugin URI:        https://intia.fr/fr/plugin-woocommerce
    1818 * Description:       Créez et envoyez par e-mail des factures conformes automatiquement à chaque commande passée sur votre e-boutique WooCommerce.
    19  * Version:           1.0.23
     19 * Version:           1.0.24
    2020 * Author:            INTIA
    2121 * Author URI:        https://intia.fr
  • infast/trunk/README.txt

    r3027253 r3049737  
    55Tested up to: 6.4
    66Requires PHP: 7.2
    7 Stable tag: 1.0.23
     7Stable tag: 1.0.24
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    3737- Envoi automatique des factures par e-mail (paramétrable)
    3838- Ajout d’un destinataire en copie lors des envois d’e-mails (paramétrable)
     39- En revanche le plugin ne gère pas pour le moment les remboursements sur les commandes. Les factures seront créées au staut Brouillon dans INFast de manière à gérer plus facilement les avoir depuis INFast.
    3940
    4041**Consulter l’exemple de facture disponible depuis un portail personnalisé pour voir la facturation INFast en action**
     
    124125
    125126== Changelog ==
     127= Version 1.0.24 =
     128- Si une commande contient des remboursements, la facture INFast restera au statut "Brouillon". Ceci permet de gérer les avoirs manullement depuis INFast tant que le plugin ne sait pas gérer les avoirs automatiquement.
     129
    126130= Version 1.0.23 =
    127131- Délier les produits WooCommerce des articles INFast ne fonctionnait pas pour les variantes de produite
  • infast/trunk/README_DEV.txt

    r3027253 r3049737  
    8787=== Send new version to SVN ===
    8888- Change version in infast-woocommerce.php
     89- Change version in class-infast-woocommerce-admin.php http_headers_useragent function
    8990- Change stage version in README.txt
    9091- Add a release description for this version
  • infast/trunk/admin/class-infast-woocommerce-admin.php

    r3027253 r3049737  
    264264
    265265    public function http_headers_useragent( $user_agent, $url) {
    266         return $user_agent . '; infast-plugin-version/1.0.23';
     266        return $user_agent . '; infast-plugin-version/1.0.24';
    267267    }   
    268268   
  • infast/trunk/includes/infast-api/class-infast-woocommerce-document-api.php

    r3012062 r3049737  
    151151            $document_validated = false;
    152152            $rounded_offset = 0;
     153            $have_refund = false;
    153154
    154155            do{
     
    176177
    177178                if ( $document_id ) {
    178                     // check amounts
    179                     // if amounts are different, add a error log and stop process
    180                     $order_total = floatval($order->get_total());
    181                     if($document_amount_vat !== $order_total) {
    182                         $rounded_offset = ($order_total - $document_amount_vat) / ($max_try / $nb_try);
    183                         $rounded_offset = round($rounded_offset, 4, PHP_ROUND_HALF_DOWN);
    184                         $abs_rounded_offset = abs($rounded_offset);
    185                         if( $abs_rounded_offset > 0.01 ) {                           
    186                             $order = wc_get_order( $order_id );     
    187                             $order->add_order_note( 'INFast API: La facture créée dans INFast n\'a pas le même montant (' . $document_amount_vat . ') que la commande WooCommerce (' . $order_total . '). La facture est restée à l\'état "brouillon" dans INFast' );
    188                             error_log( 'INFast API: INFast document has not same amount that the WooCommerce order:');   
     179                    // check if WooCommerce command have refund.
     180                    // In this case we keep the invoice in draft state
     181                    $refunds = $order->get_refunds();
     182                    $have_refund = (count ( $refunds ) != 0 );
     183                    if($have_refund) {
     184                        $order = wc_get_order( $order_id );     
     185                        $order->add_order_note( 'INFast API: La commande WooCommerce contient des remboursements. Le plugin INFast n\'est actuellement pas en mesure de traiter ces remboursements. La facture est restée à l\'état "brouillon" dans INFast' );
     186                        error_log( 'INFast API: WooCommerce order has refund, INFast plugin cannot manage them. The document is created in draft state in INFast.');   
     187                    } else {
     188                        // check amounts
     189                        // if amounts are different, add a error log and stop process
     190                        $order_total = floatval($order->get_total());
     191                        if($document_amount_vat !== $order_total) {
     192                            $rounded_offset = ($order_total - $document_amount_vat) / ($max_try / $nb_try);
     193                            $rounded_offset = round($rounded_offset, 4, PHP_ROUND_HALF_DOWN);
     194                            $abs_rounded_offset = abs($rounded_offset);
     195                            if( $abs_rounded_offset > 0.01 ) {                           
     196                                $order = wc_get_order( $order_id );     
     197                                $order->add_order_note( 'INFast API: La facture créée dans INFast n\'a pas le même montant (' . $document_amount_vat . ') que la commande WooCommerce (' . $order_total . '). La facture est restée à l\'état "brouillon" dans INFast' );
     198                                error_log( 'INFast API: INFast document has not same amount that the WooCommerce order.');   
     199                            }
     200                        } else {
     201                            $this->validate_invoice( $order_id, $document_id, $check_wip_random, $check_wip_step );
     202                            $document_validated = true;
    189203                        }
    190                     } else {
    191                         $this->validate_invoice( $order_id, $document_id, $check_wip_random, $check_wip_step );
    192                         $document_validated = true;
    193204                    }
     205                   
    194206                }
    195             } while ($nb_try < $max_try && !$document_validated && $abs_rounded_offset < 0.01);           
     207            } while ($nb_try < $max_try && !$document_validated && $abs_rounded_offset < 0.01 && !$have_refund);           
    196208
    197209            $this->delete_wip();                   
  • infast/trunk/infast-woocommerce.php

    r3027253 r3049737  
    1717 * Plugin URI:        https://intia.fr/fr/plugin-woocommerce
    1818 * Description:       Créez et envoyez par e-mail des factures conformes automatiquement à chaque commande passée sur votre e-boutique WooCommerce.
    19  * Version:           1.0.23
     19 * Version:           1.0.24
    2020 * Author:            INTIA
    2121 * Author URI:        https://intia.fr
Note: See TracChangeset for help on using the changeset viewer.