当前位置: 首页>>代码示例>>PHP>>正文


PHP Application_Model_DbTable_DbGlobal::getSaleOrderDetail方法代码示例

本文整理汇总了PHP中Application_Model_DbTable_DbGlobal::getSaleOrderDetail方法的典型用法代码示例。如果您正苦于以下问题:PHP Application_Model_DbTable_DbGlobal::getSaleOrderDetail方法的具体用法?PHP Application_Model_DbTable_DbGlobal::getSaleOrderDetail怎么用?PHP Application_Model_DbTable_DbGlobal::getSaleOrderDetail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Application_Model_DbTable_DbGlobal的用法示例。


在下文中一共展示了Application_Model_DbTable_DbGlobal::getSaleOrderDetail方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: saleviewAction

 public function saleviewAction()
 {
     $id = $this->getRequest()->getParam('id');
     $db = new report_Model_DbTable_DbReport();
     $db_global = new Application_Model_DbTable_DbGlobal();
     $row_sale_order = $db->getSaleOrderView($id);
     $row_sale_order_item = $db_global->getSaleOrderDetail($id);
     $this->view->row_sale_order = $row_sale_order;
     $this->view->row_sale_order_item = $row_sale_order_item;
 }
开发者ID:sarankh80,项目名称:opsstock,代码行数:10,代码来源:IndexController.php

示例2: editOrder

 public function editOrder($data, $id)
 {
     $db = $this->getAdapter();
     $db_globle = new Application_Model_DbTable_DbGlobal();
     $db->beginTransaction();
     $session = new Zend_Session_Namespace('auth');
     $GetUserId = $session->user_id;
     $user_type = $session->level;
     try {
         $arr_order = array('customer_id' => $data["customer"], 'location_id' => 1, 'user_id' => $GetUserId, 'currency_id' => $data["currency"], 'net_total' => $data["gran_total"], 'all_total' => $data["gran_total"], 'paid' => $data["gran_pay"], 'balance' => $data["balance"], 'date' => $data["date"], 'status' => 1);
         $where = $db->quoteInto("so_id=?", $id);
         $this->_name = "tb_sale_order";
         $this->update($arr_order, $where);
         $arr_order_his = array('customer_id' => $data["customer"], 'so_id' => $id, 'type' => 2, 'location_id' => 1, 'order_no' => $data["saleorder_no"], 'user_id' => $GetUserId, 'currency_id' => $data["currency"], 'sub_total' => $data["gran_total"], 'paid' => $data["gran_pay"], 'balance' => $data["balance"], 'date' => $data["date"], 'status' => 1);
         $this->_name = "tb_sale_order_history";
         $sale_order_his = $this->insert($arr_order_his);
         $row_old_product = $db_globle->getSaleOrderDetail($id);
         if ($row_old_product) {
             foreach ($row_old_product as $rs_old_product) {
                 $row_product_exist = $db_globle->getQtyProductExist($rs_old_product["pro_id"]);
                 $arr_product_update = array('qty_onhand' => $row_product_exist["qty_onhand"] + $rs_old_product["total_qty"], 'qty_available' => $row_product_exist["qty_available"] + $rs_old_product["total_qty"], 'qty_onsold' => $row_product_exist["qty_onsold"] - $rs_old_product["total_qty"]);
                 $this->_name = "tb_product";
                 $where = $db->quoteInto("pro_id=?", $rs_old_product["pro_id"]);
                 $this->update($arr_product_update, $where);
                 $row_prolocation_exist = $db_globle->getQtyProLocationExist($rs_old_product["pro_id"]);
                 if ($row_prolocation_exist) {
                     $arr_prolocation = array('qty_onhand' => $row_prolocation_exist["qty_onhand"] + $rs_old_product["total_qty"], 'qty_available' => $row_prolocation_exist["qty_available"] + $rs_old_product["total_qty"], 'qty_onsold' => $row_prolocation_exist["qty_onsold"] - $rs_old_product["total_qty"]);
                     $this->_name = "tb_prolocation";
                     $where = array("pro_id=?" => $rs_old_product["pro_id"], "location_id=?" => 1);
                     $this->update($arr_prolocation, $where);
                 }
             }
         }
         $arr_order_detail_update = array('status' => 0);
         $this->_name = "tb_sale_order_detail";
         $where = $db->quoteInto("so_id=?", $id);
         $this->update($arr_order_detail_update, $where);
         $identify = $data["identity"];
         $ids = explode(',', $identify);
         foreach ($ids as $i) {
             $arr_order_detail = array('so_id' => $id, 'pro_id' => $data["item_id" . $i], 'qty' => $data["qty" . $i], 'total_qty' => $data["total_qty" . $i], 'price_per_unit' => $data["price_per_qty" . $i], 'total_price' => $data["total_price" . $i], 'sub_total' => $data["total_price" . $i], 'status' => 1);
             $this->_name = "tb_sale_order_detail";
             $this->insert($arr_order_detail);
             $arr_order_his_detail = array('hs_id' => $sale_order_his, 'pro_id' => $data["item_id" . $i], 'qty' => $data["qty" . $i], 'total_qty' => $data["total_qty" . $i], 'price_per_unit' => $data["price_per_qty" . $i], 'total_price' => $data["total_price" . $i], 'sub_total' => $data["total_price" . $i]);
             $this->_name = "tb_sale_order_history_detail";
             $this->insert($arr_order_his_detail);
             $row_product_exist = $db_globle->getQtyProductExist($data["item_id" . $i]);
             if ($row_product_exist) {
                 print_r($row_product_exist);
                 $arr_product = array('qty_onhand' => $row_product_exist["qty_onhand"] - $data["total_qty" . $i], 'qty_available' => $row_product_exist["qty_available"] - $data["total_qty" . $i], 'qty_onsold' => $row_product_exist["qty_onsold"] + $data["total_qty" . $i]);
                 $this->_name = "tb_product";
                 $where = $db->quoteInto("pro_id=?", $data["item_id" . $i]);
                 $this->update($arr_product, $where);
             }
             $row_prolocation_exist = $db_globle->getQtyProLocationExist($data["item_id" . $i]);
             if ($row_prolocation_exist) {
                 $arr_prolocation = array('qty_onhand' => $row_prolocation_exist["qty_onhand"] - $data["total_qty" . $i], 'qty_available' => $row_prolocation_exist["qty_available"] - $data["total_qty" . $i], 'qty_onsold' => $row_prolocation_exist["qty_onsold"] + $data["total_qty" . $i]);
                 $this->_name = "tb_prolocation";
                 $where = array("pro_id=?" => $data["item_id" . $i], "location_id=?" => 1);
                 $this->update($arr_prolocation, $where);
             }
         }
         //exit();
         $db->commit();
     } catch (Exception $e) {
         $db->rollBack();
         $e->getMessage() . "in" . $e->getFile() . "code" . $e->getCode() . "on line" . $e->getLine();
         exit;
     }
 }
开发者ID:sarankh80,项目名称:opsstock,代码行数:70,代码来源:DbSaleOrder.php

示例3: poseditAction

 public function poseditAction()
 {
     $id = $this->getRequest()->getParam('id');
     $db = new saleorder_Model_DbTable_DbSaleOrder();
     $db_global = new Application_Model_DbTable_DbGlobal();
     $session = $session_user = new Zend_Session_Namespace('auth');
     $user_id = $session_user->fullname;
     $this->view->user = $user_id;
     $qty_warning = $db_global->getSettingByCode(6);
     $this->view->qty_warning = $qty_warning;
     $row_sale_order = $db_global->getSaleOrderById($id);
     $row_sale_order_detail = $db_global->getSaleOrderDetail($id);
     $this->view->data_sale_order = $row_sale_order_detail;
     $form = new saleorder_Form_FrmSaleOrder();
     $this->view->frm = $form->FrmSaleOrder($row_sale_order);
     $currency_setting = $db_global->getSettingByCode(1);
     $company_name = $db_global->getSettingByCode(4);
     $slogan = $db_global->getSettingByCode(5);
     $address = $db_global->getSettingByCode(2);
     $tel = $db_global->getSettingByCode(3);
     $this->view->currency_setting = $currency_setting;
     $this->view->company_name = $company_name;
     $this->view->slogan = $slogan;
     $this->view->address = $address;
     $this->view->tel = $tel;
     $itemRows = $db->getProductOption();
     $this->view->itemsOption = $itemRows;
     if ($this->getRequest()->isPost()) {
         $data = $this->getRequest()->getPost();
         if (isset($data["save"])) {
             // 				print_r($data);exit();
             $db->editOrder($data, $id);
             Application_Form_FrmMessage::redirectUrl('/index/pos');
         } elseif (isset($data["km"]) == 2) {
             $dbs = new Application_Model_DbTable_DbSiteLanguages();
             $ids = 2;
             $lang = $dbs->getbyid($ids);
             $session_lang = new Zend_Session_Namespace('lang');
             $session_lang->unlock();
             $session_lang->lang_id = $lang['id'];
             $session_lang->lang = $lang['language'];
             //print_r($lang);exit();
         } elseif (isset($data["en"]) == 1) {
             $dbs = new Application_Model_DbTable_DbSiteLanguages();
             $ids = 1;
             $lang = $dbs->getbyid($ids);
             $session_lang = new Zend_Session_Namespace('lang');
             $session_lang->unlock();
             $session_lang->lang_id = $lang['id'];
             $session_lang->lang = $lang['language'];
             //$this->_redirect('/login');
             //exit();
         }
     }
 }
开发者ID:sarankh80,项目名称:opsstock,代码行数:55,代码来源:IndexController.php


注:本文中的Application_Model_DbTable_DbGlobal::getSaleOrderDetail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。