[Vtigercrm-commits] [vtiger-commits] r9120 - /vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Thu Aug 24 06:25:03 EDT 2006
Author: saraj
Date: Thu Aug 24 04:24:59 2006
New Revision: 9120
Log:
* Modified to handle the sequence number in inventory product details
Modified:
vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php
Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php
==============================================================================
--- vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php (original)
+++ vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php Thu Aug 24 04:24:59 2006
@@ -3429,17 +3429,26 @@
{
$res = $conn->query("select * from $tablename order by $idname");
$count = $conn->num_rows($res);
+
+ $id = $oldid = 0;
+ $seqno = 0;
+
for($i=0;$i<$count;$i++)
{
+ $oldid = $id;
$id = $conn->query_result($res,$i,$idname);
+
+ //for every new PO/SO/Quotes/Invoice entity we should set the sequence start value as 1
+ if($id != $oldid)
+ $seqno = 1;
+
$productid = $conn->query_result($res,$i,'productid');
$quantity = $conn->query_result($res,$i,'quantity');
$listprice = $conn->query_result($res,$i,'listprice');
- // DG 15 Aug 2006
- // Support sequence_no
- $seqno = $conn->query_result($res, $i, 'sequence_no');
+
$query1 = "insert into vtiger_inventoryproductrel(id,productid,sequence_no,quantity,listprice) values($id, $productid,$seqno, $quantity, $listprice)";
Execute($query1);
+ $seqno++;
}
}
More information about the vtigercrm-commits
mailing list