Bug 762971 - Duplicating multiple invoices results in invoices without an ID number

If a duplicated invoice doesn't have an ID (which it won't if multiple invoices are
duplicated) allocate it (them) the next ID.
pull/72/merge
Mike Evans 10 years ago
parent e4e19a4caa
commit b89723a561

@ -2695,7 +2695,7 @@ set_gncEntry_date(gpointer data, gpointer user_data)
InvoiceWindow * gnc_ui_invoice_duplicate (GncInvoice *old_invoice, gboolean open_properties, const GDate *new_date)
{
InvoiceWindow *iw;
InvoiceWindow *iw = NULL;
GncInvoice *new_invoice = NULL;
GDate new_date_gdate;
@ -2746,10 +2746,14 @@ InvoiceWindow * gnc_ui_invoice_duplicate (GncInvoice *old_invoice, gboolean open
}
else
{
// Open the newly created invoice in the "edit" window
// Open the newly created invoice in the "edit" window
iw = gnc_ui_invoice_edit (new_invoice);
// Check the ID; set one if necessary
if (g_strcmp0 (gtk_entry_get_text (GTK_ENTRY (iw->id_entry)), "") == 0)
{
gncInvoiceSetID (new_invoice, gncInvoiceNextID(iw->book, &(iw->owner)));
}
}
return iw;
}

Loading…
Cancel
Save