2024-07-04 16:01:24 +08:00
|
|
|
|
unit U_ClothRSPlanPut;
|
|
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
|
|
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
|
|
|
|
|
cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView, cxGridTableView,
|
|
|
|
|
|
cxGridDBTableView, cxClasses, cxControls, cxGridCustomView, cxGrid, cxMemo,
|
|
|
|
|
|
cxRichEdit, ComCtrls, cxContainer, cxTextEdit, cxMaskEdit, cxButtonEdit,
|
|
|
|
|
|
StdCtrls, ToolWin, DBClient, ADODB, ExtCtrls, BtnEdit, cxCalendar, StrUtils,
|
|
|
|
|
|
cxDropDownEdit, cxGridCustomPopupMenu, cxGridPopupMenu, cxLookAndFeels,
|
|
|
|
|
|
cxLookAndFeelPainters, dxSkinsCore, dxSkinsDefaultPainters, cxNavigator,
|
|
|
|
|
|
dxDateRanges, dxBarBuiltInMenu, dxDateTimeWheelPicker, dxGDIPlusClasses,
|
|
|
|
|
|
Vcl.Menus, MovePanel, cxCheckBox, cxImage, cxDBEdit, Vcl.DBCtrls, U_BaseInput,
|
|
|
|
|
|
System.ImageList, Vcl.ImgList, IdBaseComponent, IdComponent, IdTCPConnection,
|
2024-09-20 16:26:35 +08:00
|
|
|
|
IdTCPClient, IdExplicitTLSClientServerBase, IdFTP, ShellAPI, dxSkinWXI,
|
|
|
|
|
|
dxScrollbarAnnotations;
|
2024-07-04 16:01:24 +08:00
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
TfrmClothRSPlanPut = class(TfrmBaseInput)
|
|
|
|
|
|
ToolBar1: TToolBar;
|
|
|
|
|
|
TBSave: TToolButton;
|
|
|
|
|
|
TBClose: TToolButton;
|
|
|
|
|
|
ToolBar2: TToolBar;
|
|
|
|
|
|
ToolButton1: TToolButton;
|
|
|
|
|
|
ToolButton2: TToolButton;
|
|
|
|
|
|
ADOTemp: TADOQuery;
|
|
|
|
|
|
ADOCmd: TADOQuery;
|
|
|
|
|
|
DS_1: TDataSource;
|
|
|
|
|
|
Order_Sub: TClientDataSet;
|
|
|
|
|
|
cxgrdpmn1: TcxGridPopupMenu;
|
|
|
|
|
|
pm_sub: TPopupMenu;
|
|
|
|
|
|
N1: TMenuItem;
|
|
|
|
|
|
N2: TMenuItem;
|
|
|
|
|
|
ToolButton3: TToolButton;
|
|
|
|
|
|
ScrollBox1: TScrollBox;
|
|
|
|
|
|
Label3: TLabel;
|
|
|
|
|
|
Label9: TLabel;
|
|
|
|
|
|
Label10: TLabel;
|
|
|
|
|
|
Label14: TLabel;
|
|
|
|
|
|
Label20: TLabel;
|
|
|
|
|
|
Label6: TLabel;
|
|
|
|
|
|
Label27: TLabel;
|
|
|
|
|
|
Label29: TLabel;
|
|
|
|
|
|
Label30: TLabel;
|
|
|
|
|
|
Label5: TLabel;
|
|
|
|
|
|
Label11: TLabel;
|
|
|
|
|
|
Label12: TLabel;
|
|
|
|
|
|
Label13: TLabel;
|
|
|
|
|
|
Label8: TLabel;
|
|
|
|
|
|
Label15: TLabel;
|
|
|
|
|
|
Label16: TLabel;
|
|
|
|
|
|
lblSalesId: TLabel;
|
|
|
|
|
|
Label25: TLabel;
|
|
|
|
|
|
PurDate: TDateTimePicker;
|
|
|
|
|
|
PurNo: TEdit;
|
|
|
|
|
|
BuyName: TBtnEditC;
|
|
|
|
|
|
QtyNote: TBtnEditC;
|
|
|
|
|
|
Sellname: TBtnEditC;
|
|
|
|
|
|
IsTax: TComboBox;
|
|
|
|
|
|
QiYun: TBtnEditC;
|
|
|
|
|
|
MuDi: TBtnEditC;
|
|
|
|
|
|
Currency: TComboBox;
|
|
|
|
|
|
YunShu: TBtnEditC;
|
|
|
|
|
|
Payment: TBtnEditC;
|
|
|
|
|
|
JiaGeSY: TBtnEditC;
|
|
|
|
|
|
Packing: TBtnEditC;
|
|
|
|
|
|
DlyDate: TDateTimePicker;
|
|
|
|
|
|
ShippMent: TEdit;
|
|
|
|
|
|
SalesId: TEdit;
|
|
|
|
|
|
TallyId: TEdit;
|
|
|
|
|
|
cxGrid1: TcxGrid;
|
|
|
|
|
|
TV1: TcxGridDBTableView;
|
|
|
|
|
|
cxGridDBColumn13: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn14: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn15: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn16: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn17: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn18: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn19: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn20: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn21: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn22: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn23: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn24: TcxGridDBColumn;
|
|
|
|
|
|
cxGridLevel1: TcxGridLevel;
|
|
|
|
|
|
ToolButton4: TToolButton;
|
|
|
|
|
|
TV1Column1: TcxGridDBColumn;
|
|
|
|
|
|
TV1Column2: TcxGridDBColumn;
|
|
|
|
|
|
TV1Column3: TcxGridDBColumn;
|
|
|
|
|
|
TV1Column4: TcxGridDBColumn;
|
|
|
|
|
|
TV1Column5: TcxGridDBColumn;
|
|
|
|
|
|
TV1Column6: TcxGridDBColumn;
|
|
|
|
|
|
Label1: TLabel;
|
|
|
|
|
|
SL: TEdit;
|
|
|
|
|
|
Label2: TLabel;
|
|
|
|
|
|
TV1Column7: TcxGridDBColumn;
|
|
|
|
|
|
Label4: TLabel;
|
|
|
|
|
|
FHS: TEdit;
|
|
|
|
|
|
Label7: TLabel;
|
|
|
|
|
|
DlyPlace: TBtnEditC;
|
|
|
|
|
|
Label17: TLabel;
|
|
|
|
|
|
SHAddress: TBtnEditC;
|
|
|
|
|
|
Purer: TBtnEditC;
|
|
|
|
|
|
Label18: TLabel;
|
|
|
|
|
|
ZLNote: TBtnEditC;
|
|
|
|
|
|
Label19: TLabel;
|
|
|
|
|
|
YSNote: TBtnEditC;
|
|
|
|
|
|
Label21: TLabel;
|
|
|
|
|
|
WYNote: TBtnEditC;
|
|
|
|
|
|
MainID: TEdit;
|
|
|
|
|
|
ADOQuery1: TADOQuery;
|
|
|
|
|
|
Label22: TLabel;
|
|
|
|
|
|
SCMF: TEdit;
|
|
|
|
|
|
Label23: TLabel;
|
|
|
|
|
|
SCKZ: TEdit;
|
|
|
|
|
|
TV1Column8: TcxGridDBColumn;
|
|
|
|
|
|
TV1Column9: TcxGridDBColumn;
|
|
|
|
|
|
TV1Column10: TcxGridDBColumn;
|
|
|
|
|
|
TV1Column11: TcxGridDBColumn;
|
|
|
|
|
|
Note: TMemo;
|
|
|
|
|
|
Label24: TLabel;
|
|
|
|
|
|
ToolButton5: TToolButton;
|
|
|
|
|
|
procedure TBCloseClick(Sender: TObject);
|
|
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
|
|
procedure TBSaveClick(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton1Click(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton2Click(Sender: TObject);
|
|
|
|
|
|
procedure BuyNameBtnUpClick(Sender: TObject);
|
|
|
|
|
|
procedure BuyNameBtnDnClick(Sender: TObject);
|
|
|
|
|
|
procedure v1Column4PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
procedure v1Column6PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
procedure v1Column7PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
procedure v1Column10PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
procedure SalesmanBtnUpClick(Sender: TObject);
|
|
|
|
|
|
procedure v1Column15PropertiesEditValueChanged(Sender: TObject);
|
|
|
|
|
|
procedure SellNameBtnUpClick(Sender: TObject);
|
|
|
|
|
|
procedure v1PRTOrderQtyPropertiesEditValueChanged(Sender: TObject);
|
|
|
|
|
|
procedure QiYunBtnUpClick(Sender: TObject);
|
|
|
|
|
|
procedure N1Click(Sender: TObject);
|
|
|
|
|
|
procedure N2Click(Sender: TObject);
|
|
|
|
|
|
procedure ShippMentKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
procedure ToolButton3Click(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton4Click(Sender: TObject);
|
|
|
|
|
|
procedure SLKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
procedure MuDiBtnUpClick(Sender: TObject);
|
|
|
|
|
|
procedure PurerBtnUpClick(Sender: TObject);
|
|
|
|
|
|
procedure ButtonEdit(Sender: TObject;
|
|
|
|
|
|
AButtonIndex: Integer);
|
|
|
|
|
|
procedure TV1Column6PropertiesButtonClick(Sender: TObject;
|
|
|
|
|
|
AButtonIndex: Integer);
|
|
|
|
|
|
procedure ToolButton5Click(Sender: TObject);
|
|
|
|
|
|
private
|
|
|
|
|
|
FLeft, FTop: Integer;
|
|
|
|
|
|
fuserName, Fstatus: string;
|
|
|
|
|
|
procedure JS();
|
|
|
|
|
|
procedure JSMoney();
|
|
|
|
|
|
procedure InitData();
|
|
|
|
|
|
procedure ZDYHelp(FButn: TcxButtonEdit; LType: string);
|
|
|
|
|
|
function TestData(): Boolean;
|
|
|
|
|
|
function SaveData(): Boolean;
|
|
|
|
|
|
procedure SetXH();
|
|
|
|
|
|
{ Private declarations }
|
|
|
|
|
|
public
|
|
|
|
|
|
CopyInt: Integer;
|
|
|
|
|
|
PState: string;
|
|
|
|
|
|
fFlileFlag: string;
|
|
|
|
|
|
FPurMId: string;
|
|
|
|
|
|
FAuthority, FGSTT, FType: string;
|
|
|
|
|
|
{ Public declarations }
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
|
frmClothRSPlanPut: TfrmClothRSPlanPut;
|
|
|
|
|
|
newh: hwnd;
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
U_DataLink, U_RTFun, U_ZDYHelp, U_CompanySel, U_ClothInfoSel,
|
|
|
|
|
|
U_PurTradePlanSel, U_EmpSel,U_RSTradePlanSel;
|
|
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.SetXH();
|
|
|
|
|
|
var
|
|
|
|
|
|
i: Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
First;
|
|
|
|
|
|
i := 1;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('XHNoTemp').Value := i;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
i := i + 1;
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Order_Sub.IndexFieldNames := '';
|
|
|
|
|
|
First;
|
|
|
|
|
|
i := 1;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('SerialNo').Value := FieldByName('XHNoTemp').AsInteger;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
i := i + 1;
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Order_Sub.IndexFieldNames := 'SerialNo';
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.ShippMentKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
// if not (((Key >= '0') and (Key <= '9')) or (Key = '.') or (Key = #8)) then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Key := #0;
|
|
|
|
|
|
// end
|
|
|
|
|
|
// else if (pos('.', TEdit(Sender).text) <> 0) then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// if Key = '.' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Key := #0;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.SLKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if not (((Key >= '0') and (Key <= '9')) or (Key = '.') or (Key = #8)) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Key := #0;
|
|
|
|
|
|
end
|
|
|
|
|
|
else if (pos('.', TEdit(Sender).text) <> 0) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Key = '.' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Key := #0;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.JS();
|
|
|
|
|
|
var
|
|
|
|
|
|
FPrice, FAmount, FKP, FPS, FSCGQty: Double; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۣ<EFBFBD><DBA3><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
FKP := Fieldbyname('KP').AsFloat;
|
|
|
|
|
|
FPS := Fieldbyname('Piece').AsFloat;
|
|
|
|
|
|
FPrice := Fieldbyname('Price').AsFloat;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
FAmount := RoundFloat(FKP * FPS * FPrice, 2);
|
|
|
|
|
|
if Order_Sub.fieldbyname('QtyUnit').value = 'Y' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
FSCGQty := RoundFloat(FKP * FPS * 0.9144, 2);
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
FSCGQty := RoundFloat(FKP * FPS, 2);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('SCGQty').Value := FSCGQty;
|
|
|
|
|
|
FieldByName('KP').Value := FKP;
|
|
|
|
|
|
FieldByName('Piece').Value := FPS;
|
|
|
|
|
|
// FieldByName('Qty').Value := FQty;
|
|
|
|
|
|
FieldByName('Price').Value := FPrice;
|
|
|
|
|
|
FieldByName('Amount').Value := FAmount;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
tv1.Controller.EditingController.ShowEdit();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.JSMoney();
|
|
|
|
|
|
var
|
|
|
|
|
|
FConQty, FConPrice, FC_Money: Double;
|
|
|
|
|
|
begin
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
FConQty := Fieldbyname('ConQty').AsFloat;
|
|
|
|
|
|
FConPrice := Fieldbyname('ConPrice').AsFloat;
|
|
|
|
|
|
end;
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEA3AC><EFBFBD><EFBFBD>2λС<CEBB><D0A1>
|
|
|
|
|
|
FC_Money := RoundFloat(FConQty * FConPrice, 2);
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('ConTotalAmount').Value := FC_Money;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
tv1.Controller.EditingController.ShowEdit();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.MuDiBtnUpClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmCompanySel := TfrmCompanySel.Create(Application);
|
|
|
|
|
|
with frmCompanySel do
|
|
|
|
|
|
begin
|
|
|
|
|
|
FCoType := '<27><>Ӧ<EFBFBD><D3A6>';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
self.MuDi.TxtCode := Trim(frmCompanySel.CDS_1.fieldbyname('CoCode').AsString);
|
|
|
|
|
|
self.MuDi.Text := Trim(frmCompanySel.CDS_1.fieldbyname('CoAbbrName').AsString);
|
|
|
|
|
|
self.SHAddress.Text := Trim(frmCompanySel.CDS_1.fieldbyname('CoAddress').AsString)
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmCompanySel.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TfrmClothRSPlanPut.TestData(): Boolean;
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
// if Trim(MainID.Text) = '' then
|
|
|
|
|
|
// raise Exception.Create('<27>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD>');
|
|
|
|
|
|
if Trim(PurNo.Text) = '' then
|
|
|
|
|
|
raise Exception.Create('<27>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD>źŲ<C5BA><C5B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if Trim(SellName.Text) = '' then
|
|
|
|
|
|
raise Exception.Create('<27><>Ӧ<EFBFBD>̲<EFBFBD><CCB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if Trim(BuyName.Text) = '' then
|
|
|
|
|
|
raise Exception.Create('<27>ҷ<EFBFBD><D2B7><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
|
|
|
|
|
|
if Order_Sub.IsEmpty then
|
|
|
|
|
|
raise Exception.Create('<27><>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if Order_Sub.Locate('C_Name', null, []) then
|
|
|
|
|
|
raise Exception.Create('Ʒ<><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if Order_Sub.Locate('C_Name', '', []) then
|
|
|
|
|
|
raise Exception.Create('Ʒ<><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if Order_Sub.Locate('Price', null, []) then
|
|
|
|
|
|
raise Exception.Create('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if Order_Sub.Locate('Qty', null, []) then
|
|
|
|
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if Order_Sub.Locate('Qty', 0, []) then
|
|
|
|
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ0<CEAA><30>');
|
|
|
|
|
|
if Order_Sub.Locate('QtyUnit', null, []) then
|
|
|
|
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if Order_Sub.Locate('QtyUnit', '', []) then
|
|
|
|
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
Result := True;
|
|
|
|
|
|
except
|
|
|
|
|
|
Result := false;
|
|
|
|
|
|
application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.TBCloseClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
Close;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.InitData();
|
|
|
|
|
|
var
|
|
|
|
|
|
maxno: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
//ˢ<>²<EFBFBD>Ʒ<EFBFBD><C6B7>Ϣ
|
|
|
|
|
|
with ADOTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
|
sql.Add(' select * from Pur_ClothPlan_Sub ');
|
|
|
|
|
|
sql.Add(' where PurMId=''' + Trim(FPurMId) + '''');
|
|
|
|
|
|
sql.Add(' order by SerialNo ');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
SCreateCDS(ADOTemp, Order_Sub);
|
|
|
|
|
|
SInitCDSData(ADOTemp, Order_Sub);
|
|
|
|
|
|
SCSHData(ADOTemp, ScrollBox1, 7);
|
|
|
|
|
|
//ˢ<><CBA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
|
with ADOTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select * from Pur_ClothPlan_Main where PurMId=''' + Trim(FPurMId) + '''');
|
|
|
|
|
|
SQL.Add('and PurType=''Ⱦɫ''');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
SCSHData(ADOTemp, ScrollBox1, 2);
|
|
|
|
|
|
BuyName.TxtCode := Trim(ADOTemp.FieldByName('BuyNo').AsString);
|
|
|
|
|
|
Sellname.TxtCode := Trim(ADOTemp.FieldByName('SellNo').AsString);
|
|
|
|
|
|
Fstatus := Trim(ADOTemp.FieldByName('status').AsString);
|
|
|
|
|
|
MainId.text := Trim(ADOTemp.FieldByName('MainId').AsString);
|
|
|
|
|
|
|
|
|
|
|
|
if PState = '<27><><EFBFBD><EFBFBD>' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
PurDate.DateTime := SGetServerDateTime(ADOTemp);
|
|
|
|
|
|
DlyDate.DateTime := PurDate.DateTime;
|
|
|
|
|
|
PurNo.Text := '<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
|
SL.Text := '0';
|
|
|
|
|
|
FHS.Text := '1';
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
if PState = '<27><><EFBFBD><EFBFBD>' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
PState := '<27><><EFBFBD><EFBFBD>';
|
|
|
|
|
|
FPurMId := '';
|
|
|
|
|
|
PurNo.Text := '<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
|
SL.Text := '0';
|
|
|
|
|
|
FHS.Text := '1';
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
First;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if GetLSNo(ADOCmd, maxno, 'SCS', 'Pur_ClothPlan_Sub', 4, 1) = False then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('PurMId').Value := '';
|
|
|
|
|
|
FieldByName('PurSId').Value := maxno;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.N1Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
SelOKNo(Order_Sub, True);
|
|
|
|
|
|
//var
|
|
|
|
|
|
// FValue, FFValue, FColumn, FFColumn, MHXSID: string;
|
|
|
|
|
|
// MXHNO: Integer;
|
|
|
|
|
|
//begin
|
|
|
|
|
|
// if Fstatus = '1' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// application.MessageBox('<27><>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|
|
|
|
|
// exit;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// MXHNO := Order_Sub.FieldByName('XHNo').ASInteger;
|
|
|
|
|
|
// FColumn := Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
|
|
|
|
|
// FValue := Trim(Order_Sub.fieldbyname(FColumn).AsString);
|
|
|
|
|
|
// MHXSID := Trim(Order_Sub.fieldbyname('HXSID').AsString);
|
|
|
|
|
|
// with Order_Sub do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// DisableControls;
|
|
|
|
|
|
// First;
|
|
|
|
|
|
// while not Eof do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// if FieldByName('SSel').AsBoolean then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Edit;
|
|
|
|
|
|
//
|
|
|
|
|
|
// if FValue = '' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Order_Sub.FieldByName(FColumn).Value := null;
|
|
|
|
|
|
// end
|
|
|
|
|
|
// else
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Order_Sub.FieldByName(FColumn).Value := FValue;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// if FColumn = 'C_HX' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Order_Sub.FieldByName('HXSID').Value := MHXSID;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// Post;
|
|
|
|
|
|
// JSMoney();
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// Next;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// EnableControls;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// Order_Sub.Locate('XHNO', MXHNO, []);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.N2Click(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
FValue, MC_Code, MC_Craft, MC_Name, MC_Spec, MC_CF, MC_Color, MC_MF, MC_KZ, MC_Note, MC_Unit, MGcHuaNo, MSuoLv, MC_EName: string;
|
|
|
|
|
|
MXHNO: Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
SelOKNo(Order_Sub, False);
|
|
|
|
|
|
// if Fstatus = '1' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// application.MessageBox('<27><>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|
|
|
|
|
// exit;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
//
|
|
|
|
|
|
// MXHNO := Order_Sub.FieldByName('XHNo').ASInteger;
|
|
|
|
|
|
// MC_Code := Order_Sub.fieldbyname('C_Code').AsString;
|
|
|
|
|
|
// MC_Craft := Order_Sub.fieldbyname('C_Craft').AsString;
|
|
|
|
|
|
// MC_Name := Order_Sub.fieldbyname('C_Name').AsString;
|
|
|
|
|
|
// MC_Spec := Order_Sub.fieldbyname('C_Spec').AsString;
|
|
|
|
|
|
// MC_CF := Order_Sub.fieldbyname('C_CF').AsString;
|
|
|
|
|
|
// MC_Color := Order_Sub.fieldbyname('C_Color').AsString;
|
|
|
|
|
|
// MC_MF := Order_Sub.fieldbyname('C_MF').AsString;
|
|
|
|
|
|
// MC_KZ := Order_Sub.fieldbyname('C_KZ').AsString;
|
|
|
|
|
|
// MC_Note := Order_Sub.fieldbyname('C_Note').AsString;
|
|
|
|
|
|
// MC_Unit := Order_Sub.fieldbyname('C_Unit').AsString;
|
|
|
|
|
|
// MSuoLv := Order_Sub.fieldbyname('SuoLv').AsString;
|
|
|
|
|
|
// MGcHuaNo := Order_Sub.fieldbyname('GcHuaNo').AsString;
|
|
|
|
|
|
// MC_EName := Order_Sub.fieldbyname('C_EName').AsString;
|
|
|
|
|
|
//
|
|
|
|
|
|
// with Order_Sub do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// DisableControls;
|
|
|
|
|
|
// First;
|
|
|
|
|
|
// while not Eof do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// if FieldByName('SSel').AsBoolean then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Edit;
|
|
|
|
|
|
// Order_Sub.fieldbyname('C_Code').Value := MC_Code;
|
|
|
|
|
|
// Order_Sub.fieldbyname('C_Craft').Value := MC_Craft;
|
|
|
|
|
|
// Order_Sub.fieldbyname('C_Name').Value := MC_Name;
|
|
|
|
|
|
// Order_Sub.fieldbyname('C_Spec').Value := MC_Spec;
|
|
|
|
|
|
// Order_Sub.fieldbyname('C_CF').Value := MC_CF;
|
|
|
|
|
|
// Order_Sub.fieldbyname('C_Color').Value := MC_Color;
|
|
|
|
|
|
// Order_Sub.fieldbyname('C_MF').Value := MC_MF;
|
|
|
|
|
|
// Order_Sub.fieldbyname('C_KZ').Value := MC_KZ;
|
|
|
|
|
|
// Order_Sub.fieldbyname('C_Note').Value := MC_Note;
|
|
|
|
|
|
// Order_Sub.fieldbyname('C_Unit').Value := MC_Unit;
|
|
|
|
|
|
// Order_Sub.fieldbyname('SuoLv').Value := MSuoLv;
|
|
|
|
|
|
// Order_Sub.fieldbyname('GcHuaNo').Value := MGcHuaNo;
|
|
|
|
|
|
// Order_Sub.fieldbyname('C_EName').Value := MC_EName;
|
|
|
|
|
|
// Post;
|
|
|
|
|
|
//
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// Next;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// EnableControls;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// Order_Sub.Locate('XHNO', MXHNO, []);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.PurerBtnUpClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmEmpSel := TfrmEmpSel.Create(Application);
|
|
|
|
|
|
with frmEmpSel do
|
|
|
|
|
|
begin
|
|
|
|
|
|
// FCoType := '<27><>Ӧ<EFBFBD><D3A6>';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
self.Purer.TxtCode := Trim(frmEmpSel.CDS_1.fieldbyname('EECode').AsString);
|
|
|
|
|
|
self.Purer.Text := Trim(frmEmpSel.CDS_1.fieldbyname('EEName').AsString);
|
|
|
|
|
|
// self.DlyPlace.Text := Trim(frmEmpSel.CDS_1.fieldbyname('Contacts').AsString);
|
|
|
|
|
|
// self.qiyun.Text := Trim(frmEmpSel.CDS_1.fieldbyname('CoAddress').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmEmpSel.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.QiYunBtnUpClick(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
fsj: string;
|
|
|
|
|
|
FWZ: Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
fsj := Trim(TEdit(Sender).Hint);
|
|
|
|
|
|
FWZ := Pos('/', fsj);
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag := Copy(fsj, 1, FWZ - 1);
|
|
|
|
|
|
flagname := Copy(fsj, FWZ + 1, Length(fsj) - FWZ);
|
|
|
|
|
|
MainType := '<27>ɹ<EFBFBD><C9B9><EFBFBD>ͬ';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
TEdit(Sender).Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.ZDYHelp(FButn: TcxButtonEdit; LType: string);
|
|
|
|
|
|
var
|
|
|
|
|
|
FType, ZDYName, FText: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.FormShow(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
readCxGrid(trim(self.Caption), Tv1, '<27><><EFBFBD>ۺ<EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD>');
|
|
|
|
|
|
fFlileFlag := UserDataFlag + 'HX';
|
|
|
|
|
|
InitData();
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TfrmClothRSPlanPut.SaveData(): Boolean;
|
|
|
|
|
|
var
|
|
|
|
|
|
maxno: string;
|
|
|
|
|
|
MPurNo, fDate: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
ADOCmd.Connection.BeginTrans;
|
|
|
|
|
|
//////////////// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> //////////////////////
|
|
|
|
|
|
if Trim(FPurMId) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
fDate := FormatDateTime('yy', SGetServerDate(ADOTemp));
|
|
|
|
|
|
|
|
|
|
|
|
if trim(PurNo.Text) = '<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if GetLSNo(ADOTemp, MPurNo, fDate, 'Pur_ClothPlan_Main', 4, 0) = False then
|
|
|
|
|
|
raise Exception.Create('ȡ<><C8A1><EFBFBD>²ɹ<C2B2><C9B9><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
|
|
|
|
|
|
PurNo.Text := MPurNo;
|
|
|
|
|
|
maxno := MPurNo;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
if GetLSNo(ADOTemp, maxno, Trim(PurNo.Text), 'Pur_ClothPlan_Main', 2, 0) = False then
|
|
|
|
|
|
raise Exception.Create('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
|
|
|
|
|
|
with ADOQuery1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
SQL.Add('select Cast(Right(''' + Trim(maxno) + ''',2) AS INT) AS S');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
PurNo.text := PurNo.Text + '-' + ADOQuery1.FieldByName('S').ASString;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
maxno := Trim(FPurMId);
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
SQL.Add('select * from Pur_ClothPlan_Main where PurMId=''' + Trim(FPurMId) + '''');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Trim(FPurMId) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('Filler').Value := Trim(DName);
|
|
|
|
|
|
FieldByName('status').Value := '0';
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('Editer').Value := Trim(DName);
|
|
|
|
|
|
FieldByName('EditTime').Value := SGetServerDateTime(ADOTemp);
|
|
|
|
|
|
end;
|
|
|
|
|
|
FieldByName('PurMId').Value := Trim(maxno);
|
|
|
|
|
|
RTSetsavedata(ADOCmd, 'Pur_ClothPlan_Main', ScrollBox1, 2);
|
|
|
|
|
|
FieldByName('PurType').Value := Trim(FType);
|
|
|
|
|
|
FieldByName('BuyNo').Value := Trim(BuyName.TxtCode);
|
|
|
|
|
|
FieldByName('SellNo').Value := Sellname.TxtCode;
|
|
|
|
|
|
|
|
|
|
|
|
FieldByName('MainID').Value :=MainId.Text;
|
|
|
|
|
|
// FieldByName('SalesId').Value := Saleser.TextHint;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select * from Pur_ClothPlan_Main where PurNo=''' + Trim(PurNo.Text) + '''');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if ADOCmd.RecordCount > 1 then
|
|
|
|
|
|
raise Exception.Create('<27>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>');
|
|
|
|
|
|
|
|
|
|
|
|
FPurMId := Trim(maxno);
|
|
|
|
|
|
//////////////// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> //////////////////////
|
|
|
|
|
|
///
|
|
|
|
|
|
//////////////// <20><><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD> //////////////////////
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
First;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
maxno := Trim(Order_Sub.fieldbyname('PurSId').AsString);
|
|
|
|
|
|
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
|
sql.Add('select * from Pur_ClothPlan_Sub ');
|
|
|
|
|
|
sql.Add('where PurSId=''' + Trim(maxno) + '''');
|
|
|
|
|
|
SQL.Add('and PurMId=''' + Trim(FPurMId) + '''');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if ADOCmd.IsEmpty then
|
|
|
|
|
|
Append
|
|
|
|
|
|
else
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
RTSetSaveDataCDS(ADOCmd, Tv1, Order_Sub, 'Pur_ClothPlan_Sub', 0);
|
|
|
|
|
|
RTSetsavedata(ADOCmd, 'Pur_ClothPlan_Sub', ScrollBox1, 7);
|
|
|
|
|
|
FieldByName('PurMId').Value := Trim(FPurMId);
|
|
|
|
|
|
FieldByName('PurSId').Value := Trim(maxno);
|
|
|
|
|
|
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('PurSId').Value := Trim(maxno);
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
//////////////// <20><><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD> //////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
ADOCmd.Connection.CommitTrans;
|
|
|
|
|
|
Result := True;
|
|
|
|
|
|
except
|
|
|
|
|
|
|
|
|
|
|
|
ADOCmd.Connection.RollbackTrans;
|
|
|
|
|
|
application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|
|
|
|
|
Result := False;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.TBSaveClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
PurDate.SetFocus;
|
|
|
|
|
|
|
|
|
|
|
|
if TestData() = false then
|
|
|
|
|
|
exit;
|
|
|
|
|
|
|
|
|
|
|
|
if SaveData() then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.v1PRTOrderQtyPropertiesEditValueChanged(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
mvalue, FFieldName: string;
|
|
|
|
|
|
FQty, FPrice, FAmount, FKP,FPS , FSCGQty: Double; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۣ<EFBFBD><DBA3><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
begin
|
|
|
|
|
|
// FSL := StrToInt(SL.Text);
|
|
|
|
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|
|
|
|
|
if Trim(mvalue) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
mvalue := '0';
|
|
|
|
|
|
end;
|
|
|
|
|
|
FFieldName := Trim(Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
|
|
|
|
|
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName(FFieldName).Value := Trim(mvalue);
|
|
|
|
|
|
Post;
|
|
|
|
|
|
FKP := Fieldbyname('KP').AsFloat;
|
|
|
|
|
|
FPS := Fieldbyname('Piece').AsFloat;
|
|
|
|
|
|
FPrice := Fieldbyname('Price').AsFloat;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
FAmount := RoundFloat(FKP * FPS * FPrice, 2);
|
|
|
|
|
|
if Order_Sub.fieldbyname('QtyUnit').value = 'Y' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
FSCGQty := RoundFloat(FKP * FPS * 0.9144, 2);
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
FSCGQty := RoundFloat(FKP * FPS, 2);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('SCGQty').Value := FSCGQty;
|
|
|
|
|
|
FieldByName('KP').Value := FKP;
|
|
|
|
|
|
FieldByName('Piece').Value := FPS;
|
|
|
|
|
|
// FieldByName('Qty').Value := FQty;
|
|
|
|
|
|
FieldByName('Price').Value := FPrice;
|
|
|
|
|
|
FieldByName('Amount').Value := FAmount;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
tv1.Controller.EditingController.ShowEdit();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.ToolButton1Click(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
i: Integer;
|
|
|
|
|
|
maxno: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
if GetLSNo(ADOCmd, maxno, 'PS', 'Pur_ClothPlan_Sub', 4, 1) = False then
|
|
|
|
|
|
begin
|
|
|
|
|
|
ADOCmd.Connection.RollbackTrans;
|
|
|
|
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
i := Order_Sub.RecordCount + 1;
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
frmClothInfoSel := TfrmClothInfoSel.Create(Application);
|
|
|
|
|
|
with frmClothInfoSel do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with CDS_1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
First;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if CDS_1.fieldbyname('SSel').AsBoolean then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with Self.Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('SSEL').Value := False;
|
|
|
|
|
|
FieldByName('SerialNo').Value := i;
|
|
|
|
|
|
FieldByName('PurSId').Value := maxno + INTTOSTR(i);
|
|
|
|
|
|
FieldByName('C_Code').Value := CDS_1.fieldbyname('C_Code').value;
|
|
|
|
|
|
FieldByName('C_Name').Value := CDS_1.fieldbyname('C_Name').value;
|
|
|
|
|
|
FieldByName('C_Spec').Value := CDS_1.fieldbyname('C_Spec').value;
|
|
|
|
|
|
FieldByName('C_Composition').Value := CDS_1.fieldbyname('C_Composition').value;
|
|
|
|
|
|
FieldByName('C_Color').Value := CDS_1.fieldbyname('C_Color').value;
|
|
|
|
|
|
FieldByName('Qty').Value := 0;
|
|
|
|
|
|
FieldByName('QtyUnit').Value := 'Kg';
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
i := i + 1;
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmClothInfoSel.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
SetXH();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.ToolButton2Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Order_Sub.IsEmpty then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
while Order_Sub.Locate('SSel', True, []) do
|
|
|
|
|
|
begin
|
|
|
|
|
|
// with ADOTemp do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Close;
|
|
|
|
|
|
// sql.Clear;
|
|
|
|
|
|
// sql.Add('select * from Trade_Plan_Sub where PurSId=''' + Trim(Order_Sub.fieldbyname('PurSId').AsString) + '''');
|
|
|
|
|
|
// open;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// if ADOTemp.IsEmpty = false then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// exit;
|
|
|
|
|
|
// application.MessageBox('<27><><EFBFBD><EFBFBD>ϸ<EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|
|
|
|
|
// end;
|
|
|
|
|
|
if Trim(Order_Sub.fieldbyname('PurSId').AsString) <> '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('delete Pur_ClothPlan_Sub where PurSId=''' + Trim(Order_Sub.fieldbyname('PurSId').AsString) + '''');
|
|
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Order_Sub.Delete;
|
|
|
|
|
|
end;
|
|
|
|
|
|
SetXH();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.ToolButton3Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
WriteCxGrid(trim(self.Caption), Tv1, '<27><><EFBFBD>ۺ<EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD>');
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.ToolButton4Click(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
i: Integer;
|
|
|
|
|
|
FQty, FSL, FCGQTY,FKP,FPS: Double;
|
|
|
|
|
|
maxno: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
// FSL := StrToInt(SL.Text);
|
|
|
|
|
|
// if FSL = 0 then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Application.MessageBox('<27><><EFBFBD><EFBFBD>Ϊ0<CEAA>Ƿ<EFBFBD>ȷ<EFBFBD><C8B7>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD>ʣ<EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
// end;
|
|
|
|
|
|
if GetLSNo(ADOCmd, maxno, 'PS', 'Pur_ClothPlan_Sub', 4, 1) = False then
|
|
|
|
|
|
begin
|
|
|
|
|
|
ADOCmd.Connection.RollbackTrans;
|
|
|
|
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
i := Order_Sub.RecordCount + 1;
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
frmRSTradePlanSel := TfrmRSTradePlanSel.Create(Application);
|
|
|
|
|
|
with frmRSTradePlanSel do
|
|
|
|
|
|
begin
|
|
|
|
|
|
FMainID := MainID.Text;
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with CDS_1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
First;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if CDS_1.fieldbyname('SSel').AsBoolean then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with Self.Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
PurNo.text := 'R'+CDS_1.fieldbyname('OrderNo').value;
|
|
|
|
|
|
FieldByName('SSEL').Value := False;
|
|
|
|
|
|
FieldByName('SerialNo').Value := i;
|
|
|
|
|
|
FieldByName('PurSId').Value := maxno + INTTOSTR(i);
|
|
|
|
|
|
FieldByName('C_Code').Value := CDS_1.fieldbyname('C_Code').value;
|
|
|
|
|
|
FieldByName('C_Name').Value := CDS_1.fieldbyname('C_Name').value;
|
|
|
|
|
|
FieldByName('C_Spec').Value := CDS_1.fieldbyname('C_Spec').value;
|
|
|
|
|
|
FieldByName('C_Pattern').Value := CDS_1.fieldbyname('C_Pattern').value;
|
|
|
|
|
|
FieldByName('C_ColorNo').Value := CDS_1.fieldbyname('C_ColorNo').value;
|
|
|
|
|
|
FieldByName('Piece').Value := CDS_1.fieldbyname('OrdPiece').value;
|
|
|
|
|
|
FieldByName('C_Composition').Value := CDS_1.fieldbyname('C_Composition').value;
|
|
|
|
|
|
FieldByName('C_Color').Value := CDS_1.fieldbyname('C_Color').value;
|
|
|
|
|
|
FieldByName('QtyUnit').Value := CDS_1.fieldbyname('OrdUnit').value;
|
|
|
|
|
|
FieldByName('KP').Value := CDS_1.fieldbyname('KP').value;
|
|
|
|
|
|
FieldByName('KPUnit').Value := CDS_1.fieldbyname('KPUnit').value;
|
|
|
|
|
|
FQty := CDS_1.fieldbyname('WPQty').value;
|
|
|
|
|
|
FKP :=CDS_1.fieldbyname('KP').value;
|
|
|
|
|
|
FPS :=CDS_1.fieldbyname('OrdPiece').value;
|
|
|
|
|
|
if CDS_1.fieldbyname('OrdUnit').value = 'Y' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
FCGQTY := RoundFloat(FQty * 0.9144 / ((100 - FSL) / 100), 2);
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
FCGQTY := RoundFloat(FQty / ((100 - FSL) / 100), 2);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
FieldByName('Qty').Value := CDS_1.fieldbyname('WPQty').value;
|
|
|
|
|
|
FieldByName('CGQty').Value := FCGQTY;
|
|
|
|
|
|
FieldByName('SCGQty').Value :=FKP*FPS;
|
|
|
|
|
|
FieldByName('SubId').Value := CDS_1.fieldbyname('SubId').value;
|
|
|
|
|
|
FieldByName('MainId').Value := CDS_1.fieldbyname('MainId').value;
|
|
|
|
|
|
MainId.text := CDS_1.fieldbyname('MainID').value;
|
|
|
|
|
|
// Saleser.text := CDS_1.fieldbyname('Saleser').value;
|
|
|
|
|
|
// Saleser.TextHint := CDS_1.fieldbyname('SalesId').value;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
i := i + 1;
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmRSTradePlanSel.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
SetXH();
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.ToolButton5Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Order_Sub.IsEmpty then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
OneKeyPost(Tv1, Order_Sub);
|
|
|
|
|
|
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
First;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
JS();
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.TV1Column6PropertiesButtonClick(Sender: TObject;
|
|
|
|
|
|
AButtonIndex: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag := 'KPUnit';
|
|
|
|
|
|
flagname := '<27><>ƥ<EFBFBD><C6A5>λ';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Order_Sub.Edit;
|
|
|
|
|
|
Order_Sub.fieldbyname('KPUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|
|
|
|
|
// Order_Sub.fieldbyname('PRTCode').Value:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
|
|
|
|
|
Order_Sub.Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
tv1.Controller.EditingController.ShowEdit();
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.ButtonEdit(Sender: TObject;
|
|
|
|
|
|
AButtonIndex: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag := 'XH';
|
|
|
|
|
|
flagname := 'ѡ<><D1A1>';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Order_Sub.Edit;
|
|
|
|
|
|
Order_Sub.fieldbyname('XH').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|
|
|
|
|
// Order_Sub.fieldbyname('PRTCode').Value:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
|
|
|
|
|
Order_Sub.Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
tv1.Controller.EditingController.ShowEdit();
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.BuyNameBtnUpClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmCompanySel := TfrmCompanySel.Create(Application);
|
|
|
|
|
|
with frmCompanySel do
|
|
|
|
|
|
begin
|
|
|
|
|
|
FCoType := '<27><>˾';
|
|
|
|
|
|
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
self.BuyName.TxtCode := Trim(frmCompanySel.CDS_1.fieldbyname('CoCode').AsString);
|
|
|
|
|
|
self.BuyName.Text := Trim(frmCompanySel.CDS_1.fieldbyname('CoAbbrName').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmCompanySel.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.BuyNameBtnDnClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
TBtnEditC(Sender).Text := '';
|
|
|
|
|
|
TBtnEditC(Sender).TxtCode := '';
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.v1Column4PropertiesButtonClick(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
|
|
|
|
|
|
Order_Sub.Edit;
|
|
|
|
|
|
Order_Sub.fieldbyname('PRTCodeName').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|
|
|
|
|
Order_Sub.fieldbyname('PRTCode').Value := Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
|
|
|
|
|
Order_Sub.Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
tv1.Controller.EditingController.ShowEdit();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.v1Column6PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag := 'C_MF';
|
|
|
|
|
|
flagname := '<27>ŷ<EFBFBD><C5B7><EFBFBD>Ϣ';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Order_Sub.Edit;
|
|
|
|
|
|
Order_Sub.fieldbyname('C_MF').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|
|
|
|
|
// Order_Sub.fieldbyname('PRTCode').Value:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
|
|
|
|
|
Order_Sub.Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
tv1.Controller.EditingController.ShowEdit();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.v1Column7PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag := 'C_KZ';
|
|
|
|
|
|
flagname := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Order_Sub.Edit;
|
|
|
|
|
|
Order_Sub.fieldbyname('C_KZ').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|
|
|
|
|
// Order_Sub.fieldbyname('PRTCode').Value:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
|
|
|
|
|
Order_Sub.Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
tv1.Controller.EditingController.ShowEdit();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.v1Column10PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
var
|
|
|
|
|
|
MCYNo: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
frmClothInfoSel := TfrmClothInfoSel.Create(self);
|
|
|
|
|
|
with frmClothInfoSel do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if showmodal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Order_Sub.Edit;
|
|
|
|
|
|
Order_Sub.fieldbyname('C_Code').Value := frmClothInfoSel.CDS_1.fieldbyname('C_Code').asstring;
|
|
|
|
|
|
|
|
|
|
|
|
Order_Sub.fieldbyname('C_Name').Value := frmClothInfoSel.CDS_1.fieldbyname('C_Name').asstring;
|
|
|
|
|
|
Order_Sub.fieldbyname('C_EName').Value := frmClothInfoSel.CDS_1.fieldbyname('C_EName').asstring;
|
|
|
|
|
|
Order_Sub.fieldbyname('C_Spec').Value := frmClothInfoSel.CDS_1.fieldbyname('C_Spec').asstring;
|
|
|
|
|
|
Order_Sub.fieldbyname('C_Composition').Value := frmClothInfoSel.CDS_1.fieldbyname('C_Composition').asstring;
|
|
|
|
|
|
Order_Sub.fieldbyname('C_Color').Value := frmClothInfoSel.CDS_1.fieldbyname('C_Color').asstring;
|
|
|
|
|
|
Order_Sub.fieldbyname('C_Width').Value := frmClothInfoSel.CDS_1.fieldbyname('C_Width').asstring;
|
|
|
|
|
|
Order_Sub.fieldbyname('C_GramWeight').Value := frmClothInfoSel.CDS_1.fieldbyname('C_GramWeight').asstring;
|
|
|
|
|
|
Order_Sub.Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
tv1.Controller.EditingController.ShowEdit();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.SalesmanBtnUpClick(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
fsj: string;
|
|
|
|
|
|
FWZ: Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
fsj := Trim(TEdit(Sender).Hint);
|
|
|
|
|
|
FWZ := Pos('/', fsj);
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag := Copy(fsj, 1, FWZ - 1);
|
|
|
|
|
|
flagname := Copy(fsj, FWZ + 1, Length(fsj) - FWZ);
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
TEdit(Sender).Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.v1Column15PropertiesEditValueChanged(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
mvalue: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|
|
|
|
|
|
|
|
|
|
|
if Trim(mvalue) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
mvalue := '0';
|
|
|
|
|
|
end;
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('YongJinPrice').Value := mvalue;
|
|
|
|
|
|
FieldByName('YongJin').Value := FieldByName('YongJinPrice').AsFloat * FieldByName('PRTOrderQty').AsFloat;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothRSPlanPut.SellNameBtnUpClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmCompanySel := TfrmCompanySel.Create(Application);
|
|
|
|
|
|
with frmCompanySel do
|
|
|
|
|
|
begin
|
|
|
|
|
|
FCoType := '<27><>Ӧ<EFBFBD><D3A6>';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
self.Sellname.TxtCode := Trim(frmCompanySel.CDS_1.fieldbyname('CoCode').AsString);
|
|
|
|
|
|
self.Sellname.Text := Trim(frmCompanySel.CDS_1.fieldbyname('CoAbbrName').AsString);
|
|
|
|
|
|
self.DlyPlace.Text := Trim(frmCompanySel.CDS_1.fieldbyname('Contacts').AsString);
|
|
|
|
|
|
self.qiyun.Text := Trim(frmCompanySel.CDS_1.fieldbyname('CoAddress').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmCompanySel.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end.
|
|
|
|
|
|
|