1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

working on the bot

This commit is contained in:
Hillel Coren 2016-08-09 17:14:26 +03:00
parent fa88c74d23
commit 5a4f705c8b
4 changed files with 9 additions and 3 deletions

View File

@ -11,7 +11,8 @@ class BotController extends Controller
public function handleMessage($platform)
{
$to = '29:1C-OsU7OWBEDOYJhQUsDkYHmycOwOq9QOg5FVTwRX9ts';
$message = 'add 8 tickets';
//$message = 'create a new invoice for Jenifer Altenwerth ';
$message = 'add 2 items';
//$message = view('bots.skype.message', ['message' => $message])->render();
//return $this->sendResponse($to, $message);
@ -77,7 +78,7 @@ class BotController extends Controller
$data = file_get_contents($url);
$data = json_decode($data);
var_dump($data->compositeEntities);
var_dump($data);
return $data;
}

View File

@ -101,6 +101,10 @@ class BaseIntent
$invoiceItems = [];
if ( ! isset($this->data->compositeEntities) || ! count($this->data->compositeEntities)) {
return [];
}
foreach ($this->data->compositeEntities as $entity) {
if ($entity->parentType == 'InvoiceItem') {
$product = false;

View File

@ -32,7 +32,7 @@ class CreateInvoiceItemsIntent extends BaseIntent
return $item['public_id'];
}, $invoiceItems);
$this->setState(ENTITY_INVOICE_ITEM, [$invoiceItemId]);
$this->setState(ENTITY_INVOICE_ITEM, $invoiceItemIds);
return view('bots.skype.invoice', [
'invoice' => $invoice

View File

@ -262,6 +262,7 @@ class InvoiceRepository extends BaseRepository
if ($invoice) {
// do nothing
$entityType = $invoice->getEntityType();
} elseif ($isNew) {
$entityType = ENTITY_INVOICE;
if (isset($data['is_recurring']) && filter_var($data['is_recurring'], FILTER_VALIDATE_BOOLEAN)) {