Skip to content

TransactionMapper contains hardcoded EUR currencies #176

@ingmarcur

Description

@ingmarcur

Hi,

The function map in TransactionMapper contains hardcoded EUR currencies:
149 ->setValue(Money::EUR(100 * self::getField($transaction, $lineElement, 'value')))
151,153,163,168.

Which result in a: "InvalidArgumentException: Currencies must be identical in.." exception.

`$t = new CashTransaction();
$t->setOffice($office);
$t->setCode('KAS');
$t->setDestiny(Enums\Destiny::TEMPORARY());
$t->setDate(new DateTime());
$t->setCurrency(new Currency('ANG'));
$t->setStartvalue(Money::ANG(0));

$l1 = new CashTransactionLine();
$l1->setId(1);
$l1->setLineType(Enums\LineType::DETAIL());
$l1->setDim1(8001);
$l1->setValue(Money::ANG(289));
$l1->setDescription("Some description...");
$t->setLines(array($l1));

try{
$ret = $tFactory->send($t);
}catch(Exception $e){
echo $e->getMessage();
}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions