Changeset 2298313
- Timestamp:
- 05/05/2020 09:17:46 AM (6 years ago)
- Location:
- smartaccounts/trunk
- Files:
-
- 4 edited
-
SmartAccountsArticleAsync.php (modified) (1 diff)
-
SmartAccountsClass.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
-
smartaccounts.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
smartaccounts/trunk/SmartAccountsArticleAsync.php
r2053161 r2298313 143 143 144 144 $regularPrice = get_post_meta($post_id, '_regular_price', true); 145 $salePrice = get_post_meta($post_id, '_price', true); 146 if ( ! $regularPrice) { 145 $finalPrice = get_post_meta($post_id, '_price', true); 146 $salePrice = get_post_meta($post_id, '_sale_price', true); 147 if ( ! $regularPrice || ! $finalPrice) { 148 // No price set at all yet, set one now. 147 149 update_post_meta($post_id, '_regular_price', $data['price']); 148 } else if ($regularPrice && $salePrice && ($salePrice == $regularPrice)) {149 update_post_meta($post_id, '_regular_price', $data['price']);150 } else if ($regularPrice && $salePrice && (floatval($data['price']) > floatval($regularPrice))) {150 update_post_meta($post_id, '_price', $data['price']); 151 } elseif ($salePrice && ($salePrice !== $regularPrice)) { 152 // Sale price is set. Update only regular price and keep actual sale price what it is. 151 153 update_post_meta($post_id, '_regular_price', $data['price']); 152 154 } 153 155 154 update_post_meta($post_id, '_price', $data['price']); 156 if ($finalPrice && (floatval($data['price']) > floatval($regularPrice))) { 157 // New final price is more than regular price so regular price will be updated also. 158 update_post_meta($post_id, '_regular_price', $data['price']); 159 } 160 155 161 update_post_meta($post_id, '_sku', $code); 156 162 update_post_meta($post_id, '_visibility', 'visible'); -
smartaccounts/trunk/SmartAccountsClass.php
r2283842 r2298313 34 34 error_log("Offer data: " . json_encode($offer)); 35 35 error_log("SmartAccounts sales offer created for order $order_id=" . $offer['offer']['offerId']); 36 $order->add_order_note("Offer sent to SmartAccounts: " . $offer['offer']['offerNumber']); 37 36 38 $offerIdsString = get_option('sa_failed_offers'); 37 39 $offerIds = json_decode($offerIdsString); … … 57 59 58 60 wp_schedule_single_event(time() + 129600, 'sa_retry_failed_job'); 61 $order->add_order_note("Offer sending to SmartAccounts failed: " . $exception->getMessage()); 59 62 } 60 63 } … … 82 85 update_post_meta($order_id, 'smartaccounts_invoice_id', $invoice['invoice']['invoiceNumber']); 83 86 error_log("SmartAccounts sales invoice created for order $order_id - " . $invoice['invoice']['invoiceNumber']); 87 $order->add_order_note("Invoice sent to SmartAccounts: " . $invoice['invoice']['invoiceNumber']); 88 84 89 $invoiceIdsString = get_option('sa_failed_orders'); 85 90 $invoiceIds = json_decode($invoiceIdsString); … … 105 110 106 111 wp_schedule_single_event(time() + 129600, 'sa_retry_failed_job'); 112 $order->add_order_note("Invoice sending to SmartAccounts failed: " . $exception->getMessage()); 107 113 } 108 114 } -
smartaccounts/trunk/readme.txt
r2282902 r2298313 32 32 == Importing products from SmartAccounts == 33 33 * Products must be active sales items and of type Warehouse Item or Product. Services are not imported. 34 * Product final sale price is price taken from SmartAccounts. If discount prices is needed then Regular price needs to be changed and then Regular price is notchanged.34 * Product final price is taken from SmartAccounts unless sale price is set. If sale price is set manually then only regular price is changed. 35 35 36 36 == Note about Woo and SmartAccounts client matching == … … 58 58 59 59 == Changelog == 60 61 = 3.0.5 = 62 Improved pricing when sale price is set. 60 63 61 64 = 3.0.2 = -
smartaccounts/trunk/smartaccounts.php
r2290867 r2298313 4 4 * Plugin URI: https://github.com/smartman/woocommerce_smartaccounts 5 5 * Description: This plugin creates sales invoices in the smartaccounts.ee Online Accounting Software after Woocommerce order creation 6 * Version: 3.0. 46 * Version: 3.0.5 7 7 * Author: Margus Pala 8 8 * Author URI: https://marguspala.com
Note: See TracChangeset
for help on using the changeset viewer.