FPSMS-frontend
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 

164 行
3.5 KiB

  1. import { cache } from "react";
  2. import "server-only";
  3. // import { serverFetchJson } from "@/app/utils/fetchUtil";
  4. // import { BASE_API_URL } from "@/config/api";
  5. import { serverFetchJson } from "../../utils/fetchUtil";
  6. import { BASE_API_URL } from "../../../config/api";
  7. import { Uom } from "../settings/uom";
  8. import { RecordsRes } from "../utils";
  9. import { QcFormInput, QcResult } from "../qc";
  10. import { EscalationResult } from "../escalation";
  11. export enum StockInStatus {
  12. PENDING = "pending",
  13. RECEIVED = "received",
  14. APPROVED = "escalated",
  15. REJECTED = "rejected",
  16. COMPLETED = "completed",
  17. PARTIALLY_COMPLETED = "partially_completed",
  18. }
  19. export interface StockInLineInput {
  20. id?: number;
  21. itemId?: number;
  22. acceptedQty?: number;
  23. receivedQty?: number;
  24. status?: string;
  25. expiryDate?: string;
  26. productLotNo?: string;
  27. receiptDate?: string;
  28. dnDate?: number[];
  29. dnNo?: string;
  30. }
  31. export interface StockInInput {
  32. stockInId?: number;
  33. poCode?: string;
  34. productLotNo?: string;
  35. dnNo?: string;
  36. dnDate?: string;
  37. itemName?: string;
  38. lotNo?: string;
  39. invoiceNo?: string;
  40. receiptDate: string;
  41. supplier?: string;
  42. acceptedQty: number;
  43. qty: number;
  44. receivedQty: number;
  45. acceptedWeight?: number;
  46. productionDate?: string;
  47. expiryDate: string;
  48. uom?: Uom;
  49. }
  50. export interface PoResult {
  51. id: number;
  52. code: string;
  53. orderDate: string;
  54. supplier: string;
  55. estimatedArrivalDate: string;
  56. completedDate: string;
  57. itemDetail?: string;
  58. itemCode?: string;
  59. itemName?: string;
  60. itemQty?: string;
  61. itemSumAcceptedQty?: string;
  62. itemUom?: string;
  63. escalated: boolean;
  64. status: string;
  65. pol?: PurchaseOrderLine[];
  66. }
  67. export interface PurchaseOrderLine {
  68. id: number;
  69. purchaseOrderId: number;
  70. itemId: number;
  71. itemNo: string;
  72. itemName: string;
  73. qty: number;
  74. processed: number;
  75. receivedQty: number;
  76. uom: Uom;
  77. stockUom: StockUomForPoLine;
  78. price: number;
  79. status: string;
  80. stockInLine: StockInLine[];
  81. }
  82. export interface StockUomForPoLine {
  83. id: number;
  84. stockUomCode: string;
  85. stockUomDesc: string;
  86. stockQty: number;
  87. stockRatioN: number;
  88. stockRatioD: number;
  89. purchaseRatioN: number;
  90. purchaseRatioD: number;
  91. }
  92. export interface StockInLine {
  93. id: number;
  94. stockInId?: number;
  95. purchaseOrderId?: number;
  96. purchaseOrderLineId: number;
  97. jobOrderId: number;
  98. itemId: number;
  99. itemNo: string;
  100. itemName: string;
  101. itemType: string;
  102. demandQty: number;
  103. acceptedQty: number;
  104. qty?: number;
  105. receivedQty?: number;
  106. processed?: number;
  107. price?: number;
  108. priceUnit?: string;
  109. shelfLife?: number;
  110. receiptDate?: string;
  111. productionDate?: string;
  112. productLotNo?: string;
  113. expiryDate?: string;
  114. status: string;
  115. supplier?: string;
  116. lotNo?: string;
  117. poCode?: string;
  118. uom?: Uom;
  119. defaultWarehouseId: number; // id for now
  120. dnNo?: string;
  121. dnDate?: number[];
  122. stockQty?: number;
  123. handlerId?: number;
  124. putAwayLines?: PutAwayLine[];
  125. qcResult?: QcResult[];
  126. escResult?: EscalationResult[];
  127. }
  128. export interface EscalationInput {
  129. status: string;
  130. remarks?: string;
  131. reason?: string;
  132. handlerId: number;
  133. productLotNo?: string;
  134. acceptedQty?: number; // this is the qty to be escalated
  135. // escalationQty: number
  136. }
  137. export interface PutAwayLine {
  138. id?: number
  139. qty: number
  140. warehouseId: number;
  141. warehouse: string;
  142. printQty: number;
  143. _isNew?: boolean;
  144. }
  145. export interface PutAwayInput {
  146. status: string;
  147. acceptedQty: number;
  148. warehouseId: number;
  149. putAwayLines: PutAwayLine[]
  150. }
  151. export type ModalFormInput = Partial<
  152. QcFormInput & StockInInput & PutAwayInput
  153. > & {
  154. escalationLog? : Partial<EscalationInput>
  155. };