|
|
unit u_ch_invoice_shen;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, bsSkinCtrls, dxExEdtr, dxCntner, dxTL, dxDBCtrl, dxDBGrid, DB,
|
|
|
ADODB, dxDBTLCl, dxGrClms, StdCtrls, DBCtrls, Mask, wwdblook, ComCtrls,
|
|
|
bsSkinTabs, bsdbctrls, RxLookup, u_ch_add_do, u_ch_delete_do,
|
|
|
wwdbdatetimepicker, Menus, XPMenu, wwdbedit, Wwdotdot, Wwdbcomb,
|
|
|
kbmMemTable, DBCtrlsEh, cxStyles, cxCustomData, cxGraphics, cxFilter,
|
|
|
cxData, cxDataStorage, cxEdit, cxDBData, cxGridLevel, cxClasses,
|
|
|
cxControls, cxGridCustomView, cxGridCustomTableView, cxGridTableView,
|
|
|
cxGridDBTableView, cxGrid, cxNavigator, cxDBNavigator, cxCurrencyEdit,inifiles;
|
|
|
|
|
|
type
|
|
|
Tfrm_ch_invoice_shen = class(TForm)
|
|
|
bsSkinPanel2: TbsSkinPanel;
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
bsSkinButton4: TbsSkinButton;
|
|
|
bsSkinButton3: TbsSkinButton;
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
bsSkinButton8: TbsSkinButton;
|
|
|
bsSkinButton9: TbsSkinButton;
|
|
|
bsSkinButton10: TbsSkinButton;
|
|
|
bsSkinButton11: TbsSkinButton;
|
|
|
bsSkinNotebook1: TbsSkinNotebook;
|
|
|
dxDBGrid1: TdxDBGrid;
|
|
|
bsSkinButton6: TbsSkinButton;
|
|
|
t_ch_invoice_shen: TADOQuery;
|
|
|
t_ch_invoice_shen1: TDataSource;
|
|
|
dxDBGrid1Column1: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column2: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column3: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column4: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column5: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column6: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column7: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column8: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column9: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column10: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column11: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column12: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column13: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column18: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column19: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column20: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column21: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column22: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column23: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column24: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column14: TdxDBGridColumn;
|
|
|
dxDBGrid1Column15: TdxDBGridColumn;
|
|
|
dxDBGrid1Column16: TdxDBGridColumn;
|
|
|
dxDBGrid1Column17: TdxDBGridColumn;
|
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
|
bsSkinPanel3: TbsSkinPanel;
|
|
|
Label25: TLabel;
|
|
|
DBEdit14: TDBEdit;
|
|
|
Label17: TLabel;
|
|
|
DBEdit1: TDBEdit;
|
|
|
Label18: TLabel;
|
|
|
DBEdit5: TDBEdit;
|
|
|
bsSkinPageControl2: TbsSkinPageControl;
|
|
|
Label1: TLabel;
|
|
|
Label16: TLabel;
|
|
|
DBMemo3: TDBMemo;
|
|
|
bsSkinTabSheet11: TbsSkinTabSheet;
|
|
|
bsSkinTabSheet22: TbsSkinTabSheet;
|
|
|
bsSkinDBCheckRadioBox1: TbsSkinDBCheckRadioBox;
|
|
|
RxDBLookupCombo1: TRxDBLookupCombo;
|
|
|
Label12: TLabel;
|
|
|
t_ch_fee_do: TADOQuery;
|
|
|
fra_ch_delete_do1: Tfra_ch_delete_do;
|
|
|
fra_ch_add_do1: Tfra_ch_add_do;
|
|
|
XPMenu1: TXPMenu;
|
|
|
PopupMenu2: TPopupMenu;
|
|
|
N10: TMenuItem;
|
|
|
N11: TMenuItem;
|
|
|
N14: TMenuItem;
|
|
|
N13: TMenuItem;
|
|
|
N12: TMenuItem;
|
|
|
N15: TMenuItem;
|
|
|
N16: TMenuItem;
|
|
|
bsSkinButton7: TbsSkinButton;
|
|
|
PopupMenu3: TPopupMenu;
|
|
|
N17: TMenuItem;
|
|
|
N18: TMenuItem;
|
|
|
N34: TMenuItem;
|
|
|
N35: TMenuItem;
|
|
|
N36: TMenuItem;
|
|
|
N1: TMenuItem;
|
|
|
N6: TMenuItem;
|
|
|
N4: TMenuItem;
|
|
|
N5: TMenuItem;
|
|
|
wwDBComboBox1: TwwDBComboBox;
|
|
|
Label20: TLabel;
|
|
|
Label19: TLabel;
|
|
|
DBEdit7: TDBEdit;
|
|
|
RxDBLookupCombo2: TRxDBLookupCombo;
|
|
|
Label21: TLabel;
|
|
|
Label22: TLabel;
|
|
|
DBEdit3: TDBEdit;
|
|
|
dxDBGrid1Column25: TdxDBGridColumn;
|
|
|
dxDBGrid1Column26: TdxDBGridColumn;
|
|
|
bsSkinButton12: TbsSkinButton;
|
|
|
t_ch_invoice_head: TADOQuery;
|
|
|
t_ch_invoice_head1: TDataSource;
|
|
|
wwDBLookupCombo5: TwwDBLookupCombo;
|
|
|
bsSkinButton38: TbsSkinButton;
|
|
|
DBEdit8: TDBEdit;
|
|
|
memtblprint: TkbmMemTable;
|
|
|
memtblprint1: TDataSource;
|
|
|
dxDBGrid1Column27: TdxDBGridColumn;
|
|
|
bsSkinButton40: TbsSkinButton;
|
|
|
bsSkinButton41: TbsSkinButton;
|
|
|
t_msg_mold: TADOQuery;
|
|
|
DBComboBoxEh1: TDBComboBoxEh;
|
|
|
dbedt1: TDBEdit;
|
|
|
bsSkinPanel4: TbsSkinPanel;
|
|
|
Label11: TLabel;
|
|
|
DBEdit11: TDBEdit;
|
|
|
Label70: TLabel;
|
|
|
Label71: TLabel;
|
|
|
Label72: TLabel;
|
|
|
DBComboBoxEh3: TDBComboBoxEh;
|
|
|
DBComboBoxEh4: TDBComboBoxEh;
|
|
|
DBComboBoxEh5: TDBComboBoxEh;
|
|
|
Label15: TLabel;
|
|
|
DBEdit6: TDBEdit;
|
|
|
Label8: TLabel;
|
|
|
wwDBLookupCombo4: TwwDBLookupCombo;
|
|
|
Label24: TLabel;
|
|
|
DBEdit13: TDBEdit;
|
|
|
Label9: TLabel;
|
|
|
DBEdit9: TDBEdit;
|
|
|
Label3: TLabel;
|
|
|
wwDBDateTimePicker1: TwwDBDateTimePicker;
|
|
|
Label4: TLabel;
|
|
|
DBEdit4: TDBEdit;
|
|
|
Label23: TLabel;
|
|
|
DBEdit12: TDBEdit;
|
|
|
Label2: TLabel;
|
|
|
DBEdit2: TDBEdit;
|
|
|
Label6: TLabel;
|
|
|
wwDBLookupCombo2: TwwDBLookupCombo;
|
|
|
Label5: TLabel;
|
|
|
wwDBLookupCombo3: TwwDBLookupCombo;
|
|
|
Label7: TLabel;
|
|
|
wwDBLookupCombo1: TwwDBLookupCombo;
|
|
|
Label13: TLabel;
|
|
|
DBMemo1: TDBMemo;
|
|
|
Label14: TLabel;
|
|
|
DBMemo2: TDBMemo;
|
|
|
t_ch_invoice_shen_item1: TDataSource;
|
|
|
t_ch_invoice_shen_item: TADOQuery;
|
|
|
cxGrid1DBTableView1: TcxGridDBTableView;
|
|
|
cxGrid1Level1: TcxGridLevel;
|
|
|
cxGrid1: TcxGrid;
|
|
|
cxGrid1DBTableView1DBColumn1: TcxGridDBColumn;
|
|
|
cxGrid1DBTableView1DBColumn2: TcxGridDBColumn;
|
|
|
cxGrid1DBTableView1DBColumn3: TcxGridDBColumn;
|
|
|
cxGrid1DBTableView1DBColumn4: TcxGridDBColumn;
|
|
|
cxGrid1DBTableView1DBColumn5: TcxGridDBColumn;
|
|
|
cxGrid1DBTableView1DBColumn6: TcxGridDBColumn;
|
|
|
cxGrid1DBTableView1DBColumn7: TcxGridDBColumn;
|
|
|
cxGrid1DBTableView1DBColumn8: TcxGridDBColumn;
|
|
|
cxDBNavigator1: TcxDBNavigator;
|
|
|
dxDBGrid1Column28: TdxDBGridColumn;
|
|
|
dxDBGrid1Column29: TdxDBGridColumn;
|
|
|
Label10: TLabel;
|
|
|
DBEdit10: TDBEdit;
|
|
|
CheckBox1: TCheckBox;
|
|
|
bsSkinButton20: TbsSkinButton;
|
|
|
bsSkinDBCheckRadioBox2: TbsSkinDBCheckRadioBox;
|
|
|
dxDBGrid1Column30: TdxDBGridCheckColumn;
|
|
|
cxGrid1DBTableView1DBColumn9: TcxGridDBColumn;
|
|
|
Label26: TLabel;
|
|
|
DBEdit15: TDBEdit;
|
|
|
DBEdit16: TDBEdit;
|
|
|
Label27: TLabel;
|
|
|
Label28: TLabel;
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
procedure bsSkinButton11Click(Sender: TObject);
|
|
|
procedure t_ch_invoice_shenAfterInsert(DataSet: TDataSet);
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
|
procedure bsSkinButton4Click(Sender: TObject);
|
|
|
procedure bsSkinButton3Click(Sender: TObject);
|
|
|
procedure t_ch_invoice_shenBeforePost(DataSet: TDataSet);
|
|
|
procedure DBEdit9Enter(Sender: TObject);
|
|
|
procedure t_ch_invoice_shenBeforeEdit(DataSet: TDataSet);
|
|
|
procedure bsSkinButton6Click(Sender: TObject);
|
|
|
procedure t_ch_invoice_shenAfterPost(DataSet: TDataSet);
|
|
|
procedure RxDBLookupCombo1Enter(Sender: TObject);
|
|
|
procedure dxDBGrid1Column2CustomDraw(Sender: TObject; ACanvas: TCanvas;
|
|
|
ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn;
|
|
|
const AText: String; AFont: TFont; var AColor: TColor; ASelected,
|
|
|
AFocused: Boolean; var ADone: Boolean);
|
|
|
procedure DBEdit1Change(Sender: TObject);
|
|
|
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
|
|
procedure bsSkinButton9Click(Sender: TObject);
|
|
|
procedure bsSkinButton8Click(Sender: TObject);
|
|
|
procedure bsSkinButton10Click(Sender: TObject);
|
|
|
procedure t_ch_invoice_shenAfterDelete(DataSet: TDataSet);
|
|
|
procedure DBEdit14KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure DBEdit1KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure RxDBLookupCombo1KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure bsSkinDBCheckRadioBox1KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
procedure DBEdit2KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure DBEdit4KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure wwDBLookupCombo3KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure wwDBLookupCombo2KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure wwDBLookupCombo1KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure wwDBLookupCombo4KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure DBEdit9KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure DBEdit10KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure DBEdit11KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure RxDBLookupCombo1Change(Sender: TObject);
|
|
|
procedure wwDBDateTimePicker1KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure N10Click(Sender: TObject);
|
|
|
procedure N14Click(Sender: TObject);
|
|
|
procedure N12Click(Sender: TObject);
|
|
|
procedure N16Click(Sender: TObject);
|
|
|
procedure dxDBGrid1ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
procedure bsSkinPanel2Resize(Sender: TObject);
|
|
|
procedure bsSkinButton7Click(Sender: TObject);
|
|
|
procedure N17Click(Sender: TObject);
|
|
|
procedure N34Click(Sender: TObject);
|
|
|
procedure N36Click(Sender: TObject);
|
|
|
procedure N6Click(Sender: TObject);
|
|
|
procedure N4Click(Sender: TObject);
|
|
|
procedure DBEdit7KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure RxDBLookupCombo2KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure DBEdit5KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure wwDBComboBox1KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure DBEdit3KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure bsSkinButton12Click(Sender: TObject);
|
|
|
procedure wwDBLookupCombo5KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure bsSkinButton38Click(Sender: TObject);
|
|
|
procedure DBEdit8Change(Sender: TObject);
|
|
|
procedure bsSkinPageControl2Change(Sender: TObject);
|
|
|
procedure fra_ch_add_do1bsSkinButton8Click(Sender: TObject);
|
|
|
procedure FormCreate(Sender: TObject);
|
|
|
procedure fra_ch_add_do1N1Click(Sender: TObject);
|
|
|
procedure t_msg_moldAfterInsert(DataSet: TDataSet);
|
|
|
procedure bsSkinButton40Click(Sender: TObject);
|
|
|
procedure bsSkinButton41Click(Sender: TObject);
|
|
|
procedure DBComboBoxEh3CloseUp(Sender: TObject; Accept: Boolean);
|
|
|
procedure DBComboBoxEh4CloseUp(Sender: TObject; Accept: Boolean);
|
|
|
procedure DBComboBoxEh5CloseUp(Sender: TObject; Accept: Boolean);
|
|
|
procedure DBComboBoxEh3DropDown(Sender: TObject);
|
|
|
procedure DBComboBoxEh4DropDown(Sender: TObject);
|
|
|
procedure DBComboBoxEh5DropDown(Sender: TObject);
|
|
|
procedure wwDBLookupCombo5Change(Sender: TObject);
|
|
|
procedure RxDBLookupCombo2Change(Sender: TObject);
|
|
|
procedure DBComboBoxEh1DropDown(Sender: TObject);
|
|
|
procedure DBComboBoxEh1CloseUp(Sender: TObject; Accept: Boolean);
|
|
|
procedure DBComboBoxEh1KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure dbedt1KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure DBComboBoxEh1Change(Sender: TObject);
|
|
|
procedure t_ch_invoice_shen_itemBeforePost(DataSet: TDataSet);
|
|
|
procedure t_ch_invoice_shen_itemNewRecord(DataSet: TDataSet);
|
|
|
procedure fra_ch_add_do1MenuItem1Click(Sender: TObject);
|
|
|
procedure t_ch_invoice_shen_itemBeforeEdit(DataSet: TDataSet);
|
|
|
procedure CheckBox1Click(Sender: TObject);
|
|
|
procedure bsSkinButton20Click(Sender: TObject);
|
|
|
procedure dxDBGrid1Column30CustomDraw(Sender: TObject;
|
|
|
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
|
|
|
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
|
|
|
var AColor: TColor; ASelected, AFocused: Boolean;
|
|
|
var ADone: Boolean);
|
|
|
procedure t_ch_invoice_shen_itemAfterPost(DataSet: TDataSet);
|
|
|
procedure t_ch_invoice_shen_itemBeforeInsert(DataSet: TDataSet);
|
|
|
private
|
|
|
procedure t_ch_invoice_shenFieldChange(Sender: TField);
|
|
|
procedure t_ch_invoice_shenKHFieldChange(Sender: TField);
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
MblNo:string;
|
|
|
procedure t_ch_invoice_shen_itemvatPriceFieldChange(Sender: TField);
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
ch_invoice_shen_open:boolean;
|
|
|
frm_ch_invoice_shen: Tfrm_ch_invoice_shen;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_main, my_sys_function, u_ch_shen_query, u_data_share, my_sys_chat,u_msg_mold;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.FormClose(Sender: TObject;
|
|
|
var Action: TCloseAction);
|
|
|
begin
|
|
|
ch_invoice_shen_open:=false;
|
|
|
savereggrid(dxdbgrid1,caption);
|
|
|
|
|
|
savereggrid(fra_ch_delete_do1.dxDBGrid9,caption+'9');
|
|
|
savereggrid(fra_ch_add_do1.dxDBGrid19,caption+'19');
|
|
|
savereggrid(fra_ch_add_do1.dxDBGrid17,caption+'17');
|
|
|
|
|
|
frm_ch_invoice_shen.Hide;
|
|
|
frm_ch_invoice_shen.ManualFloat(frm_ch_invoice_shen.BoundsRect );
|
|
|
frm_main.freeTabs('frm_ch_invoice_shen');
|
|
|
action:=cafree;
|
|
|
frm_ch_invoice_shen:=nil;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.FormShow(Sender: TObject);
|
|
|
var inifile1:Tinifile;
|
|
|
begin
|
|
|
inifile1:=Tinifile.Create(ExtractFilePath(application.ExeName)+'main.ini');
|
|
|
bsSkinPanel4.Visible:=inifile1.Readbool('other','invoicedsp',True);
|
|
|
CheckBox1.Checked:=inifile1.Readbool('other','invoicedsp',True);
|
|
|
inifile1.free;
|
|
|
|
|
|
|
|
|
if MBLNO<>'' then
|
|
|
fra_ch_add_do1.Edit34.text:=MBLNO;
|
|
|
// bsSkinNotebook1.PageIndex:=0;
|
|
|
|
|
|
{
|
|
|
ch_invoice_shen_open:=true;
|
|
|
t_ch_invoice_shen.Close;
|
|
|
t_ch_invoice_shen.SQL.clear;
|
|
|
t_ch_invoice_shen.SQL.Add('select * from t_ch_invoice_shen where <20><><EFBFBD><EFBFBD>״̬ not in ('+''''+'<27><><EFBFBD><D7BC>Ʊ'+''''
|
|
|
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ'+''''+') and '
|
|
|
+open_data('1001','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','no','no','no','no')
|
|
|
+'order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> desc');
|
|
|
t_ch_invoice_shen.open;
|
|
|
// t_ch_fee_do.open;
|
|
|
t_ch_invoice_head.open;
|
|
|
|
|
|
//<2F><>ҵ<EFBFBD><D2B5><EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD>
|
|
|
if StrToBool(get_parameters_value(85,'false')) then begin
|
|
|
fra_ch_add_do1.bsSkinTabSheet1.TabVisible:=False;
|
|
|
fra_ch_add_do1.bsSkinTabSheet2.TabVisible:=False;
|
|
|
fra_ch_add_do1.bsSkinTabSheet3.TabVisible:=False;
|
|
|
fra_ch_add_do1.bsSkinTabSheet4.TabVisible:=False;
|
|
|
fra_ch_add_do1.bsSkinTabSheet5.TabVisible:=True;
|
|
|
fra_ch_add_do1.bsSkinPageControl1.TabIndex:=0;
|
|
|
fra_ch_delete_do1.bsSkinTabSheet1.TabVisible:=false;
|
|
|
fra_ch_delete_do1.bsSkinTabSheet2.TabVisible:=false;
|
|
|
fra_ch_delete_do1.bsSkinTabSheet3.TabVisible:=false;
|
|
|
fra_ch_delete_do1.bsSkinTabSheet4.TabVisible:=false;
|
|
|
fra_ch_delete_do1.bsSkinTabSheet5.TabVisible:=True;
|
|
|
fra_ch_delete_do1.bsSkinPageControl1.ActivePage:=fra_ch_delete_do1.bsSkinTabSheet5;
|
|
|
|
|
|
end else begin
|
|
|
fra_ch_add_do1.bsSkinTabSheet1.TabVisible:=True;
|
|
|
fra_ch_add_do1.bsSkinTabSheet2.TabVisible:=True;
|
|
|
fra_ch_add_do1.bsSkinTabSheet3.TabVisible:=True;
|
|
|
fra_ch_add_do1.bsSkinTabSheet4.TabVisible:=True;
|
|
|
fra_ch_add_do1.bsSkinPageControl1.ActivePage:=fra_ch_add_do1.bsSkinTabSheet1;
|
|
|
fra_ch_add_do1.bsSkinTabSheet5.TabVisible:=False;
|
|
|
|
|
|
fra_ch_delete_do1.bsSkinTabSheet1.TabVisible:=True;
|
|
|
fra_ch_delete_do1.bsSkinTabSheet2.TabVisible:=True;
|
|
|
fra_ch_delete_do1.bsSkinTabSheet3.TabVisible:=True;
|
|
|
fra_ch_delete_do1.bsSkinTabSheet4.TabVisible:=True;
|
|
|
fra_ch_delete_do1.bsSkinTabSheet5.TabVisible:=false;
|
|
|
fra_ch_delete_do1.bsSkinPageControl1.ActivePage:=fra_ch_delete_do1.bsSkinTabSheet1;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
fra_ch_add_do1.do_ban1.DataSet:=t_ch_invoice_shen;
|
|
|
fra_ch_add_do1.bs_text.text:='7';
|
|
|
fra_ch_add_do1.wwDBComboBox31.text:='<27><>';
|
|
|
fra_ch_add_do1.t_ch_fee_do.open;
|
|
|
fra_ch_add_do1.bsSkinCheckRadioBox4.Checked:=False;
|
|
|
fra_ch_add_do1.bsSkinPanel9.Visible:=true;
|
|
|
|
|
|
//<2F><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD><DDBC><EFBFBD><EFBFBD><EFBFBD>
|
|
|
if StrToBool(get_parameters_value(85,'false')) then begin
|
|
|
fra_ch_delete_do1.v_fee_do_bscard.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_bscard.sql.add('select * from v_fee_do_bscard '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_bscard.DataSource:=t_ch_invoice_shen1;
|
|
|
fra_ch_delete_do1.v_fee_do_bscard.Open;
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_bscard_sum.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_bscard_sum.sql.add('select SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7) AS <20>·<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD>,sum(ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>) as ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD> from v_fee_do_bscard '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> group by SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD> '
|
|
|
+'order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),ԭʼ<D4AD>ұ<EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_bscard_sum.DataSource:=t_ch_invoice_shen1;
|
|
|
fra_ch_delete_do1.v_fee_do_bscard_sum.Open;
|
|
|
end else begin
|
|
|
fra_ch_delete_do1.v_fee_do_seae.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_seae.sql.add('select * from v_fee_do_seae '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_seae.DataSource:=t_ch_invoice_shen1;
|
|
|
fra_ch_delete_do1.v_fee_do_seae.Open;
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_seai.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_seai.sql.add('select * from v_fee_do_seai '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_seai.DataSource:=t_ch_invoice_shen1;
|
|
|
fra_ch_delete_do1.v_fee_do_seai.Open;
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_aire.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_aire.sql.add('select * from v_fee_do_aire '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_aire.DataSource:=t_ch_invoice_shen1;
|
|
|
fra_ch_delete_do1.v_fee_do_aire.Open;
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_airi.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_airi.sql.add('select * from v_fee_do_airi '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_airi.DataSource:=t_ch_invoice_shen1;
|
|
|
fra_ch_delete_do1.v_fee_do_airi.Open;
|
|
|
|
|
|
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_seae_sum.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_seae_sum.sql.add('select SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7) AS <20>·<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD>,sum(ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>) as ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD> from v_fee_do_seae '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> group by SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD> '
|
|
|
+'order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),ԭʼ<D4AD>ұ<EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_seae_sum.DataSource:=t_ch_invoice_shen1;
|
|
|
fra_ch_delete_do1.v_fee_do_seae_sum.Open;
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_seai_sum.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_seai_sum.sql.add('select SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7) AS <20>·<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD>,sum(ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>) as ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD> from v_fee_do_seai '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> group by SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD> '
|
|
|
+'order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),ԭʼ<D4AD>ұ<EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_seai_sum.DataSource:=t_ch_invoice_shen1;
|
|
|
fra_ch_delete_do1.v_fee_do_seai_sum.Open;
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_aire_sum.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_aire_sum.sql.add('select SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7) AS <20>·<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD>,sum(ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>) as ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD> from v_fee_do_aire '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> group by SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD> '
|
|
|
+'order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),ԭʼ<D4AD>ұ<EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_aire_sum.DataSource:=t_ch_invoice_shen1;
|
|
|
fra_ch_delete_do1.v_fee_do_aire_sum.Open;
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_airi_sum.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_airi_sum.sql.add('select SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7) AS <20>·<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD>,sum(ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>) as ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD> from v_fee_do_airi '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> group by SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD> '
|
|
|
+'order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),ԭʼ<D4AD>ұ<EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_airi_sum.DataSource:=t_ch_invoice_shen1;
|
|
|
fra_ch_delete_do1.v_fee_do_airi_sum.Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
fra_ch_delete_do1.bs_text.Text:='7';
|
|
|
fra_ch_delete_do1.do_ban1.DataSet:=t_ch_invoice_shen;
|
|
|
|
|
|
t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').OnChange:=t_ch_invoice_shenFieldChange;
|
|
|
t_ch_invoice_shen.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').OnChange:=t_ch_invoice_shenKHFieldChange;
|
|
|
|
|
|
loadreggrid(dxdbgrid1,false,caption);
|
|
|
frm_data_share.t_crm_client_all.requery;
|
|
|
frm_data_share.t_code_currency.requery;
|
|
|
}
|
|
|
|
|
|
|
|
|
if strtobool(get_parameters_value(322,'false')) then
|
|
|
begin
|
|
|
DBEdit16.Enabled:=false;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
DBEdit16.Enabled:=true
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.bsSkinButton11Click(Sender: TObject);
|
|
|
var
|
|
|
answer:TModalResult;
|
|
|
begin
|
|
|
if bsSkinButton11.Caption='<27>༭<EFBFBD><EFBFBD>' then
|
|
|
begin
|
|
|
if t_ch_invoice_shen.IsEmpty then
|
|
|
exit;
|
|
|
bsSkinNotebook1.PageIndex:=1;
|
|
|
bsSkinButton11.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>';
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if (t_ch_invoice_shen.State=dsinsert)or(t_ch_invoice_shen.State=dsedit) then
|
|
|
BEGIN
|
|
|
answer:=messagedlg( '<27><><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE>ģ<DEB8><C4A3>Ƿ棿',mtWarning,mbYesNoCancel,0);
|
|
|
if answer=mrYes then
|
|
|
begin
|
|
|
t_ch_invoice_shen.post;
|
|
|
end;
|
|
|
if answer=mrNo then
|
|
|
begin
|
|
|
t_ch_invoice_shen.cancel;
|
|
|
end;
|
|
|
if answer=mrCancel then
|
|
|
begin
|
|
|
exit;
|
|
|
end;
|
|
|
END;
|
|
|
bsSkinNotebook1.PageIndex:=0;
|
|
|
bsSkinButton11.Caption:='<27>༭<EFBFBD><EFBFBD>';
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.t_ch_invoice_shenAfterInsert(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD>״̬']:='<27><><EFBFBD>뿪Ʊ';
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=employee;
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=now;
|
|
|
t_ch_invoice_shen['<27>Զ<EFBFBD>']:=1;
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=0;
|
|
|
t_ch_invoice_shen['<27>ұ<EFBFBD>']:='RMB';
|
|
|
t_ch_invoice_shen['ʵ<>ʽ<EFBFBD><CABD><EFBFBD>']:=0;
|
|
|
t_ch_invoice_shen['<27>鿪<EFBFBD><E9BFAA><EFBFBD><EFBFBD>']:=0;
|
|
|
t_ch_invoice_shen['<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>']:=0;
|
|
|
t_ch_invoice_shen['˰<><CBB0>']:=0;
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='ʵ<>ʿ<EFBFBD>Ʊ';
|
|
|
// t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=get_no(date,'IA');
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.bsSkinButton1Click(Sender: TObject);
|
|
|
begin
|
|
|
t_ch_invoice_shen.insert;
|
|
|
bsSkinNotebook1.PageIndex:=1;
|
|
|
bsSkinPageControl2.ActivePage:=bsSkinTabSheet11;
|
|
|
bsSkinButton11.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>';
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.bsSkinButton2Click(Sender: TObject);
|
|
|
begin
|
|
|
table_post(t_ch_invoice_shen);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.bsSkinButton4Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_ch_invoice_shen.IsEmpty then
|
|
|
exit;
|
|
|
if (t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><><EFBFBD><D7BC>Ʊ')or
|
|
|
(t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><>ֹ<EFBFBD><EFBFBD>')or
|
|
|
(t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ')or
|
|
|
(t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring='<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>')or
|
|
|
(t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')then
|
|
|
begin
|
|
|
showmessage('<27><>ǰҵ<C7B0><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
if application.MessageBox('<27><>ȷ<EFBFBD><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?','<27><><EFBFBD><EFBFBD>:',MB_OKCANCEL)=IDOK then
|
|
|
begin
|
|
|
t_ch_fee_do.open;
|
|
|
while not t_ch_fee_do.eof do
|
|
|
t_ch_fee_do.delete;
|
|
|
t_ch_fee_do.close;
|
|
|
|
|
|
t_ch_invoice_shen_item.open;
|
|
|
while not t_ch_invoice_shen_item.eof do
|
|
|
t_ch_invoice_shen_item.delete;
|
|
|
t_ch_invoice_shen_item.close;
|
|
|
|
|
|
if bsSkinPageControl2.ActivePage<>bsSkinTabSheet11 then
|
|
|
bsSkinPageControl2.ActivePage:=bsSkinTabSheet11;
|
|
|
t_ch_invoice_shen.Delete;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.bsSkinButton3Click(Sender: TObject);
|
|
|
begin
|
|
|
table_cancel(t_ch_invoice_shen);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.t_ch_invoice_shenBeforePost(
|
|
|
DataSet: TDataSet);
|
|
|
var aAdoQuery :TAdoQuery;
|
|
|
s:string;
|
|
|
begin
|
|
|
table_before_post(t_ch_invoice_shen,'<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
table_before_post(t_ch_invoice_shen,'<27>ұ<EFBFBD>');
|
|
|
table_before_post(t_ch_invoice_shen,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
|
if (t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring<>'ʵ<>ʿ<EFBFBD>Ʊ')
|
|
|
and(t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring<>'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ')
|
|
|
and(t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring<>'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ')then
|
|
|
begin
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB>Ϊ<EFBFBD><CEAA>ʵ<EFBFBD>ʿ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>');
|
|
|
abort;
|
|
|
end;
|
|
|
|
|
|
if (t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ')then
|
|
|
begin
|
|
|
if (t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>').asstring='') then
|
|
|
begin
|
|
|
showmessage('<27><>ƱΪ<C6B1><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD>');
|
|
|
abort;
|
|
|
end;
|
|
|
end;
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=s_w(strtoint(apointnum),t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']);
|
|
|
t_ch_invoice_shen['ʵ<>ʽ<EFBFBD><CABD><EFBFBD>']:=s_w(strtoint(apointnum),t_ch_invoice_shen['ʵ<>ʽ<EFBFBD><CABD><EFBFBD>']);
|
|
|
t_ch_invoice_shen['<27>鿪<EFBFBD><E9BFAA><EFBFBD><EFBFBD>']:=s_w(strtoint(apointnum),t_ch_invoice_shen['<27>鿪<EFBFBD><E9BFAA><EFBFBD><EFBFBD>']);
|
|
|
|
|
|
if (t_ch_invoice_shen.state=dsinsert) and (trim(t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)='') then
|
|
|
begin
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=get_no(date,'IA');
|
|
|
end;
|
|
|
|
|
|
|
|
|
if t_ch_invoice_shen.FieldByName('<27>Զ<EFBFBD>').asboolean then
|
|
|
begin
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_ch_invoice_shen['ʵ<>ʽ<EFBFBD><CABD><EFBFBD>'];
|
|
|
end;
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD>״̬']:=t_ch_invoice_shen['<27><><EFBFBD><EFBFBD>״̬'];
|
|
|
t_ch_invoice_shen['<27>鿪<EFBFBD><E9BFAA><EFBFBD><EFBFBD>']:=t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']-t_ch_invoice_shen['ʵ<>ʽ<EFBFBD><CABD><EFBFBD>'];
|
|
|
add_zero(DBMemo2);
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>']:=DBMemo2.text;
|
|
|
{
|
|
|
if total_num(DBMemo2)<>t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'] then
|
|
|
begin
|
|
|
if MessageDlg('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1>ĺϼƽ<CFBC><C6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EEB2BB><D2BB>,ȷ<><C8B7>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?',mtWarning,[mbyes,mbno],0)=mrno then
|
|
|
abort;
|
|
|
end;
|
|
|
}
|
|
|
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
with aAdoQuery do
|
|
|
try
|
|
|
close;
|
|
|
SQL.clear;
|
|
|
sql.add('select ');
|
|
|
sql.Add('sum(case when <20><><EFBFBD><EFBFBD>=''<27><>'' and ԭʼ<D4AD>ұ<EFBFBD>=''RMB'' then ԭʼ<D4AD><CABC><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
sql.Add(',sum(case when <20><><EFBFBD><EFBFBD>=''<27><>'' and ԭʼ<D4AD>ұ<EFBFBD><>''RMB'' then ԭʼ<D4AD><CABC><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
sql.Add(',sum(case when <20><><EFBFBD><EFBFBD>=''<27><>'' and ԭʼ<D4AD>ұ<EFBFBD>=''RMB'' then ԭʼ<D4AD><CABC><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
sql.Add(',sum(case when <20><><EFBFBD><EFBFBD>=''<27><>'' and ԭʼ<D4AD>ұ<EFBFBD><>''RMB'' then ԭʼ<D4AD><CABC><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
sql.Add('from v_fee_do_bscard ');
|
|
|
sql.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ');
|
|
|
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
Open;First;
|
|
|
t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').value:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat-FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>').value:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat-FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
finally
|
|
|
Free;
|
|
|
end;
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
s:='';
|
|
|
t_msg_mold.Close;
|
|
|
t_msg_mold.sql.text:='select * from t_sys_msgmold where <20><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>=''<27><><EFBFBD>Ʊģ<C6B1><C4A3>'' ';
|
|
|
t_msg_mold.open;
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
with aAdoQuery do
|
|
|
try
|
|
|
close;
|
|
|
SQL.clear;
|
|
|
sql.add('select <20><><EFBFBD><EFBFBD>,ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,ί<>б<EFBFBD><D0B1><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ж<><D0B6><EFBFBD><EFBFBD>,Ŀ<>ĵ<EFBFBD>,װ<><D7B0><EFBFBD><EFBFBD>,<2C><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,<2C><>ͬ<EFBFBD><CDAC>');
|
|
|
sql.Add(',sum(case when ԭʼ<D4AD>ұ<EFBFBD>=''RMB'' then ԭʼ<D4AD><CABC><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
sql.Add(',sum(case when ԭʼ<D4AD>ұ<EFBFBD><>''RMB'' then ԭʼ<D4AD><CABC><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD>');
|
|
|
sql.Add('from v_fee_do_bscard ');
|
|
|
sql.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ');
|
|
|
sql.Add('Group by <20><><EFBFBD><EFBFBD>,ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,ί<>б<EFBFBD><D0B1><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ж<><D0B6><EFBFBD><EFBFBD>,Ŀ<>ĵ<EFBFBD>,װ<><D7B0><EFBFBD><EFBFBD>,<2C><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,<2C><>ͬ<EFBFBD><CDAC>');
|
|
|
sql.Add('order by <20><><EFBFBD><EFBFBD>,ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,ί<>б<EFBFBD><D0B1><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ж<><D0B6><EFBFBD><EFBFBD>,Ŀ<>ĵ<EFBFBD>,װ<><D7B0><EFBFBD><EFBFBD>,<2C><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,<2C><>ͬ<EFBFBD><CDAC>');
|
|
|
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
Open;First;
|
|
|
while not eof do
|
|
|
begin
|
|
|
if Trim(s)='' then
|
|
|
s:=getstrfromdataset(aAdoQuery,t_msg_mold.fieldbyname('ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)
|
|
|
else
|
|
|
s:=s+#13#10+getstrfromdataset(aAdoQuery,t_msg_mold.fieldbyname('ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)+' ';
|
|
|
Next;
|
|
|
end;
|
|
|
t_ch_invoice_shen.FieldByName('<27><>ע').AsString:=s+#13#10+'USD '+t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
finally
|
|
|
Free;
|
|
|
end;
|
|
|
|
|
|
}
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.DBEdit9Enter(Sender: TObject);
|
|
|
begin
|
|
|
if bsSkinDBCheckRadioBox1.Checked then
|
|
|
DBEdit9.ReadOnly:=true
|
|
|
else
|
|
|
DBEdit9.ReadOnly:=false;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.t_ch_invoice_shenBeforeEdit(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
if not modify_all then
|
|
|
begin
|
|
|
if (t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><><EFBFBD><D7BC>Ʊ')or
|
|
|
(t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><>ֹ<EFBFBD><EFBFBD>')or
|
|
|
(t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ')or
|
|
|
(t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring='<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>')or
|
|
|
(t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')then
|
|
|
begin
|
|
|
showmessage('<27><>ǰҵ<C7B0><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
abort;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.bsSkinButton6Click(Sender: TObject);
|
|
|
var aAdoQuery:TAdoQuery;
|
|
|
str:string;
|
|
|
begin
|
|
|
if t_ch_invoice_shen.IsEmpty then
|
|
|
exit;
|
|
|
|
|
|
if t_ch_invoice_shen_item.State in [dsedit,dsinsert] then t_ch_invoice_shen_item.Post;
|
|
|
table_post(t_ch_invoice_shen);
|
|
|
|
|
|
if t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString='<27><><EFBFBD>뿪Ʊ' then
|
|
|
begin
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
with aAdoQuery do
|
|
|
try
|
|
|
close;
|
|
|
SQL.clear;
|
|
|
sql.add('select (sum(case when <20><><EFBFBD><EFBFBD>=''<27><>'' then <20><><EFBFBD><EFBFBD> else 0 end) -sum(case when <20><><EFBFBD><EFBFBD>=''<27><>'' then <20><><EFBFBD><EFBFBD> else 0 end) ) <20><><EFBFBD><EFBFBD>');
|
|
|
sql.add(' from v_fee_do_bscard');
|
|
|
sql.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
Open;First;
|
|
|
if s_w(2,fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat)<> s_w(2,t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat) then
|
|
|
begin
|
|
|
if MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEB2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>'+#13#10+#13#10+'ȷʵҪ<CAB5>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)<>mryes then
|
|
|
Exit
|
|
|
else
|
|
|
begin
|
|
|
modify_all:=true;
|
|
|
try
|
|
|
str:=trim(InputBox('<27><><EFBFBD><EFBFBD><EFBFBD>벻<EFBFBD><EBB2BB><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD>', 'ԭ<><D4AD>', ''));
|
|
|
if str=''then
|
|
|
begin
|
|
|
showmessage('ԭ<><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD>');
|
|
|
exit;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_ch_invoice_shen.Edit;
|
|
|
t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD>').AsString:=str;
|
|
|
t_ch_invoice_shen.post;
|
|
|
t_ch_invoice_shen.Refresh;
|
|
|
end;
|
|
|
finally
|
|
|
modify_all:=false;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
Free;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
if t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString='<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>' then
|
|
|
begin
|
|
|
modify_all:=true;
|
|
|
try
|
|
|
t_ch_invoice_shen.Edit;
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD>״̬']:='<27><><EFBFBD>뿪Ʊ';
|
|
|
t_ch_invoice_shen.post;
|
|
|
t_ch_invoice_shen.Refresh;
|
|
|
finally
|
|
|
modify_all:=false;
|
|
|
end;
|
|
|
end else begin
|
|
|
shen_update(t_ch_invoice_shen);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.t_ch_invoice_shenAfterPost(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
case delete_do_type_num of
|
|
|
1:
|
|
|
begin
|
|
|
if fra_ch_delete_do1.v_fee_do_seae.active then begin
|
|
|
fra_ch_delete_do1.v_fee_do_seae.Requery;
|
|
|
fra_ch_delete_do1.v_fee_do_seae_sum.Requery;
|
|
|
end;
|
|
|
end;
|
|
|
2:
|
|
|
begin
|
|
|
if fra_ch_delete_do1.v_fee_do_seai.active then begin
|
|
|
fra_ch_delete_do1.v_fee_do_seai.Requery;
|
|
|
fra_ch_delete_do1.v_fee_do_seai_sum.Requery;
|
|
|
end;
|
|
|
end;
|
|
|
3:
|
|
|
begin
|
|
|
if fra_ch_delete_do1.v_fee_do_aire.active then begin
|
|
|
fra_ch_delete_do1.v_fee_do_aire.Requery;
|
|
|
fra_ch_delete_do1.v_fee_do_aire_sum.Requery;
|
|
|
end;
|
|
|
end;
|
|
|
4:
|
|
|
begin
|
|
|
if fra_ch_delete_do1.v_fee_do_airi.active then begin
|
|
|
fra_ch_delete_do1.v_fee_do_airi.Requery;
|
|
|
fra_ch_delete_do1.v_fee_do_airi_sum.Requery;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
5:
|
|
|
begin
|
|
|
if fra_ch_delete_do1.v_fee_do_bscard.active then
|
|
|
begin
|
|
|
fra_ch_delete_do1.v_fee_do_bscard.Requery;
|
|
|
fra_ch_delete_do1.v_fee_do_bscard_sum.Requery;
|
|
|
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
if t_ch_invoice_shen_item.active then
|
|
|
begin
|
|
|
t_ch_invoice_shen_item.Requery;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_ch_invoice_shen_item.Open;
|
|
|
t_ch_invoice_shen_item.Requery;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.RxDBLookupCombo1Enter(Sender: TObject);
|
|
|
begin
|
|
|
if StrToBool(get_parameters_value(85,'false')) then
|
|
|
begin
|
|
|
if fra_ch_delete_do1.v_fee_do_bscard.IsEmpty then
|
|
|
begin
|
|
|
RxDBLookupCombo1.ReadOnly:=false;
|
|
|
wwDBLookupCombo4.ReadOnly:=false;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
RxDBLookupCombo1.ReadOnly:=true;
|
|
|
wwDBLookupCombo4.ReadOnly:=true;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if fra_ch_delete_do1.v_fee_do_seae.IsEmpty and fra_ch_delete_do1.v_fee_do_seai.IsEmpty
|
|
|
and fra_ch_delete_do1.v_fee_do_aire.IsEmpty and fra_ch_delete_do1.v_fee_do_airi.IsEmpty then
|
|
|
begin
|
|
|
RxDBLookupCombo1.ReadOnly:=false;
|
|
|
wwDBLookupCombo4.ReadOnly:=false;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
RxDBLookupCombo1.ReadOnly:=true;
|
|
|
wwDBLookupCombo4.ReadOnly:=true;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.dxDBGrid1Column2CustomDraw(Sender: TObject;
|
|
|
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
|
|
|
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
|
|
|
var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean);
|
|
|
begin
|
|
|
if (ANode.strings[dxDBGrid1Column2.Index]='<27><><EFBFBD>뿪Ʊ')or
|
|
|
(ANode.strings[dxDBGrid1Column2.Index]='<27><><EFBFBD><EFBFBD>') then
|
|
|
AColor :=clwhite
|
|
|
else if (ANode.strings[dxDBGrid1Column2.Index]='<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>')or
|
|
|
(ANode.strings[dxDBGrid1Column2.Index]='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') then
|
|
|
AColor :=clyellow
|
|
|
else if (ANode.strings[dxDBGrid1Column2.Index]='<27><>ֹ<EFBFBD><EFBFBD>')or
|
|
|
(ANode.strings[dxDBGrid1Column2.Index]='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')then
|
|
|
AColor :=clred
|
|
|
else if (ANode.strings[dxDBGrid1Column2.Index]='<27><><EFBFBD><D7BC>Ʊ')or
|
|
|
(ANode.strings[dxDBGrid1Column2.Index]='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') then
|
|
|
AColor :=$00DDF21C;
|
|
|
|
|
|
AFont.Color:=clblack;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.DBEdit1Change(Sender: TObject);
|
|
|
begin
|
|
|
if (DBEdit1.Text='') or (DBEdit1.Text='<27><><EFBFBD>뿪Ʊ') or
|
|
|
(DBEdit1.Text='<27><><EFBFBD><EFBFBD>')then
|
|
|
DBEdit1.Color:=clwhite
|
|
|
else if (DBEdit1.Text='<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>') or (DBEdit1.Text='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') then
|
|
|
DBEdit1.Color:=clyellow
|
|
|
else if (DBEdit1.Text='<27><>ֹ<EFBFBD><EFBFBD>') or (DBEdit1.Text='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') then
|
|
|
DBEdit1.Color:=clred
|
|
|
else if (DBEdit1.Text='<27><><EFBFBD><D7BC>Ʊ') or (DBEdit1.Text='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') then
|
|
|
DBEdit1.Color:=$00DDF21C;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.FormCloseQuery(Sender: TObject;
|
|
|
var CanClose: Boolean);
|
|
|
begin
|
|
|
CanClose:=frm_close_query(t_ch_invoice_shen);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.bsSkinButton9Click(Sender: TObject);
|
|
|
var
|
|
|
aQuery:TAdoQuery;
|
|
|
strbs,strwt,strmb:WideString;
|
|
|
|
|
|
begin
|
|
|
if t_ch_invoice_shen.IsEmpty then
|
|
|
exit;
|
|
|
table_post(t_ch_invoice_shen);
|
|
|
//<2F><>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>
|
|
|
try
|
|
|
modify_all:=true;
|
|
|
t_ch_invoice_shen.Edit;
|
|
|
t_ch_invoice_shen.FieldByName('<27><>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>').AsInteger:=t_ch_invoice_shen.FieldByName('<27><>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>').AsInteger+1;
|
|
|
t_ch_invoice_shen.post;
|
|
|
finally
|
|
|
modify_all:=false;
|
|
|
end;
|
|
|
|
|
|
//ί<>б<EFBFBD><D0B1>š<EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD>š<EFBFBD><C5A1><EFBFBD><EFBFBD>ᵥ<EFBFBD><E1B5A5><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>
|
|
|
memtblprint.close;
|
|
|
memtblprint.Open;
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
with aQuery do begin
|
|
|
Close;SQL.Clear;
|
|
|
sql.Add('select distinct ί<>б<EFBFBD><D0B1><EFBFBD>,ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>ᵥ<EFBFBD><E1B5A5> from v_op_bscard where <20><><EFBFBD><EFBFBD> in (select ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_fee_do where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']+''')');
|
|
|
Open;
|
|
|
first;
|
|
|
while not eof do begin
|
|
|
if strwt='' then
|
|
|
strwt:=fieldbyname('ί<>б<EFBFBD><D0B1><EFBFBD>').AsString
|
|
|
else
|
|
|
strwt:=strwt+'/'+fieldbyname('ί<>б<EFBFBD><D0B1><EFBFBD>').AsString;
|
|
|
if strbs='' then
|
|
|
strbs:=fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString
|
|
|
else
|
|
|
strbs:=strbs+'/'+fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
|
|
|
if strmb='' then
|
|
|
strmb:=fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString
|
|
|
else
|
|
|
strmb:=strmb+'/'+fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString;
|
|
|
Next;
|
|
|
end;
|
|
|
memtblprint.Edit;
|
|
|
memtblprint.fieldbyname('bsno').AsString:=strbs;
|
|
|
memtblprint.fieldbyname('wtno').AsString:=strwt;
|
|
|
memtblprint.fieldbyname('mblno').AsString:=strmb;
|
|
|
memtblprint.post;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
|
|
|
if StrToBool(get_parameters_value(85,'false')) then begin
|
|
|
sys_print('ҵ<><D2B5><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>',2,t_ch_invoice_shen1,memtblprint1,nil,nil,fra_ch_delete_do1.v_fee_do_bscard1,nil,nil,nil,fra_ch_delete_do1.v_fee_do_bscard1,t_ch_invoice_shen1,nil);
|
|
|
end else begin
|
|
|
sys_print('ҵ<><D2B5><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>',2,t_ch_invoice_shen1,memtblprint1,nil,nil,fra_ch_delete_do1.v_fee_do_seae1,fra_ch_delete_do1.v_fee_do_seai1,fra_ch_delete_do1.v_fee_do_aire1,fra_ch_delete_do1.v_fee_do_airi1,nil,t_ch_invoice_shen1,nil);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.bsSkinButton8Click(Sender: TObject);
|
|
|
var
|
|
|
str:string;
|
|
|
begin
|
|
|
if t_ch_invoice_shen.IsEmpty then
|
|
|
exit;
|
|
|
if (t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='ʵ<>ʿ<EFBFBD>Ʊ')then
|
|
|
begin
|
|
|
shen_modify(t_ch_invoice_shen);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if (t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><><EFBFBD><D7BC>Ʊ')or
|
|
|
(t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><>ֹ<EFBFBD><EFBFBD>')or
|
|
|
(t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring='<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>')or
|
|
|
(t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ')then
|
|
|
begin
|
|
|
str:=trim(InputBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD>', '<27><><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD>', ''));
|
|
|
if str=''then
|
|
|
begin
|
|
|
showmessage('<27><><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
try
|
|
|
modify_all:=true;
|
|
|
t_ch_invoice_shen.Edit;
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD>״̬']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD>']:=str;
|
|
|
t_ch_invoice_shen.post;
|
|
|
t_ch_invoice_shen.Refresh;
|
|
|
if strtobool(get_parameters_value(1,'false'))then
|
|
|
Send_invocie_check_shen('<27><><EFBFBD><EFBFBD><EFBFBD>ķ<DEB8>Ʊ,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
+',<2C>ͻ<EFBFBD>:'+t_ch_invoice_shen.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring,'029','16',t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)
|
|
|
else
|
|
|
Send_invocie_check_shen('<27><><EFBFBD><EFBFBD><EFBFBD>ķ<DEB8>Ʊ,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
+',<2C>ͻ<EFBFBD>:'+t_ch_invoice_shen.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring,'030','16',t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
|
|
|
finally
|
|
|
modify_all:=false;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
showmessage('<27><>ǰҵ<C7B0><D2B5>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<DEB8><C4A3><EFBFBD>');
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.bsSkinButton10Click(Sender: TObject);
|
|
|
begin
|
|
|
try
|
|
|
frm_ch_shen_query:=tfrm_ch_shen_query.Create (self);
|
|
|
shen_query_type:=1;
|
|
|
shen_query_limited:='1001';
|
|
|
shen_query_op_limited:='1002';
|
|
|
frm_ch_shen_query.ShowModal;
|
|
|
finally
|
|
|
frm_ch_shen_query.Free;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.t_ch_invoice_shenAfterDelete(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
if fra_ch_add_do1.t_op_seae.Active then
|
|
|
fra_ch_add_do1.t_op_seae.Requery();
|
|
|
if fra_ch_add_do1.t_op_seai.Active then
|
|
|
fra_ch_add_do1.t_op_seai.Requery();
|
|
|
if fra_ch_add_do1.t_op_aire.Active then
|
|
|
fra_ch_add_do1.t_op_aire.Requery();
|
|
|
if fra_ch_add_do1.t_op_airi.Active then
|
|
|
fra_ch_add_do1.t_op_airi.Requery();
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.DBEdit14KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
key_DBEdit(Key,DBEdit1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.DBEdit1KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
key_DBEdit(Key,DBEdit5);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.RxDBLookupCombo1KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
key_RxDBLookupCombo(Key,RxDBLookupCombo2);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.bsSkinDBCheckRadioBox1KeyPress(
|
|
|
Sender: TObject; var Key: Char);
|
|
|
begin
|
|
|
key_DBEdit(Key,DBEdit3);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.DBEdit2KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
key_wwDBDateTimePicker(Key,wwDBDateTimePicker1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.DBEdit4KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
key_wwDBLookupCombo(Key,wwDBLookupCombo3);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.wwDBLookupCombo3KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
key_wwDBLookupCombo(Key,wwDBLookupCombo2);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.wwDBLookupCombo2KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
key_wwDBLookupCombo(Key,wwDBLookupCombo1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.wwDBLookupCombo1KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
key_wwDBLookupCombo(Key,wwDBLookupCombo4);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.wwDBLookupCombo4KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
key_DBEdit(Key,DBEdit9);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.DBEdit9KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
key_DBEdit(Key,DBEdit10);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.DBEdit10KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
key_DBEdit(Key,DBEdit11);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.DBEdit11KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
key_DBMemo(Key,DBMemo1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.RxDBLookupCombo1Change(Sender: TObject);
|
|
|
begin
|
|
|
if (t_ch_invoice_shen.state=dsinsert)or(t_ch_invoice_shen.state=dsedit)then
|
|
|
begin
|
|
|
if frm_data_share.t_crm_client_all.locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',RxDBLookupCombo1.DisplayValues[1],[]) then
|
|
|
begin
|
|
|
if frm_data_share.t_crm_client_all.fieldbyname('<27><>Ʊ̧ͷ').asstring<>'' then
|
|
|
t_ch_invoice_shen['<27><>Ʊ̧ͷ']:=frm_data_share.t_crm_client_all.fieldbyname('<27><>Ʊ̧ͷ').asstring
|
|
|
else
|
|
|
t_ch_invoice_shen['<27><>Ʊ̧ͷ']:=frm_data_share.t_crm_client_all.fieldbyname('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').asstring;
|
|
|
|
|
|
t_ch_invoice_shen['<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>']:=frm_data_share.t_crm_client_all.fieldbyname('<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.wwDBDateTimePicker1KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
key_DBEdit(Key,DBEdit4);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.N10Click(Sender: TObject);
|
|
|
begin
|
|
|
update_grid_view_no(dxdbgrid1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.N14Click(Sender: TObject);
|
|
|
begin
|
|
|
update_grid_view_all(dxdbgrid1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.N12Click(Sender: TObject);
|
|
|
begin
|
|
|
update_grid(dxdbgrid1,10);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.N16Click(Sender: TObject);
|
|
|
begin
|
|
|
grid_save_xls(dxdbgrid1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.dxDBGrid1ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
begin
|
|
|
Column_sort(Column,t_ch_invoice_shen,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.bsSkinPanel2Resize(Sender: TObject);
|
|
|
var
|
|
|
i:integer;
|
|
|
begin
|
|
|
i:=round(bsSkinPanel2.Width/12);
|
|
|
bsSkinButton10.Width:=i;
|
|
|
bsSkinButton9.Width:=i;
|
|
|
bsSkinButton2.Width:=i;
|
|
|
bsSkinButton3.Width:=i;
|
|
|
bsSkinButton4.Width:=i;
|
|
|
bsSkinButton1.Width:=i;
|
|
|
bsSkinButton11.Width:=i;
|
|
|
bsSkinButton6.Width:=i;
|
|
|
bsSkinButton8.Width:=i;
|
|
|
bsSkinButton12.Width:=i;
|
|
|
bsSkinButton38.Width:=i;
|
|
|
bsSkinButton7.Left:=bsSkinPanel2.Width-bsSkinButton7.Width-20;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.bsSkinButton7Click(Sender: TObject);
|
|
|
var
|
|
|
Pnt:Tpoint;
|
|
|
begin
|
|
|
Pnt:=bsSkinButton7.ClientToScreen(Point(0,bsSkinButton7.Height));
|
|
|
PopupMenu3.Popup(Pnt.x,Pnt.y);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.N17Click(Sender: TObject);
|
|
|
begin
|
|
|
t_ch_invoice_shen.Close;
|
|
|
t_ch_invoice_shen.SQL.clear;
|
|
|
t_ch_invoice_shen.SQL.Add('select * from t_ch_invoice_shen where <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD>뿪Ʊ'+''''
|
|
|
+') and '
|
|
|
+open_data('1001','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','no','no','no','no')
|
|
|
+'order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> desc');
|
|
|
t_ch_invoice_shen.open;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.N34Click(Sender: TObject);
|
|
|
begin
|
|
|
t_ch_invoice_shen.Close;
|
|
|
t_ch_invoice_shen.SQL.clear;
|
|
|
t_ch_invoice_shen.SQL.Add('select * from t_ch_invoice_shen where <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''
|
|
|
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+') and '
|
|
|
+open_data('1001','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','no','no','no','no')
|
|
|
+'order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> desc');
|
|
|
t_ch_invoice_shen.open;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.N36Click(Sender: TObject);
|
|
|
begin
|
|
|
t_ch_invoice_shen.Close;
|
|
|
t_ch_invoice_shen.SQL.clear;
|
|
|
t_ch_invoice_shen.SQL.Add('select * from t_ch_invoice_shen where <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''
|
|
|
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+') and '
|
|
|
+open_data('1001','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','no','no','no','no')
|
|
|
+'order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> desc');
|
|
|
t_ch_invoice_shen.open;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.N6Click(Sender: TObject);
|
|
|
begin
|
|
|
t_ch_invoice_shen.Close;
|
|
|
t_ch_invoice_shen.SQL.clear;
|
|
|
t_ch_invoice_shen.SQL.Add('select * from t_ch_invoice_shen where <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><D7BC>Ʊ'+''''
|
|
|
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+') and '
|
|
|
+open_data('1001','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','no','no','no','no')
|
|
|
+'order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> desc');
|
|
|
t_ch_invoice_shen.open;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.N4Click(Sender: TObject);
|
|
|
begin
|
|
|
t_ch_invoice_shen.Close;
|
|
|
t_ch_invoice_shen.SQL.clear;
|
|
|
t_ch_invoice_shen.SQL.Add('select * from t_ch_invoice_shen where <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ'+''''+') and '
|
|
|
+open_data('1001','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','no','no','no','no')
|
|
|
+'order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> desc');
|
|
|
t_ch_invoice_shen.open;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.DBEdit7KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
key_RxDBLookupCombo(Key,RxDBLookupCombo1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.RxDBLookupCombo2KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.DBEdit5KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
key_wwDBComboBox(Key,wwDBComboBox1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.wwDBComboBox1KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
key_DBEdit(Key,DBEdit7);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.DBEdit3KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
key_wwDBLookupCombo(Key,wwDBLookupCombo5);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.bsSkinButton12Click(Sender: TObject);
|
|
|
var
|
|
|
afield : variant;
|
|
|
i: Integer;
|
|
|
begin
|
|
|
if t_ch_invoice_shen.IsEmpty then
|
|
|
exit;
|
|
|
try
|
|
|
afield := vararraycreate([0,t_ch_invoice_shen.fieldcount-1],varvariant);
|
|
|
for i := 0 to (t_ch_invoice_shen.fieldcount-1) do
|
|
|
begin
|
|
|
afield[i] :=t_ch_invoice_shen.fields[i].value ;
|
|
|
end;
|
|
|
t_ch_invoice_shen.insert;
|
|
|
for i := 0 to (t_ch_invoice_shen.fieldcount-1) do
|
|
|
begin
|
|
|
if t_ch_invoice_shen.fields[i].FieldName<>'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'then
|
|
|
t_ch_invoice_shen.fields[i].value := afield[i] ;
|
|
|
end;
|
|
|
t_ch_invoice_shen['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:='';
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD>״̬']:='<27><><EFBFBD>뿪Ʊ';
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>']:='';
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>']:='';
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=0;
|
|
|
t_ch_invoice_shen['ʵ<>ʽ<EFBFBD><CABD><EFBFBD>']:=0;
|
|
|
t_ch_invoice_shen['<27>鿪<EFBFBD><E9BFAA><EFBFBD><EFBFBD>']:=0;
|
|
|
t_ch_invoice_shen['<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>']:=0;
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=employee;
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=now;
|
|
|
t_ch_invoice_shen['<27>Զ<EFBFBD>']:=1;
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='';
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=null;
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='';
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=null;
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD>']:='';
|
|
|
bsSkinNotebook1.PageIndex:=1;
|
|
|
bsSkinPageControl2.ActivePage:=bsSkinTabSheet11;
|
|
|
bsSkinButton11.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>';
|
|
|
except
|
|
|
if t_ch_invoice_shen.state=dsinsert then
|
|
|
t_ch_invoice_shen.cancel;
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.wwDBLookupCombo5KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
key_DBEdit(Key,DBEdit2);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.t_ch_invoice_shenFieldChange(
|
|
|
Sender: TField);
|
|
|
begin
|
|
|
if t_ch_invoice_shen.state in [dsedit,dsinsert] then
|
|
|
t_ch_invoice_shen['<27>鿪<EFBFBD><E9BFAA><EFBFBD><EFBFBD>']:=t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']-t_ch_invoice_shen['ʵ<>ʽ<EFBFBD><CABD><EFBFBD>'];
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.bsSkinButton38Click(Sender: TObject);
|
|
|
var
|
|
|
book1:Tbookmark;
|
|
|
begin
|
|
|
book1:=t_ch_invoice_shen.GetBookmark;
|
|
|
t_ch_invoice_shen.Refresh;
|
|
|
t_ch_invoice_shen.GotoBookmark(book1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.t_ch_invoice_shen_itemvatPriceFieldChange(Sender: TField);
|
|
|
var price,Amt:double;
|
|
|
begin
|
|
|
try
|
|
|
Sender.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat:=s_w(2,Sender.DataSet.fieldbyname('<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>').asfloat/(1+Sender.DataSet.fieldbyname('˰<><CBB0>').asfloat));
|
|
|
|
|
|
Sender.DataSet.FieldByName('˰<><CBB0>').Value:=s_w(2,Sender.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat*Sender.DataSet.fieldbyname('<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>').asfloat/(1+Sender.DataSet.fieldbyname('˰<><CBB0>').asfloat)*Sender.DataSet.fieldbyname('˰<><CBB0>').asfloat);
|
|
|
|
|
|
Sender.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').Value:=s_w(strtoint(apointnum),Sender.DataSet.fieldbyname('<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>').asfloat*Sender.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat-Sender.DataSet.FieldByName('˰<><CBB0>').Value)
|
|
|
finally
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.t_ch_invoice_shenKHFieldChange(
|
|
|
Sender: TField);
|
|
|
begin
|
|
|
if not frm_data_share.t_crm_client_all.IsEmpty then
|
|
|
if frm_data_share.t_crm_client_all.locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',t_ch_invoice_shen['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>'],[]) then
|
|
|
begin
|
|
|
if frm_data_share.t_crm_client_all.fieldbyname('<27><>Ʊ̧ͷ').asstring<>'' then
|
|
|
t_ch_invoice_shen['<27><>Ʊ̧ͷ']:=frm_data_share.t_crm_client_all.fieldbyname('<27><>Ʊ̧ͷ').asstring
|
|
|
else
|
|
|
t_ch_invoice_shen['<27><>Ʊ̧ͷ']:=frm_data_share.t_crm_client_all.fieldbyname('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').asstring;
|
|
|
t_ch_invoice_shen['<27><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>']:=frm_data_share.t_crm_client_all.fieldbyname('<27><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>').asstring;
|
|
|
t_ch_invoice_shen['<27><>ַ<EFBFBD>绰']:=frm_data_share.t_crm_client_all.fieldbyname('ͨѶ<CDA8><D1B6>ַ').asstring+frm_data_share.t_crm_client_all.fieldbyname('<27>绰').asstring;
|
|
|
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>˺<EFBFBD>']:=frm_data_share.t_crm_client_all.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').asstring+frm_data_share.t_crm_client_all.fieldbyname('<27>ʺ<EFBFBD>RMB').asstring
|
|
|
+frm_data_share.t_crm_client_all.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').asstring+frm_data_share.t_crm_client_all.fieldbyname('<27>ʺ<EFBFBD>USD').asstring;
|
|
|
|
|
|
t_ch_invoice_shen['<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>']:=frm_data_share.t_crm_client_all.fieldbyname('<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.DBEdit8Change(Sender: TObject);
|
|
|
begin
|
|
|
bsSkinButton6.Caption:='<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>';
|
|
|
if t_ch_invoice_shen.State in [dsinsert] then exit;
|
|
|
if t_ch_invoice_shen.IsEmpty then exit;
|
|
|
if t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString='<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>' then begin
|
|
|
bsSkinButton6.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
end else begin
|
|
|
bsSkinButton6.Caption:='<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>';
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.bsSkinPageControl2Change(Sender: TObject);
|
|
|
begin
|
|
|
if not ch_invoice_shen_open then exit;
|
|
|
if bsSkinPageControl2.ActivePage<>bsSkinTabSheet22 then exit;
|
|
|
{
|
|
|
if StrToBool(get_parameters_value(85,'false')) then begin
|
|
|
fra_ch_delete_do1.v_fee_do_bscard.close;
|
|
|
fra_ch_delete_do1.v_fee_do_bscard.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_bscard.sql.add('select * from v_fee_do_bscard '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+''' order by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_bscard.Open;
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_bscard_sum.close;
|
|
|
fra_ch_delete_do1.v_fee_do_bscard_sum.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_bscard_sum.sql.add('select <20><><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7) AS <20>·<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD>,sum(ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>) as ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD> from v_fee_do_bscard '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+''' group by <20><><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD> '
|
|
|
+'order by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),ԭʼ<D4AD>ұ<EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_bscard_sum.Open;
|
|
|
|
|
|
end else begin
|
|
|
fra_ch_delete_do1.v_fee_do_seae.close;
|
|
|
fra_ch_delete_do1.v_fee_do_seae.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_seae.sql.add('select * from v_fee_do_seae '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+''' order by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_seae.Open;
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_seai.close;
|
|
|
fra_ch_delete_do1.v_fee_do_seai.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_seai.sql.add('select * from v_fee_do_seai '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+''' order by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_seai.Open;
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_aire.close;
|
|
|
fra_ch_delete_do1.v_fee_do_aire.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_aire.sql.add('select * from v_fee_do_aire '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+''' order by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_aire.Open;
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_airi.close;
|
|
|
fra_ch_delete_do1.v_fee_do_airi.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_airi.sql.add('select * from v_fee_do_airi '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+''' order by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_airi.Open;
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_seae_sum.close;
|
|
|
fra_ch_delete_do1.v_fee_do_seae_sum.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_seae_sum.sql.add('select <20><><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7) AS <20>·<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD>,sum(ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>) as ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD> from v_fee_do_seae '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+''' group by <20><><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD> '
|
|
|
+'order by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),ԭʼ<D4AD>ұ<EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_seae_sum.Open;
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_seai_sum.close;
|
|
|
fra_ch_delete_do1.v_fee_do_seai_sum.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_seai_sum.sql.add('select <20><><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7) AS <20>·<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD>,sum(ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>) as ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD> from v_fee_do_seai '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+''' group by <20><><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD> '
|
|
|
+'order by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),ԭʼ<D4AD>ұ<EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_seai_sum.Open;
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_aire_sum.close;
|
|
|
fra_ch_delete_do1.v_fee_do_aire_sum.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_aire_sum.sql.add('select <20><><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7) AS <20>·<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD>,sum(ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>) as ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD> from v_fee_do_aire '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+''' group by <20><><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD> '
|
|
|
+'order by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),ԭʼ<D4AD>ұ<EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_aire_sum.Open;
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_aire_sum.close;
|
|
|
fra_ch_delete_do1.v_fee_do_airi_sum.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_airi_sum.sql.add('select <20><><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7) AS <20>·<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD>,sum(ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>) as ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD> from v_fee_do_airi '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+''' group by <20><><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD> '
|
|
|
+'order by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),ԭʼ<D4AD>ұ<EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_aire_sum.Open;
|
|
|
end;
|
|
|
}
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.fra_ch_add_do1bsSkinButton8Click(
|
|
|
Sender: TObject);
|
|
|
begin
|
|
|
fra_ch_add_do1.bsSkinButton8Click(Sender);
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.FormCreate(Sender: TObject);
|
|
|
begin
|
|
|
bsSkinNotebook1.PageIndex:=0;
|
|
|
ch_invoice_shen_open:=true;
|
|
|
t_ch_invoice_shen.Close;
|
|
|
t_ch_invoice_shen.SQL.clear;
|
|
|
t_ch_invoice_shen.SQL.Add('select * from t_ch_invoice_shen where <20><><EFBFBD><EFBFBD>״̬ not in ('+''''+'<27><><EFBFBD><D7BC>Ʊ'+''''
|
|
|
+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ'+''''+') and '
|
|
|
+open_data('1001','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','no','no','no','no')
|
|
|
+'order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> desc');
|
|
|
t_ch_invoice_shen.open;
|
|
|
// t_ch_fee_do.open;
|
|
|
|
|
|
t_ch_invoice_head.open;
|
|
|
|
|
|
//<2F><>ҵ<EFBFBD><D2B5><EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD>
|
|
|
if StrToBool(get_parameters_value(85,'false')) then begin
|
|
|
fra_ch_add_do1.bsSkinTabSheet1.TabVisible:=False;
|
|
|
fra_ch_add_do1.bsSkinTabSheet2.TabVisible:=False;
|
|
|
fra_ch_add_do1.bsSkinTabSheet3.TabVisible:=False;
|
|
|
fra_ch_add_do1.bsSkinTabSheet4.TabVisible:=False;
|
|
|
fra_ch_add_do1.bsSkinTabSheet5.TabVisible:=True;
|
|
|
fra_ch_add_do1.bsSkinPageControl1.TabIndex:=0;
|
|
|
|
|
|
// fra_ch_add_do1.bsSkinButton11.Caption:='<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>';
|
|
|
|
|
|
fra_ch_delete_do1.bsSkinTabSheet1.TabVisible:=false;
|
|
|
fra_ch_delete_do1.bsSkinTabSheet2.TabVisible:=false;
|
|
|
fra_ch_delete_do1.bsSkinTabSheet3.TabVisible:=false;
|
|
|
fra_ch_delete_do1.bsSkinTabSheet4.TabVisible:=false;
|
|
|
fra_ch_delete_do1.bsSkinTabSheet5.TabVisible:=True;
|
|
|
fra_ch_delete_do1.bsSkinPageControl1.ActivePage:=fra_ch_delete_do1.bsSkinTabSheet5;
|
|
|
|
|
|
end else begin
|
|
|
fra_ch_add_do1.bsSkinTabSheet1.TabVisible:=True;
|
|
|
fra_ch_add_do1.bsSkinTabSheet2.TabVisible:=True;
|
|
|
fra_ch_add_do1.bsSkinTabSheet3.TabVisible:=True;
|
|
|
fra_ch_add_do1.bsSkinTabSheet4.TabVisible:=True;
|
|
|
fra_ch_add_do1.bsSkinPageControl1.ActivePage:=fra_ch_add_do1.bsSkinTabSheet1;
|
|
|
fra_ch_add_do1.bsSkinTabSheet5.TabVisible:=False;
|
|
|
|
|
|
fra_ch_delete_do1.bsSkinTabSheet1.TabVisible:=True;
|
|
|
fra_ch_delete_do1.bsSkinTabSheet2.TabVisible:=True;
|
|
|
fra_ch_delete_do1.bsSkinTabSheet3.TabVisible:=True;
|
|
|
fra_ch_delete_do1.bsSkinTabSheet4.TabVisible:=True;
|
|
|
fra_ch_delete_do1.bsSkinTabSheet5.TabVisible:=false;
|
|
|
fra_ch_delete_do1.bsSkinPageControl1.ActivePage:=fra_ch_delete_do1.bsSkinTabSheet1;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
fra_ch_add_do1.do_ban1.DataSet:=t_ch_invoice_shen;
|
|
|
fra_ch_add_do1.bs_text.text:='7';
|
|
|
fra_ch_add_do1.wwDBComboBox31.text:='<27><>';
|
|
|
fra_ch_add_do1.t_ch_fee_do.open;
|
|
|
fra_ch_add_do1.bsSkinCheckRadioBox4.Checked:=False;
|
|
|
fra_ch_add_do1.bsSkinPanel9.Visible:=true;
|
|
|
|
|
|
//<2F><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD><DDBC><EFBFBD><EFBFBD><EFBFBD>
|
|
|
if StrToBool(get_parameters_value(85,'false')) then begin
|
|
|
fra_ch_delete_do1.v_fee_do_bscard.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_bscard.sql.add('select * from v_fee_do_bscard '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_bscard.DataSource:=t_ch_invoice_shen1;
|
|
|
fra_ch_delete_do1.v_fee_do_bscard.Open;
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_bscard_sum.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_bscard_sum.sql.add('select SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7) AS <20>·<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD>,sum(ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>) as ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD> from v_fee_do_bscard '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> group by SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD> '
|
|
|
+'order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),ԭʼ<D4AD>ұ<EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_bscard_sum.DataSource:=t_ch_invoice_shen1;
|
|
|
fra_ch_delete_do1.v_fee_do_bscard_sum.Open;
|
|
|
|
|
|
fra_ch_add_do1.do_ban_fee1.DataSet:=fra_ch_delete_do1.v_fee_do_bscard;
|
|
|
|
|
|
|
|
|
|
|
|
end else begin
|
|
|
fra_ch_delete_do1.v_fee_do_seae.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_seae.sql.add('select * from v_fee_do_seae '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_seae.DataSource:=t_ch_invoice_shen1;
|
|
|
fra_ch_delete_do1.v_fee_do_seae.Open;
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_seai.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_seai.sql.add('select * from v_fee_do_seai '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_seai.DataSource:=t_ch_invoice_shen1;
|
|
|
fra_ch_delete_do1.v_fee_do_seai.Open;
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_aire.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_aire.sql.add('select * from v_fee_do_aire '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_aire.DataSource:=t_ch_invoice_shen1;
|
|
|
fra_ch_delete_do1.v_fee_do_aire.Open;
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_airi.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_airi.sql.add('select * from v_fee_do_airi '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_airi.DataSource:=t_ch_invoice_shen1;
|
|
|
fra_ch_delete_do1.v_fee_do_airi.Open;
|
|
|
|
|
|
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_seae_sum.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_seae_sum.sql.add('select SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7) AS <20>·<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD>,sum(ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>) as ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD> from v_fee_do_seae '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> group by SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD> '
|
|
|
+'order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),ԭʼ<D4AD>ұ<EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_seae_sum.DataSource:=t_ch_invoice_shen1;
|
|
|
fra_ch_delete_do1.v_fee_do_seae_sum.Open;
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_seai_sum.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_seai_sum.sql.add('select SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7) AS <20>·<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD>,sum(ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>) as ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD> from v_fee_do_seai '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> group by SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD> '
|
|
|
+'order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),ԭʼ<D4AD>ұ<EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_seai_sum.DataSource:=t_ch_invoice_shen1;
|
|
|
fra_ch_delete_do1.v_fee_do_seai_sum.Open;
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_aire_sum.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_aire_sum.sql.add('select SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7) AS <20>·<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD>,sum(ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>) as ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD> from v_fee_do_aire '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> group by SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD> '
|
|
|
+'order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),ԭʼ<D4AD>ұ<EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_aire_sum.DataSource:=t_ch_invoice_shen1;
|
|
|
fra_ch_delete_do1.v_fee_do_aire_sum.Open;
|
|
|
|
|
|
fra_ch_delete_do1.v_fee_do_airi_sum.SQL.clear;
|
|
|
fra_ch_delete_do1.v_fee_do_airi_sum.sql.add('select SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7) AS <20>·<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD>,sum(ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>) as ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD> from v_fee_do_airi '
|
|
|
+'where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> group by SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ԭʼ<D4AD>ұ<EFBFBD> '
|
|
|
+'order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,SUBSTRING(CONVERT(char(15),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,111),1,7),ԭʼ<D4AD>ұ<EFBFBD>');
|
|
|
fra_ch_delete_do1.v_fee_do_airi_sum.DataSource:=t_ch_invoice_shen1;
|
|
|
fra_ch_delete_do1.v_fee_do_airi_sum.Open;
|
|
|
|
|
|
fra_ch_add_do1.do_ban_fee1.DataSet:=fra_ch_delete_do1.v_fee_do_seae;
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
t_ch_invoice_shen_item.DataSource:=t_ch_invoice_shen1;
|
|
|
t_ch_invoice_shen_item.Open;
|
|
|
|
|
|
|
|
|
fra_ch_delete_do1.bs_text.Text:='7';
|
|
|
fra_ch_delete_do1.do_ban1.DataSet:=t_ch_invoice_shen;
|
|
|
|
|
|
t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').OnChange:=t_ch_invoice_shenFieldChange;
|
|
|
t_ch_invoice_shen.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').OnChange:=t_ch_invoice_shenKHFieldChange;
|
|
|
|
|
|
t_ch_invoice_shen_item.FieldByName('<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>').OnChange:=t_ch_invoice_shen_itemvatPriceFieldChange;
|
|
|
t_ch_invoice_shen_item.FieldByName('<27><><EFBFBD><EFBFBD>').OnChange:=t_ch_invoice_shen_itemvatPriceFieldChange;
|
|
|
|
|
|
loadreggrid(dxdbgrid1,false,caption);
|
|
|
|
|
|
loadreggrid(fra_ch_delete_do1.dxDBGrid9,false,caption+'9');
|
|
|
loadreggrid(fra_ch_add_do1.dxDBGrid19,false,caption+'19');
|
|
|
loadreggrid(fra_ch_add_do1.dxDBGrid17,false,caption+'17');
|
|
|
|
|
|
|
|
|
frm_data_share.t_crm_client_all.requery;
|
|
|
frm_data_share.t_code_currency.requery;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.fra_ch_add_do1N1Click(Sender: TObject);
|
|
|
begin
|
|
|
fra_ch_add_do1.N1Click(Sender);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.t_msg_moldAfterInsert(DataSet: TDataSet);
|
|
|
begin
|
|
|
dataset.FieldByName('<27><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>').AsString:='<27><><EFBFBD>Ʊģ<C6B1><C4A3>';
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.bsSkinButton40Click(Sender: TObject);
|
|
|
begin
|
|
|
if not if_open('602') then
|
|
|
begin
|
|
|
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD><C8A8>,<2C><><EFBFBD><EFBFBD>ϵϵͳ<CFB5><CDB3><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1>ͨȨ<CDA8>ޣ<EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
|
|
|
t_msg_mold.Close;
|
|
|
t_msg_mold.sql.text:='select * from t_sys_msgmold where <20><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>=''<27><><EFBFBD>Ʊģ<C6B1><C4A3>'' ';
|
|
|
t_msg_mold.open;
|
|
|
if t_msg_mold.IsEmpty then t_msg_mold.Insert;
|
|
|
frm_msg_mold:=Tfrm_msg_mold.create(self);
|
|
|
try
|
|
|
frm_msg_mold.transtype:=5;
|
|
|
frm_msg_mold.t_msg_mold1.DataSet:=t_msg_mold;
|
|
|
frm_msg_mold.ShowModal;
|
|
|
finally
|
|
|
FreeAndNil(frm_msg_mold);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.bsSkinButton41Click(Sender: TObject);
|
|
|
var s:string;
|
|
|
aAdoQuery:TADOQuery;
|
|
|
begin
|
|
|
s:='';
|
|
|
t_msg_mold.Close;
|
|
|
t_msg_mold.sql.text:='select * from t_sys_msgmold where <20><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>=''<27><><EFBFBD>Ʊģ<C6B1><C4A3>'' ';
|
|
|
t_msg_mold.open;
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
with aAdoQuery do
|
|
|
try
|
|
|
close;
|
|
|
SQL.clear;
|
|
|
sql.add('select <20><><EFBFBD><EFBFBD>,ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,ί<>б<EFBFBD><D0B1><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ж<><D0B6><EFBFBD><EFBFBD>,Ŀ<>ĵ<EFBFBD>,װ<><D7B0><EFBFBD><EFBFBD>,<2C><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,<2C><>ͬ<EFBFBD><CDAC>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
sql.Add(',sum(case when ԭʼ<D4AD>ұ<EFBFBD>=''RMB'' then ԭʼ<D4AD><CABC><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
sql.Add(',sum(case when ԭʼ<D4AD>ұ<EFBFBD><>''RMB'' then ԭʼ<D4AD><CABC><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD>');
|
|
|
sql.Add('from v_fee_do_bscard ');
|
|
|
sql.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ');
|
|
|
sql.Add('Group by <20><><EFBFBD><EFBFBD>,ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,ί<>б<EFBFBD><D0B1><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ж<><D0B6><EFBFBD><EFBFBD>,Ŀ<>ĵ<EFBFBD>,װ<><D7B0><EFBFBD><EFBFBD>,<2C><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,<2C><>ͬ<EFBFBD><CDAC>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
sql.Add('order by <20><><EFBFBD><EFBFBD>,ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,ί<>б<EFBFBD><D0B1><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ж<><D0B6><EFBFBD><EFBFBD>,Ŀ<>ĵ<EFBFBD>,װ<><D7B0><EFBFBD><EFBFBD>,<2C><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,<2C><>ͬ<EFBFBD><CDAC>');
|
|
|
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
Open;First;
|
|
|
{
|
|
|
sql.Add('sum(case when <20><><EFBFBD><EFBFBD>=''<27><>'' and ԭʼ<D4AD>ұ<EFBFBD>=''RMB'' then ԭʼ<D4AD><CABC><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
sql.Add(',sum(case when <20><><EFBFBD><EFBFBD>=''<27><>'' and ԭʼ<D4AD>ұ<EFBFBD><>''RMB'' then ԭʼ<D4AD><CABC><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
sql.Add(',sum(case when <20><><EFBFBD><EFBFBD>=''<27><>'' and ԭʼ<D4AD>ұ<EFBFBD>=''RMB'' then ԭʼ<D4AD><CABC><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
sql.Add(',sum(case when <20><><EFBFBD><EFBFBD>=''<27><>'' and ԭʼ<D4AD>ұ<EFBFBD><>''RMB'' then ԭʼ<D4AD><CABC><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
sql.Add('from v_fee_do_bscard ');
|
|
|
sql.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ');
|
|
|
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
Open;First;
|
|
|
t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').value:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat-FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>').value:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat-FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
while not eof do
|
|
|
begin
|
|
|
if Trim(s)='' then
|
|
|
s:=getstrfromdataset(aAdoQuery,t_msg_mold.fieldbyname('ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)
|
|
|
else
|
|
|
s:=s+#13#10+getstrfromdataset(aAdoQuery,t_msg_mold.fieldbyname('ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)+' ';
|
|
|
Next;
|
|
|
end;
|
|
|
t_ch_invoice_shen.Edit;
|
|
|
t_ch_invoice_shen.FieldByName('<27><>ע').AsString:=s;
|
|
|
t_ch_invoice_shen.Post;
|
|
|
finally
|
|
|
Free;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.DBComboBoxEh3CloseUp(Sender: TObject;
|
|
|
Accept: Boolean);
|
|
|
begin
|
|
|
DBComboBoxEh3.items.Clear;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.DBComboBoxEh4CloseUp(Sender: TObject;
|
|
|
Accept: Boolean);
|
|
|
begin
|
|
|
DBComboBoxEh4.items.Clear;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.DBComboBoxEh5CloseUp(Sender: TObject;
|
|
|
Accept: Boolean);
|
|
|
begin
|
|
|
DBComboBoxEh5.items.Clear;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.DBComboBoxEh3DropDown(Sender: TObject);
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
client:string;
|
|
|
begin
|
|
|
DBComboBoxEh3.Items.Clear;
|
|
|
if (RxDBLookupCombo2.DisplayValues[1]<>'') then client:=RxDBLookupCombo2.DisplayValues[1] else client:=RxDBLookupCombo1.DisplayValues[1];
|
|
|
if frm_data_share.t_crm_client_all.locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',client,[]) then
|
|
|
begin
|
|
|
if Trim(frm_data_share.t_crm_client_all.fieldbyname('<27><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>').asstring)<>'' then
|
|
|
DBComboBoxEh3.Items.Add(frm_data_share.t_crm_client_all.fieldbyname('<27><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>').asstring);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.DBComboBoxEh4DropDown(Sender: TObject);
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
client:string;
|
|
|
begin
|
|
|
DBComboBoxEh4.Items.Clear;
|
|
|
if (RxDBLookupCombo2.DisplayValues[1]<>'') then client:=RxDBLookupCombo2.DisplayValues[1] else client:=RxDBLookupCombo1.DisplayValues[1];
|
|
|
if frm_data_share.t_crm_client_all.locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',client,[]) then
|
|
|
begin
|
|
|
if (Trim(frm_data_share.t_crm_client_all.fieldbyname('ͨѶ<CDA8><D1B6>ַ').asstring)<>'')
|
|
|
and (Trim(frm_data_share.t_crm_client_all.fieldbyname('<27>绰').asstring)<>'') then
|
|
|
DBComboBoxEh4.Items.Add(frm_data_share.t_crm_client_all.fieldbyname('ͨѶ<CDA8><D1B6>ַ').asstring+frm_data_share.t_crm_client_all.fieldbyname('<27>绰').asstring);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.DBComboBoxEh5DropDown(Sender: TObject);
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
client:string;
|
|
|
begin
|
|
|
DBComboBoxEh5.Items.Clear;
|
|
|
|
|
|
if (RxDBLookupCombo2.DisplayValues[1]<>'') then client:=RxDBLookupCombo2.DisplayValues[1] else client:=RxDBLookupCombo1.DisplayValues[1];
|
|
|
|
|
|
if frm_data_share.t_crm_client_all.locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',client,[]) then
|
|
|
begin
|
|
|
if (Trim(frm_data_share.t_crm_client_all.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').asstring)<>'')
|
|
|
and (Trim(frm_data_share.t_crm_client_all.fieldbyname('<27>ʺ<EFBFBD>RMB').asstring)<>'') then
|
|
|
DBComboBoxEh5.Items.Add(frm_data_share.t_crm_client_all.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').asstring+frm_data_share.t_crm_client_all.fieldbyname('<27>ʺ<EFBFBD>RMB').asstring);
|
|
|
|
|
|
if (Trim(frm_data_share.t_crm_client_all.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').asstring)<>'')
|
|
|
and (Trim(frm_data_share.t_crm_client_all.fieldbyname('<27>ʺ<EFBFBD>USD').asstring)<>'') then
|
|
|
DBComboBoxEh5.Items.Add(frm_data_share.t_crm_client_all.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USD').asstring+frm_data_share.t_crm_client_all.fieldbyname('<27>ʺ<EFBFBD>USD').asstring);
|
|
|
|
|
|
if Trim(frm_data_share.t_crm_client_all.fieldbyname('<27><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>').asstring)<>'' then
|
|
|
DBComboBoxEh3.Items.Add(frm_data_share.t_crm_client_all.fieldbyname('<27><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>').asstring);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.wwDBLookupCombo5Change(Sender: TObject);
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
begin
|
|
|
{
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
with aQuery do
|
|
|
try
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('select distinct <20><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>,<2C><>ַ<EFBFBD>绰,<2C><><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>˺<EFBFBD> from t_ch_invoice_shen');
|
|
|
SQL.Add('Where <20><>Ʊ̧ͷ=:<3A><>Ʊ̧ͷ and <20><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD><>'''' and <20><>ַ<EFBFBD>绰<>'''' and <20><><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>˺<EFBFBD><>'''' ');
|
|
|
Parameters.ParamByName('<27><>Ʊ̧ͷ').Value:=Trim(wwDBLookupCombo5.Text);
|
|
|
Open;
|
|
|
First;
|
|
|
if (t_ch_invoice_shen.state=dsinsert) or (t_ch_invoice_shen.state=dsedit) then
|
|
|
begin
|
|
|
DBComboBoxEh3.Text:=FieldByName('<27><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>').AsString;
|
|
|
DBComboBoxEh4.Text:=FieldByName('<27><>ַ<EFBFBD>绰').AsString;
|
|
|
DBComboBoxEh5.Text:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>˺<EFBFBD>').AsString;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
// t_ch_invoice.Edit;
|
|
|
// DBComboBoxEh3.Text:=FieldByName('<27><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>').AsString;
|
|
|
// DBComboBoxEh4.Text:=FieldByName('<27><>ַ<EFBFBD>绰').AsString;
|
|
|
// DBComboBoxEh5.Text:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>˺<EFBFBD>').AsString;
|
|
|
// t_ch_invoice.Post;
|
|
|
|
|
|
end;
|
|
|
finally
|
|
|
Close;
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
}
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.RxDBLookupCombo2Change(Sender: TObject);
|
|
|
begin
|
|
|
if (t_ch_invoice_shen.state=dsinsert)or(t_ch_invoice_shen.state=dsedit)then
|
|
|
begin
|
|
|
if frm_data_share.t_crm_client_all.locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',RxDBLookupCombo2.DisplayValues[1],[]) then
|
|
|
begin
|
|
|
if frm_data_share.t_crm_client_all.fieldbyname('<27><>Ʊ̧ͷ').asstring<>'' then
|
|
|
t_ch_invoice_shen['<27><>Ʊ̧ͷ']:=frm_data_share.t_crm_client_all.fieldbyname('<27><>Ʊ̧ͷ').asstring
|
|
|
else
|
|
|
t_ch_invoice_shen['<27><>Ʊ̧ͷ']:=frm_data_share.t_crm_client_all.fieldbyname('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').asstring;
|
|
|
DBComboBoxEh3.Text:=frm_data_share.t_crm_client_all.FieldByName('<27><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>').AsString;
|
|
|
DBComboBoxEh4.Text:=frm_data_share.t_crm_client_all.fieldbyname('ͨѶ<CDA8><D1B6>ַ').asstring+frm_data_share.t_crm_client_all.fieldbyname('<27>绰').asstring;
|
|
|
DBComboBoxEh5.Text:=frm_data_share.t_crm_client_all.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMB').asstring+frm_data_share.t_crm_client_all.fieldbyname('<27>ʺ<EFBFBD>RMB').asstring;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.DBComboBoxEh1DropDown(Sender: TObject);
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
begin
|
|
|
DBComboBoxEh1.Items.Clear;
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
with aQuery do
|
|
|
try
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('select <20><>Ʊ̧ͷ,<2C><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>,<2C><>ַ<EFBFBD>绰,<2C><><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>ʺ<EFBFBD>,<2C><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD> from t_crm_client_Invoice');
|
|
|
SQL.Add('Where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=:<3A>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
Parameters.ParamByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value:=t_ch_invoice_shen.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
open;
|
|
|
if not IsEmpty then
|
|
|
begin
|
|
|
while not eof do
|
|
|
begin
|
|
|
DBComboBoxEh1.Items.Add(fieldbyname('<27><>Ʊ̧ͷ').asstring);
|
|
|
Next;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('select distinct <20><>Ʊ̧ͷ from t_ch_invoice_shen');
|
|
|
SQL.Add('where <20><>Ʊ̧ͷ<>''''');
|
|
|
Open;First;
|
|
|
while not eof do
|
|
|
begin
|
|
|
DBComboBoxEh1.Items.Add(fieldbyname('<27><>Ʊ̧ͷ').asstring);
|
|
|
Next;
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
Close;
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.DBComboBoxEh1CloseUp(Sender: TObject;
|
|
|
Accept: Boolean);
|
|
|
begin
|
|
|
DBComboBoxEh1.items.Clear;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.DBComboBoxEh1KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
if key=#13 then
|
|
|
DBComboBoxEh1.Text:=dbedt1.text;
|
|
|
DBComboBoxEh1.DropDown;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.dbedt1KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
if key=#13 then
|
|
|
DBComboBoxEh1.Text:=dbedt1.text;
|
|
|
DBComboBoxEh1.DropDown;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.DBComboBoxEh1Change(Sender: TObject);
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
begin
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
with aQuery do
|
|
|
try
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('select <20><>Ʊ̧ͷ,<2C><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>,<2C><>ַ<EFBFBD>绰,<2C><><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>ʺ<EFBFBD>,<2C><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD> from t_crm_client_Invoice');
|
|
|
SQL.Add('Where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=:<3A>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> and <20><>Ʊ̧ͷ=:<3A><>Ʊ̧ͷ');
|
|
|
Parameters.ParamByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value:=t_ch_invoice_shen.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
Parameters.ParamByName('<27><>Ʊ̧ͷ').Value:=Trim(DBComboBoxEh1.Text);
|
|
|
open;
|
|
|
if not IsEmpty then
|
|
|
begin
|
|
|
if (t_ch_invoice_shen.state=dsinsert) or (t_ch_invoice_shen.state=dsedit) then
|
|
|
begin
|
|
|
DBComboBoxEh3.Text:=FieldByName('<27><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>').AsString;
|
|
|
DBComboBoxEh4.Text:=FieldByName('<27><>ַ<EFBFBD>绰').AsString;
|
|
|
DBComboBoxEh5.Text:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>ʺ<EFBFBD>').AsString;
|
|
|
DBEdit13.Text:=FieldByName('<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>').AsString;
|
|
|
end
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('select distinct <20><>Ʊ̧ͷ,<2C><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>,<2C><>ַ<EFBFBD>绰,<2C><><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>˺<EFBFBD>,<2C><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD> from t_ch_invoice_shen');
|
|
|
SQL.Add('Where <20><>Ʊ̧ͷ=:<3A><>Ʊ̧ͷ and <20><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD><>'''' and <20><>ַ<EFBFBD>绰<>'''' and <20><><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>˺<EFBFBD><>'''' ');
|
|
|
Parameters.ParamByName('<27><>Ʊ̧ͷ').Value:=Trim(DBComboBoxEh1.Text);
|
|
|
Open;
|
|
|
First;
|
|
|
if (t_ch_invoice_shen.state=dsinsert) or (t_ch_invoice_shen.state=dsedit) then
|
|
|
begin
|
|
|
DBComboBoxEh3.Text:=FieldByName('<27><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>').AsString;
|
|
|
DBComboBoxEh4.Text:=FieldByName('<27><>ַ<EFBFBD>绰').AsString;
|
|
|
DBComboBoxEh5.Text:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>˺<EFBFBD>').AsString;
|
|
|
DBEdit13.Text:=FieldByName('<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>').AsString;
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
Close;
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.t_ch_invoice_shen_itemBeforePost(
|
|
|
DataSet: TDataSet);
|
|
|
var
|
|
|
Amt,price:double;
|
|
|
begin
|
|
|
if trim(t_ch_invoice_shen_item.FieldByName('<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring)='' then
|
|
|
begin
|
|
|
showmessage('<27><>Ʒ<EFBFBD><C6B7><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD>');
|
|
|
abort;
|
|
|
end;
|
|
|
{
|
|
|
if t_ch_invoice_shen_item.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat=0 then
|
|
|
begin
|
|
|
showmessage('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD>');
|
|
|
abort;
|
|
|
end;
|
|
|
|
|
|
if t_ch_invoice_shen_item.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat=0 then
|
|
|
begin
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD>');
|
|
|
abort;
|
|
|
end;
|
|
|
}
|
|
|
|
|
|
|
|
|
if DataSet.fieldbyname('<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>').asfloat<>0 then
|
|
|
begin
|
|
|
DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat:=s_w(2,DataSet.fieldbyname('<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>').asfloat/(1+DataSet.fieldbyname('˰<><CBB0>').asfloat));
|
|
|
|
|
|
DataSet.FieldByName('˰<><CBB0>').Value:=s_w(2,DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat*DataSet.fieldbyname('<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>').asfloat/(1+DataSet.fieldbyname('˰<><CBB0>').asfloat)*DataSet.fieldbyname('˰<><CBB0>').asfloat);
|
|
|
|
|
|
DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').Value:=s_w(strtoint(apointnum),DataSet.fieldbyname('<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>').asfloat*DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat-DataSet.FieldByName('˰<><CBB0>').Value)
|
|
|
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
price:=DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat*DataSet.fieldbyname('˰<><CBB0>').asfloat+DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
|
|
|
DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').Value:=s_w(strtoint(apointnum),DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat*DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat);
|
|
|
price:=s_w(strtoint(apointnum),price);
|
|
|
Amt:=s_w(strtoint(apointnum),price*DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat);
|
|
|
DataSet.FieldByName('˰<><CBB0>').Value:=s_w(strtoint(apointnum),Amt/(1+DataSet.fieldbyname('˰<><CBB0>').AsFloat)*DataSet.fieldbyname('˰<><CBB0>').AsFloat);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.t_ch_invoice_shen_itemNewRecord(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
t_ch_invoice_shen_item.FieldByName('<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring:='';
|
|
|
t_ch_invoice_shen_item.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ͺ<EFBFBD>').asstring:='0';
|
|
|
t_ch_invoice_shen_item.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ').asstring:='Ʊ';
|
|
|
t_ch_invoice_shen_item.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=1;
|
|
|
t_ch_invoice_shen_item.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=0;
|
|
|
t_ch_invoice_shen_item.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=0;
|
|
|
t_ch_invoice_shen_item.FieldByName('˰<><CBB0>').AsFloat:=frm_data_share.t_sys_company.fieldbyname('˰<><CBB0>').AsFloat;
|
|
|
t_ch_invoice_shen_item.FieldByName('˰<><CBB0>').AsFloat:=0;
|
|
|
t_ch_invoice_shen_item.FieldByName('<27>ۿ<EFBFBD>').AsFloat:=0;
|
|
|
t_ch_invoice_shen_item.FieldByName('<27><>ע').asstring:='';
|
|
|
t_ch_invoice_shen_item.FieldByName('<27><>˰<EFBFBD>۱<EFBFBD>־').Value:=0;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.fra_ch_add_do1MenuItem1Click(
|
|
|
Sender: TObject);
|
|
|
begin
|
|
|
fra_ch_add_do1.MenuItem1Click(Sender);
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.t_ch_invoice_shen_itemBeforeEdit(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
if not modify_all then
|
|
|
begin
|
|
|
if (t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><><EFBFBD><D7BC>Ʊ')or
|
|
|
(t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><>ֹ<EFBFBD><EFBFBD>')or
|
|
|
(t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ')or
|
|
|
(t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring='<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>')or
|
|
|
(t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')then
|
|
|
begin
|
|
|
showmessage('<27><>ǰҵ<C7B0><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
abort;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.CheckBox1Click(Sender: TObject);
|
|
|
var
|
|
|
inifile1:Tinifile;
|
|
|
begin
|
|
|
//<2F><>ʾ<EFBFBD><CABE>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
|
|
inifile1:=Tinifile.Create(ExtractFilePath(application.ExeName)+'main.ini');
|
|
|
inifile1.WriteBool('other','invoicedsp',CheckBox1.Checked);
|
|
|
inifile1.free;
|
|
|
if CheckBox1.Checked then
|
|
|
begin
|
|
|
bsSkinPanel4.Visible:=true;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
bsSkinPanel4.Visible:=false;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.bsSkinButton20Click(Sender: TObject);
|
|
|
begin
|
|
|
frm_main.view_momo(t_ch_invoice_shen1,'<27><>ע');
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.dxDBGrid1Column30CustomDraw(Sender: TObject;
|
|
|
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
|
|
|
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
|
|
|
var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean);
|
|
|
begin
|
|
|
if UpperCase(ANode.strings[dxDBGrid1Column30.Index])='TRUE'then
|
|
|
AColor :=clred
|
|
|
else
|
|
|
AColor :=clwhite;
|
|
|
AFont.Color:=clblack;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.t_ch_invoice_shen_itemAfterPost(
|
|
|
DataSet: TDataSet);
|
|
|
var aAdoQuery:TAdoQuery;
|
|
|
amt:Double;
|
|
|
begin
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
with aAdoQuery do
|
|
|
try
|
|
|
close;
|
|
|
SQL.clear;
|
|
|
sql.add('select sum(<28><><EFBFBD><EFBFBD>+˰<><CBB0>) Amt');
|
|
|
sql.Add('from t_ch_invoice_shen_item ');
|
|
|
sql.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
Open;First;
|
|
|
amt:=fieldbyname('Amt').AsFloat;
|
|
|
|
|
|
close;
|
|
|
SQL.clear;
|
|
|
sql.add('update t_ch_invoice_shen set <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ʵ<>ʽ<EFBFBD><CABD><EFBFBD>=:ʵ<>ʽ<EFBFBD><CABD><EFBFBD>');
|
|
|
sql.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
Parameters.ParamByName('ʵ<>ʽ<EFBFBD><CABD><EFBFBD>').Value:=Amt;
|
|
|
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=Amt;
|
|
|
ExecSQL;
|
|
|
t_ch_invoice_shen.Refresh;
|
|
|
|
|
|
finally
|
|
|
Free;
|
|
|
end;
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_ch_invoice_shen.t_ch_invoice_shen_itemBeforeInsert(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
if t_ch_invoice_shen.state in [dsedit,dsinsert] then t_ch_invoice_shen.post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end.
|