Answer the question
In order to leave comments, you need to log in
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
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,
[]
);
}
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.
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 questionAsk a Question
731 491 924 answers to any question