Example #1
0
function print_addTask($chips, $backUrl, $printType)
{
    global $_W, $_GPC;
    $templates = biz_getPrintTemplates($_W['project']['projguid'], $printType, 'id');
    if (empty($templates) || count($templates) == 0) {
        message('无可用的打印模板,请找管理配置模板!', $backUrl, 'error');
    }
    $templateId = trim($_GPC['template']);
    if (!isset($templates[$templateId])) {
        message('无效的打印模板', $backUrl);
    }
    $prints = biz_getAllPrinter($_W['project']['projguid']);
    if (empty($prints) || count($prints) == 0) {
        message('无可用的打印机,请找管理员确认打印机配置!', $backUrl, 'error');
    }
    $titles = biz_getDictionary('printtype');
    $printTitle = $titles[$printType];
    if (empty($printTitle)) {
        message('无效的打印调用!', $backUrl, 'error');
    }
    $template = $templates[$templateId];
    $printId = intval($_GPC['printer']);
    //记录当前使用的打印机
    isetcookie('__print', $printId);
    $print = $prints[$printId];
    if (!biz_checkChipsStatus($chips, $printType, 'printstatus')) {
        db_updateChipsStatus($chips['id'], $printType, false, 'printstatus');
    }
    $copy_max = 9;
    $copy = intval($_GPC['copy']);
    if ($copy <= 0) {
        $copy = 1;
    }
    if ($copy > $copy_max) {
        $copy = $copy_max;
    }
    $printdata = biz_Print_getTemplateData($templateId, $chips);
    $task = array('projguid' => $chips['projguid'], 'title' => $chips['cname'] . '-' . $printTitle, 'printid' => $printId, 'moduleid' => $print['moduleid'], 'templateid' => $templateId, 'templatename' => $template['title'], 'key' => $chips['qrcode'], 'printname' => $print['title'], 'printtype' => $printType, 'printdata' => iserializer($printdata), 'createid' => $_W['uid'], 'creator' => $_W['username'], 'copy' => $copy, 'status' => '等待', 'createtime' => TIMESTAMP);
    if (pdo_insert('printtask', $task)) {
        message('数据已进入排队打印中,请稍候...', $backUrl);
    } else {
        message('写入打印任务数据出错', $backUrl);
    }
}
Example #2
0
    $user_info = $chips['user'];
    $sql = " select * from " . tablename('s_fee') . " where TradeGUID=:guid order by Sequence";
    $list = pdo_fetchall($sql, array(':guid' => $chips['qrcode']));
    // 点击确认 相应事件??
    include $this->template('book_dispfee');
}
// 显示认购书信息
if ($op == 'disp') {
    $id = intval($_GPC['id']);
    $chips = biz_getChips($id, true);
    $this->CheckDataRight($chips);
    if (!biz_checkChipsStatus($chips, 7)) {
        message('未打印订金不能确认!', $this->createWebUrl($do), 'info');
    }
    //定单是否已确认
    $confirmed = biz_checkChipsStatus($chips, 8);
    $user_info = $chips['user'];
    if (checksubmit() && !$confirmed) {
        //定单没有确认,
        load()->web('app');
        $room = db_getRoomByGUID($chips['roomguid']);
        if (!empty($room)) {
            if ($room['Status'] == '交款') {
                $room['NewStatus'] = '认购';
                //4强制更新状态?
                APP_updateRoomStatus($room, $chips, 2);
            }
            if (empty($chips['ProtocolNO'])) {
                load()->web('print');
                biz_updateChipsProtocolNo($chips);
            }
Example #3
0
             if (empty($bill)) {
                 $inputBill = array('BillGUID' => GUID(), 'Money' => 0, 'finance' => array(array('money' => 0, 'note' => '足定换票')));
                 if (!biz_addBill($chips, $inputBill, 2)) {
                     message('生成票据,保存数据失败!', $url, 'error');
                 }
                 $bill = biz_getBill($chips['qrcode'], 2, 0);
             }
         }
         //更新没有打印生成票据的数据
         if (!empty($bill) && empty($bill['Printed'])) {
             if (!biz_updateBillOfInvoNo($bill)) {
                 message('生成票据单号失败,请重新打印!', $this->createWebUrl($do), 'error');
             }
         }
         //未改变状态
         if (!biz_checkChipsStatus($chips, 7)) {
             load()->web('app');
             $room = db_getRoomByGUID($chips['roomguid']);
             $room['NewStatus'] = '交款';
             if (APP_updateRoomStatus($room, $chips, 2)) {
                 //更新补定状态
             }
             db_updateChipsStatus($chips['id'], 7);
         }
         print_addTask($chips, $this->createWebUrl($do), $type);
     } else {
         $url = $this->createWebUrl($do, array('op' => 'print', 'id' => $id));
         print_Confirm($chips, $url, $type);
     }
 } else {
     echo $msg;