Изменение значения НДС

Ключ
Эта строка удалена.
Это слово было удалено. Это слово было добавлено.
Эта строка добавлена.

Изменения (4)

просмотр истории страницы
h1. Исправление всех услуг, абонентов и папок
Установить НДС 22% во всех услугах:
{code}sqlexec "set list; select id from usluga" | awk '$2{print $2}' | while read uslugaid; do curl 'http://169.254.80.82:8082/rest_api/v2/Usluga/' -d 'method1=objects.get&arg1={"id":'$uslugaid'}&method2=set&arg2={"nds":22}&method3=save&arg3={}'; 'method1=objects.get&arg1={"id":'$uslugaid'}&method2=set&arg2={"nds":12}&method3=save&arg3={}'; done{code}

Установить НДС 22% во всех папках и не удаленных абонентах:
{code}sqlexec "set list; select id from abonents where deleted=0" | awk '$2{print $2}' | while read abonid; do curl 'http://169.254.80.82:8082/rest_api/v2/Abonents/' -d 'method1=objects.get&arg1={"id":'$abonid'}&method2=set&arg2={"nds":22}&method3=save&arg3={}'; 'method1=objects.get&arg1={"id":'$abonid'}&method2=set&arg2={"nds":12}&method3=save&arg3={}'; done{code}
{info}Если нужно установить НДС так же абонентам находящимся в корзине, уберите из *sqlexec* условие *where deleted=0*{info}

Например, если Вы указывали НДС 20%, установить новое значение 22% можно следующими скриптами:

{code}sqlexec "set list; select id from usluga where nds=20" nds=6" | awk '$2{print $2}' | while read uslugaid; do curl 'http://169.254.80.82:8082/rest_api/v2/Usluga/' -d 'method1=objects.get&arg1={"id":'$uslugaid'}&method2=set&arg2={"nds":22}&method3=save&arg3={}'; 'method1=objects.get&arg1={"id":'$uslugaid'}&method2=set&arg2={"nds":12}&method3=save&arg3={}'; done{code}

{code}sqlexec "set list; select id from abonents where nds=20" nds=6" | awk '$2{print $2}' | while read abonid; do curl 'http://169.254.80.82:8082/rest_api/v2/Abonents/' -d 'method1=objects.get&arg1={"id":'$abonid'}&method2=set&arg2={"nds":22}&method3=save&arg3={}'; 'method1=objects.get&arg1={"id":'$abonid'}&method2=set&arg2={"nds":12}&method3=save&arg3={}'; done{code}

h1. Константы для ставок НДС: