1

(6 replies, posted in General)

Hi  Derek, you can try disabling ToolBar3.styles = False, like the image I sent.

2

(6 replies, posted in SQL queries)

thanks you sparrow and Derek, excelent

3

(6 replies, posted in SQL queries)

I am creating a ledger with a running balance, therefore I cannot use the debit - credit formula.
for running balance i use this query:

-- Baris Saldo Awal
SELECT 
  a.kode_akun AS Kode_Akun,
  a.nama_akun AS Nama_Akun,
  strftime('%d', date({DateTimePicker1}, '-1 day')) || ' ' ||
        CASE strftime('%m', date({DateTimePicker1}, '-1 day'))
            WHEN '01' THEN 'Jan'                                        
            WHEN '02' THEN 'Feb'
            WHEN '03' THEN 'Mar'         
            WHEN '04' THEN 'Apr'
            WHEN '05' THEN 'Mei'                
            WHEN '06' THEN 'Jun'
            WHEN '07' THEN 'Jul'
            WHEN '08' THEN 'Agt'
            WHEN '09' THEN 'Sep'
            WHEN '10' THEN 'Okt'
            WHEN '11' THEN 'Nov'
            WHEN '12' THEN 'Des'
        END || ' ' || strftime('%Y', date({DateTimePicker1}, '-1 day')) AS Tanggal,
  'Saldo Awal' AS Deskripsi,
  CAST(0 AS NUMERIC) AS Total_Debet,
  CAST(0 AS NUMERIC) AS Total_Kredit,

  IFNULL((
    SELECT SUM(CASE 
      WHEN td2.posisi = 'Debet' THEN td2.jumlah 
      ELSE -td2.jumlah 
    END)
    FROM transaksi_detail td2 
    JOIN transaksi t2 ON td2.id_transaksi = t2.id
    WHERE td2.id_akun = a.id
      AND t2.tanggal < {DateTimePicker1}
  ), 0) AS Saldo_Berjalan,
  0 AS urutan_sorting

FROM akun a
WHERE a.id = {ComboBox1}

UNION ALL

-- Transaksi Normal
SELECT 
  a.kode_akun AS Kode_Akun,
  a.nama_akun AS Nama_Akun,
  strftime('%d', t.tanggal) || ' ' ||
        CASE strftime('%m', t.tanggal)
            WHEN '01' THEN 'Jan'
            WHEN '02' THEN 'Feb'
            WHEN '03' THEN 'Mar'         
            WHEN '04' THEN 'Apr'
            WHEN '05' THEN 'Mei'
            WHEN '06' THEN 'Jun'
            WHEN '07' THEN 'Jul'
            WHEN '08' THEN 'Agt'
            WHEN '09' THEN 'Sep'
            WHEN '10' THEN 'Okt'
            WHEN '11' THEN 'Nov'
            WHEN '12' THEN 'Des'
        END || ' ' || strftime('%Y', t.tanggal) AS Tanggal,
  t.deskripsi AS Deskripsi,
  SUM(CASE WHEN td.posisi = 'Debet' THEN td.jumlah ELSE 0 END) AS Total_Debet,
  SUM(CASE WHEN td.posisi = 'Kredit' THEN td.jumlah ELSE 0 END) AS Total_Kredit,
  (
    SELECT SUM(CASE 
      WHEN td2.posisi = 'Debet' THEN td2.jumlah                
      ELSE -td2.jumlah 
    END)
    FROM transaksi_detail td2                               
    JOIN transaksi t2 ON td2.id_transaksi = t2.id
    WHERE td2.id_akun = a.id
      AND (t2.tanggal < t.tanggal OR (t2.tanggal = t.tanggal AND t2.id <= t.id))
  ) AS Saldo_Berjalan,                   
  t.tanggal AS urutan_sorting

FROM transaksi_detail td
JOIN transaksi t ON td.id_transaksi = t.id
JOIN akun a ON td.id_akun = a.id
WHERE a.id = {ComboBox1}
  AND t.tanggal BETWEEN {DateTimePicker1} AND {DateTimePicker2} 
  AND a.id_status_akun = 1  -- hanya akun aktif 
GROUP BY a.kode_akun, a.nama_akun, a.id, t.tanggal, t.deskripsi, t.id
                                           
ORDER BY urutan_sorting ASC;

This is Running Balance:

  (
    SELECT SUM(CASE 
      WHEN td2.posisi = 'Debet' THEN td2.jumlah                
      ELSE -td2.jumlah 
    END)
    FROM transaksi_detail td2                               
    JOIN transaksi t2 ON td2.id_transaksi = t2.id
    WHERE td2.id_akun = a.id
      AND (t2.tanggal < t.tanggal OR (t2.tanggal = t.tanggal AND t2.id <= t.id))
  ) AS Saldo_Berjalan

4

(6 replies, posted in SQL queries)

this is solution, and Done

procedure FrmBukuBesar_TableGrid1_OnChange(Sender: TObject);
var
  i: Integer;
  Debet, Kredit, Hasil: double;

  LastRow: Integer;
  ColumnValue: string;
begin
  for i := 4 to 5 do
  begin
    if FrmBukuBesar.TableGrid1.Columns[i] is TNxNumberColumn then
    begin
      with TNxNumberColumn(FrmBukuBesar.TableGrid1.Columns[i]) do
      begin
        FormatMask := '###,##0';
        Footer.FormatMask := '###,##0';
        Footer.FormulaKind := fkSum;
        end;
    end;
  end;

  with TNxNumberColumn(FrmBukuBesar.TableGrid1.Columns[6]) do
  begin
    FormatMask := '###,##0';
  end;

  if FrmBukuBesar.TableGrid1.RowCount > 1 then
  begin
    LastRow := FrmBukuBesar.TableGrid1.RowCount - 1;
    ColumnValue := FrmBukuBesar.TableGrid1.Cells[6, LastRow];

    if FrmBukuBesar.TableGrid1.Columns.Count > 6 then
    begin
      FrmBukuBesar.TableGrid1.Columns[6].Footer.Caption := ColumnValue;
      FrmBukuBesar.TableGrid1.Refresh;
    end
    else
      ShowMessage('Kolom ke-6 tidak ditemukan');
  end
  else
    ShowMessage('Tidak ada data di TableGrid1');

  FrmBukuBesar.TableGrid1.CalculateFooter;
  FrmBukuBesar.TableGrid1.Columns[7].Visible := False;
end;

5

(6 replies, posted in SQL queries)

please help me fix this procedure, to generate column 6 footer value from last ROW column 6 value

procedure FrmBukuBesar_TableGrid1_OnChange(Sender: TObject);
var
  i: Integer;
  Debet, Kredit, Hasil: double;
begin
  // Format dan hitung total untuk kolom Debet dan Kredit
  for i := 4 to 5 do
  begin
    if FrmBukuBesar.TableGrid1.Columns[i] is TNxNumberColumn then
    begin
      with TNxNumberColumn(FrmBukuBesar.TableGrid1.Columns[i]) do
      begin
        FormatMask := '###,##0';
        Footer.FormatMask := '###,##0';
        Footer.FormulaKind := fkSum;
        FrmBukuBesar.TableGrid1.CalculateFooter;
        end;
    end;
  end;

  // Hitung saldo akhir = Debet - Kredit
  //Debet := FrmBukuBesar.TableGrid1.Columns[4].Footer.FormulaValue;
  //Kredit := FrmBukuBesar.TableGrid1.Columns[5].Footer.FormulaValue;
  //Hasil  := Debet - kredit;
  //FrmBukuBesar.TableGrid1.Columns[6].Footer.Caption := FloatToStr(Hasil);

  with TNxNumberColumn(FrmBukuBesar.TableGrid1.Columns[6]) do
  begin
    FormatMask := '###,##0';
    Footer.FormatMask := '###,##0';
    Footer.FormulaKind := fkNone;
    Footer.FormulaValue := Debet - Kredit;
  end;

  // Kalkulasi ulang footer dan sembunyikan kolom ke-7
  FrmBukuBesar.Edit1.Value := Debet;

  FrmBukuBesar.TableGrid1.CalculateFooter;
  FrmBukuBesar.TableGrid1.Columns[7].Visible := False;
end;

6

(8 replies, posted in Reports)

Hi IgorMad, maybe you need to try this code:

strftime('%d.%m.%Y %H:%M:%S', InvoiceDate) 

Result: : 07.06.2025 14:23:55

OR

strftime('%d.%m.%Y %I:%M %p', InvoiceDate)

Result: 07.06.2025 02:23 PM

7

(16 replies, posted in General)

in calculate field  file Type  choose type (TEXT)  don.t CURRENCY

8

(16 replies, posted in General)

I send fixed file  your project

9

(9 replies, posted in Reports)

you make code in fastreport like this.

procedure Memo17OnBeforePrint(Sender: TfrxComponent);
begin
   Memo17.Text := ReportTableOrdersLetters.Text; 
end;

i share invoice.fr3.. you can replace

10

(16 replies, posted in General)

the result like this  315.00

11

(16 replies, posted in General)

You try chose Field type (TEXT)  in CfTotal  not Real

12

(2 replies, posted in General)

try look this discussion in: https://myvisualdatabase.com/forum/sear … 1106052046

13

(9 replies, posted in Reports)

Sparrow, Thanks for your attention,  I have Bonus from you. God Bless You

14

(9 replies, posted in Reports)

Thank you Sparrow, I have successfully followed the example you made.

15

(9 replies, posted in Reports)

I try to give my small project so that my intention for this application can be understood. Please help me with my difficulties, thank you.

16

(7 replies, posted in General)

Thank you, I have found the link from the example given by Demitry, namely invoice with record count and year and my problem has been resolved properly.
https://myvisualdatabase.com/forum/view … 7333#p7333

17

(7 replies, posted in General)

Hi, I want solution about code number too.
How to make the number automatically follow the current year 2025 by adding 2025-001, 2025-002 and so on, if the year changes 2026 then the addition starts from 2026-001, 2026-002  etc..
2025-001
2025-002
2025-003
2025-004
2025-005
2025-006
2025-007
2025-008
2025-009
2025-010

2026-001
2026-002
2026-003
2026-004
2026-005
2026-006
2026-007
2026-008
2026-009
2026-010

thanks you

18

(9 replies, posted in Reports)

thank you Sparrow,

How do I create a graph based on age category in the application that I have shared? which I can display in the form or in fastreport? here I share the graph image

19

(9 replies, posted in Reports)

hello sparrow, I need you to help me to make chart in form and report about total datawarga.kategoriusia (calculatefield) in one church. And one again, when i update datawarga.foto  the foto can't deleted from folder photo.
i share my project in mediafire. i am thank you so much.

https://www.mediafire.com/file/k6thwbzk … c.rar/file

20

(1 replies, posted in General)

How can I make the sqlite update results from the sqlitestudio 3.4.5 application readable on MVD?

Sparrow,  Thanks Verry much. app  Done.

Thank you, my problem has been resolved well

Hi Sparrow, I'm having difficulty placing variables for the printout script.

Here are the variables I have:

('{EDIT10}') AS direktur,
('{EDIT11}') AS manajerkeuangan,
('{EDIT13}') AS kabagkeuangan, 
('{EDIT14}') AS kabagumum, 

('{EDIT2}') AS bulan,
('{EDIT5}') AS tahun,
('{EDIT7}') AS tanggal,
('{EDIT19}') AS ddmmyyyy,

if placed in the following script:

SELECT distinct 
"$autoinc",                         
  TRIM(ifnull(employees.firstname||' ','')||ifnull(employees.lastname,'')) as Nama,                                 
  jabatan.jabatan as Jabatan,
  pangkat.pangkat as Pangkat,                        
  unitkerja.unitkerja as UnitKerja,                                                
  statuskeluarga.statuskeluarga as Status_keluarga,
  statuspegawai.statuspegawai as Status_pegawai,
  gajipokok as GajiPokok,                         
  tarip as Tarip,            
  irja as IRJA,                                                   
  Tkj as TKJ,                                                            
  pajak as Pajak,
  khspajak as KhsPajak,                  
  Keluarga as Tunj_Keluarga,   
  Sandangpangan as SandangPangan,  
  
  kreditbank,
  kreditkoperasi,
  bpjsKerja,
  bpjsKesehatan,
  pensiun, 
  pemakaianair,
  Koperasi,  
                                                                  
  a.harikerja as HariKerja,
  Hadir,
  Alpha,      
  sakit,                                                                               
  IjinCuti, 
  Terlambat,
  SanksiDisiplin,
  Lembur,
  uanglembur,
  transport,              
  perusahaan,
  bruto,
  GajiKotor,
  potongan,
  TerimaBersih
  
FROM (SELECT id_employees,                                                       
        harikerja, SUM(hadir) as Hadir, SUM(alpha) as Alpha, SUM(sakit) as sakit, SUM(ijincuti) as IjinCuti, 
        SUM(terlambat) as Terlambat, (SUM(sanksiapel) + SUM(sanksiterlambat)) as SanksiDisiplin, SUM(lembur) as Lembur, SUM(uanglembur) as UangLembur, 
        SUM(transport)as Transport, SUM(perusahaan)as Perusahaan,   
        ((select gajipokok from employees where id = id_employees) + (select irja from employees where id = id_employees) + 
        (select tkj from employees where id = id_employees) + (select khspajak from employees where id = id_employees) + 
        (select khspajak from employees where id = id_employees) + (select keluarga from employees where id = id_employees) + 
        (select sandangpangan from employees where id = id_employees)+ SUM(uanglembur) + SUM(transport) + SUM(perusahaan) - 
        (select pajak from employees where id = id_employees)) as bruto,   
        
        ((select gajipokok from employees where id = id_employees) + (select irja from employees where id = id_employees) + 
        (select tkj from employees where id = id_employees) + (select khspajak from employees where id = id_employees) + 
        (select khspajak from employees where id = id_employees) + (select keluarga from employees where id = id_employees) + 
        (select sandangpangan from employees where id = id_employees)+ SUM(uanglembur) + SUM(transport) + SUM(perusahaan) ) as GajiKotor,
        
        ((select kreditbank from employees where id = id_employees) + (select kreditkoperasi from employees where id = id_employees) + 
        (select bpjsKerja from employees where id = id_employees) + (select bpjsKesehatan from employees where id = id_employees) + 
        (select pensiun from employees where id = id_employees) + (select pemakaianair from employees where id = id_employees) + 
        (select Koperasi from employees where id = id_employees) + SUM(sanksiapel) + SUM(sanksiterlambat) ) as Potongan, 
        
        (((select gajipokok from employees where id = id_employees) + (select irja from employees where id = id_employees) + 
        (select tkj from employees where id = id_employees) + (select khspajak from employees where id = id_employees) + 
        (select khspajak from employees where id = id_employees) + (select keluarga from employees where id = id_employees) + 
        (select sandangpangan from employees where id = id_employees)+ SUM(uanglembur) + SUM(transport) + SUM(perusahaan) - 
        (select pajak from employees where id = id_employees)) -
        ((select kreditbank from employees where id = id_employees) + (select kreditkoperasi from employees where id = id_employees) + 
        (select bpjsKerja from employees where id = id_employees) + (select bpjsKesehatan from employees where id = id_employees) + 
        (select pensiun from employees where id = id_employees) + (select pemakaianair from employees where id = id_employees) + 
        (select Koperasi from employees where id = id_employees) + SUM(sanksiapel) + SUM(sanksiterlambat) ) ) as TerimaBersih
                         
                                                   
      FROM attendancedays          
      WHERE date(attendancedays.date) >= date({datetimepicker1})                                                                                                                
            AND date(attendancedays.date) <= date({datetimepicker2})             
      GROUP BY harikerja, id_employees) as a                       
      
      
   LEFT JOIN employees on a.id_employees = employees.id    
   LEFT JOIN unitkerja on employees.id_unitkerja = unitkerja.id
   LEFT JOIN jabatan on jabatan.id = employees.id_jabatan 
   left outer join statuspegawai on statuspegawai.id   =   employees.id_statuspegawai  
   left outer join statuskeluarga on statuskeluarga.id = employees.id_statuskeluarga  
   left outer join pangkat on pangkat.id   =   employees.id_pangkat  
   left outer join active on active.id   =   employees.id_active  
   
    WHERE employees.id_active  = 1  
        AND employees.id_statuspegawai = 2   
        
ORDER BY unitkerja.id asc

thanks you

Sparrow, I thank you so much..  there scrip perfect and run well.
You are excelent

Sparrow, I am thanks you for your sql query, but i try search startdate 26/09/2024 - 25/10/24 result 7 employees only should be 39 employees.
maybe you can try again?