Documentation

crm.vat.add

crm.vat.add(fields)

Create new tax rate.

Parameters

Parameter Description
fields Set of fields is an array of the array("field"=>"value"[, ...]) type, containing the values of the tax rate.

Example

 var current = new Date();
 var date2str = function(d)
 {
  return d.getFullYear() + '-' + paddatepart(1 + d.getMonth()) + '-' + paddatepart(d.getDate()) + 'T' + paddatepart(d.getHours())
   + ':' + paddatepart(d.getMinutes()) + ':' + paddatepart(d.getSeconds()) + '+03:00';
 };
 var paddatepart = function(part)
 {
  return part >= 10 ? part.toString() : '0' + part.toString();
 };
 BX24.callMethod(
  "crm.vat.add",
  {
   "FIELDS":
   {
    "TIMESTAMP_X": date2str(current),
    "ACTIVE": "Y",
    "C_SORT": 110,
    "NAME": "VAT 13%",
    "RATE": 13.00
   }
  },
  function(result)
  {
   if(result.error())
    console.error(result.error());
   else
    console.info("New tax rate has been created with ID " + result.data());
  }
 );



User Comments

User comments are not part of official documentation. Use information provided by other users in the comments at your own risk.

The User Comments section is not to be used as a feature discussion board. Only registered users can post comments. Your comment will be visible once it has been approved by the moderator.
© «Bitrix Inc.», 2001-2019, «Bitrix Inc.», 2019