public function act_orderWeighingCheck() { $orderid = isset($_POST['orderid']) ? $_POST['orderid'] : ""; $where = "where id={$orderid}"; $orderinfo = orderWeighingModel::selectRecord($where); if (!orderinfo) { self::$errCode = 502; self::$errMsg = "此发货单号不存在!"; return false; } if ($orderinfo[0]['orderStatus'] != PKS_WWEIGHING) { if ($orderinfo[0]['orderStatus'] == PKS_WDISTRICT) { self::$errCode = 514; self::$errMsg = "此发货单已在待分区,不用再扫描!"; return false; } else { if ($orderinfo[0]['orderStatus'] == PKS_WAITING_SORTING) { self::$errCode = 514; self::$errMsg = "此发货单还在待分拣中!"; return false; } else { self::$errCode = 514; self::$errMsg = "此发货单在" . LibraryStatusModel::getStatusNameByStatusCode($orderinfo[0]['orderStatus']) . "状态,请确认!"; return false; } } } $flat_transport = C('flat_transport'); $carrier = CommonModel::getShipingNameById($orderinfo[0]['transportId']); if (in_array($carrier, $flat_transport)) { $arr['type'] = "flat"; } else { self::$errCode = 503; self::$errMsg = "此发货单运输方式不属于小包,请确认!"; return false; } $partionId = CommonModel::getChannelIdByIds($orderinfo[0]['transportId'], $orderinfo[0]['countryName']); $account = CommonModel::getAccountNameById($orderinfo[0]['accountId']); //运输公司 $channelId = printLabelModel::getMcFromCarrier($orderinfo[0]['id'], $carrier, $orderinfo[0]['countryName'], $account); $arr['channelId'] = $channelId; $arr['transportId'] = $orderinfo[0]['transportId']; $arr['partionId'] = $partionId; $arr['countryName'] = $orderinfo[0]['countryName']; $arr['orderid'] = $orderid; return $arr; }
$transport = trim($_SESSION['transport']); $shipOrderInfo = WhShippingOrderModel::get_order_info_union_table($shipOrderId); //获取发货单基本信息 $transportId = $shipOrderInfo['transportId']; //运输方式ID if (in_array($transportId, array(79, 80))) { $ebay_id = $shipOrderInfo['id']; $ebay_tracknumber = $shipOrderInfo['tracknumber']; $ebay_userid = $shipOrderInfo['platformUsername']; $ebay_total = $shipOrderInfo['total']; $ebay_total = $ebay_total >= 10 ? 10 : ($ebay_total == 0 ? rand(5, 10) : $ebay_total); $ebay_usermail = $shipOrderInfo['email']; $packingtype = $shipOrderInfo['packingtype']; $orderweight = round($shipOrderInfo['actualWeight'] / 1000, 3); $ordershipfee = $shipOrderInfo['actualShipping']; $ebay_account = CommonModel::getAccountNameById($shipOrderInfo['accountId']); $cname = $shipOrderInfo['username']; $street1 = $shipOrderInfo['street']; $street2 = $shipOrderInfo['address2'] ? $shipOrderInfo['address2'] : ''; $street2 .= $shipOrderInfo['address3'] ? $shipOrderInfo['address3'] : ''; $city = $shipOrderInfo['city']; $state = $shipOrderInfo['state']; $countryname = $shipOrderInfo['countryName']; $countrySn = $shipOrderInfo['countrySn']; $ebay_currency = $shipOrderInfo['currency']; $countryCn = self::get_countryNameCn($countryname); //根据国家英文名获取国家中文名 $zip = $shipOrderInfo['zipCode']; //邮编 $tel1 = !$shipOrderInfo['landline'] ? '' : $shipOrderInfo['landline']; $tel = $tel1 ? $tel1 : ($shipOrderInfo['phone'] ? $shipOrderInfo['phone'] : "");
public function getOrderInfoByIdList($idlist, $where = '') { $str = implode(',', $idlist); $sql = "\n select so.id, so.platformUsername,so.accountId, so.zipCode, so.username, so.countryName, so.countrySn, so.state, so.city, so.street, so.address2, so.address3, so.landline, so.phone\n ,so.createdTime, sor.recordNumber,sor.originOrderId from wh_shipping_order as so join wh_shipping_order_relation as sor on so.id=sor.shipOrderId where 1 and so.id in ({$str}) \n group by so.id {$where}\n "; $orderlist = array(); $q_order = $this->dbconn->query($sql); $orderlist = $this->dbconn->fetch_array_all($q_order); $total = 0; foreach ($orderlist as &$list) { $list['countryZh'] = CommonModel::getCountryNameCn($list['countryName']); $remarks = CommonModel::getExpressRemark($list['id']); //得到快递备注 $accountId = CommonModel::getAccountNameById($list['accountId']); //店铺账号 $list['appname'] = $accountId['account']; //账号昵称 if (!empty($remarks)) { foreach ($remarks as $remark) { $total += $remark['amount'] * $remark['price']; } } $list['remarkTotal'] = $total; $list['remark'] = $remarks; } return $orderlist; }
public function view_printGroupOrder100() { $groupsn = isset($_GET['groupsn']) ? trim($_GET['groupsn']) : 0; if (empty($groupsn)) { echo "请指定配货清单!"; exit; } $group_list = OmAvailableModel::getTNameList("wh_shipping_order_group", "*", "where shipOrderGroup='{$groupsn}' order by id asc"); if (!$group_list) { echo "该配货清单不存在!"; exit; } $time = time(); $userName = $_SESSION['userName']; //更新今日清单打印表 OmAvailableModel::updateTNameRow("wh_shipping_order_group_print", "set status='1',orderPrintUser='******',orderPrintTime='{$time}'", "where shipOrderGroup='{$groupsn}'"); //获取订单对应的车号 $orderids = array(); foreach ($group_list as $group) { if (!isset($orderids[$group['shipOrderId']])) { $orderids[$group['shipOrderId']] = $group['carNumber']; } } $o_arr = array(); foreach ($orderids as $order => $car_number) { $o_arr[] = $order; } $oids = implode(',', $o_arr); $po_obj = new PackingOrderModel(); $ordersinfo = $po_obj->getaSetOfOrderInfo($oids); if (empty($ordersinfo)) { $data = array('data' => array('没有可打印内容!'), 'link' => 'index.php?mod=orderWaitforPrint&act=printList'); goErrMsgPage($data); exit; } $sod_obj = new ShipingOrderDetailModel(); $acc_id_arr = array(); foreach ($ordersinfo as &$orinfval) { $locationinfo = array(); $totalnum = 0; $package_type = ''; $iscard = ''; $carrier = CommonModel::getShipingNameById($orinfval['transportId']); if ($carrier == 'EUB' || $carrier == 'Global Mail' || $carrier == '德国邮政') { $goods_title = array(); $skulisttemp = $sod_obj->getSkuListByOrderId($orinfval['id'], "order by pName"); $eubtotal = 0; $totalweight = 0; $detailcount = count($skulisttemp); $height = $detailcount > 1 ? intval(123 / $detailcount) : 123; foreach ($skulisttemp as &$tmval) { if ($carrier == 'EUB') { //EUB热敏打印处理 $sku_info = printLabelModel::getSkuInfo($tmval['sku']); if (!empty($sku_info)) { $materName = CommonModel::getMaterInfoById($sku_info['pmId']); //包材 list($goodsName) = strpos($sku_info['goodsName'], '--') !== false ? explode('--', $sku_info['goodsName']) : array($sku_info['goodsName']); $price = rand(300, 600) / 100; $eubtotal += $price; $weight = $sku_info['goodsWeight'] * $tmval['amount']; $totalweight += $weight; $locationinfo['skuinfo'][] = array('sku' => $tmval['sku'], 'itemTitle' => $tmval['itemTitle'], 'goodsName' => $goodsName, 'isPacking' => $sku_info['isPacking'], 'materName' => $materName, 'pName' => $tmval['pName'], 'amount' => $tmval['amount'], 'price' => $price, 'weight' => $weight, 'height' => $height); $locationinfo['eubtotal'] = $eubtotal; $locationinfo['eubweight'] = $totalweight; } $zip = $orinfval['zipCode']; $zip0 = explode("-", $zip); if (count($zip0) >= 2) { $zip = $zip0[0]; $orinfval['zipCode'] = $zip; } $isd = intval(substr($zip, 0, 2)); if ($isd >= 0 && $isd <= 34) { $isd = '1'; } else { if ($isd >= 35 && $isd <= 74) { $isd = '3'; } else { if ($isd >= 75 && $isd <= 93) { $isd = '4'; } else { if ($isd >= 94 && $isd <= 99) { $isd = '2'; } else { $isd = '1'; } } } } $orinfval['isd'] = $isd; //回邮信息 $orinfval['pinfo'] = CommonModel::getEubAccounts($orinfval['accountId']); //跟踪号 $orinfval['tracknumber'] = printLabelModel::getTracknumber($orinfval['id']); } else { if ($carrier == 'Global Mail' || $carrier == '德国邮政') { //Global Mail-100*100打印 $title_nums = 0; $title_nums = count($goods_title); if ($detailcount > 3 && $title_nums < 2) { $goods_title[] = !empty($tmval['itemTitle']) ? $title_nums + 1 . ' ' . $tmval['itemTitle'] : ''; } else { if ($detailcount <= 3 && $title_nums == 0) { $goods_title[] = !empty($tmval['itemTitle']) ? $title_nums + 1 . ' ' . $tmval['itemTitle'] : ''; } } $sku_info = printLabelModel::getSkuInfo($tmval['sku']); if (!empty($sku_info)) { $weight = $sku_info['goodsWeight'] * $tmval['amount']; $totalweight += $weight; } $locationinfo[] = array('sku' => $tmval['sku'], 'isPacking' => $sku_info['isPacking'], 'pName' => $tmval['pName'], 'amount' => $tmval['amount']); //重量等级 if ($totalweight < 0.1) { $weightmark = 'P'; $ordershipfee = rand(100, 500) / 100; } else { if ($totalweight < 0.5) { $weightmark = 'G'; $ordershipfee = rand(501, 1000) / 100; } else { if ($totalweight < 2) { $weightmark = 'E'; $ordershipfee = rand(1001, 2000) / 100; } else { $weightmark = '超重'; } } } $orinfval['ordershipfee'] = number_format($ordershipfee / $detailcount, 2); $orinfval['titleinfo'] = implode('<br />', $goods_title); $orinfval['totalweight'] = $totalweight; $orinfval['weightmark'] = $weightmark; $salesaccountinfo = CommonModel::getAccountNameById($orinfval['accountId']); $orinfval['appname'] = $salesaccountinfo['appname']; } else { $locationinfo[] = array('location' => $tmval['pName'], 'sku' => $tmval['sku'], 'amount' => $tmval['amount']); $goods_title[] = $tmval['itemTitle']; $orinfval['goods_title'] = $goods_title; } } $totalnum += $tmval['amount']; } } elseif ($carrier == '新加坡邮政') { $skulisttemp = $sod_obj->getAllSkuListByOrderId($orinfval['id'], "order by pName,combineSku", 0); $totalnum = $skulisttemp['totalnum']; $locationinfo = $skulisttemp['skuinfo']; if (isset($locationinfo['notcombine']) && count($locationinfo['notcombine']['info']) == 1) { $package_type = $skulisttemp['packagetype']; } $orinfval['countryZh'] = CommonModel::getCountryNameCn($orinfval['countryName']); //跟踪号 $orinfval['tracknumber'] = printLabelModel::getTracknumber($orinfval['id']); } $pmNameStr = CommonModel::getMaterInfoById($orinfval['pmId']); $orinfval['pmNameStr'] = $pmNameStr; $orinfval['finalposition'] = $locationinfo; //$carrier = CommonModel::getShipingNameById($orinfval['transportId']); $orinfval['carrier'] = $carrier; $orinfval['totalnum'] = $totalnum; } $totalCount = count($ordersinfo); $this->smarty->assign('totalCount', $totalCount); $this->smarty->assign('orderids', $orderids); $this->smarty->assign('ordersinfo', $ordersinfo); $this->smarty->display('mixprint_1.htm'); }
public static function showPartionScan($shipOrderId, $accountId, $carrier, $countryName) { $sz_array = $sz_name_array = array(); $account = CommonModel::getAccountNameById($accountId); $partions = CommonModel::getChannelNameByIds('all'); foreach ($partions as $partion) { $sz_array[$partion['partitionCode']] = $partion['countries']; $sz_name_array[$partion['partitionCode']] = htmlspecialchars_decode($partion['partitionName']); } //匹配回邮地址信息 $returnvalue = $carrier; foreach ($sz_array as $sz_key => $sz_value) { $sz_value_arr = explode("],[", $sz_value); $sz_value_arr[0] = str_replace("[", "", $sz_value_arr[0]); $sz_value_arr[count($sz_value_arr) - 1] = str_replace("]", "", $sz_value_arr[count($sz_value_arr) - 1]); if (!empty($countryName) && in_array(trim($countryName), $sz_value_arr)) { $returnvalue .= $sz_name_array[$sz_key]; break; } } //增加因缺少国家直接为福七区的逻辑 add by guanyongjun 2014/03/07 if (!in_array($countryName, array('Australia', 'Australla')) && empty($returnvalue)) { $returnvalue = $carrier . $sz_name_array[7]; } return $returnvalue; // if(strpos($carrier, '中国邮政')!==false){ // if(in_array(trim($countryName), array('Albania','Algeria','Argentina','Egypt','Ethiopia','Estonia','Anguilla','Austria','Bahrain','Panama','Belarus','Bulgaria','Benin','Belgium','Iceland','Bosnia and Herzegovina','Bolivia','Botswana','Burkina Faso','Burundi','Denmark','Togo','Dominica','Russian Federation','Ecuador','Falkland Islands(Malvinas)','Gambia','Colombia','Costa Rica','Greenland','Georgia','Guyana','Haiti','Djibouti','Guinea','Guinea','Ghana','Cambodia','Czech Republic','Zimbabwe','Cameroon','Qatar','Cote d Ivoire (Ivory Coast)','Kuwait','Kenya','Latvia','Lesotho','Laos','Lebanon','Lithuania','Liberia','Libya','Rwanda','Romania','Madagascar','Malta','Malawi','Mali','Mauritania','Mongolia','Bangladesh','Peru','Morocco','Mozambique','Namibia','Nepal','Niger','Nigeria','Palau','Portugal','Sweden','Senegal','Cyprus','Seychelles','Slovakia','Sudan','Suriname','Tanzania','Trinidad and Tobago','Tunisia','Turkey','Venezuela','Uganda','Uruguay','Western Sahara','Greece','Hungary','Syria','Jamaica','Armenia','Yemen','Iraq','Iran','India','Zambia','Zaire','Chad','Chile','Cuba,Republic of','Congo, Republic of the','Congo, Democratic Republic of the','Russia','Azerbaijan Republic','Azerbaijan','Dominica','Dominican Republic','Equatorial Guinea','Gabon Republic','Papua New Guinea')) || in_array($account, array('taotaocart','arttao','taochains','etaosky','tmallbasket','mucheer','lantao','direttao','hitao','taolink'))){ // return $carrier.$sz_name_array[7]; // }else{ // $mailways = self::getOrderGoodsMailwayIds($shipOrderId); // if(in_array(2,$mailways) || in_array(5,$mailways) || in_array(trim($countryName), array('Saudi Arabia','Malaysia'))){ // $returnvalue = $carrier; // foreach($sz_array as $sz_key => $sz_value){ // $sz_value_arr = explode("],[",$sz_value); // $sz_value_arr[0] = str_replace("[","",$sz_value_arr[0]); // $sz_value_arr[count($sz_value_arr)-1] = str_replace("]","",$sz_value_arr[count($sz_value_arr)-1]); // if(!empty($countryName) && in_array(trim($countryName),$sz_value_arr)){ // $returnvalue .= $sz_name_array[$sz_key]; // break; // } // } // return $returnvalue; // }else if(in_array(1,$mailways)){ // return $carrier.$sz_name_array[7]; // } else { // return $carrier.$sz_name_array[7]; // } // } // } }
//@session_start(); require_once WEB_PATH . "framework.php"; Core::getInstance(); global $dbConn; $shipOrderId = intval($_SESSION['shipOrderId']); //发货单ID $transport = trim($_SESSION['transport']); //运输方式的ID $order = WhShippingOrderModel::get_order_info_union_table($shipOrderId); $ebay_id = $order['id']; $recordnumber = $order['recordNumber']; //订单编号 $ebay_userid = $order['platformUsername']; //买家ID $ebay_username = $order['username']; $ebay_account = CommonModel::getAccountNameById($order['accountId']); //店铺账号 $ebay_state = $order['state']; $ebay_city = $order['city']; $ebay_street = $order['street']; $ebay_address = $ebay_state . $ebay_city . $ebay_street; //买家地址 $ebay_phone = $order['landline']; $ebay_phone1 = $order['phone']; //$ebay_ordersn = $order['ebay_ordersn']; //order表联系orderdetail表的foreginkey $tel1 = !$order['landline'] ? "" : str_replace('-', '', $order['landline']); $tel = $tel1 ? $tel1 : ($order['phone'] ? $order['phone'] : ""); $detail = WhShippingOrderdetailModel::getShipDetails($shipOrderId); //获取发货单明细 $totalAmount = 0; //总件数
private function printDispatchOrder($oids, $type) { $po_obj = new PackingOrderModel(); $ordersinfo = $po_obj->getaSetOfOrderInfo($oids); //echo "<pre>";print_r($ordersinfo);exit; if (empty($ordersinfo)) { $data = array('data' => array('没有可打印内容!'), 'link' => 'index.php?mod=orderWaitforPrint&act=printList'); goErrMsgPage($data); exit; } $sod_obj = new ShipingOrderDetailModel(); $acc_id_arr = array(); foreach ($ordersinfo as &$orinfval) { $locationinfo = array(); $totalnum = 0; $package_type = ''; $iscard = ''; $carrier = CommonModel::getShipingNameById($orinfval['transportId']); if ($type == 1 || $type == 6 || $type == 7) { //标签打印-50*100处理 if ($type == 7) { $tag = 0; } else { $tag = 1; } $skulisttemp = $sod_obj->getAllSkuListByOrderId($orinfval['id'], "order by pName,combineSku", $tag); $totalnum = $skulisttemp['totalnum']; $locationinfo = $skulisttemp['skuinfo']; if (isset($locationinfo['notcombine']) && count($locationinfo['notcombine']['info']) == 1) { $package_type = $skulisttemp['packagetype']; } $iscard = printLabelModel::checkprintcard($orinfval['id']); } elseif ($type == 8) { if ($carrier == 'EUB' || $carrier == 'Global Mail' || $carrier == '德国邮政') { $goods_title = array(); $skulisttemp = $sod_obj->getSkuListByOrderId($orinfval['id'], "order by pName"); $eubtotal = 0; $totalweight = 0; $detailcount = count($skulisttemp); $height = $detailcount > 1 ? intval(123 / $detailcount) : 123; foreach ($skulisttemp as &$tmval) { if ($carrier == 'EUB') { //EUB热敏打印处理 $sku_info = printLabelModel::getSkuInfo($tmval['sku']); if (!empty($sku_info)) { $materName = CommonModel::getMaterInfoById($sku_info['pmId']); //包材 list($goodsName) = strpos($sku_info['goodsName'], '--') !== false ? explode('--', $sku_info['goodsName']) : array($sku_info['goodsName']); $price = rand(300, 600) / 100; $eubtotal += $price; $weight = $sku_info['goodsWeight'] * $tmval['amount']; $totalweight += $weight; $locationinfo['skuinfo'][] = array('sku' => $tmval['sku'], 'itemTitle' => $tmval['itemTitle'], 'goodsName' => $goodsName, 'isPacking' => $sku_info['isPacking'], 'materName' => $materName, 'pName' => $tmval['pName'], 'amount' => $tmval['amount'], 'price' => $price, 'weight' => $weight, 'height' => $height); $locationinfo['eubtotal'] = $eubtotal; $locationinfo['eubweight'] = $totalweight; } $zip = $orinfval['zipCode']; $zip0 = explode("-", $zip); if (count($zip0) >= 2) { $zip = $zip0[0]; $orinfval['zipCode'] = $zip; } $isd = intval(substr($zip, 0, 2)); if ($isd >= 0 && $isd <= 34) { $isd = '1'; } else { if ($isd >= 35 && $isd <= 74) { $isd = '3'; } else { if ($isd >= 75 && $isd <= 93) { $isd = '4'; } else { if ($isd >= 94 && $isd <= 99) { $isd = '2'; } else { $isd = '1'; } } } } $orinfval['isd'] = $isd; //回邮信息 $orinfval['pinfo'] = CommonModel::getEubAccounts($orinfval['accountId']); //跟踪号 $orinfval['tracknumber'] = printLabelModel::getTracknumber($orinfval['id']); } else { if ($carrier == 'Global Mail' || $carrier == '德国邮政') { //Global Mail-100*100打印 $title_nums = 0; $title_nums = count($goods_title); if ($detailcount > 3 && $title_nums < 2) { $goods_title[] = !empty($tmval['itemTitle']) ? $title_nums + 1 . ' ' . $tmval['itemTitle'] : ''; } else { if ($detailcount <= 3 && $title_nums == 0) { $goods_title[] = !empty($tmval['itemTitle']) ? $title_nums + 1 . ' ' . $tmval['itemTitle'] : ''; } } $sku_info = printLabelModel::getSkuInfo($tmval['sku']); if (!empty($sku_info)) { $weight = $sku_info['goodsWeight'] * $tmval['amount']; $totalweight += $weight; } $locationinfo[] = array('sku' => $tmval['sku'], 'isPacking' => $sku_info['isPacking'], 'pName' => $tmval['pName'], 'amount' => $tmval['amount']); //重量等级 if ($totalweight < 0.1) { $weightmark = 'P'; $ordershipfee = rand(100, 500) / 100; } else { if ($totalweight < 0.5) { $weightmark = 'G'; $ordershipfee = rand(501, 1000) / 100; } else { if ($totalweight < 2) { $weightmark = 'E'; $ordershipfee = rand(1001, 2000) / 100; } else { $weightmark = '超重'; } } } $orinfval['ordershipfee'] = number_format($ordershipfee / $detailcount, 2); $orinfval['titleinfo'] = implode('<br />', $goods_title); $orinfval['totalweight'] = $totalweight; $orinfval['weightmark'] = $weightmark; $salesaccountinfo = CommonModel::getAccountNameById($orinfval['accountId']); $orinfval['appname'] = $salesaccountinfo['appname']; } else { $locationinfo[] = array('location' => $tmval['pName'], 'sku' => $tmval['sku'], 'amount' => $tmval['amount']); $goods_title[] = $tmval['itemTitle']; $orinfval['goods_title'] = $goods_title; } } $totalnum += $tmval['amount']; } } elseif ($carrier == '新加坡邮政') { $skulisttemp = $sod_obj->getAllSkuListByOrderId($orinfval['id'], "order by pName,combineSku", 0); $totalnum = $skulisttemp['totalnum']; $locationinfo = $skulisttemp['skuinfo']; if (isset($locationinfo['notcombine']) && count($locationinfo['notcombine']['info']) == 1) { $package_type = $skulisttemp['packagetype']; } $orinfval['countryZh'] = CommonModel::getCountryNameCn($orinfval['countryName']); //跟踪号 $orinfval['tracknumber'] = printLabelModel::getTracknumber($orinfval['id']); } } else { $goods_title = array(); $skulisttemp = $sod_obj->getSkuListByOrderId($orinfval['id'], "order by pName"); $eubtotal = 0; $totalweight = 0; $detailcount = count($skulisttemp); $height = $detailcount > 1 ? intval(123 / $detailcount) : 123; foreach ($skulisttemp as &$tmval) { if ($type == 3) { //EUB热敏打印处理 $sku_info = printLabelModel::getSkuInfo($tmval['sku']); if (!empty($sku_info)) { $materName = CommonModel::getMaterInfoById($sku_info['pmId']); //包材 list($goodsName) = strpos($sku_info['goodsName'], '--') !== false ? explode('--', $sku_info['goodsName']) : array($sku_info['goodsName']); $price = rand(300, 600) / 100; $eubtotal += $price; $weight = $sku_info['goodsWeight'] * $tmval['amount']; $totalweight += $weight; $locationinfo['skuinfo'][] = array('sku' => $tmval['sku'], 'itemTitle' => $tmval['itemTitle'], 'goodsName' => $goodsName, 'isPacking' => $sku_info['isPacking'], 'materName' => $materName, 'pName' => $tmval['pName'], 'amount' => $tmval['amount'], 'price' => $price, 'weight' => $weight, 'height' => $height); $locationinfo['eubtotal'] = $eubtotal; $locationinfo['eubweight'] = $totalweight; } } else { if ($type == 4 || $type == 5) { //Global Mail-100*100打印 $title_nums = 0; $title_nums = count($goods_title); if ($detailcount > 3 && $title_nums < 2) { $goods_title[] = !empty($tmval['itemTitle']) ? $title_nums + 1 . ' ' . $tmval['itemTitle'] : ''; } else { if ($detailcount <= 3 && $title_nums == 0) { $goods_title[] = !empty($tmval['itemTitle']) ? $title_nums + 1 . ' ' . $tmval['itemTitle'] : ''; } } $sku_info = printLabelModel::getSkuInfo($tmval['sku']); if (!empty($sku_info)) { $weight = $sku_info['goodsWeight'] * $tmval['amount']; $totalweight += $weight; } $locationinfo[] = array('sku' => $tmval['sku'], 'isPacking' => $sku_info['isPacking'], 'pName' => $tmval['pName'], 'amount' => $tmval['amount']); } else { $locationinfo[] = array('location' => $tmval['pName'], 'sku' => $tmval['sku'], 'amount' => $tmval['amount'], 'price' => $tmval['itemPrice'], 'itemTitle' => $tmval['itemTitle']); $goods_title[] = $tmval['itemTitle']; $orinfval['goods_title'] = $goods_title; } } $totalnum += $tmval['amount']; } } if ($type == 10) { $itemtitle = ""; foreach ($locationinfo as $key => $value) { $itemtitle .= $key + 1 . "、" . $value['itemTitle'] . "<br>"; } $orinfval['itemTitle'] = $itemtitle; $orinfval['countryZh'] = CommonModel::getCountryNameCn($orinfval['countryName']); $account = CommonModel::getAccountNameById($orinfval['accountId']); $orinfval['account'] = $account['account']; $orinfval['notes'] = $po_obj->getOrderNotesInfo($orinfval['id']); } //$orinfval['total'] = $eubtotal; if ($type == 2 || $type == 33) { //快递A4打印需分割成小数组 $locationinfo = array_chunk($locationinfo, 2); $salesaccountinfo = CommonModel::getAccountNameById($orinfval['accountId']); $orinfval['account'] = $salesaccountinfo['account']; $salesaccountinfo = CommonModel::getAccountNameById($orinfval['accountId']); $orinfval['appname'] = $salesaccountinfo['appname']; $orinfval['countryZh'] = CommonModel::getCountryNameCn($orinfval['countryName']); $orinfval['notes'] = $po_obj->getOrderNotesInfo($orinfval['id']); // print_r($orinfval); // exit; $pglist = array(); foreach ($ordersinfo as $order) { $pglist[] = $order['id']; } $olist = implode(",", $pglist); $this->smarty->assign('pglist', $olist); } if ($type == 3) { //EUB热敏打印 $zip = $orinfval['zipCode']; $zip0 = explode("-", $zip); if (count($zip0) >= 2) { $zip = $zip0[0]; $orinfval['zipCode'] = $zip; } $isd = intval(substr($zip, 0, 2)); if ($isd >= 0 && $isd <= 34) { $isd = '1'; } else { if ($isd >= 35 && $isd <= 74) { $isd = '3'; } else { if ($isd >= 75 && $isd <= 93) { $isd = '4'; } else { if ($isd >= 94 && $isd <= 99) { $isd = '2'; } else { $isd = '1'; } } } } $orinfval['isd'] = $isd; //回邮信息 $orinfval['pinfo'] = CommonModel::getEubAccounts($orinfval['accountId']); //跟踪号 $orinfval['tracknumber'] = printLabelModel::getTracknumber($orinfval['id']); } if ($type == 7) { //新加坡热敏打印 $orinfval['countryZh'] = CommonModel::getCountryNameCn($orinfval['countryName']); //跟踪号 $orinfval['tracknumber'] = printLabelModel::getTracknumber($orinfval['id']); } if ($type == 4 || $type == 5) { //Global Mail-100*100打印 //重量等级 if ($totalweight < 0.1) { $weightmark = 'P'; $ordershipfee = rand(100, 500) / 100; } else { if ($totalweight < 0.5) { $weightmark = 'G'; $ordershipfee = rand(501, 1000) / 100; } else { if ($totalweight < 2) { $weightmark = 'E'; $ordershipfee = rand(1001, 2000) / 100; } else { $weightmark = '超重'; } } } $orinfval['ordershipfee'] = number_format($ordershipfee / $detailcount, 2); $orinfval['titleinfo'] = implode('<br />', $goods_title); $orinfval['totalweight'] = $totalweight; $orinfval['weightmark'] = $weightmark; $salesaccountinfo = CommonModel::getAccountNameById($orinfval['accountId']); $orinfval['appname'] = $salesaccountinfo['appname']; } $pmNameStr = CommonModel::getMaterInfoById($orinfval['pmId']); $orinfval['pmNameStr'] = $pmNameStr; $orinfval['finalposition'] = $locationinfo; //$carrier = CommonModel::getShipingNameById($orinfval['transportId']); $orinfval['carrier'] = $carrier; $orinfval['totalnum'] = $totalnum; $orinfval['package_type'] = $package_type; if ($type == 1 || $type == 6) { //标签打印-50*100处理 $totalStr = $totalnum . " " . $pmNameStr . " " . $orinfval['calcWeight'] . "KG"; if (!empty($package_type)) { $totalStr = $totalStr . " " . $package_type; } if (!empty($iscard)) { $totalStr = $totalStr . " " . $iscard; } $totalStr = $totalStr . " " . $orinfval['platformUsername']; $orinfval['abbrshipname'] = CommonModel::getShipingAbbrNameById($orinfval['transportId']); //$orinfval['channelname'] = ShipingTypeModel::getChannelNameByIds($orinfval['transportId'], $orinfval['channelId']); //$orinfval['channelname'] = CommonModel::getChannelNameByIds($orinfval['transportId'], $orinfval['countryName']); $orinfval['totalStr'] = $totalStr; $orinfval['notes'] = $po_obj->getOrderNotesInfo($orinfval['id']); $orinfval['countryZh'] = CommonModel::getCountryNameCn($orinfval['countryName']); $orinfval['partionFromAddress'] = printLabelModel::getPartionFromAddress($orinfval['id'], $carrier, $orinfval['countryName']); } if ($type == 9) { //部分包货打印-50*100处理 $countryZh = CommonModel::getCountryNameCn($orinfval['countryName']); $isLast = printLabelModel::adjustIsLast($orinfval['id']); //是否是最后一个配货单 $doneOrder = printLabelModel::getAllOriginOrderId($orinfval['id']); $streetInfo = "<br>" . $orinfval['username'] . "<br>" . $orinfval['street'] . "<br>" . $orinfval['state'] . "<br>" . $orinfval['zipCode'] . "<br>" . $orinfval['countryName'] . "(" . $countryZh . ")"; if (!empty($doneOrder)) { $doneStr = "<br>包含配货单单号:" . $doneOrder; } else { $doneStr = ''; } if ($isLast && empty($doneStr)) { $orinfval['packinglog'] = "第一个包裹,全部打印"; $orinfval['streetInfo'] = $streetInfo; } elseif ($isLast && !empty($doneStr)) { $orinfval['packinglog'] = "最后一个包裹,全部打印" . $doneStr; $orinfval['streetInfo'] = $streetInfo; } elseif (!$isLast && empty($doneStr)) { $orinfval['packinglog'] = "第一个包裹,部分打印"; $orinfval['streetInfo'] = ''; } else { $orinfval['packinglog'] = "分包裹,部分打印" . $doneStr; $orinfval['streetInfo'] = ''; } } if ($type == 31 || $type == 32 || $type == 311 || $type == 312) { $orinfval['notes'] = $po_obj->getOrderNotesInfo($orinfval['id']); $totalPrice = 0; foreach ($locationinfo as $info) { $totalPrice += $info['price'] * $info['amount']; } $orinfval['totalPrice'] = $totalPrice; } } /*if($_SESSION['userId']==253){ echo "<pre>";print_r($ordersinfo); echo $type; }*/ //print_r($ordersinfo);exit; $totalCount = count($ordersinfo); $this->smarty->assign('totalCount', $totalCount); $this->smarty->assign('ordersinfo', $ordersinfo); switch ($type) { case 1: //标签打印-50*100 $this->smarty->display('label50x100.htm'); break; case 6: //带留言标签打印-50*100 $this->smarty->display('label50x100_2.htm'); break; case 2: //快递A4打印 $this->smarty->display('expressA4.htm'); break; case 3: //国际EUB-热敏打印 $this->smarty->display('eubprint.htm'); break; case 4: //德国Global Mail-100*100打印 $this->smarty->display('globalmailgerman.htm'); break; case 5: //非德国Global Mail-100*100打印 $this->smarty->display('unglobalmail.htm'); break; case 7: //新加坡打印 $this->smarty->display('singporeprint.htm'); break; case 8: //新加坡/EUB/Global Mail $this->smarty->display('mixprint.htm'); break; case 9: //部分包货打印50*100 $this->smarty->display('bufen50x100.htm'); break; case 31: //Finejo快递-A4(横向打印) $this->smarty->display('printlabelA4ForFZ.htm'); break; case 32: //哲果发货清单-A4打印 $this->smarty->display('printlabelA4ForZG.htm'); break; case 311: //EB001快递-A4(横向打印) $this->smarty->display('printlabelA4ForEB1.htm'); break; case 312: //EB001发货清单-A4打印 $this->smarty->display('printlabelA4ForEB2.htm'); break; case 33: //快递A4打印 $this->smarty->display('expressA4UpsUs.htm'); break; case 10: //快递50*100热敏打印 $this->smarty->display('printLabelExpress.htm'); break; default: redirect_to("index.php?mod=dispatchBillQuery&act=showForm&storeId=1"); return false; } }
$skuArr = $all_sku_info; //if(empty($ebay_userid)){ // echo "订单 $ebay_id 没有用户id信息,请联系销售人员!<br>"; // continue; // } // //add Herman.Xi 无地址不打印 2012-11-25 // if(!tep_not_null($countryname)){ // continue; // } //地址信息 if ($street2 == '') { $addressline = "Send To:<br>" . $cname . "<br>" . $street1 . "<br>" . $city . ", " . $state . "<br>" . $zip . "<br>" . $countryname; } else { $addressline = "Send To:<br>" . $cname . "<br>" . $street1 . "<br>" . $street2 . "<br>" . $city . ", " . $state . "<br>" . $zip . "<br>" . $countryname; } $salesaccountinfo = CommonModel::getAccountNameById($orinfval['accountId']); $appname = empty($salesaccountinfo) ? '' : $salesaccountinfo['appname']; //包裹重量 //$gg = "select * from ebay_packingmaterial where model ='$packingtype'"; // $gg = $dbcon->execute($gg); // $gg = $dbcon->getResultArray($gg); // $weight = $gg[0]['weight']; /** 回邮地址**/ if ($countryCn != '德国') { $postReturnAddress = '<table width="275" border="1" align="center" cellpadding="0" bgcolor="#000000" style="border-collapse:collapse "> <tr> <td colspan="2" valign="top" bgcolor="#FFFFFF"> <span class="font18"><strong>PRIORITAIRE</strong></span><br/> </td> </tr> <tr>