466 lines
13 KiB
ObjectPascal
466 lines
13 KiB
ObjectPascal
![]() |
unit U_InvoiceXXInPut;
|
|||
|
|
|||
|
interface
|
|||
|
|
|||
|
uses
|
|||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
Dialogs, ComCtrls, ToolWin, cxStyles, cxCustomData, cxGraphics, cxFilter,
|
|||
|
cxData, cxDataStorage, cxEdit, DB, cxDBData, cxGridLevel, cxClasses,
|
|||
|
cxControls, cxGridCustomView, cxGridCustomTableView, cxGridTableView,
|
|||
|
cxGridDBTableView, cxGrid, cxGridCustomPopupMenu, cxGridPopupMenu, ADODB,
|
|||
|
DBClient, ExtCtrls, StdCtrls, BtnEdit, cxButtonEdit, cxTextEdit,
|
|||
|
cxDropDownEdit, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, cxCalendar,
|
|||
|
dxSkinsCore, dxSkinsDefaultPainters, dxDateRanges, dxBarBuiltInMenu;
|
|||
|
|
|||
|
type
|
|||
|
TfrmInvoiceXXInPut = class(TForm)
|
|||
|
DataSource1: TDataSource;
|
|||
|
CDS_Invoice: TClientDataSet;
|
|||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
ToolBar1: TToolBar;
|
|||
|
TSave: TToolButton;
|
|||
|
TBClose: TToolButton;
|
|||
|
cxGrid1: TcxGrid;
|
|||
|
Tv1: TcxGridDBTableView;
|
|||
|
v1P_CodeName: TcxGridDBColumn;
|
|||
|
v1P_Spec: TcxGridDBColumn;
|
|||
|
v1Qty: TcxGridDBColumn;
|
|||
|
v1Price: TcxGridDBColumn;
|
|||
|
v1QtyUnit: TcxGridDBColumn;
|
|||
|
v1Money: TcxGridDBColumn;
|
|||
|
cxGridLevel1: TcxGridLevel;
|
|||
|
ADOQueryTmp: TADOQuery;
|
|||
|
ADOQueryCmd: TADOQuery;
|
|||
|
v1Column1: TcxGridDBColumn;
|
|||
|
v1Column3: TcxGridDBColumn;
|
|||
|
v1Column4: TcxGridDBColumn;
|
|||
|
v1Column5: TcxGridDBColumn;
|
|||
|
Tv1Column1: TcxGridDBColumn;
|
|||
|
Tv1Column2: TcxGridDBColumn;
|
|||
|
Tv1Column3: TcxGridDBColumn;
|
|||
|
Tv1Column4: TcxGridDBColumn;
|
|||
|
Tv1Column5: TcxGridDBColumn;
|
|||
|
Tv1Column6: TcxGridDBColumn;
|
|||
|
Tv1Column7: TcxGridDBColumn;
|
|||
|
ToolButton1: TToolButton;
|
|||
|
ToolButton2: TToolButton;
|
|||
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
procedure FormShow(Sender: TObject);
|
|||
|
procedure TSaveClick(Sender: TObject);
|
|||
|
procedure v1P_CodeNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
procedure v1P_SpecPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
procedure v1QtyUnitPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
procedure v1PriceUnitPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
procedure v1QtyPropertiesEditValueChanged(Sender: TObject);
|
|||
|
procedure FormDestroy(Sender: TObject);
|
|||
|
procedure Tv1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
procedure Tv1Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
procedure Tv1Column4PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
procedure Tv1Column6PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
procedure ToolButton2Click(Sender: TObject);
|
|||
|
private
|
|||
|
procedure initGrid();
|
|||
|
procedure SaveDate();
|
|||
|
{ Private declarations }
|
|||
|
public
|
|||
|
FIVNo, FZKType: string;
|
|||
|
fInvoiceFlag: string;
|
|||
|
{ Public declarations }
|
|||
|
end;
|
|||
|
|
|||
|
var
|
|||
|
frmInvoiceXXInPut: TfrmInvoiceXXInPut;
|
|||
|
|
|||
|
implementation
|
|||
|
|
|||
|
uses
|
|||
|
U_RTFun, U_ZDYHelp, U_ZdyAttachment, U_dataLink, U_KHSel;
|
|||
|
{$R *.dfm}
|
|||
|
|
|||
|
procedure TfrmInvoiceXXInPut.SaveDate();
|
|||
|
var
|
|||
|
MaxNo: string;
|
|||
|
begin
|
|||
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
try
|
|||
|
with CDS_Invoice do
|
|||
|
begin
|
|||
|
first;
|
|||
|
while not eof do
|
|||
|
begin
|
|||
|
if fieldbyname('IVID').AsString = '' then
|
|||
|
begin
|
|||
|
if GetLSNo(ADOQueryTmp, MaxNo, 'IJ', 'CW_Invoice', 4, 1) = False then
|
|||
|
begin
|
|||
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end
|
|||
|
else
|
|||
|
MaxNo := CDS_Invoice.fieldbyname('IVID').AsString;
|
|||
|
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.add('select * from CW_Invoice where IVID=' + quotedstr(Trim(MaxNo)));
|
|||
|
open;
|
|||
|
end;
|
|||
|
if ADOQueryCmd.IsEmpty then
|
|||
|
begin
|
|||
|
ADOQueryCmd.append;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
ADOQueryCmd.edit;
|
|||
|
end;
|
|||
|
ADOQueryCmd.fieldbyname('IVID').Value := MaxNo;
|
|||
|
ADOQueryCmd.fieldbyname('IVFlag').Value := '<27><><EFBFBD><EFBFBD>';
|
|||
|
ADOQueryCmd.fieldbyname('ZKType').Value := Trim(FZKType);
|
|||
|
ADOQueryCmd.fieldbyname('KPFactoryNo').Value := trim(CDS_Invoice.FieldByName('KPFactoryNo').AsString);
|
|||
|
ADOQueryCmd.fieldbyname('FactoryNo').Value := trim(CDS_Invoice.FieldByName('FactoryNo').AsString);
|
|||
|
|
|||
|
RTSetSaveDataCDS(ADOQueryCmd, Tv1, CDS_Invoice, 'CW_Invoice', 0);
|
|||
|
ADOQueryCmd.Post;
|
|||
|
next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ');
|
|||
|
Modalresult := 1;
|
|||
|
except
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', MB_ICONERROR);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmInvoiceXXInPut.initGrid();
|
|||
|
begin
|
|||
|
with ADOQueryTmp do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from CW_Invoice where IVNo=''' + trim(FIVNo) + '''');
|
|||
|
open;
|
|||
|
end;
|
|||
|
|
|||
|
SCreateCDS(ADOQueryTmp, CDS_Invoice);
|
|||
|
SInitCDSData(ADOQueryTmp, CDS_Invoice);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmInvoiceXXInPut.TBCloseClick(Sender: TObject);
|
|||
|
begin
|
|||
|
WriteCxGrid('<27><>Ʊ¼<C6B1><C2BC>', Tv1, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
Close;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmInvoiceXXInPut.FormShow(Sender: TObject);
|
|||
|
begin
|
|||
|
ReadCxGrid('<27><>Ʊ¼<C6B1><C2BC>', Tv1, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
|||
|
initGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmInvoiceXXInPut.TSaveClick(Sender: TObject);
|
|||
|
begin
|
|||
|
|
|||
|
if CDS_Invoice.Locate('IVNo', null, []) then
|
|||
|
begin
|
|||
|
application.MessageBox('<27><>Ʊ<EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>', '<27><>ʾ');
|
|||
|
exit;
|
|||
|
end;
|
|||
|
if CDS_Invoice.Locate('IVType', null, []) then
|
|||
|
begin
|
|||
|
application.MessageBox('<27><>Ʊ<EFBFBD><C6B1><EFBFBD>Ͳ<EFBFBD><CDB2><EFBFBD>Ϊ<EFBFBD><CEAA>', '<27><>ʾ');
|
|||
|
exit;
|
|||
|
end;
|
|||
|
if CDS_Invoice.Locate('FactoryName', null, []) then
|
|||
|
begin
|
|||
|
application.MessageBox('<27>Է<EFBFBD><D4B7><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>', '<27><>ʾ');
|
|||
|
exit;
|
|||
|
end;
|
|||
|
// if Trim(FIVNo) = '' then
|
|||
|
// begin
|
|||
|
// with ADOQueryTmp do
|
|||
|
// begin
|
|||
|
// close;
|
|||
|
// sql.clear;
|
|||
|
// sql.add('select * from CW_Invoice where CONVERT( varchar(10),IVDate,120)<>''' + formatdatetime('yyyy-MM-dd', IVDate.datetime) + ''' ');
|
|||
|
// sql.add(' and IVNo=' + QUOTEDSTR(trim(IVNo.Text)));
|
|||
|
// open;
|
|||
|
// end;
|
|||
|
//
|
|||
|
// if not ADOQueryTmp.IsEmpty then
|
|||
|
// begin
|
|||
|
// application.MessageBox('<27><>Ʊ<EFBFBD>Ų<EFBFBD><C5B2><EFBFBD><EFBFBD>ظ<EFBFBD>', '<27><>ʾ');
|
|||
|
// exit;
|
|||
|
// end;
|
|||
|
// end;
|
|||
|
SaveDate();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmInvoiceXXInPut.v1P_CodeNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag := 'MPRTCodeName';
|
|||
|
flagname := '<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>';
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
Self.CDS_Invoice.Edit;
|
|||
|
Self.CDS_Invoice.FieldByName('P_CodeName').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
Self.CDS_Invoice.FieldByName('P_Code').Value := Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
//self.tv1.Controller.EditingController.ShowEdit();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmInvoiceXXInPut.v1P_SpecPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag := 'P_Spec';
|
|||
|
flagname := '<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>';
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
Self.CDS_Invoice.Edit;
|
|||
|
Self.CDS_Invoice.FieldByName('P_Spec').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmInvoiceXXInPut.v1QtyUnitPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag := 'QtyUnit';
|
|||
|
flagname := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ';
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
Self.CDS_Invoice.Edit;
|
|||
|
Self.CDS_Invoice.FieldByName('QtyUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmInvoiceXXInPut.v1PriceUnitPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag := 'PriceUnit';
|
|||
|
flagname := '<27><><EFBFBD><EFBFBD>';
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
Self.CDS_Invoice.Edit;
|
|||
|
Self.CDS_Invoice.FieldByName('PriceUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmInvoiceXXInPut.v1QtyPropertiesEditValueChanged(Sender: TObject);
|
|||
|
var
|
|||
|
mvalue, FFieldName: string;
|
|||
|
FQty, FPrice, FMoney, Ftax, FtaxMoney: double;
|
|||
|
begin
|
|||
|
FFieldName := Trim(Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
|||
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
if Trim(mvalue) = '' then
|
|||
|
begin
|
|||
|
mvalue := '0';
|
|||
|
end;
|
|||
|
with CDS_Invoice do
|
|||
|
begin
|
|||
|
Edit;
|
|||
|
FieldByName(FFieldName).Value := Trim(mvalue);
|
|||
|
Post;
|
|||
|
FQty := FieldbyName('Qty').AsFloat;
|
|||
|
FtaxMoney := FieldbyName('taxMoney').AsFloat;
|
|||
|
Ftax := FieldbyName('tax').AsFloat;
|
|||
|
end;
|
|||
|
if FQty <> 0 then
|
|||
|
begin
|
|||
|
|
|||
|
FMoney := strtofloat(format('%.2f', [FtaxMoney / (1 + Ftax / 100)]));
|
|||
|
FPrice := strtofloat(format('%.2f', [FMoney / FQty]));
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
FPrice := 0;
|
|||
|
FMoney := strtofloat(format('%.2f', [FtaxMoney / (1 + Ftax / 100)]));
|
|||
|
end;
|
|||
|
|
|||
|
with CDS_Invoice do
|
|||
|
begin
|
|||
|
Edit;
|
|||
|
FieldByName('Price').Value := FPrice;
|
|||
|
FieldByName('Money').Value := FMoney;
|
|||
|
FieldByName('TaxFee').Value := FtaxMoney - FMoney;
|
|||
|
Post;
|
|||
|
end;
|
|||
|
tv1.Controller.EditingController.ShowEdit();
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmInvoiceXXInPut.FormDestroy(Sender: TObject);
|
|||
|
begin
|
|||
|
frmInvoiceXXInPut := nil;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmInvoiceXXInPut.Tv1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag := 'YFFtySYRName';
|
|||
|
flagname := '<27>Է<EFBFBD>̧ͷ';
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
Self.CDS_Invoice.Edit;
|
|||
|
Self.CDS_Invoice.FieldByName('KPFactoryName').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmInvoiceXXInPut.Tv1Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag := 'InvoiceType';
|
|||
|
flagname := '<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>';
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
Self.CDS_Invoice.Edit;
|
|||
|
Self.CDS_Invoice.FieldByName('IVType').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmInvoiceXXInPut.Tv1Column4PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
begin
|
|||
|
// try
|
|||
|
// frmKHSel := TfrmKHSel.Create(Application);
|
|||
|
// with frmKHSel do
|
|||
|
// begin
|
|||
|
// if ShowModal = 1 then
|
|||
|
// begin
|
|||
|
// Self.CDS_Invoice.Edit;
|
|||
|
// Self.CDS_Invoice.FieldByName('FactoryNo').Value := Trim(Order_Main.fieldbyname('CoCode').AsString);
|
|||
|
// Self.CDS_Invoice.FieldByName('FactoryName').Value := Trim(Order_Main.fieldbyname('KHName').AsString);
|
|||
|
// Self.CDS_Invoice.FieldByName('KPFactoryNo').Value := Trim(Order_Main.fieldbyname('CoCode').AsString);
|
|||
|
// Self.CDS_Invoice.FieldByName('KPFactoryName').Value := Trim(Order_Main.fieldbyname('KHName').AsString);
|
|||
|
// end;
|
|||
|
// end;
|
|||
|
// finally
|
|||
|
// frmKHSel.Free;
|
|||
|
// end;
|
|||
|
|
|||
|
try
|
|||
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag := 'khNAME';
|
|||
|
flagname := '<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
|
|||
|
with ClientDataSet1 do
|
|||
|
begin
|
|||
|
Self.CDS_Invoice.Edit;
|
|||
|
Self.CDS_Invoice.FieldByName('KPFactoryName').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
Self.CDS_Invoice.FieldByName('FactoryName').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmInvoiceXXInPut.Tv1Column6PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag := 'SYRName';
|
|||
|
flagname := '<27><>˾̧ͷ';
|
|||
|
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
// SYRName.Text := Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmInvoiceXXInPut.ToolButton1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
CDS_Invoice.Append;
|
|||
|
|
|||
|
CDS_Invoice.FieldByName('QtyUnit').Value := 'Kg';
|
|||
|
CDS_Invoice.FieldByName('Money').Value := 0;
|
|||
|
CDS_Invoice.FieldByName('Qty').Value := 0;
|
|||
|
CDS_Invoice.FieldByName('tax').Value := 0;
|
|||
|
CDS_Invoice.FieldByName('TaxFee').Value := 0;
|
|||
|
CDS_Invoice.FieldByName('taxMoney').Value := 0;
|
|||
|
CDS_Invoice.FieldByName('Price').Value := 0;
|
|||
|
CDS_Invoice.FieldByName('tax').Value := 13;
|
|||
|
CDS_Invoice.FieldByName('IVDate').Value := now();
|
|||
|
CDS_Invoice.Post;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmInvoiceXXInPut.ToolButton2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Invoice.IsEmpty then
|
|||
|
exit;
|
|||
|
if application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD>', '<27><>ʾ', 1) = 2 then
|
|||
|
exit;
|
|||
|
with ADOQueryTmp do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.clear;
|
|||
|
sql.add('delete from CW_Invoice where IvID=''' + trim(CDS_Invoice.fieldbyname('IvID').asstring) + ''' ');
|
|||
|
execsql;
|
|||
|
end;
|
|||
|
CDS_Invoice.delete;
|
|||
|
end;
|
|||
|
|
|||
|
end.
|
|||
|
|