纽威
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

491 lines
25 KiB

3 years ago
  1. using ICSSoft.Common;
  2. using ICSSoft.Entity;
  3. using Newtonsoft.Json;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Data;
  7. using System.Data.SqlClient;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. namespace ICSSoft.DataProject
  12. {
  13. /// <summary>
  14. /// 销售出库单
  15. /// </summary>
  16. public class SalesShipmentDoc
  17. {
  18. private static log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
  19. private static string connString = System.Configuration.ConfigurationManager.AppSettings["ERPConnStr"];
  20. private static string ERPDB = System.Configuration.ConfigurationManager.AppSettings["ERPDB"];
  21. private static string Type = System.Configuration.ConfigurationManager.AppSettings["Type"];
  22. string bustype = string.Empty;
  23. /// <summary>
  24. /// 获取销售出库单
  25. /// </summary>
  26. /// <param name="infos"></param>
  27. /// <returns></returns>
  28. public string Get(List<ICSSalesShipmentDoc> infos)
  29. {
  30. List<ICSSalesShipmentDoc> szJson = new List<ICSSalesShipmentDoc>();
  31. DataTable dt = null;
  32. string json = "";
  33. if (infos.Count <= 0)
  34. {
  35. throw new Exception("传送数据为空!");
  36. }
  37. string res = string.Empty;
  38. SqlConnection conn = new System.Data.SqlClient.SqlConnection(connString);
  39. conn.Open();
  40. SqlTransaction sqlTran = conn.BeginTransaction();
  41. SqlCommand cmd = new SqlCommand();
  42. cmd.Transaction = sqlTran;
  43. cmd.Connection = conn;
  44. try
  45. {
  46. string sql = string.Empty;
  47. foreach (ICSSalesShipmentDoc info in infos)
  48. {
  49. if (info.MTime < new DateTime(2000, 01, 01))
  50. throw new Exception("请输入正确的操作时间:" + info.MTime);
  51. sql = @" select a.ID,a.cCode,a.cCusCode,c.cCusName,a.cWhCode,d.cWhName,e.cordercode ,a.cMaker ,a.dnmaketime ,a.cHandler ,a.dnverifytime ,
  52. b.AutoID,b.iRSRowNO ,b.cInvCode ,b.iQuantity ,b.iNum,e.AutoID
  53. from rdrecord32 a
  54. inner join rdrecords32 b on a.ID=b.ID
  55. left join DispatchLists e on a.cDLCode=e.DLID
  56. left join Customer c on a.cCusCode=c.cCusCode
  57. left join Warehouse d on a.cWhCode=d.cWhCode WHERE 1=1 ";
  58. if (!string.IsNullOrWhiteSpace(info.SSDCode))
  59. {
  60. sql += " and a.cCode='{0}'";
  61. }
  62. if (!string.IsNullOrWhiteSpace(info.MTime.ToString()))
  63. {
  64. sql += " and ISNULL(a.dnmodifytime ,ISNULL(a.dnverifytime , ISNULL(a.dnmodifytime , a.dnmaketime )))>='{1}'";
  65. }
  66. if (!string.IsNullOrWhiteSpace(info.User))
  67. {
  68. sql += "and a.CMAKER='{2}'";
  69. }
  70. sql = string.Format(sql, info.SSDCode, info.MTime, info.User);
  71. dt = DBHelper.SQlReturnData(sql, cmd);
  72. if (dt.Rows.Count <= 0 || dt == null)
  73. throw new Exception("销售出库单号:" + info.SSDCode + ",无信息!");
  74. json = JsonConvert.SerializeObject(dt);
  75. }
  76. cmd.Transaction.Commit();
  77. return json;
  78. }
  79. catch (Exception ex)
  80. {
  81. cmd.Transaction.Rollback();
  82. log.Error(ex.Message);
  83. throw new Exception(ex.Message);
  84. }
  85. finally
  86. {
  87. if (conn.State == ConnectionState.Open)
  88. {
  89. conn.Close();
  90. }
  91. conn.Dispose();
  92. }
  93. }
  94. /// <summary>
  95. /// 创建销售出库单
  96. /// </summary>
  97. /// <param name="Bills"></param>
  98. /// <returns></returns>
  99. public string CreateSalesShipmentDoc(List<ICSSalesShipmentDoc> Bills)
  100. {
  101. string sql = "";
  102. string msg = "";
  103. DataTable dt = null;
  104. int iFatherId = 0;
  105. int iChildId = 0;
  106. string iFatherIdTwo = "";
  107. //bool ResultFlag = false;
  108. SqlConnection conn = new System.Data.SqlClient.SqlConnection(connString);
  109. conn.Open();
  110. SqlTransaction sqlTran = conn.BeginTransaction();
  111. SqlCommand cmd = new SqlCommand();
  112. cmd.Transaction = sqlTran;
  113. cmd.Connection = conn;
  114. VouchKey key = new VouchKey();
  115. try
  116. {
  117. if (Bills.Count <= 0)
  118. {
  119. throw new Exception("传送数据为空!");
  120. }
  121. LogInfo(Bills);
  122. foreach (ICSSalesShipmentDoc head in Bills)
  123. {
  124. #region 检查 发货单状态
  125. sql = @"SELECT a.DLID,a.cBusType,c.cRdCode,a.cSTCode,b.AutoID,b.irowno,a.cPersonCode,a.cCusCode,b.iDLsID,
  126. a.cMemo,a.cShipAddress,a.cDepCode,cCusInvName,b.cBatch,a.caddcode,a.cCloser,a.cVerifier FROM dbo.DispatchList a INNER JOIN
  127. dbo.DispatchLists b ON a.DLID=b.DLID
  128. LEFT JOIN dbo.SaleType c ON c.cSTCode=a.cSTCode
  129. WHERE a.cDLCode ='" + head.SDNCode + "'";
  130. cmd.CommandText = sql;
  131. DataTable dtDisCheck = DBHelper.SQlReturnData(sql, cmd);
  132. if (dtDisCheck != null && dtDisCheck.Rows.Count > 0)
  133. {
  134. foreach (DataRow item in dtDisCheck.Rows)
  135. {
  136. if (!string.IsNullOrEmpty(item["cCloser"].ToString()))
  137. {
  138. log.Info("DLID:" + head.ID);
  139. throw new Exception("ERP发货单已关闭,无法发货!发货单号:" + head.details);
  140. }
  141. }
  142. bustype = dtDisCheck.Rows[0]["cBusType"].ToString();
  143. }
  144. else
  145. {
  146. throw new Exception("销售发货单单号:" + head.ID + "在ERP内不存在!");
  147. }
  148. #endregion
  149. #region 检验发货单数量
  150. foreach (ICSSalesShipmentDocs body in head.details)
  151. {
  152. sql = "SELECT isnull(fOutQuantity,0) as fOutQuantity,ABS(iQuantity) as iQuantity FROM dbo.DispatchLists WHERE AutoID='" + body.SDNDetailID + "'";
  153. DataTable dtfOutQty = DBHelper.SQlReturnData(sql, cmd);
  154. if (dtfOutQty != null && dtfOutQty.Rows.Count > 0)
  155. {
  156. decimal fOutQty = Convert.ToDecimal(dtfOutQty.Rows[0]["fOutQuantity"]);
  157. decimal iQuantity = Convert.ToDecimal(dtfOutQty.Rows[0]["iQuantity"]);
  158. if (fOutQty + body.Quantity > iQuantity)
  159. {
  160. throw new Exception("可出库数量超过发货单表体出库数量!");
  161. }
  162. }
  163. else
  164. {
  165. throw new Exception("发货单表体不存在!");
  166. }
  167. }
  168. #endregion
  169. #region 销售出库单表头
  170. int num = 0;
  171. foreach (ICSSalesShipmentDoc heads in Bills)
  172. {
  173. num = heads.details.Count();
  174. }
  175. DateTime time = DateTime.Now;
  176. Dictionary<string, int> dic = DBHelper.GetAllCode("" + ERPDB + "", "ShipmentDoc", "" + num + "");
  177. iFatherId = Convert.ToInt32(dic["iFatherId"].ToString());
  178. iChildId = Convert.ToInt32(dic["iChildId"].ToString());
  179. DateTime date = DateTime.Now;
  180. string iBaseCodeLen = DBHelper.GetAllRDCode("0303", "" + time + "", "admin");
  181. sql = @"INSERT INTO dbo.rdrecord32
  182. ( ID ,bRdFlag ,cVouchType ,cBusType ,cSource ,cBusCode ,cWhCode ,
  183. dDate ,cCode ,cRdCode ,cDepCode ,cPersonCode ,cSTCode ,cCusCode ,
  184. cDLCode ,cHandler ,cMemo ,bTransFlag ,cMaker ,cDefine1 ,cDefine2 ,
  185. cDefine3 ,cDefine4 ,cDefine5 ,cDefine6 ,cDefine7 ,cDefine8 ,cDefine9 ,
  186. cDefine10 ,dVeriDate ,bpufirst ,biafirst ,VT_ID ,bIsSTQc ,cDefine11 ,
  187. cDefine12 ,cDefine13 ,cDefine14 ,cDefine15 ,cDefine16 ,cShipAddress ,
  188. caddcode ,bOMFirst ,bFromPreYear ,bIsComplement ,iDiscountTaxType ,
  189. ireturncount ,iverifystate ,iswfcontrolled ,dnmaketime ,dnverifytime ,
  190. iPrintCount ,cinvoicecompany)
  191. SELECT @ID,0,32,a.cBusType,'',a.cDLCode,@cWhCode,
  192. CONVERT(NVARCHAR(15),GETDATE(),23),@cCode,'21',a.cDepCode,a.cPersonCode,a.cSTCode,a.cCusCode,
  193. a.DLID,@cHandler,a.cMemo,0,@cMaker,a.cDefine1,a.cDefine2,
  194. a.cDefine3,a.cDefine4,a.cDefine5,a.cDefine6,a.cDefine7,a.cDefine8,a.cDefine9,
  195. a.cDefine10,CONVERT(NVARCHAR(15),GETDATE(),23),0,0,@VT_ID,0,a.cDefine11,
  196. a.cDefine12,a.cDefine13,a.cDefine14,a.cDefine15,a.cDefine16,a.cShipAddress,
  197. a.caddcode,null,0,0,0,
  198. 0,0,0,GETDATE(),GETDATE(),
  199. 0,a.cinvoicecompany
  200. FROM dbo.DispatchList a WHERE a.cDLCode ='" + head.SDNCode + "'";
  201. cmd.Parameters.Clear();
  202. cmd.Parameters.Add(new SqlParameter("@ID", iFatherId));
  203. cmd.Parameters.Add(new SqlParameter("@cWhCode",head.WHCode));
  204. cmd.Parameters.Add(new SqlParameter("@cCode", iBaseCodeLen));
  205. cmd.Parameters.Add(new SqlParameter("@cDepCode", ""));
  206. cmd.Parameters.Add(new SqlParameter("@cHandler", head.User));
  207. cmd.Parameters.Add(new SqlParameter("@cMaker", head.User));
  208. cmd.Parameters.Add(new SqlParameter("@VT_ID", iChildId));
  209. //cmd.Parameters.Add(new SqlParameter("@dDate", data.dMate));
  210. cmd.CommandText = sql;
  211. try
  212. {
  213. int count = cmd.ExecuteNonQuery();
  214. if (count <= 0)
  215. {
  216. log.Error("生成销售出库单表头失败,受影响行数<=0;");
  217. throw new Exception("生成销售出库单表头失败,受影响行数<=0;");
  218. }
  219. }
  220. catch (Exception ex)
  221. {
  222. log.Error("生成销售出库单表头失败!销售出库单号:" + head.SSDCode + ";异常:" + ex.Message + ";SQL:\r\n" + sql, ex);
  223. throw new Exception("生成销售出库单表头失败!销售出库单号:" + head.SSDCode + ";异常:" + ex.Message + ";SQL:\r\n" + sql, ex);
  224. }
  225. #endregion
  226. #region 销售出库单表体
  227. foreach (ICSSalesShipmentDocs body in head.details)
  228. {
  229. //if (head.IsReturn == "1")
  230. //{
  231. // body.iQuantity = -body.iQuantity;
  232. //}
  233. //else
  234. //{
  235. //判断物料批号与现存量表批号是否一致、数量不能超过现存量物料数量
  236. sql = @"SELECT cBatch,iQuantity from CurrentStock WHERE cInvCode='" + body.InvCode + "'AND cBatch='" + "" + "'and cWhCode='" + head.WHCode + "'";
  237. DataTable dtItem = DBHelper.SQlReturnData(sql, cmd);
  238. if (dtItem != null && dtItem.Rows.Count > 0)
  239. {
  240. //if (!dtItem.Rows[0]["cBatch"].ToString().Equals(body.cBatch))
  241. //{
  242. // throw new Exception("物料条码的批号与U8现存量物料批号不一致,物料:" + body.cInvCode);
  243. //}
  244. if (Convert.ToDecimal(dtItem.Rows[0]["iQuantity"].ToString()) < body.Quantity)
  245. {
  246. throw new Exception("物料条码的数量大于U8现存量物料数量,物料:" + body.InvCode);
  247. }
  248. }
  249. else
  250. {
  251. throw new Exception("物料:" + body.InvCode + "在现存量表中不存在!");
  252. }
  253. //}
  254. sql = @"INSERT INTO dbo.rdrecords32
  255. ( AutoID ,ID ,cInvCode ,iQuantity ,cBatch ,iFlag ,
  256. cDefine22 ,cDefine23 ,cDefine24 ,cDefine25 ,cDefine26 ,
  257. cDefine27 ,cItem_class ,cItemCode ,iDLsID ,iNQuantity ,
  258. cDefine28 ,cDefine29 ,cDefine30 ,cDefine31 ,cDefine32 ,
  259. cDefine33 ,cDefine34 ,cDefine35 ,cDefine36 ,cDefine37 ,
  260. bLPUseFree ,iRSRowNO ,iOriTrackID ,ccusinvcode,ccusinvname,bCosting ,bVMIUsed ,
  261. cbdlcode ,iExpiratDateCalcu ,iorderdid ,iordertype ,
  262. iordercode ,iorderseq ,ipesodid ,ipesotype ,cpesocode ,
  263. ipesoseq ,isodid ,isotype ,csocode ,isoseq ,irowno ,
  264. bIAcreatebill ,bsaleoutcreatebill ,isaleoutid ,bneedbill,iposflag )
  265. SELECT @AutoID,@ID,@cInvCode,@iQuantity,@cBatch,0,
  266. a.cDefine22,a.cDefine23,a.cDefine24,a.cDefine25,a.cDefine26,
  267. a.cDefine27,a.cItem_class,a.cItemCode,a.iDLsID,a.iQuantity,
  268. a.cDefine28,a.cDefine29,a.cDefine30,a.cDefine31,a.cDefine32,
  269. a.cDefine33,a.cDefine34,a.cDefine35,a.cDefine36,a.cDefine37,
  270. 0,0,0,a.cCusInvCode,a.cCusInvName,1,0,
  271. b.cDLCode,0,a.iSOsID,1,
  272. d.cSOCode,c.iRowNo,a.iSOsID,1,d.cSOCode,
  273. 1,a.iSOsID,1,d.cSOCode,c.iRowNo,@irowno,
  274. 1,1,@AutoID,1,null
  275. FROM dbo.DispatchLists a
  276. INNER JOIN dbo.DispatchList b ON a.DLID=b.DLID
  277. LEFT JOIN dbo.SO_SODetails c ON a.iSOsID=c.iSOsID
  278. LEFT JOIN dbo.SO_SOMain d ON c.ID=d.ID WHERE a.AutoID='" + body.SDNDetailID + "'";
  279. cmd.Parameters.Clear();
  280. cmd.Parameters.Add(new SqlParameter("@AutoID", iChildId));
  281. cmd.Parameters.Add(new SqlParameter("@ID", iFatherId));
  282. cmd.Parameters.Add(new SqlParameter("@cInvCode",body.InvCode));
  283. cmd.Parameters.Add(new SqlParameter("@iQuantity",body.Quantity));
  284. cmd.Parameters.Add(new SqlParameter("@cBatch", ""));
  285. cmd.Parameters.Add(new SqlParameter("@irowno",body.Sequence));
  286. cmd.CommandText = sql;
  287. try
  288. {
  289. int count = cmd.ExecuteNonQuery();
  290. if (count <= 0)
  291. {
  292. log.Error("生成销售出库单表体失败,受影响行数<=0;");
  293. throw new Exception("生成销售出库单表体失败,受影响行数<=0;");
  294. }
  295. }
  296. catch (Exception ex)
  297. {
  298. log.Error("生成销售出库单表体失败!销售出库单号:" + head.SSDCode + ";异常:" + ex.Message + ";SQL:\r\n" + sql, ex);
  299. throw new Exception("生成销售出库单表体失败!销售出库单号:" + head.SSDCode + ";异常:" + ex.Message + ";SQL:\r\n" + sql, ex);
  300. }
  301. #region 更新现存量 现存量表待出库数量扣减
  302. key.cBustypeUN = bustype;
  303. key.cVouchTypeUN = "32";
  304. key.TableName = "IA_ST_UnAccountVouch32";
  305. DBHelper.UpdateCurrentStock(cmd, body.InvCode, head.WHCode, "", -body.Quantity, key);
  306. #endregion
  307. log.Debug(sql);
  308. #region 回写销售订单累计发货数量,回写销售发货单累计出库数量
  309. sql = @"UPDATE a SET a.foutquantity=ISNULL(a.foutquantity,0)+" + body.Quantity + @"
  310. FROM dbo.SO_SODetails a LEFT JOIN dbo.DispatchLists b ON a.iSOsID=b.iSOsID
  311. WHERE b.AutoID='" + body.SDNDetailID + "'";
  312. DBHelper.CmdExecuteNonQuery(sql, cmd, "回写销售订单累计发货数量失败!");
  313. sql = "Update DispatchLists set fOutQuantity=isnull(fOutQuantity,0)+" + body.Quantity + " where AutoID='" + body.SDNDetailID + "' ";
  314. DBHelper.CmdExecuteNonQuery(sql, cmd, "回写销售发货单累计出库数量失败!");
  315. iChildId--;
  316. #endregion
  317. }
  318. #endregion
  319. iFatherIdTwo += "'" + iFatherId + "',";
  320. }
  321. #region 查询
  322. sql = @"select a.ID,a.cCode,a.cCusCode,c.cCusName,a.cWhCode,d.cWhName,e.cordercode ,a.cMaker ,a.dnmaketime ,a.cHandler ,a.dnverifytime ,
  323. b.AutoID,b.iRSRowNO ,b.cInvCode ,b.iQuantity ,b.iNum,e.AutoID
  324. from rdrecord32 a
  325. inner join rdrecords32 b on a.ID=b.ID
  326. left join DispatchLists e on a.cDLCode=e.DLID
  327. left join Customer c on a.cCusCode=c.cCusCode
  328. left join Warehouse d on a.cWhCode=d.cWhCode WHERE 1=1 and a.ID in({0}) ";
  329. sql = string.Format(sql, iFatherIdTwo.TrimEnd(','));
  330. dt = DBHelper.SQlReturnData(sql, cmd);
  331. #endregion
  332. msg = JsonConvert.SerializeObject(dt);
  333. cmd.Transaction.Commit();
  334. //ResultFlag = true;
  335. return msg;
  336. }
  337. catch (Exception ex)
  338. {
  339. cmd.Transaction.Rollback();
  340. log.Error(ex.Message);
  341. throw new Exception(ex.Message);
  342. }
  343. finally
  344. {
  345. if (conn.State == ConnectionState.Open)
  346. {
  347. conn.Close();
  348. }
  349. conn.Dispose();
  350. }
  351. }
  352. /// <summary>
  353. /// 审核销售出库单
  354. /// </summary>
  355. /// <param name="infos"></param>
  356. /// <returns></returns>
  357. public string Approve(List<ICSSalesShipmentDoc> infos)
  358. {
  359. List<ICSSalesShipmentDoc> szJson = new List<ICSSalesShipmentDoc>();
  360. DataTable dt = null;
  361. string json = "";
  362. if (infos.Count <= 0)
  363. {
  364. throw new Exception("传送数据为空!");
  365. }
  366. string res = string.Empty;
  367. SqlConnection conn = new System.Data.SqlClient.SqlConnection(connString);
  368. conn.Open();
  369. SqlTransaction sqlTran = conn.BeginTransaction();
  370. SqlCommand cmd = new SqlCommand();
  371. cmd.Transaction = sqlTran;
  372. cmd.Connection = conn;
  373. try
  374. {
  375. string sql = string.Empty;
  376. foreach (ICSSalesShipmentDoc info in infos)
  377. {
  378. if (info.MTime < new DateTime(2000, 01, 01))
  379. throw new Exception("请输入正确的操作时间:" + info.MTime);
  380. sql = @"UPDATE rdrecord32 SET cHandler ='" + info.User + @"' ,
  381. dnverifytime=CONVERT(VARCHAR(50),GETDATE(),112),dVeriDate=GETDATE() WHERE ID='{0}'";
  382. sql = string.Format(sql, info.ID);
  383. DBHelper.CmdExecuteNonQuery(sql, cmd, "审核销售出单失败!");
  384. }
  385. cmd.Transaction.Commit();
  386. return json;
  387. }
  388. catch (Exception ex)
  389. {
  390. cmd.Transaction.Rollback();
  391. log.Error(ex.Message);
  392. throw new Exception(ex.Message);
  393. }
  394. finally
  395. {
  396. if (conn.State == ConnectionState.Open)
  397. {
  398. conn.Close();
  399. }
  400. conn.Dispose();
  401. }
  402. }
  403. /// <summary>
  404. /// 删除销售出库单
  405. /// </summary>
  406. /// <param name="infos"></param>
  407. /// <returns></returns>
  408. public string Delete(List<ICSSalesShipmentDoc> infos)
  409. {
  410. List<ICSSalesShipmentDoc> szJson = new List<ICSSalesShipmentDoc>();
  411. if (infos.Count <= 0)
  412. {
  413. throw new Exception("传送数据为空!");
  414. }
  415. string res = string.Empty;
  416. SqlConnection conn = new System.Data.SqlClient.SqlConnection(connString);
  417. conn.Open();
  418. SqlTransaction sqlTran = conn.BeginTransaction();
  419. SqlCommand cmd = new SqlCommand();
  420. cmd.Transaction = sqlTran;
  421. cmd.Connection = conn;
  422. try
  423. {
  424. string sql = string.Empty;
  425. foreach (ICSSalesShipmentDoc info in infos)
  426. {
  427. if (info.MTime < new DateTime(2000, 01, 01))
  428. throw new Exception("请输入正确的操作时间:" + info.MTime);
  429. sql = @"delete rdrecord11 where rdrecord32.ID='" + info.ID + "'";
  430. sql += @"delete rdrecords11 where rdrecords32.ID='" + info.ID + "'";
  431. //UPDATE dbo.rdrecord11 a SET cHandler='" + info.User + @"' ,
  432. // dVeriDate=CONVERT(VARCHAR(50),GETDATE(),112),dnverifytime=GETDATE()
  433. // WHERE a.ID='" + info.ID + "'";
  434. DBHelper.CmdExecuteNonQuery(sql, cmd, "删除销售出单失败!");
  435. }
  436. cmd.Transaction.Commit();
  437. return res;
  438. ;
  439. }
  440. catch (Exception ex)
  441. {
  442. cmd.Transaction.Rollback();
  443. log.Error(ex.Message);
  444. throw new Exception(ex.Message);
  445. }
  446. finally
  447. {
  448. if (conn.State == ConnectionState.Open)
  449. {
  450. conn.Close();
  451. }
  452. conn.Dispose();
  453. }
  454. }
  455. /// <summary>
  456. ///
  457. /// 记录日志
  458. /// </summary>
  459. /// <param name="Bills"></param>
  460. private void LogInfo(List<ICSSalesShipmentDoc> Bills)
  461. {
  462. string HeadList = string.Empty;
  463. string BodyList = string.Empty;
  464. foreach (ICSSalesShipmentDoc head in Bills)
  465. {
  466. HeadList += "\r\n 表头主键ID:" + head.ID + ",仓库:" + head.WHCode + ",用户:" + head.User;
  467. foreach (ICSSalesShipmentDocs body in head.details)
  468. {
  469. BodyList += "\r\n 表体主键ID: " + body.SDNDetailID + ",数量:" + body.Quantity;
  470. }
  471. }
  472. log.Info(HeadList);
  473. log.Info(BodyList);
  474. }
  475. }
  476. }