Plugin Directory

Changeset 3121708


Ignore:
Timestamp:
07/18/2024 07:39:30 PM (21 months ago)
Author:
kakaroto84
Message:

V.3.0 New implementation of plugin, now you have access to credit

Location:
wc-yabi/trunk
Files:
7 added
15 edited

Legend:

Unmodified
Added
Removed
  • wc-yabi/trunk/content/admin.php

    r2469031 r3121708  
    2121           
    2222            <div class="tab-content">
    23                 <?php switch($tab) :
     23                <?php switch( $tab ) :
    2424                    case 'settings':
    2525                        require_once( YABI_PLUGIN_PATH . 'content/settings.php' );
    26                     break;
    27                     case 'tools':
    28                         require_once( YABI_PLUGIN_PATH . 'content/tools.php' );
    2926                    break;
    3027                    default:
  • wc-yabi/trunk/content/information.php

    r2469031 r3121708  
    1414
    1515                    <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>&nbsp;</p>
     44                        <hr/>
     45                        <p>&nbsp;</p>
    1646                   
    1747                        <h2><span><?php echo __('Instructions for invoice','yabi-wc'); ?></span></h2>
     
    6494                        <div class="inside">
    6595                       
    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>
    6797                           
    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>
    6999                           
    70100                            <ol>
     
    75105                                <li><?php echo __('You must select the type of person','yabi-wc'); ?></li>
    76106                                <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>
    78107                                <li><?php echo __('Click on the "Save" button to save the information of the fields','yabi-wc'); ?></li>
    79108                                <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  
    88<table width="100%" border="0" cellpadding="5" cellspacing="5" id="yabi-data">
    99
    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; ?>
    1120
    12     <tr>
     21    <tr>
    1322        <th><?php echo __('Name','yabi-wc'); ?></th>
    1423        <td>
    15             <?php echo esc_attr( $person['name'] ); ?>
     24            <?php echo esc_attr( $person[ 'name' ] ); ?>
    1625        </td>
    1726    </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; ?>
    1838   
    1939    <tr>
    2040        <th><?php echo __('Last Name','yabi-wc'); ?></th>
    2141        <td>
    22             <?php echo esc_attr( $person['lastname'] ); ?>
     42            <?php echo esc_attr( $person[ 'lastname' ] ); ?>
    2343        </td>
    2444    </tr>
    2545   
     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   
    2657    <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>
    2960    </tr>
    3061
    3162    <tr>
    32         <th><?php echo __('Identifier','yabi-wc'); ?></th>
     63        <th><?php echo __( 'Identifier','yabi-wc' ); ?></th>
    3364        <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; ?>
    3566        </td>
    3667    </tr>
     
    3970        <th><?php echo __('Email','yabi-wc'); ?></th>
    4071        <td>
    41             <?php echo esc_attr( $person['email'] ); ?>
     72            <?php echo esc_attr( $person[ 'email' ] ); ?>
    4273        </td>
    4374    </tr>   
     
    4677        <th><?php echo __('Telephone','yabi-wc'); ?></th>
    4778        <td>
    48             <?php echo esc_attr( $person['telephone'] ); ?>
     79            <?php echo esc_attr( $person[ 'telephone' ] ); ?>
    4980        </td>
    5081    </tr>
     
    5384        <th><?php echo __('Address','yabi-wc'); ?></th>
    5485        <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' ] ); ?>
    5687        </td>
    5788    </tr>
    5889   
    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' ] ) ): ?>
    6591   
    6692    <tr>
    6793        <th><?php echo __('Observations','yabi-wc'); ?></th>
    6894        <td>
    69             <?php echo esc_attr( $person['observations'] ); ?>
     95            <?php echo esc_attr( $person[ 'observations' ] ); ?>
    7096        </td>
    7197    </tr>
     98   
     99    <?php endif; ?>
     100   
     101    <?php if( !empty( $person[ 'note_name' ] ) ): ?>
    72102   
    73103    <tr>
    74104        <th><?php echo __('Note Name','yabi-wc'); ?></th>
    75105        <td>
    76             <?php echo esc_attr( $person['note_name'] ); ?>
     106            <?php echo esc_attr( $person[ 'note_name' ] ); ?>
    77107        </td>
    78108    </tr>
     109   
     110    <?php endif; ?>
     111   
     112    <?php if( !empty( $person[ 'note_value' ] ) ): ?>
    79113   
    80114    <tr>
    81115        <th><?php echo __('Note Description','yabi-wc'); ?></th>
    82116        <td>
    83             <?php echo esc_attr( $person['note_value'] ); ?>
     117            <?php echo esc_attr( $person[ 'note_value' ] ); ?>
    84118        </td>
    85119    </tr>
     120   
     121    <?php endif; ?>
    86122   
    87123    <tr>
    88124        <th><?php echo __('Invoice Number','yabi-wc'); ?></th>
    89125        <td>
    90            <?php echo esc_attr( $yabi_invoice['number'] ); ?>
     126           <?php echo esc_attr( $yabi_invoice[ 'number' ] ); ?>
    91127        </td>
    92128    </tr>
     
    95131        <th><?php echo __('Invoice Serial','yabi-wc'); ?></th>
    96132        <td>
    97            <?php echo esc_attr( $yabi_invoice['serial'] ); ?>
     133           <?php echo esc_attr( $yabi_invoice[ 'serial' ] ); ?>
    98134        </td>
    99135    </tr>
    100136
    101137</table>
    102 
    103 </table>
  • wc-yabi/trunk/content/product.php

    r2630794 r3121708  
     1<?php global $post; ?>
    12<style>
    23    #yabi-data th
     
    56    }
    67   
    7     <?php if( $person['accountid'] == 'NATURAL' ): ?>
     8    <?php if( $person[ 'accountid' ] == 'NATURAL' ): ?>
    89   
    910        .data-commercialname, #identifier-instruction
     
    1920function yabiCommercial()
    2021{
    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();
    2928    }
    3029    else
    3130    {
    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();
    3633    }
    3734}
     
    3936function yabiMessage( type, message, show )
    4037{
    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>' );
    4340   
    4441    if( show )
    4542    {
    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 );
    4845    }
    4946}
     
    5148function yabiSave( option )
    5249{
    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() )
    5956        .done(function( data ) {           
    6057           
    61             if( parseInt( data ) == 1 )
     58            if( 'GOOD' == data )
    6259            {
    6360                if( parseInt( option ) == 0 )
     
    6764                else
    6865                {
    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 ); ?> } )
    7067                        .done(function( datainvoice ) {
    7168                           
    72                             if( parseInt( datainvoice ) == 0 )
     69                            if( 'FAIL' == datainvoice )
    7370                            {
    7471                                yabiMessage( 'error', 'Saved data!. Unexpected error on invoice, try again later.!', true );
     
    10097}
    10198
     99jQuery( document ).ready(function(){
     100
     101    yabiCommercial();
     102   
     103});
     104
    102105</script>
    103106   
     
    108111
    109112    <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()">
    113116               
    114117                <?php foreach($typesperson as $id => $name): ?>
    115118               
    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>
    117120               
    118121                <?php endforeach; ?>
     
    123126   
    124127    <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' ] ); ?>"  />
    136196        </td>
    137197    </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>
    161214               
    162215                <?php endforeach; ?>
     
    165218        </td>
    166219    </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>
    230246        </td>
    231247    </tr>
     
    234250        <th></th>
    235251        <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)" />
    239255           
    240256            <div id="thespiner" class="spinner" style="float:none;width:auto;height:auto;padding:10px 0 10px
     
    242258        </td>
    243259    </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; ?>
    244278
    245279</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?>
    15<style>
    26    table th
     
    1014    }
    1115</style>
     16<script>
     17
     18jQuery( 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
     42function 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>
    1256<div class="wrap">
    1357
     
    1559
    1660    <form name="thesettings" method="post">
    17 
    18         <div class="card">
    1961   
    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>   
    21110            <hr />   
    22111           
    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>
    26120               
    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>
    30127           
    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>           
    38129   
    39130            <h2><?php echo __('Client','yabi-wc'); ?></h2>   
     
    43134           
    44135                <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>
    46137                    <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>                             
    50141                        </select>
    51142                    </td>
     
    53144           
    54145                <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>
    56147                    <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/>
    58149                        <span class="description">xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</span>
    59150                    </td>
     
    61152           
    62153                <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>
    64155                    <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/>
    66157                        <span class="description">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</span>
    67158                    </td>
    68                 </tr>   
     159                </tr>
    69160               
    70161                <tr>
    71162                    <th><label for="yabi_url_client"><?php echo __('URL client','yabi-wc'); ?>:</label></th>
    72163                    <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/>
    74165                         <span class="description">https://api.yabi.co/co/einvoices/v2/</span>
    75166                    </td>
    76                 </tr>            
     167                </tr>
    77168               
    78169                <tr>
  • wc-yabi/trunk/includes/ajax.php

    r3079931 r3121708  
    77function yabi_generate_invoice()
    88{
    9     if( isset( $_REQUEST['post_id'] ) )
     9    $response = 'FAIL';
     10   
     11    if( isset( $_POST[ 'post_id' ] ) )
    1012    {
    11         $post_id = sanitize_key( $_REQUEST['post_id'] );
     13        $post_id = sanitize_key( $_POST[ 'post_id' ] );
    1214       
    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 );
    16416    }
    16517   
    166     exit();
     18    echo $response;
     19   
     20    wp_die();
    16721}
    16822
    16923function yabi_save_data()
    17024{
    171     if( isset( $_REQUEST['name'] ) && isset( $_REQUEST['identifier'] ) )
     25    if( isset( $_POST[ 'name' ] ) && isset( $_POST[ 'identifier' ] ) )
    17226    {
    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' ] );
    19045       
    19146        $person = array(
    192             'accountid'         => $accountid,         
     47            'type_person'       => $type_person,           
    19348            'address'           => $address,
    194             'citycode'          => $citycode,
    19549            'commercialname'    => $commercialname,
    19650            'email'             => $email,
    19751            'identifier'        => $identifier,
    19852            'lastname'          => $lastname,
    199             'name'              => $name,           
    200             'note_name'         => $note_name,
     53            'name'              => $name,
     54            'note_name'         => $note_name, 
    20155            'note_value'        => $note_value,
    20256            'observations'      => $observations,
    203             'taxlevelcode'      => $taxlevelcode,
    204             'taxscheme'         => $taxscheme,
    20557            '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,       
    20764        );
    20865       
    209         update_post_meta( $post_id, 'yabi_person', $person );
     66        update_post_meta( $post_id, 'yabi_order_meta', $person );
    21067       
    211         echo 1;
     68        echo 'GOOD';
    21269    }   
    21370    else
    21471    {
    215         echo 0;
     72        echo 'FAIL';
    21673    }
    21774   
    218     exit();
     75    wp_die();
    21976}
  • wc-yabi/trunk/includes/dian.php

    r2587125 r3121708  
    11431143    return $dianarray;
    11441144}
     1145
     1146function 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  
    11<?php
    22
    3 function yabi_create_invoice_company( $person, $products, $payment )
     3function yabi_create_invoice( $post_id )
    44{
    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
     174function 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' ];
    8182   
    9183    $data_products = yabi_create_products( $products );
    10184    $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   
    11262   
    12263    $graphQL = 'mutation{
     
    30281            documentParties: {
    31282                accountingCustomerParty: {
    32                     additionalAccountId: LEGAL_ENTITY
     283                    additionalAccountId: '. $person[ 'type_person' ] .'
    33284                    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 .'
    42298            taxDescription: [
    43299                {
     
    58314            paymentDescription: {
    59315                paymentMeans: {
     316                    '. $datedue .'
    60317                    paymentMeanCode: CO_ZZZ
    61                     paymentMeanId: IN_CASH
     318                    paymentMeanId: '. $payment_type .'
    62319                    paymentTerms: {
    63320                        locale: ES_CO
     
    192449                            name
    193450                            postalCode
    194 
    195451                        }
    196452                    }
     
    506762
    507763    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: COP
    530                 issueDateTime: "'. $payment[ 'dateTime' ] .'"
    531                 acquirerEmail: "'. $person[ 'email' ] .'"
    532                 operationCode: STD
    533                 subtypeCode: SALES_INVOICE
    534             }
    535             documentLines: [
    536                 '. $data_products[ 'graphQL' ] .'
    537             ]
    538             documentParties: {
    539                 accountingCustomerParty: {
    540                     additionalAccountId: NATURAL_PERSON
    541                     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_01
    556                     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_ZZZ
    572                     paymentMeanId: IN_CASH
    573                     paymentTerms: {
    574                         locale: ES_CO
    575                         text: "'. $payment[ 'id' ] .'"
    576                     }
    577                 }
    578             }
    579         }
    580     )
    581     {   
    582         document{
    583             documentUid
    584             id
    585             uid
    586             billingPrefix{
    587                 creationDate
    588                 id
    589                 prefix
    590                 range{
    591                     from
    592                     to
    593                 }
    594             }
    595 
    596             documentLines{
    597                 description{
    598                     locale
    599                     text
    600                 }
    601                 itemDescription{
    602                     additionalItemProperty{
    603                         key
    604                         values
    605                     }
    606                     brandName
    607                     informationContentProviderParty{
    608                         endpointId{
    609                             agencyId
    610                             id
    611                             schemeId
    612                         }
    613                         identification{
    614                             idType{
    615                                 code
    616                                 description
    617                             }
    618                             identifier
    619                         }
    620                         name{
    621                             corporateName
    622                             firstName
    623                             firstSurname
    624                             secondName
    625                             secondSurname
    626                         }
    627                         partyTaxScheme{
    628                             compStringId{
    629                                 idType{
    630                                     code
    631                                     description
    632                                 }
    633                                 identifier
    634                             }
    635                             partyLegalEntity{
    636                                 shareholders{
    637                                     identification{
    638                                         idType{
    639                                             code
    640                                             description
    641                                         }
    642                                         identifier
    643                                     }
    644                                     name{
    645                                         corporateName
    646                                         firstName
    647                                         firstSurname
    648                                         secondName
    649                                         secondSurname
    650                                     }
    651                                     participationPercent
    652                                     physicalLocation{
    653                                         address
    654                                         cityCode
    655                                         cityName
    656                                         countryCode
    657                                         countrySubentity
    658                                         countrySubentityCode
    659                                         description{
    660                                             key
    661                                             values
    662                                         }
    663                                         informationUri
    664                                         name
    665                                         postalCode
    666                                     }
    667                                 }
    668                             }
    669                             registrationAddress{
    670                                 address
    671                                 cityCode
    672                                 cityName
    673                                 countryCode
    674                                 countrySubentity
    675                                 countrySubentityCode
    676                                 description{
    677                                     key
    678                                     values
    679                                 }
    680                                 informationUri
    681                                 name
    682                                 postalCode
    683                             }
    684                             registrationName
    685                             taxLevelCode
    686                             taxScheme{
    687                                 code
    688                                 description
    689                             }
    690                         }
    691                         physicalLocation{
    692                             address
    693                             cityCode
    694                             cityName
    695                             countryCode
    696                             countrySubentity
    697                             countrySubentityCode
    698                             description{
    699                                 key
    700                                 values
    701                             }
    702                             informationUri
    703                             name
    704                             postalCode
    705                         }
    706                     }
    707                     manufacturerParty{
    708                         endpointId{
    709                             agencyId
    710                             id
    711                             schemeId
    712                         }
    713                         identification{
    714                             idType{
    715                                 code
    716                                 description
    717                             }
    718                             identifier
    719                         }
    720                         name{
    721                             corporateName
    722                             firstName
    723                             firstSurname
    724                             secondName
    725                             secondSurname
    726                         }
    727                         partyTaxScheme{
    728                             compStringId{
    729                                 idType{
    730                                     code
    731                                     description
    732                                 }
    733                                 identifier
    734                             }
    735                             partyLegalEntity{
    736                                 shareholders{
    737                                     identification{
    738                                         idType{
    739                                             code
    740                                             description
    741                                         }
    742                                         identifier
    743                                     }
    744                                     name{
    745                                         corporateName
    746                                         firstName
    747                                         firstSurname
    748                                         secondName
    749                                         secondSurname
    750                                     }
    751                                     participationPercent
    752                                     physicalLocation{
    753                                         address
    754                                         cityCode
    755                                         cityName
    756                                         countryCode
    757                                         countrySubentity
    758                                         countrySubentityCode
    759                                         description{
    760                                             key
    761                                             values
    762                                         }
    763                                         informationUri
    764                                         name
    765                                         postalCode
    766                                     }
    767                                 }
    768                             }
    769                             registrationAddress{
    770                                 address
    771                                 cityCode
    772                                 cityName
    773                                 countryCode
    774                                 countrySubentity
    775                                 countrySubentityCode
    776                                 description{
    777                                     key
    778                                     values
    779                                 }
    780                                 informationUri
    781                                 name
    782                                 postalCode
    783                             }
    784                             registrationName
    785                             taxLevelCode
    786                             taxScheme{
    787                                 code
    788                                 description
    789                             }
    790                         }
    791                         physicalLocation{
    792                             address
    793                             cityCode
    794                             cityName
    795                             countryCode
    796                             countrySubentity
    797                             countrySubentityCode
    798                             description{
    799                                 key
    800                                 values
    801                             }
    802                             informationUri
    803                             name
    804                             postalCode
    805                         }
    806                     }
    807                     modelName
    808                     originCountry{
    809                         code
    810                         description
    811                     }
    812                     standardItemId{
    813                         id
    814                         name
    815                         schemeAgencyId
    816                         schemeId
    817                     }
    818                 }
    819                 lineExtensionAmount
    820                 note{
    821                     locale
    822                     text
    823                 }
    824                 price{
    825                     priceAmount
    826                     baseQuantity
    827                 }
    828                 priceModifier{
    829                     amount
    830                     baseAmount
    831                     chargeIndicator
    832                     percentage
    833                     reason{
    834                         text
    835                     }
    836                     reasonCode{
    837                         code
    838                         description
    839                     }
    840                 }
    841                 pricingReference{
    842                     amount
    843                     priceType{
    844                         code
    845                         description
    846                     }
    847                 }
    848                 quantity
    849                 unitCode{
    850                     code
    851                     description
    852                 }
    853                 uuid
    854             }
    855             documentModifiers{
    856                 amount
    857                 baseAmount
    858                 chargeIndicator
    859                 percentage
    860                 reason{
    861                     text
    862                 }
    863                 reasonCode{
    864                     code
    865                     description
    866                 }
    867             }
    868             documentParties{
    869                 accountingCustomerParty{
    870                     additionalAccountId{
    871                         code
    872                         description
    873                     }
    874                 }
    875                 accountingSupplierParty{
    876                     additionalAccountId{
    877                         code
    878                         description
    879                     }
    880                 }
    881             }
    882             documentTotals{
    883                 allowanceTotalAmount
    884                 chargeTotalAmount
    885                 lineExtensionAmount
    886                 prePaidAmount
    887                 taxExclusiveAmount
    888                 taxInclusiveAmount
    889             }
    890             documentType
    891             generalInformation{
    892                 acquirerEmail
    893                 currency{
    894                     code
    895                     description
    896                 }
    897                 environment
    898                 issueDateTime
    899             }
    900             id
    901             insertedAt
    902             organizationalUnitId
    903             paymentDescription{
    904                 paymentMeans{
    905                     paymentDueDate
    906                     paymentMeanCode{
    907                         code
    908                         description
    909                     }
    910                     paymentMeanId{
    911                         code
    912                         description
    913                     }
    914                     paymentTerms{
    915                         text
    916                     }
    917                 }
    918                 prepayments{
    919                     id
    920                     instructionId
    921                     paidAmount
    922                     paidDateTime
    923                 }
    924             }
    925             referencedDocuments{
    926                 description{
    927                     locale
    928                     text
    929                 }
    930                 issueDate
    931                 referenceId
    932                 referenceType{
    933                     description
    934                     code
    935                 }
    936             }
    937             taxDescription{
    938                 taxName{
    939                     code
    940                     description
    941                 }
    942                 roundingAmount
    943                 taxAmount
    944                 taxSubtotal{
    945                     baseUnitMeasureCode{
    946                         code
    947                         description
    948                     }
    949                     perUnitAmount
    950                     taxAmount
    951                     percent
    952                    
    953                     taxableAmount
    954                 }
    955             }
    956             transactions{
    957                 documentId
    958                 insertedAt
    959                 requestedAt
    960                 respondedAt
    961                 transactionChannel
    962                 transactionFrom
    963                 transactionId
    964                 transactionStage
    965                 transactionStatus{
    966                     message
    967                     title
    968                 }
    969                 transactionTo
    970                 transactionType
    971                 updatedAt
    972             }
    973             updatedAt
    974             files{
    975                 graphicalRepresentationHtml{
    976                     data
    977                     fileType
    978                     filename
    979                 }
    980                 attachedDocument{
    981                     data
    982                     fileType
    983                     filename
    984                 }
    985             }
    986         }
    987         errors{
    988             helpText
    989             id
    990             language
    991             message
    992             subType
    993             title
    994             type
    995         }
    996         warnings{
    997             helpText
    998             id
    999             language
    1000             message
    1001             subType
    1002             title
    1003             type
    1004         }
    1005         notifications{
    1006             helpText
    1007             id
    1008             language
    1009             message
    1010             subType
    1011             title
    1012             type
    1013         }
    1014     }
    1015 }';
    1016 
    1017     return $graphQL;
    1018764}
    1019765
     
    1055801            }
    1056802            lineExtensionAmount: "'. $item[ 'value' ] .'"
    1057             lineId: 1
     803            lineId: '. $idsequence .'
    1058804            price: {
    1059805                priceAmount: "'. $basevalue .'"
     
    1079825            unitCode: CO_ZZ
    1080826        }';
     827       
     828        $idsequence++;
    1081829    }
    1082830   
     
    1103851{
    1104852    $result = false;
    1105     $token = get_option( 'yabi_token' );
    1106     $url = get_option( 'yabi_url_client' );
     853    $yabi_settings = get_option( 'yabi_settings' );
    1107854   
    1108855    $post_data = json_encode( array( 'query' => $graphQL ) );
     
    1110857    $headers = array(
    1111858        'Content-Type'  => 'application/json',
    1112         'Authorization' => 'Bearer ' . $token,
     859        'Authorization' => 'Bearer ' . $yabi_settings[ 'token' ],
    1113860    );
    1114861   
     
    1123870    );
    1124871   
    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' ] ) )
    1128875    {
    1129         if( !empty( $response['body'] ) )
     876        if( !empty( $response[ 'body' ] ) )
    1130877        {
    1131             return json_decode( $response['body'], true );
     878            return json_decode( $response[ 'body' ], true );
    1132879        }
    1133880        else
  • wc-yabi/trunk/languages/yabi-wc-es_CO.po

    r2644114 r3121708  
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: 2020-12-02 23:02+0000\n"
    6 "PO-Revision-Date: 2021-12-10 17:04-0500\n"
     6"PO-Revision-Date: 2024-07-18 19:31+0000\n"
    77"Last-Translator: \n"
    8 "Language-Team: \n"
     8"Language-Team: Spanish (Colombia)\n"
    99"Language: es_CO\n"
    1010"MIME-Version: 1.0\n"
     
    1212"Content-Transfer-Encoding: 8bit\n"
    1313"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"
     16
     17#: content/information.php:130
    1818msgid "About the plugin"
    1919msgstr "Acerca del plugin"
    2020
    21 #: content/product-invoice.php:53 content/product.php:201
     21#: content/product-invoice.php:84 content/product.php:200
    2222msgid "Address"
    2323msgstr "Dirección"
    2424
    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
     26msgid "Automatic"
     27msgstr "Automático"
     28
     29#: content/information.php:37
     30msgid ""
     31"Automatic: Generates automatic invoices, this depends on whether the data "
     32"has been filled out correctly."
     33msgstr ""
     34"Automático: Genera facturas automáticas, esto depende de si los datos se han "
     35"completado correctamente."
     36
     37#: content/settings.php:146
    3038msgid "Business Unit Uuid"
    3139msgstr "Unidad de negocio Uuid"
    3240
    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
     42msgid "Cash: The payment is made immediately."
     43msgstr "Efectivo: El pago se realiza de forma inmediata."
     44
     45#: content/product.php:207
     46msgid "City"
     47msgstr "Ciudad"
     48
     49#: content/information.php:57 content/information.php:81
    3850#, fuzzy
    3951msgid "Click in button &quot;Save&quot;."
    4052msgstr "Clic en el botón &quot;Guardar&quot;"
    4153
    42 #: content/information.php:44
     54#: content/information.php:74
    4355msgid "Click on &quot;Business Units&quot;."
    4456msgstr "Clic en &quot;Unidad de negocio&quot;"
    4557
    46 #: content/information.php:45
     58#: content/information.php:75
    4759msgid ""
    4860"Click on a business unit, this displays the information of the business unit."
     
    5163"negocio"
    5264
    53 #: content/information.php:78
     65#: content/information.php:107
    5466msgid "Click on the \"Save\" button to save the information of the fields"
    5567msgstr "Clic en el botón \"Guardar\" para guardar la información de los campos"
    5668
    57 #: content/information.php:79
     69#: content/information.php:108
    5870msgid ""
    5971"Click on the button \"Save and generate\" for when you are sure to generate "
     
    6577"editar los campos. "
    6678
    67 #: content/information.php:73
     79#: content/information.php:103
    6880msgid "Click on the order to open the details"
    6981msgstr "Clic en el pedido para abrir los detalles"
    7082
    71 #: content/information.php:71
     83#: content/information.php:101
    7284msgid "Click on WooCommerce orders"
    7385msgstr "Clic en pedidos de WooCommerce"
    7486
    75 #: content/settings.php:39
     87#: content/settings.php:130
    7688msgid "Client"
    7789msgstr "Cliente"
    7890
    79 #: content/information.php:117
     91#: content/information.php:146
    8092msgid "Code QR"
    8193msgstr "Código QR"
    8294
    83 #: content/product.php:125
     95#: content/product-invoice.php:13 content/product.php:128
    8496msgid "Commercial Name"
    8597msgstr "Nombre comercial"
    8698
    87 #: content/information.php:49
     99#: content/settings.php:139
     100msgid "Company"
     101msgstr "Empresa"
     102
     103#: content/information.php:79
    88104msgid ""
    89105"Copy and paste  the personalized Token in the text field &quot;Token&quot;."
     
    91107"Copia y pega el Token personalizado en la caja de texto &quot;Token&quot;"
    92108
    93 #: content/information.php:46
     109#: content/information.php:76
    94110msgid "Copy the code of the business unit."
    95111msgstr "Copia el codigo de la unidad de negocio."
    96112
    97 #: content/information.php:50
     113#: content/information.php:80
    98114msgid "Copy the example URL client in the text field &quot;URL client&quot;."
    99115msgstr ""
     
    105121msgstr "Crea facturas electrónicas de tus compras de Woocommerce en Yabi"
    106122
    107 #: content/information.php:76
     123#: content/settings.php:74
     124msgid "Credit"
     125msgstr "Crédito"
     126
     127#: content/settings.php:80
     128msgid "Credit days"
     129msgstr "Días de crédito"
     130
     131#: content/information.php:106
    108132msgid ""
    109133"Depending on the type of person, you must complete the additional information"
    110134msgstr "Según el tipo de persona debe completar la información adicional"
    111135
    112 #: content/product-invoice.php:39 content/product.php:187
     136#: content/product-invoice.php:70 content/product.php:186
    113137msgid "Email"
    114138msgstr "Correo electrónico"
    115139
    116 #: content/information.php:43
     140#: content/information.php:73
    117141msgid "Enter the Yabi system"
    118142msgstr "Ingrese al sistema de Yabi"
    119143
    120 #: content/information.php:25
     144#: content/information.php:55
    121145msgid ""
    122146"Fill the text field \"Invoice Name\" with the invoice name. Example: \"SETT-"
     
    126150"Ejemplo: \"SETT-\", \"SE\"."
    127151
    128 #: content/information.php:26
     152#: content/information.php:56
    129153msgid ""
    130154"Fill the text field with the consecutive invoice. Example: if the "
     
    134158"consecutivo actual es 25, favor colocar en la caja de texto el número 26."
    135159
    136 #: content/information.php:72
     160#: content/information.php:102
    137161msgid ""
    138162"Find the order in the completed state for which you want to generate an "
     
    141165"Buscar el pedido en estado completado al cual se desea generar una factura"
    142166
    143 #: content/information.php:24 content/information.php:47
     167#: content/information.php:54 content/information.php:77
    144168msgid "Go to"
    145169msgstr "Ir a"
    146170
    147 #: content/information.php:62
     171#: content/information.php:92
    148172msgid "How to generate an invoice?"
    149173msgstr "Cómo generar una factura?"
     
    157181msgstr "https://mireunion.com/yabi"
    158182
    159 #: content/product-invoice.php:32 content/product.php:179
     183#: content/settings.php:88 content/information.php:28
     184msgid "I agree to modify the checkout"
     185msgstr "Acepto modificar el checkout"
     186
     187#: includes/woo.php:72 content/product-invoice.php:63 content/product.php:178
    160188msgid "Identifier"
    161189msgstr "Identificación"
    162190
    163 #: content/admin.php:18 content/information.php:4
     191#: includes/woo.php:83
     192msgid "Identifier digit"
     193msgstr "Dígito identificación"
     194
     195#: includes/woo.php:104
     196msgid "Identifier is a required Field!"
     197msgstr "¡El identificador es un campo obligatorio!"
     198
     199#: content/settings.php:73
     200msgid "In cash"
     201msgstr "En efectivo"
     202
     203#: content/information.php:25
     204msgid ""
     205"In Credit: The payment is credited and you can select the number of days of "
     206"the credit, generally it is 30 days"
     207msgstr ""
     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
    164212msgid "Information"
    165213msgstr "Información"
    166214
    167 #: content/information.php:37
     215#: content/information.php:67
    168216msgid "Instructions for client"
    169217msgstr "Instrucciones para el cliente"
    170218
    171 #: content/information.php:17
     219#: content/information.php:47
    172220msgid "Instructions for invoice"
    173221msgstr "Instrucciones para la facturación"
    174222
    175 #: content/settings.php:20
     223#: content/information.php:17
     224msgid "Instructions for settings"
     225msgstr "Instrucciones para la configuración"
     226
     227#. Name of the plugin
     228msgid "Integrate Yabi for WooCommerce"
     229msgstr "Integración Yabi para WooCommerce"
     230
     231#: content/settings.php:109
    176232msgid "Invoice"
    177233msgstr "Factura"
    178234
    179 #: content/settings.php:24
     235#: content/settings.php:115
    180236msgid "Invoice Name"
    181237msgstr "Nombre de factura"
    182238
    183 #: content/product-invoice.php:81 content/settings.php:27
     239#: content/settings.php:122 content/product-invoice.php:124
    184240msgid "Invoice Number"
    185241msgstr "Número de factura"
    186242
    187 #: content/product-invoice.php:88
     243#: content/product-invoice.php:131
    188244msgid "Invoice Serial"
    189245msgstr "Serie de la factura"
    190246
    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
     248msgid "Invoice type"
     249msgstr "Tipo de factura"
     250
     251#: content/information.php:21
     252msgid "Invoices can be defined in Cash or In Credit"
     253msgstr "Las facturas se pueden definir en efectivo o en crédito."
     254
     255#: content/product-invoice.php:40 content/product.php:149
    196256msgid "Last Name"
    197257msgstr "Apellido"
     258
     259#: includes/woo.php:26
     260msgid "Legal Entity"
     261msgstr "Entidad legal"
     262
     263#: content/settings.php:101
     264msgid "Manual"
     265msgstr "Manual"
     266
     267#: content/information.php:38
     268msgid "Manual: Generate invoices manually in order administration"
     269msgstr "Manual: Genera facturas manualmente en la administración de pedidos."
    198270
    199271#. Author of the plugin
     
    201273msgstr "Mex Avila"
    202274
    203 #: content/product-invoice.php:13 content/product.php:150
     275#: content/product-invoice.php:22 content/product.php:135
    204276msgid "Name"
    205277msgstr "Nombre"
    206278
    207 #: content/product-invoice.php:74 content/product.php:222
     279#: includes/woo.php:25
     280msgid "Natural Person"
     281msgstr "Persona natural"
     282
     283#: content/settings.php:91
     284msgid "No"
     285msgstr "No"
     286
     287#: content/product-invoice.php:115 content/product.php:243
    208288msgid "Note Description"
    209289msgstr "Descripción de la nota"
    210290
    211 #: content/product-invoice.php:67 content/product.php:215
     291#: content/product-invoice.php:104 content/product.php:236
    212292msgid "Note Name"
    213293msgstr "Nombre de la nota"
    214294
    215 #: content/product-invoice.php:69 content/product.php:213
     295#: content/product-invoice.php:93 content/product.php:229
    216296msgid "Observations"
    217297msgstr "Observaciones"
    218298
    219 #: content/information.php:48
     299#: content/information.php:78
    220300msgid ""
    221301"Paste the previously copied code in the text field &quot;Business Unit "
     
    225305"Uuid\"."
    226306
    227 #: content/product.php:231
     307#: content/settings.php:70
     308msgid "Payment type"
     309msgstr "Tipo de pago"
     310
     311#: content/settings.php:140
     312msgid "Person"
     313msgstr "Persona natural"
     314
     315#: wc-yabi.php:211
     316msgid ""
     317"Please enter the Yabi plugin configuration, as you need to enter new data "
     318"for it to work correctly"
     319msgstr ""
     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
     324msgid "Postcode"
     325msgstr "Código postal"
     326
     327#: content/product.php:252
    228328msgid "Save"
    229329msgstr "Guardar"
    230330
    231 #: content/product.php:233
     331#: content/product.php:254
    232332msgid "Save & Generate"
    233333msgstr "Guardar y generar"
     334
     335#: includes/woo.php:49 content/product-invoice.php:49 content/product.php:156
     336msgid "Second Last Name"
     337msgstr "Segundo apellido"
     338
     339#: includes/woo.php:38 content/product-invoice.php:31 content/product.php:142
     340msgid "Second Name"
     341msgstr "Segundo nombre"
     342
     343#: includes/woo.php:23
     344msgid "Select the type of person"
     345msgstr "Selecciona el tipo de persona"
    234346
    235347#: content/admin.php:4
     
    237349msgstr "Configuración guardada!"
    238350
    239 #: content/admin.php:19 content/settings.php:14
     351#: content/settings.php:58 content/settings.php:64 content/admin.php:19
    240352msgid "Settings"
    241353msgstr "Configuración"
    242354
    243 #: content/information.php:24 content/information.php:47
     355#: content/information.php:54 content/information.php:77
    244356msgid "settings page"
    245357msgstr "pagina de configuración"
    246358
    247 #: content/information.php:106
     359#: content/information.php:135
    248360msgid "Support this plugin"
    249361msgstr "Colabora con este plugin"
    250362
    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
    265364msgid "Telephone"
    266365msgstr "Teléfono"
    267366
    268 #: content/information.php:21
     367#: content/information.php:51
    269368msgid ""
    270369"The fields of the invoice are the name and the consecutive number of the "
     
    272371"Please fill in the corresponding data. Example: SETT-26."
    273372msgstr ""
    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
     378msgid "The process to generate an invoice."
     379msgstr "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."
    291385msgid ""
    292386"The WooCommerce purchase must be in a completed state, in order to generate "
    293 "the electronic invoice."
     387"the electronic invoice. (Automatic or Manual)"
    294388msgstr ""
    295389"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
     393msgid ""
     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."
     399msgstr ""
     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
    299407msgid "To download the invoice you have to enter the Yabi platform"
    300408msgstr "Para descargar la factura tiene que ingresar a la plataforma de Yabi"
    301409
    302 #: content/information.php:42
     410#: content/information.php:72
    303411msgid ""
    304412"To get started, contact Yabi to send you the personalized Token of your "
     
    308416"de su cuenta por correo electrónico."
    309417
    310 #: content/settings.php:53
     418#: content/settings.php:154
    311419msgid "Token"
    312420msgstr "Token"
    313421
    314 #: content/product-invoice.php:27 content/product.php:164
     422#: includes/woo.php:60 content/product-invoice.php:58 content/product.php:163
    315423msgid "Type of document"
    316424msgstr "Tipo de documento"
    317425
    318 #: content/product.php:110
     426#: includes/woo.php:99
     427msgid "Type of document is a required Field!"
     428msgstr "¡El tipo de documento es un campo obligatorio!"
     429
     430#: content/settings.php:136
     431msgid "Type of Owner"
     432msgstr "Tipo de dueño"
     433
     434#: content/product.php:113
    319435msgid "Type of person"
    320436msgstr "Tipo de persona"
    321437
    322 #: content/settings.php:61
     438#: includes/woo.php:94
     439msgid "Type of person is a required Field!"
     440msgstr "¡El tipo de persona es un campo obligatorio!"
     441
     442#: content/settings.php:162
    323443msgid "URL client"
    324444msgstr "Cliente URL"
    325445
    326 #: content/information.php:74
     446#: content/information.php:104
    327447msgid ""
    328448"When displaying the order information, the Yabi module will be displayed at "
     
    332452"el módulo de Yabi"
    333453
    334 #: content/information.php:43
     454#: content/information.php:73
    335455msgid "with your username and password."
    336456msgstr "con su nombre de usuario y contraseña."
    337457
    338 #: yabi.php:78
     458#: wc-yabi.php:94
    339459msgid "Yabi - Invoice Data"
    340460msgstr "Yabi - Información de facturación"
    341461
    342 #. Name of the plugin
    343462#: content/admin.php:15
    344463msgid "Yabi for WooCommerce"
    345464msgstr "Yabi para WooCommerce"
    346465
    347 #: content/information.php:75
     466#: content/settings.php:92
     467msgid "Yes"
     468msgstr "Si"
     469
     470#: content/information.php:105
    348471msgid "You must select the type of person"
    349472msgstr "Debe seleccionar el tipo de persona"
    350 
    351 #: content/settings.php:45
    352 msgid "Type of Owner"
    353 msgstr "Tipo de dueño"
    354 
    355 #: content/settings.php:48
    356 msgid "Company"
    357 msgstr "Empresa"
    358 
    359 #: content/settings.php:49
    360 msgid "Person"
    361 msgstr "Persona natural"
  • wc-yabi/trunk/languages/yabi-wc-es_ES.po

    r2644114 r3121708  
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: 2020-12-02 23:02+0000\n"
    6 "PO-Revision-Date: 2021-12-10 17:03-0500\n"
     6"PO-Revision-Date: 2024-07-18 19:32+0000\n"
    77"Last-Translator: \n"
    8 "Language-Team: Español\n"
     8"Language-Team: Spanish (Spain)\n"
    99"Language: es_ES\n"
    1010"MIME-Version: 1.0\n"
     
    1212"Content-Transfer-Encoding: 8bit\n"
    1313"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
    1821msgid "About the plugin"
    1922msgstr "Acerca del plugin"
    2023
    21 #: content/product-invoice.php:53 content/product.php:201
     24#: content/product-invoice.php:84 content/product.php:200
    2225msgid "Address"
    2326msgstr "Dirección"
    2427
    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
     29msgid "Automatic"
     30msgstr "Automático"
     31
     32#: content/information.php:37
     33msgid ""
     34"Automatic: Generates automatic invoices, this depends on whether the data "
     35"has been filled out correctly."
     36msgstr ""
     37"Automático: Genera facturas automáticas, esto depende de si los datos se han "
     38"completado correctamente."
     39
     40#: content/settings.php:146
    3041msgid "Business Unit Uuid"
    3142msgstr "Unidad de negocio Uuid"
    3243
    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
     45msgid "Cash: The payment is made immediately."
     46msgstr "Efectivo: El pago se realiza de forma inmediata."
     47
     48#: content/product.php:207
     49msgid "City"
     50msgstr "Ciudad"
     51
     52#: content/information.php:57 content/information.php:81
     53#, fuzzy
    3854msgid "Click in button &quot;Save&quot;."
    39 msgstr "Clic en el botón \"Guardar\""
    40 
    41 #: content/information.php:44
     55msgstr "Clic en el botón &quot;Guardar&quot;"
     56
     57#: content/information.php:74
    4258msgid "Click on &quot;Business Units&quot;."
    43 msgstr "Clic en \"Unidad de negocio\""
    44 
    45 #: content/information.php:45
     59msgstr "Clic en &quot;Unidad de negocio&quot;"
     60
     61#: content/information.php:75
    4662msgid ""
    4763"Click on a business unit, this displays the information of the business unit."
     
    5066"negocio"
    5167
    52 #: content/information.php:78
     68#: content/information.php:107
    5369msgid "Click on the \"Save\" button to save the information of the fields"
    5470msgstr "Clic en el botón \"Guardar\" para guardar la información de los campos"
    5571
    56 #: content/information.php:79
     72#: content/information.php:108
    5773msgid ""
    5874"Click on the button \"Save and generate\" for when you are sure to generate "
     
    6076"fields again."
    6177msgstr ""
    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:73
     78"Clic en el botón &quot;Guardar y generar&quot; 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
    6783msgid "Click on the order to open the details"
    6884msgstr "Clic en el pedido para abrir los detalles"
    6985
    70 #: content/information.php:71
     86#: content/information.php:101
    7187msgid "Click on WooCommerce orders"
    7288msgstr "Clic en pedidos de WooCommerce"
    7389
    74 #: content/settings.php:39
     90#: content/settings.php:130
    7591msgid "Client"
    7692msgstr "Cliente"
    7793
    78 #: content/information.php:117
     94#: content/information.php:146
    7995msgid "Code QR"
    8096msgstr "Código QR"
    8197
    82 #: content/product.php:125
     98#: content/product-invoice.php:13 content/product.php:128
    8399msgid "Commercial Name"
    84100msgstr "Nombre comercial"
    85101
    86 #: content/information.php:49
     102#: content/settings.php:139
     103msgid "Company"
     104msgstr "Empresa"
     105
     106#: content/information.php:79
    87107msgid ""
    88108"Copy and paste  the personalized Token in the text field &quot;Token&quot;."
    89 msgstr "Copia y pega el Token personalizado en la caja de texto \"Token\""
    90 
    91 #: content/information.php:46
     109msgstr ""
     110"Copia y pega el Token personalizado en la caja de texto &quot;Token&quot;"
     111
     112#: content/information.php:76
    92113msgid "Copy the code of the business unit."
    93114msgstr "Copia el codigo de la unidad de negocio."
    94115
    95 #: content/information.php:50
     116#: content/information.php:80
    96117msgid "Copy the example URL client in the text field &quot;URL client&quot;."
    97 msgstr "Copia el ejemplo del cliente URL en la caja de texto \"Cliente URL\""
     118msgstr ""
     119"Copia el ejemplo del cliente URL en la caja de texto &quot;Cliente URL&quot;"
    98120
    99121#. Description of the plugin
     
    102124msgstr "Crea facturas electrónicas de tus compras de Woocommerce en Yabi"
    103125
    104 #: content/information.php:76
     126#: content/settings.php:74
     127msgid "Credit"
     128msgstr "Crédito"
     129
     130#: content/settings.php:80
     131msgid "Credit days"
     132msgstr "Días de crédito"
     133
     134#: content/information.php:106
    105135msgid ""
    106136"Depending on the type of person, you must complete the additional information"
    107137msgstr "Según el tipo de persona debe completar la información adicional"
    108138
    109 #: content/product-invoice.php:39 content/product.php:187
     139#: content/product-invoice.php:70 content/product.php:186
    110140msgid "Email"
    111141msgstr "Correo electrónico"
    112142
    113 #: content/information.php:43
     143#: content/information.php:73
    114144msgid "Enter the Yabi system"
    115145msgstr "Ingrese al sistema de Yabi"
    116146
    117 #: content/information.php:25
     147#: content/information.php:55
    118148msgid ""
    119149"Fill the text field \"Invoice Name\" with the invoice name. Example: \"SETT-"
     
    123153"Ejemplo: \"SETT-\", \"SE\"."
    124154
    125 #: content/information.php:26
     155#: content/information.php:56
    126156msgid ""
    127157"Fill the text field with the consecutive invoice. Example: if the "
     
    131161"consecutivo actual es 25, favor colocar en la caja de texto el número 26."
    132162
    133 #: content/information.php:72
     163#: content/information.php:102
    134164msgid ""
    135165"Find the order in the completed state for which you want to generate an "
     
    138168"Buscar el pedido en estado completado al cual se desea generar una factura"
    139169
    140 #: content/information.php:24 content/information.php:47
     170#: content/information.php:54 content/information.php:77
    141171msgid "Go to"
    142172msgstr "Ir a"
    143173
    144 #: content/information.php:62
     174#: content/information.php:92
    145175msgid "How to generate an invoice?"
    146176msgstr "Cómo generar una factura?"
     
    154184msgstr "https://mireunion.com/yabi"
    155185
    156 #: content/product-invoice.php:32 content/product.php:179
     186#: content/settings.php:88 content/information.php:28
     187msgid "I agree to modify the checkout"
     188msgstr "Acepto modificar el checkout"
     189
     190#: includes/woo.php:72 content/product-invoice.php:63 content/product.php:178
    157191msgid "Identifier"
    158192msgstr "Identificación"
    159193
    160 #: content/admin.php:18 content/information.php:4
     194#: includes/woo.php:83
     195msgid "Identifier digit"
     196msgstr "Dígito identificación"
     197
     198#: includes/woo.php:104
     199msgid "Identifier is a required Field!"
     200msgstr "¡El identificador es un campo obligatorio!"
     201
     202#: content/settings.php:73
     203msgid "In cash"
     204msgstr "En efectivo"
     205
     206#: content/information.php:25
     207msgid ""
     208"In Credit: The payment is credited and you can select the number of days of "
     209"the credit, generally it is 30 days"
     210msgstr ""
     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
    161215msgid "Information"
    162216msgstr "Información"
    163217
    164 #: content/information.php:37
     218#: content/information.php:67
    165219msgid "Instructions for client"
    166220msgstr "Instrucciones para el cliente"
    167221
    168 #: content/information.php:17
     222#: content/information.php:47
    169223msgid "Instructions for invoice"
    170224msgstr "Instrucciones para la facturación"
    171225
    172 #: content/settings.php:20
     226#: content/information.php:17
     227msgid "Instructions for settings"
     228msgstr "Instrucciones para la configuración"
     229
     230#. Name of the plugin
     231msgid "Integrate Yabi for WooCommerce"
     232msgstr "Integración Yabi para WooCommerce"
     233
     234#: content/settings.php:109
    173235msgid "Invoice"
    174236msgstr "Factura"
    175237
    176 #: content/settings.php:24
     238#: content/settings.php:115
    177239msgid "Invoice Name"
    178240msgstr "Nombre de factura"
    179241
    180 #: content/product-invoice.php:81 content/settings.php:27
     242#: content/settings.php:122 content/product-invoice.php:124
    181243msgid "Invoice Number"
    182244msgstr "Número de factura"
    183245
    184 #: content/product-invoice.php:88
     246#: content/product-invoice.php:131
    185247msgid "Invoice Serial"
    186248msgstr "Serie de la factura"
    187249
    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
     251msgid "Invoice type"
     252msgstr "Tipo de factura"
     253
     254#: content/information.php:21
     255msgid "Invoices can be defined in Cash or In Credit"
     256msgstr "Las facturas se pueden definir en efectivo o en crédito."
     257
     258#: content/product-invoice.php:40 content/product.php:149
    193259msgid "Last Name"
    194260msgstr "Apellido"
     261
     262#: includes/woo.php:26
     263msgid "Legal Entity"
     264msgstr "Entidad legal"
     265
     266#: content/settings.php:101
     267msgid "Manual"
     268msgstr "Manual"
     269
     270#: content/information.php:38
     271msgid "Manual: Generate invoices manually in order administration"
     272msgstr "Manual: Genera facturas manualmente en la administración de pedidos."
    195273
    196274#. Author of the plugin
     
    198276msgstr "Mex Avila"
    199277
    200 #: content/product-invoice.php:13 content/product.php:150
     278#: content/product-invoice.php:22 content/product.php:135
    201279msgid "Name"
    202280msgstr "Nombre"
    203281
    204 #: content/product-invoice.php:74 content/product.php:222
     282#: includes/woo.php:25
     283msgid "Natural Person"
     284msgstr "Persona natural"
     285
     286#: content/settings.php:91
     287msgid "No"
     288msgstr "No"
     289
     290#: content/product-invoice.php:115 content/product.php:243
    205291msgid "Note Description"
    206292msgstr "Descripción de la nota"
    207293
    208 #: content/product-invoice.php:67 content/product.php:215
     294#: content/product-invoice.php:104 content/product.php:236
    209295msgid "Note Name"
    210296msgstr "Nombre de la nota"
    211297
    212 #: content/product-invoice.php:69 content/product.php:213
     298#: content/product-invoice.php:93 content/product.php:229
    213299msgid "Observations"
    214300msgstr "Observaciones"
    215301
    216 #: content/information.php:48
     302#: content/information.php:78
    217303msgid ""
    218304"Paste the previously copied code in the text field &quot;Business Unit "
     
    222308"Uuid\"."
    223309
    224 #: content/product.php:231
     310#: content/settings.php:70
     311msgid "Payment type"
     312msgstr "Tipo de pago"
     313
     314#: content/settings.php:140
     315msgid "Person"
     316msgstr "Persona natural"
     317
     318#: wc-yabi.php:211
     319msgid ""
     320"Please enter the Yabi plugin configuration, as you need to enter new data "
     321"for it to work correctly"
     322msgstr ""
     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
     327msgid "Postcode"
     328msgstr "Código postal"
     329
     330#: content/product.php:252
    225331msgid "Save"
    226332msgstr "Guardar"
    227333
    228 #: content/product.php:233
     334#: content/product.php:254
    229335msgid "Save & Generate"
    230336msgstr "Guardar y generar"
     337
     338#: includes/woo.php:49 content/product-invoice.php:49 content/product.php:156
     339msgid "Second Last Name"
     340msgstr "Segundo apellido"
     341
     342#: includes/woo.php:38 content/product-invoice.php:31 content/product.php:142
     343msgid "Second Name"
     344msgstr "Segundo nombre"
     345
     346#: includes/woo.php:23
     347msgid "Select the type of person"
     348msgstr "Selecciona el tipo de persona"
    231349
    232350#: content/admin.php:4
     
    234352msgstr "Configuración guardada!"
    235353
    236 #: content/admin.php:19 content/settings.php:14
     354#: content/settings.php:58 content/settings.php:64 content/admin.php:19
    237355msgid "Settings"
    238356msgstr "Configuración"
    239357
    240 #: content/information.php:24 content/information.php:47
     358#: content/information.php:54 content/information.php:77
    241359msgid "settings page"
    242360msgstr "pagina de configuración"
    243361
    244 #: content/information.php:106
     362#: content/information.php:135
    245363msgid "Support this plugin"
    246364msgstr "Colabora con este plugin"
    247365
    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
    262367msgid "Telephone"
    263368msgstr "Teléfono"
    264369
    265 #: content/information.php:21
     370#: content/information.php:51
    266371msgid ""
    267372"The fields of the invoice are the name and the consecutive number of the "
     
    269374"Please fill in the corresponding data. Example: SETT-26."
    270375msgstr ""
    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
     381msgid "The process to generate an invoice."
     382msgstr "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."
    288388msgid ""
    289389"The WooCommerce purchase must be in a completed state, in order to generate "
    290 "the electronic invoice."
     390"the electronic invoice. (Automatic or Manual)"
    291391msgstr ""
    292392"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
     396msgid ""
     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."
     402msgstr ""
     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
    296410msgid "To download the invoice you have to enter the Yabi platform"
    297411msgstr "Para descargar la factura tiene que ingresar a la plataforma de Yabi"
    298412
    299 #: content/information.php:42
     413#: content/information.php:72
    300414msgid ""
    301415"To get started, contact Yabi to send you the personalized Token of your "
     
    305419"de su cuenta por correo electrónico."
    306420
    307 #: content/settings.php:53
     421#: content/settings.php:154
    308422msgid "Token"
    309423msgstr "Token"
    310424
    311 #: content/product-invoice.php:27 content/product.php:164
     425#: includes/woo.php:60 content/product-invoice.php:58 content/product.php:163
    312426msgid "Type of document"
    313427msgstr "Tipo de documento"
    314428
    315 #: content/product.php:110
     429#: includes/woo.php:99
     430msgid "Type of document is a required Field!"
     431msgstr "¡El tipo de documento es un campo obligatorio!"
     432
     433#: content/settings.php:136
     434msgid "Type of Owner"
     435msgstr "Tipo de dueño"
     436
     437#: content/product.php:113
    316438msgid "Type of person"
    317439msgstr "Tipo de persona"
    318440
    319 #: content/settings.php:61
     441#: includes/woo.php:94
     442msgid "Type of person is a required Field!"
     443msgstr "¡El tipo de persona es un campo obligatorio!"
     444
     445#: content/settings.php:162
    320446msgid "URL client"
    321447msgstr "Cliente URL"
    322448
    323 #: content/information.php:74
     449#: content/information.php:104
    324450msgid ""
    325451"When displaying the order information, the Yabi module will be displayed at "
     
    329455"el módulo de Yabi"
    330456
    331 #: content/information.php:43
     457#: content/information.php:73
    332458msgid "with your username and password."
    333459msgstr "con su nombre de usuario y contraseña."
    334460
    335 #: yabi.php:78
     461#: wc-yabi.php:94
    336462msgid "Yabi - Invoice Data"
    337463msgstr "Yabi - Información de facturación"
    338464
    339 #. Name of the plugin
    340465#: content/admin.php:15
    341466msgid "Yabi for WooCommerce"
    342467msgstr "Yabi para WooCommerce"
    343468
    344 #: content/information.php:75
     469#: content/settings.php:92
     470msgid "Yes"
     471msgstr "Si"
     472
     473#: content/information.php:105
    345474msgid "You must select the type of person"
    346475msgstr "Debe seleccionar el tipo de persona"
    347 
    348 #: content/settings.php:45
    349 msgid "Type of Owner"
    350 msgstr "Tipo de dueño"
    351 
    352 #: content/settings.php:48
    353 msgid "Company"
    354 msgstr "Empresa"
    355 
    356 #: content/settings.php:49
    357 msgid "Person"
    358 msgstr "Persona natural"
  • wc-yabi/trunk/languages/yabi-wc.pot

    r2644114 r3121708  
    44"Project-Id-Version: Yabi for WooCommerce\n"
    55"Report-Msgid-Bugs-To: \n"
    6 "POT-Creation-Date: 2020-12-02 23:02+0000\n"
     6"POT-Creation-Date: 2024-07-18 19:29+0000\n"
    77"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    88"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1616"X-Loco-Version: 2.4.6; wp-5.5.3"
    1717
    18 #: content/information.php:101
     18#: content/information.php:130
    1919msgid "About the plugin"
    2020msgstr ""
    2121
    22 #: content/product-invoice.php:53 content/product.php:201
     22#: content/product-invoice.php:84 content/product.php:200
    2323msgid "Address"
    2424msgstr ""
    2525
    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
     27msgid "Automatic"
     28msgstr ""
     29
     30#: content/information.php:37
     31msgid ""
     32"Automatic: Generates automatic invoices, this depends on whether the data "
     33"has been filled out correctly."
     34msgstr ""
     35
     36#: content/settings.php:146
    3137msgid "Business Unit Uuid"
    3238msgstr ""
    3339
    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
     41msgid "Cash: The payment is made immediately."
     42msgstr ""
     43
     44#: content/product.php:207
     45msgid "City"
     46msgstr ""
     47
     48#: content/information.php:57 content/information.php:81
    3949msgid "Click in button &quot;Save&quot;."
    4050msgstr ""
    4151
    42 #: content/information.php:44
     52#: content/information.php:74
    4353msgid "Click on &quot;Business Units&quot;."
    4454msgstr ""
    4555
    46 #: content/information.php:45
     56#: content/information.php:75
    4757msgid ""
    4858"Click on a business unit, this displays the information of the business unit."
    4959msgstr ""
    5060
    51 #: content/information.php:78
     61#: content/information.php:107
    5262msgid "Click on the \"Save\" button to save the information of the fields"
    5363msgstr ""
    5464
    55 #: content/information.php:79
     65#: content/information.php:108
    5666msgid ""
    5767"Click on the button \"Save and generate\" for when you are sure to generate "
     
    6070msgstr ""
    6171
     72#: content/information.php:103
     73msgid "Click on the order to open the details"
     74msgstr ""
     75
     76#: content/information.php:101
     77msgid "Click on WooCommerce orders"
     78msgstr ""
     79
     80#: content/settings.php:130
     81msgid "Client"
     82msgstr ""
     83
     84#: content/information.php:146
     85msgid "Code QR"
     86msgstr ""
     87
     88#: content/product-invoice.php:13 content/product.php:128
     89msgid "Commercial Name"
     90msgstr ""
     91
     92#: content/settings.php:139
     93msgid "Company"
     94msgstr ""
     95
     96#: content/information.php:79
     97msgid ""
     98"Copy and paste  the personalized Token in the text field &quot;Token&quot;."
     99msgstr ""
     100
     101#: content/information.php:76
     102msgid "Copy the code of the business unit."
     103msgstr ""
     104
     105#: content/information.php:80
     106msgid "Copy the example URL client in the text field &quot;URL client&quot;."
     107msgstr ""
     108
     109#. Description of the plugin
     110msgid ""
     111"Create your electronic invoices of purchases made in woocommerce with Yabi"
     112msgstr ""
     113
     114#: content/settings.php:74
     115msgid "Credit"
     116msgstr ""
     117
     118#: content/settings.php:80
     119msgid "Credit days"
     120msgstr ""
     121
     122#: content/information.php:106
     123msgid ""
     124"Depending on the type of person, you must complete the additional information"
     125msgstr ""
     126
     127#: content/product-invoice.php:70 content/product.php:186
     128msgid "Email"
     129msgstr ""
     130
    62131#: content/information.php:73
    63 msgid "Click on the order to open the details"
    64 msgstr ""
    65 
    66 #: content/information.php:71
    67 msgid "Click on WooCommerce orders"
    68 msgstr ""
    69 
    70 #: content/settings.php:39
    71 msgid "Client"
    72 msgstr ""
    73 
    74 #: content/information.php:117
    75 msgid "Code QR"
    76 msgstr ""
    77 
    78 #: content/product.php:125
    79 msgid "Commercial Name"
    80 msgstr ""
    81 
    82 #: content/information.php:49
    83 msgid ""
    84 "Copy and paste  the personalized Token in the text field &quot;Token&quot;."
    85 msgstr ""
    86 
    87 #: content/information.php:46
    88 msgid "Copy the code of the business unit."
    89 msgstr ""
    90 
    91 #: content/information.php:50
    92 msgid "Copy the example URL client in the text field &quot;URL client&quot;."
    93 msgstr ""
    94 
    95 #. Description of the plugin
    96 msgid ""
    97 "Create your electronic invoices of purchases made in woocommerce with Yabi"
    98 msgstr ""
    99 
    100 #: content/information.php:76
    101 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:187
    106 msgid "Email"
    107 msgstr ""
    108 
    109 #: content/information.php:43
    110132msgid "Enter the Yabi system"
    111133msgstr ""
    112134
    113 #: content/information.php:25
     135#: content/information.php:55
    114136msgid ""
    115137"Fill the text field \"Invoice Name\" with the invoice name. Example: \"SETT-"
     
    117139msgstr ""
    118140
    119 #: content/information.php:26
     141#: content/information.php:56
    120142msgid ""
    121143"Fill the text field with the consecutive invoice. Example: if the "
     
    123145msgstr ""
    124146
    125 #: content/information.php:72
     147#: content/information.php:102
    126148msgid ""
    127149"Find the order in the completed state for which you want to generate an "
     
    129151msgstr ""
    130152
    131 #: content/information.php:24 content/information.php:47
     153#: content/information.php:54 content/information.php:77
    132154msgid "Go to"
    133155msgstr ""
    134156
    135 #: content/information.php:62
     157#: content/information.php:92
    136158msgid "How to generate an invoice?"
    137159msgstr ""
     
    145167msgstr ""
    146168
    147 #: content/product-invoice.php:32 content/product.php:179
     169#: content/settings.php:88 content/information.php:28
     170msgid "I agree to modify the checkout"
     171msgstr ""
     172
     173#: includes/woo.php:72 content/product-invoice.php:63 content/product.php:178
    148174msgid "Identifier"
    149175msgstr ""
    150176
    151 #: content/admin.php:18 content/information.php:4
     177#: includes/woo.php:83
     178msgid "Identifier digit"
     179msgstr ""
     180
     181#: includes/woo.php:104
     182msgid "Identifier is a required Field!"
     183msgstr ""
     184
     185#: content/settings.php:73
     186msgid "In cash"
     187msgstr ""
     188
     189#: content/information.php:25
     190msgid ""
     191"In Credit: The payment is credited and you can select the number of days of "
     192"the credit, generally it is 30 days"
     193msgstr ""
     194
     195#: content/information.php:4 content/admin.php:18
    152196msgid "Information"
    153197msgstr ""
    154198
    155 #: content/information.php:37
     199#: content/information.php:67
    156200msgid "Instructions for client"
    157201msgstr ""
    158202
     203#: content/information.php:47
     204msgid "Instructions for invoice"
     205msgstr ""
     206
    159207#: content/information.php:17
    160 msgid "Instructions for invoice"
    161 msgstr ""
    162 
    163 #: content/settings.php:20
     208msgid "Instructions for settings"
     209msgstr ""
     210
     211#. Name of the plugin
     212msgid "Integrate Yabi for WooCommerce"
     213msgstr ""
     214
     215#: content/settings.php:109
    164216msgid "Invoice"
    165217msgstr ""
    166218
    167 #: content/settings.php:24
     219#: content/settings.php:115
    168220msgid "Invoice Name"
    169221msgstr ""
    170222
    171 #: content/product-invoice.php:81 content/settings.php:27
     223#: content/settings.php:122 content/product-invoice.php:124
    172224msgid "Invoice Number"
    173225msgstr ""
    174226
    175 #: content/product-invoice.php:88
     227#: content/product-invoice.php:131
    176228msgid "Invoice Serial"
    177229msgstr ""
    178230
    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
     232msgid "Invoice type"
     233msgstr ""
     234
     235#: content/information.php:21
     236msgid "Invoices can be defined in Cash or In Credit"
     237msgstr ""
     238
     239#: content/product-invoice.php:40 content/product.php:149
    184240msgid "Last Name"
     241msgstr ""
     242
     243#: includes/woo.php:26
     244msgid "Legal Entity"
     245msgstr ""
     246
     247#: content/settings.php:101
     248msgid "Manual"
     249msgstr ""
     250
     251#: content/information.php:38
     252msgid "Manual: Generate invoices manually in order administration"
    185253msgstr ""
    186254
     
    189257msgstr ""
    190258
    191 #: content/product-invoice.php:13 content/product.php:150
     259#: content/product-invoice.php:22 content/product.php:135
    192260msgid "Name"
    193261msgstr ""
    194262
    195 #: content/product-invoice.php:74 content/product.php:222
     263#: includes/woo.php:25
     264msgid "Natural Person"
     265msgstr ""
     266
     267#: content/settings.php:91
     268msgid "No"
     269msgstr ""
     270
     271#: content/product-invoice.php:115 content/product.php:243
    196272msgid "Note Description"
    197273msgstr ""
    198274
    199 #: content/product-invoice.php:67 content/product.php:215
     275#: content/product-invoice.php:104 content/product.php:236
    200276msgid "Note Name"
    201277msgstr ""
    202278
    203 #: content/product-invoice.php:69 content/product.php:213
     279#: content/product-invoice.php:93 content/product.php:229
    204280msgid "Observations"
    205281msgstr ""
    206282
    207 #: content/information.php:48
     283#: content/information.php:78
    208284msgid ""
    209285"Paste the previously copied code in the text field &quot;Business Unit "
     
    211287msgstr ""
    212288
    213 #: content/product.php:231
     289#: content/settings.php:70
     290msgid "Payment type"
     291msgstr ""
     292
     293#: content/settings.php:140
     294msgid "Person"
     295msgstr ""
     296
     297#: wc-yabi.php:211
     298msgid ""
     299"Please enter the Yabi plugin configuration, as you need to enter new data "
     300"for it to work correctly"
     301msgstr ""
     302
     303#: content/product.php:222
     304msgid "Postcode"
     305msgstr ""
     306
     307#: content/product.php:252
    214308msgid "Save"
    215309msgstr ""
    216310
    217 #: content/product.php:233
     311#: content/product.php:254
    218312msgid "Save & Generate"
     313msgstr ""
     314
     315#: includes/woo.php:49 content/product-invoice.php:49 content/product.php:156
     316msgid "Second Last Name"
     317msgstr ""
     318
     319#: includes/woo.php:38 content/product-invoice.php:31 content/product.php:142
     320msgid "Second Name"
     321msgstr ""
     322
     323#: includes/woo.php:23
     324msgid "Select the type of person"
    219325msgstr ""
    220326
     
    223329msgstr ""
    224330
    225 #: content/admin.php:19 content/settings.php:14
     331#: content/settings.php:58 content/settings.php:64 content/admin.php:19
    226332msgid "Settings"
    227333msgstr ""
    228334
    229 #: content/information.php:24 content/information.php:47
     335#: content/information.php:54 content/information.php:77
    230336msgid "settings page"
    231337msgstr ""
    232338
    233 #: content/information.php:106
     339#: content/information.php:135
    234340msgid "Support this plugin"
    235341msgstr ""
    236342
    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
    250344msgid "Telephone"
    251345msgstr ""
    252346
    253 #: content/information.php:21
     347#: content/information.php:51
    254348msgid ""
    255349"The fields of the invoice are the name and the consecutive number of the "
     
    258352msgstr ""
    259353
    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
     355msgid "The process to generate an invoice."
     356msgstr ""
     357
     358#: content/information.php:98
    271359msgid ""
    272360"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)"
     362msgstr ""
     363
     364#: content/information.php:31
     365msgid ""
     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."
     371msgstr ""
     372
     373#: content/information.php:109
    277374msgid "To download the invoice you have to enter the Yabi platform"
    278375msgstr ""
    279376
    280 #: content/information.php:42
     377#: content/information.php:72
    281378msgid ""
    282379"To get started, contact Yabi to send you the personalized Token of your "
     
    284381msgstr ""
    285382
    286 #: content/settings.php:53
     383#: content/settings.php:154
    287384msgid "Token"
    288385msgstr ""
    289386
    290 #: content/product-invoice.php:27 content/product.php:164
     387#: includes/woo.php:60 content/product-invoice.php:58 content/product.php:163
    291388msgid "Type of document"
    292389msgstr ""
    293390
    294 #: content/product.php:110
     391#: includes/woo.php:99
     392msgid "Type of document is a required Field!"
     393msgstr ""
     394
     395#: content/settings.php:136
     396msgid "Type of Owner"
     397msgstr ""
     398
     399#: content/product.php:113
    295400msgid "Type of person"
    296401msgstr ""
    297402
    298 #: content/settings.php:61
     403#: includes/woo.php:94
     404msgid "Type of person is a required Field!"
     405msgstr ""
     406
     407#: content/settings.php:162
    299408msgid "URL client"
    300409msgstr ""
    301410
    302 #: content/information.php:74
     411#: content/information.php:104
    303412msgid ""
    304413"When displaying the order information, the Yabi module will be displayed at "
     
    306415msgstr ""
    307416
    308 #: content/information.php:43
     417#: content/information.php:73
    309418msgid "with your username and password."
    310419msgstr ""
    311420
    312 #: yabi.php:78
     421#: wc-yabi.php:94
    313422msgid "Yabi - Invoice Data"
    314423msgstr ""
    315424
    316 #. Name of the plugin
    317425#: content/admin.php:15
    318426msgid "Yabi for WooCommerce"
    319427msgstr ""
    320428
    321 #: content/information.php:75
     429#: content/settings.php:92
     430msgid "Yes"
     431msgstr ""
     432
     433#: content/information.php:105
    322434msgid "You must select the type of person"
    323435msgstr ""
    324 
    325 #: content/settings.php:45
    326 msgid "Type of Owner"
    327 msgstr ""
    328 
    329 #: content/settings.php:48
    330 msgid "Company"
    331 msgstr ""
    332 
    333 #: content/settings.php:49
    334 msgid "Person"
    335 msgstr ""
  • wc-yabi/trunk/readme.txt

    r3083394 r3121708  
    110110= 2.0.1 =
    111111* 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  
    99 * Plugin URI:        https://mireunion.com/yabi
    1010 * Description:       Create your electronic invoices of purchases made in woocommerce with Yabi
    11  * Version:           2.0.1
     11 * Version:           3.0.0
    1212 * Author:            Mex Avila
    1313 * Author URI:        https://datakun.com/
     
    3636}
    3737
     38global $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
    3853define( 'YABI_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
    3954define( 'YABI_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
     
    4863require_once( YABI_PLUGIN_PATH . 'includes/dian.php' );
    4964require_once( YABI_PLUGIN_PATH . 'includes/transaction.php' );
     65require_once( YABI_PLUGIN_PATH . 'includes/woo.php' );
    5066
    5167function yabi_admin()
     
    5571add_action( 'admin_menu', 'yabi_admin' );
    5672
    57 
    5873function yabi_page()
    5974{
    6075    $default_tab = null;
    61     $tab = isset($_GET['tab']) ? $_GET['tab'] : $default_tab;
     76    $tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : $default_tab;
    6277    $ok = false;
    6378
    64     if( isset( $_POST['yabi_invoice_name'] ) )
     79    if( isset( $_POST[ 'invoice_name' ] ) )
    6580    {
    6681        yabi_settings();
     
    7590    global $post;
    7691   
    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' );
    8095    }
    8196}
     
    87102   
    88103    $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   
    101105    $typesperson = array(
    102         'LEGAL'     => 'Persona Jurídica',
    103         'NATURAL'   => 'Persona Natural'
     106        'LEGAL_ENTITY'      => 'Persona Jurídica',
     107        'NATURAL_PERSON'    => 'Persona Natural'
    104108    );
    105109    $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 );
    107111   
    108112    if( empty( $yabi_invoice ) )
     
    122126            $citycode = $order->get_billing_postcode();
    123127            $telephone = $order->get_billing_phone();
     128            $city = $order->get_billing_city();
    124129           
    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';
    128133            $commercialname = '';
    129             $taxlevelcode = 'O-49';
    130             $taxscheme = 0;
    131134           
    132135            $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,
    147149            );
    148150        }
     
    158160function yabi_settings()
    159161{
    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' );
    173187}
    174188
    175189function yabi_settings_link( $links )
    176190{
    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' );
    179192    $settings_link = "<a href='$url'>" . __( 'Settings' ) . '</a>';
    180193   
     
    187200}
    188201add_filter( 'plugin_action_links_yabi/yabi.php', 'yabi_settings_link' );
     202
     203function 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}
     215add_action( 'admin_notices', 'yabi_settings_notice' );
Note: See TracChangeset for help on using the changeset viewer.