Refinery: role REFINERY_MGR instead of PTADM, translated trip log movements, titles without "شاشة", icon sections for commission claims
Wallet view header shows the truck number; the claim movement log opens by clicking its title. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
4066151033
commit
84facf2ddf
|
|
@ -1,11 +1,11 @@
|
||||||
-- Refinery (المصفاة) modules ported from AqabaTCS: trips, wage claims, commission claims, wallets, variables, cards.
|
-- Refinery (المصفاة) modules ported from AqabaTCS: trips, wage claims, commission claims, wallets, variables, cards.
|
||||||
-- Authority: SU (always allowed by the code, needs no row) and PTADM (rows below: 6 screens + every action key).
|
-- Authority: SU (always allowed by the code, needs no row) and REFINERY_MGR (rows below: 6 screens + every action key).
|
||||||
-- Run on a database where GRAINS_SCREEN_PERMISSIONS exists (db/grains-screen-permissions.sql). Safe to re-run. Not executed by the application.
|
-- Run on a database where GRAINS_SCREEN_PERMISSIONS exists (db/grains-screen-permissions.sql). Safe to re-run. Not executed by the application.
|
||||||
-- Delete a row to take a key away (the API applies it within about a minute, the browser on the next reload or sign-in).
|
-- Delete a row to take a key away (the API applies it within about a minute, the browser on the next reload or sign-in).
|
||||||
-- Give another role access: copy the block and change the role code.
|
-- Give another role access: copy the block and change the role code.
|
||||||
|
|
||||||
INSERT INTO GRAINS_SCREEN_PERMISSIONS (ROLECODE, RESOURCE_KEY)
|
INSERT INTO GRAINS_SCREEN_PERMISSIONS (ROLECODE, RESOURCE_KEY)
|
||||||
SELECT 'PTADM', v.resource_key
|
SELECT 'REFINERY_MGR', v.resource_key
|
||||||
FROM (SELECT 'refinery.trips' AS resource_key FROM dual UNION ALL
|
FROM (SELECT 'refinery.trips' AS resource_key FROM dual UNION ALL
|
||||||
SELECT 'refinery.trips.firstAdvance' FROM dual UNION ALL
|
SELECT 'refinery.trips.firstAdvance' FROM dual UNION ALL
|
||||||
SELECT 'refinery.trips.secondAdvance' FROM dual UNION ALL
|
SELECT 'refinery.trips.secondAdvance' FROM dual UNION ALL
|
||||||
|
|
@ -55,9 +55,9 @@ SELECT 'PTADM', v.resource_key
|
||||||
SELECT 'refinery.cards.report' FROM dual) v
|
SELECT 'refinery.cards.report' FROM dual) v
|
||||||
WHERE NOT EXISTS (
|
WHERE NOT EXISTS (
|
||||||
SELECT 1 FROM GRAINS_SCREEN_PERMISSIONS p
|
SELECT 1 FROM GRAINS_SCREEN_PERMISSIONS p
|
||||||
WHERE p.rolecode = 'PTADM' AND p.resource_key = v.resource_key);
|
WHERE p.rolecode = 'REFINERY_MGR' AND p.resource_key = v.resource_key);
|
||||||
|
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
-- Check (expect 47 rows):
|
-- Check (expect 47 rows):
|
||||||
-- SELECT resource_key FROM GRAINS_SCREEN_PERMISSIONS WHERE rolecode = 'PTADM' AND resource_key LIKE 'refinery.%' ORDER BY resource_key;
|
-- SELECT resource_key FROM GRAINS_SCREEN_PERMISSIONS WHERE rolecode = 'REFINERY_MGR' AND resource_key LIKE 'refinery.%' ORDER BY resource_key;
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ Apply these scripts once per database (not run by the application), in this orde
|
||||||
5c. `db/role-co.sql` - new role CO with the same rights as GTO: role row (NTP schema) + copy of every GTO row in GRAINS_SCREEN_PERMISSIONS (safe to re-run)
|
5c. `db/role-co.sql` - new role CO with the same rights as GTO: role row (NTP schema) + copy of every GTO row in GRAINS_SCREEN_PERMISSIONS (safe to re-run)
|
||||||
7. `db/grains-jobs.sql` - tables of the scheduled jobs (`GRAINS_JOBS`, `GRAINS_JOB_RUNS`), primary schema. Without it the scheduler stays idle. Jobs are then started, stopped and timed on the SU screen "المهام المجدولة" (`/jobs`); nothing runs until a job is started there. `Jobs:SchedulerEnabled=false` (set in appsettings.Development.json) switches the scheduler loop off for a process
|
7. `db/grains-jobs.sql` - tables of the scheduled jobs (`GRAINS_JOBS`, `GRAINS_JOB_RUNS`), primary schema. Without it the scheduler stays idle. Jobs are then started, stopped and timed on the SU screen "المهام المجدولة" (`/jobs`); nothing runs until a job is started there. `Jobs:SchedulerEnabled=false` (set in appsettings.Development.json) switches the scheduler loop off for a process
|
||||||
6. `db/gnac-finance-screens.sql` - GNAC gets claims, fines, wages, invoices and the invoice check report (safe to re-run)
|
6. `db/gnac-finance-screens.sql` - GNAC gets claims, fines, wages, invoices and the invoice check report (safe to re-run)
|
||||||
8. `db/refinery-permissions.sql` - refinery (المصفاة) modules: PTADM gets the 6 screens and every action key (47 rows); SU needs none (safe to re-run). The external services are OFF until configured: `Refinery__Dinarak__Enabled/BaseUrl/UserName/Password` (trip payment) and `Refinery__Jopetrol__Enabled/Url/UserName/Password` (wage claim ترحيل); `Refinery__Trips__MaxPaymentAmount` (default 500, unverified)
|
8. `db/refinery-permissions.sql` - refinery (المصفاة) modules: REFINERY_MGR gets the 6 screens and every action key (47 rows); SU needs none (safe to re-run). The external services are OFF until configured: `Refinery__Dinarak__Enabled/BaseUrl/UserName/Password` (trip payment) and `Refinery__Jopetrol__Enabled/Url/UserName/Password` (wage claim ترحيل); `Refinery__Trips__MaxPaymentAmount` (default 500, unverified)
|
||||||
|
|
||||||
**Switching a feature off for everybody:** a row with `ROLECODE = 'DISABLED'` takes that resource out of the system for all users, SU
|
**Switching a feature off for everybody:** a row with `ROLECODE = 'DISABLED'` takes that resource out of the system for all users, SU
|
||||||
included: the menu entry and buttons disappear and the API answers 403. It overrides every other row. Delete the row to bring the
|
included: the menu entry and buttons disappear and the API answers 403. It overrides every other row. Delete the row to bring the
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ Port refinery modules of the legacy ColdFusion app **AqabaTCS** (`C:\inetpub\www
|
||||||
- The legacy `*_LOG` tables (OLD_DATA / NEW_DATA JSON, METHOD_NAME, USER_ID, USER_IP) are written on every legacy action: keep doing it
|
- The legacy `*_LOG` tables (OLD_DATA / NEW_DATA JSON, METHOD_NAME, USER_ID, USER_IP) are written on every legacy action: keep doing it
|
||||||
(same method names, same JSON content as far as you can see in the factory) and port the log popup (history list + old/new view).
|
(same method names, same JSON content as far as you can see in the factory) and port the log popup (history list + old/new view).
|
||||||
Find out what legacy puts in USER_ID / CREATED_BY (numeric NTPUSERS id vs login) and use the matching `ICurrentUser` member.
|
Find out what legacy puts in USER_ID / CREATED_BY (numeric NTPUSERS id vs login) and use the matching `ICurrentUser` member.
|
||||||
- **Authority**: ONLY `SU` (always allowed by the code) and role `PTADM` get access. Do not port the legacy role-specific branches
|
- **Authority**: ONLY `SU` (always allowed by the code) and role `REFINERY_MGR` get access. Do not port the legacy role-specific branches
|
||||||
(REFINERY_MGR, REFINERY_OP, EXCHANGE_OP, REFINERY_AC, OPOFF, hard-coded user ids ...). Instead: one screen key per module (already defined in
|
(REFINERY_MGR, REFINERY_OP, EXCHANGE_OP, REFINERY_AC, OPOFF, hard-coded user ids ...). Instead: one screen key per module (already defined in
|
||||||
`PermissionKeys.Refinery.cs`) and one **action key per legacy action** (e.g. `refinery.trips.firstAdvance`), declared in YOUR OWN partial file
|
`PermissionKeys.Refinery.cs`) and one **action key per legacy action** (e.g. `refinery.trips.firstAdvance`), declared in YOUR OWN partial file
|
||||||
`src/NTP.Application/Access/PermissionKeys.Refinery.<Module>.cs` (`public static partial class PermissionKeys`). Every endpoint carries
|
`src/NTP.Application/Access/PermissionKeys.Refinery.<Module>.cs` (`public static partial class PermissionKeys`). Every endpoint carries
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ using NTP.Application.Refinery.Cards;
|
||||||
|
|
||||||
namespace NTP.Api.Controllers.V1.Refinery;
|
namespace NTP.Api.Controllers.V1.Refinery;
|
||||||
|
|
||||||
/// <summary>Refinery diesel cards (بطاقات الديزل): port of refinery_cards*.cfc. Access by permission keys only (SU / PTADM).</summary>
|
/// <summary>Refinery diesel cards (بطاقات الديزل): port of refinery_cards*.cfc. Access by permission keys only (SU / REFINERY_MGR).</summary>
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[ApiVersion(1.0)]
|
[ApiVersion(1.0)]
|
||||||
[Route("api/v{version:apiVersion}/refinery/cards")]
|
[Route("api/v{version:apiVersion}/refinery/cards")]
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ namespace NTP.Api.Controllers.V1.Refinery;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Refinery pricing periods (تسعير عطاء النفط الخام): port of refinery_variables*.cfc. Thin controller; access is by permission keys only
|
/// Refinery pricing periods (تسعير عطاء النفط الخام): port of refinery_variables*.cfc. Thin controller; access is by permission keys only
|
||||||
/// (SU / PTADM through GRAINS_SCREEN_PERMISSIONS), the legacy REFINERY_MGR / REFINERY_AC role branches are not ported.
|
/// (SU / REFINERY_MGR through GRAINS_SCREEN_PERMISSIONS), the legacy REFINERY_MGR / REFINERY_AC role branches are not ported.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[ApiVersion(1.0)]
|
[ApiVersion(1.0)]
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ using NTP.Application.Refinery.Wallets;
|
||||||
|
|
||||||
namespace NTP.Api.Controllers.V1.Refinery;
|
namespace NTP.Api.Controllers.V1.Refinery;
|
||||||
|
|
||||||
/// <summary>Refinery payment methods (شاشة طرق الدفع): port of refinery_wallet*.cfc. Access by permission keys only (SU / PTADM). The Dinarak API is not called.</summary>
|
/// <summary>Refinery payment methods (شاشة طرق الدفع): port of refinery_wallet*.cfc. Access by permission keys only (SU / REFINERY_MGR). The Dinarak API is not called.</summary>
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[ApiVersion(1.0)]
|
[ApiVersion(1.0)]
|
||||||
[Route("api/v{version:apiVersion}/refinery/wallets")]
|
[Route("api/v{version:apiVersion}/refinery/wallets")]
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ namespace NTP.Application.Access;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Action keys of the refinery trips screen (legacy REFINERYTRIP actions). The screen key itself is
|
/// Action keys of the refinery trips screen (legacy REFINERYTRIP actions). The screen key itself is
|
||||||
/// <see cref="RefineryTrips"/> (list, view, log). Granted only by GRAINS_SCREEN_PERMISSIONS rows (SU always, PTADM by script).
|
/// <see cref="RefineryTrips"/> (list, view, log). Granted only by GRAINS_SCREEN_PERMISSIONS rows (SU always, REFINERY_MGR by script).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static partial class PermissionKeys
|
public static partial class PermissionKeys
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ namespace NTP.Application.Access;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Refinery (المصفاة) module keys, ported from the AqabaTCS app. Granted ONLY by rows in GRAINS_SCREEN_PERMISSIONS (see
|
/// Refinery (المصفاة) module keys, ported from the AqabaTCS app. Granted ONLY by rows in GRAINS_SCREEN_PERMISSIONS (see
|
||||||
/// db/refinery-permissions.sql: SU is always allowed, PTADM gets every key); none of them is in <see cref="PermissionDefaults"/>.
|
/// db/refinery-permissions.sql: SU is always allowed, REFINERY_MGR gets every key); none of them is in <see cref="PermissionDefaults"/>.
|
||||||
/// Action keys of one module live in that module's own partial file (PermissionKeys.Refinery.<Module>.cs).
|
/// Action keys of one module live in that module's own partial file (PermissionKeys.Refinery.<Module>.cs).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static partial class PermissionKeys
|
public static partial class PermissionKeys
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ namespace NTP.Application.Refinery.Variables;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Port of refinery_variablesfactory.cfc / refinery_variablesfactoryweb.cfc (screen REFINERY_VARIABLES, تسعير عطاء النفط الخام).
|
/// Port of refinery_variablesfactory.cfc / refinery_variablesfactoryweb.cfc (screen REFINERY_VARIABLES, تسعير عطاء النفط الخام).
|
||||||
/// Access is decided only by the permission keys on the controller (SU / PTADM); the legacy REFINERY_MGR / REFINERY_AC role branches are not ported.
|
/// Access is decided only by the permission keys on the controller (SU / REFINERY_MGR); the legacy REFINERY_MGR / REFINERY_AC role branches are not ported.
|
||||||
/// There is no log: the legacy log call is commented out and no REFINERY_VARIABLES_LOG table exists.
|
/// There is no log: the legacy log call is commented out and no REFINERY_VARIABLES_LOG table exists.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class VariablesService(
|
public sealed class VariablesService(
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ public class TripActionServiceTests
|
||||||
|
|
||||||
private sealed class FakeUser : ICurrentUser
|
private sealed class FakeUser : ICurrentUser
|
||||||
{
|
{
|
||||||
public bool IsAuthenticated => true; public long Id => 16190811; public string UserId => "REF_X"; public string Name => "x"; public string RoleCode => "PTADM";
|
public bool IsAuthenticated => true; public long Id => 16190811; public string UserId => "REF_X"; public string Name => "x"; public string RoleCode => "REFINERY_MGR";
|
||||||
public string RoleName => ""; public string Domain => "ASEZA"; public long? LocationId => null; public string LocationName => ""; public long? StkId => null;
|
public string RoleName => ""; public string Domain => "ASEZA"; public long? LocationId => null; public string LocationName => ""; public long? StkId => null;
|
||||||
public long? CompId => null; public long? CompanyId => null; public string CompanyName => ""; public string CompanyCode => ""; public string EmpNo => "";
|
public long? CompId => null; public long? CompanyId => null; public string CompanyName => ""; public string CompanyCode => ""; public string EmpNo => "";
|
||||||
public string Lang => "AR"; public bool IsStaff => false;
|
public string Lang => "AR"; public bool IsStaff => false;
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ public class WageClaimServiceTests
|
||||||
public long Id => 77;
|
public long Id => 77;
|
||||||
public string UserId => "TESTER";
|
public string UserId => "TESTER";
|
||||||
public string Name => "t";
|
public string Name => "t";
|
||||||
public string RoleCode => "PTADM";
|
public string RoleCode => "REFINERY_MGR";
|
||||||
public string RoleName => "PTADM";
|
public string RoleName => "REFINERY_MGR";
|
||||||
public string Domain => "ASEZA";
|
public string Domain => "ASEZA";
|
||||||
public long? LocationId => null;
|
public long? LocationId => null;
|
||||||
public string LocationName => "";
|
public string LocationName => "";
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ import AddIcon from '@mui/icons-material/Add';
|
||||||
import DownloadIcon from '@mui/icons-material/Download';
|
import DownloadIcon from '@mui/icons-material/Download';
|
||||||
import PaymentsIcon from '@mui/icons-material/Payments';
|
import PaymentsIcon from '@mui/icons-material/Payments';
|
||||||
import SearchIcon from '@mui/icons-material/Search';
|
import SearchIcon from '@mui/icons-material/Search';
|
||||||
|
import AssignmentIcon from '@mui/icons-material/Assignment';
|
||||||
|
import ReceiptLongIcon from '@mui/icons-material/ReceiptLong';
|
||||||
import { DataGrid } from '@/components/DataGrid';
|
import { DataGrid } from '@/components/DataGrid';
|
||||||
import { LoadingBanner } from '@/components/LoadingBanner';
|
import { LoadingBanner } from '@/components/LoadingBanner';
|
||||||
import { PageHeader } from '@/components/PageHeader';
|
import { PageHeader } from '@/components/PageHeader';
|
||||||
|
|
@ -193,14 +195,14 @@ export function CommissionClaimPage() {
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Stack spacing={2}>
|
<Stack spacing={2}>
|
||||||
<Block>
|
<Block icon={AssignmentIcon} title={t('cc.sec.basic')}>
|
||||||
<Stack direction="row" useFlexGap sx={{ gap: 4, flexWrap: 'wrap' }}>
|
<Stack direction="row" useFlexGap sx={{ gap: 4, flexWrap: 'wrap' }}>
|
||||||
<ViewItem label={t('cc.no')}><Typography component="span" dir="ltr">{c.commissionClaimNo}</Typography></ViewItem>
|
<ViewItem label={t('cc.no')}><Typography component="span" dir="ltr">{c.commissionClaimNo}</Typography></ViewItem>
|
||||||
<ViewItem label={t('cc.date')}><Typography component="span" dir="ltr">{formatDate(c.commissionClaimDate)}</Typography></ViewItem>
|
<ViewItem label={t('cc.date')}><Typography component="span" dir="ltr">{formatDate(c.commissionClaimDate)}</Typography></ViewItem>
|
||||||
<ViewItem label={t('cc.wageCount')}>{formatNumber(c.tripCnt, 'ar')}</ViewItem>
|
<ViewItem label={t('cc.wageCount')}>{formatNumber(c.tripCnt, 'ar')}</ViewItem>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Block>
|
</Block>
|
||||||
<Block title={t('cc.wage.title')}>
|
<Block icon={ReceiptLongIcon} title={t('cc.wage.title')}>
|
||||||
{wages.isLoading ? <LoadingBanner variant="update" /> : (
|
{wages.isLoading ? <LoadingBanner variant="update" /> : (
|
||||||
<WageClaimsTable rows={wages.data ?? []} onOpen={can('refinery.wageClaims') ? (r) => navigate(`${WAGE_ROOT}/${r.id}`) : undefined} />
|
<WageClaimsTable rows={wages.data ?? []} onOpen={can('refinery.wageClaims') ? (r) => navigate(`${WAGE_ROOT}/${r.id}`) : undefined} />
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ export default defineStrings({
|
||||||
'cc.wage.date': { en: 'Claim date', ar: 'تاريخ المطالبة' }, // PUBLIC.WAGE_CLAIM_DATE
|
'cc.wage.date': { en: 'Claim date', ar: 'تاريخ المطالبة' }, // PUBLIC.WAGE_CLAIM_DATE
|
||||||
'cc.wage.status': { en: 'Status', ar: 'الحالة' },
|
'cc.wage.status': { en: 'Status', ar: 'الحالة' },
|
||||||
'cc.wage.tripCnt': { en: 'Number of trips', ar: 'عدد الارساليات' },
|
'cc.wage.tripCnt': { en: 'Number of trips', ar: 'عدد الارساليات' },
|
||||||
|
'cc.sec.basic': { en: 'Basic information', ar: 'المعلومات الأساسية' },
|
||||||
'cc.wage.title': { en: 'Wage claims', ar: 'مطالبات الاجور' }, // new
|
'cc.wage.title': { en: 'Wage claims', ar: 'مطالبات الاجور' }, // new
|
||||||
'cc.wage.empty': { en: 'No wage claims', ar: 'لا يوجد مطالبات اجور' }, // ERROR.THERE_ARE_NO_WAGES
|
'cc.wage.empty': { en: 'No wage claims', ar: 'لا يوجد مطالبات اجور' }, // ERROR.THERE_ARE_NO_WAGES
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import * as cards from './cards';
|
||||||
/**
|
/**
|
||||||
* Refinery (المصفاة) slice ported from AqabaTCS: one folder per legacy module, each exports `routes` + `menuItems`.
|
* Refinery (المصفاة) slice ported from AqabaTCS: one folder per legacy module, each exports `routes` + `menuItems`.
|
||||||
* Menu order as the legacy customtags/Menu.cfm: trips, wage claim, commission claim, wallet, variables, cards.
|
* Menu order as the legacy customtags/Menu.cfm: trips, wage claim, commission claim, wallet, variables, cards.
|
||||||
* Every key is granted only by rows in GRAINS_SCREEN_PERMISSIONS (db/refinery-permissions.sql: SU always, PTADM).
|
* Every key is granted only by rows in GRAINS_SCREEN_PERMISSIONS (db/refinery-permissions.sql: SU always, REFINERY_MGR).
|
||||||
*/
|
*/
|
||||||
const modules = [trips, wageClaims, commissionClaims, wallets, variables, cards];
|
const modules = [trips, wageClaims, commissionClaims, wallets, variables, cards];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { defineStrings } from '@/i18n/useUi';
|
||||||
/** Strings of the refinery trips screen. Arabic texts are the legacy captions (ntp.lt_caption REFINERYTRIP*, PUBLIC.*) verbatim. */
|
/** Strings of the refinery trips screen. Arabic texts are the legacy captions (ntp.lt_caption REFINERYTRIP*, PUBLIC.*) verbatim. */
|
||||||
export default defineStrings({
|
export default defineStrings({
|
||||||
'trips.menu': { en: 'Trips', ar: 'الارساليات' },
|
'trips.menu': { en: 'Trips', ar: 'الارساليات' },
|
||||||
'trips.title': { en: 'Refinery trips', ar: 'شاشة الارساليات' },
|
'trips.title': { en: 'Refinery trips', ar: 'الارساليات' },
|
||||||
'trips.crumb': { en: 'Trip details', ar: 'معلومات الارسالية' },
|
'trips.crumb': { en: 'Trip details', ar: 'معلومات الارسالية' },
|
||||||
|
|
||||||
// filters / columns
|
// filters / columns
|
||||||
|
|
@ -44,9 +44,9 @@ export default defineStrings({
|
||||||
|
|
||||||
// reports
|
// reports
|
||||||
'trips.reports': { en: 'Reports', ar: 'التقارير' },
|
'trips.reports': { en: 'Reports', ar: 'التقارير' },
|
||||||
'trips.report.trips': { en: 'Trips (Excel)', ar: 'شاشة الارساليات (Excel)' },
|
'trips.report.trips': { en: 'Trips (Excel)', ar: 'الارساليات (Excel)' },
|
||||||
'trips.report.operator': { en: 'Trips - operator (Excel)', ar: 'شاشة الارساليات - المشغل (Excel)' },
|
'trips.report.operator': { en: 'Trips - operator (Excel)', ar: 'الارساليات - المشغل (Excel)' },
|
||||||
'trips.report.exchange': { en: 'Trips - exchange (Excel)', ar: 'شاشة الارساليات - الصرف (Excel)' },
|
'trips.report.exchange': { en: 'Trips - exchange (Excel)', ar: 'الارساليات - الصرف (Excel)' },
|
||||||
'trips.report.diesel': { en: 'Diesel charges (Excel)', ar: 'شحن الديزل (Excel)' },
|
'trips.report.diesel': { en: 'Diesel charges (Excel)', ar: 'شحن الديزل (Excel)' },
|
||||||
'trips.report.cards': { en: 'Diesel balances (Excel)', ar: 'أرصدة الديزل (Excel)' },
|
'trips.report.cards': { en: 'Diesel balances (Excel)', ar: 'أرصدة الديزل (Excel)' },
|
||||||
'trips.report.bank': { en: 'Bank report (Excel)', ar: 'تقرير البنك (Excel)' },
|
'trips.report.bank': { en: 'Bank report (Excel)', ar: 'تقرير البنك (Excel)' },
|
||||||
|
|
@ -131,6 +131,14 @@ export default defineStrings({
|
||||||
|
|
||||||
/** REFINERYTRIP.<METHOD_NAME> captions of the history list. */
|
/** REFINERYTRIP.<METHOD_NAME> captions of the history list. */
|
||||||
export const methodCaptions: Record<string, string> = {
|
export const methodCaptions: Record<string, string> = {
|
||||||
|
CREATE: 'إنشاء',
|
||||||
|
NEW: 'جديد',
|
||||||
|
RESD: 'تم التسريب',
|
||||||
|
LOADED: 'تم التحميل',
|
||||||
|
ARRIVE_LOCATION: 'وصول شويعر',
|
||||||
|
DISCHARGING: 'قيد التفريغ',
|
||||||
|
DISCHARGED: 'تم التفريغ',
|
||||||
|
RVKD: 'ملغي',
|
||||||
FIRST_ADVANCED_PAYMENT: 'تعبئة بطاقة الديزل للتحميل',
|
FIRST_ADVANCED_PAYMENT: 'تعبئة بطاقة الديزل للتحميل',
|
||||||
SECOND_ADVANCED_PAYMENT: 'تعبئة بطاقة الديزل للتفريغ',
|
SECOND_ADVANCED_PAYMENT: 'تعبئة بطاقة الديزل للتفريغ',
|
||||||
FIRST_ADVANCED_PAYMENT_REVERSE: 'إلغاء شحن الديزل تحميل',
|
FIRST_ADVANCED_PAYMENT_REVERSE: 'إلغاء شحن الديزل تحميل',
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { useState, type ReactNode } from 'react';
|
import { useState, type ElementType, type ReactNode } from 'react';
|
||||||
import {
|
import {
|
||||||
Box, Button, Collapse, Dialog, DialogActions, DialogContent, DialogTitle, IconButton, Stack, Table, TableBody, TableCell, TableContainer,
|
Box, Button, Collapse, Dialog, DialogActions, DialogContent, DialogTitle, IconButton, Stack, Table, TableBody, TableCell, TableContainer,
|
||||||
TableHead, TablePagination, TableRow, Tooltip, Typography,
|
TableHead, TablePagination, TableRow, Tooltip, Typography,
|
||||||
|
|
@ -8,6 +8,7 @@ import VisibilityOutlined from '@mui/icons-material/VisibilityOutlined';
|
||||||
import type { PagedResult } from '@/api/client';
|
import type { PagedResult } from '@/api/client';
|
||||||
import { LoadingBanner } from '@/components/LoadingBanner';
|
import { LoadingBanner } from '@/components/LoadingBanner';
|
||||||
import { SectionPaper } from '@/components/SectionPaper';
|
import { SectionPaper } from '@/components/SectionPaper';
|
||||||
|
import { SectionTitle } from '@/components/SectionTitle';
|
||||||
import { StatusChip } from '@/components/StatusChip';
|
import { StatusChip } from '@/components/StatusChip';
|
||||||
import { formatDate, formatDateTime } from '@/components/meta/format';
|
import { formatDate, formatDateTime } from '@/components/meta/format';
|
||||||
import { useFeatureUi } from '@/i18n/useUi';
|
import { useFeatureUi } from '@/i18n/useUi';
|
||||||
|
|
@ -19,10 +20,11 @@ import type { ClaimLogRow, ClaimTripRow } from './types';
|
||||||
const PAGE_SIZES = [10, 25, 50];
|
const PAGE_SIZES = [10, 25, 50];
|
||||||
|
|
||||||
/** Framed block with a title (same look as the other record screens). */
|
/** Framed block with a title (same look as the other record screens). */
|
||||||
export function Block({ title, actions, children }: { title?: string; actions?: ReactNode; children: ReactNode }) {
|
export function Block({ title, icon, actions, children }: { title?: string; icon?: ElementType; actions?: ReactNode; children: ReactNode }) {
|
||||||
return (
|
return (
|
||||||
<SectionPaper sx={{ p: 2 }}>
|
<SectionPaper sx={{ p: 2 }}>
|
||||||
{(title || actions) && (
|
{title && icon && !actions && <SectionTitle icon={icon} title={title} />}
|
||||||
|
{(title || actions) && !(title && icon && !actions) && (
|
||||||
<Stack direction="row" sx={{ alignItems: 'center', justifyContent: 'space-between', mb: 1.5 }}>
|
<Stack direction="row" sx={{ alignItems: 'center', justifyContent: 'space-between', mb: 1.5 }}>
|
||||||
{title && <Typography variant="subtitle1" sx={{ fontWeight: 600 }}>{title}</Typography>}
|
{title && <Typography variant="subtitle1" sx={{ fontWeight: 600 }}>{title}</Typography>}
|
||||||
{actions}
|
{actions}
|
||||||
|
|
@ -105,10 +107,12 @@ export function ClaimLogSection({ id, base = BASE }: { id: number; base?: string
|
||||||
return strings[key] ? tr(strings[key]) : code;
|
return strings[key] ? tr(strings[key]) : code;
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<Block
|
<SectionPaper sx={{ p: 2 }}>
|
||||||
title={t('wc.log.title')}
|
<Box role="button" tabIndex={0} aria-expanded={open} onClick={() => setOpen((o) => !o)}
|
||||||
actions={<Button size="small" startIcon={<HistoryIcon />} onClick={() => setOpen((o) => !o)}>{t('wc.log.title')}</Button>}
|
onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); setOpen((o) => !o); } }}
|
||||||
>
|
sx={{ cursor: 'pointer', '& h2': { mb: open ? 1.5 : 0 } }}>
|
||||||
|
<SectionTitle icon={HistoryIcon} title={t('wc.log.title')} />
|
||||||
|
</Box>
|
||||||
<Collapse in={open} unmountOnExit>
|
<Collapse in={open} unmountOnExit>
|
||||||
{q.isLoading ? <LoadingBanner variant="update" /> : (
|
{q.isLoading ? <LoadingBanner variant="update" /> : (
|
||||||
<>
|
<>
|
||||||
|
|
@ -164,6 +168,6 @@ export function ClaimLogSection({ id, base = BASE }: { id: number; base?: string
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions><Button onClick={() => setDetail(null)}>{t('common.close')}</Button></DialogActions>
|
<DialogActions><Button onClick={() => setDetail(null)}>{t('common.close')}</Button></DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</Block>
|
</SectionPaper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -226,7 +226,7 @@ export function WalletPage() {
|
||||||
return (
|
return (
|
||||||
<Stack spacing={2}>
|
<Stack spacing={2}>
|
||||||
<PageHeader
|
<PageHeader
|
||||||
title={isNew ? t('rw.createTitle') : t('rw.detailTitle', { id: w!.id })}
|
title={isNew ? t('rw.createTitle') : t('rw.detailTitle', { id: w!.tn ?? w!.holderName ?? w!.id })}
|
||||||
status={!isNew ? <StatusChip value={w!.statusCode} statuses={walletStatuses} size="medium" /> : undefined}
|
status={!isNew ? <StatusChip value={w!.statusCode} statuses={walletStatuses} size="medium" /> : undefined}
|
||||||
backTo={ROOT}
|
backTo={ROOT}
|
||||||
actions={!isNew && (
|
actions={!isNew && (
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,11 @@ import { defineStrings } from '@/i18n/useUi';
|
||||||
/** Strings of the refinery payment methods screen (legacy captions REFINERY_WALLET.* / PUBLIC.* / ERROR.*, verbatim in Arabic where they exist). */
|
/** Strings of the refinery payment methods screen (legacy captions REFINERY_WALLET.* / PUBLIC.* / ERROR.*, verbatim in Arabic where they exist). */
|
||||||
export default defineStrings({
|
export default defineStrings({
|
||||||
'rw.menu': { en: 'Payment methods', ar: 'طرق الدفع' },
|
'rw.menu': { en: 'Payment methods', ar: 'طرق الدفع' },
|
||||||
'rw.title': { en: 'Payment methods', ar: 'شاشة طرق الدفع' },
|
'rw.title': { en: 'Payment methods', ar: 'طرق الدفع' },
|
||||||
'rw.subtitle': { en: 'How the truck owners (and the drivers, for the tip) get paid', ar: 'آلية صرف الأجور لأصحاب الشاحنات وإكرامية السائقين' },
|
'rw.subtitle': { en: 'How the truck owners (and the drivers, for the tip) get paid', ar: 'آلية صرف الأجور لأصحاب الشاحنات وإكرامية السائقين' },
|
||||||
'rw.new': { en: 'New payment method', ar: 'آلية صرف جديدة' },
|
'rw.new': { en: 'New payment method', ar: 'آلية صرف جديدة' },
|
||||||
'rw.createTitle': { en: 'New payment method', ar: 'آلية صرف جديدة' },
|
'rw.createTitle': { en: 'New payment method', ar: 'آلية صرف جديدة' },
|
||||||
'rw.detailTitle': { en: 'Payment method {id}', ar: 'آلية الصرف {id}' },
|
'rw.detailTitle': { en: 'Payment method - truck {id}', ar: 'آلية الصرف {id}' },
|
||||||
'rw.crumb.new': { en: 'New', ar: 'جديد' },
|
'rw.crumb.new': { en: 'New', ar: 'جديد' },
|
||||||
'rw.crumb.details': { en: 'Details', ar: 'التفاصيل' },
|
'rw.crumb.details': { en: 'Details', ar: 'التفاصيل' },
|
||||||
'rw.loadFailed': { en: 'The record could not be loaded.', ar: 'تعذر تحميل السجل.' },
|
'rw.loadFailed': { en: 'The record could not be loaded.', ar: 'تعذر تحميل السجل.' },
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue