Skip to main content

PurchaseRequisitionItem

Struct PurchaseRequisitionItem 

Source
pub struct PurchaseRequisitionItem {
Show 18 fields pub base: DocumentLineItem, pub requester: String, pub approver: Option<String>, pub purchasing_group: Option<String>, pub preferred_vendor: Option<String>, pub fixed_vendor: Option<String>, pub budget_center: Option<String>, pub is_approved: bool, pub is_rejected: bool, pub rejection_reason: Option<String>, pub reason: Option<String>, pub requested_date: Option<NaiveDate>, pub item_category: String, pub account_assignment_category: String, pub purchase_order_id: Option<String>, pub purchase_order_item: Option<u16>, pub is_closed: bool, pub tracking_number: Option<String>,
}
Expand description

Purchase Requisition line item with procurement-specific fields.

Fields§

§base: DocumentLineItem

Base line item fields

§requester: String

Requester user ID

§approver: Option<String>

Approver user ID (when approved)

§purchasing_group: Option<String>

Purchasing group to handle this item

§preferred_vendor: Option<String>

Preferred vendor ID (if any)

§fixed_vendor: Option<String>

Fixed vendor (must use this vendor)

§budget_center: Option<String>

Budget center for approval

§is_approved: bool

Is this item approved?

§is_rejected: bool

Is this item rejected?

§rejection_reason: Option<String>

Rejection reason

§reason: Option<String>

Business justification/reason for request

§requested_date: Option<NaiveDate>

Requested delivery date

§item_category: String

Item category (goods, service, limit, etc.)

§account_assignment_category: String

Account assignment category (K=cost center, F=order, etc.)

§purchase_order_id: Option<String>

Related Purchase Order ID (once converted)

§purchase_order_item: Option<u16>

Related PO item number

§is_closed: bool

Is this item closed (cannot be converted)?

§tracking_number: Option<String>

Tracking number for status updates

Implementations§

Source§

impl PurchaseRequisitionItem

Source

pub fn new( line_number: u16, description: impl Into<String>, quantity: Decimal, unit_price: Decimal, requester: impl Into<String>, ) -> Self

Create a new purchase requisition item.

Source

pub fn service( line_number: u16, description: impl Into<String>, quantity: Decimal, unit_price: Decimal, requester: impl Into<String>, ) -> Self

Create a service line item.

Source

pub fn with_cost_center(self, cost_center: impl Into<String>) -> Self

Set cost center.

Source

pub fn with_gl_account(self, account: impl Into<String>) -> Self

Set GL account.

Source

pub fn with_material(self, material_id: impl Into<String>) -> Self

Set material.

Source

pub fn with_purchasing_group(self, group: impl Into<String>) -> Self

Set purchasing group.

Source

pub fn with_preferred_vendor(self, vendor: impl Into<String>) -> Self

Set preferred vendor.

Source

pub fn with_fixed_vendor(self, vendor: impl Into<String>) -> Self

Set fixed vendor (mandatory source).

Source

pub fn with_requested_date(self, date: NaiveDate) -> Self

Set requested delivery date.

Source

pub fn with_reason(self, reason: impl Into<String>) -> Self

Set business justification.

Source

pub fn with_budget_center(self, budget_center: impl Into<String>) -> Self

Set budget center.

Source

pub fn approve(&mut self, approver: impl Into<String>)

Approve the line item.

Source

pub fn reject(&mut self, approver: impl Into<String>, reason: impl Into<String>)

Reject the line item.

Source

pub fn convert_to_po(&mut self, po_id: impl Into<String>, po_item: u16)

Convert to PO (mark as converted).

Source

pub fn close(&mut self)

Close the item (cannot be converted).

Source

pub fn can_convert(&self) -> bool

Check if item can be converted to PO.

Source

pub fn open_quantity(&self) -> Decimal

Get open quantity (not yet converted to PO).

Trait Implementations§

Source§

impl Clone for PurchaseRequisitionItem

Source§

fn clone(&self) -> PurchaseRequisitionItem

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PurchaseRequisitionItem

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PurchaseRequisitionItem

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for PurchaseRequisitionItem

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,