mDataRecord.pas 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. unit mDataRecord;
  2. interface
  3. uses
  4. Classes, sdDB;
  5. type
  6. TMeasureBaseRecord = class(TsdDataRecord)
  7. public
  8. procedure SetFloatValue(AValue: TsdValue; AFloat: Double);
  9. procedure SetIntValue(AValue: TsdValue; AInt: Integer);
  10. procedure SetBoolValue(AValue: TsdValue; ABool: Boolean);
  11. procedure SetStrValue(AValue: TsdValue; AStr: string);
  12. procedure AddDifferValue(AValue: TsdValue; ADiffer: Double);
  13. end;
  14. TBillsRecord = class(TMeasureBaseRecord)
  15. private
  16. // 树结构
  17. FID: TsdValue;
  18. FParentID: TsdValue;
  19. FNextSiblingID: TsdValue;
  20. // 报表专用
  21. FSerialNo: TsdValue;
  22. FIsLeaf: TsdValue;
  23. FLeafXmjParentID: TsdValue;
  24. FXiangCode: TsdValue;
  25. FMuCode: TsdValue;
  26. FJieCode: TsdValue;
  27. FXimuCode: TsdValue;
  28. FIndexCode: TsdValue;
  29. // 基础数据
  30. FCode: TsdValue;
  31. FB_Code: TsdValue;
  32. FName: TsdValue;
  33. FUnits: TsdValue;
  34. FAlias: TsdValue;
  35. // 单价
  36. FPrice: TsdValue;
  37. FNewPrice: TsdValue;
  38. // 0号台账计算相关
  39. FOrgQuantity: TsdValue;
  40. FOrgTotalPrice: TsdValue;
  41. FMisQuantity: TsdValue;
  42. FMisTotalPrice: TsdValue;
  43. FOthQuantity: TsdValue;
  44. FOthTotalPrice: TsdValue;
  45. FQuantity: TsdValue;
  46. FTotalPrice: TsdValue;
  47. // 计算模式标记
  48. FCalcType: TsdValue;
  49. // 累计
  50. FAddDealQuantity: TsdValue;
  51. FAddDealTotalPrice: TsdValue;
  52. FAddQcQuantity: TsdValue;
  53. FAddQcTotalPrice: TsdValue;
  54. FAddQcBGLCode: TsdValue;
  55. FAddQcBGLNum: TsdValue;
  56. FAddPcQuantity: TsdValue;
  57. FAddPcTotalPrice: TsdValue;
  58. FAddPcBGLCode: TsdValue;
  59. FAddPcBGLNum: TsdValue;
  60. FAddGatherQuantity: TsdValue;
  61. FAddGatherTotalPrice: TsdValue;
  62. FLockLevel: TsdValue;
  63. FLockInfo: TsdValue;
  64. FLockNewPrice: TsdValue;
  65. FCreatePhaseID: TsdValue;
  66. FIsMeasureAdd: TsdValue;
  67. FPeg: TsdValue;
  68. FDrawingCode: TsdValue;
  69. FMemoStr: TsdValue;
  70. FDgnQuantity1: TsdValue;
  71. FDgnQuantity2: TsdValue;
  72. FDgnPrice: TsdValue;
  73. FDealDgnQuantity1: TsdValue;
  74. FDealDgnQuantity2: TsdValue;
  75. FCDgnQuantity1: TsdValue;
  76. FCDgnQuantity2: TsdValue;
  77. FAddDgnPrice: TsdValue;
  78. FHasBookMark: TsdValue;
  79. FMarkMemo: TsdValue;
  80. FDealCode: TsdValue;
  81. FDealCompany: TsdValue;
  82. FDealType: TsdValue;
  83. FAddCutTotalPrice: TsdValue;
  84. FAddPayTotalPrice: TsdValue;
  85. FAddCompleteRate: TsdValue;
  86. FCacheMisTP: Double;
  87. FCacheOrgTP: Double;
  88. FCacheOthTP: Double;
  89. FPM_AddTotalPrice: TsdValue;
  90. protected
  91. procedure DoAfterAddFields; override;
  92. public
  93. property ID: TsdValue read FID;
  94. property ParentID: TsdValue read FParentID;
  95. property NextSiblingID: TsdValue read FNextSiblingID;
  96. property SerialNo: TsdValue read FSerialNo;
  97. property IsLeaf: TsdValue read FIsLeaf;
  98. property LeafXmjParentID: TsdValue read FLeafXmjParentID;
  99. property XiangCode: TsdValue read FXiangCode;
  100. property MuCode: TsdValue read FMuCode;
  101. property JieCode: TsdValue read FJieCode;
  102. property XimuCode: TsdValue read FXimuCode;
  103. property IndexCode: TsdValue read FIndexCode;
  104. property Code: TsdValue read FCode;
  105. property B_Code: TsdValue read FB_Code;
  106. property Name: TsdValue read FName;
  107. property Units: TsdValue read FUnits;
  108. property Alias: TsdValue read FAlias;
  109. property Price: TsdValue read FPrice;
  110. property NewPrice: TsdValue read FNewPrice;
  111. property OrgQuantity: TsdValue read FOrgQuantity;
  112. property OrgTotalPrice: TsdValue read FOrgTotalPrice;
  113. property MisQuantity: TsdValue read FMisQuantity;
  114. property MisTotalPrice: TsdValue read FMisTotalPrice;
  115. property OthQuantity: TsdValue read FOthQuantity;
  116. property OthTotalPrice: TsdValue read FOthTotalPrice;
  117. property Quantity: TsdValue read FQuantity;
  118. property TotalPrice: TsdValue read FTotalPrice;
  119. property CalcType: TsdValue read FCalcType;
  120. property AddDealQuantity: TsdValue read FAddDealQuantity;
  121. property AddDealTotalPrice: TsdValue read FAddDealTotalPrice;
  122. property AddQcQuantity: TsdValue read FAddQcQuantity;
  123. property AddQcTotalPrice: TsdValue read FAddQcTotalPrice;
  124. property AddQcBGLCode: TsdValue read FAddQcBGLCode;
  125. property AddQcBGLNum: TsdValue read FAddQcBGLNum;
  126. property AddPcQuantity: TsdValue read FAddPcQuantity;
  127. property AddPcTotalPrice: TsdValue read FAddPcTotalPrice;
  128. property AddPcBGLCode: TsdValue read FAddPcBGLCode;
  129. property AddPcBGLNum: TsdValue read FAddPcBGLNum;
  130. property AddGatherQuantity: TsdValue read FAddGatherQuantity;
  131. property AddGatherTotalPrice: TsdValue read FAddGatherTotalPrice;
  132. property LockLevel: TsdValue read FLockLevel;
  133. property LockInfo: TsdValue read FLockInfo;
  134. property LockNewPrice: TsdValue read FLockNewPrice;
  135. property CreatePhaseID: TsdValue read FCreatePhaseID;
  136. property IsMeasureAdd: TsdValue read FIsMeasureAdd;
  137. property Peg: TsdValue read FPeg;
  138. property DrawingCode: TsdValue read FDrawingCode;
  139. property MemoStr: TsdValue read FMemoStr;
  140. property DgnQuantity1: TsdValue read FDgnQuantity1;
  141. property DgnQuantity2: TsdValue read FDgnQuantity2;
  142. property DgnPrice: TsdValue read FDgnPrice;
  143. property DealDgnQuantity1: TsdValue read FDealDgnQuantity1;
  144. property DealDgnQuantity2: TsdValue read FDealDgnQuantity2;
  145. property CDgnQuantity1: TsdValue read FCDgnQuantity1;
  146. property CDgnQuantity2: TsdValue read FCDgnQuantity2;
  147. property AddDgnPrice: TsdValue read FAddDgnPrice;
  148. property HasBookMark: TsdValue read FHasBookMark;
  149. property MarkMemo: TsdValue read FMarkMemo;
  150. property DealCode: TsdValue read FDealCode;
  151. property DealCompany: TsdValue read FDealCompany;
  152. property DealType: TsdValue read FDealType;
  153. property AddCutTotalPrice: TsdValue read FAddCutTotalPrice;
  154. property AddPayTotalPrice: TsdValue read FAddPayTotalPrice;
  155. property AddCompleteRate: TsdValue read FAddCompleteRate;
  156. // Cache Data 用于增量计算,记录原始值
  157. property CacheOrgTP: Double read FCacheOrgTP write FCacheOrgTP;
  158. property CacheMisTP: Double read FCacheMisTP write FCacheMisTP;
  159. property CacheOthTP: Double read FCacheOthTP write FCacheOthTP;
  160. property PM_AddTotalPrice: TsdValue read FPM_AddTotalPrice;
  161. end;
  162. TStageRecord = class(TMeasureBaseRecord)
  163. private
  164. FBillsID: TsdValue;
  165. FDealQuantity: TsdValue;
  166. FDealTotalPrice: TsdValue;
  167. FDealFlag: TsdValue;
  168. FDealFormula: TsdValue;
  169. FQcQuantity: TsdValue;
  170. FQcTotalPrice: TsdValue;
  171. FQcFlag: TsdValue;
  172. FQcFormula: TsdValue;
  173. FQcBGLCode: TsdValue;
  174. FQcBGLNum: TsdValue;
  175. FPcQuantity: TsdValue;
  176. FPcTotalPrice: TsdValue;
  177. FPcFlag: TsdValue;
  178. FPcFormula: TsdValue;
  179. FPcBGLCode: TsdValue;
  180. FPcBGLNum: TsdValue;
  181. FGatherQuantity: TsdValue;
  182. FGatherTotalPrice: TsdValue;
  183. FEndDealQuantity: TsdValue;
  184. FEndDealTotalPrice: TsdValue;
  185. FEndQcQuantity: TsdValue;
  186. FEndQcTotalPrice: TsdValue;
  187. FEndQcBGLCode: TsdValue;
  188. FEndQcBGLNum: TsdValue;
  189. FEndPcQuantity: TsdValue;
  190. FEndPcTotalPrice: TsdValue;
  191. FEndPcBGLCode: TsdValue;
  192. FEndPcBGLNum: TsdValue;
  193. FEndGatherQuantity: TsdValue;
  194. FEndGatherTotalPrice: TsdValue;
  195. FPreDealQuantity: TsdValue;
  196. FPreDealTotalPrice: TsdValue;
  197. FPreQcQuantity: TsdValue;
  198. FPreQcTotalPrice: TsdValue;
  199. FPreQcBGLCode: TsdValue;
  200. FPreQcBGLNum: TsdValue;
  201. FPrePcQuantity: TsdValue;
  202. FPrePcTotalPrice: TsdValue;
  203. FPrePcBGLCode: TsdValue;
  204. FPrePcBGLNum: TsdValue;
  205. FPreGatherQuantity: TsdValue;
  206. FPreGatherTotalPrice: TsdValue;
  207. FHasBookMark: TsdValue;
  208. FMarkMemo: TsdValue;
  209. FCacheDealTP: Double;
  210. FPM_PreTotalPrice: TsdValue;
  211. FPM_TotalPrice: TsdValue;
  212. protected
  213. procedure DoAfterAddFields; override;
  214. public
  215. property BillsID: TsdValue read FBillsID;
  216. property DealQuantity: TsdValue read FDealQuantity;
  217. property DealTotalPrice: TsdValue read FDealTotalPrice;
  218. property DealFlag: TsdValue read FDealFlag;
  219. property DealFormula: TsdValue read FDealFormula;
  220. property QcQuantity: TsdValue read FQcQuantity;
  221. property QcTotalPrice: TsdValue read FQcTotalPrice;
  222. property QcFlag: TsdValue read FQcFlag;
  223. property QcFormula: TsdValue read FQcFormula;
  224. property QcBGLCode: TsdValue read FQcBGLCode;
  225. property QcBGLNum: TsdValue read FQcBGLNum;
  226. property PcQuantity: TsdValue read FPcQuantity;
  227. property PcTotalPrice: TsdValue read FPcTotalPrice;
  228. property PcFlag: TsdValue read FPcFlag;
  229. property PcFormula: TsdValue read FPcFormula;
  230. property PcBGLCode: TsdValue read FPcBGLCode;
  231. property PcBGLNum: TsdValue read FPcBGLNum;
  232. property GatherQuantity: TsdValue read FGatherQuantity;
  233. property GatherTotalPrice: TsdValue read FGatherTotalPrice;
  234. property EndDealQuantity: TsdValue read FEndDealQuantity;
  235. property EndDealTotalPrice: TsdValue read FEndDealTotalPrice;
  236. property EndQcQuantity: TsdValue read FEndQcQuantity;
  237. property EndQcTotalPrice: TsdValue read FEndQcTotalPrice;
  238. property EndQcBGLCode: TsdValue read FEndQcBGLCode;
  239. property EndQcBGLNum: TsdValue read FEndQcBGLNum;
  240. property EndPcQuantity: TsdValue read FEndPcQuantity;
  241. property EndPcTotalPrice: TsdValue read FEndPcTotalPrice;
  242. property EndPcBGLCode: TsdValue read FEndPcBGLCode;
  243. property EndPcBGLNum: TsdValue read FEndPcBGLNum;
  244. property EndGatherQuantity: TsdValue read FEndGatherQuantity;
  245. property EndGatherTotalPrice: TsdValue read FEndGatherTotalPrice;
  246. property PreDealQuantity: TsdValue read FPreDealQuantity;
  247. property PreDealTotalPrice: TsdValue read FPreDealTotalPrice;
  248. property PreQcQuantity: TsdValue read FPreQcQuantity;
  249. property PreQcTotalPrice: TsdValue read FPreQcTotalPrice;
  250. property PreQcBGLCode: TsdValue read FPreQcBGLCode;
  251. property PreQcBGLNum: TsdValue read FPreQcBGLNum;
  252. property PrePcQuantity: TsdValue read FPrePcQuantity;
  253. property PrePcTotalPrice: TsdValue read FPrePcTotalPrice;
  254. property PrePcBGLCode: TsdValue read FPrePcBGLCode;
  255. property PrePcBGLNum: TsdValue read FPrePcBGLNum;
  256. property PreGatherQuantity: TsdValue read FPreGatherQuantity;
  257. property PreGatherTotalPrice: TsdValue read FPreGatherTotalPrice;
  258. property HasBookMark: TsdValue read FHasBookMark;
  259. property MarkMemo: TsdValue read FMarkMemo;
  260. property CacheDealTP: Double read FCacheDealTP write FCacheDealTP;
  261. property PM_PreTotalPrice: TsdValue read FPM_PreTotalPrice;
  262. property PM_TotalPrice: TsdValue read FPM_TotalPrice;
  263. end;
  264. TProjectGLRecord = class(TMeasureBaseRecord)
  265. private
  266. FID: TsdValue;
  267. FCode: TsdValue;
  268. FName: TsdValue;
  269. FUnits: TsdValue;
  270. FSpecs: TsdValue;
  271. FBasePrice: TsdValue;
  272. FRiskRange: TsdValue;
  273. FLockedPhaseID: TsdValue;
  274. FCreatePhaseID: TsdValue;
  275. FInfoPrice: TsdValue;
  276. FInfoDate: TsdValue;
  277. FDeltaPrice: TsdValue;
  278. FValidDeltaPrice: TsdValue;
  279. FPM_PreQuantity: TsdValue;
  280. FPM_PreTotalPrice: TsdValue;
  281. FPM_Quantity: TsdValue;
  282. FPM_TotalPrice: TsdValue;
  283. protected
  284. procedure DoAfterAddFields; override;
  285. public
  286. property ID: TsdValue read FID;
  287. property Code: TsdValue read FCode;
  288. property Name: TsdValue read FName;
  289. property Units: TsdValue read FUnits;
  290. property Specs: TsdValue read FSpecs;
  291. property BasePrice: TsdValue read FBasePrice;
  292. property RiskRange: TsdValue read FRiskRange;
  293. property LockedPhaseID: TsdValue read FLockedPhaseID;
  294. property CreatePhaseID: TsdValue read FCreatePhaseID;
  295. property InfoPrice: TsdValue read FInfoPrice;
  296. property InfoDate: TsdValue read FInfoDate;
  297. property DeltaPrice: TsdValue read FDeltaPrice;
  298. property ValidDeltaPrice: TsdValue read FValidDeltaPrice;
  299. property PM_PreQuantity: TsdValue read FPM_PreQuantity;
  300. property PM_PreTotalPrice: TsdValue read FPM_PreTotalPrice;
  301. property PM_Quantity: TsdValue read FPM_Quantity;
  302. property PM_TotalPrice: TsdValue read FPM_TotalPrice;
  303. end;
  304. TDetailGLRecord = class(TMeasureBaseRecord)
  305. private
  306. FID: TsdValue;
  307. FBillsID: TsdValue;
  308. FGLID: TsdValue;
  309. FCode: TsdValue;
  310. FQuantity: TsdValue;
  311. FCreatePhaseID: TsdValue;
  312. FLastBillsQuantity: TsdValue;
  313. FLockedPhaseID: TsdValue;
  314. FRelaProjectGL: TProjectGLRecord;
  315. protected
  316. procedure DoAfterAddFields; override;
  317. public
  318. property ID: TsdValue read FID;
  319. property BillsID: TsdValue read FBillsID;
  320. property GLID: TsdValue read FGLID;
  321. property Code: TsdValue read FCode;
  322. property Quantity: TsdValue read FQuantity;
  323. property CreatePhaseID: TsdValue read FCreatePhaseID;
  324. property LastBillsQuantity: TsdValue read FLastBillsQuantity;
  325. property LockedPhaseID: TsdValue read FLockedPhaseID;
  326. property RelaProjectGL: TProjectGLRecord read FRelaProjectGL write FRelaProjectGL;
  327. end;
  328. implementation
  329. { TBillsRecord }
  330. procedure TBillsRecord.DoAfterAddFields;
  331. begin
  332. inherited;
  333. FID := ValueByName('ID');
  334. FParentID := ValueByName('ParentID');
  335. FNextSiblingID := ValueByName('NextSiblingID');
  336. FSerialNo := ValueByName('SerialNo');
  337. FIsLeaf := ValueByName('IsLeaf');
  338. FLeafXmjParentID := ValueByName('LeafXmjParentID');
  339. FXiangCode := ValueByName('XiangCode');
  340. FMuCode := ValueByName('MuCode');
  341. FJieCode := ValueByName('JieCode');
  342. FXimuCode := ValueByName('XimuCode');
  343. FIndexCode := ValueByName('IndexCode');
  344. FCode := ValueByName('Code');
  345. FB_Code := ValueByName('B_Code');
  346. FName := ValueByName('Name');
  347. FUnits := ValueByName('Units');
  348. FAlias := ValueByName('Alias');
  349. FPrice := ValueByName('Price');
  350. FNewPrice := ValueByName('NewPrice');
  351. FOrgQuantity := ValueByName('OrgQuantity');
  352. FOrgTotalPrice := ValueByName('OrgTotalPrice');
  353. FMisQuantity := ValueByName('MisQuantity');
  354. FMisTotalPrice := ValueByName('MisTotalPrice');
  355. FOthQuantity := ValueByName('OthQuantity');
  356. FOthTotalPrice := ValueByName('OthTotalPrice');
  357. FQuantity := ValueByName('Quantity');
  358. FTotalPrice := ValueByName('TotalPrice');
  359. FCalcType := ValueByName('CalcType');
  360. FAddDealQuantity := ValueByName('AddDealQuantity');
  361. FAddDealTotalPrice := ValueByName('AddDealTotalPrice');
  362. FAddQcQuantity := ValueByName('AddQcQuantity');
  363. FAddQcTotalPrice := ValueByName('AddQcTotalPrice');
  364. FAddQcBGLCode := ValueByName('AddQcBGLCode');
  365. FAddQcBGLNum := ValueByName('AddQcBGLNum');
  366. FAddPcQuantity := ValueByName('AddPcQuantity');
  367. FAddPcTotalPrice := ValueByName('AddPcTotalPrice');
  368. FAddPcBGLCode := ValueByName('AddPcBGLCode');
  369. FAddPcBGLNum := ValueByName('AddPcBGLNum');
  370. FAddGatherQuantity := ValueByName('AddGatherQuantity');
  371. FAddGatherTotalPrice := ValueByName('AddGatherTotalPrice');
  372. FLockLevel := ValueByName('LockLevel');
  373. FLockInfo := ValueByName('LockInfo');
  374. FLockNewPrice := ValueByName('LockNewPrice');
  375. FCreatePhaseID := ValueByName('CreatePhaseID');
  376. FIsMeasureAdd := ValueByName('IsMeasureAdd');
  377. FPeg := ValueByName('Peg');
  378. FDrawingCode := ValueByName('DrawingCode');
  379. FMemoStr := ValueByName('MemoStr');
  380. FDgnQuantity1 := ValueByName('DgnQuantity1');
  381. FDgnQuantity2 := ValueByName('DgnQuantity2');
  382. FDgnPrice := ValueByName('DgnPrice');
  383. FDealDgnQuantity1 := ValueByName('DealDgnQuantity1');
  384. FDealDgnQuantity2 := ValueByName('DealDgnQuantity2');
  385. FCDgnQuantity1 := ValueByName('CDgnQuantity1');
  386. FCDgnQuantity2 := ValueByName('CDgnQuantity2');
  387. FAddDgnPrice := ValueByName('AddDgnPrice');
  388. FHasBookMark := ValueByName('HasBookMark');
  389. FMarkMemo := ValueByName('MarkMemo');
  390. FDealCode := ValueByName('DealCode');
  391. FDealCompany := ValueByName('DealCompany');
  392. FDealType := ValueByName('DealType');
  393. FAddCutTotalPrice := ValueByName('AddCutTotalPrice');
  394. FAddPayTotalPrice := ValueByName('AddPayTotalPrice');
  395. FAddCompleteRate := ValueByName('AddCompleteRate');
  396. FPM_AddTotalPrice := ValueByName('PM_AddTotalPrice');
  397. end;
  398. { TStageRecord }
  399. procedure TStageRecord.DoAfterAddFields;
  400. begin
  401. inherited;
  402. FBillsID := ValueByName('BillsID');
  403. FDealQuantity := ValueByName('DealQuantity');
  404. FDealTotalPrice := ValueByName('DealTotalPrice');
  405. FDealFlag := ValueByName('DealFlag');
  406. FDealFormula := ValueByName('DealFormula');
  407. FQcQuantity := ValueByName('QcQuantity');
  408. FQcTotalPrice := ValueByName('QcTotalPrice');
  409. FQcFlag := ValueByName('QcFlag');
  410. FQcFormula := ValueByName('QcFormula');
  411. FQcBGLCode := ValueByName('QcBGLCode');
  412. FQcBGLNum := ValueByName('QcBGLNum');
  413. FPcQuantity := ValueByName('PcQuantity');
  414. FPcTotalPrice := ValueByName('PcTotalPrice');
  415. FPcFlag := ValueByName('PcFlag');
  416. FPcFormula := ValueByName('PcFormula');
  417. FPcBGLCode := ValueByName('PcBGLCode');
  418. FPcBGLNum := ValueByName('PcBGLNum');
  419. FGatherQuantity := ValueByName('GatherQuantity');
  420. FGatherTotalPrice := ValueByName('GatherTotalPrice');
  421. FEndDealQuantity := ValueByName('EndDealQuantity');
  422. FEndDealTotalPrice := ValueByName('EndDealTotalPrice');
  423. FEndQcQuantity := ValueByName('EndQcQuantity');
  424. FEndQcTotalPrice := ValueByName('EndQcTotalPrice');
  425. FEndQcBGLCode := ValueByName('EndQcBGLCode');
  426. FEndQcBGLNum := ValueByName('EndQcBGLNum');
  427. FEndPcQuantity := ValueByName('EndPcQuantity');
  428. FEndPcTotalPrice := ValueByName('EndPcTotalPrice');
  429. FEndPcBGLCode := ValueByName('EndPcBGLCode');
  430. FEndPcBGLNum := ValueByName('EndPcBGLNum');
  431. FEndGatherQuantity := ValueByName('EndGatherQuantity');
  432. FEndGatherTotalPrice := ValueByName('EndGatherTotalPrice');
  433. FPreDealQuantity := ValueByName('PreDealQuantity');
  434. FPreDealTotalPrice := ValueByName('PreDealTotalPrice');
  435. FPreQcQuantity := ValueByName('PreQcQuantity');
  436. FPreQcTotalPrice := ValueByName('PreQcTotalPrice');
  437. FPreQcBGLCode := ValueByName('PreQcBGLCode');
  438. FPreQcBGLNum := ValueByName('PreQcBGLNum');
  439. FPrePcQuantity := ValueByName('PrePcQuantity');
  440. FPrePcTotalPrice := ValueByName('PrePcTotalPrice');
  441. FPrePcBGLCode := ValueByName('PrePcBGLCode');
  442. FPrePcBGLNum := ValueByName('PrePcBGLNum');
  443. FPreGatherQuantity := ValueByName('PreGatherQuantity');
  444. FPreGatherTotalPrice := ValueByName('PreGatherTotalPrice');
  445. FHasBookMark := ValueByName('HasBookMark');
  446. FMarkMemo := ValueByName('MarkMemo');
  447. FPM_PreTotalPrice := ValueByName('PM_PreTotalPrice');
  448. FPM_TotalPrice := ValueByName('PM_TotalPrice');
  449. end;
  450. { TProjectGLRecord }
  451. procedure TProjectGLRecord.DoAfterAddFields;
  452. begin
  453. inherited;
  454. FID := ValueByName('ID');
  455. FCode := ValueByName('Code');
  456. FName := ValueByName('Name');
  457. FUnits := ValueByName('Units');
  458. FSpecs := ValueByName('Specs');
  459. FBasePrice := ValueByName('BasePrice');
  460. FRiskRange := ValueByName('RiskRange');
  461. FLockedPhaseID := ValueByName('LockedPhaseID');
  462. FCreatePhaseID := ValueByName('CreatePhaseID');
  463. FInfoPrice := ValueByName('InfoPrice');
  464. FInfoDate := ValueByName('InfoDate');
  465. FDeltaPrice := ValueByName('DeltaPrice');
  466. FValidDeltaPrice := ValueByName('ValidDeltaPrice');
  467. FPM_PreQuantity := ValueByName('PM_PreQuantity');
  468. FPM_PreTotalPrice := ValueByName('PM_PreTotalPrice');
  469. FPM_Quantity := ValueByName('PM_Quantity');
  470. FPM_TotalPrice := ValueByName('PM_TotalPrice');
  471. end;
  472. { TDetailGLRecord }
  473. procedure TDetailGLRecord.DoAfterAddFields;
  474. begin
  475. inherited;
  476. FID := ValueByName('ID');
  477. FBillsID := ValueByName('BillsID');
  478. FGLID := ValueByName('GLID');
  479. FCode := ValueByName('Code');
  480. FQuantity := ValueByName('Quantity');
  481. FCreatePhaseID := ValueByName('CreatePhaseID');
  482. FLastBillsQuantity := ValueByName('LastBillsQuantity');
  483. FLockedPhaseID := ValueByName('LockedPhaseID');
  484. end;
  485. { TMeasureBaseRecord }
  486. procedure TMeasureBaseRecord.AddDifferValue(AValue: TsdValue;
  487. ADiffer: Double);
  488. begin
  489. if ADiffer <> 0 then
  490. AValue.AsFloat := AValue.AsFloat + ADiffer;
  491. end;
  492. procedure TMeasureBaseRecord.SetBoolValue(AValue: TsdValue;
  493. ABool: Boolean);
  494. begin
  495. if AValue.AsBoolean <> ABool then
  496. AValue.AsBoolean := ABool;
  497. end;
  498. procedure TMeasureBaseRecord.SetFloatValue(AValue: TsdValue;
  499. AFloat: Double);
  500. begin
  501. if AValue.AsFloat <> AFloat then
  502. AValue.AsFloat := AFloat;
  503. end;
  504. procedure TMeasureBaseRecord.SetIntValue(AValue: TsdValue; AInt: Integer);
  505. begin
  506. if AValue.AsInteger <> AInt then
  507. AValue.AsInteger := AInt;
  508. end;
  509. procedure TMeasureBaseRecord.SetStrValue(AValue: TsdValue; AStr: string);
  510. begin
  511. if AValue.AsString <> AStr then
  512. AValue.AsString := AStr;
  513. end;
  514. end.