<div dir="ltr">Please unsubscribe me from your mailing list.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 6, 2020 at 6:45 PM <<a href="mailto:vtigercrm-developers-request@lists.vtigercrm.com">vtigercrm-developers-request@lists.vtigercrm.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Send vtigercrm-developers mailing list submissions to<br>
        <a href="mailto:vtigercrm-developers@lists.vtigercrm.com" target="_blank">vtigercrm-developers@lists.vtigercrm.com</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://lists.vtigercrm.com/cgi-bin/mailman/listinfo/vtigercrm-developers" rel="noreferrer" target="_blank">http://lists.vtigercrm.com/cgi-bin/mailman/listinfo/vtigercrm-developers</a><br>
<br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:vtigercrm-developers-request@lists.vtigercrm.com" target="_blank">vtigercrm-developers-request@lists.vtigercrm.com</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:vtigercrm-developers-owner@lists.vtigercrm.com" target="_blank">vtigercrm-developers-owner@lists.vtigercrm.com</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of vtigercrm-developers digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. Re: Creating Inventory records via Webservice (Martin Allen)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Tue, 6 Oct 2020 14:12:27 +0100<br>
From: Martin Allen <<a href="mailto:martin.allen@clystnet.com" target="_blank">martin.allen@clystnet.com</a>><br>
To: <a href="mailto:vtigercrm-developers@lists.vtigercrm.com" target="_blank">vtigercrm-developers@lists.vtigercrm.com</a><br>
Subject: Re: [Vtigercrm-developers] Creating Inventory records via<br>
        Webservice<br>
Message-ID:<br>
        <CAL1vgxHB1gFF262kEDzoprYK=iZEP3LEDP0F4hRK=<a href="mailto:SCZM2Otmw@mail.gmail.com" target="_blank">SCZM2Otmw@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Aah, hadn't thought about describing the LineItems separately - I was<br>
expecting to see it in the Describe for the Inventory module. Or even just<br>
a reference to LineItems as a module!<br>
<br>
Thanks.<br>
<br>
I did manage to stumble across this data structure (in a random community<br>
discussion) as a starting point that works so far - if anyone else has the<br>
same problem!<br>
<br>
$params = array (<br>
'assigned_user_id' => 'administrator',<br>
'subject' => 'REST salesOrderSubject 6',<br>
'bill_city' => 'Drachten',<br>
'bill_code' => '9205BB',<br>
'bill_country' => 'Netherland',<br>
'bill_pobox' => '',<br>
'bill_state' => '',<br>
'bill_street' => 'schuur 86',<br>
'carrier' => NULL,<br>
'contact_id' => NULL,<br>
'conversion_rate' => '1.000',<br>
'currency_id' => '21x1',<br>
'customerno' => NULL,<br>
'description' => 'Producten in deze verkooporder: 2 X Heart of David -<br>
songbook 2',<br>
'duedate' => '2018-11-06',<br>
'enable_recurring' => '0',<br>
'end_period' => NULL,<br>
'exciseduty' => '0.000',<br>
'invoicestatus' => 'Approved',<br>
'payment_duration' => NULL,<br>
'pending' => NULL,<br>
'potential_id' => NULL,<br>
'productid' => '14x42',<br>
'vtiger_purchaseorder' => NULL,<br>
'quote_id' => NULL,<br>
'recurring_frequency' => NULL,<br>
'salescommission' => '0.000',<br>
'ship_city' => 'schuur 86',<br>
'ship_code' => '9205BB',<br>
'ship_country' => 'Netherlands',<br>
'ship_pobox' => NULL,<br>
'ship_state' => NULL,<br>
'ship_street' => 'Drachten',<br>
'account_id' => '11x37',<br>
'sostatus' => 'Approved',<br>
'start_period' => NULL,<br>
'salesorder_no' => NULL,<br>
'terms_conditions' => 'The payment is expected within 30 days.',<br>
'discount_type_final' => 'percentage', // zero/amount/percentage<br>
'hdnDiscountAmount' => '0.000', // only used if 'discount_type_final'<br>
== 'amount'<br>
'hdnDiscountPercent' => '20.000', // only used if<br>
'discount_type_final' == 'percentage'<br>
'pre_tax_total' => '1000.00',<br>
'txtAdjustment' => '25.00',<br>
'hdnS_H_Amount' => '20.00',<br>
'hdnS_H_Percent' => '19',<br>
'shipping_handling_charge' => 0,<br>
'shtax1' => 0, // apply this tax, MUST exist in the application with<br>
this internal taxname<br>
'shtax2' => 0, // apply this tax, MUST exist in the application with<br>
this internal taxname<br>
'shtax3' => 0, // apply this tax, MUST exist in the application with<br>
this internal taxname<br>
'adjustmentType' => 'add', // none/add/deduct<br>
'hdnTaxType' => 'group', // group or individual taxes are obtained<br>
from the application<br>
'LineItems' => Array(<br>
'0' => Array (<br>
'productid' => '14x42',<br>
'sequence_no' => '1',<br>
'quantity' => '1.000',<br>
'listprice' => '500.00',<br>
'discount_percent' => null,<br>
'discount_amount' => null,<br>
'comment' => 'sample comment product',<br>
'description' => 'product description',<br>
'incrementondel' => '0',<br>
'tax1' => '19.00',<br>
'tax2' => '0.00',<br>
'tax3' => '0.00'<br>
),<br>
<br>
    )<br>
);<br>
<br>
Martin Allen<br>
<br>
<br>
*01392 248692 - Main Office01392 690659 - Direct Line*<br>
<br>
*[image: signature2]*<br>
<br>
Have you visited our website recently? <a href="http://www.clystnet.com" rel="noreferrer" target="_blank">http://www.clystnet.com</a><br>
<br>
<br>
The information in this email is confidential If you are not the intended<br>
recipient, you must not read or use that information. This email and any<br>
attachments are believed to be virus free however no responsibility is<br>
accepted by Clystnet for any loss or damage arising in any way from receipt<br>
or use thereof. Clystnet Ltd (company reg number 7164503) is based at<br>
Silverdown Park, Fair Oak Close, Clyst Honiton, EX5 2UX<br>
<br>
<br>
On Tue, 6 Oct 2020 at 13:40, Alan Lord <<a href="mailto:alanslists@gmail.com" target="_blank">alanslists@gmail.com</a>> wrote:<br>
<br>
> Try calling vtsw_describe for both the Inventory module you are creating<br>
> AND for the "LineItem" module ;-)<br>
><br>
> It will show you which fields are mandatory etc:...<br>
><br>
> > vtws_describe for LineItem<br>
> > Array<br>
> > (<br>
> >     [label] => LineItem<br>
> >     [name] => LineItem<br>
> >     [createable] => 1<br>
> >     [updateable] => 1<br>
> >     [deleteable] => 1<br>
> >     [retrieveable] => 1<br>
> >     [fields] => Array<br>
> >         (<br>
> >             [0] => Array<br>
> >                 (<br>
> >                     [name] => parent_id<br>
> >                     [label] => parent id<br>
> >                     [mandatory] =><br>
> >                     [type] => Array<br>
> >                         (<br>
> >                             [refersTo] => Array<br>
> >                                 (<br>
> >                                     [0] => Invoice<br>
> >                                     [1] => Quotes<br>
> >                                     [2] => PurchaseOrder<br>
> >                                     [3] => SalesOrder<br>
> >                                 )<br>
> ><br>
> >                             [name] => reference<br>
> >                         )<br>
> ><br>
> >                     [nullable] => 1<br>
> >                     [editable] => 1<br>
> >                 )<br>
> ><br>
> >             [1] => Array<br>
> >                 (<br>
> >                     [name] => productid<br>
> >                     [label] => productid<br>
> >                     [mandatory] => 1<br>
> >                     [type] => Array<br>
> >                         (<br>
> >                             [refersTo] => Array<br>
> >                                 (<br>
> >                                     [0] => Products<br>
> >                                     [1] => Services<br>
> >                                 )<br>
> ><br>
> >                             [name] => reference<br>
> >                         )<br>
> ><br>
> >                     [nullable] => 1<br>
> >                     [editable] => 1<br>
> >                 )<br>
> ><br>
> >             [2] => Array<br>
> >                 (<br>
> >                     [name] => sequence_no<br>
> >                     [label] => sequence no<br>
> >                     [mandatory] =><br>
> >                     [type] => Array<br>
> >                         (<br>
> >                             [name] => integer<br>
> >                         )<br>
> ><br>
> >                     [nullable] => 1<br>
> >                     [editable] => 1<br>
> >                 )<br>
> ><br>
> >             [3] => Array<br>
> >                 (<br>
> >                     [name] => quantity<br>
> >                     [label] => quantity<br>
> >                     [mandatory] => 1<br>
> >                     [type] => Array<br>
> >                         (<br>
> >                             [name] => double<br>
> >                         )<br>
> ><br>
> >                     [nullable] => 1<br>
> >                     [editable] => 1<br>
> >                 )<br>
> ><br>
> >             [4] => Array<br>
> >                 (<br>
> >                     [name] => listprice<br>
> >                     [label] => listprice<br>
> >                     [mandatory] =><br>
> >                     [type] => Array<br>
> >                         (<br>
> >                             [name] => double<br>
> >                         )<br>
> ><br>
> >                     [nullable] => 1<br>
> >                     [editable] => 1<br>
> >                 )<br>
> ><br>
> >             [5] => Array<br>
> >                 (<br>
> >                     [name] => discount_percent<br>
> >                     [label] => discount percent<br>
> >                     [mandatory] =><br>
> >                     [type] => Array<br>
> >                         (<br>
> >                             [name] => double<br>
> >                         )<br>
> ><br>
> >                     [nullable] => 1<br>
> >                     [editable] => 1<br>
> >                 )<br>
> ><br>
> >             [6] => Array<br>
> >                 (<br>
> >                     [name] => discount_amount<br>
> >                     [label] => discount amount<br>
> >                     [mandatory] =><br>
> >                     [type] => Array<br>
> >                         (<br>
> >                             [name] => double<br>
> >                         )<br>
> ><br>
> >                     [nullable] => 1<br>
> >                     [editable] => 1<br>
> >                 )<br>
> ><br>
> >             [7] => Array<br>
> >                 (<br>
> >                     [name] => comment<br>
> >                     [label] => comment<br>
> >                     [mandatory] =><br>
> >                     [type] => Array<br>
> >                         (<br>
> >                             [name] => text<br>
> >                         )<br>
> ><br>
> >                     [nullable] => 1<br>
> >                     [editable] => 1<br>
> >                 )<br>
> ><br>
> >             [8] => Array<br>
> >                 (<br>
> >                     [name] => incrementondel<br>
> >                     [label] => incrementondel<br>
> >                     [mandatory] =><br>
> >                     [type] => Array<br>
> >                         (<br>
> >                             [name] => autogenerated<br>
> >                         )<br>
> ><br>
> >                     [nullable] =><br>
> >                     [editable] =><br>
> >                     [default] => 0<br>
> >                 )<br>
> ><br>
> >             [9] => Array<br>
> >                 (<br>
> >                     [name] => id<br>
> >                     [label] => lineitem id<br>
> >                     [mandatory] =><br>
> >                     [type] => Array<br>
> >                         (<br>
> >                             [name] => autogenerated<br>
> >                         )<br>
> ><br>
> >                     [editable] =><br>
> >                     [nullable] =><br>
> >                     [default] =><br>
> >                 )<br>
> ><br>
> >             [10] => Array<br>
> >                 (<br>
> >                     [name] => tax1<br>
> >                     [label] => VAT<br>
> >                     [mandatory] =><br>
> >                     [type] => Array<br>
> >                         (<br>
> >                             [name] => double<br>
> >                         )<br>
> ><br>
> >                     [nullable] => 1<br>
> >                     [editable] => 1<br>
> >                 )<br>
> ><br>
> >             [11] => Array<br>
> >                 (<br>
> >                     [name] => tax2<br>
> >                     [label] => Sales<br>
> >                     [mandatory] =><br>
> >                     [type] => Array<br>
> >                         (<br>
> >                             [name] => double<br>
> >                         )<br>
> ><br>
> >                     [nullable] => 1<br>
> >                     [editable] => 1<br>
> >                 )<br>
> ><br>
> >             [12] => Array<br>
> >                 (<br>
> >                     [name] => tax3<br>
> >                     [label] => Service<br>
> >                     [mandatory] =><br>
> >                     [type] => Array<br>
> >                         (<br>
> >                             [name] => double<br>
> >                         )<br>
> ><br>
> >                     [nullable] => 1<br>
> >                     [editable] => 1<br>
> >                 )<br>
> ><br>
> >             [13] => Array<br>
> >                 (<br>
> >                     [name] => image<br>
> >                     [label] => image<br>
> >                     [mandatory] =><br>
> >                     [type] => Array<br>
> >                         (<br>
> >                             [name] => string<br>
> >                         )<br>
> ><br>
> >                     [nullable] => 1<br>
> >                     [editable] => 1<br>
> >                 )<br>
> ><br>
> >             [14] => Array<br>
> >                 (<br>
> >                     [name] => purchase_cost<br>
> >                     [label] => purchase cost<br>
> >                     [mandatory] =><br>
> >                     [type] => Array<br>
> >                         (<br>
> >                             [name] => double<br>
> >                         )<br>
> ><br>
> >                     [nullable] => 1<br>
> >                     [editable] => 1<br>
> >                 )<br>
> ><br>
> >             [15] => Array<br>
> >                 (<br>
> >                     [name] => margin<br>
> >                     [label] => margin<br>
> >                     [mandatory] =><br>
> >                     [type] => Array<br>
> >                         (<br>
> >                             [name] => double<br>
> >                         )<br>
> ><br>
> >                     [nullable] => 1<br>
> >                     [editable] => 1<br>
> >                 )<br>
> ><br>
> >         )<br>
> ><br>
> >     [idPrefix] => 33<br>
> >     [isEntity] =><br>
> >     [labelFields] =><br>
> > )<br>
><br>
><br>
><br>
> On 06/10/2020 13:34, Martin Allen wrote:<br>
> > Has anyone been able to successfully create a<br>
> > Quote/Invoice/SalesOrder/PurchaseOrder record via WebService? If so what<br>
> > data structure does it require?<br>
> ><br>
> > I am trying and keep getting a blank 200 response - I know that I need<br>
> > to add a 'LineItem' array but have no idea what fields need to be in it?<br>
> ><br>
> > Can't find any documentation on this...<br>
> ><br>
> > Martin Allen<br>
> ><br>
> > *01392 248692 - Main Office<br>
> > 01392 690659 - Direct Line*<br>
> ><br>
> > *signature2*<br>
> ><br>
> > Have you visited our website recently? <a href="http://www.clystnet.com" rel="noreferrer" target="_blank">http://www.clystnet.com</a><br>
> > <<a href="http://www.clystnet.com/" rel="noreferrer" target="_blank">http://www.clystnet.com/</a>><br>
> ><br>
> ><br>
> > The information in this email is confidential If you are not the<br>
> > intended recipient, you must not read or use that information. This<br>
> > email and any attachments are believed to be virus free however no<br>
> > responsibility is accepted by Clystnet for any loss or damage arising in<br>
> > any way from receipt or use thereof. Clystnet Ltd (company reg number<br>
> > 7164503) is based at Silverdown Park, Fair Oak Close, Clyst Honiton, EX5<br>
> 2UX<br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > <a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a><br>
> ><br>
> _______________________________________________<br>
> <a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a><br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20201006/1ec57aa4/attachment.html" rel="noreferrer" target="_blank">http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20201006/1ec57aa4/attachment.html</a>><br>
-------------- next part --------------<br>
A non-text attachment was scrubbed...<br>
Name: image001.png<br>
Type: image/png<br>
Size: 10550 bytes<br>
Desc: not available<br>
URL: <<a href="http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20201006/1ec57aa4/attachment.png" rel="noreferrer" target="_blank">http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20201006/1ec57aa4/attachment.png</a>><br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
vtigercrm-developers mailing list<br>
<a href="mailto:vtigercrm-developers@lists.vtigercrm.com" target="_blank">vtigercrm-developers@lists.vtigercrm.com</a><br>
<a href="http://lists.vtigercrm.com/cgi-bin/mailman/listinfo/vtigercrm-developers" rel="noreferrer" target="_blank">http://lists.vtigercrm.com/cgi-bin/mailman/listinfo/vtigercrm-developers</a><br>
<br>
<br>
End of vtigercrm-developers Digest, Vol 177, Issue 28<br>
*****************************************************<br>
</blockquote></div>