add pre-req check for xwd 2.4, credit card pre-req from bendiy
authorGreg Pazo <gpazo@xtuple.com>
Fri, 27 Jun 2014 17:14:33 +0000 (13:14 -0400)
committerGreg Pazo <gpazo@xtuple.com>
Fri, 27 Jun 2014 17:14:33 +0000 (13:14 -0400)
scripts/xml/distribution_package.xml

index 52faa5f..cde869e 100644 (file)
     <message>This package requires that XWD 240 package to be installed before continuing.</message>
   </prerequisite>
 
+ <prerequisite type = "query"
+               name = "Checking for duplicate Credit Card payments on Sales Orders" >
+    <query>
+      WITH counter AS (SELECT COUNT(*) AS freq
+                        FROM payco
+                        GROUP BY payco_ccpay_id, payco_cohead_id
+                        ORDER BY 1)
+      SELECT (COALESCE(MAX(freq), 1) = 0 OR COALESCE(MAX(freq), 1) = 1)
+      FROM counter;
+    </query>
+    <message>There are duplicate payco_ccpay_id and payco_cohead_id on the payco table. Please see your system administrator or contact xTuple.
+    </message>
+  </prerequisite>
+
+ <prerequisite type="query" name="Checking xwd Package Version">
+     <query>SELECT TRUE FROM pkghead WHERE pkghead_name = 'xwd' AND (pkghead_version ~* '2.4');</query>
+    <message>This package must be applied against the 2.4.0 version of the xwd package.</message>
+  </prerequisite>
+
   <script file="postbooks_upgrade.sql" />
   <script file="inventory_upgrade.sql" />
   <script file="distribution_upgrade.sql" />