Esempio n. 1
0
 function actionDeliveryDetailList()
 {
     //过滤语句
     $using = new class_using();
     $request = $using->safeUsing('request', 'controller:string,action:string');
     $this->_model =& FLEA::getSingleton('model_rep');
     //出货表
     $rep = $this->_model->find(array('ID' => $request['kcreport'], 'ID' => $request['actionDeliveryDetailList']));
     if ($rep) {
         $this->_model =& FLEA::getSingleton('model_grid');
         //表字段
         $grid = $this->_model->findAll(array('RepID' => $rep['ID']));
         //设置查询语句
         $dbo =& FLEA::getDBO();
         $this->sql = $rep['select FCustomerCode,FCustomerName,FDate,FSODate from v_delivery'];
         //查询条件-按日期查询
         ///此处可修改>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
         $cond = new class_conditions();
         $formdate = isset($request['formdate']) ? $request['formdate'] : date("Y-m-d");
         $todate = isset($request['todate']) ? $request['todate'] : date("Y-m-d");
         $FCustomer = isset($request['FCustomer']) ? trim($this->u2gbk($request['FCustomer'])) : null;
         $cond->between($formdate, $todate, 'FDate', 'D', 2);
         $cond->equal($FCustomer, 'FCustomerCode', 'S', ' and ');
         ///此处可修改<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
         //排序
         $order = new class_order($request);
         //获取当前页
         $page['cid'] = isset($request['pageNum']) && intval($request['pageNum']) > 0 ? intval($request['pageNum']) : 1;
         $page['size'] = isset($request['numPerPage']) && intval($request['numPerPage']) > 0 ? intval($request['numPerPage']) : 20;
         echo $this->sql;
         //获取SQL查询的全部记录
         $alldata = $dbo->getAll($this->sql . $cond->getWhere() . $order->getOrder());
         //获取SQL查询的记录总数
         $page['count'] = count($alldata);
         //$allFProfit =$this->_count($alldata,'FProfit');
         //$allFSaleAmount =$this->_count($alldata,'FSaleAmount');
         //记录偏移量
         $page['offset'] = ($page['cid'] - 1) * $page['size'] > $page['count'] ? $page['count'] : ($page['cid'] - 1) * $page['size'];
         $data = array_slice($alldata, $page['offset'], $page['size'], true);
         //处理查询结果
         if (isset($data)) {
             ///此处可修改>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
             $this->_smarty->assign('formdate', $formdate);
             $this->_smarty->assign('todate', $todate);
             $this->_smarty->assign('FCustomer', $FCustomer);
             ///此处可修改<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
             $this->_smarty->assign('orderField', $order->getField());
             $this->_smarty->assign('orderDirection', $order->getDirection());
             $this->_smarty->assign('page', $page);
             $this->_smarty->assign('data', $data);
             $this->_smarty->assign('grid', $grid);
             $this->_smarty->assign('alldata', $alldata);
             $this->_smarty->assign('allFProfit', $allFProfit);
             $this->_smarty->assign('allFSaleAmount', $allFSaleAmount);
             $this->_smarty->display('kc.DeliveryDetailList.htm');
         }
     } else {
         $this->_smarty->display('norepinfo.htm');
     }
 }
Esempio n. 2
0
 function actionFCustomer()
 {
     $using = new class_using();
     $request = $using->safeUsing('get', 'controller:string,action:string');
     $cond = new class_conditions();
     $formdate = isset($request['formdate']) ? $request['formdate'] : date("Y-m-d");
     $todate = isset($request['todate']) ? $request['todate'] : date("Y-m-d");
     $cond->between($formdate, $todate, 'fdate', 'D', 2);
     $dbo =& FLEA::getDBO();
     $sql = 'select fcustomercode,fcustomername from v_delivery' . $cond->getWhere() . ' order by fcustomercode';
     $data = $dbo->getAll($sql);
     $this->_smarty->assign('data', $data);
     $this->_smarty->display('FCustomer.htm');
 }
Esempio n. 3
0
 function actionDeliveryDetail()
 {
     //过滤语句
     $using = new class_using();
     $request = $using->safeUsing('get', 'controller:string,action:string');
     //设置查询语句
     $dbo =& FLEA::getDBO();
     $this->sql = 'select * from v_delivery';
     //查询条件-按日期查询
     $cond = new class_conditions();
     $formdate = isset($request['formdate']) ? $request['formdate'] : date("Y-m-d");
     $todate = isset($request['todate']) ? $request['todate'] : date("Y-m-d");
     $cond->between($formdate, $todate, 'fdate', 'D', 2);
     //排序
     $order = new class_order($request);
     //获取SQL查询的全部记录
     $alldata = $dbo->getAll($this->sql . $cond->getWhere() . $order->getOrder());
     $xls = new class_excel();
     $xls->addArray($this->gethead($alldata));
     $xls->addArray($this->getdata($alldata));
     $xls->addArray($this->getfoot($alldata));
     $xls->generateXML("DeliveryDetail");
 }
Esempio n. 4
0
 function actionDeliveryDetail()
 {
     //过滤语句
     $using = new class_using();
     $request = $using->safeUsing('post', 'controller:string,action:string');
     //设置查询语句
     $dbo =& FLEA::getDBO();
     $this->sql = 'select * from v_delivery';
     //查询条件-按日期查询
     $cond = new class_conditions();
     $formdate = isset($request['formdate']) ? $request['formdate'] : date("Y-m-d");
     $todate = isset($request['todate']) ? $request['todate'] : date("Y-m-d");
     $FCustomers = isset($request['FCustomers']) ? trim($this->u2gbk($request['FCustomers'])) : '';
     $FCustomercode = isset($request['FCustomercode']) ? trim($this->u2gbk($request['FCustomercode'])) : '';
     if (!strpos($FCustomers, ',')) {
         $FCustomercode = $FCustomers;
     } else {
         if (strlen($FCustomercode) == 0) {
             $pos = strpos($FCustomers, ',');
             $FCustomercode = substr($FCustomers, 0, $pos);
         } else {
             $start = strpos($FCustomers, $FCustomercode);
             $start = $start + strlen($FCustomercode) + 1;
             if ($start >= strlen($FCustomers)) {
                 $pos = strpos($FCustomers, ',');
                 $FCustomercode = substr($FCustomers, 0, $pos);
             } else {
                 $pos = strpos($FCustomers, ',', $start);
                 if (!$pos) {
                     $FCustomercode = substr($FCustomers, $start);
                 } else {
                     $FCustomercode = substr($FCustomers, $start, $pos - $start);
                 }
             }
         }
     }
     $cond->between($formdate, $todate, 'fdate', 'D', 2);
     $cond->equal($FCustomercode, 'FCustomercode', 'S', ' and ');
     //排序
     $order = new class_order($request);
     //获取当前页
     $page['cid'] = isset($request['pageNum']) && intval($request['pageNum']) > 0 ? intval($request['pageNum']) : 1;
     $page['size'] = isset($request['numPerPage']) && intval($request['numPerPage']) > 0 ? intval($request['numPerPage']) : 20;
     //获取SQL查询的全部记录
     $alldata = $dbo->getAll($this->sql . $cond->getWhere() . $order->getOrder());
     foreach ($alldata as $row) {
         $FCustomername = $row['FCustomerName'];
         $FAddress = $row['FAddress'];
         $FProvince = $row['FProvince'];
         $FCity = $row['FCity'];
         $FTel = $row['FTel'];
         $FFax = $row['FFax'];
         $FMobile = $row['FMobile'];
         $FRMB = 'RMB';
         break;
     }
     //获取SQL查询的记录总数
     $page['count'] = count($alldata);
     //记录偏移量
     $page['offset'] = ($page['cid'] - 1) * $page['size'] > $page['count'] ? $page['count'] : ($page['cid'] - 1) * $page['size'];
     $data = array_slice($alldata, $page['offset'], $page['size'], true);
     //处理查询结果
     if (isset($data)) {
         $this->_smarty->assign('formdate', $formdate);
         $this->_smarty->assign('todate', $todate);
         $this->_smarty->assign('FCustomers', $FCustomers);
         $this->_smarty->assign('FCustomercode', $FCustomercode);
         $this->_smarty->assign('FCustomername', $FCustomername);
         $this->_smarty->assign('FAddress', $FAddress);
         $this->_smarty->assign('FProvince', $FProvince);
         $this->_smarty->assign('FCity', $FCity);
         $this->_smarty->assign('FTel', $FTel);
         $this->_smarty->assign('FFax', $FFax);
         $this->_smarty->assign('FMobile', $FMobile);
         $this->_smarty->assign('FRMB', $FRMB);
         $this->_smarty->assign('orderField', $order->getField());
         $this->_smarty->assign('orderDirection', $order->getDirection());
         $this->_smarty->assign('page', $page);
         $this->_smarty->assign('data', $data);
         $this->_smarty->assign('alldata', $alldata);
         $this->_smarty->display('kc.DeliveryDetail.htm');
     }
 }
Esempio n. 5
0
 function actionDeliveryDetail()
 {
     //过滤语句
     $using = new class_using();
     $request = $using->safeUsing('get', 'controller:string,action:string');
     //设置查询语句
     $dbo =& FLEA::getDBO();
     $this->sql = 'select FCustomerType,sum(FSaleAmountIncludeTax) as FSaleAmountIncludeTax ,sum(FSaleAmount) as FSaleAmount,sum(FAmount) as FAmount,sum(FProfit) as FProfit,case when sum(FSaleAmount) = 0 then 0 else sum(FProfit)/sum(FSaleAmount) end FProfitRate from v_salesdetail';
     //查询条件-按日期查询
     $cond = new class_conditions();
     $formdate = isset($request['formdate']) ? $request['formdate'] : date("Y-m-d");
     $todate = isset($request['todate']) ? $request['todate'] : date("Y-m-d");
     $FCustomerType = isset($request['FCustomerType']) ? trim(rawurldecode($request['FCustomerType'])) : null;
     $cond->between($formdate, $todate, 'fdate', 'D', 2);
     $cond->equal($FCustomerType, 'FCustomerType', 'S', ' and ');
     //排序
     $order = new class_order($request);
     //获取SQL查询的全部记录
     $alldata = $dbo->getAll($this->sql . $cond->getWhere() . ' group by FCustomerType ' . $order->getOrder());
     $xls = new class_excel();
     $xls->addArray($this->gethead($alldata));
     $xls->addArray($this->getdata($alldata));
     $xls->addArray($this->getfoot($alldata));
     $xls->generateXML("DeliveryDetail");
 }
Esempio n. 6
0
 function actionrepsaleCombine()
 {
     //过滤语句
     $using = new class_using();
     $request = $using->safeUsing('post', 'controller:string,action:string');
     //设置查询语句
     $dbo =& FLEA::getDBO();
     //查询条件-按日期查询
     $cond = new class_conditions();
     $formdate = isset($request['formdate']) ? $request['formdate'] : date("Y-m-d");
     $todate = isset($request['todate']) ? $request['todate'] : date("Y-m-d");
     $FA = isset($request['FA']) && !empty($request['FA']) ? trim($this->u2gbk($request['FA'])) : '';
     $FB = isset($request['FB']) && !empty($request['FB']) ? trim($this->u2gbk($request['FB'])) : '';
     $FB = $FA == $FB ? '' : $FB;
     $_FA = $FA == '' ? '' : $FA . ',';
     $_FB = $FB == '' ? '' : $FB . ',';
     $cond->between($formdate, $todate, 'fdate', 'D', 2);
     $this->sql = 'select ' . $_FA . $_FB . 'sum(FSaleAmountIncludeTax) as FSaleAmountIncludeTax ,sum(FSaleAmount) as FSaleAmount,sum(FAmount) as FAmount,sum(FProfit) as FProfit,case when sum(FSaleAmount) = 0 then 0 else sum(FProfit)/sum(FSaleAmount) end FProfitRate from v_salesdetail';
     //排序
     $order = new class_order($request);
     //获取当前页
     $page['cid'] = isset($request['pageNum']) && intval($request['pageNum']) > 0 ? intval($request['pageNum']) : 1;
     $page['size'] = isset($request['numPerPage']) && intval($request['numPerPage']) > 0 ? intval($request['numPerPage']) : 20;
     if (trim($_FA . $_FB, ',') == '') {
         $alldata = $dbo->getAll($this->sql . $cond->getWhere() . $order->getOrder());
     } else {
         $alldata = $dbo->getAll($this->sql . $cond->getWhere() . ' group by ' . trim($_FA . $_FB, ',') . $order->getOrder());
     }
     //获取SQL查询的记录总数
     $page['count'] = count($alldata);
     $allFProfit = $this->_count($alldata, 'FProfit');
     $allFSaleAmount = $this->_count($alldata, 'FSaleAmount');
     //记录偏移量
     $page['offset'] = ($page['cid'] - 1) * $page['size'] > $page['count'] ? $page['count'] : ($page['cid'] - 1) * $page['size'];
     $data = array_slice($alldata, $page['offset'], $page['size'], true);
     //处理查询结果
     if (isset($data)) {
         $this->_smarty->assign('formdate', $formdate);
         $this->_smarty->assign('todate', $todate);
         $this->_smarty->assign('FA', $FA);
         $this->_smarty->assign('FB', $FB);
         $this->_smarty->assign('orderField', $order->getField());
         $this->_smarty->assign('orderDirection', $order->getDirection());
         $this->_smarty->assign('page', $page);
         $this->_smarty->assign('data', $data);
         $this->_smarty->assign('alldata', $alldata);
         $this->_smarty->assign('allFProfit', $allFProfit);
         $this->_smarty->assign('allFSaleAmount', $allFSaleAmount);
         $this->_smarty->display('repsale.Combine.htm');
     }
 }