mDataRecord.pas 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. unit mDataRecord;
  2. interface
  3. uses
  4. Classes, sdDB;
  5. type
  6. TBillsRecord = class(TsdDataRecord)
  7. private
  8. // 树结构
  9. FID: TsdValue;
  10. FParentID: TsdValue;
  11. FNextSiblingID: TsdValue;
  12. // 报表专用
  13. FSerialNo: TsdValue;
  14. FIsLeaf: TsdValue;
  15. FLeafXmjID: TsdValue;
  16. FXiangCode: TsdValue;
  17. FMuCode: TsdValue;
  18. FJieCode: TsdValue;
  19. FXimuCode: TsdValue;
  20. FIndexCode: TsdValue;
  21. // 基础数据
  22. FCode: TsdValue;
  23. FB_Code: TsdValue;
  24. FName: TsdValue;
  25. FUnits: TsdValue;
  26. FAlias: TsdValue;
  27. // 单价
  28. FPrice: TsdValue;
  29. FNewPrice: TsdValue;
  30. // 0号台账计算相关
  31. FOrgQuantity: TsdValue;
  32. FOrgTotalPrice: TsdValue;
  33. FMisQuantity: TsdValue;
  34. FMisTotalPrice: TsdValue;
  35. FOthQuantity: TsdValue;
  36. FOthTotalPrice: TsdValue;
  37. FQuantity: TsdValue;
  38. FTotalPrice: TsdValue;
  39. // 计算模式标记
  40. FCalcType: TsdValue;
  41. // 累计
  42. FAddDealQuantity: TsdValue;
  43. FAddDealTotalPrice: TsdValue;
  44. FAddQcQuantity: TsdValue;
  45. FAddQcTotalPrice: TsdValue;
  46. FAddQcBGLCode: TsdValue;
  47. FAddQcBGLNum: TsdValue;
  48. FAddPcQuantity: TsdValue;
  49. FAddPcTotalPrice: TsdValue;
  50. FAddPcBGLCode: TsdValue;
  51. FAddPcBGLNum: TsdValue;
  52. FAddGatherQuantity: TsdValue;
  53. FAddGatherTotalPrice: TsdValue;
  54. FLockLevel: TsdValue;
  55. FLockInfo: TsdValue;
  56. FLockNewPrice: TsdValue;
  57. FCreatePhaseID: TsdValue;
  58. FIsMeasureAdd: TsdValue;
  59. FPeg: TsdValue;
  60. FDrawingCode: TsdValue;
  61. FMemoStr: TsdValue;
  62. FDgnQuantity1: TsdValue;
  63. FDgnQuantity2: TsdValue;
  64. FDgnPrice: TsdValue;
  65. FDealDgnQuantity1: TsdValue;
  66. FDealDgnQuantity2: TsdValue;
  67. FCDgnQuantity1: TsdValue;
  68. FCDgnQuantity2: TsdValue;
  69. FAddDgnPrice: TsdValue;
  70. FHasBookMark: TsdValue;
  71. FMarkMemo: TsdValue;
  72. FDealCode: TsdValue;
  73. FDealCompany: TsdValue;
  74. FDealType: TsdValue;
  75. FAddCutTotalPrice: TsdValue;
  76. FAddPayTotalPrice: TsdValue;
  77. FAddCompleteRate: TsdValue;
  78. FCacheMisTP: Double;
  79. FCacheOrgTP: Double;
  80. FCacheOthTP: Double;
  81. protected
  82. procedure DoAfterAddFields; override;
  83. public
  84. property ID: TsdValue read FID;
  85. property ParentID: TsdValue read FParentID;
  86. property NextSiblingID: TsdValue read FNextSiblingID;
  87. property SerialNo: TsdValue read FSerialNo;
  88. property IsLeaf: TsdValue read FIsLeaf;
  89. property LeafXmjID: TsdValue read FLeafXmjID;
  90. property XiangCode: TsdValue read FXiangCode;
  91. property MuCode: TsdValue read FMuCode;
  92. property JieCode: TsdValue read FJieCode;
  93. property XimuCode: TsdValue read FXimuCode;
  94. property IndexCode: TsdValue read FIndexCode;
  95. property Code: TsdValue read FCode;
  96. property B_Code: TsdValue read FB_Code;
  97. property Name: TsdValue read FName;
  98. property Units: TsdValue read FUnits;
  99. property Alias: TsdValue read FAlias;
  100. property Price: TsdValue read FPrice;
  101. property NewPrice: TsdValue read FNewPrice;
  102. property OrgQuantity: TsdValue read FOrgQuantity;
  103. property OrgTotalPrice: TsdValue read FOrgTotalPrice;
  104. property MisQuantity: TsdValue read FMisQuantity;
  105. property MisTotalPrice: TsdValue read FMisTotalPrice;
  106. property OthQuantity: TsdValue read FOthQuantity;
  107. property OthTotalPrice: TsdValue read FOthTotalPrice;
  108. property Quantity: TsdValue read FQuantity;
  109. property TotalPrice: TsdValue read FTotalPrice;
  110. property CalcType: TsdValue read FCalcType;
  111. property AddDealQuantity: TsdValue read FAddDealQuantity;
  112. property AddDealTotalPrice: TsdValue read FAddDealTotalPrice;
  113. property AddQcQuantity: TsdValue read FAddQcQuantity;
  114. property AddQcTotalPrice: TsdValue read FAddQcTotalPrice;
  115. property AddQcBGLCode: TsdValue read FAddQcBGLCode;
  116. property AddQcBGLNum: TsdValue read FAddQcBGLNum;
  117. property AddPcQuantity: TsdValue read FAddPcQuantity;
  118. property AddPcTotalPrice: TsdValue read FAddPcTotalPrice;
  119. property AddPcBGLCode: TsdValue read FAddPcBGLCode;
  120. property AddPcBGLNum: TsdValue read FAddPcBGLNum;
  121. property AddGatherQuantity: TsdValue read FAddGatherQuantity;
  122. property AddGatherTotalPrice: TsdValue read FAddGatherTotalPrice;
  123. property LockLevel: TsdValue read FLockLevel;
  124. property LockInfo: TsdValue read FLockInfo;
  125. property LockNewPrice: TsdValue read FLockNewPrice;
  126. property CreatePhaseID: TsdValue read FCreatePhaseID;
  127. property IsMeasureAdd: TsdValue read FIsMeasureAdd;
  128. property Peg: TsdValue read FPeg;
  129. property DrawingCode: TsdValue read FDrawingCode;
  130. property MemoStr: TsdValue read FMemoStr;
  131. property DgnQuantity1: TsdValue read FDgnQuantity1;
  132. property DgnQuantity2: TsdValue read FDgnQuantity2;
  133. property DgnPrice: TsdValue read FDgnPrice;
  134. property DealDgnQuantity1: TsdValue read FDealDgnQuantity1;
  135. property DealDgnQuantity2: TsdValue read FDealDgnQuantity2;
  136. property CDgnQuantity1: TsdValue read FCDgnQuantity1;
  137. property CDgnQuantity2: TsdValue read FCDgnQuantity2;
  138. property AddDgnPrice: TsdValue read FAddDgnPrice;
  139. property HasBookMark: TsdValue read FHasBookMark;
  140. property MarkMemo: TsdValue read FMarkMemo;
  141. property DealCode: TsdValue read FDealCode;
  142. property DealCompany: TsdValue read FDealCompany;
  143. property DealType: TsdValue read FDealType;
  144. property AddCutTotalPrice: TsdValue read FAddCutTotalPrice;
  145. property AddPayTotalPrice: TsdValue read FAddPayTotalPrice;
  146. property AddCompleteRate: TsdValue read FAddCompleteRate;
  147. // Cache Data 用于增量计算,记录原始值
  148. property CacheOrgTP: Double read FCacheOrgTP write FCacheOrgTP;
  149. property CacheMisTP: Double read FCacheMisTP write FCacheMisTP;
  150. property CacheOthTP: Double read FCacheOthTP write FCacheOthTP;
  151. end;
  152. TStageRecord = class(TsdDataRecord)
  153. private
  154. FBillsID: TsdValue;
  155. FDealQuantity: TsdValue;
  156. FDealTotalPrice: TsdValue;
  157. FDealFlag: TsdValue;
  158. FDealFormula: TsdValue;
  159. FQcQuantity: TsdValue;
  160. FQcTotalPrice: TsdValue;
  161. FQcFlag: TsdValue;
  162. FQcFormula: TsdValue;
  163. FQcBGLCode: TsdValue;
  164. FQcBGLNum: TsdValue;
  165. FPcQuantity: TsdValue;
  166. FPcTotalPrice: TsdValue;
  167. FPcFlag: TsdValue;
  168. FPcFormula: TsdValue;
  169. FPcBGLCode: TsdValue;
  170. FPcBGLNum: TsdValue;
  171. FGatherQuantity: TsdValue;
  172. FGatherTotalPrice: TsdValue;
  173. FEndDealQuantity: TsdValue;
  174. FEndDealTotalPrice: TsdValue;
  175. FEndQcQuantity: TsdValue;
  176. FEndQcTotalPrice: TsdValue;
  177. FEndQcBGLCode: TsdValue;
  178. FEndQcBGLNum: TsdValue;
  179. FEndPcQuantity: TsdValue;
  180. FEndPcTotalPrice: TsdValue;
  181. FEndPcBGLCode: TsdValue;
  182. FEndPcBGLNum: TsdValue;
  183. FEndGatherQuantity: TsdValue;
  184. FEndGatherTotalPrice: TsdValue;
  185. FPreDealQuantity: TsdValue;
  186. FPreDealTotalPrice: TsdValue;
  187. FPreQcQuantity: TsdValue;
  188. FPreQcTotalPrice: TsdValue;
  189. FPreQcBGLCode: TsdValue;
  190. FPreQcBGLNum: TsdValue;
  191. FPrePcQuantity: TsdValue;
  192. FPrePcTotalPrice: TsdValue;
  193. FPrePcBGLCode: TsdValue;
  194. FPrePcBGLNum: TsdValue;
  195. FPreGatherQuantity: TsdValue;
  196. FPreGatherTotalPrice: TsdValue;
  197. FHasBookMark: TsdValue;
  198. FMarkMemo: TsdValue;
  199. FCacheDealTP: Double;
  200. protected
  201. procedure DoAfterAddFields; override;
  202. public
  203. property BillsID: TsdValue read FBillsID;
  204. property DealQuantity: TsdValue read FDealQuantity;
  205. property DealTotalPrice: TsdValue read FDealTotalPrice;
  206. property DealFlag: TsdValue read FDealFlag;
  207. property DealFormula: TsdValue read FDealFormula;
  208. property QcQuantity: TsdValue read FQcQuantity;
  209. property QcTotalPrice: TsdValue read FQcTotalPrice;
  210. property QcFlag: TsdValue read FQcFlag;
  211. property QcFormula: TsdValue read FQcFormula;
  212. property QcBGLCode: TsdValue read FQcBGLCode;
  213. property QcBGLNum: TsdValue read FQcBGLNum;
  214. property PcQuantity: TsdValue read FPcQuantity;
  215. property PcTotalPrice: TsdValue read FPcTotalPrice;
  216. property PcFlag: TsdValue read FPcFlag;
  217. property PcFormula: TsdValue read FPcFormula;
  218. property PcBGLCode: TsdValue read FPcBGLCode;
  219. property PcBGLNum: TsdValue read FPcBGLNum;
  220. property GatherQuantity: TsdValue read FGatherQuantity;
  221. property GatherTotalPrice: TsdValue read FGatherTotalPrice;
  222. property EndDealQuantity: TsdValue read FEndDealQuantity;
  223. property EndDealTotalPrice: TsdValue read FEndDealTotalPrice;
  224. property EndQcQuantity: TsdValue read FEndQcQuantity;
  225. property EndQcTotalPrice: TsdValue read FEndQcTotalPrice;
  226. property EndQcBGLCode: TsdValue read FEndQcBGLCode;
  227. property EndQcBGLNum: TsdValue read FEndQcBGLNum;
  228. property EndPcQuantity: TsdValue read FEndPcQuantity;
  229. property EndPcTotalPrice: TsdValue read FEndPcTotalPrice;
  230. property EndPcBGLCode: TsdValue read FEndPcBGLCode;
  231. property EndPcBGLNum: TsdValue read FEndPcBGLNum;
  232. property EndGatherQuantity: TsdValue read FEndGatherQuantity;
  233. property EndGatherTotalPrice: TsdValue read FEndGatherTotalPrice;
  234. property PreDealQuantity: TsdValue read FPreDealQuantity;
  235. property PreDealTotalPrice: TsdValue read FPreDealTotalPrice;
  236. property PreQcQuantity: TsdValue read FPreQcQuantity;
  237. property PreQcTotalPrice: TsdValue read FPreQcTotalPrice;
  238. property PreQcBGLCode: TsdValue read FPreQcBGLCode;
  239. property PreQcBGLNum: TsdValue read FPreQcBGLNum;
  240. property PrePcQuantity: TsdValue read FPrePcQuantity;
  241. property PrePcTotalPrice: TsdValue read FPrePcTotalPrice;
  242. property PrePcBGLCode: TsdValue read FPrePcBGLCode;
  243. property PrePcBGLNum: TsdValue read FPrePcBGLNum;
  244. property PreGatherQuantity: TsdValue read FPreGatherQuantity;
  245. property PreGatherTotalPrice: TsdValue read FPreGatherTotalPrice;
  246. property HasBookMark: TsdValue read FHasBookMark;
  247. property MarkMemo: TsdValue read FMarkMemo;
  248. property CacheDealTP: Double read FCacheDealTP write FCacheDealTP;
  249. end;
  250. implementation
  251. { TBillsRecord }
  252. procedure TBillsRecord.DoAfterAddFields;
  253. begin
  254. inherited;
  255. FID := ValueByName('ID');
  256. FParentID := ValueByName('ParentID');
  257. FNextSiblingID := ValueByName('NextSiblingID');
  258. FSerialNo := ValueByName('SerialNo');
  259. FIsLeaf := ValueByName('IsLeaf');
  260. FLeafXmjID := ValueByName('LeafXmjID');
  261. FXiangCode := ValueByName('XiangCode');
  262. FMuCode := ValueByName('MuCode');
  263. FJieCode := ValueByName('JieCode');
  264. FXimuCode := ValueByName('XimuCode');
  265. FIndexCode := ValueByName('IndexCode');
  266. FCode := ValueByName('Code');
  267. FB_Code := ValueByName('B_Code');
  268. FName := ValueByName('Name');
  269. FUnits := ValueByName('Units');
  270. FAlias := ValueByName('Alias');
  271. FPrice := ValueByName('Price');
  272. FNewPrice := ValueByName('NewPrice');
  273. FOrgQuantity := ValueByName('OrgQuantity');
  274. FOrgTotalPrice := ValueByName('OrgTotalPrice');
  275. FMisQuantity := ValueByName('MisQuantity');
  276. FMisTotalPrice := ValueByName('MisTotalPrice');
  277. FOthQuantity := ValueByName('OthQuantity');
  278. FOthTotalPrice := ValueByName('OthTotalPrice');
  279. FQuantity := ValueByName('Quantity');
  280. FTotalPrice := ValueByName('TotalPrice');
  281. FCalcType := ValueByName('CalcType');
  282. FAddDealQuantity := ValueByName('AddDealQuantity');
  283. FAddDealTotalPrice := ValueByName('AddDealTotalPrice');
  284. FAddQcQuantity := ValueByName('AddQcQuantity');
  285. FAddQcTotalPrice := ValueByName('AddQcTotalPrice');
  286. FAddQcBGLCode := ValueByName('AddQcBGLCode');
  287. FAddQcBGLNum := ValueByName('AddQcBGLNum');
  288. FAddPcQuantity := ValueByName('AddPcQuantity');
  289. FAddPcTotalPrice := ValueByName('AddPcTotalPrice');
  290. FAddPcBGLCode := ValueByName('AddPcBGLCode');
  291. FAddPcBGLNum := ValueByName('AddPcBGLNum');
  292. FAddGatherQuantity := ValueByName('AddGatherQuantity');
  293. FAddGatherTotalPrice := ValueByName('AddGatherTotalPrice');
  294. FLockLevel := ValueByName('LockLevel');
  295. FLockInfo := ValueByName('LockInfo');
  296. FLockNewPrice := ValueByName('LockNewPrice');
  297. FCreatePhaseID := ValueByName('CreatePhaseID');
  298. FIsMeasureAdd := ValueByName('IsMeasureAdd');
  299. FPeg := ValueByName('Peg');
  300. FDrawingCode := ValueByName('DrawingCode');
  301. FMemoStr := ValueByName('MemoStr');
  302. FDgnQuantity1 := ValueByName('DgnQuantity1');
  303. FDgnQuantity2 := ValueByName('DgnQuantity2');
  304. FDgnPrice := ValueByName('DgnPrice');
  305. FDealDgnQuantity1 := ValueByName('DealDgnQuantity1');
  306. FDealDgnQuantity2 := ValueByName('DealDgnQuantity2');
  307. FCDgnQuantity1 := ValueByName('CDgnQuantity1');
  308. FCDgnQuantity2 := ValueByName('CDgnQuantity2');
  309. FAddDgnPrice := ValueByName('AddDgnPrice');
  310. FHasBookMark := ValueByName('HasBookMark');
  311. FMarkMemo := ValueByName('MarkMemo');
  312. FDealCode := ValueByName('DealCode');
  313. FDealCompany := ValueByName('DealCompany');
  314. FDealType := ValueByName('DealType');
  315. FAddCutTotalPrice := ValueByName('AddCutTotalPrice');
  316. FAddPayTotalPrice := ValueByName('AddPayTotalPrice');
  317. FAddCompleteRate := ValueByName('AddCompleteRate');
  318. end;
  319. { TStageRecord }
  320. procedure TStageRecord.DoAfterAddFields;
  321. begin
  322. inherited;
  323. FBillsID := ValueByName('BillsID');
  324. FDealQuantity := ValueByName('DealQuantity');
  325. FDealTotalPrice := ValueByName('DealTotalPrice');
  326. FDealFlag := ValueByName('DealFlag');
  327. FDealFormula := ValueByName('DealFormula');
  328. FQcQuantity := ValueByName('QcQuantity');
  329. FQcTotalPrice := ValueByName('QcTotalPrice');
  330. FQcFlag := ValueByName('QcFlag');
  331. FQcFormula := ValueByName('QcFormula');
  332. FQcBGLCode := ValueByName('QcBGLCode');
  333. FQcBGLNum := ValueByName('QcBGLNum');
  334. FPcQuantity := ValueByName('PcQuantity');
  335. FPcTotalPrice := ValueByName('PcTotalPrice');
  336. FPcFlag := ValueByName('PcFlag');
  337. FPcFormula := ValueByName('PcFormula');
  338. FPcBGLCode := ValueByName('PcBGLCode');
  339. FPcBGLNum := ValueByName('PcBGLNum');
  340. FGatherQuantity := ValueByName('GatherQuantity');
  341. FGatherTotalPrice := ValueByName('GatherTotalPrice');
  342. FEndDealQuantity := ValueByName('EndDealQuantity');
  343. FEndDealTotalPrice := ValueByName('EndDealTotalPrice');
  344. FEndQcQuantity := ValueByName('EndQcQuantity');
  345. FEndQcTotalPrice := ValueByName('EndQcTotalPrice');
  346. FEndQcBGLCode := ValueByName('EndQcBGLCode');
  347. FEndQcBGLNum := ValueByName('EndQcBGLNum');
  348. FEndPcQuantity := ValueByName('EndPcQuantity');
  349. FEndPcTotalPrice := ValueByName('EndPcTotalPrice');
  350. FEndPcBGLCode := ValueByName('EndPcBGLCode');
  351. FEndPcBGLNum := ValueByName('EndPcBGLNum');
  352. FEndGatherQuantity := ValueByName('EndGatherQuantity');
  353. FEndGatherTotalPrice := ValueByName('EndGatherTotalPrice');
  354. FPreDealQuantity := ValueByName('PreDealQuantity');
  355. FPreDealTotalPrice := ValueByName('PreDealTotalPrice');
  356. FPreQcQuantity := ValueByName('PreQcQuantity');
  357. FPreQcTotalPrice := ValueByName('PreQcTotalPrice');
  358. FPreQcBGLCode := ValueByName('PreQcBGLCode');
  359. FPreQcBGLNum := ValueByName('PreQcBGLNum');
  360. FPrePcQuantity := ValueByName('PrePcQuantity');
  361. FPrePcTotalPrice := ValueByName('PrePcTotalPrice');
  362. FPrePcBGLCode := ValueByName('PrePcBGLCode');
  363. FPrePcBGLNum := ValueByName('PrePcBGLNum');
  364. FPreGatherQuantity := ValueByName('PreGatherQuantity');
  365. FPreGatherTotalPrice := ValueByName('PreGatherTotalPrice');
  366. FHasBookMark := ValueByName('HasBookMark');
  367. FMarkMemo := ValueByName('MarkMemo');
  368. end;
  369. end.