Changeset 2586168
- Timestamp:
- 08/20/2021 08:16:25 PM (5 years ago)
- Location:
- wc-yabi/trunk
- Files:
-
- 4 edited
-
content/product.php (modified) (4 diffs)
-
includes/transaction.php (modified) (9 diffs)
-
readme.txt (modified) (2 diffs)
-
wc-yabi.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wc-yabi/trunk/content/product.php
r2469031 r2586168 5 5 } 6 6 7 <?php if( $person['accountid'] == 2): ?>7 <?php if( $person['accountid'] == 'NATURAL' ): ?> 8 8 9 9 .data-commercialname, #identifier-instruction … … 21 21 var accountid = jQuery('#accountid').val(); 22 22 23 if( parseInt( accountid ) == 1)23 if( accountid == 'LEGAL' ) 24 24 { 25 25 jQuery('.data-commercialname').show(500); 26 26 jQuery('#identifier-instruction').show(); 27 27 28 jQuery('#type').val( 31);28 jQuery('#type').val('NIT'); 29 29 } 30 30 else … … 33 33 jQuery('#identifier-instruction').hide(); 34 34 35 jQuery('#type').val( 13);35 jQuery('#type').val('CC'); 36 36 } 37 37 } … … 129 129 </tr> 130 130 131 <tr class="data-commercialname">131 <tr> 132 132 <th><?php echo __('Tax Level Code','yabi-wc'); ?>:</th> 133 133 <td> -
wc-yabi/trunk/includes/transaction.php
r2520098 r2586168 3 3 function yabi_create_commercial( $person ) 4 4 { 5 if( $person['accountid'] == 1 )6 {7 $taxlevelcode = $person['taxlevelcode'];8 $pieces = explode( ',', $taxlevelcode );9 $pieceformat = array();10 foreach( $pieces as $p )11 {12 $tax = trim( $p );13 if( !empty( $tax ) )14 {15 array_push( $pieceformat, '"'. $tax .'"' );16 }17 }18 $taxlevelcode = implode( ',', $pieceformat );19 5 $taxlevelcode = $person['taxlevelcode']; 6 $pieces = explode( ',', $taxlevelcode ); 7 $pieceformat = array(); 8 foreach( $pieces as $p ) 9 { 10 $tax = trim( $p ); 11 if( !empty( $tax ) ) 12 { 13 array_push( $pieceformat, '"'. $tax .'"' ); 14 } 15 } 16 $taxlevelcode = implode( ',', $pieceformat ); 17 18 if( $person['accountid'] == 'LEGAL' ) 19 { 20 20 $taxscheme = ''; 21 21 if( $person['taxscheme'] ) … … 32 32 else 33 33 { 34 $commercial = 'partyTaxRegime:"49"'; 34 $commercial = 'partyTaxScheme:{ 35 taxLevelCode:['. $taxlevelcode .'] 36 }'; 35 37 } 36 38 … … 57 59 } 58 60 59 $invoicetypecode = " 01";60 if( $person['accountid'] == 1)61 { 62 $invoicetypecode = " 02";61 $invoicetypecode = "SALES_INVOICE"; 62 if( $person['accountid'] == 'LEGAL' ) 63 { 64 $invoicetypecode = "SALES_INVOICE"; 63 65 } 64 66 … … 86 88 invoiceAcquirerId:{ 87 89 identifier:"'. $person['identifier'] .'" 88 type: "'. $person['type'] .'"90 type:'. $person['type'] .' 89 91 } 90 92 invoiceConsecutive:"'. $invoiceConsecutive .'" … … 94 96 ] 95 97 paymentMeans:{ 96 id: "1"98 id:IN_CASH 97 99 paymentDueDate:"'. $payment['dueDate'] .'" 98 100 paymentId:"'. $payment['id'] .'" … … 104 106 documentCurrencyId:"COP" 105 107 dueDate:"'. $payment['dueDate'] .'" 106 invoiceOperationCode:"10" 107 invoiceTypeCode:"'. $invoicetypecode .'" 108 invoiceTypeCode:'. $invoicetypecode .' 108 109 issueDateTime:"'. $payment['dateTime'] .'" 109 110 } … … 111 112 id:1 112 113 taxAmount:'. $data_products['total_tax'] .' 113 taxSchemeId: "01"114 taxSchemeId:IVA 114 115 taxSubtotal:['. $tax_subtotal .'] 115 116 }] … … 166 167 baseQuantity:1 167 168 currencyId:"COP" 168 unitCode:" ZZ"169 unitCode:"UnitCode" 169 170 value:'. $basevalue .' 170 171 } 171 172 quantity:'. $item['quantity'] .' 172 173 standardItemId:{ 173 agencyId: ""174 agencyId:OFE_STD 174 175 id:"'. $item['id'] .'" 175 name: "Estándar de Adopción del contribuyente"176 schemaId: "999"176 name:OFE_STD 177 schemaId:OFE_STD 177 178 } 178 179 taxTotals:[{ 179 180 id:1 180 taxSchemeId: "01"181 taxSchemeId:IVA 181 182 taxSubtotal:{ 182 183 percent:'. $item['percent'] .' … … 185 186 } 186 187 }] 187 unit:" ZZ"188 unit:"Unit" 188 189 }'; 189 190 -
wc-yabi/trunk/readme.txt
r2520098 r2586168 4 4 Donate link: https://www.paypal.me/datakun 5 5 Requires at least: 5.5 6 Tested up to: 5. 7.16 Tested up to: 5.8 7 7 Requires PHP: 7.4 8 8 Stable tag: trunk … … 82 82 = 1.1.1 = 83 83 * Timeout was increased as Yabi servers started experiencing service delays 84 = 1.2 = 85 * Update to 1.8 Version of Yabi 86 * Change numeric variables to strings -
wc-yabi/trunk/wc-yabi.php
r2520098 r2586168 9 9 * Plugin URI: https://mireunion.com/yabi 10 10 * Description: Create your electronic invoices of purchases made in woocommerce with Yabi 11 * Version: 1. 1.111 * Version: 1.2 12 12 * Author: Mex Avila 13 13 * Author URI: https://datakun.com/ … … 87 87 $yabi_invoice = get_post_meta( $post->ID, 'yabi_invoice', true ); 88 88 $thetypes = array( 89 13 => 'Cédula de ciudadanía', 90 31 => 'NIT', 91 12 => 'Tarjeta de identidad', 92 21 => 'Tarjeta de extranjería', 93 22 => 'Cédula de extranjería', 94 41 => 'Pasaporte', 95 42 => 'Documento de identificación extranjero', 96 50 => 'NIT de otro país', 97 91 => 'NUIP *' 89 'CC' => 'Cédula de ciudadanía', 90 'NIT' => 'NIT', 91 'TI' => 'Tarjeta de identidad', 92 'TE' => 'Tarjeta de extranjería', 93 'CE' => 'Cédula de extranjería', 94 'P' => 'Pasaporte', 95 'RC' => 'Registro Civil', 96 'DIE' => 'Documento de identificación extranjero', 97 'NITE' => 'Número de Identificación Tributaria Extranjera', 98 'NUIP' => 'Número Único de Identificación Personal' 98 99 ); 99 100 $typesperson = array( 100 1=> 'Persona Jurídica',101 2=> 'Persona Natural'101 'LEGAL' => 'Persona Jurídica', 102 'NATURAL' => 'Persona Natural' 102 103 ); 103 104 $person = get_post_meta( $post->ID, 'yabi_person', true ); … … 121 122 122 123 $identifier = get_post_meta( $post->ID, 'nit', true ); 123 $type = 13;124 $accountid = 2;124 $type = 'CC'; 125 $accountid = 'NATURAL'; 125 126 $commercialname = ''; 126 $taxlevelcode = ' ';127 $taxlevelcode = 'O-48'; 127 128 $taxscheme = 0; 128 129
Note: See TracChangeset
for help on using the changeset viewer.