1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Displays the tax rates table. |
4
|
|
|
* |
5
|
|
|
*/ |
6
|
|
|
|
7
|
|
|
defined( 'ABSPATH' ) || exit; |
8
|
|
|
|
9
|
|
|
$tax_rates = GetPaid_Tax::get_all_tax_rates(); |
10
|
|
|
$dummy_rate = array( |
11
|
|
|
'country' => '', |
12
|
|
|
'state' => '', |
13
|
|
|
'global' => true, |
14
|
|
|
'rate' => wpinv_get_default_tax_rate(), |
15
|
|
|
'reduced_rate' => 5, |
16
|
|
|
'name' => __( 'VAT', 'invoicing' ), |
17
|
|
|
); |
18
|
|
|
|
19
|
|
|
$reset_url = wp_nonce_url( |
20
|
|
|
add_query_arg( 'getpaid-admin-action', 'reset_tax_rates' ), |
21
|
|
|
'getpaid-nonce', |
22
|
|
|
'getpaid-nonce' |
23
|
|
|
); |
24
|
|
|
|
25
|
|
|
?> |
26
|
|
|
<div class="table-responsive"> |
27
|
|
|
<table id="wpinv_tax_rates" class="widefat fixed table"> |
28
|
|
|
<caption><?php echo esc_html_e( 'Enter tax rates for specific regions.', 'invoicing' ); ?></caption> |
|
|
|
|
29
|
|
|
|
30
|
|
|
<thead> |
31
|
|
|
<tr class="table-light"> |
32
|
|
|
|
33
|
|
|
<th scope="col" class="border-bottom border-top"> |
34
|
|
|
<?php esc_html_e( 'Country', 'invoicing' ); ?> |
35
|
|
|
<?php getpaid_get_help_tip( __( 'Optionally limit this tax rate to a specific country.', 'invoicing' ), 'position-static', true ); ?> |
36
|
|
|
</th> |
37
|
|
|
|
38
|
|
|
<th scope="col" class="border-bottom border-top"> |
39
|
|
|
<?php esc_html_e( 'State', 'invoicing' ); ?> |
40
|
|
|
<?php getpaid_get_help_tip( __( 'Separate state codes using a comma or leave blank to apply country wide.', 'invoicing' ), 'position-static', true ); ?> |
41
|
|
|
</th> |
42
|
|
|
|
43
|
|
|
<th scope="col" class="border-bottom border-top"> |
44
|
|
|
<?php esc_html_e( 'Standard Rate %', 'invoicing' ); ?> |
45
|
|
|
<?php getpaid_get_help_tip( __( 'The tax rate (percentage) to charge on items that use the "Standard rate" tax class.', 'invoicing' ), 'position-static', true ); ?> |
46
|
|
|
</th> |
47
|
|
|
|
48
|
|
|
<th scope="col" class="border-bottom border-top"> |
49
|
|
|
<?php esc_html_e( 'Reduced Rate %', 'invoicing' ); ?> |
50
|
|
|
<?php getpaid_get_help_tip( __( 'The tax rate (percentage) to charge on items that use the "Reduced rate" tax class.', 'invoicing' ), 'position-static', true ); ?> |
51
|
|
|
</th> |
52
|
|
|
|
53
|
|
|
<th scope="col" class="border-bottom border-top"> |
54
|
|
|
<?php esc_html_e( 'Tax Name', 'invoicing' ); ?> |
55
|
|
|
<?php getpaid_get_help_tip( __( 'The name of this tax, e.g VAT.', 'invoicing' ), 'position-static', true ); ?> |
56
|
|
|
</th> |
57
|
|
|
|
58
|
|
|
<th scope="col" class="border-bottom border-top" style="width:32px"> </th> |
59
|
|
|
|
60
|
|
|
</tr> |
61
|
|
|
</thead> |
62
|
|
|
|
63
|
|
|
<tbody> |
64
|
|
|
<?php array_walk( $tax_rates, 'wpinv_tax_rate_callback' ); ?> |
65
|
|
|
</tbody> |
66
|
|
|
|
67
|
|
|
<tfoot> |
68
|
|
|
<tr class="table-light"> |
69
|
|
|
<td colspan="6" class="border-top"> |
70
|
|
|
|
71
|
|
|
<button type="button" class="button button-secondary wpinv_add_tax_rate" aria-label="<?php esc_attr_e( 'Add Tax Rate', 'invoicing' ); ?>"> |
72
|
|
|
<span><?php esc_html_e( 'Add Tax Rate', 'invoicing' ); ?></span> |
73
|
|
|
</button> |
74
|
|
|
|
75
|
|
|
<a href="<?php echo esc_url( $reset_url ); ?>" class="button button-secondary wpinv_reset_tax_rates" aria-label="<?php esc_attr_e( 'Reset Tax Rates', 'invoicing' ); ?>"> |
76
|
|
|
<span><?php esc_html_e( 'Reset Tax Rates', 'invoicing' ); ?></span> |
77
|
|
|
</a> |
78
|
|
|
</td> |
79
|
|
|
</tr> |
80
|
|
|
</tfoot> |
81
|
|
|
</table> |
82
|
|
|
</div> |
83
|
|
|
|
84
|
|
|
<script type="text/html" id="tmpl-wpinv-tax-rate-row"> |
85
|
|
|
<?php wpinv_tax_rate_callback( $dummy_rate, 0, true ); ?> |
|
|
|
|
86
|
|
|
</script> |
87
|
|
|
|
88
|
|
|
|
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.