Esempio n. 1
0
        $val["DISCOUNT_RATION_PERCENT"] = round($val["PRICE"] * 100 / $priceTotal, 5);
        $val["DISCOUNT_RATION_VALUE"] = round($discount * $val["DISCOUNT_RATION_PERCENT"] / 100, 5);
        $val["PRICE"] -= $val["DISCOUNT_RATION_VALUE"];
        $arBasket[$key] = $val;
    }
    return $arBasket;
}
if (CModule::IncludeModule("sale")) {
    if ($arOrder = CSaleOrder::GetByID($ORDER_ID)) {
        if (isset($_REQUEST['SHIPMENT_ID']) && intval($_REQUEST['SHIPMENT_ID']) > 0) {
            $shipmentId = $_REQUEST['SHIPMENT_ID'];
            $res = \Bitrix\Sale\Internals\ShipmentTable::getList(array('select' => array('PRICE_DELIVERY'), 'filter' => array('ID' => $_REQUEST['SHIPMENT_ID'])));
            $data = $res->fetch();
            $arOrder['PRICE_DELIVERY'] = $data['PRICE_DELIVERY'];
        }
        $shipmentRes = \Bitrix\Sale\Shipment::getList(array('select' => array('DATE_ALLOW_DELIVERY', 'EMP_ALLOW_DELIVERY_ID', 'DATE_DEDUCTED', 'EMP_ALLOW_DELIVERY_ID', 'TRACKING_NUMBER', 'DELIVERY_DOC_NUM', 'DELIVERY_DOC_DATE'), 'filter' => array('ORDER_ID' => $arOrder['ID'], 'SYSTEM' => 'N'), 'order' => array('ID' => 'DESC'), 'limit' => 1));
        if ($shipmentData = $shipmentRes->fetch()) {
            $arOrder = array_merge($arOrder, $shipmentData);
        }
        $rep_file_name = GetRealPath2Report($doc . ".php");
        if (strlen($rep_file_name) <= 0) {
            ShowError("PRINT TEMPLATE NOT FOUND");
            die;
        }
        $arOrderProps = array();
        $dbOrderPropVals = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $ORDER_ID), false, false, array("ID", "CODE", "VALUE", "ORDER_PROPS_ID", "PROP_TYPE"));
        while ($arOrderPropVals = $dbOrderPropVals->Fetch()) {
            $arCurOrderPropsTmp = CSaleOrderProps::GetRealValue($arOrderPropVals["ORDER_PROPS_ID"], $arOrderPropVals["CODE"], $arOrderPropVals["PROP_TYPE"], $arOrderPropVals["VALUE"], LANGUAGE_ID);
            foreach ($arCurOrderPropsTmp as $key => $value) {
                $arOrderProps[$key] = $value;
            }