ผู้เขียน หัวข้อ: ต่อเนื่องจาก ค่รักษาพยาบาลเบิลอีกครั้ง (เว็บเดิม)  (อ่าน 4744 ครั้ง)

0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

ออฟไลน์ nahos

  • Hero Member
  • *****
  • กระทู้: 2,216
  • รพ.นาแห้ว
  • Respect: +7
    • ดูรายละเอียด
    • รพ.นาแห้ว
กระทู้เดิม

หลังจากที่ผมตรวจสอบโดยใช้  IPD Balance Check ที่อาจารย์ให้มาตรวจสอบ พบข้อความเตือนดังในภาพครับ

ขอคำแนะนำเพิ่มเติมด้วยครับ   ขอบคุณมาก ๆครับ
ถ้าำคำถามท่านได้คำตอบที่ต้องการจากอาจารย์ท่านใด กรุณากด Thank เบา ๆ ^ ถูกใจกด [applaud] ไม่ชอบใจกด[smite]
>> การโพสต์ขอรายงานที่ดี <<
อ่านซักนิด ถามยังไงให้ได้คำตอบ ? :)
วิธีแสดงตัวว่าเป็นใคร โดย อ.อ๊อด (ให้ข้อมูลว่าเป็นใคร ปฏิบัติงานที่ไหน ใช้ server อะไร OS อะไร HOsxp Vไหน)
ก่อนที่จะตั้งกระทู้ถาม ลองค้นจากกระทู้เก่าดูก่อนไหม จะได้คำตอบเร็วกว่าการรอคำตอบนะ
..........................................................................
เจษ จพ.เภสัชกรรมฯ user@ NAHAEO HOSPITAL LOEI. <br>  Supervise by DANSAI HOSPITAL LOEI. <br>
Start 01/03/2550
=> Server IBM X3200 Ram 6 Gb. OS:Cent OS 6.0  
=> Client 20 client  OS: SP2  => HosXP Version <b>3.56.11.19</b>
-----------------------------
น้ำเต็มแก้ว "การเรียนรู้ไม่มีที่สิ้นสุด"

ออฟไลน์ manoi

  • Hero Member
  • *****
  • กระทู้: 8,669
  • Respect: +170
    • ดูรายละเอียด
    • HOSxP Community Center
0
หากใช้ 2.49.8.12 แล้ว ให้เอา comment ตรงบรรทัดที่เขียนว่า resyncan ออกครับ

จาก
// resyncan
ให้เป็น
resyncan

แล้วลอง run ใหม่ check ตรง resyncan เอาไว้ด้วยครับ

หรือเอาตัวใหม่ไป run ก็ได้ครับ

โค๊ด: [Select]
Unit IPDIncomeBalanceCheck;
var Result_Text : Tstringlist;
   fm:tform;
   ListBox:TListBox;
   DoButton:TButton;
   CloseButton:TButton;
   Panel:TPanel;
   Label1,Label2:TLabel;
   DateEdit1,DateEdit2:TEdit;
   ClearIncithSummaryCheckBox:TCheckBox;
   ResyncANCheckBox:TCheckBox;
implementation



Procedure DoButtonClick;
var fcds:TClientDataset;
     rcds:TClientDataset;
     ocds:TClientDataSet;
begin
  Result_Text := TStringList.Create;

  ListBox.Items.clear;

  fcds:=TClientDataset.create(nil);
  rcds:=TClientDataset.create(nil);
  ocds:=TClientDataset.create(nil);
  fcds.data:=HOSxP_Getdataset('select a.an,o.vstdate, o.an,a.an,a.pttype,a.item_money,a.income ,sum(o.sum_price) as sum_price '+
   ' from an_stat a '+
    ' left outer join opitemrece o on o.an=a.an  '+
    ' where a.regdate between "'+dateedit1.text+'" and "'+dateedit2.text+'" and a.item_money <> a.income'+
    ' group by o.an order by a.an ');


  ListBox.Items.Add('Runing check date '+dateedit1.text+' - '+dateedit2.text);
  ListBox.items.Add('Record unbalance = '+inttostr(fcds.recordcount));

  if ClearIncithSummaryCheckBox.checked then
  begin
    ListBox.items.Add('Clear incoth_summary');
    fcds.first;
    while not fcds.eof do
    begin
    ocds.data:=HOSxp_Getdataset('select * from incith_summary where an="'+fcds.fieldbyname('an').asstring+'"');
    ocds.first;
    while not ocds.eof do ocds.delete;
    if ocds.changecount>0 then
    HOSxP_updatedelta(ocds.delta,'select * from incith_summary where an="'+fcds.fieldbyname('an').asstring+'"');
    fcds.next;
    end;
  end;

  if ResyncAnCheckBox.checked then
  begin
   ListBox.items.Add('Resync AN...');
   fcds.first;
   while not fcds.eof do
   begin
     ListBox.items.Add('Resync AN '+fcds.fieldbyname('an').asstring);
     resyncan(fcds.fieldbyname('an').asstring);
     fcds.next;
   end;

   fcds.data:=HOSxP_Getdataset('select a.an,o.vstdate, o.an,a.an,a.pttype,a.item_money,a.income ,sum(o.sum_price) as sum_price '+
   ' from an_stat a '+
    ' left outer join opitemrece o on o.an=a.an  '+
    ' where a.regdate between "'+dateedit1.text+'" and "'+dateedit2.text+'" and a.item_money <> a.income'+
    ' group by o.an order by a.an ');
  end;

  fcds.first;
  if fcds.recordcount=0 then ListBox.Items.add('No error found.');
  while not fcds.eof do
  begin
    ListBox.items.add('');
    ListBox.Items.Add('Investigating.... '+fcds.fieldbyname('an').asstring+' Income = '+fcds.fieldbyname('income').asstring+
      '  Item sum price = '+fcds.fieldbyname('sum_price').asstring);

    rcds.data:=HOSxP_GetDataset('select i.pttype,p.pcode,p.paidst from ipt i left outer join pttype p on p.pttype = i.pttype where i.an = "'+fcds.fieldbyname('an').asstring+'"');
    listBox.items.add('pttype = '+rcds.fieldbyname('pttype').asstring+' pcode = '+
      rcds.fieldbyname('pcode').asstring+' paidst = '+
      rcds.fieldbyname('paidst').asstring);

    rcds.data:=HOSxP_Getdataset('select r2.income as income,r2.paidst as paidst, sum(r2.rcptamt) as sp from rcpt_print r1,rcpt_print_detail r2 where r1.vn="'+fcds.fieldbyname('an').asstring+'" and r1.finance_number=r2.finance_number and r2.paidst in ("02") group by r2.income,r2.paidst');
    if rcds.recordcount=0 then ListBox.Items.add('>>No rcpt_detail adjustment') else
      ListBox.Items.add('>>Found rcpt_detail adjustment');
    rcds.data:=HOSxP_GetDataset('select r2.income as income,r2.paidst as paidst, sum(r2.rcptamt) as sp from rcpt_print r1,rcpt_print_detail r2 where r1.vn="'+fcds.fieldbyname('an').asstring+'" and r1.finance_number=r2.finance_number and r2.paidst in ("01","03") group by r2.income,r2.paidst');
    if rcds.recordcount=0 then ListBox.Items.Add('>>No rcpt_print') else
      ListBox.Items.Add('>>Found rcpt_print');
    rcds.data:=HOSxP_GetDataset('select income,paidst,sum(sum_price) as sp from opitemrece where an="'+fcds.fieldbyname('an').asstring+'" and paidst in ("01","03") group by income,paidst');
    if rcds.recordcount=0 then ListBox.Items.Add('>>No opitemrece data (paidst 01,03)') else
    begin
      ListBox.Items.Add('>>Found opitemrece data (paidst 01,03)');
      rcds.data:=HOSxP_GetDataset('select sum(sum_price) as sp from opitemrece where an="'+fcds.fieldbyname('an').asstring+'" and paidst in ("01","03") ');
      ocds.data:=HOSxP_GetDataset('select sum(rcptamt) as sp from incith where an="'+fcds.fieldbyname('an').asstring+'" and paidst in ("01","03") ');
      if rcds.fieldbyname('sp').asfloat=ocds.fieldbyname('sp').asfloat then
        ListBox.items.Add('>>> opitemrece data (paidst 01,03) = incith [normal]') else
        ListBox.items.Add('>>> opitemrece data (paidst 01,03) <> incith');
    end;

    rcds.data:=HOSxP_GetDataset('select r2.income as income,r2.paidst as paidst,sum(r2.rcptamt) as sp from rcpt_print r1,rcpt_print_detail r2 where r1.vn="'+fcds.fieldbyname('an').asstring+'" and r1.finance_number=r2.finance_number and r2.paidst = "04" group by r2.income,r2.paidst');

    if rcds.recordcount=0 then ListBox.Items.Add('>>No discount data') else
      ListBox.Items.Add('>>Found discount data');

    rcds.data:=HOSxP_GetDataset('select r2.income,sum(r2.amount) as sp from rcpt_arrear r1,rcpt_arrear_detail r2 where r1.vn="'+fcds.fieldbyname('an').asstring+'" and r1.arrear_id = r2.arrear_id and r1.paid<>"Y" group by r2.income');
    if rcds.recordcount=0 then ListBox.Items.Add('>>No arrear data') else
      ListBox.Items.Add('>>Found arrear data');

    rcds.data:=HOSxP_GetDataset('select * from incith_summary where an="'+fcds.fieldbyname('an').asstring+'" ');
    if rcds.recordcount=0 then ListBox.Items.Add('>>No manual summary data') else
    begin
      ListBox.Items.Add('>>Found manual summary data');
      ocds.data:=HOSxP_GetDataset('select sum(rcptamt) as cc from incith_summary where an="'+fcds.fieldbyname('an').asstring+'" ');
      ListBox.Items.Add('>>>manual summary amount = '+ocds.fieldbyname('cc').asstring);

    end;

    fcds.next;
  end;

  fcds.free;
  rcds.free;
  ocds.free;

  Result_Text.free;



end;

Procedure CloseButtonClick;
begin
  fm.close;
end;



Procedure Main;
var
  i:integer;


begin


  fm:=TForm.create(nil);
  fm.caption:='HOSxP IPD Income balance check version 0.1';
  fm.width:=700;
  fm.height:=500;
  fm.top:=100;
  fm.left:=100;


  Panel:=TPanel.create(fm);
  Panel.parent:=fm;
  Panel.caption:='';
  Panel.align:=altop;

  listbox:=tlistbox.create(fm);
  listbox.parent:=fm;
  listbox.align:=alclient;
  listbox.font.name:='Courier';
  listbox.font.size:=10;


  DoButton:=TButton.create(fm);
  DoButton.parent:=Panel;
  Dobutton.top:=5;
  DoButton.left:=10;
  DoButton.width:=120;
  DoButton.caption:='Run Check';
  DoButton.onclick:=DoButtonClick;

  CloseButton:=TButton.create(fm);
  CloseButton.parent:=Panel;
  CloseButton.left:=620;
  closebutton.width:=50;
  CloseButton.top:=5;
  CloseButton.caption:='Close';
  CloseButton.onclick:=CloseButtonClick;

  Label1:=TLabel.create(fm);
  Label1.parent:=panel;
  Label1.caption:='Begin Date';
  label1.left:=140;
  Label1.top:=9;

  DateEdit1:=TEdit.create(fm);
  DateEdit1.parent:=panel;
  DateEdit1.left:=200;
  DateEdit1.top:=5;
  DateEdit1.Text:='2005-06-01';
  DateEdit1.width:=70;

  Label2:=TLabel.create(fm);
  Label2.parent:=panel;
  Label2.caption:='End Date';
  label2.left:=280;
  Label2.top:=9;

  DateEdit2:=TEdit.create(fm);
  DateEdit2.parent:=panel;
  DateEdit2.left:=330;
  DateEdit2.top:=5;
  DateEdit2.Text:='2005-06-01';
  DateEdit2.width:=70;

  ResyncANCheckBox:=TCheckBox.create(fm);
  ResyncANCheckBox.parent:=panel;
  ResyncANCheckBox.left:=420;
  ResyncANCheckBox.top:=5;
  ResyncAnCheckBox.caption:='Resync AN';

  ClearIncithSummaryCheckBox:=TCheckBox.create(fm);
  ClearIncithSummaryCheckBox.parent:=panel;
  ClearIncithSummaryCheckBox.left:=500;
  ClearIncithSummaryCheckBox.top:=5;
  ClearIncithSummaryCheckBox.width:=120;

  ClearIncithSummaryCheckBox.caption:='Clear incith_summary';

  fm.showmodal;
  fm.free;



end;





end.



HOSxP Project Manager / Cheif Developer / BMS MD

ออฟไลน์ manoi

  • Hero Member
  • *****
  • กระทู้: 8,669
  • Respect: +170
    • ดูรายละเอียด
    • HOSxP Community Center
0
ได้ผลอย่างไรบ้างครับ  8)
HOSxP Project Manager / Cheif Developer / BMS MD

ออฟไลน์ nahos

  • Hero Member
  • *****
  • กระทู้: 2,216
  • รพ.นาแห้ว
  • Respect: +7
    • ดูรายละเอียด
    • รพ.นาแห้ว
0
พึ่งจะดาวน์โหลด 8.12 เสร็จ เมื่อกี้ครับ


และลองทดสอบดูแล้ว error ลดลงจาก 109 เหลือ 84 ราย

เท่าที่สังเกต พบว่าที่โปรแกรมแก้ไขได้ จะยังไม่ชำระเงิน 
แต่รายการที่แก้ไขไม่ได้คือรายการที่มีการชำระเงินที่ห้องการเงินครับ


แต่ก็ขอบคุณมาก ๆ ครับผ้ม

ปล. ขณะอัพเกรดเป็น 8.12 พบว่ามีตารางเพิ่มขึ้นมาอีกหลายตารางพอสมควร ไม่ทราบว่าต้องไปตั้งค่าอะไรเพิ่มเติมไหมครับ


ถ้าำคำถามท่านได้คำตอบที่ต้องการจากอาจารย์ท่านใด กรุณากด Thank เบา ๆ ^ ถูกใจกด [applaud] ไม่ชอบใจกด[smite]
>> การโพสต์ขอรายงานที่ดี <<
อ่านซักนิด ถามยังไงให้ได้คำตอบ ? :)
วิธีแสดงตัวว่าเป็นใคร โดย อ.อ๊อด (ให้ข้อมูลว่าเป็นใคร ปฏิบัติงานที่ไหน ใช้ server อะไร OS อะไร HOsxp Vไหน)
ก่อนที่จะตั้งกระทู้ถาม ลองค้นจากกระทู้เก่าดูก่อนไหม จะได้คำตอบเร็วกว่าการรอคำตอบนะ
..........................................................................
เจษ จพ.เภสัชกรรมฯ user@ NAHAEO HOSPITAL LOEI. <br>  Supervise by DANSAI HOSPITAL LOEI. <br>
Start 01/03/2550
=> Server IBM X3200 Ram 6 Gb. OS:Cent OS 6.0  
=> Client 20 client  OS: SP2  => HosXP Version <b>3.56.11.19</b>
-----------------------------
น้ำเต็มแก้ว "การเรียนรู้ไม่มีที่สิ้นสุด"

ออฟไลน์ nahos

  • Hero Member
  • *****
  • กระทู้: 2,216
  • รพ.นาแห้ว
  • Respect: +7
    • ดูรายละเอียด
    • รพ.นาแห้ว
0
อ.ครับผมหากระทู้นี้ที่เว็บบอร์ดเดิมไม่เจอ
นั่งค้นนั่งไล่อยู่ 2 ชั่วโมง ไม่ทราบว่าได้ลบข้อมูลที่เว็บเดิมบ้างไหมครับ
ถ้าำคำถามท่านได้คำตอบที่ต้องการจากอาจารย์ท่านใด กรุณากด Thank เบา ๆ ^ ถูกใจกด [applaud] ไม่ชอบใจกด[smite]
>> การโพสต์ขอรายงานที่ดี <<
อ่านซักนิด ถามยังไงให้ได้คำตอบ ? :)
วิธีแสดงตัวว่าเป็นใคร โดย อ.อ๊อด (ให้ข้อมูลว่าเป็นใคร ปฏิบัติงานที่ไหน ใช้ server อะไร OS อะไร HOsxp Vไหน)
ก่อนที่จะตั้งกระทู้ถาม ลองค้นจากกระทู้เก่าดูก่อนไหม จะได้คำตอบเร็วกว่าการรอคำตอบนะ
..........................................................................
เจษ จพ.เภสัชกรรมฯ user@ NAHAEO HOSPITAL LOEI. <br>  Supervise by DANSAI HOSPITAL LOEI. <br>
Start 01/03/2550
=> Server IBM X3200 Ram 6 Gb. OS:Cent OS 6.0  
=> Client 20 client  OS: SP2  => HosXP Version <b>3.56.11.19</b>
-----------------------------
น้ำเต็มแก้ว "การเรียนรู้ไม่มีที่สิ้นสุด"