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:
parent
fa88c74d23
commit
5a4f705c8b
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user