Changeset 3104457
- Timestamp:
- 06/19/2024 10:05:22 AM (3 weeks ago)
- Location:
- accounting-for-woocommerce/tags/stable
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
accounting-for-woocommerce/tags/stable/inc/export-refunds.php
r2943758 r3104457 1 <?php if ( ! defined( 'ABSPATH' ) ) exit; 2 3 /******ETAPE 3 : PREPARER L'EXPORT******/ 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) exit; 4 3 5 4 function woocommerce_accounting_export_refunds_data() { … … 77 76 } 78 77 $order_args = apply_filters('woocommerce_accounting:export:get_orders_refunds_args', $order_args, $date_opt, array( 'wc-completed' ), array($ts1, $ts2)); 79 $orders = get_posts($order_args);78 $orders = s($order_args); 80 79 do_action('woocommerce_accounting:export:launch', $orders); 81 80 … … 338 337 $get_order = new WC_Order ( $order->ID ); 339 338 340 /* *****************************************************************************/341 /* *********************** Taxes for each order **************************/342 /* *****************************************************************************/339 /**/ 340 /**/ 341 /**/ 343 342 344 343 $tax_applied_check = get_post_meta($order->ID,'_order_tax',true) + get_post_meta($order->ID,'_order_shipping_tax',true); … … 377 376 $tax_line_amount = $order->income_tax; 378 377 } 379 /* *****************************************************************************/380 /* ********* Add shipping method accounting account ************/381 /* *****************************************************************************/378 /**/ 379 /**/ 380 /**/ 382 381 $order_shipping_methods = $get_order->get_shipping_methods( ); 383 382 foreach ($order_shipping_methods as $order_shipping_method){ … … 403 402 } 404 403 } 405 /* *****************************************************************************/406 /* ************** Add products accounting codes and accounts *******************/407 /* *****************************************************************************/404 /**/ 405 /**/ 406 /**/ 408 407 $bef_tax = get_post_meta($order->ID,'_cart_discount',true); 409 408 if ($prod_opt == "1" && $order->order_discount == 0) { … … 436 435 ); 437 436 } 438 /* *****************************************************************************/439 /* ***************** Coupon amounts per product ********************/440 /* *****************************************************************************/437 /**/ 438 /**/ 439 /**/ 441 440 442 441 //Coupons are considered as negative products … … 452 451 } 453 452 } 454 / ******** Exceptionnal accounts ************/453 / 455 454 $exptcred_acc = get_option('woocommerce_accounting_generic_exptcred_accounting_account'); 456 455 $exptchar_acc = get_option('woocommerce_accounting_generic_exptchar_accounting_account'); -
accounting-for-woocommerce/tags/stable/inc/export.php
r2943758 r3104457 1 <?php if ( ! defined( 'ABSPATH' ) ) exit; 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) exit; 2 3 global $total_income; 3 4 global $total_outcome; … … 39 40 $coupon_col = sanitize_text_field($_POST['woocommerce_accounting_export_coupon_col']); 40 41 $coupon_opt = sanitize_text_field($_POST['woocommerce_accounting_export_coupon_opt']); 41 $rounding_precision = sanitize_text_field($_POST['woocommerce_accounting_export_rounding_precision']);42 $rounding_precision = sanitize_text_field($_POST['woocommerce_accounting_export_rounding_precision']); 42 43 43 44 update_option( 'woocommerce_accounting_export_start_date',$ts1); … … 64 65 $order_status = get_option('woocommerce_accounting_status'); 65 66 67 68 69 70 71 72 73 74 75 66 76 $order_args = array( 67 'posts_per_page' => -1, 68 'post_type' => 'shop_order', 69 'post_status' => $order_status, 77 'limit' => -1, 78 'status' => $order_status, 70 79 'orderby' => 'ID', 71 80 'order' => 'ASC', 72 81 ); 73 82 74 if ($date_opt == "1") { 75 $order_args['meta_query'] = array( 76 array( 77 'key' => '_completed_date', 78 'value' => array($ts1, $ts2), 79 'compare' => 'BETWEEN', 80 'type' => 'DATE', 81 ) 82 ); 83 if(isset($date_options[$date_opt])){ 84 $order_args[$date_options[$date_opt]] = "{$ts1}...{$ts2}"; 83 85 } 84 elseif($date_opt == "0"){ 85 $order_args['date_query'] = array( 86 array( 87 'before' => $ts2, 88 'after' => $ts1, 89 'inclusive' => true 90 ) 91 ); 92 } 93 elseif ($date_opt == "3") { 94 $order_args['meta_query'] = array( 95 array( 96 'key' => '_paid_date', 97 'value' => array($ts1, $ts2), 98 'compare' => 'BETWEEN', 99 'type' => 'DATE' 100 ) 101 ); 102 } 86 103 87 $order_args = apply_filters('woocommerce_accounting:export:get_orders_args', $order_args, $date_opt, $order_status, array($ts1, $ts2)); 104 $orders = get_posts($order_args);88 $orders = s($order_args); 105 89 do_action('woocommerce_accounting:export:launch', $orders); 106 107 108 //Collecting datas 109 if (!empty($orders)) { 90 $compiledOrders = array(); 91 92 if(!empty($orders)){ 110 93 //Generic accounts 111 94 $csv_headers = get_option ('woocommerce_accounting_columns_headers'); … … 125 108 $order_shipping_acc_list = get_option ('woocommerce_accounting_shipping_methods_accounting_account'); 126 109 $pdfoptions = get_option('wpo_wcpdf_template_settings'); 127 128 foreach ($orders as $order) { 129 130 if ($date_opt == "0") { 131 $order->piecedate = get_post_field( 'post_date', $order->ID ); 132 } 133 elseif ($date_opt == "1"){ 134 $order->piecedate = get_post_meta($order->ID,'_completed_date',true); 135 } 136 elseif ($date_opt == "3"){ 137 $order->piecedate = get_post_meta($order->ID,'_paid_date',true); 110 } 111 112 foreach ($orders as $wcOrder) 113 { 114 $order = (object) array(); 115 $order->ID = $wcOrder->get_id(); 116 $order->status = $wcOrder->get_status(); 117 $order->date_created = $wcOrder->get_date_created(); 118 $order->date_completed = $wcOrder->get_date_completed(); 119 $order->date_paid = $wcOrder->get_date_paid(); 120 121 if ($date_opt == "0") { 122 $order->piecedate = $order->date_created; 123 } 124 elseif ($date_opt == "1"){ 125 $order->piecedate = $order->date_completed; 126 } 127 elseif ($date_opt == "3"){ 128 $order->piecedate = $order->date_paid; 129 } 130 else { 131 $invoice_date = $wcOrder->get_meta('_wcpdf_invoice_date_formatted', true); 132 if (!empty($invoice_date)) { 133 $order->piecedate = $invoice_date; 138 134 } 139 135 else { 140 $invoice_date = get_post_meta($order->ID,'_wcpdf_invoice_date_formatted',true); 141 if (!empty($invoice_date)) { 142 $order->piecedate = $invoice_date; 143 } 144 else { 145 $order->piecedate = get_post_field( 'post_date', $order->ID ); 146 } 147 } 148 $order->original_date = $order->piecedate; 149 // Test PDF Invoices and Packing slips activated 150 151 if (class_exists('WPO_WCPDF')) { 152 153 $invoice_number_data = get_post_meta($order->ID,'_wcpdf_invoice_number_data'); 154 $invoice_number = get_post_meta($order->ID,'_wcpdf_invoice_number',true); 155 $invoice_date = get_post_meta($order->ID,'_wcpdf_invoice_date',true); 156 157 //Invoice number presence test 158 if ( ( !empty ($invoice_number) ) && ( empty ($invoice_number_data) ) && $factnum_opt == 0 ){ 159 //Creating invoices numbers 160 $prefix = $pdfoptions['invoice_number_formatting_prefix']; 161 $suffix = $pdfoptions['invoice_number_formatting_suffix']; 162 $padding = $pdfoptions['invoice_number_formatting_padding']; 163 164 $order_year = date_i18n( 'Y', strtotime( $order->piecedate ) ); 165 $order_month = date_i18n( 'm', strtotime( $order->piecedate ) ); 166 $order_day = date_i18n( 'd', strtotime( $order->piecedate ) ); 167 $invoice_year = date_i18n( 'Y', $invoice_date ); 168 $invoice_month = date_i18n( 'm', $invoice_date ); 169 $invoice_day = date_i18n( 'd', $invoice_date ); 170 171 $formats['prefix'] = isset($prefix)?$prefix:''; 172 $formats['suffix'] = isset($suffix)?$suffix:''; 173 $formats['padding'] = isset($padding)?$padding:''; 174 175 // Remplacement of invoices dates in invoices numbers 176 foreach ($formats as $key => $value) { 177 $value = str_replace('[order_year]', $order_year, $value); 178 $value = str_replace('[order_month]', $order_month, $value); 179 $value = str_replace('[order_day]', $order_day, $value); 180 $value = str_replace('[invoice_year]', $invoice_year, $value); 181 $value = str_replace('[invoice_month]', $invoice_month, $value); 182 $value = str_replace('[invoice_day]', $invoice_day, $value); 183 $formats[$key] = $value; 184 } 185 186 // Padding 187 if ( ctype_digit( (string)$formats['padding'] ) ) { 188 $invoice_number = sprintf('%0'.$formats['padding'].'d', $invoice_number); 189 } 190 $formatted_invoice_number = $formats['prefix'] . $invoice_number . $formats['suffix'] ; 191 192 //Invoice number OK 193 $order->number = $formatted_invoice_number; 194 } 195 else if ( ( !empty ($invoice_number) ) && $factnum_opt == 0 ){ 196 $order->number = $invoice_number; 197 } 198 else { 199 $order->number = $order->ID; 200 } 201 202 //Invoice number not OK (order number) 203 136 $order->piecedate = $wcOrder->get_date_created(); 137 } 138 } 139 $order->original_date = $order->piecedate; 140 141 $meta_order_tax = (float) $wcOrder->get_total_tax(); 142 $meta_order_shipping_tax = (float) intval($wcOrder->get_shipping_tax()); 143 144 $order->outcome = round($wcOrder->get_total(), $rounding_precision); 145 $order->income_tax = round($meta_order_tax > $small_number ? $meta_order_tax : 0, $rounding_precision) + round($meta_order_shipping_tax > $small_number ? $meta_order_shipping_tax : 0, $rounding_precision); 146 $order->income_fdpht = round($wcOrder->get_total_shipping(), $rounding_precision); 147 $order->income_prodht = ( ($order->outcome) - ( ($order->income_tax) + ($order->income_fdpht) ) ); 148 //WC pre 2.3 bug on coupons correcting to match legal statements 149 150 $order->order_discount = (int) $wcOrder->get_total_discount(); 151 152 $order->gatewayid = $wcOrder->get_payment_method(); 153 154 if (isset($wcOrder->bypass)) 155 { 156 $order->bypass = $wcOrder->bypass; 157 } 158 159 $order->number = $order->ID; 160 161 //Customers exports options 162 $order->account_cust = ''; 163 if ($cust_opt == "0") { 164 $order->account_cust = $gen_account_cust; 165 } 166 167 // Get the country only in label if prod by country 168 if ($prod_opt == "2") { 169 $country_label = get_post_meta($order->ID,'_shipping_country',true); 170 } 171 else { 172 $country_label = ""; 173 } 174 //Payment gateway indication in label 175 if ($pay_opt == "1") { 176 $pay_meth = substr(get_post_meta($order->ID,'_payment_method',true),0,1) . substr(get_post_meta($order->ID,'_payment_method',true), 3, 1) . substr(get_post_meta($order->ID,'_payment_method',true),-1) ; 177 $order->lib = remove_accents (strtoupper($pay_meth) . ' ' . get_option ('woocommerce_accounting_lib_prefix') . ' ' . strtoupper(get_post_meta($order->ID,'_billing_company',true)) . ' ' . ucfirst(get_post_meta($order->ID,'_billing_last_name',true)) . ' ' . ucfirst(get_post_meta($order->ID,'_billing_first_name',true)) . ' ' . $country_label); 178 $order->lib = trim($order->lib); 179 } 180 elseif ($pay_opt == "2") { 181 $order_pay_meth = get_post_meta($order->ID,'_payment_method',true); 182 if (!empty (get_option('woocommerce_accounting_gateways_libs')[$order_pay_meth]['lib'])) { 183 $listed_pay_lib = get_option('woocommerce_accounting_gateways_libs')[$order_pay_meth]['lib']; 184 $pay_meth = $listed_pay_lib; 204 185 } 205 186 else { 206 $order->number = $order->ID;207 }208 209 //Customers exports options210 $order->account_cust = '';211 if ($cust_opt =="0") {212 $order->account_cust = $gen_account_cust;213 }214 elseif ($cust_opt =="1"){215 $order->gatewayid = get_post_meta($order->ID,'_payment_method',true);216 if (!empty($order->gatewayid)) {217 $order->gatewayid = get_post_meta($order->ID,'_payment_method',true);218 $order_country_acc = get_option('woocommerce_accounting_gateways_libs');219 $order->account_cust = (is_array($order_country_acc) && isset($order_country_acc[$order->gatewayid])) ? $order_country_acc[$order->gatewayid]['acc'] : '';220 }221 }222 223 224 // Get the country only in label if prod by country225 if ($prod_opt == "2") {226 $country_label = get_post_meta($order->ID,'_shipping_country',true);227 }228 else {229 $country_label = "";230 }231 //Payment gateway indication in label232 if ($pay_opt == "1") {233 187 $pay_meth = substr(get_post_meta($order->ID,'_payment_method',true),0,1) . substr(get_post_meta($order->ID,'_payment_method',true), 3, 1) . substr(get_post_meta($order->ID,'_payment_method',true),-1) ; 234 $order->lib = remove_accents (strtoupper($pay_meth) . ' ' . get_option ('woocommerce_accounting_lib_prefix') . ' ' . strtoupper(get_post_meta($order->ID,'_billing_company',true)) . ' ' . ucfirst(get_post_meta($order->ID,'_billing_last_name',true)) . ' ' . ucfirst(get_post_meta($order->ID,'_billing_first_name',true)) . ' ' . $country_label); 235 $order->lib = trim($order->lib); 236 } 237 elseif ($pay_opt == "2") { 238 $order_pay_meth = get_post_meta($order->ID,'_payment_method',true); 239 if (!empty (get_option('woocommerce_accounting_gateways_libs')[$order_pay_meth]['lib'])) { 240 $listed_pay_lib = get_option('woocommerce_accounting_gateways_libs')[$order_pay_meth]['lib']; 241 $pay_meth = $listed_pay_lib; 242 } 243 else { 244 $pay_meth = substr(get_post_meta($order->ID,'_payment_method',true),0,1) . substr(get_post_meta($order->ID,'_payment_method',true), 3, 1) . substr(get_post_meta($order->ID,'_payment_method',true),-1) ; 245 }; 246 $order->lib = remove_accents (strtoupper($pay_meth) . ' ' . get_option ('woocommerce_accounting_lib_prefix') . ' ' . strtoupper(get_post_meta($order->ID,'_billing_company',true)) . ' ' . ucfirst(get_post_meta($order->ID,'_billing_last_name',true)) . ' ' . ucfirst(get_post_meta($order->ID,'_billing_first_name',true)) . ' ' . $country_label); 247 $order->lib = trim($order->lib); 248 } 249 else { 250 $order->lib = remove_accents (get_option ('woocommerce_accounting_lib_prefix') . ' ' . strtoupper(get_post_meta($order->ID,'_billing_company',true)) . ' ' . ucfirst(get_post_meta($order->ID,'_billing_last_name',true)) . ' ' . ucfirst(get_post_meta($order->ID,'_billing_first_name',true)) . ' ' . $country_label); 251 $order->lib = trim($order->lib); 252 } 253 254 if ( $factnum_opt == 1 ){ 255 256 if ( (!empty ($invoice_number) ) && ( empty ($invoice_number_data) ) ) { 257 //Creating invoices numbers 258 $prefix = $pdfoptions['invoice_number_formatting_prefix']; 259 $suffix = $pdfoptions['invoice_number_formatting_suffix']; 260 $padding = $pdfoptions['invoice_number_formatting_padding']; 261 262 $order_year = date_i18n( 'Y', strtotime( $order->piecedate ) ); 263 $order_month = date_i18n( 'm', strtotime( $order->piecedate ) ); 264 $order_day = date_i18n( 'd', strtotime( $order->piecedate ) ); 265 $invoice_year = date_i18n( 'Y', strtotime( $invoice_date ) ); 266 $invoice_month = date_i18n( 'm', strtotime( $invoice_date ) ); 267 $invoice_day = date_i18n( 'd', strtotime( $invoice_date ) ); 268 269 270 $formats['prefix'] = isset($prefix)?$prefix:''; 271 $formats['suffix'] = isset($suffix)?$suffix:''; 272 $formats['padding'] = isset($padding)?$padding:''; 273 274 // Invoices dates replacements in invoices 275 foreach ($formats as $key => $value) { 276 $value = str_replace('[order_year]', $order_year, $value); 277 $value = str_replace('[order_month]', $order_month, $value); 278 $value = str_replace('[order_day]', $order_day, $value); 279 $value = str_replace('[invoice_year]', $invoice_year, $value); 280 $value = str_replace('[invoice_month]', $invoice_month, $value); 281 $value = str_replace('[invoice_day]', $invoice_day, $value); 282 $formats[$key] = $value; 283 } 284 285 // Padding 286 if ( ctype_digit( (string)$formats['padding'] ) && $formats['padding'] > 3 ) { 287 $invoice_number = sprintf('%0'.$formats['padding'].'d', $invoice_number); 288 } 289 $formatted_invoice_number = $formats['prefix'] . $invoice_number . $formats['suffix'] ; 290 } 291 elseif ( !empty ($invoice_number) ) { 292 $formatted_invoice_number = $invoice_number; 293 } 294 295 if (isset($formatted_invoice_number)){ 296 $order->lib = $formatted_invoice_number . ' ' . $order->lib; 297 } 298 299 } 300 301 302 //Date Format 303 $order->piecedate = woocommerce_accounting_date_format($order->piecedate, $date_format_opt); 304 $order->date_format_opt = $date_format_opt; 305 306 $meta_order_tax = (float) get_post_meta($order->ID, '_order_tax', true, 0); 307 $meta_order_shipping_tax = (float) get_post_meta($order->ID, '_order_shipping_tax', true, 0); 308 309 $order->outcome = round(get_post_meta($order->ID,'_order_total',true), $rounding_precision); 310 $order->income_tax = round($meta_order_tax > $small_number ? $meta_order_tax : 0, $rounding_precision) + round($meta_order_shipping_tax > $small_number ? $meta_order_shipping_tax : 0, $rounding_precision); 311 $order->income_fdpht = round(get_post_meta($order->ID, '_order_shipping',true), $rounding_precision); 312 $order->income_prodht = ( ($order->outcome) - ( ($order->income_tax) + ($order->income_fdpht) ) ); 313 //WC pre 2.3 bug on coupons correcting to match legal statements 314 315 $order->order_discount = (int) get_post_meta($order->ID, '_order_discount',true); 316 317 if ($order->order_discount > 0) { 318 $order->order_ex_discount = $order->order_discount + $order->outcome; 319 320 //Calculating 321 $order->prodht_exdisc = $order->order_ex_discount - $order->income_tax - $order->income_fdpht ; 322 //Shipment 323 $quotient_fdp = $order->income_fdpht / $order->order_ex_discount; 324 //Products 325 $quotient_prod = $order->prodht_exdisc / $order->order_ex_discount; 326 //Taxes 327 $quotient_tax = $order->income_tax / $order->order_ex_discount; 328 //Recalculate the right amounts 329 //Products 330 $order->income_prodht = $order->outcome * $quotient_prod ; 331 //Shipment 332 $order->income_fdpht = $order->outcome * $quotient_fdp ; 333 //Taxes 334 $order->income_tax = $order->outcome * $quotient_tax; 335 } 336 337 do_action_ref_array('woocommerce_accounting:export:order_values', array(&$order)); 338 } // End foreach 339 188 }; 189 $order->lib = remove_accents (strtoupper($pay_meth) . ' ' . get_option ('woocommerce_accounting_lib_prefix') . ' ' . strtoupper(get_post_meta($order->ID,'_billing_company',true)) . ' ' . ucfirst(get_post_meta($order->ID,'_billing_last_name',true)) . ' ' . ucfirst(get_post_meta($order->ID,'_billing_first_name',true)) . ' ' . $country_label); 190 $order->lib = trim($order->lib); 191 } 192 else { 193 $order->lib = remove_accents (get_option ('woocommerce_accounting_lib_prefix') . ' ' . strtoupper(get_post_meta($order->ID,'_billing_company',true)) . ' ' . ucfirst(get_post_meta($order->ID,'_billing_last_name',true)) . ' ' . ucfirst(get_post_meta($order->ID,'_billing_first_name',true)) . ' ' . $country_label); 194 $order->lib = trim($order->lib); 195 } 196 197 if ( $factnum_opt == 1 ){ 198 199 if ( (!empty ($invoice_number) ) && ( empty ($invoice_number_data) ) ) { 200 //Creating invoices numbers 201 $prefix = $pdfoptions['invoice_number_formatting_prefix']; 202 $suffix = $pdfoptions['invoice_number_formatting_suffix']; 203 $padding = $pdfoptions['invoice_number_formatting_padding']; 204 205 $order_year = date_i18n( 'Y', strtotime( $order->piecedate ) ); 206 $order_month = date_i18n( 'm', strtotime( $order->piecedate ) ); 207 $order_day = date_i18n( 'd', strtotime( $order->piecedate ) ); 208 $invoice_year = date_i18n( 'Y', strtotime( $invoice_date ) ); 209 $invoice_month = date_i18n( 'm', strtotime( $invoice_date ) ); 210 $invoice_day = date_i18n( 'd', strtotime( $invoice_date ) ); 211 212 213 $formats['prefix'] = isset($prefix)?$prefix:''; 214 $formats['suffix'] = isset($suffix)?$suffix:''; 215 $formats['padding'] = isset($padding)?$padding:''; 216 217 // Invoices dates replacements in invoices 218 foreach ($formats as $key => $value) { 219 $value = str_replace('[order_year]', $order_year, $value); 220 $value = str_replace('[order_month]', $order_month, $value); 221 $value = str_replace('[order_day]', $order_day, $value); 222 $value = str_replace('[invoice_year]', $invoice_year, $value); 223 $value = str_replace('[invoice_month]', $invoice_month, $value); 224 $value = str_replace('[invoice_day]', $invoice_day, $value); 225 $formats[$key] = $value; 226 } 227 228 // Padding 229 if ( ctype_digit( (string)$formats['padding'] ) && $formats['padding'] > 3 ) { 230 $invoice_number = sprintf('%0'.$formats['padding'].'d', $invoice_number); 231 } 232 $formatted_invoice_number = $formats['prefix'] . $invoice_number . $formats['suffix'] ; 233 } 234 elseif ( !empty ($invoice_number) ) { 235 $formatted_invoice_number = $invoice_number; 236 } 237 238 if (isset($formatted_invoice_number)){ 239 $order->lib = $formatted_invoice_number . ' ' . $order->lib; 240 } 241 } 242 243 //Date Format 244 $order->piecedate = woocommerce_accounting_date_format($order->piecedate, $date_format_opt); 245 $order->date_format_opt = $date_format_opt; 246 247 if ($order->order_discount > 0) { 248 $order->order_ex_discount = $order->order_discount + $order->outcome; 249 250 //Calculating 251 $order->prodht_exdisc = $order->order_ex_discount - $order->income_tax - $order->income_fdpht ; 252 //Shipment 253 $quotient_fdp = $order->income_fdpht / $order->order_ex_discount; 254 //Products 255 $quotient_prod = $order->prodht_exdisc / $order->order_ex_discount; 256 //Taxes 257 $quotient_tax = $order->income_tax / $order->order_ex_discount; 258 //Recalculate the right amounts 259 //Products 260 $order->income_prodht = $order->outcome * $quotient_prod ; 261 //Shipment 262 $order->income_fdpht = $order->outcome * $quotient_fdp ; 263 //Taxes 264 $order->income_tax = $order->outcome * $quotient_tax; 265 } 266 267 268 $order = apply_filters('woocommerce_accounting:export:order', $order, $wcOrder); 269 do_action_ref_array('woocommerce_accounting:export:order_values', array(&$order)); 270 271 $compiledOrders[] = $order; 272 } 273 274 //Collecting datas 275 if (!empty($orders)) { 340 276 $output = fopen("php://output",'w') or die ("Can't open php://output"); 341 277 //CSV Headers … … 394 330 do_action_ref_array('woocommerce_accounting:export:after_headline', array(&$output, $col_map, $separator)); 395 331 396 foreach($ orders as $order) {332 foreach($rders as $order) { 397 333 $total_income = 0; 398 334 $total_outcome = 0; … … 413 349 $book_code = $original_book_code; 414 350 } 415 /* *****************************************************************************/416 /* *********************** Ajout des taxes spécifiques **************************/417 /* *****************************************************************************/351 /**/ 352 /**/ 353 /**/ 418 354 419 355 $meta_order_tax = (float) get_post_meta($order->ID,'_order_tax',true, 0); … … 455 391 $tax_line_amount = $order->income_tax; 456 392 } 457 458 /* *****************************************************************************/459 /* ********* Ajout des comptes comptables des méthodes d'expédition ************/460 /* *****************************************************************************/393 394 /**/ 395 /**/ 396 /**/ 461 397 462 398 $order_shipping_methods = $get_order->get_shipping_methods( ); … … 486 422 } 487 423 } 488 489 /******************************************************************************/ 490 /*************** Ajout des comptes comptables par produits. *******************/ 491 /******************************************************************************/ 424 /*-----------------------------------------------------------------------------*/ 425 /*--------------- Ajout des comptes comptables par produits -------------------*/ 426 /*-----------------------------------------------------------------------------*/ 492 427 $bef_tax = get_post_meta($order->ID,'_cart_discount',true); 493 428 if ($prod_opt == "1" && $order->order_discount == 0) { … … 522 457 } 523 458 524 /******************************************************************************/ 525 /****************** Calcul des bons montants si code promo ********************/ 526 /******************************************************************************/ 527 459 /*-----------------------------------------------------------------------------*/ 460 /*------------------ alcul des bons montants si code promo --------------------*/ 461 /*-----------------------------------------------------------------------------*/ 528 462 //On choisit de faire apparaitre les codes promos comme des produits négatifs 529 463 //Appliqué avant taxe (réduction et Code Promo) on raisonne en HT … … 541 475 } 542 476 543 / ******** add exceptionnal income or outcome accounts ************/477 / 544 478 $exptcred_acc = get_option('woocommerce_accounting_generic_exptcred_accounting_account'); 545 479 $exptchar_acc = get_option('woocommerce_accounting_generic_exptchar_accounting_account'); … … 844 778 } 845 779 846 do_action_ref_array('woocommerce_accounting:export:before_close', array(&$output, $ orders, $separator));780 do_action_ref_array('woocommerce_accounting:export:before_close', array(&$output, $rders, $separator)); 847 781 fclose($output) or die("Can't close php://output"); 848 782 exit; -
accounting-for-woocommerce/tags/stable/inc/settings.php
r2943758 r3104457 17 17 /** 18 18 * Add help tab in settings 19 19 20 * @return void 20 21 */ … … 37 38 /** 38 39 * Get default columns 39 * @see `woocommerce_accounting_columns` filter 40 * 41 * @see `woocommerce_accounting_columns`filter 42 * 40 43 * @return array 41 44 */ … … 59 62 /** 60 63 * Get default column mapping 64 61 65 * @see `woocommerce_accounting_default_col_mapping` filter 66 62 67 * @return [type] [description] 63 68 */ … … 68 73 /** 69 74 * Parse column order settings and clean it up. 70 * @param array $color_order 75 * 76 * @param array $color_order 77 * 71 78 * @return array 72 79 */ … … 87 94 * Add Accounting tab to the settings page. 88 95 * 89 * @uses `woocommerce_settings_tabs_array` filter90 96 * @param array $setting_tabs The setting tabs array 97 98 99 91 100 * @return array $setting_tabs The setting tabs array 92 101 */ … … 98 107 /** 99 108 * Returns an array of associated sections/settings 100 * @see `woocommerce_accounting_section_settings` filter 109 * 110 * @see woocommerce_accounting_section_settings` filter 111 * 101 112 * @return array of sections / settings 102 113 */ … … 180 191 /** 181 192 * Displays settings form 182 * @see `woocommerce_accounting_setting_template` filter 193 * 194 * @see woocommerce_accounting_setting_template filter 195 * 183 196 * @return void 184 197 */ … … 197 210 /** 198 211 * Gets current setting(s) 199 * @param string $section 212 * 213 * @param string $section 214 * 200 215 * @return mixed string or array 201 216 */ … … 216 231 /** 217 232 * Register hooks 233 218 234 * @return void 219 235 */ … … 227 243 /** 228 244 * Register settings 245 229 246 * @return void 230 247 */ … … 239 256 /** 240 257 * Recursive sanitization for an array 258 241 259 * @param array|string $array 260 242 261 * @return mixed array|string 243 262 */ -
accounting-for-woocommerce/tags/stable/inc/utils.php
r2943758 r3104457 13 13 /** 14 14 * Format number for export 15 15 16 * @var $number float 17 16 18 * @return string 17 19 */ … … 31 33 /** 32 34 * Unformat number for export 35 33 36 * @var $number float 37 34 38 * @return float 35 39 */ -
accounting-for-woocommerce/tags/stable/readme.txt
r2943758 r3104457 2 2 3 3 Contributors: bastho, leroysabrina, enzomangiante, agencenous 4 Tags: woocommerce, accounting, bookkeeping, vat, export , orders, money, bank4 Tags: woocommerce, accounting, bookkeeping, vat, export 5 5 Requires at least: 5.3 6 6 Requires PHP: 7.4 7 Tested up to: 6. 28 Stable tag: 1.6. 27 Tested up to: 6. 8 Stable tag: 1.6. 9 9 License: GPLv2 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 67 67 At this time, exports have been tested on Cogilog and GnuCash. 68 68 ## Changelog 69 70 71 72 73 74 75 76 77 78 79 80 69 81 70 82 ### 1.6.2 -
accounting-for-woocommerce/tags/stable/views/export-basic.php
r2943758 r3104457 244 244 </table> 245 245 </details> 246 246 247 <?php echo apply_filters('woocommerce_accounting:export_form:pro_features', '<p>'.sprintf(__('More options available with the <a href="%s" target="_blank">pro addon</a>.', 'accounting-for-woocommerce'), 'https://apps.avecnous.eu/produit/woocommerce-accounting/?mtm_campaign=wp-plugin&mtm_kwd=accounting-for-woocommerce').'</p>'); ?> 247 248 <?php do_action('woocommerce_accounting:export_form:before_submit'); ?> -
accounting-for-woocommerce/tags/stable/views/settings-accounting-general.php
r2943758 r3104457 195 195 <ul name="woocommerce_accounting_colorder_col" id="woocommerce_accounting_colorder_col"/> 196 196 <?php foreach ($maps as $key => $map): ?> 197 <li id="<?php e sc_attr_e($key); ?>">197 <li id="<?php e($key); ?>"> 198 198 <span class="ui-icon ui-icon-arrowthick-2-n-s"></span> 199 199 <input type="text" name="woocommerce_accounting_colorder[<?php echo esc_attr($key); ?>]" value="<?php echo esc_attr($map); ?>" class="woocommerce_accounting_colorder"> … … 233 233 } 234 234 </style> 235 235 236 <?php echo apply_filters('woocommerce_accounting:export_form:pro_features', '<p>'.sprintf(__('More options available with the <a href="%s" target="_blank">pro addon</a>.', 'accounting-for-woocommerce'), 'https://apps.avecnous.eu/produit/woocommerce-accounting/?mtm_campaign=wp-plugin&mtm_kwd=accounting-for-woocommerce').'</p>'); ?> -
accounting-for-woocommerce/tags/stable/woocommerce-accounting.php
r2943758 r3104457 6 6 Author: N.O.U.S. Open Useful and Simple 7 7 Author URI: https://apps.avecnous.eu/?mtm_campaign=wp-plugin&mtm_kwd=accounting-for-woocommerce&mtm_medium=dashboard&mtm_source=author 8 Version: 1.6. 28 Version: 1.6. 9 9 */ 10 10 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly … … 55 55 /** 56 56 * Create the admin pages links 57 57 58 * @return void 58 59 */ … … 64 65 /** 65 66 * Enqueue scripts and style 67 66 68 * @return [type] [description] 67 69 */ … … 75 77 /** 76 78 * Displays export page 79 77 80 * @return void 78 81 */ … … 87 90 /** 88 91 * Displays refund export page 92 89 93 * @return void 90 94 */ … … 100 104 * Called at plugin install. 101 105 * Create default options 106 102 107 * @return void 103 108 */ … … 144 149 145 150 /** 146 * Settings link on the plugins page 151 * Settings link on the plugins page 152 * 153 * @param array $plugin_links 147 154 */ 148 155 function woocommerce_accounting_plugin_settings_link( $plugin_links ) { … … 156 163 /** 157 164 * Add settings link in the plugins list 165 166 167 168 169 170 158 171 * @see `woocommerce_accounting:export_form:pro_features` filter 159 * @param array $plugin_meta 160 * @param string $plugin_file 161 * @param array $plugin_data 162 * @param string $status 172 * 163 173 * @return array 164 174 */ … … 175 185 /** 176 186 * [woocommerce_accounting_date_format description] 177 * @param string $date 178 * @param integer $format 187 * 188 * @param string $date 189 * @param integer $format 190 * 179 191 * @return string 180 192 */
Note: See TracChangeset
for help on using the changeset viewer.