F
F
fman22019-07-08 10:35:49
1C-Bitrix
fman2, 2019-07-08 10:35:49

BITRIX. How to change check type?

Hello.
There is an online store and a cash desk from Atoll. Does anyone know how to change the check type from full payment to full_prepayment?
Maybe there are some parameters in the configuration, I honestly looked in the documentation and did not find it.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
F
fman2, 2019-07-11
@fman2

In general, friends. Problem solved. Do not listen to "Bitrix developers" in this topic, the problem is solved in the Bitrix itself.

AddEventHandler("sale", "OnCheckCollateDocuments", "CustomChangeCheckType");
function CustomChangeCheckType($entities)
{
    foreach ($entities as $entity) {
        if ($entity instanceof \Bitrix\Sale\Payment) {
            $order = $entity->getCollection()->getOrder();
            if ($entity->isPaid())
            {
                $related = [];

                foreach ($entity->getCollection() as $payment)
                {
                    if ($payment->getId() != $entity->getId())
                    {
                        $related[\Bitrix\Sale\Cashbox\Check::PAYMENT_TYPE_ADVANCE][] = $payment;
                    }
                }

                foreach ($order->getShipmentCollection() as $shipment)
                {
                    if (!$shipment->isSystem())
                    {
                        $related[\Bitrix\Sale\Cashbox\Check::SHIPMENT_TYPE_NONE][] = $shipment;
                    }
                }

                return new \Bitrix\Main\EventResult(
                    \Bitrix\Main\EventResult::SUCCESS,
                    
                );
            }
        }
    }
    return new \Bitrix\Main\EventResult(
        \Bitrix\Main\EventResult::ERROR,
        []
    );
}

This needs to be written in init.php
I'm not a Bitrix developer, I felt bad from what I saw the Bitrix code, everything was through one place, like the code above.

G
Georgy Baruchyan, 2019-07-08
@Snatch87

How to correctly specify the type of paid product Service?
I had a problem with changing the type of service, perhaps information. I think that your problem is also solved through events and changing the payment object.

Y
Yaroslav Alexandrov, 2019-07-08
@alexyarik

Everything related to the check and the type of payment in it is configured on the cash register side, plus it depends on the cash register firmware version

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question