Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Apr 10, 2024
2 parents 35276f9 + 35413dc commit 37a0c33
Show file tree
Hide file tree
Showing 43 changed files with 2,867 additions and 1,984 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
draft: false
prerelease: false
title: "Latest Release"
automatic_release_tag: "v5.0.156"
automatic_release_tag: "v5.0.157"
files: |
${{ github.workspace }}/artifacts/Invoice-Ninja-Archive
${{ github.workspace }}/artifacts/Invoice-Ninja-Hash
Expand Down
4 changes: 2 additions & 2 deletions flatpak/com.invoiceninja.InvoiceNinja.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Comment=Create invoices, accept payments, track expenses & time tasks
Categories=Office;

Icon=com.invoiceninja.InvoiceNinja
Exec=invoiceninja_client
Exec=invoiceninja
Terminal=false
StartupWMClass=invoiceninja_client
StartupWMClass=invoiceninja
9 changes: 5 additions & 4 deletions flatpak/com.invoiceninja.InvoiceNinja.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@
<p>Create. Send. Get Paid.</p>
<p>Invoice Ninja is a leading platform for SMB’s to invoice, accept payments, track expenses &amp; time billable-tasks. Designed for freelancers and small to medium size businesses, Invoice Ninja is a suite of apps to help you get paid.</p>
<p>
• Incredibly easy to use<br/>
• Incredibly easy to use:
Invoice Ninja was built to serve freelancers and business owners with a complete suite of invoicing &amp; payment tools to advance your business.
</p>
<p>
• Invoicing &amp; Payments<br/>
• Invoicing &amp; Payments:
Every feature is geared towards accurate and secure invoicing and getting you paid. With Invoice Ninja you can send beautiful branded invoices with minimum of effort and maximum professionalism.
</p>
<p>
• Time Tracker &amp; Projects<br/>
• Time Tracker &amp; Projects:
Create projects and individual tasks per project. When done, simply “Send task to invoice” and all details will be sent ready for your clients to pay!
</p>
<p>
• Track Vendors &amp; Expenses<br/>
• Track Vendors &amp; Expenses:
With Invoice Ninja, all your earnings, expenses, clients and vendors are stored and managed in one system. Categorize your vendors &amp; re-invoice expenses to clients, or simply run expense reports.
</p>
<p>
Expand All @@ -50,6 +50,7 @@
</screenshots>
<content_rating type="oars-1.1"/>
<releases>
<release version="5.0.157" date="2024-04-10"/>
<release version="5.0.156" date="2024-02-21"/>
<release version="5.0.155" date="2024-02-07"/>
<release version="5.0.154" date="2024-02-04"/>
Expand Down
14 changes: 13 additions & 1 deletion lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Constants {
}

// TODO remove version once #46609 is fixed
const String kClientVersion = '5.0.156';
const String kClientVersion = '5.0.157';
const String kMinServerVersion = '5.0.4';

const String kAppName = 'Invoice Ninja';
Expand Down Expand Up @@ -265,6 +265,7 @@ const String kEInvoiceTypeXInvoice_Basic = 'XInvoice-Basic';
const String kEInvoiceTypeFacturae_3_2 = 'Facturae_3.2';
const String kEInvoiceTypeFacturae_3_2_1 = 'Facturae_3.2.1';
const String kEInvoiceTypeFacturae_3_2_2 = 'Facturae_3.2.2';
const String kEInvoiceTypeFACT1 = 'FACT1';

const kEInvoiceTypes = [
kEInvoiceTypeEN16931,
Expand All @@ -280,6 +281,17 @@ const kEInvoiceTypes = [
kEInvoiceTypeFacturae_3_2_2,
kEInvoiceTypeFacturae_3_2_1,
kEInvoiceTypeFacturae_3_2,
kEInvoiceTypeFACT1,
];

const String kEQuoteTypeOrderX_Comfort = 'OrderX_Comfort';
const String kEQuoteTypeOrderX_Basic = 'OrderX_Basic';
const String kEQuoteType = 'OrderX_Extended';

const kEQuoteTypes = [
kEQuoteTypeOrderX_Comfort,
kEQuoteTypeOrderX_Basic,
kEQuoteType,
];

const String kCountryUnitedStates = '840';
Expand Down
7 changes: 6 additions & 1 deletion lib/data/models/account_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ abstract class AccountEntity
planExpires: '',
latestVersion: '',
currentVersion: '',
uploadExtensions: '',
reportErrors: reportErrors,
debugEnabled: false,
isDocker: false,
Expand Down Expand Up @@ -119,6 +120,9 @@ abstract class AccountEntity
@BuiltValueField(wireName: 'nordigen_enabled')
bool get nordigenEnabled;

@BuiltValueField(wireName: 'upload_extensions')
String get uploadExtensions;

bool get isUpdateAvailable {
if (disableAutoUpdate) {
return false;
Expand Down Expand Up @@ -157,7 +161,8 @@ abstract class AccountEntity
..setReactAsDefaultAP = false
..paymentId = ''
..taxApiEnabled = false
..nordigenEnabled = false;
..nordigenEnabled = false
..uploadExtensions = '';

static Serializer<AccountEntity> get serializer => _$accountEntitySerializer;
}
30 changes: 26 additions & 4 deletions lib/data/models/account_model.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion lib/data/models/client_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ abstract class ClientEntity extends Object
return _$ClientEntity._(
id: id ?? BaseEntity.nextId,
isChanged: false,
settings: SettingsEntity(),
settings: SettingsEntity().rebuild((b) => b
..languageId = state?.company.languageId ?? ''
..currencyId = state?.company.currencyId ?? ''),
name: '',
displayName: '',
balance: 0,
Expand Down
46 changes: 43 additions & 3 deletions lib/data/models/invoice_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1045,8 +1045,16 @@ abstract class InvoiceEntity extends Object
if (!isRecurring) {
actions.add(EntityAction.printPdf);
actions.add(EntityAction.download);
if (isInvoice && state.company.settings.enableEInvoice == true) {
actions.add(EntityAction.eInvoice);
if (state.company.settings.enableEInvoice == true) {
if (isInvoice) {
actions.add(EntityAction.eInvoice);
} else if (isQuote) {
actions.add(EntityAction.eQuote);
} else if (isCredit) {
actions.add(EntityAction.eCredit);
} else if (isPurchaseOrder) {
actions.add(EntityAction.ePurchaseOrder);
}
}
}
}
Expand Down Expand Up @@ -1505,6 +1513,15 @@ abstract class InvoiceEntity extends Object
String get invitationEInvoiceDownloadLink =>
invitations.isEmpty ? '' : invitations.first.eInvoiceDownloadLink;

String get invitationEQuoteDownloadLink =>
invitations.isEmpty ? '' : invitations.first.eQuoteDownloadLink;

String get invitationECreditDownloadLink =>
invitations.isEmpty ? '' : invitations.first.eCreditDownloadLink;

String get invitationEPurchaseOrderDownloadLink =>
invitations.isEmpty ? '' : invitations.first.ePurchaseOrderDownloadLink;

// ignore: unused_element
static void _initializeBuilder(InvoiceEntityBuilder builder) => builder
..activities.replace(BuiltList<ActivityEntity>())
Expand Down Expand Up @@ -1736,7 +1753,7 @@ abstract class InvoiceItemEntity
taxName2.isNotEmpty ||
taxName3.isNotEmpty;

String get taxRates {
String get taxNames {
final parts = <String>[];
if (taxName1.isNotEmpty) {
parts.add(taxName1);
Expand All @@ -1750,6 +1767,20 @@ abstract class InvoiceItemEntity
return parts.join(', ');
}

String get taxRates {
final parts = <String>[];
if (taxName1.isNotEmpty) {
parts.add('$taxRate1');
}
if (taxName2.isNotEmpty) {
parts.add('$taxRate2');
}
if (taxName3.isNotEmpty) {
parts.add('$taxRate3');
}
return parts.join(', ');
}

InvoiceItemEntity applyTax(TaxRateEntity? taxRate,
{bool isSecond = false, bool isThird = false}) {
InvoiceItemEntity item;
Expand Down Expand Up @@ -1853,6 +1884,15 @@ abstract class InvitationEntity extends Object
String get eInvoiceDownloadLink =>
'$link/download_e_invoice?t=${DateTime.now().millisecondsSinceEpoch}';

String get eQuoteDownloadLink =>
'$link/download_e_quote?t=${DateTime.now().millisecondsSinceEpoch}';

String get eCreditDownloadLink =>
'$link/download_e_credit?t=${DateTime.now().millisecondsSinceEpoch}';

String get ePurchaseOrderDownloadLink =>
'$link/download_e_purchase_order?t=${DateTime.now().millisecondsSinceEpoch}';

String get borderlessLink => '$silentLink&borderless=true';

String get latestEmailStatus {
Expand Down
3 changes: 3 additions & 0 deletions lib/data/models/models.dart
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ class EntityAction extends EnumClass {
static const EntityAction increasePrices = _$increasePrices;
static const EntityAction setTaxCategory = _$setTaxCategory;
static const EntityAction eInvoice = _$eInvoice;
static const EntityAction eQuote = _$eQuote;
static const EntityAction eCredit = _$eCredit;
static const EntityAction ePurchaseOrder = _$ePurchaseOrder;
static const EntityAction unlink = _$unlink;
static const EntityAction runTemplate = _$runTemplate;

Expand Down
12 changes: 12 additions & 0 deletions lib/data/models/models.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion lib/data/models/settings_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,13 @@ abstract class SettingsEntity
static const PAGE_NUMBER_ALIGN_RIGHT = 'R';
static const PAGE_NUMBER_ALIGN_CENTER = 'C';

static const EMAIL_SENDING_METHOD_DEFAULT = 'default';
static const EMAIL_SENDING_METHOD_POSTMARK_HOSTED = 'default';
static const EMAIL_SENDING_METHOD_MAILGUN_HOSTED = 'mailgun';
static const EMAIL_SENDING_METHOD_GMAIL = 'gmail';
static const EMAIL_SENDING_METHOD_MICROSOFT = 'office365';
static const EMAIL_SENDING_METHOD_POSTMARK = 'client_postmark';
static const EMAIL_SENDING_METHOD_MAILGUN = 'client_mailgun';
static const EMAIL_SENDING_METHOD_BREVO = 'client_brevo';
static const EMAIL_SENDING_METHOD_SMTP = 'smtp';

static const LOCK_INVOICES_OFF = 'off';
Expand Down Expand Up @@ -807,6 +809,9 @@ abstract class SettingsEntity
@BuiltValueField(wireName: 'e_invoice_type')
String? get eInvoiceType;

@BuiltValueField(wireName: 'e_quote_type')
String? get eQuoteType;

@BuiltValueField(wireName: 'default_expense_payment_type_id')
String? get defaultExpensePaymentTypeId;

Expand All @@ -818,9 +823,15 @@ abstract class SettingsEntity
@BuiltValueField(wireName: 'show_pdfhtml_on_mobile')
bool? get showPdfhtmlOnMobile;

@BuiltValueField(wireName: 'enable_rappen_rounding')
bool? get enableRappenRounding;

@BuiltValueField(wireName: 'use_unapplied_payment')
String? get useUnappliedPayment;

@BuiltValueField(wireName: 'brevo_secret')
String? get brevoSecret;

bool get hasAddress => address1 != null && address1!.isNotEmpty;

bool get hasLogo => companyLogo != null && companyLogo!.isNotEmpty;
Expand Down
Loading

0 comments on commit 37a0c33

Please sign in to comment.