<?php
ini_set('display_errors', 1);

function InsertStockTransactionClassification($specific_db_conn, $workspace_id, $company_id, $branch_id, $book_id, $stock_id, $transaction_id, $ledgerid, $percentage, $total_amount, $adjusted_type, $sequence, $is_add, $index_stock_classification)
{

    try {

        // insert query of stock transaction 
        $sql = "INSERT INTO  inventory_stock_classification(workspace_id,company_id,branch_id,book_id,inventory_transaction_stockid,transaction_id,ledgerid,percentage,total_amount,adjusted_type,sequence,is_add, index_stock_classification)
                    VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
        $stmt =  $specific_db_conn->prepare($sql);
        $stmt->execute(array($workspace_id, $company_id, $branch_id, $book_id, $stock_id, $transaction_id, $ledgerid, $percentage, $total_amount, $adjusted_type, $sequence, $is_add, $index_stock_classification));
        $id = $specific_db_conn->lastInsertId();
        return true;
    } catch (Exception $e) {
        return false;
    }
}


function InsertShippingDetails($specific_db_conn, $workspace_id, $company_id, $branch_id, $book_id, $transaction_id, $date, $ledgerid, $name, $address_ln_1, $address_ln_2, $state_id, $country_id)
{

    try {

        // insert query of stock transaction 
        $sql = "INSERT INTO  act_shipping_details(workspace_id, company_id, branch_id, book_id,transaction_id,date,ledgerid,name,address_ln_1,address_ln_2,state_id,country_id)
                    VALUES(?,?,?,?,?,?,?,?,?,?,?,?)";
        $stmt =  $specific_db_conn->prepare($sql);
        $stmt->execute(array($workspace_id, $company_id, $branch_id, $book_id, $transaction_id, $date, $ledgerid, $name, $address_ln_1, $address_ln_2, $state_id, $country_id));
        $id = $specific_db_conn->lastInsertId();

        return true;
    } catch (Exception $e) {
        echo "Error : " . $e->getMessage();
    }
}
