@@ 195-207 (lines=13) @@ | ||
192 | return apply_filters( 'wpinv_get_item_price', $this->price, $this->ID ); |
|
193 | } |
|
194 | ||
195 | public function get_vat_rule() { |
|
196 | global $wpinv_euvat; |
|
197 | ||
198 | if( !isset( $this->vat_rule ) ) { |
|
199 | $this->vat_rule = get_post_meta( $this->ID, '_wpinv_vat_rule', true ); |
|
200 | ||
201 | if ( empty( $this->vat_rule ) ) { |
|
202 | $this->vat_rule = $wpinv_euvat->allow_vat_rules() ? 'digital' : 'physical'; |
|
203 | } |
|
204 | } |
|
205 | ||
206 | return apply_filters( 'wpinv_get_item_vat_rule', $this->vat_rule, $this->ID ); |
|
207 | } |
|
208 | ||
209 | public function get_vat_class() { |
|
210 | if( !isset( $this->vat_class ) ) { |
|
@@ 209-219 (lines=11) @@ | ||
206 | return apply_filters( 'wpinv_get_item_vat_rule', $this->vat_rule, $this->ID ); |
|
207 | } |
|
208 | ||
209 | public function get_vat_class() { |
|
210 | if( !isset( $this->vat_class ) ) { |
|
211 | $this->vat_class = get_post_meta( $this->ID, '_wpinv_vat_class', true ); |
|
212 | ||
213 | if ( empty( $this->vat_class ) ) { |
|
214 | $this->vat_class = '_standard'; |
|
215 | } |
|
216 | } |
|
217 | ||
218 | return apply_filters( 'wpinv_get_item_vat_class', $this->vat_class, $this->ID ); |
|
219 | } |
|
220 | ||
221 | public function get_type() { |
|
222 | if( ! isset( $this->type ) ) { |
|
@@ 221-231 (lines=11) @@ | ||
218 | return apply_filters( 'wpinv_get_item_vat_class', $this->vat_class, $this->ID ); |
|
219 | } |
|
220 | ||
221 | public function get_type() { |
|
222 | if( ! isset( $this->type ) ) { |
|
223 | $this->type = get_post_meta( $this->ID, '_wpinv_type', true ); |
|
224 | ||
225 | if ( empty( $this->type ) ) { |
|
226 | $this->type = 'custom'; |
|
227 | } |
|
228 | } |
|
229 | ||
230 | return apply_filters( 'wpinv_get_item_type', $this->type, $this->ID ); |
|
231 | } |
|
232 | ||
233 | public function get_custom_id() { |
|
234 | $custom_id = get_post_meta( $this->ID, '_wpinv_custom_id', true ); |