From 40661510335eb8a6854facc43543b829e3d730d3 Mon Sep 17 00:00:00 2001 From: Samer Salameh Date: Thu, 19 Nov 2026 16:41:19 +0300 Subject: [PATCH] =?UTF-8?q?Refinery=20(=D8=A7=D9=84=D9=85=D8=B5=D9=81?= =?UTF-8?q?=D8=A7=D8=A9):=20port=20trips,=20wage=20claims,=20commission=20?= =?UTF-8?q?claims,=20wallets,=20variables=20and=20cards=20from=20AqabaTCS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New API slice under /api/v1/refinery (Dapper on the NAFITHTCS REFINERY_* tables), web screens under features/refinery, Dinarak and Jopetrol gateways (off by default, secrets from env), remaining-balance recalculation after the ton price correction, Excel reports (trips, operator, exchange, diesel, cards, bank). Access only through permission keys: db/refinery-permissions.sql gives the 6 screens and all action keys to PTADM (SU always allowed). Docs: docs/refinery-agent-brief.md, docs/refinery-db-objects.txt (legacy views and diesel functions), ENVIRONMENTS.md. The REFINERY_OIL import job and the daily totals email job are not ported. Co-Authored-By: Claude Sonnet 5.5 --- db/refinery-permissions.sql | 63 ++ docs/ENVIRONMENTS.md | 1 + docs/refinery-agent-brief.md | 74 ++ docs/refinery-db-objects.txt | 983 ++++++++++++++++++ .../V1/Refinery/TripsController.cs | 16 + src/NTP.Api/appsettings.json | 12 + .../Access/PermissionKeys.Refinery.Trips.cs | 2 + .../Refinery/Trips/TripReportService.cs | 32 + .../Variables/TonPriceRecalculationService.cs | 31 +- src/NTP.Infrastructure/DependencyInjection.cs | 15 + web/src/features/refinery/cards/meta.ts | 1 + web/src/features/refinery/routes.tsx | 27 + web/src/features/refinery/trips/meta.tsx | 2 +- web/src/features/refinery/trips/pages.tsx | 39 +- web/src/features/refinery/trips/strings.ts | 6 +- web/src/features/refinery/variables/meta.ts | 10 + .../features/refinery/wage-claims/strings.ts | 10 +- web/src/features/refinery/wallets/meta.ts | 1 + web/src/features/refinery/wallets/strings.ts | 2 +- 19 files changed, 1286 insertions(+), 41 deletions(-) create mode 100644 db/refinery-permissions.sql create mode 100644 docs/refinery-agent-brief.md create mode 100644 docs/refinery-db-objects.txt create mode 100644 web/src/features/refinery/routes.tsx diff --git a/db/refinery-permissions.sql b/db/refinery-permissions.sql new file mode 100644 index 0000000..f3fb1b5 --- /dev/null +++ b/db/refinery-permissions.sql @@ -0,0 +1,63 @@ +-- 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). +-- 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). +-- Give another role access: copy the block and change the role code. + +INSERT INTO GRAINS_SCREEN_PERMISSIONS (ROLECODE, RESOURCE_KEY) +SELECT 'PTADM', v.resource_key + FROM (SELECT 'refinery.trips' AS resource_key FROM dual UNION ALL + SELECT 'refinery.trips.firstAdvance' FROM dual UNION ALL + SELECT 'refinery.trips.secondAdvance' FROM dual UNION ALL + SELECT 'refinery.trips.firstAdvanceReverse' FROM dual UNION ALL + SELECT 'refinery.trips.secondAdvanceReverse' FROM dual UNION ALL + SELECT 'refinery.trips.exchange' FROM dual UNION ALL + SELECT 'refinery.trips.exchangeAudit' FROM dual UNION ALL + SELECT 'refinery.trips.receipt' FROM dual UNION ALL + SELECT 'refinery.trips.payment' FROM dual UNION ALL + SELECT 'refinery.trips.activateWalletExchange' FROM dual UNION ALL + SELECT 'refinery.trips.orangePayment' FROM dual UNION ALL + SELECT 'refinery.trips.cashPayment' FROM dual UNION ALL + SELECT 'refinery.trips.confirmExchange' FROM dual UNION ALL + SELECT 'refinery.trips.print' FROM dual UNION ALL + SELECT 'refinery.trips.report' FROM dual UNION ALL + SELECT 'refinery.trips.operatorReport' FROM dual UNION ALL + SELECT 'refinery.trips.exchangeReport' FROM dual UNION ALL + SELECT 'refinery.trips.dieselReport' FROM dual UNION ALL + SELECT 'refinery.trips.cardsReport' FROM dual UNION ALL + SELECT 'refinery.trips.bankReport' FROM dual UNION ALL + SELECT 'refinery.trips.recalculateBalance' FROM dual UNION ALL + SELECT 'refinery.wageClaims' FROM dual UNION ALL + SELECT 'refinery.wageClaims.create' FROM dual UNION ALL + SELECT 'refinery.wageClaims.close' FROM dual UNION ALL + SELECT 'refinery.wageClaims.transfer' FROM dual UNION ALL + SELECT 'refinery.wageClaims.report' FROM dual UNION ALL + SELECT 'refinery.commissionClaims' FROM dual UNION ALL + SELECT 'refinery.commissionClaims.create' FROM dual UNION ALL + SELECT 'refinery.commissionClaims.complete' FROM dual UNION ALL + SELECT 'refinery.commissionClaims.report' FROM dual UNION ALL + SELECT 'refinery.wallets' FROM dual UNION ALL + SELECT 'refinery.wallets.create' FROM dual UNION ALL + SELECT 'refinery.wallets.update' FROM dual UNION ALL + SELECT 'refinery.wallets.activate' FROM dual UNION ALL + SELECT 'refinery.wallets.deactivate' FROM dual UNION ALL + SELECT 'refinery.wallets.report' FROM dual UNION ALL + SELECT 'refinery.variables' FROM dual UNION ALL + SELECT 'refinery.variables.create' FROM dual UNION ALL + SELECT 'refinery.variables.update' FROM dual UNION ALL + SELECT 'refinery.variables.tonPriceCorrection' FROM dual UNION ALL + SELECT 'refinery.variables.report' FROM dual UNION ALL + SELECT 'refinery.variables.remainingBalanceReport' FROM dual UNION ALL + SELECT 'refinery.cards' FROM dual UNION ALL + SELECT 'refinery.cards.create' FROM dual UNION ALL + SELECT 'refinery.cards.activate' FROM dual UNION ALL + SELECT 'refinery.cards.deactivate' FROM dual UNION ALL + SELECT 'refinery.cards.report' FROM dual) v + WHERE NOT EXISTS ( + SELECT 1 FROM GRAINS_SCREEN_PERMISSIONS p + WHERE p.rolecode = 'PTADM' AND p.resource_key = v.resource_key); + +COMMIT; + +-- Check (expect 47 rows): +-- SELECT resource_key FROM GRAINS_SCREEN_PERMISSIONS WHERE rolecode = 'PTADM' AND resource_key LIKE 'refinery.%' ORDER BY resource_key; diff --git a/docs/ENVIRONMENTS.md b/docs/ENVIRONMENTS.md index 8a27dc5..db52864 100644 --- a/docs/ENVIRONMENTS.md +++ b/docs/ENVIRONMENTS.md @@ -58,6 +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) 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) +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) **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 diff --git a/docs/refinery-agent-brief.md b/docs/refinery-agent-brief.md new file mode 100644 index 0000000..37dad62 --- /dev/null +++ b/docs/refinery-agent-brief.md @@ -0,0 +1,74 @@ +# Refinery migration: shared brief for the porting agents + +Port refinery modules of the legacy ColdFusion app **AqabaTCS** (`C:\inetpub\wwwroot\AqabaTCS_LIVE`, read-only) into NTP V2 +(.NET 10 API + Oracle 11g/Dapper + React/MUI web). Read first: `CLAUDE.md`, `docs/MIGRATION.md`, `docs/refinery-db-objects.txt` +(text of the legacy DB views and the diesel / amount functions, already extracted), and `docs/schema/NAFITHTCS.md` sections +`REFINERY_*`. Reference slices that show the house style: `src/NTP.Application/Grains/Registry`, `.../Orders` (BillingService), +`src/NTP.Infrastructure/Persistence/Repositories/Grains/*`, `src/NTP.Api/Controllers/V1/Grains/RegistryController.cs`, +`web/src/features/grains-registry` (pages, meta, strings, api hooks). + +## Legacy layout (AqabaTCS) +- Backend per entity: `backend/entities//` : `*dao.cfc` (SQL), `*factory.cfc` (business rules, validation, transactions, log rows), + `*factoryweb.cfc` (web layer: filter whitelist, role specific branches, row actions), `*bean.cfc` (fields). +- Frontend per entity: `frontend/entities//GRID`, `` (form), `Log` (history popup): `.js` + `.html`. +- Menu / authority: `customtags/Menu.cfm` (entries REFINERYTRIP, REFINERY_WAGE_CLAIM, REFINERY_COMMISSION_CLAIM, REFINERY_WALLET, + REFINERY_VARIABLES, REFINERY_CARDS). Grids read DB views (`REFINERY_*_VIEW`, text in docs/refinery-db-objects.txt); `common.getGridData` + builds the filter SQL (look at `backend/common/common.cfc` when you need to know how a filter field maps to a column). +- Captions (Arabic UI / message texts) are in the database: `select code, ar from ntp.lt_caption where code like 'REFINERY%'` (also + `PUBLIC.%`, `ERROR.%`, `MESSAGE.%`, `MENU.%` for the codes you meet). **User-facing texts must be the legacy Arabic captions, verbatim.** + +## Read-only database access (NAFITHTCS, real data) +`dotnet "C:\Users\samers\AppData\Local\Temp\claude\d72adf472b8502c5\42c5454f-ddae-4fd6-af13-dba201a0f7ce\scratchpad\q\out\q.dll" NAFITHTCS "select ..."` +(only SELECT / WITH; prints `|` separated rows, max 400). Use it to check columns, status codes, sample rows, views, `user_source`, +`user_tab_columns`, `ntp.lt_caption`. Never print or copy a connection string; never write to the database; do not run SQL scripts. +`appsettings.Local.json` is in the MAIN checkout (`C:\inetpub\wwwroot\NTP_V2\src\NTP.Api\`), not in your worktree: you cannot run the API. + +## Rules (see CLAUDE.md too, they apply) +- Oracle 11.2: no OFFSET/FETCH or identity, page with ROWNUM (`OracleSql.Paginate`), sequences for ids (`SEQ_REFINERY_*` exist). Dapper with + classes that have settable properties for results. Bind by name; do not add unused DynamicParameters. Bind numbers, no `TO_CHAR` on indexed columns. + Reuse the legacy views where it is simplest (they exist in the database) but prefer explicit SQL when the view is slow or wrong for the screen. +- Layers: thin controllers (`src/NTP.Api/Controllers/V1/Refinery/Controller.cs`, route `api/v{version}/refinery/`, `[RequirePermission(key)]`), + services + contracts + validators + repository interfaces in `src/NTP.Application/Refinery//`, Dapper repositories in + `src/NTP.Infrastructure/Persistence/Repositories/Refinery//` (class names `*Service` / `*Repository` registered by convention against `I{Name}`). + Primary connection `IDbSession` (NAFITHTCS) holds all REFINERY_* tables; `IUnitOfWork.ExecuteInTransactionAsync` for multi-statement writes. + Errors: `BusinessException` (422), `ForbiddenException`, `NotFoundException`, FluentValidation (400) with the legacy Arabic text. +- 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). + 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 + (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 + `src/NTP.Application/Access/PermissionKeys.Refinery..cs` (`public static partial class PermissionKeys`). Every endpoint carries + `[RequirePermission(...)]` with the right key; the web hides buttons with `useAuth().can(key)`. Do NOT add them to `PermissionDefaults` + (rows in GRAINS_SCREEN_PERMISSIONS are the source; the lead writes `db/refinery-permissions.sql` from the key list you report). + Where a legacy rule depended on the role only to narrow what a user sees, drop it and say so in your report. +- **No secrets, no real side effects**: legacy code contains hard-coded credentials (e.g. the Jopetrol SOAP password). Never copy them. External + calls go behind `IDinarakGateway` / `IJopetrolGateway` (`src/NTP.Application/Refinery/Integrations/RefineryGateways.cs`, already written; do not + change the signatures) with options from configuration and `Enabled=false` by default; add the non-secret defaults to + `src/NTP.Api/appsettings.json` (section `Refinery:...`) and say in your report which env vars hold the secrets. Never call a real endpoint. +- Web (React 19, MUI 9): Arabic (RTL), logical CSS properties, metadata-driven `DataGrid` / `MetaForm` from `web/src/components`, strings `{ en, ar }` + in the module's `strings.ts`, API hooks with React Query like `grains-registry/api.ts`. Put everything of a module under + `web/src/features/refinery//` and export from `web/src/features/refinery//index.ts`: + `export const routes: RouteObject[]` (absolute paths `/refinery/...`) and `export const menuItems: MenuItem[]` (leaf entries only: key = the + screen key, title, icon, path; the lead composes the group and `features/refinery/routes.tsx`). Do NOT create `features/refinery/routes.tsx`. +- Port behaviour, not markup: same filters, same grid columns, same row actions, same validations and messages, same status flow. Do not port dead + code (check callers / Menu.cfm). Cite legacy `file:line` in code comments where a rule is non-obvious. +- Tests: xUnit in `tests/NTP.Tests/Refinery/` for pure logic (calculations, status rules, validators). `dotnet test tests/NTP.Tests`. + +## Working environment +- You work in your own git worktree. Do not touch the main checkout. Do NOT start the API or the dev server (ports are used by the lead). +- First copy these uncommitted foundation files from the main checkout into the same relative paths in your worktree (they are identical for all agents): + `src/NTP.Application/Access/PermissionDefaults.cs` (class made `partial`), `src/NTP.Application/Access/PermissionKeys.Refinery.cs`, + `src/NTP.Application/Refinery/Integrations/RefineryGateways.cs` (all under `C:\inetpub\wwwroot\NTP_V2\`). Commit them with your work. +- Web checks need node_modules: in your worktree `web/` create a junction to the main one: `cmd /c mklink /J node_modules C:\inetpub\wwwroot\NTP_V2\web\node_modules` + (do not commit it; check `git status`). Then `cd web && npx tsc -b --noEmit`. +- Build with `dotnet build src/NTP.Api` and test with `dotnet test tests/NTP.Tests` in your worktree. Everything must build and pass before you finish. +- Shared files you may have to touch (re-read right before editing, make a minimal Edit, never rewrite): `src/NTP.Infrastructure/DependencyInjection.cs` + (gateway registration), `src/NTP.Api/appsettings.json`. Touch nothing else outside your module folders. +- Commit your work in the worktree branch (one commit, clear message, end it with the line `Co-Authored-By: Claude Sonnet 5.5 `). + Do not push. + +## Report back (your final message, plain text, concise) +1. Branch name and commit hash. 2. Files added / changed outside your module folders. 3. **Exact list of permission keys** you declared (screen + action keys). +4. What you did NOT port or changed on purpose (and why). 5. Anything you could not verify (nothing was run against real data except read-only SELECTs). +6. Open questions for the owner. diff --git a/docs/refinery-db-objects.txt b/docs/refinery-db-objects.txt new file mode 100644 index 0000000..a5aadf9 --- /dev/null +++ b/docs/refinery-db-objects.txt @@ -0,0 +1,983 @@ +=== VIEWS (user_views text, NAFITHTCS) === + +--- REFINERY_CARDS_VIEW +select "ID","TN","CARD_NUMBER","BOX_NO","CURRENT_BALANCE","CREATION_DATE","CREATED_BY","UPDATE_DATE","UPDATED_BY","STATUS_CODE","LAST_TRIP_ID" + from REFINERY_CARDS + + +--- REFINERY_CARDS_LOG_VIEW +select "ID","ENTITIY_ID","METHOD_NAME","BALANCE_BEFORE","BALANCE_AFTER","CREATED_BY",to_char( "CREATION_DATE",'dd/mm/yyyy HH24:MI') CREATION_DATE,"UPDATED_BY",to_char(LAST_UPDATE_DATE,'dd/mm/yyyy HH24:MI') LAST_UPDATE_DATE, "AMOUNT","PN" + from REFINERY_CARDS_LOG + + +--- REFINERY_COMMISSION_CLAIM_VIEW +select "ID","COMMISSION_CLAIM_NO",to_char("COMMISSION_CLAIM_DATE",'dd/mm/yyyy') COMMISSION_CLAIM_DATE, +to_char(trunc(COMMISSION_CLAIM_DATE) , 'yyyymmdd') as COMMISSION_CLAIM_DATE_STRING, +"STATUS_CODE" , +(select count(id) from refinery_wage_claim tr where tr.COMMISSION_claim_id = REFINERY_COMMISSION_CLAIM.id) trip_cnt +from REFINERY_COMMISSION_CLAIM + + +--- REFINERY_COMMISSION_LOG_VIEW +select n.login,t."ID",t."ENTITIY_ID",t."METHOD_NAME",to_char(t."LOG_DATE",'dd/mm/yyyy HH24:MI') LOG_DATE,t."USER_ID",t."USER_IP",t."OLD_DATA",t."NEW_DATA" from refinery_commission_claim_log t +join ntp.ntpusers n ON +t.user_id = n.id(+) +order by t.id desc + + +--- REFINERY_TRIPS_VIEW +select REFINERY_TRIPS."ID", +"SECOND_ADVANCE_PAYMENT", +"FIRST_ADVANCE_PAYMENT", +"PN",REFINERY_TRIPS."STATUS_CODE", +to_char("DISPATCH_DATE",'dd/mm/yyyy') DISPATCH_DATE, +to_char("ACTUAL_LOADING_DATE",'dd/mm/yyyy') ACTUAL_LOADING_DATE, +DateToString("ACTUAL_LOADING_DATE") ACTUAL_LOADING_DATE_STRING, +DATETOSTRING(RECEIVED_DATE) RECEIVED_DATE_STRING, +ACTUAL_LOADING_DATE LOADING_DATE, +"ACTUAL_LOADING_TIME", +Datetostring("DISCHARGE_ENTRY_DATE") DISCHARGE_ENTRY_DATE_STRING, +"LOADING_CENTER","CLIENT_NO",comp.display_name CLIENT_NAME, +REFINERY_TRIPS."TN","TRN",REFINERY_TRIPS."NNPN","MATERIAL_NO", +"MENAGATE_NO","EMPTY_WEIGHT", +"GROSS_WEIGHT","NET_LOADING_WEIGHT", +"STANDARD_UNITS_WEIGHT","LITERS_WEIGHT", +"DENSITY","TEMPERATURE","FLAG", +"DISCHARGE_AUTHORIZTION_NO", +"DISCHARGE_AUTHORIZTION_YEAR", +"DISCHARGE_ENTRY_TIME", +"DISCHARGE_EXIT_DATE", +"DISCHARGE_EXIT_TIME", +"ACTUAL_GROSS_WEIGHT", +"ACTUAL_EMPTY_WEIGHT", +"NET_DISCHARGE_WEIGHT", +"NET_WAGE" ,REFINERY_TRIPS.DIESEL_CHARGE, +wa.epayment, + +decode(paid_wallet.wallet_number,null,wa.wallet_number,paid_wallet.wallet_number) wallet_number, +decode(paid_wallet.company_code,null,wa.company_code,paid_wallet.company_code) company_code, +decode(paid_wallet.owner_nnpn,null,wa.owner_nnpn,paid_wallet.owner_nnpn) owner_nnpn, +decode(paid_wallet.owner_name,null,wa.owner_name,paid_wallet.owner_name) owner_name, +decode(paid_wallet.owner_name_english,null,wa.owner_name_english,paid_wallet.owner_name_english) owner_name_english, +decode(paid_wallet.iban,null,wa.iban,paid_wallet.iban) iban, +decode(paid_wallet.bank_account,null,wa.bank_account,paid_wallet.bank_account) bank_account, +decode(paid_wallet.bank_name,null,wa.bank_name,paid_wallet.bank_name) bank_name, + +decode(wa.id,null,'0','1') as HAVE_PAYMENT_METHOD, +drvr_wallet.wallet_number driver_wallet_number, + decode(REFINERY_TRIPS.WAGE_CLAIM_ID ,null,'0','1') as HAS_WAGE_CLAIM, +RECEIVED_BY,RECEIVED_DATE,PAYMENTED_BY,PAYMENTED_DATE, +REFINERY_TRIPS.Payment_Options, +REFINERY_TRIPS.VOUCHER_SERIAL_NUMBER, + +--Datetostring("PAYMENTED_DATE") , + +--decode(REFINERY_TRIPS.Status_Code,'EXCHANGED',Datetostring(REFINERY_TRIPS.PAYMENTED_DATE),'READY_TO_PAY',Datetostring(REFINERY_TRIPS.Received_Date), +--'DISCHARGED',Datetostring(REFINERY_TRIPS.ACTUAL_LOADING_DATE)) PAYMENTED_DATE_STRING, + +Datetostring(REFINERY_TRIPS.ACTUAL_LOADING_DATE) PAYMENTED_DATE_STRING, + +DISCHARGE_ENTRY_DATE,to_char("DISCHARGE_ENTRY_DATE",'dd/mm/yyyy') DISCHARGE_ENTRY_DATE_DISPLAY, +to_char("PAYMENTED_DATE",'dd/mm/yyyy') PAYMENTED_DATE_DISPLAY, +"WATER_AMOUNT","SEDIMENT_AMOUNT",REFINERY_TRIPS."TRIP_STATUS",REFINERY_TRIPS."USER_ID",REFINERY_TRIPS."LAST_UPDATE_DATE","DAY_TIME","PROGRAM_ID","WORK_STN_ID","EXCHANGE_CLAIM_NO","PAID_AMOUNT_WATER", +WAGE_CLAIM_ID, +rwc.wage_claim_no, +info.name_ar DRVR, +REVERSE_PAYMENT, +S.FIRSTNAME RECEIVED_BY_NAME, +LT.AR STATUS_CODE_AR,remarks, +REFINERY_TRIPS.Loading_No, +(NET_LOADING_WEIGHT - net_discharge_weight) as "WEIGHT_DIIERANCE", +CARD.CARD_NUMBER,CARD.CURRENT_BALANCE, +decode(wa.epayment,null,unistr('\0644\0627\0020\064A\0648\062C\062F'),'0',unistr('\062D\0648\0627\0644\0629'),'1',unistr('\0627\0644\0643\062A\0631\0648\0646\064A')) as PAYMENT_METHOD, +--decode(wa.epayment,null,0,'0',1,'1',2) as PAYMENT_METHOD_CODE, +decode(REFINERY_TRIPS.PAYMENT_OPTIONS,NULL,decode(wa.epayment,null,0,'0',1,'1',2),'CACH_PAYMENT',3) as PAYMENT_METHOD_CODE, +Datetostring("PAYMENTED_DATE") PAYMENTED_DATE_STRING_SEARCH, + +REFINERY_TRIPS.DINARAK_REFERENCE_ID , REFINERY_WALLET_ID , +(CASE WHEN WATER_AMOUNT > 0 THEN 1 + ELSE 0 END) as WATER_EXIST, + +decode(paid_wallet.epayment,null,'','0',unistr('\062D\0648\0627\0644\0629'),'1',unistr('\0627\0644\0643\062A\0631\0648\0646\064A')) as paid_epayment +,"TRIP_NET_WAGE" , "REMAINING_BALANCE" ,penalty_amount , penalty_quantity + +from REFINERY_TRIPS,ntp.lt_caption lt,refinery_wage_claim rwc,drivers_info info,refinery_company comp,REFINERY_WALLET wa,NTP.NTPUSERS S,REFINERY_WALLET drvr_wallet, +REFINERY_CARDS CARD,REFINERY_WALLET paid_wallet +where LT.CODE(+) = 'REFINERYTRIP.STATUS.'|| REFINERY_TRIPS.STATUS_CODE +and rwc.id(+)=REFINERY_TRIPS.Wage_Claim_Id +and wa.tn(+)=REFINERY_TRIPS.tn +and info.nnpn(+)=REFINERY_TRIPS.Nnpn +and info.status_code(+) = 'COMPLETED' +and comp.code(+) = CLIENT_NO +AND s.id(+)=REFINERY_TRIPS.Received_By +and to_char(drvr_wallet.driver_nnpn(+))=REFINERY_TRIPS.Nnpn +and CARD.TN(+) = REFINERY_TRIPS.tn +AND card.Status_Code(+) = 'ACTIVE' +and wa.status_code(+) = 'ACTIVE' +and drvr_wallet.Status_Code(+)='ACTIVE' +and paid_wallet.id(+)=REFINERY_TRIPS.Refinery_Wallet_Id + + +--- REFINERY_TRIPS_LOG_VIEW +select n.login,t."ID",t."ENTITIY_ID",t."METHOD_NAME",to_char(t."LOG_DATE",'dd/mm/yyyy HH24:MI') LOG_DATE,t."USER_ID",t."USER_IP",t."OLD_DATA",t."NEW_DATA" from refinery_trips_LOG t +join ntp.ntpusers n ON +t.user_id = n.id(+) +order by t.id desc + + +--- REFINERY_VARIABLES_VIEW +select rownum ID,GROUP_ID ,to_char("START_DATE",'yyyy-mm-dd') "START_DATE" , Datetostring("START_DATE") START_DATE_STRING, to_char("END_DATE",'yyyy-mm-dd') "END_DATE", Datetostring("END_DATE") END_DATE_STRING,"DIESEL_LITER_PRICE","TON_WAGE","TON_PRICE","DRIVER_TIP","PERMIT_DISPATCH","WAYBILL_FEE","COMMISSION","TOLERANCE_PERCENTAGE","FIRST_ADVANCE_PAYMENT" /*, TON_PRICE_CORRECTION */ from ( + select start_date,end_date,key_name,key_value ,GROUP_ID from REFINERY_VARIABLES where KEY_NAME != 'AUTDIT_MODE' +) +pivot +( + sum(key_value) + for key_name in ('DIESEL_LITER_PRICE' DIESEL_LITER_PRICE,'TON_WAGE' TON_WAGE,'TON_PRICE' TON_PRICE,'DRIVER_TIP' DRIVER_TIP,'PERMIT_DISPATCH' PERMIT_DISPATCH,'WAYBILL_FEE' WAYBILL_FEE,'COMMISSION' COMMISSION,'TOLERANCE_PERCENTAGE' TOLERANCE_PERCENTAGE, 'FIRST_ADVANCE_PAYMENT' FIRST_ADVANCE_PAYMENT /* , 'TON_PRICE_CORRECTION' TON_PRICE_CORRECTION */) +) +order by 1 + + +--- REFINERY_WAGE_CLAIM_VIEW +select REFINERY_WAGE_CLAIM."ID","WAGE_CLAIM_NO",to_char("WAGE_CLAIM_DATE",'dd/mm/yyyy') WAGE_CLAIM_DATE,REFINERY_WAGE_CLAIM."STATUS_CODE" ,COMMISSION_CLAIM_ID, + decode(REFINERY_WAGE_CLAIM.COMMISSION_CLAIM_ID ,null,'0','1') as HAS_COMMISSION_CLAIM, +(select count(id) from refinery_trips tr where tr.wage_claim_id = REFINERY_WAGE_CLAIM.id) trip_cnt,comm.commission_claim_no +from REFINERY_WAGE_CLAIM,refinery_commission_claim comm +where comm.id(+)=REFINERY_WAGE_CLAIM.COMMISSION_CLAIM_ID + + +--- REFINERY_WAGE_CLAIM_LOG_VIEW +select n.login,t."ID",t."ENTITIY_ID",t."METHOD_NAME",to_char(t."LOG_DATE",'dd/mm/yyyy HH24:MI') LOG_DATE,t."USER_ID",t."USER_IP",t."OLD_DATA",t."NEW_DATA" from refinery_wage_claim_log t +join ntp.ntpusers n ON +t.user_id = n.id(+) +order by t.id desc + + +--- REFINERY_WALLET_VIEW +select "ID" +,"TN" +,"COMPANY_CODE" +,"EPAYMENT" +,decode("OWNER_NNPN",null,DRIVER_NNPN,OWNER_NNPN) OWNER_NNPN +,decode("OWNER_NNPN",null,DRIVER_NNPN,OWNER_NNPN) NNPN +,"WALLET_NUMBER" +,decode("OWNER_NAME",null,DRIVER_NAME,OWNER_NAME) OWNER_NAME +,"CREATION_DATE" +,"DRIVER_NAME" +,"DRIVER_NNPN" +,"IBAN" +,"BANK_ACCOUNT" +,"BANK_NAME" +,"CREATED_BY" +,"UPDATE_DATE" +,"UPDATED_BY" +,"STATUS_CODE" +,"BANK_BRANCH","OWNER_NAME_ENGLISH", +----,DECODE("EPAYMENT",0,unistr('\062D\0648\0627\0644\0629'),unistr('\0645\062D\0641\0638\0629\0020\0627\0644\0643\062A\0631\0648\0646\064A\0629')) PAYMENT_METHOD, +( CASE + WHEN DRIVER_NNPN is not null THEN 'DRAIVER_WALLET' + WHEN EPAYMENT = 0 THEN 'BANK' + + ELSE 'EWALLET' +END ) PAYMENT_METHOD +from REFINERY_WALLET + + +--- REFINERY_WALLET_LOG_VIEW +select n.login,t."ID",t."ENTITIY_ID",t."METHOD_NAME",to_char(t."LOG_DATE",'dd/mm/yyyy HH24:MI') LOG_DATE,t."USER_ID",t."USER_IP",t."OLD_DATA",t."NEW_DATA" from refinery_WALLET_LOG t +join ntp.ntpusers n ON +t.user_id = n.id(+) +order by t.id desc + + +--- REFINERY_DIESEL_REPORT_VIEW +select T.ID, t.pn,t.tn,T.STATUS_CODE, +t.discharge_authoriztion_no,c.creation_date, +s.firstname, +t.DIESEL_CHARGE, + +decode (c.method_name,'FIRST_ADVANCED_PAYMENT',unistr('\0634\062D\0646\0020\0644\0644\062A\062D\0645\064A\0644'),'SECOND_ADVANCED_PAYMENT',unistr('\0634\062D\0646\0020\0644\0644\062A\0641\0631\064A\063A'),'SECOND_ADVANCED_PAYMENT_REVERSE',unistr('\0627\0644\063A\0627\0621\0020\0634\062D\0646\0020\0627\0644\062A\0641\0631\064A\063A'),'FIRST_ADVANCED_PAYMENT_REVERSE',unistr('\0627\0644\063A\0627\0621\0020\0634\062D\0646\0020\0627\0644\062A\062D\0645\064A\0644')) method_name, + +c.balance_before,c.balance_after,C.AMOUNT from refinery_trips_view t,refinery_cards_log c,NTP.NTPUSERS s + +where c.PN=t.PN +and s.id(+)=to_number(c.created_by) + +ORDER BY CREATION_DATE + + +--- REFINERY_CLAIMS_REPORT_VIEW +select t."ID",t.WAGE_CLAIM_ID, t.STATUS_CODE,TRIP_STATUS, "DISCHARGE_AUTHORIZTION_NO",discharge_authoriztion_year, to_char(Discharge_Entry_Date , 'dd/mm/yyyy' ) Discharge_Entry_Date, client_no, '' client_NAME,'' serial,loading_no , to_char(actual_loading_date , 'dd/mm/yyyy') actual_loading_date , NET_LOADING_WEIGHT,WATER_AMOUNT , NET_DISCHARGE_WEIGHT +,(NET_LOADING_WEIGHT - net_discharge_weight) as "WEIGHT_DIIERANCE", +TON_WAGE ,CALCULATED_QUANTITY_TON ,QUANTITY_WAGE ,w.wage_claim_no, TOLERANCE_QUANTITY , +(CASE + WHEN Water_amount > 0 THEN + 'YES' + ELSE 'NO' + END) WATER_EXIST, + + + CASE + WHEN (NET_LOADING_WEIGHT - net_discharge_weight) < TOLERANCE_QUANTITY THEN + ltrim(to_char(0, '0.000')) + ELSE ltrim(to_char(PENALTY_QUANTITY, '9999999.999')) + END PENALTY_QUANTITY, + + --ltrim(to_char(PENALTY_QUANTITY, '9999999.999')) PENALTY_QUANTITY , + ltrim(to_char(TON_PRICE, '9999999.999')) TON_PRICE , + PENALTY_AMOUNT, + ltrim(to_char(DRIVER_TIP, '9999999.999')) DRIVER_TIP , + ltrim(to_char(PERMIT_DISPATCH, '9999999.999')) PERMIT_DISPATCH , + WAYBILL_FEE,DIESEL_LITER_PRICE, + ltrim(to_char((select sum(amount) from REFINERY_CARDS_LOG where pn = t.pn),'9999999.99')) advance_payment_FOR_DIESEL, + ltrim(to_char(COMMISSION, '9999999.999')) COMMISSION , + ltrim(to_char(NET_WAGE, '9999999.999')) NET_WAGE,T.TN,info.name_ar DRVR + + from REFINERY_TRIPS t,refinery_wage_claim w,DRIVERS_INFO info + + where w.id=t.wage_claim_id + and info.nnpn(+)=t.Nnpn +and info.status_code(+) = 'COMPLETED' + + +--- REFINERY_CLAIMS_REPORT +select "ID",STATUS_CODE,TRIP_STATUS, "DISCHARGE_AUTHORIZTION_NO",discharge_authoriztion_year, Discharge_Entry_Date, client_no, '' client_NAME,'' serial,loading_no , actual_loading_date, NET_LOADING_WEIGHT,Water_amount , net_discharge_weight ,(NET_LOADING_WEIGHT - net_discharge_weight) as "WEIGHT_DIIERANCE", +TON_WAGE ,CALCULATED_QUANTITY_TON ,QUANTITY_WAGE , TOLERANCE_QUANTITY , +(CASE + WHEN Water_amount > 0 THEN + 'YES' + ELSE 'NO' + END) WATER_EXIST, + ltrim(to_char(PENALTY_QUANTITY, '9999999.99')) PENALTY_QUANTITY , + ltrim(to_char(TON_PRICE, '9999999.99')) TON_PRICE , + PENALTY_AMOUNT, + ltrim(to_char(DRIVER_TIP, '9999999.99')) DRIVER_TIP , + ltrim(to_char(PERMIT_DISPATCH, '9999999.99')) PERMIT_DISPATCH , + WAYBILL_FEE,DIESEL_LITER_PRICE, + ltrim(to_char((select sum(amount) from REFINERY_CARDS_LOG where pn = REFINERY_TRIPS.pn),'9999999.99')) advance_payment_FOR_DIESEL, + COMMISSION ,NET_WAGE + from REFINERY_TRIPS + + +=== FUNCTIONS === + +--- CALCULATEREFINARYDIESEL +FUNCTION "CALCULATEREFINARYDIESEL" (RefineryId in numeric) + + return float as + + + + DieslCount number; + + LoadingDate date; + + CURRENT_BALANCE float; + + DIESEL_LITER_PRICE float; + + FIRST_ADVANCE_PAYMENT float; + +begin + + + + select LOADING_DATE,CURRENT_BALANCE + + into LoadingDate,CURRENT_BALANCE + + from refinery_trips_view where id = RefineryId; + + + + SELECT ( select DIESEL_CHARGE from REFINERY_TRIPS where ID = RefineryId) + + into DieslCount FROM DUAL; + + + + select key_value into FIRST_ADVANCE_PAYMENT + + from refinery_variables + + where KEY_NAME = 'FIRST_ADVANCE_PAYMENT' + + and sysdate between start_date and end_date +1 ; + + + + if DieslCount = 0 then -- No First Payment + + return FIRST_ADVANCE_PAYMENT+CURRENT_BALANCE; + + else if DieslCount = 1 then -- No Second Payment + + + + -- Get Liter current price + + select key_value into DIESEL_LITER_PRICE + + from refinery_variables + + where KEY_NAME = 'DIESEL_LITER_PRICE' + + and LoadingDate between start_date and end_date; + + + + return (DIESEL_LITER_PRICE * 350)+CURRENT_BALANCE-FIRST_ADVANCE_PAYMENT; + + else + + return CURRENT_BALANCE; + + end if; + + end if; + + + +end CalculateRefinaryDiesel; + + +--- CALCULATEREFINARYAMOUNT +FUNCTION "CALCULATEREFINARYAMOUNT" (RefineryId in numeric) + + return float as + + FIRST_ADVANCE_PAYMENT float; + + DIESEL_LITER_PRICE float; + + TON_WAGE float; + + TON_PRICE float; + + DRIVER_TIP float; + + PERMIT_DISPATCH float; + + WAYBILL_FEE float; + + COMMISSION float; + + TOLERANCE_PERCENTAGE float; + + NetLoadingWeight int; + + NetDischargeWeight int; + + CalculatedAmount float; + + WaterAmount int; + + FineQuantity float; + + AllowQuantity float; + + LoadingDate Date; + + truckNumber int; + + REMAINING_BALANCE float; + +begin + + select tn,net_loading_weight, + + net_discharge_weight, + + water_amount, + + actual_loading_date + + into truckNumber,NetLoadingWeight, NetDischargeWeight, WaterAmount, LoadingDate + + from refinery_trips + + where id = RefineryId; + + select key_value + + into FIRST_ADVANCE_PAYMENT + + from refinery_variables + + where KEY_NAME = 'FIRST_ADVANCE_PAYMENT' + + and LoadingDate between start_date and end_date; + + select key_value + + into DIESEL_LITER_PRICE + + from refinery_variables + + where KEY_NAME = 'DIESEL_LITER_PRICE' + + and LoadingDate between start_date and end_date; + + select key_value + + into TON_WAGE + + from refinery_variables + + where KEY_NAME = 'TON_WAGE' + + and LoadingDate between start_date and end_date; + + select key_value + + into TON_PRICE + + from refinery_variables + + where KEY_NAME = 'TON_PRICE' + + and LoadingDate between start_date and end_date; + + select key_value + + into DRIVER_TIP + + from refinery_variables + + where KEY_NAME = 'DRIVER_TIP' + + and LoadingDate between start_date and end_date; + + select key_value + + into PERMIT_DISPATCH + + from refinery_variables + + where KEY_NAME = 'PERMIT_DISPATCH' + + and LoadingDate between start_date and end_date; + + select key_value + + into WAYBILL_FEE + + from refinery_variables + + where KEY_NAME = 'WAYBILL_FEE' + + and LoadingDate between start_date and end_date; + + select key_value + + into COMMISSION + + from refinery_variables + + where KEY_NAME = 'COMMISSION' + + and LoadingDate between start_date and end_date; + + select key_value + + into TOLERANCE_PERCENTAGE + + from refinery_variables + + where KEY_NAME = 'TOLERANCE_PERCENTAGE' + + and LoadingDate between start_date and end_date; + + + + AllowQuantity := FLOOR(NetLoadingWeight * TOLERANCE_PERCENTAGE); + + + + FineQuantity := (NetLoadingWeight - NetDischargeWeight - WaterAmount); + + + + IF FineQuantity <= AllowQuantity THEN + + FineQuantity := 0; + + else + + FineQuantity := FineQuantity - AllowQuantity; + + end if; + + + + FineQuantity := (FineQuantity / 1000) * TON_PRICE; + + + + IF WaterAmount >= (NetLoadingWeight - NetDischargeWeight) THEN + + CalculatedAmount := (NetLoadingWeight) / 1000; + + ELSE + + CalculatedAmount := (NetDischargeWeight + WaterAmount) / 1000; + + end if; + + + + CalculatedAmount := (CalculatedAmount * TON_WAGE) - FineQuantity - + + DRIVER_TIP - PERMIT_DISPATCH - WAYBILL_FEE - + + (DIESEL_LITER_PRICE * 350) - COMMISSION; + + + + --- calcualte amount after remaining balance + + select remaining_balance + + into REMAINING_BALANCE + + from REFINERY_REMAINING_BALANCE + + where tn = truckNumber ; + + CalculatedAmount := CalculatedAmount +REMAINING_BALANCE; + + + + + + return ROUND(CalculatedAmount, 3); + + + +end CalculateRefinaryAmount; + + +--- CALCULATEREFINARYAMOUNT6 +FUNCTION "CALCULATEREFINARYAMOUNT6" (RefineryId in numeric) + + return float as + + FIRST_ADVANCE_PAYMENT float; + + DIESEL_LITER_PRICE float; + + TON_WAGE float; + + TON_PRICE float; + + DRIVER_TIP float; + + PERMIT_DISPATCH float; + + WAYBILL_FEE float; + + COMMISSION float; + + TOLERANCE_PERCENTAGE float; + + NetLoadingWeight int; + + NetDischargeWeight int; + + CalculatedAmount float; + + WaterAmount int; + + FineQuantity float; + + AllowQuantity float; + + LoadingDate Date; + + truckNumber int; + + REMAINING_BALANCE float; + +begin + + select tn,net_loading_weight, + + net_discharge_weight, + + water_amount, + + actual_loading_date + + into truckNumber,NetLoadingWeight, NetDischargeWeight, WaterAmount, LoadingDate + + from refinery_trips + + where id = RefineryId; + + select key_value + + into FIRST_ADVANCE_PAYMENT + + from refinery_variables + + where KEY_NAME = 'FIRST_ADVANCE_PAYMENT' + + and LoadingDate between start_date and end_date; + + select key_value + + into DIESEL_LITER_PRICE + + from refinery_variables + + where KEY_NAME = 'DIESEL_LITER_PRICE' + + and LoadingDate between start_date and end_date; + + select key_value + + into TON_WAGE + + from refinery_variables + + where KEY_NAME = 'TON_WAGE' + + and LoadingDate between start_date and end_date; + + select key_value + + into TON_PRICE + + from refinery_variables + + where KEY_NAME = 'TON_PRICE' + + and LoadingDate between start_date and end_date; + + select key_value + + into DRIVER_TIP + + from refinery_variables + + where KEY_NAME = 'DRIVER_TIP' + + and LoadingDate between start_date and end_date; + + select key_value + + into PERMIT_DISPATCH + + from refinery_variables + + where KEY_NAME = 'PERMIT_DISPATCH' + + and LoadingDate between start_date and end_date; + + select key_value + + into WAYBILL_FEE + + from refinery_variables + + where KEY_NAME = 'WAYBILL_FEE' + + and LoadingDate between start_date and end_date; + + select key_value + + into COMMISSION + + from refinery_variables + + where KEY_NAME = 'COMMISSION' + + and LoadingDate between start_date and end_date; + + select key_value + + into TOLERANCE_PERCENTAGE + + from refinery_variables + + where KEY_NAME = 'TOLERANCE_PERCENTAGE' + + and LoadingDate between start_date and end_date; + + + + AllowQuantity := FLOOR(NetLoadingWeight * TOLERANCE_PERCENTAGE); + + + + FineQuantity := (NetLoadingWeight - NetDischargeWeight - WaterAmount); + + + + IF FineQuantity <= AllowQuantity THEN + + FineQuantity := 0; + + else + + FineQuantity := FineQuantity - AllowQuantity; + + end if; + + + + FineQuantity := (FineQuantity / 1000) * TON_PRICE; + + + + IF WaterAmount >= (NetLoadingWeight - NetDischargeWeight) THEN + + CalculatedAmount := (NetLoadingWeight) / 1000; + + ELSE + + CalculatedAmount := (NetDischargeWeight + WaterAmount) / 1000; + + end if; + + + + CalculatedAmount := (CalculatedAmount * TON_WAGE) - FineQuantity - + + DRIVER_TIP - PERMIT_DISPATCH - WAYBILL_FEE - + + (DIESEL_LITER_PRICE * 350) - COMMISSION; + + + + --- calcualte amount after remaining balance + + select remaining_balance + + into REMAINING_BALANCE + + from REFINERY_REMAINING_BALANCE + + where tn = truckNumber ; + + CalculatedAmount := CalculatedAmount +REMAINING_BALANCE; + + + + + + return ROUND(CalculatedAmount, 3); + + + +end CalculateRefinaryAmount6; + + +--- CALCULATEREFINARYAMOUNTREPORT +FUNCTION "CALCULATEREFINARYAMOUNTREPORT" (RefineryId in numeric,calType in numeric) + + return float as + + FIRST_ADVANCE_PAYMENT float; + + DIESEL_LITER_PRICE float; + + TON_WAGE float; + + TON_PRICE float; + + DRIVER_TIP float; + + PERMIT_DISPATCH float; + + WAYBILL_FEE float; + + COMMISSION float; + + TOLERANCE_PERCENTAGE float; + + NetLoadingWeight int; + + NetDischargeWeight int; + + CalculatedAmount float; + + WaterAmount int; + + FineQuantity float; + + AllowQuantity float; + + LoadingDate Date; + +begin + + + + select net_loading_weight, + + net_discharge_weight, + + water_amount, + + actual_loading_date + + into NetLoadingWeight, NetDischargeWeight, WaterAmount, LoadingDate + + from refinery_trips + + where id = RefineryId; + + select key_value + + into FIRST_ADVANCE_PAYMENT + + from refinery_variables + + where KEY_NAME = 'FIRST_ADVANCE_PAYMENT' + + and LoadingDate between start_date and end_date; + + select key_value + + into DIESEL_LITER_PRICE + + from refinery_variables + + where KEY_NAME = 'DIESEL_LITER_PRICE' + + and LoadingDate between start_date and end_date; + + select key_value + + into TON_WAGE + + from refinery_variables + + where KEY_NAME = 'TON_WAGE' + + and LoadingDate between start_date and end_date; + + select key_value + + into TON_PRICE + + from refinery_variables + + where KEY_NAME = 'TON_PRICE' + + and LoadingDate between start_date and end_date; + + select key_value + + into DRIVER_TIP + + from refinery_variables + + where KEY_NAME = 'DRIVER_TIP' + + and LoadingDate between start_date and end_date; + + select key_value + + into PERMIT_DISPATCH + + from refinery_variables + + where KEY_NAME = 'PERMIT_DISPATCH' + + and LoadingDate between start_date and end_date; + + select key_value + + into WAYBILL_FEE + + from refinery_variables + + where KEY_NAME = 'WAYBILL_FEE' + + and LoadingDate between start_date and end_date; + + select key_value + + into COMMISSION + + from refinery_variables + + where KEY_NAME = 'COMMISSION' + + and LoadingDate between start_date and end_date; + + select key_value + + into TOLERANCE_PERCENTAGE + + from refinery_variables + + where KEY_NAME = 'TOLERANCE_PERCENTAGE' + + and LoadingDate between start_date and end_date; + + + + AllowQuantity := FLOOR(NetLoadingWeight * TOLERANCE_PERCENTAGE); + + + + FineQuantity := (NetLoadingWeight - NetDischargeWeight - WaterAmount); + + + + IF FineQuantity <= AllowQuantity THEN + + FineQuantity := 0; + + else + + FineQuantity := FineQuantity - AllowQuantity; + + end if; + + + + FineQuantity := (FineQuantity / 1000) * TON_PRICE; + + + + IF WaterAmount >= (NetLoadingWeight - NetDischargeWeight) THEN + + CalculatedAmount := (NetLoadingWeight) / 1000; + + ELSE + + CalculatedAmount := (NetDischargeWeight + WaterAmount) / 1000; + + end if; + + + + if calType = 0 then + + CalculatedAmount := (CalculatedAmount * TON_WAGE) - FineQuantity - + + DRIVER_TIP - PERMIT_DISPATCH - WAYBILL_FEE - + + (DIESEL_LITER_PRICE * 350) - COMMISSION; + + + + return ROUND(CalculatedAmount, 4); + + + + else + + + + return ROUND(CalculatedAmount*TON_WAGE, 4); + + end if; + + + +end CalculateRefinaryAmountReport; + diff --git a/src/NTP.Api/Controllers/V1/Refinery/TripsController.cs b/src/NTP.Api/Controllers/V1/Refinery/TripsController.cs index fe5e8de..55e4ea5 100644 --- a/src/NTP.Api/Controllers/V1/Refinery/TripsController.cs +++ b/src/NTP.Api/Controllers/V1/Refinery/TripsController.cs @@ -138,6 +138,22 @@ public sealed class TripsController( return File(f.Content, f.ContentType, f.FileName); } + [HttpGet("reports/operator")] + [RequirePermission(PermissionKeys.RefineryTripsOperatorReport)] + public async Task OperatorReport([FromQuery] TripQuery query, CancellationToken ct) + { + var f = await reports.OperatorAsync(query, ct); + return File(f.Content, f.ContentType, f.FileName); + } + + [HttpGet("reports/exchange")] + [RequirePermission(PermissionKeys.RefineryTripsExchangeReport)] + public async Task ExchangeReport([FromQuery] TripQuery query, CancellationToken ct) + { + var f = await reports.ExchangeAsync(query, ct); + return File(f.Content, f.ContentType, f.FileName); + } + [HttpGet("reports/diesel")] [RequirePermission(PermissionKeys.RefineryTripsDieselReport)] public async Task DieselReport([FromQuery] DieselReportQuery query, CancellationToken ct) diff --git a/src/NTP.Api/appsettings.json b/src/NTP.Api/appsettings.json index 8dfc456..ef02e52 100644 --- a/src/NTP.Api/appsettings.json +++ b/src/NTP.Api/appsettings.json @@ -61,5 +61,17 @@ "ConnectionTimeoutSeconds": 15, "StatementCacheSize": 50, "CommandTimeoutSeconds": 30 + }, + + // Refinery (المصفاة). Dinarak is the e-wallet payment API used by the trip action "صرف" (legacy RefinaryDinarakApi.cfc). + // Off here: while Enabled is false nothing is called (the action answers that the service is disabled). UserName / Password are SECRETS: + // env vars Refinery__Dinarak__UserName / Refinery__Dinarak__Password (server .env); BaseUrl is set per environment + // (Refinery__Dinarak__BaseUrl). MaxPaymentAmount is the largest net wage a payment action accepts (UNVERIFIED legacy value, caption says 500). + "Refinery": { + "Dinarak": { "Enabled": false, "BaseUrl": "", "TimeoutSeconds": 30 }, + // Jopetrol claim web service used by the wage claim "ترحيل" action: OFF, nothing is called while Enabled is false. + // UserName / Password are secrets: env vars Refinery__Jopetrol__UserName / Refinery__Jopetrol__Password (server .env), never in a file. + "Jopetrol": { "Enabled": false, "Url": "http://fueltrans.jopetrol.com.jo:6060/TransportPmt/TransportPaymentWS.asmx", "TimeoutSeconds": 30 }, + "Trips": { "MaxPaymentAmount": 500 } } } diff --git a/src/NTP.Application/Access/PermissionKeys.Refinery.Trips.cs b/src/NTP.Application/Access/PermissionKeys.Refinery.Trips.cs index bacf7d4..8a0307c 100644 --- a/src/NTP.Application/Access/PermissionKeys.Refinery.Trips.cs +++ b/src/NTP.Application/Access/PermissionKeys.Refinery.Trips.cs @@ -20,6 +20,8 @@ public static partial class PermissionKeys public const string RefineryTripsConfirmExchange = "refinery.trips.confirmExchange"; // CONFIRM_EXCHANGE public const string RefineryTripsPrint = "refinery.trips.print"; // print (cash voucher) public const string RefineryTripsReport = "refinery.trips.report"; // report (trips excel) + public const string RefineryTripsOperatorReport = "refinery.trips.operatorReport"; // report(), REFINERY_OP column set + public const string RefineryTripsExchangeReport = "refinery.trips.exchangeReport"; // report(), EXCHANGE_OP column set public const string RefineryTripsDieselReport = "refinery.trips.dieselReport"; // REFINERY_DIESEL_REPORT_VIEW report public const string RefineryTripsCardsReport = "refinery.trips.cardsReport"; // refineryCardsReport public const string RefineryTripsBankReport = "refinery.trips.bankReport"; // refineryBankReport diff --git a/src/NTP.Application/Refinery/Trips/TripReportService.cs b/src/NTP.Application/Refinery/Trips/TripReportService.cs index bb029ea..6cdcbb1 100644 --- a/src/NTP.Application/Refinery/Trips/TripReportService.cs +++ b/src/NTP.Application/Refinery/Trips/TripReportService.cs @@ -6,6 +6,8 @@ namespace NTP.Application.Refinery.Trips; public interface ITripReportService { Task TripsAsync(TripQuery query, CancellationToken ct); + Task OperatorAsync(TripQuery query, CancellationToken ct); + Task ExchangeAsync(TripQuery query, CancellationToken ct); Task DieselAsync(DieselReportQuery query, CancellationToken ct); Task CardsAsync(string? tn, CancellationToken ct); Task BankAsync(BankReportQuery query, CancellationToken ct); @@ -68,6 +70,36 @@ public sealed class TripReportService(ITripRepository trips) : ITripReportServic return Xlsx("refinery-trips", new ExportTable(["شاشة الارساليات"], headers, data)); } + /// factoryweb.report, REFINERY_OP column set (lines 825-870): form no., truck, net wage, paid / received dates and receiver. + /// The legacy limit to the trips the user received himself is a role rule and is not ported. + public async Task OperatorAsync(TripQuery query, CancellationToken ct) + { + TripQueryService.ValidateRanges(query); + var rows = await trips.ReportAsync(query, ct); + var data = rows.Select((r, i) => (IReadOnlyList) + [i + 1, r.DischargeAuthNo, r.Tn, r.NetWage, Day(r.PaymentedDate), Day(r.ReceivedDate), r.ReceivedByName]).ToList(); + string[] headers = ["متسلسل", "رقم النموذج", "رقم القاطرة", "صافي قيمة الصرف الفعلي", "تاريخ الدفع", "تاريخ الاستلام", "اسم المستلم"]; + return Xlsx("refinery-trips-operator", new ExportTable(["شاشة الارساليات"], headers, data)); + } + + /// factoryweb.report, EXCHANGE_OP column set (lines 870-940): the trip, weights, truck, trailer, driver id, net wage and status. + public async Task ExchangeAsync(TripQuery query, CancellationToken ct) + { + TripQueryService.ValidateRanges(query); + var rows = await trips.ReportAsync(query, ct); + var data = rows.Select((r, i) => (IReadOnlyList) + [ + i + 1, r.Pn, r.DispatchDate, r.LoadingNo, r.DischargeAuthNo, r.DischargeEntryDate, r.NetLoadingWeight, r.NetDischargeWeight, + r.Tn, r.Trn, r.Nnpn, r.NetWage, TripStatus.Captions.GetValueOrDefault(r.StatusCode ?? string.Empty, r.StatusCode ?? string.Empty) + ]).ToList(); + string[] headers = + [ + "متسلسل", "رقم الارسالية", "تاريخ الارسالية", "رقم الحمولة", "رقم النموذج", "تاريخ النموذج", "الوزن الصافي(كغ)", + "الوزن الصافي للتفريغ(كغ)", "رقم القاطرة", "رقم المقطورة", "الرقم الوطني", "صافي قيمة الصرف الفعلي", "الحالة" + ]; + return Xlsx("refinery-trips-exchange", new ExportTable(["شاشة الارساليات"], headers, data)); + } + public async Task DieselAsync(DieselReportQuery query, CancellationToken ct) { if (query.DateFrom > query.DateTo) throw TripErrors.FromAfterTo(); diff --git a/src/NTP.Application/Refinery/Variables/TonPriceRecalculationService.cs b/src/NTP.Application/Refinery/Variables/TonPriceRecalculationService.cs index 48a84d3..6504293 100644 --- a/src/NTP.Application/Refinery/Variables/TonPriceRecalculationService.cs +++ b/src/NTP.Application/Refinery/Variables/TonPriceRecalculationService.cs @@ -1,29 +1,16 @@ -using NTP.Application.Common; +using NTP.Application.Refinery.RemainingBalance; namespace NTP.Application.Refinery.Variables; /// -/// Port of the checks of refinerytripFactory.calculateRemainigBalance (refinerytripfactory.cfc:1269-1300) that run when the actual ton price -/// is set: there must be trips in the period (ERROR.THERE_IS_NO_ANY_TRIP_IN_THIS_PERIOD) and all of them must be exchanged -/// (ERROR.NO_TON_PRICE_EDIT_NOT_ALL_TRIPS_EXCHANGED). -/// -/// NOT ported here: for every trip with PENALTY_AMOUNT > 0 legacy calls calculateAmounts(trip, 'TON_PRICE_CORRECTION') and, when the net wage -/// changes, writes the difference into REFINERY_REMAINING_BALANCE (+ its log) per truck. That calculation is the trips module's -/// (calculateAmounts). Until it is wired in here, a period that HAS such trips is refused with a clear message instead of being -/// priced without recalculating the balances; a period without penalty trips (nothing to recalculate) works as legacy. -/// Replace the throw below with the trips module's recalculation to finish the port. -/// +/// Recalculation after the actual ton price (TON_PRICE_CORRECTION) is set: legacy UPDATE_TON_PRICE_CORRECTION calls +/// refinerytripFactory.calculateRemainigBalance (refinerytripfactory.cfc:1269). That port lives in the trips module +/// (: trips must exist and be exchanged, the net wage difference of every +/// penalised trip goes to the truck's remaining balance). It joins the caller's transaction (DbSession nesting), so a failure rolls back the +/// correction rows too (legacy reset them to 0 instead). /// -public sealed class TonPriceRecalculationService(IVariablesRepository repository) : ITonPriceRecalculationService +public sealed class TonPriceRecalculationService(IRemainingBalanceService balances) : ITonPriceRecalculationService { - public async Task RecalculateAsync(long groupId, DateTime start, DateTime end, CancellationToken ct = default) - { - var info = await repository.GetTripsOfPeriodAsync(start, end, ct); - if (info.TripCount == 0) - throw new BusinessException(VariablesErrors.NoTripsInPeriod, VariablesMessages.NoTripsInPeriod); - if (info.NotExchangedCount > 0) - throw new BusinessException(VariablesErrors.NotAllTripsExchanged, VariablesMessages.NotAllTripsExchanged); - if (info.PenaltyTripCount > 0) - throw new BusinessException(VariablesErrors.RecalculationNotAvailable, VariablesMessages.RecalculationNotAvailable); - } + public async Task RecalculateAsync(long groupId, DateTime start, DateTime end, CancellationToken ct = default) => + await balances.RecalculateForPeriodAsync(start, end, groupId, ct); } diff --git a/src/NTP.Infrastructure/DependencyInjection.cs b/src/NTP.Infrastructure/DependencyInjection.cs index 0c77c3c..15c628e 100644 --- a/src/NTP.Infrastructure/DependencyInjection.cs +++ b/src/NTP.Infrastructure/DependencyInjection.cs @@ -59,10 +59,25 @@ public static class DependencyInjection // mobile notifications run in the background in their own scope (see MobileNotificationGatewayService) services.AddScoped(); + // Refinery: Jopetrol claim web service (OFF unless Refinery:Jopetrol:Enabled; credentials only from env / .env) + services.AddOptions() + .Bind(configuration.GetSection(NTP.Infrastructure.Integrations.JopetrolOptions.SectionName)); + services.AddHttpClient(NTP.Infrastructure.Integrations.JopetrolOptions.HttpClientName); + services.AddScoped(); + // Convention: every concrete *Repository / *Service in this assembly is registered against I{Name} (scoped). // Do NOT add per-table lines here. services.AddConventionalServices(typeof(DependencyInjection).Assembly); + // Refinery: Dinarak payment API (no "Service" suffix, so not convention registered). Off unless Refinery:Dinarak:Enabled. + services.AddOptions() + .Bind(configuration.GetSection(NTP.Infrastructure.Integrations.DinarakOptions.SectionName)); + services.AddHttpClient(NTP.Infrastructure.Integrations.DinarakOptions.HttpClientName, (sp, client) => + client.Timeout = TimeSpan.FromSeconds(Math.Max(5, sp.GetRequiredService>().Value.TimeoutSeconds))); + services.AddScoped(); + services.AddScoped(sp => sp.GetRequiredService()); + services.AddScoped(sp => sp.GetRequiredService()); + services.AddHealthChecks() .AddCheck("oracle", tags: ["ready"]) .AddCheck("oracle-ntp", tags: ["ready"]); diff --git a/web/src/features/refinery/cards/meta.ts b/web/src/features/refinery/cards/meta.ts index 868b23c..b47c196 100644 --- a/web/src/features/refinery/cards/meta.ts +++ b/web/src/features/refinery/cards/meta.ts @@ -18,6 +18,7 @@ export function cardsGrid(h: { onOpen: (r: CardRow) => void }): GridMeta m.routes); + +export const menu: MenuItem[] = [ + { + key: 'refinery', + title: { en: 'Crude oil tender forms', ar: 'عطاء صرف نماذج النفط الخام' }, + icon: OilBarrelIcon, + children: modules.flatMap((m) => m.menuItems), + }, +]; diff --git a/web/src/features/refinery/trips/meta.tsx b/web/src/features/refinery/trips/meta.tsx index 023f838..90586e2 100644 --- a/web/src/features/refinery/trips/meta.tsx +++ b/web/src/features/refinery/trips/meta.tsx @@ -93,7 +93,7 @@ export function tripsGrid(onOpen: (r: TripGridRow) => void): GridMeta Object.fromEntries([...new URLSearchParams(window.location.search)].filter(([k]) => !['page', 'size', 'f'].includes(k))); const reports: { key: string; label: string; show: boolean; go: () => void }[] = [ { key: 'trips', label: t('trips.report.trips'), show: can('refinery.trips.report'), go: () => void run('trips', current(), 'refinery-trips.xlsx') }, + { key: 'operator', label: t('trips.report.operator'), show: can('refinery.trips.operatorReport'), go: () => void run('operator', current(), 'refinery-trips-operator.xlsx') }, + { key: 'exchange', label: t('trips.report.exchange'), show: can('refinery.trips.exchangeReport'), go: () => void run('exchange', current(), 'refinery-trips-exchange.xlsx') }, { key: 'diesel', label: t('trips.report.diesel'), show: can('refinery.trips.dieselReport'), go: () => void run('diesel', current(), 'refinery-diesel.xlsx') }, { key: 'cards', label: t('trips.report.cards'), show: can('refinery.trips.cardsReport'), go: () => void run('cards', { tn: current().tn ?? '' }, 'refinery-cards.xlsx') }, { @@ -83,10 +92,10 @@ function Num({ v }: { v: number | null | undefined }) { return v === null || v === undefined ? null : {formatNumber(v, lang)}; } -function Section({ title, children }: { title: string; children: ReactNode }) { +function Section({ title, icon, children }: { title: string; icon: ElementType; children: ReactNode }) { return ( - {title} + {children} ); @@ -141,7 +150,7 @@ function TripView({ trip }: { trip: TripDetail }) { actions={buttons} /> -
+
{trip.pn} {trip.dispatchDate} {trip.tn} @@ -168,7 +177,7 @@ function TripView({ trip }: { trip: TripDetail }) {
{loaded && ( -
+
{trip.loadingNo} {trip.actualLoadingDate} @@ -178,7 +187,7 @@ function TripView({ trip }: { trip: TripDetail }) { )} {dischargeSection && ( -
+
{trip.dischargeAuthNo} {trip.dischargeEntryDate} @@ -192,7 +201,7 @@ function TripView({ trip }: { trip: TripDetail }) { )} {loaded && ( -
+
{w?.epayment === 1 && ( <> {w.walletNumber} @@ -219,7 +228,7 @@ function TripView({ trip }: { trip: TripDetail }) { )} {dischargeSection && ( -
+
{w?.driverWalletNumber ? {w.driverWalletNumber} : {t('trips.driverNoWallet')}} @@ -241,7 +250,11 @@ function TripLog({ tripId }: { tripId: number }) { const q = useTripLog(tripId, page, open); return ( - + setOpen((o) => !o)} + onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); setOpen((o) => !o); } }} + sx={{ cursor: 'pointer', '& h2': { mb: open ? 1.5 : 0 } }}> + + {open && ( <> {q.isLoading && } @@ -325,9 +338,15 @@ function VoucherDialog({ voucher, onClose }: { voucher: TripVoucher | null; onCl const { t } = useFeatureUi(strings); return ( + {/* print only the voucher, not the page behind the dialog */} + {voucher && ( + {/* the printed voucher always carries the Arabic logo (white background, fixed size) */} + + نافذ + {t('trips.voucher.title')} {t('trips.voucher.date')} : {voucher.date} diff --git a/web/src/features/refinery/trips/strings.ts b/web/src/features/refinery/trips/strings.ts index 19b190d..d2aa890 100644 --- a/web/src/features/refinery/trips/strings.ts +++ b/web/src/features/refinery/trips/strings.ts @@ -2,7 +2,7 @@ import { defineStrings } from '@/i18n/useUi'; /** Strings of the refinery trips screen. Arabic texts are the legacy captions (ntp.lt_caption REFINERYTRIP*, PUBLIC.*) verbatim. */ export default defineStrings({ - 'trips.menu': { en: 'Trips', ar: 'شاشة الارساليات' }, + 'trips.menu': { en: 'Trips', ar: 'الارساليات' }, 'trips.title': { en: 'Refinery trips', ar: 'شاشة الارساليات' }, 'trips.crumb': { en: 'Trip details', ar: 'معلومات الارسالية' }, @@ -45,6 +45,8 @@ export default defineStrings({ // reports 'trips.reports': { en: 'Reports', ar: 'التقارير' }, 'trips.report.trips': { en: 'Trips (Excel)', ar: 'شاشة الارساليات (Excel)' }, + 'trips.report.operator': { en: 'Trips - operator (Excel)', ar: 'شاشة الارساليات - المشغل (Excel)' }, + 'trips.report.exchange': { en: 'Trips - exchange (Excel)', ar: 'شاشة الارساليات - الصرف (Excel)' }, 'trips.report.diesel': { en: 'Diesel charges (Excel)', ar: 'شحن الديزل (Excel)' }, 'trips.report.cards': { en: 'Diesel balances (Excel)', ar: 'أرصدة الديزل (Excel)' }, 'trips.report.bank': { en: 'Bank report (Excel)', ar: 'تقرير البنك (Excel)' }, @@ -117,7 +119,7 @@ export default defineStrings({ 'trips.log.none': { en: 'No movements', ar: 'لا يوجد معلومات' }, 'trips.voucher.title': { en: 'Cash voucher', ar: 'سند صرف نقدي' }, 'trips.voucher.date': { en: 'Date', ar: 'التاريخ' }, - 'trips.voucher.no': { en: 'No', ar: 'No' }, + 'trips.voucher.no': { en: 'No', ar: 'الرقم' }, 'trips.voucher.body1': { en: 'Received from Nafith Logistics the amount of', ar: 'وصلني من السادة شركة نافذ للخدمات اللوجستية مبلغ وقدره' }, 'trips.voucher.dinar': { en: 'dinars', ar: 'دينارا' }, 'trips.voucher.body2': { en: 'for crude oil transport wages of form number', ar: 'وذلك عن أجور نقل النفط الخام للنموذج رقم' }, diff --git a/web/src/features/refinery/variables/meta.ts b/web/src/features/refinery/variables/meta.ts index 0a2f687..d3c45a2 100644 --- a/web/src/features/refinery/variables/meta.ts +++ b/web/src/features/refinery/variables/meta.ts @@ -4,6 +4,14 @@ import { GRID_VARIABLES, type VariablesRow } from './api'; const s = strings; +const p2 = (n: number) => String(n).padStart(2, '0'); +const iso = (d: Date) => `${d.getFullYear()}-${p2(d.getMonth() + 1)}-${p2(d.getDate())}`; +/** First and last day of the current month as the grid's startDate / endDate filters. */ +const monthRange = () => { + const now = new Date(); + return { startDate: iso(new Date(now.getFullYear(), now.getMonth(), 1)), endDate: iso(new Date(now.getFullYear(), now.getMonth() + 1, 0)) }; +}; + /** Legacy REFINERY_VARIABLESGRID: period, then the prices; the filters are the two period dates. */ export function variablesGrid(h: { onOpen: (r: VariablesRow) => void }): GridMeta { return { @@ -13,6 +21,8 @@ export function variablesGrid(h: { onOpen: (r: VariablesRow) => void }): GridMet onRowClick: h.onOpen, pageSize: 16, emptyAsGrid: true, + // opens on the periods that start in the current month (first day .. last day) + defaultFilters: monthRange(), filters: [ { name: 'startDate', type: 'date', label: s['rv.filter.startDate'] }, { name: 'endDate', type: 'date', label: s['rv.filter.endDate'] }, diff --git a/web/src/features/refinery/wage-claims/strings.ts b/web/src/features/refinery/wage-claims/strings.ts index 8ba2818..c28b795 100644 --- a/web/src/features/refinery/wage-claims/strings.ts +++ b/web/src/features/refinery/wage-claims/strings.ts @@ -6,8 +6,8 @@ import { defineStrings } from '@/i18n/useUi'; */ export default defineStrings({ // ---- menu / titles - 'wc.menu': { en: 'Wage claims', ar: 'شاشة مطالبات صرف أجور النقل' }, // MENU.REFINERY_WAGE_CLAIM - 'wc.title': { en: 'Transport wage claims', ar: 'شاشة مطالبات صرف أجور النقل' }, + 'wc.menu': { en: 'Wage claims', ar: 'مطالبات صرف أجور النقل' }, // MENU.REFINERY_WAGE_CLAIM + 'wc.title': { en: 'Transport wage claims', ar: 'مطالبات صرف أجور النقل' }, 'wc.subtitle': { en: 'Claims that group the exchanged trips of the refinery tender', ar: 'مطالبات تجمع الارساليات المصروفة لعطاء المصفاة' }, 'wc.details': { en: 'Wage claim details', ar: 'معلومات مطالبة صرف اجور النقل' }, // REFINERY_WAGE_CLAIM_DETAILS 'wc.crumb.new': { en: 'New', ar: 'جديد' }, @@ -54,11 +54,11 @@ export default defineStrings({ // ---- create 'wc.create.title': { en: 'New wage claim', ar: 'إنشاء مطالبة صرف اجور النقل' }, // new - 'wc.create.subtitle': { en: 'Trips of the chosen statuses and policy dates that are not in a claim yet', ar: 'الارساليات بالحالات وتواريخ البوليصة المختارة التي لا تتبع مطالبة بعد' }, + 'wc.create.subtitle': { en: 'Trips of the chosen statuses and claim dates that are not in a claim yet', ar: 'الارساليات بالحالات وتواريخ المطالبة المختارة التي لا تتبع مطالبة بعد' }, 'wc.create.status': { en: 'Trip status', ar: 'الحالة' }, // PUBLIC.STATUS 'wc.create.all': { en: 'All', ar: 'الكل' }, - 'wc.create.from': { en: 'From (policy date)', ar: 'من (تاريخ البوليصة)' }, - 'wc.create.to': { en: 'To (policy date)', ar: 'الى (تاريخ البوليصة)' }, + 'wc.create.from': { en: 'From (claim date)', ar: 'من (تاريخ المطالبة)' }, + 'wc.create.to': { en: 'To (claim date)', ar: 'الى (تاريخ المطالبة)' }, 'wc.create.search': { en: 'Search', ar: 'بحث' }, 'wc.create.save': { en: 'Create claim', ar: 'إنشاء' }, // PUBLIC.CREATE 'wc.create.statusRequired': { en: 'Choose the status', ar: 'يجب اختيار الحالة' }, // ERROR.STATUS_REQUIRED diff --git a/web/src/features/refinery/wallets/meta.ts b/web/src/features/refinery/wallets/meta.ts index 75ad347..b3e4db4 100644 --- a/web/src/features/refinery/wallets/meta.ts +++ b/web/src/features/refinery/wallets/meta.ts @@ -34,6 +34,7 @@ export function walletsGrid(h: { onOpen: (r: WalletRow) => void }): GridMeta