table.sql 75 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436
  1. create database wtu
  2. go
  3. use wtu
  4. go
  5. --档案传递信息表
  6. create table dbo.transtime
  7. (
  8. entitytype nvarchar(60) not null, --档案类型
  9. lasttime datetime --最后传递时间
  10. )
  11. go
  12. --错误信息表
  13. create table dbo.errmsg
  14. (
  15. sysid int identity(1,1),
  16. operdate datetime default(getdate()),
  17. opertype nvarchar(60) not null,
  18. msg nvarchar(4000),
  19. sources nvarchar(400),
  20. errorflag int default(0) --0,从中间库到业务系统,1,从业务系统到中间库
  21. )
  22. go
  23. --旺店通日志表
  24. create table dbo.wdtlogs
  25. (
  26. sysid int identity(1,1),
  27. operdate datetime default(getdate()),
  28. opertype nvarchar(60) not null,
  29. args nvarchar(4000) null,
  30. returncode nvarchar(10) null,
  31. msg nvarchar(400) null
  32. )
  33. --存货
  34. CREATE TABLE dbo.Inventory(
  35. sysid int identity(1,1),
  36. cInvCode nvarchar(60) NOT NULL,
  37. cInvName nvarchar(255) NULL,
  38. cInvStd nvarchar(255) NULL,
  39. bPurchase bit NOT NULL,
  40. iTaxRate float NULL,
  41. importdate datetime null default(getdate()),
  42. processdate datetime null,
  43. cComUnitCode nvarchar(35) null,
  44. processflag bit default(0)
  45. )
  46. GO
  47. --库存期初
  48. create table dbo.stock(
  49. sysid int identity(1,1),
  50. cInvCode nvarchar(60) NOT NULL,
  51. cwhcode nvarchar(30) not null,
  52. qty decimal(26,4) not null default(0),
  53. price decimal(13,4) not null default(0),
  54. importdate datetime null default(getdate()),
  55. processflag int default(0)
  56. )
  57. go
  58. --仓库
  59. CREATE TABLE dbo.Warehouse(
  60. sysid int identity(1,1),
  61. cWhCode nvarchar(10) NOT NULL,
  62. cWhName nvarchar(20) NULL,
  63. importdate datetime null default(getdate()),
  64. processdate datetime null,
  65. processflag bit default(0)
  66. )
  67. --供应商
  68. CREATE TABLE dbo.Vendor(
  69. sysid int identity(1,1),
  70. cVenCode nvarchar(20) NOT NULL,
  71. cVenName nvarchar(98) NULL,
  72. cVenPhone nvarchar(100) null,
  73. cVenAbbName nvarchar(60) NOT NULL,
  74. cVenPerson [nvarchar](50) NULL,
  75. importdate datetime null default(getdate()),
  76. processdate datetime null,
  77. processflag bit default(0)
  78. )
  79. GO
  80. --其他入库单
  81. CREATE TABLE [dbo].[RdRecord08](
  82. sysid int identity(1,1),
  83. [ID] [bigint] NOT NULL,
  84. [bRdFlag] [tinyint] NOT NULL,
  85. [cVouchType] [nvarchar](2) NOT NULL,
  86. [cBusType] [nvarchar](12) NULL,
  87. [cSource] [nvarchar](50) NOT NULL,
  88. [cBusCode] [nvarchar](30) NULL,
  89. [cWhCode] [nvarchar](10) NOT NULL,
  90. [dDate] [datetime] NOT NULL,
  91. [cCode] [nvarchar](30) NOT NULL,
  92. [cRdCode] [nvarchar](5) NULL,
  93. [cDepCode] [nvarchar](12) NULL,
  94. [cPersonCode] [nvarchar](20) NULL,
  95. [cPTCode] [nvarchar](2) NULL,
  96. [cSTCode] [nvarchar](2) NULL,
  97. [cCusCode] [nvarchar](20) NULL,
  98. [cVenCode] [nvarchar](20) NULL,
  99. [cOrderCode] [nvarchar](30) NULL,
  100. [cARVCode] [nvarchar](30) NULL,
  101. [cBillCode] [bigint] NULL,
  102. [cDLCode] [bigint] NULL,
  103. [cProBatch] [nvarchar](60) NULL,
  104. [cHandler] [nvarchar](20) NULL,
  105. [cMemo] [nvarchar](255) NULL,
  106. [bTransFlag] [bit] NOT NULL,
  107. [cAccounter] [nvarchar](20) NULL,
  108. [cMaker] [nvarchar](20) NULL,
  109. [cDefine1] [nvarchar](20) NULL,
  110. [cDefine2] [nvarchar](20) NULL,
  111. [cDefine3] [nvarchar](20) NULL,
  112. [cDefine4] [datetime] NULL,
  113. [cDefine5] [int] NULL,
  114. [cDefine6] [datetime] NULL,
  115. [cDefine7] [float] NULL,
  116. [cDefine8] [nvarchar](4) NULL,
  117. [cDefine9] [nvarchar](8) NULL,
  118. [cDefine10] [nvarchar](60) NULL,
  119. [dKeepDate] [nvarchar](5) NULL,
  120. [dVeriDate] [datetime] NULL,
  121. [bpufirst] [bit] NULL,
  122. [biafirst] [bit] NULL,
  123. [iMQuantity] [float] NULL,
  124. [dARVDate] [datetime] NULL,
  125. [cChkCode] [nvarchar](30) NULL,
  126. [dChkDate] [datetime] NULL,
  127. [cChkPerson] [nvarchar](40) NULL,
  128. [VT_ID] [int] NULL,
  129. [bIsSTQc] [bit] NOT NULL,
  130. [cDefine11] [nvarchar](120) NULL,
  131. [cDefine12] [nvarchar](120) NULL,
  132. [cDefine13] [nvarchar](120) NULL,
  133. [cDefine14] [nvarchar](120) NULL,
  134. [cDefine15] [int] NULL,
  135. [cDefine16] [float] NULL,
  136. [gspcheck] [nvarchar](10) NULL,
  137. [ufts] [timestamp] NULL,
  138. [iExchRate] [float] NULL,
  139. [cExch_Name] [nvarchar](8) NULL,
  140. [bOMFirst] [bit] NULL,
  141. [bFromPreYear] [bit] NULL,
  142. [bIsLsQuery] [bit] NULL,
  143. [bIsComplement] [smallint] NULL,
  144. [iDiscountTaxType] [tinyint] NULL,
  145. [ireturncount] [int] NULL,
  146. [iverifystate] [int] NULL,
  147. [iswfcontrolled] [int] NULL,
  148. [cModifyPerson] [nvarchar](50) NULL,
  149. [dModifyDate] [datetime] NULL,
  150. [dnmaketime] [datetime] NULL,
  151. [dnmodifytime] [datetime] NULL,
  152. [dnverifytime] [datetime] NULL,
  153. [bredvouch] [int] NULL,
  154. [iFlowId] [int] NULL,
  155. [cPZID] [nvarchar](30) NULL,
  156. [cSourceLs] [nvarchar](4) NULL,
  157. [cSourceCodeLs] [nvarchar](20) NULL,
  158. [iPrintCount] [int] NULL,
  159. [ctransflag] [nvarchar](2) NULL,
  160. [csysbarcode] [nvarchar](60) NULL,
  161. [cCurrentAuditor] [nvarchar](200) NULL,
  162. [cCheckSignFlag] [nvarchar](36) NULL,
  163. importdate datetime null default(getdate()),
  164. processdate datetime null,
  165. processflag bit default(0),
  166. direction int default(0) --0:从U8到中间库,1:从旺店通到中间库
  167. )
  168. CREATE TABLE [dbo].[rdrecords08](
  169. sysid int identity(1,1),
  170. [AutoID] [bigint] NOT NULL,
  171. [ID] [bigint] NOT NULL,
  172. [cInvCode] [nvarchar](60) NOT NULL,
  173. [iNum] [decimal](30, 10) NULL,
  174. [iQuantity] [decimal](30, 10) NULL,
  175. [iUnitCost] [decimal](30, 10) NULL,
  176. [iPrice] [money] NULL,
  177. [iAPrice] [money] NULL,
  178. [iPUnitCost] [decimal](30, 10) NULL,
  179. [iPPrice] [money] NULL,
  180. [cBatch] [nvarchar](60) NULL,
  181. [cVouchCode] [bigint] NULL,
  182. [cInVouchCode] [nvarchar](30) NULL,
  183. [cinvouchtype] [nvarchar](2) NULL,
  184. [iSOutQuantity] [decimal](30, 10) NULL,
  185. [iSOutNum] [decimal](30, 10) NULL,
  186. [cFree1] [nvarchar](20) NULL,
  187. [cFree2] [nvarchar](20) NULL,
  188. [iFlag] [tinyint] NOT NULL,
  189. [iFNum] [decimal](30, 10) NULL,
  190. [iFQuantity] [decimal](30, 10) NULL,
  191. [dVDate] [datetime] NULL,
  192. [iTrIds] [bigint] NULL,
  193. [cPosition] [nvarchar](20) NULL,
  194. [cDefine22] [nvarchar](60) NULL,
  195. [cDefine23] [nvarchar](60) NULL,
  196. [cDefine24] [nvarchar](60) NULL,
  197. [cDefine25] [nvarchar](60) NULL,
  198. [cDefine26] [float] NULL,
  199. [cDefine27] [float] NULL,
  200. [cItem_class] [nvarchar](10) NULL,
  201. [cItemCode] [nvarchar](60) NULL,
  202. [cName] [nvarchar](255) NULL,
  203. [cItemCName] [nvarchar](20) NULL,
  204. [cFree3] [nvarchar](20) NULL,
  205. [cFree4] [nvarchar](20) NULL,
  206. [cFree5] [nvarchar](20) NULL,
  207. [cFree6] [nvarchar](20) NULL,
  208. [cFree7] [nvarchar](20) NULL,
  209. [cFree8] [nvarchar](20) NULL,
  210. [cFree9] [nvarchar](20) NULL,
  211. [cFree10] [nvarchar](20) NULL,
  212. [cBarCode] [nvarchar](200) NULL,
  213. [iNQuantity] [decimal](30, 10) NULL,
  214. [iNNum] [decimal](30, 10) NULL,
  215. [cAssUnit] [nvarchar](35) NULL,
  216. [dMadeDate] [datetime] NULL,
  217. [iMassDate] [int] NULL,
  218. [cDefine28] [nvarchar](120) NULL,
  219. [cDefine29] [nvarchar](120) NULL,
  220. [cDefine30] [nvarchar](120) NULL,
  221. [cDefine31] [nvarchar](120) NULL,
  222. [cDefine32] [nvarchar](120) NULL,
  223. [cDefine33] [nvarchar](120) NULL,
  224. [cDefine34] [int] NULL,
  225. [cDefine35] [int] NULL,
  226. [cDefine36] [datetime] NULL,
  227. [cDefine37] [datetime] NULL,
  228. [iCheckIds] [bigint] NULL,
  229. [cBVencode] [nvarchar](20) NULL,
  230. [chVencode] [nvarchar](20) NULL,
  231. [bGsp] [bit] NULL,
  232. [cGspState] [nvarchar](20) NULL,
  233. [cCheckCode] [nvarchar](30) NULL,
  234. [iCheckIdBaks] [bigint] NULL,
  235. [cRejectCode] [nvarchar](30) NULL,
  236. [iRejectIds] [bigint] NULL,
  237. [cCheckPersonCode] [nvarchar](20) NULL,
  238. [dCheckDate] [datetime] NULL,
  239. [cMassUnit] [smallint] NULL,
  240. [bChecked] [bit] NULL,
  241. [bLPUseFree] [bit] NULL,
  242. [iRSRowNO] [int] NULL,
  243. [iOriTrackID] [bigint] NULL,
  244. [coritracktype] [nvarchar](2) NULL,
  245. [cbaccounter] [nvarchar](30) NULL,
  246. [dbKeepDate] [datetime] NULL,
  247. [bCosting] [bit] NULL,
  248. [bVMIUsed] [bit] NULL,
  249. [iVMISettleQuantity] [decimal](30, 10) NULL,
  250. [iVMISettleNum] [decimal](30, 10) NULL,
  251. [cvmivencode] [nvarchar](20) NULL,
  252. [iInvSNCount] [int] NULL,
  253. [cwhpersoncode] [nvarchar](20) NULL,
  254. [cwhpersonname] [nvarchar](50) NULL,
  255. [cserviceoid] [varchar](38) NULL,
  256. [cbserviceoid] [varchar](38) NULL,
  257. [iinvexchrate] [decimal](38, 8) NULL
  258. )
  259. go
  260. CREATE TABLE [dbo].[RdRecord09](
  261. sysid int identity(1,1),
  262. [ID] [bigint] NOT NULL,
  263. [bRdFlag] [tinyint] NOT NULL,
  264. [cVouchType] [nvarchar](2) NOT NULL,
  265. [cBusType] [nvarchar](12) NULL,
  266. [cSource] [nvarchar](50) NOT NULL,
  267. [cBusCode] [nvarchar](30) NULL,
  268. [cWhCode] [nvarchar](10) NOT NULL,
  269. [dDate] [datetime] NOT NULL,
  270. [cCode] [nvarchar](30) NOT NULL,
  271. [cRdCode] [nvarchar](5) NULL,
  272. [cDepCode] [nvarchar](12) NULL,
  273. [cPersonCode] [nvarchar](20) NULL,
  274. [cPTCode] [nvarchar](2) NULL,
  275. [cSTCode] [nvarchar](2) NULL,
  276. [cCusCode] [nvarchar](20) NULL,
  277. [cVenCode] [nvarchar](20) NULL,
  278. [cOrderCode] [nvarchar](30) NULL,
  279. [cARVCode] [nvarchar](30) NULL,
  280. [cBillCode] [bigint] NULL,
  281. [cDLCode] [bigint] NULL,
  282. [cProBatch] [nvarchar](60) NULL,
  283. [cHandler] [nvarchar](20) NULL,
  284. [cMemo] [nvarchar](255) NULL,
  285. [bTransFlag] [bit] NOT NULL,
  286. [cAccounter] [nvarchar](20) NULL,
  287. [cMaker] [nvarchar](20) NULL,
  288. [cDefine1] [nvarchar](20) NULL,
  289. [cDefine2] [nvarchar](20) NULL,
  290. [cDefine3] [nvarchar](20) NULL,
  291. [cDefine4] [datetime] NULL,
  292. [cDefine5] [int] NULL,
  293. [cDefine6] [datetime] NULL,
  294. [cDefine7] [float] NULL,
  295. [cDefine8] [nvarchar](4) NULL,
  296. [cDefine9] [nvarchar](8) NULL,
  297. [cDefine10] [nvarchar](60) NULL,
  298. [dKeepDate] [nvarchar](5) NULL,
  299. [dVeriDate] [datetime] NULL,
  300. [bpufirst] [bit] NULL,
  301. [biafirst] [bit] NULL,
  302. [iMQuantity] [float] NULL,
  303. [dARVDate] [datetime] NULL,
  304. [cChkCode] [nvarchar](30) NULL,
  305. [dChkDate] [datetime] NULL,
  306. [cChkPerson] [nvarchar](40) NULL,
  307. [VT_ID] [int] NULL,
  308. [bIsSTQc] [bit] NOT NULL,
  309. [cDefine11] [nvarchar](120) NULL,
  310. [cDefine12] [nvarchar](120) NULL,
  311. [cDefine13] [nvarchar](120) NULL,
  312. [cDefine14] [nvarchar](120) NULL,
  313. [cDefine15] [int] NULL,
  314. [cDefine16] [float] NULL,
  315. [gspcheck] [nvarchar](10) NULL,
  316. [ufts] [timestamp] NULL,
  317. [iExchRate] [float] NULL,
  318. [cExch_Name] [nvarchar](8) NULL,
  319. [cShipAddress] [nvarchar](200) NULL,
  320. [caddcode] [nvarchar](60) NULL,
  321. [bOMFirst] [bit] NULL,
  322. [bFromPreYear] [bit] NULL,
  323. [bIsLsQuery] [bit] NULL,
  324. [bIsComplement] [smallint] NULL,
  325. [iDiscountTaxType] [tinyint] NULL,
  326. [iBG_OverFlag] [smallint] NULL,
  327. [cBG_Auditor] [nvarchar](20) NULL,
  328. [cBG_AuditTime] [nvarchar](20) NULL,
  329. [ControlResult] [smallint] NULL,
  330. [ireturncount] [int] NULL,
  331. [iverifystate] [int] NULL,
  332. [iswfcontrolled] [int] NULL,
  333. [cModifyPerson] [nvarchar](50) NULL,
  334. [dModifyDate] [datetime] NULL,
  335. [dnmaketime] [datetime] NULL,
  336. [dnmodifytime] [datetime] NULL,
  337. [dnverifytime] [datetime] NULL,
  338. [bredvouch] [int] NULL,
  339. [iFlowId] [int] NULL,
  340. [cPZID] [nvarchar](30) NULL,
  341. [cSourceLs] [nvarchar](4) NULL,
  342. [cSourceCodeLs] [nvarchar](20) NULL,
  343. [iPrintCount] [int] NULL,
  344. [ctransflag] [nvarchar](2) NULL,
  345. [csysbarcode] [nvarchar](60) NULL,
  346. [cCurrentAuditor] [nvarchar](200) NULL,
  347. [cCheckSignFlag] [nvarchar](36) NULL,
  348. importdate datetime null default(getdate()),
  349. processdate datetime null,
  350. processflag bit default(0), --0:未处理,1:已处理
  351. direction int default(0) --0:从U8到中间库,1:从旺店通到中间库
  352. )
  353. go
  354. CREATE TABLE [dbo].[rdrecords09](
  355. sysid int identity(1,1),
  356. [AutoID] [bigint] NOT NULL,
  357. [ID] [bigint] NOT NULL,
  358. [cInvCode] [nvarchar](60) NOT NULL,
  359. [iNum] [decimal](30, 10) NULL,
  360. [iQuantity] [decimal](30, 10) NULL,
  361. [iUnitCost] [decimal](30, 10) NULL,
  362. [iPrice] [money] NULL,
  363. [iAPrice] [money] NULL,
  364. [iPUnitCost] [decimal](30, 10) NULL,
  365. [iPPrice] [money] NULL,
  366. [cBatch] [nvarchar](60) NULL,
  367. [cVouchCode] [bigint] NULL,
  368. [cInVouchCode] [nvarchar](30) NULL,
  369. [cinvouchtype] [nvarchar](2) NULL,
  370. [iSOutQuantity] [decimal](30, 10) NULL,
  371. [iSOutNum] [decimal](30, 10) NULL,
  372. [coutvouchid] [bigint] NULL,
  373. [coutvouchtype] [nvarchar](2) NULL,
  374. [iSRedOutQuantity] [decimal](30, 10) NULL,
  375. [iSRedOutNum] [decimal](30, 10) NULL,
  376. [cFree1] [nvarchar](20) NULL,
  377. [cFree2] [nvarchar](20) NULL,
  378. [iFlag] [tinyint] NOT NULL,
  379. [iFNum] [decimal](30, 10) NULL,
  380. [iFQuantity] [decimal](30, 10) NULL,
  381. [dVDate] [datetime] NULL,
  382. [iTrIds] [bigint] NULL,
  383. [cPosition] [nvarchar](20) NULL,
  384. [cDefine22] [nvarchar](60) NULL,
  385. [cDefine23] [nvarchar](60) NULL,
  386. [cDefine24] [nvarchar](60) NULL,
  387. [cDefine25] [nvarchar](60) NULL,
  388. [cDefine26] [float] NULL,
  389. [cDefine27] [float] NULL,
  390. [cItem_class] [nvarchar](10) NULL,
  391. [cItemCode] [nvarchar](60) NULL,
  392. [iDLsID] [bigint] NULL,
  393. [cName] [nvarchar](255) NULL,
  394. [cItemCName] [nvarchar](20) NULL,
  395. [cFree3] [nvarchar](20) NULL,
  396. [cFree4] [nvarchar](20) NULL,
  397. [cFree5] [nvarchar](20) NULL,
  398. [cFree6] [nvarchar](20) NULL,
  399. [cFree7] [nvarchar](20) NULL,
  400. [cFree8] [nvarchar](20) NULL,
  401. [cFree9] [nvarchar](20) NULL,
  402. [cFree10] [nvarchar](20) NULL,
  403. [cBarCode] [nvarchar](200) NULL,
  404. [iNQuantity] [decimal](30, 10) NULL,
  405. [iNNum] [decimal](30, 10) NULL,
  406. [cAssUnit] [nvarchar](35) NULL,
  407. [dMadeDate] [datetime] NULL,
  408. [iMassDate] [int] NULL,
  409. [cDefine28] [nvarchar](120) NULL,
  410. [cDefine29] [nvarchar](120) NULL,
  411. [cDefine30] [nvarchar](120) NULL,
  412. [cDefine31] [nvarchar](120) NULL,
  413. [cDefine32] [nvarchar](120) NULL,
  414. [cDefine33] [nvarchar](120) NULL,
  415. [cDefine34] [int] NULL,
  416. [cDefine35] [int] NULL,
  417. [cDefine36] [datetime] NULL,
  418. [cDefine37] [datetime] NULL,
  419. [iCheckIds] [bigint] NULL,
  420. [cBVencode] [nvarchar](20) NULL,
  421. [bGsp] [bit] NULL,
  422. [cGspState] [nvarchar](20) NULL,
  423. [cCheckCode] [nvarchar](30) NULL,
  424. [iCheckIdBaks] [bigint] NULL,
  425. [cRejectCode] [nvarchar](30) NULL,
  426. [iRejectIds] [bigint] NULL,
  427. [cCheckPersonCode] [nvarchar](20) NULL,
  428. [dCheckDate] [datetime] NULL,
  429. [cMassUnit] [smallint] NULL,
  430. [bChecked] [bit] NULL,
  431. [iEqDID] [int] NULL,
  432. [bLPUseFree] [bit] NULL,
  433. [iRSRowNO] [int] NULL,
  434. [iOriTrackID] [bigint] NULL,
  435. [coritracktype] [nvarchar](2) NULL,
  436. [cbaccounter] [nvarchar](30) NULL,
  437. [dbKeepDate] [datetime] NULL,
  438. [bCosting] [bit] NULL,
  439. [bVMIUsed] [bit] NULL,
  440. [iVMISettleQuantity] [decimal](30, 10) NULL,
  441. [iVMISettleNum] [decimal](30, 10) NULL,
  442. [cvmivencode] [nvarchar](20) NULL,
  443. [iInvSNCount] [int] NULL,
  444. [cwhpersoncode] [nvarchar](20) NULL,
  445. [cwhpersonname] [nvarchar](50) NULL,
  446. [cserviceoid] [varchar](38) NULL,
  447. [cbserviceoid] [varchar](38) NULL,
  448. [iinvexchrate] [decimal](38, 8) NULL,
  449. [cbdlcode] [nvarchar](30) NULL
  450. )
  451. go
  452. CREATE TABLE [dbo].[RdRecord01](
  453. sysid int identity(1,1),
  454. [ID] [bigint] NOT NULL,
  455. [bRdFlag] [tinyint] NOT NULL,
  456. [cVouchType] [nvarchar](2) NOT NULL,
  457. [cBusType] [nvarchar](12) NULL,
  458. [cSource] [nvarchar](50) NOT NULL,
  459. [cBusCode] [nvarchar](30) NULL,
  460. [cWhCode] [nvarchar](10) NOT NULL,
  461. [dDate] [datetime] NOT NULL,
  462. [cCode] [nvarchar](30) NOT NULL,
  463. [cRdCode] [nvarchar](5) NULL,
  464. [cDepCode] [nvarchar](12) NULL,
  465. [cPersonCode] [nvarchar](20) NULL,
  466. [cPTCode] [nvarchar](2) NULL,
  467. [cSTCode] [nvarchar](2) NULL,
  468. [cCusCode] [nvarchar](20) NULL,
  469. [cVenCode] [nvarchar](20) NULL,
  470. [cOrderCode] [nvarchar](30) NULL,
  471. [cARVCode] [nvarchar](30) NULL,
  472. [cBillCode] [bigint] NULL,
  473. [cDLCode] [bigint] NULL,
  474. [cProBatch] [nvarchar](60) NULL,
  475. [cHandler] [nvarchar](20) NULL,
  476. [cMemo] [nvarchar](255) NULL,
  477. [bTransFlag] [bit] NOT NULL,
  478. [cAccounter] [nvarchar](20) NULL,
  479. [cMaker] [nvarchar](20) NULL,
  480. [cDefine1] [nvarchar](20) NULL,
  481. [cDefine2] [nvarchar](20) NULL,
  482. [cDefine3] [nvarchar](20) NULL,
  483. [cDefine4] [datetime] NULL,
  484. [cDefine5] [int] NULL,
  485. [cDefine6] [datetime] NULL,
  486. [cDefine7] [float] NULL,
  487. [cDefine8] [nvarchar](4) NULL,
  488. [cDefine9] [nvarchar](8) NULL,
  489. [cDefine10] [nvarchar](60) NULL,
  490. [dKeepDate] [nvarchar](5) NULL,
  491. [dVeriDate] [datetime] NULL,
  492. [bpufirst] [bit] NULL,
  493. [biafirst] [bit] NULL,
  494. [iMQuantity] [float] NULL,
  495. [dARVDate] [datetime] NULL,
  496. [cChkCode] [nvarchar](30) NULL,
  497. [dChkDate] [datetime] NULL,
  498. [cChkPerson] [nvarchar](40) NULL,
  499. [VT_ID] [int] NULL,
  500. [bIsSTQc] [bit] NOT NULL,
  501. [cDefine11] [nvarchar](120) NULL,
  502. [cDefine12] [nvarchar](120) NULL,
  503. [cDefine13] [nvarchar](120) NULL,
  504. [cDefine14] [nvarchar](120) NULL,
  505. [cDefine15] [int] NULL,
  506. [cDefine16] [float] NULL,
  507. [gspcheck] [nvarchar](10) NULL,
  508. [ipurorderid] [bigint] NULL,
  509. [ipurarriveid] [bigint] NULL,
  510. [iarriveid] [nvarchar](30) NULL,
  511. [isalebillid] [nvarchar](30) NULL,
  512. [ufts] [timestamp] NULL,
  513. [iTaxRate] [decimal](20, 6) NULL,
  514. [iExchRate] [float] NULL,
  515. [cExch_Name] [nvarchar](8) NULL,
  516. [bOMFirst] [bit] NULL,
  517. [bFromPreYear] [bit] NULL,
  518. [bIsLsQuery] [bit] NULL,
  519. [bIsComplement] [smallint] NULL,
  520. [iDiscountTaxType] [tinyint] NULL,
  521. [ireturncount] [int] NULL,
  522. [iverifystate] [int] NULL,
  523. [iswfcontrolled] [int] NULL,
  524. [cModifyPerson] [nvarchar](50) NULL,
  525. [dModifyDate] [datetime] NULL,
  526. [dnmaketime] [datetime] NULL,
  527. [dnmodifytime] [datetime] NULL,
  528. [dnverifytime] [datetime] NULL,
  529. [bredvouch] [int] NULL,
  530. [cVenPUOMProtocol] [nvarchar](20) NULL,
  531. [dCreditStart] [datetime] NULL,
  532. [iCreditPeriod] [int] NULL,
  533. [dGatheringDate] [datetime] NULL,
  534. [bCredit] [tinyint] NULL,
  535. [iFlowId] [int] NULL,
  536. [cPZID] [nvarchar](30) NULL,
  537. [cSourceLs] [nvarchar](4) NULL,
  538. [cSourceCodeLs] [nvarchar](20) NULL,
  539. [iPrintCount] [int] NULL,
  540. [csysbarcode] [nvarchar](60) NULL,
  541. [cCurrentAuditor] [nvarchar](200) NULL,
  542. [cCheckSignFlag] [nvarchar](36) NULL,
  543. [cGCRouteCode] [nvarchar](40) NULL,
  544. importdate datetime null default(getdate()),
  545. processdate datetime null,
  546. processflag bit default(0),
  547. direction int default(0) --0:从U8到中间库,1:从旺店通到中间库
  548. )
  549. GO
  550. CREATE TABLE [dbo].[rdrecords01](
  551. sysid int identity(1,1),
  552. [AutoID] [bigint] NOT NULL,
  553. [ID] [bigint] NOT NULL,
  554. [cInvCode] [nvarchar](60) NOT NULL,
  555. [iNum] [decimal](30, 10) NULL,
  556. [iQuantity] [decimal](30, 10) NULL,
  557. [iUnitCost] [decimal](30, 10) NULL,
  558. [iPrice] [money] NULL,
  559. [iAPrice] [money] NULL,
  560. [iPUnitCost] [decimal](30, 10) NULL,
  561. [iPPrice] [money] NULL,
  562. [cBatch] [nvarchar](60) NULL,
  563. [cVouchCode] [bigint] NULL,
  564. [cInVouchCode] [nvarchar](30) NULL,
  565. [cinvouchtype] [nvarchar](2) NULL,
  566. [iSOutQuantity] [decimal](30, 10) NULL,
  567. [iSOutNum] [decimal](30, 10) NULL,
  568. [cFree1] [nvarchar](20) NULL,
  569. [cFree2] [nvarchar](20) NULL,
  570. [iFlag] [tinyint] NOT NULL,
  571. [dSDate] [datetime] NULL,
  572. [iTax] [money] NULL,
  573. [iSQuantity] [decimal](30, 10) NULL,
  574. [iSNum] [decimal](30, 10) NULL,
  575. [iMoney] [money] NULL,
  576. [iFNum] [decimal](30, 10) NULL,
  577. [iFQuantity] [decimal](30, 10) NULL,
  578. [dVDate] [datetime] NULL,
  579. [cPosition] [nvarchar](20) NULL,
  580. [cDefine22] [nvarchar](60) NULL,
  581. [cDefine23] [nvarchar](60) NULL,
  582. [cDefine24] [nvarchar](60) NULL,
  583. [cDefine25] [nvarchar](60) NULL,
  584. [cDefine26] [float] NULL,
  585. [cDefine27] [float] NULL,
  586. [cItem_class] [nvarchar](10) NULL,
  587. [cItemCode] [nvarchar](60) NULL,
  588. [iPOsID] [bigint] NULL,
  589. [fACost] [decimal](30, 10) NULL,
  590. [cName] [nvarchar](255) NULL,
  591. [cItemCName] [nvarchar](20) NULL,
  592. [cFree3] [nvarchar](20) NULL,
  593. [cFree4] [nvarchar](20) NULL,
  594. [cFree5] [nvarchar](20) NULL,
  595. [cFree6] [nvarchar](20) NULL,
  596. [cFree7] [nvarchar](20) NULL,
  597. [cFree8] [nvarchar](20) NULL,
  598. [cFree9] [nvarchar](20) NULL,
  599. [cFree10] [nvarchar](20) NULL,
  600. [cBarCode] [nvarchar](200) NULL,
  601. [iNQuantity] [decimal](30, 10) NULL,
  602. [iNNum] [decimal](30, 10) NULL,
  603. [cAssUnit] [nvarchar](35) NULL,
  604. [dMadeDate] [datetime] NULL,
  605. [iMassDate] [int] NULL,
  606. [cDefine28] [nvarchar](120) NULL,
  607. [cDefine29] [nvarchar](120) NULL,
  608. [cDefine30] [nvarchar](120) NULL,
  609. [cDefine31] [nvarchar](120) NULL,
  610. [cDefine32] [nvarchar](120) NULL,
  611. [cDefine33] [nvarchar](120) NULL,
  612. [cDefine34] [int] NULL,
  613. [cDefine35] [int] NULL,
  614. [cDefine36] [datetime] NULL,
  615. [cDefine37] [datetime] NULL,
  616. [iCheckIds] [bigint] NULL,
  617. [cBVencode] [nvarchar](20) NULL,
  618. [chVencode] [nvarchar](20) NULL,
  619. [bGsp] [bit] NULL,
  620. [cGspState] [nvarchar](20) NULL,
  621. [iArrsId] [bigint] NULL,
  622. [cCheckCode] [nvarchar](30) NULL,
  623. [iCheckIdBaks] [bigint] NULL,
  624. [cRejectCode] [nvarchar](30) NULL,
  625. [iRejectIds] [bigint] NULL,
  626. [cCheckPersonCode] [nvarchar](20) NULL,
  627. [dCheckDate] [datetime] NULL,
  628. [iOriTaxCost] [decimal](20, 6) NULL,
  629. [iOriCost] [decimal](20, 6) NULL,
  630. [iOriMoney] [money] NULL,
  631. [iOriTaxPrice] [money] NULL,
  632. [ioriSum] [money] NULL,
  633. [iTaxRate] [decimal](20, 6) NULL,
  634. [iTaxPrice] [money] NULL,
  635. [iSum] [money] NULL,
  636. [bTaxCost] [bit] NULL,
  637. [cPOID] [nvarchar](30) NULL,
  638. [cMassUnit] [smallint] NULL,
  639. [iMaterialFee] [money] NULL,
  640. [iProcessCost] [decimal](30, 10) NULL,
  641. [iProcessFee] [money] NULL,
  642. [dMSDate] [datetime] NULL,
  643. [iSMaterialFee] [money] NULL,
  644. [iSProcessFee] [money] NULL,
  645. [iOMoDID] [int] NULL,
  646. [strContractId] [nvarchar](64) NULL,
  647. [strCode] [nvarchar](150) NULL,
  648. [bChecked] [bit] NULL,
  649. [bRelated] [bit] NULL,
  650. [iOMoMID] [bigint] NULL,
  651. [iMatSettleState] [int] NOT NULL,
  652. [iBillSettleCount] [int] NOT NULL,
  653. [bLPUseFree] [bit] NULL,
  654. [iOriTrackID] [bigint] NULL,
  655. [coritracktype] [nvarchar](2) NULL,
  656. [cbaccounter] [nvarchar](30) NULL,
  657. [dbKeepDate] [datetime] NULL,
  658. [bCosting] [bit] NULL,
  659. [iSumBillQuantity] [decimal](30, 10) NULL,
  660. [bVMIUsed] [bit] NULL,
  661. [iVMISettleQuantity] [decimal](30, 10) NULL,
  662. [iVMISettleNum] [decimal](30, 10) NULL,
  663. [cvmivencode] [nvarchar](20) NULL,
  664. [iInvSNCount] [int] NULL,
  665. [cwhpersoncode] [nvarchar](20) NULL,
  666. [cwhpersonname] [nvarchar](50) NULL,
  667. [impcost] [decimal](30, 10) NULL,
  668. [iIMOSID] [int] NULL,
  669. [iIMBSID] [int] NULL,
  670. [cbarvcode] [nvarchar](30) NULL,
  671. [dbarvdate] [nvarchar](30) NULL,
  672. [iinvexchrate] [decimal](30, 10) NULL,
  673. [corufts] [varchar](16) NULL,
  674. [comcode] [nvarchar](30) NULL,
  675. [strContractGUID] [uniqueidentifier] NULL,
  676. [iExpiratDateCalcu] [smallint] NULL
  677. )
  678. go
  679. CREATE TABLE [dbo].[rdrecord11](
  680. sysid int identity(1,1),
  681. importdate datetime null default(getdate()),
  682. processdate datetime null,
  683. processflag bit default(0),
  684. direction int default(0), --0:从U8到中间库,1:从旺店通到中间库
  685. [ID] [bigint] NOT NULL,
  686. [bRdFlag] [tinyint] NOT NULL,
  687. [cVouchType] [nvarchar](2) NOT NULL,
  688. [cBusType] [nvarchar](12) NULL,
  689. [cSource] [nvarchar](50) NOT NULL,
  690. [cBusCode] [nvarchar](30) NULL,
  691. [cWhCode] [nvarchar](10) NOT NULL,
  692. [dDate] [datetime] NOT NULL,
  693. [cCode] [nvarchar](30) NOT NULL,
  694. [cRdCode] [nvarchar](5) NULL,
  695. [cDepCode] [nvarchar](12) NULL,
  696. [cPersonCode] [nvarchar](20) NULL,
  697. [cPTCode] [nvarchar](2) NULL,
  698. [cSTCode] [nvarchar](2) NULL,
  699. [cCusCode] [nvarchar](20) NULL,
  700. [cVenCode] [nvarchar](20) NULL,
  701. [cOrderCode] [nvarchar](30) NULL,
  702. [cARVCode] [nvarchar](30) NULL,
  703. [cBillCode] [bigint] NULL,
  704. [cDLCode] [bigint] NULL,
  705. [cProBatch] [nvarchar](60) NULL,
  706. [cHandler] [nvarchar](20) NULL,
  707. [cMemo] [nvarchar](255) NULL,
  708. [bTransFlag] [bit] NOT NULL,
  709. [cAccounter] [nvarchar](20) NULL,
  710. [cMaker] [nvarchar](20) NULL,
  711. [cDefine1] [nvarchar](20) NULL,
  712. [cDefine2] [nvarchar](20) NULL,
  713. [cDefine3] [nvarchar](20) NULL,
  714. [cDefine4] [datetime] NULL,
  715. [cDefine5] [int] NULL,
  716. [cDefine6] [datetime] NULL,
  717. [cDefine7] [float] NULL,
  718. [cDefine8] [nvarchar](4) NULL,
  719. [cDefine9] [nvarchar](8) NULL,
  720. [cDefine10] [nvarchar](60) NULL,
  721. [dKeepDate] [nvarchar](5) NULL,
  722. [dVeriDate] [datetime] NULL,
  723. [bpufirst] [bit] NULL,
  724. [biafirst] [bit] NULL,
  725. [iMQuantity] [float] NULL,
  726. [dARVDate] [datetime] NULL,
  727. [cChkCode] [nvarchar](30) NULL,
  728. [dChkDate] [datetime] NULL,
  729. [cChkPerson] [nvarchar](40) NULL,
  730. [VT_ID] [int] NULL,
  731. [bIsSTQc] [bit] NOT NULL,
  732. [cDefine11] [nvarchar](120) NULL,
  733. [cDefine12] [nvarchar](120) NULL,
  734. [cDefine13] [nvarchar](120) NULL,
  735. [cDefine14] [nvarchar](120) NULL,
  736. [cDefine15] [int] NULL,
  737. [cDefine16] [float] NULL,
  738. [cPsPcode] [nvarchar](60) NULL,
  739. [cMPoCode] [nvarchar](30) NULL,
  740. [gspcheck] [nvarchar](10) NULL,
  741. [ipurorderid] [bigint] NULL,
  742. [iproorderid] [int] NULL,
  743. [ufts] [timestamp] NULL,
  744. [iExchRate] [float] NULL,
  745. [cExch_Name] [nvarchar](8) NULL,
  746. [bOMFirst] [bit] NULL,
  747. [bFromPreYear] [bit] NULL,
  748. [bIsLsQuery] [bit] NULL,
  749. [bIsComplement] [smallint] NULL,
  750. [iDiscountTaxType] [tinyint] NULL,
  751. [ireturncount] [int] NULL,
  752. [iverifystate] [int] NULL,
  753. [iswfcontrolled] [int] NULL,
  754. [cModifyPerson] [nvarchar](50) NULL,
  755. [dModifyDate] [datetime] NULL,
  756. [dnmaketime] [datetime] NULL,
  757. [dnmodifytime] [datetime] NULL,
  758. [dnverifytime] [datetime] NULL,
  759. [bredvouch] [int] NULL,
  760. [bmotran] [tinyint] NULL,
  761. [iFlowId] [int] NULL,
  762. [cPZID] [nvarchar](30) NULL,
  763. [cSourceLs] [nvarchar](4) NULL,
  764. [cSourceCodeLs] [nvarchar](20) NULL,
  765. [bHYVouch] [bit] NULL,
  766. [iPrintCount] [int] NULL,
  767. [csysbarcode] [nvarchar](60) NULL,
  768. [cCurrentAuditor] [nvarchar](200) NULL,
  769. [cCheckSignFlag] [nvarchar](36) NULL
  770. )
  771. GO
  772. CREATE TABLE [dbo].[rdrecords11](
  773. sysid int identity(1,1),
  774. [AutoID] [bigint] NOT NULL,
  775. [ID] [bigint] NOT NULL,
  776. [cInvCode] [nvarchar](60) NOT NULL,
  777. [iNum] [decimal](30, 10) NULL,
  778. [iQuantity] [decimal](30, 10) NULL,
  779. [iUnitCost] [decimal](30, 10) NULL,
  780. [iPrice] [money] NULL,
  781. [iAPrice] [money] NULL,
  782. [iPUnitCost] [decimal](30, 10) NULL,
  783. [iPPrice] [money] NULL,
  784. [cBatch] [nvarchar](60) NULL,
  785. [cObjCode] [nvarchar](12) NULL,
  786. [cVouchCode] [bigint] NULL,
  787. [cInVouchCode] [nvarchar](30) NULL,
  788. [cinvouchtype] [nvarchar](2) NULL,
  789. [iSOutQuantity] [decimal](30, 10) NULL,
  790. [iSOutNum] [decimal](30, 10) NULL,
  791. [coutvouchid] [bigint] NULL,
  792. [coutvouchtype] [nvarchar](2) NULL,
  793. [iSRedOutQuantity] [decimal](30, 10) NULL,
  794. [iSRedOutNum] [decimal](30, 10) NULL,
  795. [cFree1] [nvarchar](20) NULL,
  796. [cFree2] [nvarchar](20) NULL,
  797. [iFlag] [tinyint] NOT NULL,
  798. [iSQuantity] [decimal](30, 10) NULL,
  799. [iSNum] [decimal](30, 10) NULL,
  800. [iFNum] [decimal](30, 10) NULL,
  801. [iFQuantity] [decimal](30, 10) NULL,
  802. [dVDate] [datetime] NULL,
  803. [iTrIds] [bigint] NULL,
  804. [cPosition] [nvarchar](20) NULL,
  805. [cDefine22] [nvarchar](60) NULL,
  806. [cDefine23] [nvarchar](60) NULL,
  807. [cDefine24] [nvarchar](60) NULL,
  808. [cDefine25] [nvarchar](60) NULL,
  809. [cDefine26] [float] NULL,
  810. [cDefine27] [float] NULL,
  811. [cItem_class] [nvarchar](10) NULL,
  812. [cItemCode] [nvarchar](60) NULL,
  813. [cName] [nvarchar](255) NULL,
  814. [cItemCName] [nvarchar](20) NULL,
  815. [cFree3] [nvarchar](20) NULL,
  816. [cFree4] [nvarchar](20) NULL,
  817. [cFree5] [nvarchar](20) NULL,
  818. [cFree6] [nvarchar](20) NULL,
  819. [cFree7] [nvarchar](20) NULL,
  820. [cFree8] [nvarchar](20) NULL,
  821. [cFree9] [nvarchar](20) NULL,
  822. [cFree10] [nvarchar](20) NULL,
  823. [cBarCode] [nvarchar](200) NULL,
  824. [iNQuantity] [decimal](30, 10) NULL,
  825. [iNNum] [decimal](30, 10) NULL,
  826. [cAssUnit] [nvarchar](35) NULL,
  827. [dMadeDate] [datetime] NULL,
  828. [iMassDate] [int] NULL,
  829. [cDefine28] [nvarchar](120) NULL,
  830. [cDefine29] [nvarchar](120) NULL,
  831. [cDefine30] [nvarchar](120) NULL,
  832. [cDefine31] [nvarchar](120) NULL,
  833. [cDefine32] [nvarchar](120) NULL,
  834. [cDefine33] [nvarchar](120) NULL,
  835. [cDefine34] [int] NULL,
  836. [cDefine35] [int] NULL,
  837. [cDefine36] [datetime] NULL,
  838. [cDefine37] [datetime] NULL,
  839. [iMPoIds] [bigint] NULL,
  840. [iCheckIds] [bigint] NULL,
  841. [cBVencode] [nvarchar](20) NULL,
  842. [bGsp] [bit] NULL,
  843. [cGspState] [nvarchar](20) NULL,
  844. [cCheckCode] [nvarchar](30) NULL,
  845. [iCheckIdBaks] [bigint] NULL,
  846. [cRejectCode] [nvarchar](30) NULL,
  847. [iRejectIds] [bigint] NULL,
  848. [cCheckPersonCode] [nvarchar](20) NULL,
  849. [dCheckDate] [datetime] NULL,
  850. [cMassUnit] [smallint] NULL,
  851. [cMoLotCode] [nvarchar](60) NULL,
  852. [iMaterialFee] [money] NULL,
  853. [iProcessCost] [decimal](30, 10) NULL,
  854. [iProcessFee] [money] NULL,
  855. [dMSDate] [datetime] NULL,
  856. [iSMaterialFee] [money] NULL,
  857. [iSProcessFee] [money] NULL,
  858. [iOMoDID] [int] NULL,
  859. [bFilled] [bigint] NULL,
  860. [bChecked] [bit] NULL,
  861. [iOMoMID] [bigint] NULL,
  862. [cmworkcentercode] [nvarchar](8) NULL,
  863. [bLPUseFree] [bit] NULL,
  864. [iRSRowNO] [int] NULL,
  865. [iOriTrackID] [bigint] NULL,
  866. [coritracktype] [nvarchar](2) NULL,
  867. [cbaccounter] [nvarchar](30) NULL,
  868. [dbKeepDate] [datetime] NULL,
  869. [bCosting] [bit] NULL,
  870. [bVMIUsed] [bit] NULL,
  871. [iVMISettleQuantity] [decimal](30, 10) NULL,
  872. [iVMISettleNum] [decimal](30, 10) NULL,
  873. [cvmivencode] [nvarchar](20) NULL,
  874. [iInvSNCount] [int] NULL,
  875. [cwhpersoncode] [nvarchar](20) NULL,
  876. [cwhpersonname] [nvarchar](50) NULL,
  877. [iMaIDs] [bigint] NULL,
  878. [cserviceoid] [varchar](38) NULL,
  879. [cbserviceoid] [varchar](38) NULL,
  880. [iinvexchrate] [decimal](38, 8) NULL
  881. )
  882. GO
  883. CREATE TABLE [dbo].[PO_Pomain](
  884. sysid int identity(1,1),
  885. importdate datetime null default(getdate()),
  886. processdate datetime null,
  887. processflag bit default(0),
  888. direction int default(0), --0:从U8到中间库,1:从旺店通到中间库
  889. [cPOID] [nvarchar](30) NULL,
  890. [dPODate] [datetime] NOT NULL,
  891. [cVenCode] [nvarchar](20) NULL,
  892. [cDepCode] [nvarchar](12) NULL,
  893. [cPersonCode] [nvarchar](20) NULL,
  894. [cPTCode] [nvarchar](2) NULL,
  895. [cArrivalPlace] [nvarchar](255) NULL,
  896. [cSCCode] [nvarchar](2) NULL,
  897. [cexch_name] [nvarchar](8) NULL,
  898. [nflat] [float] NULL,
  899. [iTaxRate] [float] NULL,
  900. [cPayCode] [nvarchar](3) NULL,
  901. [iCost] [money] NULL,
  902. [iBargain] [money] NULL,
  903. [cMemo] [nvarchar](255) NULL,
  904. [cState] [tinyint] NULL,
  905. [cPeriod] [nvarchar](12) NULL,
  906. [cMaker] [nvarchar](20) NULL,
  907. [cVerifier] [nvarchar](20) NULL,
  908. [cCloser] [nvarchar](20) NULL,
  909. [cDefine1] [nvarchar](20) NULL,
  910. [cDefine2] [nvarchar](20) NULL,
  911. [cDefine3] [nvarchar](20) NULL,
  912. [cDefine4] [datetime] NULL,
  913. [cDefine5] [int] NULL,
  914. [cDefine6] [datetime] NULL,
  915. [cDefine7] [float] NULL,
  916. [cDefine8] [nvarchar](4) NULL,
  917. [cDefine9] [nvarchar](8) NULL,
  918. [cDefine10] [nvarchar](60) NULL,
  919. [POID] [int] NOT NULL,
  920. [iVTid] [int] NOT NULL,
  921. [ufts] [timestamp] NULL,
  922. [cChanger] [nvarchar](20) NULL,
  923. [cBusType] [nvarchar](8) NULL,
  924. [cDefine11] [nvarchar](120) NULL,
  925. [cDefine12] [nvarchar](120) NULL,
  926. [cDefine13] [nvarchar](120) NULL,
  927. [cDefine14] [nvarchar](120) NULL,
  928. [cDefine15] [int] NULL,
  929. [cDefine16] [float] NULL,
  930. [cLocker] [nvarchar](20) NULL,
  931. [iDiscountTaxType] [tinyint] NULL,
  932. [iverifystateex] [int] NULL,
  933. [ireturncount] [int] NULL,
  934. [IsWfControlled] [bit] NULL,
  935. [cmaketime] [datetime] NULL,
  936. [cModifyTime] [datetime] NULL,
  937. [cAuditTime] [datetime] NULL,
  938. [cAuditDate] [datetime] NULL,
  939. [cModifyDate] [datetime] NULL,
  940. [cReviser] [nvarchar](40) NULL,
  941. [cVenPUOMProtocol] [nvarchar](20) NULL,
  942. [cChangVerifier] [nvarchar](40) NULL,
  943. [cChangAuditTime] [datetime] NULL,
  944. [cChangAuditDate] [datetime] NULL,
  945. [iBG_OverFlag] [smallint] NULL,
  946. [cBG_Auditor] [nvarchar](20) NULL,
  947. [cBG_AuditTime] [nvarchar](20) NULL,
  948. [ControlResult] [smallint] NULL,
  949. [iflowid] [int] NULL,
  950. [iPrintCount] [int] NULL,
  951. [dCloseDate] [datetime] NULL,
  952. [dCloseTime] [datetime] NULL,
  953. [ccleanver] [nvarchar](50) NULL,
  954. [cContactCode] [nvarchar](60) NULL,
  955. [cVenPerson] [nvarchar](100) NULL,
  956. [cVenBank] [nvarchar](200) NULL,
  957. [cVenAccount] [nvarchar](100) NULL,
  958. [cappcode] [nvarchar](64) NULL,
  959. [csysbarcode] [nvarchar](60) NULL,
  960. [cCurrentAuditor] [nvarchar](200) NULL,
  961. [cGCRouteCode] [nvarchar](40) NULL,
  962. [bGCTransforming] [bit] NULL)
  963. GO
  964. CREATE TABLE [dbo].[PO_Podetails](
  965. [ID] [int] NOT NULL,
  966. [cPOID] [nvarchar](30) NULL,
  967. [cInvCode] [nvarchar](60) NOT NULL,
  968. [iQuantity] [decimal](30, 10) NULL,
  969. [iNum] [decimal](30, 10) NULL,
  970. [iQuotedPrice] [decimal](30, 10) NULL,
  971. [iUnitPrice] [decimal](30, 10) NULL,
  972. [iMoney] [money] NULL,
  973. [iTax] [money] NULL,
  974. [iSum] [money] NULL,
  975. [iDisCount] [money] NULL,
  976. [iNatUnitPrice] [decimal](30, 10) NULL,
  977. [iNatMoney] [money] NULL,
  978. [iNatTax] [money] NULL,
  979. [iNatSum] [money] NULL,
  980. [iNatDisCount] [money] NULL,
  981. [dArriveDate] [datetime] NULL,
  982. [iReceivedQTY] [decimal](30, 10) NULL,
  983. [iReceivedNum] [decimal](30, 10) NULL,
  984. [iReceivedMoney] [money] NULL,
  985. [iInvQTY] [decimal](30, 10) NULL,
  986. [iInvNum] [decimal](30, 10) NULL,
  987. [iInvMoney] [money] NULL,
  988. [cFree1] [nvarchar](20) NULL,
  989. [cFree2] [nvarchar](20) NULL,
  990. [iNatInvMoney] [money] NULL,
  991. [iOriTotal] [money] NULL,
  992. [iTotal] [money] NULL,
  993. [iPerTaxRate] decimal(26,4) NULL,
  994. [cDefine22] [nvarchar](60) NULL,
  995. [cDefine23] [nvarchar](60) NULL,
  996. [cDefine24] [nvarchar](60) NULL,
  997. [cDefine25] [nvarchar](60) NULL,
  998. [cDefine26] [float] NULL,
  999. [cDefine27] [float] NULL,
  1000. [iflag] [tinyint] NULL,
  1001. [cItemCode] [nvarchar](60) NULL,
  1002. [cItem_class] [nvarchar](10) NULL,
  1003. [PPCIds] [int] NULL,
  1004. [cItemName] [nvarchar](255) NULL,
  1005. [cFree3] [nvarchar](20) NULL,
  1006. [cFree4] [nvarchar](20) NULL,
  1007. [cFree5] [nvarchar](20) NULL,
  1008. [cFree6] [nvarchar](20) NULL,
  1009. [cFree7] [nvarchar](20) NULL,
  1010. [cFree8] [nvarchar](20) NULL,
  1011. [cFree9] [nvarchar](20) NULL,
  1012. [cFree10] [nvarchar](20) NULL,
  1013. [bGsp] [tinyint] NULL,
  1014. [POID] [int] NULL,
  1015. [cUnitID] [nvarchar](35) NULL,
  1016. [iTaxPrice] decimal(26,4) NULL,
  1017. [iArrQTY] decimal(26,4) NULL,
  1018. [iArrNum] decimal(26,4) NULL,
  1019. [iArrMoney] [money] NULL,
  1020. [iNatArrMoney] [money] NULL,
  1021. [iAppIds] [int] NULL,
  1022. [cDefine28] [nvarchar](120) NULL,
  1023. [cDefine29] [nvarchar](120) NULL,
  1024. [cDefine30] [nvarchar](120) NULL,
  1025. [cDefine31] [nvarchar](120) NULL,
  1026. [cDefine32] [nvarchar](120) NULL,
  1027. [cDefine33] [nvarchar](120) NULL,
  1028. [cDefine34] [int] NULL,
  1029. [cDefine35] [int] NULL,
  1030. [cDefine36] [datetime] NULL,
  1031. [cDefine37] [datetime] NULL,
  1032. [iSOsID] [int] NULL,
  1033. [bTaxCost] [bit] NULL,
  1034. [cSource] [nvarchar](10) NULL,
  1035. [cbCloser] [nvarchar](20) NULL,
  1036. [iPPartId] [int] NULL,
  1037. [iPQuantity] decimal(26,4) NULL,
  1038. [iPTOSeq] [int] NULL,
  1039. [SoType] [tinyint] NULL,
  1040. [SoDId] [nvarchar](50) NULL,
  1041. [ContractRowGUID] [uniqueidentifier] NULL,
  1042. [cupsocode] [nvarchar](64) NULL,
  1043. [iInvMPCost] [decimal](20, 6) NULL,
  1044. [ContractCode] [nvarchar](128) NULL,
  1045. [ContractRowNo] [nvarchar](150) NULL,
  1046. [fPoValidQuantity] decimal(26,4) NULL,
  1047. [fPoValidNum] decimal(26,4) NULL,
  1048. [fPoArrQuantity] decimal(26,4) NULL,
  1049. [fPoArrNum] decimal(26,4) NULL,
  1050. [fPoRetQuantity] decimal(26,4) NULL,
  1051. [fPoRetNum] decimal(26,4) NULL,
  1052. [fPoRefuseQuantity] decimal(26,4) NULL,
  1053. [fPoRefuseNum] decimal(26,4) NULL,
  1054. [dUfts] [timestamp] NULL,
  1055. [iorderdid] [int] NULL,
  1056. [iordertype] [tinyint] NULL,
  1057. [csoordercode] [nvarchar](50) NULL,
  1058. [iorderseq] [int] NULL,
  1059. [cbCloseTime] [datetime] NULL,
  1060. [cbCloseDate] [datetime] NULL,
  1061. [cBG_ItemCode] [nvarchar](50) NULL,
  1062. [cBG_ItemName] [nvarchar](100) NULL,
  1063. [cBG_CaliberKey1] [nvarchar](50) NULL,
  1064. [cBG_CaliberKeyName1] [nvarchar](100) NULL,
  1065. [cBG_CaliberKey2] [nvarchar](50) NULL,
  1066. [cBG_CaliberKeyName2] [nvarchar](100) NULL,
  1067. [cBG_CaliberKey3] [nvarchar](50) NULL,
  1068. [cBG_CaliberKeyName3] [nvarchar](100) NULL,
  1069. [cBG_CaliberCode1] [nvarchar](90) NULL,
  1070. [cBG_CaliberName1] [nvarchar](100) NULL,
  1071. [cBG_CaliberCode2] [nvarchar](90) NULL,
  1072. [cBG_CaliberName2] [nvarchar](100) NULL,
  1073. [cBG_CaliberCode3] [nvarchar](90) NULL,
  1074. [cBG_CaliberName3] [nvarchar](100) NULL,
  1075. [iBG_Ctrl] [tinyint] NULL,
  1076. [cBG_Auditopinion] [nvarchar](100) NULL,
  1077. [fexquantity] decimal(26,4) NULL,
  1078. [fexnum] decimal(26,4) NULL,
  1079. [ivouchrowno] [int] NULL,
  1080. [cBG_CaliberKey4] [nvarchar](50) NULL,
  1081. [cBG_CaliberKeyName4] [nvarchar](100) NULL,
  1082. [cBG_CaliberKey5] [nvarchar](50) NULL,
  1083. [cBG_CaliberKeyName5] [nvarchar](100) NULL,
  1084. [cBG_CaliberKey6] [nvarchar](50) NULL,
  1085. [cBG_CaliberKeyName6] [nvarchar](100) NULL,
  1086. [cBG_CaliberCode4] [nvarchar](90) NULL,
  1087. [cBG_CaliberName4] [nvarchar](100) NULL,
  1088. [cBG_CaliberCode5] [nvarchar](90) NULL,
  1089. [cBG_CaliberName5] [nvarchar](100) NULL,
  1090. [cBG_CaliberCode6] [nvarchar](90) NULL,
  1091. [cBG_CaliberName6] [nvarchar](100) NULL,
  1092. [csocode] [nvarchar](40) NULL,
  1093. [irowno] [int] NULL,
  1094. [freceivedqty] decimal(26,4) NULL,
  1095. [freceivednum] decimal(26,4) NULL,
  1096. [cxjspdids] [nvarchar](60) NULL,
  1097. [cbMemo] [nvarchar](255) NULL,
  1098. [cbsysbarcode] [nvarchar](80) NULL,
  1099. [planlotnumber] [nvarchar](40) NULL,
  1100. [bgift] [smallint] NULL,
  1101. [cFactoryCode] [nvarchar](50) NULL
  1102. )
  1103. GO
  1104. CREATE TABLE [dbo].[PU_ArrivalVouch](
  1105. sysid int identity(1,1),
  1106. importdate datetime null default(getdate()),
  1107. processdate datetime null,
  1108. processflag bit default(0),
  1109. direction int default(0), --0:从U8到中间库,1:从旺店通到中间库
  1110. [iVTid] [int] NOT NULL,
  1111. [ufts] [timestamp] NULL,
  1112. [ID] [int] NOT NULL,
  1113. [cCode] [nvarchar](30) NOT NULL,
  1114. [cPTCode] [nvarchar](2) NULL,
  1115. [dDate] [datetime] NOT NULL,
  1116. [cVenCode] [nvarchar](20) NOT NULL,
  1117. [cDepCode] [nvarchar](12) NULL,
  1118. [cPersonCode] [nvarchar](20) NULL,
  1119. [cPayCode] [nvarchar](3) NULL,
  1120. [cSCCode] [nvarchar](2) NULL,
  1121. [cexch_name] [nvarchar](8) NOT NULL,
  1122. [iExchRate] [float] NULL,
  1123. [iTaxRate] [decimal](20, 6) NULL,
  1124. [cMemo] [nvarchar](255) NULL,
  1125. [cBusType] [nvarchar](8) NOT NULL,
  1126. [cMaker] [nvarchar](20) NOT NULL,
  1127. [bNegative] [int] NOT NULL,
  1128. [cDefine1] [nvarchar](20) NULL,
  1129. [cDefine2] [nvarchar](20) NULL,
  1130. [cDefine3] [nvarchar](20) NULL,
  1131. [cDefine4] [datetime] NULL,
  1132. [cDefine5] [int] NULL,
  1133. [cDefine6] [datetime] NULL,
  1134. [cDefine7] [float] NULL,
  1135. [cDefine8] [nvarchar](4) NULL,
  1136. [cDefine9] [nvarchar](8) NULL,
  1137. [cDefine10] [nvarchar](60) NULL,
  1138. [cDefine11] [nvarchar](120) NULL,
  1139. [cDefine12] [nvarchar](120) NULL,
  1140. [cDefine13] [nvarchar](120) NULL,
  1141. [cDefine14] [nvarchar](120) NULL,
  1142. [cDefine15] [int] NULL,
  1143. [cDefine16] [float] NULL,
  1144. [ccloser] [nvarchar](20) NULL,
  1145. [iDiscountTaxType] [tinyint] NULL,
  1146. [iBillType] [tinyint] NOT NULL,
  1147. [cvouchtype] [nvarchar](10) NULL,
  1148. [cgeneralordercode] [nvarchar](300) NULL,
  1149. [ctmcode] [nvarchar](30) NULL,
  1150. [cincotermcode] [nvarchar](30) NULL,
  1151. [ctransordercode] [nvarchar](30) NULL,
  1152. [dportdate] [datetime] NULL,
  1153. [csportcode] [nvarchar](30) NULL,
  1154. [caportcode] [nvarchar](30) NULL,
  1155. [csvencode] [nvarchar](30) NULL,
  1156. [carrivalplace] [nvarchar](100) NULL,
  1157. [dclosedate] [datetime] NULL,
  1158. [idec] [int] NULL,
  1159. [bcal] [bit] NULL,
  1160. [guid] [nvarchar](50) NULL,
  1161. [cMakeTime] [datetime] NULL,
  1162. [cModifyTime] [datetime] NULL,
  1163. [cModifyDate] [datetime] NULL,
  1164. [cReviser] [nvarchar](40) NULL,
  1165. [iverifystate] [int] NULL,
  1166. [cAuditDate] [datetime] NULL,
  1167. [caudittime] [datetime] NULL,
  1168. [cverifier] [nvarchar](20) NULL,
  1169. [iverifystateex] [int] NULL,
  1170. [ireturncount] [int] NULL,
  1171. [IsWfControlled] [bit] NULL,
  1172. [cVenPUOMProtocol] [nvarchar](20) NULL,
  1173. [cchanger] [nvarchar](20) NULL,
  1174. [iflowid] [int] NULL,
  1175. [iPrintCount] [int] NULL,
  1176. [ccleanver] [nvarchar](50) NULL,
  1177. [cpocode] [nvarchar](64) NULL,
  1178. [csysbarcode] [nvarchar](60) NULL,
  1179. [cCurrentAuditor] [nvarchar](200) NULL)
  1180. go
  1181. CREATE TABLE [dbo].[PU_ArrivalVouchs](
  1182. [Autoid] [int] NOT NULL,
  1183. [ID] [int] NULL,
  1184. [cWhCode] [nvarchar](10) NULL,
  1185. [cInvCode] [nvarchar](60) NOT NULL,
  1186. [iNum] [decimal](20, 6) NULL,
  1187. [iQuantity] [decimal](20, 6) NOT NULL,
  1188. [iOriCost] [decimal](20, 6) NULL,
  1189. [iOriTaxCost] [decimal](20, 6) NULL,
  1190. [iOriMoney] [money] NULL,
  1191. [iOriTaxPrice] [money] NULL,
  1192. [iOriSum] [money] NULL,
  1193. [iCost] [decimal](20, 6) NULL,
  1194. [iMoney] [money] NULL,
  1195. [iTaxPrice] [money] NULL,
  1196. [iSum] [money] NULL,
  1197. [cFree1] [nvarchar](20) NULL,
  1198. [cFree2] [nvarchar](20) NULL,
  1199. [cFree3] [nvarchar](20) NULL,
  1200. [cFree4] [nvarchar](20) NULL,
  1201. [cFree5] [nvarchar](20) NULL,
  1202. [cFree6] [nvarchar](20) NULL,
  1203. [cFree7] [nvarchar](20) NULL,
  1204. [cFree8] [nvarchar](20) NULL,
  1205. [cFree9] [nvarchar](20) NULL,
  1206. [cFree10] [nvarchar](20) NULL,
  1207. [iTaxRate] [decimal](20, 6) NOT NULL,
  1208. [cDefine22] [nvarchar](60) NULL,
  1209. [cDefine23] [nvarchar](60) NULL,
  1210. [cDefine24] [nvarchar](60) NULL,
  1211. [cDefine25] [nvarchar](60) NULL,
  1212. [cDefine26] [float] NULL,
  1213. [cDefine27] [float] NULL,
  1214. [cDefine28] [nvarchar](120) NULL,
  1215. [cDefine29] [nvarchar](120) NULL,
  1216. [cDefine30] [nvarchar](120) NULL,
  1217. [cDefine31] [nvarchar](120) NULL,
  1218. [cDefine32] [nvarchar](120) NULL,
  1219. [cDefine33] [nvarchar](120) NULL,
  1220. [cDefine34] [int] NULL,
  1221. [cDefine35] [int] NULL,
  1222. [cDefine36] [datetime] NULL,
  1223. [cDefine37] [datetime] NULL,
  1224. [cItem_class] [nvarchar](2) NULL,
  1225. [cItemCode] [nvarchar](60) NULL,
  1226. [iPOsID] [int] NULL,
  1227. [cItemName] [nvarchar](255) NULL,
  1228. [cUnitID] [nvarchar](50) NULL,
  1229. [fValidInQuan] [decimal](20, 6) NULL,
  1230. [fKPQuantity] [decimal](20, 6) NULL,
  1231. [fRealQuantity] [decimal](20, 6) NULL,
  1232. [fValidQuantity] [decimal](20, 6) NULL,
  1233. [finValidQuantity] [decimal](20, 6) NULL,
  1234. [cCloser] [nvarchar](20) NULL,
  1235. [iCorId] [int] NULL,
  1236. [fRetQuantity] [decimal](20, 6) NULL,
  1237. [fInValidInQuan] [decimal](20, 6) NULL,
  1238. [bGsp] [tinyint] NULL,
  1239. [cBatch] [nvarchar](60) NULL,
  1240. [dVDate] [datetime] NULL,
  1241. [dPDate] [datetime] NULL,
  1242. [fRefuseQuantity] [decimal](20, 6) NULL,
  1243. [cGspState] [nvarchar](20) NULL,
  1244. [fValidNum] decimal(26,4) NULL,
  1245. [fValidInNum] decimal(26,4) NULL,
  1246. [fInValidNum] decimal(26,4) NULL,
  1247. [fRealNum] decimal(26,4) NULL,
  1248. [bTaxCost] [bit] NULL,
  1249. [bInspect] [tinyint] NULL,
  1250. [fRefuseNum] [decimal](20, 6) NULL,
  1251. [iPPartId] [int] NULL,
  1252. [iPQuantity] decimal(26,4) NULL,
  1253. [iPTOSeq] [int] NULL,
  1254. [SoDId] [nvarchar](50) NULL,
  1255. [SoType] [tinyint] NULL,
  1256. [ContractRowGUID] [uniqueidentifier] NULL,
  1257. [imassdate] [int] NULL,
  1258. [cmassunit] [tinyint] NULL,
  1259. [bexigency] [tinyint] NULL,
  1260. [cbcloser] [nvarchar](20) NULL,
  1261. [fSumRefuseQuantity] [decimal](20, 6) NULL,
  1262. [FSumRefuseNum] [decimal](20, 6) NULL,
  1263. [fRetNum] [decimal](20, 6) NULL,
  1264. [fDTQuantity] [decimal](20, 6) NULL,
  1265. [fInvalidInNum] [decimal](20, 6) NULL,
  1266. [fDegradeQuantity] [decimal](20, 6) NULL,
  1267. [fDegradeNum] [decimal](20, 6) NULL,
  1268. [fDegradeInQuantity] [decimal](20, 6) NULL,
  1269. [fDegradeInNum] [decimal](20, 6) NULL,
  1270. [fInspectQuantity] [decimal](20, 6) NULL,
  1271. [fInspectNum] [decimal](20, 6) NULL,
  1272. [iInvMPCost] [decimal](20, 6) NULL,
  1273. [guids] [nvarchar](50) NULL,
  1274. [iinvexchrate] [decimal](28, 8) NULL,
  1275. [objectid_source] [nvarchar](30) NULL,
  1276. [autoid_source] [int] NULL,
  1277. [ufts_source] [nvarchar](50) NULL,
  1278. [irowno_source] [int] NULL,
  1279. [csocode] [nvarchar](50) NULL,
  1280. [isorowno] [int] NULL,
  1281. [iorderid] [int] NULL,
  1282. [cordercode] [nvarchar](50) NULL,
  1283. [iorderrowno] [int] NULL,
  1284. [dlineclosedate] [datetime] NULL,
  1285. [ContractCode] [nvarchar](128) NULL,
  1286. [ContractRowNo] [nvarchar](150) NULL,
  1287. [RejectSource] [bit] NULL,
  1288. [iciqbookid] [int] NULL,
  1289. [cciqbookcode] [nvarchar](30) NULL,
  1290. [cciqcode] [nvarchar](30) NULL,
  1291. [fciqchangrate] decimal(20,6) NULL,
  1292. [irejectautoid] [int] NULL,
  1293. [iExpiratDateCalcu] [smallint] NULL,
  1294. [cExpirationdate] [nvarchar](20) NULL,
  1295. [dExpirationdate] [datetime] NULL,
  1296. [cupsocode] [nvarchar](120) NULL,
  1297. [iorderdid] [int] NULL,
  1298. [iordertype] [tinyint] NULL,
  1299. [csoordercode] [nvarchar](50) NULL,
  1300. [iorderseq] [int] NULL,
  1301. [cBatchProperty1] [decimal](38, 8) NULL,
  1302. [cBatchProperty2] [decimal](38, 8) NULL,
  1303. [cBatchProperty3] [decimal](38, 8) NULL,
  1304. [cBatchProperty4] [decimal](38, 8) NULL,
  1305. [cBatchProperty5] [decimal](38, 8) NULL,
  1306. [cBatchProperty6] [nvarchar](120) NULL,
  1307. [cBatchProperty7] [nvarchar](120) NULL,
  1308. [cBatchProperty8] [nvarchar](120) NULL,
  1309. [cBatchProperty9] [nvarchar](120) NULL,
  1310. [cBatchProperty10] [datetime] NULL,
  1311. [ivouchrowno] [int] NULL,
  1312. [irowno] [int] NULL,
  1313. [cbMemo] [nvarchar](255) NULL,
  1314. [cbsysbarcode] [nvarchar](80) NULL,
  1315. [carrivalcode] [nvarchar](80) NULL,
  1316. [ipickedquantity] [float] NULL,
  1317. [ipickednum] [float] NULL,
  1318. [iSourceMOCode] [nvarchar](60) NULL,
  1319. [iSourceMODetailsID] [int] NULL,
  1320. [freworkquantity] decimal(26,4) NULL,
  1321. [freworknum] decimal(26,4) NULL,
  1322. [fsumreworkquantity] decimal(26,4) NULL,
  1323. [fsumreworknum] decimal(26,4) NULL,
  1324. [iProductType] [tinyint] NULL,
  1325. [cMainInvCode] [nvarchar](60) NULL,
  1326. [iMainMoDetailsID] [int] NULL,
  1327. [PlanLotNumber] [nvarchar](40) NULL,
  1328. [bgift] [smallint] NULL,
  1329. [cFactoryCode] [nvarchar](50) NULL
  1330. )
  1331. go
  1332. CREATE TABLE [dbo].[DispatchList](
  1333. sysid int identity(1,1),
  1334. importdate datetime null default(getdate()),
  1335. processdate datetime null,
  1336. processflag bit default(0),
  1337. direction int default(0), --0:从U8到中间库,1:从旺店通到中间库
  1338. [DLID] [int] NOT NULL,
  1339. [cDLCode] [nvarchar](30) NULL,
  1340. [cVouchType] [nvarchar](2) NOT NULL,
  1341. [cSTCode] [nvarchar](2) NOT NULL,
  1342. [dDate] [datetime] NOT NULL,
  1343. [cRdCode] [nvarchar](5) NULL,
  1344. [cDepCode] [nvarchar](12) NOT NULL,
  1345. [cPersonCode] [nvarchar](20) NULL,
  1346. [SBVID] [int] NULL,
  1347. [cSBVCode] [nvarchar](255) NULL,
  1348. [cSOCode] [nvarchar](30) NULL,
  1349. [cCusCode] [nvarchar](20) NULL,
  1350. [cPayCode] [nvarchar](3) NULL,
  1351. [cSCCode] [nvarchar](2) NULL,
  1352. [cShipAddress] [nvarchar](255) NULL,
  1353. [cexch_name] [nvarchar](8) NOT NULL,
  1354. [iExchRate] [float] NOT NULL,
  1355. [iTaxRate] [float] NULL,
  1356. [bFirst] [bit] NOT NULL,
  1357. [bReturnFlag] [bit] NOT NULL,
  1358. [bSettleAll] [bit] NOT NULL,
  1359. [cMemo] [nvarchar](255) NULL,
  1360. [cSaleOut] [nvarchar](255) NULL,
  1361. [cDefine1] [nvarchar](20) NULL,
  1362. [cDefine2] [nvarchar](20) NULL,
  1363. [cDefine3] [nvarchar](20) NULL,
  1364. [cDefine4] [datetime] NULL,
  1365. [cDefine5] [int] NULL,
  1366. [cDefine6] [datetime] NULL,
  1367. [cDefine7] [float] NULL,
  1368. [cDefine8] [nvarchar](4) NULL,
  1369. [cDefine9] [nvarchar](8) NULL,
  1370. [cDefine10] [nvarchar](60) NULL,
  1371. [cVerifier] [nvarchar](20) NULL,
  1372. [cMaker] [nvarchar](20) NULL,
  1373. [iNetLock] [real] NULL,
  1374. [iSale] [smallint] NULL,
  1375. [cCusName] [nvarchar](120) NULL,
  1376. [iVTid] [int] NOT NULL,
  1377. [ufts] [timestamp] NULL,
  1378. [cBusType] [nvarchar](8) NULL,
  1379. [cCloser] [nvarchar](20) NULL,
  1380. [cAccounter] [nvarchar](20) NULL,
  1381. [cCreChpName] [nvarchar](20) NULL,
  1382. [cDefine11] [nvarchar](120) NULL,
  1383. [cDefine12] [nvarchar](120) NULL,
  1384. [cDefine13] [nvarchar](120) NULL,
  1385. [cDefine14] [nvarchar](120) NULL,
  1386. [cDefine15] [int] NULL,
  1387. [cDefine16] [float] NULL,
  1388. [bIAFirst] [bit] NULL,
  1389. [ioutgolden] [int] NULL,
  1390. [cgatheringplan] [nvarchar](20) NULL,
  1391. [dCreditStart] [datetime] NULL,
  1392. [dGatheringDate] [datetime] NULL,
  1393. [icreditdays] [int] NULL,
  1394. [bCredit] [bit] NULL,
  1395. [caddcode] [nvarchar](30) NULL,
  1396. [iverifystate] [int] NULL,
  1397. [ireturncount] [tinyint] NULL,
  1398. [iswfcontrolled] [tinyint] NULL,
  1399. [icreditstate] [varchar](20) NULL,
  1400. [bARFirst] [bit] NULL,
  1401. [cmodifier] [nvarchar](20) NULL,
  1402. [dmoddate] [datetime] NULL,
  1403. [dverifydate] [datetime] NULL,
  1404. [ccusperson] [nvarchar](100) NULL,
  1405. [dcreatesystime] [datetime] NULL,
  1406. [dverifysystime] [datetime] NULL,
  1407. [dmodifysystime] [datetime] NULL,
  1408. [csvouchtype] [nvarchar](10) NULL,
  1409. [iflowid] [int] NULL,
  1410. [bsigncreate] [bit] NULL,
  1411. [bcashsale] [bit] NULL,
  1412. [cgathingcode] [nvarchar](255) NULL,
  1413. [cChanger] [nvarchar](20) NULL,
  1414. [cChangeMemo] [nvarchar](255) NULL,
  1415. [outid] [uniqueidentifier] NULL,
  1416. [bmustbook] [bit] NULL,
  1417. [cBookDepcode] [nvarchar](12) NULL,
  1418. [cBookType] [nvarchar](10) NULL,
  1419. [bSaUsed] [bit] NULL,
  1420. [bneedbill] [bit] NULL,
  1421. [baccswitchflag] [bit] NULL,
  1422. [iPrintCount] [int] NULL,
  1423. [ccuspersoncode] [nvarchar](30) NULL,
  1424. [cSourceCode] [nvarchar](60) NULL,
  1425. [bsaleoutcreatebill] [bit] NULL,
  1426. [cSysBarCode] [nvarchar](60) NULL,
  1427. [cCurrentAuditor] [nvarchar](200) NULL,
  1428. [csscode] [nvarchar](3) NULL,
  1429. [cinvoicecompany] [nvarchar](20) NULL,
  1430. [fEBweight] [decimal](30, 9) NULL,
  1431. [cEBweightUnit] [nvarchar](50) NULL,
  1432. [cEBExpressCode] [nvarchar](50) NULL,
  1433. [iEBExpressCoID] [bigint] NULL,
  1434. [SeparateID] [int] NULL,
  1435. [bNotToGoldTax] [tinyint] NULL,
  1436. [cEBTrnumber] [nvarchar](80) NULL,
  1437. [cEBBuyer] [nvarchar](2000) NULL,
  1438. [cEBBuyerNote] [nvarchar](4000) NULL,
  1439. [ccontactname] [nvarchar](255) NULL,
  1440. [cEBprovince] [nvarchar](20) NULL,
  1441. [cEBcity] [nvarchar](20) NULL,
  1442. [cEBdistrict] [nvarchar](60) NULL,
  1443. [cmobilephone] [nvarchar](50) NULL,
  1444. [cInvoiceCusName] [nvarchar](255) NULL,
  1445. [cweighter] [nvarchar](40) NULL,
  1446. [dweighttime] [datetime] NULL,
  1447. [cPickVouchCode] [nvarchar](255) NULL,
  1448. [cGCRouteCode] [nvarchar](10) NULL
  1449. )
  1450. go
  1451. CREATE TABLE [dbo].[DispatchLists](
  1452. [AutoID] [int] IDENTITY(1,1) NOT NULL,
  1453. [DLID] [int] NOT NULL,
  1454. [iCorID] [int] NULL,
  1455. [cWhCode] [nvarchar](10) NULL,
  1456. [cInvCode] [nvarchar](60) NULL,
  1457. [iQuantity] [decimal](30, 10) NULL,
  1458. [iNum] [decimal](30, 10) NULL,
  1459. [iQuotedPrice] [decimal](30, 10) NULL,
  1460. [iUnitPrice] [decimal](30, 10) NULL,
  1461. [iTaxUnitPrice] [decimal](30, 10) NULL,
  1462. [iMoney] [money] NULL,
  1463. [iTax] [money] NULL,
  1464. [iSum] [money] NULL,
  1465. [iDisCount] [money] NULL,
  1466. [iNatUnitPrice] [decimal](30, 10) NULL,
  1467. [iNatMoney] [money] NULL,
  1468. [iNatTax] [money] NULL,
  1469. [iNatSum] [money] NULL,
  1470. [iNatDisCount] [money] NULL,
  1471. [iSettleNum] [decimal](30, 10) NULL,
  1472. [iSettleQuantity] [decimal](30, 10) NULL,
  1473. [iBatch] [int] NULL,
  1474. [cBatch] [nvarchar](60) NULL,
  1475. [bSettleAll] [bit] NOT NULL,
  1476. [cMemo] [nvarchar](255) NULL,
  1477. [cFree1] [nvarchar](20) NULL,
  1478. [cFree2] [nvarchar](20) NULL,
  1479. [iTB] [tinyint] NULL,
  1480. [dvDate] [datetime] NULL,
  1481. [TBQuantity] [decimal](26, 9) NULL,
  1482. [TBNum] [decimal](26, 9) NULL,
  1483. [iSOsID] [int] NULL,
  1484. [iDLsID] [int] NOT NULL,
  1485. [KL] [decimal](30, 10) NULL,
  1486. [KL2] [decimal](30, 10) NULL,
  1487. [cInvName] [nvarchar](255) NULL,
  1488. [iTaxRate] [decimal](30, 10) NULL,
  1489. [cDefine22] [nvarchar](60) NULL,
  1490. [cDefine23] [nvarchar](60) NULL,
  1491. [cDefine24] [nvarchar](60) NULL,
  1492. [cDefine25] [nvarchar](60) NULL,
  1493. [cDefine26] [float] NULL,
  1494. [cDefine27] [float] NULL,
  1495. [fOutQuantity] [decimal](30, 10) NULL,
  1496. [fOutNum] [decimal](30, 10) NULL,
  1497. [cItemCode] [nvarchar](60) NULL,
  1498. [cItem_class] [nvarchar](10) NULL,
  1499. [fSaleCost] [decimal](30, 10) NULL,
  1500. [fSalePrice] [decimal](30, 10) NULL,
  1501. [cVenAbbName] [nvarchar](60) NULL,
  1502. [cItemName] [nvarchar](255) NULL,
  1503. [cItem_CName] [nvarchar](20) NULL,
  1504. [cFree3] [nvarchar](20) NULL,
  1505. [cFree4] [nvarchar](20) NULL,
  1506. [cFree5] [nvarchar](20) NULL,
  1507. [cFree6] [nvarchar](20) NULL,
  1508. [cFree7] [nvarchar](20) NULL,
  1509. [cFree8] [nvarchar](20) NULL,
  1510. [cFree9] [nvarchar](20) NULL,
  1511. [cFree10] [nvarchar](20) NULL,
  1512. [bIsSTQc] [bit] NULL,
  1513. [iInvExchRate] decimal(26,4) NULL,
  1514. [cUnitID] [nvarchar](35) NULL,
  1515. [cCode] [nvarchar](30) NULL,
  1516. [iRetQuantity] decimal(26,4) NULL,
  1517. [fEnSettleQuan] decimal(26,4) NULL,
  1518. [fEnSettleSum] [money] NULL,
  1519. [iSettlePrice] [decimal](30, 10) NULL,
  1520. [cDefine28] [nvarchar](120) NULL,
  1521. [cDefine29] [nvarchar](120) NULL,
  1522. [cDefine30] [nvarchar](120) NULL,
  1523. [cDefine31] [nvarchar](120) NULL,
  1524. [cDefine32] [nvarchar](120) NULL,
  1525. [cDefine33] [nvarchar](120) NULL,
  1526. [cDefine34] [int] NULL,
  1527. [cDefine35] [int] NULL,
  1528. [cDefine36] [datetime] NULL,
  1529. [cDefine37] [datetime] NULL,
  1530. [dMDate] [datetime] NULL,
  1531. [bGsp] [bit] NULL,
  1532. [cGspState] [nvarchar](20) NULL,
  1533. [cSoCode] [nvarchar](30) NULL,
  1534. [cCorCode] [nvarchar](30) NULL,
  1535. [iPPartSeqID] [int] NULL,
  1536. [iPPartID] [int] NULL,
  1537. [iPPartQty] decimal(26,4) NULL,
  1538. [cContractID] [nvarchar](64) NULL,
  1539. [cContractTagCode] [nvarchar](150) NULL,
  1540. [cContractRowGuid] [uniqueidentifier] ROWGUIDCOL NULL,
  1541. [iMassDate] [int] NULL,
  1542. [cMassUnit] [smallint] NULL,
  1543. [bQANeedCheck] [bit] NOT NULL,
  1544. [bQAUrgency] [bit] NOT NULL,
  1545. [bQAChecking] [bit] NOT NULL,
  1546. [bQAChecked] [bit] NOT NULL,
  1547. [iQAQuantity] [decimal](30, 10) NULL,
  1548. [iQANum] [decimal](30, 10) NULL,
  1549. [cCusInvCode] [nvarchar](60) NULL,
  1550. [cCusInvName] [nvarchar](100) NULL,
  1551. [fsumsignquantity] [decimal](26, 9) NULL,
  1552. [fsumsignnum] [decimal](26, 9) NULL,
  1553. [cbaccounter] [nvarchar](30) NULL,
  1554. [bcosting] [bit] NOT NULL,
  1555. [cordercode] [nvarchar](30) NULL,
  1556. [iorderrowno] [bigint] NULL,
  1557. [fcusminprice] [decimal](26, 9) NULL,
  1558. [icostquantity] [decimal](26, 9) NULL,
  1559. [icostsum] [money] NULL,
  1560. [ispecialtype] [tinyint] NULL,
  1561. [cvmivencode] [nvarchar](20) NULL,
  1562. [iexchsum] [money] NULL,
  1563. [imoneysum] [money] NULL,
  1564. [irowno] [bigint] NULL,
  1565. [frettbquantity] [decimal](26, 9) NULL,
  1566. [fretsum] [decimal](26, 9) NULL,
  1567. [iExpiratDateCalcu] [smallint] NULL,
  1568. [dExpirationdate] [datetime] NULL,
  1569. [cExpirationdate] [nvarchar](20) NULL,
  1570. [cbatchproperty1] [decimal](38, 8) NULL,
  1571. [cbatchproperty2] [decimal](38, 8) NULL,
  1572. [cbatchproperty3] [decimal](38, 8) NULL,
  1573. [cbatchproperty4] [decimal](38, 8) NULL,
  1574. [cbatchproperty5] [decimal](38, 8) NULL,
  1575. [cbatchproperty6] [nvarchar](120) NULL,
  1576. [cbatchproperty7] [nvarchar](120) NULL,
  1577. [cbatchproperty8] [nvarchar](120) NULL,
  1578. [cbatchproperty9] [nvarchar](120) NULL,
  1579. [cbatchproperty10] [datetime] NULL,
  1580. [dblPreExchMomey] [decimal](29, 6) NULL,
  1581. [dblPreMomey] [decimal](29, 6) NULL,
  1582. [idemandtype] [smallint] NULL,
  1583. [cdemandcode] [nvarchar](40) NULL,
  1584. [cdemandmemo] [nvarchar](300) NULL,
  1585. [cdemandid] [nvarchar](30) NULL,
  1586. [idemandseq] [bigint] NULL,
  1587. [cvencode] [nvarchar](20) NULL,
  1588. [cReasonCode] [nvarchar](10) NULL,
  1589. [cInvSN] [nvarchar](200) NULL,
  1590. [iInvSNCount] [int] NULL,
  1591. [bneedsign] [bit] NULL,
  1592. [bsignover] [bit] NULL,
  1593. [bneedloss] [bit] NULL,
  1594. [flossrate] [decimal](29, 6) NULL,
  1595. [frlossqty] [decimal](29, 6) NULL,
  1596. [fulossqty] [decimal](29, 6) NULL,
  1597. [isettletype] [smallint] NULL,
  1598. [crelacuscode] [nvarchar](20) NULL,
  1599. [cLossMaker] [nvarchar](20) NULL,
  1600. [dLossDate] [datetime] NULL,
  1601. [dLossTime] [datetime] NULL,
  1602. [icoridlsid] [bigint] NULL,
  1603. [fretoutqty] [decimal](29, 6) NULL,
  1604. [body_outid] [uniqueidentifier] NULL,
  1605. [fVeriBillQty] [decimal](26, 9) NULL,
  1606. [fVeriBillSum] [money] NULL,
  1607. [fVeriRetQty] [decimal](26, 9) NULL,
  1608. [fVeriRetSum] [money] NULL,
  1609. [fLastSettleQty] [decimal](26, 9) NULL,
  1610. [fLastSettleSum] [money] NULL,
  1611. [cBookWhcode] [nvarchar](10) NULL,
  1612. [cInVouchType] [nvarchar](2) NULL,
  1613. [cPosition] [nvarchar](20) NULL,
  1614. [fretqtywkp] [decimal](26, 9) NULL,
  1615. [fretqtyykp] [decimal](26, 9) NULL,
  1616. [frettbqtyykp] [decimal](26, 9) NULL,
  1617. [fretsumykp] [decimal](26, 9) NULL,
  1618. [dkeepdate] [datetime] NULL,
  1619. [cSCloser] [nvarchar](20) NULL,
  1620. [isaleoutid] [bigint] NULL,
  1621. [bsaleprice] [bit] NULL,
  1622. [bgift] [bit] NULL,
  1623. [bmpforderclosed] [bit] NULL,
  1624. [cbSysBarCode] [nvarchar](80) NULL,
  1625. [fxjquantity] [float] NULL,
  1626. [fxjnum] [float] NULL,
  1627. [bIAcreatebill] [bit] NULL,
  1628. [cParentCode] [nvarchar](50) NULL,
  1629. [cChildCode] [nvarchar](50) NULL,
  1630. [fchildqty] [decimal](30, 9) NULL,
  1631. [fchildrate] [decimal](30, 9) NULL,
  1632. [iCalcType] [tinyint] NULL,
  1633. [fappretwkpqty] [decimal](30, 9) NULL,
  1634. [fappretwkpsum] [decimal](30, 9) NULL,
  1635. [fappretykpqty] [decimal](30, 9) NULL,
  1636. [fappretykpsum] [decimal](30, 9) NULL,
  1637. [fappretwkptbqty] [decimal](30, 9) NULL,
  1638. [fappretykptbqty] [decimal](30, 9) NULL,
  1639. [irtnappid] [bigint] NULL,
  1640. [crtnappcode] [nvarchar](30) NULL,
  1641. [fretailrealamount] [decimal](26, 9) NULL,
  1642. [fretailsettleamount] [decimal](26, 9) NULL,
  1643. [cFactoryCode] [nvarchar](50) NULL,
  1644. [GCSourceId] [int] NULL,
  1645. [GCSourceIds] [int] NULL)
  1646. go
  1647. CREATE TABLE [dbo].[SO_SOMain](
  1648. sysid int identity(1,1),
  1649. importdate datetime null default(getdate()),
  1650. processdate datetime null,
  1651. processflag bit default(0),
  1652. direction int default(0), --0:从U8到中间库,1:从旺店通到中间库
  1653. [cSTCode] [nvarchar](2) NOT NULL,
  1654. [dDate] [datetime] NOT NULL,
  1655. [cSOCode] [nvarchar](30) NULL,
  1656. [cCusCode] [nvarchar](20) NULL,
  1657. [cDepCode] [nvarchar](12) NOT NULL,
  1658. [cPersonCode] [nvarchar](20) NULL,
  1659. [cSCCode] [nvarchar](2) NULL,
  1660. [cCusOAddress] [nvarchar](255) NULL,
  1661. [cPayCode] [nvarchar](3) NULL,
  1662. [cexch_name] [nvarchar](8) NOT NULL,
  1663. [iExchRate] [float] NULL,
  1664. [iTaxRate] [float] NULL,
  1665. [iMoney] [money] NULL,
  1666. [cMemo] [nvarchar](255) NULL,
  1667. [iStatus] [tinyint] NULL,
  1668. [cMaker] [nvarchar](20) NULL,
  1669. [cVerifier] [nvarchar](20) NULL,
  1670. [cCloser] [nvarchar](20) NULL,
  1671. [bDisFlag] [bit] NULL,
  1672. [cDefine1] [nvarchar](20) NULL,
  1673. [cDefine2] [nvarchar](20) NULL,
  1674. [cDefine3] [nvarchar](20) NULL,
  1675. [cDefine4] [datetime] NULL,
  1676. [cDefine5] [int] NULL,
  1677. [cDefine6] [datetime] NULL,
  1678. [cDefine7] [float] NULL,
  1679. [cDefine8] [nvarchar](4) NULL,
  1680. [cDefine9] [nvarchar](8) NULL,
  1681. [cDefine10] [nvarchar](60) NULL,
  1682. [bReturnFlag] [bit] NOT NULL,
  1683. [cCusName] [nvarchar](120) NULL,
  1684. [bOrder] [bit] NULL,
  1685. [ID] [int] NOT NULL,
  1686. [iVTid] [int] NOT NULL,
  1687. [ufts] [timestamp] NULL,
  1688. [cChanger] [nvarchar](20) NULL,
  1689. [cBusType] [nvarchar](8) NOT NULL,
  1690. [cCreChpName] [nvarchar](20) NULL,
  1691. [cDefine11] [nvarchar](120) NULL,
  1692. [cDefine12] [nvarchar](120) NULL,
  1693. [cDefine13] [nvarchar](120) NULL,
  1694. [cDefine14] [nvarchar](120) NULL,
  1695. [cDefine15] [int] NULL,
  1696. [cDefine16] [float] NULL,
  1697. [coppcode] [nvarchar](60) NULL,
  1698. [cLocker] [nvarchar](20) NULL,
  1699. [dPreMoDateBT] [datetime] NULL,
  1700. [dPreDateBT] [datetime] NULL,
  1701. [cgatheringplan] [nvarchar](20) NULL,
  1702. [caddcode] [nvarchar](30) NULL,
  1703. [iverifystate] [int] NULL,
  1704. [ireturncount] [tinyint] NULL,
  1705. [iswfcontrolled] [tinyint] NULL,
  1706. [icreditstate] [varchar](20) NULL,
  1707. [cmodifier] [nvarchar](20) NULL,
  1708. [dmoddate] [datetime] NULL,
  1709. [dverifydate] [datetime] NULL,
  1710. [ccusperson] [nvarchar](100) NULL,
  1711. [dcreatesystime] [datetime] NULL,
  1712. [dverifysystime] [datetime] NULL,
  1713. [dmodifysystime] [datetime] NULL,
  1714. [iflowid] [int] NULL,
  1715. [bcashsale] [bit] NULL,
  1716. [cgathingcode] [nvarchar](255) NULL,
  1717. [cChangeVerifier] [nvarchar](20) NULL,
  1718. [dChangeVerifyDate] [datetime] NULL,
  1719. [dChangeVerifyTime] [datetime] NULL,
  1720. [outid] [uniqueidentifier] NULL,
  1721. [ccuspersoncode] [nvarchar](30) NULL,
  1722. [dclosedate] [datetime] NULL,
  1723. [dclosesystime] [datetime] NULL,
  1724. [iPrintCount] [float] NULL,
  1725. [fbookratio] [float] NULL,
  1726. [bmustbook] [bit] NULL,
  1727. [fbooksum] [money] NULL,
  1728. [fbooknatsum] [money] NULL,
  1729. [fgbooksum] [money] NULL,
  1730. [fgbooknatsum] [money] NULL,
  1731. [csvouchtype] [nvarchar](10) NULL,
  1732. [cCrmPersonCode] [nvarchar](255) NULL,
  1733. [cCrmPersonName] [nvarchar](255) NULL,
  1734. [cMainPersonCode] [nvarchar](255) NULL,
  1735. [cSysBarCode] [nvarchar](60) NULL,
  1736. [ioppid] [int] NULL,
  1737. [optnty_name] [nvarchar](255) NULL,
  1738. [cCurrentAuditor] [nvarchar](200) NULL,
  1739. [contract_status] [smallint] NULL,
  1740. [csscode] [nvarchar](3) NULL,
  1741. [cinvoicecompany] [nvarchar](20) NULL,
  1742. [cAttachment] [nvarchar](255) NULL,
  1743. [cEBTrnumber] [nvarchar](80) NULL,
  1744. [cEBBuyer] [nvarchar](2000) NULL,
  1745. [cEBBuyerNote] [nvarchar](4000) NULL,
  1746. [ccontactname] [nvarchar](255) NULL,
  1747. [cEBprovince] [nvarchar](20) NULL,
  1748. [cEBcity] [nvarchar](20) NULL,
  1749. [cEBdistrict] [nvarchar](60) NULL,
  1750. [cmobilephone] [nvarchar](50) NULL,
  1751. [cInvoiceCusName] [nvarchar](255) NULL,
  1752. [cGCRouteCode] [nvarchar](10) NULL)
  1753. go
  1754. CREATE TABLE [dbo].[SO_SODetails](
  1755. [AutoID] [int] IDENTITY(1,1) NOT NULL,
  1756. [cSOCode] [nvarchar](30) NULL,
  1757. [cInvCode] [nvarchar](60) NULL,
  1758. [dPreDate] [datetime] NULL,
  1759. [iQuantity] [decimal](30, 10) NULL,
  1760. [iNum] [decimal](30, 10) NULL,
  1761. [iQuotedPrice] [decimal](30, 10) NULL,
  1762. [iUnitPrice] [decimal](30, 10) NULL,
  1763. [iTaxUnitPrice] [decimal](30, 10) NULL,
  1764. [iMoney] [money] NULL,
  1765. [iTax] [money] NULL,
  1766. [iSum] [money] NULL,
  1767. [iDisCount] [money] NULL,
  1768. [iNatUnitPrice] [decimal](30, 10) NULL,
  1769. [iNatMoney] [money] NULL,
  1770. [iNatTax] [money] NULL,
  1771. [iNatSum] [money] NULL,
  1772. [iNatDisCount] [money] NULL,
  1773. [iFHNum] [decimal](30, 10) NULL,
  1774. [iFHQuantity] [decimal](30, 10) NULL,
  1775. [iFHMoney] [money] NULL,
  1776. [iKPQuantity] [decimal](30, 10) NULL,
  1777. [iKPNum] [decimal](30, 10) NULL,
  1778. [iKPMoney] [money] NULL,
  1779. [cMemo] [nvarchar](255) NULL,
  1780. [cFree1] [nvarchar](20) NULL,
  1781. [cFree2] [nvarchar](20) NULL,
  1782. [bFH] [int] NULL,
  1783. [iSOsID] [int] NOT NULL,
  1784. [KL] [decimal](30, 10) NULL,
  1785. [KL2] [decimal](30, 10) NULL,
  1786. [cInvName] [nvarchar](255) NULL,
  1787. [iTaxRate] [decimal](30, 10) NULL,
  1788. [cDefine22] [nvarchar](60) NULL,
  1789. [cDefine23] [nvarchar](60) NULL,
  1790. [cDefine24] [nvarchar](60) NULL,
  1791. [cDefine25] [nvarchar](60) NULL,
  1792. [cDefine26] [float] NULL,
  1793. [cDefine27] [float] NULL,
  1794. [cItemCode] [nvarchar](60) NULL,
  1795. [cItem_class] [nvarchar](10) NULL,
  1796. [cItemName] [nvarchar](255) NULL,
  1797. [cItem_CName] [nvarchar](20) NULL,
  1798. [cFree3] [nvarchar](20) NULL,
  1799. [cFree4] [nvarchar](20) NULL,
  1800. [cFree5] [nvarchar](20) NULL,
  1801. [cFree6] [nvarchar](20) NULL,
  1802. [cFree7] [nvarchar](20) NULL,
  1803. [cFree8] [nvarchar](20) NULL,
  1804. [cFree9] [nvarchar](20) NULL,
  1805. [cFree10] [nvarchar](20) NULL,
  1806. [iInvExchRate] decimal(26,4) NULL,
  1807. [cUnitID] [nvarchar](35) NULL,
  1808. [ID] [int] NULL,
  1809. [cDefine28] [nvarchar](120) NULL,
  1810. [cDefine29] [nvarchar](120) NULL,
  1811. [cDefine30] [nvarchar](120) NULL,
  1812. [cDefine31] [nvarchar](120) NULL,
  1813. [cDefine32] [nvarchar](120) NULL,
  1814. [cDefine33] [nvarchar](120) NULL,
  1815. [cDefine34] [int] NULL,
  1816. [cDefine35] [int] NULL,
  1817. [cDefine36] [datetime] NULL,
  1818. [cDefine37] [datetime] NULL,
  1819. [FPurQuan] decimal(26,4) NULL,
  1820. [fSaleCost] [decimal](30, 10) NULL,
  1821. [fSalePrice] [decimal](30, 10) NULL,
  1822. [cQuoCode] [nvarchar](30) NULL,
  1823. [iQuoID] [int] NULL,
  1824. [cSCloser] [nvarchar](20) NULL,
  1825. [dPreMoDate] [datetime] NULL,
  1826. [iRowNo] [int] NULL,
  1827. [iCusBomID] [int] NULL,
  1828. [iMoQuantity] decimal(26,4) NULL,
  1829. [cContractID] [nvarchar](64) NULL,
  1830. [cContractTagCode] [nvarchar](150) NULL,
  1831. [cContractRowGuid] [uniqueidentifier] ROWGUIDCOL NULL,
  1832. [iPPartSeqID] [int] NULL,
  1833. [iPPartID] [int] NULL,
  1834. [iPPartQty] decimal(26,4) NULL,
  1835. [cCusInvCode] [nvarchar](60) NULL,
  1836. [cCusInvName] [nvarchar](100) NULL,
  1837. [iPreKeepQuantity] decimal(26,4) NULL,
  1838. [iPreKeepNum] decimal(26,4) NULL,
  1839. [iPreKeepTotQuantity] decimal(26,4) NULL,
  1840. [iPreKeepTotNum] decimal(26,4) NULL,
  1841. [dreleasedate] [datetime] NULL,
  1842. [fcusminprice] [decimal](26, 9) NULL,
  1843. [fimquantity] [decimal](26, 9) NULL,
  1844. [fomquantity] [decimal](26, 9) NULL,
  1845. [ballpurchase] [bit] NULL,
  1846. [finquantity] [decimal](26, 9) NULL,
  1847. [icostquantity] [decimal](26, 9) NULL,
  1848. [icostsum] [money] NULL,
  1849. [foutquantity] [decimal](26, 9) NULL,
  1850. [foutnum] [decimal](26, 9) NULL,
  1851. [iexchsum] [money] NULL,
  1852. [imoneysum] [money] NULL,
  1853. [dufts] [timestamp] NULL,
  1854. [iaoids] [int] NULL,
  1855. [cpreordercode] [nvarchar](30) NULL,
  1856. [fretquantity] [decimal](29, 6) NULL,
  1857. [fretnum] [decimal](29, 6) NULL,
  1858. [dbclosedate] [datetime] NULL,
  1859. [dbclosesystime] [datetime] NULL,
  1860. [bOrderBOM] [bit] NULL,
  1861. [bOrderBOMOver] [tinyint] NULL,
  1862. [idemandtype] [smallint] NULL,
  1863. [cdemandcode] [nvarchar](40) NULL,
  1864. [cdemandmemo] [nvarchar](300) NULL,
  1865. [fPurSum] [decimal](26, 9) NULL,
  1866. [fPurBillQty] [decimal](26, 9) NULL,
  1867. [fPurBillSum] [decimal](26, 9) NULL,
  1868. [iimid] [bigint] NULL,
  1869. [ccorvouchtype] [nvarchar](10) NULL,
  1870. [icorrowno] [int] NULL,
  1871. [busecusbom] [bit] NULL,
  1872. [body_outid] [uniqueidentifier] NULL,
  1873. [fVeriDispQty] [decimal](26, 9) NULL,
  1874. [fVeriDispSum] [money] NULL,
  1875. [bsaleprice] [bit] NULL,
  1876. [bgift] [bit] NULL,
  1877. [forecastdid] [int] NULL,
  1878. [cdetailsdemandcode] [nvarchar](40) NULL,
  1879. [cdetailsdemandmemo] [nvarchar](300) NULL,
  1880. [fTransedQty] [decimal](30, 10) NULL,
  1881. [cbSysBarCode] [nvarchar](80) NULL,
  1882. [fappqty] [decimal](30, 9) NULL,
  1883. [cParentCode] [nvarchar](50) NULL,
  1884. [cChildCode] [nvarchar](50) NULL,
  1885. [fchildqty] [decimal](30, 9) NULL,
  1886. [fchildrate] [decimal](30, 9) NULL,
  1887. [iCalcType] [tinyint] NULL,
  1888. [iCurPartid] [bigint] NULL,
  1889. [cFactoryCode] [nvarchar](50) NULL,
  1890. [GCSourceId] [int] NULL,
  1891. [GCSourceIds] [int] NULL)
  1892. go
  1893. CREATE TABLE [dbo].[Customer](
  1894. sysid int identity(1,1),
  1895. importdate datetime null default(getdate()),
  1896. processdate datetime null,
  1897. processflag bit default(0),
  1898. direction int default(0), --0:从U8到中间库,1:从旺店通到中间库
  1899. [cCusCode] [nvarchar](20) NOT NULL,
  1900. [cCusName] [nvarchar](98) NULL,
  1901. [cCusAbbName] [nvarchar](60) NOT NULL,
  1902. [cCCCode] [nvarchar](12) NULL,
  1903. [cDCCode] [nvarchar](12) NULL,
  1904. [cTrade] [nvarchar](50) NULL,
  1905. [cCusAddress] [nvarchar](255) NULL,
  1906. [cCusPostCode] [nvarchar](20) NULL,
  1907. [cCusRegCode] [nvarchar](50) NULL,
  1908. [cCusBank] [nvarchar](100) NULL,
  1909. [cCusAccount] [nvarchar](50) NULL,
  1910. [dCusDevDate] [datetime] NULL,
  1911. [cCusLPerson] [nvarchar](100) NULL,
  1912. [cCusEmail] [nvarchar](100) NULL,
  1913. [cCusPerson] [nvarchar](50) NULL,
  1914. [cCusPhone] [nvarchar](100) NULL,
  1915. [cCusFax] [nvarchar](100) NULL,
  1916. [cCusBP] [nvarchar](20) NULL,
  1917. [cCusHand] [nvarchar](100) NULL,
  1918. [cCusPPerson] [nvarchar](20) NULL,
  1919. [iCusDisRate] [float] NULL,
  1920. [cCusCreGrade] [nvarchar](6) NULL,
  1921. [iCusCreLine] [float] NULL,
  1922. [iCusCreDate] [int] NULL,
  1923. [cCusPayCond] [nvarchar](20) NULL,
  1924. [cCusOAddress] [nvarchar](255) NULL,
  1925. [cCusOType] [nvarchar](10) NULL,
  1926. [cCusHeadCode] [nvarchar](20) NULL,
  1927. [cCusWhCode] [nvarchar](10) NULL,
  1928. [cCusDepart] [nvarchar](12) NULL,
  1929. [iARMoney] [float] NULL,
  1930. [dLastDate] [datetime] NULL,
  1931. [iLastMoney] [float] NULL,
  1932. [dLRDate] [datetime] NULL,
  1933. [iLRMoney] [float] NULL,
  1934. [dEndDate] [datetime] NULL,
  1935. [iFrequency] [int] NULL,
  1936. [cCusDefine1] [nvarchar](20) NULL,
  1937. [cCusDefine2] [nvarchar](20) NULL,
  1938. [cCusDefine3] [nvarchar](20) NULL,
  1939. [iCostGrade] [smallint] NULL,
  1940. [cCreatePerson] [nvarchar](20) NULL,
  1941. [cModifyPerson] [nvarchar](20) NULL,
  1942. [dModifyDate] [datetime] NULL,
  1943. [cRelVendor] [nvarchar](20) NULL,
  1944. [iId] [nvarchar](40) NULL,
  1945. [cPriceGroup] [nvarchar](20) NULL,
  1946. [cOfferGrade] [nvarchar](20) NULL,
  1947. [iOfferRate] [float] NULL,
  1948. [cCusDefine4] [nvarchar](60) NULL,
  1949. [cCusDefine5] [nvarchar](60) NULL,
  1950. [cCusDefine6] [nvarchar](60) NULL,
  1951. [cCusDefine7] [nvarchar](120) NULL,
  1952. [cCusDefine8] [nvarchar](120) NULL,
  1953. [cCusDefine9] [nvarchar](120) NULL,
  1954. [cCusDefine10] [nvarchar](120) NULL,
  1955. [cCusDefine11] [int] NULL,
  1956. [cCusDefine12] [int] NULL,
  1957. [cCusDefine13] [float] NULL,
  1958. [cCusDefine14] [float] NULL,
  1959. [cCusDefine15] [datetime] NULL,
  1960. [cCusDefine16] [datetime] NULL,
  1961. [pubufts] [timestamp] NULL,
  1962. [cInvoiceCompany] [nvarchar](60) NULL,
  1963. [bCredit] [bit] NOT NULL,
  1964. [bCreditDate] [bit] NOT NULL,
  1965. [bCreditByHead] [bit] NOT NULL,
  1966. [bLicenceDate] [bit] NOT NULL,
  1967. [dLicenceSDate] [datetime] NULL,
  1968. [dLicenceEDate] [datetime] NULL,
  1969. [iLicenceADays] [int] NULL,
  1970. [bBusinessDate] [bit] NOT NULL,
  1971. [dBusinessSDate] [datetime] NULL,
  1972. [dBusinessEDate] [datetime] NULL,
  1973. [iBusinessADays] [int] NULL,
  1974. [bProxy] [bit] NOT NULL,
  1975. [dProxySDate] [datetime] NULL,
  1976. [dProxyEDate] [datetime] NULL,
  1977. [iProxyADays] [int] NULL,
  1978. [cMemo] [nvarchar](1000) NULL,
  1979. [bLimitSale] [bit] NOT NULL,
  1980. [cCusContactCode] [uniqueidentifier] NULL,
  1981. [cCusCountryCode] [nvarchar](10) NULL,
  1982. [cCusEnName] [nvarchar](100) NULL,
  1983. [cCusEnAddr1] [nvarchar](60) NULL,
  1984. [cCusEnAddr2] [nvarchar](60) NULL,
  1985. [cCusEnAddr3] [nvarchar](60) NULL,
  1986. [cCusEnAddr4] [nvarchar](60) NULL,
  1987. [cCusPortCode] [nvarchar](10) NULL,
  1988. [cPrimaryVen] [nvarchar](20) NULL,
  1989. [fCommisionRate] [float] NULL,
  1990. [fInsueRate] [float] NULL,
  1991. [bHomeBranch] [bit] NOT NULL,
  1992. [cBranchAddr] [nvarchar](255) NULL,
  1993. [cBranchPhone] [nvarchar](100) NULL,
  1994. [cBranchPerson] [nvarchar](50) NULL,
  1995. [cCusTradeCCode] [nvarchar](12) NULL,
  1996. [CustomerKCode] [nvarchar](4) NULL,
  1997. [bCusState] [bit] NOT NULL,
  1998. [bShop] [smallint] NULL,
  1999. [cCusBankCode] [nvarchar](50) NULL,
  2000. [cCusExch_name] [nvarchar](50) NULL,
  2001. [iCusGSPType] [smallint] NOT NULL,
  2002. [iCusGSPAuth] [smallint] NULL,
  2003. [cCusGSPAuthNo] [nvarchar](120) NULL,
  2004. [cCusBusinessNo] [nvarchar](120) NULL,
  2005. [cCusLicenceNo] [nvarchar](20) NULL,
  2006. [bCusDomestic] [bit] NOT NULL,
  2007. [bCusOverseas] [bit] NOT NULL,
  2008. [cCusCreditCompany] [nvarchar](20) NULL,
  2009. [cCusSAProtocol] [nvarchar](20) NULL,
  2010. [cCusExProtocol] [nvarchar](20) NULL,
  2011. [cCusOtherProtocol] [nvarchar](20) NULL,
  2012. [fCusDiscountRate] [float] NULL,
  2013. [cCusSSCode] [nvarchar](20) NULL,
  2014. [cCusCMProtocol] [nvarchar](20) NULL,
  2015. [dCusCreateDatetime] [datetime] NOT NULL,
  2016. [cCusAppDocNo] [nvarchar](50) NULL,
  2017. [cCusMnemCode] [nvarchar](98) NULL,
  2018. [fAdvancePaymentRatio] [float] NULL,
  2019. [bServiceAttribute] [bit] NOT NULL,
  2020. [bRequestSign] [bit] NOT NULL,
  2021. [bOnGPinStore] [bit] NULL,
  2022. [cCusMngTypeCode] [nvarchar](32) NULL,
  2023. [account_type] [numeric](22, 0) NULL,
  2024. [cCusImAgentProtocol] [nvarchar](20) NULL,
  2025. [iSourceType] [smallint] NULL,
  2026. [iSourceId] [varchar](20) NULL,
  2027. [fExpense] [float] NULL,
  2028. [fApprovedExpense] [float] NULL,
  2029. [dTouchedTime] [datetime] NULL,
  2030. [dRecentlyInvoiceTime] [datetime] NULL,
  2031. [dRecentlyQuoteTime] [datetime] NULL,
  2032. [dRecentlyActivityTime] [datetime] NULL,
  2033. [dRecentlyChanceTime] [datetime] NULL,
  2034. [dRecentlyContractTime] [datetime] NULL,
  2035. [cLtcCustomerCode] [nvarchar](100) NULL,
  2036. [bTransFlag] [bit] NULL,
  2037. [cLtcPerson] [nvarchar](40) NULL,
  2038. [dLtcDate] [datetime] NULL,
  2039. [cLocationSite] [nvarchar](128) NULL,
  2040. [iCusTaxRate] [float] NULL,
  2041. [alloct_dept_time] [datetime] NULL,
  2042. [allot_user_time] [datetime] NULL,
  2043. [recyle_dept_time] [datetime] NULL,
  2044. [recyle_pub_time] [datetime] NULL,
  2045. [cLicenceNo] [nvarchar](120) NULL,
  2046. [cLicenceRange] [nvarchar](255) NULL,
  2047. [cCusBusinessRange] [nvarchar](255) NULL,
  2048. [cCusGSPAuthRange] [nvarchar](255) NULL,
  2049. [dCusGSPEDate] [datetime] NULL,
  2050. [dCusGSPSDate] [datetime] NULL,
  2051. [iCusGSPADays] [int] NULL,
  2052. [bIsCusAttachFile] [bit] NULL,
  2053. [dRecentContractDate] [datetime] NULL,
  2054. [dRecentDeliveryDate] [datetime] NULL,
  2055. [dRecentOutboundDate] [datetime] NULL,
  2056. [cProvince] [nvarchar](255) NULL,
  2057. [cCity] [nvarchar](255) NULL,
  2058. [cCounty] [nvarchar](255) NULL,
  2059. [cCusAddressGUID] [uniqueidentifier] NULL,
  2060. [cAddCode] [nvarchar](30) NULL,
  2061. [cCreditAddCode] [nvarchar](18) NULL,
  2062. [cRegCash] [nvarchar](60) NULL,
  2063. [dDepBeginDate] [datetime] NULL,
  2064. [iEmployeeNum] [int] NULL,
  2065. [cURL] [nvarchar](50) NULL,
  2066. [PictureGUID] [uniqueidentifier] NULL
  2067. )
  2068. alter table RdRecord08 add newcode nvarchar(60) null
  2069. alter table RdRecord09 add newcode nvarchar(60) null
  2070. alter table RdRecord01 add newcode nvarchar(60) null
  2071. --alter table RdRecord32 add newcode nvarchar(60) null
  2072. alter table so_somain add newcode nvarchar(60) null
  2073. alter table po_pomain add newcode nvarchar(60) null
  2074. alter table dispatchlist add newcode nvarchar(60) null
  2075. alter table PU_ArrivalVouch add newcode nvarchar(60) null
  2076. alter table transtime
  2077. add lasttime2 datetime
  2078. alter table rdrecords08
  2079. add text_flag bigint
  2080. alter table rdrecords09
  2081. add text_flag bigint
  2082. go
  2083. insert into transtime(entitytype) values('供应商')
  2084. insert into transtime(entitytype) values('仓库')
  2085. insert into transtime(entitytype) values('存货')
  2086. insert into transtime(entitytype) values('其他入库')
  2087. insert into transtime(entitytype) values('其他出库')
  2088. insert into transtime(entitytype) values('采购订单')
  2089. insert into transtime(entitytype) values('采购入库')
  2090. insert into transtime(entitytype) values('采购退货')
  2091. insert into transtime(entitytype) values('销售退货')
  2092. insert into transtime(entitytype) values('销售订单')
  2093. insert into transtime(entitytype) values('材料出库')
  2094. insert into transtime(entitytype) values('组装入库')
  2095. insert into transtime(entitytype) values('组装出库')
  2096. insert into transtime(entitytype) values('委外加工')
  2097. go
  2098. create index i_importdate on rdrecord08(importdate)
  2099. create index i_importdate on rdrecord09(importdate)
  2100. create index i_importdate on rdrecord01(importdate)
  2101. create index i_importdate on PU_ArrivalVouch(importdate)
  2102. create index i_importdate on PO_Pomain(importdate)
  2103. create index i_importdate on DispatchList(importdate)
  2104. create index i_importdate on SO_SOMain(importdate)
  2105. go
  2106. create index i_id on rdrecord08(id)
  2107. create index i_id on rdrecord09(id)
  2108. create index i_id on rdrecord01(id)
  2109. create index i_id on PU_ArrivalVouch(id)
  2110. create index i_id on PO_Pomain(poid)
  2111. create index i_id on DispatchList(dlid)
  2112. create index i_id on SO_SOMain(id)
  2113. go
  2114. create index i_id on rdrecords08(id)
  2115. create index i_id on rdrecords09(id)
  2116. create index i_id on rdrecords01(id)
  2117. create index i_id on PU_ArrivalVouchs(id)
  2118. create index i_id on PO_Podetails(poid)
  2119. create index i_id on DispatchLists(dlid)
  2120. create index i_id on SO_SOdetails(id)
  2121. go
  2122. alter table so_somain
  2123. add platform_id nvarchar(50)
  2124. go
  2125. alter table inventory add cInvDefine1 nvarchar(20)
  2126. alter table inventory add cInvDefine2 nvarchar(20)
  2127. alter table inventory add cInvDefine3 nvarchar(20)
  2128. alter table inventory add cInvDefine4 nvarchar(60)
  2129. alter table inventory add cInvDefine5 nvarchar(60)
  2130. alter table inventory add cInvDefine6 nvarchar(60)
  2131. alter table inventory add cInvDefine7 nvarchar(120)
  2132. alter table inventory add cInvDefine8 nvarchar(120)
  2133. alter table inventory add cInvDefine9 nvarchar(120)
  2134. alter table inventory add cInvDefine10 nvarchar(120)
  2135. alter table inventory add cInvDefine11 int
  2136. alter table inventory add cInvDefine12 int
  2137. alter table inventory add cInvDefine13 decimal(26,4)
  2138. alter table inventory add cInvDefine14 decimal(26,4)
  2139. alter table inventory add fRetailPrice decimal(26,4)
  2140. go
  2141. alter table vendor add contact nvarchar(30)
  2142. alter table vendor add phone nvarchar(100)
  2143. alter table vendor add mobile nvarchar(100)
  2144. alter table vendor add fax nvarchar(100)
  2145. alter table vendor add email nvarchar(100)
  2146. alter table vendor add cVenDefine11 int
  2147. alter table vendor add cVenDefine1 nvarchar(20)
  2148. alter table vendor add cVenDefine2 nvarchar(20)
  2149. alter table vendor add cVenDefine3 nvarchar(20)
  2150. alter table vendor add cVenDefine4 nvarchar(60)
  2151. alter table vendor add cVenDefine5 nvarchar(60)
  2152. alter table vendor add cVenDefine6 nvarchar(60)
  2153. alter table vendor add cVenDefine7 nvarchar(120)
  2154. alter table vendor add address nvarchar(255)
  2155. alter table vendor add cmemo nvarchar(240)
  2156. alter table vendor add bank_acc_number nvarchar(120)
  2157. alter table vendor add bank_open nvarchar(120)
  2158. go
  2159. --销售出库单
  2160. CREATE TABLE [dbo].[rdrecord32](
  2161. [ID] [bigint] NOT NULL,
  2162. [bRdFlag] [tinyint] NOT NULL,
  2163. [cVouchType] [nvarchar](2) NOT NULL,
  2164. [cBusType] [nvarchar](12) NULL,
  2165. [cSource] [nvarchar](50) NOT NULL,
  2166. [cBusCode] [nvarchar](30) NULL,
  2167. [cWhCode] [nvarchar](10) NOT NULL,
  2168. [dDate] [datetime] NOT NULL,
  2169. [cCode] [nvarchar](30) NOT NULL,
  2170. [cRdCode] [nvarchar](5) NULL,
  2171. [cDepCode] [nvarchar](12) NULL,
  2172. [cPersonCode] [nvarchar](20) NULL,
  2173. [cPTCode] [nvarchar](2) NULL,
  2174. [cSTCode] [nvarchar](2) NULL,
  2175. [cCusCode] [nvarchar](20) NULL,
  2176. [cVenCode] [nvarchar](20) NULL,
  2177. [cOrderCode] [nvarchar](30) NULL,
  2178. [cARVCode] [nvarchar](30) NULL,
  2179. [cBillCode] [bigint] NULL,
  2180. [cDLCode] [bigint] NULL,
  2181. [cProBatch] [nvarchar](60) NULL,
  2182. [cHandler] [nvarchar](20) NULL,
  2183. [cMemo] [nvarchar](255) NULL,
  2184. [bTransFlag] [bit] NOT NULL,
  2185. [cAccounter] [nvarchar](20) NULL,
  2186. [cMaker] [nvarchar](20) NULL,
  2187. [cDefine1] [nvarchar](20) NULL,
  2188. [cDefine2] [nvarchar](20) NULL,
  2189. [cDefine3] [nvarchar](20) NULL,
  2190. [cDefine4] [datetime] NULL,
  2191. [cDefine5] [int] NULL,
  2192. [cDefine6] [datetime] NULL,
  2193. [cDefine7] [float] NULL,
  2194. [cDefine8] [nvarchar](4) NULL,
  2195. [cDefine9] [nvarchar](8) NULL,
  2196. [cDefine10] [nvarchar](60) NULL,
  2197. [dKeepDate] [nvarchar](5) NULL,
  2198. [dVeriDate] [datetime] NULL,
  2199. [bpufirst] [bit] NULL,
  2200. [biafirst] [bit] NULL,
  2201. [iMQuantity] [float] NULL,
  2202. [dARVDate] [datetime] NULL,
  2203. [cChkCode] [nvarchar](30) NULL,
  2204. [dChkDate] [datetime] NULL,
  2205. [cChkPerson] [nvarchar](40) NULL,
  2206. [VT_ID] [int] NULL,
  2207. [bIsSTQc] [bit] NOT NULL,
  2208. [cDefine11] [nvarchar](120) NULL,
  2209. [cDefine12] [nvarchar](120) NULL,
  2210. [cDefine13] [nvarchar](120) NULL,
  2211. [cDefine14] [nvarchar](120) NULL,
  2212. [cDefine15] [int] NULL,
  2213. [cDefine16] [float] NULL,
  2214. [gspcheck] [nvarchar](10) NULL,
  2215. [isalebillid] [nvarchar](30) NULL,
  2216. [ufts] [timestamp] NULL,
  2217. [iExchRate] [float] NULL,
  2218. [cExch_Name] [nvarchar](8) NULL,
  2219. [cShipAddress] [nvarchar](200) NULL,
  2220. [caddcode] [nvarchar](60) NULL,
  2221. [bOMFirst] [bit] NULL,
  2222. [bFromPreYear] [bit] NULL,
  2223. [bIsLsQuery] [bit] NULL,
  2224. [bIsComplement] [smallint] NULL,
  2225. [iDiscountTaxType] [tinyint] NULL,
  2226. [ireturncount] [int] NULL,
  2227. [iverifystate] [int] NULL,
  2228. [iswfcontrolled] [int] NULL,
  2229. [cModifyPerson] [nvarchar](50) NULL,
  2230. [dModifyDate] [datetime] NULL,
  2231. [dnmaketime] [datetime] NULL,
  2232. [dnmodifytime] [datetime] NULL,
  2233. [dnverifytime] [datetime] NULL,
  2234. [bredvouch] [int] NULL,
  2235. [iFlowId] [int] NULL,
  2236. [cPZID] [nvarchar](30) NULL,
  2237. [cSourceLs] [nvarchar](4) NULL,
  2238. [cSourceCodeLs] [nvarchar](20) NULL,
  2239. [iPrintCount] [int] NULL,
  2240. [csysbarcode] [nvarchar](60) NULL,
  2241. [cCurrentAuditor] [nvarchar](200) NULL,
  2242. [cinvoicecompany] [nvarchar](20) NULL,
  2243. [fEBweight] [decimal](30, 9) NULL,
  2244. [cEBweightUnit] [nvarchar](50) NULL,
  2245. [cEBExpressCode] [nvarchar](50) NULL,
  2246. [bScanExpress] [tinyint] NULL,
  2247. [cinspector] [nvarchar](40) NULL,
  2248. [dinspecttime] [datetime] NULL,
  2249. [cweighter] [nvarchar](40) NULL,
  2250. [dweighttime] [datetime] NULL,
  2251. [bUpLoaded] [tinyint] NULL,
  2252. [outid] [uniqueidentifier] NULL,
  2253. [isMDdispatch] [tinyint] NULL,
  2254. [cCheckSignFlag] [nvarchar](36) NULL,
  2255. [cGCRouteCode] [nvarchar](40) NULL,
  2256. sysid int identity(1,1),
  2257. importdate datetime null default(getdate()),
  2258. processdate datetime null,
  2259. processflag bit default(0),
  2260. direction int default(0), --0:从U8到中间库,1:从旺店通到中间库
  2261. )
  2262. create index i_id on rdrecord32(id)
  2263. GO
  2264. CREATE TABLE [dbo].[rdrecords32](
  2265. [AutoID] [bigint] NOT NULL,
  2266. [ID] [bigint] NOT NULL,
  2267. [cInvCode] [nvarchar](60) NOT NULL,
  2268. [iNum] [decimal](30, 10) NULL,
  2269. [iQuantity] [decimal](30, 10) NULL,
  2270. [iUnitCost] [decimal](30, 10) NULL,
  2271. [iPrice] [money] NULL,
  2272. [iAPrice] [money] NULL,
  2273. [iPUnitCost] [decimal](30, 10) NULL,
  2274. [iPPrice] [money] NULL,
  2275. [cBatch] [nvarchar](60) NULL,
  2276. [cVouchCode] [bigint] NULL,
  2277. [cInVouchCode] [nvarchar](30) NULL,
  2278. [cinvouchtype] [nvarchar](2) NULL,
  2279. [iSOutQuantity] [decimal](30, 10) NULL,
  2280. [iSOutNum] [decimal](30, 10) NULL,
  2281. [coutvouchid] [bigint] NULL,
  2282. [coutvouchtype] [nvarchar](2) NULL,
  2283. [iSRedOutQuantity] [decimal](30, 10) NULL,
  2284. [iSRedOutNum] [decimal](30, 10) NULL,
  2285. [cFree1] [nvarchar](20) NULL,
  2286. [cFree2] [nvarchar](20) NULL,
  2287. [iFlag] [tinyint] NOT NULL,
  2288. [iFNum] [decimal](30, 10) NULL,
  2289. [iFQuantity] [decimal](30, 10) NULL,
  2290. [dVDate] [datetime] NULL,
  2291. [cPosition] [nvarchar](20) NULL,
  2292. [cDefine22] [nvarchar](60) NULL,
  2293. [cDefine23] [nvarchar](60) NULL,
  2294. [cDefine24] [nvarchar](60) NULL,
  2295. [cDefine25] [nvarchar](60) NULL,
  2296. [cDefine26] [float] NULL,
  2297. [cDefine27] [float] NULL,
  2298. [cItem_class] [nvarchar](10) NULL,
  2299. [cItemCode] [nvarchar](60) NULL,
  2300. [iDLsID] [bigint] NULL,
  2301. [iSBsID] [bigint] NULL,
  2302. [iSendQuantity] [decimal](30, 10) NULL,
  2303. [iSendNum] [decimal](30, 10) NULL,
  2304. [iEnsID] [int] NULL,
  2305. [cName] [nvarchar](255) NULL,
  2306. [cItemCName] [nvarchar](20) NULL,
  2307. [cFree3] [nvarchar](20) NULL,
  2308. [cFree4] [nvarchar](20) NULL,
  2309. [cFree5] [nvarchar](20) NULL,
  2310. [cFree6] [nvarchar](20) NULL,
  2311. [cFree7] [nvarchar](20) NULL,
  2312. [cFree8] [nvarchar](20) NULL,
  2313. [cFree9] [nvarchar](20) NULL,
  2314. [cFree10] [nvarchar](20) NULL,
  2315. [cBarCode] [nvarchar](200) NULL,
  2316. [iNQuantity] [decimal](30, 10) NULL,
  2317. [iNNum] [decimal](30, 10) NULL,
  2318. [cAssUnit] [nvarchar](35) NULL,
  2319. [dMadeDate] [datetime] NULL,
  2320. [iMassDate] [int] NULL,
  2321. [cDefine28] [nvarchar](120) NULL,
  2322. [cDefine29] [nvarchar](120) NULL,
  2323. [cDefine30] [nvarchar](120) NULL,
  2324. [cDefine31] [nvarchar](120) NULL,
  2325. [cDefine32] [nvarchar](120) NULL,
  2326. [cDefine33] [nvarchar](120) NULL,
  2327. [cDefine34] [int] NULL,
  2328. [cDefine35] [int] NULL,
  2329. [cDefine36] [datetime] NULL,
  2330. [cDefine37] [datetime] NULL,
  2331. [iCheckIds] [bigint] NULL,
  2332. [cBVencode] [nvarchar](20) NULL,
  2333. [bGsp] [bit] NULL,
  2334. [cGspState] [nvarchar](20) NULL,
  2335. [cCheckCode] [nvarchar](30) NULL,
  2336. [iCheckIdBaks] [bigint] NULL,
  2337. [cRejectCode] [nvarchar](30) NULL,
  2338. [iRejectIds] [bigint] NULL,
  2339. [cCheckPersonCode] [nvarchar](20) NULL,
  2340. [dCheckDate] [datetime] NULL,
  2341. [cMassUnit] [smallint] NULL,
  2342. [iRefundInspectFlag] [tinyint] NULL,
  2343. [strContractId] [nvarchar](64) NULL,
  2344. [strCode] [nvarchar](150) NULL,
  2345. [bChecked] [bit] NULL,
  2346. [iEqDID] [int] NULL,
  2347. [bLPUseFree] [bit] NULL,
  2348. [iRSRowNO] [int] NULL,
  2349. [iOriTrackID] [bigint] NULL,
  2350. [coritracktype] [nvarchar](2) NULL,
  2351. [cbaccounter] [nvarchar](30) NULL,
  2352. [dbKeepDate] [datetime] NULL,
  2353. [bCosting] [bit] NULL,
  2354. [bVMIUsed] [bit] NULL,
  2355. [iVMISettleQuantity] [decimal](30, 10) NULL,
  2356. [iVMISettleNum] [decimal](30, 10) NULL,
  2357. [cvmivencode] [nvarchar](20) NULL,
  2358. [iInvSNCount] [int] NULL,
  2359. [cwhpersoncode] [nvarchar](20) NULL,
  2360. [cwhpersonname] [nvarchar](50) NULL,
  2361. [cserviceoid] [varchar](38) NULL,
  2362. [cbserviceoid] [varchar](38) NULL,
  2363. [iinvexchrate] [decimal](38, 8) NULL,
  2364. [cbdlcode] [nvarchar](30) NULL,
  2365. sysid int identity(1,1)
  2366. )
  2367. create index i_id on rdrecords32(id)
  2368. go