销售出库单、采购入库单导出pdf,增加制单人和审核人
| | |
| | | } |
| | | |
| | | // 修改本单据状态为已入库 |
| | | $sql = "update t_pw_bill set bill_status = 1000 where id = '%s' "; |
| | | $rc = $db->execute($sql, $id); |
| | | $sql = "update t_pw_bill set bill_status = 1000 |
| | | ,confirm_user_id = '%s' |
| | | ,confirm_date = now() |
| | | where id = '%s' "; |
| | | $rc = $db->execute($sql, $loginUserId,$id); |
| | | if ($rc === false) { |
| | | return $this->sqlError(__METHOD__, __LINE__); |
| | | } |
| | |
| | | $canViewPrice = $params["canViewPrice"]; |
| | | |
| | | $sql = "select p.id, p.bill_status, p.ref, p.biz_dt, u1.name as biz_user_name, u2.name as input_user_name, |
| | | u3.name as confirm_user_name, |
| | | p.goods_money, w.name as warehouse_name, s.name as supplier_name, |
| | | p.date_created, p.payment_type, p.company_id, p.money_with_tax,p.bill_memo |
| | | from t_pw_bill p, t_warehouse w, t_supplier s, t_user u1, t_user u2 |
| | | where (p.warehouse_id = w.id) and (p.supplier_id = s.id) |
| | | and (p.biz_user_id = u1.id) and (p.input_user_id = u2.id) |
| | | and (p.ref = '%s')"; |
| | | from t_pw_bill p |
| | | left join t_warehouse w on p.warehouse_id = w.id |
| | | left join t_supplier s on p.supplier_id = s.id |
| | | left join t_user u1 on p.biz_user_id = u1.id |
| | | left join t_user u2 on p.input_user_id = u2.id |
| | | left join t_user u3 on p.confirm_user_id = u3.id |
| | | where |
| | | (p.ref = '%s')"; |
| | | |
| | | $data = $db->query($sql, $ref); |
| | | if (!$data) { |
| | |
| | | $result["warehouseName"] = $v["warehouse_name"]; |
| | | $result["bizUserName"] = $v["biz_user_name"]; |
| | | $result["bill_memo"] = $v["bill_memo"]; |
| | | $result["input_user_name"] = $v["input_user_name"]; |
| | | $result["confirm_user_name"] = $v["confirm_user_name"]; |
| | | |
| | | $sql = "select g.code, g.name, g.spec, u.name as unit_name, |
| | | convert(p.goods_count, $fmt) as goods_count, p.goods_price, |
| | |
| | | $ref = $params["ref"]; |
| | | |
| | | $db = $this->db; |
| | | $sql = "select w.id, w.bizdt, c.name as customer_name, |
| | | u.name as biz_user_name, |
| | | h.name as warehouse_name, |
| | | w.sale_money, w.memo, w.deal_address, w.company_id, |
| | | w.money_with_tax |
| | | from t_ws_bill w, t_customer c, t_user u, t_warehouse h |
| | | where w.customer_id = c.id and w.biz_user_id = u.id |
| | | and w.warehouse_id = h.id |
| | | and w.ref = '%s' "; |
| | | $sql = "SELECT |
| | | w.id, |
| | | w.bizdt, |
| | | c. NAME AS customer_name, |
| | | u. NAME AS biz_user_name, |
| | | h. NAME AS warehouse_name, |
| | | w.sale_money, |
| | | w.memo, |
| | | w.deal_address, |
| | | w.company_id, |
| | | w.money_with_tax, |
| | | u2.name input_user_name, |
| | | u3.name confirm_user_name |
| | | FROM |
| | | t_ws_bill w |
| | | LEFT JOIN t_customer c ON w.customer_id = c.id |
| | | LEFT JOIN t_user u ON w.biz_user_id = u.id |
| | | LEFT JOIN t_warehouse h ON w.warehouse_id = h.id |
| | | LEFT JOIN t_user u2 ON w.input_user_id = u2.id |
| | | LEFT JOIN t_user u3 ON w.confirm_user_id = u3.id |
| | | WHERE w.ref = '%s' "; |
| | | $data = $db->query($sql, $ref); |
| | | if (!$data) { |
| | | return null; |
| | |
| | | $bill["memo"] = $data[0]["memo"]; |
| | | $bill["dealAddress"] = $data[0]["deal_address"]; |
| | | $bill["moneyWithTax"] = $data[0]["money_with_tax"]; |
| | | $bill["input_user_name"] = $data[0]["input_user_name"]; |
| | | $bill["confirm_user_name"] = $data[0]["confirm_user_name"]; |
| | | |
| | | // 明细表 |
| | | $sql = "select g.code, g.name, g.spec, u.name as unit_name, |
| | |
| | | // 更新本单据的状态 |
| | | $sql = "update t_ws_bill |
| | | set bill_status = 1000, inventory_money = %f, profit = %f |
| | | ,confirm_user_id = '%s' |
| | | ,confirm_date = now() |
| | | where id = '%s' "; |
| | | $rc = $db->execute($sql, $sumInventoryMoney, $profit, $id); |
| | | $rc = $db->execute($sql, $sumInventoryMoney, $profit, $loginUserId, $id); |
| | | if ($rc === false) { |
| | | return $this->sqlError(__METHOD__, __LINE__); |
| | | } |
| | |
| | | */ |
| | | $html = ' |
| | | <table> |
| | | <tr><td colspan="2">单号:' . $ref . '</td></tr> |
| | | <tr><td>单号:' . $ref . '</td><td>制单人:'.$bill["input_user_name"].'</td></tr> |
| | | <tr><td colspan="2">供应商:' . $bill["supplierName"] . '</td></tr> |
| | | <tr><td>业务日期:' . $bill["bizDT"] . '</td><td>入库仓库:' . $bill["warehouseName"] . '</td></tr> |
| | | <tr><td>业务员:' . $bill["bizUserName"] . '</td><td></td></tr>'; |
| | | <tr><td>业务员:' . $bill["bizUserName"] . '</td><td>审核人:'.$bill["confirm_user_name"].'</td></tr>'; |
| | | $html .= '<tr><td colspan="2">备注:' . $bill["bill_memo"] . '</td></tr>'; |
| | | if ($canViewPrice) { |
| | | $html .= '<tr><td>采购货款:' . $bill["goodsMoney"] . ' (' . $utilService->moneyToCap($bill["goodsMoney"]) . ')</td>' . |
| | |
| | | <tr><td>单号:' . $ref . '</td><td>业务日期:' . $bill["bizDT"] . '</td></tr> |
| | | <tr><td colspan="2">客户:' . $bill["customerName"] . '</td></tr> |
| | | <tr><td>业务员:' . $bill["bizUserName"] . '</td><td>出库仓库:' . $bill["warehouseName"] . '</td></tr> |
| | | <tr><td>制单人:' . $bill["input_user_name"] . '</td><td>审核人:' . $bill["confirm_user_name"] . '</td></tr> |
| | | <tr><td>销售金额:' . $bill["saleMoney"] . ' (' . $utilService->moneyToCap($bill["saleMoney"]) . ')</td>' |
| | | . '<td>价税合计:' . $bill["moneyWithTax"] . ' (' . $utilService->moneyToCap($bill["moneyWithTax"]) . ')</td></tr> |
| | | <tr><td colspan="2">送货地址:' . $bill["dealAddress"] . '</td></tr> |