金蝶K3 V12.2版本,对已发生业务单据的物料启用辅助计量单位
/******************************************************************************
联达双计量单位 yLD_K3Data_SecUnit 1.SQL 批量更新物料的辅助计量单位和换算率
2.SQL 批量更新期初的辅助数量(ICBal和ICInvBal和POInvBal)
3.SQL 批量更新本期发生的物流单据的辅助数量
4.SQL 批量更新本期发生的非物流单据的辅助数量
5.SQL 校对即时库存(收料通知单会影响虚仓库存) 1.领料系统增加辅助计量数量
2.领料分配的时候进一法(将多余的领料分配到最后一张领料单)
******************************************************************************/ --1.批量更新物料的辅助计量单位和换算率
UPDATE t1
SET FSecUnitID = 60494
, FSecCoefficient = t3.[重量/块]
FROM t_ICItemBase t1
INNER JOIN t_ICItem t2 ON t2.FItemID = t1.FItemID
INNER JOIN 铁板规格1 t3 ON t3.[代码] = t2.FNumber; --2.批量更新期初的辅助数量(ICBal)
UPDATE t1
SET t1.FSecBegQty = t1.FBegQty / t2.FSecCoefficient
,t1.FSecEndQty = t1.FSecEndQty / t2.FSecCoefficient
,t1.FSecReceive = t1.FSecReceive / t2.FSecCoefficient
,t1.FSecSend = t1.FSecSend / t2.FSecCoefficient
,t1.FSecYtdReceive = t1.FSecYtdReceive / t2.FSecCoefficient
,t1.FSecYtdSend = t1.FSecYtdSend / t2.FSecCoefficient
FROM ICBal t1
INNER JOIN t_ICItem t2 ON t2.FItemID = t1.FItemID
WHERE 1=1
AND t1.FYear=2018
AND t1.FPeriod=8
AND t2.FSecCoefficient>0 --2.批量更新期初的辅助数量(ICInvBal)
UPDATE t1
SET t1.FSecBegQty = t1.FBegQty / t2.FSecCoefficient
,t1.FSecEndQty = t1.FSecEndQty / t2.FSecCoefficient
,t1.FSecReceive = t1.FSecReceive / t2.FSecCoefficient
,t1.FSecSend = t1.FSecSend / t2.FSecCoefficient
,t1.FSecYtdReceive = t1.FSecYtdReceive / t2.FSecCoefficient
,t1.FSecYtdSend = t1.FSecYtdSend / t2.FSecCoefficient
FROM ICInvBal t1
INNER JOIN t_ICItem t2 ON t2.FItemID = t1.FItemID
WHERE 1=1
AND t1.FYear=2018
AND t1.FPeriod=8
AND t2.FSecCoefficient>0 --2.批量更新期初的辅助数量(POInvBal)
UPDATE t1
SET t1.FSecBegQty = t1.FBegQty / t2.FSecCoefficient
,t1.FSecEndQty = t1.FSecEndQty / t2.FSecCoefficient
,t1.FSecReceive = t1.FSecReceive / t2.FSecCoefficient
,t1.FSecSend = t1.FSecSend / t2.FSecCoefficient
,t1.FSecYtdReceive = t1.FSecYtdReceive / t2.FSecCoefficient
,t1.FSecYtdSend = t1.FSecYtdSend / t2.FSecCoefficient
FROM POInvBal t1
INNER JOIN t_ICItem t2 ON t2.FItemID = t1.FItemID
WHERE 1=1
AND t1.FYear=2018
AND t1.FPeriod=8
AND t2.FSecCoefficient>0 --3.批量更新本期发生的物流单据的辅助数量
UPDATE t1
SET t1.FSecCoefficient = t2.FSecCoefficient
,t1.FSecQty = t1.FQty / t2.FSecCoefficient
,t1.FSecQtyMust= t1.FQtyMust / t2.FSecCoefficient
,t1.FSecCommitQty= t1.FCommitQty / t2.FSecCoefficient
,t1.FSecVWInStockQty= t1.FVWInStockQty / t2.FSecCoefficient
,t1.FSecInvoiceQty= t1.FQtyInvoice / t2.FSecCoefficient
,t1.FSecQtyActual= t1.FQtyActual / t2.FSecCoefficient
,t1.FOutSecCommitQty= t1.FOutCommitQty / t2.FSecCoefficient
FROM ICStockBillEntry t1
INNER JOIN t_ICItem t2 ON t2.FItemID = t1.FItemID
INNER JOIN ICStockBill t3 ON t3.FInterID = t1.FInterID
WHERE 1=1
AND CONVERT(NVARCHAR,t3.FDATE,112) BETWEEN '' AND ''
AND t2.FSecCoefficient>0 --4.批量更新本期发生的非物流单据的辅助数量
UPDATE t1
SET t1.FSecCoefficient = t2.FSecCoefficient
,t1.FSecQty = t1.FQty / t2.FSecCoefficient
,t1.FSecCommitQty= t1.FCommitQty / t2.FSecCoefficient
,t1.FSecStockQty= t1.FStockQty / t2.FSecCoefficient
,t1.FSecInvoiceQty= t1.FQtyInvoice / t2.FSecCoefficient
,t1.FSecDeliveryQty= t1.FDeliveryQty / t2.FSecCoefficient
FROM POOrderEntry t1
INNER JOIN t_ICItem t2 ON t2.FItemID = t1.FItemID
INNER JOIN POOrder t3 ON t3.FInterID = t1.FInterID
WHERE 1=1
AND CONVERT(NVARCHAR,t3.FDATE,112) BETWEEN '' AND ''
AND t2.FSecCoefficient>0 UPDATE t1
SET t1.FSecCoefficient = t2.FSecCoefficient
,t1.FSecQty = t1.FQty / t2.FSecCoefficient
,t1.FSecCommitQty= t1.FCommitQty / t2.FSecCoefficient
,t1.FSecBackQty= t1.FBackQty / t2.FSecCoefficient
,t1.FSecConCommitQty= t1.FConCommitQty / t2.FSecCoefficient
,t1.FSecScrapQty= t1.FScrapQty / t2.FSecCoefficient
,t1.FSecScrapInCommitQty= t1.FScrapInCommitQty / t2.FSecCoefficient
,t1.FSecQtyPass= t1.FQtyPass / t2.FSecCoefficient
,t1.FSecConPassQty= t1.FConPassQty / t2.FSecCoefficient
,t1.FSecNotPassQty= t1.FNotPassQty / t2.FSecCoefficient
,t1.FSecSampleBreakQty= t1.FSampleBreakQty / t2.FSecCoefficient
,t1.FSecRelateQty= t1.FRelateQty / t2.FSecCoefficient
,t1.FSecQCheckQty= t1.FQCheckQty / t2.FSecCoefficient
FROM POInStockEntry t1
INNER JOIN t_ICItem t2 ON t2.FItemID = t1.FItemID
INNER JOIN POInStock t3 ON t3.FInterID = t1.FInterID
WHERE 1=1
AND CONVERT(NVARCHAR,t3.FDATE,112) BETWEEN '' AND ''
AND t2.FSecCoefficient>0 --5.校对即时库存
EXEC dbo.CheckInventory
金蝶K3 V12.2版本,对已发生业务单据的物料启用辅助计量单位的更多相关文章
- 金蝶K3 V12.2版本,中途启用双计量单位出现错误
忘记修改虚仓库存/收料通知单的双计量数量
- 金蝶K3,名称或代码在系统中已被使用,由于数据移动,未能继续以NOLOCK方式扫描
使用金蝶K3时出现:名称或代码在系统中已被使用:错误代码:3604(E14H)source:Microsoft OLE DB provider for SQL SERVERDetail:由于数据移动, ...
- 金蝶K3 WISE 13.1版本服务器虚拟机环境部署
闲来无事,整个13.1版本的金蝶玩玩. 系统环境:WIN2008 R2,x64位 数据库:MSSQL 2008 R2,X64位 记录下操作步骤: 1.准备安装软件,见图: 2.安装资源包,.net3. ...
- python办公自动化系列之金蝶K3(三)
小爬在之前的两篇文章 [python办公自动化系列之金蝶K3自动登录(一)].[python办公自动化系列之金蝶K3自动登录(二)]带大家系统搞定了K3客户端的自动登录难题,但是搞定[自动登录]只是我 ...
- 金蝶K3 wise 插件二次开发与配置
金蝶K3 wise 插件二次开发与配置 开发环境:K/3 Wise 13.0.K/3 Bos开发平台.Visual Basic 6.0 目录 一.二次开发插件编程二.代码演示三.配置插件四.测试插件五 ...
- 金蝶K3 WISE 快速登录
金蝶K3 WISE 快速登录 "C:\Program Files (x86)\Kingdee\K3ERP\k3main.exe" -LoginUser|账套号|账套密码|用户账号| ...
- 关于金蝶k3 wise供应生门户登陆界面屏蔽业务账套多余功能模块设置方法
关于金蝶k3 wise供应生门户登陆界面屏蔽业务账套多余功能模块设置方法 1. 找到以下路径 ...\Kingdee\K3ERP\KDHR\SITEFILE\WEBUI\ 找到“Login.aspx” ...
- 金蝶K3物料选择问题(感觉Ctrl被按住了一样)
金蝶K3在进入物料选择时,有时需要用Ctrl才可以进行多选,为什么有时不用Ctrl也可以进行多选,就像Ctrl被按住了一样? 解决:在物料选择界面按2次ctrl键单击物料可实现多选,再按2次ctrl则 ...
- 新安装的金蝶K3软件,初始化后,在基础资料中对于币别,科目,部门,客户等资料均无法新增,无法引出,等操作,K3CASysSet.dll
新装K3,新建的帐套.导入科目点菜单或新增button均无反应,币别.客户等辅助核算项目也新增也无法保存. 在电脑上新安装的金蝶K3软件.初始化后.在基础资料中对于币别,科目,部门,客户等资料均无法新 ...
随机推荐
- Scala 学习之路(十二)—— 类型参数
一.泛型 Scala支持类型参数化,使得我们能够编写泛型程序. 1.1 泛型类 Java中使用<>符号来包含定义的类型参数,Scala则使用[]. class Pair[T, S](val ...
- maven_nexus私服搭建
搭建很简单,但是新版本运行方式有所区别,于此记录一下: 1.下载程序包:http://www.sonatype.org/nexus/downloads/ 官网比较慢,下了一小时.期间在csdn花了一积 ...
- 【Flink】深入理解Flink-On-Yarn模式
1. 前言 Flink提供了两种在yarn上运行的模式,分别为Session-Cluster和Per-Job-Cluster模式,本文分析两种模式及启动流程. 下图展示了Flink-On-Yarn模式 ...
- 【Linux】一步一步学Linux——VMware Workstation 15 Pro安装图解教程(06)
目录 00. 目录 01. VMware Workstation Pro15下载 02. VMware Workstation Pro15安装 03. VMware Workstation Pro 1 ...
- Python笔记【6】_函数
#!/usr/bin/env/python #-*-coding:utf-8-*- #Author:LingChongShi #查看源码Ctrl+左键 ''' def:函数是一段可以重复调用的代码,通 ...
- 001-python3 初识
一.python的起源 python是一门 解释型弱类型编程语言. 特点: 简单.明确.优雅 二.python的解释器 CPython. 官方提供的. 内部使用c语言来实现 PyPy. 一次性把我们的 ...
- 自动化冒烟测试 Unittest , Pytest 哪家强?
前言:之前有一段时间一直用 Python Uittest做自动化测试,觉得Uittest组织冒烟用例比较繁琐,后来康哥提示我使用pytest.mark来组织冒烟用例 本文讲述以下几个内容: 1.Uni ...
- idea环境下push项目
1,选中需要推送的项目: 2,VCS-git-add 添加到本地仓库 3,vcs-commit 提交 4.commit and push 推送到远程仓库 出现错误这是提示程序有错误或者是TODO代码没 ...
- 在阿里云上搭建Spring Initializr服务器。
参考的博客有: https://blog.csdn.net/chszs/article/details/51713174 https://segmentfault.com/a/119000001137 ...
- 详叙BeanWrapper和PropertyDescriptor
每篇一句 千古以来要饭的没有要早饭的,知道为什么吗? 相关阅读 [小家Spring]聊聊Spring中的数据转换:Converter.ConversionService.TypeConverter.P ...