Fix cancel/reverse bug
This commit is contained in:
parent
c8feb35bb2
commit
0c3ccda3e0
|
|
@ -13,7 +13,8 @@ const String kAppVersion = '2.0.9';
|
||||||
|
|
||||||
const String kSiteUrl = 'https://invoiceninja.com';
|
const String kSiteUrl = 'https://invoiceninja.com';
|
||||||
//const String kAppProductionUrl = 'https://invoicing.co';
|
//const String kAppProductionUrl = 'https://invoicing.co';
|
||||||
const String kAppProductionUrl = 'https://staging.invoicing.co'; // TODO remove staging
|
const String kAppProductionUrl =
|
||||||
|
'https://staging.invoicing.co'; // TODO remove staging
|
||||||
const String kAppStagingUrl = 'https://staging.invoicing.co';
|
const String kAppStagingUrl = 'https://staging.invoicing.co';
|
||||||
const String kWhiteLabelUrl =
|
const String kWhiteLabelUrl =
|
||||||
'https://app.invoiceninja.com/buy_now/?account_key=AsFmBAeLXF0IKf7tmi0eiyZfmWW9hxMT&product_id=3';
|
'https://app.invoiceninja.com/buy_now/?account_key=AsFmBAeLXF0IKf7tmi0eiyZfmWW9hxMT&product_id=3';
|
||||||
|
|
@ -110,6 +111,8 @@ const String kInvoiceStatusDraft = '1';
|
||||||
const String kInvoiceStatusSent = '2';
|
const String kInvoiceStatusSent = '2';
|
||||||
const String kInvoiceStatusPartial = '3';
|
const String kInvoiceStatusPartial = '3';
|
||||||
const String kInvoiceStatusPaid = '4';
|
const String kInvoiceStatusPaid = '4';
|
||||||
|
const String kInvoiceStatusCancelled = '5';
|
||||||
|
const String kInvoiceStatusReversed = '6';
|
||||||
|
|
||||||
const kInvoiceStatuses = {
|
const kInvoiceStatuses = {
|
||||||
kInvoiceStatusPastDue: 'past_due',
|
kInvoiceStatusPastDue: 'past_due',
|
||||||
|
|
@ -117,6 +120,8 @@ const kInvoiceStatuses = {
|
||||||
kInvoiceStatusSent: 'sent',
|
kInvoiceStatusSent: 'sent',
|
||||||
kInvoiceStatusPartial: 'partial',
|
kInvoiceStatusPartial: 'partial',
|
||||||
kInvoiceStatusPaid: 'paid',
|
kInvoiceStatusPaid: 'paid',
|
||||||
|
kInvoiceStatusCancelled: 'cancelled',
|
||||||
|
kInvoiceStatusReversed: 'reversed',
|
||||||
};
|
};
|
||||||
|
|
||||||
const String kQuoteStatusExpired = '-1';
|
const String kQuoteStatusExpired = '-1';
|
||||||
|
|
@ -413,6 +418,8 @@ class InvoiceStatusColors {
|
||||||
kInvoiceStatusPartial: Colors.deepPurple,
|
kInvoiceStatusPartial: Colors.deepPurple,
|
||||||
kInvoiceStatusPaid: convertHexStringToColor('#407535'),
|
kInvoiceStatusPaid: convertHexStringToColor('#407535'),
|
||||||
kInvoiceStatusPastDue: convertHexStringToColor('#8D3E3F'),
|
kInvoiceStatusPastDue: convertHexStringToColor('#8D3E3F'),
|
||||||
|
kInvoiceStatusCancelled: Colors.red,
|
||||||
|
kInvoiceStatusReversed: Colors.red,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -582,4 +589,4 @@ const kPageSizes = [
|
||||||
'Tabloid',
|
'Tabloid',
|
||||||
];
|
];
|
||||||
|
|
||||||
const String kDrawerKey = 'drawer_key';
|
const String kDrawerKey = 'drawer_key';
|
||||||
|
|
|
||||||
|
|
@ -258,6 +258,8 @@ final invoicesReducer = combineReducers<InvoiceState>([
|
||||||
TypedReducer<InvoiceState, LoadInvoiceSuccess>(_updateInvoice),
|
TypedReducer<InvoiceState, LoadInvoiceSuccess>(_updateInvoice),
|
||||||
TypedReducer<InvoiceState, MarkInvoicesSentSuccess>(_markInvoicesSentSuccess),
|
TypedReducer<InvoiceState, MarkInvoicesSentSuccess>(_markInvoicesSentSuccess),
|
||||||
TypedReducer<InvoiceState, MarkInvoicesPaidSuccess>(_markInvoicesPaidSuccess),
|
TypedReducer<InvoiceState, MarkInvoicesPaidSuccess>(_markInvoicesPaidSuccess),
|
||||||
|
TypedReducer<InvoiceState, ReverseInvoicesSuccess>(_reverseInvoicesSuccess),
|
||||||
|
TypedReducer<InvoiceState, CancelInvoicesSuccess>(_cancelInvoicesSuccess),
|
||||||
TypedReducer<InvoiceState, ArchiveInvoicesRequest>(_archiveInvoiceRequest),
|
TypedReducer<InvoiceState, ArchiveInvoicesRequest>(_archiveInvoiceRequest),
|
||||||
TypedReducer<InvoiceState, ArchiveInvoicesSuccess>(_archiveInvoiceSuccess),
|
TypedReducer<InvoiceState, ArchiveInvoicesSuccess>(_archiveInvoiceSuccess),
|
||||||
TypedReducer<InvoiceState, ArchiveInvoicesFailure>(_archiveInvoiceFailure),
|
TypedReducer<InvoiceState, ArchiveInvoicesFailure>(_archiveInvoiceFailure),
|
||||||
|
|
@ -287,6 +289,24 @@ InvoiceState _markInvoicesPaidSuccess(
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
InvoiceState _reverseInvoicesSuccess(
|
||||||
|
InvoiceState invoiceState, ReverseInvoicesSuccess action) {
|
||||||
|
return invoiceState.rebuild((b) {
|
||||||
|
for (final invoice in action.invoices) {
|
||||||
|
b.map[invoice.id] = invoice;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
InvoiceState _cancelInvoicesSuccess(
|
||||||
|
InvoiceState invoiceState, CancelInvoicesSuccess action) {
|
||||||
|
return invoiceState.rebuild((b) {
|
||||||
|
for (final invoice in action.invoices) {
|
||||||
|
b.map[invoice.id] = invoice;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
InvoiceState _archiveInvoiceRequest(
|
InvoiceState _archiveInvoiceRequest(
|
||||||
InvoiceState invoiceState, ArchiveInvoicesRequest action) {
|
InvoiceState invoiceState, ArchiveInvoicesRequest action) {
|
||||||
final invoices = action.invoiceIds.map((id) => invoiceState.map[id]).toList();
|
final invoices = action.invoiceIds.map((id) => invoiceState.map[id]).toList();
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,8 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
static final Map<String, Map<String, String>> _localizedValues = {
|
static final Map<String, Map<String, String>> _localizedValues = {
|
||||||
'en': {
|
'en': {
|
||||||
// STARTER: lang key - do not remove comment
|
// STARTER: lang key - do not remove comment
|
||||||
|
'reversed': 'Reversed',
|
||||||
|
'cancelled': 'Cancelled',
|
||||||
'credit_amount': 'Credit Amount',
|
'credit_amount': 'Credit Amount',
|
||||||
'quote_amount': 'Quote Amount',
|
'quote_amount': 'Quote Amount',
|
||||||
'hosted': 'Hosted',
|
'hosted': 'Hosted',
|
||||||
|
|
@ -36511,6 +36513,11 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
String get quoteAmount =>
|
String get quoteAmount =>
|
||||||
_localizedValues[localeCode]['quote_amount'] ?? '';
|
_localizedValues[localeCode]['quote_amount'] ?? '';
|
||||||
|
|
||||||
|
String get reversed =>
|
||||||
|
_localizedValues[localeCode]['reversed'] ?? '';
|
||||||
|
|
||||||
|
String get cancelled =>
|
||||||
|
_localizedValues[localeCode]['cancelled'] ?? '';
|
||||||
|
|
||||||
String lookup(String key) {
|
String lookup(String key) {
|
||||||
final lookupKey = toSnakeCase(key);
|
final lookupKey = toSnakeCase(key);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue