469 lines
16 KiB
ObjectPascal
469 lines
16 KiB
ObjectPascal
|
|
unit U_PayableBatchInput;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
|||
|
|
cxEdit, DB, cxDBData, cxCalendar, cxDropDownEdit, ComCtrls, ToolWin,
|
|||
|
|
cxGridLevel, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
|
|||
|
|
cxClasses, cxControls, cxGridCustomView, cxGrid, cxGridCustomPopupMenu,
|
|||
|
|
cxGridPopupMenu, ADODB, DBClient, cxButtonEdit, cxTextEdit, cxSpinEdit,
|
|||
|
|
StdCtrls, ExtCtrls, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator,
|
|||
|
|
dxDateRanges, dxBarBuiltInMenu, U_BaseInput, System.ImageList, Vcl.ImgList,
|
|||
|
|
dxScrollbarAnnotations, dxSkinsCore, dxSkinsDefaultPainters, cxImageList,
|
|||
|
|
dxSkinOffice2013White, dxSkinSharpPlus, dxSkinWXI, cxCheckBox;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmPayableBatchInput = class(TfrmBaseInput)
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
TBAdd: TToolButton;
|
|||
|
|
TBDel: TToolButton;
|
|||
|
|
TBSave: TToolButton;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
DS_1: TDataSource;
|
|||
|
|
CDS_1: TClientDataSet;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
ADOQueryMain: TADOQuery;
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
GPM_1: TcxGridPopupMenu;
|
|||
|
|
ToolButton1: TToolButton;
|
|||
|
|
cxGrid1: TcxGrid;
|
|||
|
|
Tv1: TcxGridDBTableView;
|
|||
|
|
Tv1Column22: TcxGridDBColumn;
|
|||
|
|
Tv1FFTime: TcxGridDBColumn;
|
|||
|
|
Tv1ReconciliationDate: TcxGridDBColumn;
|
|||
|
|
TV1OurCoName: TcxGridDBColumn;
|
|||
|
|
Tv1OppCoName: TcxGridDBColumn;
|
|||
|
|
Tv1FFAbstract: TcxGridDBColumn;
|
|||
|
|
Tv1ConNo: TcxGridDBColumn;
|
|||
|
|
Tv1OrderNo: TcxGridDBColumn;
|
|||
|
|
Tv1BuyConNo: TcxGridDBColumn;
|
|||
|
|
Tv1F_Code: TcxGridDBColumn;
|
|||
|
|
Tv1F_Name: TcxGridDBColumn;
|
|||
|
|
Tv1F_Width: TcxGridDBColumn;
|
|||
|
|
Tv1F_GramWeight: TcxGridDBColumn;
|
|||
|
|
Tv1F_Color: TcxGridDBColumn;
|
|||
|
|
Tv1Piece: TcxGridDBColumn;
|
|||
|
|
Tv1Qty: TcxGridDBColumn;
|
|||
|
|
Tv1QtyUnit: TcxGridDBColumn;
|
|||
|
|
Tv1Currency: TcxGridDBColumn;
|
|||
|
|
Tv1NoTaxPrice: TcxGridDBColumn;
|
|||
|
|
Tv1NoTaxInclude: TcxGridDBColumn;
|
|||
|
|
Tv1TaxRate: TcxGridDBColumn;
|
|||
|
|
Tv1Tax: TcxGridDBColumn;
|
|||
|
|
Tv1TaxInclude: TcxGridDBColumn;
|
|||
|
|
Tv1Note: TcxGridDBColumn;
|
|||
|
|
Tv1FromID1: TcxGridDBColumn;
|
|||
|
|
cxGridLevel1: TcxGridLevel;
|
|||
|
|
TbOrdAdd: TToolButton;
|
|||
|
|
Tv1PurNo: TcxGridDBColumn;
|
|||
|
|
Tv1FinType: TcxGridDBColumn;
|
|||
|
|
TbPurSel: TToolButton;
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure TBSaveClick(Sender: TObject);
|
|||
|
|
procedure Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|||
|
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
|
procedure Tv1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure TBAddClick(Sender: TObject);
|
|||
|
|
procedure TBDelClick(Sender: TObject);
|
|||
|
|
procedure TbOrdAddClick(Sender: TObject);
|
|||
|
|
procedure TbPurSelClick(Sender: TObject);
|
|||
|
|
|
|||
|
|
private
|
|||
|
|
{ Private declarations }
|
|||
|
|
function SaveData(): Boolean;
|
|||
|
|
procedure InitGrid();
|
|||
|
|
public
|
|||
|
|
{ Public declarations }
|
|||
|
|
FBCId, FKHName: string;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmPayableBatchInput: TfrmPayableBatchInput;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
U_DataLink, U_RTFun, U_ZDYHelp, U_CompanySel, U_FinTradePlanSel,
|
|||
|
|
U_FinPurchasePlanSel;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmPayableBatchInput.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
Action := caFree;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPayableBatchInput.InitGrid();
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
Filtered := False;
|
|||
|
|
sql.Add(' select A.* ');
|
|||
|
|
sql.Add(' from Finance_Flow A ');
|
|||
|
|
sql.Add(' where 1=2 ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS(ADOQueryMain, CDS_1);
|
|||
|
|
SInitCDSData(ADOQueryMain, CDS_1);
|
|||
|
|
finally
|
|||
|
|
ADOQueryMain.EnableControls;
|
|||
|
|
TV1.DataController.Filter.Clear;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmPayableBatchInput.SaveData(): Boolean;
|
|||
|
|
var
|
|||
|
|
Maxno, MFFID: string;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
CDS_1.DisableControls;
|
|||
|
|
with CDS_1 do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from Finance_Flow where FFID=''' + Trim(CDS_1.fieldbyname('FFID').AsString) + '''');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
MFFID := Trim(ADOQueryTemp.fieldbyname('FFID').AsString);
|
|||
|
|
if Trim(MFFID) = '' then
|
|||
|
|
begin
|
|||
|
|
if not GetLSNo(ADOQueryCmd, Maxno, 'YFK', 'Finance_Flow', 3, 1) then
|
|||
|
|
raise Exception.Create('ȡӦ<C8A1>տ<EFBFBD><D5BF><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Maxno := Trim(MFFID);
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from Finance_Flow where FFID=''' + Trim(Maxno) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
if Trim(MFFID) = '' then
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('Fillid').Value := Trim(Dcode);
|
|||
|
|
FieldByName('Filler').Value := Trim(DName);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('Editid').Value := Trim(Dcode);
|
|||
|
|
FieldByName('Editer').Value := Trim(DName);
|
|||
|
|
FieldByName('EditTime').Value := SGetServerDate(ADOQueryTemp);
|
|||
|
|
end;
|
|||
|
|
RTSetSaveDataCDS(ADOQueryCmd, Tv1, CDS_1, 'Finance_Flow', 0);
|
|||
|
|
|
|||
|
|
FieldByName('FFID').Value := Maxno;
|
|||
|
|
FieldByName('FFFlag').Value := 'Ӧ<><D3A6><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('FFType').Value := 'Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>';
|
|||
|
|
|
|||
|
|
|
|||
|
|
//֯<>쵥<EFBFBD><ECB5A5>
|
|||
|
|
FieldByName('OrdMainId').Value := CDS_1.fieldbyname('OrdMainId').Value;
|
|||
|
|
FieldByName('OrdSubId').Value := CDS_1.fieldbyname('OrdSubId').Value;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ
|
|||
|
|
FieldByName('ConMId').Value := CDS_1.fieldbyname('ConMId').value;
|
|||
|
|
FieldByName('ConSId').Value := CDS_1.fieldbyname('ConSId').value;
|
|||
|
|
//<2F><><EFBFBD>Ϻ<EFBFBD>ͬ
|
|||
|
|
FieldByName('BuyConMID').Value := CDS_1.fieldbyname('BuyConMID').value;
|
|||
|
|
FieldByName('BuyConSID').Value := CDS_1.fieldbyname('BuyConSID').Value;
|
|||
|
|
//<2F>Է<EFBFBD><D4B7><EFBFBD>λ
|
|||
|
|
FieldByName('OppCoNo').Value := CDS_1.fieldbyname('OppCoNo').Value;
|
|||
|
|
//<2F>ҷ<EFBFBD><D2B7><EFBFBD>λ
|
|||
|
|
FieldByName('OurCoNo').Value := CDS_1.fieldbyname('OurCoNo').Value;
|
|||
|
|
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('insert into Finance_Need_Up(UType,UDataId,UOperation,UOperator,UModule,UDetails)');
|
|||
|
|
sql.Add('values(''Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>'' ');
|
|||
|
|
sql.Add(',' + quotedstr(Maxno));
|
|||
|
|
sql.Add(',''<27><><EFBFBD><EFBFBD>'' ');
|
|||
|
|
sql.Add(',' + quotedstr(DName));
|
|||
|
|
sql.Add(',' + quotedstr(trim(self.Caption)));
|
|||
|
|
sql.Add(',' + quotedstr(Maxno));
|
|||
|
|
sql.Add(') ');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
CDS_1.EnableControls;
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
Result := True;
|
|||
|
|
except
|
|||
|
|
Result := False;
|
|||
|
|
CDS_1.EnableControls;
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPayableBatchInput.TBAddClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
CDS_1.Append;
|
|||
|
|
CDS_1.FieldByName('FFTime').Value := SGetServerDateTime(ADOQueryCmd);
|
|||
|
|
CDS_1.FieldByName('ReconciliationDate').Value := SGetServerDate(ADOQueryCmd);
|
|||
|
|
CDS_1.FieldByName('OurCoName').Value := 'DESHINE VIETNAM CO., LTD';
|
|||
|
|
CDS_1.FieldByName('SSel').Value := False;
|
|||
|
|
CDS_1.Post;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPayableBatchInput.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
Close;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPayableBatchInput.TBDelClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
CDS_1.Delete;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPayableBatchInput.TbOrdAddClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmFinTradePlanSel := TfrmFinTradePlanSel.Create(Application);
|
|||
|
|
with frmFinTradePlanSel do
|
|||
|
|
begin
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
with frmFinTradePlanSel.CDS_1 do
|
|||
|
|
begin
|
|||
|
|
//֯<>쵥
|
|||
|
|
self.CDS_1.FieldByName('OrderNo').AsString := Trim(frmFinTradePlanSel.CDS_1.fieldbyname('OrderNo').AsString);
|
|||
|
|
self.CDS_1.FieldByName('OrdMainId').AsString := Trim(frmFinTradePlanSel.CDS_1.fieldbyname('MainId').AsString);
|
|||
|
|
self.CDS_1.FieldByName('OrdSubId').AsString := Trim(frmFinTradePlanSel.CDS_1.fieldbyname('SubId').AsString);
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ
|
|||
|
|
self.CDS_1.FieldByName('ConNo').AsString := Trim(frmFinTradePlanSel.CDS_1.fieldbyname('ConNo').AsString);
|
|||
|
|
self.CDS_1.FieldByName('ConMId').AsString := Trim(frmFinTradePlanSel.CDS_1.fieldbyname('ConMId').AsString);
|
|||
|
|
self.CDS_1.FieldByName('ConSId').AsString := Trim(frmFinTradePlanSel.CDS_1.fieldbyname('ConSId').AsString);
|
|||
|
|
//<2F><><EFBFBD>Ϻ<EFBFBD>ͬ
|
|||
|
|
self.CDS_1.FieldByName('BuyConNo').AsString := Trim(frmFinTradePlanSel.CDS_1.fieldbyname('BuyConNo').AsString);
|
|||
|
|
self.CDS_1.FieldByName('BuyConMID').AsString := Trim(frmFinTradePlanSel.CDS_1.fieldbyname('FROMCPSID').AsString);
|
|||
|
|
self.CDS_1.FieldByName('BuyConSID').AsString := Trim(frmFinTradePlanSel.CDS_1.fieldbyname('FROMCPMID').AsString);
|
|||
|
|
|
|||
|
|
self.CDS_1.FieldByName('F_Code').AsString := Trim(frmFinTradePlanSel.CDS_1.fieldbyname('OrderNo').AsString);
|
|||
|
|
self.CDS_1.FieldByName('F_Name').AsString := Trim(frmFinTradePlanSel.CDS_1.fieldbyname('MainId').AsString);
|
|||
|
|
self.CDS_1.FieldByName('F_Width').AsString := Trim(frmFinTradePlanSel.CDS_1.fieldbyname('SubId').AsString);
|
|||
|
|
self.CDS_1.FieldByName('F_GramWeight').AsString := Trim(frmFinTradePlanSel.CDS_1.fieldbyname('OrderNo').AsString);
|
|||
|
|
self.CDS_1.FieldByName('F_Color').AsString := Trim(frmFinTradePlanSel.CDS_1.fieldbyname('MainId').AsString);
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmFinTradePlanSel.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPayableBatchInput.FormShow(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fsj: string;
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
ReadCxGrid('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>', Tv1, 'Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>');
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPayableBatchInput.TBSaveClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if CDS_1.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
if CDS_1.Locate('FFTime', null, []) = True then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Ǽ<EFBFBD><C7BC><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if CDS_1.Locate('ReconciliationDate', null, []) = True then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if CDS_1.Locate('FinType', null, []) = True then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if CDS_1.Locate('Qty', null, []) = True then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
// CDS_1.First;
|
|||
|
|
// while not CDS_1.Eof do
|
|||
|
|
// begin
|
|||
|
|
// // ͬʱ<CDAC>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
// if (CDS_1.FieldByName('IOType').AsString = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') and (CDS_1.FieldByName('ToOrdNo').IsNull or (Trim(CDS_1.FieldByName('ToOrdNo').AsString) = '')) then
|
|||
|
|
// begin
|
|||
|
|
// Application.MessageBox('<27><>ѡ<EFBFBD><EFBFBD><F1B3B5BC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>֯<EFBFBD>쵥!', '<27><>ʾ', 0);
|
|||
|
|
// Exit;
|
|||
|
|
// end;
|
|||
|
|
// CDS_1.Next;
|
|||
|
|
// end;
|
|||
|
|
|
|||
|
|
if SaveData() then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
//ModalResult:=1;
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPayableBatchInput.ToolButton1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
WriteCxGrid('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>', Tv1, 'Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPayableBatchInput.TbPurSelClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmFinPurchasePlanSel := TfrmFinPurchasePlanSel.Create(Application);
|
|||
|
|
with frmFinPurchasePlanSel do
|
|||
|
|
begin
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
with frmFinPurchasePlanSel.CDS_1 do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
if CDS_1.fieldbyname('SSel').AsBoolean then
|
|||
|
|
begin
|
|||
|
|
with Self.CDS_1 do
|
|||
|
|
begin
|
|||
|
|
append;
|
|||
|
|
//<2F>ҷ<EFBFBD><D2B7><EFBFBD>λ
|
|||
|
|
self.CDS_1.FieldByName('FFTime').Value := SGetServerDateTime(ADOQueryCmd);
|
|||
|
|
self.CDS_1.FieldByName('ReconciliationDate').Value := SGetServerDate(ADOQueryCmd);
|
|||
|
|
self.CDS_1.FieldByName('OurCoName').Value := 'DESHINE VIETNAM CO., LTD';
|
|||
|
|
self.CDS_1.FieldByName('FinType').Value := 'ɴ<><C9B4>';
|
|||
|
|
self.CDS_1.FieldByName('SSel').Value := False;
|
|||
|
|
//֯<>쵥
|
|||
|
|
self.CDS_1.FieldByName('PurNo').AsString := Trim(frmFinPurchasePlanSel.CDS_1.fieldbyname('PurNo').AsString);
|
|||
|
|
self.CDS_1.FieldByName('PurMID').AsString := Trim(frmFinPurchasePlanSel.CDS_1.fieldbyname('PurMId').AsString);
|
|||
|
|
self.CDS_1.FieldByName('PurSID').AsString := Trim(frmFinPurchasePlanSel.CDS_1.fieldbyname('PurSId').AsString);
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ
|
|||
|
|
self.CDS_1.FieldByName('ConNo').AsString := Trim(frmFinPurchasePlanSel.CDS_1.fieldbyname('ConNo').AsString);
|
|||
|
|
self.CDS_1.FieldByName('ConMId').AsString := Trim(frmFinPurchasePlanSel.CDS_1.fieldbyname('fromConMId').AsString);
|
|||
|
|
self.CDS_1.FieldByName('ConSId').AsString := Trim(frmFinPurchasePlanSel.CDS_1.fieldbyname('fromConSId').AsString);
|
|||
|
|
//<2F><><EFBFBD>Ϻ<EFBFBD>ͬ
|
|||
|
|
self.CDS_1.FieldByName('BuyConNo').AsString := Trim(frmFinPurchasePlanSel.CDS_1.fieldbyname('CPConNo').AsString);
|
|||
|
|
self.CDS_1.FieldByName('BuyConMID').AsString := Trim(frmFinPurchasePlanSel.CDS_1.fieldbyname('FROMCPSID').AsString);
|
|||
|
|
self.CDS_1.FieldByName('BuyConSID').AsString := Trim(frmFinPurchasePlanSel.CDS_1.fieldbyname('FROMCPMID').AsString);
|
|||
|
|
|
|||
|
|
self.CDS_1.FieldByName('F_Code').AsString := Trim(frmFinPurchasePlanSel.CDS_1.fieldbyname('Y_Code').AsString);
|
|||
|
|
self.CDS_1.FieldByName('F_Name').AsString := Trim(frmFinPurchasePlanSel.CDS_1.fieldbyname('Y_Name').AsString);
|
|||
|
|
// self.CDS_1.FieldByName('F_Width').AsString := Trim(frmFinPurchasePlanSel.CDS_1.fieldbyname('SubId').AsString);
|
|||
|
|
// self.CDS_1.FieldByName('F_GramWeight').AsString := Trim(frmFinPurchasePlanSel.CDS_1.fieldbyname('C_GramWeight').AsString);
|
|||
|
|
self.CDS_1.FieldByName('F_Color').AsString := Trim(frmFinPurchasePlanSel.CDS_1.fieldbyname('Y_Color').AsString);
|
|||
|
|
self.CDS_1.FieldByName('Piece').AsString := Trim(frmFinPurchasePlanSel.CDS_1.fieldbyname('Piece').AsString);
|
|||
|
|
self.CDS_1.FieldByName('Qty').AsString := Trim(frmFinPurchasePlanSel.CDS_1.fieldbyname('Qty').AsString);
|
|||
|
|
self.CDS_1.FieldByName('QtyUnit').AsString := Trim(frmFinPurchasePlanSel.CDS_1.fieldbyname('QtyUnit').AsString);
|
|||
|
|
self.CDS_1.FieldByName('currency').AsString := Trim(frmFinPurchasePlanSel.CDS_1.fieldbyname('currency').AsString);
|
|||
|
|
self.CDS_1.FieldByName('NoTaxPrice').AsString := Trim(frmFinPurchasePlanSel.CDS_1.fieldbyname('Piece').AsString);
|
|||
|
|
self.CDS_1.FieldByName('NoTaxInclude').AsString := Trim(frmFinPurchasePlanSel.CDS_1.fieldbyname('Amount').AsString);
|
|||
|
|
self.CDS_1.FieldByName('TaxRate').AsString := Trim(frmFinPurchasePlanSel.CDS_1.fieldbyname('TaxRate').AsString);
|
|||
|
|
self.CDS_1.FieldByName('Tax').AsString := Trim(frmFinPurchasePlanSel.CDS_1.fieldbyname('Tax').AsString);
|
|||
|
|
self.CDS_1.FieldByName('TaxInclude').AsString := Trim(frmFinPurchasePlanSel.CDS_1.fieldbyname('TaxInclude').AsString);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
frmFinPurchasePlanSel.CDS_1.Next;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmFinPurchasePlanSel.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPayableBatchInput.Tv1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmCompanySel := TfrmCompanySel.Create(Application);
|
|||
|
|
with frmCompanySel do
|
|||
|
|
begin
|
|||
|
|
FCoType := '<27><>Ӧ<EFBFBD><D3A6>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
with Self.CDS_1 do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('ToCoNo').Value := Trim(CDS_1.fieldbyname('CoCode').AsString);
|
|||
|
|
FieldByName('ToCoName').Value := Trim(CDS_1.fieldbyname('CoAbbrName').AsString);
|
|||
|
|
post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmCompanySel.Free;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPayableBatchInput.Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|||
|
|
var
|
|||
|
|
FFSPID: string;
|
|||
|
|
begin
|
|||
|
|
// if CDS_Sub.IsEmpty then
|
|||
|
|
// Exit;
|
|||
|
|
// if Trim(CDS_Sub.fieldbyname('BYIOID').AsString) <> '' then
|
|||
|
|
// begin
|
|||
|
|
// with ADOQueryTemp do
|
|||
|
|
// begin
|
|||
|
|
// Close;
|
|||
|
|
// sql.Clear;
|
|||
|
|
// sql.Add('select * from BS_Yarn_IO where BYIOID=''' + Trim(CDS_Sub.fieldbyname('BYIOID').AsString) + '''');
|
|||
|
|
// Open;
|
|||
|
|
// end;
|
|||
|
|
// FFSPID := Trim(ADOQueryTemp.fieldbyname('BYIOID').AsString);
|
|||
|
|
// if Trim(FFSPID) <> '' then
|
|||
|
|
// begin
|
|||
|
|
// v1CRType.Options.Editing := False;
|
|||
|
|
// end
|
|||
|
|
// else
|
|||
|
|
// begin
|
|||
|
|
// v1CRType.Options.Editing := True;
|
|||
|
|
// end;
|
|||
|
|
// end
|
|||
|
|
// else
|
|||
|
|
// begin
|
|||
|
|
// v1CRType.Options.Editing := True;
|
|||
|
|
// end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|