This commit is contained in:
2022-07-01 00:38:15 +00:00
parent 2aa4b6d28b
commit 356bcfe64d
11 changed files with 364 additions and 47 deletions

View File

@@ -1140,67 +1140,67 @@ namespace AyaNovaQBI
#endregion
// #region QB Terms
#region QB Terms
// //Validate any existing
// //case 3228 added extra condition set everything is false
// if (SetEverything == false && !string.IsNullOrEmpty(QDat.TermsDefault))
// {
// //if something is set but there are no terms
// //then just clear it and move along
// if (QBTerms.Rows.Count == 1)
// {
// QDat.TermsDefault = "";
// goto TermsOK;
// }
//Validate any existing
//case 3228 added extra condition set everything is false
if (SetEverything == false && !string.IsNullOrEmpty(QDat.TermsDefault))
{
//if something is set but there are no terms
//then just clear it and move along
if (QBTerms.Rows.Count == 1)
{
QDat.TermsDefault = "";
goto TermsOK;
}
// //Something is set and there *are* terms so
// //let's validate it...
// if (QBTerms.Rows.Contains(QDat.TermsDefault))
// {
// if (!SetEverything)
// goto TermsOK;
// }
// else
// {
// MessageBox.Show("The QuickBooks default terms previously set for invoicing\r\n" +
// "no longer appears to be valid. You will next be prompted to re-select it.");
// }
// }
//Something is set and there *are* terms so
//let's validate it...
if (QBTerms.Rows.Contains(QDat.TermsDefault))
{
if (!SetEverything)
goto TermsOK;
}
else
{
MessageBox.Show("The QuickBooks default terms previously set for invoicing\r\n" +
"no longer appears to be valid. You will next be prompted to re-select it.");
}
}
// //We've arrived here because there is no setting for Terms
// //Or the user want's to change it
// //and there are some defined in QB
// SetQBTerms termsdialog = new SetQBTerms();
// termsdialog.DialogTitle = "AyaNova QBI setup - Customer default invoice terms";
// termsdialog.OptionTitle = "Default terms";
// termsdialog.OptionDescription = "QBI needs to know what QuickBooks terms you want \r\n" +
// "QBI to set for customers imported from AyaNova.\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.";
// termsdialog.QBTerms = QBTerms;
//We've arrived here because there is no setting for Terms
//Or the user want's to change it
//and there are some defined in QB
SetQBTerms termsdialog = new SetQBTerms();
termsdialog.DialogTitle = "AyaNova QBI setup - Customer default invoice terms";
termsdialog.OptionTitle = "Default terms";
termsdialog.OptionDescription = "QBI needs to know what QuickBooks terms you want \r\n" +
"QBI to set for customers imported from AyaNova.\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.";
termsdialog.QBTerms = QBTerms;
// termsdialog.SelectedQBTerm = QDat.TermsDefault;
termsdialog.SelectedQBTerm = QDat.TermsDefault;
// if (termsdialog.ShowDialog() == DialogResult.Cancel)
// {
// return pfstat.Cancel;
if (termsdialog.ShowDialog() == DialogResult.Cancel)
{
return pfstat.Cancel;
// }
// else
// QDat.TermsDefault = termsdialog.SelectedQBTerm;
// termsdialog.Dispose();
// termsdialog = null;
}
else
QDat.TermsDefault = termsdialog.SelectedQBTerm;
termsdialog.Dispose();
termsdialog = null;
//TermsOK:
TermsOK:
// #endregion
#endregion
// #region ToBePrinted
// //No validation possible