Changeset 312
- Timestamp:
- 10/04/07 14:05:01
- Files:
-
- trunk/phpbms/common/stylesheet/mozilla/forms.css (modified) (1 diff)
- trunk/phpbms/common/stylesheet/mozilla/pages/snapshot.css (modified) (1 diff)
- trunk/phpbms/include/common_functions.php (modified) (1 diff)
- trunk/phpbms/install/update.php (modified) (1 diff)
- trunk/phpbms/install/updatev0.9.sql (modified) (1 diff)
- trunk/phpbms/modules/bms/include/clients_credit.php (modified) (7 diffs)
- trunk/phpbms/modules/bms/include/receipts.php (modified) (5 diffs)
- trunk/phpbms/modules/bms/install/paymentmethods.sql (modified) (1 diff)
- trunk/phpbms/modules/bms/install/relationships.sql (modified) (1 diff)
- trunk/phpbms/modules/bms/install/updatev0.90.sql (modified) (1 diff)
- trunk/phpbms/modules/bms/report/aritems_clientstatement.php (modified) (1 diff)
- trunk/phpbms/modules/bms/snapshot.php (modified) (2 diffs)
- trunk/phpbms/modules/sample/include/sampletable.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/phpbms/common/stylesheet/mozilla/forms.css
r311 r312 9 9 vertical-align: middle; 10 10 font-style:normal; 11 foo:1pxl; 11 12 } 12 13 SELECT{padding:0 0 0 3px;} trunk/phpbms/common/stylesheet/mozilla/pages/snapshot.css
r311 r312 82 82 #eventsBox h2{margin:0; padding:4px 0 4px;} 83 83 #eventsBox #eventsList table{border-collapse:collapse;} 84 #eventsBox #eventsLis td{padding:10px 5px; border-bottom:1px solid #DDDDDD; font-size:11px;} 85 #eventsBox .eventDayName td{font-size:13px;background:#EEEEEE; 84 85 #eventsBox #eventsList td{ 86 padding:10px 5px; 87 border-bottom:1px solid #DDDDDD; 88 font-size:11px; 89 } 90 91 #eventsBox #eventsList .eventDayName td{ 92 font-size:13px; 93 background:#EEEEEE; 86 94 font-weight:bold; 87 95 padding:4px; 88 border-bottom:1px solid #BBBBBB;} 89 #eventsBox #today td{background:#DDDDDD} 96 border-bottom:1px solid #BBBBBB; 97 } 98 99 #eventsBox #today td{ 100 background:#DDDDDD 101 } 90 102 91 103 #eventButtons { trunk/phpbms/include/common_functions.php
r311 r312 576 576 return $value; 577 577 } 578 579 580 //for windows servers, we have no define time constants and nl_langinfo function 581 //in a limited fashion; some windows servers still show that the function 582 //exists even though it's not implemented, thus the second check; 583 584 $nl_exists = function_exists("nl_langinfo"); 585 if($nl_exists) 586 $nl_exists = @ nl_langinfo(CODESET); 587 588 if(!nl_exists){ 589 590 function nl_langinfo($constant){ 591 592 echo $constant; 593 594 }//end function 595 596 function nl_setup(){ 597 598 $date = mktime(0,0,0,10,7,2007); 599 600 for($i = 1; $i<=7; $i++){ 601 602 define("ABDAY_".$i, date("D", $date)); 603 define("DAY_".$i, date("l"), $date); 604 605 $date = strtotime("tomorrow", $date); 606 }//end for 607 608 609 for($i = 1; $i<=12; $i++){ 610 611 $date = mktime(0, 0, 0, $i, 1, 2007); 612 613 define("ABMON_".$i, date("M", $date)); 614 define("MON_".$i, date("F"), $date); 615 616 }//end for 617 618 }//end function 619 620 nl_setup(); 621 622 623 }//end if 624 625 nl_langinfo(ABMON_12); 626 578 627 ?> trunk/phpbms/install/update.php
r285 r312 64 64 <h1>Before Updating</h1> 65 65 66 <p >Backup all of your data and program files before running any update.</p>66 <p class="important">Backup all of your data and program files before running any update.</p> 67 67 <p> 68 68 By downloading and decompressing this update, you may have already replaced script files trunk/phpbms/install/updatev0.9.sql
r311 r312 110 110 DELETE FROM tableoptions WHERE name='printex'; 111 111 INSERT INTO tableoptions (tabledefid, name, `option`,othercommand, roleid) SELECT id, "printex", 1, 0, 0 FROM tabledefs WHERE `type` != "view"; 112 INSERT INTO `reports` (`name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('SQL Export', 'export', '0', '0', '-100', 'report/general_sql.php', 'Generate SQL INSERT statements for records.', 1, NOW(), 1, NOW()); trunk/phpbms/modules/bms/include/clients_credit.php
r311 r312 83 83 relatedid, 84 84 amount, 85 `type`, 85 86 paid, 86 87 itemdate, … … 96 97 $queryresult = $this->db->query($querystatement); 97 98 99 $querystatement = " 100 SELECT 101 SUM(amount) AS theamount, 102 SUM(amount - paid) AS thedue 103 FROM 104 aritems 105 WHERE 106 clientid = ".((int) $clientid)." 107 AND `status` = 'open' 108 ORDER BY 109 posted"; 110 111 $sumresult = $this->db->query($querystatement); 112 $sumrecord = $this->db->fetchArray($sumresult); 113 98 114 ?><table border="0" cellpadding="0" cellspacing="0" class="querytable" id="openItems"> 99 115 … … 101 117 <tr> 102 118 <th align="left" nowrap="nowrap">doc ref</th> 119 <th align="left" nowrap="nowrap">type</th> 103 120 <th align="left" nowrap="nowrap">doc date</th> 104 121 <th align="left" nowrap="nowrap">due date</th> 105 <th align="right" width="100%" nowrap="nowrap">am mount</th>122 <th align="right" width="100%" nowrap="nowrap">amount</th> 106 123 <th align="right">due</th> 107 124 </tr> … … 110 127 <tfoot> 111 128 <tr class="queryfooter"> 112 <td colspan=" 4" align="right"> </td>113 <td align="right"> </td>129 <td colspan="5" align="right"><?php echo formatVariable($sumrecord["theamount"], "currency")?></td> 130 <td align="right"><?php echo formatVariable($sumrecord["thedue"], "currency")?></td> 114 131 </tr> 115 132 </tfoot> … … 132 149 133 150 ?><tr class="queryGroup"> 134 <td colspan=" 5"><?php echo $title?></td>151 <td colspan="6"><?php echo $title?></td> 135 152 </tr><?php 136 153 … … 141 158 ?><tr class="row<?php echo $row?>"> 142 159 <td><?php echo $therecord["relatedid"]?></td> 160 <td nowrap="nowrap"><?php echo $therecord["type"]?></td> 143 161 <td><?php echo formatFromSQLDate($therecord["itemdate"])?></td> 144 <td><?php echo dateToString($dueDate)?></td> 162 <td <?php if($dueDate < mktime(0,0,0)) echo 'class="important"';?>><?php 163 164 if($therecord["type"] == "invoice") 165 echo dateToString($dueDate); 166 else 167 echo " "; 168 169 ?></td> 145 170 <td align="right"><?php echo formatVariable($therecord["amount"],"currency")?></td> 146 171 <td align="right"><?php echo formatVariable($therecord["amount"] - $therecord["paid"],"currency")?></td> … … 149 174 150 175 } else { 151 ?><tr class="norecords"><td colspan=" 5" >No open items</td></tr><?php176 ?><tr class="norecords"><td colspan="6" >No open items</td></tr><?php 152 177 }//endif 153 178 ?> trunk/phpbms/modules/bms/include/receipts.php
r311 r312 143 143 $this->db->query($deletestatement); 144 144 145 $itemsArray = split(";;", $itemlist);145 $itemsArray = explode(";;", $itemlist); 146 146 147 147 foreach($itemsArray as $item){ 148 148 149 $itemRecord = split("::", $item);149 $itemRecord = explode("::", $item); 150 150 151 151 if(count($itemRecord) > 1){ … … 362 362 $newWhere = ""; 363 363 while($therecord = $this->db->fetchArray($queryresult)) 364 $newWhere .= " ,id = ".$therecord["id"];364 $newWhere .= " OR id = ".$therecord["id"]; 365 365 366 366 if(strlen($newWhere)) 367 $newWhere = substr($newWhere, 2);367 $newWhere = substr($newWhere, 4); 368 368 else 369 369 $newWhere = "id = -1974"; … … 434 434 435 435 if($therecord["amount"] == $checkrecord["thesum"]){ 436 $newWhere .= " ,id = ".$therecord["id"];436 $newWhere .= " OR id = ".$therecord["id"]; 437 437 $count++; 438 438 … … 442 442 443 443 if(strlen($newWhere)) 444 $newWhere = substr($newWhere, 2);444 $newWhere = substr($newWhere, 4); 445 445 else 446 446 $newWhere = "id = -1974"; … … 606 606 }//endwhile 607 607 608 $newWhere .= " ,id = ".$therecord["id"];608 $newWhere .= " OR id = ".$therecord["id"]; 609 609 }//endwhile 610 610 611 611 if(strlen($newWhere)) 612 $newWhere = substr($newWhere, 2);612 $newWhere = substr($newWhere, 4); 613 613 614 614 if($newWhere){ trunk/phpbms/modules/bms/install/paymentmethods.sql
r176 r312 1 INSERT INTO `paymentmethods` (` name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('Business Check','draft',10,0,0,'',1,NOW(),1,NOW());2 INSERT INTO `paymentmethods` (` name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('Personal Check','draft',10,0,0,'',1,NOW(),1,NOW());3 INSERT INTO `paymentmethods` (` name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('Cashiers Check','draft',10,0,0,'',1,NOW(),1,NOW());4 INSERT INTO `paymentmethods` (` name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('VISA','charge',0,0,0,'',1,NOW(),1,NOW());5 INSERT INTO `paymentmethods` (` name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('Mastercard','charge',0,0,0,'',1,NOW(),1,NOW());6 INSERT INTO `paymentmethods` (` name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('American Express','charge',0,0,0,'',1,NOW(),1,NOW());7 INSERT INTO `paymentmethods` (` name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('Cash','',20,0,0,'',1,NOW(),1,NOW());8 INSERT INTO `paymentmethods` (` name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('Accounts Reveivable','receivable',30,0,0,'',1,NOW(),1,NOW());9 INSERT INTO `paymentmethods` (` name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('Wire Transfer','draft',10,0,0,'',1,NOW(),1,NOW());10 INSERT INTO `paymentmethods` (` name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('Money Order','',20,0,0,'',1,NOW(),1,NOW());11 INSERT INTO `paymentmethods` (` name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('VISA - Debit','charge',0,0,0,'',1,NOW(),1,NOW());12 INSERT INTO `paymentmethods` (` name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('Discover Card','charge',0,0,0,'',1,NOW(),1,NOW());1 INSERT INTO `paymentmethods` (`id`, `name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('1', 'Business Check', 'draft', '10', '0', '0', '', 1, NOW(), 1, NOW()); 2 INSERT INTO `paymentmethods` (`id`, `name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('2', 'Personal Check', 'draft', '10', '0', '0', '', 1, NOW(), 1, NOW()); 3 INSERT INTO `paymentmethods` (`id`, `name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('3', 'Cashiers Check', 'draft', '10', '0', '0', '', 1, NOW(), 1, NOW()); 4 INSERT INTO `paymentmethods` (`id`, `name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('4', 'VISA', 'charge', '0', '0', '0', '', 1, NOW(), 1, NOW()); 5 INSERT INTO `paymentmethods` (`id`, `name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('5', 'Mastercard', 'charge', '0', '0', '0', '', 1, NOW(), 1, NOW()); 6 INSERT INTO `paymentmethods` (`id`, `name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('6', 'American Express', 'charge', '0', '0', '0', '', 1, NOW(), 1, NOW()); 7 INSERT INTO `paymentmethods` (`id`, `name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('7', 'Cash', '', '20', '0', '0', '', 1, NOW(), 1, NOW()); 8 INSERT INTO `paymentmethods` (`id`, `name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('8', 'Net 30', 'receivable', '30', '0', '0', '', 1, NOW(), 1, NOW()); 9 INSERT INTO `paymentmethods` (`id`, `name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('9', 'Wire Transfer', 'draft', '10', '0', '0', '', 1, NOW(), 1, NOW()); 10 INSERT INTO `paymentmethods` (`id`, `name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('10', 'Money Order', '', '20', '0', '0', '', 1, NOW(), 1, NOW()); 11 INSERT INTO `paymentmethods` (`id`, `name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('11', 'VISA - Debit', 'charge', '0', '0', '0', '', 1, NOW(), 1, NOW()); 12 INSERT INTO `paymentmethods` (`id`, `name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('12', 'Discover Card', 'charge', '0', '0', '0', '', 1, NOW(), 1, NOW()); trunk/phpbms/modules/bms/install/relationships.sql
r170 r312 1 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (1,'id','sales managers','salesmanagerid',2,9,1,NOW(),1,NOW(),0); 2 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (4,'clientid','invoices','id',2,3,1,NOW(),1,NOW(),1); 3 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (5,'id','clients','clientid',3,2,1,NOW(),1,NOW(),0); 4 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (6,'id','tax areas','taxareaid',3,6,1,NOW(),1,NOW(),0); 5 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (7,'id','invoices','invoiceid',5,3,1,NOW(),1,NOW(),0); 6 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (8,'id','products','productid',5,4,1,NOW(),1,NOW(),0); 7 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (9,'id','parent products','parentid',8,4,1,NOW(),1,NOW(),0); 8 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (10,'id','child products','childid',8,4,1,NOW(),1,NOW(),0); 9 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (11,'categoryid','products','id',7,4,1,NOW(),1,NOW(),1); 10 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (12,'productid','invoice line items','id',4,5,1,NOW(),1,NOW(),1); 11 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (13,'parentid','prerequisites','id',4,8,1,NOW(),1,NOW(),1); 12 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (14,'taxareaid','invoices','id',6,3,1,NOW(),1,NOW(),0); 13 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (15,'salesmanagerid','sales manager for clients','id',9,2,1,NOW(),1,NOW(),0); 14 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (16,'createdby','created clients','id',9,2,1,NOW(),1,NOW(),0); 15 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (17,'modifiedby','modified clients','id',9,2,1,NOW(),1,NOW(),0); 16 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (18,'createdby','created invoices','id',9,3,1,NOW(),1,NOW(),0); 17 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (19,'modifiedby','modified invoices','id',9,3,1,NOW(),1,NOW(),0); 18 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (20,'invoiceid','line items','id',3,5,1,NOW(),1,NOW(),1); 19 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (21,'discountid','Invoices','id',25,3,1,NOW(),1,NOW(),0); 20 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (22,'id','Discounts','discountid',3,25,1,NOW(),1,NOW(),0); 1 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'sales managers', 'salesmanagerid', '2', '9', 1, NOW(), 1, NOW(), '0'); 2 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('clientid', 'sales orders', 'id', '2', '3', 1, NOW(), 1, NOW(), '1'); 3 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'clients', 'clientid', '3', '2', 1, NOW(), 1, NOW(), '0'); 4 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'tax areas', 'taxareaid', '3', '6', 1, NOW(), 1, NOW(), '0'); 5 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'sales orders', 'invoiceid', '5', '3', 1, NOW(), 1, NOW(), '0'); 6 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'products', 'productid', '5', '4', 1, NOW(), 1, NOW(), '0'); 7 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'parent products', 'parentid', '8', '4', 1, NOW(), 1, NOW(), '0'); 8 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'child products', 'childid', '8', '4', 1, NOW(), 1, NOW(), '0'); 9 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('categoryid', 'products', 'id', '7', '4', 1, NOW(), 1, NOW(), '1'); 10 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('productid', 'sales order line items', 'id', '4', '5', 1, NOW(), 1, NOW(), '1'); 11 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('parentid', 'prerequisites', 'id', '4', '8', 1, NOW(), 1, NOW(), '1'); 12 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('taxareaid', 'sales orders', 'id', '6', '3', 1, NOW(), 1, NOW(), '0'); 13 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('salesmanagerid', 'sales person for clients', 'id', '9', '2', 1, NOW(), 1, NOW(), '0'); 14 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('createdby', 'created clients', 'id', '9', '2', 1, NOW(), 1, NOW(), '0'); 15 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('modifiedby', 'modified clients', 'id', '9', '2', 1, NOW(), 1, NOW(), '0'); 16 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('createdby', 'created sales orders', 'id', '9', '3', 1, NOW(), 1, NOW(), '0'); 17 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('modifiedby', 'modified invoices', 'id', '9', '3', 1, NOW(), 1, NOW(), '0'); 18 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('invoiceid', 'line items', 'id', '3', '5', 1, NOW(), 1, NOW(), '1'); 19 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('discountid', 'sales orders', 'id', '25', '3', 1, NOW(), 1, NOW(), '0'); 20 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'discounts', 'discountid', '3', '25', 1, NOW(), 1, NOW(), '0'); 21 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'clients', 'clientid', '303', '2', 1, NOW(), 1, NOW(), '0'); 22 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('clientid', 'AR items', 'id', '2', '303', 1, NOW(), 1, NOW(), '1'); 23 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'invoices', 'relatedid', '303', '3', 1, NOW(), 1, NOW(), '0'); 24 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('relatedid', 'AR items', 'id', '3', '303', 1, NOW(), 1, NOW(), '0'); 25 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'clients', 'clientid', '304', '2', 1, NOW(), 1, NOW(), '0'); 26 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('clientid', 'receipts', 'id', '2', '304', 1, NOW(), 1, NOW(), '1'); 27 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'product categories', 'categoryid', '4', '7', 1, NOW(), 1, NOW(), '0'); 28 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('shippingmethodid', 'sales orders', 'id', '300', '3', 1, NOW(), 1, NOW(), '0'); 29 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('paymentmethodid', 'sales orders', 'id', '301', '3', 1, NOW(), 1, NOW(), '0'); 30 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('paymentmethodid', 'receipts', 'id', '301', '304', 1, NOW(), 1, NOW(), '1'); 31 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'receipts', 'relatedid', '303', '304', 1, NOW(), 1, NOW(), '0'); 32 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('assignedtoid', 'assigned to sales orders', 'id', '9', '3', 1, NOW(), 1, NOW(), '0'); trunk/phpbms/modules/bms/install/updatev0.90.sql
r311 r312 195 195 INSERT INTO `tablesearchablefields` (`tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (304,'receipts.amount','amount',4,'field'); 196 196 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (3,'mark_rtp','mark ready to post',1,20); 197 DELETE FROM `relationships`; 198 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'sales managers', 'salesmanagerid', '2', '9', 1, NOW(), 1, NOW(), '0'); 199 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('clientid', 'sales orders', 'id', '2', '3', 1, NOW(), 1, NOW(), '1'); 200 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'clients', 'clientid', '3', '2', 1, NOW(), 1, NOW(), '0'); 201 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'tax areas', 'taxareaid', '3', '6', 1, NOW(), 1, NOW(), '0'); 202 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'sales orders', 'invoiceid', '5', '3', 1, NOW(), 1, NOW(), '0'); 203 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'products', 'productid', '5', '4', 1, NOW(), 1, NOW(), '0'); 204 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'parent products', 'parentid', '8', '4', 1, NOW(), 1, NOW(), '0'); 205 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'child products', 'childid', '8', '4', 1, NOW(), 1, NOW(), '0'); 206 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('categoryid', 'products', 'id', '7', '4', 1, NOW(), 1, NOW(), '1'); 207 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('productid', 'sales order line items', 'id', '4', '5', 1, NOW(), 1, NOW(), '1'); 208 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('parentid', 'prerequisites', 'id', '4', '8', 1, NOW(), 1, NOW(), '1'); 209 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('taxareaid', 'sales orders', 'id', '6', '3', 1, NOW(), 1, NOW(), '0'); 210 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('salesmanagerid', 'sales person for clients', 'id', '9', '2', 1, NOW(), 1, NOW(), '0'); 211 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('createdby', 'created clients', 'id', '9', '2', 1, NOW(), 1, NOW(), '0'); 212 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('modifiedby', 'modified clients', 'id', '9', '2', 1, NOW(), 1, NOW(), '0'); 213 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('createdby', 'created sales orders', 'id', '9', '3', 1, NOW(), 1, NOW(), '0'); 214 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('modifiedby', 'modified invoices', 'id', '9', '3', 1, NOW(), 1, NOW(), '0'); 215 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('invoiceid', 'line items', 'id', '3', '5', 1, NOW(), 1, NOW(), '1'); 216 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('discountid', 'sales orders', 'id', '25', '3', 1, NOW(), 1, NOW(), '0'); 217 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'discounts', 'discountid', '3', '25', 1, NOW(), 1, NOW(), '0'); 218 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'clients', 'clientid', '303', '2', 1, NOW(), 1, NOW(), '0'); 219 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('clientid', 'AR items', 'id', '2', '303', 1, NOW(), 1, NOW(), '1'); 220 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'invoices', 'relatedid', '303', '3', 1, NOW(), 1, NOW(), '0'); 221 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('relatedid', 'AR items', 'id', '3', '303', 1, NOW(), 1, NOW(), '0'); 222 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'clients', 'clientid', '304', '2', 1, NOW(), 1, NOW(), '0'); 223 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('clientid', 'receipts', 'id', '2', '304', 1, NOW(), 1, NOW(), '1'); 224 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'product categories', 'categoryid', '4', '7', 1, NOW(), 1, NOW(), '0'); 225 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('shippingmethodid', 'sales orders', 'id', '300', '3', 1, NOW(), 1, NOW(), '0'); 226 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('paymentmethodid', 'sales orders', 'id', '301', '3', 1, NOW(), 1, NOW(), '0'); 227 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('paymentmethodid', 'receipts', 'id', '301', '304', 1, NOW(), 1, NOW(), '1'); 228 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'receipts', 'relatedid', '303', '304', 1, NOW(), 1, NOW(), '0'); 229 INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('assignedtoid', 'assigned to sales orders', 'id', '9', '3', 1, NOW(), 1, NOW(), '0'); trunk/phpbms/modules/bms/report/aritems_clientstatement.php
r311 r312 165 165 166 166 $pdf->Cell(1 - 0.01, 0.17, formatVariable($totalDue, "currency"), 1, 0, "R", 1); 167 168 $this->currentTotal = 0; 169 $this->term1Total = 0; 170 $this->term2Total = 0; 171 $this->term3Total = 0; 167 172 168 173 }//end while trunk/phpbms/modules/bms/snapshot.php
r311 r312 251 251 WHERE 252 252 `status` = 'open' 253 AND posted=1; 254 "; 253 AND posted=1"; 255 254 256 255 $queryresult = $this->db->query($querystatement); … … 317 316 $sumrecord = $this->db->fetchArray($sumresult); 318 317 319 if($this->db->numRows($queryresult) == 0) 320 echo "none"; 321 else{ 318 if($this->db->numRows($queryresult) == 0){ 319 320 ?> 321 <div class="small disabledtext">none</div> 322 <?php 323 } else { 322 324 323 325 ?> trunk/phpbms/modules/sample/include/sampletable.php
r285 r312 13 13 */ 14 14 if(class_exists("phpbmsTable")){ 15 class [tablename]extends phpbmsTable{15 class tablename extends phpbmsTable{ 16 16 17 17 // CLASS OVERRIDES ===================================================================