You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

5515 lines
186 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{$INCLUDE t_main.inc}
unit u_ch_invoice_jk;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, bsSkinTabs, bsSkinCtrls, DB, ADODB, dxExEdtr,CommCtrl,
dxCntner, dxTL, dxDBCtrl, dxDBGrid, dxDBTLCl, dxGrClms, wwdblook,
StdCtrls, DBCtrls, RxLookup, bsdbctrls, Mask, wwdbdatetimepicker,
ExtCtrls, Menus, XPMenu, u_ch_add_do, u_ch_delete_do, wwdbedit, Wwdotdot,
Wwdbcomb, DBCtrlsEh, kbmMemTable, cxStyles, cxCustomData, cxGraphics,
cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, cxCurrencyEdit,
cxNavigator, cxDBNavigator, cxGridLevel, cxGridCustomTableView,
cxGridTableView, cxGridDBTableView, cxClasses, cxControls,
cxGridCustomView, cxGrid, Grids, Wwdbigrd, Wwdbgrid,superobject,IdHTTP;
type
Tfrm_ch_invoice_jk = class(TForm)
bsSkinPageControl1: TbsSkinPageControl;
bsSkinTabSheet1: TbsSkinTabSheet;
bsSkinTabSheet2: TbsSkinTabSheet;
bsSkinTabSheet3: TbsSkinTabSheet;
bsSkinPanel2: TbsSkinPanel;
bsSkinButton5: TbsSkinButton;
bsSkinButton9: TbsSkinButton;
bsSkinButton10: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
bsSkinButton1: TbsSkinButton;
t_ch_invoice_shen: TADOQuery;
t_ch_invoice_shen1: TDataSource;
v_fee_do_seae: TADOQuery;
v_fee_do_seae1: TDataSource;
t_ch_invoice: TADOQuery;
t_ch_invoice1: TDataSource;
bsSkinButton2: TbsSkinButton;
bsSkinButton6: TbsSkinButton;
bsSkinButton7: TbsSkinButton;
bsSkinButton8: TbsSkinButton;
bsSkinPanel1: TbsSkinPanel;
bsSkinButton4: TbsSkinButton;
bsSkinButton11: TbsSkinButton;
bsSkinButton12: TbsSkinButton;
bsSkinButton13: TbsSkinButton;
bsSkinButton14: TbsSkinButton;
bsSkinButton16: TbsSkinButton;
bsSkinButton17: TbsSkinButton;
bsSkinButton18: TbsSkinButton;
bsSkinButton19: TbsSkinButton;
bsSkinPanel3: TbsSkinPanel;
bsSkinButton21: TbsSkinButton;
bsSkinButton23: TbsSkinButton;
bsSkinButton24: TbsSkinButton;
bsSkinButton25: TbsSkinButton;
bsSkinButton26: TbsSkinButton;
bsSkinButton30: TbsSkinButton;
bsSkinPageControl2: TbsSkinPageControl;
bsSkinTabSheet11: TbsSkinTabSheet;
bsSkinTabSheet22: TbsSkinTabSheet;
dxDBGrid2: TdxDBGrid;
dxDBGridMaskColumn1: TdxDBGridMaskColumn;
dxDBGridMaskColumn2: TdxDBGridMaskColumn;
dxDBGridMaskColumn3: TdxDBGridMaskColumn;
dxDBGridMaskColumn4: TdxDBGridMaskColumn;
dxDBGridMaskColumn5: TdxDBGridMaskColumn;
dxDBGridMaskColumn6: TdxDBGridMaskColumn;
dxDBGridMaskColumn7: TdxDBGridMaskColumn;
dxDBGridDateColumn1: TdxDBGridDateColumn;
dxDBGridMaskColumn8: TdxDBGridMaskColumn;
dxDBGridMaskColumn9: TdxDBGridMaskColumn;
dxDBGridMaskColumn10: TdxDBGridMaskColumn;
dxDBGridMaskColumn11: TdxDBGridMaskColumn;
dxDBGridMaskColumn12: TdxDBGridMaskColumn;
dxDBGridColumn1: TdxDBGridColumn;
dxDBGridColumn2: TdxDBGridColumn;
dxDBGridColumn3: TdxDBGridColumn;
dxDBGridColumn4: TdxDBGridColumn;
dxDBGrid1Column18: TdxDBGridMaskColumn;
dxDBGridMaskColumn13: TdxDBGridMaskColumn;
dxDBGridDateColumn2: TdxDBGridDateColumn;
dxDBGridMaskColumn14: TdxDBGridMaskColumn;
dxDBGridDateColumn3: TdxDBGridDateColumn;
dxDBGridMaskColumn15: TdxDBGridMaskColumn;
dxDBGridDateColumn4: TdxDBGridDateColumn;
bsSkinButton28: TbsSkinButton;
bsSkinButton29: TbsSkinButton;
bsSkinPageControl3: TbsSkinPageControl;
bsSkinTabSheet4: TbsSkinTabSheet;
dxDBGrid3: TdxDBGrid;
dxDBGridMaskColumn16: TdxDBGridMaskColumn;
dxDBGridMaskColumn17: TdxDBGridMaskColumn;
dxDBGridMaskColumn18: TdxDBGridMaskColumn;
dxDBGridMaskColumn19: TdxDBGridMaskColumn;
dxDBGridMaskColumn20: TdxDBGridMaskColumn;
dxDBGridColumn5: TdxDBGridColumn;
dxDBGridColumn6: TdxDBGridColumn;
dxDBGridMaskColumn21: TdxDBGridMaskColumn;
dxDBGridDateColumn5: TdxDBGridDateColumn;
dxDBGridDateColumn6: TdxDBGridDateColumn;
dxDBGridMaskColumn22: TdxDBGridMaskColumn;
dxDBGridMaskColumn23: TdxDBGridMaskColumn;
dxDBGridMaskColumn24: TdxDBGridMaskColumn;
dxDBGridMaskColumn25: TdxDBGridMaskColumn;
dxDBGridMaskColumn26: TdxDBGridMaskColumn;
dxDBGridColumn7: TdxDBGridColumn;
dxDBGridColumn8: TdxDBGridColumn;
dxDBGridMaskColumn27: TdxDBGridMaskColumn;
dxDBGridMaskColumn28: TdxDBGridMaskColumn;
dxDBGridMaskColumn29: TdxDBGridMaskColumn;
dxDBGridMaskColumn30: TdxDBGridMaskColumn;
bsSkinTabSheet5: TbsSkinTabSheet;
bsSkinTabSheet6: TbsSkinTabSheet;
bsSkinTabSheet7: TbsSkinTabSheet;
bsSkinPanel7: TbsSkinPanel;
Label54: TLabel;
DBEdit16: TDBEdit;
Label21: TLabel;
DBEdit12: TDBEdit;
Label57: TLabel;
DBEdit17: TDBEdit;
Label59: TLabel;
DBEdit18: TDBEdit;
Label63: TLabel;
RxDBLookupCombo3: TRxDBLookupCombo;
PopupMenu2: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
N20: TMenuItem;
bsSkinButton31: TbsSkinButton;
XPMenu1: TXPMenu;
v_fee_do_seai: TADOQuery;
v_fee_do_seai1: TDataSource;
dxDBGrid4: TdxDBGrid;
dxDBGridMaskColumn31: TdxDBGridMaskColumn;
dxDBGridMaskColumn32: TdxDBGridMaskColumn;
dxDBGridMaskColumn33: TdxDBGridMaskColumn;
dxDBGridMaskColumn34: TdxDBGridMaskColumn;
dxDBGridMaskColumn35: TdxDBGridMaskColumn;
dxDBGridColumn9: TdxDBGridColumn;
dxDBGridColumn10: TdxDBGridColumn;
dxDBGridMaskColumn36: TdxDBGridMaskColumn;
dxDBGridDateColumn7: TdxDBGridDateColumn;
dxDBGridDateColumn8: TdxDBGridDateColumn;
dxDBGridMaskColumn37: TdxDBGridMaskColumn;
dxDBGridMaskColumn38: TdxDBGridMaskColumn;
dxDBGridMaskColumn39: TdxDBGridMaskColumn;
dxDBGridMaskColumn40: TdxDBGridMaskColumn;
dxDBGridMaskColumn41: TdxDBGridMaskColumn;
dxDBGridColumn11: TdxDBGridColumn;
dxDBGridColumn12: TdxDBGridColumn;
dxDBGridMaskColumn42: TdxDBGridMaskColumn;
dxDBGridMaskColumn43: TdxDBGridMaskColumn;
dxDBGridMaskColumn44: TdxDBGridMaskColumn;
dxDBGridMaskColumn45: TdxDBGridMaskColumn;
N3: TMenuItem;
N4: TMenuItem;
v_fee_do_aire: TADOQuery;
v_fee_do_aire1: TDataSource;
v_fee_do_airi: TADOQuery;
v_fee_do_airi1: TDataSource;
dxDBGrid5: TdxDBGrid;
dxDBGridMaskColumn46: TdxDBGridMaskColumn;
dxDBGridMaskColumn47: TdxDBGridMaskColumn;
dxDBGridMaskColumn48: TdxDBGridMaskColumn;
dxDBGridMaskColumn49: TdxDBGridMaskColumn;
dxDBGridMaskColumn50: TdxDBGridMaskColumn;
dxDBGridColumn13: TdxDBGridColumn;
dxDBGridColumn14: TdxDBGridColumn;
dxDBGridMaskColumn51: TdxDBGridMaskColumn;
dxDBGridDateColumn9: TdxDBGridDateColumn;
dxDBGridDateColumn10: TdxDBGridDateColumn;
dxDBGridMaskColumn52: TdxDBGridMaskColumn;
dxDBGridMaskColumn53: TdxDBGridMaskColumn;
dxDBGridMaskColumn54: TdxDBGridMaskColumn;
dxDBGridColumn15: TdxDBGridColumn;
dxDBGridColumn16: TdxDBGridColumn;
dxDBGridMaskColumn55: TdxDBGridMaskColumn;
dxDBGridMaskColumn56: TdxDBGridMaskColumn;
dxDBGridMaskColumn57: TdxDBGridMaskColumn;
dxDBGrid6: TdxDBGrid;
dxDBGridMaskColumn58: TdxDBGridMaskColumn;
dxDBGridMaskColumn59: TdxDBGridMaskColumn;
dxDBGridMaskColumn60: TdxDBGridMaskColumn;
dxDBGridMaskColumn61: TdxDBGridMaskColumn;
dxDBGridMaskColumn62: TdxDBGridMaskColumn;
dxDBGridColumn17: TdxDBGridColumn;
dxDBGridColumn18: TdxDBGridColumn;
dxDBGridMaskColumn63: TdxDBGridMaskColumn;
dxDBGridDateColumn11: TdxDBGridDateColumn;
dxDBGridDateColumn12: TdxDBGridDateColumn;
dxDBGridMaskColumn64: TdxDBGridMaskColumn;
dxDBGridMaskColumn65: TdxDBGridMaskColumn;
dxDBGridMaskColumn66: TdxDBGridMaskColumn;
dxDBGridColumn19: TdxDBGridColumn;
dxDBGridColumn20: TdxDBGridColumn;
dxDBGridMaskColumn67: TdxDBGridMaskColumn;
dxDBGridMaskColumn68: TdxDBGridMaskColumn;
dxDBGridMaskColumn69: TdxDBGridMaskColumn;
PopupMenu1: TPopupMenu;
N10: TMenuItem;
N11: TMenuItem;
N14: TMenuItem;
N13: TMenuItem;
N12: TMenuItem;
N15: TMenuItem;
N16: TMenuItem;
bsSkinButton22: TbsSkinButton;
bsSkinButton27: TbsSkinButton;
bsSkinButton32: TbsSkinButton;
ADOQuery1: TADOQuery;
DataSource1: TDataSource;
ADOQuery2: TADOQuery;
DataSource2: TDataSource;
ADOQuery3: TADOQuery;
DataSource3: TDataSource;
ADOQuery4: TADOQuery;
DataSource4: TDataSource;
PopupMenu3: TPopupMenu;
N17: TMenuItem;
N18: TMenuItem;
N34: TMenuItem;
N35: TMenuItem;
N36: TMenuItem;
MenuItem1: TMenuItem;
N6: TMenuItem;
N5: TMenuItem;
MenuItem2: TMenuItem;
bsSkinPanel4: TbsSkinPanel;
Label1: TLabel;
Label4: TLabel;
Label7: TLabel;
Label13: TLabel;
Label2: TLabel;
Label5: TLabel;
Label8: TLabel;
Label14: TLabel;
Label9: TLabel;
Label3: TLabel;
Label6: TLabel;
Label10: TLabel;
Label11: TLabel;
Label16: TLabel;
Label15: TLabel;
bsSkinPanel5: TbsSkinPanel;
Label25: TLabel;
Label17: TLabel;
Label18: TLabel;
Label20: TLabel;
Label19: TLabel;
Label12: TLabel;
Label64: TLabel;
Label65: TLabel;
DBEdit14: TDBEdit;
DBEdit1: TDBEdit;
DBEdit5: TDBEdit;
DBEdit7: TDBEdit;
DBEdit8: TDBEdit;
DBEdit2: TDBEdit;
DBEdit3: TDBEdit;
DBEdit4: TDBEdit;
DBMemo1: TDBMemo;
DBEdit6: TDBEdit;
DBEdit9: TDBEdit;
DBMemo2: TDBMemo;
DBEdit10: TDBEdit;
DBEdit11: TDBEdit;
DBEdit20: TDBEdit;
DBEdit21: TDBEdit;
DBMemo3: TDBMemo;
DBEdit22: TDBEdit;
DBEdit23: TDBEdit;
DBEdit24: TDBEdit;
DBEdit25: TDBEdit;
DBEdit26: TDBEdit;
DBEdit28: TDBEdit;
dxDBGrid2Column25: TdxDBGridColumn;
dxDBGrid2Column26: TdxDBGridColumn;
dxDBGrid3Column22: TdxDBGridColumn;
dxDBGrid4Column22: TdxDBGridColumn;
dxDBGrid5Column19: TdxDBGridColumn;
dxDBGrid6Column19: TdxDBGridColumn;
t_ch_invoice_head: TADOQuery;
t_ch_invoice_head1: TDataSource;
dxDBGrid3Column23: TdxDBGridColumn;
dxDBGrid6Column20: TdxDBGridColumn;
dxDBGrid5Column20: TdxDBGridColumn;
dxDBGrid4Column23: TdxDBGridColumn;
N7: TMenuItem;
N8: TMenuItem;
N9: TMenuItem;
N19: TMenuItem;
bsSkinNotebook1: TbsSkinNotebook;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid1Column38: TdxDBGridCheckColumn;
dxDBGrid1Column2: TdxDBGridMaskColumn;
dxDBGrid1Column3: TdxDBGridMaskColumn;
dxDBGrid1Column4: TdxDBGridMaskColumn;
dxDBGrid1Column5: TdxDBGridDateColumn;
dxDBGrid1Column6: TdxDBGridMaskColumn;
dxDBGrid1Column7: TdxDBGridMaskColumn;
dxDBGrid1Column8: TdxDBGridMaskColumn;
dxDBGrid1Column9: TdxDBGridMaskColumn;
dxDBGrid1Column10: TdxDBGridDateColumn;
dxDBGrid1Column11: TdxDBGridMaskColumn;
dxDBGrid1Column12: TdxDBGridMaskColumn;
dxDBGrid1Column13: TdxDBGridMaskColumn;
dxDBGrid1Column14: TdxDBGridMaskColumn;
dxDBGrid1Column15: TdxDBGridMaskColumn;
dxDBGrid1Column16: TdxDBGridMaskColumn;
dxDBGrid1Column17: TdxDBGridMaskColumn;
dxDBGrid1Column37: TdxDBGridColumn;
dxDBGrid1Column19: TdxDBGridColumn;
dxDBGrid1Column20: TdxDBGridColumn;
dxDBGrid1Column21: TdxDBGridColumn;
dxDBGrid1Column22: TdxDBGridMaskColumn;
dxDBGrid1Column23: TdxDBGridMaskColumn;
dxDBGrid1Column24: TdxDBGridMaskColumn;
dxDBGrid1Column25: TdxDBGridCheckColumn;
dxDBGrid1Column26: TdxDBGridMaskColumn;
dxDBGrid1Column27: TdxDBGridDateColumn;
dxDBGrid1Column28: TdxDBGridMaskColumn;
dxDBGrid1Column32: TdxDBGridCheckColumn;
dxDBGrid1Column29: TdxDBGridCheckColumn;
dxDBGrid1Column30: TdxDBGridMaskColumn;
dxDBGrid1Column35: TdxDBGridMaskColumn;
dxDBGrid1Column36: TdxDBGridDateColumn;
dxDBGrid1Column31: TdxDBGridMaskColumn;
dxDBGrid1Column33: TdxDBGridMaskColumn;
dxDBGrid1Column34: TdxDBGridDateColumn;
bsSkinPageControl4: TbsSkinPageControl;
pagesheet2: TbsSkinTabSheet;
bsSkinPageControl5: TbsSkinPageControl;
bsSkinTabSheet8: TbsSkinTabSheet;
dxDBGrid7: TdxDBGrid;
dxDBGridMaskColumn70: TdxDBGridMaskColumn;
dxDBGridMaskColumn71: TdxDBGridMaskColumn;
dxDBGridMaskColumn72: TdxDBGridMaskColumn;
dxDBGridMaskColumn73: TdxDBGridMaskColumn;
dxDBGridMaskColumn74: TdxDBGridMaskColumn;
dxDBGridColumn21: TdxDBGridColumn;
dxDBGrid7Column23: TdxDBGridColumn;
dxDBGridColumn22: TdxDBGridColumn;
dxDBGridMaskColumn75: TdxDBGridMaskColumn;
dxDBGrid7Column22: TdxDBGridColumn;
dxDBGridDateColumn13: TdxDBGridDateColumn;
dxDBGridDateColumn14: TdxDBGridDateColumn;
dxDBGridMaskColumn76: TdxDBGridMaskColumn;
dxDBGridMaskColumn77: TdxDBGridMaskColumn;
dxDBGridMaskColumn78: TdxDBGridMaskColumn;
dxDBGridMaskColumn79: TdxDBGridMaskColumn;
dxDBGridMaskColumn80: TdxDBGridMaskColumn;
dxDBGridColumn23: TdxDBGridColumn;
dxDBGridColumn24: TdxDBGridColumn;
dxDBGridMaskColumn81: TdxDBGridMaskColumn;
dxDBGridMaskColumn82: TdxDBGridMaskColumn;
dxDBGridMaskColumn83: TdxDBGridMaskColumn;
dxDBGridMaskColumn84: TdxDBGridMaskColumn;
bsSkinTabSheet9: TbsSkinTabSheet;
dxDBGrid8: TdxDBGrid;
dxDBGridMaskColumn85: TdxDBGridMaskColumn;
dxDBGridMaskColumn86: TdxDBGridMaskColumn;
dxDBGridMaskColumn87: TdxDBGridMaskColumn;
dxDBGridMaskColumn88: TdxDBGridMaskColumn;
dxDBGridMaskColumn89: TdxDBGridMaskColumn;
dxDBGridColumn25: TdxDBGridColumn;
dxDBGrid8Column23: TdxDBGridColumn;
dxDBGridColumn26: TdxDBGridColumn;
dxDBGridMaskColumn90: TdxDBGridMaskColumn;
dxDBGrid8Column22: TdxDBGridColumn;
dxDBGridDateColumn15: TdxDBGridDateColumn;
dxDBGridDateColumn16: TdxDBGridDateColumn;
dxDBGridMaskColumn91: TdxDBGridMaskColumn;
dxDBGridMaskColumn92: TdxDBGridMaskColumn;
dxDBGridMaskColumn93: TdxDBGridMaskColumn;
dxDBGridMaskColumn94: TdxDBGridMaskColumn;
dxDBGridMaskColumn95: TdxDBGridMaskColumn;
dxDBGridColumn27: TdxDBGridColumn;
dxDBGridColumn28: TdxDBGridColumn;
dxDBGridMaskColumn96: TdxDBGridMaskColumn;
dxDBGridMaskColumn97: TdxDBGridMaskColumn;
dxDBGridMaskColumn98: TdxDBGridMaskColumn;
dxDBGridMaskColumn99: TdxDBGridMaskColumn;
bsSkinTabSheet10: TbsSkinTabSheet;
dxDBGrid9: TdxDBGrid;
dxDBGridMaskColumn100: TdxDBGridMaskColumn;
dxDBGridMaskColumn101: TdxDBGridMaskColumn;
dxDBGridMaskColumn102: TdxDBGridMaskColumn;
dxDBGridMaskColumn103: TdxDBGridMaskColumn;
dxDBGridMaskColumn104: TdxDBGridMaskColumn;
dxDBGridColumn29: TdxDBGridColumn;
dxDBGrid9Column20: TdxDBGridColumn;
dxDBGridColumn30: TdxDBGridColumn;
dxDBGridMaskColumn105: TdxDBGridMaskColumn;
dxDBGrid9Column19: TdxDBGridColumn;
dxDBGridDateColumn17: TdxDBGridDateColumn;
dxDBGridDateColumn18: TdxDBGridDateColumn;
dxDBGridMaskColumn106: TdxDBGridMaskColumn;
dxDBGridMaskColumn107: TdxDBGridMaskColumn;
dxDBGridMaskColumn108: TdxDBGridMaskColumn;
dxDBGridColumn31: TdxDBGridColumn;
dxDBGridColumn32: TdxDBGridColumn;
dxDBGridMaskColumn109: TdxDBGridMaskColumn;
dxDBGridMaskColumn110: TdxDBGridMaskColumn;
dxDBGridMaskColumn111: TdxDBGridMaskColumn;
bsSkinTabSheet12: TbsSkinTabSheet;
dxDBGrid10: TdxDBGrid;
dxDBGridMaskColumn112: TdxDBGridMaskColumn;
dxDBGridMaskColumn113: TdxDBGridMaskColumn;
dxDBGridMaskColumn114: TdxDBGridMaskColumn;
dxDBGridMaskColumn115: TdxDBGridMaskColumn;
dxDBGridMaskColumn116: TdxDBGridMaskColumn;
dxDBGridColumn33: TdxDBGridColumn;
dxDBGrid10Column20: TdxDBGridColumn;
dxDBGridColumn34: TdxDBGridColumn;
dxDBGridMaskColumn117: TdxDBGridMaskColumn;
dxDBGrid10Column19: TdxDBGridColumn;
dxDBGridDateColumn19: TdxDBGridDateColumn;
dxDBGridDateColumn20: TdxDBGridDateColumn;
dxDBGridMaskColumn118: TdxDBGridMaskColumn;
dxDBGridMaskColumn119: TdxDBGridMaskColumn;
dxDBGridMaskColumn120: TdxDBGridMaskColumn;
dxDBGridColumn35: TdxDBGridColumn;
dxDBGridColumn36: TdxDBGridColumn;
dxDBGridMaskColumn121: TdxDBGridMaskColumn;
dxDBGridMaskColumn122: TdxDBGridMaskColumn;
dxDBGridMaskColumn123: TdxDBGridMaskColumn;
bsSkinPageControl6: TbsSkinPageControl;
bstab1: TbsSkinTabSheet;
bstab2: TbsSkinTabSheet;
s_invoice: TScrollBox;
Label27: TLabel;
Label29: TLabel;
Label31: TLabel;
Label33: TLabel;
Label35: TLabel;
Label37: TLabel;
Label39: TLabel;
Label41: TLabel;
Label46: TLabel;
Label47: TLabel;
Label48: TLabel;
Label49: TLabel;
Label51: TLabel;
Label52: TLabel;
Label53: TLabel;
Label55: TLabel;
Label56: TLabel;
Label58: TLabel;
Label60: TLabel;
Label61: TLabel;
Label62: TLabel;
Label24: TLabel;
Label26: TLabel;
Label66: TLabel;
wwDBDateTimePicker1: TwwDBDateTimePicker;
DE_ShipName: TDBEdit;
DE_BLNO: TDBEdit;
wwDBDateTimePicker2: TwwDBDateTimePicker;
DM: TDBMemo;
DE_SumUpper: TDBEdit;
DBSumLower: TDBEdit;
DE_BusnessNo: TDBEdit;
DE_TaxNo: TDBEdit;
DE_Maker: TDBEdit;
wwDBDateTimePicker3: TwwDBDateTimePicker;
wwDBLookupCombo6: TwwDBLookupCombo;
wwDBLookupCombo7: TwwDBLookupCombo;
DBCheckBox3: TDBCheckBox;
wwDBLookupCombo10: TwwDBLookupCombo;
wwDBLookupCombo11: TwwDBLookupCombo;
wwDBLookupCombo12: TwwDBLookupCombo;
RxDBLookupCombo2: TRxDBLookupCombo;
DBEdit27: TDBEdit;
bsSkinPanel6: TbsSkinPanel;
Label22: TLabel;
Label23: TLabel;
DBEdit13: TDBEdit;
DBEdit15: TDBEdit;
bsSkinDBCheckRadioBox2: TbsSkinDBCheckRadioBox;
bsSkinDBCheckRadioBox3: TbsSkinDBCheckRadioBox;
DBEdit29: TDBEdit;
wwDBLookupCombo1: TwwDBLookupCombo;
Panel1: TPanel;
fra_ch_delete_do1: Tfra_ch_delete_do;
fra_ch_add_do1: Tfra_ch_add_do;
ComboBoxObjBsCard: TDBComboBox;
dxDBGrid1Column39: TdxDBGridColumn;
dbedt1: TDBEdit;
DBEdit19: TDBEdit;
DBEdit30: TDBEdit;
t_sys_bank: TADOQuery;
t_sys_bank1: TDataSource;
bsSkinButton38: TbsSkinButton;
bsSkinButton33: TbsSkinButton;
dxDBGrid3Column24: TdxDBGridColumn;
dxDBGrid3Column25: TdxDBGridColumn;
dxDBGrid4Column24: TdxDBGridColumn;
dxDBGrid4Column25: TdxDBGridColumn;
dxDBGrid5Column21: TdxDBGridColumn;
dxDBGrid5Column22: TdxDBGridColumn;
dxDBGrid6Column21: TdxDBGridColumn;
dxDBGrid6Column22: TdxDBGridColumn;
dxDBGrid7Column24: TdxDBGridColumn;
dxDBGrid7Column25: TdxDBGridColumn;
dxDBGrid8Column24: TdxDBGridColumn;
dxDBGrid8Column25: TdxDBGridColumn;
bsSkinButton34: TbsSkinButton;
bsSkinButton35: TbsSkinButton;
v_fee_do_bscard: TADOQuery;
v_fee_do_bscard1: TDataSource;
bsSkinTabSheet13: TbsSkinTabSheet;
dxDBGrid11: TdxDBGrid;
dxDBGridMaskColumn124: TdxDBGridMaskColumn;
dxDBGridMaskColumn125: TdxDBGridMaskColumn;
dxDBGridMaskColumn126: TdxDBGridMaskColumn;
dxDBGridMaskColumn127: TdxDBGridMaskColumn;
dxDBGridMaskColumn128: TdxDBGridMaskColumn;
dxDBGridColumn37: TdxDBGridColumn;
dxDBGridColumn38: TdxDBGridColumn;
dxDBGridColumn39: TdxDBGridColumn;
dxDBGridMaskColumn129: TdxDBGridMaskColumn;
dxDBGridColumn40: TdxDBGridColumn;
dxDBGridDateColumn21: TdxDBGridDateColumn;
dxDBGridDateColumn22: TdxDBGridDateColumn;
dxDBGridMaskColumn130: TdxDBGridMaskColumn;
dxDBGridMaskColumn131: TdxDBGridMaskColumn;
dxDBGridMaskColumn132: TdxDBGridMaskColumn;
dxDBGridMaskColumn133: TdxDBGridMaskColumn;
dxDBGridMaskColumn134: TdxDBGridMaskColumn;
dxDBGridColumn41: TdxDBGridColumn;
dxDBGridColumn42: TdxDBGridColumn;
dxDBGridMaskColumn135: TdxDBGridMaskColumn;
dxDBGridMaskColumn136: TdxDBGridMaskColumn;
dxDBGridMaskColumn137: TdxDBGridMaskColumn;
dxDBGridMaskColumn138: TdxDBGridMaskColumn;
dxDBGridColumn43: TdxDBGridColumn;
dxDBGridColumn44: TdxDBGridColumn;
dxDBGrid11Column26: TdxDBGridColumn;
bsSkinTabSheet14: TbsSkinTabSheet;
dxDBGrid12: TdxDBGrid;
dxDBGridMaskColumn139: TdxDBGridMaskColumn;
dxDBGridMaskColumn140: TdxDBGridMaskColumn;
dxDBGridMaskColumn141: TdxDBGridMaskColumn;
dxDBGridMaskColumn142: TdxDBGridMaskColumn;
dxDBGridMaskColumn143: TdxDBGridMaskColumn;
dxDBGridColumn45: TdxDBGridColumn;
dxDBGridColumn46: TdxDBGridColumn;
dxDBGridColumn47: TdxDBGridColumn;
dxDBGridColumn48: TdxDBGridColumn;
dxDBGridMaskColumn144: TdxDBGridMaskColumn;
dxDBGridColumn49: TdxDBGridColumn;
dxDBGridDateColumn23: TdxDBGridDateColumn;
dxDBGridDateColumn24: TdxDBGridDateColumn;
dxDBGridMaskColumn145: TdxDBGridMaskColumn;
dxDBGridMaskColumn146: TdxDBGridMaskColumn;
dxDBGridMaskColumn147: TdxDBGridMaskColumn;
dxDBGridMaskColumn148: TdxDBGridMaskColumn;
dxDBGridMaskColumn149: TdxDBGridMaskColumn;
dxDBGridColumn50: TdxDBGridColumn;
dxDBGridColumn51: TdxDBGridColumn;
dxDBGridColumn52: TdxDBGridColumn;
dxDBGridMaskColumn150: TdxDBGridMaskColumn;
dxDBGridMaskColumn151: TdxDBGridMaskColumn;
dxDBGridMaskColumn152: TdxDBGridMaskColumn;
dxDBGridMaskColumn153: TdxDBGridMaskColumn;
dxDBGrid12Column26: TdxDBGridColumn;
Label67: TLabel;
DBEdit31: TDBEdit;
Label68: TLabel;
DBEdit32: TDBEdit;
bsSkinButton36: TbsSkinButton;
DBCheckBox1: TDBCheckBox;
SaveDialog1: TSaveDialog;
Label70: TLabel;
DBEdit33: TDBEdit;
Label71: TLabel;
DBEdit34: TDBEdit;
bsSkinButton15: TbsSkinButton;
bsSkinButton20: TbsSkinButton;
DBComboBoxEh3: TDBComboBoxEh;
qry_UPDINV: TADOQuery;
lbl1: TLabel;
qry_getPath: TADOQuery;
kbmMemTable1: TkbmMemTable;
kbmMemTable2: TkbmMemTable;
tmr_UPDINV: TTimer;
btn1: TbsSkinButton;
edt_from: TEdit;
btn2: TbsSkinButton;
bsknpnl1_bankflow: TbsSkinPanel;
btn4_bankflow: TbsSkinButton;
dxdbgrdchckclmnDBGrid1Column40: TdxDBGridCheckColumn;
Label72: TLabel;
DBEdit35: TDBEdit;
bsSkinButton37: TbsSkinButton;
t_ch_invoice_expitem: TADOQuery;
bsSkinCheckRadioBox1: TbsSkinCheckRadioBox;
bsSkinButton39: TbsSkinButton;
t_ch_invoice_item: TADOQuery;
t_ch_invoice_item1: TDataSource;
DM_ChaCon: TDBMemo;
Label43: TLabel;
DBComboBoxEh2: TDBComboBoxEh;
Label69: TLabel;
DM_CostType: TDBMemo;
Label44: TLabel;
DM_Money: TDBMemo;
cxDBNavigator1: TcxDBNavigator;
Label28: TLabel;
DBComboBoxEh4: TDBComboBoxEh;
DBComboBoxEh5: TDBComboBoxEh;
Label73: TLabel;
Label74: TLabel;
DBComboBoxEh6: TDBComboBoxEh;
DBEdit38: TDBEdit;
Label76: TLabel;
DBEdit39: TDBEdit;
Label77: TLabel;
Label78: TLabel;
DBEdit40: TDBEdit;
wwDBComboBox8: TwwDBComboBox;
Label79: TLabel;
Label80: TLabel;
DBEdit41: TDBEdit;
Label81: TLabel;
DBEdit42: TDBEdit;
wwDBGrid2: TwwDBGrid;
wwDBLookupCombo2: TwwDBLookupCombo;
Label30: TLabel;
DBComboBoxEh7: TDBComboBoxEh;
Label32: TLabel;
DBEdit43: TDBEdit;
DBEdit44: TDBEdit;
Label34: TLabel;
bsSkinButton40: TbsSkinButton;
Label38: TLabel;
wwDBLookupCombo3: TwwDBLookupCombo;
DBComboBoxEh8: TDBComboBoxEh;
Label40: TLabel;
bsSkinButton41: TbsSkinButton;
bsSkinButton42: TbsSkinButton;
Label45: TLabel;
DBComboBoxEh9: TDBComboBoxEh;
t_crm_client_Invoice: TADOQuery;
t_crm_client_Invoice1: TDataSource;
RxDBLookupCombo1: TRxDBLookupCombo;
DBComboBoxEh1: TDBComboBoxEh;
bsSkinButton43: TbsSkinButton;
bsSkinButton44: TbsSkinButton;
bsSkinButton45: TbsSkinButton;
bsSkinButton46: TbsSkinButton;
bsSkinButton47: TbsSkinButton;
t_ch_invoice_insert: TADOQuery;
t_ch_invoice_item_insert: TADOQuery;
dxDBGrid1Column40: TdxDBGridColumn;
dxDBGrid1Column41: TdxDBGridColumn;
dxDBGrid1Column42: TdxDBGridColumn;
dxDBGrid1Column43: TdxDBGridColumn;
dxDBGrid1Column44: TdxDBGridColumn;
dxDBGrid1Column45: TdxDBGridColumn;
dxDBGrid1Column46: TdxDBGridColumn;
dxDBGrid1Column47: TdxDBGridColumn;
dxDBGrid1Column48: TdxDBGridColumn;
dxDBGrid1Column49: TdxDBGridColumn;
dxDBGrid1Column50: TdxDBGridColumn;
dxDBGrid1Column51: TdxDBGridColumn;
t_ch_invoice_invno: TADOQuery;
t_ch_invoice_invno1: TDataSource;
bsSkinGroupBox1: TbsSkinGroupBox;
dxDBGrid13: TdxDBGrid;
dxDBGrid13Column1: TdxDBGridColumn;
DBNavigator1: TDBNavigator;
dxDBGrid1Column52: TdxDBGridColumn;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinPanel1Resize(Sender: TObject);
procedure bsSkinPanel3Resize(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure t_ch_invoiceAfterInsert(DataSet: TDataSet);
procedure bsSkinButton4Click(Sender: TObject);
procedure bsSkinButton11Click(Sender: TObject);
procedure bsSkinButton13Click(Sender: TObject);
procedure t_ch_invoiceBeforeInsert(DataSet: TDataSet);
procedure t_ch_invoiceBeforePost(DataSet: TDataSet);
procedure bsSkinButton18Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure bsSkinButton9Click(Sender: TObject);
procedure bsSkinButton16Click(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure N20Click(Sender: TObject);
procedure t_ch_invoiceBeforeEdit(DataSet: TDataSet);
procedure RxDBLookupCombo2Change(Sender: TObject);
procedure DM_MoneyChange(Sender: TObject);
procedure DM_MoneyExit(Sender: TObject);
procedure DBSumLowerChange(Sender: TObject);
procedure bsSkinButton17Click(Sender: TObject);
procedure bsSkinButton12Click(Sender: TObject);
procedure bsSkinButton23Click(Sender: TObject);
procedure bsSkinButton28Click(Sender: TObject);
procedure bsSkinButton29Click(Sender: TObject);
procedure bsSkinButton30Click(Sender: TObject);
procedure bsSkinButton26Click(Sender: TObject);
procedure bsSkinButton25Click(Sender: TObject);
procedure RxDBLookupCombo3Enter(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure bsSkinButton24Click(Sender: TObject);
procedure bsSkinButton3Click(Sender: TObject);
procedure bsSkinButton31Click(Sender: TObject);
procedure N3Click(Sender: TObject);
procedure DBEdit12KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit16KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit17KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit18KeyPress(Sender: TObject; var Key: Char);
procedure RxDBLookupCombo3KeyPress(Sender: TObject; var Key: Char);
procedure RxDBLookupCombo2KeyPress(Sender: TObject; var Key: Char);
procedure DE_ShipNameKeyPress(Sender: TObject; var Key: Char);
procedure DE_BLNOKeyPress(Sender: TObject; var Key: Char);
procedure wwDBDateTimePicker2KeyPress(Sender: TObject; var Key: Char);
procedure wwDBLookupCombo10KeyPress(Sender: TObject; var Key: Char);
procedure wwDBLookupCombo11KeyPress(Sender: TObject; var Key: Char);
procedure wwDBLookupCombo12KeyPress(Sender: TObject; var Key: Char);
procedure DE_SumUpperKeyPress(Sender: TObject; var Key: Char);
procedure DBSumLowerKeyPress(Sender: TObject; var Key: Char);
procedure wwDBLookupCombo6KeyPress(Sender: TObject; var Key: Char);
procedure DE_BusnessNoKeyPress(Sender: TObject; var Key: Char);
procedure DE_TaxNoKeyPress(Sender: TObject; var Key: Char);
procedure DE_MakerKeyPress(Sender: TObject; var Key: Char);
procedure RxDBLookupCombo3Change(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
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 dxDBGrid2ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
procedure bsSkinButton22Click(Sender: TObject);
procedure bsSkinButton27Click(Sender: TObject);
procedure bsSkinButton32Click(Sender: TObject);
procedure N17Click(Sender: TObject);
procedure N34Click(Sender: TObject);
procedure N36Click(Sender: TObject);
procedure N6Click(Sender: TObject);
procedure MenuItem2Click(Sender: TObject);
procedure dxDBGridMaskColumn2CustomDraw(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 DBEdit29KeyPress(Sender: TObject; var Key: Char);
procedure wwDBDateTimePicker1KeyPress(Sender: TObject; var Key: Char);
procedure wwDBLookupCombo1KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit27KeyPress(Sender: TObject; var Key: Char);
procedure t_ch_invoiceAfterPost(DataSet: TDataSet);
procedure N8Click(Sender: TObject);
procedure N19Click(Sender: TObject);
procedure DBEdit12Change(Sender: TObject);
procedure DE_BLNODblClick(Sender: TObject);
procedure DBEdit29DblClick(Sender: TObject);
procedure t_ch_invoiceAfterScroll(DataSet: TDataSet);
procedure t_ch_invoice1DataChange(Sender: TObject; Field: TField);
procedure ComboBoxObjBsCardDropDown(Sender: TObject);
procedure ComboBoxObjBsCardKeyPress(Sender: TObject; var Key: Char);
procedure dbedt1KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit30Change(Sender: TObject);
procedure RxDBLookupCombo2Enter(Sender: TObject);
procedure bsSkinButton38Click(Sender: TObject);
procedure bsSkinButton33Click(Sender: TObject);
procedure dxDBGrid1CustomDraw(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 wwDBLookupCombo6Change(Sender: TObject);
procedure DBComboBoxEh1DropDown(Sender: TObject);
procedure dbedt1Change(Sender: TObject);
procedure DBComboBoxEh1CloseUp(Sender: TObject; Accept: Boolean);
procedure bsSkinPageControl1Change(Sender: TObject);
procedure bsSkinPageControl6Change(Sender: TObject);
procedure dxDBGrid3Column25CustomDraw(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 dxDBGrid4Column25CustomDraw(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 dxDBGrid5Column22CustomDraw(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 dxDBGrid6Column22CustomDraw(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 dxDBGrid3Column24CustomDraw(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 dxDBGrid4Column24CustomDraw(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 dxDBGrid7Column24CustomDraw(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 dxDBGrid8Column24CustomDraw(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 dxDBGrid7Column25CustomDraw(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 dxDBGrid8Column25CustomDraw(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 bsSkinButton35Click(Sender: TObject);
procedure bsSkinPanel2Resize(Sender: TObject);
procedure bsSkinPageControl2Change(Sender: TObject);
procedure dxDBGridColumn43CustomDraw(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 dxDBGridColumn44CustomDraw(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 fra_ch_add_do1MenuItem1Click(Sender: TObject);
procedure fra_ch_add_do1bsSkinButton11Click(Sender: TObject);
procedure bsSkinButton36Click(Sender: TObject);
procedure DBComboBoxEh2DropDown(Sender: TObject);
procedure DM_CostTypeKeyPress(Sender: TObject; var Key: Char);
procedure DBComboBoxEh2CloseUp(Sender: TObject; Accept: Boolean);
procedure DBComboBoxEh2Change(Sender: TObject);
procedure bsSkinButton15Click(Sender: TObject);
procedure bsSkinButton20Click(Sender: TObject);
procedure dxDBGrid1Click(Sender: TObject);
procedure tmr_UPDINVTimer(Sender: TObject);
procedure btn1Click(Sender: TObject);
procedure dxDBGrid1ChangeNode(Sender: TObject; OldNode,
Node: TdxTreeListNode);
procedure btn4_bankflowClick(Sender: TObject);
procedure bsSkinButton37Click(Sender: TObject);
procedure bsSkinButton34Click(Sender: TObject);
procedure bsSkinButton39Click(Sender: TObject);
procedure t_ch_invoice_itemAfterPost(DataSet: TDataSet);
procedure t_ch_invoice_itemBeforeEdit(DataSet: TDataSet);
procedure t_ch_invoice_itemBeforeInsert(DataSet: TDataSet);
procedure DBComboBoxEh1Change(Sender: TObject);
procedure wwDBLookupCombo2Change(Sender: TObject);
procedure t_ch_invoice_itemBeforePost(DataSet: TDataSet);
procedure t_ch_invoice_itemNewRecord(DataSet: TDataSet);
procedure bsSkinButton40Click(Sender: TObject);
procedure bsSkinButton41Click(Sender: TObject);
procedure bsSkinButton42Click(Sender: TObject);
procedure RxDBLookupCombo1Change(Sender: TObject);
procedure wwDBLookupCombo3Change(Sender: TObject);
procedure bsSkinButton43Click(Sender: TObject);
procedure bsSkinButton45Click(Sender: TObject);
procedure bsSkinButton44Click(Sender: TObject);
procedure t_ch_invoice_insertAfterInsert(DataSet: TDataSet);
procedure t_ch_invoice_insertBeforePost(DataSet: TDataSet);
procedure t_ch_invoice_item_insertAfterInsert(DataSet: TDataSet);
procedure t_ch_invoice_item_insertAfterPost(DataSet: TDataSet);
private
shiji:double;
KPpath:string;
Local_SH:string;
DZDH:string;
OLD_IN_ID:string;
NEW_IN_ID:string;
m_bankflowRight:boolean;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮȨ<CBAE><C8A8>
function getfeestr:boolean;
procedure readcustomer();
procedure readfeename();
procedure Change_INV(IN_ID:string );
procedure UPDINV(IN_ID:string );
procedure setBankflowButtonState();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮƥ<CBAE>䰴ť<E4B0B4><C5A5>״̬
procedure expduiINV(exptype:Integer);
procedure expINV(exptype:Integer);
procedure expDZduiINV(exptype:Integer);
procedure expDZINV(exptype:Integer);
{ Private declarations }
public
fname1,fname2,fname3,fname4,fname5,fname6,fname7,fnum:string;
fprice1,fprice2,fprice3,fprice4,fprice5,fprice6,fprice7,invremarks:string;
main,vessldate,feinum,bibie:thandle;
procedure t_ch_invoice_itemvatPriceFieldChange(Sender: TField);
{ Public declarations }
end;
var
ch_invoice_open:boolean;
frm_ch_invoice_jk: Tfrm_ch_invoice_jk;
invcontrid:integer;
function EnumChildWindowsProc(hwnd,lparam:Integer):Boolean;stdcall;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD>
implementation
uses u_main, my_sys_function, u_data_share, u_ch_invoice_add_jk,
u_ch_shen_query, u_ch_invoice_query, u_ch_invoice_addone_jk,
u_ch_invoice_expitems;
{$R *.dfm}
procedure Tfrm_ch_invoice_jk.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
ch_invoice_open:=false;
savereggrid(dxdbgrid1,caption+'1');
savereggrid(dxdbgrid2,caption+'2');
frm_ch_invoice_jk.Hide;
frm_ch_invoice_jk.ManualFloat(frm_ch_invoice_jk.BoundsRect );
frm_main.freeTabs('frm_ch_invoice_jk');
action:=cafree;
frm_ch_invoice_jk:=nil;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_ch_invoice_jk.bsSkinPanel1Resize(Sender: TObject);
var
i:integer;
begin
i:=round(bsSkinPanel1.Width/12);
bsSkinButton16.Width:=i;
bsSkinButton17.Width:=i;
// bsSkinButton15.Width:=i;
// bsSkinButton20.Width:=i;
bsSkinButton4.Width:=i;
bsSkinButton11.Width:=i;
bsSkinButton12.Width:=i;
bsSkinButton13.Width:=i;
bsSkinButton18.Width:=i;
bsSkinButton19.Width:=i;
bsSkinButton46.Width:=i;
bsSkinButton47.Width:=i;
end;
procedure Tfrm_ch_invoice_jk.bsSkinPanel3Resize(Sender: TObject);
var
i:integer;
begin
//<2F><><EFBFBD>㰴ť<E3B0B4><C5A5><EFBFBD><EFBFBD>
if strtobool(get_parameters_value(1,'false'))then
begin
bsSkinButton25.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ';
bsSkinButton22.Visible:=false;
bsSkinButton27.Visible:=false;
i:=round(bsSkinPanel3.Width/10);
bsSkinButton23.Width:=i;
bsSkinButton24.Width:=i;
bsSkinButton28.Width:=i;
bsSkinButton29.Width:=i;
bsSkinButton30.Width:=i;
bsSkinButton25.Width:=i;
bsSkinButton26.Width:=i;
bsSkinButton31.Width:=i;
bsSkinButton33.Width:=i;
end
else
begin
bsSkinButton25.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ';
bsSkinButton22.Visible:=true;
bsSkinButton27.Visible:=true;
i:=round(bsSkinPanel3.Width/13);
bsSkinButton23.Width:=i;
bsSkinButton24.Width:=i;
bsSkinButton28.Width:=i;
bsSkinButton29.Width:=i;
bsSkinButton30.Width:=i;
bsSkinButton25.Width:=i;
bsSkinButton26.Width:=i;
bsSkinButton31.Width:=i;
bsSkinButton22.Width:=i;
bsSkinButton27.Width:=i;
bsSkinButton23.Width:=i;
bsSkinButton33.Width:=i;
end;
bsSkinButton32.Left:=dxDBGrid2.Width-bsSkinButton32.Width-20;
end;
procedure Tfrm_ch_invoice_jk.FormShow(Sender: TObject);
begin
t_sys_bank.open;
frm_data_share.t_code_goods_inv.Requery();
t_ch_invoice.close;
t_ch_invoice.sql.clear;
t_ch_invoice.sql.add('select top 100 * from t_ch_invoice order by <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> desc,<2C><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> desc');
t_ch_invoice.open;
t_ch_invoice_item.Open;
ch_invoice_open:=true;
TNumericField(t_ch_invoice.FieldByName('<27>ϼƽ<CFBC><C6BD><EFBFBD>')).DisplayFormat:='#,##0.00;-#,##0.00';
ADOQuery1.open;
ADOQuery2.open;
ADOQuery3.open;
ADOQuery4.open;
t_ch_invoice_invno.Open;
// t_crm_client_Invoice.Open;
//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮƥ<CBAE><C6A5><EFBFBD><EFBFBD>Ȩ<EFBFBD><C8A8>
m_bankflowRight:=if_open('418');
//qry_feename.Open;
qry_getPath.Close;
qry_getPath.Open;
KPpath:= qry_getPath.fieldByName('KPpath').AsString;
//KPpath:=StringReplace (KPpath, ' ', '[<5B>ո<EFBFBD>]', []);
Local_SH:= Trim(frm_data_share.t_sys_company.fieldbyname('˰<><CBB0><EFBFBD>ǼǺ<C7BC>').AsString);
DZDH:= qry_getPath.fieldByName('DZDH').AsString;
//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮƥ<CBAE><C6A5><EFBFBD><EFBFBD>Ȩ<EFBFBD><C8A8>
m_bankflowRight:=if_open('418');
readcustomer;//<2F><>ȡ<EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>
readfeename;
OLD_IN_ID:='';
NEW_IN_ID:='';
DBComboBoxEh3.Text:='<27><>ֵ˰<D6B5><CBB0>Ʊ';
//<2F>ڸ<EFBFBD><DAB8>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ڶ<EFBFBD>ȡ
// t_ch_invoice_head.open;
//<2F><>ҵ<EFBFBD><D2B5><EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD>
bsSkinPageControl1.ActivePageIndex:=0;
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.bsSkinCheckRadioBox6.Checked:=true;
// fra_ch_add_do1.bsSkinButton11.Caption:='<27><><EFBFBD><EFBFBD><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_add_do1.bsSkinCheckRadioBox6.Checked:=true;
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;
fra_ch_add_do1.bs_text.text:='1';
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;
fra_ch_delete_do1.bs_text.Text:='1';
fra_ch_delete_do1.do_ban1.DataSet:=t_ch_invoice;
loadreggrid(dxdbgrid1,false,caption+'1');
loadreggrid(dxdbgrid2,false,caption+'2');
frm_data_share.t_crm_client_all.requery;
frm_data_share.t_code_currency.requery;
//<2F>Ƿ<EFBFBD>ע<EFBFBD><D7A2>˰<EFBFBD>ؽӿ<D8BD>
if not if_reg(417) then begin
bsSkinButton34.Visible:=false;
bsSkinButton35.Visible:=false;
end;
{$IFDEF FPSHENQING}
{$ELSE}
bsSkinTabSheet3.TabVisible:=false;
{$ENDIF}
t_ch_invoice_item.FieldByName('<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>').OnChange:=t_ch_invoice_itemvatPriceFieldChange;
t_ch_invoice_item.FieldByName('<27><><EFBFBD><EFBFBD>').OnChange:=t_ch_invoice_itemvatPriceFieldChange;
setBankflowButtonState();
end;
procedure Tfrm_ch_invoice_jk.t_ch_invoiceAfterInsert(DataSet: TDataSet);
begin
t_ch_invoice['<27>Ƶ<EFBFBD><C6B5><EFBFBD>']:=employee;
t_ch_invoice['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:=date;
t_ch_invoice['<27>ϼƽ<CFBC><C6BD><EFBFBD>']:=0;
t_ch_invoice['ʵ<>ʽ<EFBFBD><CABD><EFBFBD>']:=0;
t_ch_invoice['<27><EFBFBD><E9BFAA><EFBFBD><EFBFBD>']:=0;
t_ch_invoice['<27>Զ<EFBFBD>']:=1;
t_ch_invoice['<27><><EFBFBD>̵ǼǺ<C7BC>']:=Trim(frm_data_share.t_sys_company.fieldbyname('<27><><EFBFBD>̵ǼǺ<C7BC>').AsString);
t_ch_invoice['˰<><CBB0><EFBFBD>ǼǺ<C7BC>']:=Trim(frm_data_share.t_sys_company.fieldbyname('˰<><CBB0><EFBFBD>ǼǺ<C7BC>').AsString);
t_ch_invoice['<27><><EFBFBD><EFBFBD>״̬']:=0;
t_ch_invoice['<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ']:=0;
t_ch_invoice['<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>']:=0;
t_ch_invoice['<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD><EFBFBD>ʺ<EFBFBD><CABA><EFBFBD><EFBFBD><EFBFBD>']:=1;
t_ch_invoice['<27>ұ<EFBFBD>']:='RMB';
t_ch_invoice['<27><>Ʊ<EFBFBD>ұ<EFBFBD>']:='RMB';
t_ch_invoice['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:='1';
t_ch_invoice['<27><>Ʊ״̬']:='0';
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='0';
t_ch_invoice['<27><><EFBFBD>ͷ<EFBFBD>ʽ']:='-1';
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD>']:='0';
{
if t_ch_invoice['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']<>'<27><>ϸ<EFBFBD><CFB8>Ʊ' then
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˷<EFBFBD>';
}
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton4Click(Sender: TObject);
begin
if t_ch_invoice.state in [dsedit,dsinsert] then t_ch_invoice.post;
if strtobool(get_parameters_value(5,'FALSE'))then
begin
try
frm_ch_invoice_add_jk:=tfrm_ch_invoice_add_jk.Create (self);
frm_ch_invoice_add_jk.bsSkinCheckRadioBox1.enabled:=false;
frm_ch_invoice_add_jk.bsSkinCheckRadioBox2.Visible:=false;
frm_ch_invoice_add_jk.wwDBLookupCombo6.Text:='RMB';
frm_ch_invoice_add_jk.bsSkinCheckRadioBox7.Checked:=True;
if t_ch_invoice.IsEmpty then
frm_ch_invoice_add_jk.bsSkinCheckRadioBox8.enabled:=false;
frm_ch_invoice_add_jk.ShowModal;
finally
frm_ch_invoice_add_jk.Free;
end;
end
else
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܿ<EFBFBD><DCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɷ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>');
end;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton11Click(Sender: TObject);
begin
table_post(t_ch_invoice);
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton13Click(Sender: TObject);
begin
table_cancel(t_ch_invoice);
end;
procedure Tfrm_ch_invoice_jk.t_ch_invoiceBeforeInsert(DataSet: TDataSet);
begin
if not modify_all then
abort;
end;
procedure Tfrm_ch_invoice_jk.t_ch_invoiceBeforePost(DataSet: TDataSet);
var
currency_chi:String;
total_money:Double;
aAdoQuery:TAdoQuery;
USDAMT,RMBAMT:Double;
begin
t_ch_invoice['ʵ<>ʽ<EFBFBD><CABD><EFBFBD>']:=s_w(StrToInt(apointnum),t_ch_invoice['ʵ<>ʽ<EFBFBD><CABD><EFBFBD>']);
if (t_ch_invoice.state=dsinsert) and (t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='') then
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=get_no(date,'IA');
if (frm_ch_invoice_jk.t_ch_invoice.fieldbyname('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').asstring<>'<27><><EFBFBD>뷢Ʊ') and (shiji<>t_ch_invoice.FieldByName('ʵ<>ʽ<EFBFBD><CABD><EFBFBD>').value) then
t_ch_invoice['<27>ϼƽ<CFBC><C6BD><EFBFBD>']:=t_ch_invoice['ʵ<>ʽ<EFBFBD><CABD><EFBFBD>'];
total_money:=Abs(t_ch_invoice['<27>ϼƽ<CFBC><C6BD><EFBFBD>']);
if t_ch_invoice['<27>ұ<EFBFBD>']='RMB' then currency_chi:='';//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if t_ch_invoice['<27>ұ<EFBFBD>']='USD' then currency_chi:=''; //<2F><>Ԫ
if t_ch_invoice['<27>ϼƽ<CFBC><C6BD><EFBFBD>']<0 then
begin
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д']:=invoice_max(total_money,currency_chi+'(<28><>)');
end
else
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д']:=invoice_max(t_ch_invoice['<27>ϼƽ<CFBC><C6BD><EFBFBD>'],currency_chi);
{
IF t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').asstring='<27><><EFBFBD>ɷ<EFBFBD>Ʊ'then
begin
t_ch_invoice['ʵ<>ʽ<EFBFBD><CABD><EFBFBD>']:=0;
end;
}
t_ch_invoice['<27><EFBFBD><E9BFAA><EFBFBD><EFBFBD>']:=t_ch_invoice['<27>ϼƽ<CFBC><C6BD><EFBFBD>']-t_ch_invoice['ʵ<>ʽ<EFBFBD><CABD><EFBFBD>'];
//table_before_post(t_ch_invoice,'<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>');
// table_before_post(t_ch_invoice,'<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_ch_invoice,'<27>ұ<EFBFBD>');
if (t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsString<>'1') then begin
USDAMT:=0;
RMBAMT:=0;
aAdoQuery:=CreateAdoQuery;
with aAdoQuery do
try
Close;SQL.Clear;
sql.Add('select ');
sql.Add('sum(case when f.<2E>ұ<EFBFBD>=''RMB'' then D.ԭʼ<D4AD><CABC><EFBFBD><EFBFBD> else 0 end) as RMBAMT');
sql.Add(',sum(case when f.<2E>ұ<EFBFBD><>''RMB'' then D.ԭʼ<D4AD><CABC><EFBFBD><EFBFBD> else 0 end) as USDAMT');
sql.Add('From t_ch_fee_do d left join t_ch_fee f on (f.CH_ID=d.CH_ID)');
sql.Add('where D.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:bsno');
Parameters.ParamByName('bsno').Value:=t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
open;First;
if not IsEmpty then
begin
USDAMT:=USDAMT+FieldByName('USDAMT').AsFloat;
RMBAMT:=RMBAMT+FieldByName('RMBAMT').AsFloat;
end;
t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>').AsFloat:=RMBAMT;
t_ch_invoice.FieldByName('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').AsFloat:=USDAMT;
if (RMBAMT=0) and (USDAMT<>0) and (edt_from.text='') and (t_ch_invoice.FieldByName('<27><>ע').AsString='') THEN begin
t_ch_invoice['ʵ<>ʱұ<CAB1>']:='USD';
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˷<EFBFBD>';
t_ch_invoice['<27><>ע']:='USD'+floattostr(USDAMT)+'*'+floattostr(GetUsdExrate(t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString))+' <20><>Ʊ<EFBFBD>޸<EFBFBD><DEB8><EFBFBD>Ԫ';
end else t_ch_invoice['ʵ<>ʱұ<CAB1>']:='RMB';
if (t_ch_invoice.FieldByName('<27><>Ʊ̧ͷ').AsString='') or (t_ch_invoice.FieldByName('<27><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>').AsString='') then begin
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.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
if (t_ch_invoice.FieldByName('ʵ<>ʱұ<CAB1>').AsString<>'') then
SQL.Add(' and <20>ұ<EFBFBD>='''+t_ch_invoice.FieldByName('ʵ<>ʱұ<CAB1>').AsString+'''');
open;
if not IsEmpty then
begin
if (t_ch_invoice.state=dsinsert) or (t_ch_invoice.state=dsedit) then
begin
DBComboBoxEh4.Text:=FieldByName('<27><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>').AsString;
DBComboBoxEh5.Text:=FieldByName('<27><>ַ<EFBFBD>绰').AsString;
DBComboBoxEh6.Text:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>ʺ<EFBFBD>').AsString;
t_ch_invoice['<27><>Ʊ̧ͷ']:=fieldbyname('<27><>Ʊ̧ͷ').asstring;
if frm_data_share.t_crm_client_all.locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',t_ch_invoice.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString,[]) then
begin
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_data_share.t_crm_client_all.fieldbyname('<27><><EFBFBD>շ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').asstring;
end
end
end;
end;
finally
Free;
end;
end;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton18Click(Sender: TObject);
begin
bsSkinTabSheet1.Show;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton1Click(Sender: TObject);
begin
bsSkinTabSheet2.Show;
if StrToBool(get_parameters_value(85,'false')) then
begin
bsSkinTabSheet8.TabVisible:=false;
bsSkinTabSheet9.TabVisible:=false;
bsSkinTabSheet10.TabVisible:=false;
bsSkinTabSheet12.TabVisible:=false;
bsSkinTabSheet13.TabVisible:=true;
v_fee_do_bscard.Close;
v_fee_do_bscard.DataSource:=t_ch_invoice1;
v_fee_do_bscard.Open;
ADOQuery1.Close;
ADOQuery2.Close;
ADOQuery3.Close;
ADOQuery4.Close;
end
else
begin
bsSkinTabSheet8.TabVisible:=true;
bsSkinTabSheet9.TabVisible:=true;
bsSkinTabSheet10.TabVisible:=true;
bsSkinTabSheet12.TabVisible:=true;
bsSkinTabSheet13.TabVisible:=false;
ADOQuery1.open;
ADOQuery2.open;
ADOQuery3.open;
ADOQuery4.open;
v_fee_do_bscard.Close;
end;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton9Click(Sender: TObject);
var
Pnt:Tpoint;
begin
Pnt:=bsSkinButton9.ClientToScreen(Point(0,bsSkinButton9.Height));
PopupMenu2.Popup(Pnt.x,Pnt.y);
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton16Click(Sender: TObject);
var
Pnt:Tpoint;
begin
Pnt:=bsSkinButton16.ClientToScreen(Point(0,bsSkinButton16.Height));
PopupMenu2.Popup(Pnt.x,Pnt.y);
end;
procedure Tfrm_ch_invoice_jk.N1Click(Sender: TObject);
begin
if t_ch_invoice.IsEmpty then
exit;
if t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>').asboolean then
begin
showmessage('<27><>Ʊ<EFBFBD>Ѿ<EFBFBD><D1BE>ϳ<EFBFBD><CFB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>');
exit;
end;
if Trim(t_ch_invoice.FieldByName('<27><>Ʊ̧ͷ').AsString)='' then
begin
showmessage('<27><>Ʊ̧ͷΪ<CDB7>գ<EFBFBD><D5A3><EFBFBD><EFBFBD>ܴ<EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>');
exit;
end;
if t_ch_invoice.state in [dsedit,dsinsert] then t_ch_invoice.post;
if not t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ').asboolean then
begin
t_ch_invoice.Edit;
t_ch_invoice['<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ']:=1;
t_ch_invoice.post;
end;
sys_print('ҵ<><D2B5><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>ӡ',1,t_ch_invoice1,nil,nil,nil,DataSource1,DataSource2,DataSource3,DataSource4,t_ch_invoice1,nil,nil);
end;
procedure Tfrm_ch_invoice_jk.N20Click(Sender: TObject);
begin
if t_ch_invoice.IsEmpty then
exit;
if t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>').asboolean then
begin
showmessage('<27><>Ʊ<EFBFBD>Ѿ<EFBFBD><D1BE>ϳ<EFBFBD><CFB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>');
exit;
end;
if Trim(t_ch_invoice.FieldByName('<27><>Ʊ̧ͷ').AsString)='' then
begin
showmessage('<27><>Ʊ̧ͷΪ<CDB7>գ<EFBFBD><D5A3><EFBFBD><EFBFBD>ܴ<EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>');
exit;
end;
if t_ch_invoice.state in [dsedit,dsinsert] then t_ch_invoice.post;
if not t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ').asboolean then
begin
t_ch_invoice.Edit;
t_ch_invoice['<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ']:=1;
t_ch_invoice.post;
end;
sys_print('ҵ<><D2B5><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>ӡ',2,t_ch_invoice1,nil,nil,nil,DataSource1,DataSource2,DataSource3,DataSource4,t_ch_invoice1,nil,nil);
end;
procedure Tfrm_ch_invoice_jk.t_ch_invoiceBeforeEdit(DataSet: TDataSet);
begin
if not modify_all then
begin
if t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>').asboolean then
begin
showmessage('<27><>Ʊ<EFBFBD>Ѿ<EFBFBD><D1BE>ϳ<EFBFBD><CFB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ģ<DEB8><C4A3><EFBFBD>');
abort;
end;
if t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ').asboolean then
begin
showmessage('<27><>Ʊ<EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ģ<DEB8><C4A3><EFBFBD>');
abort;
end;
end;
shiji:=t_ch_invoice.fieldbyname('ʵ<>ʽ<EFBFBD><CABD><EFBFBD>').asfloat;
end;
procedure Tfrm_ch_invoice_jk.RxDBLookupCombo2Change(Sender: TObject);
begin
try
// if (t_ch_invoice.state=dsinsert) or (t_ch_invoice.state=dsedit) then
// begin
if not t_sys_bank.IsEmpty then
if t_sys_bank.Locate('<27><><EFBFBD><EFBFBD>',RxDBLookupCombo2.DisplayValues[0],[])then begin
t_ch_invoice.Edit;
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>']:=t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>').asstring;
end;
// end;
except
;
end;
end;
procedure Tfrm_ch_invoice_jk.DM_MoneyChange(Sender: TObject);
VAR
total_money:real;
currency_chi:string;
begin
try
if (t_ch_invoice.state=dsinsert) or (t_ch_invoice.state=dsedit) then
begin
if frm_data_share.t_code_currency.Locate('<27>ұ<EFBFBD>',wwDBLookupCombo6.text,[])then
// currency_chi:=frm_data_share.t_code_currency.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
total_money:=total_num(DM_Money);
t_ch_invoice['<27>ϼƽ<CFBC><C6BD><EFBFBD>']:=total_money;
if total_money<0 then
begin
total_money:=Abs(total_money);
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д']:=invoice_max(total_money,'<27><>'+currency_chi);
end
else
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д']:=invoice_max(total_money,currency_chi);
end;
except
;
end;
end;
procedure Tfrm_ch_invoice_jk.DM_MoneyExit(Sender: TObject);
begin
if (t_ch_invoice.State=dsedit)or(t_ch_invoice.State=dsinsert)then
begin
add_zero(DM_Money);
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>']:=DM_Money.text;
end;
end;
procedure Tfrm_ch_invoice_jk.DBSumLowerChange(Sender: TObject);
VAR
total_money:real;
currency_chi:string;
begin
try
if (t_ch_invoice.state=dsinsert) or (t_ch_invoice.state=dsedit) then
begin
if frm_data_share.t_code_currency.Locate('<27>ұ<EFBFBD>',wwDBLookupCombo6.text,[])then
currency_chi:=frm_data_share.t_code_currency.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
total_money:=strtofloat(DBSumLower.text);
if total_money<0 then
begin
total_money:=Abs(total_money);
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д']:=invoice_max(total_money,currency_chi+'(<28><>)');
end
else
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д']:=invoice_max(total_money,currency_chi);
end;
except
;
end;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton17Click(Sender: TObject);
begin
if t_ch_invoice.IsEmpty then
exit;
if not if_open('031') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end;
if t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>').asboolean then
begin
showmessage('<27><>Ʊ<EFBFBD>Ѿ<EFBFBD><D1BE>ϳ<EFBFBD><CFB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>');
exit;
end;
if t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ').asboolean then
begin
if application.MessageBox('<27><>ȷ<EFBFBD><C8B7>Ҫȡ<D2AA><C8A1><EFBFBD><EFBFBD>ӡ<EFBFBD><D3A1>?','<27><><EFBFBD><EFBFBD>:',MB_OKCANCEL)=IDOK then
begin
try
modify_all:=true;
t_ch_invoice.Edit;
t_ch_invoice['<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ']:=0;
t_ch_invoice.post;
finally
modify_all:=false;
end;
end;
end;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton12Click(Sender: TObject);
var
str:widestring;
if_shen:string;
in_id:integer;
aQuery:TADOQuery;
begin
//ɾ<><C9BE><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>ӡֻ<D3A1>ܷϳ<DCB7><CFB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>
if t_ch_invoice.IsEmpty then
exit;
if t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>').asboolean then
begin
if if_open('309') then begin
modify_all:=true;
t_ch_invoice.Edit;
t_ch_invoice['<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>']:=0;
t_ch_invoice['<27>ϳ<EFBFBD>ԭ<EFBFBD><D4AD>']:='';
t_ch_invoice['<27>ϳ<EFBFBD><CFB3><EFBFBD>']:='';
t_ch_invoice['<27>ϳ<EFBFBD><CFB3><EFBFBD><EFBFBD><EFBFBD>']:=null;
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='';
t_ch_invoice.post;
modify_all:=false;
end else begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD>,<2C><>û<EFBFBD>г<EFBFBD><D0B3><EFBFBD><EFBFBD>ϳ<EFBFBD><CFB3><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD><DEA3><EFBFBD>');
end;
exit;
end;
if_shen:=t_ch_invoice.fieldbyname('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').asstring;
if t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ').asboolean then
begin
str:=trim(InputBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϳ<EFBFBD>ԭ<EFBFBD><D4AD>', '<27>ϳ<EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD>', ''));
if str=''then
begin
showmessage('<27>ϳ<EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3>ϳ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
exit;
end
else if str=''then
begin
exit;
end;
in_id:=t_ch_invoice.FieldByName('IN_ID').asinteger;
t_ch_invoice.Refresh;
if not t_ch_invoice.locate('IN_ID',in_id,[]) then
exit;
try
if t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString<>'<27><><EFBFBD>뷢Ʊ' then begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('select * from t_ch_fee_do where <20><><EFBFBD><EFBFBD>=''1'' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Open;
first;
while not eof do begin
Delete;
end;
end;
finally
FreeAndNil(aQuery);
end;
end else begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('select * from t_ch_fee_do where <20><><EFBFBD><EFBFBD>=''1'' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Open;
first;
while not eof do begin
edit;
fieldbyname('<27><><EFBFBD><EFBFBD>').AsString:='7';
post;
next;
end;
end;
finally
FreeAndNil(aQuery);
end;
end;
//ִ<><D6B4>˰<EFBFBD>ػ<EFBFBD><D8BB>ϳ<EFBFBD><CFB3><EFBFBD><EFBFBD><EFBFBD>
modify_all:=true;
t_ch_invoice.Edit;
t_ch_invoice['<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>']:=1;
t_ch_invoice['<27>ϳ<EFBFBD>ԭ<EFBFBD><D4AD>']:=str;
t_ch_invoice['<27>ϳ<EFBFBD><CFB3><EFBFBD>']:=employee;
t_ch_invoice['<27>ϳ<EFBFBD><CFB3><EFBFBD><EFBFBD><EFBFBD>']:=now;
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='';
t_ch_invoice.post;
modify_all:=false;
except
modify_all:=false;
showmessage('<27>ϳ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
exit;
end;
end
else
begin
if application.MessageBox('<27><>ȷ<EFBFBD><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?','<27><><EFBFBD><EFBFBD>:',MB_OKCANCEL)=IDOK then begin
if t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString<>'<27><><EFBFBD>뷢Ʊ' then begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('select * from t_ch_fee_do where <20><><EFBFBD><EFBFBD>=''1'' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Open;
first;
while not eof do begin
Delete;
end;
end;
finally
FreeAndNil(aQuery);
end;
end else begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('select * from t_ch_fee_do where <20><><EFBFBD><EFBFBD>=''1'' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Open;
first;
while not eof do begin
edit;
fieldbyname('<27><><EFBFBD><EFBFBD>').AsString:='7';
post;
next;
end;
end;
finally
FreeAndNil(aQuery);
end;
end;
t_ch_invoice.delete;
end else
exit;
end;
if if_shen<>'<27><><EFBFBD>ɷ<EFBFBD>Ʊ'then
begin
t_ch_invoice_shen.requery;
end;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton23Click(Sender: TObject);
begin
sys_print('ҵ<><D2B5><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>',2,t_ch_invoice_shen1,nil,nil,nil,v_fee_do_seae1,v_fee_do_seai1,v_fee_do_aire1,v_fee_do_airi1,t_ch_invoice_shen1,nil,nil);
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton28Click(Sender: TObject);
begin
table_Prior(t_ch_invoice_shen);
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton29Click(Sender: TObject);
begin
table_next(t_ch_invoice_shen);
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton30Click(Sender: TObject);
begin
if bsSkinButton30.Caption='<27><>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>' then
begin
if t_ch_invoice_shen.IsEmpty then
exit;
bsSkinTabSheet22.show;
bsSkinButton30.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>';
end
else
begin
bsSkinTabSheet11.show;
bsSkinButton30.Caption:='<27><>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>';
end;
if StrToBool(get_parameters_value(85,'false')) then
begin
bsSkinTabSheet4.TabVisible:=false;
bsSkinTabSheet5.TabVisible:=false;
bsSkinTabSheet6.TabVisible:=false;
bsSkinTabSheet7.TabVisible:=false;
bsSkinTabSheet14.TabVisible:=true;
v_fee_do_bscard.Close;
v_fee_do_bscard.DataSource:=t_ch_invoice_shen1;
v_fee_do_bscard.Open;
v_fee_do_seae.Close;
v_fee_do_seai.Close;
v_fee_do_aire.Close;
v_fee_do_airi.Close;
end
else
begin
bsSkinTabSheet4.TabVisible:=true;
bsSkinTabSheet5.TabVisible:=true;
bsSkinTabSheet6.TabVisible:=true;
bsSkinTabSheet7.TabVisible:=true;
bsSkinTabSheet14.TabVisible:=false;
v_fee_do_seae.open;
v_fee_do_seai.open;
v_fee_do_aire.open;
v_fee_do_airi.open;
v_fee_do_bscard.Close;
end;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton26Click(Sender: TObject);
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_back(t_ch_invoice_shen);
end
else
begin
if (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>Ʊ')or
(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>')then
begin
t_ch_invoice_shen.Edit;
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD>״̬']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><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.post;
t_ch_invoice_shen.Refresh;
end
else
begin
showmessage('<27><>ǰҵ<C7B0><D2B5>״̬<D7B4><CCAC><EFBFBD>ܲ<EFBFBD><DCB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBA3A1>');
end;
end;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton25Click(Sender: TObject);
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
if (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><EFBFBD><EFBFBD>')or
(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>')then
begin
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><EFBFBD>']:=employee;
t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=now;
t_ch_invoice_shen.post;
t_ch_invoice_shen.Refresh;
end
else
begin
showmessage('<27><>ǰҵ<C7B0><D2B5>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׼<EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>');
end;
end
else
begin
if strtobool(get_parameters_value(1,'false')) then
begin
if (t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring<>'<27><>׼<EFBFBD><D7BC>Ʊ') and
(t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring<>'<27><>ֹ<EFBFBD>޸<EFBFBD>') then
begin
showmessage('<27><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD>ܿ<EFBFBD><DCBF><EFBFBD><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>');
exit;
end;
end
else
begin
if (t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring<>'<27><>׼<EFBFBD><D7BC>Ʊ') and
(t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring<>'<27><>ֹ<EFBFBD>޸<EFBFBD>') and
(t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring<>'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>') then
begin
showmessage('<27><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD>ܿ<EFBFBD><DCBF><EFBFBD><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>');
exit;
end;
end;
try
frm_ch_invoice_add_jk:=tfrm_ch_invoice_add_jk.Create (self);
frm_ch_invoice_add_jk.bsSkinCheckRadioBox1.checked:=true;
frm_ch_invoice_add_jk.bsSkinCheckRadioBox7.enabled:=false;
frm_ch_invoice_add_jk.bsSkinCheckRadioBox8.enabled:=false;
frm_ch_invoice_add_jk.wwDBLookupCombo6.Text:=t_ch_invoice_shen.fieldbyname('<27>ұ<EFBFBD>').asstring;
frm_ch_invoice_add_jk.wwDBLookupCombo6.ReadOnly:=true;
frm_ch_invoice_add_jk.edit2.text:=t_ch_invoice_shen.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring;
frm_ch_invoice_add_jk.edit2.Visible:=true;
frm_ch_invoice_add_jk.RxDBLookupCombo3.Visible:=false;
if t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring<>''then
begin
{
if (date-t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asdatetime)>7 then
begin
showmessage('<27><><EFBFBD><EFBFBD><E6A3BA>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>7<EFBFBD><37><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD><C6A3><EFBFBD>');
end;
}
end;
frm_ch_invoice_add_jk.ShowModal;
finally
frm_ch_invoice_add_jk.Free;
end;
end;
end;
procedure Tfrm_ch_invoice_jk.RxDBLookupCombo3Enter(Sender: TObject);
begin
if DBEdit12.text='<27><><EFBFBD>뷢Ʊ' then
begin
RxDBLookupCombo3.ReadOnly:=true;
{DBEdit19.ReadOnly:=true;
DE_ShipName.ReadOnly:=true;
DE_BLNO.ReadOnly:=true;
wwDBDateTimePicker2.ReadOnly:=true;
wwDBLookupCombo10.ReadOnly:=true;
wwDBLookupCombo11.ReadOnly:=true;
wwDBLookupCombo12.ReadOnly:=true;
DM_ChaCon.ReadOnly:=true;
DM_CostType.ReadOnly:=true;
DM_Money.ReadOnly:=true;
DE_SumUpper.ReadOnly:=true;
DBSumLower.ReadOnly:=true; }
wwDBLookupCombo6.ReadOnly:=true;
end
else
begin
RxDBLookupCombo3.ReadOnly:=false;
{DBEdit19.ReadOnly:=false;
DE_ShipName.ReadOnly:=false;
DE_BLNO.ReadOnly:=false;
wwDBDateTimePicker2.ReadOnly:=false;
wwDBLookupCombo10.ReadOnly:=false;
wwDBLookupCombo11.ReadOnly:=false;
wwDBLookupCombo12.ReadOnly:=false;
DM_ChaCon.ReadOnly:=false;
DM_CostType.ReadOnly:=false;
DM_Money.ReadOnly:=false;
DE_SumUpper.ReadOnly:=false;
DBSumLower.ReadOnly:=false; }
wwDBLookupCombo6.ReadOnly:=false;
end;
end;
procedure Tfrm_ch_invoice_jk.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin
CanClose:=frm_close_query(t_ch_invoice);
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton24Click(Sender: TObject);
begin
try
frm_ch_shen_query:=tfrm_ch_shen_query.Create (self);
shen_query_type:=3;
shen_query_limited:='no';
shen_query_op_limited:='no';
frm_ch_shen_query.ShowModal;
finally
frm_ch_shen_query.Free;
end;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton3Click(Sender: TObject);
begin
if t_ch_invoice.IsEmpty then
exit;
if t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').asstring<>'<27><><EFBFBD>뷢Ʊ'then
begin
showmessage('<27><>ǰ<EFBFBD><C7B0>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뷢Ʊ<EBB7A2><C6B1><EFBFBD><EFBFBD>');
exit;
end;
if t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>').asboolean then
begin
showmessage('<27><>ǰ<EFBFBD><C7B0>Ʊ<EFBFBD>Ѿ<EFBFBD><D1BE>ϳ<EFBFBD><CFB3><EFBFBD><EFBFBD><EFBFBD>');
exit;
end;
if not t_ch_invoice_shen.Locate('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',t_ch_invoice.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,[])then
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><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='
+''''+t_ch_invoice.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'''');
t_ch_invoice_shen.open;
end;
bsSkinTabSheet22.Show;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton31Click(Sender: TObject);
begin
if t_ch_invoice_shen.IsEmpty then
exit;
if t_ch_invoice_shen.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring<>'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ'then
begin
showmessage('<27><>ǰ<EFBFBD><C7B0><EFBFBD>뻹û<EBBBB9>п<EFBFBD><D0BF><EFBFBD><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>');
exit;
end;
if not t_ch_invoice.Locate('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>',t_ch_invoice_shen.fieldbyname('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').asstring,[])then
begin
t_ch_invoice.close;
t_ch_invoice.sql.clear;
t_ch_invoice.sql.add('select * from t_ch_invoice where <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>='
+''''+t_ch_invoice_shen.fieldbyname('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').asstring+'''');
t_ch_invoice.open;
end;
if not t_ch_invoice.IsEmpty then
bsSkinTabSheet2.Show
else
showmessage('û<><C3BB><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>Ӧ<EFBFBD>ķ<EFBFBD>Ʊ<EFBFBD><C6B1>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>');
end;
procedure Tfrm_ch_invoice_jk.N3Click(Sender: TObject);
begin
if t_ch_invoice.IsEmpty then
exit;
if t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>').asboolean then
begin
showmessage('<27><>Ʊ<EFBFBD>Ѿ<EFBFBD><D1BE>ϳ<EFBFBD><CFB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>');
exit;
end;
if Trim(t_ch_invoice.FieldByName('<27><>Ʊ̧ͷ').AsString)='' then
begin
showmessage('<27><>Ʊ̧ͷΪ<CDB7>գ<EFBFBD><D5A3><EFBFBD><EFBFBD>ܴ<EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>');
exit;
end;
if t_ch_invoice.state in [dsedit,dsinsert] then t_ch_invoice.post;
if not t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ').asboolean then
begin
t_ch_invoice.Edit;
t_ch_invoice['<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ']:=1;
t_ch_invoice.post;
end;
sys_print('ҵ<><D2B5><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>ӡ',3,t_ch_invoice1,nil,nil,nil,DataSource1,DataSource2,DataSource3,DataSource4,t_ch_invoice1,nil,nil);
if t_ch_invoice.state in [dsedit,dsinsert] then t_ch_invoice.post;
if MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)=mryes then
bsSkinButton4Click(sender);
end;
procedure Tfrm_ch_invoice_jk.DBEdit12KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit16);
end;
procedure Tfrm_ch_invoice_jk.DBEdit16KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit17);
end;
procedure Tfrm_ch_invoice_jk.DBEdit17KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit18);
end;
procedure Tfrm_ch_invoice_jk.DBEdit18KeyPress(Sender: TObject; var Key: Char);
begin
key_RxDBLookupCombo(Key,RxDBLookupCombo3);
end;
procedure Tfrm_ch_invoice_jk.RxDBLookupCombo3KeyPress(Sender: TObject;
var Key: Char);
begin
key_RxDBLookupCombo(Key,RxDBLookupCombo2);
end;
procedure Tfrm_ch_invoice_jk.RxDBLookupCombo2KeyPress(Sender: TObject;
var Key: Char);
begin
key_DBEdit(Key,DBEdit27);
end;
procedure Tfrm_ch_invoice_jk.DE_ShipNameKeyPress(Sender: TObject;
var Key: Char);
begin
key_DBEdit(Key,DE_BLNO);
end;
procedure Tfrm_ch_invoice_jk.DE_BLNOKeyPress(Sender: TObject; var Key: Char);
begin
key_wwDBDateTimePicker(Key,wwDBDateTimePicker2);
end;
procedure Tfrm_ch_invoice_jk.wwDBDateTimePicker2KeyPress(Sender: TObject;
var Key: Char);
begin
key_wwDBLookupCombo(Key,wwDBLookupCombo10);
end;
procedure Tfrm_ch_invoice_jk.wwDBLookupCombo10KeyPress(Sender: TObject;
var Key: Char);
begin
key_wwDBLookupCombo(Key,wwDBLookupCombo11);
end;
procedure Tfrm_ch_invoice_jk.wwDBLookupCombo11KeyPress(Sender: TObject;
var Key: Char);
begin
key_wwDBLookupCombo(Key,wwDBLookupCombo12);
end;
procedure Tfrm_ch_invoice_jk.wwDBLookupCombo12KeyPress(Sender: TObject;
var Key: Char);
begin
key_DBMemo(Key,DM_ChaCon);
end;
procedure Tfrm_ch_invoice_jk.DE_SumUpperKeyPress(Sender: TObject;
var Key: Char);
begin
key_DBEdit(Key,DBSumLower);
end;
procedure Tfrm_ch_invoice_jk.DBSumLowerKeyPress(Sender: TObject;
var Key: Char);
begin
key_wwDBLookupCombo(Key,wwDBLookupCombo6);
end;
procedure Tfrm_ch_invoice_jk.wwDBLookupCombo6KeyPress(Sender: TObject;
var Key: Char);
begin
key_DBEdit(Key,DE_BusnessNo);
end;
procedure Tfrm_ch_invoice_jk.DE_BusnessNoKeyPress(Sender: TObject;
var Key: Char);
begin
key_DBEdit(Key,DE_TaxNo);
end;
procedure Tfrm_ch_invoice_jk.DE_TaxNoKeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DE_Maker);
end;
procedure Tfrm_ch_invoice_jk.DE_MakerKeyPress(Sender: TObject; var Key: Char);
begin
key_wwDBLookupCombo(Key,wwDBLookupCombo7);
end;
procedure Tfrm_ch_invoice_jk.RxDBLookupCombo3Change(Sender: TObject);
var
aQuery:TADOQuery;
begin
if t_ch_invoice.fieldbyname('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').asstring='<27><><EFBFBD>ɷ<EFBFBD>Ʊ'then
begin
if (t_ch_invoice.state=dsinsert)or(t_ch_invoice.state=dsedit)then
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>',RxDBLookupCombo3.DisplayValues[1],[]) then
begin
{
if frm_data_share.t_crm_client_all.fieldbyname('<27><>Ʊ̧ͷ').asstring<>'' then
t_ch_invoice['<27><>Ʊ̧ͷ']:=frm_data_share.t_crm_client_all.fieldbyname('<27><>Ʊ̧ͷ').asstring
else
t_ch_invoice['<27><>Ʊ̧ͷ']:=frm_data_share.t_crm_client_all.fieldbyname('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').asstring;
}
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_data_share.t_crm_client_all.fieldbyname('<27><><EFBFBD>շ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').asstring;
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.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
if (t_ch_invoice.FieldByName('ʵ<>ʱұ<CAB1>').AsString<>'') then
SQL.Add(' and <20>ұ<EFBFBD>='''+t_ch_invoice.FieldByName('ʵ<>ʱұ<CAB1>').AsString+'''');
open;
if not IsEmpty then
begin
if (t_ch_invoice.state=dsinsert) or (t_ch_invoice.state=dsedit) then
begin
DBComboBoxEh4.Text:=FieldByName('<27><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>').AsString;
DBComboBoxEh5.Text:=FieldByName('<27><>ַ<EFBFBD>绰').AsString;
DBComboBoxEh6.Text:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>ʺ<EFBFBD>').AsString;
t_ch_invoice['<27><>Ʊ̧ͷ']:=fieldbyname('<27><>Ʊ̧ͷ').asstring
// DBEdit31.Text:=FieldByName('<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>').AsString;
end
end
finally
Close;
FreeAndNil(aQuery);
end;
end;
end;
end;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton10Click(Sender: TObject);
begin
try
frm_ch_invoice_query:=tfrm_ch_invoice_query.Create (self);
inv_query_type:=3;
frm_ch_invoice_query.ShowModal;
finally
frm_ch_invoice_query.Free;
end;
end;
procedure Tfrm_ch_invoice_jk.N10Click(Sender: TObject);
begin
if bsSkinTabSheet1.Showing then
update_grid_view_no(dxdbgrid1)
else
update_grid_view_no(dxdbgrid2);
end;
procedure Tfrm_ch_invoice_jk.N14Click(Sender: TObject);
begin
if bsSkinTabSheet1.Showing then
update_grid_view_all(dxdbgrid1)
else
update_grid_view_all(dxdbgrid2);
end;
procedure Tfrm_ch_invoice_jk.N12Click(Sender: TObject);
begin
if bsSkinTabSheet1.Showing then
update_grid(dxdbgrid1,7)
else
update_grid(dxdbgrid2,8);
end;
procedure Tfrm_ch_invoice_jk.N16Click(Sender: TObject);
begin
if bsSkinTabSheet1.Showing then
grid_save_xls(dxdbgrid1)
else
grid_save_xls(dxdbgrid2);
end;
procedure Tfrm_ch_invoice_jk.dxDBGrid1ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
begin
Column_sort(Column,t_ch_invoice,'<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>');
end;
procedure Tfrm_ch_invoice_jk.dxDBGrid2ColumnSorting(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_jk.bsSkinButton22Click(Sender: TObject);
begin
shen_modify_ok(t_ch_invoice_shen);
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton27Click(Sender: TObject);
begin
shen_modify_back(t_ch_invoice_shen);
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton32Click(Sender: TObject);
var
Pnt:Tpoint;
begin
Pnt:=bsSkinButton32.ClientToScreen(Point(0,bsSkinButton32.Height));
PopupMenu3.Popup(Pnt.x,Pnt.y);
end;
procedure Tfrm_ch_invoice_jk.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>뿪Ʊ'+''''
+') '
+'order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> desc');
t_ch_invoice_shen.open;
end;
procedure Tfrm_ch_invoice_jk.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>'+''''+') '
+'order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> desc');
t_ch_invoice_shen.open;
end;
procedure Tfrm_ch_invoice_jk.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>'+''''+') '
+'order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> desc');
t_ch_invoice_shen.open;
end;
procedure Tfrm_ch_invoice_jk.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>'+''''+') '
+'order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> desc');
t_ch_invoice_shen.open;
end;
procedure Tfrm_ch_invoice_jk.MenuItem2Click(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>Ʊ'+''''+') '
+'order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> desc');
t_ch_invoice_shen.open;
end;
procedure Tfrm_ch_invoice_jk.dxDBGridMaskColumn2CustomDraw(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[dxDBGridMaskColumn2.Index]='<27><><EFBFBD>뿪Ʊ')or
(ANode.strings[dxDBGridMaskColumn2.Index]='<27><>׼<EFBFBD>޸<EFBFBD>') then
AColor :=clwhite
else if (ANode.strings[dxDBGridMaskColumn2.Index]='<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>')or
(ANode.strings[dxDBGridMaskColumn2.Index]='<27><><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD>') then
AColor :=clyellow
else if (ANode.strings[dxDBGridMaskColumn2.Index]='<27><>ֹ<EFBFBD>޸<EFBFBD>')or
(ANode.strings[dxDBGridMaskColumn2.Index]='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')then
AColor :=clred
else if (ANode.strings[dxDBGridMaskColumn2.Index]='<27><>׼<EFBFBD><D7BC>Ʊ')or
(ANode.strings[dxDBGridMaskColumn2.Index]='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') then
AColor :=$00DDF21C;
AFont.Color:=clblack;
end;
procedure Tfrm_ch_invoice_jk.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_jk.DBEdit29KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DE_ShipName);
end;
procedure Tfrm_ch_invoice_jk.wwDBDateTimePicker1KeyPress(Sender: TObject;
var Key: Char);
begin
key_DBEdit(Key,DBEdit29);
end;
procedure Tfrm_ch_invoice_jk.wwDBLookupCombo1KeyPress(Sender: TObject;
var Key: Char);
begin
// key_wwDBDateTimePicker(Key,wwDBDateTimePicker1);
end;
procedure Tfrm_ch_invoice_jk.DBEdit27KeyPress(Sender: TObject; var Key: Char);
begin
key_wwDBLookupCombo(Key,wwDBLookupCombo1);
end;
procedure Tfrm_ch_invoice_jk.t_ch_invoiceAfterPost(DataSet: TDataSet);
begin
// t_ch_invoice_head.Requery();
if t_ch_invoice['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']<>'<27><><EFBFBD>뷢Ʊ' then begin
if bsSkinPageControl1.ActivePage=bsSkinTabSheet3 then begin
ADOQuery1.Requery;
ADOQuery2.Requery;
ADOQuery3.Requery;
ADOQuery4.Requery;
end;
if StrToBool(get_parameters_value(85,'false')) then begin
if (bsSkinPageControl6.ActivePage=bstab2) then begin
if fra_ch_delete_do1.v_fee_do_bscard_sum.active then begin
fra_ch_delete_do1.v_fee_do_bscard_sum.Requery;
fra_ch_delete_do1.v_fee_do_bscard.Requery;
end;
end;
end else begin
if (bsSkinPageControl6.ActivePage=bstab2) then 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;
fra_ch_delete_do1.v_fee_do_seai.Requery;
fra_ch_delete_do1.v_fee_do_seai_sum.Requery;
fra_ch_delete_do1.v_fee_do_aire.Requery;
fra_ch_delete_do1.v_fee_do_aire_sum.Requery;
fra_ch_delete_do1.v_fee_do_airi.Requery;
fra_ch_delete_do1.v_fee_do_airi_sum.Requery;
end;
end;
end;
if if_ch_delete_do then
begin
case delete_do_type_num of
1,2,3,4,5:
begin
if fra_ch_add_do1.t_op_seae.Active then
begin
fra_ch_add_do1.t_ch_fee.Requery();
fra_ch_add_do1.t_ch_fee_sum.Requery();
end;
end;
end;
end;
delete_do_type_num:=0;
if_ch_delete_do:=false;
end;
end;
procedure Tfrm_ch_invoice_jk.N8Click(Sender: TObject);
var
aQuery:TADOQuery;
begin
// aQuery:=CreateAdoQuery;
try
modify_all:=true;
t_ch_invoice.edit;
t_ch_invoice['<27>Ƿ<EFBFBD><C7B7>շ<EFBFBD>']:=1;
t_ch_invoice.post;
{
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Update t_ch_invoice set <20>Ƿ<EFBFBD><C7B7>շ<EFBFBD>=1 where IN_ID='+inttostr(t_ch_invoice.fieldbyName('IN_ID').AsInteger));
ExecSQL;
end;
t_ch_invoice.Refresh;
}
finally
modify_all:=false;
// FreeAndNil(aQuery);
end;
end;
procedure Tfrm_ch_invoice_jk.N19Click(Sender: TObject);
begin
// aQuery:=CreateAdoQuery;
try
modify_all:=true;
t_ch_invoice.edit;
t_ch_invoice['<27>Ƿ<EFBFBD><C7B7>շ<EFBFBD>']:=0;
t_ch_invoice.post;
{
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Update t_ch_invoice set <20>Ƿ<EFBFBD><C7B7>շ<EFBFBD>=0 where IN_ID='+inttostr(t_ch_invoice.fieldbyName('IN_ID').AsInteger));
ExecSQL;
end;
t_ch_invoice.Refresh;
}
finally
modify_all:=false;
// FreeAndNil(aQuery);
end;
end;
procedure Tfrm_ch_invoice_jk.DBEdit12Change(Sender: TObject);
begin
if DBEdit12.Text<>'<27><><EFBFBD>뷢Ʊ' then
bstab2.TabVisible:=True
else
bstab2.TabVisible:=false;
end;
procedure Tfrm_ch_invoice_jk.DE_BLNODblClick(Sender: TObject);
var
str:String;
begin
//˫<><CBAB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1B5A5><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD>Ʊ<EFBFBD><C6B1>ϸ
frmch_invoice_addone_jk:=Tfrmch_invoice_addone_jk.Create(Self);
try
with frmch_invoice_addone_jk.ADOQuery1 do begin
frmch_invoice_addone_jk.MblNo:=true;
frmch_invoice_addone_jk.ADOQuery2.Close;
frmch_invoice_addone_jk.ADOQuery2.SQL.Clear;
frmch_invoice_addone_jk.ADOQuery2.SQL.Add('select <20><><EFBFBD><EFBFBD><E1B5A5><>б<EFBFBD><D0B1><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>˸<EFBFBD><><D0B6><EFBFBD><EFBFBD>,Ŀ<>ĵ<EFBFBD> from v_op_bscard where <20><><EFBFBD><EFBFBD><E1B5A5>='''+Trim(DE_BLNO.Text)+''' or <20><><EFBFBD><EFBFBD><E1B5A5>='''+Trim(DE_BLNO.Text)+'''');
frmch_invoice_addone_jk.ADOQuery2.Open;
str:=' and <20><><EFBFBD><EFBFBD><>(<28><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+<2B><><EFBFBD>뿪Ʊ) and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<>1 and <20><><EFBFBD><EFBFBD>=''<27><>'' and <20><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from v_op_bscard where <20><><EFBFBD><EFBFBD><E1B5A5>='''+Trim(DE_BLNO.Text)+''' or <20><><EFBFBD><EFBFBD><E1B5A5>='''+Trim(DE_BLNO.Text)+''')';
frmch_invoice_addone_jk.t_fee_obj.Close;
frmch_invoice_addone_jk.t_fee_obj.SQL.Clear;
frmch_invoice_addone_jk.t_fee_obj.SQL.Add('Select distinct <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> from t_ch_fee where 1=1 ') ;
frmch_invoice_addone_jk.t_fee_obj.SQL.Add(str);
if t_ch_invoice.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString<>'' then
frmch_invoice_addone_jk.t_fee_obj.SQL.Add(' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+t_ch_invoice.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
frmch_invoice_addone_jk.t_fee_obj.Open;
Close;
SQL.Clear;
SQL.Add('Select * from t_ch_fee where 1=1 ');
if t_ch_invoice.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString<>'' then
SQL.Add(' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+t_ch_invoice.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
// else
// SQL.Add(' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=:<3A>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> ');
SQL.Add(str);
Open;
if not IsEmpty then begin
if t_ch_invoice.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then
frmch_invoice_addone_jk.bsSkinRadioGroup1.ItemIndex:=1
else
frmch_invoice_addone_jk.bsSkinRadioGroup1.ItemIndex:=0;
frmch_invoice_addone_jk.ShowModal;
end else begin
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1B5A5><EFBFBD>´˿ͻ<CBBF><CDBB><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD>Ʊ<EFBFBD>ķ<EFBFBD><C4B7><EFBFBD>',mtWarning,[mbYes],0);
end;
end;
finally
FreeAndNil(frmch_invoice_addone_jk);
end;
end;
procedure Tfrm_ch_invoice_jk.DBEdit29DblClick(Sender: TObject);
var
str:String;
begin
//˫<><CBAB>ί<EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD>Ʊ<EFBFBD><C6B1>ϸ
frmch_invoice_addone_jk:=Tfrmch_invoice_addone_jk.Create(Self);
try
with frmch_invoice_addone_jk.ADOQuery1 do begin
frmch_invoice_addone_jk.MblNo:=false;
frmch_invoice_addone_jk.ADOQuery2.Close;
frmch_invoice_addone_jk.ADOQuery2.SQL.Clear;
frmch_invoice_addone_jk.ADOQuery2.SQL.Add('select <20><><EFBFBD><EFBFBD><E1B5A5><>б<EFBFBD><D0B1><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>˸<EFBFBD><><D0B6><EFBFBD><EFBFBD>,Ŀ<>ĵ<EFBFBD> from v_op_bscard where ί<>б<EFBFBD><D0B1><EFBFBD>='''+Trim(DBEdit29.Text)+''' or ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+Trim(DBEdit29.Text)+''' or <20><><EFBFBD><EFBFBD><E1B5A5>='''+Trim(DBEdit29.Text)+'''');
frmch_invoice_addone_jk.ADOQuery2.Open;
str:=' and <20><><EFBFBD><EFBFBD><>(<28><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+<2B><><EFBFBD>뿪Ʊ) and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<>1 and <20><><EFBFBD><EFBFBD>=''<27><>'' and <20><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from v_op_bscard where ί<>б<EFBFBD><D0B1><EFBFBD>='''+Trim(DBEdit29.Text)+''' or ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+Trim(DBEdit29.Text)+''' or <20><><EFBFBD><EFBFBD><E1B5A5>='''+Trim(DBEdit29.Text)+''')';
frmch_invoice_addone_jk.t_fee_obj.Close;
frmch_invoice_addone_jk.t_fee_obj.SQL.Clear;
frmch_invoice_addone_jk.t_fee_obj.SQL.Add('Select distinct <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> from t_ch_fee where 1=1 ') ;
frmch_invoice_addone_jk.t_fee_obj.SQL.Add(str);
if t_ch_invoice.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString<>'' then
frmch_invoice_addone_jk.t_fee_obj.SQL.Add(' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+t_ch_invoice.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
frmch_invoice_addone_jk.t_fee_obj.Open;
Close;
SQL.Clear;
SQL.Add('Select * from t_ch_fee where 1=1 ');
if t_ch_invoice.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString<>'' then
SQL.Add(' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+t_ch_invoice.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
// else
// SQL.Add(' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=:<3A>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> ');
SQL.Add(str);
Open;
// frmch_invoice_addone.memtblDetail.open;
if not IsEmpty then begin
if t_ch_invoice.FieldByName('<27>ұ<EFBFBD>').AsString='USD' then
frmch_invoice_addone_jk.bsSkinRadioGroup1.ItemIndex:=1
else
frmch_invoice_addone_jk.bsSkinRadioGroup1.ItemIndex:=0;
frmch_invoice_addone_jk.ShowModal;
end else begin
MessageDlg('<27><>ί<EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD>´˿ͻ<CBBF><CDBB><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD>Ʊ<EFBFBD>ķ<EFBFBD><C4B7><EFBFBD>',mtWarning,[mbYes],0);
end;
end;
finally
FreeAndNil(frmch_invoice_addone_jk);
end;
end;
procedure Tfrm_ch_invoice_jk.t_ch_invoiceAfterScroll(DataSet: TDataSet);
begin
{
if t_ch_invoice['<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>'] then begin
if t_ch_invoice['<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ'] then begin
bsSkinButton7.Caption:='ɾ<><C9BE><EFBFBD><EFBFBD>Ʊ';
bsSkinButton12.Caption:='ɾ<><C9BE><EFBFBD><EFBFBD>Ʊ';
end else begin
bsSkinButton7.Caption:='<27>ϳ<EFBFBD><CFB3><EFBFBD>Ʊ';
bsSkinButton12.Caption:='<27>ϳ<EFBFBD><CFB3><EFBFBD>Ʊ';
end;
end;
}
end;
procedure Tfrm_ch_invoice_jk.t_ch_invoice1DataChange(Sender: TObject;
Field: TField);
begin
if t_ch_invoice.State in [dsinsert] then exit;
if t_ch_invoice.IsEmpty then exit;
if t_ch_invoice['<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ'] then begin
if t_ch_invoice.fieldbyname('<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>').asboolean then begin
bsSkinButton7.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD>ϳ<EFBFBD>';
bsSkinButton12.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD>ϳ<EFBFBD>';
end else begin
bsSkinButton7.Caption:='<27>ϳ<EFBFBD><CFB3><EFBFBD>Ʊ';
bsSkinButton12.Caption:='<27>ϳ<EFBFBD><CFB3><EFBFBD>Ʊ';
end;
end else begin
bsSkinButton7.Caption:='ɾ<><C9BE><EFBFBD><EFBFBD>Ʊ';
bsSkinButton12.Caption:='ɾ<><C9BE><EFBFBD><EFBFBD>Ʊ';
end;
end;
procedure Tfrm_ch_invoice_jk.ComboBoxObjBsCardDropDown(Sender: TObject);
var
aQuery:TADOQuery;
begin
ComboBoxObjBsCard.Items.Clear;
aQuery:=CreateAdoQuery;
with aQuery do
try
Close;SQL.Clear;
SQL.Add('select distinct <20><>Ʊ̧ͷ from t_ch_invoice');
SQL.Add('order by <20><>Ʊ̧ͷ');
Open;
First;
while not Eof do begin
ComboBoxObjBsCard.Items.Add(FieldByName('<27><>Ʊ̧ͷ').AsString);
Next;
end;
finally
Close;
FreeAndNil(aQuery);
end;
end;
procedure Tfrm_ch_invoice_jk.ComboBoxObjBsCardKeyPress(Sender: TObject;
var Key: Char);
begin
// key_wwDBDateTimePicker(Key,wwDBDateTimePicker1);
end;
procedure Tfrm_ch_invoice_jk.dbedt1KeyPress(Sender: TObject; var Key: Char);
begin
// if key=#13 then
// DBComboBoxEh1.Text:=dbedt1.text;
// DBComboBoxEh1.DropDown;
// ComboBoxObjBsCard.DropDown;
// key_wwDBDateTimePicker(Key,wwDBDateTimePicker1);
end;
procedure Tfrm_ch_invoice_jk.DBEdit30Change(Sender: TObject);
begin
if DBEdit30.Text='' then begin
t_sys_bank.Filtered:=false;
end else begin
t_sys_bank.Filtered:=false;
t_sys_bank.Filter:='<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>='''+DBEdit30.text+'''';
t_sys_bank.Filtered:=true;
if t_sys_bank.IsEmpty then
t_sys_bank.Filtered:=false;
end;
end;
procedure Tfrm_ch_invoice_jk.RxDBLookupCombo2Enter(Sender: TObject);
begin
DBEdit30Change(sender);
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton38Click(Sender: TObject);
var
book1:Tbookmark;
begin
book1:=t_ch_invoice.GetBookmark;
t_ch_invoice.Requery;
t_ch_invoice.GotoBookmark(book1);
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton33Click(Sender: TObject);
var
book1:Tbookmark;
begin
book1:=t_ch_invoice_shen.GetBookmark;
t_ch_invoice_shen.Requery;
t_ch_invoice_shen.GotoBookmark(book1);
end;
procedure Tfrm_ch_invoice_jk.dxDBGrid1CustomDraw(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[dxDBGrid1Column29.Index]='True' then begin
AFont.Style:=AFont.Style+[fsStrikeOut];
AFont.Color:=clred;
end;
if ANode.Strings[dxDBGrid1Column38.Index]='True' then begin
if frm_data_share.t_code_fee_color.Locate('<27><><EFBFBD><EFBFBD>״̬','<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>',[])then
begin
aColor:=StringToColor(frm_data_share.t_code_fee_color.fieldbyname('<27><>ɫ').asstring);
end;
end;
end;
procedure Tfrm_ch_invoice_jk.wwDBLookupCombo6Change(Sender: TObject);
VAR
total_money:real;
currency_chi:string;
begin
//<2F>ұ<EFBFBD><D2B1><EFBFBD><EFBFBD><EFBFBD>
try
if (t_ch_invoice.state=dsinsert) or (t_ch_invoice.state=dsedit) then
begin
if frm_data_share.t_code_currency.Locate('<27>ұ<EFBFBD>',wwDBLookupCombo6.text,[])then
currency_chi:=frm_data_share.t_code_currency.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
total_money:=t_ch_invoice.fieldbyname('<27>ϼƽ<CFBC><C6BD><EFBFBD>').AsFloat;
if total_money<0 then
begin
total_money:=Abs(total_money);
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д']:=invoice_max(total_money,currency_chi+'(<28><>)');
end
else
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д']:=invoice_max(total_money,currency_chi);
if t_sys_bank.Active then
if t_sys_bank.Locate('<27>ұ<EFBFBD>',wwDBLookupCombo6.text,[])then begin
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>']:=t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>').asstring;
end;
end;
except
;
end;
end;
procedure Tfrm_ch_invoice_jk.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.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
if (t_ch_invoice.FieldByName('ʵ<>ʱұ<CAB1>').AsString<>'') then
SQL.Add(' and <20>ұ<EFBFBD>='''+t_ch_invoice.FieldByName('ʵ<>ʱұ<CAB1>').AsString+'''');
Open;
if not IsEmpty then begin
First;
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 where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=:<3A>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add('order by <20><>Ʊ̧ͷ');
Parameters.ParamByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value:=t_ch_invoice.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
Open;
if not IsEmpty then begin
First;
while not Eof do begin
DBComboBoxEh1.Items.Add(FieldByName('<27><>Ʊ̧ͷ').AsString);
Next;
end;
end;
end;
finally
Close;
FreeAndNil(aQuery);
end;
end;
procedure Tfrm_ch_invoice_jk.dbedt1Change(Sender: TObject);
begin
// DBComboBoxEh1.Text:=dbedt1.text;
end;
procedure Tfrm_ch_invoice_jk.DBComboBoxEh1CloseUp(Sender: TObject;
Accept: Boolean);
begin
DBComboBoxEh1.items.Clear;
end;
procedure Tfrm_ch_invoice_jk.bsSkinPageControl1Change(Sender: TObject);
begin
if not ch_invoice_open then exit;
if bsSkinPageControl1.ActivePage=bsSkinTabSheet3 then
begin
if strtobool(get_parameters_value(1,'false'))then
begin
if not t_ch_invoice_shen.Active then
t_ch_invoice_shen.open;
end
else
begin
if not t_ch_invoice_shen.Active then
begin
t_ch_invoice_shen.close;
t_ch_invoice_shen.sql.clear;
t_ch_invoice_shen.sql.add('select * from t_ch_invoice_shen ');
t_ch_invoice_shen.sql.add('where <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><>׼<EFBFBD><D7BC>Ʊ'+''''+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD>'+''''
+','+''''+'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+')');
t_ch_invoice_shen.sql.add(' order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
t_ch_invoice_shen.Open;
end;
end;
end;
if bsSkinPageControl2.ActivePage=bsSkinTabSheet22 then
// if not v_fee_do_seae.Active then
begin
if StrToBool(get_parameters_value(85,'false')) then
begin
bsSkinTabSheet4.TabVisible:=false;
bsSkinTabSheet5.TabVisible:=false;
bsSkinTabSheet6.TabVisible:=false;
bsSkinTabSheet7.TabVisible:=false;
bsSkinTabSheet14.TabVisible:=true;
v_fee_do_bscard.Close;
v_fee_do_bscard.DataSource:=t_ch_invoice_shen1;
v_fee_do_bscard.Open;
v_fee_do_seae.Close;
v_fee_do_seai.Close;
v_fee_do_aire.Close;
v_fee_do_airi.Close;
end
else
begin
bsSkinTabSheet4.TabVisible:=true;
bsSkinTabSheet5.TabVisible:=true;
bsSkinTabSheet6.TabVisible:=true;
bsSkinTabSheet7.TabVisible:=true;
bsSkinTabSheet14.TabVisible:=false;
v_fee_do_seae.open;
v_fee_do_seai.open;
v_fee_do_aire.open;
v_fee_do_airi.open;
v_fee_do_bscard.Close;
end;
end;
if bsSkinPageControl1.ActivePage=bsSkinTabSheet2 then
begin
if StrToBool(get_parameters_value(85,'false')) then
begin
bsSkinTabSheet8.TabVisible:=false;
bsSkinTabSheet9.TabVisible:=false;
bsSkinTabSheet10.TabVisible:=false;
bsSkinTabSheet12.TabVisible:=false;
bsSkinTabSheet13.TabVisible:=true;
v_fee_do_bscard.Close;
v_fee_do_bscard.DataSource:=t_ch_invoice1;
v_fee_do_bscard.Open;
ADOQuery1.Close;
ADOQuery2.Close;
ADOQuery3.Close;
ADOQuery4.Close;
end
else
begin
bsSkinTabSheet8.TabVisible:=true;
bsSkinTabSheet9.TabVisible:=true;
bsSkinTabSheet10.TabVisible:=true;
bsSkinTabSheet12.TabVisible:=true;
bsSkinTabSheet13.TabVisible:=false;
ADOQuery1.open;
ADOQuery2.open;
ADOQuery3.open;
ADOQuery4.open;
v_fee_do_bscard.Close;
end;
end;
end;
procedure Tfrm_ch_invoice_jk.bsSkinPageControl6Change(Sender: TObject);
begin
if not ch_invoice_open then exit;
if not (bsSkinPageControl6.ActivePage=bstab2) then exit;
fra_ch_add_do1.bs_text.text:='1';
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.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.DataSource:=t_ch_invoice1;
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.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.DataSource:=t_ch_invoice1;
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.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+''' order by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
// fra_ch_delete_do1.v_fee_do_seae.DataSource:=t_ch_invoice1;
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.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+''' order by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
// fra_ch_delete_do1.v_fee_do_seai.DataSource:=t_ch_invoice1;
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.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+''' order by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
// fra_ch_delete_do1.v_fee_do_aire.DataSource:=t_ch_invoice1;
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.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+''' order by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
// fra_ch_delete_do1.v_fee_do_airi.DataSource:=t_ch_invoice1;
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 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.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+''' 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_invoice1;
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 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.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+''' 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_invoice1;
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 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.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+''' 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_invoice1;
fra_ch_delete_do1.v_fee_do_aire_sum.Open;
fra_ch_delete_do1.v_fee_do_airi_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 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.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+''' 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_invoice1;
fra_ch_delete_do1.v_fee_do_airi_sum.Open;
end;
end;
procedure Tfrm_ch_invoice_jk.dxDBGrid3Column25CustomDraw(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
AColor:=dxgrid_color_fee(ANode.strings[dxDBGrid3Column25.Index]);
AFont.Color:=clblack;
end;
procedure Tfrm_ch_invoice_jk.dxDBGrid4Column25CustomDraw(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
AColor:=dxgrid_color_fee(ANode.strings[dxDBGrid4Column25.Index]);
AFont.Color:=clblack;
end;
procedure Tfrm_ch_invoice_jk.dxDBGrid5Column22CustomDraw(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
AColor:=dxgrid_color_fee(ANode.strings[dxDBGrid5Column22.Index]);
AFont.Color:=clblack;
end;
procedure Tfrm_ch_invoice_jk.dxDBGrid6Column22CustomDraw(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
AColor:=dxgrid_color_fee(ANode.strings[dxDBGrid6Column22.Index]);
AFont.Color:=clblack;
end;
procedure Tfrm_ch_invoice_jk.dxDBGrid3Column24CustomDraw(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
AColor:=dxgrid_color('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>',ANode.Strings[dxDBGrid3Column24.Index]);
AFont.Color:=clblack;
end;
procedure Tfrm_ch_invoice_jk.dxDBGrid4Column24CustomDraw(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
AColor:=dxgrid_color('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>',ANode.Strings[dxDBGrid4Column24.Index]);
AFont.Color:=clblack;
end;
procedure Tfrm_ch_invoice_jk.dxDBGrid7Column24CustomDraw(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
AColor:=dxgrid_color('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>',ANode.Strings[dxDBGrid7Column24.Index]);
AFont.Color:=clblack;
end;
procedure Tfrm_ch_invoice_jk.dxDBGrid8Column24CustomDraw(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
AColor:=dxgrid_color('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>',ANode.Strings[dxDBGrid8Column24.Index]);
AFont.Color:=clblack;
end;
procedure Tfrm_ch_invoice_jk.dxDBGrid7Column25CustomDraw(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
AColor:=dxgrid_color_fee(ANode.strings[dxDBGrid7Column25.Index]);
AFont.Color:=clblack;
end;
procedure Tfrm_ch_invoice_jk.dxDBGrid8Column25CustomDraw(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
AColor:=dxgrid_color_fee(ANode.strings[dxDBGrid8Column25.Index]);
AFont.Color:=clblack;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton35Click(Sender: TObject); //<2F><><EFBFBD>Ƶ<EFBFBD>˰<EFBFBD><CBB0>
var
str:Tstringlist;
StrAmt,path,feename,amount,NAME,SH,DZ,ZH,INVTYPE:string;
begin
if t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ').asboolean then
begin
showmessage('<27><>Ʊ<EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>');
abort;
end else begin
//t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ').Value:=True;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>ѯ<EFBFBD><D1AF><EFBFBD>ڶ<EFBFBD>ʱ<EFBFBD><CAB1>ѯ<EFBFBD>У<EFBFBD><D0A3><EFBFBD>ɨ<EFBFBD><EFBFBD>Ѵ<EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>վ<EFBFBD>
//ֱ<><D6B1><EFBFBD>л<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>ʱֹͣ<CDA3><D6B9>ʱ<EFBFBD><CAB1>ѯ<EFBFBD><D1AF>
end;
//path:='D:\<5C>ݷ<EFBFBD>\MakeInvoice\testTax\bin\Debug\testTax.exe <20><><EFBFBD><EFBFBD> ';
path:=KPpath+'\MakeTax.exe <20><>Ʊ'; //0
INVTYPE:='2';
if (DBComboBoxEh3.text='<27><>ֵ˰רƱ') then begin
INVTYPE:='0';
end;
{
if (DBComboBoxEh3.text='<27><>ֵ˰<D6B5><CBB0>Ʊ') then begin
path:=path+' 2 2';
end;
}
path:=path+' '+INVTYPE;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ //1
feename:= DM_CostType.Lines[0];
//amount:= DBSumLower.Text;
StrAmt:=FloatToStr(GetUsdExrate(t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString)*t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').AsFloat);
if (t_ch_invoice.FieldByName('<27>ұ<EFBFBD>').AsString='USD') THEN
begin
Amount:=Trim(StrAmt);
end
else
begin
Amount:=Trim(t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').AsString); //˰<><CBB0>
end;
if (feename='') then begin
ShowMessage('<27><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>');
Exit;
end;
if (amount='0') or (amount='') then begin
ShowMessage('<27><><EFBFBD><EFBFBD>д<EFBFBD><D0B4>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>');
Exit;
end;
name:=t_ch_invoice.fieldbyname('<27><>Ʊ̧ͷ').AsString;
if kbmMemTable1.Locate('NAME',name,[]) then begin
NAME:=kbmMemTable1.fieldbyname('NAME').AsString;
SH:=kbmMemTable1.fieldbyname('SH').AsString;
DZ:=kbmMemTable1.fieldbyname('DZ').AsString;
//<2F><><EFBFBD><EFBFBD><EFBFBD>˻<EFBFBD><CBBB><EFBFBD><EFBFBD><EFBFBD>
ZH:=kbmMemTable1.fieldbyname('ZH').AsString;
path:=path+' '+trim(NAME); //2
path:=path+' '+trim(SH); //3
path:=path+' '+trim(DZ); //4
path:=path+' '+trim(ZH); //5
end else begin
showmessage('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB>¼<EFBFBD><C2BC>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD>򵼳<EFBFBD><F2B5BCB3>Ŀͻ<C4BF><CDBB><EFBFBD><EFBFBD><EFBFBD><EBB2BB><EFBFBD><EFBFBD><EFBFBD>µġ<C2B5>'
+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿͻ<C3BF><CDBB>Ƿ<EFBFBD><C7B7>Ѿ<EFBFBD>¼<EFBFBD><C2BC>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>.txt<78><74><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><CBB0>\bin<69>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ڡ<EFBFBD>');
exit;
end;
if (DZDH='') then begin
showmessage('<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3>Ϣ<EFBFBD>Ŀ<EFBFBD>Ʊ<EFBFBD><C6B1>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>д<EFBFBD><D0B4>Ʊ<EFBFBD><C6B1>λ<EFBFBD><CEBB>ַ<EFBFBD><EFBFBD><E7BBB0>Ȼ<EFBFBD><C8BB><EFBFBD><EFBFBD><EFBFBD>´򿪿<C2B4>Ʊģ<C6B1><C4A3>');
exit;
end; ////
path:=path+' '+DZDH; //6
{
if (trim(DBEdit19.Text)+trim(DBEdit27.Text)='') then begin
showmessage('<27><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD>к<EFBFBD><D0BA>˻<EFBFBD>');
exit;
end;
}
path:=path+' '+'RMB<4D><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0B5BA><EFBFBD><EFBFBD>·֧<C2B7><D6A7>532900134010688_USD<53>й<EFBFBD><D0B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0B5BA><EFBFBD><EFBFBD>·֧<C2B7><D6A7>233808306778';
//trim(DBEdit19.Text)+trim(DBEdit27.Text); //7 <20><><EFBFBD><EFBFBD><EFBFBD>˻<EFBFBD>
path:=path+' __'+StringReplace (t_ch_invoice.FieldByName('<27><>ע').AsString, ' ', '__', [rfReplaceAll]);
//trim(t_ch_invoice.FieldByName('<27><>ע').AsString);
//trim(DM.Lines.Strings[0]); //8 <20><>ע
if (DM.Lines.Strings[0]='') then begin
path:=path+'__';
end;
path:=path+' '+employee; //9 <20><>Ʊ<EFBFBD><C6B1>
path:=path+' '+feename; //10 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF>
path:=path+' '+amount; //11 <20><><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>
path:=path+' Server=DongshengSoft02\mssqlserver2008;Database=dongshengdata_jf;uid=sa;pwd=ds20040201'; //12 <20><><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>
path:=path+' '+t_ch_invoice.FieldByName('IN_ID').AsString; //13 <20><>Ʊgid
//showmessage(path);
if kbmMemTable2.Locate('FEENAME',feename,[]) then begin
path:=path+' '+kbmMemTable2.FieldByName('FEENAME').AsString ; //14
path:=path+' '+kbmMemTable2.FieldByName('GoodsTaxNo').AsString ; //15
path:=path+' '+kbmMemTable2.FieldByName('TaxPre').AsString ; //16
path:=path+' '+kbmMemTable2.FieldByName('CropGoodsNo').AsString ; //17
end else begin
showmessage('ȱ<>ٷ<EFBFBD><D9B7>ô<EFBFBD><C3B4><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>'
+#13#10+'<27><>\<5C><>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>.txt<78><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊflbmxml.txt'
+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><CBB0>\bin<69>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ڡ<EFBFBD>');
exit;
end;
//showmessage(path);
winexec(Pchar(path), sw_show);
tmr_UPDINV.Enabled:= True;
end;
procedure Tfrm_ch_invoice_jk.btn1Click(Sender: TObject);
var
str:Tstringlist;
StrAmt,path,feename,amount,NAME,SH,DZ,ZH,spbm,FPTT:string;
begin
if bsSkinCheckRadioBox1.Checked then
expDZINV(0)
else
expINV(0);
{
t_ch_invoice_expitem.Close;
t_ch_invoice_expitem.Open;
if t_ch_invoice_expitem.RecordCount>0 then begin
if MessageDlg('<27>÷<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD>ϸ,ȷ<>ϰ<EFBFBD><CFB0>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbYes,mbNo],0)=mrYes then begin
t_ch_invoice_expitem.close;
expduiINV();
end;
Exit;
end;
t_ch_invoice_expitem.close;
try
str:=Tstringlist.Create;
str.Clear;
str.Add('<?xml version="1.0" encoding="GBK" ?>');
str.Add('<Kp>');
str.Add('<Version>2.0</Version>');//56
str.Add('<Fpxx>');
str.Add('<Zsl>1</Zsl>');
str.Add('<Zsl>1</Zsl>'); //<2F><><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>еĵ<D0B5><C4B5><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
str.Add('<Fpsj>');
str.Add('<Fp>');
str.Add('<Djh>'+t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'</Djh>'); //<2F><><EFBFBD>ݺţ<DDBA>20<32>ֽڣ<D6BD>
FPTT:=trim(t_ch_invoice.FieldByName('<27><>Ʊ̧ͷ').AsString);
str.Add('<Gfmc>'+FPTT+'</Gfmc>'); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>100<30>ֽڣ<D6BD>
//showmessage(IntToStr(kbmMemTable1.RecordCount));
if kbmMemTable1.Locate('NAME',FPTT,[]) then begin
NAME:=kbmMemTable1.fieldbyname('NAME').AsString;
SH:=kbmMemTable1.fieldbyname('SH').AsString;
DZ:=kbmMemTable1.fieldbyname('DZ').AsString;
ZH:=kbmMemTable1.fieldbyname('ZH').AsString;
str.Add('<Gfsh>'+SH+'</Gfsh>'); //<2F><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>
str.Add('<Gfyhzh>'+trim(ZH)+'</Gfyhzh>'); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˺ţ<CBBA>100<30>ֽڣ<D6BD>
str.Add('<Gfdzdh>'+trim(DZ)+'</Gfdzdh>'); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><E7BBB0>100<30>ֽڣ<D6BD>
end else begin
showmessage('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB>¼<EFBFBD><C2BC>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD>򵼳<EFBFBD><F2B5BCB3>Ŀͻ<C4BF><CDBB><EFBFBD><EFBFBD><EFBFBD><EBB2BB><EFBFBD><EFBFBD><EFBFBD>µġ<C2B5>'
+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿͻ<C3BF><CDBB>Ƿ<EFBFBD><C7B7>Ѿ<EFBFBD>¼<EFBFBD><C2BC>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>.txt<78><74><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><CBB0>\bin<69>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ڡ<EFBFBD>');
exit;
end;
str.Add('<Bz>'+t_ch_invoice.FieldByName('<27><>ע').AsString+'</Bz>'); //<2F><>ע<EFBFBD><D7A2>240<34>ֽڣ<D6BD>
str.Add('<Fhr><3E>޷<EFBFBD><DEB7><EFBFBD></Fhr>'); //<2F><><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD>8<EFBFBD>ֽڣ<D6BD>
str.Add('<Skr><3E><><EFBFBD>ķ<EFBFBD></Skr>'); //<2F>տ<EFBFBD><D5BF>ˣ<EFBFBD>8<EFBFBD>ֽڣ<D6BD>
feename:= DM_CostType.Lines[0];
amount:= DBSumLower.Text;
if kbmMemTable2.Locate('FEENAME',feename,[]) then begin
str.Add('<Spbmbbh>'+kbmMemTable2.FieldByName('Spbmbbh').AsString+'</Spbmbbh>'); //<2F><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E6B1BE>
if (kbmMemTable2.FieldByName('Hsbz').AsString='True') then
str.Add('<Hsbz>1</Hsbz>') //<2F><>˰<EFBFBD><CBB0>־
else
str.Add('<Hsbz>0</Hsbz>')
end else begin
showmessage('ȱ<>ٷ<EFBFBD><D9B7>ô<EFBFBD><C3B4><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>'
+#13#10+'<27><>\<5C><>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>.txt<78><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊflbmxml.txt'
+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><CBB0>\bin<69>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ڡ<EFBFBD>');
exit;
end;
str.Add('<Spxx>');
str.Add('<Sph>');
str.Add('<Xh>1</Xh>'); //<2F><><EFBFBD><EFBFBD>
str.Add('<Spmc>'+feename+'</Spmc>');
str.Add('<Ggxh> </Ggxh>'); ////<2F><><EFBFBD><EFBFBD><EFBFBD>ͺţ<CDBA>40<34>ֽڣ<D6BD>
str.Add('<Jldw>Ʊ</Jldw>'); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>32<33>ֽڣ<D6BD>
if kbmMemTable2.Locate('FEENAME',feename,[]) then begin
spbm:=kbmMemTable2.FieldByName('GoodsTaxNo').AsString;
while Length(spbm)<19 do
begin
spbm:=spbm+'0';
end;
str.Add('<Spbm>'+spbm+'</Spbm>'); //<2F><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
str.Add('<Qyspbm>'+kbmMemTable2.FieldByName('CropGoodsNo').AsString+'</Qyspbm>'); //<2F><>ҵ<EFBFBD><D2B5>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
end else begin
showmessage('ȱ<>ٷ<EFBFBD><D9B7>ô<EFBFBD><C3B4><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>'
+#13#10+'<27><>\<5C><>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>.txt<78><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊflbmxml.txt'
+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><CBB0>\bin<69>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ڡ<EFBFBD>');
exit;
end;
str.Add('<Syyhzcbz>1</Syyhzcbz>'); //<2F>Ż<EFBFBD><C5BB><EFBFBD><EFBFBD>߱<EFBFBD>ʶ
str.Add('<Lslbz>1</Lslbz>'); //<2F><>˰<EFBFBD>ʱ<EFBFBD>ʶ
str.Add('<Yhzcsm></Yhzcsm>'); //<2F>Ż<EFBFBD><C5BB><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>
StrAmt:=FloatToStr(GetUsdExrate(t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString)*t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').AsFloat);
if t_ch_invoice.FieldByName('<27>ұ<EFBFBD>').AsString='USD' THEN
begin
str.Add('<Dj>'+StrAmt+'</Dj>'); //<2F><><EFBFBD><EFBFBD>
str.Add('<Sl>1</Sl>'); //<2F><><EFBFBD><EFBFBD>
str.Add('<Je>'+StrAmt+'</Je>'); //<2F><><EFBFBD><EFBFBD><EEA3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>ʱΪ<CAB1>ۿ<EFBFBD><DBBF><EFBFBD>
str.Add('<Slv>0</Slv>'); //˰<><CBB0>
end
else
begin
str.Add('<Dj>'+t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').AsString+'</Dj>'); //<2F><><EFBFBD><EFBFBD>
str.Add('<Sl>1</Sl>'); //<2F><><EFBFBD><EFBFBD>
str.Add('<Je>'+t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').AsString+'</Je>'); //<2F><><EFBFBD><EFBFBD><EEA3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>ʱΪ<CAB1>ۿ<EFBFBD><DBBF><EFBFBD>
str.Add('<Slv>0</Slv>'); //˰<><CBB0>
end;
str.Add('<Kce>0</Kce>'); //<2F><><EFBFBD><EFBFBD>
str.Add('</Sph>');
str.Add('</Spxx>');
str.Add('</Fp>');
str.Add('</Fpsj>');
str.Add('</Fpxx>');
str.Add('</Kp>'); //
SaveDialog1.FileName:=t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString;
if SaveDialog1.Execute then
begin
str.SaveToFile(SaveDialog1.FileName+'.XML');
showmessage('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ɳɹ<C9B3><C9B9><EFBFBD>');
end
else
begin
showmessage('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
exit;
end;
finally
FreeAndNil(Str);
end;
}
end;
function EnumChildWindowsProc(hwnd,lparam:Integer):Boolean;stdcall; //<2F><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
begin
end;
function Tfrm_ch_invoice_jk.getfeestr: boolean; //<2F><>ʼ<EFBFBD><CABC>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
var
i,j:integer;
str_num,str:string;
begin
fname1:='';
fname2:='';
fname3:='';
fname4:='';
fname5:='';
fname6:='';
fname7:='';
fprice1:='';
fprice2:='';
fprice3:='';
fprice4:='';
fprice5:='';
fprice6:='';
fprice7:='';
fnum:='1';
try
for i:=0 to DM_CostType.Lines.Count-1 do
begin
str:=trim(DM_CostType.Lines[i]);
if str<>'' then begin
if i=0 then begin
fname1:=str;
end;
if i=1 then begin
fname2:=str;
end;
if i=2 then begin
fname3:=str;
end;
if i=3 then begin
fname4:=str;
end;
if i=4 then begin
fname5:=str;
end;
if i=5 then begin
fname6:=str;
end;
if i=6 then begin
fname7:=str;
end;
end;
end;
for i:=0 to DM_Money.Lines.Count-1 do
begin
str:=trim(DM_Money.Lines[i]);
str_num:='';
for j:=1 to length(str) do
begin
if (str[j]='0') or (str[j]='1')
OR (str[j]='2') or (str[j]='3')
OR (str[j]='4') or (str[j]='5')
OR (str[j]='6') or (str[j]='7')
OR (str[j]='8') or (str[j]='9')
or (str[j]='.')then
begin
str_num:=str_num+str[j];
end
else
begin
end;
end;
if str<>'' then begin
if i=0 then begin
fprice1:=str_num;
end;
if i=1 then begin
fprice2:=str_num;
end;
if i=2 then begin
fprice3:=str_num;
end;
if i=3 then begin
fprice4:=str_num;
end;
if i=4 then begin
fprice5:=str_num;
end;
if i=5 then begin
fprice6:=str_num;
end;
if i=6 then begin
fprice7:=str_num;
end;
end;
end;
finally
end;
end;
procedure Tfrm_ch_invoice_jk.bsSkinPanel2Resize(Sender: TObject);
var
i:integer;
begin
if not if_reg(417) then begin
i:=round(bsSkinPanel2.Width/13);
bsSkinButton9.Width:=i;
bsSkinButton2.Width:=i;
bsSkinButton10.Width:=i;
bsSkinButton6.Width:=i;
bsSkinButton7.Width:=i;
bsSkinButton8.Width:=i;
bsSkinButton1.Width:=i;
bsSkinButton3.Width:=i;
bsSkinButton38.Width:=i;
btn2.Width:=i;
bsSkinButton44.Width:=i;
bsSkinButton45.Width:=i;
end else begin
i:=round(bsSkinPanel2.Width/14);
bsSkinButton9.Width:=i;
bsSkinButton2.Width:=i;
bsSkinButton10.Width:=i;
bsSkinButton6.Width:=i;
bsSkinButton7.Width:=i;
bsSkinButton8.Width:=i;
bsSkinButton1.Width:=i;
bsSkinButton3.Width:=i;
bsSkinButton38.Width:=i;
bsSkinButton34.Width:=i;
btn2.Width:=i;
bsSkinButton44.Width:=i;
bsSkinButton45.Width:=i;
end;
bsSkinCheckRadioBox1.Left:=btn2.Left;
end;
procedure Tfrm_ch_invoice_jk.bsSkinPageControl2Change(Sender: TObject);
begin
if bsSkinPageControl2.TabIndex=1 then
if StrToBool(get_parameters_value(85,'false')) then
begin
bsSkinTabSheet4.TabVisible:=false;
bsSkinTabSheet5.TabVisible:=false;
bsSkinTabSheet6.TabVisible:=false;
bsSkinTabSheet7.TabVisible:=false;
bsSkinTabSheet14.TabVisible:=true;
v_fee_do_bscard.Close;
v_fee_do_bscard.DataSource:=t_ch_invoice_shen1;
v_fee_do_bscard.Open;
v_fee_do_seae.Close;
v_fee_do_seai.Close;
v_fee_do_aire.Close;
v_fee_do_airi.Close;
end
else
begin
bsSkinTabSheet4.TabVisible:=true;
bsSkinTabSheet5.TabVisible:=true;
bsSkinTabSheet6.TabVisible:=true;
bsSkinTabSheet7.TabVisible:=true;
bsSkinTabSheet14.TabVisible:=false;
v_fee_do_seae.open;
v_fee_do_seai.open;
v_fee_do_aire.open;
v_fee_do_airi.open;
v_fee_do_bscard.Close;
end;
end;
procedure Tfrm_ch_invoice_jk.dxDBGridColumn43CustomDraw(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
AColor:=dxgrid_color(ANode.Strings[dxDBGrid11Column26.Index],ANode.Strings[dxDBGridColumn43.Index]);
AFont.Color:=clblack;
end;
procedure Tfrm_ch_invoice_jk.dxDBGridColumn44CustomDraw(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
AColor:=dxgrid_color_fee(ANode.strings[dxDBGridColumn44.Index]);
AFont.Color:=clblack;
end;
procedure Tfrm_ch_invoice_jk.fra_ch_add_do1MenuItem1Click(Sender: TObject);
begin
fra_ch_add_do1.MenuItem1Click(Sender);
end;
procedure Tfrm_ch_invoice_jk.fra_ch_add_do1bsSkinButton11Click(
Sender: TObject);
begin
fra_ch_add_do1.bsSkinButton11Click(Sender);
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton36Click(Sender: TObject);
var ASqlQuery:TADOQuery;
str1,str2:Tstringlist;
begin
ASqlQuery:=CreateAdoQuery;
str1:=Tstringlist.Create;
str2:=Tstringlist.Create;
with ASqlQuery do
try
str1.Clear;
str2.Clear;
Close;SQL.Clear;
SQL.Add('select <20><><EFBFBD><EFBFBD><E1B5A5>,sum(<28><><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD> 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><E1B5A5>');
SQL.Add('order by <20><><EFBFBD><EFBFBD><E1B5A5>');
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=t_ch_invoice.fieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
Open;First;
while not eof do
begin
if t_ch_invoice['<27>ұ<EFBFBD>']='USD' then
str1.Add(get_parameters_value(7,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˷<EFBFBD>')+fieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString)
else
str1.Add(get_parameters_value(147,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD>')+fieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString);
str2.Add(fieldByName('<27><><EFBFBD><EFBFBD>').AsString);
Next;
end;
t_ch_invoice.Edit;
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>']:=str1.text;
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>']:=str2.text;
t_ch_invoice.Post;
finally
Free;
str1.Free;
str2.Free;
end;
end;
procedure Tfrm_ch_invoice_jk.DBComboBoxEh2DropDown(Sender: TObject);
var
aQuery:TADOQuery;
begin
DBComboBoxEh2.Items.Clear;
aQuery:=CreateAdoQuery;
with aQuery do
try
Close;SQL.Clear;
SQL.Add('declare @s varchar(100),@sql varchar(1000) ');
SQL.Add('set @s=(select <20><><EFBFBD><EFBFBD>ֵ from t_sys_parameters_value where vl_id=512) ');
SQL.Add(' set @sql='+#39+'select <20><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>б<EFBFBD>='+#39+#39+#39+'+ replace(@s,'+#39+','+#39+','+#39+#39+#39+' union all select '+#39+#39+#39+')+'+#39+#39+#39+#39+' ');
//SQL.Add('PRINT @sql ');
SQL.Add('exec (@sql)');
Open;
First;
while not Eof do begin
DBComboBoxEh2.Items.Add(FieldByName('<27><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>б<EFBFBD>').AsString);
Next;
end;
finally
Close;
FreeAndNil(aQuery);
end;
end;
procedure Tfrm_ch_invoice_jk.DM_CostTypeKeyPress(Sender: TObject;
var Key: Char);
begin
if Key=#13 then
if DM_CostType.Lines.Count>=10 then
begin
ShowMessage('<27><>Ʊ<EFBFBD><C6B1>ϸ<EFBFBD><CFB8><EFBFBD>ܲٹ<DCB2>10<31><30>');
abort;
end;
end;
procedure Tfrm_ch_invoice_jk.DBComboBoxEh2CloseUp(Sender: TObject;
Accept: Boolean);
begin
DBComboBoxEh2.items.Clear;
end;
procedure Tfrm_ch_invoice_jk.DBComboBoxEh2Change(Sender: TObject);
begin
if DBComboBoxEh2.Items.Count>0 then
begin
t_ch_invoice.Edit;
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>']:=DBComboBoxEh2.Items.Strings[DBComboBoxEh2.ItemIndex];
if pos('<27><>վ',t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').asstring)>0 then
begin
RxDBLookupCombo2.Value:='03';
end;
end;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton15Click(Sender: TObject);
var aAdoQuery:TAdoQuery;
afield : variant;
i: Integer;
bsno:string;
AmtRmb,UsdRmb:double;
begin
aAdoQuery:=CreateAdoQuery;
with aAdoQuery do
try
Close;sql.Clear;
sql.Add('select count(*) c');
sql.Add('From t_ch_fee_do');
sql.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:bsno');
Parameters.ParamByName('bsno').Value:=t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
open;First;
if FieldByName('c').AsInteger<=0 then
begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD>ڷ<EFBFBD><DAB7><EFBFBD><EFBFBD><EFBFBD>ϸ,<2C><><EFBFBD>ò<EFBFBD><C3B2><EFBFBD>');
Exit;
end;
finally
free;
end;
bsno:=t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
AmtRmb:=t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>').AsFloat;
UsdRmb:=t_ch_invoice.FieldByName('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').AsFloat;
if (t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>').AsFloat<>0)
and (t_ch_invoice.FieldByName('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').AsFloat<>0) then
begin
try
frm_ch_invoice_add_jk:=tfrm_ch_invoice_add_jk.Create (self);
frm_ch_invoice_add_jk.bsSkinCheckRadioBox3.checked:=True;
frm_ch_invoice_add_jk.bsSkinCheckRadioBox1.enabled:=false;
frm_ch_invoice_add_jk.bsSkinCheckRadioBox2.Visible:=false;
frm_ch_invoice_add_jk.wwDBLookupCombo6.Text:='USD';
frm_ch_invoice_add_jk.bsSkinCheckRadioBox8.enabled:=false;
frm_ch_invoice_add_jk.ShowModal;
finally
frm_ch_invoice_add_jk.Free;
end;
end
else
begin
ShowMessage('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
Exit;
end;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton20Click(Sender: TObject);
var ASqlQuery:TADOQuery;
str1,str2:Tstringlist; //<2F><>ȡ<EFBFBD><EFBFBD><E1B5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע
begin
ASqlQuery:=CreateAdoQuery;
str1:=Tstringlist.Create;
str2:=Tstringlist.Create;
with ASqlQuery do
try
str1.Clear;
str2.Clear;
Close;SQL.Clear;
SQL.Add('select top 1 <20><><EFBFBD><EFBFBD><E1B5A5> 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.fieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
Open;
t_ch_invoice.Edit;
t_ch_invoice['<27><>ע']:=t_ch_invoice.fieldbyname('<27><>ע').AsString+#13#10+fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString;
t_ch_invoice.Post;
finally
Free;
str1.Free;
str2.Free;
end;
end;
procedure Tfrm_ch_invoice_jk.readcustomer;
var
ts:Tstringlist;
List:Tstringlist;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ÿ<>е<EFBFBD><D0B5><EFBFBD>
i,j:Integer;
_ts,YCSH,DQSH:string;
begin
ts:=Tstringlist.create;
list:=Tstringlist.create;
try
kbmMemTable1.EmptyTable;
kbmMemTable1.Open;
try
ts.loadfromfile(KPpath+'\<5C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>.txt');
finally
end;
for i:=0 to ts.count-1 do
begin
_ts:=StringReplace (ts[i], '~~', '~', [rfReplaceAll]);
_ts:=StringReplace (_ts, ' ', '_', [rfReplaceAll]);
list.delimiter:='~';
list.delimitedText:=_ts;
if(list.Count>3 ) then begin
if(List[3]<>'') and (list[1]<>'<27><><EFBFBD><EFBFBD>') then begin
//20161116
//
//<2F><><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD>ô<EFBFBD>ж<EFBFBD><D0B6>Ѵ<EFBFBD><D1B4><EFBFBD><EFBFBD>ݺ͵<DDBA>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>˭<EFBFBD><CBAD>18λ˰<CEBB>ŵ<EFBFBD>
//1<><31>18λ<38>Ѵ<D1B4><E6A3AC>ǰ15λ<35><CEBB><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>
//2<><32>15λ<35>Ѵ<D1B4><E6A3AC>ǰ15λ<35><CEBB><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>
//3<><33>18λ<38>Ѵ<D1B4><E6A3AC>ǰ18λ<38><CEBB><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>
//2<><32>15λ<35>Ѵ<D1B4><E6A3AC>ǰ18λ<38><CEBB>ɾ<EFBFBD><C9BE><EFBFBD>Ѵ<EFBFBD><D1B4><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>뵱ǰ<EBB5B1><C7B0><EFBFBD><EFBFBD>
if kbmMemTable1.Locate('NAME',List[1],[]) then begin
YCSH:=Trim(kbmMemTable1.FieldByName('SH').AsString); //<2F>Ѵ<EFBFBD>˰<EFBFBD><CBB0>
DQSH:=Trim(List[3]);
if (Length(YCSH)=15) and (Length(DQSH)=18) then begin
kbmMemTable1.Edit;
kbmMemTable1.FieldByName('NAME').AsString := List[1];
kbmMemTable1.FieldByName('SH').AsString := List[3];
kbmMemTable1.FieldByName('DZ').AsString := List[4];
kbmMemTable1.FieldByName('ZH').AsString := List[5];
kbmMemTable1.post;
end;
end else begin
kbmMemTable1.Append;
kbmMemTable1.FieldByName('NAME').AsString := List[1];
kbmMemTable1.FieldByName('SH').AsString := List[3];
kbmMemTable1.FieldByName('DZ').AsString := List[4];
kbmMemTable1.FieldByName('ZH').AsString := List[5];
//kbmMemTable1.Append;
kbmMemTable1.post;
end;
end;
end;
end;
finally
ts.free;
list.free;
end;
end;
procedure Tfrm_ch_invoice_jk.readfeename;
var
ts:Tstringlist;
List:Tstringlist;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ÿ<>е<EFBFBD><D0B5><EFBFBD>
i,j:Integer;
_ts:string;
begin
ts:=Tstringlist.create;
list:=Tstringlist.create;
try
kbmMemTable2.EmptyTable;
kbmMemTable2.Open;
ts.loadfromfile(KPpath+'\flbmxml.txt');
for i:=0 to ts.count-1 do
begin
_ts:=StringReplace (ts[i], '~~', '~', [rfReplaceAll]);
list.delimiter:='~';
list.delimitedText:=_ts;
if(list.Count>3 ) then begin
if(List[3]<>'') and (list[0]<>'//') then begin
//lst1.Items.Add('--------'+inttostr(i)+'--------');
kbmMemTable2.Append;
kbmMemTable2.FieldByName('FEENAME').AsString := List[1];
kbmMemTable2.FieldByName('GoodsTaxNo').AsString := List[11];
kbmMemTable2.FieldByName('TaxPre').AsString := List[4];
kbmMemTable2.FieldByName('CropGoodsNo').AsString := List[3];
kbmMemTable2.FieldByName('Spbmbbh').AsString := List[16];
kbmMemTable2.FieldByName('Hsbz').AsString := List[8];
kbmMemTable2.post;
end;
end;
end;
finally
ts.free;
list.free;
end;
end;
procedure Tfrm_ch_invoice_jk.dxDBGrid1Click(Sender: TObject);
begin
Change_INV(t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString);
setBankflowButtonState();
end;
procedure Tfrm_ch_invoice_jk.Change_INV(IN_ID: string);
begin
if (OLD_IN_ID='') then begin
end else begin
if (OLD_IN_ID<>t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString) then begin
OLD_IN_ID:=t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString;
tmr_UPDINV.Enabled:=false;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ <20><> ѯ<><D1AF>Ʊ<EFBFBD>š<EFBFBD><C5A1>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>ϡ<EFBFBD><CFA1><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><E4A3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>post<73><74>
end;
end;
end;
procedure Tfrm_ch_invoice_jk.UPDINV(IN_ID: string);
begin
qry_UPDINV.Close;
qry_UPDINV.Parameters.ParamByName('IN_ID').Value:=t_ch_invoice.FieldByName('IN_ID').AsString;
qry_UPDINV.Open;
if (DBEdit16.Text<>qry_UPDINV.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString)
or (bsSkinDBCheckRadioBox3.Checked<>qry_UPDINV.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ').AsBoolean)
or (bsSkinDBCheckRadioBox2.Checked<>qry_UPDINV.FieldByName('<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>').AsBoolean) then
begin
//t_ch_invoice.Edit;
//t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').Value:=qry_UPDINV.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString;
//t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ').Value:=qry_UPDINV.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ').AsString;
//t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>').Value:=qry_UPDINV.FieldByName('<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>').AsString;
//t_ch_invoice.post;
DBEdit16.Text:=qry_UPDINV.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString;
bsSkinDBCheckRadioBox3.Checked:=qry_UPDINV.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ').AsBoolean;
bsSkinDBCheckRadioBox2.Checked:=qry_UPDINV.FieldByName('<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>').AsBoolean;
end;
end;
procedure Tfrm_ch_invoice_jk.tmr_UPDINVTimer(Sender: TObject);
var _OLD_FPH,_NEW_FPH,_OLD_FC,_NEW_FC:string; //<2F>ɷ<EFBFBD>Ʊ<EFBFBD><C6B1> <20>·<EFBFBD>Ʊ<EFBFBD><C6B1>
begin
//_OLD_FPH := t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString;
//_OLD_FC := t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>').AsString;
UPDINV(t_ch_invoice.FieldByName('IN_ID').AsString);
//_NEW_FPH := t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString;
//_NEW_FC := t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>').AsString;
if (DBEdit16.Text='') then begin
if (t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString<>DBEdit16.Text) then begin
tmr_UPDINV.enabled:= False;
end else if (t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>').asboolean<>bsSkinDBCheckRadioBox2.Checked) then begin
tmr_UPDINV.enabled:= False;
end;
end
else begin
tmr_UPDINV.enabled:= False;
end;
end;
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮƥ<CBAE>䰴ť<E4B0B4><C5A5>״̬
/// </summary>
procedure Tfrm_ch_invoice_jk.setBankflowButtonState();
begin
bsknpnl1_bankflow.visible:=false;
if(m_bankflowRight=false) then
exit;
//
bsknpnl1_bankflow.Visible:=True;
if( t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ').AsBoolean) then
begin
btn4_bankflow.Enabled := not ( t_ch_invoice.FieldByName('ƥ<><C6A5><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE><EFBFBD><EFBFBD>').IsNull);
btn4_bankflow.Caption:='ȡ<><C8A1>[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD>ֶ<EFBFBD>ƥ<EFBFBD><C6A5>]';
btn4_bankflow.Tag:=0;
end
else
begin
btn4_bankflow.Enabled := true;
btn4_bankflow.Caption:=' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD>ֶ<EFBFBD>ƥ<EFBFBD><C6A5> ';
btn4_bankflow.Tag:=1;
end;
end;
procedure Tfrm_ch_invoice_jk.dxDBGrid1ChangeNode(Sender: TObject; OldNode,
Node: TdxTreeListNode);
begin
setBankflowButtonState();
end;
procedure Tfrm_ch_invoice_jk.btn4_bankflowClick(Sender: TObject);
var
strinfo:string;
blpp:boolean;
begin
//
if(btn4_bankflow.Tag=0) then
strinfo:='<27><><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD>ֶ<EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ,<2C>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>?'
else
strinfo:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δƥ<CEB4><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD>ķ<EFBFBD>Ʊ<EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD><EFBFBD>ֶ<EFBFBD>ƥ<EFBFBD><C6A5>,<2C>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>?';
if(Application.MessageBox(PChar(strinfo),'<27>ֶ<EFBFBD>ƥ<EFBFBD><C6A5>',MB_YESNO+mb_iconwarning)<>id_yes) then
Exit;
try
t_ch_invoice.Edit;
if btn4_bankflow.Tag=1 then
blpp:=True
else
blpp:=False;
t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ').AsBoolean := blpp;
t_ch_invoice.FieldByName('ƥ<><C6A5><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>').asstring:= employee;
t_ch_invoice.FieldByName('ƥ<><C6A5><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE><EFBFBD><EFBFBD>').asDatetime:= GetDbDatetime;
t_ch_invoice.Post();
except
on ex:Exception do
begin
strinfo:='<27><>Ʊ<EFBFBD><C6B1>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>ˮ״̬<D7B4><CCAC><EFBFBD><EFBFBD>:'+ex.Message;
errorlog(strinfo);
Application.MessageBox(PChar(strinfo),'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ',MB_ICONWARNING) ;
end;
end;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton37Click(Sender: TObject);
begin
if t_ch_invoice.IsEmpty then
exit;
if t_ch_invoice.FieldByName('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').AsString='' then
exit;
t_ch_invoice_expitem.Close;
t_ch_invoice_expitem.Open;
if t_ch_invoice_expitem.RecordCount=0 then begin
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ڷ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ!','<27><><EFBFBD><EFBFBD>:',MB_OKCANCEL);
t_ch_invoice_expitem.Close;
exit;
end;
t_ch_invoice_expitem.Close;
try
frm_ch_invoice_expitems:=tfrm_ch_invoice_expitems.Create (application);
invduino:=t_ch_invoice.fieldbyname('<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>').asstring;
invcurr:=t_ch_invoice.fieldbyname('<27>ұ<EFBFBD>').asstring;
frm_ch_invoice_expitems.ShowModal;
finally
frm_ch_invoice_expitems.Free;
end;
end;
procedure Tfrm_ch_invoice_jk.expduiINV(exptype:Integer);
var
str:Tstringlist;
StrAmt,path,feename,amount,NAME,SH,DZ,ZH,spbm,FPTT,ScriptPath:string;
USDAMT,RMBAMT:Double;
i:Integer;
begin
ScriptPath:=ExtractFilePath(ParamStr(0))+'INVEXP\';
if not DirectoryExists(ScriptPath) then
CreateDir(ScriptPath);
t_ch_invoice_expitem.Close;
t_ch_invoice_expitem.Open;
USDAMT:=0;
RMBAMT:=0;
try
str:=Tstringlist.Create;
str.Clear;
str.Add('<?xml version="1.0" encoding="GBK" ?>');
str.Add('<Kp>');
str.Add('<Version>2.0</Version>');//56
str.Add('<Fpxx>');
// str.Add('<Zsl>1</Zsl>');
str.Add('<Zsl>'+inttostr(t_ch_invoice_expitem.RecordCount)+'</Zsl>'); //<2F><><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>еĵ<D0B5><C4B5><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
str.Add('<Fpsj>');
t_ch_invoice_expitem.First;
i:=1;
while not t_ch_invoice_expitem.Eof do begin
str.Add('<Fp>');
str.Add('<Djh>'+t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+inttostr(i)+'</Djh>'); //<2F><><EFBFBD>ݺţ<DDBA>20<32>ֽڣ<D6BD>
FPTT:=trim(t_ch_invoice_expitem.FieldByName('<27><>Ʊ̧ͷ').AsString);
str.Add('<Gfmc>'+FPTT+'</Gfmc>'); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>100<30>ֽڣ<D6BD>
//showmessage(IntToStr(kbmMemTable1.RecordCount));
if kbmMemTable1.Locate('NAME',FPTT,[]) then begin
NAME:=kbmMemTable1.fieldbyname('NAME').AsString;
SH:=kbmMemTable1.fieldbyname('SH').AsString;
DZ:=kbmMemTable1.fieldbyname('DZ').AsString;
ZH:=kbmMemTable1.fieldbyname('ZH').AsString;
str.Add('<Gfsh>'+SH+'</Gfsh>'); //<2F><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>
str.Add('<Gfyhzh>'+trim(StringReplace(ZH,'#|#',' ',[]))+'</Gfyhzh>'); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˺ţ<CBBA>100<30>ֽڣ<D6BD>
str.Add('<Gfdzdh>'+trim(DZ)+'</Gfdzdh>'); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><E7BBB0>100<30>ֽڣ<D6BD>
end else begin
showmessage('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+FPTT+'û<><C3BB>¼<EFBFBD><C2BC>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD>򵼳<EFBFBD><F2B5BCB3>Ŀͻ<C4BF><CDBB><EFBFBD><EFBFBD><EFBFBD><EBB2BB><EFBFBD><EFBFBD><EFBFBD>µġ<C2B5>'
+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿͻ<C3BF><CDBB>Ƿ<EFBFBD><C7B7>Ѿ<EFBFBD>¼<EFBFBD><C2BC>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>.txt<78><74><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><CBB0>\bin<69>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ڡ<EFBFBD>');
exit;
end;
if t_ch_invoice_expitem.FieldByName('<27>ұ<EFBFBD>').AsString='USD' THEN
str.Add('<Bz>'+'USD'+floattostr(t_ch_invoice_expitem.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat)+'*'+floattostr(GetUsdExrate(t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString))+' <20><>Ʊ<EFBFBD>޸<EFBFBD><DEB8><EFBFBD>Ԫ'+t_ch_invoice_expitem.FieldByName('<27><>ע').AsString+' </Bz>')
else str.Add('<Bz>'+t_ch_invoice_expitem.FieldByName('<27><>ע').AsString+' </Bz>');
str.Add('<Fhr><3E>޷<EFBFBD><DEB7><EFBFBD></Fhr>'); //<2F><><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD>8<EFBFBD>ֽڣ<D6BD>
str.Add('<Skr><3E><><EFBFBD>ķ<EFBFBD></Skr>'); //<2F>տ<EFBFBD><D5BF>ˣ<EFBFBD>8<EFBFBD>ֽڣ<D6BD>
feename:=trim(t_ch_invoice_expitem.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString);
amount:= DBSumLower.Text;
if kbmMemTable2.Locate('FEENAME',feename,[]) then begin
str.Add('<Spbmbbh>'+kbmMemTable2.FieldByName('Spbmbbh').AsString+'</Spbmbbh>'); //<2F><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E6B1BE>
if (kbmMemTable2.FieldByName('Hsbz').AsString='True') then
str.Add('<Hsbz>1</Hsbz>') //<2F><>˰<EFBFBD><CBB0>־
else
str.Add('<Hsbz>0</Hsbz>')
end else begin
showmessage('ȱ<>ٷ<EFBFBD><D9B7>ô<EFBFBD><C3B4><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>'
+#13#10+'<27><>\<5C><>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>.txt<78><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊflbmxml.txt'
+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><CBB0>\bin<69>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ڡ<EFBFBD>');
exit;
end;
str.Add('<Spxx>');
str.Add('<Sph>');
str.Add('<Xh>1</Xh>'); //<2F><><EFBFBD><EFBFBD>
str.Add('<Spmc>'+feename+'</Spmc>');
{
if t_ch_invoice.FieldByName('<27>ұ<EFBFBD>').AsString='USD' THEN
begin
str.Add('<Spmc>'+t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').AsString+'</Spmc>'); //<2F><>Ʒ<EFBFBD><C6B7><EFBFBD>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ϊ<EFBFBD>ۿ<EFBFBD><DBBF><EFBFBD><EFBFBD><EFBFBD>
end
else
begin
str.Add('<Spmc><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD></Spmc>'); //<2F><>Ʒ<EFBFBD><C6B7><EFBFBD>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ϊ<EFBFBD>ۿ<EFBFBD><DBBF><EFBFBD><EFBFBD><EFBFBD>
end;
}
str.Add('<Ggxh> </Ggxh>'); ////<2F><><EFBFBD><EFBFBD><EFBFBD>ͺţ<CDBA>40<34>ֽڣ<D6BD>
str.Add('<Jldw>Ʊ</Jldw>'); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>32<33>ֽڣ<D6BD>
if kbmMemTable2.Locate('FEENAME',feename,[]) then begin
spbm:=kbmMemTable2.FieldByName('GoodsTaxNo').AsString;
while Length(spbm)<19 do
begin
spbm:=spbm+'0';
end;
str.Add('<Spbm>'+spbm+'</Spbm>'); //<2F><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
str.Add('<Qyspbm>'+kbmMemTable2.FieldByName('CropGoodsNo').AsString+'</Qyspbm>'); //<2F><>ҵ<EFBFBD><D2B5>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
end else begin
showmessage('ȱ<>ٷ<EFBFBD><D9B7>ô<EFBFBD><C3B4><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>'
+#13#10+'<27><>\<5C><>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>.txt<78><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊflbmxml.txt'
+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><CBB0>\bin<69>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ڡ<EFBFBD>');
exit;
end;
str.Add('<Syyhzcbz>1</Syyhzcbz>'); //<2F>Ż<EFBFBD><C5BB><EFBFBD><EFBFBD>߱<EFBFBD>ʶ
str.Add('<Lslbz>1</Lslbz>'); //<2F><>˰<EFBFBD>ʱ<EFBFBD>ʶ
str.Add('<Yhzcsm></Yhzcsm>'); //<2F>Ż<EFBFBD><C5BB><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>
StrAmt:=FloatToStr(GetUsdExrate(t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString)*t_ch_invoice_expitem.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat);
if t_ch_invoice_expitem.FieldByName('<27>ұ<EFBFBD>').AsString='USD' THEN
begin
str.Add('<Dj>'+StrAmt+'</Dj>'); //<2F><><EFBFBD><EFBFBD>
str.Add('<Sl>1</Sl>'); //<2F><><EFBFBD><EFBFBD>
str.Add('<Je>'+StrAmt+'</Je>'); //<2F><><EFBFBD><EFBFBD><EEA3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>ʱΪ<CAB1>ۿ<EFBFBD><DBBF><EFBFBD>
str.Add('<Slv>0</Slv>'); //˰<><CBB0>
end
else
begin
str.Add('<Dj>'+t_ch_invoice_expitem.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+'</Dj>'); //<2F><><EFBFBD><EFBFBD>
str.Add('<Sl>1</Sl>'); //<2F><><EFBFBD><EFBFBD>
str.Add('<Je>'+t_ch_invoice_expitem.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+'</Je>'); //<2F><><EFBFBD><EFBFBD><EEA3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>ʱΪ<CAB1>ۿ<EFBFBD><DBBF><EFBFBD>
str.Add('<Slv>0</Slv>'); //˰<><CBB0>
end;
str.Add('<Kce>0</Kce>'); //<2F><><EFBFBD><EFBFBD>
str.Add('</Sph>');
str.Add('</Spxx>');
str.Add('</Fp>');
i:=i+1;
if t_ch_invoice_expitem.FieldByName('<27>ұ<EFBFBD>').AsString='USD' THEN
begin
USDAMT:=USDAMT+t_ch_invoice_expitem.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
end else begin
RMBAMT:=RMBAMT+t_ch_invoice_expitem.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
end;
t_ch_invoice_expitem.Next;
end;
str.Add('</Fpsj>');
str.Add('</Fpxx>');
str.Add('</Kp>'); //
if (exptype=1) then begin
str.SaveToFile(ScriptPath
+t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString
+FormatDateTime('yyyy',now)
+FormatDateTime('mm',now)
+FormatDateTime('dd',now)
+FormatDateTime('hh',now)
+FormatDateTime('nn',now)+'.XML');
ShowMessage('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ɳɹ<C9B3>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+IntToStr(i)+'<27>ŷ<EFBFBD>Ʊ,<2C>ϼƽ<CFBC><C6BD><EFBFBD> <20><>Ԫ:'+FloatToStr(USDAMT)+',<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+FloatToStr(RMBAMT));
end else begin
SaveDialog1.FileName:=t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString;
if SaveDialog1.Execute then
begin
str.SaveToFile(SaveDialog1.FileName+'.XML');
ShowMessage('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ɳɹ<C9B3>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+IntToStr(i)+'<27>ŷ<EFBFBD>Ʊ,<2C>ϼƽ<CFBC><C6BD><EFBFBD> <20><>Ԫ:'+FloatToStr(USDAMT)+',<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+FloatToStr(RMBAMT));
end
else
begin
showmessage('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
exit;
end;
end;
finally
t_ch_invoice_expitem.Close;
FreeAndNil(Str);
end;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton34Click(Sender: TObject);
var
str:Tstringlist;
StrAmt,path,feename,amount,NAME,SH,DZ,ZH,spbm,FPTT,ScriptPath:string;
i:Integer;
begin
if dxDBGrid1.SelectedCount>0 then
begin
for i:=0 to dxDBGrid1.SelectedCount-1 do
begin
t_ch_invoice.GotoBookmark(pointer(dxDBGrid1.selectedrows[i]));
if bsSkinCheckRadioBox1.Checked then
expDZINV(1)
else
expINV(1);
end;
end
else
begin
if bsSkinCheckRadioBox1.Checked then
expDZINV(1)
else
expINV(1);
end;
end;
procedure Tfrm_ch_invoice_jk.expINV(exptype: Integer);
var
str:Tstringlist;
StrAmt,path,feename,amount,NAME,SH,DZ,ZH,spbm,FPTT,ScriptPath:string;
begin
ScriptPath:=ExtractFilePath(ParamStr(0))+'INVEXP\';
if not DirectoryExists(ScriptPath) then
CreateDir(ScriptPath);
t_ch_invoice_expitem.Close;
t_ch_invoice_expitem.Open;
if t_ch_invoice_expitem.RecordCount>0 then begin
if MessageDlg('<27>÷<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD>ϸ,ȷ<>ϰ<EFBFBD><CFB0>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbYes,mbNo],0)=mrYes then begin
t_ch_invoice_expitem.close;
expduiINV(exptype);
end;
Exit;
end;
t_ch_invoice_expitem.close;
try
str:=Tstringlist.Create;
str.Clear;
str.Add('<?xml version="1.0" encoding="GBK" ?>');
str.Add('<Kp>');
str.Add('<Version>2.0</Version>');//56
str.Add('<Fpxx>');
str.Add('<Zsl>1</Zsl>');
str.Add('<Zsl>1</Zsl>'); //<2F><><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>еĵ<D0B5><C4B5><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
str.Add('<Fpsj>');
str.Add('<Fp>');
str.Add('<Djh>'+t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'</Djh>'); //<2F><><EFBFBD>ݺţ<DDBA>20<32>ֽڣ<D6BD>
FPTT:=trim(t_ch_invoice.FieldByName('<27><>Ʊ̧ͷ').AsString);
str.Add('<Gfmc>'+FPTT+'</Gfmc>'); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>100<30>ֽڣ<D6BD>
//showmessage(IntToStr(kbmMemTable1.RecordCount));
if kbmMemTable1.Locate('NAME',FPTT,[]) then begin
NAME:=kbmMemTable1.fieldbyname('NAME').AsString;
SH:=kbmMemTable1.fieldbyname('SH').AsString;
DZ:=kbmMemTable1.fieldbyname('DZ').AsString;
ZH:=kbmMemTable1.fieldbyname('ZH').AsString;
str.Add('<Gfsh>'+SH+'</Gfsh>'); //<2F><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>
str.Add('<Gfyhzh>'+trim(StringReplace(ZH,'#|#',' ',[]))+'</Gfyhzh>'); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˺ţ<CBBA>100<30>ֽڣ<D6BD>
str.Add('<Gfdzdh>'+trim(DZ)+'</Gfdzdh>'); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><E7BBB0>100<30>ֽڣ<D6BD>
end else begin
showmessage('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB>¼<EFBFBD><C2BC>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD>򵼳<EFBFBD><F2B5BCB3>Ŀͻ<C4BF><CDBB><EFBFBD><EFBFBD><EFBFBD><EBB2BB><EFBFBD><EFBFBD><EFBFBD>µġ<C2B5>'
+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿͻ<C3BF><CDBB>Ƿ<EFBFBD><C7B7>Ѿ<EFBFBD>¼<EFBFBD><C2BC>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>.txt<78><74><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><CBB0>\bin<69>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ڡ<EFBFBD>');
exit;
end;
str.Add('<Bz>'+t_ch_invoice.FieldByName('<27><>ע').AsString+'</Bz>'); //<2F><>ע<EFBFBD><D7A2>240<34>ֽڣ<D6BD>
str.Add('<Fhr><3E>޷<EFBFBD><DEB7><EFBFBD></Fhr>'); //<2F><><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD>8<EFBFBD>ֽڣ<D6BD>
str.Add('<Skr><3E><><EFBFBD>ķ<EFBFBD></Skr>'); //<2F>տ<EFBFBD><D5BF>ˣ<EFBFBD>8<EFBFBD>ֽڣ<D6BD>
feename:= DM_CostType.Lines[0];
amount:= DBSumLower.Text;
if kbmMemTable2.Locate('FEENAME',feename,[]) then begin
str.Add('<Spbmbbh>'+kbmMemTable2.FieldByName('Spbmbbh').AsString+'</Spbmbbh>'); //<2F><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E6B1BE>
if (kbmMemTable2.FieldByName('Hsbz').AsString='True') then
str.Add('<Hsbz>1</Hsbz>') //<2F><>˰<EFBFBD><CBB0>־
else
str.Add('<Hsbz>0</Hsbz>')
end else begin
showmessage('ȱ<>ٷ<EFBFBD><D9B7>ô<EFBFBD><C3B4><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>'
+#13#10+'<27><>\<5C><>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>.txt<78><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊflbmxml.txt'
+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><CBB0>\bin<69>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ڡ<EFBFBD>');
exit;
end;
str.Add('<Spxx>');
str.Add('<Sph>');
str.Add('<Xh>1</Xh>'); //<2F><><EFBFBD><EFBFBD>
str.Add('<Spmc>'+feename+'</Spmc>');
{
if t_ch_invoice.FieldByName('<27>ұ<EFBFBD>').AsString='USD' THEN
begin
str.Add('<Spmc>'+t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').AsString+'</Spmc>'); //<2F><>Ʒ<EFBFBD><C6B7><EFBFBD>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ϊ<EFBFBD>ۿ<EFBFBD><DBBF><EFBFBD><EFBFBD><EFBFBD>
end
else
begin
str.Add('<Spmc><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD></Spmc>'); //<2F><>Ʒ<EFBFBD><C6B7><EFBFBD>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ϊ<EFBFBD>ۿ<EFBFBD><DBBF><EFBFBD><EFBFBD><EFBFBD>
end;
}
str.Add('<Ggxh> </Ggxh>'); ////<2F><><EFBFBD><EFBFBD><EFBFBD>ͺţ<CDBA>40<34>ֽڣ<D6BD>
str.Add('<Jldw>Ʊ</Jldw>'); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>32<33>ֽڣ<D6BD>
if kbmMemTable2.Locate('FEENAME',feename,[]) then begin
spbm:=kbmMemTable2.FieldByName('GoodsTaxNo').AsString;
while Length(spbm)<19 do
begin
spbm:=spbm+'0';
end;
str.Add('<Spbm>'+spbm+'</Spbm>'); //<2F><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
str.Add('<Qyspbm>'+kbmMemTable2.FieldByName('CropGoodsNo').AsString+'</Qyspbm>'); //<2F><>ҵ<EFBFBD><D2B5>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
end else begin
showmessage('ȱ<>ٷ<EFBFBD><D9B7>ô<EFBFBD><C3B4><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>'
+#13#10+'<27><>\<5C><>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>.txt<78><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊflbmxml.txt'
+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><CBB0>\bin<69>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ڡ<EFBFBD>');
exit;
end;
str.Add('<Syyhzcbz>1</Syyhzcbz>'); //<2F>Ż<EFBFBD><C5BB><EFBFBD><EFBFBD>߱<EFBFBD>ʶ
str.Add('<Lslbz>1</Lslbz>'); //<2F><>˰<EFBFBD>ʱ<EFBFBD>ʶ
str.Add('<Yhzcsm></Yhzcsm>'); //<2F>Ż<EFBFBD><C5BB><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>
StrAmt:=FloatToStr(GetUsdExrate(t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString)*t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').AsFloat);
if t_ch_invoice.FieldByName('<27>ұ<EFBFBD>').AsString='USD' THEN
begin
str.Add('<Dj>'+StrAmt+'</Dj>'); //<2F><><EFBFBD><EFBFBD>
str.Add('<Sl>1</Sl>'); //<2F><><EFBFBD><EFBFBD>
str.Add('<Je>'+StrAmt+'</Je>'); //<2F><><EFBFBD><EFBFBD><EEA3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>ʱΪ<CAB1>ۿ<EFBFBD><DBBF><EFBFBD>
str.Add('<Slv>0</Slv>'); //˰<><CBB0>
end
else
begin
str.Add('<Dj>'+t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').AsString+'</Dj>'); //<2F><><EFBFBD><EFBFBD>
str.Add('<Sl>1</Sl>'); //<2F><><EFBFBD><EFBFBD>
str.Add('<Je>'+t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').AsString+'</Je>'); //<2F><><EFBFBD><EFBFBD><EEA3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>ʱΪ<CAB1>ۿ<EFBFBD><DBBF><EFBFBD>
str.Add('<Slv>0</Slv>'); //˰<><CBB0>
end;
str.Add('<Kce>0</Kce>'); //<2F><><EFBFBD><EFBFBD>
str.Add('</Sph>');
str.Add('</Spxx>');
str.Add('</Fp>');
str.Add('</Fpsj>');
str.Add('</Fpxx>');
str.Add('</Kp>'); //
if (exptype=1) then begin
str.SaveToFile(ScriptPath
+t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString
+FormatDateTime('yyyy',now)
+FormatDateTime('mm',now)
+FormatDateTime('dd',now)
+FormatDateTime('hh',now)
+FormatDateTime('nn',now)+'.XML');
end else begin
SaveDialog1.FileName:=t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString;
if SaveDialog1.Execute then
begin
str.SaveToFile(SaveDialog1.FileName+'.XML');
showmessage('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ɳɹ<C9B3><C9B9><EFBFBD>');
end
else
begin
showmessage('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
exit;
end;
end;
finally
FreeAndNil(Str);
end;
end;
procedure Tfrm_ch_invoice_jk.expDZduiINV(exptype: Integer);
var
str:Tstringlist;
StrAmt,path,feename,amount,NAME,SH,DZ,ZH,spbm,FPTT,ScriptPath:string;
i:Integer;
aQuery,aQuery2:TADOQuery;
begin
ScriptPath:=ExtractFilePath(ParamStr(0))+'DZINVEXP\';
if not DirectoryExists(ScriptPath) then
CreateDir(ScriptPath);
t_ch_invoice_expitem.Close;
t_ch_invoice_expitem.Open;
aQuery:=CreateAdoQuery;
aQuery2:=CreateAdoQuery;
try
str:=Tstringlist.Create;
str.Clear;
str.Add('<?xml version="1.0" encoding="GBK" ?>');
str.Add('<business id="FPKJ" comment="<22><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>">');
aQuery.Close;
aQuery.SQL.Clear;
aQuery.SQL.Add('select top 1 * from t_sys_company');
aQuery.Open;
t_ch_invoice_expitem.First;
i:=1;
while not t_ch_invoice_expitem.Eof do begin
str.Add('<REQUEST_COMMON_FPKJ class="REQUEST_COMMON_FPKJ">');//56
str.Add('<COMMON_FPKJ_FPT class="COMMON_FPKJ_FPT">');//56
str.Add('<FPQQLSH>'+t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+inttostr(i)+'</FPQQLSH>'); //<2F><><EFBFBD>ݺţ<DDBA>20<32>ֽڣ<D6BD>
str.Add('<KPLX>0</KPLX>');
str.Add('<BMB_BBH>33.0</BMB_BBH>');
str.Add('<XSF_NSRSBH>'+aQuery.fieldbyname('˰<><CBB0><EFBFBD>ǼǺ<C7BC>').AsString+'</XSF_NSRSBH>'); //<2F><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>
str.Add('<XSF_MC>'+aQuery.fieldbyname('ȫ<><C8AB>').AsString+'</XSF_MC>'); //<2F><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>
str.Add('<XSF_DZDH>'+aQuery.fieldbyname('<27><>ַ').AsString+aQuery.fieldbyname('<27>绰').AsString+'</XSF_DZDH>'); //<2F><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>
aQuery2.Close;
aQuery2.SQL.Clear;
aQuery2.SQL.Add('select top 1 * from t_sys_bank where <20>ұ<EFBFBD>='''+t_ch_invoice.FieldByName('<27>ұ<EFBFBD>').AsString+'''');
aQuery2.Open;
if (not aQuery2.IsEmpty) then
str.Add('<XSF_YHZH>'+aQuery2.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+aQuery2.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>').AsString+'</XSF_YHZH>') //<2F><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>
else str.Add('<XSF_YHZH></XSF_YHZH>'); //<2F><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>
FPTT:=trim(t_ch_invoice_expitem.FieldByName('<27><>Ʊ̧ͷ').AsString);
//showmessage(IntToStr(kbmMemTable1.RecordCount));
if kbmMemTable1.Locate('NAME',FPTT,[]) then begin
NAME:=kbmMemTable1.fieldbyname('NAME').AsString;
SH:=kbmMemTable1.fieldbyname('SH').AsString;
DZ:=kbmMemTable1.fieldbyname('DZ').AsString;
ZH:=kbmMemTable1.fieldbyname('ZH').AsString;
if (Pos('#|#',ZH)>0) then begin
if t_ch_invoice.FieldByName('<27>ұ<EFBFBD>').AsString='USD' THEN begin
ZH:=Copy(ZH,Pos('#|#',ZH)+3,Length(ZH)-Pos('#|#',ZH)-2);
end else begin
ZH:=Copy(ZH,0,Pos('#|#',ZH)-1);
end;
end;
str.Add('<GMF_NSRSBH>'+SH+'</GMF_NSRSBH>'); //<2F><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>
str.Add('<GMF_MC>'+FPTT+'</GMF_MC>'); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>100<30>ֽڣ<D6BD>
str.Add('<GMF_DZDH>'+trim(DZ)+'</GMF_DZDH>'); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><E7BBB0>100<30>ֽڣ<D6BD>
str.Add('<GMF_YHZH>'+ZH+'</GMF_YHZH>'); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˺ţ<CBBA>100<30>ֽڣ<D6BD>
end else begin
showmessage('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+FPTT+'û<><C3BB>¼<EFBFBD><C2BC>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD>򵼳<EFBFBD><F2B5BCB3>Ŀͻ<C4BF><CDBB><EFBFBD><EFBFBD><EFBFBD><EBB2BB><EFBFBD><EFBFBD><EFBFBD>µġ<C2B5>'
+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿͻ<C3BF><CDBB>Ƿ<EFBFBD><C7B7>Ѿ<EFBFBD>¼<EFBFBD><C2BC>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>.txt<78><74><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><CBB0>\bin<69>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ڡ<EFBFBD>');
exit;
end;
str.Add('<KPR>'+t_ch_invoice.FieldByName('<27>Ƶ<EFBFBD><C6B5><EFBFBD>').AsString+'</KPR>'); //<2F><><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD>8<EFBFBD>ֽڣ<D6BD>
str.Add('<SKR><3E><><EFBFBD>ķ<EFBFBD></SKR>'); //<2F>տ<EFBFBD><D5BF>ˣ<EFBFBD>8<EFBFBD>ֽڣ<D6BD>
str.Add('<FHR><3E>޷<EFBFBD><DEB7><EFBFBD></FHR>'); //<2F><><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD>8<EFBFBD>ֽڣ<D6BD>
str.Add('<YFP_DM></YFP_DM>'); //<2F><><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD>8<EFBFBD>ֽڣ<D6BD>
str.Add('<YFP_HM></YFP_HM>');
if t_ch_invoice_expitem.FieldByName('<27>ұ<EFBFBD>').AsString='USD' THEN
StrAmt:=FloatToStr(GetUsdExrate(t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString)*t_ch_invoice_expitem.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat)
else
StrAmt:=t_ch_invoice_expitem.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
str.Add('<JSHJ>'+StrAmt+'</JSHJ>');
str.Add('<HJJE>'+StrAmt+'</HJJE>'); //<2F><><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD>8<EFBFBD>ֽڣ<D6BD>
str.Add('<HJSE>0</HJSE>'); //<2F><><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD>8<EFBFBD>ֽڣ<D6BD>
feename:=trim(t_ch_invoice_expitem.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString);
amount:= DBSumLower.Text;
if kbmMemTable2.Locate('FEENAME',feename,[]) then begin
{
if (kbmMemTable2.FieldByName('Hsbz').AsString='True') then
str.Add('<HSBZ>1</HSBZ>') //<2F><>˰<EFBFBD><CBB0>־
else
}
str.Add('<HSBZ>0</HSBZ>')
end else begin
showmessage('ȱ<>ٷ<EFBFBD><D9B7>ô<EFBFBD><C3B4><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>'
+#13#10+'<27><>\<5C><>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>.txt<78><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊflbmxml.txt'
+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><CBB0>\bin<69>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ڡ<EFBFBD>');
exit;
end;
if t_ch_invoice_expitem.FieldByName('<27>ұ<EFBFBD>').AsString='USD' THEN
str.Add('<BZ>'+'USD'+floattostr(t_ch_invoice_expitem.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat)+'*'+floattostr(GetUsdExrate(t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString))+' <20><>Ʊ<EFBFBD>޸<EFBFBD><DEB8><EFBFBD>Ԫ'+t_ch_invoice_expitem.FieldByName('<27><>ע').AsString+' </BZ>')
else str.Add('<BZ>'+t_ch_invoice_expitem.FieldByName('<27><>ע').AsString+' </BZ>');
str.Add('</COMMON_FPKJ_FPT>');
str.Add('<COMMON_FPKJ_XMXXS class=''COMMON_FPKJ_XMXX'' size=''1''>');
str.Add('<COMMON_FPKJ_XMXX>');
str.Add('<FPHXZ>0</FPHXZ>'); //<2F><><EFBFBD><EFBFBD>
if kbmMemTable2.Locate('FEENAME',feename,[]) then begin
spbm:=kbmMemTable2.FieldByName('GoodsTaxNo').AsString;
while Length(spbm)<19 do
begin
spbm:=spbm+'0';
end;
str.Add('<SPBM>'+spbm+'</SPBM>'); //<2F><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
str.Add('<ZXBM>'+spbm+'</ZXBM>'); //<2F><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
// str.Add('<Qyspbm>'+kbmMemTable2.FieldByName('CropGoodsNo').AsString+'</Qyspbm>'); //<2F><>ҵ<EFBFBD><D2B5>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
end else begin
showmessage('ȱ<>ٷ<EFBFBD><D9B7>ô<EFBFBD><C3B4><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>'
+#13#10+'<27><>\<5C><>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>.txt<78><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊflbmxml.txt'
+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><CBB0>\bin<69>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ڡ<EFBFBD>');
exit;
end;
str.Add('<YHZCBS>1</YHZCBS>'); //<2F>Ż<EFBFBD><C5BB><EFBFBD><EFBFBD>߱<EFBFBD>ʶ
str.Add('<LSLBS>1</LSLBS>'); //<2F><>˰<EFBFBD>ʱ<EFBFBD>ʶ
str.Add('<ZZSTSGL></ZZSTSGL>'); //<2F>Ż<EFBFBD><C5BB><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>
str.Add('<XMMC>'+feename+'</XMMC>');
str.Add('<GGXH></GGXH>'); ////<2F><><EFBFBD><EFBFBD><EFBFBD>ͺţ<CDBA>40<34>ֽڣ<D6BD>
str.Add('<DW>Ʊ</DW>');
str.Add('<XMSL>1</XMSL>'); //<2F><><EFBFBD><EFBFBD>
str.Add('<XMDJ>'+StrAmt+'</XMDJ>'); //<2F><><EFBFBD><EFBFBD>
str.Add('<XMJE>'+StrAmt+'</XMJE>'); //<2F><><EFBFBD><EFBFBD><EEA3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>ʱΪ<CAB1>ۿ<EFBFBD><DBBF><EFBFBD>
str.Add('<SL>0</SL>'); //˰<><CBB0>
str.Add('<SE>0</SE>'); //˰<><CBB0>
str.Add('<KCE>0</KCE>'); //<2F><><EFBFBD><EFBFBD>
str.Add('</COMMON_FPKJ_XMXX>');
str.Add('</COMMON_FPKJ_XMXXS>');
str.Add('</REQUEST_COMMON_FPKJ>');
i:=i+1;
t_ch_invoice_expitem.Next;
end;
str.Add('</business>'); //
if (exptype=1) then begin
str.SaveToFile(ScriptPath
+t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString
+FormatDateTime('yyyy',now)
+FormatDateTime('mm',now)
+FormatDateTime('dd',now)
+FormatDateTime('hh',now)
+FormatDateTime('nn',now)+'.XML');
end else begin
SaveDialog1.FileName:=t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString;
if SaveDialog1.Execute then
begin
str.SaveToFile(SaveDialog1.FileName+'.XML');
showmessage('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ɳɹ<C9B3><C9B9><EFBFBD>');
end
else
begin
showmessage('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
exit;
end;
end;
finally
t_ch_invoice_expitem.Close;
FreeAndNil(Str);
FreeAndNil(aQuery);
FreeAndNil(aQuery2);
end;
end;
procedure Tfrm_ch_invoice_jk.expDZINV(exptype: Integer);
var
str:Tstringlist;
StrAmt,path,feename,amount,NAME,SH,DZ,ZH,spbm,FPTT,ScriptPath:string;
aQuery:TADOQuery;
begin
ScriptPath:=ExtractFilePath(ParamStr(0))+'INVDZEXP\';
if not DirectoryExists(ScriptPath) then
CreateDir(ScriptPath);
t_ch_invoice_expitem.Close;
t_ch_invoice_expitem.Open;
if t_ch_invoice_expitem.RecordCount>0 then begin
if MessageDlg('<27>÷<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD>ϸ,ȷ<>ϰ<EFBFBD><CFB0>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbYes,mbNo],0)=mrYes then begin
t_ch_invoice_expitem.close;
expDZduiINV(exptype);
end;
Exit;
end;
t_ch_invoice_expitem.close;
aQuery:=CreateAdoQuery;
try
str:=Tstringlist.Create;
str.Clear;
str.Add('<?xml version="1.0" encoding="GBK" ?>');
str.Add('<business id="FPKJ" comment="<22><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>">');
str.Add('<REQUEST_COMMON_FPKJ class="REQUEST_COMMON_FPKJ">');
str.Add('<COMMON_FPKJ_FPT class="COMMON_FPKJ_FPT">');
str.Add('<FPQQLSH>'+t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'</FPQQLSH>'); //<2F><><EFBFBD>ݺţ<DDBA>20<32>ֽڣ<D6BD>
str.Add('<KPLX>0</KPLX>');
str.Add('<BMB_BBH>33.0</BMB_BBH>');
aQuery.Close;
aQuery.SQL.Clear;
aQuery.SQL.Add('select top 1 * from t_sys_company');
aQuery.Open;
str.Add('<XSF_NSRSBH>'+aQuery.fieldbyname('˰<><CBB0><EFBFBD>ǼǺ<C7BC>').AsString+'</XSF_NSRSBH>'); //<2F><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>
str.Add('<XSF_MC>'+aQuery.fieldbyname('ȫ<><C8AB>').AsString+'</XSF_MC>'); //<2F><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>
str.Add('<XSF_DZDH>'+aQuery.fieldbyname('<27><>ַ').AsString+aQuery.fieldbyname('<27>绰').AsString+'</XSF_DZDH>'); //<2F><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>
aQuery.Close;
aQuery.SQL.Clear;
aQuery.SQL.Add('select top 1 * from t_sys_bank where <20>ұ<EFBFBD>='''+t_ch_invoice.FieldByName('<27>ұ<EFBFBD>').AsString+'''');
aQuery.Open;
if (not aQuery.IsEmpty) then
str.Add('<XSF_YHZH>'+aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>').AsString+'</XSF_YHZH>') //<2F><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>
else str.Add('<XSF_YHZH></XSF_YHZH>'); //<2F><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>
FPTT:=trim(t_ch_invoice.FieldByName('<27><>Ʊ̧ͷ').AsString);
//showmessage(IntToStr(kbmMemTable1.RecordCount));
if kbmMemTable1.Locate('NAME',FPTT,[]) then begin
NAME:=kbmMemTable1.fieldbyname('NAME').AsString;
SH:=kbmMemTable1.fieldbyname('SH').AsString;
DZ:=kbmMemTable1.fieldbyname('DZ').AsString;
ZH:=kbmMemTable1.fieldbyname('ZH').AsString;
if (Pos('#|#',ZH)>0) then begin
if t_ch_invoice.FieldByName('<27>ұ<EFBFBD>').AsString='USD' THEN begin
ZH:=Copy(ZH,Pos('#|#',ZH)+3,Length(ZH)-Pos('#|#',ZH)-2);
end else begin
ZH:=Copy(ZH,0,Pos('#|#',ZH)-1);
end;
end;
str.Add('<GMF_NSRSBH>'+SH+'</GMF_NSRSBH>'); //<2F><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>
str.Add('<GMF_MC>'+FPTT+'</GMF_MC>'); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>100<30>ֽڣ<D6BD>
str.Add('<GMF_DZDH>'+trim(DZ)+'</GMF_DZDH>'); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><E7BBB0>100<30>ֽڣ<D6BD>
str.Add('<GMF_YHZH>'+ZH+'</GMF_YHZH>'); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˺ţ<CBBA>100<30>ֽڣ<D6BD>
end else begin
showmessage('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB>¼<EFBFBD><C2BC>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD>򵼳<EFBFBD><F2B5BCB3>Ŀͻ<C4BF><CDBB><EFBFBD><EFBFBD><EFBFBD><EBB2BB><EFBFBD><EFBFBD><EFBFBD>µġ<C2B5>'
+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿͻ<C3BF><CDBB>Ƿ<EFBFBD><C7B7>Ѿ<EFBFBD>¼<EFBFBD><C2BC>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>.txt<78><74><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><CBB0>\bin<69>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ڡ<EFBFBD>');
exit;
end;
str.Add('<KPR>'+t_ch_invoice.FieldByName('<27>Ƶ<EFBFBD><C6B5><EFBFBD>').AsString+'</KPR>'); //<2F><><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD>8<EFBFBD>ֽڣ<D6BD>
str.Add('<SKR><3E><><EFBFBD>ķ<EFBFBD></SKR>'); //<2F>տ<EFBFBD><D5BF>ˣ<EFBFBD>8<EFBFBD>ֽڣ<D6BD>
str.Add('<FHR><3E>޷<EFBFBD><DEB7><EFBFBD></FHR>'); //<2F><><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD>8<EFBFBD>ֽڣ<D6BD>
str.Add('<YFP_DM></YFP_DM>'); //<2F><><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD>8<EFBFBD>ֽڣ<D6BD>
str.Add('<YFP_HM></YFP_HM>');
if t_ch_invoice.FieldByName('<27>ұ<EFBFBD>').AsString='USD' THEN
StrAmt:=FloatToStr(GetUsdExrate(t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString)*t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').AsFloat)
else
StrAmt:=t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').AsString;
str.Add('<JSHJ>'+StrAmt+'</JSHJ>');
str.Add('<HJJE>'+StrAmt+'</HJJE>'); //<2F><><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD>8<EFBFBD>ֽڣ<D6BD>
str.Add('<HJSE>0</HJSE>');
feename:= DM_CostType.Lines[0];
amount:= DBSumLower.Text;
if kbmMemTable2.Locate('FEENAME',feename,[]) then begin
// str.Add('<Spbmbbh>'+kbmMemTable2.FieldByName('Spbmbbh').AsString+'</Spbmbbh>'); //<2F><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E6B1BE>
{ if (kbmMemTable2.FieldByName('Hsbz').AsString='True') then
str.Add('<HSBZ>1</HSBZ>') //<2F><>˰<EFBFBD><CBB0>־
else
}
str.Add('<HSBZ>0</HSBZ>')
end else begin
showmessage('ȱ<>ٷ<EFBFBD><D9B7>ô<EFBFBD><C3B4><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>'
+#13#10+'<27><>\<5C><>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>.txt<78><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊflbmxml.txt'
+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><CBB0>\bin<69>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ڡ<EFBFBD>');
exit;
end;
str.Add('<BZ>'+t_ch_invoice.FieldByName('<27><>ע').AsString+'</BZ>'); //<2F><>ע<EFBFBD><D7A2>240<34>ֽڣ<D6BD>
str.Add('</COMMON_FPKJ_FPT>');
str.Add('<COMMON_FPKJ_XMXXS class=''COMMON_FPKJ_XMXX'' size=''1''>');
str.Add('<COMMON_FPKJ_XMXX>');
str.Add('<FPHXZ>0</FPHXZ>');
if kbmMemTable2.Locate('FEENAME',feename,[]) then begin
spbm:=kbmMemTable2.FieldByName('GoodsTaxNo').AsString;
while Length(spbm)<19 do
begin
spbm:=spbm+'0';
end;
str.Add('<SPBM>'+spbm+'</SPBM>'); //<2F><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
str.Add('<ZXBM>'+spbm+'</ZXBM>'); //<2F><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
end else begin
showmessage('ȱ<>ٷ<EFBFBD><D9B7>ô<EFBFBD><C3B4><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>'
+#13#10+'<27><>\<5C><>˰<EFBFBD><CBB0>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>.txt<78><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊflbmxml.txt'
+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><CBB0>\bin<69>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ڡ<EFBFBD>');
exit;
end;
str.Add('<YHZCBS>1</YHZCBS>'); //<2F>Ż<EFBFBD><C5BB><EFBFBD><EFBFBD>߱<EFBFBD>ʶ
str.Add('<LSLBS>1</LSLBS>'); //<2F><>˰<EFBFBD>ʱ<EFBFBD>ʶ
str.Add('<ZZSTSGL></ZZSTSGL>'); //<2F>Ż<EFBFBD><C5BB><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>
str.Add('<XMMC>'+feename+'</XMMC>');
str.Add('<GGXH></GGXH>'); ////<2F><><EFBFBD><EFBFBD><EFBFBD>ͺţ<CDBA>40<34>ֽڣ<D6BD>
str.Add('<DW>Ʊ</DW>');
str.Add('<XMSL>1</XMSL>'); //<2F><><EFBFBD><EFBFBD>
str.Add('<XMDJ>'+StrAmt+'</XMDJ>'); //<2F><><EFBFBD><EFBFBD>
str.Add('<XMJE>'+StrAmt+'</XMJE>'); //<2F><><EFBFBD><EFBFBD><EEA3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>ʱΪ<CAB1>ۿ<EFBFBD><DBBF><EFBFBD>
str.Add('<SL>0</SL>'); //˰<><CBB0>
str.Add('<SE>0</SE>');
str.Add('<KCE>0</KCE>'); //<2F><><EFBFBD><EFBFBD>
str.Add('</COMMON_FPKJ_XMXX>');
str.Add('</COMMON_FPKJ_XMXXS>');
str.Add('</REQUEST_COMMON_FPKJ>');
str.Add('</business>'); //
if (exptype=1) then begin
str.SaveToFile(ScriptPath
+t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString
+FormatDateTime('yyyy',now)
+FormatDateTime('mm',now)
+FormatDateTime('dd',now)
+FormatDateTime('hh',now)
+FormatDateTime('nn',now)+'.XML');
end else begin
SaveDialog1.FileName:=t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString;
if SaveDialog1.Execute then
begin
str.SaveToFile(SaveDialog1.FileName+'.XML');
showmessage('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ɳɹ<C9B3><C9B9><EFBFBD>');
end
else
begin
showmessage('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
exit;
end;
end;
finally
FreeAndNil(Str);
FreeAndNil(aQuery);
end;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton39Click(Sender: TObject);
begin
expDZINV(0)
end;
procedure Tfrm_ch_invoice_jk.t_ch_invoice_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_item ');
sql.Add('where IN_ID=:IN_ID');
Parameters.ParamByName('IN_ID').Value:=t_ch_invoice.fieldbyname('IN_ID').AsInteger;
Open;First;
amt:=fieldbyname('Amt').AsFloat;
if Abs(Amt)<0.1 then
begin
close;
SQL.clear;
sql.add('update t_ch_invoice set <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>=:<3A>ϼƽ<CFBC><C6BD><EFBFBD><>ʽ<EFBFBD><CABD><EFBFBD>=:ʵ<>ʽ<EFBFBD><CABD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д');
sql.Add('where IN_ID=:IN_ID');
Parameters.ParamByName('IN_ID').Value:=t_ch_invoice.fieldbyname('IN_ID').AsInteger;
Parameters.ParamByName('<27>ϼƽ<CFBC><C6BD><EFBFBD>').Value:=Amt;
Parameters.ParamByName('ʵ<>ʽ<EFBFBD><CABD><EFBFBD>').Value:=Amt;
if Amt<0 then
begin
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д').Value:=FloatToStr(Amt)+'(<28><>)';
end
else
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д').Value:=FloatToStr(Amt);
ExecSQL;
end
else
begin
close;
SQL.clear;
sql.add('update t_ch_invoice set <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>=:<3A>ϼƽ<CFBC><C6BD><EFBFBD><>ʽ<EFBFBD><CABD><EFBFBD>=:ʵ<>ʽ<EFBFBD><CABD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д');
sql.Add('where IN_ID=:IN_ID');
Parameters.ParamByName('IN_ID').Value:=t_ch_invoice.fieldbyname('IN_ID').AsInteger;
Parameters.ParamByName('<27>ϼƽ<CFBC><C6BD><EFBFBD>').Value:=Amt;
Parameters.ParamByName('ʵ<>ʽ<EFBFBD><CABD><EFBFBD>').Value:=Amt;
if Amt<0 then
begin
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д').Value:=invoice_max(Amt,''+'(<28><>)');
end
else
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д').Value:=invoice_max(Amt,'');
ExecSQL;
end;
t_ch_invoice.Refresh;
finally
Free;
end;
end;
procedure Tfrm_ch_invoice_jk.t_ch_invoice_itemBeforeEdit(
DataSet: TDataSet);
begin
if not modify_all then
begin
if t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>').asboolean then
begin
showmessage('<27><>Ʊ<EFBFBD>Ѿ<EFBFBD><D1BE>ϳ<EFBFBD><CFB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ģ<DEB8><C4A3><EFBFBD>');
abort;
end;
if t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD>').asboolean then
begin
showmessage('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>ƾ֤<C6BE><D6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ģ<DEB8><C4A3><EFBFBD>');
abort;
end;
if t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ').asboolean then
begin
showmessage('<27><>Ʊ<EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ģ<DEB8><C4A3><EFBFBD>');
abort;
end;
end;
end;
procedure Tfrm_ch_invoice_jk.t_ch_invoice_itemBeforeInsert(
DataSet: TDataSet);
begin
if t_ch_invoice.state in [dsedit,dsinsert] then t_ch_invoice.post;
end;
procedure Tfrm_ch_invoice_jk.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.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
Parameters.ParamByName('<27><>Ʊ̧ͷ').Value:=Trim(DBComboBoxEh1.Text);
if (t_ch_invoice.FieldByName('ʵ<>ʱұ<CAB1>').AsString<>'') then
SQL.Add(' and <20>ұ<EFBFBD>='''+t_ch_invoice.FieldByName('ʵ<>ʱұ<CAB1>').AsString+'''');
open;
if not IsEmpty then
begin
if (t_ch_invoice.state=dsinsert) or (t_ch_invoice.state=dsedit) then
begin
DBComboBoxEh4.Text:=FieldByName('<27><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>').AsString;
DBComboBoxEh5.Text:=FieldByName('<27><>ַ<EFBFBD>绰').AsString;
DBComboBoxEh6.Text:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>ʺ<EFBFBD>').AsString;
// DBEdit31.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');
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.state=dsinsert) or (t_ch_invoice.state=dsedit) then
begin
DBComboBoxEh4.Text:=FieldByName('<27><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>').AsString;
DBComboBoxEh5.Text:=FieldByName('<27><>ַ<EFBFBD>绰').AsString;
DBComboBoxEh6.Text:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>˺<EFBFBD>').AsString;
// DBEdit31.Text:=FieldByName('<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>').AsString;
end;
end;
finally
Close;
FreeAndNil(aQuery);
end;
end;
procedure Tfrm_ch_invoice_jk.wwDBLookupCombo2Change(Sender: TObject);
begin
if (t_ch_invoice_item.state=dsinsert)or(t_ch_invoice_item.state=dsedit) then
begin
if not frm_data_share.t_code_goods_inv.IsEmpty then
if frm_data_share.t_code_goods_inv.Locate('<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>',wwDBLookupCombo2.text,[])then
begin
t_ch_invoice_item['˰<><CBB0>']:=frm_data_share.t_code_goods_inv.fieldbyname('˰<><CBB0>').AsFloat;
t_ch_invoice_item['<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>']:=frm_data_share.t_code_goods_inv.fieldbyname('<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').AsString;
t_ch_invoice_item['<27><><EFBFBD><EFBFBD><EFBFBD>ͺ<EFBFBD>']:=frm_data_share.t_code_goods_inv.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ͺ<EFBFBD>').AsString;
t_ch_invoice_item['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ']:=frm_data_share.t_code_goods_inv.fieldbyname('<27><>λ').AsString;
end;
end;
end;
procedure Tfrm_ch_invoice_jk.t_ch_invoice_itemBeforePost(
DataSet: TDataSet);
var
Amt,price:double;
begin
if trim(DataSet.FieldByName('<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring)='' then
begin
showmessage('<27><>Ʒ<EFBFBD><C6B7><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD>');
abort;
end;
{
if DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat=0 then
begin
showmessage('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD>');
abort;
end;
if DataSet.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:=DataSet.fieldbyname('<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>').asfloat/(1+DataSet.fieldbyname('˰<><CBB0>').asfloat/100);
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/100)*DataSet.fieldbyname('˰<><CBB0>').asfloat/100);
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/100+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/100)*DataSet.fieldbyname('˰<><CBB0>').AsFloat/100);
end;
end;
procedure Tfrm_ch_invoice_jk.t_ch_invoice_itemNewRecord(DataSet: TDataSet);
begin
DataSet.FieldByName('<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring:='';
DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ͺ<EFBFBD>').asstring:='0';
DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ').asstring:='Ʊ';
DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=1;
DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=0;
DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=0;
DataSet.FieldByName('˰<><CBB0>').AsFloat:=frm_data_share.t_sys_company.fieldbyname('˰<><CBB0>').AsFloat;
DataSet.FieldByName('˰<><CBB0>').AsFloat:=0;
DataSet.FieldByName('<27>ۿ<EFBFBD>').AsFloat:=0;
DataSet.FieldByName('<27><>ע').asstring:='';
DataSet.FieldByName('<27><>˰<EFBFBD>۱<EFBFBD>־').Value:=0;
end;
procedure Tfrm_ch_invoice_jk.t_ch_invoice_itemvatPriceFieldChange(
Sender: TField);
begin
try
Sender.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat:=Sender.DataSet.fieldbyname('<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>').asfloat/(1+Sender.DataSet.fieldbyname('˰<><CBB0>').asfloat/100);
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/100)*Sender.DataSet.fieldbyname('˰<><CBB0>').asfloat/100);
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_jk.bsSkinButton40Click(Sender: TObject);
var
str,PostUrl:string;
book1:Tbookmark;
IdHttp : TIdHTTP;
errmsg : string;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
ResponseStream : TStringStream; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
ResponseStr: string;
RequestStr : string; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
RequestStream : TStringStream;
jo: ISuperObject;
i,k:Integer;
sl:TStrings;
begin
t_ch_invoice_expitem.Close;
t_ch_invoice_expitem.Open;
if (not t_ch_invoice_expitem.IsEmpty) then begin
if (t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsString='1') then begin
end else begin
if MessageDlg(' <20>˷<EFBFBD>Ʊ<EFBFBD><C6B1>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+#13#10+'ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)=mryes then
begin
bsSkinButton43.OnClick(nil);
end;
Exit;
end;
end;
str:=str+'{';
str:=str+'"bill":"'+t_ch_invoice.fieldbyname('IN_ID').AsString+'"';
str:=str+'}';
PostUrl:=get_parameters_value(2124,'')+'/Dispatch/NNMakeInv';
IdHttp := TIdHTTP.Create(nil);
IdHTTP.HTTPOptions := IdHTTP.HTTPOptions + [hoKeepOrigProtocol]; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD><E6B1BE>Ч
IdHTTP.ProtocolVersion := pv1_1;
IdHttp.HandleRedirects:=true;
IdHttp.Request.UserAgent:='Mozilla/3.0 (compatible; Indy Library)';
idhttp.Request.ContentType:='application/json;charset=UTF-8';
ResponseStream := TStringStream.Create('');
RequestStream := TStringStream.Create('');
sl:=tstringlist.create();
sl.add(str);
jo := SO(str);
try
try
RequestStr:=jo.AsJSon(True);
RequestStream.WriteString(RequestStr);
IdHttp.post(PostUrl,RequestStream,ResponseStream);
except
IdHttp.post(PostUrl,RequestStream,ResponseStream);
end;
ResponseStr := ResponseStream.DataString;
ResponseStr := UTF8Decode(ResponseStr);
if Pos(':true',ResponseStr)>0 then
begin
book1:=t_ch_invoice.GetBookmark;
t_ch_invoice.Requery;
t_ch_invoice.GotoBookmark(book1);
end else
begin
i:= Pos('"Message":' ,ResponseStr);
errmsg :=Copy(ResponseStr ,i+12,Length(ResponseStr)-i-12);
errmsg :=Copy(errmsg ,0,Pos('"' ,errmsg));
if (errmsg<>'"') then
MessageDlg(errmsg,mtError,[mbok],0)
else begin
book1:=t_ch_invoice.GetBookmark;
t_ch_invoice.Requery;
t_ch_invoice.GotoBookmark(book1);
end;
end;
finally
IdHttp.Free;
RequestStream.Free;
ResponseStream.Free;
end;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton41Click(Sender: TObject);
var
str,PostUrl:string;
book1:Tbookmark;
IdHttp : TIdHTTP;
errmsg : string;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
ResponseStream : TStringStream; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
ResponseStr: string;
RequestStr : string; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
RequestStream : TStringStream;
jo: ISuperObject;
i,k:Integer;
sl:TStrings;
begin
str:=str+'{';
str:=str+'"bill":"'+t_ch_invoice.fieldbyname('IN_ID').AsString+'"';
str:=str+'}';
PostUrl:=get_parameters_value(2124,'')+'/Dispatch/NNReadInv';
IdHttp := TIdHTTP.Create(nil);
IdHTTP.HTTPOptions := IdHTTP.HTTPOptions + [hoKeepOrigProtocol]; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD><E6B1BE>Ч
IdHTTP.ProtocolVersion := pv1_1;
IdHttp.HandleRedirects:=true;
IdHttp.Request.UserAgent:='Mozilla/3.0 (compatible; Indy Library)';
idhttp.Request.ContentType:='application/json;charset=UTF-8';
ResponseStream := TStringStream.Create('');
RequestStream := TStringStream.Create('');
sl:=tstringlist.create();
sl.add(str);
jo := SO(str);
try
try
RequestStr:=jo.AsJSon(True);
RequestStream.WriteString(RequestStr);
IdHttp.post(PostUrl,RequestStream,ResponseStream);
except
IdHttp.post(PostUrl,RequestStream,ResponseStream);
end;
ResponseStr := ResponseStream.DataString;
ResponseStr := UTF8Decode(ResponseStr);
if Pos(':true',ResponseStr)>0 then
begin
book1:=t_ch_invoice.GetBookmark;
t_ch_invoice.Requery;
t_ch_invoice.GotoBookmark(book1);
end else
begin
i:= Pos('"Message":' ,ResponseStr);
errmsg :=Copy(ResponseStr ,i+12,Length(ResponseStr)-i-12);
errmsg :=Copy(errmsg ,0,Pos('"' ,errmsg));
if (errmsg<>'"') then
MessageDlg(errmsg,mtError,[mbok],0)
else begin
book1:=t_ch_invoice.GetBookmark;
t_ch_invoice.Requery;
t_ch_invoice.GotoBookmark(book1);
end;
end;
finally
IdHttp.Free;
RequestStream.Free;
ResponseStream.Free;
end;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton42Click(Sender: TObject);
var
str,PostUrl:string;
book1:Tbookmark;
IdHttp : TIdHTTP;
errmsg : string;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
ResponseStream : TStringStream; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
ResponseStr: string;
RequestStr : string; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
RequestStream : TStringStream;
jo: ISuperObject;
i,k:Integer;
sl:TStrings;
begin
str:=str+'{';
str:=str+'"bill":"'+t_ch_invoice.fieldbyname('IN_ID').AsString+'"';
str:=str+'}';
PostUrl:=get_parameters_value(2124,'')+'/Dispatch/NNSetRed';
IdHttp := TIdHTTP.Create(nil);
IdHTTP.HTTPOptions := IdHTTP.HTTPOptions + [hoKeepOrigProtocol]; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD><E6B1BE>Ч
IdHTTP.ProtocolVersion := pv1_1;
IdHttp.HandleRedirects:=true;
IdHttp.Request.UserAgent:='Mozilla/3.0 (compatible; Indy Library)';
idhttp.Request.ContentType:='application/json;charset=UTF-8';
ResponseStream := TStringStream.Create('');
RequestStream := TStringStream.Create('');
sl:=tstringlist.create();
sl.add(str);
jo := SO(str);
try
try
RequestStr:=jo.AsJSon(True);
RequestStream.WriteString(RequestStr);
IdHttp.post(PostUrl,RequestStream,ResponseStream);
except
IdHttp.post(PostUrl,RequestStream,ResponseStream);
end;
ResponseStr := ResponseStream.DataString;
ResponseStr := UTF8Decode(ResponseStr);
if Pos(':true',ResponseStr)>0 then
begin
book1:=t_ch_invoice.GetBookmark;
t_ch_invoice.Requery;
t_ch_invoice.GotoBookmark(book1);
end else
begin
i:= Pos('"Message":' ,ResponseStr);
errmsg :=Copy(ResponseStr ,i+12,Length(ResponseStr)-i-12);
errmsg :=Copy(errmsg ,0,Pos('"' ,errmsg));
if (errmsg<>'"') then
MessageDlg(errmsg,mtError,[mbok],0)
else begin
book1:=t_ch_invoice.GetBookmark;
t_ch_invoice.Requery;
t_ch_invoice.GotoBookmark(book1);
end;
end;
finally
IdHttp.Free;
RequestStream.Free;
ResponseStream.Free;
end;
end;
procedure Tfrm_ch_invoice_jk.RxDBLookupCombo1Change(Sender: TObject);
begin
if (t_ch_invoice.state=dsedit)or(t_ch_invoice.state=dsinsert)then
begin
if not t_crm_client_Invoice.IsEmpty then begin
t_ch_invoice['<27><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>']:=t_crm_client_Invoice.fieldbyname('<27><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>').asString;
t_ch_invoice['<27><>ַ<EFBFBD>绰']:=t_crm_client_Invoice.fieldbyname('<27><>ַ<EFBFBD>绰').asString;
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>˺<EFBFBD>']:=t_crm_client_Invoice.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>˺<EFBFBD>').asString;
end;
end;
end;
procedure Tfrm_ch_invoice_jk.wwDBLookupCombo3Change(Sender: TObject);
VAR
total_money:real;
currency_chi:string;
aQuery:TADOQuery;
begin
//<2F>ұ<EFBFBD><D2B1><EFBFBD><EFBFBD><EFBFBD>
try
if (t_ch_invoice.state=dsinsert) or (t_ch_invoice.state=dsedit) then
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> ');
Parameters.ParamByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value:=t_ch_invoice.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
if (t_ch_invoice.FieldByName('ʵ<>ʱұ<CAB1>').AsString<>'') then
SQL.Add(' and <20>ұ<EFBFBD>='''+t_ch_invoice.FieldByName('ʵ<>ʱұ<CAB1>').AsString+'''');
open;
if not IsEmpty then
begin
if (t_ch_invoice.state=dsinsert) or (t_ch_invoice.state=dsedit) then
begin
DBComboBoxEh4.Text:=FieldByName('<27><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>').AsString;
DBComboBoxEh5.Text:=FieldByName('<27><>ַ<EFBFBD>绰').AsString;
DBComboBoxEh6.Text:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>ʺ<EFBFBD>').AsString;
t_ch_invoice['<27><>Ʊ̧ͷ']:=fieldbyname('<27><>Ʊ̧ͷ').asstring
// DBEdit31.Text:=FieldByName('<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>').AsString;
end
end
finally
Close;
FreeAndNil(aQuery);
end;
end;
except
;
end;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton43Click(Sender: TObject);
var
str:Tstringlist;
StrAmt,path,feename,amount,NAME,SH,DZ,ZH,spbm,FPTT,ScriptPath:string;
i:Integer;
aQuery,aQuery2:TADOQuery;
isfirst:Boolean;
book1:TBookmark;
begin
t_ch_invoice_expitem.Close;
t_ch_invoice_expitem.Open;
if (t_ch_invoice_expitem.IsEmpty) then begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8>Ҫ<EFBFBD><D2AA><EFBFBD>֣<EFBFBD>');
exit;
end;
if (t_ch_invoice.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsString='1') then begin
ShowMessage('<27>Ѳ<EFBFBD><D1B2><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD>֣<EFBFBD>');
exit;
end;
t_ch_invoice_expitem.First;
isfirst:=true;
while not t_ch_invoice_expitem.Eof do begin
if (isfirst) then begin
t_ch_invoice.Edit;
FPTT:=trim(t_ch_invoice_expitem.FieldByName('<27><>Ʊ̧ͷ').AsString);
t_ch_invoice['<27><>Ʊ̧ͷ']:=FPTT;
if kbmMemTable1.Locate('NAME',FPTT,[]) then begin
NAME:=kbmMemTable1.fieldbyname('NAME').AsString;
t_ch_invoice['<27><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>']:=kbmMemTable1.fieldbyname('SH').AsString;
t_ch_invoice['<27><>Ʊ̧ͷ']:=FPTT;
t_ch_invoice['<27><>ַ<EFBFBD>绰']:=kbmMemTable1.fieldbyname('DZ').AsString;
ZH:=kbmMemTable1.fieldbyname('ZH').AsString;
if (Pos('#|#',ZH)>0) then begin
if t_ch_invoice.FieldByName('<27>ұ<EFBFBD>').AsString='USD' THEN begin
ZH:=Copy(ZH,Pos('#|#',ZH)+3,Length(ZH)-Pos('#|#',ZH)-2);
end else begin
ZH:=Copy(ZH,0,Pos('#|#',ZH)-1);
end;
end;
t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>˺<EFBFBD>']:=ZH;
end;
if t_ch_invoice_expitem.FieldByName('<27>ұ<EFBFBD>').AsString='USD' THEN
StrAmt:=FloatToStr(GetUsdExrate(t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString)*t_ch_invoice_expitem.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat)
else
StrAmt:=t_ch_invoice_expitem.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
feename:=trim(t_ch_invoice_expitem.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString);
if t_ch_invoice_expitem.FieldByName('<27>ұ<EFBFBD>').AsString='USD' THEN
t_ch_invoice['<27><>ע']:='USD'+floattostr(t_ch_invoice_expitem.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat)+'*'+floattostr(GetUsdExrate(t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString))+' <20><>Ʊ<EFBFBD>޸<EFBFBD><DEB8><EFBFBD>Ԫ'+t_ch_invoice_expitem.FieldByName('<27><>ע').AsString
else t_ch_invoice['<27><>ע']:=t_ch_invoice_expitem.FieldByName('<27><>ע').AsString;
t_ch_invoice['<27>ұ<EFBFBD>']:=t_ch_invoice_expitem.FieldByName('<27>ұ<EFBFBD>').AsString;
if kbmMemTable2.Locate('FEENAME',feename,[]) then
spbm:=kbmMemTable2.FieldByName('GoodsTaxNo').AsString;
while Length(spbm)<19 do
begin
spbm:=spbm+'0';
end;
t_ch_invoice['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:=t_ch_invoice['<27>ϼƽ<CFBC><C6BD><EFBFBD>'];
t_ch_invoice['<27>ϼƽ<CFBC><C6BD><EFBFBD>']:=StrToFloatDef(StrAmt,0);
t_ch_invoice['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:='1';
t_ch_invoice.Post;
if (not t_ch_invoice_item.IsEmpty) then begin
t_ch_invoice_item.First;
while not t_ch_invoice_item.Eof do begin
t_ch_invoice_item.Delete;
end;
end;
t_ch_invoice_item.Insert;
t_ch_invoice_item.FieldByName('<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring:=feename;
t_ch_invoice_item.FieldByName('<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring:=spbm;
t_ch_invoice_item.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ').asstring:='Ʊ';
t_ch_invoice_item.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=1;
t_ch_invoice_item.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloatDef(StrAmt,0);
t_ch_invoice_item.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloatDef(StrAmt,0);
t_ch_invoice_item.FieldByName('<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>').AsFloat:=StrToFloatDef(StrAmt,0);
t_ch_invoice_item.FieldByName('˰<><CBB0>').AsFloat:=frm_data_share.t_sys_company.fieldbyname('˰<><CBB0>').AsFloat;
t_ch_invoice_item.FieldByName('˰<><CBB0>').AsFloat:=0;
t_ch_invoice_item.FieldByName('<27>ۿ<EFBFBD>').AsFloat:=0;
t_ch_invoice_item.FieldByName('<27><>ע').asstring:='';
t_ch_invoice_item.FieldByName('<27><>˰<EFBFBD>۱<EFBFBD>־').Value:=StrToFloatDef(StrAmt,0);
t_ch_invoice_item.Post;
end else begin
IF (not t_ch_invoice_insert.Active) then t_ch_invoice_insert.Open;
IF (not t_ch_invoice_item_insert.Active) then t_ch_invoice_item_insert.Open;
t_ch_invoice_insert.Insert;
t_ch_invoice_insert['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:='<27><><EFBFBD>ɷ<EFBFBD>Ʊ';
t_ch_invoice_insert['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:=date;
t_ch_invoice_insert['<27>Ƶ<EFBFBD><C6B5><EFBFBD>']:=employee;
t_ch_invoice_insert['<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ']:=0;
t_ch_invoice_insert['<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>']:=0;
t_ch_invoice_insert['<27>ϳ<EFBFBD>ԭ<EFBFBD><D4AD>']:='';
t_ch_invoice_insert['<27>ϳ<EFBFBD><CFB3><EFBFBD>']:='';
t_ch_invoice_insert['<27>ϳ<EFBFBD><CFB3><EFBFBD><EFBFBD><EFBFBD>']:=null;
t_ch_invoice_insert['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='';
t_ch_invoice_insert['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=null;
t_ch_invoice_insert['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=t_ch_invoice['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>'];
if t_sys_bank.Locate('<27>ұ<EFBFBD>',t_ch_invoice_insert['<27>ұ<EFBFBD>'],[]) then begin
t_ch_invoice_insert['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
t_ch_invoice_insert['<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>']:=t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>').asstring;
end;
t_ch_invoice_insert['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:='<27><>ֵ˰<D6B5><CBB0>Ʊ';
FPTT:=trim(t_ch_invoice_expitem.FieldByName('<27><>Ʊ̧ͷ').AsString);
t_ch_invoice_insert['<27><>Ʊ̧ͷ']:=FPTT;
if kbmMemTable1.Locate('NAME',FPTT,[]) then begin
NAME:=kbmMemTable1.fieldbyname('NAME').AsString;
t_ch_invoice_insert['<27><>˰<EFBFBD><CBB0>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>']:=kbmMemTable1.fieldbyname('SH').AsString;
t_ch_invoice_insert['<27><>ַ<EFBFBD>绰']:=kbmMemTable1.fieldbyname('DZ').AsString;
ZH:=kbmMemTable1.fieldbyname('ZH').AsString;
if (Pos('#|#',ZH)>0) then begin
if t_ch_invoice_insert.FieldByName('<27>ұ<EFBFBD>').AsString='USD' THEN begin
ZH:=Copy(ZH,Pos('#|#',ZH)+3,Length(ZH)-Pos('#|#',ZH)-2);
end else begin
ZH:=Copy(ZH,0,Pos('#|#',ZH)-1);
end;
end;
t_ch_invoice_insert['<27><><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>˺<EFBFBD>']:=ZH;
end;
if t_ch_invoice_expitem.FieldByName('<27>ұ<EFBFBD>').AsString='USD' THEN
StrAmt:=FloatToStr(GetUsdExrate(t_ch_invoice_insert.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString)*t_ch_invoice_expitem.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat)
else
StrAmt:=t_ch_invoice_expitem.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
feename:=trim(t_ch_invoice_expitem.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString);
if t_ch_invoice_expitem.FieldByName('<27>ұ<EFBFBD>').AsString='USD' THEN
t_ch_invoice_insert['<27><>ע']:='USD'+floattostr(t_ch_invoice_expitem.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat)+'*'+floattostr(GetUsdExrate(t_ch_invoice_insert.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString))+' <20><>Ʊ<EFBFBD>޸<EFBFBD><DEB8><EFBFBD>Ԫ'+t_ch_invoice_expitem.FieldByName('<27><>ע').AsString
else t_ch_invoice_insert['<27><>ע']:=t_ch_invoice_expitem.FieldByName('<27><>ע').AsString;
t_ch_invoice_insert['<27>ұ<EFBFBD>']:=t_ch_invoice_expitem.FieldByName('<27>ұ<EFBFBD>').AsString;
t_ch_invoice_insert['<27>ϼƽ<CFBC><C6BD><EFBFBD>']:=StrToFloatDef(StrAmt,0);
if kbmMemTable2.Locate('FEENAME',feename,[]) then
spbm:=kbmMemTable2.FieldByName('GoodsTaxNo').AsString;
while Length(spbm)<19 do
begin
spbm:=spbm+'0';
end;
t_ch_invoice_insert['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:='1';
t_ch_invoice_insert.Post;
t_ch_invoice_item_insert.Insert;
t_ch_invoice_item_insert.FieldByName('<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring:=feename;
t_ch_invoice_item_insert.FieldByName('<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring:=spbm;
t_ch_invoice_item_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ').asstring:='Ʊ';
t_ch_invoice_item_insert.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=1;
t_ch_invoice_item_insert.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloatDef(StrAmt,0);
t_ch_invoice_item_insert.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloatDef(StrAmt,0);
t_ch_invoice_item_insert.FieldByName('<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>').AsFloat:=StrToFloatDef(StrAmt,0);
t_ch_invoice_item_insert.FieldByName('˰<><CBB0>').AsFloat:=frm_data_share.t_sys_company.fieldbyname('˰<><CBB0>').AsFloat;
t_ch_invoice_item_insert.FieldByName('˰<><CBB0>').AsFloat:=0;
t_ch_invoice_item_insert.FieldByName('<27>ۿ<EFBFBD>').AsFloat:=0;
t_ch_invoice_item_insert.FieldByName('<27><>ע').asstring:='';
t_ch_invoice_item_insert.FieldByName('<27><>˰<EFBFBD>۱<EFBFBD>־').Value:=StrToFloatDef(StrAmt,0);
t_ch_invoice_item_insert.Post;
end;
isfirst:=false;
t_ch_invoice_expitem.Next;
end;
// bsSkinTabSheet1.Show;
book1:=t_ch_invoice.GetBookmark;
t_ch_invoice.Requery;
t_ch_invoice.GotoBookmark(book1);
t_ch_invoice.First;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton45Click(Sender: TObject);
begin
if not t_ch_invoice.Bof then
t_ch_invoice.Prior;
end;
procedure Tfrm_ch_invoice_jk.bsSkinButton44Click(Sender: TObject);
begin
if not t_ch_invoice.eof then
t_ch_invoice.next;
end;
procedure Tfrm_ch_invoice_jk.t_ch_invoice_insertAfterInsert(
DataSet: TDataSet);
begin
t_ch_invoice_insert['<27>Ƶ<EFBFBD><C6B5><EFBFBD>']:=employee;
t_ch_invoice_insert['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:=date;
t_ch_invoice_insert['<27>ϼƽ<CFBC><C6BD><EFBFBD>']:=0;
t_ch_invoice_insert['ʵ<>ʽ<EFBFBD><CABD><EFBFBD>']:=0;
t_ch_invoice_insert['<27><EFBFBD><E9BFAA><EFBFBD><EFBFBD>']:=0;
t_ch_invoice_insert['<27>Զ<EFBFBD>']:=1;
t_ch_invoice_insert['<27><><EFBFBD>̵ǼǺ<C7BC>']:=Trim(frm_data_share.t_sys_company.fieldbyname('<27><><EFBFBD>̵ǼǺ<C7BC>').AsString);
t_ch_invoice_insert['˰<><CBB0><EFBFBD>ǼǺ<C7BC>']:=Trim(frm_data_share.t_sys_company.fieldbyname('˰<><CBB0><EFBFBD>ǼǺ<C7BC>').AsString);
t_ch_invoice_insert['<27><><EFBFBD><EFBFBD>״̬']:=0;
t_ch_invoice_insert['<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ']:=0;
t_ch_invoice_insert['<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>']:=0;
t_ch_invoice_insert['<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD><EFBFBD>ʺ<EFBFBD><CABA><EFBFBD><EFBFBD><EFBFBD>']:=1;
t_ch_invoice_insert['<27>ұ<EFBFBD>']:='RMB';
t_ch_invoice_insert['<27><>Ʊ<EFBFBD>ұ<EFBFBD>']:='RMB';
t_ch_invoice_insert['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:='1';
t_ch_invoice_insert['<27><>Ʊ״̬']:='0';
t_ch_invoice_insert['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='0';
t_ch_invoice_insert['<27><><EFBFBD>ͷ<EFBFBD>ʽ']:='-1';
t_ch_invoice_insert['<27><><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD>']:='0';
end;
procedure Tfrm_ch_invoice_jk.t_ch_invoice_insertBeforePost(
DataSet: TDataSet);
var
currency_chi:String;
total_money:Double;
aAdoQuery:TAdoQuery;
USDAMT,RMBAMT:Double;
begin
t_ch_invoice_insert['ʵ<>ʽ<EFBFBD><CABD><EFBFBD>']:=s_w(StrToInt(apointnum),t_ch_invoice_insert['ʵ<>ʽ<EFBFBD><CABD><EFBFBD>']);
if (t_ch_invoice_insert.state=dsinsert) and (t_ch_invoice_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='') then
t_ch_invoice_insert['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=get_no(date,'IA');
if (t_ch_invoice_insert.fieldbyname('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').asstring<>'<27><><EFBFBD>뷢Ʊ') and (shiji<>t_ch_invoice_insert.FieldByName('ʵ<>ʽ<EFBFBD><CABD><EFBFBD>').value) then
t_ch_invoice_insert['<27>ϼƽ<CFBC><C6BD><EFBFBD>']:=t_ch_invoice_insert['ʵ<>ʽ<EFBFBD><CABD><EFBFBD>'];
total_money:=Abs(t_ch_invoice_insert['<27>ϼƽ<CFBC><C6BD><EFBFBD>']);
if t_ch_invoice_insert['<27>ұ<EFBFBD>']='RMB' then currency_chi:='';//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if t_ch_invoice_insert['<27>ұ<EFBFBD>']='USD' then currency_chi:=''; //<2F><>Ԫ
if t_ch_invoice_insert['<27>ϼƽ<CFBC><C6BD><EFBFBD>']<0 then
begin
t_ch_invoice_insert['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д']:=invoice_max(total_money,currency_chi+'(<28><>)');
end
else
t_ch_invoice_insert['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д']:=invoice_max(t_ch_invoice_insert['<27>ϼƽ<CFBC><C6BD><EFBFBD>'],currency_chi);
end;
procedure Tfrm_ch_invoice_jk.t_ch_invoice_item_insertAfterInsert(
DataSet: TDataSet);
begin
DataSet['IN_ID']:=t_ch_invoice_insert['IN_ID'];
end;
procedure Tfrm_ch_invoice_jk.t_ch_invoice_item_insertAfterPost(
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_item ');
sql.Add('where IN_ID=:IN_ID');
Parameters.ParamByName('IN_ID').Value:=t_ch_invoice_insert.fieldbyname('IN_ID').AsInteger;
Open;First;
amt:=fieldbyname('Amt').AsFloat;
if Abs(Amt)<0.1 then
begin
close;
SQL.clear;
sql.add('update t_ch_invoice set <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>=:<3A>ϼƽ<CFBC><C6BD><EFBFBD><>ʽ<EFBFBD><CABD><EFBFBD>=:ʵ<>ʽ<EFBFBD><CABD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д');
sql.Add('where IN_ID=:IN_ID');
Parameters.ParamByName('IN_ID').Value:=t_ch_invoice_insert.fieldbyname('IN_ID').AsInteger;
Parameters.ParamByName('<27>ϼƽ<CFBC><C6BD><EFBFBD>').Value:=Amt;
Parameters.ParamByName('ʵ<>ʽ<EFBFBD><CABD><EFBFBD>').Value:=Amt;
if Amt<0 then
begin
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д').Value:=FloatToStr(Amt)+'(<28><>)';
end
else
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д').Value:=FloatToStr(Amt);
ExecSQL;
end
else
begin
close;
SQL.clear;
sql.add('update t_ch_invoice set <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>=:<3A>ϼƽ<CFBC><C6BD><EFBFBD><>ʽ<EFBFBD><CABD><EFBFBD>=:ʵ<>ʽ<EFBFBD><CABD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д');
sql.Add('where IN_ID=:IN_ID');
Parameters.ParamByName('IN_ID').Value:=t_ch_invoice_insert.fieldbyname('IN_ID').AsInteger;
Parameters.ParamByName('<27>ϼƽ<CFBC><C6BD><EFBFBD>').Value:=Amt;
Parameters.ParamByName('ʵ<>ʽ<EFBFBD><CABD><EFBFBD>').Value:=Amt;
if Amt<0 then
begin
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д').Value:=invoice_max(Amt,''+'(<28><>)');
end
else
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д').Value:=invoice_max(Amt,'');
ExecSQL;
end;
finally
Free;
end;
end;
end.