mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
working on the bot
This commit is contained in:
parent
fa88c74d23
commit
5a4f705c8b
@ -11,7 +11,8 @@ class BotController extends Controller
|
|||||||
public function handleMessage($platform)
|
public function handleMessage($platform)
|
||||||
{
|
{
|
||||||
$to = '29:1C-OsU7OWBEDOYJhQUsDkYHmycOwOq9QOg5FVTwRX9ts';
|
$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();
|
//$message = view('bots.skype.message', ['message' => $message])->render();
|
||||||
//return $this->sendResponse($to, $message);
|
//return $this->sendResponse($to, $message);
|
||||||
|
|
||||||
@ -77,7 +78,7 @@ class BotController extends Controller
|
|||||||
$data = file_get_contents($url);
|
$data = file_get_contents($url);
|
||||||
$data = json_decode($data);
|
$data = json_decode($data);
|
||||||
|
|
||||||
var_dump($data->compositeEntities);
|
var_dump($data);
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
@ -101,6 +101,10 @@ class BaseIntent
|
|||||||
|
|
||||||
$invoiceItems = [];
|
$invoiceItems = [];
|
||||||
|
|
||||||
|
if ( ! isset($this->data->compositeEntities) || ! count($this->data->compositeEntities)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($this->data->compositeEntities as $entity) {
|
foreach ($this->data->compositeEntities as $entity) {
|
||||||
if ($entity->parentType == 'InvoiceItem') {
|
if ($entity->parentType == 'InvoiceItem') {
|
||||||
$product = false;
|
$product = false;
|
||||||
|
@ -32,7 +32,7 @@ class CreateInvoiceItemsIntent extends BaseIntent
|
|||||||
return $item['public_id'];
|
return $item['public_id'];
|
||||||
}, $invoiceItems);
|
}, $invoiceItems);
|
||||||
|
|
||||||
$this->setState(ENTITY_INVOICE_ITEM, [$invoiceItemId]);
|
$this->setState(ENTITY_INVOICE_ITEM, $invoiceItemIds);
|
||||||
|
|
||||||
return view('bots.skype.invoice', [
|
return view('bots.skype.invoice', [
|
||||||
'invoice' => $invoice
|
'invoice' => $invoice
|
||||||
|
@ -262,6 +262,7 @@ class InvoiceRepository extends BaseRepository
|
|||||||
|
|
||||||
if ($invoice) {
|
if ($invoice) {
|
||||||
// do nothing
|
// do nothing
|
||||||
|
$entityType = $invoice->getEntityType();
|
||||||
} elseif ($isNew) {
|
} elseif ($isNew) {
|
||||||
$entityType = ENTITY_INVOICE;
|
$entityType = ENTITY_INVOICE;
|
||||||
if (isset($data['is_recurring']) && filter_var($data['is_recurring'], FILTER_VALIDATE_BOOLEAN)) {
|
if (isset($data['is_recurring']) && filter_var($data['is_recurring'], FILTER_VALIDATE_BOOLEAN)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user