1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Displays the tax rules table. |
4
|
|
|
* |
5
|
|
|
*/ |
6
|
|
|
|
7
|
|
|
defined( 'ABSPATH' ) || exit; |
8
|
|
|
|
9
|
|
|
$dummy_rule = array( |
10
|
|
|
'key' => 'TAX_RULE_KEY', |
11
|
|
|
'label' => __( 'New Tax Rule', 'invoicing' ), |
12
|
|
|
'tax_base' => wpinv_get_option( 'tax_base', 'billing' ), |
13
|
|
|
'same_country_rule' => wpinv_get_option( 'vat_same_country_rule', 'vat_too' ), |
14
|
|
|
); |
15
|
|
|
|
16
|
|
|
wp_nonce_field( 'wpinv_tax_rules', 'wpinv_tax_rules_nonce' ); |
17
|
|
|
|
18
|
|
|
?> |
19
|
|
|
<div class="table-responsive"> |
20
|
|
|
<table id="wpinv-tax-rules" class="widefat fixed table"> |
21
|
|
|
<caption><?php echo esc_html_e( 'You can use this section to create or edit your tax rules', 'invoicing' ); ?></caption> |
|
|
|
|
22
|
|
|
|
23
|
|
|
<thead> |
24
|
|
|
<tr class="table-light"> |
25
|
|
|
|
26
|
|
|
<th scope="col" class="border-bottom border-top"> |
27
|
|
|
<?php esc_html_e( 'Unique Key', 'invoicing' ); ?> |
28
|
|
|
</th> |
29
|
|
|
|
30
|
|
|
<th scope="col" class="border-bottom border-top"> |
31
|
|
|
<?php esc_html_e( 'Label', 'invoicing' ); ?> |
32
|
|
|
</th> |
33
|
|
|
|
34
|
|
|
<th scope="col" class="border-bottom border-top"> |
35
|
|
|
<?php esc_html_e( 'Calculate tax based on', 'invoicing' ); ?> |
36
|
|
|
</th> |
37
|
|
|
|
38
|
|
|
<!-- <th scope="col" class="border-bottom border-top"> |
39
|
|
|
<?php esc_html_e( 'Same country rule', 'invoicing' ); ?> |
40
|
|
|
<?php getpaid_get_help_tip( __( 'What should happen if a customer is from the same country as your business?.', 'invoicing' ), 'position-static', true ); ?> |
41
|
|
|
</th> --> |
42
|
|
|
|
43
|
|
|
<th scope="col" class="border-bottom border-top" style="width:32px"> </th> |
44
|
|
|
|
45
|
|
|
</tr> |
46
|
|
|
</thead> |
47
|
|
|
|
48
|
|
|
<tbody> |
49
|
|
|
<?php foreach ( GetPaid_Tax::get_all_tax_rules() as $tax_rule ) : ?> |
50
|
|
|
<?php include plugin_dir_path( __FILE__ ) . 'html-tax-rule-edit.php'; ?> |
51
|
|
|
<?php endforeach; ?> |
52
|
|
|
</tbody> |
53
|
|
|
|
54
|
|
|
<tfoot> |
55
|
|
|
<tr class="table-light"> |
56
|
|
|
<td colspan="4" class="border-top"> |
57
|
|
|
|
58
|
|
|
<button type="button" class="button button-secondary wpinv_add_tax_rule" aria-label="<?php esc_attr_e( 'Add Tax Rule', 'invoicing' ); ?>"> |
59
|
|
|
<span><?php esc_html_e( 'Add Tax Rule', 'invoicing' ); ?></span> |
60
|
|
|
</button> |
61
|
|
|
|
62
|
|
|
</td> |
63
|
|
|
</tr> |
64
|
|
|
</tfoot> |
65
|
|
|
</table> |
66
|
|
|
</div> |
67
|
|
|
|
68
|
|
|
<script type="text/html" id="tmpl-wpinv-tax-rule-row"> |
69
|
|
|
<?php $tax_rule = $dummy_rule; ?> |
70
|
|
|
<?php include plugin_dir_path( __FILE__ ) . 'html-tax-rule-edit.php'; ?> |
71
|
|
|
</script> |
72
|
|
|
|
73
|
|
|
|
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.