Files

168 lines
4.2 KiB
C++

#if !defined(AFX_RPTS_H__B3971462_FC37_11D3_964F_00C0F02C4B69__INCLUDED_)
#define AFX_RPTS_H__B3971462_FC37_11D3_964F_00C0F02C4B69__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// RPTS.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// RPTS form view
#ifndef __AFXEXT_H__
#include <afxext.h>
#endif
//these defines are used to set bits
//for which criteria selectors should be
//enabled depending upon the report
//Use bitwise OR | to add up values
//and use bitwise AND to See if a bit is set or not
//so CLIENT | TECH = 3 anding client or tech will
//result in nonzero so if(value & CLIENT) will be
//true if client exists in bitfield
//largest possible number for these 10 items would be
//512, 15 items would be 32767
#define CLIENT 1
#define TECH 2
#define PROJECT 4
#define CATEGORY 8
#define UNIT 16
#define PART 32
#define RATE 64
#define NONCLIENT 128
#define DATE 256
#define ZONE 512
#define MANUFACTURER 1024
#define MODEL 2048
#include "gzcombo.h"
#include "gzrset.h"
#include "label.h"
#include "afxwin.h"
class RPTS : public CFormView
{
public:
RPTS(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(RPTS)
GZRset* rs;
CSpApp* m_pApp;
// Form Data
public:
//{{AFX_DATA(RPTS)
enum { IDD = IDD_RPTS_FORM };
CButton m_btnSQL;
CButton m_btnFields;
CButton m_btnTTX;
CLabel m_lblByModel;
CLabel m_lblByDesc;
CStatic m_lblModel;
CStatic m_lblManufacturer;
CgzCombo m_cbModel;
CgzCombo m_cbManufacturer;
CStatic m_lblZone;
CgzCombo m_cbZone;
CStatic m_lblUnit;
CStatic m_lblTech;
CStatic m_lblRate;
CStatic m_lblProject;
CStatic m_lblPart;
CStatic m_lblNonClient;
CStatic m_lblDateRange;
CStatic m_lblClient;
CStatic m_lblCategory;
CStatic m_lblBetween;
CStatic m_lblAnd;
CDateTimeCtrl m_dtStart;
CDateTimeCtrl m_dtEnd;
CgzCombo m_cbUnit;
CgzCombo m_cbTech;
CgzCombo m_cbReport;
CgzCombo m_cbRate;
CgzCombo m_cbProject;
CgzCombo m_cbPart;
CgzCombo m_cbNonClient;
CgzCombo m_cbDateRange;
CgzCombo m_cbClient;
CgzCombo m_cbCategory;
CButton m_btnReport;
//}}AFX_DATA
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(RPTS)
public:
virtual void OnInitialUpdate();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
public:
//CString m_strChosenReport;
CString m_strReportFileName;
void GetDateXMonthsAgo(COleDateTime* dtData, int iMonths);
void GetFirstDayLastMonth(COleDateTime* dtData);
void GetMonthEnd(COleDateTime* dtData);
void BuildSql();
CString m_strSQL;
CString m_strRawSQL;
CString m_strProcessedSQL;//added June 24th 2003 to handle head offices and preserve original raw sql
void BuildCriteria();
bool m_bListByDescription;
void ActivateCriteria();
void FillLists(bool bFillModelsOnly);
void DeActivate();
void Activate();
virtual ~RPTS();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
//{{AFX_MSG(RPTS)
afx_msg void OnLblbymodel();
afx_msg void OnLblbydesc();
afx_msg void OnCloseupCbreport();
afx_msg void OnBtnreport();
afx_msg void OnCloseupCbdaterange();
afx_msg void OnDatetimechangeDtend(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDatetimechangeDtstart(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnBtnttx();
afx_msg void OnBtnfields();
afx_msg void OnBtnrefresh();
afx_msg void OnBtnsql();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
bool m_bShowShortdateWarning;
private:
// Substitute head offices in query if one was selected as criteria
void SubHeadOffice(void);
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_RPTS_H__B3971462_FC37_11D3_964F_00C0F02C4B69__INCLUDED_)