I think from Sales Pack 4.4.2 on could be a new bug.
I calculate different sums via a before safe script at entity quote
here an example (not complete): product.customtyp is a use defined field as others.
The Problem is, that some amounts are not calulated if changing positions automatically. Some are and some are not.
Second if i insert more positions via a workflow, the tax rate is always 0 % if price is 0.
This is for a block that is used as a template and some prices have to be filled in.
I insert on Position No. 907, 908 and 909 and so on.
In the past that was working without the need of programming workarounds or buttons to get correct sums.
I calculate different sums via a before safe script at entity quote
here an example (not complete): product.customtyp is a use defined field as others.
Code:
$items = record\findRelatedMany('Quote', id, 'items', 100000);
$support = 0;
$entwicklung = 0;
$sonstiges = 0;
$i = 0;
while(
$i < array\length($items),
(
$productType = record\attribute('QuoteItem', array\at($items, $i), 'product.customtyp');
$amount = record\attribute('QuoteItem', array\at($items, $i), 'amount');
ifThen($productType == 'Dienstleistung TKD und Support', $support = $support + $amount);
ifThen($productType == 'Dienstleistung Entwicklung', $entwicklung = $entwicklung + $amount);
ifThen($productType == 'Betrag Sonstiges' || $productType == null, $sonstiges = $sonstiges + $amount);
ifThen($productType == 'Reise', $reise = $reise + $amount);
$i = $i + 1;
)
);
ifThenElse($support > 0, cAmmountDLTKDSup = $support, cAmmountDLTKDSup = null);
ifThenElse($entwicklung > 0, cAmmountDLEntw = $entwicklung, cAmmountDLEntw = null);
ifThenElse($sonstiges > 0, cAmmountsonst = $sonstiges, cAmmountsonst = null);
cAmmountdl=cAmmountDLEntw+cAmmountDLTKDSup;
$sonstiges = cAmmountsonst+cAmmountreise;
amount=cAmmountdl+$sonstiges;
ifThenElse(cAmmountdl > 0, cAmmountDLGesetzt = true, cAmmountDLGesetzt = false);
ifThenElse(cAmmountreise > 0, cAmmountreiseGesetzt = true, cAmmountreiseGesetzt = false);
Second if i insert more positions via a workflow, the tax rate is always 0 % if price is 0.
This is for a block that is used as a template and some prices have to be filled in.
I insert on Position No. 907, 908 and 909 and so on.
In the past that was working without the need of programming workarounds or buttons to get correct sums.

Comment