Plugin Directory

Changeset 1899812


Ignore:
Timestamp:
06/27/2018 10:01:36 AM (8 years ago)
Author:
marguspala
Message:

Better discount handling

Location:
smartaccounts/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • smartaccounts/trunk/SmartAccountsApi.php

    r1861538 r1899812  
    2828        $args = array(
    2929            'body'    => $bodyJson,
    30             'headers' => ['Content-Type' => 'application/json']
     30            'headers' => ['Content-Type' => 'application/json'],
     31            'timeout' => 60
    3132        );
    3233
  • smartaccounts/trunk/SmartAccountsClass.php

    r1857095 r1899812  
    2626            $saPayment->createPayment();
    2727            update_post_meta($order_id, 'smartaccounts_invoice_id', $invoice['invoice']['invoiceNumber']);
     28            error_log("SmartAccounts sales invoice created for order $order_id - " . $invoice['invoice']['invoiceNumber']);
    2829        } catch (Exception $exception) {
    29             $handle = fopen(dirname(__FILE__) . "/error.log", 'a');
    30 
    31             if ($handle) {
    32                 fwrite($handle, new DateTime());
    33                 fwrite($handle, "Error reason: " . $exception->getMessage());
    34                 fwrite($handle, $exception->getTraceAsString());
    35                 fclose($handle);
    36             }
     30            error_log("SmartAccounts error: " . $exception->getMessage() . " " . $exception->getTraceAsString());
    3731        }
    3832    }
  • smartaccounts/trunk/SmartAccountsSalesInvoice.php

    r1864957 r1899812  
    5757    public function getOrderTotal()
    5858    {
    59         return $this->order->get_subtotal() + $this->order->get_shipping_total();
     59        return $this->order->get_subtotal() + $this->order->get_shipping_total() - $this->order->get_discount_total();
    6060    }
    6161
  • smartaccounts/trunk/readme.txt

    r1796659 r1899812  
    22Tags: SmartAccounts, smartaccounts, WooCommerce
    33Requires at least: 4.8
    4 Tested up to: 4.9
     4Tested up to: 4.9.6
    55License: GPLv2 or later
    66License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1010== Description ==
    1111
    12 After woocommerce order goes to status "Processing" or "Completed" then this plugin:
     12After woocommerce order goes to status “Processing” or “Completed” then this plugin:
    1313* Creates Customer to SmartAccounts if no existing customer with same name and e-mail found
    1414* Creates Articles in Smartaccounts of Woocommerce product on the order if existing products are not found.
    15  Woocommerce product SKU is compared with SmartAccounts article code.
     15Woocommerce product SKU is compared with SmartAccounts article code.
    1616* Creates sales in invoice and connects it with the right customer and adds all the Articles on the invoice.
    1717* Marks the sales invoice as paid.
     
    4444== Changelog ==
    4545
    46 = 1.1 =
    47 Woo order number reference is added to SmartAccounts invoice note
    48 If company name is filled then invoice is connected to the Billing company
    49 Discounted prices are used on invoices
    50 Rounding calculation is added
    51 Shipping item code is configurable
    52 error.log is created in case of SmartAccounts communication issues
     46=1.3=
    5347
    54 = 1.0 =
    55 * Plugin is ready for production testing
     48Cart based discounts are handled better.
  • smartaccounts/trunk/smartaccounts.php

    r1864957 r1899812  
    44 * Plugin URI: https://github.com/smartman/woocommerce_smartaccounts
    55 * Description: This plugin creates sales invoices in the smartaccounts.ee Online Accounting Software after Woocommerce order creation
    6  * Version: 1.2.3
     6 * Version: 1.3
    77 * Author: Margus Pala
    88 * Author URI: https://marguspala.com
Note: See TracChangeset for help on using the changeset viewer.