dump add selling
This commit is contained in:
parent
3642e128f9
commit
0d750d6b7c
|
@ -31,13 +31,27 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
<h3>Total: <strong>{{ CurrentSellingTotal() }}€</strong></h3>
|
<div class="row">
|
||||||
<input type="number" id="paid_amount" ng-model="paidAmount">
|
<div class="col-xs-6">
|
||||||
<div class="alert alert-success" ng-if="CurrentSellingTotal() - paidAmount <=0">
|
<h3>Total: </h3>
|
||||||
<h3>Rendu: {{ CurrentSellingTotal() - paidAmount }}€</h3>
|
</div>
|
||||||
|
<div class="col-xs-6">
|
||||||
|
<strong>{{ CurrentSellingTotal() }}€</strong>
|
||||||
</div>
|
</div>
|
||||||
<div class="alert alert-warning" ng-if="CurrentSellingTotal() - paidAmount >0">
|
</div>
|
||||||
<h3>il manque: {{ CurrentSellingTotal() - paidAmount }}€</h3>
|
<div class="row">
|
||||||
|
<div class="col-xs-6">
|
||||||
|
Le client paie:
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-6">
|
||||||
|
<input type="number" id="paid_amount" ng-model="paidAmount">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="alert alert-success" ng-if="paidAmount && CurrentSellingTotal() - paidAmount <=0">
|
||||||
|
<h3>Rendu: {{ -1*(CurrentSellingTotal() - paidAmount) }} €</h3>
|
||||||
|
</div>
|
||||||
|
<div class="alert alert-warning" ng-if="paidAmount && CurrentSellingTotal() - paidAmount >0">
|
||||||
|
<h3>il manque: {{ CurrentSellingTotal() - paidAmount }} €</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
|
@ -68,19 +68,24 @@ angular
|
||||||
$scope.pausedSelling.splice(index, 1);
|
$scope.pausedSelling.splice(index, 1);
|
||||||
};
|
};
|
||||||
$scope.clearCurrentSelling = function () {
|
$scope.clearCurrentSelling = function () {
|
||||||
|
$scope.paidAmount = 0;
|
||||||
$scope.commentaire = "";
|
$scope.commentaire = "";
|
||||||
$scope.activeSelling = [];
|
$scope.activeSelling = [];
|
||||||
};
|
};
|
||||||
$scope.sendForm = function () {
|
$scope.sendForm = function () {
|
||||||
let lesParams = {
|
let lesParams = {
|
||||||
|
paidByClient : $scope.paidAmount,
|
||||||
sellingComment: $scope.commentaire,
|
sellingComment: $scope.commentaire,
|
||||||
activeSelling : $scope.activeSelling,
|
activeSelling : $scope.activeSelling,
|
||||||
activeFestival: $scope.activeFestival
|
activeFestival: $scope.activeFestival
|
||||||
};
|
};
|
||||||
$http({
|
$http({
|
||||||
method: 'POST',
|
method : 'POST',
|
||||||
url : '/add-selling',
|
url : 'add-selling',
|
||||||
data : lesParams // pass in data as strings
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
data : lesParams // pass in data as strings
|
||||||
}).then(function (rep) {
|
}).then(function (rep) {
|
||||||
console.log(rep);
|
console.log(rep);
|
||||||
if (!rep.success) {
|
if (!rep.success) {
|
||||||
|
|
|
@ -124,6 +124,18 @@ class DefaultController extends Controller {
|
||||||
// setup dates
|
// setup dates
|
||||||
// persist all
|
// persist all
|
||||||
// fetch back history of selling
|
// fetch back history of selling
|
||||||
return new JsonResponse( [ "message" => "ok", "dump" => $request->request ] );
|
echo "<pre>";
|
||||||
|
var_dump( $_POST );
|
||||||
|
|
||||||
|
echo "</pre>";
|
||||||
|
|
||||||
|
return var_dump( $request->request );
|
||||||
|
// return new JsonResponse( [
|
||||||
|
// "message" => "ok",
|
||||||
|
// "recent_sellings" => [],
|
||||||
|
// "dump" => $request->request->get( 'sellingComment' ),
|
||||||
|
// "dump2" => $request->getMethod(),
|
||||||
|
// "dump3" => $request->request->get( 'data' ),
|
||||||
|
// ] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,9 +32,14 @@ class SellRecord {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* total
|
* total
|
||||||
* @ORM\Column(type="decimal", scale=2, nullable=true)
|
* @ORM\Column(type="decimal", scale=2, nullable=false)
|
||||||
*/
|
*/
|
||||||
private $amount;
|
private $amount;
|
||||||
|
/**
|
||||||
|
* amount paid by client
|
||||||
|
* @ORM\Column(type="decimal", scale=2, nullable=true)
|
||||||
|
*/
|
||||||
|
private $paidByClient;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var
|
* @var
|
||||||
|
@ -49,6 +54,20 @@ class SellRecord {
|
||||||
private $user;
|
private $user;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function getPaidByClient() {
|
||||||
|
return $this->paidByClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mixed $paidByClient
|
||||||
|
*/
|
||||||
|
public function setPaidByClient( $paidByClient ) {
|
||||||
|
$this->paidByClient = $paidByClient;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue