Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 20th November 2011
Darkc0der Darkc0der is offline
Ceriwiser
 
Join Date: Nov 2011
Posts: 598
Rep Power: 14
Darkc0der mempunyai hidup yang Normal
Default [butuh pencerahan] hitung keterlambatan pembayaran kredit (delphi7)

ceritanya ane pengen buat program tentang pembelian barang secara kredit..



nah sekarang ane sudah berhasil untuk membuat form transaksinya..

dan skarang lagi buat form [b]pembayaran kredit/B]



disini ada permasalah tentang menentukan berapa hari keterlabatan



misal : tgl_trans = 4 januari 2011

terus semestinya kan dia bayar kredit pertama tgl 4 februari 2011...

klo dia bayar tgl 10 februari kan bisa dengan pemisahan dd/mm/yyyy ..

tapi klo dia transaksi tgl 29 januari 2011 dan bayar 4 maret 2011 ...



gimana jadi solusinya dengan menggunakan borland delphi..

mohon bantuannya, baik berupa logika nya , sukur2 ada contoh nya..



nih yg udah coba saya buat..




PHP Code:




procedure TF_Kredit.btncektelatClick(Sender: TObject);

var

telatbln,telattahun:integer;

bulantrans,bulanbayar,tahun1,tahun2:string;

a,b,c,d,e,f,x:string;

begin

bulantrans
:=MidStr(DateToStr(DateTimePicker1.Date),4,2);

if
LeftStr(bulantrans,1)='0' then

begin

bulantrans
:=RightStr(bulantrans,1);

ShowMessage(bulantrans);

end

else

begin

ShowMessage
(bulantrans);

end;



tahun1:=RightStr(DateToStr(DateTimePicker1.date),4);

tahun2:=RightStr(DateToStr(DateTimePicker2.date),4);





bulanbayar:=MidStr(DateToStr(DateTimePicker2.Date),4,2);

if
LeftStr(bulanbayar,1)='0' then

begin

bulanbayar
:=RightStr(bulanbayar,1);

ShowMessage(bulanbayar);

end

else

begin

ShowMessage
(bulanbayar);

end;





telatbln:=0;





if (
StrToInt(bulanbayar)-StrToInt(bulantrans))=0 then

begin

telatbln
:=-30;

end

else

if (
StrToInt(bulanbayar)-StrToInt(bulantrans))=1 then

begin

telatbln
:=0;

end

else

if (
StrToInt(bulanbayar)-StrToInt(bulantrans))=2 then

begin

telatbln
:=30;

end

else

if (
StrToInt(bulanbayar)-StrToInt(bulantrans))=3 then

begin

telatbln
:=60;

end

else

if (
StrToInt(bulanbayar)-StrToInt(bulantrans))=4 then

begin

telatbln
:=90;

end;



a:=LeftStr(DateToStr(DateTimePicker1.Date),3); //tgl date 1

b:=MidStr(DateToStr(DateTimePicker2.Date),4,3); //bulan date 2

c:=RightStr(DateToStr(DateTimePicker2.Date),4); //tahun date 2

d:=a+b+c;

x:=VarToStr(ceil(StrToDate(d) - DateTimePicker1.Date));

f:=x;

e:=VarToStr(ceil(DateTimePicker2.Date-DateTimePicker1.Date));

edttelat.Text:=IntToStr((StrToInt(e)-StrToInt(f)+telatbln));

end;











Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


 


All times are GMT +7. The time now is 02:56 AM.


no new posts