Author Topic: VirtueMart 3.6.11 10289 - invoice  (Read 338 times)

lostmail

  • Jr. Member
  • **
  • Posts: 280
VirtueMart 3.6.11 10289 - invoice
« on: April 02, 2020, 15:58:25 pm »
I installed the BETA release VirtueMart 3.6.11 10289 and when i print an invoice in admin backend i see that the calculation rule DBTaxRulesBill is now double in 2 lines.

I searched for DBTaxRulesBill in the files in VM and in Template/virtuemart but I can not find any where this line is double...

Any idea how to fix that ?
(I have no template modification - it`s a default VM System) - so i think it`s a bug somewhere..
Joomla 3.x + VM 3.6.x (for Testing without any additional Extensions)

lostmail

  • Jr. Member
  • **
  • Posts: 280
Re: VirtueMart 3.6.11 10289 - invoice
« Reply #1 on: April 02, 2020, 16:55:22 pm »
I found that it must be located in the file com_virtuemart/views/invoice/tmpl/invoice_items.php:

Quote
   <?php
   if($discountsBill){
      foreach($discountsBill as $rule){ ?>
   <tr >
      <td colspan="6" style="text-align: right;" class="pricePad"><?php echo $rule->calc_rule_name ?> </td>
      <?php if ( VmConfig::get('show_tax')) { ?>
      <td style="text-align: right;">&nbsp;</td>
      <?php } ?>
      <td style="text-align: right;"><?php echo $this->currency->priceDisplay($rule->calc_amount, $this->user_currency_id); ?></td>
      <td style="text-align: right;"><?php echo $this->currency->priceDisplay($rule->calc_amount, $this->user_currency_id); ?></td>
   </tr>
         <?php
      }
   } ?>

   <?php
   foreach($this->orderDetails['calc_rules'] as $rule){
      if ($rule->calc_kind== 'DBTaxRulesBill') { ?>
            <tr>
                <td colspan="6"  style="text-align: right;" class="pricePad"><?php echo $rule->calc_rule_name ?> </td>
            <?php if ( VmConfig::get('show_tax')) { ?>
                    <td style="text-align: right;">&nbsp;</td>
            <?php } ?>
                <td style="text-align: right;"><?php echo  $this->currency->priceDisplay($rule->calc_amount,$this->user_currency_id);  ?> </td>
                <td style="text-align: right;"><?php echo  $this->currency->priceDisplay($rule->calc_amount,$this->user_currency_id);  ?> </td>
            </tr>
         <?php
      } elseif ($rule->calc_kind == 'taxRulesBill') { ?>
            <tr>
                <td colspan="6"  style="text-align: right;" class="pricePad"><?php echo $rule->calc_rule_name ?> </td>
            <?php if ( VmConfig::get('show_tax')) { ?>
                    <td style="text-align: right;"><?php echo $this->currency->priceDisplay($rule->calc_amount,$this->user_currency_id); ?> </td>
            <?php } ?>
                <td style="text-align: right;">&nbsp;</td>
                <td style="text-align: right;"><?php echo $this->currency->priceDisplay($rule->calc_amount,$this->user_currency_id); ?> </td>
            </tr>
         <?php
      } elseif ($rule->calc_kind == 'DATaxRulesBill') { ?>
            <tr>
                <td colspan="6" style="text-align: right;" class="pricePad"><?php echo $rule->calc_rule_name ?> </td>
            <?php if ( VmConfig::get('show_tax')) { ?>
                    <td style="text-align: right;">&nbsp;</td>
            <?php } ?>
                <td style="text-align: right;"><?php  echo   $this->currency->priceDisplay($rule->calc_amount,$this->user_currency_id);  ?> </td>
                <td style="text-align: right;"><?php echo $this->currency->priceDisplay($rule->calc_amount,$this->user_currency_id);  ?> </td>
            </tr>
         <?php
      }
   } ?>

This area makes that in printing an invoice the line for caluclation & rules is visible twice....
What`s going wrong here ?
Joomla 3.x + VM 3.6.x (for Testing without any additional Extensions)

lostmail

  • Jr. Member
  • **
  • Posts: 280
Re: VirtueMart 3.6.11 10289 - invoice
« Reply #2 on: April 04, 2020, 11:13:11 am »
I deleted this part :
Quote
   <?php
   if($discountsBill){
      foreach($discountsBill as $rule){ ?>
   <tr >
      <td colspan="6" style="text-align: right;" class="pricePad"><?php echo $rule->calc_rule_name ?> </td>
      <?php if ( VmConfig::get('show_tax')) { ?>
      <td style="text-align: right;">&nbsp;</td>
      <?php } ?>
      <td style="text-align: right;"><?php echo $this->currency->priceDisplay($rule->calc_amount, $this->user_currency_id); ?></td>
      <td style="text-align: right;"><?php echo $this->currency->priceDisplay($rule->calc_amount, $this->user_currency_id); ?></td>
   </tr>
         <?php
      }
   } ?>

Now it is not double anymore.

Joomla 3.x + VM 3.6.x (for Testing without any additional Extensions)

lostmail

  • Jr. Member
  • **
  • Posts: 280
Re: VirtueMart 3.6.11 10289 - invoice
« Reply #3 on: April 04, 2020, 11:15:03 am »
I recognised the tax in order confirmation is wrong calculated in the last line (it seems the tax for additional tax/rule -  DBTaxBill  - is not considered):

The red marked amount should also be 6,00 EUR like in the line before....don`t know why it is different here...??
Joomla 3.x + VM 3.6.x (for Testing without any additional Extensions)

lostmail

  • Jr. Member
  • **
  • Posts: 280
Re: VirtueMart 3.6.11 10289 - invoice
« Reply #4 on: April 04, 2020, 22:09:02 pm »
Changed this line in invoice_items.php:

from:
Quote
<td style="text-align: right;"><?php echo $this->currency->priceDisplay($rule->calc_amount, $this->user_currency_id); ?></td>

to:
Quote
<td style="text-align: right;"><?php echo $this->currency->priceDisplay($this->orderDetails['details']['BT']->order_billTaxAmount, $this->user_currency_id); ?></td>

Don`t know if it is correct but it works for me.

Joomla 3.x + VM 3.6.x (for Testing without any additional Extensions)