navigation  interaction  search

 other resources

Changeset 312

Show
Ignore:
Timestamp:
10/04/07 14:05:01
Author:
brieb
Message:

Fixed minor update problems.
Fixed invalid stylesheet definitions.
Added potential windows servers nl_langinfo workaround.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/phpbms/common/stylesheet/mozilla/forms.css

    r311 r312  
    99        vertical-align: middle;  
    1010        font-style:normal; 
     11        foo:1pxl; 
    1112} 
    1213SELECT{padding:0 0 0 3px;} 
  • trunk/phpbms/common/stylesheet/mozilla/pages/snapshot.css

    r311 r312  
    8282#eventsBox h2{margin:0; padding:4px 0 4px;} 
    8383#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; 
    8694        font-weight:bold; 
    8795        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
    90102 
    91103#eventButtons { 
  • trunk/phpbms/include/common_functions.php

    r311 r312  
    576576        return $value; 
    577577} 
     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"); 
     585if($nl_exists) 
     586        $nl_exists = @ nl_langinfo(CODESET); 
     587 
     588if(!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 
     625nl_langinfo(ABMON_12); 
     626 
    578627?> 
  • trunk/phpbms/install/update.php

    r285 r312  
    6464                <h1>Before Updating</h1> 
    6565                 
    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> 
    6767                <p> 
    6868                        By downloading and decompressing this update, you may have already replaced script files  
  • trunk/phpbms/install/updatev0.9.sql

    r311 r312  
    110110DELETE FROM tableoptions WHERE name='printex'; 
    111111INSERT INTO tableoptions (tabledefid, name, `option`,othercommand, roleid) SELECT id, "printex", 1, 0, 0 FROM tabledefs WHERE `type` != "view"; 
     112INSERT 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  
    8383                                        relatedid, 
    8484                                        amount, 
     85                                        `type`, 
    8586                                        paid, 
    8687                                        itemdate, 
     
    9697                        $queryresult = $this->db->query($querystatement); 
    9798                         
     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                         
    98114                ?><table border="0" cellpadding="0" cellspacing="0" class="querytable" id="openItems"> 
    99115 
     
    101117                                <tr> 
    102118                                        <th align="left" nowrap="nowrap">doc ref</th> 
     119                                        <th align="left" nowrap="nowrap">type</th> 
    103120                                        <th align="left" nowrap="nowrap">doc date</th> 
    104121                                        <th align="left" nowrap="nowrap">due date</th> 
    105                                         <th align="right" width="100%" nowrap="nowrap">ammount</th> 
     122                                        <th align="right" width="100%" nowrap="nowrap">amount</th> 
    106123                                        <th align="right">due</th> 
    107124                                </tr> 
     
    110127                        <tfoot> 
    111128                                <tr class="queryfooter"> 
    112                                         <td colspan="4" align="right">&nbsp;</td> 
    113                                         <td align="right">&nbsp;</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> 
    114131                                </tr> 
    115132                        </tfoot> 
     
    132149                                                                 
    133150                                                                ?><tr class="queryGroup"> 
    134                                                                         <td colspan="5"><?php echo $title?></td> 
     151                                                                        <td colspan="6"><?php echo $title?></td> 
    135152                                                                </tr><?php 
    136153                                                                 
     
    141158                                                        ?><tr class="row<?php echo $row?>"> 
    142159                                                                <td><?php echo $therecord["relatedid"]?></td> 
     160                                                                <td nowrap="nowrap"><?php echo $therecord["type"]?></td> 
    143161                                                                <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 "&nbsp;"; 
     168                                                                 
     169                                                                ?></td> 
    145170                                                                <td align="right"><?php echo formatVariable($therecord["amount"],"currency")?></td> 
    146171                                                                <td align="right"><?php echo formatVariable($therecord["amount"] - $therecord["paid"],"currency")?></td> 
     
    149174                                                 
    150175                                        } else { 
    151                                                 ?><tr class="norecords"><td colspan="5" >No open items</td></tr><?php 
     176                                                ?><tr class="norecords"><td colspan="6" >No open items</td></tr><?php 
    152177                                        }//endif 
    153178                                ?> 
  • trunk/phpbms/modules/bms/include/receipts.php

    r311 r312  
    143143                        $this->db->query($deletestatement); 
    144144 
    145                         $itemsArray = split(";;", $itemlist); 
     145                        $itemsArray = explode(";;", $itemlist); 
    146146 
    147147                        foreach($itemsArray as $item){ 
    148148                         
    149                                 $itemRecord = split("::", $item); 
     149                                $itemRecord = explode("::", $item); 
    150150                                 
    151151                                if(count($itemRecord) > 1){ 
     
    362362                        $newWhere = ""; 
    363363                        while($therecord = $this->db->fetchArray($queryresult)) 
    364                                 $newWhere .= ", id = ".$therecord["id"]; 
     364                                $newWhere .= " OR id = ".$therecord["id"]; 
    365365                                 
    366366                        if(strlen($newWhere)) 
    367                                 $newWhere = substr($newWhere, 2); 
     367                                $newWhere = substr($newWhere, 4); 
    368368                        else 
    369369                                $newWhere = "id = -1974"; 
     
    434434                                 
    435435                                if($therecord["amount"] == $checkrecord["thesum"]){ 
    436                                         $newWhere .= ", id = ".$therecord["id"]; 
     436                                        $newWhere .= " OR id = ".$therecord["id"]; 
    437437                                        $count++; 
    438438                                         
     
    442442 
    443443                        if(strlen($newWhere)) 
    444                                 $newWhere = substr($newWhere, 2); 
     444                                $newWhere = substr($newWhere, 4); 
    445445                        else 
    446446                                $newWhere = "id = -1974"; 
     
    606606                                }//endwhile 
    607607 
    608                                 $newWhere .= ", id = ".$therecord["id"]; 
     608                                $newWhere .= " OR id = ".$therecord["id"]; 
    609609                        }//endwhile 
    610610 
    611611                        if(strlen($newWhere)) 
    612                                 $newWhere = substr($newWhere, 2); 
     612                                $newWhere = substr($newWhere, 4); 
    613613                         
    614614                        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()); 
     1INSERT 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()); 
     2INSERT 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()); 
     3INSERT 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()); 
     4INSERT INTO `paymentmethods` (`id`, `name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('4', 'VISA', 'charge', '0', '0', '0', '', 1, NOW(), 1, NOW()); 
     5INSERT INTO `paymentmethods` (`id`, `name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('5', 'Mastercard', 'charge', '0', '0', '0', '', 1, NOW(), 1, NOW()); 
     6INSERT 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()); 
     7INSERT INTO `paymentmethods` (`id`, `name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('7', 'Cash', '', '20', '0', '0', '', 1, NOW(), 1, NOW()); 
     8INSERT 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()); 
     9INSERT 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()); 
     10INSERT INTO `paymentmethods` (`id`, `name`, `type`, `priority`, `inactive`, `onlineprocess`, `processscript`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('10', 'Money Order', '', '20', '0', '0', '', 1, NOW(), 1, NOW()); 
     11INSERT 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()); 
     12INSERT 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); 
     1INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'sales managers', 'salesmanagerid', '2', '9', 1, NOW(), 1, NOW(), '0'); 
     2INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('clientid', 'sales orders', 'id', '2', '3', 1, NOW(), 1, NOW(), '1'); 
     3INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'clients', 'clientid', '3', '2', 1, NOW(), 1, NOW(), '0'); 
     4INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'tax areas', 'taxareaid', '3', '6', 1, NOW(), 1, NOW(), '0'); 
     5INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'sales orders', 'invoiceid', '5', '3', 1, NOW(), 1, NOW(), '0'); 
     6INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'products', 'productid', '5', '4', 1, NOW(), 1, NOW(), '0'); 
     7INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'parent products', 'parentid', '8', '4', 1, NOW(), 1, NOW(), '0'); 
     8INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'child products', 'childid', '8', '4', 1, NOW(), 1, NOW(), '0'); 
     9INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('categoryid', 'products', 'id', '7', '4', 1, NOW(), 1, NOW(), '1'); 
     10INSERT 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'); 
     11INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('parentid', 'prerequisites', 'id', '4', '8', 1, NOW(), 1, NOW(), '1'); 
     12INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('taxareaid', 'sales orders', 'id', '6', '3', 1, NOW(), 1, NOW(), '0'); 
     13INSERT 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'); 
     14INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('createdby', 'created clients', 'id', '9', '2', 1, NOW(), 1, NOW(), '0'); 
     15INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('modifiedby', 'modified clients', 'id', '9', '2', 1, NOW(), 1, NOW(), '0'); 
     16INSERT 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'); 
     17INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('modifiedby', 'modified invoices', 'id', '9', '3', 1, NOW(), 1, NOW(), '0'); 
     18INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('invoiceid', 'line items', 'id', '3', '5', 1, NOW(), 1, NOW(), '1'); 
     19INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('discountid', 'sales orders', 'id', '25', '3', 1, NOW(), 1, NOW(), '0'); 
     20INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'discounts', 'discountid', '3', '25', 1, NOW(), 1, NOW(), '0'); 
     21INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'clients', 'clientid', '303', '2', 1, NOW(), 1, NOW(), '0'); 
     22INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('clientid', 'AR items', 'id', '2', '303', 1, NOW(), 1, NOW(), '1'); 
     23INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'invoices', 'relatedid', '303', '3', 1, NOW(), 1, NOW(), '0'); 
     24INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('relatedid', 'AR items', 'id', '3', '303', 1, NOW(), 1, NOW(), '0'); 
     25INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'clients', 'clientid', '304', '2', 1, NOW(), 1, NOW(), '0'); 
     26INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('clientid', 'receipts', 'id', '2', '304', 1, NOW(), 1, NOW(), '1'); 
     27INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'product categories', 'categoryid', '4', '7', 1, NOW(), 1, NOW(), '0'); 
     28INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('shippingmethodid', 'sales orders', 'id', '300', '3', 1, NOW(), 1, NOW(), '0'); 
     29INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('paymentmethodid', 'sales orders', 'id', '301', '3', 1, NOW(), 1, NOW(), '0'); 
     30INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('paymentmethodid', 'receipts', 'id', '301', '304', 1, NOW(), 1, NOW(), '1'); 
     31INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'receipts', 'relatedid', '303', '304', 1, NOW(), 1, NOW(), '0'); 
     32INSERT 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  
    195195INSERT INTO `tablesearchablefields` (`tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (304,'receipts.amount','amount',4,'field'); 
    196196INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (3,'mark_rtp','mark ready to post',1,20); 
     197DELETE FROM `relationships`; 
     198INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'sales managers', 'salesmanagerid', '2', '9', 1, NOW(), 1, NOW(), '0'); 
     199INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('clientid', 'sales orders', 'id', '2', '3', 1, NOW(), 1, NOW(), '1'); 
     200INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'clients', 'clientid', '3', '2', 1, NOW(), 1, NOW(), '0'); 
     201INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'tax areas', 'taxareaid', '3', '6', 1, NOW(), 1, NOW(), '0'); 
     202INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'sales orders', 'invoiceid', '5', '3', 1, NOW(), 1, NOW(), '0'); 
     203INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'products', 'productid', '5', '4', 1, NOW(), 1, NOW(), '0'); 
     204INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'parent products', 'parentid', '8', '4', 1, NOW(), 1, NOW(), '0'); 
     205INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'child products', 'childid', '8', '4', 1, NOW(), 1, NOW(), '0'); 
     206INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('categoryid', 'products', 'id', '7', '4', 1, NOW(), 1, NOW(), '1'); 
     207INSERT 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'); 
     208INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('parentid', 'prerequisites', 'id', '4', '8', 1, NOW(), 1, NOW(), '1'); 
     209INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('taxareaid', 'sales orders', 'id', '6', '3', 1, NOW(), 1, NOW(), '0'); 
     210INSERT 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'); 
     211INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('createdby', 'created clients', 'id', '9', '2', 1, NOW(), 1, NOW(), '0'); 
     212INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('modifiedby', 'modified clients', 'id', '9', '2', 1, NOW(), 1, NOW(), '0'); 
     213INSERT 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'); 
     214INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('modifiedby', 'modified invoices', 'id', '9', '3', 1, NOW(), 1, NOW(), '0'); 
     215INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('invoiceid', 'line items', 'id', '3', '5', 1, NOW(), 1, NOW(), '1'); 
     216INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('discountid', 'sales orders', 'id', '25', '3', 1, NOW(), 1, NOW(), '0'); 
     217INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'discounts', 'discountid', '3', '25', 1, NOW(), 1, NOW(), '0'); 
     218INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'clients', 'clientid', '303', '2', 1, NOW(), 1, NOW(), '0'); 
     219INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('clientid', 'AR items', 'id', '2', '303', 1, NOW(), 1, NOW(), '1'); 
     220INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'invoices', 'relatedid', '303', '3', 1, NOW(), 1, NOW(), '0'); 
     221INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('relatedid', 'AR items', 'id', '3', '303', 1, NOW(), 1, NOW(), '0'); 
     222INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'clients', 'clientid', '304', '2', 1, NOW(), 1, NOW(), '0'); 
     223INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('clientid', 'receipts', 'id', '2', '304', 1, NOW(), 1, NOW(), '1'); 
     224INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'product categories', 'categoryid', '4', '7', 1, NOW(), 1, NOW(), '0'); 
     225INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('shippingmethodid', 'sales orders', 'id', '300', '3', 1, NOW(), 1, NOW(), '0'); 
     226INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('paymentmethodid', 'sales orders', 'id', '301', '3', 1, NOW(), 1, NOW(), '0'); 
     227INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('paymentmethodid', 'receipts', 'id', '301', '304', 1, NOW(), 1, NOW(), '1'); 
     228INSERT INTO `relationships` (`tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES ('id', 'receipts', 'relatedid', '303', '304', 1, NOW(), 1, NOW(), '0'); 
     229INSERT 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  
    165165                         
    166166                        $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; 
    167172 
    168173                }//end while             
  • trunk/phpbms/modules/bms/snapshot.php

    r311 r312  
    251251                        WHERE 
    252252                          `status` = 'open' 
    253                           AND posted=1; 
    254                 "; 
     253                          AND posted=1"; 
    255254                 
    256255                $queryresult = $this->db->query($querystatement); 
     
    317316                $sumrecord = $this->db->fetchArray($sumresult); 
    318317                 
    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 { 
    322324                 
    323325                        ?> 
  • trunk/phpbms/modules/sample/include/sampletable.php

    r285 r312  
    1313*/   
    1414if(class_exists("phpbmsTable")){ 
    15         class [tablename] extends phpbmsTable{ 
     15        class tablename extends phpbmsTable{ 
    1616                 
    1717                // CLASS OVERRIDES =================================================================== 
Copyright © 2006-2007 Kreotek, LLC. All Rights reserved.