Beispiel #1
0
    exit;
}
if (isset($_POST['orders']) || isset($_GET['orders'])) {
    if (isset($_GET['orders'])) {
        $orders = $_GET['orders'];
        // Получаем id контрагента
        isset($_GET['filial']) ? $filial = $_GET['filial'] : null;
    } else {
        $orders = $_POST['orders'];
        //Сюда приходит список всех задействованых заказов
    }
    unset($parsed_res);
    require $GLOBALS['PATH_model'] . 'invoice_c.php';
    $Supplier = new Suppliers();
    if (isset($filial) == true) {
        $tpl->Assign('filial', $Supplier->GetFilialById($filial));
    }
    $products = array();
    foreach ($orders as $id_order) {
        $Orders = new Orders();
        $Orders->SetFieldsById($id_order);
        $ord = $Orders->fields;
        $tpl->Assign("order", $ord);
        $Invoice = new Invoice();
        $User = new Users();
        // Получить данные покупателя
        $id_customer = $ord['id_customer'];
        $Customer = new Customers();
        $Customer->SetFieldsById($id_customer);
        // Получить данные контрагента
        $id_contragent = $ord['id_contragent'];