DocTypeConvert.cs 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace cuidian.Common
  7. {
  8. public class DocTypeConvert
  9. {
  10. /// <summary>
  11. /// 根据单据类型获得中文说明
  12. /// </summary>
  13. /// <param name="docType"></param>
  14. /// <returns></returns>
  15. public static string ConvertToDesc(EnumDocType docType )
  16. {
  17. string desc = string.Empty;
  18. switch (docType)
  19. {
  20. case EnumDocType.SaleOrder:
  21. desc = "销售订单";
  22. break;
  23. case EnumDocType.PurchaseOrder:
  24. desc = "采购订单";
  25. break;
  26. case EnumDocType.TransVouch:
  27. desc = "调拨单";
  28. break;
  29. case EnumDocType.CheckVouch:
  30. desc = "盘点单";
  31. break;
  32. case EnumDocType.Assemble:
  33. desc = "组装单";
  34. break;
  35. case EnumDocType.DisAssemble:
  36. desc = "拆卸单";
  37. break;
  38. case EnumDocType.ArrivalVouch:
  39. desc = "采购到货单";
  40. break;
  41. case EnumDocType.RedArrivalVouch:
  42. desc = "采购退货单";
  43. break;
  44. case EnumDocType.RdRecord01:
  45. desc = "采购入库单";
  46. break;
  47. case EnumDocType.RedRdRecord01:
  48. desc = "红字采购入库单";
  49. break;
  50. case EnumDocType.RedDispatchlist:
  51. desc = "销售退货单";
  52. break;
  53. case EnumDocType.Dispatchlist:
  54. desc = "销售发货单";
  55. break;
  56. case EnumDocType.RdRecord32:
  57. desc = "销售出库单";
  58. break;
  59. case EnumDocType.RedRdRecord32:
  60. desc = "红字销售出库单";
  61. break;
  62. case EnumDocType.RdRecord08:
  63. desc = "其他入库单";
  64. break;
  65. case EnumDocType.RdRecord09:
  66. desc = "其他出库单";
  67. break;
  68. default:
  69. break;
  70. }
  71. return desc;
  72. }
  73. /// <summary>
  74. /// 根据单据类型获得VoucherType
  75. /// </summary>
  76. /// <param name="docType"></param>
  77. /// <returns></returns>
  78. public static string ConvertToVoucherType(EnumDocType docType)
  79. {
  80. string voucherType = string.Empty;
  81. switch (docType)
  82. {
  83. case EnumDocType.SaleOrder:
  84. case EnumDocType.TransVouch:
  85. voucherType = "12";
  86. break;
  87. case EnumDocType.PurchaseOrder:
  88. voucherType = "1";
  89. break;
  90. case EnumDocType.CheckVouch:
  91. voucherType = "18";
  92. break;
  93. case EnumDocType.Assemble:
  94. voucherType = "13";
  95. break;
  96. case EnumDocType.DisAssemble:
  97. voucherType = "14";
  98. break;
  99. case EnumDocType.ArrivalVouch:
  100. case EnumDocType.RedArrivalVouch:
  101. voucherType = "2";
  102. break;
  103. case EnumDocType.RdRecord01:
  104. case EnumDocType.RedRdRecord01:
  105. voucherType = "01";
  106. break;
  107. case EnumDocType.Dispatchlist:
  108. voucherType = "9";
  109. break;
  110. case EnumDocType.RedDispatchlist:
  111. voucherType = "10";
  112. break;
  113. case EnumDocType.RdRecord32:
  114. case EnumDocType.RedRdRecord32:
  115. voucherType = "32";
  116. break;
  117. case EnumDocType.RdRecord08:
  118. voucherType = "08";
  119. break;
  120. case EnumDocType.RdRecord09:
  121. voucherType = "09";
  122. break;
  123. default:
  124. break;
  125. }
  126. return voucherType;
  127. }
  128. public static string ConvertToCardNum(EnumDocType docType)
  129. {
  130. string cardNum = string.Empty;
  131. switch (docType)
  132. {
  133. case EnumDocType.SaleOrder:
  134. cardNum = "17";
  135. break;
  136. case EnumDocType.PurchaseOrder:
  137. cardNum = "88";
  138. break;
  139. case EnumDocType.TransVouch:
  140. cardNum = "0304";
  141. break;
  142. case EnumDocType.CheckVouch:
  143. cardNum = "0307";
  144. break;
  145. case EnumDocType.Assemble:
  146. cardNum = "0308";
  147. break;
  148. case EnumDocType.DisAssemble:
  149. cardNum = "0309";
  150. break;
  151. case EnumDocType.ArrivalVouch:
  152. cardNum = "26";
  153. break;
  154. case EnumDocType.RedArrivalVouch:
  155. cardNum = "r26";
  156. break;
  157. case EnumDocType.RdRecord01:
  158. cardNum = "24";
  159. break;
  160. case EnumDocType.RedRdRecord01:
  161. cardNum = "r24";
  162. break;
  163. case EnumDocType.RedDispatchlist:
  164. cardNum = "r01";
  165. break;
  166. case EnumDocType.Dispatchlist:
  167. cardNum = "01";
  168. break;
  169. case EnumDocType.RdRecord32:
  170. cardNum = "0303";
  171. break;
  172. case EnumDocType.RedRdRecord32:
  173. cardNum = "r0303";
  174. break;
  175. case EnumDocType.RdRecord08:
  176. cardNum = "0301";
  177. break;
  178. case EnumDocType.RdRecord09:
  179. cardNum = "0302";
  180. break;
  181. default:
  182. break;
  183. }
  184. return cardNum;
  185. }
  186. }
  187. }