dh-hos / dhg.hospitalsecondstore

1 stars 0 forks source link

Lỗi - Chức năng theo dõi dữ liệu -> cập nhật nhập #1

Closed le-an-87 closed 2 years ago

le-an-87 commented 2 years ago
`Công ty TNHH Giải Pháp Kỹ Thuật Số DH - Mẫu: DH-08.1: Phiếu ghi nhận lỗi phát sinh DHG.Hospital 3.1`
Simple Icons

PHIẾU GHI NHẬN LỖI PHÁT SINH

#

chi_tiet_loi
mo_ta_loi
Chức năng cập nhật nhập báo lỗi!
Phiên bản :2021.12.28.145820PM
Npgsql.NpgsqlException:
argument of AND must be type boolean, not type numeric
Severity: ERROR
Code: 42804
   at OTH.ClsPostgres.CmdPgSQL.GetDataTable(String sSQL)
   at HosMed.Core.CLSAdapter.ClsCheckNhapXuatAdapter.CheckNhapKhoSecondStore(String pThang, String pNam, String pMakhoCPCha, String pMakhoCP, Boolean pTheoSoLo)
   at HosMed.Core.Forms.BCThang.FrmCheckNhap.FrmCheckNhap_Load(Object sender, EventArgs e)
 select a.mahh, c.tenhh, c.dvt, a.giavat, a.giaxuat, a.handung,    '' as solo,     a.nhap, b.thucnhap   from (    SELECT mahh, giavat, giaxuat, handung,   coalesce(sum(nhap),0) as nhap    FROM (      select mahh, giavat, giaxuat, coalesce(handung,'') as handung,     coalesce(sum(nhap),0) as nhap      from current.pstonkho      where thangkt = '07' and namkt   = '2022'       and khocp   = '02'       and xoa     =  0 and current.isnull(madv,'') = ''        and coalesce(giakc,0) > 0      group by mahh, giavat, giaxuat, handung     UNION ALL      select mahh, giavat, giaxuat, coalesce(handung,'') as handung,     coalesce(sum(nhap),0) as nhap      from current.pstonkho      where thangkt = '07' and namkt   = '2022'       and khocp   = '02'       and xoa     =  0  and coalesce(madv,'') = ''       and coalesce(giakc,0) = 0      group by mahh, giavat, giaxuat, handung    ) K    GROUP BY mahh, giavat, giaxuat, handung  ) a   LEFT JOIN (    select mahh, giavat, giaban, handung,     coalesce(sum(thucnhap),0) as thucnhap    from (         select mahh, giavat, giaban, coalesce(handung,'') as handung,     coalesce(soluong,0) as thucnhap         from current.pshdxn         where thangkt = '07' and namkt   = '2022'          and khole   = '02'          and loaixn  = 'xql'           and coalesce(xoa,0)           and tamin   = 9           and coalesce(toatutruc,0) = 0         UNION ALL         select mahh, giavat, giaban, coalesce(handung,'') as handung,     coalesce(soluong,0) as thucnhap         from current.pshdxn         where thangkt = '07'          and namkt   = '2022'          and khole   = '02'          and coalesce(toatutruc,0) = 0           and loaixn in ('nkt','tto')          and coalesce(dain,0) = 1          and coalesce(xoa,0) = 0         UNION ALL         select mahh, giavat, giaban, coalesce(handung,'') as handung,     coalesce(soluong,0) as thucnhap         from current.pshdxn         where thangkt = '07' and namkt   = '2022'          and khole   = '02'          and loaixn  in ('nkp')           and coalesce(xoa,0) = 0         UNION ALL         select mahh, giavat, giaban, coalesce(handung,'') as handung,     coalesce(soluong,0) as thucnhap         from current.pshdxn         where thangkt = '07' and namkt   = '2022'          and makh   = '02'          and coalesce(giakc,0) > 0           and loaixn  in ('ntt')           and coalesce(nhanct,0) = 1          and coalesce(xoa,0) = 0         UNION ALL         select mahh, giavat, giaban, coalesce(handung,'') as handung,       coalesce(soluong,0) as thucnhap         from current.pshdxn         where thangkt = '07' and namkt   = '2022'          and makh   = '02'          and coalesce(giakc,0) = 0           and loaixn  in ('ntt')           and coalesce(nhanct,0) = 1          and coalesce(xoa,0) = 0     ) x    group by mahh, giavat, giaban, handung  ) b on a.mahh = b.mahh      and a.giavat = b.giavat      and a.giaxuat = b.giaban      and coalesce(a.handung,'') = coalesce(b.handung,'')   left join current.dmthuoc c on a.mahh = c.mahh   where coalesce(a.nhap,0) != coalesce(thucnhap,0) 

image image

le-an-87 commented 2 years ago

đã fix!