ソースを参照

added fields INVOICE, PAYMENT to Zamówienia

Piotr Labudda 9 年 前
コミット
b6c79738fa
1 ファイル変更30 行追加0 行削除
  1. 30 0
      SE/se-lib/Route/UrlAction/ProjektyProNetMediaZamZlec.php

+ 30 - 0
SE/se-lib/Route/UrlAction/ProjektyProNetMediaZamZlec.php

@@ -92,6 +92,36 @@ class Route_UrlAction_ProjektyProNetMediaZamZlec extends RouteBase {// TODO: Url
 		if (1 != V::get('_print', '', $_GET)) UI::dol();
 	}
 
+	public function reinstallAction() {
+		UI::gora();
+		try {
+			DB::getPDO()->execSql(" alter table CRM_LISTA_ZASOBOW_ORDERS add INVOICE enum('0','1') NOT NULL DEFAULT '0' ");
+			DB::getPDO()->execSql(" alter table CRM_LISTA_ZASOBOW_ORDERS_HIST add INVOICE varchar(6) NOT NULL DEFAULT 'N/S;' ");
+		} catch (Exception $e) {
+			if (fales !== strpos($e->getMessage(), 'Duplicate column name')) {
+				UI::alert('warning', $e->getMessage());
+			} else {
+				UI::alert('danger', $e->getMessage());
+				DBG::log($e);
+			}
+		}
+
+		try {
+			DB::getPDO()->execSql(" alter table CRM_LISTA_ZASOBOW_ORDERS add PAYMENT enum('0','1') NOT NULL DEFAULT '0' ");
+			DB::getPDO()->execSql(" alter table CRM_LISTA_ZASOBOW_ORDERS_HIST add PAYMENT varchar(6) NOT NULL DEFAULT 'N/S;' ");
+		} catch (Exception $e) {
+			if (fales !== strpos($e->getMessage(), 'Duplicate column name')) {
+				UI::alert('warning', $e->getMessage());
+			} else {
+				UI::alert('danger', $e->getMessage());
+				DBG::log($e);
+			}
+		}
+
+		UI::alert('info', "Koniec");
+		UI::dol();
+	}
+
 	public function getWidgetProject() {
 		$widgetProject = array();
 		$widgetProject['idTabela'] = 1656;// TODO: idZasob for TABELA Projekty