3 Replies Latest reply: Oct 9, 2017 5:21 AM by fredrik olsson RSS

    Calculation in load script

    fredrik olsson

      Hi,

       

      In our database all products sold have a price, cost, units and VAT amount.

      The VAT amount is the total VAT amount for all units sold for that certain product.

       

      Now I wanna add the right portion of VAT in the load script. Is it possible to add this in a load statement?

      I wanna calculate the VAT percentage and the add that to both price and cost.

       

      I want to do something like this (written in c# as an example):

      If (VatAmount > 0) {

           var vatPercentage = ((VatAmount / Units) / Price) + 1; //Get VAT percentage

           Price = Price * vatPercentage;

           Cost = Cost * vatPercentage;

      }

       

      Product:

      LOAD

          Code,

          Description,

          VatAmount,

          Units,

          Price,

          Cost;