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

📄 pnota_u.~pa

📁 Mosaic ERP大型系统 v6.09.rar
💻 ~PA
字号:
unit pnota_u;

interface

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

type
  TPrimanota = class(TForm)
    ToolBar1: TToolBar;
    ToolButton1: TToolButton;
    ActionList1: TActionList;
    Chiudi: TAction;
    dsnota: TDataSource;
    GrigliaPrimaNota: TDBGridEh;
    ToolButton2: TToolButton;
    Stampa: TAction;
    PrimaNota: TppBDEPipeline;
    primanota_report: TppReport;
    Modifica_primanota: TppDesigner;
    Imposta: TAction;
    ToolButton3: TToolButton;
    Nuovo: TAction;
    ToolButton4: TToolButton;
    ppHeaderBand1: TppHeaderBand;
    ppLabel1: TppLabel;
    ppSystemVariable1: TppSystemVariable;
    ppSystemVariable2: TppSystemVariable;
    ppLabel2: TppLabel;
    ppLabel6: TppLabel;
    ppLabel7: TppLabel;
    ppLabel8: TppLabel;
    ppLabel9: TppLabel;
    ppLabel11: TppLabel;
    ppLabel3: TppLabel;
    ppLabel5: TppLabel;
    ppLabel10: TppLabel;
    ppLabel12: TppLabel;
    ppLabel13: TppLabel;
    ppLabel14: TppLabel;
    ppLabel15: TppLabel;
    ppLabel16: TppLabel;
    ppLabel17: TppLabel;
    ppDetailBand1: TppDetailBand;
    ppDBText1: TppDBText;
    ppDBText7: TppDBText;
    ppDBText8: TppDBText;
    ppLine1: TppLine;
    ppDBMemo1: TppDBMemo;
    ppDBText2: TppDBText;
    ppDBText4: TppDBText;
    ppDBText5: TppDBText;
    ppDBText6: TppDBText;
    ppDBText10: TppDBText;
    ppDBText11: TppDBText;
    ppDBText12: TppDBText;
    ppSummaryBand1: TppSummaryBand;
    ppLabel4: TppLabel;
    ppDBCalc1: TppDBCalc;
    ppDBCalc2: TppDBCalc;
    ppDBText3: TppDBText;
    ppDBCalc3: TppDBCalc;
    ppDBCalc4: TppDBCalc;
    ppDBText9: TppDBText;
    ppDBCalc5: TppDBCalc;
    ppDBCalc6: TppDBCalc;
    ppDBText13: TppDBText;
    Panel1: TPanel;
    Label1: TLabel;
    Label2: TLabel;
    dal: TDateTimePicker;
    al: TDateTimePicker;
    Filtra: TCheckBox;
    Totali: TAction;
    Elimina: TAction;
    ToolButton6: TToolButton;
    Modifica: TAction;
    ToolButton7: TToolButton;
    Conferma: TAction;
    Su: TAction;
    Giu: TAction;
    ToolButton9: TToolButton;
    ToolButton10: TToolButton;
    ppLabel18: TppLabel;
    ppLabel19: TppLabel;
    ppLabel20: TppLabel;
    ppLabel21: TppLabel;
    ppDBText14: TppDBText;
    ppDBText15: TppDBText;
    ppDBText16: TppDBText;
    ppDBCalc7: TppDBCalc;
    ppDBCalc8: TppDBCalc;
    ppDBText17: TppDBText;
    Rinumera: TAction;
    QPnota: TQuery;
    ToolButton5: TToolButton;
    Aiuto: TAction;
    procedure ChiudiExecute(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure ImpostaExecute(Sender: TObject);
    procedure StampaExecute(Sender: TObject);
    procedure NuovoExecute(Sender: TObject);
    procedure FiltraClick(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure dalChange(Sender: TObject);
    procedure TotaliExecute(Sender: TObject);
    procedure EliminaExecute(Sender: TObject);
    procedure Modifica_primanotaCustomSaveDoc(Sender: TObject);
    procedure ModificaExecute(Sender: TObject);
    procedure ConfermaExecute(Sender: TObject);
    procedure SuExecute(Sender: TObject);
    procedure GiuExecute(Sender: TObject);
    procedure RinumeraExecute(Sender: TObject);
    procedure AiutoExecute(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Primanota: TPrimanota;

implementation

uses scade_mod, ana_mod, Umenu, pagamenti_u;

{$R *.DFM}

procedure TPrimanota.ChiudiExecute(Sender: TObject);
begin
     release ;
end;

procedure TPrimanota.FormCreate(Sender: TObject);
var

   I : Integer ;
begin
     Dal.Date := Now ;
     Al.Date := Now ;
     With ModuloDatiScadenziario do
      begin
       TTconti.First ;
       i := 3 ;
       While not TTconti.eof do
        begin
         If TTContiDescrizione.asString <> '' then
          begin
           GrigliaPrimaNota.Columns[i].Title.Caption := 'ENT.'+TTcontiDescrizione.AsString ;
           GrigliaPrimaNota.Columns[i+1].Title.Caption := 'USC.'+TTcontiDescrizione.AsString ;
           GrigliaPrimaNota.Columns[i+2].Title.Caption := 'SAL.'+TTcontiDescrizione.AsString ;
          end
         else
          begin
           GrigliaPrimaNota.Columns[i].Visible := false ;
           GrigliaPrimaNota.Columns[i+1].Visible := false ;
           GrigliaPrimaNota.Columns[i+2].Visible := false ;
          end ;
         TTConti.next ;
         Inc(i,3) ;
        end ;
       TTTPnota.Last ;
      end ;
end;

procedure TPrimanota.ImpostaExecute(Sender: TObject);
VAr
   Nome_Report : string ;

begin
     Nome_report := '' ;
     If ModuloDatiAnagrafiche.LeggiChiave('Layout primanota',nome_report) then
       begin
        If FileExists(nome_report) then
         begin
          primanota_report.Template.filename := nome_report ;
          primanota_report.Template.LoadFromFile ;
         end ;
       end ;
     Modifica_primanota.show ;

end;

procedure TPrimanota.StampaExecute(Sender: TObject);
Var
   nome_report : string ;
begin
     Nome_report := '' ;
     If ModuloDatiAnagrafiche.LeggiChiave('Layout primanota',nome_report) then
       begin
        If FileExists(nome_report) then
         begin
          Primanota_report.Template.filename := nome_report ;
          Primanota_report.Template.LoadFromFile ;
         end ;
       end ;
     primanota_report.Print ;

end;

procedure TPrimanota.NuovoExecute(Sender: TObject);
begin
     ModuloDatiScadenziario.TTTpnota.Insert ;
     Pagamenti_form := TPagamenti_Form.Create(self) ;
     Pagamenti_form.ShowModal ;
end;

procedure TPrimanota.FiltraClick(Sender: TObject);
Var
 dalS,alS : string ;

begin
    dalS := ModuloDatiScadenziario.MilleniumBugStr(dal.date) ;
    alS := ModuloDatiScadenziario.MilleniumBugStr(al.date) ;
     With ModuloDatiScadenziario do
      begin
       TTTPnota.Filtered := False ;
       TTTPnota.Filter := 'Data>=''' + dalS + ''' and Data<=''' + alS +'''';
       TTTPnota.Filtered := Filtra.Checked ;
      end ;

end;

procedure TPrimanota.FormClose(Sender: TObject; var Action: TCloseAction);
begin
     ModuloDatiScadenziario.TTTpnota.Filtered := False ;
end;

procedure TPrimanota.dalChange(Sender: TObject);
begin
     Filtra.Checked := False ;
     ModuloDatiScadenziario.TTTpnota.Filtered := False ;
end;

procedure TPrimanota.TotaliExecute(Sender: TObject);
begin
 Totali.Checked := not Totali.Checked ;
 GrigliaPrimaNota.SumList.Active := Totali.Checked ;
 If Totali.Checked then
  GrigliaPrimaNota.FooterRowCount := 1
 else
  GrigliaPrimaNota.FooterRowCount := 0 ;
end;

procedure TPrimanota.EliminaExecute(Sender: TObject);
begin
 If MessageDlg('Attenzione, eliminare la riga di prima nota selezionata ?',MtConfirmation,[mbYes,mbNo],0) = mrYes then
  with ModuloDatiScadenziario.TTTpnota do
   Delete ;
end;

procedure TPrimanota.Modifica_primanotaCustomSaveDoc(Sender: TObject);
begin
     ModuloDatiAnagrafiche.ScriviChiave('Layout primanota',primanota_report.Template.Filename) ;
     primanota_report.Template.SaveToFile ;
end;

procedure TPrimanota.ModificaExecute(Sender: TObject);
begin
 Pagamenti_form := TPagamenti_Form.Create(self) ;
 Pagamenti_form.ShowModal ;
 Pagamenti_form.Free ;
end;

procedure TPrimanota.ConfermaExecute(Sender: TObject);
begin
 with ModuloDatiScadenziario do
  If (TTTPnota.State = dsInsert) or
     (TTTPnota.State = dsEdit) then
     TTTPnota.Post ;

end;

procedure TPrimanota.SuExecute(Sender: TObject);
begin
 moduloDatiScadenziario.SpostaRigaPnota(-1) ;
end;

procedure TPrimanota.GiuExecute(Sender: TObject);
begin
 moduloDatiScadenziario.SpostaRigaPnota(+1);
end;

procedure TPrimanota.RinumeraExecute(Sender: TObject);
var
 Pnota : TTable ;
 i,fc : integer ;

begin
 If MessageDlg('Operazione irreversibile, proseguire ?',mtConfirmation,[mbYes,mbNo],0) =mrYes then
  begin
   Pnota := TTable.Create(self) ;
   Pnota.DatabaseName := 'euro2000' ;
   Pnota.TableName := 'TPnota.db' ;
   Pnota.Open ;
   i := 1 ;
   Qpnota.Open ;
   While not Pnota.IsEmpty do Pnota.Delete ;
   While Not Qpnota.Eof do
    begin
     Pnota.Insert ;
     for fc := 0 to Pnota.FieldCount - 1  do
      Pnota.Fields[fc].Value := QPnota.Fields[fc].Value ;
     Pnota.FieldByName('Registrazione').Value := i ;
     Pnota.Post ;
     Qpnota.Next;
     inc(i) ;
    end ;
   Pnota.Close ;
   Pnota.Free ;
   Qpnota.Close;
   ShowMessage('Rinumerazione completata !') ;
   ModuloDatiScadenziario.TTTpnota.Refresh ;
  end ;
end;

procedure TPrimanota.AiutoExecute(Sender: TObject);
begin
     menu_form.Aiuto('manuale.pdf',56) ;
end;

end.

⌨️ 快捷键说明

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