Пример #1
0
printQuote::printQuote(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
    : printSinglecopyDocument(parent, name, modal, fl)
{
  setupUi(optionsWidget());
  setWindowTitle(optionsWidget()->windowTitle());
  
  setDoctype("QT");
  setReportKey("quhead_id");

  _docinfoQueryString = "SELECT quhead_id AS docid, quhead_id,"
                        "       quhead_number AS docnumber,"
                        "       false         AS printed,"
                        "<? if exists('reportname') ?>"
                        "       <? value('reportname') ?>"
                        "<? else ?>"
                        "       findCustomerForm(quhead_cust_id, 'Q')"
                        " <? endif ?> AS reportname"
                        "  FROM quhead"
                        " WHERE (quhead_id=<? value('docid') ?>);" ;

  connect(_quote,          SIGNAL(newId(int)), this, SLOT(sHandleNewQuoteId()));
  connect(_report,         SIGNAL(newID(int)), this, SLOT(sHandleButtons()));
  connect(this,     SIGNAL(finishedWithAll()), this, SLOT(sFinishedWithAll()));
  connect(this, SIGNAL(populated(XSqlQuery*)), this, SLOT(sPopulate(XSqlQuery*)));
}
Пример #2
0
printPoForm::printPoForm(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
  : printSinglecopyDocument(parent, name, modal, fl)
{
  setupUi(optionsWidget());
  setWindowTitle(optionsWidget()->windowTitle());

  setDoctype("PO");
  setReportKey("pohead_id");

  _docinfoQueryString = "SELECT pohead_id      AS docid, pohead_id,"
                        "       pohead_number  AS docnumber,"
                        "       pohead_printed AS printed,"
                        "<? if exists('reportname') ?>"
                        "       (SELECT form_report_name"
                        "          FROM form"
                        "         WHERE ((form_name=<? value('reportname') ?>)"
                        "            AND (form_key='PO')))"
                        "<? else ?>"
                        "       COALESCE((SELECT MIN(form_report_name)"
                        "                   FROM form WHERE (form_key='PO')),"
                        "                'PurchaseOrder')"
                        "<? endif ?> AS reportname"
                        "  FROM pohead"
                        " WHERE (pohead_id=<? value('docid') ?>);" ;

  _report->populate( "SELECT form_id, form_name, form_name "
                     "FROM form "
                     "WHERE (form_key='PO') "
                     "ORDER BY form_name;" );

  connect(_po,    SIGNAL(newId(int, QString)), this, SLOT(sHandleNewOrderId()));
  connect(_report,         SIGNAL(newID(int)), this, SLOT(sHandleButtons()));
  connect(this,     SIGNAL(finishedWithAll()), this, SLOT(sFinishedWithAll()));
  connect(this, SIGNAL(populated(XSqlQuery*)), this, SLOT(sPopulate(XSqlQuery*)));
}