mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Working on task invoices
This commit is contained in:
parent
eee064e500
commit
91402b2c4e
@ -17,6 +17,13 @@ class UpdateDarkMode extends Migration
|
|||||||
});
|
});
|
||||||
|
|
||||||
DB::statement('update users set dark_mode = 1;');
|
DB::statement('update users set dark_mode = 1;');
|
||||||
|
|
||||||
|
// update invoice_item_type_id for task invoice items
|
||||||
|
DB::statement('update invoice_items
|
||||||
|
left join invoices on invoices.id = invoice_items.invoice_id
|
||||||
|
set invoice_item_type_id = 2
|
||||||
|
where invoices.has_tasks = 1
|
||||||
|
and invoice_item_type_id = 1');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -166,11 +166,16 @@ function ViewModel(data) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
self.hasTasksCached;
|
||||||
self.hasTasks = ko.computed(function() {
|
self.hasTasks = ko.computed(function() {
|
||||||
|
if (self.hasTasksCached) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
invoice = self.invoice();
|
invoice = self.invoice();
|
||||||
for (var i=0; i<invoice.invoice_items().length; ++i) {
|
for (var i=0; i<invoice.invoice_items().length; ++i) {
|
||||||
var item = invoice.invoice_items()[i];
|
var item = invoice.invoice_items()[i];
|
||||||
if (! item.isEmpty() && item.invoice_item_type_id() == {{ INVOICE_ITEM_TYPE_TASK }}) {
|
if (! item.isEmpty() && item.invoice_item_type_id() == {{ INVOICE_ITEM_TYPE_TASK }}) {
|
||||||
|
self.hasTasksCached = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user