u_venduti.pas
来自「一套来自国外的ERP系统,有兴趣的朋友可以看看!」· PAS 代码 · 共 211 行
PAS
211 行
unit u_venduti;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Db, Grids, DBGrids, DBTables, StdCtrls, ComCtrls, ActnList, ExtCtrls,
DBCtrls, ToolWin, ppDB, ppBands, ppCtrls, ppClass, ppVar, ppPrnabl,
ppProd, ppReport, ppComm, ppRelatv, ppCache, ppDBPipe, ppDBBDE;
type
TVenduti = class(TForm)
Lista: TTable;
DsLista: TDataSource;
DBGrid1: TDBGrid;
ListaIdriga: TIntegerField;
ListaIdlista: TIntegerField;
ListaSezione: TStringField;
ListaArticolo: TStringField;
ListaDescrizione: TStringField;
ListaQta: TFloatField;
ListaPrezzoL: TCurrencyField;
ListaPrezzoE: TCurrencyField;
ListaQtaprenota: TFloatField;
ListaQtavenduta: TFloatField;
ListaQtaconsegnata: TFloatField;
ListaOrdinamento: TIntegerField;
ListaSelezione: TBooleanField;
ListaQtaselezionata: TFloatField;
ListaQtarimasta: TFloatField;
ListaQtarimasta2: TFloatField;
ListaQtanonconsegnata: TFloatField;
ListaArticoloetichetta: TStringField;
TotaleL: TEdit;
Label1: TLabel;
Label2: TLabel;
TotaleE: TEdit;
Label3: TLabel;
BonusL: TEdit;
BonusE: TEdit;
Label4: TLabel;
ToolBar1: TToolBar;
DBNavigator1: TDBNavigator;
ppVenduti: TppBDEPipeline;
Venduti: TppReport;
ppHeaderBand1: TppHeaderBand;
ppLabel1: TppLabel;
ppLabel2: TppLabel;
ppSystemVariable1: TppSystemVariable;
ppDBText6: TppDBText;
ppLabel3: TppLabel;
ppDBText7: TppDBText;
ppLabel4: TppLabel;
ppDBText8: TppDBText;
ppDetailBand1: TppDetailBand;
ppDBText3: TppDBText;
ppDBText5: TppDBText;
ppDBText2: TppDBText;
ppDBText4: TppDBText;
ppFooterBand1: TppFooterBand;
ppSystemVariable2: TppSystemVariable;
ppGroup1: TppGroup;
ppGroupHeaderBand1: TppGroupHeaderBand;
ppDBText1: TppDBText;
ppLine1: TppLine;
ppLine2: TppLine;
ppGroupFooterBand1: TppGroupFooterBand;
ActionList1: TActionList;
Stampa: TAction;
Esci: TAction;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
ListaImportoL: TCurrencyField;
ListaImportoE: TCurrencyField;
ListaIdGiornale: TStringField;
QVenduti: TQuery;
QVendutiIdriga: TIntegerField;
QVendutiIdlista: TIntegerField;
QVendutiSezione: TStringField;
QVendutiArticolo: TStringField;
QVendutiDescrizione: TStringField;
QVendutiQta: TFloatField;
QVendutiPrezzoL: TCurrencyField;
QVendutiPrezzoE: TCurrencyField;
QVendutiQtaprenota: TFloatField;
QVendutiQtavenduta: TFloatField;
QVendutiQtaconsegnata: TFloatField;
QVendutiOrdinamento: TIntegerField;
QVendutiSelezione: TBooleanField;
QVendutiQtaselezionata: TFloatField;
QVendutiQtarimasta: TFloatField;
QVendutiQtarimasta2: TFloatField;
QVendutiQtanonconsegnata: TFloatField;
QVendutiArticoloetichetta: TStringField;
QVendutiDenominazione: TStringField;
QVendutiIdGiornale: TStringField;
QVendutiIdLista2: TIntegerField;
QVendutiCognomenomesposo: TStringField;
QVendutiCognomenomesposa: TStringField;
QVendutiDatanozze: TDateField;
QVendutiModalitdiconsegna: TStringField;
QVendutiIndirizzoattualesposo: TStringField;
QVendutiIndirizzoattualesposa: TStringField;
QVendutiCAPattualesposo: TStringField;
QVendutiCAPattualesposa: TStringField;
QVendutiLocalitattualesposo: TStringField;
QVendutiLocalitattualesposa: TStringField;
QVendutiProvinciaattualesposo: TStringField;
QVendutiProvinciaattualesposa: TStringField;
QVendutiTelefonosposo: TStringField;
QVendutiTelefonosposa: TStringField;
QVendutiCellsposo: TStringField;
QVendutiCellsposa: TStringField;
QVendutiIndirizzocoppia: TStringField;
QVendutiCAPcoppia: TStringField;
QVendutiLocalitcoppia: TStringField;
QVendutiProvinciacoppia: TStringField;
QVendutiData: TDateField;
QVendutiRecapitodelleconsegne: TStringField;
QVendutiTelefonoconsegne: TStringField;
QVendutiRecapitodelleconsegne2: TStringField;
QVendutiTelefonodelleconsegne2: TStringField;
QVendutiTipopromozione: TStringField;
QVendutiSconto: TFloatField;
QVendutiNote: TMemoField;
QVendutiModalitdiconsegna2: TStringField;
QVendutiIdGiornale_1: TStringField;
QVendutiImportoL: TCurrencyField;
DSQVenduti: TDataSource;
QVendutiOperatore: TStringField;
QVendutiArticolofornitore: TStringField;
QVendutiImportoE: TCurrencyField;
procedure FormCreate(Sender: TObject);
procedure StampaExecute(Sender: TObject);
procedure EsciExecute(Sender: TObject);
procedure ListaCalcFields(DataSet: TDataSet);
procedure QVendutiCalcFields(DataSet: TDataSet);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Venduti: TVenduti;
implementation
uses Liste_nozze, main;
{$R *.DFM}
procedure TVenduti.FormCreate(Sender: TObject);
var TotL, BonL : currency;
TotE, BonE : currency;
begin
if lista_Nozze.lista.State = dsEdit then
lista_nozze.lista.Post;
DsLista.Enabled := false;
TotL:=0;
TotE:=0;
Lista.First;
while not lista.eof do
begin
TotL:=TotL+(listaprezzoL.AsCurrency*listaQtaVenduta.AsFloat);
TotE:=TotE+(Main_form.ArrotondaImponibile4(listaprezzoE.AsCurrency,'E')*listaQtaVenduta.AsFloat);
lista.next;
end;
lista.first;
if Lista_Nozze.listeSconto.AsInteger > 0 then
begin
BonL := (TotL / 100) * Lista_Nozze.listeSconto.AsInteger;
BonE := (TotE / 100) * Lista_Nozze.listeSconto.AsFloat;
BonusL.Text := Formatfloat('#,###',BonL);
BonusE.Text := Formatfloat('#,##0.00',BonE);
end;
TotaleL.text := Formatfloat('#,###',TotL);
TotaleE.text := Formatfloat('#,##0.00',TotE);
DsLista.Enabled := true;
end;
procedure TVenduti.StampaExecute(Sender: TObject);
begin
QVenduti.Close ;
QVenduti.ParamByName('Lista').Value := Lista_Nozze.listeIDlista.AsInteger ;
QVenduti.Prepare ;
QVenduti.Open ;
Venduti.Print;
QVenduti.Close ;
end;
procedure TVenduti.EsciExecute(Sender: TObject);
begin
Close;
end;
procedure TVenduti.ListaCalcFields(DataSet: TDataSet);
begin
ListaImportoL.AsCurrency := listaqta.AsFloat * listaprezzoL.AsCurrency;
ListaImportoE.AsCurrency := listaqta.AsFloat * listaprezzoE.AsCurrency;
end;
procedure TVenduti.QVendutiCalcFields(DataSet: TDataSet);
begin
QVendutiImportoL.AsCurrency := QVendutiqtavenduta.AsFloat * QVendutiprezzoL.AsCurrency;
QVendutiImportoE.AsCurrency := QVendutiqtavenduta.AsFloat * (Main_form.ArrotondaImponibile4(QVendutiprezzoE.AsCurrency,'E'));
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?