mirror of
https://github.com/Karaka-Management/oms-Billing.git
synced 2026-02-06 11:38:41 +00:00
fix login bugs
This commit is contained in:
parent
293a3e060a
commit
2adbdc8765
|
|
@ -154,6 +154,16 @@ final class ApiBillController extends Controller
|
|||
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Bill', 'Bill successfully created.', $bill);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new database entry for a Bill object and update its bill number
|
||||
*
|
||||
* @param Bill $bill The Bill object to create a database entry for and update its bill number
|
||||
* @param RequestAbstract $request The request object that contains the header account and origin
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function createBillDatabaseEntry(Bill $bill, RequestAbstract $request) : void
|
||||
{
|
||||
$this->createModel($request->header->account, $bill, BillMapper::class, 'bill', $request->getOrigin());
|
||||
|
|
@ -163,6 +173,22 @@ final class ApiBillController extends Controller
|
|||
$this->updateModel($request->header->account, $bill, $new, BillMapper::class, 'bill', $request->getOrigin());
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a base Bill object with default values
|
||||
*
|
||||
* @param Client $client The client object for whom the bill is being created
|
||||
* @param RequestAbstract $request The request object that contains the header account
|
||||
*
|
||||
* @return Bill The new Bill object with default values
|
||||
*
|
||||
* @todo Validate VAT before creation
|
||||
* @todo Set the correct date of payment
|
||||
* @todo Use bill and shipping address instead of main address if available
|
||||
* @todo Implement allowed invoice languages and a default invoice language if none match
|
||||
* @todo Implement client invoice language (allowing for different invoice languages than invoice address)
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function createBaseBill(Client $client, RequestAbstract $request) : Bill
|
||||
{
|
||||
// @todo: validate vat before creation
|
||||
|
|
@ -177,7 +203,7 @@ final class ApiBillController extends Controller
|
|||
|
||||
$bill->payment = 0;
|
||||
$bill->paymentText = '';
|
||||
|
||||
|
||||
// @todo: use bill and shipping address instead of main address if available
|
||||
$bill->client = $client;
|
||||
$bill->billTo = $client->account->name1;
|
||||
|
|
@ -192,7 +218,7 @@ final class ApiBillController extends Controller
|
|||
// @todo implement client invoice langage (this would allow invoice langauges which are different from the invoice address)
|
||||
$bill->setLanguage(
|
||||
!\in_array(
|
||||
$client->mainAddress->getCountry(),
|
||||
$client->mainAddress->getCountry(),
|
||||
[ISO3166TwoEnum::_DEU, ISO3166TwoEnum::_AUT]
|
||||
)
|
||||
? ISO639x1Enum::_EN
|
||||
|
|
|
|||
|
|
@ -105,6 +105,16 @@ final class ApiTaxController extends Controller
|
|||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the client's tax code based on their country and tax office address
|
||||
*
|
||||
* @param Client $client The client to get the tax code for
|
||||
* @param Address $taxOfficeAddress The tax office address used to determine the tax code
|
||||
*
|
||||
* @return ClientAttributeValue The client's tax code
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getClientTaxCode(Client $client, Address $taxOfficeAddress) : ClientAttributeValue
|
||||
{
|
||||
/** @var \Modules\ClientManagement\Models\ClientAttributeType $codes */
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ use Modules\Billing\Models\BillMapper;
|
|||
use Modules\Billing\Models\BillTypeMapper;
|
||||
use Modules\Billing\Models\NullBillType;
|
||||
use Modules\Billing\Models\SettingsEnum;
|
||||
use Modules\Payment\Models\PaymentType;
|
||||
use Modules\SupplierManagement\Models\NullSupplier;
|
||||
use Modules\SupplierManagement\Models\Supplier;
|
||||
use Modules\SupplierManagement\Models\SupplierMapper;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user