Просмотр исходного кода

Add NOTIFY support to green sales report

Neal Wilson 7 лет назад
Родитель
Сommit
64069a3336
2 измененных файлов: 6 добавлений и 0 удалений
  1. 4
    0
      config/Reports/greensales.xml
  2. 2
    0
      config/Windows/navigation.xml

+ 4
- 0
config/Reports/greensales.xml Просмотреть файл

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

+ 2
- 0
config/Windows/navigation.xml Просмотреть файл

@@ -326,6 +326,8 @@
326 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 327
             query.exec("CREATE OR REPLACE FUNCTION notify_purchase_changed() RETURNS trigger AS $$ BEGIN NOTIFY PurchaseChange; RETURN NULL; END; $$ LANGUAGE plpgsql");
328 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 332
             query.exec("UPDATE TypicaFeatures SET version = 8 WHERE feature = 'base-features'");
331 333
             query = query.invalidate();

Загрузка…
Отмена
Сохранить