Merge TiangYing Xi's no-business-address into maint.

This commit is contained in:
John Ralls
2021-06-12 17:16:14 -07:00
4 changed files with 7 additions and 56 deletions

View File

@@ -329,23 +329,10 @@ gnc_customer_window_ok_cb (GtkWidget *widget, gpointer data)
/* Check for valid company name */
if (check_entry_nonempty (cw->company_entry,
_("You must enter a company name. "
"If this customer is an individual (and not a company) "
"you should enter the same value for:\nIdentification "
"- Company Name, and\nPayment Address - Name.")))
_("The Company Name field cannot be left blank, please "
"enter a company name or a person's name.")))
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) */
min = gnc_numeric_zero ();
max = gnc_numeric_create (100, 1);

View File

@@ -208,26 +208,11 @@ gnc_employee_window_ok_cb (GtkWidget *widget, gpointer data)
GNCPrintAmountInfo print_info;
gnc_commodity *currency;
/* Check for valid username */
if (check_entry_nonempty (ew->username_entry,
_("You must enter a username.")))
return;
/* Check for valid username */
/* Check for valid employeename */
if (check_entry_nonempty (ew->name_entry,
_("You must enter the employee's name.")))
_("You must enter a Payment-Address Name.")))
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 */
if (g_strcmp0 (gtk_entry_get_text (GTK_ENTRY (ew->id_entry)), "") == 0)

View File

@@ -211,23 +211,10 @@ gnc_vendor_window_ok_cb (GtkWidget *widget, gpointer data)
/* Check for valid company name */
if (check_entry_nonempty (vw->company_entry,
_("You must enter a company name. "
"If this vendor is an individual (and not a company) "
"you should enter the same value for:\nIdentification "
"- Company Name, and\nPayment Address - Name.")))
_("The Company Name field cannot be left blank, please "
"enter a company name or a person's name.")))
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 */
if (g_strcmp0 (gtk_entry_get_text (GTK_ENTRY (vw->id_entry)), "") == 0)
{

View File

@@ -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 (name);