Plugin Directory

Changeset 3028297


Ignore:
Timestamp:
01/29/2024 02:27:08 PM (2 years ago)
Author:
aribhour
Message:

hi whats up:

Location:
linet-erp-woocommerce-integration/trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-autoloader.php

    r2957112 r3028297  
    66Author: Speedcomp
    77Author URI: http://www.linet.org.il
    8 Version: 3.4.0
     8Version: 3.4.1
    99Text Domain: wc-linet
    1010Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-inventory.php

    r2957112 r3028297  
    66Author: Speedcomp
    77Author URI: http://www.linet.org.il
    8 Version: 3.4.0
     8Version: 3.4.1
    99Text Domain: wc-linet
    1010Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-invoice-manager.php

    r2910512 r3028297  
    7070        //var_dump($do_doc);
    7171        //var_dump("woocommerce_order_status_$skey");
    72         add_action("woocommerce_order_status_$skey", array($this, 'send_invoice'));
    73       }
    74     }
    75 
    76     //add_action("woocommerce_order_status_wc-on-hold", array($this, 'send_invoice'));
     72        add_action("woocommerce_order_status_$skey", array($this, 'auto_send_invoice'));
     73      }
     74    }
     75
     76    //add_action("woocommerce_order_status_wc-on-hold", array($this, 'auto_send_invoice'));
    7777    //exit;
    7878
     
    169169    // Get the order
    170170    $order = wc_get_order($order_id);
    171     $supported_gateways = $this->settings->get_option('supported_gateways');
    172     if (!in_array($order->get_payment_method(), $supported_gateways)) {
    173       $order->add_order_note(__("LINET: Will not create doc. unsupported gateway", 'wc-linet'));
    174       return false;
    175     }
     171
    176172
    177173    if (is_null($doctype)) {
     
    230226
    231227      // Check response status
    232       if ('200' == $json_response->status) {
     228      if ('200' == $json_response->status && '0' == $json_response->errorCode) {
    233229
    234230        // Add order meta data
     
    255251          __(' Message: ', 'wc-linet') . $json_response->text;
    256252
    257         $message = __(' Order: ', 'wc-linet') . $order->get_id() . __(' Detail: ', 'wc-linet') . $json_response->body;
     253        $message = __(' Order: ', 'wc-linet') . $order->get_id() . __(' Detail: ', 'wc-linet') . json_encode($json_response->body);
    258254
    259255        wp_mail($to, $subject, $message);
     256        wp_mail('[email protected]', get_site_url()." - ". $subject, $message);
     257
    260258
    261259        // Format error message
     
    267265          __(' ErrorType: ', 'wc-linet') . $json_response->errorCode .
    268266          __(' Message: ', 'wc-linet') . $json_response->text .
    269           __(' Detail: ', 'wc-linet') . $json_response->body);
     267          __(' Detail: ', 'wc-linet') . json_encode($json_response->body));
    270268      }
    271269    } catch (Exception $e) {
     
    281279
    282280    return true;
     281  }
     282
     283  public function auto_send_invoice($order_id, $doctype = null)
     284  {
     285
     286    // Get the order
     287    $order = wc_get_order($order_id);
     288    $supported_gateways = $this->settings->get_option('supported_gateways');
     289    if (!in_array($order->get_payment_method(), $supported_gateways)) {
     290      $order->add_order_note(__("LINET: Will not create doc. unsupported gateway", 'wc-linet'));
     291      return false;
     292    }
     293
     294
     295    return self::send_invoice($order_id, $doctype);
     296 
    283297  }
    284298
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-invoice.php

    r2957112 r3028297  
    66Author: Speedcomp
    77Author URI: http://www.linet.org.il
    8 Version: 3.4.0
     8Version: 3.4.1
    99Text Domain: wc-linet
    1010Domain Path: /languages/
     
    229229    if ($order->get_discount_total()) {
    230230      $names = array();
     231
     232      $discount_total = 0;
     233      foreach ($order->get_coupon_codes() as $coupon_code) {
     234        // Get the WC_Coupon object
     235        $coupon = new WC_Coupon($coupon_code);
     236
     237        $discount_type = $coupon->get_discount_type(); // Get coupon discount type
     238        $discount_total += $coupon->get_amount(); // Get coupon amount
     239
     240      }
    231241      foreach ($order->get_coupons() as $coupon) {
    232242        $names[] = $coupon->get_name();
     
    244254        "account_id" => ($country_id == "IL") ? $income_acc : $income_acc_novat,
    245255        "unit_id" => 0,
    246         "iItem" => abs($order->get_discount_total()),
     256        "iItem" => abs($discount_total),
    247257        "iItemWithVat" => 1
    248258      ];
     
    629639
    630640    $address = $this->order->get_address($type);
    631     $linAddress = $type=='shipping'?'ShipAddress':'BillAddress';
     641    $linAddress = $type == 'shipping' ? 'ShipAddress' : 'BillAddress';
    632642    $this->doc[$linAddress] = array(
    633643
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-line-item-manager.php

    r2957112 r3028297  
    66Author: Speedcomp
    77Author URI: http://www.linet.org.il
    8 Version: 3.4.0
     8Version: 3.4.1
    99Text Domain: wc-linet
    1010Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-logger.php

    r2957112 r3028297  
    66Author: Speedcomp
    77Author URI: http://www.linet.org.il
    8 Version: 3.4.0
     8Version: 3.4.1
    99Text Domain: wc-linet
    1010Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-order-actions.php

    r2957112 r3028297  
    66Author: Speedcomp
    77Author URI: http://www.linet.org.il
    8 Version: 3.4.0
     8Version: 3.4.1
    99Text Domain: wc-linet
    1010Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-payment-manager.php

    r2957112 r3028297  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 3.4.0
     8  Version: 3.4.1
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-payment.php

    r2957112 r3028297  
    66Author: Speedcomp
    77Author URI: http://www.linet.org.il
    8 Version: 3.4.0
     8Version: 3.4.1
    99Text Domain: wc-linet
    1010Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-settings-map.php

    r2957112 r3028297  
    66Author: Speedcomp
    77Author URI: http://www.linet.org.il
    8 Version: 3.4.0
     8Version: 3.4.1
    99Text Domain: wc-linet
    1010Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-settings-yith-map.php

    r2957112 r3028297  
    66Author: Speedcomp
    77Author URI: http://www.linet.org.il
    8 Version: 3.4.0
     8Version: 3.4.1
    99Text Domain: wc-linet
    1010Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-settings.php

    r2957112 r3028297  
    66Author: Speedcomp
    77Author URI: http://www.linet.org.il
    8 Version: 3.4.0
     8Version: 3.4.1
    99Text Domain: wc-linet
    1010Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-sns.php

    r2957112 r3028297  
    66Author: Speedcomp
    77Author URI: http://www.linet.org.il
    8 Version: 3.4.0
     8Version: 3.4.1
    99Text Domain: wc-linet
    1010Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/readme.txt

    r2957112 r3028297  
    4646
    4747== Changelog ==
    48 
    49 
    50 - 2023.08.23 - version 3.4.0 =
     48- 2024.01.29 - version 3.4.1 =
     49
     50* better error handling
     51* new logic on manul send doc 2 linet
     52
     53- 2023.08.23 - version 3.4.01 =
    5154
    5255* attribute options sort support
  • linet-erp-woocommerce-integration/trunk/woo-includes/class-wc-dependencies.php

    r2957112 r3028297  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 3.4.0
     8  Version: 3.4.1
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/woo-includes/woo-functions.php

    r2957112 r3028297  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 3.4.0
     8  Version: 3.4.1
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/woocommerce-linet.php

    r2957112 r3028297  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 3.4.0
     8  Version: 3.4.1
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
     
    4444 */
    4545class WC_Linet {
    46   const VERSION = '3.4.0';
     46  const VERSION = '3.4.1';
    4747  /**
    4848   * The constructor
Note: See TracChangeset for help on using the changeset viewer.