Advertisement
Guest User

Untitled

a guest
Jul 7th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.48 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * QuickBooks InventoryItem object container
  5.  *
  6.  * @todo Verify the get/set methods on this one... it was copied from NonInventoryItem
  7.  * @todo Add isActive(), getIsActive(), etc. methods
  8.  *
  9.  * @author Keith Palmer <keith@consolibyte.com>
  10.  * @license LICENSE.txt
  11.  *
  12.  * @package QuickBooks
  13.  * @subpackage Object
  14.  */
  15.  
  16. /**
  17.  *
  18.  */
  19. QuickBooks_Loader::load('/QuickBooks/QBXML/Object.php');
  20.  
  21. /**
  22.  *
  23.  */
  24. class QuickBooks_QBXML_Object_PurchaseOrder extends QuickBooks_QBXML_Object
  25. {
  26.     public function __construct($arr = array())
  27.     {
  28.         parent::__construct($arr);
  29.     }
  30.    
  31.     /**
  32.      * Set the transaction date of the purchase order
  33.      *
  34.      * @param string $date
  35.      * @return boolean
  36.      */
  37.     public function setTxnDate($date)
  38.     {
  39.         return $this->set('TxnDate', $date);
  40.     }
  41.  
  42.     public function getTxnNumber() {
  43.         return $this->get('TxnDate');
  44.     }
  45.  
  46.     /**
  47.      * Set RefNumber of the purchase order
  48.      * @param $refnumber
  49.      * @return bool
  50.      */
  51.     public function setRefNumber($refnumber) {
  52.         return $this->set('RefNumber', $refnumber);
  53.     }
  54.  
  55.     public function getRefNumber() {
  56.         return $this->get('RefNumber');
  57.     }
  58.  
  59.     /**
  60.      * Get the name for this item
  61.      *
  62.      * @return string
  63.      */
  64.     public function getName()
  65.     {
  66.         return $this->get('Name');
  67.     }
  68.    
  69.     public function setFullName($fullname)
  70.     {
  71.         return $this->setFullNameType('FullName', 'Name', 'ParentRef FullName', $fullname);
  72.     }
  73.    
  74.     public function getFullName()
  75.     {
  76.         return $this->getFullNameType('FullName', 'Name', 'ParentRef FullName');
  77.     }  
  78.  
  79.     /**
  80.      * Set the account ListID for this item
  81.      *
  82.      * @param string $ListID
  83.      * @return string
  84.      */
  85.     public function setItemDescription($desc)
  86.     {
  87.         return $this->set('PurchaseOrderLineAdd Desc', $desc);
  88.     }
  89.  
  90.     public function setItemQuantity($qty) {
  91.         return $this->set('PurchaseOrderLineAdd Quantity', $qty);
  92.     }
  93.  
  94.     public function setItemRate($rate) {
  95.         return $this->set('PurchaseOrderLineAdd Rate', $rate);
  96.     }
  97.    
  98.     public function setVendorRefFullName($FullName)
  99.     {
  100.         return $this->setFullNameType('VendorRef FullName', null, null, $FullName);
  101.     }
  102.  
  103.    
  104.     /**
  105.      * Get Vendor Full Name
  106.      */
  107.     public function getVendorRefFullName()
  108.     {
  109.         return $this->get('VendorRef FullName');
  110.     }
  111.  
  112.     /**
  113.      * Set Item Full Name
  114.      */
  115.     public function setItemFullName($itemFullName) {
  116.         return $this->setFullNameType('PurchaseOrderLineAdd ItemRef FullName', null, null, $itemFullName);
  117.     }
  118.  
  119.  
  120.    
  121.     /**
  122.      *
  123.      *
  124.      * @return boolean
  125.      */
  126.     protected function _cleanup()
  127.     {
  128.        
  129.         return true;
  130.     }
  131.    
  132.     /**
  133.      *
  134.      */
  135.     public function asArray($request, $nest = true)
  136.     {
  137.         $this->_cleanup();
  138.        
  139.         return parent::asArray($request, $nest);
  140.     }
  141.    
  142.     /**
  143.      * Convert this object to a valid qbXML request
  144.      *
  145.      * @param string $request                   The type of request to convert this to (examples: CustomerAddRq, CustomerModRq, CustomerQueryRq)
  146.      * @param boolean $todo_for_empty_elements  A constant, one of: QUICKBOOKS_XML_XML_COMPRESS, QUICKBOOKS_XML_XML_DROP, QUICKBOOKS_XML_XML_PRESERVE
  147.      * @param string $indent
  148.      * @param string $root
  149.      * @return string
  150.      */
  151.     public function asQBXML($request, $version = null, $locale = null, $root = null)
  152.     {
  153.         $this->_cleanup();
  154.        
  155.         return parent::asQBXML($request, $version, $locale, $root);
  156.     }
  157.    
  158.     /**
  159.      * Tell what type of object this is
  160.      *
  161.      * @return string
  162.      */
  163.     public function object()
  164.     {
  165.         return QUICKBOOKS_OBJECT_PURCHASEORDER;
  166.     }
  167. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement