mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Merge TiangYing Xi's no-business-address into maint.
This commit is contained in:
@@ -329,23 +329,10 @@ gnc_customer_window_ok_cb (GtkWidget *widget, gpointer data)
|
|||||||
|
|
||||||
/* Check for valid company name */
|
/* Check for valid company name */
|
||||||
if (check_entry_nonempty (cw->company_entry,
|
if (check_entry_nonempty (cw->company_entry,
|
||||||
_("You must enter a company name. "
|
_("The Company Name field cannot be left blank, please "
|
||||||
"If this customer is an individual (and not a company) "
|
"enter a company name or a person's name.")))
|
||||||
"you should enter the same value for:\nIdentification "
|
|
||||||
"- Company Name, and\nPayment Address - Name.")))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Make sure we have an address */
|
|
||||||
if (check_entry_nonempty (cw->addr1_entry, NULL) &&
|
|
||||||
check_entry_nonempty (cw->addr2_entry, NULL) &&
|
|
||||||
check_entry_nonempty (cw->addr3_entry, NULL) &&
|
|
||||||
check_entry_nonempty (cw->addr4_entry, NULL))
|
|
||||||
{
|
|
||||||
const char *msg = _("You must enter a billing address.");
|
|
||||||
gnc_error_dialog (gnc_ui_get_gtk_window (widget), "%s", msg);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Verify terms, discount, and credit are valid (or empty) */
|
/* Verify terms, discount, and credit are valid (or empty) */
|
||||||
min = gnc_numeric_zero ();
|
min = gnc_numeric_zero ();
|
||||||
max = gnc_numeric_create (100, 1);
|
max = gnc_numeric_create (100, 1);
|
||||||
|
|||||||
@@ -208,26 +208,11 @@ gnc_employee_window_ok_cb (GtkWidget *widget, gpointer data)
|
|||||||
GNCPrintAmountInfo print_info;
|
GNCPrintAmountInfo print_info;
|
||||||
gnc_commodity *currency;
|
gnc_commodity *currency;
|
||||||
|
|
||||||
/* Check for valid username */
|
/* Check for valid employeename */
|
||||||
if (check_entry_nonempty (ew->username_entry,
|
|
||||||
_("You must enter a username.")))
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* Check for valid username */
|
|
||||||
if (check_entry_nonempty (ew->name_entry,
|
if (check_entry_nonempty (ew->name_entry,
|
||||||
_("You must enter the employee's name.")))
|
_("You must enter a Payment-Address Name.")))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Make sure we have an address */
|
|
||||||
if (check_entry_nonempty (ew->addr1_entry, NULL) &&
|
|
||||||
check_entry_nonempty (ew->addr2_entry, NULL) &&
|
|
||||||
check_entry_nonempty (ew->addr3_entry, NULL) &&
|
|
||||||
check_entry_nonempty (ew->addr4_entry, NULL))
|
|
||||||
{
|
|
||||||
const char *msg = _("You must enter an address.");
|
|
||||||
gnc_error_dialog (gnc_ui_get_gtk_window (widget), "%s", msg);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set the employee id if one has not been chosen */
|
/* Set the employee id if one has not been chosen */
|
||||||
if (g_strcmp0 (gtk_entry_get_text (GTK_ENTRY (ew->id_entry)), "") == 0)
|
if (g_strcmp0 (gtk_entry_get_text (GTK_ENTRY (ew->id_entry)), "") == 0)
|
||||||
|
|||||||
@@ -211,23 +211,10 @@ gnc_vendor_window_ok_cb (GtkWidget *widget, gpointer data)
|
|||||||
|
|
||||||
/* Check for valid company name */
|
/* Check for valid company name */
|
||||||
if (check_entry_nonempty (vw->company_entry,
|
if (check_entry_nonempty (vw->company_entry,
|
||||||
_("You must enter a company name. "
|
_("The Company Name field cannot be left blank, please "
|
||||||
"If this vendor is an individual (and not a company) "
|
"enter a company name or a person's name.")))
|
||||||
"you should enter the same value for:\nIdentification "
|
|
||||||
"- Company Name, and\nPayment Address - Name.")))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Make sure we have an address */
|
|
||||||
if (check_entry_nonempty (vw->addr1_entry, NULL) &&
|
|
||||||
check_entry_nonempty (vw->addr2_entry, NULL) &&
|
|
||||||
check_entry_nonempty (vw->addr3_entry, NULL) &&
|
|
||||||
check_entry_nonempty (vw->addr4_entry, NULL))
|
|
||||||
{
|
|
||||||
const char *msg = _("You must enter a payment address.");
|
|
||||||
gnc_error_dialog (gnc_ui_get_gtk_window (widget), "%s", msg);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check for valid id and set one if necessary */
|
/* Check for valid id and set one if necessary */
|
||||||
if (g_strcmp0 (gtk_entry_get_text (GTK_ENTRY (vw->id_entry)), "") == 0)
|
if (g_strcmp0 (gtk_entry_get_text (GTK_ENTRY (vw->id_entry)), "") == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -246,14 +246,6 @@ gnc_customer_import_fix_customers (GtkListStore *store, guint *fixed, guint *del
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// At least one of the address fields must have a value.
|
|
||||||
// If not, then delete the row.
|
|
||||||
if (strlen(addr1) == 0 && strlen(addr2) == 0 && strlen(addr3) == 0 && strlen(addr4) == 0)
|
|
||||||
{
|
|
||||||
valid = gtk_list_store_remove (store, &iter);
|
|
||||||
(*deleted)++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_free (company);
|
g_free (company);
|
||||||
g_free (name);
|
g_free (name);
|
||||||
|
|||||||
Reference in New Issue
Block a user