/** * Retrieve a credit item builded from the post data * * @param array $post * @return array */ public static function getCreditItem($post) { $price = empty($post['voucherAmountKomma']) ? floatval($post['voucherAmount']) : floatval($post['voucherAmount'] . '.' . $post['voucherAmountKomma']); $credit = array(); $credit['id'] = 'CREDIT[' . rpDb::getNextCreditId($post['order_number']) . ']'; $credit['name'] = utf8_decode('Händler Gutschrift'); $credit['qty'] = 1; $credit['unitPriceGross'] = $price * -1; $credit['taxRate'] = 19; return $credit; }