You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
how to create an invoice with multiple payment methods in one order, such as half payment in cash and half payment with a credit card, and then how to handle this in Netsuite
#162
$customerId = customer_id;
// Replace placeholder values with your actual data
$customPriceLevelId = $this->getCustomPriceLevelId('Retail Price'); // Replace with your actual method to get custom price level ID
$stripePaymentMethodId = 7; // Replace with your actual method to get Stripe payment method ID
$otherPaymentMethodId = 1; // Replace with your actual method to get the other payment method ID
$so = new SalesOrder();
$so->entity = new RecordRef();
$so->entity->internalId = $customerId;
// Set the shipping address details
$so->shippingAddress = new Address();
$so->shippingAddress->attention = " Test";
$so->shippingAddress->addressee = " Test";
$so->shippingAddress->addr1 = "Test";
$so->shippingAddress->addr2 = "";
$so->shippingAddress->addr3 = "";
$so->shippingAddress->addrPhone = "";
$so->shippingAddress->city = "text";
$so->shippingAddress->state = "";
$so->shippingAddress->zip = "test";
// $so->shippingAddress->country = "United Kingdom"; // not worked
$so->shippingAddress->country = Country::_unitedKingdom;
// Add line items to the Sales Order
$so->itemList = new SalesOrderItemList();
$soi = new SalesOrderItem();
$soi->item = new RecordRef();
$soi->item->internalId = ITEM_ID;
$soi->quantity = 3;
$soi->price = new RecordRef();
$soi->price->internalId = $customPriceLevelId;
$soi->amount = 55.3;
$soi->taxRate1 = 0;
// $soi->tax1Amt = 4.7;
// $soi->isTaxable = false; // not worked
// $soi->taxAmount = 1.1; // not worked
// $soi->taxRate1 = 1.1;
// $soi->taxRate2 = 1.2; // not worked
$so->itemList->item = array($soi);
// Add payment details in Sales Order
$so->paymentMethod = new RecordRef();
// Add the Sales Order
$request = new AddRequest();
$request->record = $so;
$addResponse = $this->serviceNetSuite->add($request);
if (!$addResponse->writeResponse->status->isSuccess) {
echo "ADD ERROR";
re($addResponse);
exit();
} else {
echo "ADD SUCCESS, id " . $addResponse->writeResponse->baseRef->internalId;
re($addResponse);
exit;
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
//I am Using Laravel I Have Done Order creation
$customerId = customer_id;
// Replace placeholder values with your actual data
$customPriceLevelId = $this->getCustomPriceLevelId('Retail Price'); // Replace with your actual method to get custom price level ID
$stripePaymentMethodId = 7; // Replace with your actual method to get Stripe payment method ID
$otherPaymentMethodId = 1; // Replace with your actual method to get the other payment method ID
Beta Was this translation helpful? Give feedback.
All reactions