This commit is contained in:
2022-07-01 21:14:51 +00:00
parent 19084455b0
commit e2ecec24d3
3 changed files with 38 additions and 14 deletions

View File

@@ -21,7 +21,21 @@ namespace AyaNovaQBI
public DataTable QBInvoiceTemplates { get; set; } public DataTable QBInvoiceTemplates { get; set; }
public string SelectedQBInvoiceTemplate { get => (string)cbQBItems.SelectedValue; set { } }
public string SelectedQBInvoiceTemplate
{
get
{
return _selectedQBInvoiceTemplate;
}
set
{
_selectedQBInvoiceTemplate = value;
}
}
private string _selectedQBInvoiceTemplate;
private void SetQBClass_load(object sender, EventArgs e) private void SetQBClass_load(object sender, EventArgs e)
{ {
@@ -35,6 +49,11 @@ namespace AyaNovaQBI
cbQBItems.DisplayMember = "FullName"; cbQBItems.DisplayMember = "FullName";
cbQBItems.ValueMember = "ID"; cbQBItems.ValueMember = "ID";
lblStatus.Text = "QuickBooks invoice template:"; lblStatus.Text = "QuickBooks invoice template:";
if (string.IsNullOrWhiteSpace(_selectedQBInvoiceTemplate))
cbQBItems.SelectedIndex = 0;
else
this.cbQBItems.SelectedValue = _selectedQBInvoiceTemplate;
} }

View File

@@ -21,7 +21,20 @@ namespace AyaNovaQBI
public DataTable QBTerms { get; set; } public DataTable QBTerms { get; set; }
public string SelectedQBTerm { get => (string)cbQBTerms.SelectedValue; set { } }
public string SelectedQBTerm
{
get
{
return _selectedQBTerm;
}
set
{
_selectedQBTerm = value;
}
}
private string _selectedQBTerm;
private void SetQBClass_load(object sender, EventArgs e) private void SetQBClass_load(object sender, EventArgs e)
{ {

View File

@@ -996,7 +996,7 @@ namespace AyaNovaQBI
#region QB Transaction class #region QB Transaction class
//Validate any existing //Validate any existing
if (SetEverything == false && QDat.TransactionClass != null && QDat.TransactionClass != "") if (SetEverything == false && !string.IsNullOrWhiteSpace(QDat.TransactionClass))
{ {
//if something is set but there are no tr classes //if something is set but there are no tr classes
//then just clear it and move along //then just clear it and move along
@@ -1039,9 +1039,9 @@ namespace AyaNovaQBI
if (QBClasses.Rows.Contains(QDat.TransactionClass)) if (QBClasses.Rows.Contains(QDat.TransactionClass))
s3.SelectedQBClass = QDat.TransactionClass; s3.SelectedQBClass = QDat.TransactionClass;
else else
s3.SelectedQBClass = TRANSACTION_CLASS_NO_CLASS_SELECTED; s3.SelectedQBClass = TRANSACTION_CLASS_NO_CLASS_SELECTED;
if (s3.ShowDialog() == DialogResult.Cancel) if (s3.ShowDialog() == DialogResult.Cancel)
{ {
return pfstat.Cancel; return pfstat.Cancel;
@@ -1076,7 +1076,6 @@ namespace AyaNovaQBI
"for now it is disabled and the default invoice template will be used"; "for now it is disabled and the default invoice template will be used";
s3a.ShowDialog(); s3a.ShowDialog();
goto TRInvoiceTemplateOK; goto TRInvoiceTemplateOK;
} }
@@ -1132,8 +1131,7 @@ namespace AyaNovaQBI
"for invoices. If you do not use Invoice templates or are not sure what they are\r\n" + "for invoices. If you do not use Invoice templates or are not sure what they are\r\n" +
"select < Use default > from the list below.\r\n\r\n" + "select < Use default > from the list below.\r\n\r\n" +
"This setting is required."; "This setting is required.";
s3b.QBInvoiceTemplates = QBInvoiceTemplates; s3b.QBInvoiceTemplates = QBInvoiceTemplates;
s3b.SelectedQBInvoiceTemplate = QDat.QBInvoiceTemplate; s3b.SelectedQBInvoiceTemplate = QDat.QBInvoiceTemplate;
if (s3b.ShowDialog() == DialogResult.Cancel) if (s3b.ShowDialog() == DialogResult.Cancel)
@@ -1195,7 +1193,6 @@ namespace AyaNovaQBI
"When an invoice for a customer is created the selected terms will be applied.\r\n\r\n" + "When an invoice for a customer is created the selected terms will be applied.\r\n\r\n" +
"This setting is required."; "This setting is required.";
termsdialog.QBTerms = QBTerms; termsdialog.QBTerms = QBTerms;
termsdialog.SelectedQBTerm = QDat.TermsDefault; termsdialog.SelectedQBTerm = QDat.TermsDefault;
if (termsdialog.ShowDialog() == DialogResult.Cancel) if (termsdialog.ShowDialog() == DialogResult.Cancel)
@@ -1221,10 +1218,6 @@ namespace AyaNovaQBI
goto TBPOK; goto TBPOK;
} }
SetToBePrinted s4 = new SetToBePrinted(); SetToBePrinted s4 = new SetToBePrinted();
s4.DialogTitle = "AyaNova QBI setup - Set invoice to be printed?"; s4.DialogTitle = "AyaNova QBI setup - Set invoice to be printed?";
s4.OptionTitle = "Invoice to be printed"; s4.OptionTitle = "Invoice to be printed";
@@ -1257,7 +1250,6 @@ namespace AyaNovaQBI
goto SETMEMOOK; goto SETMEMOOK;
} }
SetMemoField s5 = new SetMemoField(); SetMemoField s5 = new SetMemoField();
s5.DialogTitle = "AyaNova QBI setup - Set Memo field?"; s5.DialogTitle = "AyaNova QBI setup - Set Memo field?";
s5.OptionTitle = "Invoice memo field"; s5.OptionTitle = "Invoice memo field";