mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 15:55:48 +00:00
fix(resolve): fix resolve merge
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
npm run format
|
||||||
|
npm run lint
|
||||||
|
npm run build
|
||||||
@@ -12,10 +12,11 @@ const PurchaseDetail = () => {
|
|||||||
|
|
||||||
const purchaseId = searchParams.get('purchaseId');
|
const purchaseId = searchParams.get('purchaseId');
|
||||||
|
|
||||||
const { data: purchase, isLoading: isLoadingPurchase, mutate: mutatePurchase } = useSWR(
|
const {
|
||||||
purchaseId,
|
data: purchase,
|
||||||
(id: number) => PurchaseApi.getSingle(id)
|
isLoading: isLoadingPurchase,
|
||||||
);
|
mutate: mutatePurchase,
|
||||||
|
} = useSWR(purchaseId, (id: number) => PurchaseApi.getSingle(id));
|
||||||
|
|
||||||
if (!purchaseId) {
|
if (!purchaseId) {
|
||||||
router.back();
|
router.back();
|
||||||
|
|||||||
@@ -177,7 +177,9 @@ export const MovementFormSchema: Yup.ObjectSchema<MovementFormSchemaType> =
|
|||||||
'Gudang tujuan tidak boleh sama dengan gudang asal!',
|
'Gudang tujuan tidak boleh sama dengan gudang asal!',
|
||||||
function (value) {
|
function (value) {
|
||||||
const { source_warehouse_id } = this.parent;
|
const { source_warehouse_id } = this.parent;
|
||||||
return !value || !source_warehouse_id || value !== source_warehouse_id;
|
return (
|
||||||
|
!value || !source_warehouse_id || value !== source_warehouse_id
|
||||||
|
);
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
products: Yup.array()
|
products: Yup.array()
|
||||||
|
|||||||
@@ -140,7 +140,8 @@ export const getPurchaseRequestFormInitialValues = (
|
|||||||
: null,
|
: null,
|
||||||
location_id: initialValues?.location?.id ?? undefined,
|
location_id: initialValues?.location?.id ?? undefined,
|
||||||
notes: initialValues?.notes ?? null,
|
notes: initialValues?.notes ?? null,
|
||||||
items: initialValues?.items?.length ? initialValues.items.map((item) => ({
|
items: initialValues?.items?.length
|
||||||
|
? initialValues.items.map((item) => ({
|
||||||
warehouse: item.warehouse
|
warehouse: item.warehouse
|
||||||
? {
|
? {
|
||||||
value: item.warehouse.id,
|
value: item.warehouse.id,
|
||||||
@@ -156,7 +157,8 @@ export const getPurchaseRequestFormInitialValues = (
|
|||||||
: null,
|
: null,
|
||||||
product_id: item.product?.id ?? 0,
|
product_id: item.product?.id ?? 0,
|
||||||
qty: item.qty ?? 0,
|
qty: item.qty ?? 0,
|
||||||
})) : [
|
}))
|
||||||
|
: [
|
||||||
{
|
{
|
||||||
warehouse: null,
|
warehouse: null,
|
||||||
warehouse_id: 0,
|
warehouse_id: 0,
|
||||||
|
|||||||
@@ -781,7 +781,8 @@ const PurchaseRequestForm = ({
|
|||||||
? formatNumber(
|
? formatNumber(
|
||||||
supplierProductData[item.product_id]
|
supplierProductData[item.product_id]
|
||||||
.ProductPrice *
|
.ProductPrice *
|
||||||
(parseFloat(item.qty?.toString() || '0') || 0)
|
(parseFloat(item.qty?.toString() || '0') ||
|
||||||
|
0)
|
||||||
)
|
)
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
@@ -803,9 +804,8 @@ const PurchaseRequestForm = ({
|
|||||||
item.product_id &&
|
item.product_id &&
|
||||||
supplierProductData[item.product_id]
|
supplierProductData[item.product_id]
|
||||||
? `Harga per unit: Rp ${formatNumber(
|
? `Harga per unit: Rp ${formatNumber(
|
||||||
supplierProductData[
|
supplierProductData[item.product_id]
|
||||||
item.product_id
|
.ProductPrice
|
||||||
].ProductPrice
|
|
||||||
)}`
|
)}`
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user