183 public function equals(array $fields)
192 $bBasketItemsMatch =
true;
193 $basketItemsIndexList = array();
194 $fieldsItemsIndexList = array();
200 $basketItems = $parentImport::getGroupItemsBasketFields($fields[
'ITEMS']);
201 if(count($basketItems)<=0)
207 $shipmentCollection =
$entity->getCollection();
208 $order = $shipmentCollection->getOrder();
209 $basket = $order->getBasket();
211 foreach ($basket as $basketItem)
213 if(
$entity->isExistBasketItem($basketItem))
215 $quantity =
$entity->getBasketItemQuantity($basketItem);
218 $basketItemsIndexList[$basketItem->getId()] = $quantity;
223 foreach($basketItems as $items)
225 foreach($items as $productXML_ID => $item)
227 if($basketItem = $parentImport::getBasketItemByItem($basket, $item))
229 $fieldsItemsIndexList[$basketItem->getId()] = $item[
'QUANTITY'];
234 if(count($basketItemsIndexList)<>count($fieldsItemsIndexList))
236 $bBasketItemsMatch =
false;
240 foreach ($basketItemsIndexList as $basketId=>$quantity)
242 if(isset($fieldsItemsIndexList[$basketId]) && $fieldsItemsIndexList[$basketId] == $quantity)
243 unset($fieldsItemsIndexList[$basketId]);
246 if(count($fieldsItemsIndexList)>0)
247 $bBasketItemsMatch =
false;
250 $itemDeliveryService = $shipmentImport::getFieldsDeliveryService($fields);
252 if($bBasketItemsMatch &&
253 (
$entity->isShipped()? $fields[
'DEDUCTED']==
'Y':true) &&
254 $entity->getPrice() == $itemDeliveryService[
'PRICE']