• Resolved thomasv85

    (@thomasv85)


    Hoi Ewout,
    Ik loop tegen een probleem aan.
    In de pdf van de factuur laat ik de stukprijs ex btw zien met <td class=”quantity”><?php echo $item[‘ex_single_price’]; ?> excl. BTW</td>
    Maar hoe kan ik ervoor zorgen dat de totaalprijs van dat product ook ex btw is.
    <td class=”price”><?php echo $item[‘order_price’]; ?></td>

    En hoe kan ik de subtotaal ex btw tonen?

    Ik hoor graag van je.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor alexmigf

    (@alexmigf)

    Hello @thomasv85

    The best solution for your problem is to use our Premium Templates extension. Inside the customizer you can deal with prices and VAT very easily:

    Product column price:

    Captura-de-ecra-2020-06-17-a-s-09-56-02

    Subtotal:

    Captura-de-ecra-2020-06-17-a-s-09-57-26

    • This reply was modified 5 years, 9 months ago by alexmigf.
    Thread Starter thomasv85

    (@thomasv85)

    There is no shortcode for the free version?

    We also have another issue.

    We use the plugin invoice me. If a costumer makes a order with invoice me, then woocommerce send a mail with a pdf with all prices ex vat. If you download the pdf from the dashboard of woocommerce, you get the pdf with all prices incl vat.

    How is tgat possibke that those 2 are not the same?

    Plugin Contributor alexmigf

    (@alexmigf)

    Hello @thomasv85

    “There is no shortcode for the free version?”
    A: Unfortunately not.

    “We use the plugin invoice me. If a costumer makes a order with invoice me, then woocommerce send a mail with a pdf with all prices ex vat. If you download the pdf from the dashboard of woocommerce, you get the pdf with all prices incl vat.”
    A: I’m finding that quite strange. Can you show me the order items table screen and the invoices tables too?

    • This reply was modified 5 years, 9 months ago by alexmigf.
    Thread Starter thomasv85

    (@thomasv85)

    Hi Alex,
    The pdf that we get with the mail:
    https://prnt.sc/t1wwez

    And the pdf that we download from woocommerce:
    https://prnt.sc/t1wx20

    Plugin Contributor alexmigf

    (@alexmigf)

    Hello @thomasv85

    Could share also a screenshot of the email where’s the document attached please?

    Also do a test with only the Simple Template enabled under PDF Invoices > General > Choose a template.

    Thread Starter thomasv85

    (@thomasv85)

    https://prnt.sc/t1z7c8

    With the simple template we don’t have the issue

    This is the invoice.php code:

    <?php global $wpo_wcpdf; ?>
    <table class="head container">
    	<tr>
    		<td class="header">
    		<?php
    		if( $wpo_wcpdf->get_header_logo_id() ) {
    			$wpo_wcpdf->header_logo();
    		} else {
    			echo apply_filters( 'wpo_wcpdf_invoice_title', __( 'Invoice', 'wpo_wcpdf' ) );
    		}
    		?>
    		</td>
    		<td class="shop-info">
    			<div class="shop-name"><h3><?php $wpo_wcpdf->shop_name(); ?></h3></div>
    			<div class="shop-address"><?php $wpo_wcpdf->shop_address(); ?></div>
    		</td>
    	</tr>
    </table>
    <h1 class="document-type-label">
    <?php if( $wpo_wcpdf->get_header_logo_id() ) echo apply_filters( 'wpo_wcpdf_invoice_title', __( 'Invoice', 'wpo_wcpdf' ) ); ?>
    </h1>
    <?php do_action( 'wpo_wcpdf_after_document_label', $wpo_wcpdf->export->template_type, $wpo_wcpdf->export->order ); ?>
    <table class="order-data-addresses">
    	<tr>
    		<td class="address billing-address">
    			<!-- <h3><?php _e( 'Billing Address:', 'wpo_wcpdf' ); ?></h3> -->
    			<?php $wpo_wcpdf->billing_address(); ?>
    			<?php if ( isset($wpo_wcpdf->settings->template_settings['invoice_email']) ) { ?>
    			<div class="billing-email"><?php $wpo_wcpdf->billing_email(); ?></div>
    			<?php } ?>
    			<?php if ( isset($wpo_wcpdf->settings->template_settings['invoice_phone']) ) { ?>
    			<div class="billing-phone"><?php $wpo_wcpdf->billing_phone(); ?></div>
    			<?php } ?>
    		</td>
    		<td class="address shipping-address">
    			<?php if ( isset($wpo_wcpdf->settings->template_settings['invoice_shipping_address']) && $wpo_wcpdf->ships_to_different_address()) { ?>
    			<h3><?php _e( 'Ship To:', 'wpo_wcpdf' ); ?></h3>
    			<?php $wpo_wcpdf->shipping_address(); ?>
    			<?php } ?>
    		</td>
    		<td class="order-data">
    			<table>
    				<?php do_action( 'wpo_wcpdf_before_order_data', $wpo_wcpdf->export->template_type, $wpo_wcpdf->export->order ); ?>
    				<?php if ( isset($wpo_wcpdf->settings->template_settings['display_number']) && $wpo_wcpdf->settings->template_settings['display_number'] == 'invoice_number') { ?>
    				<tr class="invoice-number">
    					<th><?php _e( 'Invoice Number:', 'wpo_wcpdf' ); ?></th>
    					<td><?php $wpo_wcpdf->invoice_number(); ?></td>
    				</tr>
    				<?php } ?>
    				<?php if ( isset($wpo_wcpdf->settings->template_settings['display_date']) && $wpo_wcpdf->settings->template_settings['display_date'] == 'invoice_date') { ?>
    				<tr class="invoice-date">
    					<th><?php _e( 'Invoice Date:', 'wpo_wcpdf' ); ?></th>
    					<td><?php $wpo_wcpdf->invoice_date(); ?></td>
    				</tr>
    				<?php } ?>
    				<tr class="order-number">
    					<th><?php _e( 'Order Number:', 'wpo_wcpdf' ); ?></th>
    					<td><?php $wpo_wcpdf->order_number(); ?></td>
    				</tr>
    				<tr class="order-date">
    					<th><?php _e( 'Order Date:', 'wpo_wcpdf' ); ?></th>
    					<td><?php $wpo_wcpdf->order_date(); ?></td>
    				</tr>
    				<tr class="payment-method">
    					<th><?php _e( 'Payment Method:', 'wpo_wcpdf' ); ?></th>
    					<td><?php $wpo_wcpdf->payment_method(); ?></td>
    				</tr>
    				<?php do_action( 'wpo_wcpdf_after_order_data', $wpo_wcpdf->export->template_type, $wpo_wcpdf->export->order ); ?>
    			</table>			
    		</td>
    	</tr>
    </table>
    <?php do_action( 'wpo_wcpdf_before_order_details', $wpo_wcpdf->export->template_type, $wpo_wcpdf->export->order ); ?>
    <table class="order-details">
    	<thead>
    		<tr>
    			<th class="product"><?php _e('Product', 'wpo_wcpdf'); ?></th>
    			<th class="quantity">Aantal</th>
                <th class="price">Stukprijs</th>
    			<th class="price"><?php _e('Price', 'wpo_wcpdf'); ?></th>
    		</tr>
    	</thead>
    	<tbody>
    		<?php $items = $wpo_wcpdf->get_order_items(); if( sizeof( $items ) > 0 ) : foreach( $items as $item_id => $item ) : ?>
    		<tr class="<?php echo apply_filters( 'wpo_wcpdf_item_row_class', $item_id, $wpo_wcpdf->export->template_type, $wpo_wcpdf->export->order, $item_id ); ?>">
    			<td class="product">
    				<?php $description_label = __( 'Description', 'wpo_wcpdf' ); // registering alternate label translation ?>
    				<span class="item-name"><?php echo $item['name']; ?></span>
    				<?php do_action( 'wpo_wcpdf_before_item_meta', $wpo_wcpdf->export->template_type, $item, $wpo_wcpdf->export->order  ); ?>
    				<span class="item-meta"><?php echo $item['meta']; ?></span>
    				<dl class="meta">
    					<?php $description_label = __( 'SKU', 'wpo_wcpdf' ); // registering alternate label translation ?>
    					<?php if( !empty( $item['sku'] ) ) : ?><dt class="sku"><?php _e( 'SKU:', 'wpo_wcpdf' ); ?></dt><dd class="sku"><?php echo $item['sku']; ?></dd><?php endif; ?>
    					<?php if( !empty( $item['weight'] ) ) : ?><dt class="weight"><?php _e( 'Weight:', 'wpo_wcpdf' ); ?></dt><dd class="weight"><?php echo $item['weight']; ?><?php echo get_option('woocommerce_weight_unit'); ?></dd><?php endif; ?>
    				</dl>
    				<?php do_action( 'wpo_wcpdf_after_item_meta', $wpo_wcpdf->export->template_type, $item, $wpo_wcpdf->export->order  ); ?>
    			</td>
    			<td class="quantity"><?php echo $item['quantity']; ?></td>
                <td class="quantity"><?php echo $item['ex_single_price']; ?> <br><dd class="sku">excl. 21% BTW</dd></td>
    			
    		
    		
    			<td class="price"><?php echo $item['order_price']; ?> 
    				</td>
    		</tr>
    		<?php endforeach; endif; ?>
    	</tbody>
    	<tfoot>
    		<tr class="no-borders">
    			<td class="no-borders">
    				<div class="customer-notes">
    					<?php if ( $wpo_wcpdf->get_shipping_notes() ) : ?>
    						<h3><?php _e( 'Customer Notes', 'wpo_wcpdf' ); ?></h3>
    						<?php $wpo_wcpdf->shipping_notes(); ?>
    					<?php endif; ?>
    				</div>	 			
    			</td>
    			<td class="no-borders" colspan="3">
    					<?php
                        $array = $wpo_wcpdf->get_woocommerce_totals();
    					/*
    					cart_subtotal
    					shipping
    					payment_method
    					order_total
    					*/
                        $prijs = explode("(",$array['cart_subtotal']['value']);
                        $prijs = $prijs[0];
                        $prijs = preg_replace('/[^0-9,.]/',"",$prijs);
                        $prijs = str_replace(".","",$prijs);
                        $totaalprijs = str_replace(",",".",$prijs);
    					$totaalprijs = ($totaalprijs / 121) * 100;
    					?>
    				<table class="totals">
    					<tfoot>
                        
                        
    						<?php foreach( $wpo_wcpdf->get_woocommerce_totals() as $key => $total ) : ?>
    						<tr class="<?php echo $key; ?>">
    							<td class="no-borders"></td>
    							<th class="description"><?php echo $total['label']; ?></th>
    							<td class="price"><span class="totals-price"><?php echo $total['value']; ?></span></td>
    						
    							
    						</tr>
    						<?php endforeach; ?>
    					</tfoot>
    				</table>
    			</td>
    		</tr>
    	</tfoot>
    </table>
    <strong><?php
    $betaal = $wpo_wcpdf->get_payment_method();
    if($betaal == "Bestel op factuur (30 dagen)") {
    	echo "Betaling binnen 8 dagen: 2% betalingskorting = €". round( ((preg_replace('/[^0-9,.]/', '', $totaalprijs) * 0.02) ) ,2);
    }
    ?></strong>
    <?php do_action( 'wpo_wcpdf_after_order_details', $wpo_wcpdf->export->template_type, $wpo_wcpdf->export->order ); ?>
    <?php if ( $wpo_wcpdf->get_footer() ): ?>
    <div id="footer">
    	<?php $wpo_wcpdf->footer(); ?>
    </div><!-- #letter-footer -->
    <?php endif; ?>

    We only add

    <?php
                        $array = $wpo_wcpdf->get_woocommerce_totals();
    					/*
    					cart_subtotal
    					shipping
    					payment_method
    					order_total
    					*/
                        $prijs = explode("(",$array['cart_subtotal']['value']);
                        $prijs = $prijs[0];
                        $prijs = preg_replace('/[^0-9,.]/',"",$prijs);
                        $prijs = str_replace(".","",$prijs);
                        $totaalprijs = str_replace(",",".",$prijs);
    					$totaalprijs = ($totaalprijs / 121) * 100;
    					?>

    and

    <?php
    $betaal = $wpo_wcpdf->get_payment_method();
    if($betaal == "Bestel op factuur (30 dagen)") {
    	echo "Betaling binnen 8 dagen: 2% betalingskorting = €". round( ((preg_replace('/[^0-9,.]/', '', $totaalprijs) * 0.02) ) ,2);
    }
    ?>
    Plugin Contributor alexmigf

    (@alexmigf)

    Hello @thomasv85

    If you changed the totals inside the template is likely not going to work the same way. Like i wrote before, i suggest you the Premium Templates extension has it solves your problem, because custom development is beyond the free support.

    Thread Starter thomasv85

    (@thomasv85)

    If i buy the premium can i make a code that gives a discount on a specified payment method?

    Like ` <?php
    $betaal = $wpo_wcpdf->get_payment_method();
    if($betaal == “Bestel op factuur (30 dagen)”) {
    echo “Betaling binnen 8 dagen: 2% betalingskorting = €”. round( ((preg_replace(‘/[^0-9,.]/’, ”, $totaalprijs) * 0.02) ) ,2);
    }
    ?>`

    Plugin Contributor alexmigf

    (@alexmigf)

    Hello @thomasv85

    Yes, we should be able to help you on that.

    Thread Starter thomasv85

    (@thomasv85)

    Hi there,
    I have the premium version.
    Can you help me with the code? like

    
     <?php
    $betaal = $wpo_wcpdf->get_payment_method();
    if($betaal == “Bestel op factuur (30 dagen)”) {
    echo “Betaling binnen 8 dagen: 2% betalingskorting = €”. round( ((preg_replace(‘/[^0-9,.]/’, ”, $totaalprijs) * 0.02) ) ,2);
    }
    ?>
    
    • This reply was modified 5 years, 9 months ago by thomasv85.
    Plugin Contributor alexmigf

    (@alexmigf)

    Hello @thomasv85

    We are not allowed to provide support for paid products here in the forums. Please contact us by email: support@wpovernight.com

    We will do our best to help you!

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Ex btw’ is closed to new replies.