You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/electricity_bills_system/ClientUpdate.java
+3-5Lines changed: 3 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -381,12 +381,10 @@ public void actionPerformed(ActionEvent ae){
381
381
Stringrs2=rs.getString("PHONE");
382
382
Stringrs3=rs.getString("EMAIL");
383
383
if(rs2.equals(phone)){
384
-
condicion=1;
385
-
tf=1;
384
+
386
385
}
387
386
if(rs3.equals(mail)){
388
-
condicion=1;
389
-
ml=1;
387
+
390
388
}
391
389
}
392
390
rs.close();
@@ -447,7 +445,7 @@ public void actionPerformed(ActionEvent ae){
447
445
if (opcion == JOptionPane.YES_OPTION) {
448
446
try {
449
447
Connectc= newConnect();
450
-
Stringquery ="UPDATE CLIENT SET NAME='"+name+"',ADDRESS='"+address+"',CITY='"+city+"', POSTAL='"+postal+"', EMAIL='"+mail+"', PHONE='"+phone+"'";
448
+
Stringquery ="UPDATE CLIENT SET NAME='"+name+"',ADDRESS='"+address+"',CITY='"+city+"', POSTAL='"+postal+"', EMAIL='"+mail+"', PHONE='"+phone+"' where id='"+ID+"'";
Stringquery="SELECT COALESCE(SUM(HOUR),0) AS HORAS,COALESCE(ROUND(SUM(TOTAL_BILL),2),0) AS BENEFICIOS FROM bill_standard WHERE NIF='"+NIF+"' AND DATE LIKE '%-"+fecha+"'";
37
+
ResultSetrs1 = c.s.executeQuery(query);
38
+
while(rs1.next()){
39
+
beneficios = rs1.getString("BENEFICIOS");
40
+
horas = rs1.getString("HORAS");
41
+
horas=horas.substring(0, horas.indexOf("."));
42
+
}
43
+
Stringquery4="SELECT COALESCE(COUNT(STATUS),0) AS PENDIENTE FROM bill_standard WHERE NIF='"+NIF+"' AND DATE LIKE '%-"+fecha+"' AND (STATUS LIKE 'sin enviar' OR STATUS LIKE 'pendiente%')";
44
+
ResultSetrs4 = c.s.executeQuery(query4);
45
+
while(rs4.next()){
46
+
factura_pendiente= rs4.getString("PENDIENTE");
47
+
}
48
+
49
+
Stringquery2="SELECT COALESCE(COUNT(STATUS),0) AS PAGADA FROM bill_standard WHERE NIF='"+NIF+"' AND DATE LIKE '%-"+fecha+"' AND STATUS LIKE 'pagado'";
50
+
ResultSetrs2 = c.s.executeQuery(query2);
51
+
while(rs2.next()){
52
+
factura_pagada= rs2.getString("PAGADA");
53
+
}
54
+
Stringquery3="SELECT COALESCE(SUM(TOTAL_PRICE),0) AS GASTOS FROM material_bill WHERE NIF='"+NIF+"' AND DATE LIKE '%-"+fecha+"'";
55
+
ResultSetrs3 = c.s.executeQuery(query3);
56
+
while(rs3.next()){
57
+
gastos= rs3.getString("GASTOS");
58
+
}
59
+
60
+
}catch (Exceptione){
61
+
e.printStackTrace();
62
+
}
63
+
25
64
this.NIF=NIF;
26
65
this.ID_USER=ID_USER;
27
66
financeFrame = newJFrame("Finanzas - Resumen del Mes");
0 commit comments