Skip to content

Commit 00af5ef

Browse files
committed
Merge branch 'dev' of https://github.com/touchmegit1/SmallTrend into dev
2 parents 72b55e6 + a6a930b commit 00af5ef

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

backend/src/main/resources/data.sql

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ INSERT INTO `role_permissions` VALUES (1,1,1),(2,2,1),(3,3,1),(4,4,1),(5,5,1),(6
9393
INSERT INTO `users` (`id`,`active`,`address`,`created_at`,`email`,`full_name`,`password`,`phone`,`status`,`updated_at`,`username`,`role_id`,`avatar_url`,`base_salary`,`count_late_as_present`,`hourly_rate`,`min_required_shifts`,`salary_type`,`working_hours_per_month`) VALUES (1,1,'123 Nguyen Hue, HCMC','2026-03-18 01:40:08.000000','admin@smalltrend.com','Nguyen Van Admin','$2a$10$dXJ3SW6G7P50lGmMkkmwe.20cQQubK3.HZWzG3YB1tlRy.fqvM/BG','0901234567','ACTIVE','2026-03-18 01:40:08.000000','admin',1,'https://i.pravatar.cc/150?img=12',30000000.00,0,NULL,NULL,'MONTHLY',208.00),(2,1,'456 Le Loi, HCMC','2026-03-18 01:40:08.000000','manager@smalltrend.com','Tran Thi Manager','$2a$10$dXJ3SW6G7P50lGmMkkmwe.20cQQubK3.HZWzG3YB1tlRy.fqvM/BG','0912345678','ACTIVE','2026-03-19 17:52:22.933689','manager',2,'https://res.cloudinary.com/didvvefmu/image/upload/v1773942746/smalltrend/avatars/pqsiai7remow3cpxfx3d.jpg',18000000.00,0,NULL,NULL,'MONTHLY',208.00),(3,1,'789 Dien Bien Phu, HCMC','2026-03-18 01:40:08.000000','cashier1@smalltrend.com','Le Van Cashier','$2a$10$dXJ3SW6G7P50lGmMkkmwe.20cQQubK3.HZWzG3YB1tlRy.fqvM/BG','0923456789','ACTIVE','2026-03-18 01:40:08.000000','cashier1',3,'https://i.pravatar.cc/150?img=15',13500000.00,0,75000.00,NULL,'HOURLY',208.00),(4,1,'321 Ba Trieu, HCMC','2026-03-18 01:40:08.000000','cashier2@smalltrend.com','Vo Thi Cashier 2','$2a$10$dXJ3SW6G7P50lGmMkkmwe.20cQQubK3.HZWzG3YB1tlRy.fqvM/BG','0968765432','ACTIVE','2026-03-18 01:40:08.000000','cashier2',3,'https://i.pravatar.cc/150?img=47',13200000.00,0,72000.00,NULL,'HOURLY',208.00),(5,1,'12 Nguyen Trai, HCMC','2026-03-18 01:40:08.000000','inventory@smalltrend.com','Pham Van Inventory','$2a$10$dXJ3SW6G7P50lGmMkkmwe.20cQQubK3.HZWzG3YB1tlRy.fqvM/BG','0934567890','ACTIVE','2026-03-18 01:40:08.000000','inventory1',4,'https://i.pravatar.cc/150?img=25',13000000.00,0,NULL,NULL,'MONTHLY',208.00),(6,1,'90 Pasteur, HCMC','2026-03-18 01:40:08.000000','sales@smalltrend.com','Hoang Thi Sales','$2a$10$dXJ3SW6G7P50lGmMkkmwe.20cQQubK3.HZWzG3YB1tlRy.fqvM/BG','0945678901','ACTIVE','2026-03-18 01:40:08.000000','sales1',5,'https://i.pravatar.cc/150?img=41',12600000.00,0,70000.00,NULL,'HOURLY',208.00),(7,1,'45 Hai Ba Trung, HCMC','2026-03-18 01:40:08.000000','sales2@smalltrend.com','Nguyen Van Sales 2','$2a$10$dXJ3SW6G7P50lGmMkkmwe.20cQQubK3.HZWzG3YB1tlRy.fqvM/BG','0987654012','ACTIVE','2026-03-18 01:40:08.000000','sales2',5,'https://i.pravatar.cc/150?img=6',12500000.00,0,NULL,20,'MONTHLY_MIN_SHIFTS',208.00),(8,1,'120 Yên Lãng, Đống Đa, Hà Nội','2026-03-19 14:24:14.936732','kiennguyen21005@gmail.com','Nguyễn Xuân Kiên','$2a$10$4eO2jrzTRQmOTW/iSlECv.99/YUjwzsVWIeIViQdjQw0YwEp7ZKNi','0842561752','ACTIVE','2026-03-19 14:24:14.936732','kien',2,NULL,NULL,0,NULL,NULL,'MONTHLY',208.00),(9,1,'Lào Cai','2026-03-19 14:25:32.081856','hung@gmail.com','Nguyễn Quốc Hưng','$2a$10$KT2Gw8KbGyljHUIo18ebeebchc8PjJyjfnJNRf2PnDXtV3rqFXjv2','0977869300','ACTIVE','2026-03-19 14:25:32.081856','hung',2,NULL,NULL,0,NULL,NULL,'MONTHLY',208.00);
9494

9595
-- 6. CUSTOMER TIERS
96-
INSERT INTO `customer_tiers` (`id`,`tier_code`,`tier_name`,`min_spending`,`points_multiplier`,`bonus_points`,`color`,`icon_url`,`free_shipping`,`priority_support`,`early_access`,`birthday_bonus`,`birthday_bonus_points`,`expiry_months`,`benefits`,`priority`,`is_active`,`description`,`created_at`,`updated_at`) VALUES
97-
(1,'BRONZE','Đồng',0.00,1.00,NULL,'#CD7F32',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,NULL,NULL,NULL),
98-
(2,'SILVER','Bạc',5000000.00,1.50,NULL,'#C0C0C0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2,0,NULL,NULL,'2026-03-19 15:33:09.341890'),
99-
(3,'GOLD','Vàng',15000000.00,2.00,NULL,'#FFD700',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,3,0,NULL,NULL,NULL),
100-
(4,'PLATINUM','Bạch Kim',50000000.00,3.00,NULL,'#E5E4E2',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,4,0,NULL,NULL,NULL);
96+
INSERT INTO `customer_tiers` (`id`,`tier_code`,`tier_name`,`min_spending`,`min_points`,`points_multiplier`,`bonus_points`,`color`,`icon_url`,`free_shipping`,`priority_support`,`early_access`,`birthday_bonus`,`birthday_bonus_points`,`expiry_months`,`benefits`,`priority`,`is_active`,`description`,`created_at`,`updated_at`) VALUES
97+
(1,'BRONZE','Đồng',0.00,0,1.00,NULL,'#CD7F32',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,NULL,NULL,NULL),
98+
(2,'SILVER','Bạc',5000000.00,0,1.50,NULL,'#C0C0C0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2,0,NULL,NULL,'2026-03-19 15:33:09.341890'),
99+
(3,'GOLD','Vàng',15000000.00,0,2.00,NULL,'#FFD700',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,3,0,NULL,NULL,NULL),
100+
(4,'PLATINUM','Bạch Kim',50000000.00,0,3.00,NULL,'#E5E4E2',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,4,0,NULL,NULL,NULL);
101101

102102
-- 7. CUSTOMERS
103103
INSERT INTO `customers` (`id`,`loyalty_points`,`name`,`phone`,`spent_amount`) VALUES (1,150,'Nguyen Van A','0987654321',1200000),(2,800,'Tran Thi B','0976543210',6200000),(3,2000,'Le Van C','0965432109',18000000),(4,3382,'Pham Thi D','0954321098',56340200),(7,4,'Huy','0961390486',48000),(9,0,'s','09999999999',0),(10,0,'Ko','0961390487',0),(11,0,'Huy','0961390488',0),(12,0,'Huy','0123456789',0),(13,0,'','09612345688',0);
@@ -236,7 +236,7 @@ VALUES
236236
(4,500000.00,13200000.00,1.00,'2026-03-18 01:40:09.000000','2026-01-01 00:00:00.000000',NULL,72000.00,0,'Thu ngân ca chiều - Lương theo giờ (Giờ thường: 72k/h, OT: 108k/h)',1.50,'HOURLY','2026-03-18 01:40:09.000000',4,0,NULL,208.00),
237237
(5,400000.00,13000000.00,1.00,'2026-03-18 01:40:09.000000','2026-01-01 00:00:00.000000',NULL,NULL,0,'Quản lý kho hàng - Lương cố định hàng tháng',1.50,'MONTHLY','2026-03-18 01:40:09.000000',5,0,NULL,208.00),
238238
(6,450000.00,12600000.00,1.50,'2026-03-18 01:40:09.000000','2026-01-01 00:00:00.000000',NULL,70000.00,0,'Nhân viên bán hàng - Lương theo giờ (Giờ thường: 70k/h, OT: 105k/h)',1.50,'HOURLY','2026-03-18 01:40:09.000000',6,0,NULL,208.00),
239-
(7,400000.00,12500000.00,1.50,'2026-03-18 01:40:09.000000','2026-01-01 00:00:00.000000',NULL,NULL,0,'Nhân viên bán hàng - Lương tháng, cần tối thiểu 20 ca công/tháng',1.50,'MONTHLY_MIN_SHIFTS','2026-03-18 01:40:09.000000',7,0,20,208.00);
239+
(7,400000.00,12500000.00,1.50,'2026-03-18 01:40:09.000000','2026-01-01 00:00:00.000000',NULL,NULL,0,'Nhân viên bán hàng - Lương tháng, cần tối thiểu 20 ca công/tháng',1.50,'MONTHLY','2026-03-18 01:40:09.000000',7,0,20,208.00);
240240

241241
-- Mark one historical assignment as soft-deleted sample
242242
UPDATE work_shift_assignments

frontend/src/pages/Pos/PaymentModal.jsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,15 @@ export default function PaymentModal({ cart, customer, onClose, onComplete, onSt
444444
setFocusedField("notes");
445445
notesRef.current?.focus();
446446
} else if (focusedField === "notes") {
447-
setFocusedField("paymentMethod");
448-
if (!paymentMethod) setPaymentMethod("cash");
447+
if (!paymentMethod || paymentMethod === "cash") {
448+
if (!paymentMethod) setPaymentMethod("cash");
449+
setFocusedField("cashAmount");
450+
cashInputRef.current?.focus();
451+
} else {
452+
setFocusedField("paymentMethod");
453+
}
449454
} else if (focusedField === "paymentMethod") {
455+
if (!paymentMethod) setPaymentMethod("cash");
450456
if (paymentMethod === "cash") {
451457
setFocusedField("cashAmount");
452458
cashInputRef.current?.focus();

0 commit comments

Comments
 (0)