Changeset 3121708
- Timestamp:
- 07/18/2024 07:39:30 PM (21 months ago)
- Location:
- wc-yabi/trunk
- Files:
-
- 7 added
- 15 edited
-
.gitignore (added)
-
content/admin.php (modified) (1 diff)
-
content/information.php (modified) (3 diffs)
-
content/product-invoice.php (modified) (5 diffs)
-
content/product.php (modified) (12 diffs)
-
content/settings.php (modified) (6 diffs)
-
includes/ajax.php (modified) (1 diff)
-
includes/dian.php (modified) (1 diff)
-
includes/transaction.php (modified) (10 diffs)
-
includes/woo.php (added)
-
languages/yabi-wc-es_CO.l10n.php (added)
-
languages/yabi-wc-es_CO.mo (modified) (previous)
-
languages/yabi-wc-es_CO.po (modified) (16 diffs)
-
languages/yabi-wc-es_ES.l10n.php (added)
-
languages/yabi-wc-es_ES.mo (modified) (previous)
-
languages/yabi-wc-es_ES.po (modified) (15 diffs)
-
languages/yabi-wc.pot (modified) (13 diffs)
-
readme.txt (modified) (1 diff)
-
scripts (added)
-
scripts/checkout.min.css (added)
-
scripts/checkout.min.js (added)
-
wc-yabi.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wc-yabi/trunk/content/admin.php
r2469031 r3121708 21 21 22 22 <div class="tab-content"> 23 <?php switch( $tab) :23 <?php switch( $tab ) : 24 24 case 'settings': 25 25 require_once( YABI_PLUGIN_PATH . 'content/settings.php' ); 26 break;27 case 'tools':28 require_once( YABI_PLUGIN_PATH . 'content/tools.php' );29 26 break; 30 27 default: -
wc-yabi/trunk/content/information.php
r2469031 r3121708 14 14 15 15 <div class="postbox"> 16 17 <h2><span><?php echo __('Instructions for settings','yabi-wc'); ?></span></h2> 18 19 <div class="inside"> 20 21 <p><?php echo __('Invoices can be defined in Cash or In Credit','yabi-wc'); ?></p> 22 23 <ul> 24 <li><?php echo __('Cash: The payment is made immediately.','yabi-wc'); ?></li> 25 <li><?php echo __('In Credit: The payment is credited and you can select the number of days of the credit, generally it is 30 days','yabi-wc'); ?></li> 26 </ul> 27 28 <p><?php echo __('I agree to modify the checkout','yabi-wc'); ?></p> 29 30 <ul> 31 <li><?php echo __('This option allows you to modify the default Woocommerce form to allow the custom fields that Yabi uses, such as IDs or NIT. It also displays the departments and municipalities of Colombia with their respective DIAN codes. It also generates a link so that people can generate the address as necessary for the DIAN.','yabi-wc'); ?></li> 32 </ul> 33 34 <p><?php echo __('Invoice type','yabi-wc'); ?></p> 35 36 <ul> 37 <li><?php echo __('Automatic: Generates automatic invoices, this depends on whether the data has been filled out correctly.','yabi-wc'); ?></li> 38 <li><?php echo __('Manual: Generate invoices manually in order administration','yabi-wc'); ?></li> 39 </ul> 40 41 </div> 42 43 <p> </p> 44 <hr/> 45 <p> </p> 16 46 17 47 <h2><span><?php echo __('Instructions for invoice','yabi-wc'); ?></span></h2> … … 64 94 <div class="inside"> 65 95 66 <p><?php echo __('The process to generate an invoice is not automatic, it is a manual process in which the following steps must be carried out.','yabi-wc'); ?></p>96 <p><?php echo __('The process to generate an invoice.','yabi-wc'); ?></p> 67 97 68 <p><?php echo __('The WooCommerce purchase must be in a completed state, in order to generate the electronic invoice. ','yabi-wc'); ?></p>98 <p><?php echo __('The WooCommerce purchase must be in a completed state, in order to generate the electronic invoice. (Automatic or Manual)','yabi-wc'); ?></p> 69 99 70 100 <ol> … … 75 105 <li><?php echo __('You must select the type of person','yabi-wc'); ?></li> 76 106 <li><?php echo __('Depending on the type of person, you must complete the additional information','yabi-wc'); ?></li> 77 <li><?php echo __('All fields are required except for the note','yabi-wc'); ?></li>78 107 <li><?php echo __('Click on the "Save" button to save the information of the fields','yabi-wc'); ?></li> 79 108 <li><?php echo __('Click on the button "Save and generate" for when you are sure to generate the invoice, after the invoice is generated you will not be able to edit the fields again.','yabi-wc'); ?></li> -
wc-yabi/trunk/content/product-invoice.php
r2630794 r3121708 8 8 <table width="100%" border="0" cellpadding="5" cellspacing="5" id="yabi-data"> 9 9 10 <table width="100%" border="0" cellpadding="5" cellspacing="5" id="yabi-data"> 10 <?php if( 'LEGAL_ENTITY' == $person[ 'type_person' ] ): ?> 11 12 <tr> 13 <th><?php echo __( 'Commercial Name','yabi-wc' ); ?></th> 14 <td> 15 <?php echo esc_attr( $person[ 'commercialname' ] ); ?> 16 </td> 17 </tr> 18 19 <?php endif; ?> 11 20 12 <tr>21 <tr> 13 22 <th><?php echo __('Name','yabi-wc'); ?></th> 14 23 <td> 15 <?php echo esc_attr( $person[ 'name'] ); ?>24 <?php echo esc_attr( $person[ 'name' ] ); ?> 16 25 </td> 17 26 </tr> 27 28 <?php if( !empty( $person[ 'second_name' ] ) ): ?> 29 30 <tr> 31 <th><?php echo __( 'Second Name','yabi-wc' ); ?></th> 32 <td> 33 <?php echo esc_attr( $person[ 'second_name' ] ); ?> 34 </td> 35 </tr> 36 37 <?php endif; ?> 18 38 19 39 <tr> 20 40 <th><?php echo __('Last Name','yabi-wc'); ?></th> 21 41 <td> 22 <?php echo esc_attr( $person[ 'lastname'] ); ?>42 <?php echo esc_attr( $person[ 'lastname' ] ); ?> 23 43 </td> 24 44 </tr> 25 45 46 <?php if( !empty( $person[ 'second_last_name' ] ) ): ?> 47 48 <tr> 49 <th><?php echo __( 'Second Last Name','yabi-wc' ); ?></th> 50 <td> 51 <?php echo esc_attr( $person[ 'second_last_name' ] ); ?> 52 </td> 53 </tr> 54 55 <?php endif; ?> 56 26 57 <tr> 27 <th><?php echo __( 'Type of document','yabi-wc'); ?></th>28 <td><?php echo esc_attr( $ thetypes[ $person['type']] ); ?></td>58 <th><?php echo __( 'Type of document','yabi-wc' ); ?></th> 59 <td><?php echo esc_attr( $person[ 'type_document' ] ); ?></td> 29 60 </tr> 30 61 31 62 <tr> 32 <th><?php echo __( 'Identifier','yabi-wc'); ?></th>63 <th><?php echo __( 'Identifier','yabi-wc' ); ?></th> 33 64 <td> 34 <?php echo esc_attr( $person[ 'identifier'] ); ?>65 <?php echo esc_attr( $person[ 'identifier' ] ); ?><?php if( 'LEGAL_ENTITY' == $person[ 'type_person' ] ): ?>-<?php echo esc_attr( $person[ 'identifier_digit' ] ); ?><?php endif; ?> 35 66 </td> 36 67 </tr> … … 39 70 <th><?php echo __('Email','yabi-wc'); ?></th> 40 71 <td> 41 <?php echo esc_attr( $person[ 'email'] ); ?>72 <?php echo esc_attr( $person[ 'email' ] ); ?> 42 73 </td> 43 74 </tr> … … 46 77 <th><?php echo __('Telephone','yabi-wc'); ?></th> 47 78 <td> 48 <?php echo esc_attr( $person[ 'telephone'] ); ?>79 <?php echo esc_attr( $person[ 'telephone' ] ); ?> 49 80 </td> 50 81 </tr> … … 53 84 <th><?php echo __('Address','yabi-wc'); ?></th> 54 85 <td> 55 <?php echo esc_attr( $person[ 'address'] ); ?>86 <?php echo esc_attr( $person[ 'address' ] ); ?>, <?php echo esc_attr( yabi_generate_values( $person[ 'city' ] ) ); ?>, <?php echo esc_attr( $person[ 'citycode' ] ); ?> 56 87 </td> 57 88 </tr> 58 89 59 <tr> 60 <th><?php echo __('City Code','yabi-wc'); ?></th> 61 <td> 62 <?php echo esc_attr( $person['citycode'] ); ?> 63 </td> 64 </tr> 90 <?php if( !empty( $person[ 'observations' ] ) ): ?> 65 91 66 92 <tr> 67 93 <th><?php echo __('Observations','yabi-wc'); ?></th> 68 94 <td> 69 <?php echo esc_attr( $person[ 'observations'] ); ?>95 <?php echo esc_attr( $person[ 'observations' ] ); ?> 70 96 </td> 71 97 </tr> 98 99 <?php endif; ?> 100 101 <?php if( !empty( $person[ 'note_name' ] ) ): ?> 72 102 73 103 <tr> 74 104 <th><?php echo __('Note Name','yabi-wc'); ?></th> 75 105 <td> 76 <?php echo esc_attr( $person[ 'note_name'] ); ?>106 <?php echo esc_attr( $person[ 'note_name' ] ); ?> 77 107 </td> 78 108 </tr> 109 110 <?php endif; ?> 111 112 <?php if( !empty( $person[ 'note_value' ] ) ): ?> 79 113 80 114 <tr> 81 115 <th><?php echo __('Note Description','yabi-wc'); ?></th> 82 116 <td> 83 <?php echo esc_attr( $person[ 'note_value'] ); ?>117 <?php echo esc_attr( $person[ 'note_value' ] ); ?> 84 118 </td> 85 119 </tr> 120 121 <?php endif; ?> 86 122 87 123 <tr> 88 124 <th><?php echo __('Invoice Number','yabi-wc'); ?></th> 89 125 <td> 90 <?php echo esc_attr( $yabi_invoice[ 'number'] ); ?>126 <?php echo esc_attr( $yabi_invoice[ 'number' ] ); ?> 91 127 </td> 92 128 </tr> … … 95 131 <th><?php echo __('Invoice Serial','yabi-wc'); ?></th> 96 132 <td> 97 <?php echo esc_attr( $yabi_invoice[ 'serial'] ); ?>133 <?php echo esc_attr( $yabi_invoice[ 'serial' ] ); ?> 98 134 </td> 99 135 </tr> 100 136 101 137 </table> 102 103 </table> -
wc-yabi/trunk/content/product.php
r2630794 r3121708 1 <?php global $post; ?> 1 2 <style> 2 3 #yabi-data th … … 5 6 } 6 7 7 <?php if( $person[ 'accountid'] == 'NATURAL' ): ?>8 <?php if( $person[ 'accountid' ] == 'NATURAL' ): ?> 8 9 9 10 .data-commercialname, #identifier-instruction … … 19 20 function yabiCommercial() 20 21 { 21 var accountid = jQuery('#accountid').val(); 22 23 if( accountid == 'LEGAL' ) 24 { 25 jQuery('.data-commercialname').show(500); 26 jQuery('#identifier-instruction').show(); 27 28 jQuery('#type').val('NIT'); 22 var type_person = jQuery( '#type_person' ).val(); 23 24 if( type_person == 'LEGAL_ENTITY' ) 25 { 26 jQuery( '.data-commercialname' ).show( 500 ); 27 jQuery( '#identifier_digit' ).show(); 29 28 } 30 29 else 31 30 { 32 jQuery('.data-commercialname').hide(); 33 jQuery('#identifier-instruction').hide(); 34 35 jQuery('#type').val('CC'); 31 jQuery( '.data-commercialname' ).hide(); 32 jQuery( '#identifier_digit' ).hide(); 36 33 } 37 34 } … … 39 36 function yabiMessage( type, message, show ) 40 37 { 41 jQuery( '#thespiner').removeClass('is-active');42 jQuery( '#response').html('<div class="notice notice-'+ type +' inline"><p>'+ message +'</p></div>');38 jQuery( '#thespiner' ).removeClass( 'is-active' ); 39 jQuery( '#response' ).html( '<div class="notice notice-'+ type +' inline"><p>'+ message +'</p></div>' ); 43 40 44 41 if( show ) 45 42 { 46 jQuery( '#button-yabi-1').attr('disabled', false);47 jQuery( '#button-yabi-2').attr('disabled', false);43 jQuery( '#button-yabi-1' ).attr( 'disabled', false ); 44 jQuery( '#button-yabi-2' ).attr( 'disabled', false ); 48 45 } 49 46 } … … 51 48 function yabiSave( option ) 52 49 { 53 jQuery( '#thespiner').addClass('is-active');54 jQuery( '#button-yabi-1').attr('disabled', true);55 jQuery( '#button-yabi-2').attr('disabled', true);56 jQuery( '#response').html(' ');57 58 jQuery.post( '<?php echo esc_url( admin_url( 'admin-ajax.php' )); ?>', jQuery('#post').serialize() )50 jQuery( '#thespiner' ).addClass( 'is-active' ); 51 jQuery( '#button-yabi-1' ).attr( 'disabled', true ); 52 jQuery( '#button-yabi-2' ).attr( 'disabled', true ); 53 jQuery( '#response' ).html(' '); 54 55 jQuery.post( '<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>', jQuery( '#post' ).serialize() ) 59 56 .done(function( data ) { 60 57 61 if( parseInt( data ) == 1)58 if( 'GOOD' == data ) 62 59 { 63 60 if( parseInt( option ) == 0 ) … … 67 64 else 68 65 { 69 jQuery.post( '<?php echo esc_url( admin_url( 'admin-ajax.php' )); ?>', { action : 'yabi_generate_invoice', post_id : <?php echo esc_attr( $post->ID ); ?> } )66 jQuery.post( '<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>', { action : 'yabi_generate_invoice', post_id : <?php echo esc_attr( $post->ID ); ?> } ) 70 67 .done(function( datainvoice ) { 71 68 72 if( parseInt( datainvoice ) == 0)69 if( 'FAIL' == datainvoice ) 73 70 { 74 71 yabiMessage( 'error', 'Saved data!. Unexpected error on invoice, try again later.!', true ); … … 100 97 } 101 98 99 jQuery( document ).ready(function(){ 100 101 yabiCommercial(); 102 103 }); 104 102 105 </script> 103 106 … … 108 111 109 112 <tr> 110 <th><?php echo __( 'Type of person','yabi-wc'); ?>:</th>111 <td> 112 <select name=" accountid" id="accountid" onchange="yabiCommercial()">113 <th><?php echo __( 'Type of person','yabi-wc' ); ?>*:</th> 114 <td> 115 <select name="type_person" id="type_person" onchange="yabiCommercial()"> 113 116 114 117 <?php foreach($typesperson as $id => $name): ?> 115 118 116 <option <?php if( $person[ 'accountid'] == $id ): ?>selected="selected"<?php endif; ?> value="<?php echo esc_attr( $id ); ?>"><?php echo esc_html( $name ); ?></option>119 <option <?php if( $person[ 'type_person' ] == $id ): ?>selected="selected"<?php endif; ?> value="<?php echo esc_attr( $id ); ?>"><?php echo esc_html( $name ); ?></option> 117 120 118 121 <?php endforeach; ?> … … 123 126 124 127 <tr class="data-commercialname"> 125 <th><?php echo __('Commercial Name','yabi-wc'); ?>:</th> 126 <td> 127 <input class="regular-text" type="text" id="commercialname" name="commercialname" value="<?php echo esc_attr( $person['commercialname'] ); ?>" /> 128 </td> 129 </tr> 130 131 <tr> 132 <th><?php echo __('Tax Level Code','yabi-wc'); ?>:</th> 133 <td> 134 <input class="regular-text" type="text" id="taxlevelcode" name="taxlevelcode" value="<?php echo esc_attr( $person['taxlevelcode'] ); ?>" /><br/> 135 <small><?php echo __('Tax obligations registered in the RUT: O-05, O-48 (Separate by comma)','yabi-wc'); ?></small> 128 <th><?php echo __( 'Commercial Name','yabi-wc' ); ?>*:</th> 129 <td> 130 <input class="regular-text" type="text" id="commercialname" name="commercialname" value="<?php echo esc_attr( $person[ 'commercialname' ] ); ?>" /> 131 </td> 132 </tr> 133 134 <tr> 135 <th><?php echo __( 'Name','yabi-wc' ); ?>*:</th> 136 <td> 137 <input class="regular-text" type="text" id="name" name="name" value="<?php echo esc_attr( $person[ 'name' ] ); ?>" /> 138 </td> 139 </tr> 140 141 <tr> 142 <th><?php echo __( 'Second Name','yabi-wc' ); ?>:</th> 143 <td> 144 <input class="regular-text" type="text" id="second_name" name="second_name" value="<?php echo esc_attr( $person[ 'second_name' ] ); ?>" /> 145 </td> 146 </tr> 147 148 <tr> 149 <th><?php echo __( 'Last Name','yabi-wc' ); ?>*:</th> 150 <td> 151 <input class="regular-text" type="text" id="lastname" name="lastname" value="<?php echo esc_attr( $person[ 'lastname' ] ); ?>" /> 152 </td> 153 </tr> 154 155 <tr> 156 <th><?php echo __( 'Second Last Name','yabi-wc' ); ?>:</th> 157 <td> 158 <input class="regular-text" type="text" id="second_last_name" name="second_last_name" value="<?php echo esc_attr( $person[ 'second_last_name' ] ); ?>" /> 159 </td> 160 </tr> 161 162 <tr> 163 <th><?php echo __( 'Type of document','yabi-wc' ); ?>*:</th> 164 <td> 165 <select name="type_document" id="type_document"> 166 167 <?php global $yabi_thetypes; foreach( $yabi_thetypes as $id => $name ): ?> 168 169 <option <?php if( $person[ 'type_document' ] == $id ): ?>selected="selected"<?php endif; ?> value="<?php echo esc_attr( $id ); ?>"><?php echo esc_html( $name ); ?></option> 170 171 <?php endforeach; ?> 172 173 </select> 174 </td> 175 </tr> 176 177 <tr> 178 <th><?php echo __( 'Identifier','yabi-wc' ); ?>*:</th> 179 <td> 180 <input class="regular-text" type="text" id="identifier" name="identifier" value="<?php echo esc_attr( $person[ 'identifier' ] ); ?>" /> 181 <input class="small-text" type="text" id="identifier_digit" name="identifier_digit" value="<?php echo esc_attr( $person[ 'identifier_digit' ] ); ?>" /> 182 </td> 183 </tr> 184 185 <tr> 186 <th><?php echo __( 'Email','yabi-wc' ); ?>*:</th> 187 <td> 188 <input class="regular-text" type="text" id="email" name="email" value="<?php echo esc_attr( $person[ 'email' ] ); ?>" /> 189 </td> 190 </tr> 191 192 <tr> 193 <th><?php echo __( 'Telephone','yabi-wc' ); ?>:</th> 194 <td> 195 <input class="regular-text" type="text" id="telephone" name="telephone" value="<?php echo esc_attr( $person[ 'telephone' ] ); ?>" /> 136 196 </td> 137 197 </tr> 138 139 <tr> 140 <th><?php echo __('Name','yabi-wc'); ?>:</th> 141 <td> 142 <input class="regular-text" type="text" id="name" name="name" value="<?php echo esc_attr( $person['name'] ); ?>" /> 143 </td> 144 </tr> 145 146 <tr> 147 <th><?php echo __('Last Name','yabi-wc'); ?>:</th> 148 <td> 149 <input class="regular-text" type="text" id="lastname" name="lastname" value="<?php echo esc_attr( $person['lastname'] ); ?>" /> 150 </td> 151 </tr> 152 153 <tr> 154 <th><?php echo __('Type of document','yabi-wc'); ?>:</th> 155 <td> 156 <select name="type" id="type"> 157 158 <?php foreach($thetypes as $id => $name): ?> 159 160 <option <?php if( $person['type'] == $id ): ?>selected="selected"<?php endif; ?> value="<?php echo esc_attr( $id ); ?>"><?php echo esc_html( $name ); ?></option> 198 199 <tr> 200 <th><?php echo __('Address','yabi-wc'); ?>:</th> 201 <td> 202 <input class="regular-text" type="text" id="address" name="address" value="<?php echo esc_attr( $person[ 'address' ] ); ?>" /> 203 </td> 204 </tr> 205 206 <tr> 207 <th><?php echo __('City','yabi-wc'); ?>:</th> 208 <td> 209 <select name="city" id="city"> 210 211 <?php foreach( $diancodes as $id => $name ): ?> 212 213 <option <?php if( $person[ 'city' ] == $id ): ?>selected="selected"<?php endif; ?> value="<?php echo esc_attr( $id ); ?>"><?php echo esc_html( $name ); ?></option> 161 214 162 215 <?php endforeach; ?> … … 165 218 </td> 166 219 </tr> 167 168 <tr> 169 <th><?php echo __('Identifier','yabi-wc'); ?>:</th> 170 <td> 171 <input class="regular-text" type="text" id="identifier" name="identifier" value="<?php echo esc_attr( $person['identifier'] ); ?>" /><br/> 172 <small id="identifier-instruction"><?php echo __('The NIT must include the check digit separated by hyphen','yabi-wc'); ?></small> 173 </td> 174 </tr> 175 176 <tr> 177 <th><?php echo __('Email','yabi-wc'); ?>:</th> 178 <td> 179 <input class="regular-text" type="text" id="email" name="email" value="<?php echo esc_attr( $person['email'] ); ?>" /> 180 </td> 181 </tr> 182 183 <tr> 184 <th><?php echo __('Telephone','yabi-wc'); ?>:</th> 185 <td> 186 <input class="regular-text" type="text" id="telephone" name="telephone" value="<?php echo esc_attr( $person['telephone'] ); ?>" /> 187 </td> 188 </tr> 189 190 <tr> 191 <th><?php echo __('Address','yabi-wc'); ?>:</th> 192 <td> 193 <input class="regular-text" type="text" id="address" name="address" value="<?php echo esc_attr( $person['address'] ); ?>" /> 194 </td> 195 </tr> 196 197 <tr> 198 <th><?php echo __('City Code','yabi-wc'); ?>:</th> 199 <td> 200 <select name="citycode" id="citycode"> 201 202 <?php foreach( $diancodes as $id => $name ): ?> 203 204 <option <?php if( $person['citycode'] == $id ): ?>selected="selected"<?php endif; ?> value="<?php echo esc_attr( $id ); ?>"><?php echo esc_html( $name ); ?></option> 205 206 <?php endforeach; ?> 207 208 </select> 209 </td> 210 </tr> 211 212 <tr> 213 <th><?php echo __('Observations','yabi-wc'); ?>:</th> 214 <td> 215 <textarea class="regular-text" id="observations" name="observations" rows="3"><?php echo esc_attr( $person['observations'] ); ?></textarea> 216 </td> 217 </tr> 218 219 <tr> 220 <th><?php echo __('Note Name','yabi-wc'); ?>:</th> 221 <td> 222 <input class="regular-text" type="text" id="note_name" name="note_name" value="<?php echo esc_attr( $person['note_name'] ); ?>" /> 223 </td> 224 </tr> 225 226 <tr> 227 <th><?php echo __('Note Description','yabi-wc'); ?>:</th> 228 <td> 229 <textarea class="regular-text" id="note_value" name="note_value" rows="3"><?php echo esc_attr( $person['note_value'] ); ?></textarea> 220 221 <tr> 222 <th><?php echo __('Postcode','yabi-wc'); ?>:</th> 223 <td> 224 <input class="regular-text" type="text" id="citycode" name="citycode" value="<?php echo esc_attr( $person[ 'citycode' ] ); ?>" /> 225 </td> 226 </tr> 227 228 <tr> 229 <th><?php echo __( 'Observations','yabi-wc' ); ?>:</th> 230 <td> 231 <textarea class="regular-text" id="observations" name="observations" rows="3"><?php echo esc_attr( $person[ 'observations' ] ); ?></textarea> 232 </td> 233 </tr> 234 235 <tr> 236 <th><?php echo __( 'Note Name','yabi-wc' ); ?>:</th> 237 <td> 238 <input class="regular-text" type="text" id="note_name" name="note_name" value="<?php echo esc_attr( $person[ 'note_name' ] ); ?>" /> 239 </td> 240 </tr> 241 242 <tr> 243 <th><?php echo __( 'Note Description','yabi-wc' ); ?>:</th> 244 <td> 245 <textarea class="regular-text" id="note_value" name="note_value" rows="3"><?php echo esc_attr( $person[ 'note_value' ] ); ?></textarea> 230 246 </td> 231 247 </tr> … … 234 250 <th></th> 235 251 <td> 236 <input id="button-yabi-1" class="button-primary" type="button" name="submit" value="<?php echo __( 'Save','yabi-wc'); ?>" onClick="yabiSave(0)" />237 238 <input id="button-yabi-2" class="button-primary" type="button" name="submit" value="<?php echo __( 'Save & Generate','yabi-wc'); ?>" onClick="yabiSave(1)" />252 <input id="button-yabi-1" class="button-primary" type="button" name="submit" value="<?php echo __( 'Save','yabi-wc' ); ?>" onClick="yabiSave(0)" /> 253 254 <input id="button-yabi-2" class="button-primary" type="button" name="submit" value="<?php echo __( 'Save & Generate','yabi-wc' ); ?>" onClick="yabiSave(1)" /> 239 255 240 256 <div id="thespiner" class="spinner" style="float:none;width:auto;height:auto;padding:10px 0 10px … … 242 258 </td> 243 259 </tr> 260 261 <?php $yabi_response = get_post_meta( $post->ID, 'yabi_response', true ); ?> 262 263 <?php if( !empty( $yabi_response ) ): ?> 264 265 <tr> 266 <th>Last error:</th> 267 <td> 268 269 <?php echo $yabi_response[ 'data' ][ 'createInvoice' ][ 'errors' ][ 0 ][ 'message' ]; ?><br/> 270 271 <small><?php echo $yabi_response[ 'data' ][ 'createInvoice' ][ 'errors' ][ 0 ][ 'helpText' ]; ?></small> 272 273 </td> 274 275 </tr> 276 277 <?php endif; ?> 244 278 245 279 </table> -
wc-yabi/trunk/content/settings.php
r3083394 r3121708 1 <?php 2 $yabi_settings = get_option( 'yabi_settings' ); 3 $invoice_number = get_option( 'yabi_invoice_number' ); 4 ?> 1 5 <style> 2 6 table th … … 10 14 } 11 15 </style> 16 <script> 17 18 jQuery( document ).ready(function(){ 19 20 jQuery( '#payment_type' ).change(function(){ 21 22 if( 'CREDIT' == jQuery( this ).val() ) 23 { 24 jQuery( '#option_credit' ).show(); 25 } 26 else 27 { 28 jQuery( '#option_credit' ).hide(); 29 } 30 31 }); 32 33 jQuery( '#modified_checkout' ).change(function(){ 34 35 setting_automatic(); 36 37 }); 38 39 setting_automatic(); 40 }); 41 42 function setting_automatic() 43 { 44 if( 'Yes' == jQuery( '#modified_checkout' ).val() ) 45 { 46 jQuery( '#automatic_option' ).show(); 47 } 48 else 49 { 50 jQuery( '#automatic_option' ).hide(); 51 jQuery( '#invoice_type' ).val( 'Manual' ); 52 } 53 } 54 55 </script> 12 56 <div class="wrap"> 13 57 … … 15 59 16 60 <form name="thesettings" method="post"> 17 18 <div class="card">19 61 20 <h2><?php echo __('Invoice','yabi-wc'); ?></h2> 62 <div class="card"> 63 64 <h2><?php echo __('Settings','yabi-wc'); ?></h2> 65 <hr /> 66 67 <table width="100%" cellpadding="10" cellspacing="10" border="0"> 68 69 <tr> 70 <th width="20%"><label for="payment_type"><?php echo __('Payment type','yabi-wc'); ?>:</label></th> 71 <td> 72 <select id="payment_type" name="payment_type"> 73 <option value="IN_CASH" <?php if( 'IN_CASH' == $yabi_settings[ 'payment_type' ] ) echo 'selected'; ?>><?php echo __( 'In cash','yabi-wc' ); ?></option> 74 <option value="CREDIT" <?php if( 'CREDIT' == $yabi_settings[ 'payment_type' ] ) echo 'selected'; ?>><?php echo __( 'Credit','yabi-wc' ); ?></option> 75 </select> 76 </td> 77 </tr> 78 79 <tr id="option_credit" <?php if( 'CREDIT' != $yabi_settings[ 'payment_type' ] ) echo 'style="display: none;"'; ?>> 80 <th><label for="credit_days"><?php echo __('Credit days','yabi-wc'); ?>:</label></th> 81 <td> 82 <input type="number" class="small-text" id="credit_days" name="credit_days" value="<?php echo esc_attr( $yabi_settings[ 'credit_days' ] ); ?>" /><br/> 83 <span class="description">30</span> 84 </td> 85 </tr> 86 87 <tr> 88 <th><label for="modified_checkout"><?php echo __( 'I agree to modify the checkout','yabi-wc' ); ?>:</label></th> 89 <td> 90 <select id="modified_checkout" name="modified_checkout"> 91 <option value="No" <?php if( 'No' == $yabi_settings[ 'modified_checkout' ] ) echo 'selected'; ?>><?php echo __( 'No','yabi-wc' ); ?></option> 92 <option value="Yes" <?php if( 'Yes' == $yabi_settings[ 'modified_checkout' ] ) echo 'selected'; ?>><?php echo __( 'Yes','yabi-wc' ); ?></option> 93 </select> 94 </td> 95 </tr> 96 97 <tr id="automatic_option" style="display: none;"> 98 <th><label for="invoice_type"><?php echo __('Invoice type','yabi-wc'); ?>:</label></th> 99 <td> 100 <select id="invoice_type" name="invoice_type"> 101 <option value="Manual" <?php if( 'Manual' == $yabi_settings[ 'invoice_type' ] ) echo 'selected'; ?>><?php echo __( 'Manual','yabi-wc' ); ?></option> 102 <option value="Automatic" <?php if( 'Automatic' == $yabi_settings[ 'invoice_type' ] ) echo 'selected'; ?>><?php echo __( 'Automatic','yabi-wc' ); ?></option> 103 </select> 104 </td> 105 </tr> 106 107 </table> 108 109 <h2><?php echo __( 'Invoice','yabi-wc' ); ?></h2> 21 110 <hr /> 22 111 23 <p> 24 <label for="yabi_invoice_name"><?php echo __('Invoice Name','yabi-wc'); ?>:</label> 25 <input type="text" class="small-text" id="yabi_invoice_name" name="yabi_invoice_name" value="<?php echo esc_attr( get_option('yabi_invoice_name') ); ?>" /> 112 <table width="100%" cellpadding="10" cellspacing="10" border="0"> 113 114 <tr> 115 <th width="20%"><label for="invoice_name"><?php echo __( 'Invoice Name','yabi-wc' ); ?>:</label></th> 116 <td> 117 <input type="text" class="small-text" id="invoice_name" name="invoice_name" value="<?php echo esc_attr( $yabi_settings[ 'invoice_name' ] ); ?>" /> 118 </td> 119 </tr> 26 120 27 <label for="yabi_invoice_number"><?php echo __('Invoice Number','yabi-wc'); ?>:</label> 28 <input type="number" class="small-text" id="yabi_invoice_number" name="yabi_invoice_number" value="<?php echo esc_attr( get_option('yabi_invoice_number') ); ?>" /> 29 </p> 121 <tr> 122 <th><label for="invoice_number"><?php echo __( 'Invoice Number','yabi-wc' ); ?>:</label></th> 123 <td> 124 <input type="number" class="small-text" id="invoice_number" name="invoice_number" value="<?php echo esc_attr( $invoice_number ); ?>" /> 125 </td> 126 </tr> 30 127 31 <p> 32 <input class="button-primary" type="submit" name="Save" value="Save" /> 33 </p> 34 35 </div> 36 37 <div class="card"> 128 </table> 38 129 39 130 <h2><?php echo __('Client','yabi-wc'); ?></h2> … … 43 134 44 135 <tr> 45 <th width=" 14%"><label for="yabi_owner"><?php echo __('Type of Owner','yabi-wc'); ?>:</label></th>136 <th width="20%"><label for="owner"><?php echo __( 'Type of Owner','yabi-wc' ); ?>:</label></th> 46 137 <td> 47 <select id=" yabi_owner" name="yabi_owner">48 <option value="company" <?php if( 'company' == get_option( 'yabi_owner' ) ) echo 'selected'; ?>><?php echo __('Company','yabi-wc'); ?></option>49 <option value="person" <?php if( 'person' == get_option( 'yabi_owner' ) ) echo 'selected'; ?>><?php echo __('Person','yabi-wc'); ?></option>138 <select id="owner" name="owner"> 139 <option value="company" <?php if( 'company' == $yabi_settings[ 'owner' ] ) echo 'selected'; ?>><?php echo __( 'Company','yabi-wc' ); ?></option> 140 <option value="person" <?php if( 'person' == $yabi_settings[ 'owner' ] ) echo 'selected'; ?>><?php echo __( 'Person','yabi-wc' ); ?></option> 50 141 </select> 51 142 </td> … … 53 144 54 145 <tr> 55 <th width="14%"><label for="yabi_businessunituuid"><?php echo __('Business Unit Uuid','yabi-wc'); ?>:</label></th>146 <th><label for="businessunituuid"><?php echo __('Business Unit Uuid','yabi-wc'); ?>:</label></th> 56 147 <td> 57 <input type="text" class="large-text" id=" yabi_businessunituuid" name="yabi_businessunituuid" value="<?php echo esc_attr( get_option('yabi_businessunituuid')); ?>" /><br/>148 <input type="text" class="large-text" id="businessunituuid" name="businessunituuid" value="<?php echo esc_attr( $yabi_settings[ 'businessunituuid' ] ); ?>" /><br/> 58 149 <span class="description">xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</span> 59 150 </td> … … 61 152 62 153 <tr> 63 <th><label for=" yabi_token"><?php echo __('Token','yabi-wc'); ?>:</label></th>154 <th><label for="token"><?php echo __('Token','yabi-wc'); ?>:</label></th> 64 155 <td> 65 <input type="text" class="large-text" id=" yabi_token" name="yabi_token" value="<?php echo esc_attr( get_option('yabi_token')); ?>" /><br/>156 <input type="text" class="large-text" id="token" name="token" value="<?php echo esc_attr( $yabi_settings[ 'token' ] ); ?>" /><br/> 66 157 <span class="description">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</span> 67 158 </td> 68 </tr> 159 </tr> 69 160 70 161 <tr> 71 162 <th><label for="yabi_url_client"><?php echo __('URL client','yabi-wc'); ?>:</label></th> 72 163 <td> 73 <input type="text" class="large-text" id=" yabi_url_client" name="yabi_url_client" value="<?php echo esc_attr( get_option('yabi_url_client')); ?>" /><br/>164 <input type="text" class="large-text" id="url_client" name="url_client" value="<?php echo esc_attr( $yabi_settings[ 'url_client' ] ); ?>" /><br/> 74 165 <span class="description">https://api.yabi.co/co/einvoices/v2/</span> 75 166 </td> 76 </tr> 167 </tr> 77 168 78 169 <tr> -
wc-yabi/trunk/includes/ajax.php
r3079931 r3121708 7 7 function yabi_generate_invoice() 8 8 { 9 if( isset( $_REQUEST['post_id'] ) ) 9 $response = 'FAIL'; 10 11 if( isset( $_POST[ 'post_id' ] ) ) 10 12 { 11 $post_id = sanitize_key( $_ REQUEST['post_id'] );13 $post_id = sanitize_key( $_POST[ 'post_id' ] ); 12 14 13 $products = array(); 14 15 $person = get_post_meta( $post_id, 'yabi_person', true ); 16 $order = wc_get_order( $post_id ); 17 $items = $order->get_items(); 18 19 foreach( $items as $item ) 20 { 21 $data = $item->get_data(); 22 $total = $item->get_total(); 23 $description = $item->get_name(); 24 $value = round( $item->get_subtotal(), 2 ); 25 $quantity = $item->get_quantity(); 26 $id = $item->get_product_id(); 27 28 if( isset( $data['taxes']['subtotal'] ) ) 29 { 30 $tax = round( current( $data['taxes']['subtotal'] ), 2 ); 31 } 32 else 33 { 34 $tax = round( $item->get_subtotal_tax(), 2 ); 35 } 36 37 $percent = round( $tax * 100 / $total ); 38 39 $adjust = round( $total + $item->get_total_tax() ); 40 41 $theitem = array( 42 'id' => $id, 43 'description' => $description, 44 'value' => $value, 45 'tax' => $tax, 46 'quantity' => $quantity, 47 'percent' => $percent, 48 'adjust' => $adjust, 49 ); 50 51 array_push( $products, $theitem ); 52 } 53 54 /* Coupons */ 55 $numitem = 0; 56 $order_items = $order->get_items('coupon'); 57 foreach( $order_items as $item_id => $item ) 58 { 59 $order_discount_amount = wc_get_order_item_meta( $item_id, 'discount_amount', true ); 60 $order_discount_tax_amount = wc_get_order_item_meta( $item_id, 'discount_amount_tax', true ); 61 62 if( isset( $products[ $numitem ] ) ) 63 { 64 $products[ $numitem ][ 'value' ] = floatval( $products[ $numitem ][ 'value' ] ) - floatval( $order_discount_amount ); 65 $products[ $numitem ][ 'tax' ] = floatval( $products[ $numitem ][ 'tax' ] ) - floatval( $order_discount_tax_amount ); 66 67 $products[ $numitem ][ 'percent' ] = round( $products[ $numitem ][ 'tax' ] * 100 / $products[ $numitem ][ 'value' ] ); 68 69 $verified = round( $products[ $numitem ][ 'value' ] * $products[ $numitem ][ 'percent' ] / 100, 2 ); 70 71 $difference = $products[ $numitem ][ 'tax' ] - $verified; 72 73 if( abs( $difference ) > 0.5 ) 74 { 75 $products[ $numitem ][ 'tax' ] = $verified; 76 77 $products[ $numitem ][ 'value' ] = $products[ $numitem ][ 'adjust' ] - $products[ $numitem ][ 'tax' ]; 78 } 79 } 80 81 $numitem++; 82 } 83 /***********/ 84 85 /* Shipping */ 86 $total_shipping = $order->get_shipping_total(); 87 if( 0 < $total_shipping ) 88 { 89 $tax_shipping = $order->get_shipping_tax(); 90 91 $percent = round( $tax_shipping * 100 / $total_shipping ); 92 93 $adjust = round( $total_shipping + $tax_shipping ); 94 95 $theitem = array( 96 'id' => '101', 97 'description' => 'Transporte', 98 'value' => $total_shipping, 99 'tax' => $tax_shipping, 100 'quantity' => 1, 101 'percent' => $percent, 102 'adjust' => $adjust, 103 ); 104 105 array_push( $products, $theitem ); 106 } 107 /************/ 108 109 $dueDate = date( "Y-m-d" ); 110 $dateTime = date( "Y-m-d" ) .'T'. date("H:i:s") .'Z'; 111 112 $payment = array( 113 'id' => $post_id, 114 'dueDate' => $dueDate, 115 'dateTime' => $dateTime, 116 ); 117 118 if( 'NATURAL' == $person[ 'accountid' ] ) 119 { 120 $graphQL = yabi_create_invoice_person( $person, $products, $payment ); 121 } 122 else 123 { 124 $graphQL = yabi_create_invoice_company( $person, $products, $payment ); 125 } 126 127 $response = yabi_send_data( $graphQL ); 128 129 update_post_meta( $post_id, 'yabi_graphQL', $graphQL ); 130 update_post_meta( $post_id, 'yabi_response_data', $response ); 131 132 if( !empty( $response ) ) 133 { 134 if( isset( $response['errors'] ) ) 135 { 136 echo json_encode( array( 'error' => 1, 'message' => $response['errors'][0]['message'] ) ); 137 } 138 elseif( isset( $response['data']['createInvoice']['document']['uid'] ) ) 139 { 140 $invoiceConsecutive = get_option('yabi_invoice_name') . get_option('yabi_invoice_number'); 141 142 $yabi_invoice_number = intval( get_option('yabi_invoice_number') ) + 1; 143 update_option( 'yabi_invoice_number', $yabi_invoice_number ); 144 145 $invoiceid = $response['data']['createInvoice']['document']['uid']; 146 147 $yabi_invoice = array( 148 'number' => $invoiceConsecutive, 149 'serial' => $invoiceid 150 ); 151 update_post_meta( $post_id, 'yabi_invoice', $yabi_invoice ); 152 153 echo json_encode( array( 'error' => 0, 'message' => 'Success!. Invoice generate: '. $invoiceid ) ); 154 } 155 else 156 { 157 echo json_encode( array( 'error' => 1, 'message' => 'Error: Some inputs need revision.' ) ); 158 } 159 } 160 else 161 { 162 echo 0; 163 } 15 $response = yabi_create_invoice( $post_id ); 164 16 } 165 17 166 exit(); 18 echo $response; 19 20 wp_die(); 167 21 } 168 22 169 23 function yabi_save_data() 170 24 { 171 if( isset( $_ REQUEST['name'] ) && isset( $_REQUEST['identifier'] ) )25 if( isset( $_POST[ 'name' ] ) && isset( $_POST[ 'identifier' ] ) ) 172 26 { 173 $post_id = sanitize_key( $_REQUEST['post_id'] ); 174 $citycode = sanitize_text_field( $_REQUEST['citycode'] ); 175 $address = sanitize_text_field( $_REQUEST['address'] ); 176 $email = sanitize_email( $_REQUEST['email'] ); 177 $name = sanitize_text_field( $_REQUEST['name'] ); 178 $lastname = sanitize_text_field( $_REQUEST['lastname'] ); 179 $note_name = sanitize_text_field( $_REQUEST['note_name'] ); 180 $note_value = sanitize_text_field( $_REQUEST['note_value'] ); 181 $identifier = sanitize_text_field( $_REQUEST['identifier'] ); 182 $observations = sanitize_text_field( $_REQUEST['observations'] ); 183 $type = sanitize_text_field( $_REQUEST['type'] ); 184 $telephone = sanitize_text_field( $_REQUEST['telephone'] ); 185 $accountid = sanitize_text_field( $_REQUEST['accountid'] ); 186 $commercialname = sanitize_text_field( $_REQUEST['commercialname'] ); 187 $taxlevelcode = sanitize_text_field( $_REQUEST['taxlevelcode'] ); 188 189 $taxscheme = 0; 27 $post_id = sanitize_key( $_POST[ 'post_id' ] ); 28 $address = sanitize_text_field( $_POST[ 'address' ] ); 29 $email = sanitize_email( $_POST[ 'email' ] ); 30 $name = sanitize_text_field( $_POST[ 'name' ] ); 31 $lastname = sanitize_text_field( $_POST[ 'lastname' ] ); 32 $note_name = sanitize_text_field( $_POST[ 'note_name' ] ); 33 $note_value = sanitize_text_field( $_POST[ 'note_value' ] ); 34 $identifier = sanitize_text_field( $_POST[ 'identifier' ] ); 35 $observations = sanitize_text_field( $_POST[ 'observations' ] ); 36 $type_document = sanitize_text_field( $_POST[ 'type_document' ] ); 37 $telephone = sanitize_text_field( $_POST[ 'telephone' ] ); 38 $type_person = sanitize_text_field( $_POST[ 'type_person' ] ); 39 $commercialname = sanitize_text_field( $_POST[ 'commercialname' ] ); 40 $second_name = sanitize_text_field( $_POST[ 'second_name' ] ); 41 $second_last_name = sanitize_text_field( $_POST[ 'second_last_name' ] ); 42 $identifier_digit = sanitize_text_field( $_POST[ 'identifier_digit' ] ); 43 $city = sanitize_text_field( $_POST[ 'city' ] ); 44 $citycode = sanitize_text_field( $_POST[ 'citycode' ] ); 190 45 191 46 $person = array( 192 ' accountid' => $accountid,47 'type_person' => $type_person, 193 48 'address' => $address, 194 'citycode' => $citycode,195 49 'commercialname' => $commercialname, 196 50 'email' => $email, 197 51 'identifier' => $identifier, 198 52 'lastname' => $lastname, 199 'name' => $name, 200 'note_name' => $note_name,53 'name' => $name, 54 'note_name' => $note_name, 201 55 'note_value' => $note_value, 202 56 'observations' => $observations, 203 'taxlevelcode' => $taxlevelcode,204 'taxscheme' => $taxscheme,205 57 'telephone' => $telephone, 206 'type' => $type, 58 'type_document' => $type_document, 59 'second_name' => $second_name, 60 'second_last_name' => $second_last_name, 61 'identifier_digit' => $identifier_digit, 62 'citycode' => $citycode, 63 'city' => $city, 207 64 ); 208 65 209 update_post_meta( $post_id, 'yabi_ person', $person );66 update_post_meta( $post_id, 'yabi_order_meta', $person ); 210 67 211 echo 1;68 echo 'GOOD'; 212 69 } 213 70 else 214 71 { 215 echo 0;72 echo 'FAIL'; 216 73 } 217 74 218 exit();75 wp_die(); 219 76 } -
wc-yabi/trunk/includes/dian.php
r2587125 r3121708 1143 1143 return $dianarray; 1144 1144 } 1145 1146 function yabi_generate_values( $id ) 1147 { 1148 $value = ''; 1149 1150 $codes = yabi_generate_Codes(); 1151 1152 if( isset( $codes[ $id ] ) ) 1153 { 1154 $value = $codes[ $id ]; 1155 } 1156 1157 return $value; 1158 } -
wc-yabi/trunk/includes/transaction.php
r3083394 r3121708 1 1 <?php 2 2 3 function yabi_create_invoice _company( $person, $products, $payment)3 function yabi_create_invoice( $post_id ) 4 4 { 5 $businessUnitUuid = get_option( 'yabi_businessunituuid' ); 6 $invoice_number = get_option( 'yabi_invoice_number' ); 7 $invoice_name = get_option( 'yabi_invoice_name' ); 5 $response = 'FAIL'; 6 7 if( !empty( $post_id ) ) 8 { 9 $order = wc_get_order( $post_id ); 10 11 if( !empty( $order ) ) 12 { 13 $is_virtual = true; 14 $products = array(); 15 16 $person = get_post_meta( $post_id, 'yabi_order_meta', true ); 17 18 $items = $order->get_items(); 19 20 foreach( $items as $item ) 21 { 22 $data = $item->get_data(); 23 $total = $item->get_total(); 24 $description = $item->get_name(); 25 $value = round( $item->get_subtotal(), 2 ); 26 $quantity = $item->get_quantity(); 27 $id = $item->get_product_id(); 28 29 $product = wc_get_product( $id ); 30 if( !empty( $product ) && !$product->is_virtual() ) 31 { 32 $is_virtual = false; 33 } 34 35 if( isset( $data['taxes']['subtotal'] ) ) 36 { 37 $tax = round( current( $data['taxes']['subtotal'] ), 2 ); 38 } 39 else 40 { 41 $tax = round( $item->get_subtotal_tax(), 2 ); 42 } 43 44 $percent = round( $tax * 100 / $total ); 45 46 $adjust = round( $total + $item->get_total_tax() ); 47 48 $theitem = array( 49 'id' => $id, 50 'description' => $description, 51 'value' => $value, 52 'tax' => $tax, 53 'quantity' => $quantity, 54 'percent' => $percent, 55 'adjust' => $adjust, 56 ); 57 58 array_push( $products, $theitem ); 59 } 60 61 /* Coupons */ 62 $numitem = 0; 63 $order_items = $order->get_items( 'coupon' ); 64 foreach( $order_items as $item_id => $item ) 65 { 66 $order_discount_amount = wc_get_order_item_meta( $item_id, 'discount_amount', true ); 67 $order_discount_tax_amount = wc_get_order_item_meta( $item_id, 'discount_amount_tax', true ); 68 69 if( isset( $products[ $numitem ] ) ) 70 { 71 $products[ $numitem ][ 'value' ] = floatval( $products[ $numitem ][ 'value' ] ) - floatval( $order_discount_amount ); 72 $products[ $numitem ][ 'tax' ] = floatval( $products[ $numitem ][ 'tax' ] ) - floatval( $order_discount_tax_amount ); 73 74 $products[ $numitem ][ 'percent' ] = round( $products[ $numitem ][ 'tax' ] * 100 / $products[ $numitem ][ 'value' ] ); 75 76 $verified = round( $products[ $numitem ][ 'value' ] * $products[ $numitem ][ 'percent' ] / 100, 2 ); 77 78 $difference = $products[ $numitem ][ 'tax' ] - $verified; 79 80 if( abs( $difference ) > 0.5 ) 81 { 82 $products[ $numitem ][ 'tax' ] = $verified; 83 84 $products[ $numitem ][ 'value' ] = $products[ $numitem ][ 'adjust' ] - $products[ $numitem ][ 'tax' ]; 85 } 86 } 87 88 $numitem++; 89 } 90 /***********/ 91 92 /* Shipping */ 93 $total_shipping = $order->get_shipping_total(); 94 if( 0 < $total_shipping ) 95 { 96 $tax_shipping = $order->get_shipping_tax(); 97 98 $percent = round( $tax_shipping * 100 / $total_shipping ); 99 100 $adjust = round( $total_shipping + $tax_shipping ); 101 102 $theitem = array( 103 'id' => '101', 104 'description' => 'Transporte', 105 'value' => $total_shipping, 106 'tax' => $tax_shipping, 107 'quantity' => 1, 108 'percent' => $percent, 109 'adjust' => $adjust, 110 ); 111 112 array_push( $products, $theitem ); 113 } 114 /************/ 115 116 $dueDate = date( "Y-m-d" ); 117 $dateTime = date( "Y-m-d" ) .'T'. date("H:i:s") .'Z'; 118 119 $payment = array( 120 'id' => $post_id, 121 'dueDate' => $dueDate, 122 'dateTime' => $dateTime, 123 ); 124 125 $graphQL = yabi_create_invoice_graph( $person, $products, $payment, $is_virtual ); 126 127 $response = yabi_send_data( $graphQL ); 128 129 update_post_meta( $post_id, 'yabi_graphQL', $graphQL ); 130 update_post_meta( $post_id, 'yabi_response', $response ); 131 132 if( !empty( $response ) ) 133 { 134 if( isset( $response[ 'errors' ] ) ) 135 { 136 $response = json_encode( array( 'error' => 1, 'message' => $response[ 'errors' ][ 0 ][ 'message' ] ) ); 137 } 138 elseif( isset( $response[ 'data' ][ 'createInvoice' ][ 'document' ][ 'uid' ] ) ) 139 { 140 $yabi_settings = get_option( 'yabi_settings' ); 141 $invoice_number = get_option( 'yabi_invoice_number' ); 142 143 $invoiceConsecutive = $yabi_settings[ 'invoice_name' ] . $invoice_number; 144 145 $yabi_invoice_number = intval( $invoice_number ) + 1; 146 147 update_option( 'yabi_invoice_number', $yabi_invoice_number, 'no' ); 148 149 $invoiceid = $response[ 'data' ][ 'createInvoice' ][ 'document' ][ 'uid' ]; 150 151 $yabi_invoice = array( 152 'number' => $invoiceConsecutive, 153 'serial' => $invoiceid 154 ); 155 update_post_meta( $post_id, 'yabi_invoice', $yabi_invoice ); 156 157 $response = json_encode( array( 'error' => 0, 'message' => 'Success!. Invoice generate: '. $invoiceid ) ); 158 } 159 elseif( isset( $response[ 'data' ][ 'createInvoice' ][ 'errors' ] ) ) 160 { 161 $response = json_encode( array( 'error' => 1, 'message' => $response[ 'data' ][ 'createInvoice' ][ 'errors' ][ 0 ][ 'message' ] ) ); 162 } 163 else 164 { 165 $response = json_encode( array( 'error' => 1, 'message' => 'Unexpected error, try again later or contact support.' ) ); 166 } 167 } 168 } 169 } 170 171 return $response; 172 } 173 174 function yabi_create_invoice_graph( $person, $products, $payment, $is_virtual ) 175 { 176 $yabi_settings = get_option( 'yabi_settings' ); 177 $invoice_number = get_option( 'yabi_invoice_number' ); 178 179 $businessUnitUuid = $yabi_settings[ 'businessunituuid' ]; 180 $invoice_name = $yabi_settings[ 'invoice_name' ]; 181 $payment_type = $yabi_settings[ 'payment_type' ]; 8 182 9 183 $data_products = yabi_create_products( $products ); 10 184 $tax_subtotal = yabi_create_tax( $data_products ); 185 186 $datedue = ''; 187 if( 'CREDIT' == $payment_type ) 188 { 189 $credit_days = $yabi_settings[ 'credit_days' ]; 190 191 $newcredit = date( "Y-m-d", strtotime( $payment[ 'dueDate' ] . " +$credit_days days" ) ); 192 193 $dateTime = $newcredit .'T'. date("H:i:s") .'Z'; 194 195 $datedue = 'paymentDueDate: "'. $dateTime .'"'; 196 } 197 198 $address = ''; 199 $identifier = ''; 200 $note = ''; 201 $observations = ''; 202 $personName = ''; 203 204 switch( $person[ 'type_person' ] ) 205 { 206 case 'NATURAL_PERSON': 207 208 $identifier = $person[ 'identifier' ]; 209 210 $personName = 'personName: { 211 firstName: "'. $person[ 'name' ] .'" 212 secondName: "'. $person[ 'second_name' ] .'" 213 firstSurname: "'. $person[ 'lastname' ] .'" 214 secondSurname: "'. $person[ 'second_last_name' ] .'" 215 }'; 216 217 break; 218 219 case 'LEGAL_ENTITY': 220 221 $identifier = $person[ 'identifier' ] .'-'. $person[ 'identifier_digit' ]; 222 223 $personName = 'personName: { 224 corporateName: "'. $person[ 'commercialname' ] .'" 225 }'; 226 227 break; 228 } 229 230 if( !empty( $person[ 'note_name' ] ) && !empty( $person[ 'note_value' ] ) ) 231 { 232 $note = 'note: { 233 key: "'. $person[ 'note_name' ] .'" 234 value: "'. $person[ 'note_value' ] .'" 235 }'; 236 } 237 238 if( !empty( $person[ 'observations' ] ) ) 239 { 240 $observations = 'notes: [{ 241 key: "Observations" 242 value: "'. $person[ 'observations' ] .'" 243 }]'; 244 } 245 246 if( !empty( $person[ 'city' ] ) && !empty( $person[ 'address' ] ) && !empty( $person[ 'citycode' ] ) ) 247 { 248 $country = 'CO'; 249 if( !empty( $person[ 'country' ] ) ) 250 { 251 $country = $person[ 'country' ]; 252 } 253 254 $address = 'physicalLocation: { 255 country: '. $country .' 256 city: "'. $person[ 'city' ] .'" 257 address: "'. $person[ 'address' ] .'" 258 postalCode: "'. $person[ 'citycode' ] .'" 259 }'; 260 } 261 11 262 12 263 $graphQL = 'mutation{ … … 30 281 documentParties: { 31 282 accountingCustomerParty: { 32 additionalAccountId: LEGAL_ENTITY283 additionalAccountId: '. $person[ 'type_person' ] .' 33 284 personId: { 34 idType: '. $person[ 'type' ] .' 35 identifier: "'. $person[ 'identifier' ] .'" 36 } 37 personName: { 38 corporateName: "'. $person[ 'commercialname' ] .'" 39 } 40 } 41 } 285 idType: '. $person[ 'type_document' ] .' 286 identifier: "'. $identifier .'" 287 } 288 '. $personName .' 289 '. $address .' 290 contact: { 291 email: "'. $person[ 'email' ] .'" 292 telephone: "'. $person[ 'telephone' ] .'" 293 '. $note .' 294 } 295 } 296 } 297 '. $observations .' 42 298 taxDescription: [ 43 299 { … … 58 314 paymentDescription: { 59 315 paymentMeans: { 316 '. $datedue .' 60 317 paymentMeanCode: CO_ZZZ 61 paymentMeanId: IN_CASH318 paymentMeanId: '. $payment_type .' 62 319 paymentTerms: { 63 320 locale: ES_CO … … 192 449 name 193 450 postalCode 194 195 451 } 196 452 } … … 506 762 507 763 return $graphQL; 508 509 }510 511 function yabi_create_invoice_person( $person, $products, $payment )512 {513 $businessUnitUuid = get_option( 'yabi_businessunituuid' );514 $invoice_number = get_option( 'yabi_invoice_number' );515 $invoice_name = get_option( 'yabi_invoice_name' );516 517 $data_products = yabi_create_products( $products );518 $tax_subtotal = yabi_create_tax( $data_products );519 520 $graphQL = 'mutation{521 createInvoice(522 document: {523 organizationalUnitId: "'. $businessUnitUuid .'"524 id:{525 number: '. $invoice_number .'526 prefix: "'. $invoice_name .'"527 }528 generalInformation: {529 currency: COP530 issueDateTime: "'. $payment[ 'dateTime' ] .'"531 acquirerEmail: "'. $person[ 'email' ] .'"532 operationCode: STD533 subtypeCode: SALES_INVOICE534 }535 documentLines: [536 '. $data_products[ 'graphQL' ] .'537 ]538 documentParties: {539 accountingCustomerParty: {540 additionalAccountId: NATURAL_PERSON541 personId: {542 idType: '. $person[ 'type' ] .'543 identifier: "'. $person[ 'identifier' ] .'"544 }545 personName: {546 firstName: "'. $person[ 'name' ] .'"547 secondName: ""548 firstSurname: "'. $person[ 'lastname' ] .'"549 secondSurname: ""550 }551 }552 }553 taxDescription: [554 {555 taxName: CO_01556 taxAmount: "'. $data_products[ 'total_tax' ] .'"557 roundingAmount: "0"558 taxSubtotal: [559 '. $tax_subtotal .'560 ]561 }562 ]563 documentTotals: {564 lineExtensionAmount: "'. $data_products[ 'total_value' ] .'"565 taxExclusiveAmount: "'. $data_products[ 'total_value' ] .'"566 taxInclusiveAmount: "'. ( $data_products[ 'total_tax' ] + $data_products[ 'total_value' ] ) .'"567 payableAmount: "'. ( $data_products[ 'total_tax' ] + $data_products[ 'total_value' ] ) .'"568 }569 paymentDescription: {570 paymentMeans: {571 paymentMeanCode: CO_ZZZ572 paymentMeanId: IN_CASH573 paymentTerms: {574 locale: ES_CO575 text: "'. $payment[ 'id' ] .'"576 }577 }578 }579 }580 )581 {582 document{583 documentUid584 id585 uid586 billingPrefix{587 creationDate588 id589 prefix590 range{591 from592 to593 }594 }595 596 documentLines{597 description{598 locale599 text600 }601 itemDescription{602 additionalItemProperty{603 key604 values605 }606 brandName607 informationContentProviderParty{608 endpointId{609 agencyId610 id611 schemeId612 }613 identification{614 idType{615 code616 description617 }618 identifier619 }620 name{621 corporateName622 firstName623 firstSurname624 secondName625 secondSurname626 }627 partyTaxScheme{628 compStringId{629 idType{630 code631 description632 }633 identifier634 }635 partyLegalEntity{636 shareholders{637 identification{638 idType{639 code640 description641 }642 identifier643 }644 name{645 corporateName646 firstName647 firstSurname648 secondName649 secondSurname650 }651 participationPercent652 physicalLocation{653 address654 cityCode655 cityName656 countryCode657 countrySubentity658 countrySubentityCode659 description{660 key661 values662 }663 informationUri664 name665 postalCode666 }667 }668 }669 registrationAddress{670 address671 cityCode672 cityName673 countryCode674 countrySubentity675 countrySubentityCode676 description{677 key678 values679 }680 informationUri681 name682 postalCode683 }684 registrationName685 taxLevelCode686 taxScheme{687 code688 description689 }690 }691 physicalLocation{692 address693 cityCode694 cityName695 countryCode696 countrySubentity697 countrySubentityCode698 description{699 key700 values701 }702 informationUri703 name704 postalCode705 }706 }707 manufacturerParty{708 endpointId{709 agencyId710 id711 schemeId712 }713 identification{714 idType{715 code716 description717 }718 identifier719 }720 name{721 corporateName722 firstName723 firstSurname724 secondName725 secondSurname726 }727 partyTaxScheme{728 compStringId{729 idType{730 code731 description732 }733 identifier734 }735 partyLegalEntity{736 shareholders{737 identification{738 idType{739 code740 description741 }742 identifier743 }744 name{745 corporateName746 firstName747 firstSurname748 secondName749 secondSurname750 }751 participationPercent752 physicalLocation{753 address754 cityCode755 cityName756 countryCode757 countrySubentity758 countrySubentityCode759 description{760 key761 values762 }763 informationUri764 name765 postalCode766 }767 }768 }769 registrationAddress{770 address771 cityCode772 cityName773 countryCode774 countrySubentity775 countrySubentityCode776 description{777 key778 values779 }780 informationUri781 name782 postalCode783 }784 registrationName785 taxLevelCode786 taxScheme{787 code788 description789 }790 }791 physicalLocation{792 address793 cityCode794 cityName795 countryCode796 countrySubentity797 countrySubentityCode798 description{799 key800 values801 }802 informationUri803 name804 postalCode805 }806 }807 modelName808 originCountry{809 code810 description811 }812 standardItemId{813 id814 name815 schemeAgencyId816 schemeId817 }818 }819 lineExtensionAmount820 note{821 locale822 text823 }824 price{825 priceAmount826 baseQuantity827 }828 priceModifier{829 amount830 baseAmount831 chargeIndicator832 percentage833 reason{834 text835 }836 reasonCode{837 code838 description839 }840 }841 pricingReference{842 amount843 priceType{844 code845 description846 }847 }848 quantity849 unitCode{850 code851 description852 }853 uuid854 }855 documentModifiers{856 amount857 baseAmount858 chargeIndicator859 percentage860 reason{861 text862 }863 reasonCode{864 code865 description866 }867 }868 documentParties{869 accountingCustomerParty{870 additionalAccountId{871 code872 description873 }874 }875 accountingSupplierParty{876 additionalAccountId{877 code878 description879 }880 }881 }882 documentTotals{883 allowanceTotalAmount884 chargeTotalAmount885 lineExtensionAmount886 prePaidAmount887 taxExclusiveAmount888 taxInclusiveAmount889 }890 documentType891 generalInformation{892 acquirerEmail893 currency{894 code895 description896 }897 environment898 issueDateTime899 }900 id901 insertedAt902 organizationalUnitId903 paymentDescription{904 paymentMeans{905 paymentDueDate906 paymentMeanCode{907 code908 description909 }910 paymentMeanId{911 code912 description913 }914 paymentTerms{915 text916 }917 }918 prepayments{919 id920 instructionId921 paidAmount922 paidDateTime923 }924 }925 referencedDocuments{926 description{927 locale928 text929 }930 issueDate931 referenceId932 referenceType{933 description934 code935 }936 }937 taxDescription{938 taxName{939 code940 description941 }942 roundingAmount943 taxAmount944 taxSubtotal{945 baseUnitMeasureCode{946 code947 description948 }949 perUnitAmount950 taxAmount951 percent952 953 taxableAmount954 }955 }956 transactions{957 documentId958 insertedAt959 requestedAt960 respondedAt961 transactionChannel962 transactionFrom963 transactionId964 transactionStage965 transactionStatus{966 message967 title968 }969 transactionTo970 transactionType971 updatedAt972 }973 updatedAt974 files{975 graphicalRepresentationHtml{976 data977 fileType978 filename979 }980 attachedDocument{981 data982 fileType983 filename984 }985 }986 }987 errors{988 helpText989 id990 language991 message992 subType993 title994 type995 }996 warnings{997 helpText998 id999 language1000 message1001 subType1002 title1003 type1004 }1005 notifications{1006 helpText1007 id1008 language1009 message1010 subType1011 title1012 type1013 }1014 }1015 }';1016 1017 return $graphQL;1018 764 } 1019 765 … … 1055 801 } 1056 802 lineExtensionAmount: "'. $item[ 'value' ] .'" 1057 lineId: 1803 lineId: '. $idsequence .' 1058 804 price: { 1059 805 priceAmount: "'. $basevalue .'" … … 1079 825 unitCode: CO_ZZ 1080 826 }'; 827 828 $idsequence++; 1081 829 } 1082 830 … … 1103 851 { 1104 852 $result = false; 1105 $token = get_option( 'yabi_token' ); 1106 $url = get_option( 'yabi_url_client' ); 853 $yabi_settings = get_option( 'yabi_settings' ); 1107 854 1108 855 $post_data = json_encode( array( 'query' => $graphQL ) ); … … 1110 857 $headers = array( 1111 858 'Content-Type' => 'application/json', 1112 'Authorization' => 'Bearer ' . $ token,859 'Authorization' => 'Bearer ' . $yabi_settings[ 'token' ], 1113 860 ); 1114 861 … … 1123 870 ); 1124 871 1125 $response = wp_remote_post( $ url, $args );1126 1127 if( isset( $response[ 'body'] ) )872 $response = wp_remote_post( $yabi_settings[ 'url_client' ], $args ); 873 874 if( isset( $response[ 'body' ] ) ) 1128 875 { 1129 if( !empty( $response[ 'body'] ) )876 if( !empty( $response[ 'body' ] ) ) 1130 877 { 1131 return json_decode( $response[ 'body'], true );878 return json_decode( $response[ 'body' ], true ); 1132 879 } 1133 880 else -
wc-yabi/trunk/languages/yabi-wc-es_CO.po
r2644114 r3121708 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "POT-Creation-Date: 2020-12-02 23:02+0000\n" 6 "PO-Revision-Date: 202 1-12-10 17:04-0500\n"6 "PO-Revision-Date: 2024-07-18 19:31+0000\n" 7 7 "Last-Translator: \n" 8 "Language-Team: \n"8 "Language-Team: Spanish (Colombia)\n" 9 9 "Language: es_CO\n" 10 10 "MIME-Version: 1.0\n" … … 12 12 "Content-Transfer-Encoding: 8bit\n" 13 13 "Plural-Forms: nplurals=2; plural=n != 1;\n" 14 "X-Generator: Poedit 3.0.1\n"15 "X-Loco-Version: 2. 4.6; wp-5.5.3\n"16 17 #: content/information.php:1 0114 "X-Generator: Loco https://localise.biz/\n" 15 "X-Loco-Version: 2.6.10; wp-6.5.4" 16 17 #: content/information.php:130 18 18 msgid "About the plugin" 19 19 msgstr "Acerca del plugin" 20 20 21 #: content/product-invoice.php: 53 content/product.php:20121 #: content/product-invoice.php:84 content/product.php:200 22 22 msgid "Address" 23 23 msgstr "Dirección" 24 24 25 #: content/information.php:77 26 msgid "All fields are required except for the note" 27 msgstr "Todos los campos son obligatorios a excepcion de la nota" 28 29 #: content/settings.php:45 25 #: content/settings.php:102 26 msgid "Automatic" 27 msgstr "Automático" 28 29 #: content/information.php:37 30 msgid "" 31 "Automatic: Generates automatic invoices, this depends on whether the data " 32 "has been filled out correctly." 33 msgstr "" 34 "Automático: Genera facturas automáticas, esto depende de si los datos se han " 35 "completado correctamente." 36 37 #: content/settings.php:146 30 38 msgid "Business Unit Uuid" 31 39 msgstr "Unidad de negocio Uuid" 32 40 33 #: content/product-invoice.php:60 content/product.php:208 34 msgid "City Code" 35 msgstr "Código de ciudad" 36 37 #: content/information.php:27 content/information.php:51 41 #: content/information.php:24 42 msgid "Cash: The payment is made immediately." 43 msgstr "Efectivo: El pago se realiza de forma inmediata." 44 45 #: content/product.php:207 46 msgid "City" 47 msgstr "Ciudad" 48 49 #: content/information.php:57 content/information.php:81 38 50 #, fuzzy 39 51 msgid "Click in button "Save"." 40 52 msgstr "Clic en el botón "Guardar"" 41 53 42 #: content/information.php: 4454 #: content/information.php:74 43 55 msgid "Click on "Business Units"." 44 56 msgstr "Clic en "Unidad de negocio"" 45 57 46 #: content/information.php: 4558 #: content/information.php:75 47 59 msgid "" 48 60 "Click on a business unit, this displays the information of the business unit." … … 51 63 "negocio" 52 64 53 #: content/information.php: 7865 #: content/information.php:107 54 66 msgid "Click on the \"Save\" button to save the information of the fields" 55 67 msgstr "Clic en el botón \"Guardar\" para guardar la información de los campos" 56 68 57 #: content/information.php: 7969 #: content/information.php:108 58 70 msgid "" 59 71 "Click on the button \"Save and generate\" for when you are sure to generate " … … 65 77 "editar los campos. " 66 78 67 #: content/information.php: 7379 #: content/information.php:103 68 80 msgid "Click on the order to open the details" 69 81 msgstr "Clic en el pedido para abrir los detalles" 70 82 71 #: content/information.php: 7183 #: content/information.php:101 72 84 msgid "Click on WooCommerce orders" 73 85 msgstr "Clic en pedidos de WooCommerce" 74 86 75 #: content/settings.php: 3987 #: content/settings.php:130 76 88 msgid "Client" 77 89 msgstr "Cliente" 78 90 79 #: content/information.php:1 1791 #: content/information.php:146 80 92 msgid "Code QR" 81 93 msgstr "Código QR" 82 94 83 #: content/product .php:12595 #: content/product-invoice.php:13 content/product.php:128 84 96 msgid "Commercial Name" 85 97 msgstr "Nombre comercial" 86 98 87 #: content/information.php:49 99 #: content/settings.php:139 100 msgid "Company" 101 msgstr "Empresa" 102 103 #: content/information.php:79 88 104 msgid "" 89 105 "Copy and paste the personalized Token in the text field "Token"." … … 91 107 "Copia y pega el Token personalizado en la caja de texto "Token"" 92 108 93 #: content/information.php: 46109 #: content/information.php:76 94 110 msgid "Copy the code of the business unit." 95 111 msgstr "Copia el codigo de la unidad de negocio." 96 112 97 #: content/information.php: 50113 #: content/information.php:80 98 114 msgid "Copy the example URL client in the text field "URL client"." 99 115 msgstr "" … … 105 121 msgstr "Crea facturas electrónicas de tus compras de Woocommerce en Yabi" 106 122 107 #: content/information.php:76 123 #: content/settings.php:74 124 msgid "Credit" 125 msgstr "Crédito" 126 127 #: content/settings.php:80 128 msgid "Credit days" 129 msgstr "Días de crédito" 130 131 #: content/information.php:106 108 132 msgid "" 109 133 "Depending on the type of person, you must complete the additional information" 110 134 msgstr "Según el tipo de persona debe completar la información adicional" 111 135 112 #: content/product-invoice.php: 39 content/product.php:187136 #: content/product-invoice.php:70 content/product.php:186 113 137 msgid "Email" 114 138 msgstr "Correo electrónico" 115 139 116 #: content/information.php: 43140 #: content/information.php:73 117 141 msgid "Enter the Yabi system" 118 142 msgstr "Ingrese al sistema de Yabi" 119 143 120 #: content/information.php: 25144 #: content/information.php:55 121 145 msgid "" 122 146 "Fill the text field \"Invoice Name\" with the invoice name. Example: \"SETT-" … … 126 150 "Ejemplo: \"SETT-\", \"SE\"." 127 151 128 #: content/information.php: 26152 #: content/information.php:56 129 153 msgid "" 130 154 "Fill the text field with the consecutive invoice. Example: if the " … … 134 158 "consecutivo actual es 25, favor colocar en la caja de texto el número 26." 135 159 136 #: content/information.php: 72160 #: content/information.php:102 137 161 msgid "" 138 162 "Find the order in the completed state for which you want to generate an " … … 141 165 "Buscar el pedido en estado completado al cual se desea generar una factura" 142 166 143 #: content/information.php: 24 content/information.php:47167 #: content/information.php:54 content/information.php:77 144 168 msgid "Go to" 145 169 msgstr "Ir a" 146 170 147 #: content/information.php: 62171 #: content/information.php:92 148 172 msgid "How to generate an invoice?" 149 173 msgstr "Cómo generar una factura?" … … 157 181 msgstr "https://mireunion.com/yabi" 158 182 159 #: content/product-invoice.php:32 content/product.php:179 183 #: content/settings.php:88 content/information.php:28 184 msgid "I agree to modify the checkout" 185 msgstr "Acepto modificar el checkout" 186 187 #: includes/woo.php:72 content/product-invoice.php:63 content/product.php:178 160 188 msgid "Identifier" 161 189 msgstr "Identificación" 162 190 163 #: content/admin.php:18 content/information.php:4 191 #: includes/woo.php:83 192 msgid "Identifier digit" 193 msgstr "Dígito identificación" 194 195 #: includes/woo.php:104 196 msgid "Identifier is a required Field!" 197 msgstr "¡El identificador es un campo obligatorio!" 198 199 #: content/settings.php:73 200 msgid "In cash" 201 msgstr "En efectivo" 202 203 #: content/information.php:25 204 msgid "" 205 "In Credit: The payment is credited and you can select the number of days of " 206 "the credit, generally it is 30 days" 207 msgstr "" 208 "En Crédito: Se acredita el pago y puedes seleccionar el número de días del " 209 "crédito, generalmente son 30 días" 210 211 #: content/information.php:4 content/admin.php:18 164 212 msgid "Information" 165 213 msgstr "Información" 166 214 167 #: content/information.php: 37215 #: content/information.php:67 168 216 msgid "Instructions for client" 169 217 msgstr "Instrucciones para el cliente" 170 218 171 #: content/information.php: 17219 #: content/information.php:47 172 220 msgid "Instructions for invoice" 173 221 msgstr "Instrucciones para la facturación" 174 222 175 #: content/settings.php:20 223 #: content/information.php:17 224 msgid "Instructions for settings" 225 msgstr "Instrucciones para la configuración" 226 227 #. Name of the plugin 228 msgid "Integrate Yabi for WooCommerce" 229 msgstr "Integración Yabi para WooCommerce" 230 231 #: content/settings.php:109 176 232 msgid "Invoice" 177 233 msgstr "Factura" 178 234 179 #: content/settings.php: 24235 #: content/settings.php:115 180 236 msgid "Invoice Name" 181 237 msgstr "Nombre de factura" 182 238 183 #: content/ product-invoice.php:81 content/settings.php:27239 #: content/settings.php:122 content/product-invoice.php:124 184 240 msgid "Invoice Number" 185 241 msgstr "Número de factura" 186 242 187 #: content/product-invoice.php: 88243 #: content/product-invoice.php:131 188 244 msgid "Invoice Serial" 189 245 msgstr "Serie de la factura" 190 246 191 #: content/product.php:144 192 msgid "Is the purchaser responsible for IVA?" 193 msgstr "El adquiriente es responsable de IVA?" 194 195 #: content/product-invoice.php:20 content/product.php:157 247 #: content/settings.php:98 content/information.php:34 248 msgid "Invoice type" 249 msgstr "Tipo de factura" 250 251 #: content/information.php:21 252 msgid "Invoices can be defined in Cash or In Credit" 253 msgstr "Las facturas se pueden definir en efectivo o en crédito." 254 255 #: content/product-invoice.php:40 content/product.php:149 196 256 msgid "Last Name" 197 257 msgstr "Apellido" 258 259 #: includes/woo.php:26 260 msgid "Legal Entity" 261 msgstr "Entidad legal" 262 263 #: content/settings.php:101 264 msgid "Manual" 265 msgstr "Manual" 266 267 #: content/information.php:38 268 msgid "Manual: Generate invoices manually in order administration" 269 msgstr "Manual: Genera facturas manualmente en la administración de pedidos." 198 270 199 271 #. Author of the plugin … … 201 273 msgstr "Mex Avila" 202 274 203 #: content/product-invoice.php: 13 content/product.php:150275 #: content/product-invoice.php:22 content/product.php:135 204 276 msgid "Name" 205 277 msgstr "Nombre" 206 278 207 #: content/product-invoice.php:74 content/product.php:222 279 #: includes/woo.php:25 280 msgid "Natural Person" 281 msgstr "Persona natural" 282 283 #: content/settings.php:91 284 msgid "No" 285 msgstr "No" 286 287 #: content/product-invoice.php:115 content/product.php:243 208 288 msgid "Note Description" 209 289 msgstr "Descripción de la nota" 210 290 211 #: content/product-invoice.php: 67 content/product.php:215291 #: content/product-invoice.php:104 content/product.php:236 212 292 msgid "Note Name" 213 293 msgstr "Nombre de la nota" 214 294 215 #: content/product-invoice.php: 69 content/product.php:213295 #: content/product-invoice.php:93 content/product.php:229 216 296 msgid "Observations" 217 297 msgstr "Observaciones" 218 298 219 #: content/information.php: 48299 #: content/information.php:78 220 300 msgid "" 221 301 "Paste the previously copied code in the text field "Business Unit " … … 225 305 "Uuid\"." 226 306 227 #: content/product.php:231 307 #: content/settings.php:70 308 msgid "Payment type" 309 msgstr "Tipo de pago" 310 311 #: content/settings.php:140 312 msgid "Person" 313 msgstr "Persona natural" 314 315 #: wc-yabi.php:211 316 msgid "" 317 "Please enter the Yabi plugin configuration, as you need to enter new data " 318 "for it to work correctly" 319 msgstr "" 320 "Ingrese a la configuración del complemento Yabi, ya que necesita ingresar " 321 "nuevos datos para que funcione correctamente" 322 323 #: content/product.php:222 324 msgid "Postcode" 325 msgstr "Código postal" 326 327 #: content/product.php:252 228 328 msgid "Save" 229 329 msgstr "Guardar" 230 330 231 #: content/product.php:2 33331 #: content/product.php:254 232 332 msgid "Save & Generate" 233 333 msgstr "Guardar y generar" 334 335 #: includes/woo.php:49 content/product-invoice.php:49 content/product.php:156 336 msgid "Second Last Name" 337 msgstr "Segundo apellido" 338 339 #: includes/woo.php:38 content/product-invoice.php:31 content/product.php:142 340 msgid "Second Name" 341 msgstr "Segundo nombre" 342 343 #: includes/woo.php:23 344 msgid "Select the type of person" 345 msgstr "Selecciona el tipo de persona" 234 346 235 347 #: content/admin.php:4 … … 237 349 msgstr "Configuración guardada!" 238 350 239 #: content/ admin.php:19 content/settings.php:14351 #: content/settings.php:58 content/settings.php:64 content/admin.php:19 240 352 msgid "Settings" 241 353 msgstr "Configuración" 242 354 243 #: content/information.php: 24 content/information.php:47355 #: content/information.php:54 content/information.php:77 244 356 msgid "settings page" 245 357 msgstr "pagina de configuración" 246 358 247 #: content/information.php:1 06359 #: content/information.php:135 248 360 msgid "Support this plugin" 249 361 msgstr "Colabora con este plugin" 250 362 251 #: content/product.php:132 252 msgid "Tax Level Code" 253 msgstr "Código de nivel de impuestos" 254 255 #: content/product.php:135 256 msgid "Tax obligations registered in the RUT: O-05, O-48 (Separate by comma)" 257 msgstr "" 258 "Obligaciones fiscales registradas en el RUT: O-05, O-48 (Separar por coma)" 259 260 #: content/product.php:140 261 msgid "Tax Scheme" 262 msgstr "Régimen fiscal" 263 264 #: content/product-invoice.php:46 content/product.php:194 363 #: content/product-invoice.php:77 content/product.php:193 265 364 msgid "Telephone" 266 365 msgstr "Teléfono" 267 366 268 #: content/information.php: 21367 #: content/information.php:51 269 368 msgid "" 270 369 "The fields of the invoice are the name and the consecutive number of the " … … 272 371 "Please fill in the corresponding data. Example: SETT-26." 273 372 msgstr "" 274 "Los campos de la factura son el nombre y el número consecutivo de la " 275 "factura, en la DIAN tuvo que pasar el requisito para la numeración. Por " 276 "favor complete los datos correspondientes. Ejemplo: SETT-26." 277 278 #: content/product.php:182 279 msgid "The NIT must include the check digit separated by hyphen" 280 msgstr "El nit debe incluir el dígito de verificación separado por guión" 281 282 #: content/information.php:66 283 msgid "" 284 "The process to generate an invoice is not automatic, it is a manual process " 285 "in which the following steps must be carried out." 286 msgstr "" 287 "El proceso para generar una factura no es automático, es un proceso manual " 288 "en el cual se debe ejecutar los siguientes pasos." 289 290 #: content/information.php:68 373 "Los campos de la factura son el nombre y el número consecutivo de la factura," 374 " en la DIAN tuvo que pasar el requisito para la numeración. Por favor " 375 "complete los datos correspondientes. Ejemplo: SETT-26." 376 377 #: content/information.php:96 378 msgid "The process to generate an invoice." 379 msgstr "El proceso para generar una factura." 380 381 #: content/information.php:98 382 #| msgid "" 383 #| "The WooCommerce purchase must be in a completed state, in order to " 384 #| "generate the electronic invoice." 291 385 msgid "" 292 386 "The WooCommerce purchase must be in a completed state, in order to generate " 293 "the electronic invoice. "387 "the electronic invoice. (Automatic or Manual)" 294 388 msgstr "" 295 389 "La compra de WooCommerce debe estar en estado completado, para poder generar " 296 "la factura electrónica." 297 298 #: content/information.php:80 390 "la factura electrónica. (Automático o Manual)" 391 392 #: content/information.php:31 393 msgid "" 394 "This option allows you to modify the default Woocommerce form to allow the " 395 "custom fields that Yabi uses, such as IDs or NIT. It also displays the " 396 "departments and municipalities of Colombia with their respective DIAN codes. " 397 "It also generates a link so that people can generate the address as " 398 "necessary for the DIAN." 399 msgstr "" 400 "Esta opción le permite modificar el formulario predeterminado de Woocommerce " 401 "para permitir los campos personalizados que utiliza Yabi, como cédula o NIT. " 402 "También muestra los departamentos y municipios de Colombia con sus " 403 "respectivos códigos DIAN. También genera un enlace para que las personas " 404 "puedan generar la dirección necesaria para la DIAN." 405 406 #: content/information.php:109 299 407 msgid "To download the invoice you have to enter the Yabi platform" 300 408 msgstr "Para descargar la factura tiene que ingresar a la plataforma de Yabi" 301 409 302 #: content/information.php: 42410 #: content/information.php:72 303 411 msgid "" 304 412 "To get started, contact Yabi to send you the personalized Token of your " … … 308 416 "de su cuenta por correo electrónico." 309 417 310 #: content/settings.php: 53418 #: content/settings.php:154 311 419 msgid "Token" 312 420 msgstr "Token" 313 421 314 #: content/product-invoice.php:27 content/product.php:164422 #: includes/woo.php:60 content/product-invoice.php:58 content/product.php:163 315 423 msgid "Type of document" 316 424 msgstr "Tipo de documento" 317 425 318 #: content/product.php:110 426 #: includes/woo.php:99 427 msgid "Type of document is a required Field!" 428 msgstr "¡El tipo de documento es un campo obligatorio!" 429 430 #: content/settings.php:136 431 msgid "Type of Owner" 432 msgstr "Tipo de dueño" 433 434 #: content/product.php:113 319 435 msgid "Type of person" 320 436 msgstr "Tipo de persona" 321 437 322 #: content/settings.php:61 438 #: includes/woo.php:94 439 msgid "Type of person is a required Field!" 440 msgstr "¡El tipo de persona es un campo obligatorio!" 441 442 #: content/settings.php:162 323 443 msgid "URL client" 324 444 msgstr "Cliente URL" 325 445 326 #: content/information.php: 74446 #: content/information.php:104 327 447 msgid "" 328 448 "When displaying the order information, the Yabi module will be displayed at " … … 332 452 "el módulo de Yabi" 333 453 334 #: content/information.php: 43454 #: content/information.php:73 335 455 msgid "with your username and password." 336 456 msgstr "con su nombre de usuario y contraseña." 337 457 338 #: yabi.php:78458 #: wc-yabi.php:94 339 459 msgid "Yabi - Invoice Data" 340 460 msgstr "Yabi - Información de facturación" 341 461 342 #. Name of the plugin343 462 #: content/admin.php:15 344 463 msgid "Yabi for WooCommerce" 345 464 msgstr "Yabi para WooCommerce" 346 465 347 #: content/information.php:75 466 #: content/settings.php:92 467 msgid "Yes" 468 msgstr "Si" 469 470 #: content/information.php:105 348 471 msgid "You must select the type of person" 349 472 msgstr "Debe seleccionar el tipo de persona" 350 351 #: content/settings.php:45352 msgid "Type of Owner"353 msgstr "Tipo de dueño"354 355 #: content/settings.php:48356 msgid "Company"357 msgstr "Empresa"358 359 #: content/settings.php:49360 msgid "Person"361 msgstr "Persona natural" -
wc-yabi/trunk/languages/yabi-wc-es_ES.po
r2644114 r3121708 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "POT-Creation-Date: 2020-12-02 23:02+0000\n" 6 "PO-Revision-Date: 202 1-12-10 17:03-0500\n"6 "PO-Revision-Date: 2024-07-18 19:32+0000\n" 7 7 "Last-Translator: \n" 8 "Language-Team: Español\n"8 "Language-Team: Spanish (Spain)\n" 9 9 "Language: es_ES\n" 10 10 "MIME-Version: 1.0\n" … … 12 12 "Content-Transfer-Encoding: 8bit\n" 13 13 "Plural-Forms: nplurals=2; plural=n != 1;\n" 14 "X-Generator: Poedit 3.0.1\n" 15 "X-Loco-Version: 2.4.6; wp-5.5.3\n" 16 17 #: content/information.php:101 14 "X-Generator: Loco https://localise.biz/\n" 15 "X-Loco-Version: 2.6.10; wp-6.5.4\n" 16 "X-Loco-Fallback: es_CO\n" 17 "X-Loco-Template: languages/yabi-wc-es_CO.po\n" 18 "X-Loco-Template-Mode: PO,JSON" 19 20 #: content/information.php:130 18 21 msgid "About the plugin" 19 22 msgstr "Acerca del plugin" 20 23 21 #: content/product-invoice.php: 53 content/product.php:20124 #: content/product-invoice.php:84 content/product.php:200 22 25 msgid "Address" 23 26 msgstr "Dirección" 24 27 25 #: content/information.php:77 26 msgid "All fields are required except for the note" 27 msgstr "Todos los campos son obligatorios a excepcion de la nota" 28 29 #: content/settings.php:45 28 #: content/settings.php:102 29 msgid "Automatic" 30 msgstr "Automático" 31 32 #: content/information.php:37 33 msgid "" 34 "Automatic: Generates automatic invoices, this depends on whether the data " 35 "has been filled out correctly." 36 msgstr "" 37 "Automático: Genera facturas automáticas, esto depende de si los datos se han " 38 "completado correctamente." 39 40 #: content/settings.php:146 30 41 msgid "Business Unit Uuid" 31 42 msgstr "Unidad de negocio Uuid" 32 43 33 #: content/product-invoice.php:60 content/product.php:208 34 msgid "City Code" 35 msgstr "Código de ciudad" 36 37 #: content/information.php:27 content/information.php:51 44 #: content/information.php:24 45 msgid "Cash: The payment is made immediately." 46 msgstr "Efectivo: El pago se realiza de forma inmediata." 47 48 #: content/product.php:207 49 msgid "City" 50 msgstr "Ciudad" 51 52 #: content/information.php:57 content/information.php:81 53 #, fuzzy 38 54 msgid "Click in button "Save"." 39 msgstr "Clic en el botón \"Guardar\""40 41 #: content/information.php: 4455 msgstr "Clic en el botón "Guardar"" 56 57 #: content/information.php:74 42 58 msgid "Click on "Business Units"." 43 msgstr "Clic en \"Unidad de negocio\""44 45 #: content/information.php: 4559 msgstr "Clic en "Unidad de negocio"" 60 61 #: content/information.php:75 46 62 msgid "" 47 63 "Click on a business unit, this displays the information of the business unit." … … 50 66 "negocio" 51 67 52 #: content/information.php: 7868 #: content/information.php:107 53 69 msgid "Click on the \"Save\" button to save the information of the fields" 54 70 msgstr "Clic en el botón \"Guardar\" para guardar la información de los campos" 55 71 56 #: content/information.php: 7972 #: content/information.php:108 57 73 msgid "" 58 74 "Click on the button \"Save and generate\" for when you are sure to generate " … … 60 76 "fields again." 61 77 msgstr "" 62 "Clic en el botón \"Guardar y generar\" para cuando este seguro de generar la"63 " facturación, luego de que la factura se genera no podrá volver a editar los"64 " campos. "65 66 #: content/information.php: 7378 "Clic en el botón "Guardar y generar" para cuando este seguro de " 79 "generar la facturación, luego de que la factura se genera no podrá volver a " 80 "editar los campos. " 81 82 #: content/information.php:103 67 83 msgid "Click on the order to open the details" 68 84 msgstr "Clic en el pedido para abrir los detalles" 69 85 70 #: content/information.php: 7186 #: content/information.php:101 71 87 msgid "Click on WooCommerce orders" 72 88 msgstr "Clic en pedidos de WooCommerce" 73 89 74 #: content/settings.php: 3990 #: content/settings.php:130 75 91 msgid "Client" 76 92 msgstr "Cliente" 77 93 78 #: content/information.php:1 1794 #: content/information.php:146 79 95 msgid "Code QR" 80 96 msgstr "Código QR" 81 97 82 #: content/product .php:12598 #: content/product-invoice.php:13 content/product.php:128 83 99 msgid "Commercial Name" 84 100 msgstr "Nombre comercial" 85 101 86 #: content/information.php:49 102 #: content/settings.php:139 103 msgid "Company" 104 msgstr "Empresa" 105 106 #: content/information.php:79 87 107 msgid "" 88 108 "Copy and paste the personalized Token in the text field "Token"." 89 msgstr "Copia y pega el Token personalizado en la caja de texto \"Token\"" 90 91 #: content/information.php:46 109 msgstr "" 110 "Copia y pega el Token personalizado en la caja de texto "Token"" 111 112 #: content/information.php:76 92 113 msgid "Copy the code of the business unit." 93 114 msgstr "Copia el codigo de la unidad de negocio." 94 115 95 #: content/information.php: 50116 #: content/information.php:80 96 117 msgid "Copy the example URL client in the text field "URL client"." 97 msgstr "Copia el ejemplo del cliente URL en la caja de texto \"Cliente URL\"" 118 msgstr "" 119 "Copia el ejemplo del cliente URL en la caja de texto "Cliente URL"" 98 120 99 121 #. Description of the plugin … … 102 124 msgstr "Crea facturas electrónicas de tus compras de Woocommerce en Yabi" 103 125 104 #: content/information.php:76 126 #: content/settings.php:74 127 msgid "Credit" 128 msgstr "Crédito" 129 130 #: content/settings.php:80 131 msgid "Credit days" 132 msgstr "Días de crédito" 133 134 #: content/information.php:106 105 135 msgid "" 106 136 "Depending on the type of person, you must complete the additional information" 107 137 msgstr "Según el tipo de persona debe completar la información adicional" 108 138 109 #: content/product-invoice.php: 39 content/product.php:187139 #: content/product-invoice.php:70 content/product.php:186 110 140 msgid "Email" 111 141 msgstr "Correo electrónico" 112 142 113 #: content/information.php: 43143 #: content/information.php:73 114 144 msgid "Enter the Yabi system" 115 145 msgstr "Ingrese al sistema de Yabi" 116 146 117 #: content/information.php: 25147 #: content/information.php:55 118 148 msgid "" 119 149 "Fill the text field \"Invoice Name\" with the invoice name. Example: \"SETT-" … … 123 153 "Ejemplo: \"SETT-\", \"SE\"." 124 154 125 #: content/information.php: 26155 #: content/information.php:56 126 156 msgid "" 127 157 "Fill the text field with the consecutive invoice. Example: if the " … … 131 161 "consecutivo actual es 25, favor colocar en la caja de texto el número 26." 132 162 133 #: content/information.php: 72163 #: content/information.php:102 134 164 msgid "" 135 165 "Find the order in the completed state for which you want to generate an " … … 138 168 "Buscar el pedido en estado completado al cual se desea generar una factura" 139 169 140 #: content/information.php: 24 content/information.php:47170 #: content/information.php:54 content/information.php:77 141 171 msgid "Go to" 142 172 msgstr "Ir a" 143 173 144 #: content/information.php: 62174 #: content/information.php:92 145 175 msgid "How to generate an invoice?" 146 176 msgstr "Cómo generar una factura?" … … 154 184 msgstr "https://mireunion.com/yabi" 155 185 156 #: content/product-invoice.php:32 content/product.php:179 186 #: content/settings.php:88 content/information.php:28 187 msgid "I agree to modify the checkout" 188 msgstr "Acepto modificar el checkout" 189 190 #: includes/woo.php:72 content/product-invoice.php:63 content/product.php:178 157 191 msgid "Identifier" 158 192 msgstr "Identificación" 159 193 160 #: content/admin.php:18 content/information.php:4 194 #: includes/woo.php:83 195 msgid "Identifier digit" 196 msgstr "Dígito identificación" 197 198 #: includes/woo.php:104 199 msgid "Identifier is a required Field!" 200 msgstr "¡El identificador es un campo obligatorio!" 201 202 #: content/settings.php:73 203 msgid "In cash" 204 msgstr "En efectivo" 205 206 #: content/information.php:25 207 msgid "" 208 "In Credit: The payment is credited and you can select the number of days of " 209 "the credit, generally it is 30 days" 210 msgstr "" 211 "En Crédito: Se acredita el pago y puedes seleccionar el número de días del " 212 "crédito, generalmente son 30 días" 213 214 #: content/information.php:4 content/admin.php:18 161 215 msgid "Information" 162 216 msgstr "Información" 163 217 164 #: content/information.php: 37218 #: content/information.php:67 165 219 msgid "Instructions for client" 166 220 msgstr "Instrucciones para el cliente" 167 221 168 #: content/information.php: 17222 #: content/information.php:47 169 223 msgid "Instructions for invoice" 170 224 msgstr "Instrucciones para la facturación" 171 225 172 #: content/settings.php:20 226 #: content/information.php:17 227 msgid "Instructions for settings" 228 msgstr "Instrucciones para la configuración" 229 230 #. Name of the plugin 231 msgid "Integrate Yabi for WooCommerce" 232 msgstr "Integración Yabi para WooCommerce" 233 234 #: content/settings.php:109 173 235 msgid "Invoice" 174 236 msgstr "Factura" 175 237 176 #: content/settings.php: 24238 #: content/settings.php:115 177 239 msgid "Invoice Name" 178 240 msgstr "Nombre de factura" 179 241 180 #: content/ product-invoice.php:81 content/settings.php:27242 #: content/settings.php:122 content/product-invoice.php:124 181 243 msgid "Invoice Number" 182 244 msgstr "Número de factura" 183 245 184 #: content/product-invoice.php: 88246 #: content/product-invoice.php:131 185 247 msgid "Invoice Serial" 186 248 msgstr "Serie de la factura" 187 249 188 #: content/product.php:144 189 msgid "Is the purchaser responsible for IVA?" 190 msgstr "El adquiriente es responsable de IVA?" 191 192 #: content/product-invoice.php:20 content/product.php:157 250 #: content/settings.php:98 content/information.php:34 251 msgid "Invoice type" 252 msgstr "Tipo de factura" 253 254 #: content/information.php:21 255 msgid "Invoices can be defined in Cash or In Credit" 256 msgstr "Las facturas se pueden definir en efectivo o en crédito." 257 258 #: content/product-invoice.php:40 content/product.php:149 193 259 msgid "Last Name" 194 260 msgstr "Apellido" 261 262 #: includes/woo.php:26 263 msgid "Legal Entity" 264 msgstr "Entidad legal" 265 266 #: content/settings.php:101 267 msgid "Manual" 268 msgstr "Manual" 269 270 #: content/information.php:38 271 msgid "Manual: Generate invoices manually in order administration" 272 msgstr "Manual: Genera facturas manualmente en la administración de pedidos." 195 273 196 274 #. Author of the plugin … … 198 276 msgstr "Mex Avila" 199 277 200 #: content/product-invoice.php: 13 content/product.php:150278 #: content/product-invoice.php:22 content/product.php:135 201 279 msgid "Name" 202 280 msgstr "Nombre" 203 281 204 #: content/product-invoice.php:74 content/product.php:222 282 #: includes/woo.php:25 283 msgid "Natural Person" 284 msgstr "Persona natural" 285 286 #: content/settings.php:91 287 msgid "No" 288 msgstr "No" 289 290 #: content/product-invoice.php:115 content/product.php:243 205 291 msgid "Note Description" 206 292 msgstr "Descripción de la nota" 207 293 208 #: content/product-invoice.php: 67 content/product.php:215294 #: content/product-invoice.php:104 content/product.php:236 209 295 msgid "Note Name" 210 296 msgstr "Nombre de la nota" 211 297 212 #: content/product-invoice.php: 69 content/product.php:213298 #: content/product-invoice.php:93 content/product.php:229 213 299 msgid "Observations" 214 300 msgstr "Observaciones" 215 301 216 #: content/information.php: 48302 #: content/information.php:78 217 303 msgid "" 218 304 "Paste the previously copied code in the text field "Business Unit " … … 222 308 "Uuid\"." 223 309 224 #: content/product.php:231 310 #: content/settings.php:70 311 msgid "Payment type" 312 msgstr "Tipo de pago" 313 314 #: content/settings.php:140 315 msgid "Person" 316 msgstr "Persona natural" 317 318 #: wc-yabi.php:211 319 msgid "" 320 "Please enter the Yabi plugin configuration, as you need to enter new data " 321 "for it to work correctly" 322 msgstr "" 323 "Ingrese a la configuración del complemento Yabi, ya que necesita ingresar " 324 "nuevos datos para que funcione correctamente" 325 326 #: content/product.php:222 327 msgid "Postcode" 328 msgstr "Código postal" 329 330 #: content/product.php:252 225 331 msgid "Save" 226 332 msgstr "Guardar" 227 333 228 #: content/product.php:2 33334 #: content/product.php:254 229 335 msgid "Save & Generate" 230 336 msgstr "Guardar y generar" 337 338 #: includes/woo.php:49 content/product-invoice.php:49 content/product.php:156 339 msgid "Second Last Name" 340 msgstr "Segundo apellido" 341 342 #: includes/woo.php:38 content/product-invoice.php:31 content/product.php:142 343 msgid "Second Name" 344 msgstr "Segundo nombre" 345 346 #: includes/woo.php:23 347 msgid "Select the type of person" 348 msgstr "Selecciona el tipo de persona" 231 349 232 350 #: content/admin.php:4 … … 234 352 msgstr "Configuración guardada!" 235 353 236 #: content/ admin.php:19 content/settings.php:14354 #: content/settings.php:58 content/settings.php:64 content/admin.php:19 237 355 msgid "Settings" 238 356 msgstr "Configuración" 239 357 240 #: content/information.php: 24 content/information.php:47358 #: content/information.php:54 content/information.php:77 241 359 msgid "settings page" 242 360 msgstr "pagina de configuración" 243 361 244 #: content/information.php:1 06362 #: content/information.php:135 245 363 msgid "Support this plugin" 246 364 msgstr "Colabora con este plugin" 247 365 248 #: content/product.php:132 249 msgid "Tax Level Code" 250 msgstr "Código de nivel de impuestos" 251 252 #: content/product.php:135 253 msgid "Tax obligations registered in the RUT: O-05, O-48 (Separate by comma)" 254 msgstr "" 255 "Obligaciones fiscales registradas en el RUT: O-05, O-48 (Separar por coma)" 256 257 #: content/product.php:140 258 msgid "Tax Scheme" 259 msgstr "Régimen fiscal" 260 261 #: content/product-invoice.php:46 content/product.php:194 366 #: content/product-invoice.php:77 content/product.php:193 262 367 msgid "Telephone" 263 368 msgstr "Teléfono" 264 369 265 #: content/information.php: 21370 #: content/information.php:51 266 371 msgid "" 267 372 "The fields of the invoice are the name and the consecutive number of the " … … 269 374 "Please fill in the corresponding data. Example: SETT-26." 270 375 msgstr "" 271 "Los campos de la factura son el nombre y el número consecutivo de la " 272 "factura, en la DIAN tuvo que pasar el requisito para la numeración. Por " 273 "favor complete los datos correspondientes. Ejemplo: SETT-26." 274 275 #: content/product.php:182 276 msgid "The NIT must include the check digit separated by hyphen" 277 msgstr "El nit debe incluir el dígito de verificación separado por guión" 278 279 #: content/information.php:66 280 msgid "" 281 "The process to generate an invoice is not automatic, it is a manual process " 282 "in which the following steps must be carried out." 283 msgstr "" 284 "El proceso para generar una factura no es automático, es un proceso manual " 285 "en el cual se debe ejecutar los siguientes pasos." 286 287 #: content/information.php:68 376 "Los campos de la factura son el nombre y el número consecutivo de la factura," 377 " en la DIAN tuvo que pasar el requisito para la numeración. Por favor " 378 "complete los datos correspondientes. Ejemplo: SETT-26." 379 380 #: content/information.php:96 381 msgid "The process to generate an invoice." 382 msgstr "El proceso para generar una factura." 383 384 #: content/information.php:98 385 #| msgid "" 386 #| "The WooCommerce purchase must be in a completed state, in order to " 387 #| "generate the electronic invoice." 288 388 msgid "" 289 389 "The WooCommerce purchase must be in a completed state, in order to generate " 290 "the electronic invoice. "390 "the electronic invoice. (Automatic or Manual)" 291 391 msgstr "" 292 392 "La compra de WooCommerce debe estar en estado completado, para poder generar " 293 "la factura electrónica." 294 295 #: content/information.php:80 393 "la factura electrónica. (Automático o Manual)" 394 395 #: content/information.php:31 396 msgid "" 397 "This option allows you to modify the default Woocommerce form to allow the " 398 "custom fields that Yabi uses, such as IDs or NIT. It also displays the " 399 "departments and municipalities of Colombia with their respective DIAN codes. " 400 "It also generates a link so that people can generate the address as " 401 "necessary for the DIAN." 402 msgstr "" 403 "Esta opción le permite modificar el formulario predeterminado de Woocommerce " 404 "para permitir los campos personalizados que utiliza Yabi, como cédula o NIT. " 405 "También muestra los departamentos y municipios de Colombia con sus " 406 "respectivos códigos DIAN. También genera un enlace para que las personas " 407 "puedan generar la dirección necesaria para la DIAN." 408 409 #: content/information.php:109 296 410 msgid "To download the invoice you have to enter the Yabi platform" 297 411 msgstr "Para descargar la factura tiene que ingresar a la plataforma de Yabi" 298 412 299 #: content/information.php: 42413 #: content/information.php:72 300 414 msgid "" 301 415 "To get started, contact Yabi to send you the personalized Token of your " … … 305 419 "de su cuenta por correo electrónico." 306 420 307 #: content/settings.php: 53421 #: content/settings.php:154 308 422 msgid "Token" 309 423 msgstr "Token" 310 424 311 #: content/product-invoice.php:27 content/product.php:164425 #: includes/woo.php:60 content/product-invoice.php:58 content/product.php:163 312 426 msgid "Type of document" 313 427 msgstr "Tipo de documento" 314 428 315 #: content/product.php:110 429 #: includes/woo.php:99 430 msgid "Type of document is a required Field!" 431 msgstr "¡El tipo de documento es un campo obligatorio!" 432 433 #: content/settings.php:136 434 msgid "Type of Owner" 435 msgstr "Tipo de dueño" 436 437 #: content/product.php:113 316 438 msgid "Type of person" 317 439 msgstr "Tipo de persona" 318 440 319 #: content/settings.php:61 441 #: includes/woo.php:94 442 msgid "Type of person is a required Field!" 443 msgstr "¡El tipo de persona es un campo obligatorio!" 444 445 #: content/settings.php:162 320 446 msgid "URL client" 321 447 msgstr "Cliente URL" 322 448 323 #: content/information.php: 74449 #: content/information.php:104 324 450 msgid "" 325 451 "When displaying the order information, the Yabi module will be displayed at " … … 329 455 "el módulo de Yabi" 330 456 331 #: content/information.php: 43457 #: content/information.php:73 332 458 msgid "with your username and password." 333 459 msgstr "con su nombre de usuario y contraseña." 334 460 335 #: yabi.php:78461 #: wc-yabi.php:94 336 462 msgid "Yabi - Invoice Data" 337 463 msgstr "Yabi - Información de facturación" 338 464 339 #. Name of the plugin340 465 #: content/admin.php:15 341 466 msgid "Yabi for WooCommerce" 342 467 msgstr "Yabi para WooCommerce" 343 468 344 #: content/information.php:75 469 #: content/settings.php:92 470 msgid "Yes" 471 msgstr "Si" 472 473 #: content/information.php:105 345 474 msgid "You must select the type of person" 346 475 msgstr "Debe seleccionar el tipo de persona" 347 348 #: content/settings.php:45349 msgid "Type of Owner"350 msgstr "Tipo de dueño"351 352 #: content/settings.php:48353 msgid "Company"354 msgstr "Empresa"355 356 #: content/settings.php:49357 msgid "Person"358 msgstr "Persona natural" -
wc-yabi/trunk/languages/yabi-wc.pot
r2644114 r3121708 4 4 "Project-Id-Version: Yabi for WooCommerce\n" 5 5 "Report-Msgid-Bugs-To: \n" 6 "POT-Creation-Date: 202 0-12-02 23:02+0000\n"6 "POT-Creation-Date: 2024-07-18 19:29+0000\n" 7 7 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 8 8 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 16 16 "X-Loco-Version: 2.4.6; wp-5.5.3" 17 17 18 #: content/information.php:1 0118 #: content/information.php:130 19 19 msgid "About the plugin" 20 20 msgstr "" 21 21 22 #: content/product-invoice.php: 53 content/product.php:20122 #: content/product-invoice.php:84 content/product.php:200 23 23 msgid "Address" 24 24 msgstr "" 25 25 26 #: content/information.php:77 27 msgid "All fields are required except for the note" 28 msgstr "" 29 30 #: content/settings.php:45 26 #: content/settings.php:102 27 msgid "Automatic" 28 msgstr "" 29 30 #: content/information.php:37 31 msgid "" 32 "Automatic: Generates automatic invoices, this depends on whether the data " 33 "has been filled out correctly." 34 msgstr "" 35 36 #: content/settings.php:146 31 37 msgid "Business Unit Uuid" 32 38 msgstr "" 33 39 34 #: content/product-invoice.php:60 content/product.php:208 35 msgid "City Code" 36 msgstr "" 37 38 #: content/information.php:27 content/information.php:51 40 #: content/information.php:24 41 msgid "Cash: The payment is made immediately." 42 msgstr "" 43 44 #: content/product.php:207 45 msgid "City" 46 msgstr "" 47 48 #: content/information.php:57 content/information.php:81 39 49 msgid "Click in button "Save"." 40 50 msgstr "" 41 51 42 #: content/information.php: 4452 #: content/information.php:74 43 53 msgid "Click on "Business Units"." 44 54 msgstr "" 45 55 46 #: content/information.php: 4556 #: content/information.php:75 47 57 msgid "" 48 58 "Click on a business unit, this displays the information of the business unit." 49 59 msgstr "" 50 60 51 #: content/information.php: 7861 #: content/information.php:107 52 62 msgid "Click on the \"Save\" button to save the information of the fields" 53 63 msgstr "" 54 64 55 #: content/information.php: 7965 #: content/information.php:108 56 66 msgid "" 57 67 "Click on the button \"Save and generate\" for when you are sure to generate " … … 60 70 msgstr "" 61 71 72 #: content/information.php:103 73 msgid "Click on the order to open the details" 74 msgstr "" 75 76 #: content/information.php:101 77 msgid "Click on WooCommerce orders" 78 msgstr "" 79 80 #: content/settings.php:130 81 msgid "Client" 82 msgstr "" 83 84 #: content/information.php:146 85 msgid "Code QR" 86 msgstr "" 87 88 #: content/product-invoice.php:13 content/product.php:128 89 msgid "Commercial Name" 90 msgstr "" 91 92 #: content/settings.php:139 93 msgid "Company" 94 msgstr "" 95 96 #: content/information.php:79 97 msgid "" 98 "Copy and paste the personalized Token in the text field "Token"." 99 msgstr "" 100 101 #: content/information.php:76 102 msgid "Copy the code of the business unit." 103 msgstr "" 104 105 #: content/information.php:80 106 msgid "Copy the example URL client in the text field "URL client"." 107 msgstr "" 108 109 #. Description of the plugin 110 msgid "" 111 "Create your electronic invoices of purchases made in woocommerce with Yabi" 112 msgstr "" 113 114 #: content/settings.php:74 115 msgid "Credit" 116 msgstr "" 117 118 #: content/settings.php:80 119 msgid "Credit days" 120 msgstr "" 121 122 #: content/information.php:106 123 msgid "" 124 "Depending on the type of person, you must complete the additional information" 125 msgstr "" 126 127 #: content/product-invoice.php:70 content/product.php:186 128 msgid "Email" 129 msgstr "" 130 62 131 #: content/information.php:73 63 msgid "Click on the order to open the details"64 msgstr ""65 66 #: content/information.php:7167 msgid "Click on WooCommerce orders"68 msgstr ""69 70 #: content/settings.php:3971 msgid "Client"72 msgstr ""73 74 #: content/information.php:11775 msgid "Code QR"76 msgstr ""77 78 #: content/product.php:12579 msgid "Commercial Name"80 msgstr ""81 82 #: content/information.php:4983 msgid ""84 "Copy and paste the personalized Token in the text field "Token"."85 msgstr ""86 87 #: content/information.php:4688 msgid "Copy the code of the business unit."89 msgstr ""90 91 #: content/information.php:5092 msgid "Copy the example URL client in the text field "URL client"."93 msgstr ""94 95 #. Description of the plugin96 msgid ""97 "Create your electronic invoices of purchases made in woocommerce with Yabi"98 msgstr ""99 100 #: content/information.php:76101 msgid ""102 "Depending on the type of person, you must complete the additional information"103 msgstr ""104 105 #: content/product-invoice.php:39 content/product.php:187106 msgid "Email"107 msgstr ""108 109 #: content/information.php:43110 132 msgid "Enter the Yabi system" 111 133 msgstr "" 112 134 113 #: content/information.php: 25135 #: content/information.php:55 114 136 msgid "" 115 137 "Fill the text field \"Invoice Name\" with the invoice name. Example: \"SETT-" … … 117 139 msgstr "" 118 140 119 #: content/information.php: 26141 #: content/information.php:56 120 142 msgid "" 121 143 "Fill the text field with the consecutive invoice. Example: if the " … … 123 145 msgstr "" 124 146 125 #: content/information.php: 72147 #: content/information.php:102 126 148 msgid "" 127 149 "Find the order in the completed state for which you want to generate an " … … 129 151 msgstr "" 130 152 131 #: content/information.php: 24 content/information.php:47153 #: content/information.php:54 content/information.php:77 132 154 msgid "Go to" 133 155 msgstr "" 134 156 135 #: content/information.php: 62157 #: content/information.php:92 136 158 msgid "How to generate an invoice?" 137 159 msgstr "" … … 145 167 msgstr "" 146 168 147 #: content/product-invoice.php:32 content/product.php:179 169 #: content/settings.php:88 content/information.php:28 170 msgid "I agree to modify the checkout" 171 msgstr "" 172 173 #: includes/woo.php:72 content/product-invoice.php:63 content/product.php:178 148 174 msgid "Identifier" 149 175 msgstr "" 150 176 151 #: content/admin.php:18 content/information.php:4 177 #: includes/woo.php:83 178 msgid "Identifier digit" 179 msgstr "" 180 181 #: includes/woo.php:104 182 msgid "Identifier is a required Field!" 183 msgstr "" 184 185 #: content/settings.php:73 186 msgid "In cash" 187 msgstr "" 188 189 #: content/information.php:25 190 msgid "" 191 "In Credit: The payment is credited and you can select the number of days of " 192 "the credit, generally it is 30 days" 193 msgstr "" 194 195 #: content/information.php:4 content/admin.php:18 152 196 msgid "Information" 153 197 msgstr "" 154 198 155 #: content/information.php: 37199 #: content/information.php:67 156 200 msgid "Instructions for client" 157 201 msgstr "" 158 202 203 #: content/information.php:47 204 msgid "Instructions for invoice" 205 msgstr "" 206 159 207 #: content/information.php:17 160 msgid "Instructions for invoice" 161 msgstr "" 162 163 #: content/settings.php:20 208 msgid "Instructions for settings" 209 msgstr "" 210 211 #. Name of the plugin 212 msgid "Integrate Yabi for WooCommerce" 213 msgstr "" 214 215 #: content/settings.php:109 164 216 msgid "Invoice" 165 217 msgstr "" 166 218 167 #: content/settings.php: 24219 #: content/settings.php:115 168 220 msgid "Invoice Name" 169 221 msgstr "" 170 222 171 #: content/ product-invoice.php:81 content/settings.php:27223 #: content/settings.php:122 content/product-invoice.php:124 172 224 msgid "Invoice Number" 173 225 msgstr "" 174 226 175 #: content/product-invoice.php: 88227 #: content/product-invoice.php:131 176 228 msgid "Invoice Serial" 177 229 msgstr "" 178 230 179 #: content/product.php:144 180 msgid "Is the purchaser responsible for IVA?" 181 msgstr "" 182 183 #: content/product-invoice.php:20 content/product.php:157 231 #: content/settings.php:98 content/information.php:34 232 msgid "Invoice type" 233 msgstr "" 234 235 #: content/information.php:21 236 msgid "Invoices can be defined in Cash or In Credit" 237 msgstr "" 238 239 #: content/product-invoice.php:40 content/product.php:149 184 240 msgid "Last Name" 241 msgstr "" 242 243 #: includes/woo.php:26 244 msgid "Legal Entity" 245 msgstr "" 246 247 #: content/settings.php:101 248 msgid "Manual" 249 msgstr "" 250 251 #: content/information.php:38 252 msgid "Manual: Generate invoices manually in order administration" 185 253 msgstr "" 186 254 … … 189 257 msgstr "" 190 258 191 #: content/product-invoice.php: 13 content/product.php:150259 #: content/product-invoice.php:22 content/product.php:135 192 260 msgid "Name" 193 261 msgstr "" 194 262 195 #: content/product-invoice.php:74 content/product.php:222 263 #: includes/woo.php:25 264 msgid "Natural Person" 265 msgstr "" 266 267 #: content/settings.php:91 268 msgid "No" 269 msgstr "" 270 271 #: content/product-invoice.php:115 content/product.php:243 196 272 msgid "Note Description" 197 273 msgstr "" 198 274 199 #: content/product-invoice.php: 67 content/product.php:215275 #: content/product-invoice.php:104 content/product.php:236 200 276 msgid "Note Name" 201 277 msgstr "" 202 278 203 #: content/product-invoice.php: 69 content/product.php:213279 #: content/product-invoice.php:93 content/product.php:229 204 280 msgid "Observations" 205 281 msgstr "" 206 282 207 #: content/information.php: 48283 #: content/information.php:78 208 284 msgid "" 209 285 "Paste the previously copied code in the text field "Business Unit " … … 211 287 msgstr "" 212 288 213 #: content/product.php:231 289 #: content/settings.php:70 290 msgid "Payment type" 291 msgstr "" 292 293 #: content/settings.php:140 294 msgid "Person" 295 msgstr "" 296 297 #: wc-yabi.php:211 298 msgid "" 299 "Please enter the Yabi plugin configuration, as you need to enter new data " 300 "for it to work correctly" 301 msgstr "" 302 303 #: content/product.php:222 304 msgid "Postcode" 305 msgstr "" 306 307 #: content/product.php:252 214 308 msgid "Save" 215 309 msgstr "" 216 310 217 #: content/product.php:2 33311 #: content/product.php:254 218 312 msgid "Save & Generate" 313 msgstr "" 314 315 #: includes/woo.php:49 content/product-invoice.php:49 content/product.php:156 316 msgid "Second Last Name" 317 msgstr "" 318 319 #: includes/woo.php:38 content/product-invoice.php:31 content/product.php:142 320 msgid "Second Name" 321 msgstr "" 322 323 #: includes/woo.php:23 324 msgid "Select the type of person" 219 325 msgstr "" 220 326 … … 223 329 msgstr "" 224 330 225 #: content/ admin.php:19 content/settings.php:14331 #: content/settings.php:58 content/settings.php:64 content/admin.php:19 226 332 msgid "Settings" 227 333 msgstr "" 228 334 229 #: content/information.php: 24 content/information.php:47335 #: content/information.php:54 content/information.php:77 230 336 msgid "settings page" 231 337 msgstr "" 232 338 233 #: content/information.php:1 06339 #: content/information.php:135 234 340 msgid "Support this plugin" 235 341 msgstr "" 236 342 237 #: content/product.php:132 238 msgid "Tax Level Code" 239 msgstr "" 240 241 #: content/product.php:135 242 msgid "Tax obligations registered in the RUT: O-05, O-48 (Separate by comma)" 243 msgstr "" 244 245 #: content/product.php:140 246 msgid "Tax Scheme" 247 msgstr "" 248 249 #: content/product-invoice.php:46 content/product.php:194 343 #: content/product-invoice.php:77 content/product.php:193 250 344 msgid "Telephone" 251 345 msgstr "" 252 346 253 #: content/information.php: 21347 #: content/information.php:51 254 348 msgid "" 255 349 "The fields of the invoice are the name and the consecutive number of the " … … 258 352 msgstr "" 259 353 260 #: content/product.php:182 261 msgid "The NIT must include the check digit separated by hyphen" 262 msgstr "" 263 264 #: content/information.php:66 265 msgid "" 266 "The process to generate an invoice is not automatic, it is a manual process " 267 "in which the following steps must be carried out." 268 msgstr "" 269 270 #: content/information.php:68 354 #: content/information.php:96 355 msgid "The process to generate an invoice." 356 msgstr "" 357 358 #: content/information.php:98 271 359 msgid "" 272 360 "The WooCommerce purchase must be in a completed state, in order to generate " 273 "the electronic invoice." 274 msgstr "" 275 276 #: content/information.php:80 361 "the electronic invoice. (Automatic or Manual)" 362 msgstr "" 363 364 #: content/information.php:31 365 msgid "" 366 "This option allows you to modify the default Woocommerce form to allow the " 367 "custom fields that Yabi uses, such as IDs or NIT. It also displays the " 368 "departments and municipalities of Colombia with their respective DIAN codes. " 369 "It also generates a link so that people can generate the address as " 370 "necessary for the DIAN." 371 msgstr "" 372 373 #: content/information.php:109 277 374 msgid "To download the invoice you have to enter the Yabi platform" 278 375 msgstr "" 279 376 280 #: content/information.php: 42377 #: content/information.php:72 281 378 msgid "" 282 379 "To get started, contact Yabi to send you the personalized Token of your " … … 284 381 msgstr "" 285 382 286 #: content/settings.php: 53383 #: content/settings.php:154 287 384 msgid "Token" 288 385 msgstr "" 289 386 290 #: content/product-invoice.php:27 content/product.php:164387 #: includes/woo.php:60 content/product-invoice.php:58 content/product.php:163 291 388 msgid "Type of document" 292 389 msgstr "" 293 390 294 #: content/product.php:110 391 #: includes/woo.php:99 392 msgid "Type of document is a required Field!" 393 msgstr "" 394 395 #: content/settings.php:136 396 msgid "Type of Owner" 397 msgstr "" 398 399 #: content/product.php:113 295 400 msgid "Type of person" 296 401 msgstr "" 297 402 298 #: content/settings.php:61 403 #: includes/woo.php:94 404 msgid "Type of person is a required Field!" 405 msgstr "" 406 407 #: content/settings.php:162 299 408 msgid "URL client" 300 409 msgstr "" 301 410 302 #: content/information.php: 74411 #: content/information.php:104 303 412 msgid "" 304 413 "When displaying the order information, the Yabi module will be displayed at " … … 306 415 msgstr "" 307 416 308 #: content/information.php: 43417 #: content/information.php:73 309 418 msgid "with your username and password." 310 419 msgstr "" 311 420 312 #: yabi.php:78421 #: wc-yabi.php:94 313 422 msgid "Yabi - Invoice Data" 314 423 msgstr "" 315 424 316 #. Name of the plugin317 425 #: content/admin.php:15 318 426 msgid "Yabi for WooCommerce" 319 427 msgstr "" 320 428 321 #: content/information.php:75 429 #: content/settings.php:92 430 msgid "Yes" 431 msgstr "" 432 433 #: content/information.php:105 322 434 msgid "You must select the type of person" 323 435 msgstr "" 324 325 #: content/settings.php:45326 msgid "Type of Owner"327 msgstr ""328 329 #: content/settings.php:48330 msgid "Company"331 msgstr ""332 333 #: content/settings.php:49334 msgid "Person"335 msgstr "" -
wc-yabi/trunk/readme.txt
r3083394 r3121708 110 110 = 2.0.1 = 111 111 * The field to write the URL of the connection to Yabi was enabled 112 = 3.0.0 = 113 * New implementation of plugin, now you have access to credit -
wc-yabi/trunk/wc-yabi.php
r3083394 r3121708 9 9 * Plugin URI: https://mireunion.com/yabi 10 10 * Description: Create your electronic invoices of purchases made in woocommerce with Yabi 11 * Version: 2.0.111 * Version: 3.0.0 12 12 * Author: Mex Avila 13 13 * Author URI: https://datakun.com/ … … 36 36 } 37 37 38 global $yabi_thetypes; 39 40 $yabi_thetypes = array( 41 'CC' => 'Cédula de ciudadanía', 42 'NIT' => 'NIT', 43 'TI' => 'Tarjeta de identidad', 44 'TE' => 'Tarjeta de extranjería', 45 'CE' => 'Cédula de extranjería', 46 'P' => 'Pasaporte', 47 'RC' => 'Registro Civil', 48 'DIE' => 'Documento de identificación extranjero', 49 'NITE' => 'Número de Identificación Tributaria Extranjera', 50 'NUIP' => 'Número Único de Identificación Personal' 51 ); 52 38 53 define( 'YABI_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); 39 54 define( 'YABI_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); … … 48 63 require_once( YABI_PLUGIN_PATH . 'includes/dian.php' ); 49 64 require_once( YABI_PLUGIN_PATH . 'includes/transaction.php' ); 65 require_once( YABI_PLUGIN_PATH . 'includes/woo.php' ); 50 66 51 67 function yabi_admin() … … 55 71 add_action( 'admin_menu', 'yabi_admin' ); 56 72 57 58 73 function yabi_page() 59 74 { 60 75 $default_tab = null; 61 $tab = isset( $_GET['tab']) ? $_GET['tab'] : $default_tab;76 $tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : $default_tab; 62 77 $ok = false; 63 78 64 if( isset( $_POST[ 'yabi_invoice_name'] ) )79 if( isset( $_POST[ 'invoice_name' ] ) ) 65 80 { 66 81 yabi_settings(); … … 75 90 global $post; 76 91 77 if( $post->post_status == 'wc-completed' )78 { 79 add_meta_box( 'yabi-product', __( 'Yabi - Invoice Data','yabi-wc'), 'yabi_product_data', 'shop_order', 'normal');92 if( isset( $post->post_status ) && $post->post_status == 'wc-completed' ) 93 { 94 add_meta_box( 'yabi-product', __( 'Yabi - Invoice Data','yabi-wc' ), 'yabi_product_data', 'shop_order', 'normal' ); 80 95 } 81 96 } … … 87 102 88 103 $yabi_invoice = get_post_meta( $post->ID, 'yabi_invoice', true ); 89 $thetypes = array( 90 'CC' => 'Cédula de ciudadanía', 91 'NIT' => 'NIT', 92 'TI' => 'Tarjeta de identidad', 93 'TE' => 'Tarjeta de extranjería', 94 'CE' => 'Cédula de extranjería', 95 'P' => 'Pasaporte', 96 'RC' => 'Registro Civil', 97 'DIE' => 'Documento de identificación extranjero', 98 'NITE' => 'Número de Identificación Tributaria Extranjera', 99 'NUIP' => 'Número Único de Identificación Personal' 100 ); 104 101 105 $typesperson = array( 102 'LEGAL '=> 'Persona Jurídica',103 'NATURAL ' => 'Persona Natural'106 'LEGAL_ENTITY' => 'Persona Jurídica', 107 'NATURAL_PERSON' => 'Persona Natural' 104 108 ); 105 109 $diancodes = yabi_generate_Codes(); 106 $person = get_post_meta( $post->ID, 'yabi_ person', true );110 $person = get_post_meta( $post->ID, 'yabi_order_meta', true ); 107 111 108 112 if( empty( $yabi_invoice ) ) … … 122 126 $citycode = $order->get_billing_postcode(); 123 127 $telephone = $order->get_billing_phone(); 128 $city = $order->get_billing_city(); 124 129 125 $identifier = get_post_meta( $post->ID, 'nit', true );126 $type = 'CC';127 $ accountid = 'NATURAL';130 $identifier = ''; 131 $type_document = 'CC'; 132 $type_person = 'NATURAL_PERSON'; 128 133 $commercialname = ''; 129 $taxlevelcode = 'O-49';130 $taxscheme = 0;131 134 132 135 $person = array( 133 'citycode' => $citycode, 134 'address' => $address, 135 'email' => $email, 136 'name' => $name, 137 'lastname' => $lastname, 138 'note_name' => $note_name, 139 'note_value' => $note_value, 140 'identifier' => $identifier, 141 'type' => $type, 142 'telephone' => $telephone, 143 'accountid' => $accountid, 144 'commercialname' => $commercialname, 145 'taxlevelcode' => $taxlevelcode, 146 'taxscheme' => $taxscheme 136 'citycode' => $citycode, 137 'address' => $address, 138 'email' => $email, 139 'name' => $name, 140 'lastname' => $lastname, 141 'note_name' => $note_name, 142 'note_value' => $note_value, 143 'identifier' => $identifier, 144 'type_document' => $type_document, 145 'telephone' => $telephone, 146 'type_person' => $type_person, 147 'commercialname' => $commercialname, 148 'city' => $city, 147 149 ); 148 150 } … … 158 160 function yabi_settings() 159 161 { 160 $yabi_invoice_name = sanitize_text_field( $_POST['yabi_invoice_name'] ); 161 $yabi_invoice_number = sanitize_text_field( $_POST['yabi_invoice_number'] ); 162 $yabi_owner = sanitize_key( $_POST['yabi_owner'] ); 163 $yabi_businessunituuid = sanitize_key( $_POST['yabi_businessunituuid'] ); 164 $yabi_token = sanitize_key( $_POST['yabi_token'] ); 165 $yabi_url_client = esc_url_raw( $_POST['yabi_url_client'] ); 166 167 update_option( 'yabi_invoice_name', $yabi_invoice_name ); 168 update_option( 'yabi_invoice_number', $yabi_invoice_number ); 169 update_option( 'yabi_owner', $yabi_owner ); 170 update_option( 'yabi_businessunituuid', $yabi_businessunituuid ); 171 update_option( 'yabi_token', $yabi_token ); 172 update_option( 'yabi_url_client', $yabi_url_client ); 162 $invoice_name = sanitize_text_field( $_POST[ 'invoice_name' ] ); 163 $invoice_number = sanitize_text_field( $_POST[ 'invoice_number' ] ); 164 $owner = sanitize_key( $_POST[ 'owner' ] ); 165 $businessunituuid = sanitize_key( $_POST[ 'businessunituuid' ] ); 166 $token = sanitize_key( $_POST[ 'token' ] ); 167 $url_client = esc_url_raw( $_POST[ 'url_client' ] ); 168 $payment_type = sanitize_text_field( $_POST[ 'payment_type' ] ); 169 $invoice_type = sanitize_text_field( $_POST[ 'invoice_type' ] ); 170 $credit_days = sanitize_key( $_POST[ 'credit_days' ] ); 171 $modified_checkout = sanitize_text_field( $_POST[ 'modified_checkout' ] ); 172 173 $yabi_settings = array( 174 'invoice_name' => $invoice_name, 175 'owner' => $owner, 176 'businessunituuid' => $businessunituuid, 177 'token' => $token, 178 'url_client' => $url_client, 179 'payment_type' => $payment_type, 180 'invoice_type' => $invoice_type, 181 'credit_days' => $credit_days, 182 'modified_checkout' => $modified_checkout, 183 ); 184 185 update_option( 'yabi_settings', $yabi_settings, 'yes' ); 186 update_option( 'yabi_invoice_number', $invoice_number, 'no' ); 173 187 } 174 188 175 189 function yabi_settings_link( $links ) 176 190 { 177 $url = esc_url( get_admin_url() . 'admin.php?page=yabi&tab=settings' ); 178 191 $url = esc_url( get_admin_url() . 'admin.php?page=yabi&tab=settings' ); 179 192 $settings_link = "<a href='$url'>" . __( 'Settings' ) . '</a>'; 180 193 … … 187 200 } 188 201 add_filter( 'plugin_action_links_yabi/yabi.php', 'yabi_settings_link' ); 202 203 function yabi_settings_notice() 204 { 205 if( false === get_option( 'yabi_settings' ) ) 206 { 207 $url = esc_url( get_admin_url() . 'admin.php?page=yabi&tab=settings' ); 208 $settings_link = " <a href='$url'>" . __( 'Settings' ) . '</a>'; 209 210 echo '<div class="notice notice-warning is-dismissible"><p>'; 211 echo __( 'Please enter the Yabi plugin configuration, as you need to enter new data for it to work correctly','yabi-wc' ) . $settings_link; 212 echo '</p></div>'; 213 } 214 } 215 add_action( 'admin_notices', 'yabi_settings_notice' );
Note: See TracChangeset
for help on using the changeset viewer.