Pārlūkot izejas kodu

Add NOTIFY support to green sales report

Neal Wilson 7 gadus atpakaļ
vecāks
revīzija
64069a3336
2 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  1. 4
    0
      config/Reports/greensales.xml
  2. 2
    0
      config/Windows/navigation.xml

+ 4
- 0
config/Reports/greensales.xml Parādīt failu

122
 				query = query.invalidate();
122
 				query = query.invalidate();
123
 			}
123
 			}
124
 			refresh();
124
 			refresh();
125
+            var notifier = Application.subscribe("salechange");
126
+            notifier.notify.connect(function() {
127
+                refresh();
128
+            });
125
 			dateSelect.rangeUpdated.connect(refresh);
129
 			dateSelect.rangeUpdated.connect(refresh);
126
 		]]>
130
 		]]>
127
 	</program>
131
 	</program>

+ 2
- 0
config/Windows/navigation.xml Parādīt failu

326
             query.exec("CREATE TRIGGER notify_transactions_changed AFTER INSERT OR UPDATE OR DELETE ON transactions FOR EACH STATEMENT EXECUTE PROCEDURE notify_transactions_changed()");
326
             query.exec("CREATE TRIGGER notify_transactions_changed AFTER INSERT OR UPDATE OR DELETE ON transactions FOR EACH STATEMENT EXECUTE PROCEDURE notify_transactions_changed()");
327
             query.exec("CREATE OR REPLACE FUNCTION notify_purchase_changed() RETURNS trigger AS $$ BEGIN NOTIFY PurchaseChange; RETURN NULL; END; $$ LANGUAGE plpgsql");
327
             query.exec("CREATE OR REPLACE FUNCTION notify_purchase_changed() RETURNS trigger AS $$ BEGIN NOTIFY PurchaseChange; RETURN NULL; END; $$ LANGUAGE plpgsql");
328
             query.exec("CREATE TRIGGER notify_purchase_changed AFTER INSERT OR UPDATE OR DELETE ON purchase FOR EACH STATEMENT EXECUTE PROCEDURE notify_purchase_changed()");
328
             query.exec("CREATE TRIGGER notify_purchase_changed AFTER INSERT OR UPDATE OR DELETE ON purchase FOR EACH STATEMENT EXECUTE PROCEDURE notify_purchase_changed()");
329
+            query.exec("CREATE OR REPLACE FUNCTION notify_sale_changed() RETURNS trigger AS $$ BEGIN NOTIFY SaleChange; RETURN NULL; END; $$ LANGUAGE plpgsql");
330
+            query.exec("CREATE TRIGGER notify_sale_changed AFTER INSERT OR UPDATE OR DELETE ON sale FOR EACH STATEMENT EXECUTE PROCEDURE notify_sale_changed()");
329
             
331
             
330
             query.exec("UPDATE TypicaFeatures SET version = 8 WHERE feature = 'base-features'");
332
             query.exec("UPDATE TypicaFeatures SET version = 8 WHERE feature = 'base-features'");
331
             query = query.invalidate();
333
             query = query.invalidate();

Notiek ielāde…
Atcelt
Saglabāt