⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 u_prenotazioni.pas

📁 基于OOP设计的一套较好的ERP系统
💻 PAS
字号:
unit u_Prenotazioni;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, db,
  Grids, DBGrids, DBTables, ActnList, StdCtrls, DBCtrls, ExtCtrls,
  ComCtrls, ToolWin, ImgList, Mask, DBSumLst, ppDB, ppModule, raCodMod,
  ppBands, ppStrtch, ppMemo, ppCtrls, ppVar, ppPrnabl, ppClass, ppProd,
  ppReport, ppComm, ppRelatv, ppCache, ppDBPipe, ppDBBDE, ppRichTx;

type
  TPrenotazioni = class(TForm)
    Tprenotazioni: TTable;
    DsTPrenotazioni: TDataSource;
    Dprenotazioni: TTable;
    Panel1: TPanel;
    TprenotazioniGrid: TDBGrid;
    Panel2: TPanel;
    DBGrid2: TDBGrid;
    ActionList1: TActionList;
    Esci: TAction;
    Vendi: TAction;
    Elimina: TAction;
    ToolBar1: TToolBar;
    ToolButton1: TToolButton;
    ToolButton2: TToolButton;
    ToolButton3: TToolButton;
    DprenotazioniIdprenotazione: TIntegerField;
    DprenotazioniIdrigalista: TIntegerField;
    DprenotazioniQta: TFloatField;
    DprenotazioniPrezzoL: TCurrencyField;
    DprenotazioniPrezzoE: TCurrencyField;
    TprenotazioniIdprenotazione: TIntegerField;
    TprenotazioniNominativo: TStringField;
    TprenotazioniNtelefono: TStringField;
    TprenotazioniCaparraL: TCurrencyField;
    TprenotazioniCaparraE: TCurrencyField;
    TprenotazioniStato: TStringField;
    TprenotazioniConsegna: TStringField;
    Annulla: TAction;
    ToolButton6: TToolButton;
    Label6: TLabel;
    TotaleL: TEdit;
    Label7: TLabel;
    TotaleE: TEdit;
    DprenotazioniDescrizione: TStringField;
    DprenotazioniArticolo: TStringField;
    Lista: TTable;
    ListaIdriga: TIntegerField;
    ListaIdlista: TIntegerField;
    ListaSezione: TStringField;
    ListaArticolo: TStringField;
    ListaDescrizione: TStringField;
    ListaQta: TFloatField;
    ListaPrezzoL: TCurrencyField;
    ListaPrezzoE: TCurrencyField;
    ListaQtaprenota: TFloatField;
    ListaQtaconsegnata: TFloatField;
    ListaOrdinamento: TIntegerField;
    ListaSelezione: TBooleanField;
    ListaQtaselezionata: TFloatField;
    ListaQtarimasta: TFloatField;
    ListaQtanonconsegnata: TFloatField;
    ListaQtarimasta2: TFloatField;
    TprenotazioniId_lista: TIntegerField;
    DBNavigator1: TDBNavigator;
    ToolBar2: TToolBar;
    DprenNav: TDBNavigator;
    Venduti: TCheckBox;
    ListaQtavenduta: TFloatField;
    Nominativo: TEdit;
    Label1: TLabel;
    Modifica: TAction;
    ToolButton5: TToolButton;
    tpicklist: TTable;
    tpicklistIdpicklist: TIntegerField;
    tpicklistIdlista: TIntegerField;
    tpicklistStatopicklist: TStringField;
    tpicklistIdvendita: TIntegerField;
    tpicklistDestinatario: TStringField;
    tpicklistModalitdiconsegna: TStringField;
    DSTpicklist: TDataSource;
    dpicklist: TTable;
    dpicklistIdrigalista: TIntegerField;
    dpicklistIdpicklist: TIntegerField;
    dpicklistArticolo: TStringField;
    dpicklistDescrizione: TStringField;
    dpicklistQta: TFloatField;
    DprenotazioniImportoL: TCurrencyField;
    DprenotazioniImportoE: TCurrencyField;
    ListaImportoL: TCurrencyField;
    ListaImportoE: TCurrencyField;
    TprenotazioniIdGiornale: TStringField;
    DprenotazioniIdGiornale: TStringField;
    ListaIdGiornale: TStringField;
    tpicklistIdGiornale: TStringField;
    dpicklistIdGiornale: TStringField;
    Testata: TMemo;
    tpicklistTestata: TMemoField;
    ppTPickList: TppBDEPipeline;
    Vendita: TppReport;
    ppTPrenotazioni: TppBDEPipeline;
    dpicklistArticoloFornitore: TStringField;
    dpicklistDenominazione: TStringField;
    ListaArticolofornitore: TStringField;
    ListaDenominazione: TStringField;
    ppDPickList: TppBDEPipeline;
    DsPickList: TDataSource;
    dpicklistPrezzoL: TIntegerField;
    DsDPrenotazioni: TDataSource;
    ppHeaderBand1: TppHeaderBand;
    ppLabel5: TppLabel;
    ppDBText18: TppDBText;
    ppSystemVariable3: TppSystemVariable;
    ppDBText24: TppDBText;
    ppLine5: TppLine;
    ppLabel21: TppLabel;
    ppDBText19: TppDBText;
    ppLabel22: TppLabel;
    ppDBText20: TppDBText;
    ppDBMemo1: TppDBMemo;
    ppDetailBand1: TppDetailBand;
    ppDBText26: TppDBText;
    ppDBText27: TppDBText;
    ppDBText28: TppDBText;
    ppDBText29: TppDBText;
    ppDBText30: TppDBText;
    ppDBText31: TppDBText;
    ppFooterBand1: TppFooterBand;
    ppSummaryBand2: TppSummaryBand;
    ppLabel23: TppLabel;
    ppLabel25: TppLabel;
    ppLabel26: TppLabel;
    ppDBText22: TppDBText;
    ppDBText23: TppDBText;
    ppDBText25: TppDBText;
    TprenotazioniTotale: TIntegerField;
    TprenotazioniTotDoc: TIntegerField;
    TprenotazioniPostazione: TStringField;
    ppDBRichText1: TppDBRichText;
    Scontrino: TDBCheckBox;
    Depositi_combo: TComboBox;
    Label2: TLabel;
    ListaArticoloetichetta: TStringField;
    dpicklistPrezzoE: TCurrencyField;
    procedure EsciExecute(Sender: TObject);
    procedure EliminaExecute(Sender: TObject);
    procedure FormActivate(Sender: TObject);
    procedure TprenotazioniAfterDelete(DataSet: TDataSet);
    procedure VendiExecute(Sender: TObject);
    procedure AnnullaExecute(Sender: TObject);
    procedure DsTPrenotazioniDataChange(Sender: TObject; Field: TField);
    procedure DprenotazioniCalcFields(DataSet: TDataSet);
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure ListaPrezzoLChange(Sender: TField);
    procedure VendutiClick(Sender: TObject);
    procedure ModificaExecute(Sender: TObject);
    procedure tpicklistAfterInsert(DataSet: TDataSet);
    procedure ListaCalcFields(DataSet: TDataSet);
    procedure TprenotazioniAfterInsert(DataSet: TDataSet);
    procedure TprenotazioniAfterPost(DataSet: TDataSet);
    procedure TprenotazioniBeforeDelete(DataSet: TDataSet);
    procedure DprenotazioniAfterInsert(DataSet: TDataSet);
    procedure ListaAfterInsert(DataSet: TDataSet);
    procedure dpicklistAfterInsert(DataSet: TDataSet);
    procedure DprenotazioniAfterPost(DataSet: TDataSet);
    procedure ListaAfterPost(DataSet: TDataSet);
    procedure tpicklistAfterPost(DataSet: TDataSet);
    procedure dpicklistAfterPost(DataSet: TDataSet);
    procedure DprenotazioniBeforeDelete(DataSet: TDataSet);
    procedure ListaBeforeDelete(DataSet: TDataSet);
    procedure tpicklistBeforeDelete(DataSet: TDataSet);
    procedure dpicklistBeforeDelete(DataSet: TDataSet);
    procedure dpicklistCalcFields(DataSet: TDataSet);
    procedure TprenotazioniCalcFields(DataSet: TDataSet);
    procedure Depositi_comboKeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    Totalone: currency;
    { Public declarations }
  end;

var
  Prenotazioni: TPrenotazioni;

implementation

uses Liste_nozze, wizard, main, u_consegna_mod, Consegna;

{$R *.DFM}

procedure TPrenotazioni.EsciExecute(Sender: TObject);
begin
     Close;
end;

procedure TPrenotazioni.EliminaExecute(Sender: TObject);
begin
     if messagedlg('Sei sicuro di cancellare la prenotazione ?',mtconfirmation,[mbYes,mbNo],0) = mrNo then
        abort ;
     if (TprenotazioniStato.AsString <> 'A') and  (TprenotazioniStato.AsString <> 'C')then
       while not Dprenotazioni.IsEmpty do
          begin
             if lista.findkey([Dprenotazioniidrigalista.asinteger]) then
             begin
                  lista.edit;
                  listaQtaprenota.AsInteger:=listaQtaprenota.AsInteger-DprenotazioniQta.AsInteger;
                  listaqtarimasta2.AsInteger :=  listaqta.AsInteger-(listaqtavenduta.AsInteger+listaqtaprenota.AsInteger);
                  lista.post;
             end;
             Dprenotazioni.Delete;
          end;
     if (TprenotazioniStato.AsString = 'C') then
         while not Dprenotazioni.IsEmpty do
          begin
             Dprenotazioni.Delete;
          end;
     if (TprenotazioniStato.AsString = 'A') then
        while not Dprenotazioni.IsEmpty do
              Dprenotazioni.Delete;
     Tprenotazioni.Delete;
end;

procedure TPrenotazioni.FormActivate(Sender: TObject);
begin
    Dprenotazioni.Active := True;
    if Tprenotazioni.IsEmpty then
       ToolButton2.Enabled := False;
    Lista_Nozze.DSLista.Enabled := false;
    Tprenotazioni.First;
end;

procedure TPrenotazioni.TprenotazioniAfterDelete(DataSet: TDataSet);
begin
     if Tprenotazioni.IsEmpty then
       ToolButton2.Enabled := False
     else
         ToolButton2.Enabled := True;
end;

procedure TPrenotazioni.VendiExecute(Sender: TObject);
Var
 Genera_Bolla,
 Stampa            : Boolean;
 trovato : boolean ;
 articolo_etichetta : string ;
 tscontr : ttable ;
 TotL, TotE : currency ;
begin
     if Lista_Nozze.liste.State = DsEdit then
        Lista_Nozze.liste.Post ;
     if TprenotazioniStato.AsString = 'A' then
          if messagedlg('La prenotazione 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -