diff options
Diffstat (limited to 'src/ui/ui_invoices.cpp')
| -rw-r--r-- | src/ui/ui_invoices.cpp | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/ui/ui_invoices.cpp b/src/ui/ui_invoices.cpp index 26f60c4..fe4f5a8 100644 --- a/src/ui/ui_invoices.cpp +++ b/src/ui/ui_invoices.cpp @@ -9,6 +9,8 @@ static view_state current_view_state = view_state::LIST; static invoice active_invoice; +extern void draw_contact_form(contact* buffer, bool viewing_only = false); + void ui_setup_invoices() { current_view_state = view_state::LIST; @@ -33,10 +35,25 @@ bool draw_invoice_form(invoice* buffer, bool back_button_enabled = true, bool vi //ImGui::InputText(localize("contact.form.identifier"), buffer->id, IM_ARRAYSIZE(buffer->id)); // 2. Sequential number - ImGui::SetNextItemWidth(widthAvailable*0.5f); - ImGui::InputTextWithHint("Invoice number", "Invoice number", buffer->sequential_number, IM_ARRAYSIZE(buffer->sequential_number)); - ImGui::SameLine();ui_helper_draw_required_tag(); - if (!viewing_only) ImGui::EndDisabled(); + ImGui::Text("Invoice number: %s", buffer->sequential_number); + + // 3. Supplier (you) + ImGui::Text("Supplier: %s", buffer->supplier.name); + + ImGui::Separator(); + + ImGui::Text("Customer information"); + draw_contact_form(&buffer->customer); + strops_copy(buffer->customer_id, buffer->customer.id, sizeof(buffer->customer_id)); + + ImGui::Separator(); + + //ImGui::SetNextItemWidth(widthAvailable*0.5f); + //ImGui::InputTextWithHint("Invoice number", "Invoice number", buffer->sequential_number, IM_ARRAYSIZE(buffer->sequential_number)); + //ImGui::SameLine();ui_helper_draw_required_tag(); + + + //if (!viewing_only) ImGui::EndDisabled(); return false; } @@ -48,6 +65,8 @@ void draw_invoices_list() { current_view_state = view_state::CREATE; active_invoice = administration_create_empty_invoice(); + active_invoice.supplier = administration_get_company_info(); + strops_copy(active_invoice.supplier_id, active_invoice.supplier.id, sizeof(active_invoice.supplier_id)); } } |
