Advertisement
Guest User

Untitled

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