1

Hi guys can we check order invoice is shipped or not like if order has 3 invoices i want to get only that invoice that is not shipped yet. I have order invoice collection and order shipment collection how can i check which invoice is shipped and which is not here is the code of both collection

Shipment collection

    array(1) {
  [0]=>
  array(15) {
    ["entity_id"]=>
    string(2) "14"
    ["store_id"]=>
    string(1) "1"
    ["total_weight"]=>
    NULL
    ["total_qty"]=>
    string(6) "2.0000"
    ["email_sent"]=>
    string(1) "1"
    ["order_id"]=>
    string(2) "40"
    ["customer_id"]=>
    string(2) "20"
    ["shipping_address_id"]=>
    string(2) "80"
    ["billing_address_id"]=>
    string(2) "79"
    ["shipment_status"]=>
    NULL
    ["increment_id"]=>
    string(9) "100000032"
    ["created_at"]=>
    string(19) "2016-09-26 06:45:46"
    ["updated_at"]=>
    string(19) "2016-09-26 06:45:51"
    ["packages"]=>
    NULL
    ["shipping_label"]=>
    NULL
  }

Invoice Collection

    array(2) {
  [0]=>
  array(63) {
    ["entity_id"]=>
    string(2) "20"
    ["store_id"]=>
    string(1) "1"
    ["base_grand_total"]=>
    string(8) "387.7000"
    ["shipping_tax_amount"]=>
    NULL
    ["tax_amount"]=>
    string(6) "0.0000"
    ["base_tax_amount"]=>
    string(6) "0.0000"
    ["store_to_order_rate"]=>
    string(6) "1.0000"
    ["base_shipping_tax_amount"]=>
    NULL
    ["base_discount_amount"]=>
    string(6) "0.0000"
    ["base_to_order_rate"]=>
    string(6) "1.0000"
    ["grand_total"]=>
    string(8) "387.7000"
    ["shipping_amount"]=>
    string(6) "5.7000"
    ["subtotal_incl_tax"]=>
    string(8) "382.0000"
    ["base_subtotal_incl_tax"]=>
    string(8) "382.0000"
    ["store_to_base_rate"]=>
    string(6) "1.0000"
    ["base_shipping_amount"]=>
    string(6) "0.0000"
    ["total_qty"]=>
    string(6) "4.0000"
    ["base_to_global_rate"]=>
    string(6) "1.0000"
    ["subtotal"]=>
    string(8) "382.0000"
    ["base_subtotal"]=>
    string(8) "382.0000"
    ["discount_amount"]=>
    string(6) "0.0000"
    ["billing_address_id"]=>
    string(2) "79"
    ["is_used_for_refund"]=>
    NULL
    ["order_id"]=>
    string(2) "40"
    ["email_sent"]=>
    string(1) "1"
    ["can_void_flag"]=>
    string(1) "0"
    ["state"]=>
    string(1) "2"
    ["shipping_address_id"]=>
    string(2) "80"
    ["store_currency_code"]=>
    string(3) "BHD"
    ["transaction_id"]=>
    NULL
    ["order_currency_code"]=>
    string(3) "BHD"
    ["base_currency_code"]=>
    string(3) "BHD"
    ["global_currency_code"]=>
    string(3) "BHD"
    ["increment_id"]=>
    string(9) "100000044"
    ["created_at"]=>
    string(19) "2016-09-25 14:07:57"
    ["updated_at"]=>
    string(19) "2016-09-25 14:07:57"
    ["hidden_tax_amount"]=>
    string(6) "0.0000"
    ["base_hidden_tax_amount"]=>
    string(6) "0.0000"
    ["shipping_hidden_tax_amount"]=>
    NULL
    ["base_shipping_hidden_tax_amnt"]=>
    NULL
    ["shipping_incl_tax"]=>
    NULL
    ["base_shipping_incl_tax"]=>
    NULL
    ["base_total_refunded"]=>
    NULL
    ["discount_description"]=>
    NULL
    ["base_customer_balance_amount"]=>
    NULL
    ["customer_balance_amount"]=>
    NULL
    ["base_gift_cards_amount"]=>
    string(6) "0.0000"
    ["gift_cards_amount"]=>
    string(6) "0.0000"
    ["gw_base_price"]=>
    NULL
    ["gw_price"]=>
    NULL
    ["gw_items_base_price"]=>
    NULL
    ["gw_items_price"]=>
    NULL
    ["gw_card_base_price"]=>
    NULL
    ["gw_card_price"]=>
    NULL
    ["gw_base_tax_amount"]=>
    NULL
    ["gw_tax_amount"]=>
    NULL
    ["gw_items_base_tax_amount"]=>
    NULL
    ["gw_items_tax_amount"]=>
    NULL
    ["gw_card_base_tax_amount"]=>
    NULL
    ["gw_card_tax_amount"]=>
    NULL
    ["base_reward_currency_amount"]=>
    NULL
    ["reward_currency_amount"]=>
    NULL
    ["reward_points_balance"]=>
    NULL
  }
  [1]=>
  array(63) {
    ["entity_id"]=>
    string(2) "21"
    ["store_id"]=>
    string(1) "1"
    ["base_grand_total"]=>
    string(8) "387.7000"
    ["shipping_tax_amount"]=>
    NULL
    ["tax_amount"]=>
    string(6) "0.0000"
    ["base_tax_amount"]=>
    string(6) "0.0000"
    ["store_to_order_rate"]=>
    string(6) "1.0000"
    ["base_shipping_tax_amount"]=>
    NULL
    ["base_discount_amount"]=>
    string(6) "0.0000"
    ["base_to_order_rate"]=>
    string(6) "1.0000"
    ["grand_total"]=>
    string(8) "387.7000"
    ["shipping_amount"]=>
    string(6) "5.7000"
    ["subtotal_incl_tax"]=>
    string(8) "382.0000"
    ["base_subtotal_incl_tax"]=>
    string(8) "382.0000"
    ["store_to_base_rate"]=>
    string(6) "1.0000"
    ["base_shipping_amount"]=>
    string(6) "0.0000"
    ["total_qty"]=>
    string(6) "3.0000"
    ["base_to_global_rate"]=>
    string(6) "1.0000"
    ["subtotal"]=>
    string(8) "382.0000"
    ["base_subtotal"]=>
    string(8) "382.0000"
    ["discount_amount"]=>
    string(6) "0.0000"
    ["billing_address_id"]=>
    string(2) "79"
    ["is_used_for_refund"]=>
    NULL
    ["order_id"]=>
    string(2) "40"
    ["email_sent"]=>
    string(1) "1"
    ["can_void_flag"]=>
    string(1) "0"
    ["state"]=>
    string(1) "2"
    ["shipping_address_id"]=>
    string(2) "80"
    ["store_currency_code"]=>
    string(3) "BHD"
    ["transaction_id"]=>
    NULL
    ["order_currency_code"]=>
    string(3) "BHD"
    ["base_currency_code"]=>
    string(3) "BHD"
    ["global_currency_code"]=>
    string(3) "BHD"
    ["increment_id"]=>
    string(9) "100000045"
    ["created_at"]=>
    string(19) "2016-09-26 07:10:26"
    ["updated_at"]=>
    string(19) "2016-09-26 07:10:26"
    ["hidden_tax_amount"]=>
    string(6) "0.0000"
    ["base_hidden_tax_amount"]=>
    string(6) "0.0000"
    ["shipping_hidden_tax_amount"]=>
    NULL
    ["base_shipping_hidden_tax_amnt"]=>
    NULL
    ["shipping_incl_tax"]=>
    NULL
    ["base_shipping_incl_tax"]=>
    NULL
    ["base_total_refunded"]=>
    NULL
    ["discount_description"]=>
    NULL
    ["base_customer_balance_amount"]=>
    NULL
    ["customer_balance_amount"]=>
    NULL
    ["base_gift_cards_amount"]=>
    string(6) "0.0000"
    ["gift_cards_amount"]=>
    string(6) "0.0000"
    ["gw_base_price"]=>
    NULL
    ["gw_price"]=>
    NULL
    ["gw_items_base_price"]=>
    NULL
    ["gw_items_price"]=>
    NULL
    ["gw_card_base_price"]=>
    NULL
    ["gw_card_price"]=>
    NULL
    ["gw_base_tax_amount"]=>
    NULL
    ["gw_tax_amount"]=>
    NULL
    ["gw_items_base_tax_amount"]=>
    NULL
    ["gw_items_tax_amount"]=>
    NULL
    ["gw_card_base_tax_amount"]=>
    NULL
    ["gw_card_tax_amount"]=>
    NULL
    ["base_reward_currency_amount"]=>
    NULL
    ["reward_currency_amount"]=>
    NULL
    ["reward_points_balance"]=>
    NULL
  }
}
0

Hi Invoice is not related to shipment, but you can easily relate invoice item to shipped order item With a query like :

select sfoi.* from sales_flat_order_item sfoi left join sales_flat_invoice_item sfii on sfii.parent_id = sfoi.item_id
where sfoi.qty_shipped > 0;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.