feat(inventories): implement inventory movement list and transfer functionality
- Added InventoryMovementListComponent to display stock movements with filtering options. - Created InventoriesTransferFormComponent for transferring stock between inventories. - Implemented product cardex view to show detailed inventory movements for specific products. - Enhanced product listing with loading states and improved UI components. - Introduced Jalali date formatting directive for better date representation. - Added utility functions for Jalali date conversions and comparisons. - Created reusable details info card component for displaying inventory details. - Updated movement reference types and tags for better categorization of inventory movements.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
export * from './currency';
|
||||
export * from './jalali-date.utils';
|
||||
export * from './name';
|
||||
export * from './time';
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
import dayjs, { Dayjs } from 'dayjs';
|
||||
import jalaliday from 'jalaliday';
|
||||
|
||||
dayjs.extend(jalaliday);
|
||||
|
||||
export function toJalali(date: string | number | Date | Dayjs, format = 'YYYY/MM/DD'): Dayjs {
|
||||
return dayjs(date).calendar('jalali');
|
||||
}
|
||||
|
||||
export function fromJalali(jalaliDate: string): Dayjs {
|
||||
// Parse Jalali date string (e.g., '1404-09-21')
|
||||
return dayjs(jalaliDate, { jalali: true }).calendar('gregory');
|
||||
}
|
||||
|
||||
export function formatJalali(date: string | number | Date | Dayjs, format = 'YYYY/MM/DD'): string {
|
||||
return toJalali(date).format(format);
|
||||
}
|
||||
|
||||
export function jalaliDiff(
|
||||
date1: string | number | Date | Dayjs,
|
||||
date2: string | number | Date | Dayjs,
|
||||
unit: dayjs.OpUnitType = 'day',
|
||||
): number {
|
||||
return toJalali(date1).diff(toJalali(date2), unit);
|
||||
}
|
||||
|
||||
export function isJalaliBefore(
|
||||
date1: string | number | Date | Dayjs,
|
||||
date2: string | number | Date | Dayjs,
|
||||
): boolean {
|
||||
return toJalali(date1).isBefore(toJalali(date2));
|
||||
}
|
||||
|
||||
export function isJalaliAfter(
|
||||
date1: string | number | Date | Dayjs,
|
||||
date2: string | number | Date | Dayjs,
|
||||
): boolean {
|
||||
return toJalali(date1).isAfter(toJalali(date2));
|
||||
}
|
||||
|
||||
export function nowJalali(): Dayjs {
|
||||
return dayjs().calendar('jalali');
|
||||
}
|
||||
Reference in New Issue
Block a user