FPSMS-frontend
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

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