Plugin Directory

Changeset 3450548


Ignore:
Timestamp:
01/30/2026 03:01:12 PM (2 months ago)
Author:
wntcloud
Message:

Bugs fix

Location:
wintouch-cloud
Files:
6 edited
14 copied

Legend:

Unmodified
Added
Removed
  • wintouch-cloud/tags/0.0.7/README.md

    r3449632 r3450548  
    88**Requires at least:** 5.0 
    99**Tested up to:** 6.9 
    10 **Stable tag:** 0.0.6 
     10**Stable tag:** 0.0.7 
    1111**Requires PHP:** 7.2 
    1212**License:** GPLv2 or later 
  • wintouch-cloud/tags/0.0.7/assets/css/style.css

    r3447059 r3450548  
    325325}
    326326
     327.wt-account-description {
     328    overflow: hidden;
     329    text-wrap-mode: nowrap;
     330}
     331
     332.wt-account-description p{
     333    overflow: hidden;
     334    text-overflow: ellipsis;
     335}
     336
    327337.wt-account-enterprise {
    328     display: flex;
    329 }
    330 
    331 .wt-account-enterprise .wt-account-description {
    332     flex-shrink: 0;
     338    display: grid;
     339    grid-template-columns: 1fr auto;
     340    gap: .7em;
    333341}
    334342
  • wintouch-cloud/tags/0.0.7/readme.txt

    r3449632 r3450548  
    44Requires at least: 5.0
    55Tested up to: 6.9
    6 Stable tag: 0.0.6
     6Stable tag: 0.0.7
    77Requires PHP: 7.2
    88License: GPLv2 or later
  • wintouch-cloud/tags/0.0.7/src/Order.php

    r3449632 r3450548  
    2929
    3030        if ($send_with_payload) {
    31             $prices_with_tax = wc_prices_include_tax();
    32 
    33             if ($prices_with_tax) {
    34                 // Shipping with tax
    35                 $shipping_price = $order->get_shipping_total() + $order->get_shipping_tax();
    36             } else {
    37                 // Shipping without tax
    38                 $shipping_price = $order->get_shipping_total();
    39             }
     31            $prices_with_tax = $order->get_prices_include_tax();
    4032
    4133            $data['OrderPayload'] = [
    4234                'Notes' => $order->get_customer_note(),
    4335                'TotalPrice' => $order->get_total(),
    44                 'TotalDiscount' => $order->get_total_discount(),
    45                 'TotalShipping' => $shipping_price,
     36                'TotalDiscount' => $prices_with_tax ? $order->get_total_discount() : 0,
    4637                'PricesWithTax' => $prices_with_tax
    4738            ];
     
    6354            $checkoutFields = Package::container()->get(CheckoutFields::class);
    6455            $data['OrderPayload']['Client'] = [
    65                 'Name' => $order->get_billing_first_name() . $order->get_billing_last_name(),
     56                'Name' => $order->get_billing_first_name() . ' ' . $order->get_billing_last_name(),
    6657                'Email' => $order->get_billing_email(),
    6758                'Nif' => $checkoutFields->get_field_from_object('Wintouch/nif', $order, 'order')
     
    7667                } else {
    7768                    // Price with tax calculated
    78                     $item_price = $item->get_subtotal() / $item->get_quantity();
     69                    $item_price = $item->get_total() / $item->get_quantity();
    7970                }
    8071
     
    8980
    9081                $data['OrderPayload']['Items'][] = $orderItem;
     82            }
     83
     84            if ($order->get_shipping_total() > 0) {
     85                // Shipping price and tax
     86                if ($prices_with_tax) {
     87                    // Shipping with tax
     88                    $shipping_price = $order->get_shipping_total() + $order->get_shipping_tax();
     89                } else {
     90                    // Shipping without tax
     91                    $shipping_price = $order->get_shipping_total();
     92                }
     93
     94                $shipping_tax = round(($order->get_shipping_tax() / $order->get_shipping_total()) * 100);
     95
     96                $data['OrderPayload']['Items'][] = [
     97                    'Title' => 'Custo de envio',
     98                    'Price' => $shipping_price,
     99                    'Quantity' => 1,
     100                    'TaxRate' => $shipping_tax
     101                ];
    91102            }
    92103        }
  • wintouch-cloud/tags/0.0.7/views/Account.php

    r3447026 r3450548  
    1818<div class="card">
    1919
    20     <h2 class="title">Utilizador</h2>
     20    <div class="wt-account-description">
     21        <h2 class="title">Utilizador</h2>
    2122
    22     <br>
     23        <br>
    2324
    24     <?php
    25         if (isset($wintouch_user['Name'])) {
    26             echo '<p>Nome: '.esc_html($wintouch_user['Name']).'</p>';
    27         } else {
    28             echo '<p>Nome: Não definido</p>';
    29         }
     25        <?php
     26            if (isset($wintouch_user['Name'])) {
     27                echo '<p>Nome: '.esc_html($wintouch_user['Name']).'</p>';
     28            } else {
     29                echo '<p>Nome: Não definido</p>';
     30            }
    3031
    31         if (isset($wintouch_user['Email'])) {
    32             echo '<p>Email: '.esc_html($wintouch_user['Email']).'</p>';
    33         } else {
    34             echo '<p>Email: Não definido</p>';
    35         }
     32            if (isset($wintouch_user['Email'])) {
     33                echo '<p>Email: '.esc_html($wintouch_user['Email']).'</p>';
     34            } else {
     35                echo '<p>Email: Não definido</p>';
     36            }
    3637
    37         if (isset($wintouch_user['PhoneNumber'])) {
    38             echo '<p>Telemóvel: '.esc_html($wintouch_user['PhoneNumber']).'</p>';
    39         } else {
    40             echo '<p>Telemóvel: Não definido</p>';
    41         }
    42     ?>
     38            if (isset($wintouch_user['PhoneNumber'])) {
     39                echo '<p>Telemóvel: '.esc_html($wintouch_user['PhoneNumber']).'</p>';
     40            } else {
     41                echo '<p>Telemóvel: Não definido</p>';
     42            }
     43        ?>
    4344
    44     <br>
     45        <br>
    4546
    46     <form method="POST" action="<?php esc_url(admin_url('admin.php?page=wintouch')) ?>">
    47         <input name="action" value="logout" hidden>
    48         <button class="button button-primary" type="submit">Terminar sessão</button>
    49     </form>
     47        <form method="POST" action="<?php esc_url(admin_url('admin.php?page=wintouch')) ?>">
     48            <input name="action" value="logout" hidden>
     49            <button class="button button-primary" type="submit">Terminar sessão</button>
     50        </form>
     51    </div>
    5052
    5153</div>
  • wintouch-cloud/tags/0.0.7/wintouch-cloud.php

    r3449632 r3450548  
    33 * Plugin Name: WINTOUCH Cloud
    44 * Description: Uma ferramenta de faturação para o seu negócio.
    5  * Version: 0.0.6
     5 * Version: 0.0.7
    66 * Author: WINTOUCH
    77 * Author URI: https://wintouchcloud.com
  • wintouch-cloud/trunk/README.md

    r3449632 r3450548  
    88**Requires at least:** 5.0 
    99**Tested up to:** 6.9 
    10 **Stable tag:** 0.0.6 
     10**Stable tag:** 0.0.7 
    1111**Requires PHP:** 7.2 
    1212**License:** GPLv2 or later 
  • wintouch-cloud/trunk/assets/css/style.css

    r3447059 r3450548  
    325325}
    326326
     327.wt-account-description {
     328    overflow: hidden;
     329    text-wrap-mode: nowrap;
     330}
     331
     332.wt-account-description p{
     333    overflow: hidden;
     334    text-overflow: ellipsis;
     335}
     336
    327337.wt-account-enterprise {
    328     display: flex;
    329 }
    330 
    331 .wt-account-enterprise .wt-account-description {
    332     flex-shrink: 0;
     338    display: grid;
     339    grid-template-columns: 1fr auto;
     340    gap: .7em;
    333341}
    334342
  • wintouch-cloud/trunk/readme.txt

    r3449632 r3450548  
    44Requires at least: 5.0
    55Tested up to: 6.9
    6 Stable tag: 0.0.6
     6Stable tag: 0.0.7
    77Requires PHP: 7.2
    88License: GPLv2 or later
  • wintouch-cloud/trunk/src/Order.php

    r3449632 r3450548  
    2929
    3030        if ($send_with_payload) {
    31             $prices_with_tax = wc_prices_include_tax();
    32 
    33             if ($prices_with_tax) {
    34                 // Shipping with tax
    35                 $shipping_price = $order->get_shipping_total() + $order->get_shipping_tax();
    36             } else {
    37                 // Shipping without tax
    38                 $shipping_price = $order->get_shipping_total();
    39             }
     31            $prices_with_tax = $order->get_prices_include_tax();
    4032
    4133            $data['OrderPayload'] = [
    4234                'Notes' => $order->get_customer_note(),
    4335                'TotalPrice' => $order->get_total(),
    44                 'TotalDiscount' => $order->get_total_discount(),
    45                 'TotalShipping' => $shipping_price,
     36                'TotalDiscount' => $prices_with_tax ? $order->get_total_discount() : 0,
    4637                'PricesWithTax' => $prices_with_tax
    4738            ];
     
    6354            $checkoutFields = Package::container()->get(CheckoutFields::class);
    6455            $data['OrderPayload']['Client'] = [
    65                 'Name' => $order->get_billing_first_name() . $order->get_billing_last_name(),
     56                'Name' => $order->get_billing_first_name() . ' ' . $order->get_billing_last_name(),
    6657                'Email' => $order->get_billing_email(),
    6758                'Nif' => $checkoutFields->get_field_from_object('Wintouch/nif', $order, 'order')
     
    7667                } else {
    7768                    // Price with tax calculated
    78                     $item_price = $item->get_subtotal() / $item->get_quantity();
     69                    $item_price = $item->get_total() / $item->get_quantity();
    7970                }
    8071
     
    8980
    9081                $data['OrderPayload']['Items'][] = $orderItem;
     82            }
     83
     84            if ($order->get_shipping_total() > 0) {
     85                // Shipping price and tax
     86                if ($prices_with_tax) {
     87                    // Shipping with tax
     88                    $shipping_price = $order->get_shipping_total() + $order->get_shipping_tax();
     89                } else {
     90                    // Shipping without tax
     91                    $shipping_price = $order->get_shipping_total();
     92                }
     93
     94                $shipping_tax = round(($order->get_shipping_tax() / $order->get_shipping_total()) * 100);
     95
     96                $data['OrderPayload']['Items'][] = [
     97                    'Title' => 'Custo de envio',
     98                    'Price' => $shipping_price,
     99                    'Quantity' => 1,
     100                    'TaxRate' => $shipping_tax
     101                ];
    91102            }
    92103        }
  • wintouch-cloud/trunk/views/Account.php

    r3447026 r3450548  
    1818<div class="card">
    1919
    20     <h2 class="title">Utilizador</h2>
     20    <div class="wt-account-description">
     21        <h2 class="title">Utilizador</h2>
    2122
    22     <br>
     23        <br>
    2324
    24     <?php
    25         if (isset($wintouch_user['Name'])) {
    26             echo '<p>Nome: '.esc_html($wintouch_user['Name']).'</p>';
    27         } else {
    28             echo '<p>Nome: Não definido</p>';
    29         }
     25        <?php
     26            if (isset($wintouch_user['Name'])) {
     27                echo '<p>Nome: '.esc_html($wintouch_user['Name']).'</p>';
     28            } else {
     29                echo '<p>Nome: Não definido</p>';
     30            }
    3031
    31         if (isset($wintouch_user['Email'])) {
    32             echo '<p>Email: '.esc_html($wintouch_user['Email']).'</p>';
    33         } else {
    34             echo '<p>Email: Não definido</p>';
    35         }
     32            if (isset($wintouch_user['Email'])) {
     33                echo '<p>Email: '.esc_html($wintouch_user['Email']).'</p>';
     34            } else {
     35                echo '<p>Email: Não definido</p>';
     36            }
    3637
    37         if (isset($wintouch_user['PhoneNumber'])) {
    38             echo '<p>Telemóvel: '.esc_html($wintouch_user['PhoneNumber']).'</p>';
    39         } else {
    40             echo '<p>Telemóvel: Não definido</p>';
    41         }
    42     ?>
     38            if (isset($wintouch_user['PhoneNumber'])) {
     39                echo '<p>Telemóvel: '.esc_html($wintouch_user['PhoneNumber']).'</p>';
     40            } else {
     41                echo '<p>Telemóvel: Não definido</p>';
     42            }
     43        ?>
    4344
    44     <br>
     45        <br>
    4546
    46     <form method="POST" action="<?php esc_url(admin_url('admin.php?page=wintouch')) ?>">
    47         <input name="action" value="logout" hidden>
    48         <button class="button button-primary" type="submit">Terminar sessão</button>
    49     </form>
     47        <form method="POST" action="<?php esc_url(admin_url('admin.php?page=wintouch')) ?>">
     48            <input name="action" value="logout" hidden>
     49            <button class="button button-primary" type="submit">Terminar sessão</button>
     50        </form>
     51    </div>
    5052
    5153</div>
  • wintouch-cloud/trunk/wintouch-cloud.php

    r3449632 r3450548  
    33 * Plugin Name: WINTOUCH Cloud
    44 * Description: Uma ferramenta de faturação para o seu negócio.
    5  * Version: 0.0.6
     5 * Version: 0.0.7
    66 * Author: WINTOUCH
    77 * Author URI: https://wintouchcloud.com
Note: See TracChangeset for help on using the changeset viewer.