Changeset 2393793
- Timestamp:
- 10/05/2020 05:50:23 PM (5 years ago)
- Location:
- perseo-software
- Files:
-
- 13 added
- 3 edited
-
tags/11.0 (added)
-
tags/11.0/LICENSE.txt (added)
-
tags/11.0/PluginPerseo.php (added)
-
tags/11.0/PluginPerseoClientes.php (added)
-
tags/11.0/README.md (added)
-
tags/11.0/includes (added)
-
tags/11.0/includes/PluginPerseo_cargador.php (added)
-
tags/11.0/includes/PluginPerseo_cron.php (added)
-
tags/11.0/includes/PluginPerseo_master.php (added)
-
tags/11.0/js (added)
-
tags/11.0/js/PluginPerseo_cedulas.js (added)
-
tags/11.0/js/PluginPerseo_combo.js (added)
-
tags/11.0/uninstall.php (added)
-
trunk/PluginPerseo.php (modified) (8 diffs)
-
trunk/README.md (modified) (1 diff)
-
trunk/includes/PluginPerseo_cron.php (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
perseo-software/trunk/PluginPerseo.php
r2391793 r2393793 4 4 Plugin URI: http://perseo.ec/ 5 5 Description: Este Plugins integra el Sistema Contable Perseo Web y PC con la tienda Woocommerce 6 Version: 1 0.06 Version: 11.0 7 7 Author: Pegasus Soft S.A. - Ecuador 8 8 Author URI: https://perseo.ec … … 472 472 473 473 $perseo_html = "<select class='{$args['class']}' data-custom='{$args['perseo_datopersonalizado']}' name='pluginperseo_parametros[{$args['label_for']}]' > 474 <option value='NO' ".$perseo_refr2." >NO</option> 474 475 <option value='SI' ".$perseo_refr1." >SI</option> 475 <option value='NO' ".$perseo_refr2." >NO</option>476 476 477 </select >"; 477 478 echo $perseo_html; … … 487 488 488 489 $perseo_html = "<select class='{$args['class']}' data-custom='{$args['perseo_datopersonalizado']}' name='pluginperseo_parametros[{$args['label_for']}]' > 490 <option value='NO' ".$perseo_refr2." >NO</option> 489 491 <option value='SI' ".$perseo_refr1." >SI</option> 490 <option value='NO' ".$perseo_refr2." >NO</option>492 491 493 </select >"; 492 494 echo $perseo_html; … … 503 505 504 506 $perseo_html = "<select class='{$args['class']}' data-custom='{$args['perseo_datopersonalizado']}' name='pluginperseo_parametros[{$args['label_for']}]' > 507 <option value='NO' ".$perseo_refr2." >NO</option> 505 508 <option value='SI' ".$perseo_refr1." >SI</option> 506 <option value='NO' ".$perseo_refr2." >NO</option>509 507 510 </select >"; 508 511 echo $perseo_html; … … 518 521 519 522 $perseo_html = "<select class='{$args['class']}' data-custom='{$args['perseo_datopersonalizado']}' name='pluginperseo_parametros[{$args['label_for']}]' > 523 <option value='NO' ".$perseo_refr2." >NO</option> 520 524 <option value='SI' ".$perseo_refr1." >SI</option> 521 <option value='NO' ".$perseo_refr2." >NO</option>525 522 526 </select >"; 523 527 echo $perseo_html; … … 534 538 535 539 $perseo_html = "<select class='{$args['class']}' data-custom='{$args['perseo_datopersonalizado']}' name='pluginperseo_parametros[{$args['label_for']}]' > 540 <option value='NO' ".$perseo_refr2." >NO</option> 536 541 <option value='SI' ".$perseo_refr1." >SI</option> 537 <option value='NO' ".$perseo_refr2." >NO</option>542 538 543 </select >"; 539 544 echo $perseo_html; … … 550 555 551 556 $perseo_html = "<select class='{$args['class']}' data-custom='{$args['perseo_datopersonalizado']}' name='pluginperseo_parametros[{$args['label_for']}]' > 557 <option value='NO' ".$perseo_refr2." >NO</option> 552 558 <option value='SI' ".$perseo_refr1." >SI</option> 553 <option value='NO' ".$perseo_refr2." >NO</option>559 554 560 </select >"; 555 561 echo $perseo_html; … … 588 594 589 595 $perseo_html = "<select class='{$args['class']}' data-custom='{$args['perseo_datopersonalizado']}' name='pluginperseo_parametros[{$args['label_for']}]' > 596 <option value='NO' ".$perseo_refr2." >NO</option> 590 597 <option value='SI' ".$perseo_refr1." >SI</option> 591 <option value='NO' ".$perseo_refr2." >NO</option>598 592 599 </select >"; 593 600 echo $perseo_html; -
perseo-software/trunk/README.md
r2391793 r2393793 49 49 50 50 == Changelog == 51 52 = 11.0 = 53 * Actualizacion . 54 51 55 = 10.0 = 52 56 * Actualizacion . -
perseo-software/trunk/includes/PluginPerseo_cron.php
r2393033 r2393793 468 468 469 469 public function fperseo_producto(){ 470 470 //echo 'Memoria usada: ' . round(memory_get_usage() / 1024,1) . ' KB de ' . round(memory_get_usage(1) / 1024,1) . ' KB'; 471 471 472 472 global $wpdb; … … 519 519 { 520 520 ///variables actualizacion 521 //$ConsultaProductoUpd=""; 522 //$ConsultaProductofecha=""; 523 //$ConsultaProductoUpd=$wpdb->get_var("SELECT meta.post_id FROM {$table_prefix}posts posts, {$table_prefix}postmeta meta where posts.ID=meta.post_id and meta.meta_value='".$producto['productosid']."'"); 524 $ConsultaProductoUpd=$wpdb->get_var("SELECT post_id FROM {$table_prefix}postmeta where meta_key = 'PERSEOID' and meta_value =".$producto['productosid']); 521 $ConsultaProductoUpd=$wpdb->get_var("SELECT post_id FROM {$table_prefix}postmeta where meta_key = 'PERSEOID' and meta_value =".$producto['productosid']); 525 522 526 //echo "<br>"; 527 //var_dump($ConsultaProductoUpd); 528 //echo "<br>"; 529 523 530 524 if(empty($ConsultaProductoUpd)){ 531 525 // echo "PRODUCTO NUEVO"; … … 564 558 ) 565 559 ); 566 ////////////////////////////////////////// 560 /////////////////////////////////////////////////////// 567 561 //Consultamos id ultimo 568 562 $sqlProdID= "SELECT MAX(ID) FROM {$table_prefix}posts "; 569 563 $resProdPerseo = $wpdb->get_var($sqlProdID); 570 564 $idPost=$resProdPerseo; 571 //echo $idPost; 572 //echo '<br>'; 565 /////////////////////////////////////////////////////// 573 566 ///actualizamos 574 567 $wpdb->update($table_prefix.'posts',array( 'guid'=> home_url().'/?post_type=product&p='.$idPost.''), array('ID' => $idPost)); … … 581 574 ///saber si tiene IVA 12 % o 0% 582 575 if ($producto['porcentajeiva']=='12'){ 583 $wpdb->insert($table_prefix.'postmeta', array('post_id'=> $idPost, 'meta_key' => '_tax_status', 'meta_value'=> 'taxable') );576 $wpdb->insert($table_prefix.'postmeta', array('post_id'=> $idPost, 'meta_key' => '_tax_status', 'meta_value'=> 'taxable') ); 584 577 } else { 585 $wpdb->insert($table_prefix.'postmeta', array('post_id'=> $idPost, 'meta_key' => '_tax_status', 'meta_value'=> 'none') );578 $wpdb->insert($table_prefix.'postmeta', array('post_id'=> $idPost, 'meta_key' => '_tax_status', 'meta_value'=> 'none') ); 586 579 }; 587 580 … … 633 626 $wpdb->insert($table_prefix.'postmeta', array('post_id'=> $idPost, 'meta_key' => '_purchase_note', 'meta_value'=> '') ); //nose 634 627 635 /////////////////////////////////////////////////// 628 ////////////////////////////////////////////////////////// 636 629 //insertamos Nuevo producto TERCERA TABLA plugin_term_relationships 637 630 //verificamos q cargo si categoria o linea wp_term_relationships categoriasproductos_consulta … … 659 652 660 653 ///////////////////////////////////////////////////// 661 //Saber el precio seleccionado 654 //Saber el precio seleccionado 662 655 foreach($producto['tarifas'] as $tarifa) 663 { 664 665 //iva 666 $perseo_iva=0; 656 { 657 667 658 //tarifa venta 668 659 $perseo_tarifaventa=0; 669 660 //tarifa aumento 670 $perseo_tarifaaumento=0 ;661 $perseo_tarifaaumento=0 ; 671 662 if (isset($tarifa)) 672 663 { 673 $perseo_iva= ($producto['porcentajeiva']/100)+1;664 //$perseo_iva= ($producto['porcentajeiva']/100)+1; 674 665 675 666 if($perseo_parametros['perseotarifaVenta']==$tarifa['tarifasid']) 676 667 { 677 //$perseo_tarifaventa=round($tarifa['precio'],2) * $perseo_iva;678 668 $perseo_tarifaventa=round($tarifa['precio'],2); 669 $wpdb->insert($table_prefix.'postmeta', array('post_id'=> $idPost, 'meta_key' => '_price', 'meta_value'=> $perseo_tarifaventa )); //nose 670 $wpdb->insert($table_prefix.'postmeta', array('post_id'=> $idPost, 'meta_key' => '_regular_price', 'meta_value'=> $perseo_tarifaventa )); 671 /////////////////////////////////////////////////// 672 //insertamos Nuevo producto CUARTA TABLA plugin_wc_product_meta_lookup 673 $wpdb->update($table_prefix.'wc_product_meta_lookup', 674 array( 675 'product_id' => $idPost, 676 'sku' => '0', 677 'virtual' => '0', 678 'downloadable' => '0', 679 'min_price' => 0, 680 'max_price' => $perseo_tarifaventa, 681 'onsale' => '0', 682 'stock_quantity'=> '', 683 'stock_status' => 'instock', 684 'rating_count' => '0', 685 'average_rating'=> '0.00', 686 'total_sales' => '0', 687 'tax_status' => 'taxable', 688 'tax_class' => '' 689 ) , 690 array('product_id' => $idPost) 691 ); 679 692 }; 680 693 //precio 2 681 694 if($perseo_parametros['perseotarifaAumento']==$tarifa['tarifasid']) 682 { 683 //$perseo_tarifaaumento =round($tarifa['precio'],2)* $perseo_iva; 695 { 684 696 $perseo_tarifaaumento =round($tarifa['precio'],2); 685 } 686 687 $wpdb->insert($table_prefix.'postmeta', array('post_id'=> $idPost, 'meta_key' => '_price', 'meta_value'=> $perseo_tarifaventa )); //nose 688 $wpdb->insert($table_prefix.'postmeta', array('post_id'=> $idPost, 'meta_key' => '_regular_price', 'meta_value'=> $perseo_tarifaventa )); 689 $wpdb->insert($table_prefix.'postmeta', array('post_id'=> $idPost, 'meta_key' => '_sale_price', 'meta_value'=> $perseo_tarifaaumento)); 690 691 692 697 $wpdb->insert($table_prefix.'postmeta', array('post_id'=> $idPost, 'meta_key' => '_sale_price', 'meta_value'=> $perseo_tarifaaumento)); 698 /////////////////////////////////////////////////// 699 //insertamos Nuevo producto CUARTA TABLA plugin_wc_product_meta_lookup 700 $wpdb->update($table_prefix.'wc_product_meta_lookup', 701 array( 702 'product_id' => $idPost, 703 'sku' => '0', 704 'virtual' => '0', 705 'downloadable' => '0', 706 'min_price' => $perseo_tarifaaumento, 707 'max_price' => 0, 708 'onsale' => '0', 709 'stock_quantity'=> '', 710 'stock_status' => 'instock', 711 'rating_count' => '0', 712 'average_rating'=> '0.00', 713 'total_sales' => '0', 714 'tax_status' => 'taxable', 715 'tax_class' => '' 716 ) , 717 array('product_id' => $idPost) 718 ); 719 720 } 693 721 }; 694 722 } 695 ///////////////////////////////////////////////////696 //insertamos Nuevo producto CUARTA TABLA plugin_wc_product_meta_lookup697 $wpdb->insert($table_prefix.'wc_product_meta_lookup',698 array(699 'product_id' => $idPost,700 'sku' => '0',701 'virtual' => '0',702 'downloadable' => '0',703 'min_price' => $perseo_tarifaaumento,704 'max_price' => $perseo_tarifaventa,705 'onsale' => '0',706 'stock_quantity'=> '',707 'stock_status' => 'instock',708 'rating_count' => '0',709 'average_rating'=> '0.00',710 'total_sales' => '0',711 'tax_status' => 'taxable',712 'tax_class' => ''713 )714 );715 723 724 716 725 717 726 /////////////////////////////////////////////////// … … 839 848 840 849 /////////////////////////////////////////// 841 //selecciona la imagen del producto850 //selecciona la primera imagen q sera visible en el producto 842 851 if ($imagen["primera"]==1){ 843 852 $perseo_resima = $wpdb->get_var($perseo_sqlima); … … 851 860 //// imagen padre 852 861 $perseo_nuevaima = $wpdb->get_var($perseo_sqlima); 862 853 863 if ($imagen["primera"]==0){ 854 864 $perseo_sumar= $perseo_sumar.$perseo_nuevaima.','; … … 897 907 //echo "PRODUCTO MODIFICADO"; 898 908 //echo "<br>"; 899 // echo $ConsultaProductoUpd;900 // echo "<br>";901 // echo '<br>';902 //echo $ConsultaProductoUpd;903 //echo '<br>';904 // echo date_format(date_create($producto['fechamodificacion']),'Y-m-d H:i:s').' > '.$ConsultaProductofecha;905 //echo '<br>';906 // $perseo_tabla = $wpdb->prefix.'_posts';907 909 $perseo_actualizar = array( 908 910 'post_content' => $producto['fichatecnica'], … … 913 915 ); 914 916 915 //var_dump( $perseo_actualizar);916 //echo "<br>";917 //echo "<br>";918 917 919 918 $wpdb->update($table_prefix.'posts', $perseo_actualizar, array('ID' => $ConsultaProductoUpd)); 920 919 921 920 update_post_meta($ConsultaProductoUpd, '_stock', $producto['existenciastotales']); 922 921 922 //////////////////////////////////////////////////// 923 //Eliminamos impuestos 924 $wpdb->query("Delete from {$table_prefix}postmeta where meta_key = '_tax_status' and post_id=".$ConsultaProductoUpd); 925 ///////////////////////////////////////// 926 ///saber si tiene IVA 12 % o 0% 927 if ($producto['porcentajeiva']=='12'){ 928 $wpdb->insert($table_prefix.'postmeta', array('post_id'=> $ConsultaProductoUpd, 'meta_key' => '_tax_status', 'meta_value'=> 'taxable') ); 929 } else { 930 $wpdb->insert($table_prefix.'postmeta', array('post_id'=> $ConsultaProductoUpd, 'meta_key' => '_tax_status', 'meta_value'=> 'none') ); 931 }; 932 923 933 /////////////////////////////////////////////////// 924 934 //insertamos Nuevo producto TERCERA TABLA plugin_term_relationships … … 935 945 }; 936 946 937 // echo '<br>';938 // echo $resProdCat;939 // echo '<br>';940 // echo $ConsultaProductoUpd;941 //echo '<br>';942 947 943 948 $wpdb->query("Delete from {$table_prefix}term_relationships where object_id=".$ConsultaProductoUpd); … … 947 952 948 953 ///////////////////////////////////////////////////// 949 //Saber el precio seleccionado 950 //iva 951 $perseo_iva=0; 952 //tarifa venta 954 //Saber el precio seleccionado 955 956 foreach($producto['tarifas'] as $tarifa) 957 { 958 //tarifa venta 953 959 $perseo_tarifaventa=0; 954 960 //tarifa aumento 955 $perseo_tarifaaumento=0 ; 956 foreach($producto['tarifas'] as $tarifa) 957 { 958 961 $perseo_tarifaaumento=0; 962 959 963 if (isset($tarifa)) 960 964 { 961 $perseo_iva= ($producto['porcentajeiva']/100)+1;965 //$perseo_iva= ($producto['porcentajeiva']/100)+1; 962 966 963 967 if($perseo_parametros['perseotarifaVenta']==$tarifa['tarifasid']) 964 { 965 //$perseo_tarifaventa=round($tarifa['precio'],2) * $perseo_iva; 968 { 966 969 $perseo_tarifaventa=round($tarifa['precio'],2); 970 update_post_meta($ConsultaProductoUpd, '_price', $perseo_tarifaventa); 971 update_post_meta($ConsultaProductoUpd, '_regular_price', $perseo_tarifaventa ); 972 973 /////////////////////////////////////////////////// 974 //insertamos Nuevo producto CUARTA TABLA plugin_wc_product_meta_lookup 975 $wpdb->update($table_prefix.'wc_product_meta_lookup', 976 array( 977 'max_price' => $perseo_tarifaventa 978 ), 979 array('product_id' => $ConsultaProductoUpd) 980 ); 981 967 982 }; 968 983 //precio 2 969 984 if($perseo_parametros['perseotarifaAumento']==$tarifa['tarifasid']) 970 { 971 //$perseo_tarifaaumento =round($tarifa['precio'],2)* $perseo_iva; 985 { 972 986 $perseo_tarifaaumento =round($tarifa['precio'],2); 973 } 974 // var_dump($tarifa); 975 // echo '<br>'.$ConsultaProductoUpd; 976 977 update_post_meta($ConsultaProductoUpd, '_price', $perseo_tarifaventa); 978 update_post_meta($ConsultaProductoUpd, '_regular_price', $perseo_tarifaventa ); 979 update_post_meta($ConsultaProductoUpd, '_sale_price', $perseo_tarifaaumento); 987 update_post_meta($ConsultaProductoUpd, '_sale_price', $perseo_tarifaaumento); 988 989 /////////////////////////////////////////////////// 990 //insertamos Nuevo producto CUARTA TABLA plugin_wc_product_meta_lookup 991 $wpdb->update($table_prefix.'wc_product_meta_lookup', 992 array( 993 'min_price' => $perseo_tarifaaumento 994 ), 995 array('product_id' => $ConsultaProductoUpd) 996 ); 997 998 } 980 999 }; 981 1000 } … … 983 1002 984 1003 985 /////////////////////////////////////////////////// 986 //insertamos Nuevo producto CUARTA TABLA plugin_wc_product_meta_lookup 987 $wpdb->update($table_prefix.'wc_product_meta_lookup', 988 array( 989 'min_price' => $perseo_tarifaaumento, 990 'max_price' => $perseo_tarifaventa 991 ), 992 array('product_id' => $ConsultaProductoUpd) 993 ); 1004 994 1005 995 1006 ///////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.