diff options
Diffstat (limited to 'src/ui/ui_expenses.cpp')
| -rw-r--r-- | src/ui/ui_expenses.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/ui/ui_expenses.cpp b/src/ui/ui_expenses.cpp index bb23ba9..6c02a74 100644 --- a/src/ui/ui_expenses.cpp +++ b/src/ui/ui_expenses.cpp @@ -339,6 +339,23 @@ static void draw_expense_form(invoice* buffer, bool viewing_only = false) static void ui_draw_expenses_list() { + if (!administration_can_create_invoices()) { + ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(0, 102, 204, 255)); // blue + ImGui::Text(localize("ui.invoiceRequirementP1")); + ImGui::PopStyleColor(); + + if (ImGui::IsItemHovered()) { + ImGui::SetMouseCursor(ImGuiMouseCursor_Hand); + if (ImGui::IsMouseClicked(ImGuiMouseButton_Left)) { + ui_set_state(main_state::UI_SETTINGS); + } + } + + ImGui::SameLine(); + ImGui::Text(localize("ui.invoiceRequirementP2")); + return; + } + const u32 items_per_page = 50; static s32 current_page = 0; @@ -366,7 +383,7 @@ static void ui_draw_expenses_list() ImGui::SameLine(); bool enable_prev = current_page > 0; if (!enable_prev) ImGui::BeginDisabled(); - if (ImGui::Button("<< Prev") && current_page > 0) current_page--; + if (ImGui::Button(localize("ui.prev")) && current_page > 0) current_page--; if (!enable_prev) ImGui::EndDisabled(); ImGui::SameLine(); @@ -376,7 +393,7 @@ static void ui_draw_expenses_list() ImGui::SameLine(); bool enable_next = current_page < max_page-1; if (!enable_next) ImGui::BeginDisabled(); - if (ImGui::Button("Next >>") && current_page < max_page-1) current_page++; + if (ImGui::Button(localize("ui.next")) && current_page < max_page-1) current_page++; if (!enable_next) ImGui::EndDisabled(); ImGui::Spacing(); |
