QBCORE
Dependencies
Optional dependencies (if any ox_ resource is used)
Installation
Place the
ylean_loansfolder into your server'sresourcesdirectory.Import
sql.sqlinto your MySQL database.Add job settings from
job.txtinto...\qb-core\shared\jobs.lua
Config File
Configuration Requirements
nameMust exactly match the job name defined in your main configuration file.gradesEach key ('0','1','2', etc.) must correspond to a grade defined in that same configuration. Any addition, removal, or renumbering of grades here must be applied to the main job config as well.
Boss Menu Access
Any player who holds the “financial” job at a rank where the isBoss variable is set to true has access to the boss menu.
1. Fixed Rate Mode (constant = true)
constant = true)Behavior No matter what repayment term the player picks, the interest rate is always equal to
value.Configuration

2. Variable Rate Mode (constant = false)
constant = false)Behavior
For a 1-day loan, use the
minrate.For a loan at the maximum allowed deadline (defined by
maximumDeadline), use themaxrate.For any term in between, interpolate linearly between
minandmax.
Linear interpolation formula
Configuration

Translation Guide
This section explains how to add or edit translations for ylean_loans, covering both the NUI (front-end) and server (back-end) locales, as well as the main NUI HTML file.
1. NUI (Front-End) Translations
Directory:
ylean_loans/nui/locales/Contains pre-translated JSON files, e.g.en.json,pl.json, etc.Add or Edit a Language
Create or modify
your_lang.jsonin that folder.Open
ylean_loans/nui/index.js. Find the line:and add or change the code to your filename (without
.json):
2. Server (Back-End) Translations
Directory:
ylean_loans/locales/Contains Lua locale files, e.g.en.lua,pl.lua, etc.Add or Edit a Language
Create or modify
yourLang.luain that folder.
Open
config.lua. Find theYlean.Localestable and add your filename (without.lua):
3. Main NUI HTML
File:
ylean_loans/nui/index.htmlContains static text (headings, placeholders) that may need translation beyond what your JSON files cover.Edit for Your Language
Open
index.html.Translate any hard-coded strings
Restart script
With these steps, you can fully localize ylean_loans in both the UI and server logic. Remember to keep your filenames (without extensions) consistent when referencing them in index.js and config.lua.
Changing the Displayed Currency
To switch the currency symbol shown throughout ylean_loans, update three places: the back-end Lua locales, the NUI JSON locales, and the NUI script.
Back-End (Lua Locales)
Open the appropriate file in
ylean_loans/locales/(e.g.en.lua,pl.lua).Locate any entries containing the currency symbol (for example a key like
insufficientCreditScore = "Insufficient credit score for a $%d loan! Max allowed: $%d"or inline strings).Replace
"$"with your desired symbol (e.g."€").Save and restart the resource to apply changes.
Front-End NUI (JSON Locales)
Open the corresponding JSON file in
ylean_loans/nui/locales/(e.g.en.json,pl.json).Find any keys or values that include the currency symbol (for example
"validate_repayment_range": "Repayment Amount must be between $").Replace
"$"with your desired symbol.Save the file and reload the NUI to see the updated labels.
Front-End NUI Script
Open
ylean_loans/nui/index.js.Find the line:
Change it to your new symbol, for example:
Save the file and reload the script (e.g., via
ensure ylean_loans).
After completing these three steps, all monetary values and labels in both the UI and server logic will use your new currency symbol.
Changing the Date Format
To adjust how dates are displayed in the NUI:
Open
ylean_loans/nui/index.js.Locate the line:
Replace
"en-US"with any valid ECMAScript Intl locale string—for example:Save the file and reload the script (e.g., via
ensure ylean_loans).
The UI will now format all dates according to your chosen locale.
Upcoming Repayment Notification Mechanism
The reminder system alerts borrowers as their payment deadline approaches:
Activation: Controlled by
notifyAboutUpcomingRepayment.activein each loan’s configuration namespace (IndividualLoanRepaymentorBusinessLoanRepayment).Threshold: Defined by
notifyAboutUpcomingRepayment.hours—reminders start when the time until the deadline is less than or equal to this value.Frequency: Once the threshold is reached, borrowers receive a notification every hour until they either repay the loan or the deadline passes and the deduction or interest-accrual procedure is triggered.
To configure:
Enable or disable reminders with the
activeflag.Set the
hoursvalue to determine how far in advance hourly reminders begin.
Immediate Deduction Mode
In this mode, once the repayment deadline passes, the system automatically deducts the full outstanding balance from the borrower’s bank account. This applies to both individual and business loans, subject to the following configuration:
Enable/Disable: Controlled by the
immediateDeductionflag in each loan’s settings.Credit Score Penalty (individual loans only): If enabled, a fixed number of credit score points (
creditScoreLostInCaseOfDelay) is deducted when the funds are collected.Notification: Upon deduction, a log entry and optional webhook notification (e.g., Discord) inform administrators and the borrower of the action.
All related configuration options are defined within the Ylean.IndividualLoanRepayment and Ylean.BusinessLoanRepayment namespaces.
Configuration Steps:
Set
immediateDeduction = trueto activate this mode.(Individual loans) Define
creditScoreLostInCaseOfDelayto apply penalties for delayed repayment.
Interest Accrual Mode
This mode gradually increases the loan amount by a daily interest rate, providing a grace period before enforcing a full deduction:
Interest Accrual: The outstanding principal is multiplied by
(1 + interestRate)once per day, compounding until collection.Grace Period: A configurable number of days (
daysBeforeDeduction) gives borrowers time to repay without immediate loss of funds.Final Collection: After the grace period, the total accumulated balance (principal plus accrued interest) is deducted in full. Individual loans may also incur a credit score penalty at this point.
All related configuration options are defined within the Ylean.IndividualLoanRepayment and Ylean.BusinessLoanRepayment namespaces.
Configuration Steps:
Set
immediateDeduction = falseto use interest accrual.Define
interestRate(daily rate) anddaysBeforeDeduction(grace period).(Individual loans) Optionally configure
creditScoreLostInCaseOfDelayfor score penalties upon final collection.
Comparison of Modes
Activation
immediateDeduction = true
immediateDeduction = false
Interest before deduction
None
Accrued daily until the threshold
Status change
Immediately upon delay
After daysBeforeDeduction days overdue
Funds deducted
Full principal
Accumulated principal + interest
Credit score impact
Individual loans only
Individual loans only
Discord Webhook Logging
Key loan events can be logged to Discord via webhooks, with each action configurable individually under the YleanDC.Logs namespace in discord_logs_cfg.lua file.
Global Settings (YleanDC):
ServerName(string): Name of the server displayed in the embed footer.DefaultEmbedColor(integer): Default color code used for embeds when an event-specific color is not provided.
Per-Event Configuration: Each event under YleanDC.Logs supports:
Enabled (boolean): Turn logging on or off.
WebhookURL (string): Discord webhook endpoint for that event.
BotName (string) and BotAvatar (string URL): Identity of the webhook bot.
Embed (object): Customization of the embed’s
Title,Color, andThumbnail.
Configured Events:
LoanIndividualNoApproval
Player applied for an individual loan that does not require approval
LoanIndividualApproval
Player applied for an individual loan that requires approval
PartialLoanRepayment
Player made a partial repayment on a loan
FullLoanRepayment
Player fully repaid a loan
SubmitBusinessLoan
Employee submitted a business loan
AcceptBusinessLoan
Player accepted a business loan
RejectBusinessLoan
Player rejected a business loan
OverdueLoanIndividual
Player failed to repay an individual loan on time
OverdueLoanBusiness
Player failed to repay a business loan on time
EmployeeLoanIndividual
Employee granted an individual loan
EmployeeRejectLoanIndividual
Employee rejected an individual loan
EmployeeClockOut
Employee clocked out (ended duty)
EmployeeClockIn
Employee clocked in (started duty)
BossFireEmployee
Boss fired an employee
BossChangeJobGrade
Boss changed an employee's job grade
BossHireEmployee
Boss hired a new employee
CompanyBankDeposit
Deposit made into the company bank account
CompanyBankWithdrawal
Withdrawal made from the company bank account
Last updated